Commit 2fc8706dc3975a9a9f7d6f498fab7da1b3115c3a

Authored by xp.Huang
2 parents 75a903c5 f8645d4c

Merge branch 'fix/DEFECT-1361' into 'main_dev'

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

See merge request yunteng/thingskit-front!655
@@ -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',