From 607f6e4bb56e0d3f8602dfdd7e5ee145fb0ef8a6 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 19:10:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=83=A8=E5=88=86bpm=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/bpm/model/index.ts | 14 +- .../src/api/bpm/model/types.ts | 8 + .../src/api/bpm/processInstance/index.ts | 8 +- .../src/router/modules/remaining.ts | 2 +- .../src/views/bpm/model/index.vue | 217 +++++++++++++++++- .../src/views/bpm/model/model.data.ts | 81 +++++++ .../src/views/bpm/processInstance/index.vue | 122 +++++++++- .../views/bpm/processInstance/process.data.ts | 84 +++++++ 8 files changed, 516 insertions(+), 20 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts create mode 100644 yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts index cc577a7fc0..0d95727e40 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts @@ -2,20 +2,20 @@ import { useAxios } from '@/hooks/web/useAxios' import { ModelVO } from './types' const request = useAxios() -export const getModelPage = async (params) => { +export const getModelPageApi = async (params) => { return await request.get({ url: '/bpm/model/page', params }) } -export const getModel = async (id: number) => { +export const getModelApi = async (id: number) => { return await request.get({ url: '/bpm/model/get?id=' + id }) } -export const updateModel = async (data: ModelVO) => { +export const updateModelApi = async (data: ModelVO) => { return await request.put({ url: '/bpm/model/update', data: data }) } // 任务状态修改 -export const updateModelState = async (id: number, state: string) => { +export const updateModelStateApi = async (id: number, state: number) => { const data = { id: id, state: state @@ -23,14 +23,14 @@ export const updateModelState = async (id: number, state: string) => { return await request.put({ url: '/bpm/model/update-state', data: data }) } -export const createModel = async (data: ModelVO) => { +export const createModelApi = async (data: ModelVO) => { return await request.post({ url: '/bpm/model/create', data: data }) } -export const deleteModel = async (id: number) => { +export const deleteModelApi = async (id: number) => { return await request.delete({ url: '/bpm/model/delete?id=' + id }) } -export const deployModel = async (id: number) => { +export const deployModelApi = async (id: number) => { return await request.post({ url: '/bpm/model/deploy?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts index 96266fab3a..36f4aab1bb 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts @@ -1,3 +1,10 @@ +export type ProcessDefinitionVO = { + id: string + version: number + deploymentTIme: string + suspensionState: number +} + export type ModelVO = { id: number formName: string @@ -9,6 +16,7 @@ export type ModelVO = { formId: number formCustomCreatePath: string formCustomViewPath: string + processDefinition: ProcessDefinitionVO status: number remark: string createTime: string diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts index b49dfa6153..48715f8532 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts @@ -2,15 +2,15 @@ import { useAxios } from '@/hooks/web/useAxios' import { ProcessInstanceVO } from './types' const request = useAxios() -export const getMyProcessInstancePage = async (params) => { +export const getMyProcessInstancePageApi = async (params) => { return await request.get({ url: '/bpm/process-instance/my-page', params }) } -export const createProcessInstance = async (data: ProcessInstanceVO) => { +export const createProcessInstanceApi = async (data: ProcessInstanceVO) => { return await request.post({ url: '/bpm/process-instance/create', data: data }) } -export const cancelProcessInstance = async (id: number, reason: string) => { +export const cancelProcessInstanceApi = async (id: number, reason: string) => { const data = { id: id, reason: reason @@ -18,6 +18,6 @@ export const cancelProcessInstance = async (id: number, reason: string) => { return await request.delete({ url: '/bpm/process-instance/cancel', data: data }) } -export const getProcessInstance = async (id: number) => { +export const getProcessInstanceApi = async (id: number) => { return await request.get({ url: '/bpm/process-instance/get?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 7c3c524e6d..92f3a367ef 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -72,7 +72,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'edit', - component: () => import('@/views/infra/codegen/components/EditTable.vue'), + component: () => import('@/views/infra/codegen/EditTable.vue'), name: 'EditTable', meta: { noCache: true, diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue index b03cb75c88..bbf0199e4e 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue @@ -1,7 +1,216 @@ - + + + + + + + +
+ + {{ t('action.add') }} + +
+ + + + + + + +
+
- + + +
+ + + + + + +
+ diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts new file mode 100644 index 0000000000..a1ffaadfcf --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts @@ -0,0 +1,81 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { required } from '@/utils/formRules' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + name: [required] +}) + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: '流程标识', + field: 'key', + search: { + show: true + } + }, + { + label: '流程名称', + field: 'name', + search: { + show: true + } + }, + { + label: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + search: { + show: true + } + }, + { + label: '表单信息', + field: 'formId' + }, + { + label: '最新部署的流程定义', + field: 'processDefinition', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: t('common.createTime'), + field: 'createTime', + form: { + show: false + } + }, + { + label: t('table.action'), + field: 'action', + width: '240px', + form: { + show: false + }, + detail: { + show: false + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue index b03cb75c88..a49d911f31 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue @@ -1,7 +1,121 @@ - + + + + + + + +
+ + {{ t('action.add') }} + +
+ + + + + +
+
- + + + + + + + + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts new file mode 100644 index 0000000000..dff3dc0760 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts @@ -0,0 +1,84 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +const { t } = useI18n() // 国际化 + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: '流程名', + field: 'name', + search: { + show: true + } + }, + { + label: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + search: { + show: true + } + }, + { + label: '当前审批任务', + field: 'tasks' + }, + { + label: t('common.status'), + field: 'status', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, + search: { + show: true + } + }, + { + label: '结果', + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, + search: { + show: true + } + }, + { + label: '提交时间', + field: 'createTime', + form: { + show: false + }, + search: { + show: true + } + }, + { + label: '结束时间', + field: 'endTime', + form: { + show: false + } + }, + { + label: t('table.action'), + field: 'action', + width: '240px', + form: { + show: false + }, + detail: { + show: false + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas)