整合统一网格员身份信息获取

This commit is contained in:
aixianling
2022-03-17 10:27:03 +08:00
parent f5b301d2ec
commit e0ec7ddc27
2 changed files with 20 additions and 17 deletions

View File

@@ -85,7 +85,7 @@ export default {
...mapActions(['selectPrivilegedContact']), ...mapActions(['selectPrivilegedContact']),
getDetail() { getDetail() {
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => { this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) { if (res?.data) {
this.detailInfo = res.data this.detailInfo = res.data
if (this.fromType == 'edit') { if (this.fromType == 'edit') {
this.form = res.data this.form = res.data

View File

@@ -2,12 +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="gird" class="fill" :selected="[params]" @select="handleSelectGird">
<img src="./components/img/gird-icon.png" alt="" class="gird-icon"> <img src="./components/img/gird-icon.png" alt="" class="gird-icon">
<div class="gird-name" v-text="params.girdName" /> <div class="gird-name" v-text="params.girdName"/>
<u-icon name="arrow-down" color="#999" class="down-icon" size="20"/> <u-icon name="arrow-down" color="#999" class="down-icon" size="20"/>
</AiPagePicker> </AiPagePicker>
<span @click="linkTo('./SetGird')" v-if="checkType == 2">网格配置</span> <span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
</div> </div>
<component v-if="refresh && isAdmin" :is="component" @change="onChange" :params="params"></component> <component v-if="refresh && isAdmin" :is="component" @change="onChange" :params="params"></component>
<div class="tabs" v-if="isTab && isAdmin"> <div class="tabs" v-if="isTab && isAdmin">
@@ -27,10 +27,20 @@
import Statistics from './Statistics.vue' import Statistics from './Statistics.vue'
import Organization from './Organization.vue' import Organization from './Organization.vue'
import Map from './Map.vue' import Map from './Map.vue'
import {mapState} from "vuex";
export default { export default {
name: 'AppGridManagement', name: 'AppGridManagement',
appName: '网格管理', appName: '网格管理',
computed: {
...mapState(['user']),
isAdmin() {
return this.user.girdCheckType > 0
},
isGridAdmin() {
return this.user.girdCheckType == 2
}
},
data() { data() {
return { return {
component: 'Statistics', component: 'Statistics',
@@ -58,8 +68,6 @@ export default {
} }
], ],
isTab: true, isTab: true,
isAdmin: false,
checkType: ''
} }
}, },
components: { components: {
@@ -67,7 +75,6 @@ export default {
Statistics, Statistics,
Map, Map,
}, },
methods: { methods: {
onChange(e) { onChange(e) {
this.params = e.params this.params = e.params
@@ -83,15 +90,10 @@ export default {
this.component = component this.component = component
this.refreshHome(); this.refreshHome();
}, },
isGirdUser() { getGridInfo() {
this.isAdmin = false this.isAdmin && this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res?.data) { if (res?.data) {
if (res.data.checkType != '0') { this.params = res.data?.appGirdInfo || {}
this.isAdmin = true
this.checkType = res.data.checkType
this.params = res.data.appGirdInfo
}
} }
}) })
}, },
@@ -104,7 +106,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
this.isGirdUser() this.getGridInfo()
uni.$on('hideTab', () => { uni.$on('hideTab', () => {
this.isTab = false this.isTab = false
}) })
@@ -139,7 +141,8 @@ export default {
border-radius: 16px; border-radius: 16px;
margin: 0 30px 32px; margin: 0 30px 32px;
box-sizing: border-box; box-sizing: border-box;
.gird-name{
.gird-name {
display: inline-block; display: inline-block;
max-width: calc(100% - 108px); max-width: calc(100% - 108px);
white-space: nowrap; white-space: nowrap;