wangting
2025-01-02 e358d69fc18870584dd2d9f531910b7838ea27d9
Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue
@@ -405,53 +405,9 @@
    departmentQueryController({queryAllLevel: true}).then(res => {
      const data = res.data.treeData;
      this.departData = this.departDtaFormAtter(data);
    }).catch(err => {
      this.$message.error(err);
    })
  },
  watch: {
    selectRow:{
      handler(val,oldval) {
        this.authData=[];
        if(val && val.rules){
          this.form=JSON.parse(JSON.stringify(val.rules));
          //this.getTemp(true);
          //this.getTemp(false)
          //构建授权主体数据
          if(val.rules.users){
            val.rules.users.split(',').forEach((item,i)=>{
              if(item){
                this.authData.push({
                  name:'{'+item+', '+item+', user}'
                })
              }
            })
          }
          if(val.rules.roles){
            val.rules.roles.split(',').forEach((item,i)=>{
              if(item){
                this.authData.push({
                  name:'{'+item+', '+item+', role}'
                })
              }
            })
          }
          if(val.rules.userGroups){
            val.rules.userGroups.split(',').forEach((item,i)=>{
              if(item){
                this.authData.push({
                  name:'{'+item+', '+item+', userGroup}'
                })
              }
            })
          }
        }else {
          this.form={};
        }
      },
      immediate: true,
      deep: true
    },
    actionMap:{
      handler(val) {
        this.actionDic=[];
@@ -463,6 +419,67 @@
            })
          }
        };
      },
      immediate: true,
      deep: true
    },
    selectRow:{
      handler(val,oldval) {
        this.authData=[];
        if(val && val.rules &&val.rules.length>0) {
          this.form = JSON.parse(JSON.stringify(val.rules[0]));
          //this.getTemp(true);
          //this.getTemp(false)
          //构建授权主体数据
          if (val.rules[0].users) {
            val.rules[0].users.split(',').forEach((item, i) => {
              if (item) {
                this.authData.push({
                  name: '{' + item + ', ' + item + ', user}'
                })
              }
            })
          }
          if (val.rules[0].roles) {
            val.rules[0].roles.split(',').forEach((item, i) => {
              if (item) {
                this.authData.push({
                  name: '{' + item + ', ' + item + ', role}'
                })
              }
            })
          }
          if (val.rules[0].userGroups) {
            val.rules[0].userGroups.split(',').forEach((item, i) => {
              if (item) {
                this.authData.push({
                  name: '{' + item + ', ' + item + ', userGroup}'
                })
              }
            })
          }
          //解析操作按钮选中值
          if (this.actionDic.length > 0) {
            let actionDicStr = JSON.stringify(this.actionDic);
            val.rules.forEach(item => {
              if (item.isGrand == 49) {
                let identifier = item.identifier.replace(this.btmNode.attributes.name + '_', '')
                if (actionDicStr.indexOf('"value":"'+identifier+'"}') != -1) {
                  this.actionForm.push(identifier)
                } else {
                  this.linkactionForm.push(identifier);
                }
              }
            })
          }
        }else {
          this.form={
            ruleName:'',
            ruleType:'0'
          };
          this.actionForm=[];
          this.linkactionForm=[];
        }
      },
      immediate: true,
      deep: true
@@ -544,8 +561,12 @@
        row,
        this.$refs.departCrud,
        this.lastIndex,
        (newIndex) => { this.lastIndex = newIndex; },
        () => { this.departCurrenRows = [row]; }
        (newIndex) => {
          this.lastIndex = newIndex;
        },
        () => {
          this.departCurrenRows = [row];
        }
      );
    },
    // 选择部门 确定
@@ -753,6 +774,7 @@
::v-deep {
  .el-radio ,.el-checkbox{
    margin-right: 30px;
    margin-bottom: 10px;
  }
}
div{
@@ -762,5 +784,6 @@
  padding: 10px 6px;
  margin: 0;
  border: 1px solid #EBEEF5;
  overflow: auto;
}
</style>