Commit 82a2bb03 by 李耀琨

解决冲突

parents cc6c702a 493e0bf1
......@@ -228,6 +228,29 @@ export function inputOutputFields(data) {
}
//启动
export function doRun(data) {
return request({
url: 'etlweb/trans/run',
data,
method: 'post'
})
}
//执行转换
export function doTrans(data) {
return request({
url: 'etlweb/trans/result',
data,
method: 'post'
})
}
......
......@@ -49,8 +49,9 @@
type="text"
icon="el-icon-refresh"
size="large"
></el-button>
@click="doTrans"></el-button>
</el-tooltip>
<el-divider direction="vertical"></el-divider>
<el-tooltip
......@@ -811,8 +812,7 @@
<outDialog
ref="tableOutPut"
:tableOutPutVisible.sync="tableOutPutVisible"
@fathertrans="fathertrans"
></outDialog>
:graph.sync="graph" :doubleClickCell="doubleClickCell"  :getXmlVal="getXmlVal" @fathertrans="fathertrans" ></outDialog>
<insertOrUpdate
ref="insertOrdate"
:InsertOrUpdateVisible.sync="InsertOrUpdateVisible"
......@@ -835,6 +835,12 @@
<microDialog ref="mic" :microVisible.sync="microVisible"></microDialog>
<!-- 输出弹窗end================== -->
<!-- 转换弹窗开始 -->
<trans-graph
ref="transGraph"
:transGraphVisible.sync="transGraphVisible"
:getXmlVal.sync="getXmlVal"></trans-graph>
<!-- 转换弹窗结束 -->
</div>
</template>
......@@ -874,6 +880,10 @@ import textFileDialog from "../../../output-dialog/text-file-output";
import microDialog from "../../../output-dialog/micro-excel";
// 输出弹窗end********************************************
import mxgraph from "@/utils/mxgraph";
const {
mxGraph,
......@@ -903,6 +913,8 @@ export default {
data() {
return {
transGraphVisible:false,//转换弹窗
doubleClickCell:{},//双击的cell
monitorCanvas: "", //监听画布
getXmlVal: "", //获取上一个xml
keyHandler: null,
......@@ -1238,8 +1250,10 @@ export default {
cell.title = cell.value.attributes.label.value;
cell.ctype = cell.value.attributes.ctype.value;
// cell.title = cell.value.attributes.label.value;
// cell.ctype = cell.value.attributes.ctype.value;
// let height = cell.geometry.height;
// let width = cell.geometry.width;
// let x = cell.geometry.x;
......@@ -1288,8 +1302,11 @@ cell.ctype = cell.value.attributes.ctype.value;
// 监听双击事件
const cell = this.R.pathOr([], ["properties", "cell"], evt);
console.info(cell); // 在控制台输出双击的cell
this.nodeData = cell
this.nodeData = cell
this.setXml();
this.doubleClickCell=cell;
// 获取接口数据
......@@ -1362,7 +1379,7 @@ cell.ctype = cell.value.attributes.ctype.value;
} else if (cell.ids == "step2" || cell.ctype == "TextFileInput") {
this.TextFileInputDialog = !this.TextFileInputDialog;
return;
} else if (cell.ids == "step16") {
} else if (cell.ids == "step17") {
//表输出
this.tableOutPutVisible = !this.tableOutPutVisible;
return;
......@@ -1727,6 +1744,12 @@ cell.ctype = cell.value.attributes.ctype.value;
this.graph = new mxGraph(this.$refs.container);
},
// 执行转换
doTrans(){
this.transGraphVisible=!this.transGraphVisible;
},
// //重绘流程图
clearFlow() {
// let that = this;
......
import main from './main.vue'
export default main
\ No newline at end of file
<template>
<div>
<el-dialog
title="转换"
:visible.sync="transGraphVisible"
width="1200px"
:before-close="handleClose"
@open="openFunc"
top="10%"
append-to-body>
<el-form ref="tableOutForm" :model="tableOutForm" label-width="200px">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="步骤度量" name="first">
<el-table :data="tableData" style="width: 100%">
<template v-for="(item,index) in tableHead">
<el-table-column :prop="item.column_name" :label="item.column_comment" :key="index"></el-table-column>
</template>
</el-table>
</el-tab-pane>
<el-tab-pane label="日志" name="second">
<div style="height:50vh;overflow-y:auto;">{{mylog}}</div>
</el-tab-pane>
<el-tab-pane label="执行历史" name="third " :disabled="true">
3333
</el-tab-pane>
<el-tab-pane label="性能图" name="fourth" :disabled="true">
4444
</el-tab-pane>
<el-tab-pane label="Metrics" name="fiveth " :disabled="true">
5555
</el-tab-pane>
<el-tab-pane label="Preview Data" name="sixth " :disabled="true">
6666
</el-tab-pane>
</el-tabs>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="transGraphVisible = false">取 消</el-button>
<!-- <el-button type="primary" @click.native="confirm()">确 定</el-button> -->
</span>
</el-dialog>
</div>
</template>
<script>
import {
doTrans,//获取表输出
doRun,//启动
} from "@/api/kettle/file";
export default ({
name: "trans-graph",
data(){
return{
executionId:null,//执行转换返回id
mylog:'',//日志
field:false,//编辑弹窗
checkedCities: ['上海', '北京'],
editDia:false,//编辑表字段
fieldForm:{},//编辑弹窗
radioTreaty:'0',
tableOutForm:{
commit: "1000",
connection: "mysql---test",
fields: "[]",
ignore_errors: "N",
partitioning_daily: "N",
partitioning_enabled: "N",
partitioning_field: "",
partitioning_monthly: "Y",
return_field: undefined,
return_keys: "N",
schema: "test",
specify_fields: "N",
table: "r_database",
tablename_field: "",
tablename_in_field: "N",
tablename_in_table: "Y",
truncate: "N",
use_batch: "Y",
},
stepName:{},
activeName:'first',
engine:[],
tableData: [
{
filemask: "",
name: "王小虎",
exclude_filemask: "",
file_required: "0",
include_subfolders: "1",
},
],
// 表头数据
// tableHead:[
// {
// column_name: "column_name",column_comment:"表字段"
// },
// {
// column_name: "stream_name",column_comment:"流字段"
// },
// ],
tableHead:[
{
column_name: "name",column_comment:"步骤名称"
},
{
column_name: "num",column_comment:"复制的记录行数"
},
{
column_name: "r",column_comment:"读"
},
{
column_name: "x",column_comment:"写"
},
{
column_name: "i",column_comment:"输入"
},
{
column_name: "o",column_comment:"输出"
},
{
column_name: "u",column_comment:"更新"
},
{
column_name: "f",column_comment:"拒绝"
},
{
column_name: "e",column_comment:"错误"
},
{
column_name: "a",column_comment:"激活"
},
{
column_name: "t",column_comment:"时间"
},
{
column_name: "s",column_comment:"速度(条记录/秒)"
},
{
column_name: "pio",column_comment:"Pri/in/out"
},
],
tableData: [{
name: '3',
num: '鞠婧祎',
r:'',
x:'',
i:'',
o:'',
u:'',
f:'',
e:'',
a:'',
t:'',
s:'',
pio:'',
},
],
// 表格数据
// tableData: [{
// stream_name: '3',
// column_name: '鞠婧祎',
// },
// {
// stream_name: '25',
// column_name: '魏大勋',
// },
// {
// stream_name: '18',
// column_name: '关晓彤',
// }],
}
},
props:["transGraphVisible","getXmlVal"],
mounted(){
},
created(){
},
methods:{
handleClose(){
this.$emit("update:transGraphVisible", false);
},
//打开弹窗执行方法
openFunc(){
this.doRun();
// if(this.executionId !=''){
// this.doTrans();
// }
},
// 执行
doTrans(){
let pamer = new FormData(); // 创建form对象
var myexecutionId=this.executionId;
// "62fd0f2a89b0401bbe6e7aabbb842b56"
pamer.append("executionId", myexecutionId);
doTrans(pamer).then((res) => {
if(res){
console.log('返回执行的数据====',res);
// this.tableData=res;
this.stepMeasure=res.stepMeasure
this.mylog=res.log
let tableKeyArr = ["name", "num", "r", "x", "i", "o", "u", "f", "e", "a", "t", "s", "pio"]
let tableData = [] //表格数据
res.stepMeasure.forEach(item=>{
let newObj = {}
item.forEach((v,i)=>{
newObj[tableKeyArr[i]] = v
})
tableData.push(newObj)
})
this.tableData = tableData
}
})
},
// 启动
doRun(){
let pamer = new FormData(); // 创建form对象
pamer.append("graphXml", this.getXmlVal);
var executParam={
"exec_local":"Y",
"exec_remote":"N",
"pass_export":"N",
"exec_cluster":"N",
"cluster_post":"Y",
"cluster_prepare":"Y",
"cluster_start":"Y",
"cluster_show_trans":"N",
"parameters":[
],
"variables":[
{
"name":"Internal.Entry.Current.Directory",
"value":"/"
},
{
"name":"Internal.Job.Filename.Directory",
"value":"Parent Job File Directory"
},
{
"name":"Internal.Job.Filename.Name",
"value":"Parent Job Filename"
},
{
"name":"Internal.Job.Name",
"value":"Parent Job Name"
},
{
"name":"Internal.Job.Repository.Directory",
"value":"Parent Job Repository Directory"
}
],
"arguments":[
],
"safe_mode":"N",
"log_level":"Basic",
"clear_log":"Y",
"gather_metrics":"Y",
"log_file":"N",
"log_file_append":"N",
"show_subcomponents":"Y",
"create_parent_folder":"N",
"remote_server":"",
"replay_date":""
}
// JSON.parse(executParam);
pamer.append("executionConfiguration",JSON.stringify(executParam));
doRun(pamer).then((res) => {
if(res.success){
console.log('返回run的id====',res.message);
this.executionId=res.message;
if(this.executionId){
this.doTrans();
}
}
})
}
}
})
</script>
\ No newline at end of file
......@@ -1207,6 +1207,7 @@ props: ["dragItem"],
console.log('点击当前节点===',node);
this.nodePath=data.path;//当前选择数
this.curNodeIconCls=data.iconCls;//当前选中节点
this.nodePath=data.path;
console.log('当前节点的文件夹路径:',this.nodePath);
if(node.data.leaf){
this.curNodeText=node.data.text;//当前节点
......
......@@ -5,6 +5,7 @@
:visible.sync="tableOutPutVisible"
width="800px"
:before-close="handleClose"
@open="dialogOpen"
top="10%"
append-to-body>
......@@ -197,6 +198,20 @@
</template>
<script>
import mxgraph from "@/utils/mxgraph";
const {
mxGraph,
mxUtils,
mxEvent,
mxKeyHandler,
mxRubberband,
mxConstants,
mxStencilRegistry,
mxStencil,
mxCodec,
mxGraphModel,
mxGeometry,
} = mxgraph
import {
inputOutputFields,//获取表输出
......@@ -306,12 +321,18 @@ export default ({
type: Boolean,
default:false
},
explorer:Function
explorer:Function,
graph:Object,
doubleClickCell:Object,
getXmlVal:String
},
mounted(){
},
created(){
this.dialogOpen();
},
watch:{
tableOutForm(n,o){
console.log('表单值变化',n,o)
......@@ -330,20 +351,23 @@ export default ({
this.$emit("update:tableOutPutVisible", false);
},
//获取表输出
inputOutputFields(){
dialogOpen(){
// var enc = new mxCodec(mxUtils.createXmlDocument());
// var node = enc.encode(graph.getModel());
// store.baseParams.stepName = encodeURIComponent(cell.getAttribute('label'));
// store.baseParams.graphXml = mxUtils.getPrettyXml(node);
// store.baseParams.before = true
// var node = enc.encode(graph.getModel());
// console.log('获取===',node);
// var changeXml = mxUtils.getPrettyXml(node);
if(this.doubleClickCell){
var title=this.doubleClickCell.title
}
console.log('获取cell88===',this.doubleClickCell);
let pamer = new FormData(); // 创建form对象
pamer.append("stepName", this.nodePath);
pamer.append("graphXml", "transformation");
pamer.append("stepName", encodeURIComponent(title));
pamer.append("graphXml", this.getXmlVal);
pamer.append("before", true);
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log(res,'返回空白画布xml');
this.blankCanvas = res
console.log('字段',res);
// this.blankCanvas = res
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment