Преглед изворни кода

1、英语写作功能
2、build

zengyicheng пре 1 година
родитељ
комит
e19b3d5697
1 измењених фајлова са 54 додато и 8 уклоњено
  1. 54 8
      src/components/pages/components/englishRight.vue

+ 54 - 8
src/components/pages/components/englishRight.vue

@@ -39,7 +39,25 @@
               :key="eIndex"
               :label="e.title"
               :value="e.id"
+              class="optionCss"
             >
+              <span
+                style="
+                  max-width: 160px;
+                  white-space: nowrap;
+                  overflow: hidden;
+                  text-overflow: ellipsis;
+                  word-break: break-word;
+                "
+                >{{ e.title }}</span
+              >
+              <span
+                ><img
+                  style="width: 20px; height: 20px; cursor: pointer"
+                  @click="deleteTemplate(e.id)"
+                  src="../../../assets/icon/deleteN.png"
+                  alt=""
+              /></span>
             </el-option>
           </el-select>
           <el-tooltip
@@ -48,10 +66,7 @@
             placement="top"
             v-if="engList.textJson.startJson.length > 0"
           >
-            <div
-              class="addeEva"
-              @click="setEvaTitle"
-            >
+            <div class="addeEva" @click="setEvaTitle">
               <img src="../../../assets/icon/addEva.png" alt="" />
             </div>
           </el-tooltip>
@@ -205,9 +220,10 @@ export default {
             this.engList.textJson = tJson;
           } else {
             this.engList.textJson.score = tJson.score;
-            for (var i = 0; i < tJson.startJson.length; i++) {
-              this.engList.textJson.startJson.push(tJson.startJson[i]);
-            }
+            // for (var i = 0; i < tJson.startJson.length; i++) {
+            // this.engList.textJson.startJson.push(tJson.startJson[i]);
+            this.engList.textJson = tJson;
+            // }
           }
           this.engEvaId = "";
         })
@@ -215,6 +231,28 @@ export default {
           console.error(err);
         });
     },
+    deleteTemplate(id) {
+      this.$confirm("是否确定删除该模板?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let params = {
+            id: id,
+          };
+          this.ajax
+            .get(this.$store.state.api + "deleteEnglishEvaById", params)
+            .then((res) => {
+              this.$message.success("删除成功");
+              this.selectEnglishEva();
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
   },
   watch: {
     englishList: {
@@ -315,7 +353,7 @@ export default {
   width: 50px;
   height: 30px;
   border: 1px dashed #dbdbdb;
-  margin-top: 5px;
+  margin: 0 0 0 10px;
   border-radius: 10px;
   float: right;
   cursor: pointer;
@@ -357,4 +395,12 @@ export default {
   height: 30px;
   cursor: pointer;
 }
+
+.optionCss {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: baseline;
+  justify-content: space-between;
+}
 </style>