Commit 960f4843 by 李伟康

- 修复当 carModelId 不存在时显示全部工具列表的问题

- 在 watch 中调用 setPageToolList 方法,提高代码复用性
1 parent b49e5905
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
customerInfo () { customerInfo () {
return this.$store.state.user.customerInfo return this.$store.state.user.customerInfo
}, },
viewKey(){ viewKey () {
return this.$store.state.user.viewKey return this.$store.state.user.viewKey
} }
}, },
...@@ -188,19 +188,13 @@ export default { ...@@ -188,19 +188,13 @@ export default {
viewKey: { viewKey: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (this.channelType == 1) { this.setPageToolList()
let { carModelId } = this.customerInfo
const isAito = this.aitoCarModelIds?.findIndex(e => e == carModelId)
if (isAito == -1) {
this.pageToolList = this.toolList.filter(e => !e.isAito)
} else this.pageToolList = this.toolList
}
} }
}, },
toolList: { toolList: {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
this.pageToolList = newval this.setPageToolList()
} }
}, },
}, },
...@@ -296,6 +290,15 @@ export default { ...@@ -296,6 +290,15 @@ export default {
scale (e) { scale (e) {
let { id } = this let { id } = this
this.scaleValueObject[id] = e this.scaleValueObject[id] = e
},
setPageToolList () {
if (this.channelType == 1) {
let { carModelId } = this.customerInfo
const isAito = this.aitoCarModelIds?.findIndex(e => e == carModelId)
if (carModelId && isAito == -1) {
this.pageToolList = this.toolList.filter(e => !e.isAito)
} else this.pageToolList = this.toolList
} else this.pageToolList = this.toolList
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!