mirror of
https://gitee.com/myxzgzs/boyue_jnpf.git
synced 2025-08-08 15:22:43 +08:00
63 lines
1.6 KiB
Plaintext
63 lines
1.6 KiB
Plaintext
<template>
|
|
<div class="jnpf-content-wrapper bg-white">
|
|
<FlowParser @register="registerFlowParser" @reload="init()" />
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { reactive, onMounted, toRefs} from 'vue';
|
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
import { usePopup } from '@/components/Popup';
|
|
import FlowParser from '@/views/workFlow/components/FlowParser.vue';
|
|
import { getFlowStartFormId } from '@/api/workFlow/template';
|
|
import { useTabs } from '@/hooks/web/useTabs';
|
|
import { useRouter } from 'vue-router';
|
|
|
|
interface State {
|
|
flowId: string;
|
|
}
|
|
|
|
const { close } = useTabs();
|
|
const router = useRouter();
|
|
const { createMessage } = useMessage();
|
|
const [registerFlowParser, { openPopup: openFlowParser }] = usePopup();
|
|
const state = reactive<State>({
|
|
flowId: '',//请在此处填写流程模板id
|
|
});
|
|
|
|
function init() {
|
|
const data = {
|
|
id: '',
|
|
flowId: state.flowId,
|
|
opType: '-1',
|
|
hideCancelBtn: true,
|
|
hideSaveBtn: true,
|
|
};
|
|
openFlowParser(true, data);
|
|
}
|
|
|
|
#if(${context.isFlow})
|
|
function getFlowId(){
|
|
if(!state.flowId){
|
|
createMessage.error('流程模板的flowId未填写')
|
|
close();
|
|
router.replace('/404');
|
|
return
|
|
}
|
|
getFlowStartFormId(state.flowId).then(res => {
|
|
init()
|
|
}).catch(() => {
|
|
close();
|
|
router.replace('/404');
|
|
});
|
|
}
|
|
#end
|
|
onMounted(() => {
|
|
#if(${context.isFlow})
|
|
getFlowId()
|
|
#else
|
|
init();
|
|
#end
|
|
});
|
|
</script>
|