Commit 2dc5f2b2c38505c6158d067d53f10f41b0aa88b1

Authored by fengtao
1 parent c1c9ea5f

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

... ... @@ -33,13 +33,19 @@
33 33 </Card>
34 34 <Loading v-bind="compState" />
35 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 43 </Authority>
38 44 </div>
39 45 </template>
40 46
41 47 <script lang="ts">
42   - import { defineComponent, onMounted, ref } from 'vue';
  48 + import { defineComponent, onMounted, ref, computed } from 'vue';
43 49 import { Card, Upload } from 'ant-design-vue';
44 50 import { BasicForm, useForm } from '/@/components/Form/index';
45 51 import { schemas, provSchemas } from '../config/enterPriseInfo.config';
... ... @@ -53,6 +59,8 @@
53 59 import type { FileItem } from '/@/components/Upload/src/typing';
54 60 import type { CityItem, Code } from '../types';
55 61 import { Authority } from '/@/components/Authority';
  62 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  63 + import { getAuthCache } from '/@/utils/auth';
56 64
57 65 export default defineComponent({
58 66 components: {
... ... @@ -65,6 +73,17 @@
65 73 LoadingOutlined,
66 74 },
67 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 87 const loading = ref(false);
69 88 const compState = ref({
70 89 absolute: false,
... ... @@ -355,6 +374,7 @@
355 374 beforeUploadqrcodePic,
356 375 registerCustomForm,
357 376 loading,
  377 + isWhereAdmin,
358 378 };
359 379 },
360 380 });
... ...
... ... @@ -5,7 +5,7 @@
5 5 <Tabs.TabPane
6 6 v-if="
7 7 isWhereAdmin == 'TENANT_ADMIN' ||
8   - (isWhereAdmin == 'SYS_ADMIN' && isWhereAdmin !== 'CUSTOMER_USER')
  8 + (isWhereAdmin == 'SYS_ADMIN' || isWhereAdmin == 'CUSTOMER_USER')
9 9 "
10 10 key="企业信息"
11 11 tab="企业信息"
... ... @@ -28,7 +28,8 @@
28 28 <EnterpriseInfo
29 29 v-if="
30 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 35 <CVIDraw
... ...