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 a2a0c7780..d47b30c10 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts @@ -1,5 +1,28 @@ import request from '@/config/axios' -import { ModelVO } from './types' + +export type ProcessDefinitionVO = { + id: string + version: number + deploymentTIme: string + suspensionState: number +} + +export type ModelVO = { + id: number + formName: string + key: string + name: string + description: string + category: string + formType: number + formId: number + formCustomCreatePath: string + formCustomViewPath: string + processDefinition: ProcessDefinitionVO + status: number + remark: string + createTime: string +} export const getModelPageApi = async (params) => { return await request.get({ url: '/bpm/model/page', params }) diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts deleted file mode 100644 index 36f4aab1b..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -export type ProcessDefinitionVO = { - id: string - version: number - deploymentTIme: string - suspensionState: number -} - -export type ModelVO = { - id: number - formName: string - key: string - name: string - description: string - category: string - formType: number - formId: number - formCustomCreatePath: string - formCustomViewPath: string - processDefinition: ProcessDefinitionVO - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue index 7f32f6f4e..f70d52bfe 100644 --- a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue +++ b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue @@ -33,6 +33,9 @@ export default defineComponent({ if (!props.type) { return null } + if (!props.value) { + return null + } getDictObj(props.type, props.value.toString()) return ( -import dayjs from 'dayjs' -import { DICT_TYPE } from '@/utils/dict' -import { useTable } from '@/hooks/web/useTable' -import type { FormExpose } from '@/components/Form' -import type { ModelVO } from '@/api/bpm/model/types' -import { rules, allSchemas } from './model.data' + + + - - 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 index ac813738d..e3d013380 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts @@ -1,78 +1,105 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { required } from '@/utils/formRules' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + +import { DICT_TYPE } from '@/utils/dict' const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ - name: [required] + key: [required], + name: [required], + category: [required], + formType: [required], + formId: [required], + formCustomCreatePath: [required], + formCustomViewPath: [required] }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'key', + primaryType: null, + action: true, + actionWidth: '540px', + columns: [ + { + title: '流程标识', + field: 'key', + isSearch: true, + table: { + width: 120 + } }, - detail: { - show: false - } - }, - { - label: '流程标识', - field: 'key', - search: { - show: true - } - }, - { - label: '流程名称', - field: 'name', - search: { - show: true - } - }, - { - label: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - search: { - show: true - } - }, - { - label: '表单信息', - field: 'formId' - }, - { - label: '最新部署的流程定义', - field: 'processDefinition', - form: { - show: false + { + title: '流程名称', + field: 'name', + isSearch: true, + table: { + width: 120, + slots: { + default: 'name_default' + } + } }, - detail: { - show: false - } - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + dictClass: 'number', + isSearch: true }, - detail: { - show: false + { + title: '表单信息', + field: 'formId', + table: { + width: 120, + 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 } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas)