feat: 完善流程详情模块,进度 20%
This commit is contained in:
@@ -466,7 +466,7 @@ export const BpmAutoApproveType = {
|
||||
};
|
||||
|
||||
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
|
||||
export enum CandidateStrategy {
|
||||
export enum CandidateStrategyEnum {
|
||||
/**
|
||||
* 审批人自选
|
||||
*/
|
||||
@@ -532,7 +532,7 @@ export enum CandidateStrategy {
|
||||
/**
|
||||
* 节点类型
|
||||
*/
|
||||
export enum NodeType {
|
||||
export enum NodeTypeEnum {
|
||||
/**
|
||||
* 子流程节点
|
||||
*/
|
||||
@@ -593,3 +593,44 @@ export enum NodeType {
|
||||
*/
|
||||
USER_TASK_NODE = 11,
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务状态枚举
|
||||
*/
|
||||
export enum TaskStatusEnum {
|
||||
/**
|
||||
* 审批通过
|
||||
*/
|
||||
APPROVE = 2,
|
||||
|
||||
/**
|
||||
* 审批通过中
|
||||
*/
|
||||
APPROVING = 7,
|
||||
/**
|
||||
* 已取消
|
||||
*/
|
||||
CANCEL = 4,
|
||||
/**
|
||||
* 未开始
|
||||
*/
|
||||
NOT_START = -1,
|
||||
|
||||
/**
|
||||
* 审批不通过
|
||||
*/
|
||||
REJECT = 3,
|
||||
|
||||
/**
|
||||
* 已退回
|
||||
*/
|
||||
RETURN = 5,
|
||||
/**
|
||||
* 审批中
|
||||
*/
|
||||
RUNNING = 1,
|
||||
/**
|
||||
* 待审批
|
||||
*/
|
||||
WAIT = 0,
|
||||
}
|
||||
|
||||
64
apps/web-antd/src/utils/formCreate.ts
Normal file
64
apps/web-antd/src/utils/formCreate.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 针对 https://github.com/xaboy/form-create-designer 封装的工具类
|
||||
*/
|
||||
|
||||
import { isRef } from 'vue';
|
||||
|
||||
// 编码表单 Conf
|
||||
export const encodeConf = (designerRef: object) => {
|
||||
// @ts-ignore designerRef.value is dynamically added by form-create-designer
|
||||
return JSON.stringify(designerRef.value.getOption());
|
||||
};
|
||||
|
||||
// 编码表单 Fields
|
||||
export const encodeFields = (designerRef: object) => {
|
||||
// @ts-ignore designerRef.value is dynamically added by form-create-designer
|
||||
const rule = JSON.parse(designerRef.value.getJson());
|
||||
const fields: string[] = [];
|
||||
rule.forEach((item: unknown) => {
|
||||
fields.push(JSON.stringify(item));
|
||||
});
|
||||
return fields;
|
||||
};
|
||||
|
||||
// 解码表单 Fields
|
||||
export const decodeFields = (fields: string[]) => {
|
||||
const rule: object[] = [];
|
||||
fields.forEach((item) => {
|
||||
rule.push(JSON.parse(item));
|
||||
});
|
||||
return rule;
|
||||
};
|
||||
|
||||
// 设置表单的 Conf 和 Fields,适用 FcDesigner 场景
|
||||
export const setConfAndFields = (
|
||||
designerRef: object,
|
||||
conf: string,
|
||||
fields: string,
|
||||
) => {
|
||||
// @ts-ignore designerRef.value is dynamically added by form-create-designer
|
||||
designerRef.value.setOption(JSON.parse(conf));
|
||||
// @ts-ignore designerRef.value is dynamically added by form-create-designer
|
||||
designerRef.value.setRule(decodeFields(fields));
|
||||
};
|
||||
|
||||
// 设置表单的 Conf 和 Fields,适用 form-create 场景
|
||||
export const setConfAndFields2 = (
|
||||
detailPreview: object,
|
||||
conf: string,
|
||||
fields: string[],
|
||||
value?: object,
|
||||
) => {
|
||||
if (isRef(detailPreview)) {
|
||||
// @ts-ignore detailPreview.value is dynamically added by form-create-designer
|
||||
detailPreview = detailPreview.value;
|
||||
}
|
||||
// @ts-ignore detailPreview properties are dynamically added by form-create-designer
|
||||
detailPreview.option = JSON.parse(conf);
|
||||
// @ts-ignore detailPreview properties are dynamically added by form-create-designer
|
||||
detailPreview.rule = decodeFields(fields);
|
||||
if (value) {
|
||||
// @ts-ignore detailPreview properties are dynamically added by form-create-designer
|
||||
detailPreview.value = value;
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,7 @@
|
||||
export * from './constants';
|
||||
export * from './dict';
|
||||
export * from './formatTime';
|
||||
export * from './formCreate';
|
||||
export * from './rangePickerProps';
|
||||
export * from './routerHelper';
|
||||
export * from './validator';
|
||||
|
||||
15
apps/web-antd/src/utils/routerHelper.ts
Normal file
15
apps/web-antd/src/utils/routerHelper.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
|
||||
const modules = import.meta.glob('../views/**/*.{vue,tsx}');
|
||||
/**
|
||||
* 注册一个异步组件
|
||||
* @param componentPath 例:/bpm/oa/leave/detail
|
||||
*/
|
||||
export const registerComponent = (componentPath: string) => {
|
||||
for (const item in modules) {
|
||||
if (item.includes(componentPath)) {
|
||||
// 使用异步组件的方式来动态加载组件
|
||||
return defineAsyncComponent(modules[item] as any);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user