Commit f8645d4c04ac6f305637903087454181710b66bf
1 parent
bd736be5
fix: DEFECT-1361修复数据看板选择服务无输入参数时,无法通过验证
Showing
2 changed files
with
6 additions
and
2 deletions
| @@ -302,7 +302,9 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -302,7 +302,9 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 302 | placeholder: '请选择服务', | 302 | placeholder: '请选择服务', |
| 303 | getPopupContainer: () => document.body, | 303 | getPopupContainer: () => document.body, |
| 304 | onChange(value: string, options: ModelOfMatterParams) { | 304 | onChange(value: string, options: ModelOfMatterParams) { |
| 305 | - const command = value ? (options.functionJson.inputData || [])[0].serviceCommand : null; | 305 | + const command = value |
| 306 | + ? (options.functionJson.inputData || [])[0]?.serviceCommand | ||
| 307 | + : null; | ||
| 306 | setFieldsValue({ [DataSourceField.COMMAND]: command }); | 308 | setFieldsValue({ [DataSourceField.COMMAND]: command }); |
| 307 | }, | 309 | }, |
| 308 | }; | 310 | }; |
| @@ -31,11 +31,13 @@ export function useSendCommand() { | @@ -31,11 +31,13 @@ export function useSendCommand() { | ||
| 31 | params = customCommand.command!; | 31 | params = customCommand.command!; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | + console.log(params); | ||
| 35 | + | ||
| 34 | // 控制按钮下发命令为0 或 1 | 36 | // 控制按钮下发命令为0 或 1 |
| 35 | await sendCommandOneway({ | 37 | await sendCommandOneway({ |
| 36 | deviceId, | 38 | deviceId, |
| 37 | value: { | 39 | value: { |
| 38 | - params: params, | 40 | + params: params || null, |
| 39 | persistent: true, | 41 | persistent: true, |
| 40 | additionalInfo: { | 42 | additionalInfo: { |
| 41 | cmdType: 'API', | 43 | cmdType: 'API', |