From abbaeabc3af652a1a3b5de7909a6733a56696696 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 23 Mar 2023 22:50:48 +0800 Subject: [PATCH] =?UTF-8?q?Vue3=20=E9=87=8D=E6=9E=84=EF=BC=9A=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=9A=84=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bpm/form/index.ts | 12 +- src/router/modules/remaining.ts | 4 +- src/views/bpm/form/FormEditor.vue | 108 +++++++++++++++ src/views/bpm/form/form.data.ts | 43 ------ src/views/bpm/form/formEditor.vue | 157 ---------------------- src/views/bpm/form/index.vue | 210 ++++++++++++++++++++---------- src/views/bpm/model/index.vue | 4 +- 7 files changed, 262 insertions(+), 276 deletions(-) create mode 100644 src/views/bpm/form/FormEditor.vue delete mode 100644 src/views/bpm/form/form.data.ts delete mode 100644 src/views/bpm/form/formEditor.vue diff --git a/src/api/bpm/form/index.ts b/src/api/bpm/form/index.ts index c745201f..142ed24c 100644 --- a/src/api/bpm/form/index.ts +++ b/src/api/bpm/form/index.ts @@ -11,7 +11,7 @@ export type FormVO = { } // 创建工作流的表单定义 -export const createFormApi = async (data: FormVO) => { +export const createForm = async (data: FormVO) => { return await request.post({ url: '/bpm/form/create', data: data @@ -19,7 +19,7 @@ export const createFormApi = async (data: FormVO) => { } // 更新工作流的表单定义 -export const updateFormApi = async (data: FormVO) => { +export const updateForm = async (data: FormVO) => { return await request.put({ url: '/bpm/form/update', data: data @@ -27,21 +27,21 @@ export const updateFormApi = async (data: FormVO) => { } // 删除工作流的表单定义 -export const deleteFormApi = async (id: number) => { +export const deleteForm = async (id: number) => { return await request.delete({ url: '/bpm/form/delete?id=' + id }) } // 获得工作流的表单定义 -export const getFormApi = async (id: number) => { +export const getForm = async (id: number) => { return await request.get({ url: '/bpm/form/get?id=' + id }) } // 获得工作流的表单定义分页 -export const getFormPageApi = async (params) => { +export const getFormPage = async (params) => { return await request.get({ url: '/bpm/form/page', params @@ -49,7 +49,7 @@ export const getFormPageApi = async (params) => { } // 获得动态表单的精简列表 -export const getSimpleFormsApi = async () => { +export const getSimpleFormList = async () => { return await request.get({ url: '/bpm/form/list-all-simple' }) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index d5970267..04f0d3d0 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -225,14 +225,14 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: '/manager/form/edit', - component: () => import('@/views/bpm/form/formEditor.vue'), + component: () => import('@/views/bpm/form/FormEditor.vue'), name: 'bpmFormEditor', meta: { noCache: true, hidden: true, canTo: true, title: '设计流程表单', - activeMenu: 'bpm/manager/form/formEditor' + activeMenu: '/bpm/manager/form' } }, { diff --git a/src/views/bpm/form/FormEditor.vue b/src/views/bpm/form/FormEditor.vue new file mode 100644 index 00000000..25ff66fe --- /dev/null +++ b/src/views/bpm/form/FormEditor.vue @@ -0,0 +1,108 @@ + + diff --git a/src/views/bpm/form/form.data.ts b/src/views/bpm/form/form.data.ts deleted file mode 100644 index 43c93dd7..00000000 --- a/src/views/bpm/form/form.data.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - name: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '表单编号', - action: true, - columns: [ - { - title: '表单名', - field: 'name', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - title: '备注', - field: 'remark' - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - table: { - width: 180 - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue deleted file mode 100644 index 1070739e..00000000 --- a/src/views/bpm/form/formEditor.vue +++ /dev/null @@ -1,157 +0,0 @@ - - diff --git a/src/views/bpm/form/index.vue b/src/views/bpm/form/index.vue index b4b208a9..7e14b3e3 100644 --- a/src/views/bpm/form/index.vue +++ b/src/views/bpm/form/index.vue @@ -1,93 +1,171 @@ - diff --git a/src/views/bpm/model/index.vue b/src/views/bpm/model/index.vue index 01a97d3f..e88ee89e 100644 --- a/src/views/bpm/model/index.vue +++ b/src/views/bpm/model/index.vue @@ -374,7 +374,7 @@ const formDetailPreview = ref({ const handleFormDetail = async (row) => { if (row.formType == 10) { // 设置表单 - const data = await FormApi.getFormApi(row.formId) + const data = await FormApi.getForm(row.formId) setConfAndFields2(formDetailPreview, data.conf, data.fields) // 弹窗打开 formDetailVisible.value = true @@ -588,7 +588,7 @@ const uploadClose = () => { // ========== 初始化 ========== onMounted(() => { // 获得流程表单的下拉框的数据 - FormApi.getSimpleFormsApi().then((data) => { + FormApi.getSimpleFormList().then((data) => { forms.value = data }) })