2024-03-09 16:45:47 +08:00
|
|
|
<!-- 开始节点配置 -->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="subprocess">
|
|
|
|
|
<a-form ref="formRef" :model="node" labelAlign="left" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
|
|
|
<a-form-item label="节点标识">
|
|
|
|
|
<a-input v-model:value="node.id" placeholder="请输入" readonly />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="是否异步">
|
|
|
|
|
<a-switch v-model:checked="node.isAsync" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="流程模版">
|
|
|
|
|
<a-select v-model:value="node.wfschemeId" :options="data.list">
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="流程版本">
|
|
|
|
|
<a-select v-model:value="node.wfVersionId" :options="data.verisons">
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-03-13 16:53:01 +08:00
|
|
|
import { reactive, defineProps, computed, inject, ref, watch, h ,onMounted} from 'vue'
|
|
|
|
|
import { getDetail } from '@/api/sys/WFSchemeInfo'
|
2024-03-09 16:45:47 +08:00
|
|
|
const labelCol = { span: 7 };
|
|
|
|
|
const wrapperCol = { span: 17 };
|
|
|
|
|
const props = defineProps({
|
2024-03-13 16:53:01 +08:00
|
|
|
element: Object,
|
|
|
|
|
schemeCode:String,
|
2024-03-09 16:45:47 +08:00
|
|
|
})
|
2024-03-13 16:53:01 +08:00
|
|
|
let node = ref({
|
2024-03-11 16:55:44 +08:00
|
|
|
id: '',
|
|
|
|
|
isAsync: false,
|
|
|
|
|
wfschemeId: '',
|
|
|
|
|
wfVersionId: '',
|
2024-03-09 16:45:47 +08:00
|
|
|
})
|
2024-03-11 16:55:44 +08:00
|
|
|
watch(
|
|
|
|
|
() => props.element,
|
|
|
|
|
(newVal, oldVal) => {
|
2024-03-12 16:41:21 +08:00
|
|
|
if (newVal.type == "bpmn:SubProcess") {
|
2024-03-13 16:53:01 +08:00
|
|
|
node.value.id = newVal.id
|
|
|
|
|
node.value.type = newVal.type
|
|
|
|
|
getDetailInfo()
|
2024-03-12 16:41:21 +08:00
|
|
|
}
|
2024-03-11 16:55:44 +08:00
|
|
|
}
|
|
|
|
|
)
|
2024-03-13 16:53:01 +08:00
|
|
|
async function getDetailInfo() {
|
|
|
|
|
let data = await getDetail({ code: props.schemeCode })
|
|
|
|
|
let scheme = JSON.parse(data.scheme.content);
|
|
|
|
|
let wfData = scheme.wfData
|
|
|
|
|
wfData.forEach(element => {
|
|
|
|
|
if(element.id == node.value.id){
|
|
|
|
|
node.value = element
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
2024-03-09 16:45:47 +08:00
|
|
|
const data = reactive({
|
|
|
|
|
list: [],
|
|
|
|
|
verisons: []
|
|
|
|
|
})
|
2024-03-13 16:53:01 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
if (props.schemeCode) {
|
|
|
|
|
getDetailInfo()
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-03-11 16:55:44 +08:00
|
|
|
function getForm() {
|
2024-03-13 16:53:01 +08:00
|
|
|
if (node.value.id != '') {
|
|
|
|
|
return node.value
|
2024-03-12 16:41:21 +08:00
|
|
|
}
|
2024-03-11 16:55:44 +08:00
|
|
|
}
|
|
|
|
|
defineExpose({
|
|
|
|
|
getForm
|
|
|
|
|
})
|
2024-03-09 16:45:47 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|