From 1ba713a2f094be6dcf06abd6f51bf2e94ff25033 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 23 Oct 2023 12:32:40 +0800 Subject: [PATCH] chore: compose --- src/views/workflow/process/ApplyProcess.vue | 151 +++++++++++++ src/views/workflow/process/HistoryProcess.vue | 165 ++++++++++++++ src/views/workflow/process/RunProcess.vue | 168 ++++++++++++++ src/views/workflow/process/process.data.ts | 68 ------ src/views/workflow/process/process.data.tsx | 207 ++++++++++++++++++ src/views/workflow/task/TaskFormView.vue | 4 +- 6 files changed, 693 insertions(+), 70 deletions(-) create mode 100644 src/views/workflow/process/ApplyProcess.vue create mode 100644 src/views/workflow/process/HistoryProcess.vue create mode 100644 src/views/workflow/process/RunProcess.vue delete mode 100644 src/views/workflow/process/process.data.ts create mode 100644 src/views/workflow/process/process.data.tsx diff --git a/src/views/workflow/process/ApplyProcess.vue b/src/views/workflow/process/ApplyProcess.vue new file mode 100644 index 0000000..13b4964 --- /dev/null +++ b/src/views/workflow/process/ApplyProcess.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/views/workflow/process/HistoryProcess.vue b/src/views/workflow/process/HistoryProcess.vue new file mode 100644 index 0000000..1bb669d --- /dev/null +++ b/src/views/workflow/process/HistoryProcess.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/views/workflow/process/RunProcess.vue b/src/views/workflow/process/RunProcess.vue new file mode 100644 index 0000000..9f0ab75 --- /dev/null +++ b/src/views/workflow/process/RunProcess.vue @@ -0,0 +1,168 @@ + + + diff --git a/src/views/workflow/process/process.data.ts b/src/views/workflow/process/process.data.ts deleted file mode 100644 index b4b1d84..0000000 --- a/src/views/workflow/process/process.data.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { BasicColumn, FormSchema } from '/@/components/Table'; -import { h } from 'vue'; -import { Tag } from 'ant-design-vue'; -import { listProcessCategory } from '/@/api/platform/workflow/extension/controller/processCategory'; - -export const columns: BasicColumn[] = [ - { - title: '流程名称', - dataIndex: 'name', - width: 200, - }, - { - title: '流程KEY', - dataIndex: 'key', - width: 200, - }, - { - title: '流程分类', - dataIndex: 'category', - width: 150, - customRender: ({ record }) => { - const category = record.category; - return h(Tag, { color: 'processing' }, () => String(record.category).split(',')[1] || '未分类'); - } - }, - { - title: '流程版本', - dataIndex: 'version', - width: 150, - customRender: ({ record }) => { - const version = record.version; - return h(Tag, { color: version ? 'success' : 'warning' }, () => version || '版本未发布'); - } - }, - { - title: '上次发布时间', - dataIndex: 'deploymentTime', - width: 200 - } -]; - -export const searchFormSchema: FormSchema[] = [ - { - field: 'categoryId', - label: '流程分类', - component: 'ApiTreeSelect', - componentProps: { - placeholder: '请选择流程分类', - fieldNames:{ - label: 'name', - key: 'id', - value: 'id' - }, - api: listProcessCategory, - listToTree: true - }, - colProps: { span: 8 } - }, - { - field: 'name', - label: '流程名称', - component: 'Input', - componentProps: { - placeholder: '请输入流程名称' - }, - colProps: { span: 8 } - } -]; diff --git a/src/views/workflow/process/process.data.tsx b/src/views/workflow/process/process.data.tsx new file mode 100644 index 0000000..788feb2 --- /dev/null +++ b/src/views/workflow/process/process.data.tsx @@ -0,0 +1,207 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; +import { listProcessCategory } from '/@/api/platform/workflow/extension/controller/processCategory'; + +export const columns: BasicColumn[] = [ + { + title: '流程名称', + dataIndex: 'name', + width: 200, + }, + { + title: '流程KEY', + dataIndex: 'key', + width: 200, + }, + { + title: '流程分类', + dataIndex: 'category', + width: 150, + customRender: ({ record }) => { + const category = record.category; + return h(Tag, { color: 'processing' }, () => String(record.category).split(',')[1] || '未分类'); + } + }, + { + title: '流程版本', + dataIndex: 'version', + width: 150, + customRender: ({ record }) => { + const version = record.version; + return h(Tag, { color: version ? 'success' : 'warning' }, () => version || '版本未发布'); + } + }, + { + title: '上次发布时间', + dataIndex: 'deploymentTime', + width: 200 + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'categoryId', + label: '流程分类', + component: 'ApiTreeSelect', + componentProps: { + placeholder: '请选择流程分类', + fieldNames:{ + label: 'name', + key: 'id', + value: 'id' + }, + api: listProcessCategory, + listToTree: true + }, + colProps: { span: 8 } + }, + { + field: 'name', + label: '流程名称', + component: 'Input', + componentProps: { + placeholder: '请输入流程名称' + }, + colProps: { span: 8 } + } +]; + +export const applyColumns: BasicColumn[] = [ + { + title: '流程标题', + dataIndex: ['vars', 'title'], + width: 200, + }, + { + title: '流程名称', + dataIndex: 'processDefName', + width: 200, + }, + { + title: '当前节点', + dataIndex: 'taskName', + width: 200, + }, + { + title: '流程状态', + dataIndex: 'mesName', + width: 150, + customRender: ({ record }) => { + return h(Tag, { color: 'processing' }, () => record.mesName); + } + }, + { + title: '发起时间 / 结束时间', + dataIndex: 'startTime', + width: 200, + customRender: ({ record }) => { + return [ +

+ { record.startTime || '--' } +

, +

+ { record.endTime || '--' } +

+ ]; + } + } +]; + +export const searchApplyFormSchema: FormSchema[] = [ + { + field: 'title', + label: '流程标题', + component: 'Input', + componentProps: { + placeholder: '请输入流程标题', + }, + colProps: { span: 8 } + }, + { + field: 'dateRange', + label: '创建时间', + component: 'RangePicker', + componentProps: { + style: { width:'100%' }, + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期','结束日期'] + }, + colProps: { span: 8 } + } +]; + +export const historyColumns: BasicColumn[] = [ + { + title: '实例名称', + dataIndex: ['vars', 'title'], + width: 200, + }, + { + title: '流程名称', + dataIndex: 'processDefName', + width: 200, + }, + { + title: '流程发起人', + dataIndex: ['vars', 'userName'], + width: 200, + }, + { + title: '流程状态', + dataIndex: 'mesName', + width: 150, + customRender: ({ record }) => { + return h(Tag, { color: 'processing' }, () => record.mesName); + } + }, + { + title: '发起时间 / 结束时间', + dataIndex: 'startTime', + width: 200, + customRender: ({ record }) => { + return [ +

+ { record.startTime || '--' } +

, +

+ { record.endTime || '--' } +

+ ]; + } + } +]; + +export const runColumns: BasicColumn[] = [ + { + title: '标题', + dataIndex: ['vars', 'title'], + width: 200, + }, + { + title: '流程名称', + dataIndex: 'processDefName', + width: 200, + }, + { + title: '当前节点', + dataIndex: 'taskName', + width: 150, + customRender: ({ record }) => { + return h(Tag, { color: 'processing' }, () => record.taskName); + } + }, + { + title: '流程状态', + dataIndex: 'mesName', + width: 150, + customRender: ({ record }) => { + return h(Tag, { color: 'processing' }, () => record.mesName); + } + }, + { + title: '流程发起人', + dataIndex: ['vars', 'userName'], + width: 200, + }, +]; diff --git a/src/views/workflow/task/TaskFormView.vue b/src/views/workflow/task/TaskFormView.vue index 605a2de..e0c122c 100644 --- a/src/views/workflow/task/TaskFormView.vue +++ b/src/views/workflow/task/TaskFormView.vue @@ -32,7 +32,7 @@ :disabled="true" /> - + - +