Commit 74aac58aa2f511be0da98b23daf375d524e16874

Authored by xp.Huang
2 parents bc34d678 0f7e9f5e

Merge branch 'dev-ft' into 'main'

fix:修改Teambition上的问题

See merge request huang/yun-teng-iot-front!297
@@ -46,8 +46,8 @@ export const AccountDetail: AppRouteRecordRaw = { @@ -46,8 +46,8 @@ export const AccountDetail: AppRouteRecordRaw = {
46 { 46 {
47 path: 'account_detail/:id', 47 path: 'account_detail/:id',
48 name: 'Account_Detail', 48 name: 'Account_Detail',
49 - // component: () => import('/@/views/system/account/AccountDetail.vue'),  
50 - component: () => import('../../views/alarm/config/ContactDrawer.vue'), 49 + component: () => import('/@/views/system/account/AccountDetail.vue'),
  50 + // component: () => import('../../views/alarm/config/ContactDrawer.vue'),
51 meta: { 51 meta: {
52 title: '用户详情', 52 title: '用户详情',
53 }, 53 },
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 <span 59 <span
60 class="mr-2" 60 class="mr-2"
61 style=" 61 style="
62 - width: 1.25rem; 62 + width: 1.4rem;
63 height: 1.25rem; 63 height: 1.25rem;
64 border: 1px solid; 64 border: 1px solid;
65 color: #0b55f1; 65 color: #0b55f1;
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 </BasicForm> 84 </BasicForm>
85 </Card> 85 </Card>
86 <Loading v-bind="compState" /> 86 <Loading v-bind="compState" />
87 - <Authority value="api:yt:appDesign:update:put"> 87 + <Authority value="api:yt:appDesign:update:update">
88 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button> 88 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button>
89 </Authority> 89 </Authority>
90 </div> 90 </div>
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 </BasicForm> 86 </BasicForm>
87 </Card> 87 </Card>
88 <Loading v-bind="compState" /> 88 <Loading v-bind="compState" />
89 - <Authority value="api:yt:platform:update:put"> 89 + <Authority value="api:yt:platform:update:update">
90 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button> 90 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button>
91 </Authority> 91 </Authority>
92 </div> 92 </div>
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 </BasicForm> 32 </BasicForm>
33 </Card> 33 </Card>
34 <Loading v-bind="compState" /> 34 <Loading v-bind="compState" />
35 - <Authority value="api:yt:enterprise:update:put"> 35 + <Authority value="api:yt:enterprise:update:update">
36 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">更新基本信息</a-button> 36 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">更新基本信息</a-button>
37 </Authority> 37 </Authority>
38 </div> 38 </div>
@@ -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 }