diff --git a/src/components/AiAreaPicker.vue b/src/components/AiAreaPicker.vue index 61363c9c..25a0867d 100644 --- a/src/components/AiAreaPicker.vue +++ b/src/components/AiAreaPicker.vue @@ -3,6 +3,9 @@
+
+ +
@@ -57,7 +60,10 @@ export default { name: {default: ''}, value: String, all: Boolean, - icon: {default: "location.svg"} + icon: {default: "location.svg"}, + isForm: Boolean, + valueLevel: {default: 5}, + fullName: {default: ''} }, computed: { ...mapState(['user']), @@ -102,9 +108,9 @@ export default { v && (this.getFullArea()) }, - value (v) { + value(v) { if (this.list.length && v) { - this.areaName = this.list.find((e) => e.id == this.value).name + this.areaName = this.list.find((e) => e.id == this.value).name } }, @@ -118,7 +124,7 @@ export default { } } }, - mounted () { + mounted() { this.handleInit() }, methods: { @@ -126,7 +132,7 @@ export default { this.handleInit() this.$refs.areaSelector.showPopup() }, - scrollHeight () { + scrollHeight() { this.height = document.querySelector('.areaSelector') && `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)` }, getFullArea() { @@ -156,10 +162,10 @@ export default { }).then((res) => { if (res.data.length) { this.list = res.data - let self = this.fullArea.find((e) => e.id == this.areaId) - + 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 + this.areaName = this.list.find((e) => e.id == this.value).name } if (!this.areaName && this.value === this.areaId) { this.areaName = self.name @@ -204,7 +210,7 @@ export default { }, getChild(op) { if (op.id != this.index) { - if (op.type < 5 && (/0{3}$/g.test(this.index) || !this.index)) { + if (op.type <= this.valueLevel && op.type < 5 && (/0{3}$/g.test(this.index) || !this.index)) { this.fullArea.push(op) this.getChildAreas(op.id) } @@ -213,7 +219,7 @@ export default { } this.$nextTick(() => { - + this.scrollHeight() }) },