master
parent
740ad27ef0
commit
429bb57dd4
|
@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue