Commit f0e3f398fd11704c4a2297839405a09b6b3b40b8
Merge branch 'dev_by_ft' into 'main_dev'
fix: 修改视频配置,点击编辑回显,部分回显失败 See merge request yunteng/thingskit-front!1201
Showing
3 changed files
with
17 additions
and
8 deletions
@@ -4,14 +4,11 @@ import { defHttp } from '/@/utils/http/axios'; | @@ -4,14 +4,11 @@ import { defHttp } from '/@/utils/http/axios'; | ||
4 | import { isString } from '/@/utils/is'; | 4 | import { isString } from '/@/utils/is'; |
5 | import { OrderByEnum } from '/@/views/device/localtion/cpns/TimePeriodForm/config'; | 5 | import { OrderByEnum } from '/@/views/device/localtion/cpns/TimePeriodForm/config'; |
6 | 6 | ||
7 | -// 获取设备配置 | ||
8 | -export const getDeviceProfile = ({ deviceType, transportType }) => { | 7 | +// 获取设备配置,很多地方使用,不能修改这里 |
8 | +export const getDeviceProfile = (deviceType?: string) => { | ||
9 | return defHttp.get<DeviceProfileModel[]>({ | 9 | return defHttp.get<DeviceProfileModel[]>({ |
10 | url: '/device_profile/me/list', | 10 | url: '/device_profile/me/list', |
11 | - params: { | ||
12 | - deviceType: isString(deviceType) ? deviceType : undefined, | ||
13 | - transportType: isString(transportType) ? transportType : undefined, | ||
14 | - }, | 11 | + params: { deviceType: isString(deviceType) ? deviceType : undefined }, |
15 | }); | 12 | }); |
16 | }; | 13 | }; |
17 | 14 | ||
@@ -62,3 +59,14 @@ export const getDeviceAttribute = (entityId: string) => { | @@ -62,3 +59,14 @@ export const getDeviceAttribute = (entityId: string) => { | ||
62 | } | 59 | } |
63 | ); | 60 | ); |
64 | }; | 61 | }; |
62 | + | ||
63 | +//获取设备配置,新增传协议类型 | ||
64 | +export const getDeviceProfileByTransportType = ({ deviceType, transportType }) => { | ||
65 | + return defHttp.get<DeviceProfileModel[]>({ | ||
66 | + url: '/device_profile/me/list', | ||
67 | + params: { | ||
68 | + deviceType: isString(deviceType) ? deviceType : undefined, | ||
69 | + transportType: isString(transportType) ? transportType : undefined, | ||
70 | + }, | ||
71 | + }); | ||
72 | +}; |
@@ -131,6 +131,7 @@ | @@ -131,6 +131,7 @@ | ||
131 | await setFieldsValue({ | 131 | await setFieldsValue({ |
132 | videoType: record.videoPlatformDTO?.type, | 132 | videoType: record.videoPlatformDTO?.type, |
133 | ...params, | 133 | ...params, |
134 | + ...(record?.params || {}), | ||
134 | }); | 135 | }); |
135 | } else { | 136 | } else { |
136 | editId.value = ''; | 137 | editId.value = ''; |
1 | -import { getDeviceProfile } from '/@/api/alarm/position'; | 1 | +import { getDeviceProfileByTransportType } from '/@/api/alarm/position'; |
2 | import { FormSchema } from '/@/components/Form'; | 2 | import { FormSchema } from '/@/components/Form'; |
3 | 3 | ||
4 | enum FormFieldsEnum { | 4 | enum FormFieldsEnum { |
@@ -40,7 +40,7 @@ export const formSchemas: FormSchema[] = [ | @@ -40,7 +40,7 @@ export const formSchemas: FormSchema[] = [ | ||
40 | const { getFieldsValue } = formActionType; | 40 | const { getFieldsValue } = formActionType; |
41 | const { transportType } = getFieldsValue(); | 41 | const { transportType } = getFieldsValue(); |
42 | return { | 42 | return { |
43 | - api: getDeviceProfile, | 43 | + api: getDeviceProfileByTransportType, |
44 | params: { | 44 | params: { |
45 | deviceType: formModel[FormFieldsEnum.DEVICE_TYPE], | 45 | deviceType: formModel[FormFieldsEnum.DEVICE_TYPE], |
46 | transportType, | 46 | transportType, |