zhangjie 4 yıl önce
ebeveyn
işleme
6c8f803012

BIN
public/temps/用户导入模板.xlsx


BIN
public/temps/用户导入模版.xlsx


BIN
public/temps/考务导入模板.xlsx


BIN
public/temps/考务导入模版.xlsx


+ 1 - 0
src/assets/styles/card-preview.scss

@@ -280,6 +280,7 @@
     font-weight: bold;
     color: rgba(0, 0, 0, 1);
     line-height: 1;
+    white-space: normal;
   }
   &-body {
     padding: 10px;

+ 1 - 1
src/modules/base/views/UserManage.vue

@@ -156,7 +156,7 @@ export default {
       ABLE_TYPE,
       roles: [],
       users: [],
-      downloadUrl: "/temps/用户导入模.xlsx",
+      downloadUrl: "/temps/用户导入模.xlsx",
       // import
       uploadUrl: "/api/print/basic/user/add",
       uploadData: {

+ 11 - 6
src/modules/card/components/RightClickMenu.vue

@@ -67,12 +67,13 @@ export default {
       document.oncontextmenu = function() {
         return false;
       };
-      document.addEventListener("mouseup", e => {
-        if (e.button === 2) {
-          this.visible = false;
-          this.rightClick(e);
-        }
-      });
+      document.addEventListener("mouseup", this.docMouseUp);
+    },
+    docMouseUp(e) {
+      if (e.button === 2) {
+        this.visible = false;
+        this.rightClick(e);
+      }
     },
     rightClick(e) {
       const id = this.getRelateElementId(e.target);
@@ -170,6 +171,10 @@ export default {
           this.rebuildPages();
         });
     }
+  },
+  beforeDestroy() {
+    document.oncontextmenu = null;
+    document.removeEventListener("mouseup", this.docMouseUp);
   }
 };
 </script>

+ 23 - 8
src/modules/card/components/elementEdit/ExplainChildren.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="elem-explain-children">
-    <div class="elem-title" v-if="data.showTitle">
+    <div class="elem-title" v-if="data.showTitle" ref="ElemTitle">
       {{ data.parent.topicName }}
     </div>
     <div class="elem-body" :style="explainBodyStyle">
@@ -36,19 +36,34 @@ export default {
     }
   },
   data() {
-    return {};
+    return {
+      explainBodyStyle: {}
+    };
   },
   computed: {
-    ...mapState("card", ["curDragElement"]),
-    explainBodyStyle() {
-      const height = this.data.showTitle ? this.data.h - 24 : this.data.h;
-      return {
-        height: height + "px"
-      };
+    ...mapState("card", ["curDragElement"])
+  },
+  watch: {
+    "data.parent": {
+      handler() {
+        this.modifyBodyStyle();
+      }
     }
   },
+  mounted() {
+    this.modifyBodyStyle();
+  },
   methods: {
     ...mapMutations("card", ["setCurDragElement", "setCurElement"]),
+    modifyBodyStyle() {
+      let height = this.data.h;
+      if (this.data.showTitle) {
+        height = this.data.h - this.$refs.ElemTitle.clientHeight;
+      }
+      this.explainBodyStyle = {
+        height: height + "px"
+      };
+    },
     dropInnerElement(e) {
       let { layerX: x, layerY: y } = e;
       const { offsetLeft, offsetTop } = this.getOffsetInfo(e.target);

+ 13 - 10
src/modules/card/components/elementPreview/ExplainChildren.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="elem-explain-children">
-    <div class="elem-title" v-if="data.showTitle">
+    <div class="elem-title" v-if="data.showTitle" ref="ElemTitle">
       {{ data.parent.topicName }}
     </div>
-    <div class="elem-body" :style="explainBodyStyle">
+    <div class="elem-body" ref="ElemBody">
       <div class="elem-explain-no">{{ data.explainNumber }}、</div>
       <!-- 解答题子元件区域 -->
       <div class="elem-explain-elements">
@@ -31,14 +31,17 @@ export default {
   data() {
     return {};
   },
-  computed: {
-    explainBodyStyle() {
-      const height = this.data.showTitle ? this.data.h - 30 : this.data.h;
-      return {
-        height: height + "px"
-      };
-    }
+  mounted() {
+    this.modifyBodyStyle();
   },
-  methods: {}
+  methods: {
+    modifyBodyStyle() {
+      let height = this.data.h;
+      if (this.data.showTitle) {
+        height = this.data.h - this.$refs.ElemTitle.clientHeight;
+      }
+      this.$refs.ElemBody.style.height = height + "px";
+    }
+  }
 };
 </script>

+ 3 - 1
src/modules/card/components/elementPropEdit/EditComposition.vue

@@ -32,7 +32,9 @@
       <el-form-item prop="topicName" label="题目名称:">
         <el-input
           v-model.trim="modalForm.topicName"
-          size=""
+          type="textarea"
+          :autosize="{ minRows: 2, maxRows: 5 }"
+          resize="none"
           placeholder="请输入题目名称"
           clearable
         ></el-input>

+ 4 - 1
src/modules/card/components/elementPropEdit/EditExplain.vue

@@ -32,7 +32,9 @@
       <el-form-item prop="topicName" label="题目名称:">
         <el-input
           v-model.trim="modalForm.topicName"
-          size=""
+          type="textarea"
+          :autosize="{ minRows: 2, maxRows: 5 }"
+          resize="none"
           placeholder="请输入题目名称"
           clearable
         ></el-input>
@@ -183,6 +185,7 @@ export default {
 
       this.modalForm.questionsCount =
         this.modalForm.endNumber - this.modalForm.startNumber + 1;
+      console.log(this.modalForm);
       this.$emit("modified", this.modalForm);
       this.cancel();
     }

+ 3 - 1
src/modules/card/components/elementPropEdit/EditFillLine.vue

@@ -32,7 +32,9 @@
       <el-form-item prop="topicName" label="题目名称:">
         <el-input
           v-model.trim="modalForm.topicName"
-          size=""
+          type="textarea"
+          :autosize="{ minRows: 2, maxRows: 5 }"
+          resize="none"
           placeholder="请输入题目名称"
           clearable
         ></el-input>

+ 3 - 1
src/modules/card/components/elementPropEdit/EditFillQuestion.vue

@@ -32,7 +32,9 @@
       <el-form-item prop="topicName" label="题目名称:">
         <el-input
           v-model.trim="modalForm.topicName"
-          size=""
+          type="textarea"
+          :autosize="{ minRows: 2, maxRows: 5 }"
+          resize="none"
           placeholder="请输入题目名称"
           clearable
         ></el-input>

+ 1 - 0
src/modules/card/previewTemp.js

@@ -344,6 +344,7 @@ const css =
     font-weight: bold;\
     color: black;\
     line-height: 1;\
+    white-space: normal;\
   }\
 \
   .elem-body {\

+ 1 - 0
src/modules/card/store.js

@@ -267,6 +267,7 @@ const actions = {
                 ];
               child.explainNumber = i + element.startNumber;
               child.parent = { ...element };
+              child.topicNo = element.topicNo;
             });
           } else {
             state.pages[lastPos._pageNo].columns[

+ 1 - 1
src/modules/exam-center/views/ExamModify.vue

@@ -29,7 +29,7 @@
           icon="icon icon-plus"
           style="margin-left:10px;"
         >
-          <a :href="downloadUrl" download="考务导入模.xlsx">考务模板下载</a>
+          <a :href="downloadUrl" download="考务导入模.xlsx">考务模板下载</a>
         </el-button>
       </el-form-item>
       <el-form-item label="考试开始时间:">