修改机构默认选中第一行

This commit is contained in:
闫晓茹 2024-04-09 13:32:23 +08:00
parent c888e9a899
commit 7665f769c0

View File

@ -79,15 +79,17 @@
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:expand-on-click-node="true"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
highlight-current
node-key="id"
@node-click="handleNodeClick"
:render-content="renderContent"
/>
</div>
<!-- :default-expanded-keys="checkDefault" -->
</el-col>
<el-col :span="18" :xs="24">
<el-descriptions title="机构信息">
@ -581,6 +583,7 @@ export default {
name: "Agency",
data() {
return {
checkDefault: [],
arealist: [],
citylist: [],
arealists: [],
@ -740,6 +743,19 @@ export default {
treeOptions: [],
};
},
//
watch: {
deptOptions: {
handler(val) {
if(val) {
this.$nextTick(() => {
document.querySelector('.el-tree-node__content').click()
})
}
},
immediate: true
},
},
created() {
this.getaddress();
// this.getTreeselect();
@ -813,7 +829,7 @@ export default {
// checkStrictly: true,
// lazyLoad: this.lazyLoad,
// };
console.log(res.data, "58", this.treeOptions);
// console.log(res.data, "58", this.treeOptions);
});
},
//