SanHQin 5 mesi fa
parent
commit
b8c23fe679

+ 201 - 0
src/components/pages/test/add/components/addCheckPopover.vue

@@ -0,0 +1,201 @@
+<template>
+  <div>
+    <el-popover
+      placement="bottom-start"
+      width="400"
+      trigger="click"
+      v-model="show"
+    >
+      <div class="addBox">
+        <div class="ab_base">
+          <div class="ab_title">基础题型</div>
+          <div class="ab_list">
+            <div
+              class="ab_l_item"
+              v-for="(item, index) in options"
+              :key="`base_${index}`"
+            >
+              <button
+                class="pub_test_btn"
+                @click="addCheckBase(item, index)"
+                :class="{
+                  pub_test_btn_text: item.value == 3,
+                  pub_test_btn_choose: item.value == 1 || item.value == 10,
+                  pub_test_btn_file: item.value == 5,
+                  pub_test_btn_course: item.value == 6,
+                  pub_test_btn_eva: item.value == 7,
+                  pub_test_btn_time: item.value == 8,
+                  pub_test_btn_choose2: item.value == 9
+                }"
+              >
+                {{ item.label }}
+              </button>
+            </div>
+          </div>
+        </div>
+
+        <div class="ab_module">
+          <div class="ab_title">平台组件</div>
+          <div class="ab_list">
+            <div
+              class="ab_l_item"
+              v-for="(item, index) in optionsPin"
+              :key="`module_${index}`"
+            >
+              <button
+                class="pub_test_btn"
+                @click="addCheckModule(item, index)"
+                :class="{
+                  pub_test_btn_course: item.value == 6 || item.value == 11
+                }"
+              >
+                {{ item.label }}
+              </button>
+            </div>
+          </div>
+        </div>
+
+        <div class="ab_addModule">
+          <div class="ab_title">添加组件</div>
+          <div class="ab_list">
+            <div
+              class="ab_l_item"
+              v-for="(item, index) in buttonOptions"
+              :key="`addModule_${index}`"
+            >
+              <button
+                class="pub_test_btn"
+                @click="addCheckAddModule(item, index)"
+                :class="{
+                  pub_test_btn_group: item.type == 1,
+                  pub_test_btn_page: item.type == 2
+                }"
+              >
+                {{ item.name }}
+              </button>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="addBtn" slot="reference">
+        <svg
+          width="16"
+          height="16"
+          viewBox="0 0 16 16"
+          fill="none"
+          xmlns="http://www.w3.org/2000/svg"
+        >
+          <path
+            d="M7.11133 2.66675H8.88911V13.3334H7.11133V2.66675Z"
+            fill="black"
+            fill-opacity="0.6"
+          />
+          <path
+            d="M13.3332 7.11108V8.88886H2.6665V7.11108H13.3332Z"
+            fill="black"
+            fill-opacity="0.6"
+          />
+        </svg>
+        插入题目
+      </div>
+      <!-- <el-button type="primary" size="small" slot="reference"
+        >添加题目</el-button
+      > -->
+    </el-popover>
+  </div>
+</template>
+
+<script>
+import minxinVue from "../minxins/minxin";
+export default {
+  mixins: [minxinVue],
+  data() {
+    return {
+      show: false
+    };
+  },
+  methods: {
+    addCheckBase(item, index) {
+      this.$emit("addCheck", item.value);
+      this.show = false;
+    },
+    addCheckModule(item, index) {
+      this.$emit("addCheck", item.value);
+      this.show = false;
+    },
+    addCheckAddModule(item, index) {
+      this.$emit("addQtype", item.type);
+      this.show = false;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.addBox {
+  width: 400px;
+  height: auto;
+  box-sizing: border-box;
+  padding: 20px;
+}
+
+.addBox > div {
+  width: 100%;
+  height: auto;
+  margin-bottom: 20px;
+}
+
+.ab_title {
+  width: 100%;
+  margin-bottom: 5px;
+  position: relative;
+  margin-left: 10px;
+  font-size: 18px;
+  font-weight: bold;
+  /* margin */
+}
+
+.ab_title::before {
+  content: "";
+  width: 10px;
+  height: 10px;
+  border-radius: 50%;
+  background-color: #3681fc;
+  position: absolute;
+  left: -15px;
+  top: 50%;
+  transform: translateY(-50%);
+}
+
+.ab_list {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.ab_l_item {
+  margin-bottom: 10px;
+}
+
+.addBtn{
+	width: 95px;
+	padding: 12px 0px;
+	display: flex;
+	align-items: center;
+	background-color: #F0F2F5;
+	border-radius: 5px;
+	color: #00000099;
+	font-size: 14px;
+	cursor: pointer;
+	transition: all 0.2s;
+	font-weight: bold;
+	justify-content: center;
+}
+
+.addBtn:hover{
+	background-color: #e0e0e0;
+}
+
+.addBtn>svg{
+	margin-right: 5px;
+}
+</style>

+ 36 - 2
src/components/pages/test/add/components/checkOrder.vue

@@ -3,6 +3,7 @@
         <div v-for="(item1, index1) in this.checkJson" :key="index1" class="mc_ti_1" :draggable="isdrag == `${index1}`"
             :class="{
 								active: checkC === `x${index1}`,
+								showCheckBox: checkC === `x${index1}` && etype==='edit',
                 dragOverTop: newIndex === index1 && typeIndex == 'drag-' + index1 && (oldIndex > index1 && (!(newIndex2 || newIndex2 === 0) || !(newIndex3 || newIndex3 === 0))),
                 dragOverBottom: newIndex === index1 && typeIndex == 'drag-' + index1 && (oldIndex < index1 || !(!(newIndex2 || newIndex2 === 0) || !(newIndex3 || newIndex3 === 0))),
             }" @click.stop="checkTitle(`${index1}`, 1, item1)" @dragstart="dragStart(item1, index1, `${index1}`)"
@@ -29,6 +30,7 @@
                 <div v-for="(item2, index2) in item1.array" :key="`${index1}-${index2}`" class="mc_ti_2"
                     :draggable="isdrag == `${index1}-${index2}`" :class="{
                         active: checkC === `x${index1}-${index2}`,
+												showCheckBox: checkC === `x${index1}-${index2}` && etype==='edit',
                         dragOverTop: newIndex === index1 && newIndex2 === index2 && typeIndex == 'drag2-' + index1 + '-' + index2 && (oldIndex2 > index2  && ( !(newIndex3 || newIndex3 === 0))),
                         dragOverBottom: newIndex === index1 && newIndex2 === index2 && typeIndex == 'drag2-' + index1 + '-' + index2 && (oldIndex2 < index2 || !( !(newIndex3 || newIndex3 === 0))),
                     }" @click.stop="checkTitle(`${index1}-${index2}`, 2, item2)"
@@ -54,6 +56,7 @@
                         <div v-for="(item3, index3) in item2.array" :key="`${index1}-${index2}-${index3}`" class="mc_ti_3"
                             :draggable="isdrag == `${index1}-${index2}-${index3}`" :class="{
                                 active: checkC === `x${index1}-${index2}-${index3}`,
+                                showCheckBox: checkC === `x${index1}-${index2}-${index3}` && etype==='edit',
                                 dragOverTop: newIndex === index1 && newIndex2 === index2 && newIndex3 === index3 && typeIndex == 'drag3-' + index1 + '-' + index2 + '-' + index3 && oldIndex3 > index3,
                                 dragOverBottom: newIndex === index1 && newIndex2 === index2 && newIndex3 === index3 && typeIndex == 'drag3-' + index1 + '-' + index2 + '-' + index3 && oldIndex3 < index3,
                             }" @click.stop="checkTitle(`${index1}-${index2}-${index3}`, 3, item3)"
@@ -118,6 +121,9 @@
                                     </courseDialog2>-->
                                 </div>
                             </div>
+														<div class="addCheckBox" v-if="checkC === `x${index1}-${index2}-${index3}` && etype==='edit'" @click.stop="">
+															<addCheckPopover @addCheck="addCheck" @addQtype="addQtype"/>
+														</div>
                         </div>
                     </div>
                     <div v-else-if="item2.ttype == 1 && canEdit.indexOf(item2.type) !== -1 && etype == 'edit'"
@@ -158,11 +164,15 @@
                                 @setJson="setJson"></courseDialog2> -->
                         </div>
                     </div>
+										<div class="addCheckBox" v-if="checkC === `x${index1}-${index2}` && etype==='edit'" @click.stop="">
+											<addCheckPopover @addCheck="addCheck" @addQtype="addQtype"/>
+										</div>
                 </div>
             </div>
             <div v-else-if="item1.ttype == 1 && canEdit.indexOf(item1.type) !== -1 && etype == 'edit'" class="edit_box">
                 <div v-if="item1.type == 1">
                     <choiceX :cJson="item1.json" @setJson="setJson" :index="`x${index1}`" :isOpen="item1.type == 1 && checkC === `x${index1}`"></choiceX>
+										
                     <!-- <choiceDialog v-if="item1.type == 1 && checkC === `x${index1}`" :cJson="cJson" @setJson="setJson">
                     </choiceDialog> -->
                 </div>
@@ -197,7 +207,10 @@
                     </courseDialog2> -->
                 </div>
             </div>
-        </div>
+						<div class="addCheckBox" v-if="checkC === `x${index1}` && etype==='edit'" @click.stop="">
+							<addCheckPopover @addCheck="addCheck" @addQtype="addQtype"/>
+						</div>
+					</div>
         <el-dialog title="修改名称" :visible.sync="groupDaliog" :append-to-body="true" width="500px"
             :before-close="handleClose" class="dialog_diy">
             <div style="
@@ -235,6 +248,7 @@ import timeDialog from './timeBox/index.vue'
 import timeX from './timeBox/time.vue'
 import courseDialog2 from './course2/index.vue'
 import courseX2 from './course2/course.vue'
+import addCheckPopover from './addCheckPopover.vue'
 export default {
     mixins: [minxinVue],
     components: {
@@ -251,7 +265,8 @@ export default {
         timeDialog,
         timeX,
         courseDialog2,
-        courseX2
+        courseX2,
+				addCheckPopover
     },
     props: {
         checkJson: {
@@ -660,6 +675,12 @@ export default {
             this.isdrag = "";
             this.$forceUpdate()
         },
+				addCheck(value){
+					this.$emit('addCheck',value)
+				},
+				addQtype(type){
+					this.$emit('addQtype',type)
+				}
     },
     mounted() {
         this.manualJson = this.depthCopy(this.checkJson);
@@ -882,6 +903,7 @@ export default {
     padding: 10px 0 0;
 }
 
+
 .dragOverTop {
     border-top: 2px solid #0061FF !important;
     border-radius: 0 !important;
@@ -927,4 +949,16 @@ export default {
 .active>>>.test_index{
 	color: #3681FC;
 }
+
+.showCheckBox{
+	position: relative;
+	margin-bottom: 60px;
+	overflow: visible;
+}
+
+.addCheckBox{
+	position: absolute;
+	bottom: -50px;
+	
+}
 </style>

+ 294 - 171
src/components/pages/test/add/edit/edit/index.vue

@@ -1,10 +1,28 @@
 <template>
   <div class="edit_box">
-    <div class="e_add" v-show="showLeftMenu">
+    <div class="e_add" v-show="showLeftMenu" v-if="false">
       <div class="title" style="margin-bottom: 20px">题目添加</div>
-			<span class="e_a_foldIcon" style="right: 0;" @click="showLeftMenu=false">
-				<svg t="1728443188732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5721" width="200" height="200"><path d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z" p-id="5722"></path></svg>
-			</span>
+      <span
+        class="e_a_foldIcon"
+        style="right: 0;"
+        @click="showLeftMenu = false"
+      >
+        <svg
+          t="1728443188732"
+          class="icon"
+          viewBox="0 0 1024 1024"
+          version="1.1"
+          xmlns="http://www.w3.org/2000/svg"
+          p-id="5721"
+          width="200"
+          height="200"
+        >
+          <path
+            d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z"
+            p-id="5722"
+          ></path>
+        </svg>
+      </span>
       <div class="e_add_box">
         <div class="title">基础题型</div>
         <div class="e_add_ci">
@@ -27,7 +45,7 @@
                   pub_test_btn_course: item.value == 6,
                   pub_test_btn_eva: item.value == 7,
                   pub_test_btn_time: item.value == 8,
-                  pub_test_btn_choose2: item.value == 9,
+                  pub_test_btn_choose2: item.value == 9
                 }"
               >
                 {{ item.label }}
@@ -49,7 +67,7 @@
               <button
                 class="pub_test_btn"
                 :class="{
-                  pub_test_btn_course: item.value == 6 || item.value == 11,
+                  pub_test_btn_course: item.value == 6 || item.value == 11
                 }"
               >
                 {{ item.label }}
@@ -74,7 +92,7 @@
                 class="pub_test_btn"
                 :class="{
                   pub_test_btn_group: item.type == 1,
-                  pub_test_btn_page: item.type == 2,
+                  pub_test_btn_page: item.type == 2
                 }"
               >
                 {{ item.name }}
@@ -85,23 +103,58 @@
       </div>
     </div>
 
-		<div class="e_viewFile" v-show="viewFile" :style="`margin-right:${!showLeftMenu?'20px':0};margin-left:${showLeftMenu?'20px':'0'}`">
-			<iframe
+    <div
+      class="e_viewFile"
+      v-show="viewFile"
+      :style="
+        `margin-right:${!showLeftMenu ? '20px' : 0};margin-left:${
+          showLeftMenu ? '20px' : '0'
+        }`
+      "
+    >
+      <iframe
         ref="viframe"
-				v-if="fileData && fileData.url"
+        v-if="fileData && fileData.url"
         style="width: 100%; height: 100%; border: none"
         :src="
           'https://view.officeapps.live.com/op/view.aspx?src=' +
             encodeURIComponent(fileData.url)
         "
       ></iframe>
-		</div>
+    </div>
 
-    <div class="e_content" :style="`margin-right:${showRightMenu?'20px':0};margin-left:${showLeftMenu?'20px':0};`">
-      <div v-if="!isEditing" class="title" @click="editTitle">{{ title ? title : '请填写表单标题' }}</div>
-      <input v-if="isEditing" class="titleInput" ref="title" v-model="titleValue" @blur="save" @keyup.enter="save" placeholder="请填写表单标题"/>
-      <div v-if="!isEditing2" class="detail" @click="editBref">{{ brief ? brief : '请填写表单说明' }}</div>
-      <input v-if="isEditing2" class="briefInput" ref="detail" v-model="briefValue" @blur="save2" @keyup.enter="save2" placeholder="请填写表单说明"/>
+    <div
+      class="e_content"
+      :style="
+        `margin-right:${showRightMenu ? '20px' : '0'	};margin-left:${
+          showLeftMenu ? '20px' : '0'
+        };`
+      "
+    >
+      <div v-if="!isEditing" class="title" @click="editTitle">
+        {{ title ? title : "请填写表单标题" }}
+      </div>
+      <input
+        v-if="isEditing"
+        class="titleInput"
+        ref="title"
+        v-model="titleValue"
+        @blur="save"
+        @keyup.enter="save"
+        placeholder="请填写表单标题"
+      />
+      <div v-if="!isEditing2" class="detail" @click="editBref">
+        {{ brief ? brief : "请填写表单说明" }}
+      </div>
+      <input
+        v-if="isEditing2"
+        class="briefInput"
+        ref="detail"
+        v-model="briefValue"
+        @blur="save2"
+        @keyup.enter="save2"
+        placeholder="请填写表单说明"
+      />
       <div class="e_order_box">
         <checkOrder
           :checkC.sync="checkC"
@@ -109,8 +162,12 @@
           @changeJson="changeJson"
           etype="edit"
           :cJson.sync="cJson"
+					@addCheck="addCheck"
+					@addQtype="addQtype"
         >
         </checkOrder>
+				<addCheckPopover v-if="manualJson.length==0" @addCheck="addCheck" @addQtype="addQtype"/>
+
       </div>
     </div>
     <div class="e_order" v-show="showRightMenu">
@@ -118,9 +175,27 @@
         题目排序
         <span style="font-size: 14px; color: #373737">总分:{{ score }}分</span>
       </div>
-			<span class="e_a_foldIcon" style="left: 0;transform: rotate(180deg);" @click="showRightMenu=false">
-				<svg t="1728443188732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5721" width="200" height="200"><path d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z" p-id="5722"></path></svg>
-			</span>
+      <span
+        class="e_a_foldIcon"
+        style="left: 0;transform: rotate(180deg);"
+        @click="showRightMenu = false"
+      >
+        <svg
+          t="1728443188732"
+          class="icon"
+          viewBox="0 0 1024 1024"
+          version="1.1"
+          xmlns="http://www.w3.org/2000/svg"
+          p-id="5721"
+          width="200"
+          height="200"
+        >
+          <path
+            d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z"
+            p-id="5722"
+          ></path>
+        </svg>
+      </span>
       <div class="e_order_box" style="margin-top: 20px">
         <checkOrder
           :checkC.sync="checkC"
@@ -133,42 +208,82 @@
       </div>
     </div>
 
-		<span class="e_outside_foldIcon" v-if="!showLeftMenu" style="left: 0;transform: rotate(180deg);" @click="showLeftMenu = true">
-			<svg t="1728443188732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5721" width="200" height="200"><path d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z" p-id="5722"></path></svg>
-		</span>
-
-		<span class="e_outside_foldIcon" v-if="!showRightMenu" style="right: 0;" @click="showRightMenu = true">
-			<svg t="1728443188732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5721" width="200" height="200"><path d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z" p-id="5722"></path></svg>
-		</span>
-</div>
+    <span
+      class="e_outside_foldIcon"
+      v-if="!showLeftMenu && false"
+      style="left: 0;transform: rotate(180deg);"
+      @click="showLeftMenu = true"
+    >
+      <svg
+        t="1728443188732"
+        class="icon"
+        viewBox="0 0 1024 1024"
+        version="1.1"
+        xmlns="http://www.w3.org/2000/svg"
+        p-id="5721"
+        width="200"
+        height="200"
+      >
+        <path
+          d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z"
+          p-id="5722"
+        ></path>
+      </svg>
+    </span>
+
+    <span
+      class="e_outside_foldIcon"
+      v-if="!showRightMenu"
+      style="right: 0;"
+      @click="showRightMenu = true"
+    >
+      <svg
+        t="1728443188732"
+        class="icon"
+        viewBox="0 0 1024 1024"
+        version="1.1"
+        xmlns="http://www.w3.org/2000/svg"
+        p-id="5721"
+        width="200"
+        height="200"
+      >
+        <path
+          d="M110.9 128.34a32 32 0 0 1 32-32h773a32 32 0 0 1 0 64h-773a32 32 0 0 1-32-32z m4.58 402.15L260 651.38c15.62 13.07 39.4 2 39.4-18.41V391.19c0-20.37-23.78-31.48-39.4-18.41L115.48 493.67a24 24 0 0 0 0 36.82z m800.41-50.41H405.54a32 32 0 1 0 0 64h510.35a32 32 0 0 0 0-64z m0 383.58h-773a32 32 0 1 0 0 64h773a32 32 0 0 0 0-64z"
+          p-id="5722"
+        ></path>
+      </svg>
+    </span>
+  </div>
 </template>
 
 <script>
 import checkOrder from "../../components/checkOrder.vue";
 import minxinVue from "../../minxins/minxin";
+import addCheckPopover from "../../../add/components/addCheckPopover.vue";
 export default {
   components: {
     checkOrder,
+    addCheckPopover
   },
   mixins: [minxinVue],
   props: {
     checkJson: {
-      type: Array,
+      type: Array
     },
     title: {
-      type: String,
+      type: String
     },
     brief: {
-      type: String,
+      type: String
+    },
+    viewFile: {
+      type: Boolean,
+      default: false
     },
-		viewFile:{
-			type:Boolean,
-			default:false,
-		},
-		fileData:{
-			type:Object,
-			default:()=>({fileName:"",url:""})
-		},
+    fileData: {
+      type: Object,
+      default: () => ({ fileName: "", url: "" })
+    }
   },
   data() {
     return {
@@ -179,8 +294,8 @@ export default {
       titleValue: "",
       isEditing2: false,
       briefValue: "",
-			showLeftMenu:true,
-			showRightMenu:true,
+      showLeftMenu: false,
+      showRightMenu: true
     };
   },
   watch: {
@@ -188,17 +303,17 @@ export default {
       handler(newVal) {
         this.manualJson = this.depthCopy(newVal);
       },
-      deep: true,
-    },
+      deep: true
+    }
   },
   computed: {
     score() {
       let score = 0;
-      this.manualJson.forEach((el) => {
+      this.manualJson.forEach(el => {
         if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
-          el.array.forEach((item) => {
+          el.array.forEach(item => {
             if (item.ttype == 2 && item.array.length > 0) {
-              item.array.forEach((item2) => {
+              item.array.forEach(item2 => {
                 if (item2.ttype == 1 && item2.json) {
                   score += item2.json.score ? parseFloat(item2.json.score) : 0;
                 }
@@ -212,30 +327,34 @@ export default {
         }
       });
       return score > 0 ? score : "未设置分数";
-    },
+    }
   },
   methods: {
-    editTitle(){
+    editTitle() {
       this.isEditing = true;
-      this.titleValue = this.title ? JSON.parse(JSON.stringify(this.title)) : ''
+      this.titleValue = this.title
+        ? JSON.parse(JSON.stringify(this.title))
+        : "";
       this.$nextTick(() => {
         // 聚焦到输入框
-        this.$refs['title'].focus();
+        this.$refs["title"].focus();
       });
     },
-    save(){
+    save() {
       this.isEditing = false;
       this.$emit("updateTitle", this.titleValue);
     },
-    editBref(){
+    editBref() {
       this.isEditing2 = true;
-      this.briefValue = this.brief ? JSON.parse(JSON.stringify(this.brief)) : ''
+      this.briefValue = this.brief
+        ? JSON.parse(JSON.stringify(this.brief))
+        : "";
       this.$nextTick(() => {
         // 聚焦到输入框
-        this.$refs['brief'].focus();
+        this.$refs["brief"].focus();
       });
     },
-    save2(){
+    save2() {
       this.isEditing2 = false;
       this.$emit("updateBrief", this.briefValue);
     },
@@ -245,27 +364,27 @@ export default {
     },
     addCheck(topicType) {
       let type = 1;
-			// if(this.manualJson.filter(i=>i.type==6).length>=1){
-			// 	return this.$message.error("一个表单只能添加一个课程组件");
-			// }
-			function checkType(obj){
-				if(obj.filter(i=>i.array).length>0){
-					let bol = false;
-					obj.forEach(i=>{
-						console.log(i.array)
-						if(bol)return;
-						bol = checkType(i.array);
-					})
-					return bol;
-				}else if(obj.filter(i=>i.type==6).length>=1){
-					return true;
-				}else{
-					return false;
-				}
-			}
-			if(topicType == 6 && checkType(this.manualJson)){
-				return this.$message.error("一个表单只能添加一个课程组件");
-			}
+      // if(this.manualJson.filter(i=>i.type==6).length>=1){
+      // 	return this.$message.error("一个表单只能添加一个课程组件");
+      // }
+      function checkType(obj) {
+        if (obj.filter(i => i.array).length > 0) {
+          let bol = false;
+          obj.forEach(i => {
+            console.log(i.array);
+            if (bol) return;
+            bol = checkType(i.array);
+          });
+          return bol;
+        } else if (obj.filter(i => i.type == 6).length >= 1) {
+          return true;
+        } else {
+          return false;
+        }
+      }
+      if (topicType == 6 && checkType(this.manualJson)) {
+        return this.$message.error("一个表单只能添加一个课程组件");
+      }
       if (this.manualJson.length > 0) {
         for (var i = 0; i < this.manualJson.length; i++) {
           if (this.manualJson[i].ttype == 2) {
@@ -279,15 +398,15 @@ export default {
       if (this.checkC) {
         let _check = this.checkC.replace("x", "").split("-");
         let _json = this.manualJson[_check[0]];
-        let _topicType = ''
-        if(topicType == 9 || topicType == 10){
-          _topicType = 1 
-        }else {
-          _topicType = topicType
+        let _topicType = "";
+        if (topicType == 9 || topicType == 10) {
+          _topicType = 1;
+        } else {
+          _topicType = topicType;
         }
         let json = {
           ttype: 1,
-          type: _topicType,
+          type: _topicType
         };
         if (topicType == 1) {
           json.json = {
@@ -295,59 +414,59 @@ export default {
             type: 1,
             array: [
               { option: "选项1", img: "" },
-              { option: "选项2", img: "" },
+              { option: "选项2", img: "" }
             ],
-            answer: "",
+            answer: ""
           };
         } else if (topicType == 3) {
           json.json = {
             title: "标题",
             type: 1,
-            answer: "",
+            answer: ""
           };
         } else if (topicType == 5) {
           json.json = {
             title: "标题",
             type: 1,
-            detail: "",
+            detail: ""
           };
         } else if (topicType == 6) {
           json.json = {
             title: "标题",
             detail: "",
-            courses:[]
+            courses: []
           };
         } else if (topicType == 7) {
           json.json = {
             title: "标题",
             detail: "",
             small: 0,
-            big: 10,
+            big: 10
           };
         } else if (topicType == 8) {
           json.json = {
             title: "标题",
-            detail: "",
+            detail: ""
           };
-        }else if (topicType == 9) {
+        } else if (topicType == 9) {
           json.json = {
             title: "标题",
             type: 1,
             array: [
               { option: "选项1", img: "" },
-              { option: "选项2", img: "" },
+              { option: "选项2", img: "" }
             ],
-            answer: "",
+            answer: ""
           };
-        }else if (topicType == 10) {
+        } else if (topicType == 10) {
           json.json = {
             title: "标题",
             type: 2,
             array: [
               { option: "选项1", img: "" },
-              { option: "选项2", img: "" },
+              { option: "选项2", img: "" }
             ],
-            answer: "",
+            answer: ""
           };
         } else if (topicType == 11) {
           json.json = {
@@ -395,15 +514,15 @@ export default {
         }
       } else {
         if (type == 1) {
-          let _topicType = ''
-          if(topicType == 9 || topicType == 10){
-            _topicType = 1 
-          }else {
-            _topicType = topicType
+          let _topicType = "";
+          if (topicType == 9 || topicType == 10) {
+            _topicType = 1;
+          } else {
+            _topicType = topicType;
           }
           let json1 = {
             ttype: 1,
-            type: _topicType,
+            type: _topicType
           };
 
           if (topicType == 1) {
@@ -412,39 +531,39 @@ export default {
               type: 1,
               array: [
                 { option: "选项1", img: "" },
-                { option: "选项2", img: "" },
+                { option: "选项2", img: "" }
               ],
-              answer: "",
+              answer: ""
             };
           } else if (topicType == 3) {
             json1.json = {
               title: "标题",
               type: 1,
-              answer: "",
+              answer: ""
             };
           } else if (topicType == 5) {
             json1.json = {
               title: "标题",
               type: 1,
-              detail: "",
+              detail: ""
             };
           } else if (topicType == 6) {
             json1.json = {
               title: "标题",
               detail: "",
-              courses:[]
+              courses: []
             };
           } else if (topicType == 7) {
             json1.json = {
               title: "标题",
               detail: "",
               small: 0,
-              big: 10,
+              big: 10
             };
           } else if (topicType == 8) {
             json1.json = {
               title: "标题",
-              detail: "",
+              detail: ""
             };
           } else if (topicType == 9) {
             json1.json = {
@@ -452,9 +571,9 @@ export default {
               type: 1,
               array: [
                 { option: "选项1", img: "" },
-                { option: "选项2", img: "" },
+                { option: "选项2", img: "" }
               ],
-              answer: "",
+              answer: ""
             };
           } else if (topicType == 10) {
             json1.json = {
@@ -462,9 +581,9 @@ export default {
               type: 2,
               array: [
                 { option: "选项1", img: "" },
-                { option: "选项2", img: "" },
+                { option: "选项2", img: "" }
               ],
-              answer: "",
+              answer: ""
             };
           } else if (topicType == 11) {
             json1.json = {
@@ -473,14 +592,14 @@ export default {
             };
           }
           this.manualJson.push(json1);
-          this.$forceUpdate()
+          this.$forceUpdate();
         } else if (type == 3 || type == 2) {
           this.$message.error("请选中分页或者分组添加题目");
           return;
         }
       }
       topicType = "";
-      this.$forceUpdate()
+      this.$forceUpdate();
       this.$emit("changeJson", this.manualJson);
     },
     addQtype(type) {
@@ -498,7 +617,7 @@ export default {
         let json = {
           ttype: 2,
           array: [],
-          isopen: true,
+          isopen: true
         };
         if (type == 1) {
           if (this.checkC) {
@@ -512,8 +631,8 @@ export default {
             {
               ttype: 2,
               array: this.depthCopy(this.manualJson),
-              isopen: true,
-            },
+              isopen: true
+            }
           ];
         } else if (type == 3) {
           if (this.checkC) {
@@ -537,8 +656,8 @@ export default {
                 {
                   ttype: 2,
                   array: this.depthCopy(this.manualJson[_check[0]].array),
-                  isopen: true,
-                },
+                  isopen: true
+                }
               ];
             } else {
               this.manualJson[_check[0]].array.push(json);
@@ -564,7 +683,7 @@ export default {
           let json = {
             ttype: 3,
             array: [],
-            isopen: true,
+            isopen: true
           };
           if (this.checkC) {
             let _check = this.checkC.replace("x", "").split("-");
@@ -578,17 +697,17 @@ export default {
             {
               ttype: 3,
               array: this.depthCopy(this.manualJson),
-              isopen: true,
-            },
+              isopen: true
+            }
           ];
         }
       }
       this.$emit("changeJson", this.manualJson);
-    },
+    }
   },
   mounted() {
     this.manualJson = this.depthCopy(this.checkJson);
-  },
+  }
 };
 </script>
 
@@ -601,7 +720,7 @@ export default {
   justify-content: space-between;
   padding: 0 0 0;
   box-sizing: border-box;
-	position: relative;
+  position: relative;
 }
 
 .e_add {
@@ -613,20 +732,19 @@ export default {
   box-sizing: border-box;
   /* border-right: 1px solid #e5e5e5; */
   border-radius: 5px;
-	position: relative;
+  position: relative;
 }
 
 .e_content {
   height: 100%;
-	flex: 1;
-	/* margin: 0 20px; */
+  flex: 1;
+  /* margin: 0 20px; */
   /* width: calc(100% - 640px); */
   background: #fff;
   overflow: auto;
   padding: 20px;
   box-sizing: border-box;
   border-radius: 5px;
-
 }
 
 .e_content > .title {
@@ -648,7 +766,7 @@ export default {
   outline: none;
 }
 
-.briefInput{
+.briefInput {
   font-size: 14px;
   text-align: center;
   width: 100%;
@@ -664,10 +782,9 @@ export default {
   width: 100%;
   margin-bottom: 10px;
   word-break: break-all;
-  color:#00000066;
+  color: #00000066;
 }
 
-
 .e_order {
   height: 100%;
   width: 300px;
@@ -676,7 +793,7 @@ export default {
   padding: 20px 10px;
   box-sizing: border-box;
   border-radius: 5px;
-	position: relative;
+  position: relative;
 }
 
 .e_add > .title,
@@ -732,51 +849,57 @@ export default {
   width: 50%;
 }
 
-.e_a_foldIcon{
-	width: 30px;
-	height: 30px;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	position: absolute;
-	top: 15px;
-	border-radius: 5px 0 0 5px;
-	background-color: #409EFF;
-	cursor: pointer;
+.e_a_foldIcon {
+  width: 30px;
+  height: 30px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: absolute;
+  top: 15px;
+  border-radius: 5px 0 0 5px;
+  background-color: #409eff;
+  cursor: pointer;
+}
+
+.e_a_foldIcon > svg {
+  width: 20px;
+  height: 20px;
+  fill: #fff;
 }
 
-.e_a_foldIcon>svg{
-	width: 20px;
-	height: 20px;
-	fill: #fff;
+.e_outside_foldIcon {
+  width: 40px;
+  height: 40px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: absolute;
+  top: 15px;
+  border-radius: 5px 0 0 5px;
+  background-color: #409eff;
+  cursor: pointer;
 }
 
-.e_outside_foldIcon{
-	width: 40px;
-	height: 40px;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	position: absolute;
-	top: 15px;
-	border-radius: 5px 0 0 5px;
-	background-color: #409EFF;
-	cursor: pointer;
+.e_outside_foldIcon > svg {
+  width: 20px;
+  height: 20px;
+  fill: #fff;
 }
 
-.e_outside_foldIcon>svg{
-	width: 20px;
-	height: 20px;
-	fill: #fff;
+.e_viewFile {
+  height: 100%;
+  flex: 1;
+  margin-left: 0px;
+  background-color: #ffffff;
+  border-radius: 5px;
+  box-sizing: border-box;
+  overflow-y: hidden;
 }
 
-.e_viewFile{
-	height: 100%;
-	flex: 1;
-	margin-left: 20px;
-	background-color: #FFFFFF;
-	border-radius: 5px;
-	box-sizing: border-box;
-	overflow-y: hidden;	
+.e_addBox{
+	width: 400px;
+	height: 300px;
+	background-color: red;
 }
-</style>
+</style>

+ 2 - 2
src/components/pages/test/check/docxTemplateDialog.vue

@@ -250,7 +250,7 @@ export default {
       uploadTemplateDocxData: null, //上传的模板文档
       downFileData: null, // 下载模板文档的url
       checkJson: [],
-      foldField: false,
+      foldField: true,
       wordContent: "",
       wordContentLoading: true,
       courseId: "",
@@ -296,7 +296,7 @@ export default {
       this.downFileData = null;
       this.fieldList = [];
       this.uploadTemplateDocxData = null;
-      this.foldField = false;
+      this.foldField = true;
       // this.fileList = [];
     },