master
面包骑士 2024-09-05 22:34:48 +08:00
parent 740ad27ef0
commit 429bb57dd4
2 changed files with 32 additions and 7 deletions

View File

@ -50,3 +50,12 @@ export function execute(taskCode) {
method: 'post' method: 'post'
}) })
} }
// 测试执行
export function testExecute(data) {
return request({
url: '/quest/task/testExecute',
method: 'post',
data: data
})
}

View File

@ -3,10 +3,14 @@
<div class="nodes-wrap" align="center"> <div class="nodes-wrap" align="center">
<el-button <el-button
style="width: 75%;margin-top: 5px;margin-bottom: 5px;" style="width: 75%;margin-top: 5px;margin-bottom: 5px;"
type="primary" @click="save">保存修改</el-button> type="primary" @click="save">保存</el-button>
<el-button
style="width: 75%;margin-left: 0;margin-top: 5px;margin-bottom: 5px;"
type="info" @click="test">测试</el-button>
<el-button <el-button
style="width: 75%;margin-left: 0;margin-bottom: 5px;" style="width: 75%;margin-left: 0;margin-bottom: 5px;"
@click="returnBack">返回</el-button> @click="returnBack">返回</el-button>
<div> <div>
<el-divider content-position="left">基础</el-divider> <el-divider content-position="left">基础</el-divider>
<div v-for="item in nodeTypeList.filter(node => node.partition === 'basis')" :key="item.type" class="node" draggable="true" @dragstart="drag($event, item)"> <div v-for="item in nodeTypeList.filter(node => node.partition === 'basis')" :key="item.type" class="node" draggable="true" @dragstart="drag($event, item)">
@ -60,6 +64,7 @@ import {batch, listNode} from "../../../api/quest/node";
import {GenNonDuplicateID} from "../../../common/until"; import {GenNonDuplicateID} from "../../../common/until";
import panzoom from "panzoom"; import panzoom from "panzoom";
import methods from "./config/methods"; import methods from "./config/methods";
import {execute, testExecute} from "../../../api/quest/task";
export default { export default {
name: "FlowEdit", name: "FlowEdit",
@ -181,13 +186,13 @@ export default {
}); });
return Array.from(map.values()); return Array.from(map.values());
}, },
// /** 参数处理 */
save() { handleSubmit() {
// 1. 线 // 1. 线
const nodeList = this.data.nodeList const nodeList = this.data.nodeList
const lineList = this.lineHandle(this.data.lineList) const lineList = this.lineHandle(this.data.lineList)
this.checkData.nodeList = nodeList this.checkData.nodeList = this.data.nodeList
this.checkData.lineList = lineList this.checkData.lineList = this.data.lineList
console.log(this.data) console.log(this.data)
// 2. ,jsPlumb ==> // 2. ,jsPlumb ==>
@ -209,11 +214,22 @@ export default {
}) })
nodeData.push(flowNode.methods.toMysqlNode(node,preLine,nextLine,this.taskCode)) nodeData.push(flowNode.methods.toMysqlNode(node,preLine,nextLine,this.taskCode))
}) })
// 3. return nodeData;
},
//
test() {
const nodeData = this.handleSubmit();
testExecute(nodeData).then(res => {
this.$message.success(res.data)
})
},
//
save() {
const nodeData = this.handleSubmit();
//
batch(nodeData,this.$route.query.taskCode).then(res => { batch(nodeData,this.$route.query.taskCode).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
}) })
console.log(nodeData)
}, },
// //
returnBack() { returnBack() {