Commit 051f4b85b70874dc9a567defda28d8d15909517e

Authored by YunaiV
1 parent c3317e14

bpm:增加流程定义的列表

yudao-ui-admin-vue3/src/views/bpm/definition/index.vue
... ... @@ -8,7 +8,12 @@
8 8 </template>
9 9 <!-- 表单信息 -->
10 10 <template #formId_default="{ row }">
11   - <XTextButton :title="row.formName" @click="handleFormDetail(row.formId)" />
  11 + <XTextButton
  12 + v-if="row.formType === 10"
  13 + :title="row.formName"
  14 + @click="handleFormDetail(row)"
  15 + />
  16 + <XTextButton v-else :title="row.formCustomCreatePath" @click="handleFormDetail(row)" />
12 17 </template>
13 18 <!-- 流程版本 -->
14 19 <template #version_default="{ row }">
... ... @@ -51,18 +56,22 @@ import * as DefinitionApi from &#39;@/api/bpm/definition&#39;
51 56 // import * as ModelApi from '@/api/bpm/model'
52 57 import { allSchemas } from './definition.data'
53 58  
54   -// const { t } = useI18n() // 国际化
55 59 const message = useMessage() // 消息弹窗
56 60 const router = useRouter() // 路由
  61 +const { query } = useRoute() // 查询参数
57 62  
58 63 import viewForm from '@form-create/element-ui'
59 64 const ViewForm = viewForm.$form()
60 65 import { setConfAndFields2 } from '@/utils/formCreate'
61 66  
62 67 // ========== 列表相关 ==========
  68 +const queryParams = reactive({
  69 + key: query.key
  70 +})
63 71 const [registerTable] = useXTable({
64 72 allSchemas: allSchemas,
65   - getListApi: DefinitionApi.getProcessDefinitionPageApi
  73 + getListApi: DefinitionApi.getProcessDefinitionPageApi,
  74 + params: queryParams
66 75 })
67 76  
68 77 // 流程表单的详情按钮操作
... ... @@ -71,12 +80,17 @@ const formDetailPreview = ref({
71 80 rule: [],
72 81 option: {}
73 82 })
74   -const handleFormDetail = async (rowId: number) => {
75   - // 设置表单
76   - const data = await FormApi.getFormApi(rowId)
77   - setConfAndFields2(formDetailPreview, data.conf, data.fields)
78   - // 弹窗打开
79   - formDetailVisible.value = true
  83 +const handleFormDetail = async (row) => {
  84 + if (row.formType == 10) {
  85 + // 设置表单
  86 + setConfAndFields2(formDetailPreview, row.formConf, row.formFields)
  87 + // 弹窗打开
  88 + formDetailVisible.value = true
  89 + } else {
  90 + router.push({
  91 + path: row.formCustomCreatePath
  92 + })
  93 + }
80 94 }
81 95  
82 96 // 流程图的详情按钮操作
... ...
yudao-ui-admin-vue3/src/views/bpm/model/index.vue
... ... @@ -27,9 +27,11 @@
27 27 <!-- 表单信息 -->
28 28 <template #formId_default="{ row }">
29 29 <XTextButton
  30 + v-if="row.formType === 10"
30 31 :title="forms.find((form) => form.id === row.formId)?.name || row.formId"
31   - @click="handleFormDetail(row.formId)"
  32 + @click="handleFormDetail(row)"
32 33 />
  34 + <XTextButton v-else :title="row.formCustomCreatePath" @click="handleFormDetail(row)" />
33 35 </template>
34 36 <!-- 流程版本 -->
35 37 <template #version_default="{ row }">
... ... @@ -76,7 +78,7 @@
76 78 preIcon="ep:aim"
77 79 title="流程定义"
78 80 v-hasPermi="['bpm:process-definition:query']"
79   - @click="handleDefinitionList(row.id)"
  81 + @click="handleDefinitionList(row)"
80 82 />
81 83 <!-- 操作:删除 -->
82 84 <XTextButton
... ... @@ -342,7 +344,7 @@ const handleDefinitionList = (row) =&gt; {
342 344 router.push({
343 345 name: 'BpmProcessDefinitionList',
344 346 query: {
345   - modelId: row.id
  347 + key: row.key
346 348 }
347 349 })
348 350 }
... ... @@ -353,12 +355,18 @@ const formDetailPreview = ref({
353 355 rule: [],
354 356 option: {}
355 357 })
356   -const handleFormDetail = async (rowId: number) => {
357   - // 设置表单
358   - const data = await FormApi.getFormApi(rowId)
359   - setConfAndFields2(formDetailPreview, data.conf, data.fields)
360   - // 弹窗打开
361   - formDetailVisible.value = true
  358 +const handleFormDetail = async (row) => {
  359 + if (row.formType == 10) {
  360 + // 设置表单
  361 + const data = await FormApi.getFormApi(row.formId)
  362 + setConfAndFields2(formDetailPreview, data.conf, data.fields)
  363 + // 弹窗打开
  364 + formDetailVisible.value = true
  365 + } else {
  366 + router.push({
  367 + path: row.formCustomCreatePath
  368 + })
  369 + }
362 370 }
363 371  
364 372 // 流程图的详情按钮操作
... ...
yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts
... ... @@ -54,7 +54,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
54 54 title: '表单信息',
55 55 field: 'formId',
56 56 table: {
57   - width: 120,
  57 + width: 180,
58 58 slots: {
59 59 default: 'formId_default'
60 60 }
... ...