田源
2023-10-08 5446789066a3af6e00c16cf07c37efcd263a7640
整合代码
已修改1个文件
40 ■■■■■ 文件已修改
Source/UBCS-WEB/src/views/integration/systemInfo.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/integration/systemInfo.vue
@@ -33,10 +33,13 @@
                     v-model="TreeForm"
                     :data="TreeData"
                     :option="TreeOption"
                     node-key="id"
                     :default-checked-keys="[5]"
                     @check-change="checkChange">
          </avue-tree>
        </el-col>
      </el-row>
      <div slot="footer" class="dialog-footer" style="height: 50px;line-height: 50px">
        <el-button icon="el-icon-plus" size="small" type="primary" @click="empower">授 权</el-button>
        <el-button icon="el-icon-close" size="small" type="danger">重 置</el-button>
@@ -142,6 +145,10 @@
    empower() {
      batchAddSave(this.checkAll.oid, this.checkAll.id, this.ParentList).then(res => {
        console.log(res)
        if(res.data.data.code === 200){
          this.$message.success(res.data.data.msg)
          this.dialogVisible=false;
        }
      })
    },
    //分类授权多选回调
@@ -155,7 +162,7 @@
            classParentOid: row.parentId,
          };
          this.ParentList.push(parentRecord);
          // 如果row的children不为空,继续循环children中的每个对象
          // 如果row的children不为空 继续循环children中的每个对象
          if (row.children && row.children.length > 0) {
            for (let child of row.children) {
              const childRecord = {
@@ -165,7 +172,7 @@
                classParentOid: child.parentId,
              };
              this.ParentList.push(childRecord);
              // 如果子对象的children不为空,继续循环获取数据
              // 如果子对象的children不为空 继续循环获取数据
              if (child.children && child.children.length > 0) {
                for (let subChild of child.children) {
                  const subRecord = {
@@ -221,6 +228,35 @@
      this.checkAll = row
      sysInfoTree({systemOid: row.oid, systemId: row.id}).then(res => {
        this.TreeData = res.data;
        var List=[]
        this.TreeData.forEach((item,index)=>{
          const parentRecord = {
            label: item.text,
            children:  [], // 初始化children为空数组
          };
          List.push(parentRecord);
          // 如果item的children不为空 继续循环children中的每个对象
          if (item.children && item.children.length > 0) {
            for (let child of item.children) {
              const childRecord = {
                label: child.text, // 使用child的text属性作为label
                children:  [], // 初始化children为空数组
              };
              parentRecord.children.push(childRecord); // 将childRecord添加到parentRecord的children数组中
              // 如果子对象的children不为空 继续循环获取数据
              if (child.children && child.children.length > 0) {
                for (let subChild of child.children) {
                  const subRecord = {
                    label: subChild.text, // 使用subChild的text属性作为label
                    children:  [], // 初始化children为空数组
                  };
                  childRecord.children.push(subRecord); // 将subRecord添加到childRecord的children数组中
                }
              }
            }
          }
        })
        console.log('list',List)
        this.ModifyProperties(this.TreeData, 'text', 'label');
        // 根据 this.TreeData 的长度计算延迟时间
        const delayTime = this.TreeData.length * 1;