Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm

pull/582/head
jason 2024-10-29 21:24:46 +08:00
commit 7044bcee60
2 changed files with 19 additions and 15 deletions

View File

@ -70,13 +70,7 @@
<!-- 弹窗流程模型图的预览 -->
<Dialog title="流程图" v-model="bpmnDetailVisible" width="800">
<MyProcessViewer
key="designer"
v-model="bpmnXml"
:value="bpmnXml as any"
v-bind="bpmnControlForm"
:prefix="bpmnControlForm.prefix"
/>
<MyProcessViewer style="height: 700px" key="designer" :xml="bpmnXml" />
</Dialog>
</template>
@ -118,7 +112,7 @@ const formDetailPreview = ref({
rule: [],
option: {}
})
const handleFormDetail = async (row) => {
const handleFormDetail = async (row: any) => {
if (row.formType == 10) {
//
setConfAndFields2(formDetailPreview, row.formConf, row.formFields)
@ -133,13 +127,13 @@ const handleFormDetail = async (row) => {
/** 流程图的详情按钮操作 */
const bpmnDetailVisible = ref(false)
const bpmnXml = ref(null)
const bpmnControlForm = ref({
prefix: 'flowable'
})
const handleBpmnDetail = async (row) => {
bpmnXml.value = (await DefinitionApi.getProcessDefinition(row.id))?.bpmnXml
const bpmnXml = ref('')
const handleBpmnDetail = async (row: any) => {
//
bpmnXml.value = ''
bpmnDetailVisible.value = true
// BPMN XML
bpmnXml.value = (await DefinitionApi.getProcessDefinition(row.id))?.bpmnXml
}
/** 初始化 **/

View File

@ -95,7 +95,7 @@
<script lang="ts" setup>
import * as DefinitionApi from '@/api/bpm/definition'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { setConfAndFields2 } from '@/utils/formCreate'
import { decodeFields, setConfAndFields2 } from '@/utils/formCreate'
import type { ApiAttrs } from '@form-create/element-ui/types/config'
import ProcessInstanceBpmnViewer from '../detail/ProcessInstanceBpmnViewer.vue'
import { CategoryApi } from '@/api/bpm/category'
@ -185,7 +185,17 @@ const handleSelect = async (row, formVariables) => {
//
if (row.formType == 10) {
//
// formVariables row.formFields
// formVariables
//
const allowedFields = decodeFields(row.formFields).map((fieldObj: any) => fieldObj.field)
for (const key in formVariables) {
if (!allowedFields.includes(key)) {
delete formVariables[key]
}
}
setConfAndFields2(detailForm, row.formConf, row.formFields, formVariables)
//
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(row.id)
if (processDefinitionDetail) {