Commit 241476aaaeff11fd255be544e0dcc416657ef688
Merge branch 'fix/product-edit-gateaway' into 'main_dev'
fix: 修复上报网关子设备bug See merge request yunteng/thingskit-front!1398
Showing
2 changed files
with
7 additions
and
3 deletions
| @@ -264,13 +264,16 @@ export const getGATEWAYdevice = async (params: { | @@ -264,13 +264,16 @@ export const getGATEWAYdevice = async (params: { | ||
| 264 | ); | 264 | ); |
| 265 | }; | 265 | }; |
| 266 | 266 | ||
| 267 | -export const getGatewayDevice = (params: Record<'organizationId' | 'transportType', string>) => { | ||
| 268 | - const { organizationId, transportType } = params; | 267 | +export const getGatewayDevice = ( |
| 268 | + params: Record<'organizationId' | 'transportType' | 'gatewayId', string> | ||
| 269 | +) => { | ||
| 270 | + const { organizationId, transportType, gatewayId } = params; | ||
| 269 | return defHttp.get<DeviceRecord[]>({ | 271 | return defHttp.get<DeviceRecord[]>({ |
| 270 | url: DeviceManagerApi.GATEWAY_DEVICE, | 272 | url: DeviceManagerApi.GATEWAY_DEVICE, |
| 271 | params: { | 273 | params: { |
| 272 | organizationId, | 274 | organizationId, |
| 273 | transportType, | 275 | transportType, |
| 276 | + gatewayId, | ||
| 274 | }, | 277 | }, |
| 275 | }); | 278 | }); |
| 276 | }; | 279 | }; |
| @@ -297,7 +297,7 @@ export const step1Schemas: FormSchema[] = [ | @@ -297,7 +297,7 @@ export const step1Schemas: FormSchema[] = [ | ||
| 297 | component: 'ApiSelect', | 297 | component: 'ApiSelect', |
| 298 | ifShow: ({ values }) => values.deviceType === 'SENSOR', | 298 | ifShow: ({ values }) => values.deviceType === 'SENSOR', |
| 299 | componentProps: ({ formModel, formActionType }) => { | 299 | componentProps: ({ formModel, formActionType }) => { |
| 300 | - const { transportType } = formModel; | 300 | + const { transportType, deviceType, gatewayId } = formModel; |
| 301 | const { setFieldsValue } = formActionType; | 301 | const { setFieldsValue } = formActionType; |
| 302 | if (!transportType) return {}; | 302 | if (!transportType) return {}; |
| 303 | return { | 303 | return { |
| @@ -312,6 +312,7 @@ export const step1Schemas: FormSchema[] = [ | @@ -312,6 +312,7 @@ export const step1Schemas: FormSchema[] = [ | ||
| 312 | showSearch: true, | 312 | showSearch: true, |
| 313 | params: { | 313 | params: { |
| 314 | transportType, | 314 | transportType, |
| 315 | + gatewayId: deviceType === DeviceTypeEnum.SENSOR && gatewayId ? gatewayId : null, | ||
| 315 | }, | 316 | }, |
| 316 | placeholder: '请选择网关设备', | 317 | placeholder: '请选择网关设备', |
| 317 | valueField: 'tbDeviceId', | 318 | valueField: 'tbDeviceId', |