Files
dvcp_v2_wxcp_app/library/apps/AppGridManagement/AppGridManagement.vue

228 lines
4.9 KiB
Vue
Raw Normal View History

2021-12-15 18:07:16 +08:00
<template>
<div class="AppGridManagement">
2022-06-13 09:57:52 +08:00
<template v-if="isGridMember">
<div class="pad-t32" v-if="component != 'Map'"/>
<div class="select-gird" v-if="component != 'Map'" flex>
2022-06-13 10:04:44 +08:00
<AiPagePicker type="gird" class="fill" @select="handleSelectGird">
2022-06-13 09:57:52 +08:00
<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>
2022-01-17 14:24:54 +08:00
</div>
2022-06-13 09:57:52 +08:00
<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>
2022-01-13 09:21:45 +08:00
</div>
2022-06-13 09:57:52 +08:00
</template>
<div v-if="!isGridMember" class="empty">
2022-01-14 15:59:11 +08:00
<img src="./components/img/no-admin.png" alt="">
2022-06-13 09:57:52 +08:00
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
2022-03-18 14:45:15 +08:00
<div class="add-btn" @click="linkTo('./AddUser')">网格员信息申报</div>
2022-01-14 15:59:11 +08:00
</div>
2021-12-15 18:07:16 +08:00
</div>
</template>
<script>
2022-01-13 09:21:45 +08:00
import Statistics from './Statistics.vue'
import Organization from './Organization.vue'
import Map from './Map.vue'
2022-06-13 09:57:52 +08:00
import {mapState} from 'vuex'
2021-12-15 18:07:16 +08:00
export default {
name: 'AppGridManagement',
appName: '网格管理',
data() {
return {
2022-01-14 13:54:17 +08:00
component: 'Statistics',
2022-01-13 09:21:45 +08:00
params: {},
refresh: true,
tabIndex: 0,
tabs: [
{
2022-01-13 17:07:59 +08:00
img: require('./components/img/statistics-icon.png'),
activeImg: require('./components/img/statistics-icon-active.png'),
2022-01-13 09:21:45 +08:00
text: '统计',
component: 'Statistics',
},
{
2022-01-13 17:07:59 +08:00
img: require('./components/img/org-icon.png'),
activeImg: require('./components/img/org-icon-active.png'),
2022-01-13 09:21:45 +08:00
text: '组织',
component: 'Organization',
},
{
2022-01-13 17:07:59 +08:00
img: require('./components/img/map-icon.png'),
activeImg: require('./components/img/map-icon-active.png'),
2022-01-13 09:21:45 +08:00
text: '地图',
component: 'Map'
}
],
isTab: true,
2021-12-15 18:07:16 +08:00
}
},
2022-06-13 09:57:52 +08:00
computed: {
...mapState(['user']),
isGridMember() {
return this.user.girdCheckType > 0
},
isGridAdmin() {
return this.user.girdCheckType == 2
}
},
2022-01-13 09:21:45 +08:00
components: {
Organization,
Statistics,
Map,
},
2021-12-15 18:07:16 +08:00
methods: {
onChange(e) {
this.params = e.params
this.component = e.type
2022-01-13 09:21:45 +08:00
},
2022-06-13 09:57:52 +08:00
refreshHome() {
2022-01-13 09:21:45 +08:00
this.refresh = false
this.$nextTick(() => {
this.refresh = true
})
},
2022-06-13 09:57:52 +08:00
tabClick(index, component) {
this.tabIndex = index
this.component = component
this.refreshHome();
2022-01-14 15:59:11 +08:00
},
2022-01-17 14:24:54 +08:00
linkTo(url) {
2022-06-13 09:57:52 +08:00
uni.navigateTo({url})
2022-01-17 14:24:54 +08:00
},
2022-06-13 09:57:52 +08:00
handleSelectGird(v) {
this.params = v || {}
this.refreshHome()
}
2021-12-15 18:07:16 +08:00
},
2022-06-13 09:57:52 +08:00
onLoad() {
this.handleSelectGird(this.user.gridInfo)
2022-01-13 09:21:45 +08:00
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
})
},
2022-06-13 09:57:52 +08:00
onShow() {
document.title = '网格管理'
2022-01-14 15:59:11 +08:00
},
2022-01-13 09:21:45 +08:00
onReachBottom() {
2022-06-13 09:57:52 +08:00
if (!this.tabIndex) {
2022-01-13 09:21:45 +08:00
uni.$emit('nextList')
}
},
2021-12-15 18:07:16 +08:00
}
</script>
<style lang="scss" scoped>
2022-01-13 09:21:45 +08:00
.AppGridManagement {
2022-01-14 11:44:27 +08:00
height: 100vh;
2021-12-15 18:07:16 +08:00
}
2022-03-18 14:45:15 +08:00
2022-06-13 09:57:52 +08:00
.pad-t32 {
2022-01-17 14:24:54 +08:00
padding-top: 32px;
}
2022-06-13 09:57:52 +08:00
.gird-icon {
margin-right: 8px;
2022-01-24 16:08:33 +08:00
}
2022-06-13 09:57:52 +08:00
.select-gird {
2022-01-17 14:24:54 +08:00
width: calc(100% - 60px);
padding: 24px 32px;
background: #FFFFFF;
border-radius: 16px;
margin: 0 30px 32px;
box-sizing: border-box;
2022-06-13 09:57:52 +08:00
img {
2022-01-17 14:24:54 +08:00
width: 32px;
height: 32px;
vertical-align: middle;
}
2022-06-13 09:57:52 +08:00
span {
2022-01-17 14:24:54 +08:00
display: inline-block;
width: 112px;
height: 48px;
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #3F8DF5;
line-height: 48px;
}
}
2022-06-13 09:57:52 +08:00
2022-01-13 09:21:45 +08:00
.tabs {
width: 100%;
height: 98px;
background: #fff;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
2022-06-13 09:57:52 +08:00
2022-01-13 09:21:45 +08:00
.item {
flex: 1;
text-align: center;
2022-06-13 09:57:52 +08:00
2022-01-13 09:21:45 +08:00
img {
width: 56px;
height: 56px;
margin-top: 8px;
}
2022-06-13 09:57:52 +08:00
2022-01-13 09:21:45 +08:00
p {
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #c4cad4;
line-height: 8px;
}
2022-06-13 09:57:52 +08:00
2022-01-13 09:21:45 +08:00
.color-3267F0 {
color: #3267f0;
}
}
2021-12-15 18:07:16 +08:00
}
2022-06-13 09:57:52 +08:00
.empty {
2022-01-14 15:59:11 +08:00
text-align: center;
2022-06-13 09:57:52 +08:00
img {
2022-01-14 15:59:11 +08:00
width: 282px;
height: 306px;
margin: 136px auto 0;
}
2022-06-13 09:57:52 +08:00
p {
2022-01-14 15:59:11 +08:00
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
2022-06-13 09:57:52 +08:00
.add-btn {
2022-03-18 14:45:15 +08:00
width: 400px;
height: 88px;
line-height: 88px;
text-align: center;
border-radius: 8px;
background-color: #3267f0;
color: #fff;
font-size: 30px;
margin: 200px auto 0;
}
2022-01-14 15:59:11 +08:00
}
2022-01-13 09:21:45 +08:00
</style>