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

fix:异常脚本修改时id重复问题处理

lph пре 1 година
родитељ
комит
3f624d9933

+ 6 - 1
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementAsyncContinuations.vue

@@ -139,7 +139,12 @@ export default {
         isEnablePaging: false,
         industryType,
       });
-      this.scriptList = filterUtil({ industryType }, this.allScriptList());
+      this.scriptList = filterUtil({ industryType }, this.allScriptList()).map(
+        (item) => ({
+          value: item.scriptKey,
+          label: item.scriptName,
+        })
+      );
       // this.scriptList = res.rows.map((item) => ({
       //   value: item.scriptKey,
       //   label: item.scriptName,

+ 7 - 2
ruoyi-ui/src/views/system/bpmnPro/components/Panel/components/ElementUnusualTasks.vue

@@ -100,7 +100,7 @@
             :disabled="!newUnusualTask.industryType"
           >
             <el-option
-              v-for="{ label, value } in scriptKeyList"
+              v-for="{ label, value } in filteredScriptList"
               :label="label"
               :value="value"
               :key="value"
@@ -266,7 +266,11 @@ export default {
   },
   computed: {
     filteredScriptList() {
-      console.log(this.scriptKeyList, this.listeners);
+      return this.scriptKeyList.filter(
+        (item) =>
+          !this.listeners.some((row) => row.scriptKey == item.value) ||
+          this.newUnusualTask.scriptKey == item.value
+      );
     },
   },
   methods: {
@@ -277,6 +281,7 @@ export default {
       this.scriptForm.scriptTriggerType = getScriptTriggerType(getActive());
 
       this.listeners = getUnusualTaskTableData(this._listenersRaw);
+      console.log(this.listeners);
     },
 
     updateScriptType(value) {