Commit f8645d4c04ac6f305637903087454181710b66bf

Authored by ww
1 parent bd736be5

fix: DEFECT-1361修复数据看板选择服务无输入参数时,无法通过验证

... ... @@ -302,7 +302,9 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
302 302 placeholder: '请选择服务',
303 303 getPopupContainer: () => document.body,
304 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 308 setFieldsValue({ [DataSourceField.COMMAND]: command });
307 309 },
308 310 };
... ...
... ... @@ -31,11 +31,13 @@ export function useSendCommand() {
31 31 params = customCommand.command!;
32 32 }
33 33
  34 + console.log(params);
  35 +
34 36 // 控制按钮下发命令为0 或 1
35 37 await sendCommandOneway({
36 38 deviceId,
37 39 value: {
38   - params: params,
  40 + params: params || null,
39 41 persistent: true,
40 42 additionalInfo: {
41 43 cmdType: 'API',
... ...