2024-03-20 22:25:24 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<section class="dingflow-design">
|
2024-03-24 20:35:53 +08:00
|
|
|
|
<el-row>
|
2024-03-29 19:56:45 +08:00
|
|
|
|
<el-col :span="20" />
|
2024-03-24 20:35:53 +08:00
|
|
|
|
<el-col :span="4">
|
2024-03-27 09:27:14 +08:00
|
|
|
|
<el-button type="primary" size="small" @click="test">保存(用于测试,还未完成)</el-button>
|
2024-03-24 20:35:53 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
2024-03-20 22:25:24 +08:00
|
|
|
|
<div class="box-scale">
|
2024-03-29 19:56:45 +08:00
|
|
|
|
<!-- <div class="start-event-node">
|
|
|
|
|
|
<div class="start-event-node-text">流程开始</div>
|
|
|
|
|
|
<div class="start-event-node-circle"></div>
|
|
|
|
|
|
<div class="start-event-node-flow">
|
|
|
|
|
|
<el-popover placement="right-start" width="auto">
|
|
|
|
|
|
<div class="add-node-popover-body">
|
|
|
|
|
|
<a class="add-node-popover-item approver" @click="addType(1)">
|
|
|
|
|
|
<div class="item-wrapper">
|
|
|
|
|
|
<span class="iconfont"></span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p>审批人</p>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<template #reference>
|
|
|
|
|
|
<button class="btn" type="button">
|
|
|
|
|
|
<span class="iconfont"></span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div> -->
|
2024-03-20 22:25:24 +08:00
|
|
|
|
<nodeWrap v-model:nodeConfig="nodeConfig" />
|
|
|
|
|
|
<div class="end-node">
|
|
|
|
|
|
<div class="end-node-circle"></div>
|
|
|
|
|
|
<div class="end-node-text">流程结束</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
</div>
|
2024-03-24 20:35:53 +08:00
|
|
|
|
<approverDrawer />
|
2024-03-20 22:25:24 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import nodeWrap from '@/components/SimpleProcessDesigner/src/nodeWrap.vue'
|
2024-03-29 19:56:45 +08:00
|
|
|
|
import addNode from '@/components/SimpleProcessDesigner/src/addNode.vue'
|
2024-03-24 20:35:53 +08:00
|
|
|
|
import approverDrawer from '@/components/SimpleProcessDesigner/src/drawer/approverDrawer.vue'
|
|
|
|
|
|
import { ref } from 'vue'
|
2024-03-29 19:56:45 +08:00
|
|
|
|
import { saveBpmSimpleModel, getBpmSimpleModel } from '@/api/bpm/simple'
|
2024-03-20 22:25:24 +08:00
|
|
|
|
defineOptions({ name: 'SimpleWorkflowDesignEditor' })
|
2024-03-29 19:56:45 +08:00
|
|
|
|
const uid = getCurrentInstance().uid
|
2024-03-27 09:27:14 +08:00
|
|
|
|
const router = useRouter() // 路由
|
|
|
|
|
|
const { query } = useRoute() // 路由的查询
|
2024-03-29 19:56:45 +08:00
|
|
|
|
const modelId = query.modelId
|
2024-03-27 09:27:14 +08:00
|
|
|
|
const message = useMessage() // 国际化
|
2024-03-24 20:35:53 +08:00
|
|
|
|
const nodeConfig = ref({
|
2024-03-29 19:56:45 +08:00
|
|
|
|
name: '流程开始',
|
|
|
|
|
|
type: -1,
|
|
|
|
|
|
id: 'StartEvent_' + uid,
|
2024-03-27 09:27:14 +08:00
|
|
|
|
childNode: undefined
|
2024-03-20 22:25:24 +08:00
|
|
|
|
})
|
2024-03-29 19:56:45 +08:00
|
|
|
|
const test = async () => {
|
2024-03-27 09:27:14 +08:00
|
|
|
|
if (!modelId) {
|
|
|
|
|
|
message.error('缺少模型 modelId 编号')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
modelId: modelId,
|
|
|
|
|
|
simpleModelBody: toRaw(nodeConfig.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
console.log('request json data is ', data)
|
2024-03-29 19:56:45 +08:00
|
|
|
|
const result = await saveBpmSimpleModel(data)
|
|
|
|
|
|
console.log('save the result is ', result)
|
|
|
|
|
|
if (result) {
|
2024-03-27 09:27:14 +08:00
|
|
|
|
message.success('修改成功')
|
2024-03-29 19:56:45 +08:00
|
|
|
|
close()
|
2024-03-27 09:27:14 +08:00
|
|
|
|
} else {
|
2024-03-29 19:56:45 +08:00
|
|
|
|
message.alert('修改失败')
|
2024-03-27 09:27:14 +08:00
|
|
|
|
}
|
2024-03-29 19:56:45 +08:00
|
|
|
|
|
2024-03-24 20:35:53 +08:00
|
|
|
|
}
|
2024-03-27 09:27:14 +08:00
|
|
|
|
const close = () => {
|
|
|
|
|
|
router.push({ path: '/bpm/manager/model' })
|
|
|
|
|
|
}
|
2024-03-29 19:56:45 +08:00
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
console.log('the modelId is ', modelId)
|
|
|
|
|
|
const result = await getBpmSimpleModel(modelId)
|
|
|
|
|
|
if(result){
|
|
|
|
|
|
console.log('get the result is ', result)
|
|
|
|
|
|
nodeConfig.value = result;
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-03-20 22:25:24 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
@import url('@/components/SimpleProcessDesigner/theme/workflow.css');
|
2024-03-29 19:56:45 +08:00
|
|
|
|
</style>
|