| | |
| | | class="form-box flex flex-col mb-30px flex-1" |
| | | > |
| | | <!-- 情况一:流程表单 --> |
| | | <el-col v-if="processDefinition?.formType === 10"> |
| | | <el-col v-if="processDefinition?.formType === BpmModelFormType.NORMAL"> |
| | | <form-create |
| | | v-model="detailForm.value" |
| | | v-model:api="fApi" |
| | |
| | | /> |
| | | </el-col> |
| | | <!-- 情况二:业务表单 --> |
| | | <div v-if="processDefinition?.formType === 20"> |
| | | <div v-if="processDefinition?.formType === BpmModelFormType.CUSTOM"> |
| | | <BusinessFormComponent :id="processInstance.businessKey" /> |
| | | </div> |
| | | </div> |
| | |
| | | :process-instance="processInstance" |
| | | :process-definition="processDefinition" |
| | | :userOptions="userOptions" |
| | | :normal-form="detailForm" |
| | | :normal-form-api="fApi" |
| | | :writable-fields="writableFields" |
| | | @success="refresh" |
| | | /> |
| | | </div> |
| | |
| | | <script lang="ts" setup> |
| | | import { formatDate } from '@/utils/formatTime' |
| | | import { DICT_TYPE } from '@/utils/dict' |
| | | import { BpmModelType } from '@/utils/constants' |
| | | import { BpmModelType, BpmModelFormType } from '@/utils/constants' |
| | | import { setConfAndFields2 } from '@/utils/formCreate' |
| | | import { registerComponent } from '@/utils/routerHelper' |
| | | import type { ApiAttrs } from '@form-create/element-ui/types/config' |
| | |
| | | value: {} |
| | | }) // 流程实例的表单详情 |
| | | |
| | | const writableFields: Array<string> = [] // 表单可以编辑的字段 |
| | | |
| | | /** 获得详情 */ |
| | | const getDetail = () => { |
| | | getApprovalDetail() |
| | |
| | | processDefinition.value = data.processDefinition |
| | | |
| | | // 设置表单信息 |
| | | if (processDefinition.value.formType === 10) { |
| | | if (processDefinition.value.formType === BpmModelFormType.NORMAL) { |
| | | // 获取表单字段权限 |
| | | const formFieldsPermission = data.formFieldsPermission |
| | | |
| | | if (detailForm.value.rule.length > 0) { |
| | | // 清空可编辑字段为空 |
| | | writableFields.splice(0) |
| | | if (detailForm.value.rule?.length > 0) { |
| | | // 避免刷新 form-create 显示不了 |
| | | detailForm.value.value = processInstance.value.formVariables |
| | | } else { |
| | |
| | | if (permission === FieldPermissionType.WRITE) { |
| | | //@ts-ignore |
| | | fApi.value?.disabled(false, field) |
| | | // 加入可以编辑的字段 |
| | | writableFields.push(field) |
| | | } |
| | | if (permission === FieldPermissionType.NONE) { |
| | | //@ts-ignore |
| | |
| | | overflow: auto; |
| | | |
| | | .form-scroll-area { |
| | | display: flex; |
| | | height: calc( |
| | | 100vh - var(--top-tool-height) - var(--tags-view-height) - var(--app-footer-height) - 35px - |
| | | $process-header-height - 40px |
| | |
| | | $process-header-height - 40px |
| | | ); |
| | | overflow: auto; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | :deep(.box-card) { |