|
@@ -1,8 +1,8 @@
|
|
import { DictCode } from '@/constants';
|
|
import { DictCode } from '@/constants';
|
|
|
|
|
|
-import type { Component } from 'vue';
|
|
|
|
-import type { StepProps } from 'ant-design-vue';
|
|
|
|
-import type { Rule } from 'ant-design-vue/es/form';
|
|
|
|
|
|
+import type { Component, ComponentPublicInstance } from 'vue';
|
|
|
|
+import type { StepProps, UploadProps } from 'ant-design-vue';
|
|
|
|
+import type { Rule, RuleObject } from 'ant-design-vue/es/form';
|
|
import type { ProtocolConfigMethod } from '@/constants';
|
|
import type { ProtocolConfigMethod } from '@/constants';
|
|
|
|
|
|
export interface ApiResponse<T> {
|
|
export interface ApiResponse<T> {
|
|
@@ -30,6 +30,8 @@ export type FormRules<T> = {
|
|
[key: string]: Rule[];
|
|
[key: string]: Rule[];
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+export type RuleValidator<T> = (rule: RuleObject, value: T, callback: (error?: string) => void) => Promise<void>;
|
|
|
|
+
|
|
export interface DictTypeDataParams {
|
|
export interface DictTypeDataParams {
|
|
id?: number;
|
|
id?: number;
|
|
dictCode?: DictCode;
|
|
dictCode?: DictCode;
|
|
@@ -57,18 +59,29 @@ export interface UseGuideStepItem extends StepProps {
|
|
component: Component;
|
|
component: Component;
|
|
contentOffset?: number;
|
|
contentOffset?: number;
|
|
formLayout?: 'horizontal' | 'vertical' | 'inline';
|
|
formLayout?: 'horizontal' | 'vertical' | 'inline';
|
|
|
|
+ isLastStep?: boolean;
|
|
nextStepButtonText?: string;
|
|
nextStepButtonText?: string;
|
|
nextStepButtonDisabled?: boolean;
|
|
nextStepButtonDisabled?: boolean;
|
|
}
|
|
}
|
|
|
|
|
|
export interface UseGuideStepItemProps<T> {
|
|
export interface UseGuideStepItemProps<T> {
|
|
form: T;
|
|
form: T;
|
|
|
|
+ steps: UseGuideStepItem[];
|
|
|
|
+ stepIndex: number;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export type UseGuideStepItemExpose = {
|
|
|
|
+ finish?: () => void | Promise<void>;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export type UseGuideStepItemInstance = ComponentPublicInstance<unknown, UseGuideStepItemExpose>;
|
|
|
|
+
|
|
export interface SetupProtocolForm {
|
|
export interface SetupProtocolForm {
|
|
protocolType: string;
|
|
protocolType: string;
|
|
protocolInfo: ProtocolBaseInfo;
|
|
protocolInfo: ProtocolBaseInfo;
|
|
|
|
+ protocolFile: UploadProps['fileList'];
|
|
configMethod: ProtocolConfigMethod;
|
|
configMethod: ProtocolConfigMethod;
|
|
|
|
+ deviceType: string;
|
|
}
|
|
}
|
|
|
|
|
|
export interface CustomParamsForm {
|
|
export interface CustomParamsForm {
|
|
@@ -91,51 +104,25 @@ export interface CustomParamsForm {
|
|
}
|
|
}
|
|
|
|
|
|
export interface ProtocolBaseInfo {
|
|
export interface ProtocolBaseInfo {
|
|
- /*协议名称 */
|
|
|
|
|
|
+ id: number | null;
|
|
protocolName: string;
|
|
protocolName: string;
|
|
-
|
|
|
|
- /*协议类型(modbusRtu/modbusTcp/S7三选一) */
|
|
|
|
protocolType: string;
|
|
protocolType: string;
|
|
-
|
|
|
|
- /*设备类型 */
|
|
|
|
deviceType: string;
|
|
deviceType: string;
|
|
-
|
|
|
|
- /*数据位(仅限modbusRtu, 5/6/7/8) */
|
|
|
|
- dataBit?: number;
|
|
|
|
-
|
|
|
|
- /*校验位(仅限modbusRtu, N/O/E) */
|
|
|
|
- parityBit: string;
|
|
|
|
-
|
|
|
|
- /*停止位(仅限modbusRtu,1/1.5/2) */
|
|
|
|
- stopBit: string;
|
|
|
|
-
|
|
|
|
- /*波特率(仅限modbusRtu) */
|
|
|
|
- baudRate?: number;
|
|
|
|
-
|
|
|
|
- /*数据发送间隔 */
|
|
|
|
|
|
+ deviceTypeId: number | null;
|
|
|
|
+ dataBit: 5 | 6 | 7 | 8;
|
|
|
|
+ parityBit: 'N' | 'O' | 'E';
|
|
|
|
+ stopBit: '1' | '1.5' | '2';
|
|
|
|
+ baudRate: number;
|
|
dataSendInterval: number;
|
|
dataSendInterval: number;
|
|
-
|
|
|
|
- /*高频发送间隔 */
|
|
|
|
highFreqSendInterval: number;
|
|
highFreqSendInterval: number;
|
|
-
|
|
|
|
- /*读取超时时间 */
|
|
|
|
readTimeout: number;
|
|
readTimeout: number;
|
|
-
|
|
|
|
- /*下条数据读取延时时间 */
|
|
|
|
nextDataReadDelay: number;
|
|
nextDataReadDelay: number;
|
|
-
|
|
|
|
- /*下轮数据读取延时时间 */
|
|
|
|
nextRoundDataReadDelay: number;
|
|
nextRoundDataReadDelay: number;
|
|
-
|
|
|
|
- /*自动连读地址(仅限modbusRtu/modbusTcp) */
|
|
|
|
- readContinuousAddr?: string;
|
|
|
|
-
|
|
|
|
- /*自动连读地址最大长度(仅限modbusRtu/modbusTcp) */
|
|
|
|
- readContinuousAddrLength?: number;
|
|
|
|
-
|
|
|
|
- /*字节顺序(正序/反序) */
|
|
|
|
|
|
+ readContinuousAddr: string;
|
|
|
|
+ readContinuousAddrCode: number;
|
|
|
|
+ readContinuousAddrLength: number;
|
|
byteOrder: string;
|
|
byteOrder: string;
|
|
-
|
|
|
|
- /*地址顺序(正序/反序) */
|
|
|
|
|
|
+ byteOrderCode: string;
|
|
addrOrder: string;
|
|
addrOrder: string;
|
|
|
|
+ addrOrderCode: string;
|
|
}
|
|
}
|