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 | 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 | 271 | return defHttp.get<DeviceRecord[]>({ |
| 270 | 272 | url: DeviceManagerApi.GATEWAY_DEVICE, |
| 271 | 273 | params: { |
| 272 | 274 | organizationId, |
| 273 | 275 | transportType, |
| 276 | + gatewayId, | |
| 274 | 277 | }, |
| 275 | 278 | }); |
| 276 | 279 | }; | ... | ... |
| ... | ... | @@ -297,7 +297,7 @@ export const step1Schemas: FormSchema[] = [ |
| 297 | 297 | component: 'ApiSelect', |
| 298 | 298 | ifShow: ({ values }) => values.deviceType === 'SENSOR', |
| 299 | 299 | componentProps: ({ formModel, formActionType }) => { |
| 300 | - const { transportType } = formModel; | |
| 300 | + const { transportType, deviceType, gatewayId } = formModel; | |
| 301 | 301 | const { setFieldsValue } = formActionType; |
| 302 | 302 | if (!transportType) return {}; |
| 303 | 303 | return { |
| ... | ... | @@ -312,6 +312,7 @@ export const step1Schemas: FormSchema[] = [ |
| 312 | 312 | showSearch: true, |
| 313 | 313 | params: { |
| 314 | 314 | transportType, |
| 315 | + gatewayId: deviceType === DeviceTypeEnum.SENSOR && gatewayId ? gatewayId : null, | |
| 315 | 316 | }, |
| 316 | 317 | placeholder: '请选择网关设备', |
| 317 | 318 | valueField: 'tbDeviceId', | ... | ... |