Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
艾贤凌
2022-01-18 18:43:09 +08:00
5 changed files with 66 additions and 14 deletions

View File

@@ -72,7 +72,13 @@ export default {
this.areaId = this.user.areaId this.areaId = this.user.areaId
// this.getLeafNodes() // this.getLeafNodes()
uni.$on('goback', e => { uni.$on('goback', e => {
this.getGridInfo(e.id, true) if (e.girdLevel == '0') {
setTimeout(() => {
this.$u.toast('请选择二级或者三级网格')
}, 400)
return false
}
this.getGridList(e.id, true)
}) })
}, },
onShow() { onShow() {
@@ -103,6 +109,26 @@ export default {
}) })
}, },
getGridList (id) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
this.$hideLoading()
if (res?.data) {
const arr = res.data.map(v => {
return {
id: v.id,
girdName: v.girdName,
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
}
})
this.renderGridMap(arr)
}
}).catch(() => {
this.$hideLoading()
})
},
getGridInfo (id, flag) { getGridInfo (id, flag) {
this.$loading() this.$loading()
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => { this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {

View File

@@ -4,7 +4,7 @@
<div class="header-description"> <div class="header-description">
<u-form :model="forms" ref="uForm" label-width="auto"> <u-form :model="forms" ref="uForm" label-width="auto">
<u-form-item label="区域选择" prop="areaId" class="areaIds" style="position: relative"> <u-form-item label="区域选择" prop="areaId" class="areaIds" style="position: relative">
<AiAreaPicker v-model="forms.areaId" :areaId="areaIdProps" @select="areaSelect" style="color: #333"></AiAreaPicker> <AiAreaPicker :value="forms.areaId" :areaId="areaIdProps" @select="areaSelect" style="color: #333"></AiAreaPicker>
<u-icon name="arrow-right" color="rgb(192, 196, 204)" size="30" style="margin-left: 4px" /> <u-icon name="arrow-right" color="rgb(192, 196, 204)" size="30" style="margin-left: 4px" />
</u-form-item> </u-form-item>
@@ -93,7 +93,7 @@ export default {
this.areaIdProps = this.user.areaId this.areaIdProps = this.user.areaId
if (!this.id) { if (!this.id) {
this.forms.areaId = this.user.areaId this.forms.areaId = this.user.areaId
this.areaName = this.user.areaName this.forms.areaName = this.user.areaName
} }
this.$dict.load('realityStatus').then(() => { this.$dict.load('realityStatus').then(() => {
this.getDetail() this.getDetail()
@@ -126,6 +126,8 @@ export default {
this.forms = res.data this.forms = res.data
this.forms.create_user_name = res.data.name this.forms.create_user_name = res.data.name
this.forms.realityValue = res.data.reality this.forms.realityValue = res.data.reality
this.forms.areaId = res.data.areaId
this.forms.areaName = res.data.areaName
this.forms.reality = this.$dict.getLabel('realityStatus', res.data.reality) this.forms.reality = this.$dict.getLabel('realityStatus', res.data.reality)
if (res.data.images) { if (res.data.images) {
this.forms.images = JSON.parse(res.data.images || '[]') this.forms.images = JSON.parse(res.data.images || '[]')

View File

@@ -8,7 +8,6 @@
<span> <span>
{{ data.name }} {{ data.name }}
<span class="tags" v-if="data.menuLevel3Name">{{ data.menuLevel3Name }}</span> <span class="tags" v-if="data.menuLevel3Name">{{ data.menuLevel3Name }}</span>
<span class="tags" v-if="data.reality">{{ $dict.getLabel('realityStatus', data.reality) }}</span>
</span> </span>
</div> </div>
@@ -110,7 +109,7 @@ export default {
height: 40px; height: 40px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #FFFFFF; border: 1px solid #FFFFFF;
margin-right: 16px; margin-left: 16px;
} }
} }
} }

View File

@@ -5,7 +5,7 @@
<slot v-if="$slots.default"/> <slot v-if="$slots.default"/>
<div v-else class="areaSelector"> <div v-else class="areaSelector">
<image :src="locationIcon" class="location"/> <image :src="locationIcon" class="location"/>
<div v-text="selected.name || currentArea.name"/> <div v-text="areaName"/>
</div> </div>
</div> </div>
<div class="areaSelector"> <div class="areaSelector">
@@ -18,7 +18,7 @@
</div> </div>
<div/> <div/>
<span v-if="all" v-text="`省`" @click="selectNode({}, -1)"/> <span v-if="all" v-text="`省`" @click="selectNode({}, -1)"/>
<span v-for="(area,i) in fullArea" :key="area.id" v-text="area.levelLabel" <span v-for="(area,i) in fullArea" :key="area.id" v-text="area.levelLabel || '村/社区'"
@click="selectNode(area, i)"/> @click="selectNode(area, i)"/>
</div> </div>
<!--用来作为占位的--> <!--用来作为占位的-->
@@ -90,6 +90,7 @@ export default {
return { return {
fullArea: [], fullArea: [],
index: '', index: '',
areaName: '',
list: [], list: [],
levelLabels: ["省", "市", "县/区", "镇/街道", "村/社区"], levelLabels: ["省", "市", "县/区", "镇/街道", "村/社区"],
selected: {}, selected: {},
@@ -101,10 +102,18 @@ export default {
v && (this.getFullArea()) v && (this.getFullArea())
}, },
value (v) {
if (this.list.length && v) {
this.areaName = this.list.find((e) => e.id == this.value).name
}
},
fullArea: { fullArea: {
handler(v) { handler(v) {
this.$nextTick(() => { this.$nextTick(() => {
if (v) {
this.scrollHeight() this.scrollHeight()
}
}) })
} }
} }
@@ -118,7 +127,7 @@ export default {
this.$refs.areaSelector.showPopup() this.$refs.areaSelector.showPopup()
}, },
scrollHeight () { 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() { getFullArea() {
let areaId = this.areaId || (this.all ? '' : this.$areaId) let areaId = this.areaId || (this.all ? '' : this.$areaId)
@@ -134,8 +143,8 @@ export default {
this.fullArea = res.data.reverse().slice(this.dataRange) this.fullArea = res.data.reverse().slice(this.dataRange)
} else { } else {
this.fullArea = res.data this.fullArea = res.data
}
}
return this.fullArea return this.fullArea
} }
}) })
@@ -148,10 +157,26 @@ export default {
if (res.data.length) { if (res.data.length) {
this.list = res.data 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
}
if (!this.areaName && this.value === this.areaId) {
this.areaName = self.name
}
if (self.id) { if (self.id) {
this.list.unshift(self) this.list.unshift(self)
} }
this.scrollHeight() this.scrollHeight()
} else {
if (this.areaId.substr(this.areaId.length - 3, 3) !== '000') {
this.list = [{
id: this.areaId,
name: this.fullArea[0].name
}]
this.areaName = this.fullArea[0].name
}
} }
}) })
}, },
@@ -171,10 +196,11 @@ export default {
}) })
if (this.selected.type == 5) { 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:fullName', fullName)
this.$emit('update:name', this.selected.name) this.$emit('update:name', (this.selected.name || this.areaName))
this.closePopup() this.closePopup()
}, },
getChild(op) { getChild(op) {
@@ -210,7 +236,6 @@ export default {
return false return false
} }
console.log(this.index)
this.getFullArea().then(() => { this.getFullArea().then(() => {
this.getChildAreas(this.currentArea.id || this.areaId) this.getChildAreas(this.currentArea.id || this.areaId)
}) })

View File

@@ -356,7 +356,7 @@ const store = new Vuex.Store({
state.dispatch("injectJWeixin", "selectPrivilegedContact").then(() => { state.dispatch("injectJWeixin", "selectPrivilegedContact").then(() => {
setTimeout(() => { setTimeout(() => {
let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin let sdk = typeof wx?.invoke == 'function' ? wx : jWeixin
sdk?.invoke("selectEnterpriseContact", { sdk?.invoke("selectPrivilegedContact", {
fromDepartmentId: -1, fromDepartmentId: -1,
selectedContextContact: 1, selectedContextContact: 1,
mode: "multi", mode: "multi",