diff --git a/src/apps/AppMonitoringObject/Add.vue b/src/apps/AppMonitoringObject/Add.vue
index 10a64e71..62dfe1bc 100644
--- a/src/apps/AppMonitoringObject/Add.vue
+++ b/src/apps/AppMonitoringObject/Add.vue
@@ -121,8 +121,7 @@
现住址
diff --git a/src/components/AiAreaPicker.vue b/src/components/AiAreaPicker.vue
index 61da82f2..5d7dfb40 100644
--- a/src/components/AiAreaPicker.vue
+++ b/src/components/AiAreaPicker.vue
@@ -26,7 +26,7 @@ export default {
event: "select"
},
props: {
- areaId: {default: ''},
+ areaId: String,
name: {default: ''},
value: String,
all: Boolean,
@@ -52,7 +52,7 @@ export default {
return level
},
root() {
- return this.areaId || this.user.areaId || this.$areaId
+ return this.areaId || this.rootArea
},
locationIcon() {
return this.$cdn + this.icon
@@ -61,7 +61,8 @@ export default {
data() {
return {
fullArea: [],
- areaName: ""
+ areaName: "",
+ rootArea: ""
}
},
watch: {
@@ -72,16 +73,27 @@ export default {
v && !this.areaName && this.getAreaName(this.value)
},
fullArea(v) {
- v && this.$emit('update:fullName', v?.map(e => e.name)?.join("") || "")
+ v && this.value && this.$emit('update:fullName', v?.map(e => e.name)?.join("") || "")
},
areaName(v) {
v && this.$emit('update:name', v)
}
},
created() {
+ this.getRootArea()
this.value && this.getAreaName(this.value)
},
methods: {
+ getRootArea() {
+ if (uni.getStorageSync("rootArea")) {
+ this.rootArea = uni.getStorageSync("rootArea")
+ } else this.$http.post("/app/appdvcpconfig/getCorpArea", null, {}).then(res => {
+ if (res?.data) {
+ this.rootArea = res.data
+ uni.setStorageSync("rootArea", res.data)
+ }
+ })
+ },
getInfo(areaId) {
return areaId && this.$http.post('/admin/area/getAllParentAreaId', null, {
withoutToken: true,
@@ -111,9 +123,8 @@ export default {
this.fullArea = data.fullArea
this.$forceUpdate()
}
-
})
- let {value, all, valueLevel, selectRoot, areaId} = this.$props
+ let {value, all, valueLevel, selectRoot, areaId = this.root} = this.$props
let url = qs.stringifyUrl({
url: "/components/pages/selectArea", query: {...this.$attrs, value, all, valueLevel, selectRoot, areaId}
})