diff --git a/src/api/bpm/model/index.ts b/src/api/bpm/model/index.ts index feedd20b..68a8d0e8 100644 --- a/src/api/bpm/model/index.ts +++ b/src/api/bpm/model/index.ts @@ -25,7 +25,7 @@ export type ModelVO = { bpmnXml: string } -export const getModelPageApi = async (params) => { +export const getModelPage = async (params) => { return await request.get({ url: '/bpm/model/page', params }) } @@ -33,7 +33,7 @@ export const getModel = async (id: number) => { return await request.get({ url: '/bpm/model/get?id=' + id }) } -export const updateModelApi = async (data: ModelVO) => { +export const updateModel = async (data: ModelVO) => { return await request.put({ url: '/bpm/model/update', data: data }) } @@ -46,7 +46,7 @@ export const updateModelStateApi = async (id: number, state: number) => { return await request.put({ url: '/bpm/model/update-state', data: data }) } -export const createModelApi = async (data: ModelVO) => { +export const createModel = async (data: ModelVO) => { return await request.post({ url: '/bpm/model/create', data: data }) } diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index ecbfedb4..e3ba78d2 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -34,7 +34,7 @@ export default defineComponent({ return null } // 解决自定义字典标签值为零时标签不渲染的问题 - if (props.value === undefined) { + if (props.value === undefined || props.value === null) { return null } getDictObj(props.type, props.value.toString()) diff --git a/src/views/bpm/model/ModelForm.vue b/src/views/bpm/model/ModelForm.vue new file mode 100644 index 00000000..192c5b2f --- /dev/null +++ b/src/views/bpm/model/ModelForm.vue @@ -0,0 +1,219 @@ + + diff --git a/src/views/bpm/model/editor/index.vue b/src/views/bpm/model/editor/index.vue index a59844dc..7e3d8413 100644 --- a/src/views/bpm/model/editor/index.vue +++ b/src/views/bpm/model/editor/index.vue @@ -62,10 +62,10 @@ const save = async (bpmnXml) => { } as unknown as ModelApi.ModelVO // 提交 if (data.id) { - await ModelApi.updateModelApi(data) + await ModelApi.updateModel(data) message.success('修改成功') } else { - await ModelApi.createModelApi(data) + await ModelApi.createModel(data) message.success('新增成功') } // 跳转回去 diff --git a/src/views/bpm/model/index.vue b/src/views/bpm/model/index.vue index 9a4df2e8..01e38a92 100644 --- a/src/views/bpm/model/index.vue +++ b/src/views/bpm/model/index.vue @@ -1,595 +1,249 @@ - diff --git a/src/views/bpm/model/model.data.ts b/src/views/bpm/model/model.data.ts deleted file mode 100644 index 89e886cc..00000000 --- a/src/views/bpm/model/model.data.ts +++ /dev/null @@ -1,106 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - key: [required], - name: [required], - category: [required], - formType: [required], - formId: [required], - formCustomCreatePath: [required], - formCustomViewPath: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'key', - primaryType: null, - action: true, - actionWidth: '540px', - columns: [ - { - title: '流程标识', - field: 'key', - isSearch: true, - table: { - width: 120 - } - }, - { - title: '流程名称', - field: 'name', - isSearch: true, - table: { - width: 120, - slots: { - default: 'name_default' - } - } - }, - { - title: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - isSearch: true, - table: { - slots: { - default: 'category_default' - } - } - }, - { - title: '表单信息', - field: 'formId', - table: { - width: 180, - slots: { - default: 'formId_default' - } - } - }, - { - title: '最新部署的流程定义', - field: 'processDefinition', - isForm: false, - table: { - children: [ - { - title: '流程版本', - field: 'version', - slots: { - default: 'version_default' - }, - width: 80 - }, - { - title: '激活状态', - field: 'status', - slots: { - default: 'status_default' - }, - width: 80 - }, - { - title: '部署时间', - field: 'processDefinition.deploymentTime', - formatter: 'formatDate', - width: 180 - } - ] - } - }, - { - title: t('common.createTime'), - field: 'createTime', - isForm: false, - formatter: 'formatDate', - table: { - width: 180 - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas)