Commit 629a3b65 by 李耀琨

导出xml

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