695593266@qq.com пре 1 месец
родитељ
комит
f461557796
3 измењених фајлова са 18 додато и 2 уклоњено
  1. 2 1
      .claude/settings.local.json
  2. 15 1
      src/views/material/BOMmanage/components/workmanship.vue
  3. 1 0
      vue.config.js

+ 2 - 1
.claude/settings.local.json

@@ -3,7 +3,8 @@
     "allow": [
       "Bash(git checkout *)",
       "Bash(python *)",
-      "Bash(node *)"
+      "Bash(node *)",
+      "Bash(xargs grep *)"
     ]
   }
 }

+ 15 - 1
src/views/material/BOMmanage/components/workmanship.vue

@@ -58,7 +58,7 @@
         :columns="columns"
         :datasource="datasource"
         :need-page="false"
-        row-key="id"
+        :row-key="getRowKey"
       >
         <!-- 表头工具栏 -->
         <!-- <template v-slot:toolbar>
@@ -465,6 +465,12 @@
       };
     },
     methods: {
+      getRowKey(row) {
+        if (row && row._rowKey != null) return row._rowKey;
+        if (row && row.id != null) return String(row.id);
+        if (row && row.code != null) return 'c_' + row.code;
+        return '';
+      },
       // 单个工步数据保存
       saveWorking(row) {
         if (!row.name) {
@@ -677,6 +683,14 @@
               (it, ie) => Number(it.sort) - Number(ie.sort)
             );
           }
+          dataList.forEach((item, idx) => {
+            if (item._rowKey == null) {
+              item._rowKey =
+                (item.id != null ? 'id_' + item.id : 'idx_' + idx) +
+                '_' +
+                (item.code != null ? item.code : idx);
+            }
+          });
 
           return dataList;
 

+ 1 - 0
vue.config.js

@@ -36,6 +36,7 @@ module.exports = {
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
         target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.251:51005',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',