Showing
1 changed file
with
55 additions
and
7 deletions
@@ -2,29 +2,75 @@ | @@ -2,29 +2,75 @@ | ||
2 | <div class="platform flex"> | 2 | <div class="platform flex"> |
3 | <Card class="tab-card" :bordered="false"> | 3 | <Card class="tab-card" :bordered="false"> |
4 | <Tabs v-model:activeKey="activeKey" tab-position="left"> | 4 | <Tabs v-model:activeKey="activeKey" tab-position="left"> |
5 | - <Tabs.TabPane key="企业信息" tab="企业信息" /> | ||
6 | - <Tabs.TabPane key="平台信息" tab="平台信息" /> | ||
7 | - <Tabs.TabPane key="APP信息" tab="APP信息" /> | 5 | + <Tabs.TabPane |
6 | + v-if=" | ||
7 | + isWhereAdmin == 'TENANT_ADMIN' || | ||
8 | + (isWhereAdmin == 'SYS_ADMIN' && isWhereAdmin !== 'CUSTOMER_USER') | ||
9 | + " | ||
10 | + key="企业信息" | ||
11 | + tab="企业信息" | ||
12 | + /> | ||
13 | + <Tabs.TabPane | ||
14 | + v-if="isWhereAdmin !== 'CUSTOMER_USER' && isWhereAdmin !== 'TENANT_ADMIN'" | ||
15 | + key="平台信息" | ||
16 | + tab="平台信息" | ||
17 | + /> | ||
18 | + <Tabs.TabPane | ||
19 | + v-if="isWhereAdmin !== 'CUSTOMER_USER' && isWhereAdmin !== 'TENANT_ADMIN'" | ||
20 | + key="APP信息" | ||
21 | + tab="APP信息" | ||
22 | + /> | ||
8 | </Tabs> | 23 | </Tabs> |
9 | </Card> | 24 | </Card> |
10 | 25 | ||
11 | <div style="width: 100%"> | 26 | <div style="width: 100%"> |
12 | <Card class="card" :title="activeKey" :bordered="false" :bodyStyle="{ display: 'none' }" /> | 27 | <Card class="card" :title="activeKey" :bordered="false" :bodyStyle="{ display: 'none' }" /> |
13 | - <EnterpriseInfo v-if="activeKey === '企业信息'" /> | ||
14 | - <CVIDraw v-else-if="activeKey === '平台信息'" /> | ||
15 | - <AppDraw v-else /> | 28 | + <EnterpriseInfo |
29 | + v-if=" | ||
30 | + (activeKey === '企业信息' && isWhereAdmin == 'SYS_ADMIN') || | ||
31 | + (isWhereAdmin == 'TENANT_ADMIN' && isWhereAdmin !== 'CUSTOMER_USER') | ||
32 | + " | ||
33 | + /> | ||
34 | + <CVIDraw | ||
35 | + v-if=" | ||
36 | + activeKey === '平台信息' && | ||
37 | + isWhereAdmin == 'SYS_ADMIN' && | ||
38 | + isWhereAdmin !== 'CUSTOMER_USER' && | ||
39 | + isWhereAdmin !== 'TENANT_ADMIN' | ||
40 | + " | ||
41 | + /> | ||
42 | + <AppDraw | ||
43 | + v-if=" | ||
44 | + activeKey === 'APP信息' && | ||
45 | + isWhereAdmin == 'SYS_ADMIN' && | ||
46 | + isWhereAdmin !== 'CUSTOMER_USER' && | ||
47 | + isWhereAdmin !== 'TENANT_ADMIN' | ||
48 | + " | ||
49 | + /> | ||
16 | </div> | 50 | </div> |
17 | </div> | 51 | </div> |
18 | </template> | 52 | </template> |
19 | 53 | ||
20 | <script lang="ts" setup> | 54 | <script lang="ts" setup> |
21 | import { Tabs, Card } from 'ant-design-vue'; | 55 | import { Tabs, Card } from 'ant-design-vue'; |
22 | - import { ref } from 'vue'; | 56 | + import { ref, computed } from 'vue'; |
23 | import EnterpriseInfo from './cpns/EnterpriseInfo.vue'; | 57 | import EnterpriseInfo from './cpns/EnterpriseInfo.vue'; |
24 | import CVIDraw from './cpns/CVIDraw.vue'; | 58 | import CVIDraw from './cpns/CVIDraw.vue'; |
25 | import AppDraw from './cpns/AppDraw.vue'; | 59 | import AppDraw from './cpns/AppDraw.vue'; |
60 | + import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | ||
61 | + import { getAuthCache } from '/@/utils/auth'; | ||
26 | 62 | ||
27 | const activeKey = ref('企业信息'); | 63 | const activeKey = ref('企业信息'); |
64 | + const userInfo: any = getAuthCache(USER_INFO_KEY); | ||
65 | + const isWhereAdmin: any = computed(() => { | ||
66 | + if (userInfo.roles.includes('TENANT_ADMIN')) { | ||
67 | + return 'TENANT_ADMIN'; | ||
68 | + } else if (userInfo.roles.includes('CUSTOMER_USER')) { | ||
69 | + return 'CUSTOMER_USER'; | ||
70 | + } else { | ||
71 | + return 'SYS_ADMIN'; | ||
72 | + } | ||
73 | + }); | ||
28 | </script> | 74 | </script> |
29 | 75 | ||
30 | <style lang="less" scoped> | 76 | <style lang="less" scoped> |
@@ -37,9 +83,11 @@ | @@ -37,9 +83,11 @@ | ||
37 | padding-left: 10px; | 83 | padding-left: 10px; |
38 | background-color: #fff; | 84 | background-color: #fff; |
39 | } | 85 | } |
86 | + | ||
40 | .tab-card { | 87 | .tab-card { |
41 | margin: 1rem 0 1rem 1rem; | 88 | margin: 1rem 0 1rem 1rem; |
42 | } | 89 | } |
90 | + | ||
43 | .card { | 91 | .card { |
44 | margin: 1rem; | 92 | margin: 1rem; |
45 | } | 93 | } |