Ver código fonte

bpm:增加流程定义的列表

YunaiV 2 anos atrás
pai
commit
051f4b85b7

+ 23 - 9
yudao-ui-admin-vue3/src/views/bpm/definition/index.vue

@@ -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
+    })
+  }
 }
 
 // 流程图的详情按钮操作

+ 17 - 9
yudao-ui-admin-vue3/src/views/bpm/model/index.vue

@@ -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
+    })
+  }
 }
 
 // 流程图的详情按钮操作

+ 1 - 1
yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts

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