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 46 {
47 47 path: 'account_detail/:id',
48 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 51 meta: {
52 52 title: '用户详情',
53 53 },
... ...
... ... @@ -59,7 +59,7 @@
59 59 <span
60 60 class="mr-2"
61 61 style="
62   - width: 1.25rem;
  62 + width: 1.4rem;
63 63 height: 1.25rem;
64 64 border: 1px solid;
65 65 color: #0b55f1;
... ...
... ... @@ -84,7 +84,7 @@
84 84 </BasicForm>
85 85 </Card>
86 86 <Loading v-bind="compState" />
87   - <Authority value="api:yt:appDesign:update:put">
  87 + <Authority value="api:yt:appDesign:update:update">
88 88 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button>
89 89 </Authority>
90 90 </div>
... ...
... ... @@ -86,7 +86,7 @@
86 86 </BasicForm>
87 87 </Card>
88 88 <Loading v-bind="compState" />
89   - <Authority value="api:yt:platform:update:put">
  89 + <Authority value="api:yt:platform:update:update">
90 90 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button>
91 91 </Authority>
92 92 </div>
... ...
... ... @@ -32,7 +32,7 @@
32 32 </BasicForm>
33 33 </Card>
34 34 <Loading v-bind="compState" />
35   - <Authority value="api:yt:enterprise:update:put">
  35 + <Authority value="api:yt:enterprise:update:update">
36 36 <a-button @click="handleUpdateInfo" type="primary" class="mt-4">更新基本信息</a-button>
37 37 </Authority>
38 38 </div>
... ...
... ... @@ -2,29 +2,75 @@
2 2 <div class="platform flex">
3 3 <Card class="tab-card" :bordered="false">
4 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 23 </Tabs>
9 24 </Card>
10 25
11 26 <div style="width: 100%">
12 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 50 </div>
17 51 </div>
18 52 </template>
19 53
20 54 <script lang="ts" setup>
21 55 import { Tabs, Card } from 'ant-design-vue';
22   - import { ref } from 'vue';
  56 + import { ref, computed } from 'vue';
23 57 import EnterpriseInfo from './cpns/EnterpriseInfo.vue';
24 58 import CVIDraw from './cpns/CVIDraw.vue';
25 59 import AppDraw from './cpns/AppDraw.vue';
  60 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  61 + import { getAuthCache } from '/@/utils/auth';
26 62
27 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 74 </script>
29 75
30 76 <style lang="less" scoped>
... ... @@ -37,9 +83,11 @@
37 83 padding-left: 10px;
38 84 background-color: #fff;
39 85 }
  86 +
40 87 .tab-card {
41 88 margin: 1rem 0 1rem 1rem;
42 89 }
  90 +
43 91 .card {
44 92 margin: 1rem;
45 93 }
... ...