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;