改造上架版网格
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
"jest": "^25.4.0",
|
||||
"mini-types": "*",
|
||||
"miniprogram-api-typings": "^3.3.2",
|
||||
"node-sass": "npm:dart-sass@^1.25.0",
|
||||
"node-sass": "npm:sass@^1.51.0",
|
||||
"postcss-comment": "^2.0.0",
|
||||
"query-string": "^7.1.1",
|
||||
"uview-ui": "^1.8.4",
|
||||
|
||||
@@ -246,6 +246,10 @@ export const $permissions = flag => {
|
||||
return buttons.some(b => b.id == flag || b.permission == flag)
|
||||
} else return false
|
||||
}
|
||||
export const $copy = any =>{
|
||||
if(any)return JSON.parse(JSON.stringify(any))
|
||||
else return any
|
||||
}
|
||||
export default {
|
||||
dict,
|
||||
confirm,
|
||||
@@ -290,5 +294,6 @@ export default {
|
||||
dayjs,
|
||||
idCardNoUtil,
|
||||
qs,
|
||||
$permissions
|
||||
$permissions,
|
||||
$copy
|
||||
}
|
||||
|
||||
@@ -21,14 +21,16 @@ export default {
|
||||
type: {default: "resident"},
|
||||
nodeKey: {default: "idNumber"},
|
||||
selected: {default: () => []},
|
||||
placeholder: {default: "选择人员"}
|
||||
placeholder: {default: "选择人员"},
|
||||
ops: {default: () => ({})}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
configList: {
|
||||
resident: {url: "/components/pages/selectResident", label: "name"},
|
||||
gird: {url: "/components/pages/selectGird", label: "girdName"},
|
||||
party: {url: "/components/pages/selectParty", label: "name"}
|
||||
party: {url: "/components/pages/selectParty", label: "name"},
|
||||
custom: {...this.ops}
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -46,7 +48,7 @@ export default {
|
||||
let {config, nodeKey} = this,
|
||||
selected = this.value || this.selected?.map(e => e[nodeKey])
|
||||
uni.$once('pagePicker:' + this.type, data => {
|
||||
console.log('发送',data)
|
||||
console.log('发送', data)
|
||||
this.$emit("update:selected", data)
|
||||
this.$emit("select", data)
|
||||
this.$emit("change", data.map(e => e[nodeKey]))
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
<template>
|
||||
<div class="AddGird">
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips"></span>网格类型
|
||||
</div>
|
||||
<div class="value">{{ $dict.getLabel('girdType', form.girdType) }}</div>
|
||||
</div>
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips"></span>网格层级
|
||||
</div>
|
||||
<div class="value">{{ $dict.getLabel('girdLevel', form.girdLevel) }}</div>
|
||||
</div>
|
||||
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips">*</span>网格名称
|
||||
@@ -35,7 +22,7 @@
|
||||
<span style="color:#999;" v-else>请选择</span>
|
||||
<img src="./components/img/right-icon.png" alt=""/></div>
|
||||
</div>
|
||||
<div class="item-flex" v-if="form.girdLevel == 2">
|
||||
<div class="item-flex">
|
||||
<div class="label">
|
||||
<span class="tips"></span>网格员
|
||||
</div>
|
||||
@@ -68,7 +55,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.$dict.load('girdType', 'girdLevel').then(() => {
|
||||
this.$dict.load('girdType').then(() => {
|
||||
this.id = option.id
|
||||
this.fromType = option.fromType
|
||||
this.getDetail()
|
||||
@@ -93,9 +80,7 @@ export default {
|
||||
if (this.fromType == 'add') {
|
||||
this.form.parentGirdId = this.detailInfo.id
|
||||
this.form.parentGirdName = this.detailInfo.girdName
|
||||
this.form.girdLevel = Number(this.detailInfo.girdLevel) + 1
|
||||
this.form.girdType = Number(this.detailInfo.girdType) + 1
|
||||
this.form.isLastLevel = this.form.girdLevel == 2 ? '1' : '0'
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
<div class="AppGridManagement">
|
||||
<div class="pad-t32" v-if="component != 'Map' && isAdmin"></div>
|
||||
<div class="select-gird" v-if="component != 'Map' && isAdmin" flex>
|
||||
<AiPagePicker type="gird" class="fill" :selected="[params]" @select="handleSelectGird">
|
||||
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
||||
<div class="gird-name" v-text="params.girdName"/>
|
||||
<u-icon name="arrow-down" color="#999" class="down-icon" size="20"/>
|
||||
<AiPagePicker type="custom" class="fill" :selected="[params]" @select="handleSelectGird"
|
||||
:ops="{url:'./SelectGrid',label: 'girdName'}">
|
||||
<div flex>
|
||||
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
||||
<AiMore v-model="params.girdName" icon="arrow-down"/>
|
||||
</div>
|
||||
</AiPagePicker>
|
||||
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
|
||||
</div>
|
||||
@@ -134,6 +136,10 @@ export default {
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
.gird-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.select-gird {
|
||||
width: calc(100% - 60px);
|
||||
padding: 24px 32px;
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
<span class="label">网格类型</span>
|
||||
<span class="value">{{ $dict.getLabel('girdType', form.girdType) }}</span>
|
||||
</div>
|
||||
<div class="info-flex">
|
||||
<span class="label">网格层级</span>
|
||||
<span class="value">{{ $dict.getLabel('girdLevel', form.girdLevel) }}</span>
|
||||
</div>
|
||||
<div v-if="form.girdMemberManageList && form.girdMemberManageList.length">
|
||||
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
||||
<span class="label">网格长</span>
|
||||
@@ -77,16 +73,10 @@ export default {
|
||||
},
|
||||
computed: {...mapState(['user', 'config'])},
|
||||
created() {
|
||||
this.$dict.load('girdType', 'girdLevel')
|
||||
this.$dict.load('girdType')
|
||||
this.areaId = this.user.areaId
|
||||
// this.getLeafNodes()
|
||||
uni.$on('goback', e => {
|
||||
if (e.girdLevel == '0') {
|
||||
// setTimeout(() => {
|
||||
// this.$u.toast('请选择二级或者三级网格')
|
||||
// }, 400)
|
||||
// return false
|
||||
}
|
||||
this.form.girdName = e.girdName
|
||||
this.getGridList(e.id, true)
|
||||
})
|
||||
@@ -108,7 +98,7 @@ export default {
|
||||
getLeafNodes() {
|
||||
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data.filter(v => v.girdLevel === '2')
|
||||
this.treeList = res.data
|
||||
|
||||
const arr = res.data.filter(v => v.points).map(e => {
|
||||
return {
|
||||
@@ -139,7 +129,7 @@ export default {
|
||||
}
|
||||
)
|
||||
if(this.latLngCenter.length) {
|
||||
return
|
||||
|
||||
}else {
|
||||
this.latLngCenter.push(v.points[0].lat, v.points[0].lng)
|
||||
}
|
||||
@@ -190,7 +180,6 @@ export default {
|
||||
map.setCenter(this.latLngCenter)
|
||||
this.map.setZoom(14)
|
||||
}
|
||||
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
|
||||
if (this.polygons.length > 0) {
|
||||
this.polygons.forEach(e => e.destroy())
|
||||
this.labels.forEach(e => {
|
||||
@@ -203,7 +192,6 @@ export default {
|
||||
let bounds = []
|
||||
|
||||
paths.forEach((path, i) => {
|
||||
let color = colors[i % colors.length]
|
||||
let polygon = new TMap.MultiPolygon({
|
||||
map, styles: {
|
||||
default: new TMap.PolygonStyle({
|
||||
@@ -294,14 +282,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep uni-page-body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ai-tree-picker {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.detail {
|
||||
height: 100%;
|
||||
|
||||
|
||||
@@ -2,42 +2,33 @@
|
||||
<div class="SelectGird">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span style="color:#3F8DF5" @click="girdNameClick(item, index)">{{item.girdName}}</span></span>
|
||||
<span v-for="(item, index) in slectList" :key="index">
|
||||
<span v-if="index" style="margin:0 4px;" v-text="`/`"/>
|
||||
<span style="color:#3F8DF5" @click="girdNameClick(item, index)" v-text="item.girdName"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="showTypes">
|
||||
<div v-if="treeList.length > 0">
|
||||
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
|
||||
<div class="imges">
|
||||
<span v-if="isFormMap == 1 && item.girdLevel != 0">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
|
||||
</span>
|
||||
<span v-if="isFormMap != 1">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
|
||||
</span>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras" />
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked"
|
||||
@click.stop="girdClick(item, index)"/>
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)"/>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
</div>
|
||||
<div class="rightes">
|
||||
<div class="applicationNames">{{ item.girdName }}</div>
|
||||
<img src="./components/img/right-icon.png" alt="" class="imgs" v-if="item.girdLevel != 2"/>
|
||||
<u-icon v-if="item.hasChildren" @click="itemClick(item)" name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="padding-bottom: 70px;"></div> -->
|
||||
<div v-if="isFormMap == 1">
|
||||
<div class="subBtn" @click="submit" v-if="treeList.length && treeList[0].girdLevel != 0">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="subBtn" @click="submit" v-else>
|
||||
<div class="subBtn" @click="submit">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -52,13 +43,12 @@ export default {
|
||||
slectList: [],
|
||||
userGird: {},
|
||||
userList: [],
|
||||
girdLevel: 0,
|
||||
parentGirdId: '',
|
||||
isFormMap: 0, //1为网格地图 一级不允许选中
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.isFormMap) {
|
||||
if (option.isFormMap) {
|
||||
this.isFormMap = option.isFormMap
|
||||
}
|
||||
this.isGirdUser()
|
||||
@@ -69,74 +59,69 @@ export default {
|
||||
if (res.code == 0) {
|
||||
if (res.data.checkType) {
|
||||
this.userGird = res.data
|
||||
this.getTree()
|
||||
this.getAllGrids()
|
||||
} else {
|
||||
this.$u.toast('当前人员不是网格员或网格管理员')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getTree() {
|
||||
getAllGrids() {
|
||||
this.slectList = []
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${this.girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${this.parentGirdId}`).then((res) => {
|
||||
let {girdMemberId} = this.userGird
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel`, null, {
|
||||
params: {girdMemberId}
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
this.allData = res.data
|
||||
let parents = res.data.map(e => e.parentGirdId)
|
||||
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||
this.treeInit()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
treeInit() {
|
||||
this.treeList = this.allData
|
||||
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||
this.treeList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: '可选范围',
|
||||
id: '',
|
||||
girdLevel: ''
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
},
|
||||
|
||||
itemClick(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: row.girdName,
|
||||
id: row.id,
|
||||
girdLevel: row.girdLevel
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
},
|
||||
|
||||
searckGird(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var girdLevel = Number(row.girdLevel)+1
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data
|
||||
}
|
||||
})
|
||||
getGridsByGridMemberAndParent(row) {
|
||||
let {id: parentGirdId} = row
|
||||
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||
},
|
||||
|
||||
girdNameClick(row, index) {
|
||||
this.userList = []
|
||||
if(!index) { //第一级别
|
||||
if (!index) { //第一级别
|
||||
this.slectList = []
|
||||
this.treeInit()
|
||||
}else {
|
||||
} else {
|
||||
var list = []
|
||||
this.slectList.map((item, i) => {
|
||||
if(i <= index) {
|
||||
if (i <= index) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.slectList = list
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
girdClick(row, index) {
|
||||
if (this.treeList[index].isChecked) {//取消
|
||||
@@ -156,8 +141,7 @@ export default {
|
||||
submit() {
|
||||
if (this.SelectGird.id != null) {
|
||||
uni.$emit('goback', this.SelectGird)
|
||||
console.log(this.SelectGird)
|
||||
uni.navigateBack()
|
||||
uni.navigateBack({})
|
||||
} else {
|
||||
return this.$u.toast('请选择网格')
|
||||
}
|
||||
@@ -171,6 +155,7 @@ export default {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
padding-bottom: 140px;
|
||||
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
@@ -217,11 +202,13 @@ export default {
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
width: calc(100% - 188px);
|
||||
display: flex;
|
||||
@@ -229,15 +216,17 @@ export default {
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
|
||||
.applicationNames {
|
||||
width: calc(100% - 56px);
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -260,6 +249,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
@@ -281,11 +271,13 @@ export default {
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
@@ -301,6 +293,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
|
||||
@@ -2,82 +2,41 @@
|
||||
<div class="setGird">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span style="color:#3F8DF5" @click="girdNameClick(item, index)">{{item.girdName}}</span></span>
|
||||
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span
|
||||
style="color:#3F8DF5" @click="girdNameClick(item, index)">{{ item.girdName }}</span></span>
|
||||
</div>
|
||||
|
||||
<div class="showTypes" v-if="!userList.length">
|
||||
<div v-if="treeList.length > 0">
|
||||
<div class="cards" v-for="(item, index) in treeList" :key="index">
|
||||
<div class="imges">
|
||||
<span v-if="item.girdRight == 1 && item.girdLevel != 2">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
|
||||
<span v-if="item.girdRight==1">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked"
|
||||
@click.stop="girdClick(item, index)"/>
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else
|
||||
@click.stop="girdClick(item, index)"/>
|
||||
</span>
|
||||
<span v-else style="width:24px;"></span>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras" />
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
</div>
|
||||
<div class="rightes">
|
||||
<div class="applicationNames" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
||||
<div class="right-icon" v-if="item.girdLevel != 2" @click="itemClick(item)" >
|
||||
<img src="./components/img/right-icon.png" alt="" class="imgs" />
|
||||
</div>
|
||||
<div class="rightes fill">
|
||||
<div class="applicationNames fill" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
||||
<u-icon v-if="item.hasChildren" @click="itemClick(item)" name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="padding-bottom: 70px;"></div> -->
|
||||
<div class="subBtn" @click="toAddGird" v-if="slectList.length && slectList[slectList.length-1].girdLevel != 1">
|
||||
<div class="subBtn" @click="toAddGird">
|
||||
<div>添加网格</div>
|
||||
</div>
|
||||
|
||||
<u-popup v-model="show" mode="bottom" border-radius="14" height="1000">
|
||||
<div class="popup">
|
||||
<div class="bg"></div>
|
||||
<div class="title">{{ form.girdName }}</div>
|
||||
<div class="info-flex">
|
||||
<span class="label">网格类型</span>
|
||||
<span class="value">{{ $dict.getLabel('girdType', form.girdType) }}</span>
|
||||
</div>
|
||||
<div class="info-flex">
|
||||
<span class="label">网格层级</span>
|
||||
<span class="value">{{ $dict.getLabel('girdLevel', form.girdLevel) }}</span>
|
||||
</div>
|
||||
<div v-if="form.girdMemberManageList && form.girdMemberManageList.length">
|
||||
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
||||
<span class="label">网格长</span>
|
||||
<span class="value">
|
||||
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId" style="display:inline-block;" />
|
||||
<!-- {{ item.phone }}
|
||||
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
|
||||
v-if="item.phone"> -->
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="form.girdMemberList && form.girdMemberList.length">
|
||||
<div class="info-flex" v-for="(item, index) in form.girdMemberList" :key="index">
|
||||
<span class="label">网格员</span>
|
||||
<span class="value">
|
||||
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId" style="display:inline-block;" />
|
||||
<!-- {{ item.phone }}
|
||||
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
|
||||
v-if="item.phone"> -->
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:56px;"></div>
|
||||
<div class="btn" v-if="form.girdRight == 1">
|
||||
<span class="del" @click="del">删除网格</span>
|
||||
<span class="edit" @click="edit">编辑网格</span>
|
||||
</div>
|
||||
</div>
|
||||
</u-popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
`
|
||||
<script>
|
||||
export default {
|
||||
name: 'setGird',
|
||||
@@ -88,17 +47,12 @@ export default {
|
||||
treeList: [],
|
||||
slectList: [],
|
||||
userList: [],
|
||||
|
||||
show: false,
|
||||
form: {},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$dict.load('girdType', 'girdLevel')
|
||||
this.isGirdUser()
|
||||
uni.$on('update', () => {
|
||||
this.show = false
|
||||
this.getTree()
|
||||
uni.$on('update', () => {
|
||||
this.getAllGrids()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
@@ -110,75 +64,71 @@ export default {
|
||||
if (res.code == 0) {
|
||||
if (res.data.checkType) {
|
||||
this.userGird = res.data
|
||||
this.getTree()
|
||||
this.getAllGrids()
|
||||
} else {
|
||||
this.$u.toast('当前人员不是网格员或网格管理员')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getTree() {
|
||||
getAllGrids() {
|
||||
this.slectList = []
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=0&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=`).then((res) => {
|
||||
let {girdMemberId} = this.userGird
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel`, null, {
|
||||
params: {girdMemberId}
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
this.allData = res.data
|
||||
let parents = res.data.map(e => e.parentGirdId)
|
||||
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
|
||||
this.treeInit()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
treeInit() {
|
||||
this.treeList = this.allData
|
||||
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||
this.treeList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: '可选范围',
|
||||
id: '',
|
||||
girdLevel: '0'
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
},
|
||||
|
||||
itemClick(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: row.girdName,
|
||||
id: row.id,
|
||||
girdLevel: row.girdLevel
|
||||
}
|
||||
|
||||
this.slectList.push(obj)
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
},
|
||||
|
||||
searckGird(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var girdLevel = Number(row.girdLevel)+1
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data
|
||||
this.setGird = {}
|
||||
}
|
||||
})
|
||||
getGridsByGridMemberAndParent(row) {
|
||||
let {id: parentGirdId} = row
|
||||
this.setGird = {}
|
||||
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||
},
|
||||
|
||||
girdNameClick(row, index) {
|
||||
this.userList = []
|
||||
if(!index) { //第一级别
|
||||
if (!index) { //第一级别
|
||||
this.slectList = []
|
||||
this.treeInit()
|
||||
}else {
|
||||
} else {
|
||||
var list = []
|
||||
this.slectList.map((item, i) => {
|
||||
if(i <= index) {
|
||||
if (i <= index) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.slectList = list
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
girdClick(row, index) {
|
||||
if (this.treeList[index].isChecked) {//取消
|
||||
@@ -195,29 +145,9 @@ export default {
|
||||
},
|
||||
|
||||
showGirdInfo(row) {
|
||||
this.show = true
|
||||
this.form = row
|
||||
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
|
||||
},
|
||||
|
||||
del() {
|
||||
this.$confirm('删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
|
||||
this.$http.post(`/app/appgirdinfo/delete?ids=${this.form.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('删除成功!')
|
||||
this.show = false
|
||||
this.form = {}
|
||||
this.treeList = []
|
||||
this.isGirdUser()
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
edit() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.form.id}&fromType=edit`})
|
||||
},
|
||||
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({phoneNumber: phone})
|
||||
@@ -239,6 +169,7 @@ export default {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
padding-bottom: 140px;
|
||||
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
@@ -285,34 +216,36 @@ export default {
|
||||
margin: 0 20px 0 36px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
width: calc(100% - 178px);
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 16px;
|
||||
|
||||
.applicationNames {
|
||||
display: inline-block;
|
||||
width: calc(100% - 100px);
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.right-icon{
|
||||
|
||||
.right-icon {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -336,6 +269,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
@@ -357,11 +291,13 @@ export default {
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
@@ -377,6 +313,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
@@ -402,76 +339,7 @@ export default {
|
||||
margin: 32px 0 32px 344px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
font-family: PingFang-SC-Heavy, PingFang-SC;
|
||||
font-weight: 800;
|
||||
color: #333;
|
||||
line-height: 50px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.info-flex {
|
||||
padding: 26px 0 30px 0;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #D8DDE6;
|
||||
line-height: 40px;
|
||||
font-size: 28px;
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
width: 160px;
|
||||
font-weight: 800;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #666;
|
||||
font-size: 26px;
|
||||
|
||||
.phone-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
vertical-align: sub;
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.border-b0{
|
||||
border-bottom: 0;
|
||||
}
|
||||
.btn{
|
||||
width: 100%;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
span{
|
||||
display: inline-block;
|
||||
height: 92px;
|
||||
line-height: 90px;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
.del{
|
||||
color: #f46;
|
||||
border: 1px solid #f46;
|
||||
flex: 1;
|
||||
margin-right: 32px;
|
||||
}
|
||||
.edit{
|
||||
background-color: #3671EE;
|
||||
color: #fff;
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,12 +43,6 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="boxes">
|
||||
<span class="boxesLeft">网格层级</span>
|
||||
|
||||
<span class="boxesRight">{{ $dict.getLabel('girdLevel', girdMsgList.girdLevel) || '' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="boxes">
|
||||
<span class="boxesLeft">标绘状态</span>
|
||||
|
||||
@@ -76,8 +70,8 @@ export default {
|
||||
checkType: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$dict.load('girdType', 'girdLevel').then(() => {
|
||||
created() {
|
||||
this.$dict.load('girdType').then(() => {
|
||||
this.isGirdUser()
|
||||
this.girdMsgList = this.params
|
||||
this.getList()
|
||||
@@ -112,9 +106,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
uni-page-body {
|
||||
height: 100%;
|
||||
}
|
||||
.Statistics {
|
||||
padding: 0 30px;
|
||||
box-sizing: border-box;
|
||||
|
||||
186
src/saas/AppGridManagement/gridMembers.vue
Normal file
186
src/saas/AppGridManagement/gridMembers.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<section class="gridMembers">
|
||||
<div class="title">{{ detail.girdName }}</div>
|
||||
<div flex v-for="(item, index) in list" :key="index" class="listItem">
|
||||
<img class="avatar" :src="item.photo"/>
|
||||
<div class="fill">
|
||||
<AiOpenData class="memberName" v-if="item.wxUserId" type="userName" :openid="item.wxUserId"/>
|
||||
<div class="memberName" v-else v-text="item.name"/>
|
||||
<div flex>
|
||||
<div class="color-999" v-text="item.userRole"/>
|
||||
<div v-if="item.label" class="tag" v-text="item.label"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div @click="gotoFamilyList(item)">责任家庭</div>
|
||||
<div @click="handleTag(item)">标签设置</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn" v-if="detail.girdRight == 1">
|
||||
<span class="del" @click="del" v-if="!!detail.parentGirdId">删除网格</span>
|
||||
<span class="edit" @click="edit">编辑网格</span>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "gridMembers",
|
||||
appName: "网格成员",
|
||||
computed: {
|
||||
list() {
|
||||
let {girdMemberManageList, girdMemberList} = this.detail
|
||||
return [girdMemberManageList?.map(e => ({...e, userRole: "网格长"})) || [],
|
||||
girdMemberList?.map(e => ({
|
||||
...e,
|
||||
userRole: "网格员"
|
||||
})) || []].flat()
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
this.$http.post("/app/appgirdinfo/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detail = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
del() {
|
||||
this.$confirm('删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
|
||||
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast('删除成功!')
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
edit() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
|
||||
},
|
||||
handleTag({id, label}) {
|
||||
uni.showModal({
|
||||
title: "设置标签",
|
||||
content: label,
|
||||
editable: true,
|
||||
placeholderText: "请输入标签信息,最多10个字",
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
if (res.content && res.content.length <= 10) {
|
||||
this.$http.post("/app/appgirdmemberinfo/updateGirdMemberLabelById", null, {
|
||||
params: {id, label: res.content}
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("设置成功")
|
||||
this.getDetail()
|
||||
} else this.handleTag({id, label})
|
||||
}).catch(() => this.handleTag({id, label}))
|
||||
} else {
|
||||
this.$u.toast("请输入标签,最多10个字")
|
||||
this.handleTag({id, label})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
gotoFamilyList(item) {
|
||||
uni.navigateTo({url: `./FamilyList?id=${item.id}&girdId=${item.girdId}`})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getDetail()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.gridMembers {
|
||||
padding: 16px 32px 0;
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-left: 32px;
|
||||
line-height: 48px;
|
||||
color: #26f;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
font-family: PingFang-SC-Heavy, PingFang-SC;
|
||||
font-weight: 800;
|
||||
color: #333;
|
||||
line-height: 50px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.listItem {
|
||||
padding: 20px 0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
height: 92px;
|
||||
line-height: 90px;
|
||||
border-radius: 8px;
|
||||
font-size: 34px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.del {
|
||||
color: #f46;
|
||||
border: 1px solid #f46;
|
||||
flex: 1;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.edit {
|
||||
background-color: #3671EE;
|
||||
color: #fff;
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.memberName {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.tag {
|
||||
margin-left: 32px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 8px;
|
||||
background: #26f;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user