bug修复

This commit is contained in:
bb_pan 2025-04-10 10:46:01 +08:00
parent cb965ce550
commit da5dd1e76e
1 changed files with 12 additions and 7 deletions

View File

@ -577,9 +577,6 @@ export default {
wholeTypeItemsList: [], wholeTypeItemsList: [],
} }
}, },
created() {
this.GetDeviceTypeTree()
},
async mounted() { async mounted() {
await this.GetUserInfo() await this.GetUserInfo()
@ -591,7 +588,7 @@ export default {
await this.getHoldingPoleSelListData() await this.getHoldingPoleSelListData()
// this.GetDeviceTypeTree() await this.GetDeviceTypeTree()
// this.getList(); // this.getList();
if (this.$route.query.taskId && !this.$route.query.isBack) { if (this.$route.query.taskId && !this.$route.query.isBack) {
console.log('查看') console.log('查看')
@ -670,10 +667,18 @@ export default {
const params = { const params = {
level: 4, level: 4,
} }
getDeviceTypeTree(params).then((res) => { const loading = this.$loading({
this.deviceTypeTree = res.data lock: true,
console.log('🚀 ~ getDeviceTypeTree ~ this.deviceTypeTree:', this.deviceTypeTree) text: '加载中...',
}) })
try {
const res = await getDeviceTypeTree(params)
this.deviceTypeTree = res.data
loading.close()
} catch (error) {
console.log('🚀 ~ GetDeviceTypeTree ~ error:', error)
loading.close()
}
}, },
getParentsById(list, id) { getParentsById(list, id) {
for (let i in list) { for (let i in list) {