Browse Source

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

liqk 4 years ago
parent
commit
bd08f75ed5

+ 10 - 5
TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue

@@ -1,7 +1,8 @@
 <template>
 	<div id="baseCanvas" @mouseover="mouseOver" @mouseleave="mouseLeave">
 		<!-- <BaseCanvas class="sign-canvas" ref="SignCanvas" :options="options"/> -->
-		<BaseKonvaCanvas class="sign-canvas" ref="SignCanvas" status="line"/>
+		<!-- <BaseCanvas class="sign-canvas" ref="SignCanvas" :options="options" :status="curMode"/> -->
+		<BaseKonva class="sign-canvas" ref="SignCanvas" :options="options"/>
 		<div class="canvas-tools animated fadeIn" ref="canvasTools">
 			<span :class="['canvas-tools-item',curMode === 'move' ? 'tools-active' : '']" @click="doMove()" style="border-radius: 15px 0 0 0;">
 				<Icon custom="iconfont icon-left-arrow" size="20"/>
@@ -56,11 +57,10 @@
 	</div>
 </template>
 <script>
-	import BaseCanvas from './BaseCanvas.vue';
-	import BaseKonvaCanvas from '@/view/task/mark/MarkCanvas.vue'
+	import BaseCanvas from '@/view/task/mark/MarkCanvas.vue';
 	export default {
 		components: {
-			BaseCanvas,BaseKonvaCanvas
+			BaseCanvas
 		},
 		props: {
 			vm:{
@@ -95,6 +95,8 @@
 				activeColor: 'black',
 				curMode:'paint',
 				options: {
+					width: 1200,         //画布宽度
+					height: 480, 
 					textColor:'red',
 					textSize:16,
 					isDpr: false, //是否使用dpr兼容高分屏 [Boolean] 可选
@@ -109,6 +111,8 @@
 					borderWidth: 2, // 网格线宽度  [Number] 可选
 					borderColor: "#7c7c7c", //网格颜色  [String] 可选
 					writeWidth: 5, //基础轨迹宽度  [Number] 可选
+					lineColor: 'red', // 轨迹颜色  [String] 可选
+					lineWidth: 5, //基础轨迹宽度  [Number] 可选
 					writeColor: 'red', // 轨迹颜色  [String] 可选
 					isSign: true, //签名模式 [Boolean] 默认为非签名模式,有线框, 当设置为true的时候没有任何线框
 					imgType: 'png' //下载的图片格式  [String] 可选为 jpeg  canvas本是透明背景的
@@ -139,7 +143,7 @@
 			},
 			
 			doPaint(){
-				this.curMode = 'paint'
+				this.curMode = 'line'
 				this.$refs.SignCanvas.mode = 'paint'
 			},
 			
@@ -163,6 +167,7 @@
 			},
 
 			onSelectWriteWidth(val) {
+				this.options.lineWidth = val
 				this.options.writeWidth = val
 				this.activeDot = val
 			},

+ 4 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/evaluation.js

@@ -1,4 +1,8 @@
 export default {
+	editor:{
+		uploadVideo:'上传本地视频',
+		uploadAudio:'上传本地音频'
+	}, 
     index:{
 		item:'试题',
 		paper:'试卷',

+ 40 - 36
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/evaluation.js

@@ -1,4 +1,8 @@
 export default {
+	editor: {
+		uploadVideo: '上傳本地視頻',
+		uploadAudio: '上傳本地音訊'
+	},
 	index: {
 		item: '試題',
 		paper: '試卷',
@@ -65,8 +69,8 @@ export default {
 	deleteFail: '刪除失敗',
 	editSuc: '修改成功',
 	backToTop: '跳回頂端',
-	cancelSuc:'取消成功',
-	addSuc:'新增成功',
+	cancelSuc: '取消成功',
+	addSuc: '新增成功',
 	newExercise: {
 		newSchoolItem: '新建學校題目',
 		newPrivateItem: '新建個人題目',
@@ -178,7 +182,7 @@ export default {
 		paperDetails: '試卷詳情',
 		paperAnalysis: '試卷分析',
 		setPaperScore: '設定試卷總分',
-		goAnswerSheet:'預覽答題卡'
+		goAnswerSheet: '預覽答題卡'
 	},
 	importFile: {
 		uploadSuc: '試卷檔案上傳解析成功!',
@@ -212,11 +216,11 @@ export default {
 		spc: '道',
 		goDetails: '查看詳情',
 		noOriginTips: '請先選擇題目來源',
-		tip1:'第',
-		tip2:'題綜合題的配分',
-		tip3:'不足',
-		tip4:'溢出',
-		tip5:'請檢查後重試!'
+		tip1: '第',
+		tip2: '題綜合題的配分',
+		tip3: '不足',
+		tip4: '溢出',
+		tip5: '請檢查後重試!'
 	},
 	points: {
 		addPoint: '新增知識點',
@@ -237,34 +241,34 @@ export default {
 		diffPie: '試卷難度分佈圖',
 		objectivePie: '試卷主客觀題目分佈圖'
 	},
-	getEmptyItems:'拿不到試題',
-	child:'小題',
-	typePieTitle:'題型分佈圖',
-	reImport:'重新匯入',
-	continueImport:'繼續預覽',
-	imgError:'圖片異常提醒',
-	imgErr1:'解析資料存在以下',
-	imgErr2:'處圖片異常,請選擇',
-	imgErr3:'忽略並繼續預覽',
-	imgErr4:'還是',
-	imgErr5:'修改後重新匯入試卷',
-	reImportTip:'請重新匯入正確格式的試卷!',
-	type1:'主觀題',
-	type2:'客觀題',
-	repairResourse:{
-	description:'資源描述',
-	link:'資源連結網址',
-	edit:'編輯',
-	deleteResource:'刪除',
-	addRepair:'增加補救資源',
-	type:'資源類型',
-	place1:'請輸入資源描述',
-	tip1:'(輸入後按Enter即可新增成功)',
-	place2:'請輸入資源網址,按Enter即可新增',
-	confirm:'確認',
-	isExistTip:'已存在相同連結網址!',
-	formatErrorTip:'請輸入正確格式的網址!',
-	noCompleteTip:'請填寫完整',
+	getEmptyItems: '拿不到試題',
+	child: '小題',
+	typePieTitle: '題型分佈圖',
+	reImport: '重新匯入',
+	continueImport: '繼續預覽',
+	imgError: '圖片異常提醒',
+	imgErr1: '解析資料存在以下',
+	imgErr2: '處圖片異常,請選擇',
+	imgErr3: '忽略並繼續預覽',
+	imgErr4: '還是',
+	imgErr5: '修改後重新匯入試卷',
+	reImportTip: '請重新匯入正確格式的試卷!',
+	type1: '主觀題',
+	type2: '客觀題',
+	repairResourse: {
+		description: '資源描述',
+		link: '資源連結網址',
+		edit: '編輯',
+		deleteResource: '刪除',
+		addRepair: '增加補救資源',
+		type: '資源類型',
+		place1: '請輸入資源描述',
+		tip1: '(輸入後按Enter即可新增成功)',
+		place2: '請輸入資源網址,按Enter即可新增',
+		confirm: '確認',
+		isExistTip: '已存在相同連結網址!',
+		formatErrorTip: '請輸入正確格式的網址!',
+		noCompleteTip: '請填寫完整',
 	},
 	completeCount: '填空數量',
 	addTip1: '當前配分超過試卷總分,請重新分配!',

+ 2 - 2
TEAMModelOS/ClientApp/src/utils/editorTools.js

@@ -119,7 +119,7 @@ export default {
 				const upFileId = 'upFileId' + Math.random().toString().slice(2);
 				var tabsConf = {
 					// tab 的标题
-					title: editor.i18next.t("menus.panelMenus.video.上传本地视频 "),
+					title: app.$t('evaluation.editor.uploadVideo'),
 					// 模板
 					tpl: '<div class="w-e-up-img-container">\n <div id="' + inputIFrameId +
 						'" class="w-e-up-btn">\n<i class="w-e-icon-upload2"></i>\n</div>\n <div style="display:none;">\n<input id="' +
@@ -240,7 +240,7 @@ export default {
 				const upFileId = 'upFileId' + Math.random().toString().slice(2);
 				var tabsConf = {
 					// tab 的标题
-					title: editor.i18next.t("menus.panelMenus.video.上传本地音频 "),
+					title: app.$t('evaluation.editor.uploadAudio'),
 					// 模板
 					tpl: '<div class="w-e-up-img-container">\n <div id="' + inputIFrameId +
 						'" class="w-e-up-btn">\n<i class="w-e-icon-upload2"></i>\n</div>\n <div style="display:none;">\n<input id="' +

+ 24 - 22
TEAMModelOS/ClientApp/src/view/task/mark/MarkCanvas.vue

@@ -588,28 +588,30 @@ export default {
     },
     mounted() {
         let _this = this
-
-        //创建画布
-        _this.stage = new Konva.Stage({
-            container: 'container',
-            id: 'canvas',
-            width: this.options.width,
-            height: this.options.height
-        })
-        _this.orgLayer = new Konva.Layer()
-        _this.markLayer = new Konva.Layer()
-        _this.stage.add(_this.orgLayer)
-        _this.stage.add(_this.markLayer)
-        _this.orgLayer.batchDraw()
-        _this.bundleScoll()
-        _this.stage.on('click', (evt) => {
-            _this.tr.nodes([])
-        })
-        _this.stage.on('mouseover', (evt) => {
-            let nodes = _this.tr.nodes()
-            if (_this.mouseStatus == 'resize' && nodes.length == 0) _this.mouseStatus = _this.resizeBefore
-
-        })
+		_this.$nextTick(() => {
+			//创建画布
+			_this.stage = new Konva.Stage({
+			    container: 'container',
+			    id: 'canvas',
+			    width: this.options.width,
+			    height: this.options.height
+			})
+			_this.orgLayer = new Konva.Layer()
+			_this.markLayer = new Konva.Layer()
+			_this.stage.add(_this.orgLayer)
+			_this.stage.add(_this.markLayer)
+			_this.orgLayer.batchDraw()
+			_this.bundleScoll()
+			_this.stage.on('click', (evt) => {
+			    _this.tr.nodes([])
+			})
+			_this.stage.on('mouseover', (evt) => {
+			    let nodes = _this.tr.nodes()
+			    if (_this.mouseStatus == 'resize' && nodes.length == 0) _this.mouseStatus = _this.resizeBefore
+			
+			})
+		}) 
+        
 
         this.tr = new Konva.Transformer({
             rotateEnabled: false,