Commit 96d15519 by 李耀琨

Merge branch 'master' of http://139.159.239.83:9093/mxl/ETL-admin into master

parents 91571fd0 504d8173
......@@ -841,7 +841,7 @@
:getXmlVal="getXmlVal"
@fathertrans="fathertrans"
:saveOutputDialog="saveOutputDialog"
:tableOutForm="outPutFormData1"
:tableOutFormSend="outPutFormData1"
></outDialog>
<insertOrUpdate
ref="insertOrdate"
......@@ -849,7 +849,7 @@
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:getXmlVal="getXmlVal"
:insertOrUpdateForm="outPutFormData2"
:insertOrUpdateFormSend="outPutFormData2"
></insertOrUpdate>
<excelOutPutDialog
ref="excelOut"
......@@ -863,28 +863,28 @@
:updateVisible.sync="updateVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:updateForm="outPutFormData4"
:updateFormSend="outPutFormData4"
:getXmlVal="getXmlVal"></updateDialog>
<synDialog
ref="syn"
:synVisible.sync="synVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:synForm="outPutFormData5"
:synFormSend="outPutFormData5"
:getXmlVal="getXmlVal"></synDialog>
<delDialog
ref="del"
:deleteVisible.sync="deleteVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:deleteForm="outPutFormData6"
:deleteFormSend="outPutFormData6"
:getXmlVal="getXmlVal"></delDialog>
<sqlDialog
ref="sql"
:sqlVisible.sync="sqlVisible"
:saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell"
:sqlForm="outPutFormData7"
:sqlFormSend="outPutFormData7"
></sqlDialog>
<textFileDialog
ref="textFile"
......@@ -1818,7 +1818,9 @@ previousField(){
//mico-Excel输出
this.microVisible = !this.microVisible;
this.outPutFormData9 = this.showDataFunc();
this.$refs.mic.clickFun(this.graph);//向子组件传递画布
setTimeout(() => {
this.$refs.mic.clickFun(this.graph);//向子组件传递画布
}, 500);
return;
} else if (cell.ids == "step9" || cell.value.attributes.ctype.value == "ExcelOutput" ) {
//Excel输出
......
......@@ -1068,6 +1068,48 @@ export default {
},
// 封装把数据库保存到画布
// saveDataBases(){
// // JSON对象转成formData对象
// var params = this.createModel;
// // 由于高级选项连接池集群页面没有画完,保存默认参数
// params.supportBooleanDataType = true;
// params.supportTimestampDataType = true;
// params.preserveReservedCaseCheck = true;
// params.extraOptions = [];
// params.usingConnectionPool = "N";
// params.initialPoolSize = "5";
// params.maximumPoolSize = "10";
// params.partitioned = "N";
// params.partitionInfo = [];
// var root = this.newGraph.getDefaultParent();
// var databases = root.getAttribute('databases');
// var jsonArray = JSON.parse(databases);
// if(jsonArray.length == 0) {
// jsonArray.push(params);
// } else {
// jsonArray.forEach((item,index)=>{
// if(item.name == params.name) {
// jsonArray.splice(index, 1, params);
// } else {
// if(index == jsonArray.length - 1)
// jsonArray.push(params);
// }
// })
// }
// this.newGraph.getModel().beginUpdate();
// try{
// var edit = new mxCellAttributeChange(root, 'databases', JSON.stringify(jsonArray));
// this.newGraph.getModel().execute(edit);
// }
// finally{
// this.newGraph.getModel().endUpdate();
// }
// }
},
};
</script>
......
......@@ -378,6 +378,7 @@
<div slot="header" class="clearfix">
<el-button style="padding: 3px 0" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
......@@ -810,6 +811,14 @@ export default ({
this.tableData=res;
})
},
//删除全部
deleteFields(){
this.tableData=[];
},
//删除全部
// deleteFieldsUpdate(){
// this.tableDataUpdate=[];
// }
}
})
......
......@@ -9,15 +9,16 @@
>
<!-- <div id="ExcelInputDialog"></div> -->
<el-form ref="stepName" :model="stepName" label-width="120px">
<!-- <el-form ref="stepName" :model="stepName" label-width="120px"> -->
<el-form ref="delForm" :model="deleteForm" label-width="200px">
<el-form-item label="步骤名称:">
<el-input v-model="stepName.name"></el-input>
<el-input v-model="deleteForm.label"></el-input>
</el-form-item>
</el-form>
<!-- </el-form> -->
<el-form ref="delForm" :model="deleteForm" label-width="200px">
<!-- <el-form ref="delForm" :model="deleteForm" label-width="200px"> -->
<div style="border:1px solid #99BBE8;padding:15px 15px;margin-bottom:15px;">
<database-choose ref="databaseChoose" :form.sync="deleteForm" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" :form.sync="deleteForm" @fatherFun="fatherFun" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<el-form-item label="提交记录数量:">
<el-row :gutter="10">
<el-col :span="23">
......@@ -32,6 +33,8 @@
<div slot="header" class="clearfix">
<span>查询值所需的关键字</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div>
<!-- <el-table style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead">
......@@ -125,6 +128,7 @@ inputOutputFields,//获取表输出
export default ({
data(){
return{
deleteForm:{},//解决子组件改变父组件传递props属性报错
newGraph:{},
fieldsList1:[],
fieldsList2:[],
......@@ -136,15 +140,6 @@ export default ({
// deleteForm:{
// commit: "100",
// connection: "",
// schema: "test",
// table: "",
// searchFields: "[]",
// updateFields: "[]",
// },
// deleteForm:{
// commit: "100",
// connection: "",
// key:"[]",
// label:"删除",
// schema: "",
......@@ -206,30 +201,28 @@ export default ({
}
},
// watch:{
// deleteForm(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.key);
// this.tableData=ny;
// }
// }
// },
watch:{
// deleteForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.key);
// this.tableData=ny;
// }
// }
// }
deleteForm(n,o){
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.key);
// 解决子组件改变父组件传进来的变量的属性不报错start------
deleteFormSend(val){
console.log("回显的表单数据===",val);
this.deleteForm=val;
if(this.deleteForm.key){
var ny=JSON.parse(this.deleteForm.key);
this.tableData=ny;
}
}
}
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:["title","nodePath","deleteVisible","doubleClickCell","saveOutputDialog","deleteForm","getXmlVal"],
props:["title","nodePath","deleteVisible","doubleClickCell","saveOutputDialog","deleteFormSend","getXmlVal"],
// props:{
// title:{
// type:String,
......@@ -248,8 +241,56 @@ export default ({
mounted(){
},
// created(){
// // 深拷贝解决第一次不执行
// this.newform=JSON.parse(JSON.stringify(this.form));
// },
methods:{
clickFun(graph){
// 数据库重置
fatherFun(param){
console.log("触发了父组件的方法=----",param);
//数据库
if(param.connection == this.deleteFormSend.connection){
console.log(2)
this.deleteForm = this.deleteFormSend
if(param.table == this.deleteFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.deleteFormSend.fields)
}else{
console.log(6)
this.tableData = []
}
}else{
console.log(3)
this.deleteForm = param
this.tableData = []
console.log(5)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection ==true || param.changeConnection==="true"){
// this.tableData=[];
// console.log('触发了父组件的方法改变连接=----',this.tableData)
// }else{
// if(param.changeSchema){
// }else{
// var ny=JSON.parse(param.key);
// this.tableData=ny;
// }
// if(param.changeTable ==true || param.changeConnection==="true"){
// this.tableData=[];
// console.log('触发了父组件的方法改变表=----',this.tableData)
// }else{
// var ny=JSON.parse(param.key);
// this.tableData=ny;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
setTimeout(() => {
......@@ -260,7 +301,7 @@ export default ({
this.$emit("update:deleteVisible", false);
},
confirm(){
this.deleteForm.label=this.doubleClickCell.title;
// this.deleteForm.label=this.doubleClickCell.title;
this.deleteForm.key=JSON.stringify(this.tableData);//字段复值
console.log('弹窗数据:===',this.deleteForm);
this.saveOutputDialog(this.deleteForm);
......@@ -321,7 +362,7 @@ export default ({
})
},
//获取表输出
inputOutputFields(){
inputOutputFields(par){
if(this.doubleClickCell){
// var title=this.doubleClickCell.title;
var title=this.doubleClickCell.value.attributes.label.value
......@@ -341,9 +382,27 @@ export default ({
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log('字段',res);
this.fieldsList2=res;
if(par=="get"){
var newArray=[];
res.forEach(item => {
var newObj={};
newObj.field=item.name;
newObj.condition="=";
newObj.name=item.name;
newObj.name2="";
newArray.push(newObj);
});
this.tableData=newArray;
}else{
this.fieldsList2=res;
}
})
},
//删除全部
deleteFields(){
this.tableData=[];
},
......
......@@ -18,7 +18,7 @@
<!-- <el-form :model="insertOrUpdateForm" label-width="200px"> -->
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content">
<database-choose ref="databaseChoose" :form.sync="insertOrUpdateForm" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" :form.sync="insertOrUpdateForm" @fatherFun="fatherFun" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<el-form-item label="提交记录数量:">
<el-row :gutter="10">
<el-col :span="23">
......@@ -43,6 +43,8 @@
<el-button style="padding: 3px 0" type="text" @click="fieldClick(true)">新增字段</el-button>
<!-- <el-button style="padding: 3px 0" type="text">删除字段</el-button> -->
<el-button style="padding: 3px 0" type="text" @click="getFields(0)">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div>
<!-- <el-table style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead">
......@@ -109,6 +111,7 @@
<el-button style="padding: 3px 0" type="text" @click="fieldClickUpdate">新增字段</el-button>
<!-- <el-button style="padding: 3px 0" type="text">删除字段</el-button> -->
<el-button style="padding: 3px 0" type="text" @click="getFields(1)">获取和更新字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFieldsUpdate">删除全部</el-button>
<el-button style="padding: 3px 0" type="text">编辑映射</el-button>
</div>
......@@ -187,6 +190,7 @@ import {
export default ({
data(){
return{
insertOrUpdateForm: {},//解决子组件改变父组件传递props属性报错
newGraph:{},
fieldsList1:[],
fieldsList2:[],
......@@ -293,33 +297,37 @@ export default ({
}
},
// watch:{
// insertOrUpdateForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// },
// },
watch:{
// insertOrUpdateForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
insertOrUpdateForm(n, o) {
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.searchFields);
var na=JSON.parse(n.updateFields);
this.tableData=ny;
// 解决子组件改变父组件传进来的变量的属性不报错start------
insertOrUpdateFormSend(val){
console.log("回显的表单数据===",val);
this.insertOrUpdateForm=val;
if(val.searchFields){
var ny=JSON.parse(val.searchFields);
this.tableData=ny;
}
if(val.updateFields){
var na=JSON.parse(val.updateFields);
this.tableDataUpdate=na;
}
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:["insertOrUpdateForm","InsertOrUpdateVisible","doubleClickCell","getXmlVal","saveOutputDialog"],
props:["insertOrUpdateFormSend","InsertOrUpdateVisible","doubleClickCell","getXmlVal","saveOutputDialog"],
// props:{
// InsertOrUpdateVisible:{
......@@ -331,6 +339,59 @@ export default ({
},
methods:{
// 数据库重置
fatherFun(param){
console.log("触发了父组件的方法=----",param);
//数据库
if(param.connection == this.insertOrUpdateFormSend.connection){
console.log(2)
this.insertOrUpdateForm = this.insertOrUpdateFormSend
if(param.table == this.insertOrUpdateFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.insertOrUpdateFormSend.searchFields);
this.tableDataUpdate = JSON.parse(this.insertOrUpdateFormSend.updateFields);
}else{
console.log(6)
this.tableData = [];
this.tableDataUpdate=[];
}
}else{
console.log(3)
this.insertOrUpdateForm = param
this.tableData = [];
this.tableDataUpdate=[];
console.log(5)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection ==true || param.changeConnection==="true"){
// this.tableData=[];
// this.tableDataUpdate=[];
// }else{
// if(param.changeSchema){
// }else{
// // var ny=JSON.parse(param.key);
// // this.tableData=ny;
// }
// if(param.changeTable ==true || param.changeConnection==="true"){
// console.log("进入回显的999999=====");
// this.tableData=[];
// this.tableDataUpdate=[];
// // console.log('触发了父组件的方法改变表=----',this.tableData);
// }else{
// console.log("进入回显的999999=====");
// var ny=JSON.parse(param.searchFields);
// var na=JSON.parse(param.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
......@@ -507,6 +568,14 @@ export default ({
this.fieldsList2=res;
})
},
//删除字段
deleteFields(){
this.tableData=[];
},
//删除字段
deleteFieldsUpdate(){
this.tableDataUpdate=[];
}
......
......@@ -298,6 +298,8 @@
<div slot="header" class="clearfix">
<span>字段</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
<!-- 编辑弹窗开始=========== -->
......@@ -490,45 +492,45 @@ export default ({
],
// 表格数据
tableData: [
{
name: '3',
type: '鞠婧祎',
format: '女',
styleCell:'1',
title:'2',
titleStyleCell:'2',
formula:'2',
hyperlinkField:'4',
commentField:'2',
commentAuthorField:'4'
// {
// name: '3',
// type: '鞠婧祎',
// format: '女',
// styleCell:'1',
// title:'2',
// titleStyleCell:'2',
// formula:'2',
// hyperlinkField:'4',
// commentField:'2',
// commentAuthorField:'4'
},
{
name: '3',
type: '鞠婧祎',
format: '女',
styleCell:'1',
title:'2',
titleStyleCell:'2',
formula:'2',
hyperlinkField:'4',
commentField:'2',
commentAuthorField:'4'
// },
// {
// name: '3',
// type: '鞠婧祎',
// format: '女',
// styleCell:'1',
// title:'2',
// titleStyleCell:'2',
// formula:'2',
// hyperlinkField:'4',
// commentField:'2',
// commentAuthorField:'4'
},
{
name: '3',
type: '鞠婧祎',
format: '女',
styleCell:'1',
title:'2',
titleStyleCell:'2',
formula:'2',
hyperlinkField:'4',
commentField:'2',
commentAuthorField:'4'
// },
// {
// name: '3',
// type: '鞠婧祎',
// format: '女',
// styleCell:'1',
// title:'2',
// titleStyleCell:'2',
// formula:'2',
// hyperlinkField:'4',
// commentField:'2',
// commentAuthorField:'4'
}
// }
],
}
......@@ -652,20 +654,49 @@ export default ({
this.fileDialogVisible=true;
},
//超链接
inputOutputFields(){
inputOutputFields(par){
if(this.doubleClickCell){
// var title=this.doubleClickCell.title
var title=this.doubleClickCell.value.attributes.label.value
}
// 画布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字符串
console.log('获取cell888888===',this.doubleClickCell);
let pamer = new FormData(); // 创建form对象
pamer.append("stepName", encodeURIComponent(title));
pamer.append("graphXml", this.getXmlVal);
pamer.append("graphXml", myXmlVal);
pamer.append("before", true);
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log('字段',res);
this.hyperlinkList=res;
if(par=="get"){
var newArray=[];
res.forEach(item => {
var newObj={};
newObj.name=item.name;
newObj.type=item.type;
newObj.format="";
newObj.styleCell="";
newObj.title=item.name;
newObj.titleStyleCell="";
newObj.formula="";
newObj.hyperlinkField="";
newObj.commentField="";
newObj.commentAuthorField="";
newArray.push(newObj);
});
this.tableData=newArray;
}else{
this.hyperlinkList=res;
}
})
},
// 获取字段类型
......@@ -694,6 +725,10 @@ export default ({
}
})
},
//删除全部
deleteFields(){
this.tableData=[];
},
......
......@@ -20,7 +20,7 @@
<el-tab-pane label="一般" name="content">
<div style="position:relative;border:1px solid #b5b8c8;padding:15px 0;">
<div style="position:absolute;top:-15px;left:20px;color:#15428b;background-color:#fff;padding:5px 10px;">连接</div>
<database-choose ref="databaseChoose" :form.sync="sqlForm" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" @fatherFun="fatherFun" :form.sync="sqlForm" :graph="newGraph"></database-choose>
</div>
<div style="position:relative;border:1px solid #b5b8c8;padding:15px 0;margin-top:15px;">
......@@ -190,6 +190,7 @@ import {
export default ({
data(){
return{
sqlForm:this.sqlFormSend,
newGraph:{},
formName:'',
fileDialogVisible:false,//选择文件夹弹窗
......@@ -287,8 +288,16 @@ export default ({
}
},
watch:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
sqlFormSend(val){
console.log("回显的表单数据===",val);
this.sqlForm=val;
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:["sqlForm","title","sqlVisible","saveOutputDialog","doubleClickCell"],
props:["sqlFormSend","title","sqlVisible","saveOutputDialog","doubleClickCell"],
// props:{
// title:{
......@@ -306,10 +315,36 @@ export default ({
this.getAvailableCharsets();//获取编码
},
methods:{
// 数据库重置
fatherFun(param){
console.log("触发了父组件的方法=----",param);
//数据库
if(param.connection == this.sqlFormSend.connection){
console.log(2)
this.sqlForm = this.sqlFormSend
if(param.table == this.sqlFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.sqlFormSend.fields)
}else{
console.log(6)
// this.tableData = []
}
}else{
console.log(3)
this.sqlForm = param
// this.tableData = []
}
console.log(5)
},
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
this.$refs.databaseChoose.clickFun(this.newGraph);
setTimeout(() => {
this.$refs.databaseChoose.clickFun(this.newGraph);
}, 500);
},
handleClose(){
this.$emit("update:sqlVisible", false);
......
......@@ -13,7 +13,7 @@
</el-form-item>
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="一般" name="content">
<database-choose ref="databaseChoose" :form.sync="synForm" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" :form.sync="synForm" @fatherFun="fatherFun" :graph="newGraph"></database-choose>
<el-form-item label="提交的记录数量:">
<el-row :gutter="10">
<el-col :span="23">
......@@ -49,6 +49,8 @@
<div slot="header" class="clearfix">
<span>用来查询的关键字</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
</div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
......@@ -113,6 +115,8 @@
<div slot="header" class="clearfix">
<span>更新字段</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClickUpdate">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFieldsUpdate">删除全部</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('update')">获取字段</el-button>
</div>
<table-list :tableHead="tableHeadUpdate" :tableData="tableDataUpdate" :field.sync="editDiaUpdate" :fieldClick="fieldClickUpdate"></table-list>
......@@ -242,6 +246,7 @@ inputOutputFields,//获取表输出
export default ({
data(){
return{
synForm:{},//解决子组件改变父组件传递props属性报错
newGraph:{},
fieldsList1:[],
fieldsList2:[],
......@@ -418,35 +423,38 @@ export default ({
}
},
// watch:{
// synForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// },
// },
watch:{
// synForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
synForm(n, o) {
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.searchFields);
var na=JSON.parse(n.updateFields);
this.tableData=ny;
// 解决子组件改变父组件传进来的变量的属性不报错start------
synFormSend(val){
console.log("回显的表单数据===",val);
this.synForm=val;
if(val.searchFields){
var ny=JSON.parse(val.searchFields);
this.tableData=ny;
}
if(val.updateFields){
var na=JSON.parse(val.updateFields);
this.tableDataUpdate=na;
}
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:{
synForm:Object,
synFormSend:Object,
title:{
type:String,
default:''
......@@ -469,7 +477,61 @@ export default ({
},
methods:{
clickFun(graph){
// 数据库重置
fatherFun(param){
console.log("触发了父组件的方法=----",param);
console.log("触发了父组件的方法=----",param);
//数据库
if(param.connection == this.synFormSend.connection){
console.log(2)
this.synForm = this.synFormSend
if(param.table == this.synFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.synFormSend.searchFields);
this.tableDataUpdate = JSON.parse(this.synFormSend.updateFields);
}else{
console.log(6)
this.tableData = [];
this.tableDataUpdate=[];
}
}else{
console.log(3)
this.synForm = param
this.tableData = [];
this.tableDataUpdate=[];
console.log(5)
}
// 判断返回来有没有改变连接和表有就重置数据库start-------
// if(param.changeConnection==true || param.changeConnection==="true"){
// this.tableData=[];
// this.tableDataUpdate=[];
// }else{
// if(param.changeSchema){
// }else{
// // var ny=JSON.parse(param.key);
// // this.tableData=ny;
// }
// if(param.changeTable==true || param.changeTable==="true"){
// console.log("进入回显的8888888=====");
// this.tableData=[];
// this.tableDataUpdate=[];
// // console.log('触发了父组件的方法改变表=----',this.tableData);
// }else{
// console.log("进入回显的999999=====");
// var ny=JSON.parse(param.searchFields);
// var na=JSON.parse(param.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
setTimeout(() => {
......@@ -567,7 +629,7 @@ export default ({
})
},
//获取表输出
inputOutputFields(){
inputOutputFields(par){
if(this.doubleClickCell){
// var title=this.doubleClickCell.title
var title=this.doubleClickCell.value.attributes.label.value;
......@@ -589,9 +651,45 @@ export default ({
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log('字段',res);
this.fieldsList2=res;
// 获取全部字段===
if(par=="get"){
var newArray=[];
res.forEach(item => {
var newObj={};
newObj.field=item.name;
newObj.condition="=";
newObj.name=item.name;
newObj.name2="";
newArray.push(newObj);
});
this.tableData=newArray;
}else if(par=="update"){
var newArray=[];
res.forEach(item => {
var newObj={};
newObj.name=item.name;
newObj.rename=item.name;
newObj.update="Y";
newArray.push(newObj);
});
this.tableDataUpdate=newArray;
}else{
this.fieldsList2=res;
}
// 获取全部字段===
// this.fieldsList2=res;
})
},
//删除字段
deleteFields(){
this.tableData=[];
},
//删除字段
deleteFieldsUpdate(){
this.tableDataUpdate=[];
}
}
......
......@@ -16,7 +16,7 @@
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content">
<database-choose ref="databaseChoose" :form.sync="tableOutForm" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" @fatherFun="fatherFun" :form.sync="tableOutForm" :getXmlVal="getXmlVal" :graph="newGraph"></database-choose>
<el-form-item label="提交记录数量:">
<el-row :gutter="10">
<el-col :span="23">
......@@ -205,7 +205,7 @@ import { mapGetters,mapMutations } from "vuex";
export default ({
data(){
return{
newTableOutForm:{},
tableOutForm:this.tableOutFormSend,
field:false,//编辑弹窗
checkedCities: ['上海', '北京'],
editDia:false,//编辑表字段
......@@ -299,83 +299,107 @@ export default ({
}
},
props:["tableOutForm","title","nodePath","tableOutPutVisible","explorer","graph","doubleClickCell","getXmlVal","saveOutputDialog"],
props:["tableOutFormSend","title","nodePath","tableOutPutVisible","explorer","graph","doubleClickCell","getXmlVal","saveOutputDialog"],
mounted(){
// this.tableOutForm=this.tableOutFormSend;
},
created(){
// if(this.tableOutForm.connection!=''){
// this.tableData=JSON.parse(this.tableOutForm.fields);
// this.newTableOutForm=this.tableOutForm;
// }
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.fields);
// this.tableData=ny;
// }
// },
// this.dialogOpen();
// console.log("tableout回显数据===",this.tableOutForm);
// if(this.tableOutForm.fields){
// var ny=JSON.parse(this.tableOutForm.fields);
// this.tableData=ny;
// }
console.log(this.graph,'=========');
},
watch:{
// tableOutForm:{
// // deep:true,
// // immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.fields);
// this.tableData=ny;
// }
// }
// },
tableOutForm(n,o){
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.fields);
// 解决子组件改变父组件传进来的变量的属性不报错start------
tableOutFormSend(val){
console.log("回显的表单数据===",val);
this.tableOutForm=val;
if(this.tableOutForm.fields){
var ny=JSON.parse(this.tableOutForm.fields);
this.tableData=ny;
}
},
//如果修改了数据库链接或者另选表字段为空需要重置start================
// 'tableOutForm.connection':{
// handler: function(a,b) {
// if(this.newTableOutForm){
// if(a!=this.newTableOutForm.conection){
// this.tableData=[];
// }
// }
// },
// },
// 'tableOutForm.table': {
// handler: function(a,b) {
// if(this.newTableOutForm){
// if(a!=this.newTableOutForm.table){
// this.tableData=[];
// }
// }
// },
// },
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
methods:{
// 数据库重置
fatherFun(param){
//如果修改了数据库链接或者另选表字段为空需要重置end================
console.log("触发了父组件的方法=----",param);
// graph(n,o){
// console.log("表输出拿到的画布1111===",n);
// }
//数据库
if(param.connection == this.tableOutFormSend.connection){
console.log(2)
this.tableOutForm = this.tableOutFormSend
if(param.table == this.tableOutFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.tableOutFormSend.fields)
}else{
console.log(6)
this.tableData = []
}
}else{
console.log(3)
this.tableOutForm = param
this.tableData = []
// if(param.table == this.tableOutFormSend.table && param.connection == this.tableOutFormSend.connection){
// //数据库与表不变的情况
// console.log(3)
// this.tableOutForm = this.tableOutFormSend
// this.tableData = JSON.parse(this.tableOutFormSend.fields)
// }else{
// console.log(4)
// this.tableOutForm = param
// this.tableData = []
// }
}
//表change
console.log(5)
return
console.log("触发了父组件的方法=----",param);
// 判断返回来有没有改变连接和表有就重置数据库start-------
if(param.changeConnection ==true || param.changeConnection==="true"){
this.tableData=[];
}else{
if(param.changeSchema){
}else{
var ny=JSON.parse(param.fields);
this.tableData=ny;
}
if(param.changeTable ==true || param.changeConnection==="true"){
this.tableData=[];
console.log('触发了父组件的方法改变表=----',this.tableData)
}else{
var ny=JSON.parse(param.fields);
this.tableData=ny;
}
}
console.log('数据源',this.tableOutFormSend)
console.log('自组件数据',param);
if(this.tableOutFormSend.connection == param.connection){
this.tableOutForm = this.tableOutFormSend
}else{
this.tableOutForm = param
}
// 判断返回来有没有改变连接和表有就重置数据库end-------
},
},
methods:{
clickFun(graph){
console.log(graph,1)
this.newGraph = graph
......@@ -450,7 +474,7 @@ export default ({
// 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("query", '');
inputOutputFields(pamer).then(res=>{
......
......@@ -270,6 +270,8 @@
<el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix">
<el-button style="padding: 3px 0" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
</div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
<!-- 编辑弹窗开始=========== -->
......@@ -687,7 +689,7 @@ export default ({
}
},
//获取表输出
inputOutputFields(){
inputOutputFields(par){
if(this.doubleClickCell){
// var title=this.doubleClickCell.title;
var title=this.doubleClickCell.value.attributes.label.value
......@@ -710,7 +712,22 @@ export default ({
pamer.append("query", '');
inputOutputFields(pamer).then(res=>{
console.log('字段',res);
this.fieldsList2=res;
// 获取全部字段===
if(par=="get"){
var newArray=[];
res.forEach(item => {
var newObj={};
newObj.name=item.name;
newObj.type=item.type;
newArray.push(newObj);
});
this.tableData=newArray;
}else{
this.fieldsList2=res;
}
// 获取全部字段===
// this.fieldsList2=res;
})
},
// 获取字段类型
......@@ -746,6 +763,10 @@ export default ({
this.textFileForm.separator=tab;
console.log('分隔符============',this.textFileForm.separator);
},
//删除字段
deleteFields(){
this.tableData=[];
}
......
......@@ -16,7 +16,7 @@
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content">
<database-choose ref="databaseChoose" :form.sync="updateForm" :graph="newGraph"></database-choose>
<database-choose ref="databaseChoose" @fatherFun="fatherFun" :form.sync="updateForm" :graph="newGraph"></database-choose>
<el-form-item label="提交记录数量:">
<el-row :gutter="10">
<el-col :span="23">
......@@ -60,7 +60,7 @@
<el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix">
<el-button style="padding: 3px 0" type="text" @click="fieldClick(true)">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
</div>
......@@ -114,7 +114,7 @@
<el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix">
<el-button style="padding: 3px 0" type="text" @click="fieldClickUpdate">新增字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFieldsUpdate">删除字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFieldsUpdate">删除全部</el-button>
<el-button style="padding: 3px 0" type="text" @click="inputOutputFields('update')">获取字段</el-button>
</div>
......@@ -183,6 +183,7 @@ inputOutputFields,//获取表输出
export default ({
data(){
return{
updateForm:this.updateFormSend,//解决子组件改变父组件传递props属性报错
newGraph:{},
fieldsList1:[],
fieldsList2:[],
......@@ -288,33 +289,37 @@ export default ({
}
},
watch:{
// synForm:{
// deep:true,
// immediate:true,
// handler:function(n,o){
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// }
// }
updateForm(n, o) {
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.searchFields);
var na=JSON.parse(n.updateFields);
this.tableData=ny;
// watch:{
// updateForm(n, o) {
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.searchFields);
// var na=JSON.parse(n.updateFields);
// this.tableData=ny;
// this.tableDataUpdate=na;
// }
// },
// },
watch:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
updateFormSend(val){
console.log("回显的表单数据===",val);
this.updateForm=val;
if(val.searchFields){
var ny=JSON.parse(val.searchFields);
this.tableData=ny;
}
if(val.updateFields){
var na=JSON.parse(val.updateFields);
this.tableDataUpdate=na;
}
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
},
props:{
updateForm:Object,
updateFormSend:Object,
title:{
type:String,
default:''
......@@ -337,6 +342,30 @@ export default ({
},
methods:{
// 数据库重置
fatherFun(param){
console.log("触发了父组件的方法=----",param);
//数据库
if(param.connection == this.updateFormSend.connection){
console.log(2)
this.updateForm = this.updateFormSend
if(param.table == this.updateFormSend.table){
console.log(4)
this.tableData = JSON.parse(this.updateFormSend.searchFields);
this.tableDataUpdate = JSON.parse(this.updateFormSend.updateFields);
}else{
console.log(6)
this.tableData = [];
this.tableDataUpdate=[];
}
}else{
console.log(3)
this.updateForm = param
this.tableData = [];
this.tableDataUpdate=[];
console.log(5)
}
},
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph;
......
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