SanHQin hace 2 semanas
padre
commit
9b655c5601

+ 1 - 1
dist/index.html

@@ -37,7 +37,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.16bb25addaa14382af630b41dda1bcfc.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.c21f71e5297dcdcfb4e1.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.8b87037828e7fd0aa1d1504f6d4c8b01.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.6b2878ac2e4b65972689.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/css/app.8b87037828e7fd0aa1d1504f6d4c8b01.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/css/app.8b87037828e7fd0aa1d1504f6d4c8b01.css.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/css/workPage.3a2d03968d0cb14346d2444fb161387e.css.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/css/workPage.4d0f06f902bf0fdc9d6fa8d5a69808e5.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/css/workPage.4d0f06f902bf0fdc9d6fa8d5a69808e5.css.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/app.6b2878ac2e4b65972689.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/app.6b2878ac2e4b65972689.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/manifest.23ea04dc469b57e2b4f8.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/workPage-manifest.2ece51fa34be51c8610a.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/workPage.39e3825d3bc82e43a815.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/workPage.39e3825d3bc82e43a815.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/workPage.c06c4cc03f2c7843f582.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/static/js/workPage.c06c4cc03f2c7843f582.js.map


+ 1 - 1
dist/workPage.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.3a2d03968d0cb14346d2444fb161387e.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.c06c4cc03f2c7843f582.js></script></body></html><script>function stopSafari() {
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.4d0f06f902bf0fdc9d6fa8d5a69808e5.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.39e3825d3bc82e43a815.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

+ 52 - 15
src/components/pages/workPage/components/setChoiceQuestion.vue

@@ -2,7 +2,7 @@
   <div class="setChoiceQuestion">
     <div class="testItem" v-for="(item, index) in jsonData.testJson" :key="item.id">
       <div class="ti_header">
-        <span>{{ lang.ssTopic }}{{ index + 1 }} <span v-if="item.answer.length==0">{{lang.ssNoSettingAnswer}}</span></span>
+        <span>{{ lang.ssTopic }}{{ index + 1 }} <span v-if="item.answer.length==0 || item.checkList.some(opt=>opt=='')">{{lang.ssOptionEmpty}}</span></span>
         <div class="ti_h_edit">
           <span @click="copyTest(item.id)">
             <svg viewBox="0 0 1024 1024" version="1.1" p-id="4608" width="200" height="200">
@@ -13,7 +13,7 @@
           </span>
 
           <!-- 上 -->
-          <span @click="changeIndex(item, index, 'up')">
+          <span :class="{'disabled': index === 0}" @click="changeIndex(item, index, 'up')">
             <svg viewBox="0 0 1024 1024" width="200" height="200" fill="#6B7280">
               <path
                 d="M959.804421 511.603981l-84.009346 84.023672L576.143391 293.406446l0 665.582911L448.20351 958.989357 448.20351 293.406446 147.619594 595.628676l-84.024695-84.023672L512.213359 63.546292 959.804421 511.603981z">
@@ -21,7 +21,7 @@
             </svg>
           </span>
           <!-- 下 -->
-          <span @click="changeIndex(item, index, 'down')">
+          <span :class="{'disabled': index === jsonData.testJson.length - 1}" @click="changeIndex(item, index, 'down')">
             <svg style="transform: rotate(180deg);" viewBox="0 0 1024 1024" width="200" height="200" fill="#6B7280">
               <path
                 d="M959.804421 511.603981l-84.009346 84.023672L576.143391 293.406446l0 665.582911L448.20351 958.989357 448.20351 293.406446 147.619594 595.628676l-84.024695-84.023672L512.213359 63.546292 959.804421 511.603981z">
@@ -41,8 +41,7 @@
       </div>
 
       <div class="ti_title">
-        <div class="ti_t_input" contenteditable="true" v-text="item.teststitle"
-          @blur="setTestTitle(item.id, $event.target.innerText)"></div>
+        <el-input class="ti_t_input" type="textarea" v-model="item.teststitle" :rows="3" :autosize="{ minRows: 3, maxRows: 6 }" resize="none" :placeholder="lang.ssEnterTextTitle" @blur="setTestTitle(item.id)"></el-input>
         <div class="uploadImage" @click="uploadImage(item.id)">
           <svg viewBox="0 0 1024 1024" version="1.1" p-id="15953" width="200" height="200">
             <path
@@ -175,7 +174,8 @@ export default {
   data() {
     return {
       jsonData: {},
-      dragItem: null
+      dragItem: null,
+      delJson:null,
     }
   },
   watch: {
@@ -222,12 +222,12 @@ export default {
       this.setTestJson();
     },
     //修改标题
-    setTestTitle(id, title) {
-      console.log('修改标题', id, title)
-      let test = this.jsonData.testJson.find(item => item.id == id);
-      if (test) {
-        test.teststitle = title;
-      }
+    setTestTitle(id, target) {
+      // let title = target.innerText;
+      // let test = this.jsonData.testJson.find(item => item.id == id);
+      // if (test) {
+      //   test.teststitle = title;
+      // }
       this.setTestJson();
     },
     // 点击复选框
@@ -244,6 +244,7 @@ export default {
     },
     // 删除题目
     deleteTest(id) {
+      this.delJson = JSON.stringify(this.jsonData.testJson);
       let index = this.jsonData.testJson.findIndex(item => item.id == id);
       this.jsonData.testJson.splice(index, 1);
       this.setTestJson();
@@ -312,14 +313,14 @@ export default {
       if (test) {
         if (direction == 'up') {
           if (index == 0) {
-            this.$message.info("已到顶部");
+            //this.$message.info("已到顶部");
             return;
           }
           this.jsonData.testJson.splice(index, 1);
           this.jsonData.testJson.splice(index - 1, 0, JSON.parse(JSON.stringify(test)));
         } else if (direction == 'down') {
           if (index == this.jsonData.testJson.length - 1) {
-            this.$message.info("已到底部");
+            //this.$message.info("已到底部");
             return;
           }
           this.jsonData.testJson.splice(index, 1);
@@ -409,6 +410,21 @@ export default {
       });
       this.dragItem = null;
     },
+    // ctrl+z 撤销删除
+    undoDelete() {
+      if (this.delJson) {
+        this.jsonData.testJson = JSON.parse(this.delJson);
+        this.setTestJson();
+        this.delJson = null;
+      }
+    },
+  },
+  mounted() {
+    window.addEventListener('keydown', (e)=>{
+      if (e.ctrlKey && e.key === 'z') {
+        this.undoDelete();
+      }
+    });
   },
 }
 </script>
@@ -503,6 +519,13 @@ export default {
   fill: #6B7280;
 }
 
+.ti_h_edit>.disabled {
+  cursor: not-allowed;
+  opacity: 0.5;
+}
+
+
+
 .ti_title {
   width: 100%;
   height: fit-content;
@@ -524,11 +547,25 @@ export default {
   background: none;
   font-size: 1.2rem;
   resize: none;
-  max-height: 10rem;
+  /* max-height: 10rem; */
   overflow: auto;
   /* padding-right: 2rem; */
 }
 
+.ti_t_input /deep/ .el-textarea__inner {
+  padding: 0;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  border: none;
+  outline: none;
+  background: none;
+  font-size: 1.2rem;
+  resize: none;
+  /* max-height: 10rem; */
+  overflow: auto;
+}
+
 .uploadImage {
   position: absolute;
   bottom: 0.5rem;

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio