改造上架版网格
This commit is contained in:
@@ -71,7 +71,7 @@
|
|||||||
"jest": "^25.4.0",
|
"jest": "^25.4.0",
|
||||||
"mini-types": "*",
|
"mini-types": "*",
|
||||||
"miniprogram-api-typings": "^3.3.2",
|
"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",
|
"postcss-comment": "^2.0.0",
|
||||||
"query-string": "^7.1.1",
|
"query-string": "^7.1.1",
|
||||||
"uview-ui": "^1.8.4",
|
"uview-ui": "^1.8.4",
|
||||||
|
|||||||
@@ -246,6 +246,10 @@ export const $permissions = flag => {
|
|||||||
return buttons.some(b => b.id == flag || b.permission == flag)
|
return buttons.some(b => b.id == flag || b.permission == flag)
|
||||||
} else return false
|
} else return false
|
||||||
}
|
}
|
||||||
|
export const $copy = any =>{
|
||||||
|
if(any)return JSON.parse(JSON.stringify(any))
|
||||||
|
else return any
|
||||||
|
}
|
||||||
export default {
|
export default {
|
||||||
dict,
|
dict,
|
||||||
confirm,
|
confirm,
|
||||||
@@ -290,5 +294,6 @@ export default {
|
|||||||
dayjs,
|
dayjs,
|
||||||
idCardNoUtil,
|
idCardNoUtil,
|
||||||
qs,
|
qs,
|
||||||
$permissions
|
$permissions,
|
||||||
|
$copy
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,16 @@ export default {
|
|||||||
type: {default: "resident"},
|
type: {default: "resident"},
|
||||||
nodeKey: {default: "idNumber"},
|
nodeKey: {default: "idNumber"},
|
||||||
selected: {default: () => []},
|
selected: {default: () => []},
|
||||||
placeholder: {default: "选择人员"}
|
placeholder: {default: "选择人员"},
|
||||||
|
ops: {default: () => ({})}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
configList: {
|
configList: {
|
||||||
resident: {url: "/components/pages/selectResident", label: "name"},
|
resident: {url: "/components/pages/selectResident", label: "name"},
|
||||||
gird: {url: "/components/pages/selectGird", label: "girdName"},
|
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,
|
let {config, nodeKey} = this,
|
||||||
selected = this.value || this.selected?.map(e => e[nodeKey])
|
selected = this.value || this.selected?.map(e => e[nodeKey])
|
||||||
uni.$once('pagePicker:' + this.type, data => {
|
uni.$once('pagePicker:' + this.type, data => {
|
||||||
console.log('发送',data)
|
console.log('发送', data)
|
||||||
this.$emit("update:selected", data)
|
this.$emit("update:selected", data)
|
||||||
this.$emit("select", data)
|
this.$emit("select", data)
|
||||||
this.$emit("change", data.map(e => e[nodeKey]))
|
this.$emit("change", data.map(e => e[nodeKey]))
|
||||||
|
|||||||
@@ -1,18 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="AddGird">
|
<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="item-flex">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span class="tips">*</span>网格名称
|
<span class="tips">*</span>网格名称
|
||||||
@@ -35,7 +22,7 @@
|
|||||||
<span style="color:#999;" v-else>请选择</span>
|
<span style="color:#999;" v-else>请选择</span>
|
||||||
<img src="./components/img/right-icon.png" alt=""/></div>
|
<img src="./components/img/right-icon.png" alt=""/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-flex" v-if="form.girdLevel == 2">
|
<div class="item-flex">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span class="tips"></span>网格员
|
<span class="tips"></span>网格员
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +55,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.$dict.load('girdType', 'girdLevel').then(() => {
|
this.$dict.load('girdType').then(() => {
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.fromType = option.fromType
|
this.fromType = option.fromType
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
@@ -93,9 +80,7 @@ export default {
|
|||||||
if (this.fromType == 'add') {
|
if (this.fromType == 'add') {
|
||||||
this.form.parentGirdId = this.detailInfo.id
|
this.form.parentGirdId = this.detailInfo.id
|
||||||
this.form.parentGirdName = this.detailInfo.girdName
|
this.form.parentGirdName = this.detailInfo.girdName
|
||||||
this.form.girdLevel = Number(this.detailInfo.girdLevel) + 1
|
|
||||||
this.form.girdType = Number(this.detailInfo.girdType) + 1
|
this.form.girdType = Number(this.detailInfo.girdType) + 1
|
||||||
this.form.isLastLevel = this.form.girdLevel == 2 ? '1' : '0'
|
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
<div class="AppGridManagement">
|
<div class="AppGridManagement">
|
||||||
<div class="pad-t32" v-if="component != 'Map' && isAdmin"></div>
|
<div class="pad-t32" v-if="component != 'Map' && isAdmin"></div>
|
||||||
<div class="select-gird" v-if="component != 'Map' && isAdmin" flex>
|
<div class="select-gird" v-if="component != 'Map' && isAdmin" flex>
|
||||||
<AiPagePicker type="gird" class="fill" :selected="[params]" @select="handleSelectGird">
|
<AiPagePicker type="custom" class="fill" :selected="[params]" @select="handleSelectGird"
|
||||||
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
:ops="{url:'./SelectGrid',label: 'girdName'}">
|
||||||
<div class="gird-name" v-text="params.girdName"/>
|
<div flex>
|
||||||
<u-icon name="arrow-down" color="#999" class="down-icon" size="20"/>
|
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
||||||
|
<AiMore v-model="params.girdName" icon="arrow-down"/>
|
||||||
|
</div>
|
||||||
</AiPagePicker>
|
</AiPagePicker>
|
||||||
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
|
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -134,6 +136,10 @@ export default {
|
|||||||
padding-top: 32px;
|
padding-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gird-icon {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.select-gird {
|
.select-gird {
|
||||||
width: calc(100% - 60px);
|
width: calc(100% - 60px);
|
||||||
padding: 24px 32px;
|
padding: 24px 32px;
|
||||||
|
|||||||
@@ -23,10 +23,6 @@
|
|||||||
<span class="label">网格类型</span>
|
<span class="label">网格类型</span>
|
||||||
<span class="value">{{ $dict.getLabel('girdType', form.girdType) }}</span>
|
<span class="value">{{ $dict.getLabel('girdType', form.girdType) }}</span>
|
||||||
</div>
|
</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 v-if="form.girdMemberManageList && form.girdMemberManageList.length">
|
||||||
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
||||||
<span class="label">网格长</span>
|
<span class="label">网格长</span>
|
||||||
@@ -77,16 +73,10 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {...mapState(['user', 'config'])},
|
computed: {...mapState(['user', 'config'])},
|
||||||
created() {
|
created() {
|
||||||
this.$dict.load('girdType', 'girdLevel')
|
this.$dict.load('girdType')
|
||||||
this.areaId = this.user.areaId
|
this.areaId = this.user.areaId
|
||||||
// this.getLeafNodes()
|
// this.getLeafNodes()
|
||||||
uni.$on('goback', e => {
|
uni.$on('goback', e => {
|
||||||
if (e.girdLevel == '0') {
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.$u.toast('请选择二级或者三级网格')
|
|
||||||
// }, 400)
|
|
||||||
// return false
|
|
||||||
}
|
|
||||||
this.form.girdName = e.girdName
|
this.form.girdName = e.girdName
|
||||||
this.getGridList(e.id, true)
|
this.getGridList(e.id, true)
|
||||||
})
|
})
|
||||||
@@ -108,7 +98,7 @@ export default {
|
|||||||
getLeafNodes() {
|
getLeafNodes() {
|
||||||
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
|
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
|
||||||
if (res?.data) {
|
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 => {
|
const arr = res.data.filter(v => v.points).map(e => {
|
||||||
return {
|
return {
|
||||||
@@ -139,7 +129,7 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
if(this.latLngCenter.length) {
|
if(this.latLngCenter.length) {
|
||||||
return
|
|
||||||
}else {
|
}else {
|
||||||
this.latLngCenter.push(v.points[0].lat, v.points[0].lng)
|
this.latLngCenter.push(v.points[0].lat, v.points[0].lng)
|
||||||
}
|
}
|
||||||
@@ -190,7 +180,6 @@ export default {
|
|||||||
map.setCenter(this.latLngCenter)
|
map.setCenter(this.latLngCenter)
|
||||||
this.map.setZoom(14)
|
this.map.setZoom(14)
|
||||||
}
|
}
|
||||||
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
|
|
||||||
if (this.polygons.length > 0) {
|
if (this.polygons.length > 0) {
|
||||||
this.polygons.forEach(e => e.destroy())
|
this.polygons.forEach(e => e.destroy())
|
||||||
this.labels.forEach(e => {
|
this.labels.forEach(e => {
|
||||||
@@ -203,7 +192,6 @@ export default {
|
|||||||
let bounds = []
|
let bounds = []
|
||||||
|
|
||||||
paths.forEach((path, i) => {
|
paths.forEach((path, i) => {
|
||||||
let color = colors[i % colors.length]
|
|
||||||
let polygon = new TMap.MultiPolygon({
|
let polygon = new TMap.MultiPolygon({
|
||||||
map, styles: {
|
map, styles: {
|
||||||
default: new TMap.PolygonStyle({
|
default: new TMap.PolygonStyle({
|
||||||
@@ -294,14 +282,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep uni-page-body {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
ai-tree-picker {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail {
|
.detail {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -2,42 +2,33 @@
|
|||||||
<div class="SelectGird">
|
<div class="SelectGird">
|
||||||
<div class="header-middle">
|
<div class="header-middle">
|
||||||
<div class="hint">
|
<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>
|
||||||
<div class="showTypes">
|
<div class="showTypes">
|
||||||
<div v-if="treeList.length > 0">
|
<div v-if="treeList.length > 0">
|
||||||
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
|
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
|
||||||
<div class="imges">
|
<div class="imges">
|
||||||
<span v-if="isFormMap == 1 && item.girdLevel != 0">
|
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked"
|
||||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
|
@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/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)"/>
|
||||||
</span>
|
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||||
<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" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="rightes">
|
<div class="rightes">
|
||||||
<div class="applicationNames">{{ item.girdName }}</div>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="padding-bottom: 70px;"></div> -->
|
<!-- <div style="padding-bottom: 70px;"></div> -->
|
||||||
<div v-if="isFormMap == 1">
|
<div class="subBtn" @click="submit">
|
||||||
<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>确定选择</div>
|
<div>确定选择</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -52,13 +43,12 @@ export default {
|
|||||||
slectList: [],
|
slectList: [],
|
||||||
userGird: {},
|
userGird: {},
|
||||||
userList: [],
|
userList: [],
|
||||||
girdLevel: 0,
|
|
||||||
parentGirdId: '',
|
parentGirdId: '',
|
||||||
isFormMap: 0, //1为网格地图 一级不允许选中
|
isFormMap: 0, //1为网格地图 一级不允许选中
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
if(option.isFormMap) {
|
if (option.isFormMap) {
|
||||||
this.isFormMap = option.isFormMap
|
this.isFormMap = option.isFormMap
|
||||||
}
|
}
|
||||||
this.isGirdUser()
|
this.isGirdUser()
|
||||||
@@ -69,74 +59,69 @@ export default {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.data.checkType) {
|
if (res.data.checkType) {
|
||||||
this.userGird = res.data
|
this.userGird = res.data
|
||||||
this.getTree()
|
this.getAllGrids()
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast('当前人员不是网格员或网格管理员')
|
this.$u.toast('当前人员不是网格员或网格管理员')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTree() {
|
getAllGrids() {
|
||||||
this.slectList = []
|
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) {
|
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()
|
this.treeInit()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
treeInit() {
|
treeInit() {
|
||||||
this.treeList = this.allData
|
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||||
this.treeList.map((item) => {
|
this.treeList.map((item) => {
|
||||||
item.isChecked = false
|
item.isChecked = false
|
||||||
})
|
})
|
||||||
var obj = {
|
let obj = {
|
||||||
girdName: '可选范围',
|
girdName: '可选范围',
|
||||||
id: '',
|
id: '',
|
||||||
girdLevel: ''
|
|
||||||
}
|
}
|
||||||
this.slectList.push(obj)
|
this.slectList.push(obj)
|
||||||
},
|
},
|
||||||
|
|
||||||
itemClick(row) {
|
itemClick(row) {
|
||||||
if(row.girdLevel == 2) return
|
let obj = {
|
||||||
var obj = {
|
|
||||||
girdName: row.girdName,
|
girdName: row.girdName,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
girdLevel: row.girdLevel
|
|
||||||
}
|
}
|
||||||
this.slectList.push(obj)
|
this.slectList.push(obj)
|
||||||
this.searckGird(row)
|
this.getGridsByGridMemberAndParent(row)
|
||||||
},
|
},
|
||||||
|
|
||||||
searckGird(row) {
|
getGridsByGridMemberAndParent(row) {
|
||||||
if(row.girdLevel == 2) return
|
let {id: parentGirdId} = row
|
||||||
var girdLevel = Number(row.girdLevel)+1
|
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
|
|
||||||
if (res?.data) {
|
|
||||||
this.treeList = res.data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
girdNameClick(row, index) {
|
girdNameClick(row, index) {
|
||||||
this.userList = []
|
this.userList = []
|
||||||
if(!index) { //第一级别
|
if (!index) { //第一级别
|
||||||
this.slectList = []
|
this.slectList = []
|
||||||
this.treeInit()
|
this.treeInit()
|
||||||
}else {
|
} else {
|
||||||
var list = []
|
var list = []
|
||||||
this.slectList.map((item, i) => {
|
this.slectList.map((item, i) => {
|
||||||
if(i <= index) {
|
if (i <= index) {
|
||||||
list.push(item)
|
list.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.slectList = list
|
this.slectList = list
|
||||||
this.searckGird(row)
|
this.getGridsByGridMemberAndParent(row)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
girdClick(row, index) {
|
girdClick(row, index) {
|
||||||
if (this.treeList[index].isChecked) {//取消
|
if (this.treeList[index].isChecked) {//取消
|
||||||
@@ -156,8 +141,7 @@ export default {
|
|||||||
submit() {
|
submit() {
|
||||||
if (this.SelectGird.id != null) {
|
if (this.SelectGird.id != null) {
|
||||||
uni.$emit('goback', this.SelectGird)
|
uni.$emit('goback', this.SelectGird)
|
||||||
console.log(this.SelectGird)
|
uni.navigateBack({})
|
||||||
uni.navigateBack()
|
|
||||||
} else {
|
} else {
|
||||||
return this.$u.toast('请选择网格')
|
return this.$u.toast('请选择网格')
|
||||||
}
|
}
|
||||||
@@ -171,6 +155,7 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding-bottom: 140px;
|
padding-bottom: 140px;
|
||||||
|
|
||||||
.header-top {
|
.header-top {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 20px 32px;
|
padding: 20px 32px;
|
||||||
@@ -217,11 +202,13 @@ export default {
|
|||||||
margin-left: 36px;
|
margin-left: 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 74px;
|
width: 74px;
|
||||||
height: 74px;
|
height: 74px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rightes {
|
.rightes {
|
||||||
width: calc(100% - 188px);
|
width: calc(100% - 188px);
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -229,15 +216,17 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
border-bottom: 1px solid #e4e5e6;
|
border-bottom: 1px solid #e4e5e6;
|
||||||
|
|
||||||
.applicationNames {
|
.applicationNames {
|
||||||
width: calc(100% - 56px);
|
width: calc(100% - 56px);
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space:nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgs {
|
.imgs {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -260,6 +249,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
.imgselect {
|
.imgselect {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
@@ -281,11 +271,13 @@ export default {
|
|||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
border-bottom: 1px solid #e4e5e6;
|
border-bottom: 1px solid #e4e5e6;
|
||||||
padding-right: 40px;
|
padding-right: 40px;
|
||||||
|
|
||||||
.applicationNames {
|
.applicationNames {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.idNumbers {
|
.idNumbers {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
@@ -301,6 +293,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 118px;
|
height: 118px;
|
||||||
background: #f4f8fb;
|
background: #f4f8fb;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
width: 192px;
|
width: 192px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
|||||||
@@ -2,82 +2,41 @@
|
|||||||
<div class="setGird">
|
<div class="setGird">
|
||||||
<div class="header-middle">
|
<div class="header-middle">
|
||||||
<div class="hint">
|
<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>
|
||||||
|
|
||||||
<div class="showTypes" v-if="!userList.length">
|
<div class="showTypes" v-if="!userList.length">
|
||||||
<div v-if="treeList.length > 0">
|
<div v-if="treeList.length > 0">
|
||||||
<div class="cards" v-for="(item, index) in treeList" :key="index">
|
<div class="cards" v-for="(item, index) in treeList" :key="index">
|
||||||
<div class="imges">
|
<div class="imges">
|
||||||
<span v-if="item.girdRight == 1 && item.girdLevel != 2">
|
<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/xzh.png" alt="" class="imgselect" v-if="item.isChecked"
|
||||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
|
@click.stop="girdClick(item, index)"/>
|
||||||
|
<img src="./components/img/xz.png" alt="" class="imgselect" v-else
|
||||||
|
@click.stop="girdClick(item, index)"/>
|
||||||
</span>
|
</span>
|
||||||
<span v-else style="width:24px;"></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>
|
||||||
<div class="rightes">
|
<div class="rightes fill">
|
||||||
<div class="applicationNames" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
<div class="applicationNames fill" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
||||||
<div class="right-icon" v-if="item.girdLevel != 2" @click="itemClick(item)" >
|
<u-icon v-if="item.hasChildren" @click="itemClick(item)" name="arrow-right" color="#ddd"/>
|
||||||
<img src="./components/img/right-icon.png" alt="" class="imgs" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="padding-bottom: 70px;"></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>添加网格</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
`
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'setGird',
|
name: 'setGird',
|
||||||
@@ -88,17 +47,12 @@ export default {
|
|||||||
treeList: [],
|
treeList: [],
|
||||||
slectList: [],
|
slectList: [],
|
||||||
userList: [],
|
userList: [],
|
||||||
|
|
||||||
show: false,
|
|
||||||
form: {},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$dict.load('girdType', 'girdLevel')
|
|
||||||
this.isGirdUser()
|
this.isGirdUser()
|
||||||
uni.$on('update', () => {
|
uni.$on('update', () => {
|
||||||
this.show = false
|
this.getAllGrids()
|
||||||
this.getTree()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@@ -110,75 +64,71 @@ export default {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.data.checkType) {
|
if (res.data.checkType) {
|
||||||
this.userGird = res.data
|
this.userGird = res.data
|
||||||
this.getTree()
|
this.getAllGrids()
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast('当前人员不是网格员或网格管理员')
|
this.$u.toast('当前人员不是网格员或网格管理员')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTree() {
|
getAllGrids() {
|
||||||
this.slectList = []
|
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) {
|
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()
|
this.treeInit()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
treeInit() {
|
treeInit() {
|
||||||
this.treeList = this.allData
|
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||||
this.treeList.map((item) => {
|
this.treeList.map((item) => {
|
||||||
item.isChecked = false
|
item.isChecked = false
|
||||||
})
|
})
|
||||||
var obj = {
|
let obj = {
|
||||||
girdName: '可选范围',
|
girdName: '可选范围',
|
||||||
id: '',
|
id: '',
|
||||||
girdLevel: '0'
|
|
||||||
}
|
}
|
||||||
this.slectList.push(obj)
|
this.slectList.push(obj)
|
||||||
},
|
},
|
||||||
|
|
||||||
itemClick(row) {
|
itemClick(row) {
|
||||||
if(row.girdLevel == 2) return
|
let obj = {
|
||||||
var obj = {
|
|
||||||
girdName: row.girdName,
|
girdName: row.girdName,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
girdLevel: row.girdLevel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.slectList.push(obj)
|
this.slectList.push(obj)
|
||||||
this.searckGird(row)
|
this.getGridsByGridMemberAndParent(row)
|
||||||
},
|
},
|
||||||
|
|
||||||
searckGird(row) {
|
getGridsByGridMemberAndParent(row) {
|
||||||
if(row.girdLevel == 2) return
|
let {id: parentGirdId} = row
|
||||||
var girdLevel = Number(row.girdLevel)+1
|
this.setGird = {}
|
||||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
|
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||||
if (res?.data) {
|
|
||||||
this.treeList = res.data
|
|
||||||
this.setGird = {}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
girdNameClick(row, index) {
|
girdNameClick(row, index) {
|
||||||
this.userList = []
|
this.userList = []
|
||||||
if(!index) { //第一级别
|
if (!index) { //第一级别
|
||||||
this.slectList = []
|
this.slectList = []
|
||||||
this.treeInit()
|
this.treeInit()
|
||||||
}else {
|
} else {
|
||||||
var list = []
|
var list = []
|
||||||
this.slectList.map((item, i) => {
|
this.slectList.map((item, i) => {
|
||||||
if(i <= index) {
|
if (i <= index) {
|
||||||
list.push(item)
|
list.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.slectList = list
|
this.slectList = list
|
||||||
this.searckGird(row)
|
this.getGridsByGridMemberAndParent(row)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
girdClick(row, index) {
|
girdClick(row, index) {
|
||||||
if (this.treeList[index].isChecked) {//取消
|
if (this.treeList[index].isChecked) {//取消
|
||||||
@@ -195,29 +145,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
showGirdInfo(row) {
|
showGirdInfo(row) {
|
||||||
this.show = true
|
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
|
||||||
this.form = row
|
|
||||||
},
|
},
|
||||||
|
|
||||||
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) {
|
callPhone(phone) {
|
||||||
uni.makePhoneCall({phoneNumber: phone})
|
uni.makePhoneCall({phoneNumber: phone})
|
||||||
@@ -239,6 +169,7 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding-bottom: 140px;
|
padding-bottom: 140px;
|
||||||
|
|
||||||
.header-top {
|
.header-top {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 20px 32px;
|
padding: 20px 32px;
|
||||||
@@ -285,34 +216,36 @@ export default {
|
|||||||
margin: 0 20px 0 36px;
|
margin: 0 20px 0 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 74px;
|
width: 74px;
|
||||||
height: 74px;
|
height: 74px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rightes {
|
.rightes {
|
||||||
width: calc(100% - 178px);
|
display: flex;
|
||||||
// display: flex;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// align-items: center;
|
|
||||||
border-bottom: 1px solid #e4e5e6;
|
border-bottom: 1px solid #e4e5e6;
|
||||||
|
padding-right: 16px;
|
||||||
|
|
||||||
.applicationNames {
|
.applicationNames {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: calc(100% - 100px);
|
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space:nowrap;
|
white-space: nowrap;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
.right-icon{
|
|
||||||
|
.right-icon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgs {
|
.imgs {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
@@ -336,6 +269,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
.imgselect {
|
.imgselect {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
@@ -357,11 +291,13 @@ export default {
|
|||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
border-bottom: 1px solid #e4e5e6;
|
border-bottom: 1px solid #e4e5e6;
|
||||||
padding-right: 40px;
|
padding-right: 40px;
|
||||||
|
|
||||||
.applicationNames {
|
.applicationNames {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.idNumbers {
|
.idNumbers {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
@@ -377,6 +313,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 118px;
|
height: 118px;
|
||||||
background: #f4f8fb;
|
background: #f4f8fb;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
width: 192px;
|
width: 192px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
@@ -402,76 +339,7 @@ export default {
|
|||||||
margin: 32px 0 32px 344px;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -43,12 +43,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="boxes">
|
|
||||||
<span class="boxesLeft">网格层级</span>
|
|
||||||
|
|
||||||
<span class="boxesRight">{{ $dict.getLabel('girdLevel', girdMsgList.girdLevel) || '' }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="boxes">
|
<div class="boxes">
|
||||||
<span class="boxesLeft">标绘状态</span>
|
<span class="boxesLeft">标绘状态</span>
|
||||||
|
|
||||||
@@ -76,8 +70,8 @@ export default {
|
|||||||
checkType: '',
|
checkType: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
this.$dict.load('girdType', 'girdLevel').then(() => {
|
this.$dict.load('girdType').then(() => {
|
||||||
this.isGirdUser()
|
this.isGirdUser()
|
||||||
this.girdMsgList = this.params
|
this.girdMsgList = this.params
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -112,9 +106,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
uni-page-body {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.Statistics {
|
.Statistics {
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
box-sizing: border-box;
|
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