xiangpei
2024-11-30 b33517d527aff48ff30eb78d341bbce53d0ed3bb
src/components/flow/Role/index.vue
@@ -121,6 +121,7 @@
            this.radioSelected = newVal
          } else {
            this.selectRoleList = newVal;
            console.log(this.selectRoleList, "角色回显")
          }
        }
      },
@@ -128,14 +129,24 @@
    },
    roleList: {
      handler(newVal) {
        console.log(newVal, "角色回显11")
        if (StrUtil.isNotBlank(newVal) && this.selectRoleList.length > 0) {
          this.$nextTick(() => {
            this.$refs.dataTable.clearSelection();
            this.selectRoleList?.split(',').forEach(key => {
              this.$refs.dataTable.toggleRowSelection(newVal.find(
                item => key == item.roleId
              ), true)
            });
            if (this.selectRoleList instanceof Array) {
              this.selectRoleList.forEach(key => {
                this.$refs.dataTable.toggleRowSelection(newVal.find(
                  item => key == item.roleId
                ), true)
              });
            } else {
              this.selectRoleList?.split(',').forEach(key => {
                this.$refs.dataTable.toggleRowSelection(newVal.find(
                  item => key == item.roleId
                ), true)
              });
            }
          });
        }
      }