Commit 4cf30d89 by 莫晓莉

提交xml获取

parent 261a9af1
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
content="重新绘制" content="执行转换"
placement="bottom" placement="bottom"
> >
<el-button <el-button
...@@ -1644,6 +1644,7 @@ export default { ...@@ -1644,6 +1644,7 @@ export default {
//文本文件输出 //文本文件输出
this.fileVisible = !this.fileVisible; this.fileVisible = !this.fileVisible;
this.outPutFormData8 = this.showDataFunc(); this.outPutFormData8 = this.showDataFunc();
this.$refs.textFile.clickFun(this.graph);//向子组件传递画布
return; return;
} else if (cell.ids == "step14" || cell.value.attributes.ctype.value == "SynchronizeAfterMerge" ) { } else if (cell.ids == "step14" || cell.value.attributes.ctype.value == "SynchronizeAfterMerge" ) {
//数据同步 //数据同步
...@@ -1767,6 +1768,7 @@ export default { ...@@ -1767,6 +1768,7 @@ export default {
getXml() { getXml() {
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.graph.getModel()); const encodedModel = codec.encode(this.graph.getModel());
console.log(encodedModel,46546465456);
this.getXmlVal = mxUtils.getXml(encodedModel); this.getXmlVal = mxUtils.getXml(encodedModel);
let w = "" let w = ""
w = JSON.stringify(this.getXmlVal) w = JSON.stringify(this.getXmlVal)
......
...@@ -95,8 +95,16 @@ export default { ...@@ -95,8 +95,16 @@ export default {
methods: { methods: {
clickFun(graph){ clickFun(graph){
console.log(graph,'数据库编辑=====') let codec = new mxCodec();
this.newGraph = graph let encodedModel = codec.encode(graph.getModel());
let myXmlVal = mxUtils.getPrettyXml(encodedModel);
console.log('myXmlVal2',myXmlVal)
// console.log(graph,2)
// this.newGraph = graph;
// this.$refs.establishDia.clickFun(graph);
}, },
//获取新建弹窗返回来的值 //获取新建弹窗返回来的值
......
...@@ -476,8 +476,13 @@ export default { ...@@ -476,8 +476,13 @@ export default {
// }, // },
clickFun(graph){ clickFun(graph){
console.log(graph,'最内层') console.log(graph,3)
this.newGraph = graph this.newGraph = graph;
let codec = new mxCodec();
let encodedModel = codec.encode(graph.getModel());
let myXmlVal = mxUtils.getPrettyXml(encodedModel);
console.log('myXmlVal3',myXmlVal)
}, },
...@@ -501,9 +506,12 @@ export default { ...@@ -501,9 +506,12 @@ export default {
// data.append("graphXml", this.getXmlVal); // data.append("graphXml", this.getXmlVal);
const codec = new mxCodec(); const codec = new mxCodec();
console.log("🚀 ~ file: main.vue ~ line 514 ~ getTransDatabase ~ this.newGraph.getModel()", this.newGraph.getModel())
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("转码钱画布详情:", encodedModel); console.log("转码钱画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
data.append("graphXml", myXmlVal); data.append("graphXml", myXmlVal);
data.append("name", name); data.append("name", name);
...@@ -533,7 +541,7 @@ export default { ...@@ -533,7 +541,7 @@ export default {
this.createModel=testJson; this.createModel=testJson;
console.log("写死的数据库----",this.createModel); console.log("写死的数据库----",this.createModel);
this.$emit("getSonValue", this.createModel.name); //组件要传回父组件的值 this.$emit("getSonValue", this.createModel.name); //组件要传回父组件的值
return // return
// 写死测试------- // 写死测试-------
getTransDatabase(data).then((res) => { getTransDatabase(data).then((res) => {
...@@ -738,6 +746,10 @@ export default { ...@@ -738,6 +746,10 @@ export default {
if(this.noneRespository==1){ if(this.noneRespository==1){
console.log(this.newGraph,'最内层接收画布99999999999999') console.log(this.newGraph,'最内层接收画布99999999999999')
var root = this.newGraph.getDefaultParent(); var root = this.newGraph.getDefaultParent();
const codecx = new mxCodec();
const encodedModel2 = codecx.encode(this.newGraph.getModel());//xml对象
var myXmlVal2 = mxUtils.getPrettyXml(encodedModel2);//xml字符串
console.log("=============myXmlVa\n", myXmlVal2)
var databases = root.getAttribute('databases'); var databases = root.getAttribute('databases');
console.log(databases,'55555555555555555559') console.log(databases,'55555555555555555559')
var jsonArray = JSON.parse(databases); var jsonArray = JSON.parse(databases);
...@@ -769,7 +781,8 @@ export default { ...@@ -769,7 +781,8 @@ export default {
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
console.log("🚀 ~ file: main.vue ~ line 774 ~ check ~ myXmlVal", myXmlVal)
console.log(encodedModel, 8888888888888); console.log(encodedModel, 8888888888888);
this.$emit("getSonValue", false); //组件要传回父组件的值,关闭弹窗 this.$emit("getSonValue", false); //组件要传回父组件的值,关闭弹窗
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="日志" name="second"> <el-tab-pane label="日志" name="second" :disabled="!finished">
<div style="height:50vh;overflow-y:auto;">{{mylog}}</div> <div style="height:50vh;overflow-y:auto;">{{mylog}}</div>
</el-tab-pane> </el-tab-pane>
...@@ -55,6 +55,7 @@ export default ({ ...@@ -55,6 +55,7 @@ export default ({
name: "trans-graph", name: "trans-graph",
data(){ data(){
return{ return{
finished:false,//只有执行成功才显示日志
executionId:null,//执行转换返回id executionId:null,//执行转换返回id
mylog:'',//日志 mylog:'',//日志
field:false,//编辑弹窗 field:false,//编辑弹窗
...@@ -85,15 +86,15 @@ export default ({ ...@@ -85,15 +86,15 @@ export default ({
stepName:{}, stepName:{},
activeName:'first', activeName:'first',
engine:[], engine:[],
tableData: [ // tableData: [
{ // {
filemask: "", // filemask: "",
name: "王小虎", // name: "王小虎",
exclude_filemask: "", // exclude_filemask: "",
file_required: "0", // file_required: "0",
include_subfolders: "1", // include_subfolders: "1",
}, // },
], // ],
// 表头数据 // 表头数据
...@@ -217,7 +218,8 @@ export default ({ ...@@ -217,7 +218,8 @@ export default ({
console.log('返回执行的数据====',res); console.log('返回执行的数据====',res);
// this.tableData=res; // this.tableData=res;
this.stepMeasure=res.stepMeasure this.stepMeasure=res.stepMeasure
this.mylog=res.log this.mylog=res.log;
this.finished=res.finished;//执行转换以后
let tableKeyArr = ["name", "num", "r", "x", "i", "o", "u", "f", "e", "a", "t", "s", "pio"] let tableKeyArr = ["name", "num", "r", "x", "i", "o", "u", "f", "e", "a", "t", "s", "pio"]
......
...@@ -288,7 +288,9 @@ export default ({ ...@@ -288,7 +288,9 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
......
...@@ -442,7 +442,8 @@ export default ({ ...@@ -442,7 +442,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("schema", this.insertOrUpdateForm.schema); pamer.append("schema", this.insertOrUpdateForm.schema);
...@@ -467,7 +468,8 @@ export default ({ ...@@ -467,7 +468,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("before", true); pamer.append("before", true);
......
...@@ -532,7 +532,8 @@ export default ({ ...@@ -532,7 +532,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("schema", this.synForm.schema); pamer.append("schema", this.synForm.schema);
...@@ -557,7 +558,8 @@ export default ({ ...@@ -557,7 +558,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("before", true); pamer.append("before", true);
......
...@@ -327,10 +327,17 @@ export default ({ ...@@ -327,10 +327,17 @@ export default ({
}, },
methods:{ methods:{
clickFun(graph){ clickFun(graph){
console.log(graph,'双击获取值') console.log(graph,1)
this.newGraph = graph this.newGraph = graph
// this.$refs.databaseChoose.clickFun(graph); setTimeout(() => {
this.$refs.databaseChoose.clickFun(this.newGraph); this.$refs.databaseChoose.clickFun(graph,121331);
}, 500);
let codec = new mxCodec();
let encodedModel = codec.encode(graph.getModel());
let myXmlVal = mxUtils.getPrettyXml(encodedModel);
console.log('myXmlVal1',myXmlVal)
}, },
confirm(){ confirm(){
this.tableOutForm.label=this.doubleClickCell.title; this.tableOutForm.label=this.doubleClickCell.title;
...@@ -364,7 +371,8 @@ export default ({ ...@@ -364,7 +371,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("databaseName", this.tableOutForm.connection); pamer.append("databaseName", this.tableOutForm.connection);
...@@ -393,7 +401,8 @@ export default ({ ...@@ -393,7 +401,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml",myXmlVal); pamer.append("graphXml",myXmlVal);
pamer.append("before", true); pamer.append("before", true);
......
...@@ -391,6 +391,7 @@ import { ...@@ -391,6 +391,7 @@ import {
export default ({ export default ({
data(){ data(){
return{ return{
newGraph:{},
metaStoreList:[],//类型 metaStoreList:[],//类型
formatStoreList:[],//字段格式 formatStoreList:[],//字段格式
fieldsList2:[], fieldsList2:[],
...@@ -561,6 +562,12 @@ export default ({ ...@@ -561,6 +562,12 @@ export default ({
}, },
methods:{ methods:{
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph
// this.$refs.databaseChoose.clickFun(graph);
// this.$refs.databaseChoose.clickFun(this.newGraph);
},
handleClose(){ handleClose(){
this.$emit("update:fileVisible", false); this.$emit("update:fileVisible", false);
}, },
...@@ -673,7 +680,15 @@ export default ({ ...@@ -673,7 +680,15 @@ export default ({
console.log('获取cell888888===',this.doubleClickCell); console.log('获取cell888888===',this.doubleClickCell);
let pamer = new FormData(); // 创建form对象 let pamer = new FormData(); // 创建form对象
pamer.append("stepName", encodeURIComponent(title)); pamer.append("stepName", encodeURIComponent(title));
pamer.append("graphXml", this.getXmlVal); // pamer.append("graphXml", this.getXmlVal);
// 画布xml转码
const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel);
// var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal);
pamer.append("before", true); pamer.append("before", true);
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ inputOutputFields(pamer).then(res=>{
......
...@@ -426,7 +426,8 @@ export default ({ ...@@ -426,7 +426,8 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("schema", this.updateForm.schema); pamer.append("schema", this.updateForm.schema);
...@@ -451,7 +452,9 @@ export default ({ ...@@ -451,7 +452,9 @@ export default ({
const codec = new mxCodec(); const codec = new mxCodec();
const encodedModel = codec.encode(this.newGraph.getModel());//xml对象 const encodedModel = codec.encode(this.newGraph.getModel());//xml对象
console.log("获取字段的画布详情:", encodedModel); console.log("获取字段的画布详情:", encodedModel);
var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml", myXmlVal); pamer.append("graphXml", myXmlVal);
pamer.append("before", true); pamer.append("before", true);
......
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