仿钉钉设计流程后端接入-10%

This commit is contained in:
jason 2024-03-27 09:27:14 +08:00
parent cf28e42a26
commit 627b822f15
6 changed files with 50 additions and 14 deletions

View File

@ -0,0 +1,9 @@
import request from '@/config/axios'
export const saveBpmSimpleModel = async (data) => {
return await request.post({
url: '/bpm/simple/save',
data: data
})
}

View File

@ -10,6 +10,7 @@
</div> </div>
<p>审批人</p> <p>审批人</p>
</a> </a>
<!-- TODO 暂时去掉未完成
<a class="add-node-popover-item notifier" @click="addType(2)"> <a class="add-node-popover-item notifier" @click="addType(2)">
<div class="item-wrapper"> <div class="item-wrapper">
<span class="iconfont"></span> <span class="iconfont"></span>
@ -22,6 +23,7 @@
</div> </div>
<p>条件分支</p> <p>条件分支</p>
</a> </a>
-->
</div> </div>
<template #reference> <template #reference>
<button class="btn" type="button"> <button class="btn" type="button">
@ -71,8 +73,7 @@ const addType = (type) => {
candidateStrategy: undefined, candidateStrategy: undefined,
candidateParam: [] candidateParam: []
}, },
childNode: props.childNodeP, // childNode: props.childNodeP
nodeUserList: []
} }
} else if (type == 2) { } else if (type == 2) {
data = { data = {
@ -97,7 +98,7 @@ const addType = (type) => {
priorityLevel: 1, priorityLevel: 1,
conditionList: [], conditionList: [],
nodeUserList: [], nodeUserList: [],
childNode: props.childNodeP // childNode: props.childNodeP
}, },
{ {
name: '条件2', name: '条件2',

View File

@ -250,7 +250,7 @@ const saveApprover = () => {
closeDrawer() closeDrawer()
} }
const saveConfig = () => { const saveConfig = () => {
console.log('before userTaskConfig is ', userTaskConfig.value.id)
const rawConfig = toRaw(userTaskConfig.value) const rawConfig = toRaw(userTaskConfig.value)
rawConfig.value.attributes = toRaw(candidateConfig.value) rawConfig.value.attributes = toRaw(candidateConfig.value)
rawConfig.flag = true rawConfig.flag = true

View File

@ -295,7 +295,8 @@ const setPerson = (priorityLevel) => {
} }
setUserTaskConfig({ setUserTaskConfig({
value: { value: {
...JSON.parse(JSON.stringify(props.nodeConfig)) ...JSON.parse(JSON.stringify(props.nodeConfig)),
id: 'Activity_'+_uid,
}, },
flag: false, flag: false,
id: _uid, id: _uid,

View File

@ -74,7 +74,7 @@
</el-table-column> </el-table-column>
<el-table-column label="流程图标" align="center" prop="icon" width="100"> <el-table-column label="流程图标" align="center" prop="icon" width="100">
<template #default="scope"> <template #default="scope">
<el-image :src="scope.row.icon" class="w-32px h-32px" /> <el-image :src="scope.row.icon" class="h-32px w-32px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程分类" align="center" prop="categoryName" width="100" /> <el-table-column label="流程分类" align="center" prop="categoryName" width="100" />
@ -165,7 +165,7 @@
<el-button <el-button
link link
type="primary" type="primary"
@click="handleSimpleDesign(scope.row.id)" @click="handleSimpleDesign(scope.row)"
v-hasPermi="['bpm:model:update']" v-hasPermi="['bpm:model:update']"
> >
仿钉钉设计流程 仿钉钉设计流程

View File

@ -5,7 +5,7 @@
<el-row> <el-row>
<el-col :span="20"/> <el-col :span="20"/>
<el-col :span="4"> <el-col :span="4">
<el-button type="primary" size="small" @click="test">测试</el-button> <el-button type="primary" size="small" @click="test">保存(用于测试还未完成)</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="box-scale"> <div class="box-scale">
@ -23,20 +23,45 @@
import nodeWrap from '@/components/SimpleProcessDesigner/src/nodeWrap.vue' import nodeWrap from '@/components/SimpleProcessDesigner/src/nodeWrap.vue'
import approverDrawer from '@/components/SimpleProcessDesigner/src/drawer/approverDrawer.vue' import approverDrawer from '@/components/SimpleProcessDesigner/src/drawer/approverDrawer.vue'
import { ref } from 'vue' import { ref } from 'vue'
import { saveBpmSimpleModel } from '@/api/bpm/simple'
defineOptions({ name: 'SimpleWorkflowDesignEditor' }) defineOptions({ name: 'SimpleWorkflowDesignEditor' })
const uid = getCurrentInstance().uid;
const router = useRouter() //
const { query } = useRoute() //
const modelId = query.modelId;
const message = useMessage() //
const nodeConfig = ref({ const nodeConfig = ref({
name: '发起人', name: '发起人',
type: 0, type: 0,
id: 'root', id: 'Activity_'+uid,
nodeUserList: [],
attributes: { attributes: {
"candidateStrategy": 70 "candidateStrategy": '70'
}, },
childNode: {}, childNode: undefined
}) })
const test = ()=> { const test = async ()=> {
console.log('json format', toRaw(nodeConfig.value)) if (!modelId) {
message.error('缺少模型 modelId 编号')
return
}
const data = {
modelId: modelId,
simpleModelBody: toRaw(nodeConfig.value)
}
console.log('request json data is ', data)
const result = await saveBpmSimpleModel(data);
console.log('the result is ', result)
if(result){
message.success('修改成功')
} else {
message.alert('修改失败');
}
close ()
} }
const close = () => {
router.push({ path: '/bpm/manager/model' })
}
</script> </script>
<style> <style>
@import url('@/components/SimpleProcessDesigner/theme/workflow.css'); @import url('@/components/SimpleProcessDesigner/theme/workflow.css');