Commit c68497cff706fcc756a054ff3893884fd2d0ab9a

Authored by dev001
2 parents a5e25f29 5d45f035

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

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