@szjy/workflow 0.1.32 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +22304 -21881
- package/dist/index.umd.js +254 -254
- package/dist/packages/components/Workflow/biz-logic/form-cell/FormAssociatedProperty.vue.d.ts +2 -0
- package/dist/packages/components/Workflow/components/biz/validation/userValidation.d.ts +49 -0
- package/dist/packages/components/Workflow/exposeApi.d.ts +4 -0
- package/dist/packages/components/Workflow/index.vue.d.ts +4 -1
- package/dist/packages/components/Workflow/store/cell-associated/constants.d.ts +56 -0
- package/dist/packages/components/Workflow/store/cell-associated/index.d.ts +37 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { UserJSON } from '../../../biz-logic/leave/types';
|
|
2
|
+
/**
|
|
3
|
+
* 用户选择器校验规则配置
|
|
4
|
+
* 每个规则包含:
|
|
5
|
+
* - field: 需要校验的字段名
|
|
6
|
+
* - message: 校验失败时的提示信息
|
|
7
|
+
* - validator: 自定义校验函数(可选)
|
|
8
|
+
*/
|
|
9
|
+
export interface ValidationRule {
|
|
10
|
+
field: keyof UserJSON | string;
|
|
11
|
+
message: string;
|
|
12
|
+
validator?: (value: any, user: UserJSON) => boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 用户类型校验规则映射表
|
|
16
|
+
* key: 用户类型(GET_USER_TYPES 中的值)
|
|
17
|
+
* value: 该类型需要执行的校验规则数组
|
|
18
|
+
*/
|
|
19
|
+
export declare const USER_TYPE_VALIDATION_RULES: Record<string, ValidationRule[]>;
|
|
20
|
+
/**
|
|
21
|
+
* 校验结果接口
|
|
22
|
+
*/
|
|
23
|
+
export interface ValidationResult {
|
|
24
|
+
valid: boolean;
|
|
25
|
+
message?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 通用用户选择器校验函数
|
|
29
|
+
* @param user 用户配置对象
|
|
30
|
+
* @returns 校验结果,包含是否通过和错误信息
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateUserSelection(user: UserJSON): ValidationResult;
|
|
33
|
+
/**
|
|
34
|
+
* 批量添加自定义校验规则
|
|
35
|
+
* @param userType 用户类型
|
|
36
|
+
* @param rules 校验规则数组
|
|
37
|
+
*/
|
|
38
|
+
export declare function addValidationRules(userType: string, rules: ValidationRule[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* 覆盖指定用户类型的校验规则
|
|
41
|
+
* @param userType 用户类型
|
|
42
|
+
* @param rules 新的校验规则数组
|
|
43
|
+
*/
|
|
44
|
+
export declare function setValidationRules(userType: string, rules: ValidationRule[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* 移除指定用户类型的所有校验规则
|
|
47
|
+
* @param userType 用户类型
|
|
48
|
+
*/
|
|
49
|
+
export declare function removeValidationRules(userType: string): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FieldItemType, FieldPermissionConfigMapNode, PermissionJSONLike } from "./store/permission/constants";
|
|
2
2
|
import { EsignJSONLike } from './store/esign';
|
|
3
|
+
import { CellAssociatedJSONLike } from "./store/cell-associated/constants";
|
|
3
4
|
export declare const getWorkflowXml: () => Promise<string | undefined>;
|
|
4
5
|
export declare function initXmlToStore(xml: string): Promise<void>;
|
|
5
6
|
export declare function updateProcessId(processId: string): void;
|
|
@@ -16,3 +17,6 @@ export declare function getEsignJSON(): {
|
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export declare function setEsignConfig(esignJSON: EsignJSONLike): void;
|
|
20
|
+
export declare function getCellAssociatedJSON(): CellAssociatedJSONLike;
|
|
21
|
+
export declare function setCellAssociatedConfig(cellAssociatedJSON: CellAssociatedJSONLike, fields: FieldItemType[]): void;
|
|
22
|
+
export declare function updateCellAssociatedFields(fields: FieldItemType[]): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPermissionJSON, initXmlToStore, updateProcessId, setPermissionByFields, updatePermFields, getEsignJSON, setEsignConfig } from "./exposeApi";
|
|
1
|
+
import { getPermissionJSON, initXmlToStore, updateProcessId, setPermissionByFields, updatePermFields, getEsignJSON, setEsignConfig, getCellAssociatedJSON, setCellAssociatedConfig, updateCellAssociatedFields } from "./exposeApi";
|
|
2
2
|
import BpmnModeler from 'bpmn-js/lib/Modeler.js';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
mode: {
|
|
@@ -18,6 +18,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
updatePermFields: typeof updatePermFields;
|
|
19
19
|
getEsignJSON: typeof getEsignJSON;
|
|
20
20
|
setEsignConfig: typeof setEsignConfig;
|
|
21
|
+
getCellAssociatedJSON: typeof getCellAssociatedJSON;
|
|
22
|
+
setCellAssociatedConfig: typeof setCellAssociatedConfig;
|
|
23
|
+
updateCellAssociatedFields: typeof updateCellAssociatedFields;
|
|
21
24
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
25
|
init: (modeler: BpmnModeler) => void;
|
|
23
26
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const CURRENT_USER_KEY = "current";
|
|
2
|
+
export declare const OTHER_USER_KEY = "others";
|
|
3
|
+
export type CellAssociatedGroupName = "current" | "others";
|
|
4
|
+
export declare const CELL_ASSOCIATED_TYPE: {
|
|
5
|
+
readonly OP_TIME: "opTime";
|
|
6
|
+
readonly OP_USER: "opUser";
|
|
7
|
+
};
|
|
8
|
+
export type CellAssociatedConfigType = typeof CELL_ASSOCIATED_TYPE[keyof typeof CELL_ASSOCIATED_TYPE];
|
|
9
|
+
export type FieldItemType = {
|
|
10
|
+
id: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const CELL_ASSOCIATED_OPTIONS: ({
|
|
15
|
+
label: string;
|
|
16
|
+
value: "opTime";
|
|
17
|
+
} | {
|
|
18
|
+
label: string;
|
|
19
|
+
value: "opUser";
|
|
20
|
+
})[];
|
|
21
|
+
export type CellConfigItem = {
|
|
22
|
+
opTime?: boolean;
|
|
23
|
+
opUser?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type CellAssociatedItem = {
|
|
26
|
+
key: string;
|
|
27
|
+
fieldId: string;
|
|
28
|
+
fieldName: string;
|
|
29
|
+
config: CellConfigItem;
|
|
30
|
+
};
|
|
31
|
+
export type TaskCellAssociatedMap = {
|
|
32
|
+
[CURRENT_USER_KEY]: CellAssociatedItem[];
|
|
33
|
+
[OTHER_USER_KEY]: CellAssociatedItem[];
|
|
34
|
+
};
|
|
35
|
+
export type AllTaskCellAssociatedMap = {
|
|
36
|
+
[key: string]: TaskCellAssociatedMap;
|
|
37
|
+
};
|
|
38
|
+
export type CellAssociatedConfigMap = {
|
|
39
|
+
[fieldId: string]: CellConfigItem;
|
|
40
|
+
};
|
|
41
|
+
export type CellAssociatedConfigMapNode = {
|
|
42
|
+
[CURRENT_USER_KEY]?: CellAssociatedConfigMap;
|
|
43
|
+
[OTHER_USER_KEY]?: CellAssociatedConfigMap;
|
|
44
|
+
};
|
|
45
|
+
export type CellAssociatedJSONLike = {
|
|
46
|
+
[nodeId: string]: CellAssociatedConfigMapNode;
|
|
47
|
+
};
|
|
48
|
+
export type ExtraInfo = {
|
|
49
|
+
[key: string]: {
|
|
50
|
+
name?: string;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare const convertCellAssociatedArrayToMap: (cellAssociatedArray?: CellAssociatedItem[]) => CellAssociatedConfigMap;
|
|
55
|
+
export declare const convertCellAssociatedMapToArray: (obj: CellAssociatedConfigMap, extraInfo: ExtraInfo) => CellAssociatedItem[];
|
|
56
|
+
export declare const convertTaskCellAssociatedMapToMap: (taskCellAssociatedMap: Partial<TaskCellAssociatedMap>) => CellAssociatedConfigMapNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type AllTaskCellAssociatedMap, type CellAssociatedGroupName, type TaskCellAssociatedMap, type FieldItemType, type CellConfigItem, type CellAssociatedJSONLike } from './constants';
|
|
2
|
+
/**
|
|
3
|
+
* 单元格关联配置管理模块
|
|
4
|
+
* 1. 存储所有节点的单元格关联配置
|
|
5
|
+
* 2. 存储当前节点的单元格关联配置
|
|
6
|
+
* 3. 提供初始化配置的方法
|
|
7
|
+
* 4. 提供更新配置的方法
|
|
8
|
+
*/
|
|
9
|
+
declare const useCellAssociatedStore: import("pinia").StoreDefinition<"cellAssociated", import("pinia")._UnwrapAll<Pick<{
|
|
10
|
+
allTaskCellAssociatedMap: import("vue").Ref<AllTaskCellAssociatedMap>;
|
|
11
|
+
getCellAssociatedJSON: () => CellAssociatedJSONLike;
|
|
12
|
+
initAllCellAssociatedByFields: (cellAssociatedJSON: CellAssociatedJSONLike, fields: FieldItemType[]) => void;
|
|
13
|
+
curNodeId: import("vue").Ref<string>;
|
|
14
|
+
setCurNodeId: (id?: string) => void;
|
|
15
|
+
curTaskMap: import("vue").ComputedRef<TaskCellAssociatedMap>;
|
|
16
|
+
updateFieldConfig: (groupName: CellAssociatedGroupName, idx: number, config: CellConfigItem) => void;
|
|
17
|
+
setAllFields: (fields: FieldItemType[]) => void;
|
|
18
|
+
}, "curNodeId" | "allTaskCellAssociatedMap">>, Pick<{
|
|
19
|
+
allTaskCellAssociatedMap: import("vue").Ref<AllTaskCellAssociatedMap>;
|
|
20
|
+
getCellAssociatedJSON: () => CellAssociatedJSONLike;
|
|
21
|
+
initAllCellAssociatedByFields: (cellAssociatedJSON: CellAssociatedJSONLike, fields: FieldItemType[]) => void;
|
|
22
|
+
curNodeId: import("vue").Ref<string>;
|
|
23
|
+
setCurNodeId: (id?: string) => void;
|
|
24
|
+
curTaskMap: import("vue").ComputedRef<TaskCellAssociatedMap>;
|
|
25
|
+
updateFieldConfig: (groupName: CellAssociatedGroupName, idx: number, config: CellConfigItem) => void;
|
|
26
|
+
setAllFields: (fields: FieldItemType[]) => void;
|
|
27
|
+
}, "curTaskMap">, Pick<{
|
|
28
|
+
allTaskCellAssociatedMap: import("vue").Ref<AllTaskCellAssociatedMap>;
|
|
29
|
+
getCellAssociatedJSON: () => CellAssociatedJSONLike;
|
|
30
|
+
initAllCellAssociatedByFields: (cellAssociatedJSON: CellAssociatedJSONLike, fields: FieldItemType[]) => void;
|
|
31
|
+
curNodeId: import("vue").Ref<string>;
|
|
32
|
+
setCurNodeId: (id?: string) => void;
|
|
33
|
+
curTaskMap: import("vue").ComputedRef<TaskCellAssociatedMap>;
|
|
34
|
+
updateFieldConfig: (groupName: CellAssociatedGroupName, idx: number, config: CellConfigItem) => void;
|
|
35
|
+
setAllFields: (fields: FieldItemType[]) => void;
|
|
36
|
+
}, "setCurNodeId" | "setAllFields" | "getCellAssociatedJSON" | "initAllCellAssociatedByFields" | "updateFieldConfig">>;
|
|
37
|
+
export default useCellAssociatedStore;
|