Commit bb437a9a20b90dc1d05ce5891ba80c6cdb76ad8d

Authored by ww
1 parent 40c29078

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

... ... @@ -876,8 +876,8 @@ export const CommandSchemas = (
876 876 const setValues = {
877 877 [CommandFieldsEnum.CUSTOM_TYPE]:
878 878 options.callType === ServiceCallTypeEnum.ASYNC
879   - ? CommandDeliveryWayEnum.TWO_WAY
880   - : CommandDeliveryWayEnum.ONE_WAY,
  879 + ? CommandDeliveryWayEnum.ONE_WAY
  880 + : CommandDeliveryWayEnum.TWO_WAY,
881 881 [CommandFieldsEnum.MODEL_INPUT]: null,
882 882 };
883 883
... ...
... ... @@ -264,6 +264,13 @@ export const trigger_condition_schema: FormSchema[] = [
264 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 315 },
309 316 placeholder: '请选择设备',
310 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 327 ifShow: ({ values }) => isPart(values.device),
... ...
... ... @@ -30,7 +30,7 @@ export function useSendCommand() {
30 30 // 如果是TCP设备从物模型中获取下发命令(TCP网关子设备无物模型服务与事件)
31 31 if (customCommand?.transportType === TransportTypeEnum.TCP) {
32 32 params = customCommand.command!;
33   - if (customCommand.callType === ServiceCallTypeEnum.ASYNC) {
  33 + if (customCommand.callType === ServiceCallTypeEnum.SYNC) {
34 34 sendCommandFn = sendCommandTwoway;
35 35 }
36 36 }
... ...