| | |
| | | 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> |
| | |
| | | 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; |
| | | } |
| | | }) |
| | | }, |
| | | //分类授权多选回调 |
| | |
| | | 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 = { |
| | |
| | | classParentOid: child.parentId, |
| | | }; |
| | | this.ParentList.push(childRecord); |
| | | // 如果子对象的children不为空,继续循环获取数据 |
| | | // 如果子对象的children不为空 继续循环获取数据 |
| | | if (child.children && child.children.length > 0) { |
| | | for (let subChild of child.children) { |
| | | const subRecord = { |
| | |
| | | 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; |