Commit 09f9248ea09bf40164351b71382d0baeeb5ec642

Authored by xp.Huang
2 parents 024871c3 7a0b4310

Merge branch 'ww' into 'main'

fix: BUG in teambition

See merge request huang/yun-teng-iot-front!422
... ... @@ -28,6 +28,7 @@ enum Api {
28 28 setRoleStatus = '/role/update_status/',
29 29 MenuList = '/system/getMenuList',
30 30 RolePageList = '/role',
  31 + TenantRolePageList = '/role/tenant',
31 32 SaveOrUpdateRoleInfoWithMenu = '/role/save_with_menu',
32 33 DeleteRole = '/role',
33 34 GetAllRoleList = '/role/find/list',
... ... @@ -80,6 +81,10 @@ export const getMenuList = (params?: MenuParams) =>
80 81
81 82 export const getRoleListByPage = (params?: RolePageParams) =>
82 83 defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });
  84 +
  85 +export const getTenantRoleRoleListByPage = (params?: RolePageParams) =>
  86 + defHttp.get<RolePageListGetResultModel>({ url: Api.TenantRolePageList, params });
  87 +
83 88 export const getTenantRoleListByPage = (params?: RolePageParams) =>
84 89 defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });
85 90
... ...
... ... @@ -21,6 +21,9 @@ export const descSchema = (emit: EmitType): DescItem[] => {
21 21 {
22 22 field: 'name',
23 23 label: '设备名称',
  24 + render(val, data: Record<'alias' | 'name', string>) {
  25 + return h('span', {}, data.alias || val);
  26 + },
24 27 },
25 28 {
26 29 field: 'label',
... ... @@ -51,7 +54,7 @@ export const descSchema = (emit: EmitType): DescItem[] => {
51 54 return h(
52 55 Button,
53 56 { type: 'link', style: { padding: 0 }, onClick: () => emit('open-gateway-device', data) },
54   - { default: () => val }
  57 + { default: () => data.gatewayAlias || val }
55 58 );
56 59 },
57 60 },
... ...
... ... @@ -5,7 +5,7 @@
5 5 @register="register"
6 6 destroyOnClose
7 7 @close="closeDrawer"
8   - :title="deviceDetail.name"
  8 + :title="deviceDetail.alias || deviceDetail.name"
9 9 width="80%"
10 10 >
11 11 <Tabs v-model:activeKey="activeKey" :size="size">
... ...
... ... @@ -62,6 +62,7 @@
62 62 const current = ref(0);
63 63 const isUpdate = ref<Boolean>(false);
64 64 const deviceInfo = ref({});
  65 + let currentDeviceData = {} as Recordable;
65 66 const getTitle = computed(() => (!unref(isUpdate) ? '新增设备' : '编辑设备'));
66 67 // 所有参数
67 68 let stepState = ref();
... ... @@ -71,6 +72,7 @@
71 72 isUpdate.value = data?.isUpdate;
72 73 if (unref(isUpdate)) {
73 74 const { record } = data;
  75 + currentDeviceData = record;
74 76 unref(DeviceStep1Ref)?.parentSetFieldsValue({
75 77 ...record,
76 78 profile: record.deviceProfile.name,
... ... @@ -138,8 +140,10 @@
138 140 confirmLoading: true,
139 141 });
140 142 if (unref(isUpdate)) {
  143 + console.log(currentDeviceData);
141 144 const editData = {
142 145 ...unref(stepState),
  146 + customerId: currentDeviceData.customerId,
143 147 deviceInfo: {
144 148 avatar: DeviceStep1Ref.value?.devicePic,
145 149 ...DeviceStep1Ref.value?.positionState,
... ...
... ... @@ -2,9 +2,9 @@
2 2 <div style="background-color: #f0f2f5">
3 3 <BasicTable @register="registerTable">
4 4 <template #tbDeviceName="{ record }">
5   - <div style="color: #619eff" class="cursor-pointer" @click="handleGetTbDeviceId(record)">{{
6   - record.tbDeviceName
7   - }}</div>
  5 + <div style="color: #619eff" class="cursor-pointer" @click="handleGetTbDeviceId(record)">
  6 + {{ record.alias || record.tbDeviceName }}
  7 + </div>
8 8 </template>
9 9 <template #deviceState="{ record }">
10 10 <Tag
... ...
... ... @@ -4,6 +4,7 @@
4 4 v-bind="$attrs"
5 5 @register="registerDrawer"
6 6 @ok="handleSubmit"
  7 + destroy-on-close
7 8 width="50%"
8 9 showFooter
9 10 @close="handleClose"
... ... @@ -245,7 +246,6 @@
245 246 operationType: trigger?.triggerCondition?.condition?.condition[0]?.valueType,
246 247 detail: trigger?.triggerCondition?.alarmDetails,
247 248 entityId: trigger?.entityId,
248   - deviceType: trigger?.deviceType,
249 249 deviceProfileId: trigger?.deviceProfileId,
250 250 replaceValue: trigger?.triggerCondition?.condition?.spec?.predicate?.defaultValue,
251 251 time: trigger?.triggerCondition?.condition?.spec?.predicate?.defaultValue,
... ... @@ -326,7 +326,6 @@
326 326 operationType: condition?.triggerCondition?.condition?.condition[0]?.valueType,
327 327 detail: condition?.triggerCondition?.alarmDetails,
328 328 entityId: condition?.entityId,
329   - deviceType: condition?.deviceType,
330 329 deviceProfileId: condition?.deviceProfileId,
331 330 replaceValue: condition?.triggerCondition?.condition?.spec?.predicate?.defaultValue,
332 331 time: condition?.triggerCondition?.condition?.spec?.predicate?.defaultValue,
... ... @@ -399,7 +398,6 @@
399 398 deviceId: action.deviceId,
400 399 alarm_config: action.alarmProfileId,
401 400 alarm_level: action.doContext.alarmLevel,
402   - deviceType: action.deviceType,
403 401 });
404 402 // 如果是设备输出设置脚本值
405 403 if (action.outTarget === 'DEVICE_OUT') {
... ... @@ -439,7 +437,6 @@
439 437 .valueType,
440 438 detail: action.doContext.clearRule[index].triggerCondition.alarmDetails,
441 439 entityId: action.doContext.clearRule[index].entityId,
442   - deviceType: action.doContext.clearRule[index].entityId?.deviceType,
443 440 deviceProfileId: action.doContext.clearRule[index]?.deviceProfileId,
444 441 replaceValue:
445 442 action.doContext.clearRule[index].triggerCondition.condition.spec.predicate
... ...
... ... @@ -58,7 +58,7 @@
58 58 <script lang="ts">
59 59 import { defineComponent, nextTick } from 'vue';
60 60 import { BasicTable, useTable, TableAction } from '/@/components/Table';
61   - import { delRole, getRoleListByPage, setRoleStatus } from '/@/api/system/system';
  61 + import { delRole, getTenantRoleRoleListByPage, setRoleStatus } from '/@/api/system/system';
62 62 import { useMessage } from '/@/hooks/web/useMessage';
63 63 import { useDrawer } from '/@/components/Drawer';
64 64 import RoleDrawer from './RoleDrawer.vue';
... ... @@ -78,7 +78,7 @@
78 78 }
79 79 const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({
80 80 title: '租户角色列表',
81   - api: getRoleListByPage,
  81 + api: getTenantRoleRoleListByPage,
82 82 columns,
83 83 formConfig: {
84 84 labelWidth: 120,
... ...