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

View File

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

View File

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