左侧树修改

This commit is contained in:
gongjiale 2022-10-31 17:47:38 +08:00
parent 511f4690c1
commit 2156e70433
2 changed files with 29 additions and 28 deletions

View File

@ -161,7 +161,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="yyzy" label="应用资源" min-width="100%"> <el-table-column prop="yyzy" label="应用资源" min-width="100%">
</el-table-column> </el-table-column>
<el-table-column prop="hys" label="会议室" min-width="100%" v-show='departmentId == 2 || departmentId == 4'> <el-table-column prop="hys" label="会客厅" min-width="100%" v-show='departmentId == 2 || departmentId == 4'>
</el-table-column> </el-table-column>
<el-table-column prop="zj" label="总计" min-width="100%"> <el-table-column prop="zj" label="总计" min-width="100%">
</el-table-column> </el-table-column>
@ -321,7 +321,7 @@ export default {
{ name: '基础设施', key: 3 }, { name: '基础设施', key: 3 },
{ name: '数据资源', key: 4 }, { name: '数据资源', key: 4 },
{ name: '知识库', key: 5 }, { name: '知识库', key: 5 },
{ name: '会议室', value: 6 } { name: '会客厅', value: 6 }
], ],
tableData: [], tableData: [],
tableDataClone: [], tableDataClone: [],
@ -347,9 +347,9 @@ export default {
{ name: '开发组件', value: 3 }, { name: '开发组件', value: 3 },
{ name: '业务组件', value: 4 }, { name: '业务组件', value: 4 },
{ name: '应用资源', value: 5 }, { name: '应用资源', value: 5 },
{ name: '会议室', value: 6 } { name: '会客厅', value: 6 }
], // ], //
typeOptions1: [// typeOptions1: [//
{ name: '智能算法', value: 1 }, { name: '智能算法', value: 1 },
{ name: '图层服务', value: 2 }, { name: '图层服务', value: 2 },
{ name: '开发组件', value: 3 }, { name: '开发组件', value: 3 },

View File

@ -185,31 +185,32 @@
treeData.value.sort((a, b) => { treeData.value.sort((a, b) => {
return sortArr.indexOf(a.key) - sortArr.indexOf(b.key) return sortArr.indexOf(a.key) - sortArr.indexOf(b.key)
}) })
let deptId=user.value.deptId //
treeData.value.forEach((child) => { // let deptId=user.value.deptId
let childern=child.children // treeData.value.forEach((child) => {
childern.forEach((childs) => {// // let childern=child.children
if(childs.key==deptId ){ // childern.forEach((childs) => {//
childs.show=true // if(childs.key==deptId ){
child.show=true // childs.show=true
mybus.emit('paramsGetResources', [childs.key]) // child.show=true
selectId.value =childs.key // mybus.emit('paramsGetResources', [childs.key])
} // selectId.value =childs.key
if(childs.children && childs.children.length>0){// // }
let qu=childs.children // if(childs.children && childs.children.length>0){//
qu.forEach((qu) => { // let qu=childs.children
if(qu.key==deptId ){ // qu.forEach((qu) => {
qu.show=true // if(qu.key==deptId ){
childs.show=true // qu.show=true
child.show=true // childs.show=true
mybus.emit('paramsGetResources', [qu.key]) // child.show=true
selectId.value = qu.key // mybus.emit('paramsGetResources', [qu.key])
} // selectId.value = qu.key
}) // }
} // })
}) // }
// })
}) // })
console.log('左侧树结构数据======================>', treeData.value) console.log('左侧树结构数据======================>', treeData.value)
showKey.value++ showKey.value++