浏览代码

修改流程执行人的选项list初始逻辑

lph 1 年之前
父节点
当前提交
2985fb2be6
共有 1 个文件被更改,包括 19 次插入4 次删除
  1. 19 4
      zkqy-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteUser.vue

+ 19 - 4
zkqy-ui/src/views/system/bpmnPro/components/Panel/components/ElementExecuteUser.vue

@@ -155,9 +155,11 @@ export default {
     initFormData() {
       if (!getExecuteUserType(getActive())) {
         //初始化数据时给流程绑定用户类型
-        this.updateExeUserType("1");
+        this.updateExeUserType("1", true);
       }
       this.exeUserType = getExecuteUserType(getActive()) || "1";
+      this.initOptions(this.exeUserType);
+      // this.updateExeUserType(this.exeUserType, true);
       if (this.exeUserType == 2) {
         let temp = getExecuteUser(getActive()) || "";
         console.log(temp);
@@ -182,21 +184,34 @@ export default {
       });
       this.isArriveBoottom = false;
     },
-    updateExeUserType(value) {
+    initOptions(value) {
+      if (value == "3") {
+        // this.exeRoleListHandler();
+        this.exeUserValueList = this.roleList;
+      } else {
+        // this.exeUserListHandler();
+        this.exeUserValueList = this.userList;
+      }
+    },
+    updateExeUserType(value, isFirst = false) {
       setExecuteUserType(getActive(), value);
-      value == 2
+      value == "2"
         ? setExecuteUser(getActive(), [], this.isNewNode())
         : setExecuteUser(getActive(), "", this.isNewNode());
+      // if (!isFirst) {
       this.exeUserValueList = [];
       this.exeUserValue = "";
+      // }
+
       if (!value) return;
-      if (value == 3) {
+      if (value == "3") {
         // this.exeRoleListHandler();
         this.exeUserValueList = this.roleList;
       } else {
         // this.exeUserListHandler();
         this.exeUserValueList = this.userList;
       }
+      console.log(value, this.exeUserValueList);
     },
     async exeUserListHandler() {
       this.allUserList().forEach((item) => {