bpm:增加流程定义的列表

pull/2/head
YunaiV 2023-01-21 00:44:09 +08:00
parent c3317e144f
commit 051f4b85b7
3 changed files with 41 additions and 19 deletions

View File

@ -8,7 +8,12 @@
</template> </template>
<!-- 表单信息 --> <!-- 表单信息 -->
<template #formId_default="{ row }"> <template #formId_default="{ row }">
<XTextButton :title="row.formName" @click="handleFormDetail(row.formId)" /> <XTextButton
v-if="row.formType === 10"
:title="row.formName"
@click="handleFormDetail(row)"
/>
<XTextButton v-else :title="row.formCustomCreatePath" @click="handleFormDetail(row)" />
</template> </template>
<!-- 流程版本 --> <!-- 流程版本 -->
<template #version_default="{ row }"> <template #version_default="{ row }">
@ -51,18 +56,22 @@ import * as DefinitionApi from '@/api/bpm/definition'
// import * as ModelApi from '@/api/bpm/model' // import * as ModelApi from '@/api/bpm/model'
import { allSchemas } from './definition.data' import { allSchemas } from './definition.data'
// const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const router = useRouter() // const router = useRouter() //
const { query } = useRoute() //
import viewForm from '@form-create/element-ui' import viewForm from '@form-create/element-ui'
const ViewForm = viewForm.$form() const ViewForm = viewForm.$form()
import { setConfAndFields2 } from '@/utils/formCreate' import { setConfAndFields2 } from '@/utils/formCreate'
// ========== ========== // ========== ==========
const queryParams = reactive({
key: query.key
})
const [registerTable] = useXTable({ const [registerTable] = useXTable({
allSchemas: allSchemas, allSchemas: allSchemas,
getListApi: DefinitionApi.getProcessDefinitionPageApi getListApi: DefinitionApi.getProcessDefinitionPageApi,
params: queryParams
}) })
// //
@ -71,12 +80,17 @@ const formDetailPreview = ref({
rule: [], rule: [],
option: {} option: {}
}) })
const handleFormDetail = async (rowId: number) => { const handleFormDetail = async (row) => {
// if (row.formType == 10) {
const data = await FormApi.getFormApi(rowId) //
setConfAndFields2(formDetailPreview, data.conf, data.fields) setConfAndFields2(formDetailPreview, row.formConf, row.formFields)
// //
formDetailVisible.value = true formDetailVisible.value = true
} else {
router.push({
path: row.formCustomCreatePath
})
}
} }
// //

View File

@ -27,9 +27,11 @@
<!-- 表单信息 --> <!-- 表单信息 -->
<template #formId_default="{ row }"> <template #formId_default="{ row }">
<XTextButton <XTextButton
v-if="row.formType === 10"
:title="forms.find((form) => form.id === row.formId)?.name || row.formId" :title="forms.find((form) => form.id === row.formId)?.name || row.formId"
@click="handleFormDetail(row.formId)" @click="handleFormDetail(row)"
/> />
<XTextButton v-else :title="row.formCustomCreatePath" @click="handleFormDetail(row)" />
</template> </template>
<!-- 流程版本 --> <!-- 流程版本 -->
<template #version_default="{ row }"> <template #version_default="{ row }">
@ -76,7 +78,7 @@
preIcon="ep:aim" preIcon="ep:aim"
title="流程定义" title="流程定义"
v-hasPermi="['bpm:process-definition:query']" v-hasPermi="['bpm:process-definition:query']"
@click="handleDefinitionList(row.id)" @click="handleDefinitionList(row)"
/> />
<!-- 操作删除 --> <!-- 操作删除 -->
<XTextButton <XTextButton
@ -342,7 +344,7 @@ const handleDefinitionList = (row) => {
router.push({ router.push({
name: 'BpmProcessDefinitionList', name: 'BpmProcessDefinitionList',
query: { query: {
modelId: row.id key: row.key
} }
}) })
} }
@ -353,12 +355,18 @@ const formDetailPreview = ref({
rule: [], rule: [],
option: {} option: {}
}) })
const handleFormDetail = async (rowId: number) => { const handleFormDetail = async (row) => {
// if (row.formType == 10) {
const data = await FormApi.getFormApi(rowId) //
setConfAndFields2(formDetailPreview, data.conf, data.fields) const data = await FormApi.getFormApi(row.formId)
// setConfAndFields2(formDetailPreview, data.conf, data.fields)
formDetailVisible.value = true //
formDetailVisible.value = true
} else {
router.push({
path: row.formCustomCreatePath
})
}
} }
// //

View File

@ -54,7 +54,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '表单信息', title: '表单信息',
field: 'formId', field: 'formId',
table: { table: {
width: 120, width: 180,
slots: { slots: {
default: 'formId_default' default: 'formId_default'
} }