瀏覽代碼

编辑公式-批量选中bug修复

duy 4 天之前
父節點
當前提交
a34c0f3b4a
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 1 1
      public/version.json
  2. 9 3
      src/views/manager/projectinfo/editElement/editElement.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20251202103834"
+  "value": "20251203115937"
 }

+ 9 - 3
src/views/manager/projectinfo/editElement/editElement.vue

@@ -860,11 +860,16 @@ export default {
           mydiv[0].classList.add("oldlace-bg");
           if (metaKey || ctrlKey) {
             if (!target.classList.contains('select-td')) {
+              const index = this.checkList.findIndex(el=> !el.isMulti)
+              if (index !== -1) {
+                this.checkList.splice(index, 1)
+              }
               target.classList.add("select-td");
               this.checkList.push({
                 tr: target.getAttribute('trindex') || target1.getAttribute('trindex'),
                 td: target.getAttribute('tdindex') || target1.getAttribute('tdindex'),
-                name: !isNameEmpty ? curTdEle.getAttribute("title") || '暂未匹配元素' : '暂未匹配元素'
+                name: !isNameEmpty ? curTdEle.getAttribute("title") || '暂未匹配元素' : '暂未匹配元素',
+                isMulti: true
               })
             } else {
               target.classList.remove("select-td");
@@ -883,7 +888,8 @@ export default {
             this.checkList = [{
               tr: target.getAttribute('trindex') || target1.getAttribute('trindex'),
               td: target.getAttribute('tdindex') || target1.getAttribute('tdindex'),
-              name: !isNameEmpty ? curTdEle.getAttribute("title") || '暂未匹配元素' : '暂未匹配元素'
+              name: !isNameEmpty ? curTdEle.getAttribute("title") || '暂未匹配元素' : '暂未匹配元素',
+              isMulti: false
             }]
             document.querySelectorAll('#parent .select-td').forEach(el => el.classList.remove('select-td'));
           }
@@ -1051,7 +1057,7 @@ export default {
 
 .parent {
   ::v-deep .select-td {
-    background-color: #DDEAFE;
+    background-color: #DDEAFE !important;
     border-color: #2550A2 1px solid;
   }