Browse Source

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

zhouj1203@hotmail.com 4 years ago
parent
commit
657acf6eca

+ 4 - 4
TEAMModelOS/ClientApp/src/components/questionnaire/BaseJudge.vue

@@ -4,8 +4,8 @@
             <IconText :text="'题目'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
                 <div ref="singleEditor" style="text-align:left"></div>
         </div>
-        <div class="exersices-option">
-            <IconText :text="'单选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+        <div class="exersices-option"  style="margin-top:20px">
+            <IconText :text="'判断选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div v-if="options.length">
 				<div v-for="(item,index) in options" :key="index" class="option-editor-wrap" style="margin-top:10px;display:flex">
 					<span class="fl-center option-order">{{String.fromCharCode(64 + parseInt(index+1))}}</span>
@@ -200,7 +200,7 @@
             this.initEditors()
 			
 			if(this.editInfo && this.editInfo.question){
-				console.log('进入单选题Mounted编辑')
+				console.log('进入判断题Mounted编辑')
 				this.editSingleInfo = this.editInfo
 				this.stemContent = this.editSingleInfo.question
 				this.optionsContent = this.editSingleInfo.option
@@ -215,7 +215,7 @@
             editInfo: {
                 handler(newValue, oldValue) {
                     if (newValue) {
-                        console.log('单选接收到的数据')
+                        console.log('判断接收到的数据')
                         console.log(newValue)
                         this.editSingleInfo = newValue
                         if (Object.keys(newValue).length > 0) {

+ 6 - 6
TEAMModelOS/ClientApp/src/components/questionnaire/BaseMultiple.vue

@@ -4,8 +4,8 @@
             <IconText :text="'题目'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
                 <div ref="singleEditor" style="text-align:left"></div>
         </div>
-        <div class="exersices-option">
-            <IconText :text="'选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+        <div class="exersices-option" style="margin-top:20px">
+            <IconText :text="'选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div v-if="options.length">
 				<div v-for="(item,index) in options" :key="index" class="option-editor-wrap" style="margin-top:10px;display:flex">
 					<span class="fl-center option-order">{{String.fromCharCode(64 + parseInt(index+1))}}</span>
@@ -55,9 +55,8 @@
 				this.stemEditor.txt.clear()
 				// this.initEditors()
 				// this.stemContent = ''
-			},
+            },
             initEditors() {
-                // Editor默认配置
                 if (this.options.length > 0) {
                     this.options.forEach((item, i) => {
                         let that = this
@@ -149,6 +148,7 @@
                 if (this.options.length > 2) {
                     this.options.splice(index, 1)
                     this.optionsContent.splice(index, 1)
+                    console.log(this.$refs['singleOption' + index][0]);
                     // 如果删除了已有选项 后面的code要降1
                     for (let i in this.optionsContent) {
                         if (i >= index) {
@@ -200,7 +200,7 @@
             this.initEditors()
 			
 			if(this.editInfo && this.editInfo.question){
-				console.log('进入选题Mounted编辑')
+				console.log('进入选题Mounted编辑')
 				this.editSingleInfo = this.editInfo
 				this.stemContent = this.editSingleInfo.question
 				this.optionsContent = this.editSingleInfo.option
@@ -215,7 +215,7 @@
             editInfo: {
                 handler(newValue, oldValue) {
                     if (newValue) {
-                        console.log('选接收到的数据')
+                        console.log('选接收到的数据')
                         console.log(newValue)
                         this.editSingleInfo = newValue
                         if (Object.keys(newValue).length > 0) {

+ 1 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -326,7 +326,7 @@
 						this.editInfo = null
 					}
 				},
-				deep: true,
+				// deep: true,
 				// immediate:true
 			}
 		}

+ 2 - 2
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.vue

@@ -140,18 +140,18 @@
 				this.curItem = null
 				this.editIndex = null
 				this.addModal = true
+				this.$refs.addItem.resetContent()
 				// this.$refs.addItem.onAddNew()
 			},
 			
 			// 重置所有富文本编辑器内容 初始化
 			onModalChange(val){
-				if(!val) this.$refs.addItem.resetContent()
 			},
 			
 			// 确认添加题目
 			onConfirmAdd() {
 				let addItem = this.$refs.addItem
-				console.log('新增Ref的内容')
+				console.log('新增问卷试题内容')
 				console.log(addItem)
 				console.log(addItem.optionsContent.map(i => i.value))
 				// 判断获取到的新题是否规范

+ 11 - 5
TEAMModelOS/ClientApp/src/components/questionnaire/BaseSingle.vue

@@ -4,7 +4,7 @@
             <IconText :text="'题目'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
                 <div ref="singleEditor" style="text-align:left"></div>
         </div>
-        <div class="exersices-option">
+        <div class="exersices-option" style="margin-top:20px">
             <IconText :text="'单选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div v-if="options.length">
 				<div v-for="(item,index) in options" :key="index" class="option-editor-wrap" style="margin-top:10px;display:flex">
@@ -14,7 +14,7 @@
 					<span class="fl-center option-delete" @click="deleteOption(index)"><Icon type="md-close" /></span>
 				</div>
 			</div>
-            <p class="option-add"><span @click="addOption()">+ 添加选项 </span></p>
+            <p class="option-add"><span @click="addOption()"> + 添加选项 </span></p>
         </div>
     </div>
 </template>
@@ -147,18 +147,24 @@
             },
             // 删除选项
             deleteOption(index) {
+                console.log(this.options);
+                console.log(this.optionsContent.map(i => i.value));
+                let curEditor = this.optionEditors[index + 4]
                 if (this.options.length > 2) {
                     this.options.splice(index, 1)
                     this.optionsContent.splice(index, 1)
+                    
                     // 如果删除了已有选项 后面的code要降1
                     for (let i in this.optionsContent) {
                         if (i >= index) {
                             this.optionsContent[i].code = String.fromCharCode(64 + parseInt(parseInt(i) + 1))
                         }
                     }
-                    if (index < this.trueIndex) {
-                        this.trueIndex = this.trueIndex - 1
-                    }
+                    curEditor.txt.html(this.optionsContent[index].value)
+                    console.log('删除后');
+                    console.log(this.options);
+                    console.log(this.optionsContent.map(i => i.value));
+                    console.log(this.optionEditors);
                 } else {
                     this.$Message.warning('至少保留两个选项!')
                 }

+ 1 - 0
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -153,6 +153,7 @@
 					startTime: '',
 					description: '',
 					isReset: [],
+					progress:'pending',
 					other: []
 				}