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