Commit 2dc5f2b2c38505c6158d067d53f10f41b0aa88b1

Authored by fengtao
1 parent c1c9ea5f

fix:修改企业定制客户 企业信息按钮不显示

@@ -33,13 +33,19 @@ @@ -33,13 +33,19 @@
33 </Card> 33 </Card>
34 <Loading v-bind="compState" /> 34 <Loading v-bind="compState" />
35 <Authority value="api:yt:enterprise:update:update"> 35 <Authority value="api:yt:enterprise:update:update">
36 - <a-button @click="handleUpdateInfo" type="primary" class="mt-4">更新基本信息</a-button> 36 + <a-button
  37 + v-if="isWhereAdmin !== 'CUSTOMER_USER'"
  38 + @click="handleUpdateInfo"
  39 + type="primary"
  40 + class="mt-4"
  41 + >更新基本信息</a-button
  42 + >
37 </Authority> 43 </Authority>
38 </div> 44 </div>
39 </template> 45 </template>
40 46
41 <script lang="ts"> 47 <script lang="ts">
42 - import { defineComponent, onMounted, ref } from 'vue'; 48 + import { defineComponent, onMounted, ref, computed } from 'vue';
43 import { Card, Upload } from 'ant-design-vue'; 49 import { Card, Upload } from 'ant-design-vue';
44 import { BasicForm, useForm } from '/@/components/Form/index'; 50 import { BasicForm, useForm } from '/@/components/Form/index';
45 import { schemas, provSchemas } from '../config/enterPriseInfo.config'; 51 import { schemas, provSchemas } from '../config/enterPriseInfo.config';
@@ -53,6 +59,8 @@ @@ -53,6 +59,8 @@
53 import type { FileItem } from '/@/components/Upload/src/typing'; 59 import type { FileItem } from '/@/components/Upload/src/typing';
54 import type { CityItem, Code } from '../types'; 60 import type { CityItem, Code } from '../types';
55 import { Authority } from '/@/components/Authority'; 61 import { Authority } from '/@/components/Authority';
  62 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  63 + import { getAuthCache } from '/@/utils/auth';
56 64
57 export default defineComponent({ 65 export default defineComponent({
58 components: { 66 components: {
@@ -65,6 +73,17 @@ @@ -65,6 +73,17 @@
65 LoadingOutlined, 73 LoadingOutlined,
66 }, 74 },
67 setup() { 75 setup() {
  76 + const userInfo: any = getAuthCache(USER_INFO_KEY);
  77 + const isWhereAdmin: any = computed(() => {
  78 + if (userInfo.roles.includes('TENANT_ADMIN')) {
  79 + return 'TENANT_ADMIN';
  80 + } else if (userInfo.roles.includes('CUSTOMER_USER')) {
  81 + return 'CUSTOMER_USER';
  82 + } else {
  83 + return 'SYS_ADMIN';
  84 + }
  85 + });
  86 +
68 const loading = ref(false); 87 const loading = ref(false);
69 const compState = ref({ 88 const compState = ref({
70 absolute: false, 89 absolute: false,
@@ -355,6 +374,7 @@ @@ -355,6 +374,7 @@
355 beforeUploadqrcodePic, 374 beforeUploadqrcodePic,
356 registerCustomForm, 375 registerCustomForm,
357 loading, 376 loading,
  377 + isWhereAdmin,
358 }; 378 };
359 }, 379 },
360 }); 380 });
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <Tabs.TabPane 5 <Tabs.TabPane
6 v-if=" 6 v-if="
7 isWhereAdmin == 'TENANT_ADMIN' || 7 isWhereAdmin == 'TENANT_ADMIN' ||
8 - (isWhereAdmin == 'SYS_ADMIN' && isWhereAdmin !== 'CUSTOMER_USER') 8 + (isWhereAdmin == 'SYS_ADMIN' || isWhereAdmin == 'CUSTOMER_USER')
9 " 9 "
10 key="企业信息" 10 key="企业信息"
11 tab="企业信息" 11 tab="企业信息"
@@ -28,7 +28,8 @@ @@ -28,7 +28,8 @@
28 <EnterpriseInfo 28 <EnterpriseInfo
29 v-if=" 29 v-if="
30 (activeKey === '企业信息' && isWhereAdmin == 'SYS_ADMIN') || 30 (activeKey === '企业信息' && isWhereAdmin == 'SYS_ADMIN') ||
31 - (isWhereAdmin == 'TENANT_ADMIN' && isWhereAdmin !== 'CUSTOMER_USER') 31 + isWhereAdmin == 'TENANT_ADMIN' ||
  32 + isWhereAdmin == 'CUSTOMER_USER'
32 " 33 "
33 /> 34 />
34 <CVIDraw 35 <CVIDraw