Преглед на файлове

Merge branch 'xj' of http://192.168.0.115:3000/bill/public-fuse into xj

bill преди 1 година
родител
ревизия
3db207b2c1
променени са 2 файла, в които са добавени 38 реда и са изтрити 24 реда
  1. 36 23
      src/app/mirror/App.vue
  2. 2 1
      src/core/Scene.js

+ 36 - 23
src/app/mirror/App.vue

@@ -21,7 +21,7 @@
     </div>
     <div class="content">
       <el-table
-      :key="data.list.length"
+        :key="data.list.length"
         class="main-table"
         key="id"
         border
@@ -165,11 +165,17 @@ import {
   getCaseScriptInfo,
   CaseScriptSaveOrUpdate,
 } from "@/app/mirror/store/script";
+import linkIco from "@/assets/image/fire.ico";
+
+const link = document.querySelector<HTMLLinkElement>("#app-icon")!;
+link.setAttribute("href", linkIco);
 
 const caseId = ref(null);
 const project = reactive({
   title: "我的脚本",
 });
+
+document.title = project.title;
 const dialogImageUrl = ref("");
 const dialogVisible = ref(false);
 const disabled = ref(false);
@@ -208,8 +214,8 @@ const dragOptions = [
         let list = JSON.parse(JSON.stringify(data.newSortList));
         const target = list.splice(evt.oldIndex, 1);
         list.splice(evt.newIndex, 0, target[0]);
-        data.newSortList = list
-        console.log(evt.oldIndex, evt.newIndex,data.newSortList, data.list);
+        data.newSortList = list;
+        console.log(evt.oldIndex, evt.newIndex, data.newSortList, data.list);
       },
     },
   },
@@ -236,16 +242,18 @@ onMounted(() => {
 });
 
 function getCaseScriptList() {
-  getCaseScriptInfo(caseId.value).then((res) => {
-    project.title = res.name;
-    data.list = res.content
-    data.newSortList = res.content
-    const idList = data.list.map(ele => ele.id);
-    active.value =Math.max.apply(null,idList) || 1;
-    sortList.value = data.list.map((_, index) => index);
-  }).catch((err) => {
-    console.log(err);
-  });
+  getCaseScriptInfo(caseId.value)
+    .then((res) => {
+      project.title = res.name;
+      data.list = res.content;
+      data.newSortList = res.content;
+      const idList = data.list.map((ele) => ele.id);
+      active.value = Math.max.apply(null, idList) || 1;
+      sortList.value = data.list.map((_, index) => index);
+    })
+    .catch((err) => {
+      console.log(err);
+    });
 }
 function handleAdd() {
   // let content = sortList.value.map((index) => data.list[index]);
@@ -254,26 +262,31 @@ function handleAdd() {
   console.log("add", data.newSortList);
   for (var i = 1; i <= addLine.value; i++) {
     console.log(i);
-    data.newSortList.push({ id: active.value + 1, name: "", desc: "", fileList: [] });
+    data.newSortList.push({
+      id: active.value + 1,
+      name: "",
+      desc: "",
+      fileList: [],
+    });
   }
-  active.value ++;
-  data.list = data.newSortList
+  active.value++;
+  data.list = data.newSortList;
   sortList.value = data.list.map((_, index) => index);
 }
 const handleRemove = (data) => {
   data.fileList = [];
 };
-const handleTableRemove =(index, datas) => {
-  data.newSortList = data.newSortList.filter(ele => ele.id !== datas.id);
+const handleTableRemove = (index, datas) => {
+  data.newSortList = data.newSortList.filter((ele) => ele.id !== datas.id);
   console.log("saveProject", data.newSortList);
-  data.list = data.newSortList
+  data.list = data.newSortList;
   // let content = sortList.value.map((index) => data.list[index]);
   // data.list.length = 0;
   // content.splice(index, 1);
   // Object.assign(data.list, content);
   // sortList.value = content.map((_, index) => index);
   console.log("saveProject", index, datas, data.list);
-}
+};
 const handlePictureCardPreview = (file: UploadFile) => {
   dialogImageUrl.value = file.url!;
   dialogVisible.value = true;
@@ -434,12 +447,12 @@ tbody {
     }
   }
 }
-.marksDiv{
+.marksDiv {
   position: relative;
-  .table-delete{
+  .table-delete {
     position: absolute;
     right: -10px;
     top: -3px;
   }
 }
-</style>
+</style>

+ 2 - 1
src/core/Scene.js

@@ -95,7 +95,8 @@ export default class Scene extends Mitt {
         String(obj.name).includes("marker_") ||
         String(obj.name).includes("line_") ||
         String(obj.name).includes("line_point_") ||
-        String(obj.name).includes("circle_")
+        String(obj.name).includes("circle_") ||
+        String(obj.name).includes("pureText_")
       ) {
         this.scene.remove(obj);
       }