Commit 629a3b65 by 李耀琨

导出xml

parent 582d0eb8
......@@ -409,3 +409,24 @@ export function locale(data){
method: 'post'
})
}
// 从文件获取字段
export function mappingFields(data){
return request({
url:'etlweb/trans/mappingFields',
data,
method: 'post'
})
}
// 获取日期格式
export function datetimeformat(data){
return request({
url:'etlweb/system/datetimeformat',
data,
method: 'post'
})
}
......@@ -202,7 +202,7 @@
输出时字段名再重新映射回原来输入时的名字?
</el-col>
<el-col :span="4">
<el-button>字段映射...</el-button>
<el-button @click="fieldMapping">字段映射...</el-button>
</el-col>
......@@ -465,6 +465,7 @@ import {
availableCharsets,
previousSteps,
inputOutputFields,
mappingFields
} from "@/api/kettle/link";
export default {
props: ["form", "nodeData", "saveOutputDialog", "mappingDialog"], //从父组件传过来的值
......@@ -574,6 +575,22 @@ export default {
}
},
fieldMapping(){
var enc = new mxCodec(mxUtils.createXmlDocument());
var node = enc.encode(this.newGraph.getModel());
this.graphXml = mxUtils.getPrettyXml(node);
let pamerFields = new FormData(); // 创建form对象
pamerFields.append(
"stepName",
this.nodeData.value.attributes.label.value
);
pamerFields.append("graphXml", this.graphXml);
pamerFields.append("before", true);
mappingFields(pamerFields).then(res=>{
console.log(res);
})
},
route(flowData){
this.localPath.fileName = flowData.name
......
......@@ -303,7 +303,6 @@ export default {
getGraphDataBases() {
// var graph = this.getGraph();
var root = this.newGraph.getDefaultParent(),
data = [];
if (root.getAttribute("databases") != null)
......
......@@ -934,8 +934,10 @@
<conversionSettings
ref="conversionSettings"
:form="form"
:getXmlVal="getXmlVal"
:conversionSettingsDialog.sync="conversionSettingsDialog"
:doubleClickCell="doubleClickCell"
:saveOutputDialog1="saveOutputDialog1"
></conversionSettings>
<!-- 作业属性设置 -->
<jobSettings
......@@ -949,7 +951,10 @@
<importXmlFile
ref="importXmlFile"
:importXmlFileDialog.sync="importXmlFileDialog"
:form="form"
:nodeData="nodeData"
:doubleClickCell="doubleClickCell"
:saveOutputDialog="saveOutputDialog"
></importXmlFile>
<!-- 分组 -->
......@@ -2165,7 +2170,21 @@ export default {
valueFormat(pamer2).then((res) => {
this.fieldFormat = res;
});
// if (this.curFileType == "transformation" && cell.dis == "step98") ||
// cell.value.attributes.ctype.value == "Dummy" ) {
// }else
if (
(this.curFileType == "transformation" && cell.dis == "srep98") ||
cell.value.attributes.ctype.value == "Dummy"
) {
this.nullOperationDialog = !this.nullOperationDialog;
this.form = this.showDataFunc();
setTimeout(() => {
this.$refs.nullOperation.clickFun(this.graph, this.form);
}, 500);
} else if (
(this.curFileType == "transformation" && cell.dis == "step79") ||
cell.value.attributes.ctype.value == "Mail"
) {
......@@ -2174,8 +2193,7 @@ export default {
setTimeout(() => {
this.$refs.sendMail.clickFun(this.graph, this.form);
}, 500);
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step126") ||
cell.value.attributes.ctype.value == "StreamLookup"
) {
......@@ -2184,8 +2202,7 @@ export default {
setTimeout(() => {
this.$refs.streamQuery.clickFun(this.graph, this.form);
}, 500);
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step143") ||
cell.value.attributes.ctype.value == "GroupBy"
) {
......@@ -2261,8 +2278,7 @@ export default {
this.$refs.setVariable.clickFun(this.graph, this.form);
}, 500);
return;
}
if (
} else if (
(this.curFileType == "transformation" && cell.dis == "step66") ||
cell.value.attributes.ctype.value == "SortRows"
) {
......@@ -2548,7 +2564,8 @@ export default {
this.graph.popupMenuHandler.autoExpand = true;
this.graph.popupMenuHandler.factoryMethod = (menu, cell, evt) => {
let root = this.graph.getDefaultParent();
console.log("root-", root);
// this.doubleClickCell = cell;
console.log("root-", root, "cell", cell);
let channelLogTable = JSON.parse(root.getAttribute("channelLogTable"));
console.log("channelLogTable-", channelLogTable);
......@@ -2566,9 +2583,8 @@ export default {
this.conversionSettingsDialog = !this.conversionSettingsDialog;
this.form = q;
setTimeout(() => {
this.$refs.conversionSettings.clickFun(this.graph,this.form); //向子组件传递画布
this.$refs.conversionSettings.clickFun(this.graph, this.form); //向子组件传递画布
}, 500);
});
menu.addItem("映射输入规范", null, () => {
console.log(cell, "当前节点");
......@@ -2578,10 +2594,10 @@ export default {
console.log(cell, "当前节点");
this.mappingOutputDialog = !this.mappingOutputDialog;
});
menu.addItem("空操作", null, () => {
console.log(cell, "当前节点");
this.nullOperationDialog = !this.nullOperationDialog;
});
// menu.addItem("空操作", null, () => {
// console.log(cell, "当前节点");
// this.nullOperationDialog = !this.nullOperationDialog;
// });
menu.addSeparator();
} else {
//画布右键
......@@ -3114,7 +3130,28 @@ export default {
// .catch(() => {});
},
//输出组件保存************************
//画布属性保存*************
saveOutputDialog1(params) {
var outPutForm = params;
console.log("子组件传回来的弹窗参数===", outPutForm);
this.graph.getModel().beginUpdate();
try {
let root = this.graph.getDefaultParent();
for (var name in outPutForm) {
// var edit = new mxCellAttributeChange(
// this.doubleClickCell,
// name,
// outPutForm[name]
// );
// this.graph.getModel().execute(edit);
root.setAttribute(name, outPutForm[name]);
}
} finally {
this.graph.getModel().endUpdate();
}
},
// 组件数据保存***********
saveOutputDialog(params) {
var outPutForm = params;
console.log("子组件传回来的弹窗参数===", outPutForm);
......@@ -3127,6 +3164,7 @@ export default {
this.graph.getModel().execute(edit);
}
},
//输出组件保存******************/
},
};
......
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