add 添加表单配置
This commit is contained in:
38
src/api/workflow/definitionConfig/index.ts
Normal file
38
src/api/workflow/definitionConfig/index.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types';
|
||||
|
||||
|
||||
/**
|
||||
* 查询表单配置详细
|
||||
* @param id
|
||||
*/
|
||||
export const getByDefId = (definitionId: string | number): AxiosPromise<DefinitionConfigVO> => {
|
||||
return request({
|
||||
url: '/workflow/definitionConfig/getByDefId/' + definitionId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增表单配置
|
||||
* @param data
|
||||
*/
|
||||
export const saveOrUpdate = (data: DefinitionConfigForm) => {
|
||||
return request({
|
||||
url: '/workflow/definitionConfig/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除表单配置
|
||||
* @param id
|
||||
*/
|
||||
export const deldefinitionConfig = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/workflow/definitionConfig/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
@ -1,13 +1,15 @@
|
||||
export interface FormDefinitionVO {
|
||||
import { FormManageVO } from '@/api/workflow/formManage/types';
|
||||
|
||||
export interface DefinitionConfigVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
* 表单ID
|
||||
*/
|
||||
path: string;
|
||||
formId?: string | number;
|
||||
|
||||
/**
|
||||
* 流程定义ID
|
||||
@ -24,18 +26,23 @@ export interface FormDefinitionVO {
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 表单管理
|
||||
*/
|
||||
wfFormManageVo: FormManageVO;
|
||||
|
||||
}
|
||||
|
||||
export interface FormDefinitionForm extends BaseEntity {
|
||||
export interface DefinitionConfigForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
* 表单ID
|
||||
*/
|
||||
path?: string;
|
||||
formId?: string | number;
|
||||
|
||||
/**
|
||||
* 流程定义ID
|
||||
@ -52,14 +59,20 @@ export interface FormDefinitionForm extends BaseEntity {
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 表单管理
|
||||
*/
|
||||
wfFormManageVo: FormManageVO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface FormDefinitionQuery extends PageQuery {
|
||||
export interface DefinitionConfigQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 路由地址
|
||||
* 表单ID
|
||||
*/
|
||||
path?: string;
|
||||
formId?: string | number;
|
||||
|
||||
/**
|
||||
* 流程定义ID
|
||||
@ -72,9 +85,10 @@ export interface FormDefinitionQuery extends PageQuery {
|
||||
processKey?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
* 表单管理
|
||||
*/
|
||||
params?: any;
|
||||
wfFormManageVo: FormManageVO;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { FormDefinitionVO, FormDefinitionForm, FormDefinitionQuery } from '@/api/workflow/formDefinition/types';
|
||||
|
||||
|
||||
/**
|
||||
* 查询表单配置详细
|
||||
* @param id
|
||||
*/
|
||||
export const getByDefId = (definitionId: string | number): AxiosPromise<FormDefinitionVO> => {
|
||||
return request({
|
||||
url: '/workflow/formDefinition/getByDefId/' + definitionId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增表单配置
|
||||
* @param data
|
||||
*/
|
||||
export const saveOrUpdate = (data: FormDefinitionForm) => {
|
||||
return request({
|
||||
url: '/workflow/formDefinition/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除表单配置
|
||||
* @param id
|
||||
*/
|
||||
export const delFormDefinition = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/workflow/formDefinition/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
76
src/api/workflow/formManage/index.ts
Normal file
76
src/api/workflow/formManage/index.ts
Normal file
@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { FormManageVO, FormManageForm, FormManageQuery } from '@/api/workflow/formManage/types';
|
||||
|
||||
/**
|
||||
* 查询表单管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listFormManage = (query?: FormManageQuery): AxiosPromise<FormManageVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/formManage/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询表单管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const selectListFormManage = (): AxiosPromise<FormManageVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/formManage/list/selectList',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询表单管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getFormManage = (id: string | number): AxiosPromise<FormManageVO> => {
|
||||
return request({
|
||||
url: '/workflow/formManage/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增表单管理
|
||||
* @param data
|
||||
*/
|
||||
export const addFormManage = (data: FormManageForm) => {
|
||||
return request({
|
||||
url: '/workflow/formManage',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改表单管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateFormManage = (data: FormManageForm) => {
|
||||
return request({
|
||||
url: '/workflow/formManage',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除表单管理
|
||||
* @param id
|
||||
*/
|
||||
export const delFormManage = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/workflow/formManage/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
75
src/api/workflow/formManage/types.ts
Normal file
75
src/api/workflow/formManage/types.ts
Normal file
@ -0,0 +1,75 @@
|
||||
export interface FormManageVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
formName: string;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
formType: string;
|
||||
/**
|
||||
* 表单类型名称
|
||||
*/
|
||||
formTypeName: string;
|
||||
|
||||
/**
|
||||
* 路由地址/表单ID
|
||||
*/
|
||||
router: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remork: string;
|
||||
|
||||
}
|
||||
|
||||
export interface FormManageForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
formName?: string;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
formType?: string;
|
||||
|
||||
/**
|
||||
* 路由地址/表单ID
|
||||
*/
|
||||
router?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remork?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface FormManageQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
formName?: string;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
formType?: string;
|
||||
}
|
||||
|
||||
|
||||
|
63
src/api/workflow/nodeConfig/index.ts
Normal file
63
src/api/workflow/nodeConfig/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types';
|
||||
|
||||
/**
|
||||
* 查询节点配置列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise<NodeConfigVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/nodeConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询节点配置详细
|
||||
* @param id
|
||||
*/
|
||||
export const getNodeConfig = (id: string | number): AxiosPromise<NodeConfigVO> => {
|
||||
return request({
|
||||
url: '/workflow/nodeConfig/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增节点配置
|
||||
* @param data
|
||||
*/
|
||||
export const addNodeConfig = (data: NodeConfigForm) => {
|
||||
return request({
|
||||
url: '/workflow/nodeConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改节点配置
|
||||
* @param data
|
||||
*/
|
||||
export const updateNodeConfig = (data: NodeConfigForm) => {
|
||||
return request({
|
||||
url: '/workflow/nodeConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除节点配置
|
||||
* @param id
|
||||
*/
|
||||
export const delNodeConfig = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/workflow/nodeConfig/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
43
src/api/workflow/nodeConfig/types.ts
Normal file
43
src/api/workflow/nodeConfig/types.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import { FormManageVO } from '@/api/workflow/formManage/types';
|
||||
|
||||
export interface NodeConfigVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
formId: string | number;
|
||||
|
||||
/**
|
||||
* 表单类型
|
||||
*/
|
||||
formType: string;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
nodeName: string;
|
||||
|
||||
/**
|
||||
* 节点id
|
||||
*/
|
||||
nodeId: string | number;
|
||||
|
||||
/**
|
||||
* 流程定义id
|
||||
*/
|
||||
definitionId: string | number;
|
||||
|
||||
/**
|
||||
* 表单管理
|
||||
*/
|
||||
wfFormManageVo: FormManageVO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { NodeConfigVO } from '@/api/workflow/nodeConfig/types';
|
||||
import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types';
|
||||
export interface TaskQuery extends PageQuery {
|
||||
name?: string;
|
||||
processDefinitionKey?: string;
|
||||
@ -37,8 +39,8 @@ export interface TaskVO extends BaseEntity {
|
||||
participantVo: ParticipantVo;
|
||||
multiInstance: boolean;
|
||||
businessKey: string;
|
||||
formKey: string;
|
||||
wfFormDefinitionVo: any;
|
||||
wfNodeConfigVo: NodeConfigVO;
|
||||
wfDefinitionConfigVo: DefinitionConfigVO;
|
||||
}
|
||||
|
||||
export interface VariableVo {
|
||||
|
49
src/api/workflow/workflowCommon/index.ts
Normal file
49
src/api/workflow/workflowCommon/index.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
|
||||
|
||||
export default {
|
||||
routerJump(routerJumpVo: RouterJumpVo,proxy){
|
||||
if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`,
|
||||
query: {
|
||||
id: routerJumpVo.businessKey,
|
||||
type: routerJumpVo.type,
|
||||
taskId: routerJumpVo.taskId
|
||||
}
|
||||
});
|
||||
} else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`,
|
||||
query: {
|
||||
id: routerJumpVo.businessKey,
|
||||
type: routerJumpVo.type,
|
||||
taskId: routerJumpVo.taskId
|
||||
}
|
||||
});
|
||||
}else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'static') {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`,
|
||||
query: {
|
||||
id: routerJumpVo.businessKey,
|
||||
type: routerJumpVo.type,
|
||||
taskId: routerJumpVo.taskId
|
||||
}
|
||||
});
|
||||
}else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'dynamic') {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`,
|
||||
query: {
|
||||
id: routerJumpVo.businessKey,
|
||||
type: routerJumpVo.type,
|
||||
taskId: routerJumpVo.taskId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
|
||||
}
|
||||
}
|
||||
}
|
10
src/api/workflow/workflowCommon/types.ts
Normal file
10
src/api/workflow/workflowCommon/types.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { NodeConfigVO } from '@/api/workflow/nodeConfig/types';
|
||||
import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types';
|
||||
|
||||
export interface RouterJumpVo {
|
||||
wfDefinitionConfigVo: DefinitionConfigVO;
|
||||
wfNodeConfigVo: NodeConfigVO;
|
||||
businessKey: string;
|
||||
taskId: string;
|
||||
type: string;
|
||||
}
|
Reference in New Issue
Block a user