Commit 3466b318b1b1a46894cf42b3a6c6cdfb3c7e5da8

Authored by YunaiV
1 parent ec6a46a5

bpm:流程模型的列表的表单展示

yudao-ui-admin-vue3/src/views/bpm/model/index.vue
... ... @@ -28,7 +28,7 @@
28 28 <template #formId_default="{ row }">
29 29 <XTextButton
30 30 :title="forms.find((form) => form.id === row.formId)?.name || row.formId"
31   - @click="handleFormDetail(row.id)"
  31 + @click="handleFormDetail(row.formId)"
32 32 />
33 33 </template>
34 34 <!-- 流程版本 -->
... ... @@ -212,7 +212,7 @@
212 212 <XButton
213 213 type="primary"
214 214 :loading="dialogLoading"
215   - @click="submitForm()"
  215 + @click="submitForm"
216 216 :title="t('action.save')"
217 217 />
218 218 <!-- 按钮:关闭 -->
... ... @@ -287,6 +287,15 @@
287 287 <XButton title="取 消" @click="uploadClose" />
288 288 </template>
289 289 </XModal>
  290 +
  291 + <!-- 表单详情的弹窗 -->
  292 + <XModal v-model="formDetailVisible" width="800" title="表单详情" :show-footer="false">
  293 + <ViewForm
  294 + :rule="formDetailPreview.rule"
  295 + :option="formDetailPreview.option"
  296 + v-if="formDetailVisible"
  297 + />
  298 + </XModal>
290 299 </ContentWrap>
291 300 </template>
292 301  
... ... @@ -306,6 +315,10 @@ const { t } = useI18n() // 国际化
306 315 const message = useMessage() // 消息弹窗
307 316 const router = useRouter() // 路由
308 317  
  318 +import viewForm from '@form-create/element-ui'
  319 +const ViewForm = viewForm.$form()
  320 +import { setConfAndFields2 } from '@/utils/formCreate'
  321 +
309 322 // ========== 列表相关 ==========
310 323 const [registerTable, { reload }] = useXTable({
311 324 allSchemas: allSchemas,
... ... @@ -335,10 +348,17 @@ const handleDefinitionList = (row) =&gt; {
335 348 }
336 349  
337 350 // 流程表单的详情按钮操作
338   -const handleFormDetail = (row) => {
339   - // TODO 芋艿:表单组件开发中
340   - console.log(row)
341   - message.success('动态表单开发中,预计 2 月底完成')
  351 +const formDetailVisible = ref(false)
  352 +const formDetailPreview = ref({
  353 + rule: [],
  354 + option: {}
  355 +})
  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
342 362 }
343 363  
344 364 // 流程图的详情按钮操作
... ...