From e0ec7ddc27ed8e0ff662898fa1af398a76116a2b Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 17 Mar 2022 10:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=90=88=E7=BB=9F=E4=B8=80=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=91=98=E8=BA=AB=E4=BB=BD=E4=BF=A1=E6=81=AF=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/saas/AppGridManagement/AddGird.vue | 2 +- .../AppGridManagement/AppGridManagement.vue | 35 ++++++++++--------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/saas/AppGridManagement/AddGird.vue b/src/saas/AppGridManagement/AddGird.vue index 5b67124b..e6698c09 100644 --- a/src/saas/AppGridManagement/AddGird.vue +++ b/src/saas/AppGridManagement/AddGird.vue @@ -85,7 +85,7 @@ export default { ...mapActions(['selectPrivilegedContact']), getDetail() { this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => { - if (res.code == 0) { + if (res?.data) { this.detailInfo = res.data if (this.fromType == 'edit') { this.form = res.data diff --git a/src/saas/AppGridManagement/AppGridManagement.vue b/src/saas/AppGridManagement/AppGridManagement.vue index cdeef2c2..c09899bc 100644 --- a/src/saas/AppGridManagement/AppGridManagement.vue +++ b/src/saas/AppGridManagement/AppGridManagement.vue @@ -2,12 +2,12 @@
- + -
+
- 网格配置 + 网格配置
@@ -27,10 +27,20 @@ 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']), + isAdmin() { + return this.user.girdCheckType > 0 + }, + isGridAdmin() { + return this.user.girdCheckType == 2 + } + }, data() { return { component: 'Statistics', @@ -58,8 +68,6 @@ export default { } ], isTab: true, - isAdmin: false, - checkType: '' } }, components: { @@ -67,7 +75,6 @@ export default { Statistics, Map, }, - methods: { onChange(e) { this.params = e.params @@ -83,15 +90,10 @@ export default { this.component = component this.refreshHome(); }, - isGirdUser() { - this.isAdmin = false - this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => { + getGridInfo() { + this.isAdmin && this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => { if (res?.data) { - if (res.data.checkType != '0') { - this.isAdmin = true - this.checkType = res.data.checkType - this.params = res.data.appGirdInfo - } + this.params = res.data?.appGirdInfo || {} } }) }, @@ -104,7 +106,7 @@ export default { } }, onLoad() { - this.isGirdUser() + this.getGridInfo() uni.$on('hideTab', () => { this.isTab = false }) @@ -139,7 +141,8 @@ export default { border-radius: 16px; margin: 0 30px 32px; box-sizing: border-box; - .gird-name{ + + .gird-name { display: inline-block; max-width: calc(100% - 108px); white-space: nowrap;