diff --git a/src/apps/AppWalkask/add.vue b/src/apps/AppWalkask/add.vue
index 8fc405d9..cc020225 100644
--- a/src/apps/AppWalkask/add.vue
+++ b/src/apps/AppWalkask/add.vue
@@ -4,7 +4,7 @@
@@ -110,7 +109,7 @@ export default {
height: 40px;
border-radius: 4px;
border: 1px solid #FFFFFF;
- margin-right: 16px;
+ margin-left: 16px;
}
}
}
diff --git a/src/components/AiAreaPicker.vue b/src/components/AiAreaPicker.vue
index b02eaf1a..0e366ba0 100644
--- a/src/components/AiAreaPicker.vue
+++ b/src/components/AiAreaPicker.vue
@@ -5,7 +5,7 @@
@@ -90,6 +90,7 @@ export default {
return {
fullArea: [],
index: '',
+ areaName: '',
list: [],
levelLabels: ["省", "市", "县/区", "镇/街道", "村/社区"],
selected: {},
@@ -101,10 +102,18 @@ export default {
v && (this.getFullArea())
},
+ value (v) {
+ if (this.list.length && v) {
+ this.areaName = this.list.find((e) => e.id == this.value).name
+ }
+ },
+
fullArea: {
handler(v) {
this.$nextTick(() => {
- this.scrollHeight()
+ if (v) {
+ this.scrollHeight()
+ }
})
}
}
@@ -118,7 +127,7 @@ export default {
this.$refs.areaSelector.showPopup()
},
scrollHeight () {
- return this.height = `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)`
+ return this.height = document.querySelector('.areaSelector') && `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)`
},
getFullArea() {
let areaId = this.areaId || (this.all ? '' : this.$areaId)
@@ -134,8 +143,8 @@ export default {
this.fullArea = res.data.reverse().slice(this.dataRange)
} else {
this.fullArea = res.data
+
}
-
return this.fullArea
}
})
@@ -148,6 +157,14 @@ export default {
if (res.data.length) {
this.list = res.data
let self = this.fullArea.find((e) => e.id == this.areaId)
+
+ if (this.value && !this.areaName && this.value !== this.areaId) {
+ this.areaName = this.list.find((e) => e.id == this.value).name
+ }
+
+ if (!this.areaName && this.value === this.areaId) {
+ this.areaName = self.name
+ }
if (self.id) {
this.list.unshift(self)
}
@@ -171,10 +188,11 @@ export default {
})
if (this.selected.type == 5) {
- fullName = fullName + this.selected.name
+ fullName = fullName + (this.selected.name || this.areaName)
}
+ this.areaName = this.selected.name || this.areaName
this.$emit('update:fullName', fullName)
- this.$emit('update:name', this.selected.name)
+ this.$emit('update:name', (this.selected.name || this.areaName))
this.closePopup()
},
getChild(op) {
@@ -210,7 +228,6 @@ export default {
return false
}
- console.log(this.index)
this.getFullArea().then(() => {
this.getChildAreas(this.currentArea.id || this.areaId)
})