更新流程

pull/3/head
张腾 2024-08-29 00:58:59 +08:00
parent 1f5f9a9a49
commit 07790e5924
5 changed files with 209 additions and 19 deletions

View File

@ -31,4 +31,11 @@ export function updTask(params) {
}) })
} }
export function extractDataName() {
return request({
url: '/integration/task/extractDataName',
method: 'post',
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -45,7 +45,11 @@ export const constantRoutes = [
component: () => import('@/views/login'), component: () => import('@/views/login'),
hidden: true hidden: true
}, },
{
path: '/easyFlow',
component: () => import('@/components/ef/panel'),
hidden: true
},
{ {
path: '/register', path: '/register',
component: () => import('@/views/register'), component: () => import('@/views/register'),

View File

@ -24,65 +24,65 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column label="编号" width="180"> <el-table-column label="编号" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.id }}</span> <span style="margin-left: 10px">{{ scope.row.id }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务名称" width="180"> <el-table-column label="任务名称" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.name }}</span> <span style="margin-left: 10px">{{ scope.row.name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务权重级别" width="180"> <el-table-column label="任务权重级别" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px" v-if="scope.row.weight == 1"></span> <span style="margin-left: 10px" v-if="scope.row.weight == 1"></span>
<span style="margin-left: 10px" v-if="scope.row.weight == 2"></span> <span style="margin-left: 10px" v-if="scope.row.weight == 2"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务执行状态" width="180"> <el-table-column label="任务执行状态" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.processTotal }}</span> <span style="margin-left: 10px">{{ scope.row.processStatus }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最终执行结果" width="180"> <el-table-column label="最终执行结果" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.status }}</span> <span style="margin-left: 10px" v-if="scope.row.status == 1"></span>
<span style="margin-left: 10px" v-if="scope.row.status == 0"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总处理条数" width="180"> <el-table-column label="总处理条数" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.total }}</span> <span style="margin-left: 10px">{{ scope.row.total }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人" width="180"> <el-table-column label="创建人" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.createBy }}</span> <span style="margin-left: 10px">{{ scope.row.createBy }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="180"> <el-table-column label="创建时间" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.createTime }}</span> <span style="margin-left: 10px">{{ scope.row.createTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="修改人" width="180"> <el-table-column label="修改人" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.updateBy }}</span> <span style="margin-left: 10px">{{ scope.row.updateBy }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="修改时间" width="180"> <el-table-column label="修改时间" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.updateTime }}</span> <span style="margin-left: 10px">{{ scope.row.updateTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@click="handleEdit(scope.$index, scope.row)">编辑节点</el-button> @click="handleEdit(scope.$index, scope.row)">编辑节点</el-button>
<br>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<el-button @click="saveActive" icon="el-icon-position" style="margin-right: 20px;float :right">保存</el-button>
<p>选择节点</p> <p>选择节点</p>
<div class="antvBox"> <div class="antvBox">
<div class="menu-list"> <div class="menu-list">
@ -14,29 +15,71 @@
<div id="container" /> <div id="container" />
</div> </div>
</div> </div>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%"
>
<span>
<el-radio-group v-model="labelPosition" size="small">
<el-radio-button label="left">左对齐</el-radio-button>
<el-radio-button label="right">右对齐</el-radio-button>
<el-radio-button label="top">顶部对齐</el-radio-button>
</el-radio-group>
<div style="margin: 20px;"></div>
<el-form :label-position="labelPosition" label-width="80px" :model="tableMsg">
<el-form-item label="任务id">
<el-input v-model="tableMsg.id" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="数据库id">
<el-input v-model="tableMsg.databaseId" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="数据表">
<el-cascader
v-model="tableMsg.tableName"
:options="tables"
:props="{ expandTrigger: 'hover',value:'name',label:'name',children:'tableNames' }"
@change="handleChange"></el-cascader>
</el-form-item>
<el-form-item label="表别名">
<el-input v-model="tableMsg.tableAsField"></el-input>
</el-form-item>
</el-form>
</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { Graph } from "@antv/x6"; import { Graph } from "@antv/x6";
import {extractDataName} from "../../../api/etl/etl";
export default { export default {
name: "antvX6", name: "antvX6",
data() { data() {
return { return {
tables:{},
tableMsg:{},
labelPosition: 'right',
dialogVisible:false,
curSelectNode: "",
moduleList: [ moduleList: [
{ {
id: 1, id: 1,
name: "节点1", name: "1",
image: require("@/assets/img/1.png"), image: require("@/assets/img/1.png"),
}, },
{ {
id: 8, id: 8,
name: "节点2", name: "2",
image: require("@/assets/img/2.png"), image: require("@/assets/img/2.png"),
}, },
{ {
id: 2, id: 2,
name: "节点3", name: "联查",
image: require("@/assets/img/3.png"), image: require("@/assets/img/3.png"),
}, },
{ {
@ -49,9 +92,139 @@ export default {
}; };
}, },
methods: { methods: {
handleChange(value) {
console.log(value);
},
getDatabaseMessage(){
this.dialogVisible = true
extractDataName().then(response => {
this.tables = response.data
})
},
//todo
nodeAddEvent() {
const { graph } = this;
const container = document.getElementById("container");
const changePortsVisible = (visible) => {
const ports = container.querySelectorAll(".x6-port-body");
for (let i = 0, len = ports.length; i < len; i = i + 1) {
ports[i].style.visibility = visible ? "visible" : "hidden";
}
};
this.graph.on("node:mouseenter", () => {
changePortsVisible(true);
});
this.graph.on("node:mouseleave", () => {
changePortsVisible(false);
});
this.graph.on("node:dblclick",() =>{
this.getDatabaseMessage()
})
//todo
this.graph.on("node:click", ({ e, x, y, node, view }) => {
//
if (this.curSelectNode) {
//
this.curSelectNode.removeTools();
//
if (this.curSelectNode !== node) {
node.addTools([
{
name: "boundary",
args: {
attrs: {
fill: "#16B8AA",
stroke: "#2F80EB",
strokeWidth: 1,
fillOpacity: 0.1,
},
},
},
{
name: "button-remove",
args: {
x: "100%",
y: 0,
offset: {
x: 0,
y: 0,
},
},
},
]);
this.curSelectNode = node;
} else {
this.curSelectNode = null;
}
} else {
this.curSelectNode = node;
node.addTools([
{
name: "boundary",
args: {
attrs: {
fill: "#16B8AA",
stroke: "#2F80EB",
strokeWidth: 1,
fillOpacity: 0.1,
},
},
},
{
name: "button-remove",
args: {
x: "100%",
y: 0,
offset: {
x: 0,
y: 0,
},
},
},
]);
}
});
//todo 线
this.graph.on("cell:mouseenter", ({ cell }) => {
if (cell.shape == "edge") {
cell.addTools([
{
name: "button-remove",
args: {
x: "100%",
y: 0,
offset: {
x: 0,
y: 0,
},
},
},
]);
cell.setAttrs({
line: {
stroke: "#409EFF",
},
});
cell.zIndex = 99; // 线
}
});
this.graph.on("cell:mouseleave", ({ cell }) => {
if (cell.shape === "edge") {
cell.removeTools();
cell.setAttrs({
line: {
stroke: "black",
},
});
cell.zIndex = 1; // 线线
}
});
},
// //
handleDragEnd(e, item) { handleDragEnd(e, item) {
console.log(e, item); // //
this.addHandleNode( this.addHandleNode(
e.pageX - 500, e.pageX - 500,
e.pageY - 200, e.pageY - 200,
@ -118,6 +291,7 @@ export default {
}, },
}, },
}); });
this.nodeAddEvent()
}, },
// //
addHandleNode(x, y, id, image, name) { addHandleNode(x, y, id, image, name) {
@ -173,6 +347,11 @@ export default {
zIndex: 10, zIndex: 10,
}); });
}, },
//todo
saveActive() {
console.log(this.graph.toJSON(), "graph");
console.log(this.graph.getNodes(), "node");
},
}, },
// - 访DOM", // - 访DOM",
mounted() { mounted() {