223 lines
4.8 KiB
Vue
223 lines
4.8 KiB
Vue
<template>
|
|
<div class="AppGridManagement">
|
|
<div class="pad-t32" v-if="component != 'Map' && isGridMember"></div>
|
|
<div class="select-gird" v-if="component != 'Map' && isGridMember" 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')" v-if="isGridAdmin">网格配置</span>
|
|
</div>
|
|
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params"/>
|
|
<!-- <div class="tabs" v-if="isTab && isGridMember">
|
|
<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="!isGridMember" class="empty">
|
|
<img src="./components/img/no-admin.png" alt="">
|
|
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Statistics from './Statistics.vue'
|
|
import Organization from './Organization.vue'
|
|
import Map from './Map.vue'
|
|
import {mapState} from "vuex";
|
|
|
|
export default {
|
|
name: 'AppGridManagement',
|
|
appName: '网格管理',
|
|
computed: {
|
|
...mapState(['user']),
|
|
isGridMember() {
|
|
return this.user.girdCheckType > 0
|
|
},
|
|
isGridAdmin() {
|
|
return this.user.girdCheckType == 2
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
component: 'Organization',
|
|
params: {},
|
|
refresh: true,
|
|
tabIndex: 0,
|
|
tabs: [
|
|
{
|
|
img: require('./components/img/statistics-icon.png'),
|
|
activeImg: require('./components/img/statistics-icon-active.png'),
|
|
text: '统计',
|
|
component: 'Statistics',
|
|
},
|
|
{
|
|
img: require('./components/img/org-icon.png'),
|
|
activeImg: require('./components/img/org-icon-active.png'),
|
|
text: '组织',
|
|
component: 'Organization',
|
|
},
|
|
{
|
|
img: require('./components/img/map-icon.png'),
|
|
activeImg: require('./components/img/map-icon-active.png'),
|
|
text: '地图',
|
|
component: 'Map'
|
|
}
|
|
],
|
|
isTab: true,
|
|
}
|
|
},
|
|
components: {
|
|
Organization,
|
|
Statistics,
|
|
Map,
|
|
},
|
|
methods: {
|
|
onChange(e) {
|
|
this.params = e.params
|
|
this.component = e.type
|
|
},
|
|
refreshHome() {
|
|
this.refresh = false
|
|
this.$nextTick(() => {
|
|
this.refresh = true
|
|
})
|
|
}, tabClick(index, component) {
|
|
this.tabIndex = index
|
|
this.component = component
|
|
this.refreshHome();
|
|
},
|
|
linkTo(url) {
|
|
uni.navigateTo({url})
|
|
},
|
|
handleSelectGird(v) {
|
|
this.params = v || {}
|
|
this.refreshHome()
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.handleSelectGird(this.user.gridInfo)
|
|
uni.$on('hideTab', () => {
|
|
this.isTab = false
|
|
})
|
|
uni.$on('showTab', () => {
|
|
this.isTab = true
|
|
})
|
|
},
|
|
onShow() {
|
|
document.title = '网格管理'
|
|
},
|
|
onReachBottom() {
|
|
if (!this.tabIndex) {
|
|
uni.$emit('nextList')
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.AppGridManagement {
|
|
height: 100vh;
|
|
}
|
|
|
|
.pad-t32 {
|
|
padding-top: 32px;
|
|
}
|
|
|
|
.gird-icon {
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.select-gird {
|
|
width: calc(100% - 60px);
|
|
padding: 24px 32px;
|
|
background: #FFFFFF;
|
|
border-radius: 16px;
|
|
margin: 0 30px 32px;
|
|
box-sizing: border-box;
|
|
|
|
.gird-name {
|
|
display: inline-block;
|
|
max-width: calc(100% - 108px);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
vertical-align: middle;
|
|
margin: 0 16px;
|
|
}
|
|
|
|
img {
|
|
width: 32px;
|
|
height: 32px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
span {
|
|
display: inline-block;
|
|
width: 112px;
|
|
height: 48px;
|
|
font-size: 28px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 500;
|
|
color: #3F8DF5;
|
|
line-height: 48px;
|
|
}
|
|
}
|
|
|
|
.tabs {
|
|
width: 100%;
|
|
height: 98px;
|
|
background: #fff;
|
|
border-top: 1px solid #ddd;
|
|
position: fixed;
|
|
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;
|
|
font-weight: 500;
|
|
color: #c4cad4;
|
|
line-height: 8px;
|
|
}
|
|
|
|
.color-3267F0 {
|
|
color: #3267f0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.empty {
|
|
text-align: center;
|
|
|
|
img {
|
|
width: 282px;
|
|
height: 306px;
|
|
margin: 136px auto 0;
|
|
}
|
|
|
|
p {
|
|
font-size: 28px;
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
color: #999;
|
|
line-height: 40px;
|
|
}
|
|
}
|
|
</style>
|