@@ -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()
})
},
diff --git a/src/components/pages/selectGird.vue b/src/components/pages/selectGird.vue
index 27c2e198..0d4d4ed3 100644
--- a/src/components/pages/selectGird.vue
+++ b/src/components/pages/selectGird.vue
@@ -73,7 +73,6 @@ export default {
}
},
onLoad(params) {
- console.log(params)
if (params.girdLevel) {
this.girdLevel = params.girdLevel
}
@@ -85,7 +84,7 @@ export default {
this.isDisabledOneGird = params.isDisabledOneGird
}
this.isGirdUser()
-
+
},
methods: {
isGirdUser() {
@@ -98,7 +97,6 @@ export default {
} else {
this.getTree()
}
-
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
}
@@ -108,7 +106,7 @@ export default {
getMyGird() {
this.selectList = []
this.$http.post('/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser').then((res) => {
- if (res.code == 0) {
+ if (res?.data) {
this.allData = res.data
this.treeInit()
}