Commit eb8a7ad56db2277c258e5c6f203500abcc5a6f07
Committed by
xp.Huang
1 parent
e3a58369
fix: 修改视频配置,点击编辑回显,部分回显失败
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, |