vue-vben-admin/src/components/ProcessDesigner/package/penal/subprocess/index.vue

77 lines
2.2 KiB
Vue

<!-- 开始节点配置 -->
<template>
<div class="subprocess">
<a-form ref="formRef" :model="node" labelAlign="left" :label-col="labelCol" :wrapper-col="wrapperCol"
:disabled="data.componentDisabled">
<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="list" @change="changeScheme"
:fieldNames="{ value: 'id', label: 'name' }">
</a-select>
</a-form-item>
<a-form-item label="流程版本">
<a-select v-model:value="node.wfVersionId" :options="verisons" :fieldNames="{value:'id',label:'createDate'}">
</a-select>
</a-form-item>
</a-form>
</div>
</template>
<script lang="ts" setup>
import { reactive, defineProps, computed, inject, ref, watch, h, onMounted } from 'vue'
import { getDetail, getLoad, getVerisonsLoad } from '@/api/sys/WFSchemeInfo'
import { flowStore } from '@/store/modules/flow';
const flowWfDataStore = flowStore();
const labelCol = { span: 7 };
const wrapperCol = { span: 17 };
const props = defineProps({
element: Object,
schemeCode: String,
pageType: String,
pageView: String,
})
let node = ref({})
const data = reactive({
componentDisabled: props.pageType == 'detail' ? true : false
})
const list = ref([])
const verisons = ref([])
watch(
() => props.element,
(newVal, oldVal) => {
if (newVal.type == "bpmn:SubProcess") {
const currentNode = flowWfDataStore.getWfDataNode(newVal.id)
if (currentNode) {
node.value = currentNode
} else {
node.value = newVal
}
}
}
)
async function getSchemeList() {
const data = await getLoad()
list.value = data
}
async function changeScheme() {
const data = await getVerisonsLoad({ id: node.value.wfschemeId })
verisons.value = data
}
onMounted(() => {
getSchemeList()
})
defineExpose({
})
</script>
<style>
</style>