Bladeren bron

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

zhouj1203@hotmail.com 4 jaren geleden
bovenliggende
commit
99595b66ad

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

@@ -278,7 +278,6 @@ export default {
 	
 	/* 添加自定义本地音频上传功能 */
 	addCanvas(vm, editor) {
-		console.log(vm)
 		// 获取必要的变量,这些在下文中都会用到
 		const {
 			$,
@@ -296,7 +295,6 @@ export default {
 			}
 	
 			clickHandler() {
-				console.log(Modal)
 				// Modal.props.fullscreen.default = true
 				Modal.info({
 					width:1300,
@@ -352,4 +350,28 @@ export default {
 		// 也可以通过配置 menus 调整菜单的顺序,参考【配置菜单】部分的文档
 		editor.config.menus = editor.config.menus.concat(canvasDraw);
 	},
+	
+	/* 获取富文本的资源src数据 */
+	getRichTextSrc(richtext) {
+	    let imgList = [];
+	    richtext.replace(/<img [^>]*height=['"]([^'"]+)[^>]*>/g, (match, capture) => {
+	          imgList.push(capture);
+	    });
+	    return imgList;
+	},
+	
+	transBase64Src(richTextArr){
+		var srcReg = /<img [^>]*src=['"]([^'"]+)[^>]*>/g;
+		var heightReg = /<img [^>]*height=['"]([^'"]+)[^>]*>/g;
+		var widthReg = /<img [^>]*width=['"]([^'"]+)[^>]*>/g;
+		var imgReg = /<img [^>]*src=['"]([^'"]+)[^>]*>/gi;
+		let imgList = [];
+		richTextArr.forEach(item => {
+			item.replace(srcReg, (match, capture) => {
+			      imgList.push(capture);
+			});
+		})
+		
+		console.log(imgList)
+	}
 }

+ 6 - 4
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue

@@ -267,18 +267,20 @@
 						exerciseItem.answer = [this.$refs.judge._data.trueAnswer];
 						break;
 					case "complete":
-						exerciseItem.question = this.$refs.complete._data.stemContent;
+						exerciseItem.question = this.$refs.complete.stemContent;
 						exerciseItem.option = [];
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
-						exerciseItem.answer = this.$refs.complete._data.answerContent;
+						exerciseItem.explain = this.analysisContent;
+						exerciseItem.answer = [this.$refs.complete.answerContent];
 						break;
 					case "subjective":
-						exerciseItem.question = this.$refs.subjective._data.stemContent;
+						exerciseItem.question = this.$refs.subjective.stemContent;
 						exerciseItem.option = [];
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
-						exerciseItem.answer = this.$refs.subjective._data.answerContent;
+						exerciseItem.explain = this.analysisContent;
+						exerciseItem.answer = [this.$refs.subjective.answerContent];
 						break;
 					case "compose":
 						exerciseItem.question = this.$refs.compose.stemContent;

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.less

@@ -41,7 +41,7 @@
 }
 
     .exersices-attr .ivu-select-selection {
-        width:300px;
+        max-width:300px;
         margin-top:20px;
         min-height:40px;
     }

+ 3 - 0
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -577,6 +577,8 @@
 				let whiteList = this.getWhiteListByType(Obj.type);
 				console.log("验证的");
 				console.log(Obj);
+				// this.$editorTools.transBase64Src([Obj.question])
+				// return
 				for (let key in Obj) {
 					if (whiteList.includes(key) && typeof Obj[key] === "string") {
 						if (!this.getSimpleText(Obj[key])) {
@@ -642,6 +644,7 @@
 			},
 			this.$editorTools.addVideoUpload(this, analysisEditor)
 			this.$editorTools.addAudio(this, analysisEditor)
+			this.$editorTools.addCanvas(this, analysisEditor)
 			this.$editorTools.initMyEditor(analysisEditor)
 			analysisEditor.create();
 			this.analysisEditor = analysisEditor;

+ 2 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue

@@ -47,6 +47,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 			
 			stemEditor.create()
@@ -58,6 +59,7 @@
 			answerEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, answerEditor)
 			this.$editorTools.addAudio(this, answerEditor)
+			this.$editorTools.addCanvas(this, answerEditor)
 			this.$editorTools.initMyEditor(answerEditor)
 			
 			answerEditor.create()

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue

@@ -37,6 +37,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 			stemEditor.create()
 			this.stemEditor = stemEditor

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue

@@ -45,6 +45,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 			
 			stemEditor.create()

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -289,6 +289,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 			stemEditor.create()
 			this.stemEditor = stemEditor

+ 2 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -67,6 +67,7 @@
 						}
 
 						this.$editorTools.addAudio(this, editor)
+						this.$editorTools.addCanvas(this, editor)
 						this.$editorTools.initMyEditor(editor)
 
 						// 选项编辑器内容发生变化时
@@ -111,6 +112,7 @@
 						let editor = new E(that.$refs['singleOption' + newIndex][0])
 						this.$editorTools.addAudio(this, editor)
 						this.$editorTools.initMyEditor(editor)
+						this.$editorTools.addCanvas(this, editor)
 						editor.config.onchange = (html) => {
 							let key = String.fromCharCode(64 + parseInt(newIndex + 1))
 							let codeArr = this.optionsContent.map(item => item.code)

+ 2 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue

@@ -47,6 +47,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 			
 			stemEditor.create()
@@ -58,6 +59,7 @@
 			answerEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, answerEditor)
 			this.$editorTools.addAudio(this, answerEditor)
+			this.$editorTools.addCanvas(this, answerEditor)
 			this.$editorTools.initMyEditor(answerEditor)
 			
 			answerEditor.create()