Commit c68497cff706fcc756a054ff3893884fd2d0ab9a

Authored by dev001
2 parents a5e25f29 5d45f035

Merge branch 'main_dev' into feat/account-role-manage

... ... @@ -87,7 +87,8 @@
87 87 const isTcpDevice = unref(props.deviceDetail)?.transportType === TransportTypeEnum.TCP;
88 88 if (commandType === CommandTypeEnum.CUSTOM) {
89 89 if (isTcpDevice) {
90   - return values.tcpCommandValue;
  90 + const value = values.tcpCommandValue;
  91 + return value?.replaceAll(/\s/g, '');
91 92 }
92 93 return parseStringToJSON(values.commandValue!).json;
93 94 } else {
... ...
... ... @@ -130,7 +130,11 @@ function handleServiceType(
130 130 functionJson: {
131 131 inputData:
132 132 transportType === TransportTypeEnum.TCP
133   - ? [{ [FormFieldsEnum.SERVICE_COMMAND]: serviceCommand } as unknown as StructJSON]
  133 + ? [
  134 + {
  135 + [FormFieldsEnum.SERVICE_COMMAND]: serviceCommand?.replaceAll(/\s/g, ''),
  136 + } as unknown as StructJSON,
  137 + ]
134 138 : inputData,
135 139 outputData,
136 140 },
... ...
... ... @@ -5,7 +5,6 @@
5 5 @register="registerDrawer"
6 6 :showFooter="false"
7 7 :title="descInfo?.title"
8   - destroyOnClose
9 8 width="70%"
10 9 >
11 10 <div v-html="descInfo?.content"></div>
... ...
... ... @@ -76,7 +76,6 @@
76 76 showTableSetting: true,
77 77 bordered: true,
78 78 showIndexColumn: false,
79   - canResize: false,
80 79 actionColumn: {
81 80 width: 200,
82 81 title: t('routes.common.common.operation'), //操作
... ...
... ... @@ -14,6 +14,7 @@ import { dateUtil } from '/@/utils/dateUtil';
14 14 import { ProductPicker, validateProductPicker } from '../ProductPicker';
15 15 import { useGlobSetting } from '/@/hooks/setting';
16 16 import { TransportTypeEnum } from '/@/enums/deviceEnum';
  17 +import { validateTCPCustomCommand } from '/@/components/Form/src/components/ThingsModelForm';
17 18
18 19 useComponentRegister('DevicePicker', DevicePicker);
19 20 useComponentRegister('ProductPicker', ProductPicker);
... ... @@ -218,7 +219,7 @@ export const formSchemas: FormSchema[] = [
218 219 const rules: Rule[] = [{ required: true, message: '请输入自定义数据流' }];
219 220 return model[FormFieldsEnum.PUSH_WAY] === PushWayEnum.MQTT
220 221 ? [...rules, ...JSONEditorValidator()]
221   - : rules;
  222 + : [...rules, { validator: validateTCPCustomCommand }];
222 223 },
223 224 ifShow: ({ model }) => model[FormFieldsEnum.EXECUTE_CONTENT_TYPE] === TaskTypeEnum.CUSTOM,
224 225 valueField: 'value',
... ...
... ... @@ -95,7 +95,8 @@ export const composeData = (result: Required<FormValueType>): CreateTaskRecordTy
95 95 targetType,
96 96 executeContent: {
97 97 pushContent: {
98   - rpcCommand: pushWay === PushWayEnum.MQTT ? JSON.parse(rpcCommand) : rpcCommand,
  98 + rpcCommand:
  99 + pushWay === PushWayEnum.TCP ? rpcCommand.replaceAll(/\s/g, '') : JSON.parse(rpcCommand),
99 100 },
100 101 pushWay,
101 102 type: executeContentType,
... ...
... ... @@ -8,7 +8,7 @@ export enum MoreActionEvent {
8 8 export enum VisualBoardPermission {
9 9 UPDATE = 'api:yt:data_board:update:update',
10 10 DELETE = 'api:yt:data_board:delete',
11   - CREATE = '',
  11 + CREATE = 'api:yt:data_board:add:post',
12 12 SHARE = 'api:yt:data_board:share',
13 13 DETAIL = 'api:yt:data_component:list',
14 14 }
... ...
... ... @@ -196,7 +196,7 @@ export const commonDataSourceSchemas = (): FormSchema[] => {
196 196 });
197 197 }
198 198 },
199   - getPopupContainer: () => document.body,
  199 + ...createPickerSearch(),
200 200 };
201 201 },
202 202 },
... ...