无等级网格版合并
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
<template>
|
||||
<div class="AppGridManagement">
|
||||
<!-- <div class="header" v-if="component != 'Map' && isAdmin"> -->
|
||||
<div class="pad-t32" v-if="component != 'Map' && isAdmin"></div>
|
||||
<div class="select-gird" v-if="component != 'Map' && isAdmin">
|
||||
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
|
||||
<div @click="linkTo('./SelectGird')">
|
||||
{{params.girdName}}
|
||||
<img src="./components/img/down-icon.png" alt="" class="down-icon">
|
||||
<template v-if="isGridMember">
|
||||
<div class="pad-t32" v-if="component != 'Map'"/>
|
||||
<div class="select-gird" v-if="component != 'Map'" flex>
|
||||
<AiPagePicker type="custom" class="fill" @select="handleSelectGird"
|
||||
:ops="{url:'./SelectGird',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?id='+params.id)" v-if="isGridAdmin&&!!params.id">网格配置</span>
|
||||
</div>
|
||||
<component v-if="refresh" :is="component" @change="onChange" :params="params"/>
|
||||
<div class="tabs" v-if="isTab">
|
||||
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
|
||||
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
|
||||
<p :class="{'color-3267F0':tabIndex == index}" v-text="item.text"/>
|
||||
</div>
|
||||
<span @click="linkTo('./SetGird')" v-if="checkType == 2">网格配置</span>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<component v-if="refresh && isAdmin" :is="component" @change="onChange" :params="params"> </component>
|
||||
<div class="tabs" v-if="isTab && isAdmin">
|
||||
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
|
||||
<img :src="tabIndex == index ? item.activeImg : item.img" alt="" />
|
||||
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isAdmin" class="empty">
|
||||
</template>
|
||||
<div v-if="!isGridMember" class="empty">
|
||||
<img src="./components/img/no-admin.png" alt="">
|
||||
<p>没有网格员权限<br />无法查看网格信息哦~</p>
|
||||
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
|
||||
<div class="add-btn" @click="linkTo('./AddUser')">网格员信息申报</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,11 +32,11 @@
|
||||
import Statistics from './Statistics.vue'
|
||||
import Organization from './Organization.vue'
|
||||
import Map from './Map.vue'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppGridManagement',
|
||||
appName: '网格管理',
|
||||
|
||||
data() {
|
||||
return {
|
||||
component: 'Statistics',
|
||||
@@ -62,48 +64,48 @@ export default {
|
||||
}
|
||||
],
|
||||
isTab: true,
|
||||
isAdmin: false,
|
||||
checkType: 0,
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isGridMember() {
|
||||
return this.user.girdCheckType > 0
|
||||
},
|
||||
isGridAdmin() {
|
||||
return this.user.girdCheckType == 2
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Organization,
|
||||
Statistics,
|
||||
Map,
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange(e) {
|
||||
this.params = e.params
|
||||
this.component = e.type
|
||||
},
|
||||
tabClick(index, component) {
|
||||
this.tabIndex = index
|
||||
this.component = component
|
||||
refreshHome() {
|
||||
this.refresh = false
|
||||
this.$nextTick(() => {
|
||||
this.refresh = true
|
||||
})
|
||||
},
|
||||
isGirdUser() {
|
||||
this.isAdmin = false
|
||||
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.checkType != '0') {
|
||||
this.isAdmin = true
|
||||
this.checkType = res.data.checkType
|
||||
this.params = res.data.appGirdInfo
|
||||
}
|
||||
}
|
||||
})
|
||||
tabClick(index, component) {
|
||||
this.tabIndex = index
|
||||
this.component = component
|
||||
this.refreshHome();
|
||||
},
|
||||
linkTo(url) {
|
||||
uni.navigateTo({ url })
|
||||
uni.navigateTo({url})
|
||||
},
|
||||
handleSelectGird(v) {
|
||||
this.params = v || {}
|
||||
this.refreshHome()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
document.title = '网格管理'
|
||||
onLoad() {
|
||||
this.handleSelectGird(this.user.gridInfo)
|
||||
uni.$on('hideTab', () => {
|
||||
this.isTab = false
|
||||
})
|
||||
@@ -111,17 +113,11 @@ export default {
|
||||
this.isTab = true
|
||||
})
|
||||
},
|
||||
onLoad() {
|
||||
this.isGirdUser()
|
||||
uni.$on('goback', (res) => {
|
||||
this.params = res
|
||||
})
|
||||
uni.$on('updateGird', (res) => {
|
||||
this.isGirdUser()
|
||||
})
|
||||
onShow() {
|
||||
document.title = '网格管理'
|
||||
},
|
||||
onReachBottom() {
|
||||
if(!this.tabIndex) {
|
||||
if (!this.tabIndex) {
|
||||
uni.$emit('nextList')
|
||||
}
|
||||
},
|
||||
@@ -133,43 +129,29 @@ export default {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.pad-t32{
|
||||
.pad-t32 {
|
||||
padding-top: 32px;
|
||||
}
|
||||
.header{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
|
||||
.gird-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.select-gird{
|
||||
|
||||
.select-gird {
|
||||
width: calc(100% - 60px);
|
||||
padding: 24px 32px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16px;
|
||||
margin: 0 30px 32px;
|
||||
box-sizing: border-box;
|
||||
img{
|
||||
|
||||
img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
div{
|
||||
display: inline-block;
|
||||
width: calc(100% - 144px);
|
||||
padding-left: 20px;
|
||||
box-sizing: border-box;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 48px;
|
||||
img{
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
span{
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 112px;
|
||||
height: 48px;
|
||||
@@ -180,6 +162,7 @@ export default {
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs {
|
||||
width: 100%;
|
||||
height: 98px;
|
||||
@@ -189,14 +172,17 @@ export default {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 22px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
@@ -204,25 +190,30 @@ export default {
|
||||
color: #c4cad4;
|
||||
line-height: 8px;
|
||||
}
|
||||
|
||||
.color-3267F0 {
|
||||
color: #3267f0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty{
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
img{
|
||||
|
||||
img {
|
||||
width: 282px;
|
||||
height: 306px;
|
||||
margin: 136px auto 0;
|
||||
}
|
||||
p{
|
||||
|
||||
p {
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #999;
|
||||
line-height: 40px;
|
||||
}
|
||||
.add-btn{
|
||||
|
||||
.add-btn {
|
||||
width: 400px;
|
||||
height: 88px;
|
||||
line-height: 88px;
|
||||
|
||||
Reference in New Issue
Block a user