Commit 93f90334b36758673e981ed3297052340b8d0d66

Authored by xp.Huang
2 parents 40c29078 bb437a9a

Merge branch 'fix/object-model-service-invocation' into 'main_dev'

fix: 修复服务命令下发同步为双向异步为单向

See merge request yunteng/thingskit-front!724
@@ -876,8 +876,8 @@ export const CommandSchemas = ( @@ -876,8 +876,8 @@ export const CommandSchemas = (
876 const setValues = { 876 const setValues = {
877 [CommandFieldsEnum.CUSTOM_TYPE]: 877 [CommandFieldsEnum.CUSTOM_TYPE]:
878 options.callType === ServiceCallTypeEnum.ASYNC 878 options.callType === ServiceCallTypeEnum.ASYNC
879 - ? CommandDeliveryWayEnum.TWO_WAY  
880 - : CommandDeliveryWayEnum.ONE_WAY, 879 + ? CommandDeliveryWayEnum.ONE_WAY
  880 + : CommandDeliveryWayEnum.TWO_WAY,
881 [CommandFieldsEnum.MODEL_INPUT]: null, 881 [CommandFieldsEnum.MODEL_INPUT]: null,
882 }; 882 };
883 883
@@ -264,6 +264,13 @@ export const trigger_condition_schema: FormSchema[] = [ @@ -264,6 +264,13 @@ export const trigger_condition_schema: FormSchema[] = [
264 useByProductGetAttribute(res, updateSchema, options); 264 useByProductGetAttribute(res, updateSchema, options);
265 } 265 }
266 }, 266 },
  267 + filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => {
  268 + let { label, value } = option;
  269 + label = label.toLowerCase();
  270 + value = value.toLowerCase();
  271 + inputValue = inputValue.toLowerCase();
  272 + return label.includes(inputValue) || value.includes(inputValue);
  273 + },
267 }; 274 };
268 }, 275 },
269 }, 276 },
@@ -308,6 +315,13 @@ export const trigger_condition_schema: FormSchema[] = [ @@ -308,6 +315,13 @@ export const trigger_condition_schema: FormSchema[] = [
308 }, 315 },
309 placeholder: '请选择设备', 316 placeholder: '请选择设备',
310 getPopupContainer: () => document.body, 317 getPopupContainer: () => document.body,
  318 + filterOption: (inputValue: string, option: Record<'label' | 'value', string>) => {
  319 + let { label, value } = option;
  320 + label = label.toLowerCase();
  321 + value = value.toLowerCase();
  322 + inputValue = inputValue.toLowerCase();
  323 + return label.includes(inputValue) || value.includes(inputValue);
  324 + },
311 }; 325 };
312 }, 326 },
313 ifShow: ({ values }) => isPart(values.device), 327 ifShow: ({ values }) => isPart(values.device),
@@ -30,7 +30,7 @@ export function useSendCommand() { @@ -30,7 +30,7 @@ export function useSendCommand() {
30 // 如果是TCP设备从物模型中获取下发命令(TCP网关子设备无物模型服务与事件) 30 // 如果是TCP设备从物模型中获取下发命令(TCP网关子设备无物模型服务与事件)
31 if (customCommand?.transportType === TransportTypeEnum.TCP) { 31 if (customCommand?.transportType === TransportTypeEnum.TCP) {
32 params = customCommand.command!; 32 params = customCommand.command!;
33 - if (customCommand.callType === ServiceCallTypeEnum.ASYNC) { 33 + if (customCommand.callType === ServiceCallTypeEnum.SYNC) {
34 sendCommandFn = sendCommandTwoway; 34 sendCommandFn = sendCommandTwoway;
35 } 35 }
36 } 36 }