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 @@ ...@@ -841,7 +841,7 @@
:getXmlVal="getXmlVal" :getXmlVal="getXmlVal"
@fathertrans="fathertrans" @fathertrans="fathertrans"
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:tableOutForm="outPutFormData1" :tableOutFormSend="outPutFormData1"
></outDialog> ></outDialog>
<insertOrUpdate <insertOrUpdate
ref="insertOrdate" ref="insertOrdate"
...@@ -849,7 +849,7 @@ ...@@ -849,7 +849,7 @@
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:getXmlVal="getXmlVal" :getXmlVal="getXmlVal"
:insertOrUpdateForm="outPutFormData2" :insertOrUpdateFormSend="outPutFormData2"
></insertOrUpdate> ></insertOrUpdate>
<excelOutPutDialog <excelOutPutDialog
ref="excelOut" ref="excelOut"
...@@ -863,28 +863,28 @@ ...@@ -863,28 +863,28 @@
:updateVisible.sync="updateVisible" :updateVisible.sync="updateVisible"
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:updateForm="outPutFormData4" :updateFormSend="outPutFormData4"
:getXmlVal="getXmlVal"></updateDialog> :getXmlVal="getXmlVal"></updateDialog>
<synDialog <synDialog
ref="syn" ref="syn"
:synVisible.sync="synVisible" :synVisible.sync="synVisible"
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:synForm="outPutFormData5" :synFormSend="outPutFormData5"
:getXmlVal="getXmlVal"></synDialog> :getXmlVal="getXmlVal"></synDialog>
<delDialog <delDialog
ref="del" ref="del"
:deleteVisible.sync="deleteVisible" :deleteVisible.sync="deleteVisible"
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:deleteForm="outPutFormData6" :deleteFormSend="outPutFormData6"
:getXmlVal="getXmlVal"></delDialog> :getXmlVal="getXmlVal"></delDialog>
<sqlDialog <sqlDialog
ref="sql" ref="sql"
:sqlVisible.sync="sqlVisible" :sqlVisible.sync="sqlVisible"
:saveOutputDialog="saveOutputDialog" :saveOutputDialog="saveOutputDialog"
:doubleClickCell="doubleClickCell" :doubleClickCell="doubleClickCell"
:sqlForm="outPutFormData7" :sqlFormSend="outPutFormData7"
></sqlDialog> ></sqlDialog>
<textFileDialog <textFileDialog
ref="textFile" ref="textFile"
...@@ -1818,7 +1818,9 @@ previousField(){ ...@@ -1818,7 +1818,9 @@ previousField(){
//mico-Excel输出 //mico-Excel输出
this.microVisible = !this.microVisible; this.microVisible = !this.microVisible;
this.outPutFormData9 = this.showDataFunc(); this.outPutFormData9 = this.showDataFunc();
this.$refs.mic.clickFun(this.graph);//向子组件传递画布 setTimeout(() => {
this.$refs.mic.clickFun(this.graph);//向子组件传递画布
}, 500);
return; return;
} else if (cell.ids == "step9" || cell.value.attributes.ctype.value == "ExcelOutput" ) { } else if (cell.ids == "step9" || cell.value.attributes.ctype.value == "ExcelOutput" ) {
//Excel输出 //Excel输出
......
...@@ -1068,6 +1068,48 @@ export default { ...@@ -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> </script>
......
...@@ -378,6 +378,7 @@ ...@@ -378,6 +378,7 @@
<div slot="header" class="clearfix"> <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="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="inputOutputFields">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div> </div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list> <table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
...@@ -810,6 +811,14 @@ export default ({ ...@@ -810,6 +811,14 @@ export default ({
this.tableData=res; this.tableData=res;
}) })
}, },
//删除全部
deleteFields(){
this.tableData=[];
},
//删除全部
// deleteFieldsUpdate(){
// this.tableDataUpdate=[];
// }
} }
}) })
......
...@@ -9,15 +9,16 @@ ...@@ -9,15 +9,16 @@
> >
<!-- <div id="ExcelInputDialog"></div> --> <!-- <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-form-item label="步骤名称:">
<el-input v-model="stepName.name"></el-input> <el-input v-model="deleteForm.label"></el-input>
</el-form-item> </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;"> <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-form-item label="提交记录数量:">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="23"> <el-col :span="23">
...@@ -32,6 +33,8 @@ ...@@ -32,6 +33,8 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>查询值所需的关键字</span> <span>查询值所需的关键字</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button> <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> </div>
<!-- <el-table style="width: 100%" border :data="tableData"> <!-- <el-table style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead"> <template v-for="(item,index) in tableHead">
...@@ -125,6 +128,7 @@ inputOutputFields,//获取表输出 ...@@ -125,6 +128,7 @@ inputOutputFields,//获取表输出
export default ({ export default ({
data(){ data(){
return{ return{
deleteForm:{},//解决子组件改变父组件传递props属性报错
newGraph:{}, newGraph:{},
fieldsList1:[], fieldsList1:[],
fieldsList2:[], fieldsList2:[],
...@@ -136,15 +140,6 @@ export default ({ ...@@ -136,15 +140,6 @@ export default ({
// deleteForm:{ // deleteForm:{
// commit: "100", // commit: "100",
// connection: "", // connection: "",
// schema: "test",
// table: "",
// searchFields: "[]",
// updateFields: "[]",
// },
// deleteForm:{
// commit: "100",
// connection: "",
// key:"[]", // key:"[]",
// label:"删除", // label:"删除",
// schema: "", // schema: "",
...@@ -206,30 +201,28 @@ export default ({ ...@@ -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:{ watch:{
// deleteForm:{ // 解决子组件改变父组件传进来的变量的属性不报错start------
// // deep:true, deleteFormSend(val){
// // immediate:true, console.log("回显的表单数据===",val);
// handler:function(n,o){ this.deleteForm=val;
// console.log("回显的表单数据===",n); if(this.deleteForm.key){
// if(n){ var ny=JSON.parse(this.deleteForm.key);
// var ny=JSON.parse(n.key);
// this.tableData=ny;
// }
// }
// }
deleteForm(n,o){
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.key);
this.tableData=ny; this.tableData=ny;
} }
} },
// 解决子组件改变父组件传进来的变量的属性不报错start------
}, },
props:["title","nodePath","deleteVisible","doubleClickCell","saveOutputDialog","deleteForm","getXmlVal"], props:["title","nodePath","deleteVisible","doubleClickCell","saveOutputDialog","deleteFormSend","getXmlVal"],
// props:{ // props:{
// title:{ // title:{
// type:String, // type:String,
...@@ -248,8 +241,56 @@ export default ({ ...@@ -248,8 +241,56 @@ export default ({
mounted(){ mounted(){
}, },
// created(){
// // 深拷贝解决第一次不执行
// this.newform=JSON.parse(JSON.stringify(this.form));
// },
methods:{ 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,'双击获取值') console.log(graph,'双击获取值')
this.newGraph = graph; this.newGraph = graph;
setTimeout(() => { setTimeout(() => {
...@@ -260,7 +301,7 @@ export default ({ ...@@ -260,7 +301,7 @@ export default ({
this.$emit("update:deleteVisible", false); this.$emit("update:deleteVisible", false);
}, },
confirm(){ confirm(){
this.deleteForm.label=this.doubleClickCell.title; // this.deleteForm.label=this.doubleClickCell.title;
this.deleteForm.key=JSON.stringify(this.tableData);//字段复值 this.deleteForm.key=JSON.stringify(this.tableData);//字段复值
console.log('弹窗数据:===',this.deleteForm); console.log('弹窗数据:===',this.deleteForm);
this.saveOutputDialog(this.deleteForm); this.saveOutputDialog(this.deleteForm);
...@@ -321,7 +362,7 @@ export default ({ ...@@ -321,7 +362,7 @@ export default ({
}) })
}, },
//获取表输出 //获取表输出
inputOutputFields(){ inputOutputFields(par){
if(this.doubleClickCell){ if(this.doubleClickCell){
// var title=this.doubleClickCell.title; // var title=this.doubleClickCell.title;
var title=this.doubleClickCell.value.attributes.label.value var title=this.doubleClickCell.value.attributes.label.value
...@@ -341,9 +382,27 @@ export default ({ ...@@ -341,9 +382,27 @@ export default ({
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ inputOutputFields(pamer).then(res=>{
console.log('字段',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 @@ ...@@ -18,7 +18,7 @@
<!-- <el-form :model="insertOrUpdateForm" label-width="200px"> --> <!-- <el-form :model="insertOrUpdateForm" label-width="200px"> -->
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content"> <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-form-item label="提交记录数量:">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="23"> <el-col :span="23">
...@@ -43,6 +43,8 @@ ...@@ -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" @click="fieldClick(true)">新增字段</el-button>
<!-- <el-button style="padding: 3px 0" type="text">删除字段</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="getFields(0)">获取字段</el-button>
<el-button style="padding: 3px 0" type="text" @click="deleteFields">删除全部</el-button>
</div> </div>
<!-- <el-table style="width: 100%" border :data="tableData"> <!-- <el-table style="width: 100%" border :data="tableData">
<template v-for="(item,index) in tableHead"> <template v-for="(item,index) in tableHead">
...@@ -109,6 +111,7 @@ ...@@ -109,6 +111,7 @@
<el-button style="padding: 3px 0" type="text" @click="fieldClickUpdate">新增字段</el-button> <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">删除字段</el-button> -->
<el-button style="padding: 3px 0" type="text" @click="getFields(1)">获取和更新字段</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> <el-button style="padding: 3px 0" type="text">编辑映射</el-button>
</div> </div>
...@@ -187,6 +190,7 @@ import { ...@@ -187,6 +190,7 @@ import {
export default ({ export default ({
data(){ data(){
return{ return{
insertOrUpdateForm: {},//解决子组件改变父组件传递props属性报错
newGraph:{}, newGraph:{},
fieldsList1:[], fieldsList1:[],
fieldsList2:[], fieldsList2:[],
...@@ -293,33 +297,37 @@ export default ({ ...@@ -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:{ watch:{
// insertOrUpdateForm:{ // 解决子组件改变父组件传进来的变量的属性不报错start------
// // deep:true, insertOrUpdateFormSend(val){
// // immediate:true, console.log("回显的表单数据===",val);
// handler:function(n,o){ this.insertOrUpdateForm=val;
// console.log("回显的表单数据===",n); if(val.searchFields){
// if(n){ var ny=JSON.parse(val.searchFields);
// var ny=JSON.parse(n.searchFields); this.tableData=ny;
// var na=JSON.parse(n.updateFields);
// this.tableData=ny; }
// this.tableDataUpdate=na; if(val.updateFields){
// } var na=JSON.parse(val.updateFields);
// }
// }
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; this.tableDataUpdate=na;
} }
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
}, },
props:["insertOrUpdateForm","InsertOrUpdateVisible","doubleClickCell","getXmlVal","saveOutputDialog"], props:["insertOrUpdateFormSend","InsertOrUpdateVisible","doubleClickCell","getXmlVal","saveOutputDialog"],
// props:{ // props:{
// InsertOrUpdateVisible:{ // InsertOrUpdateVisible:{
...@@ -331,6 +339,59 @@ export default ({ ...@@ -331,6 +339,59 @@ export default ({
}, },
methods:{ 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){ clickFun(graph){
console.log(graph,'双击获取值') console.log(graph,'双击获取值')
this.newGraph = graph; this.newGraph = graph;
...@@ -507,6 +568,14 @@ export default ({ ...@@ -507,6 +568,14 @@ export default ({
this.fieldsList2=res; this.fieldsList2=res;
}) })
}, },
//删除字段
deleteFields(){
this.tableData=[];
},
//删除字段
deleteFieldsUpdate(){
this.tableDataUpdate=[];
}
......
...@@ -298,6 +298,8 @@ ...@@ -298,6 +298,8 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>字段</span> <span>字段</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button> <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> </div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list> <table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
<!-- 编辑弹窗开始=========== --> <!-- 编辑弹窗开始=========== -->
...@@ -490,45 +492,45 @@ export default ({ ...@@ -490,45 +492,45 @@ export default ({
], ],
// 表格数据 // 表格数据
tableData: [ tableData: [
{ // {
name: '3', // name: '3',
type: '鞠婧祎', // type: '鞠婧祎',
format: '女', // format: '女',
styleCell:'1', // styleCell:'1',
title:'2', // title:'2',
titleStyleCell:'2', // titleStyleCell:'2',
formula:'2', // formula:'2',
hyperlinkField:'4', // hyperlinkField:'4',
commentField:'2', // commentField:'2',
commentAuthorField:'4' // commentAuthorField:'4'
}, // },
{ // {
name: '3', // name: '3',
type: '鞠婧祎', // type: '鞠婧祎',
format: '女', // format: '女',
styleCell:'1', // styleCell:'1',
title:'2', // title:'2',
titleStyleCell:'2', // titleStyleCell:'2',
formula:'2', // formula:'2',
hyperlinkField:'4', // hyperlinkField:'4',
commentField:'2', // commentField:'2',
commentAuthorField:'4' // commentAuthorField:'4'
}, // },
{ // {
name: '3', // name: '3',
type: '鞠婧祎', // type: '鞠婧祎',
format: '女', // format: '女',
styleCell:'1', // styleCell:'1',
title:'2', // title:'2',
titleStyleCell:'2', // titleStyleCell:'2',
formula:'2', // formula:'2',
hyperlinkField:'4', // hyperlinkField:'4',
commentField:'2', // commentField:'2',
commentAuthorField:'4' // commentAuthorField:'4'
} // }
], ],
} }
...@@ -652,20 +654,49 @@ export default ({ ...@@ -652,20 +654,49 @@ export default ({
this.fileDialogVisible=true; this.fileDialogVisible=true;
}, },
//超链接 //超链接
inputOutputFields(){ inputOutputFields(par){
if(this.doubleClickCell){ if(this.doubleClickCell){
// var title=this.doubleClickCell.title // var title=this.doubleClickCell.title
var title=this.doubleClickCell.value.attributes.label.value 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); 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", myXmlVal);
pamer.append("before", true); pamer.append("before", true);
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ inputOutputFields(pamer).then(res=>{
console.log('字段',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 ({ ...@@ -694,6 +725,10 @@ export default ({
} }
}) })
}, },
//删除全部
deleteFields(){
this.tableData=[];
},
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<el-tab-pane label="一般" name="content"> <el-tab-pane label="一般" name="content">
<div style="position:relative;border:1px solid #b5b8c8;padding:15px 0;"> <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> <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>
<div style="position:relative;border:1px solid #b5b8c8;padding:15px 0;margin-top:15px;"> <div style="position:relative;border:1px solid #b5b8c8;padding:15px 0;margin-top:15px;">
...@@ -190,6 +190,7 @@ import { ...@@ -190,6 +190,7 @@ import {
export default ({ export default ({
data(){ data(){
return{ return{
sqlForm:this.sqlFormSend,
newGraph:{}, newGraph:{},
formName:'', formName:'',
fileDialogVisible:false,//选择文件夹弹窗 fileDialogVisible:false,//选择文件夹弹窗
...@@ -287,8 +288,16 @@ export default ({ ...@@ -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:{ // props:{
// title:{ // title:{
...@@ -306,10 +315,36 @@ export default ({ ...@@ -306,10 +315,36 @@ export default ({
this.getAvailableCharsets();//获取编码 this.getAvailableCharsets();//获取编码
}, },
methods:{ 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){ clickFun(graph){
console.log(graph,'双击获取值') console.log(graph,'双击获取值')
this.newGraph = graph; this.newGraph = graph;
this.$refs.databaseChoose.clickFun(this.newGraph); setTimeout(() => {
this.$refs.databaseChoose.clickFun(this.newGraph);
}, 500);
}, },
handleClose(){ handleClose(){
this.$emit("update:sqlVisible", false); this.$emit("update:sqlVisible", false);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</el-form-item> </el-form-item>
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="一般" name="content"> <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-form-item label="提交的记录数量:">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="23"> <el-col :span="23">
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>用来查询的关键字</span> <span>用来查询的关键字</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClick(true)">新增字段</el-button> <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> </div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list> <table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
...@@ -113,6 +115,8 @@ ...@@ -113,6 +115,8 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>更新字段</span> <span>更新字段</span>
<el-button style="padding: 3px 0;margin-left:50px;" type="text" @click="fieldClickUpdate">新增字段</el-button> <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> </div>
<table-list :tableHead="tableHeadUpdate" :tableData="tableDataUpdate" :field.sync="editDiaUpdate" :fieldClick="fieldClickUpdate"></table-list> <table-list :tableHead="tableHeadUpdate" :tableData="tableDataUpdate" :field.sync="editDiaUpdate" :fieldClick="fieldClickUpdate"></table-list>
...@@ -242,6 +246,7 @@ inputOutputFields,//获取表输出 ...@@ -242,6 +246,7 @@ inputOutputFields,//获取表输出
export default ({ export default ({
data(){ data(){
return{ return{
synForm:{},//解决子组件改变父组件传递props属性报错
newGraph:{}, newGraph:{},
fieldsList1:[], fieldsList1:[],
fieldsList2:[], fieldsList2:[],
...@@ -418,35 +423,38 @@ export default ({ ...@@ -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:{ watch:{
// synForm:{ // 解决子组件改变父组件传进来的变量的属性不报错start------
// // deep:true, synFormSend(val){
// // immediate:true, console.log("回显的表单数据===",val);
// handler:function(n,o){ this.synForm=val;
// console.log("回显的表单数据===",n); if(val.searchFields){
// if(n){ var ny=JSON.parse(val.searchFields);
// var ny=JSON.parse(n.searchFields); this.tableData=ny;
// var na=JSON.parse(n.updateFields);
// this.tableData=ny; }
// this.tableDataUpdate=na; if(val.updateFields){
// } var na=JSON.parse(val.updateFields);
// }
// }
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; this.tableDataUpdate=na;
} }
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
}, },
props:{ props:{
synForm:Object, synFormSend:Object,
title:{ title:{
type:String, type:String,
default:'' default:''
...@@ -469,7 +477,61 @@ export default ({ ...@@ -469,7 +477,61 @@ export default ({
}, },
methods:{ 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,'双击获取值') console.log(graph,'双击获取值')
this.newGraph = graph; this.newGraph = graph;
setTimeout(() => { setTimeout(() => {
...@@ -567,7 +629,7 @@ export default ({ ...@@ -567,7 +629,7 @@ export default ({
}) })
}, },
//获取表输出 //获取表输出
inputOutputFields(){ inputOutputFields(par){
if(this.doubleClickCell){ if(this.doubleClickCell){
// var title=this.doubleClickCell.title // var title=this.doubleClickCell.title
var title=this.doubleClickCell.value.attributes.label.value; var title=this.doubleClickCell.value.attributes.label.value;
...@@ -589,9 +651,45 @@ export default ({ ...@@ -589,9 +651,45 @@ export default ({
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ inputOutputFields(pamer).then(res=>{
console.log('字段',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 @@ ...@@ -16,7 +16,7 @@
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content"> <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-form-item label="提交记录数量:">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="23"> <el-col :span="23">
...@@ -205,7 +205,7 @@ import { mapGetters,mapMutations } from "vuex"; ...@@ -205,7 +205,7 @@ import { mapGetters,mapMutations } from "vuex";
export default ({ export default ({
data(){ data(){
return{ return{
newTableOutForm:{}, tableOutForm:this.tableOutFormSend,
field:false,//编辑弹窗 field:false,//编辑弹窗
checkedCities: ['上海', '北京'], checkedCities: ['上海', '北京'],
editDia:false,//编辑表字段 editDia:false,//编辑表字段
...@@ -299,83 +299,107 @@ export default ({ ...@@ -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(){ mounted(){
// this.tableOutForm=this.tableOutFormSend;
}, },
created(){ created(){
// console.log("tableout回显数据===",this.tableOutForm);
// if(this.tableOutForm.connection!=''){ // if(this.tableOutForm.fields){
// this.tableData=JSON.parse(this.tableOutForm.fields); // var ny=JSON.parse(this.tableOutForm.fields);
// this.newTableOutForm=this.tableOutForm; // this.tableData=ny;
// } // }
// console.log("回显的表单数据===",n);
// if(n){
// var ny=JSON.parse(n.fields);
// this.tableData=ny;
// }
// },
// this.dialogOpen();
console.log(this.graph,'========='); console.log(this.graph,'=========');
}, },
watch:{ watch:{
// tableOutForm:{ // 解决子组件改变父组件传进来的变量的属性不报错start------
// // deep:true, tableOutFormSend(val){
// // immediate:true, console.log("回显的表单数据===",val);
// handler:function(n,o){ this.tableOutForm=val;
// console.log("回显的表单数据===",n); if(this.tableOutForm.fields){
// if(n){ var ny=JSON.parse(this.tableOutForm.fields);
// var ny=JSON.parse(n.fields);
// this.tableData=ny;
// }
// }
// },
tableOutForm(n,o){
console.log("回显的表单数据===",n);
if(n){
var ny=JSON.parse(n.fields);
this.tableData=ny; this.tableData=ny;
} }
}, },
//如果修改了数据库链接或者另选表字段为空需要重置start================ // 解决子组件改变父组件传进来的变量的属性不报错start------
// 'tableOutForm.connection':{ },
// handler: function(a,b) { methods:{
// if(this.newTableOutForm){ // 数据库重置
// if(a!=this.newTableOutForm.conection){ fatherFun(param){
// this.tableData=[];
// }
// }
// },
// },
// 'tableOutForm.table': {
// handler: function(a,b) {
// if(this.newTableOutForm){
// if(a!=this.newTableOutForm.table){
// this.tableData=[];
// }
// }
// },
// },
//如果修改了数据库链接或者另选表字段为空需要重置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){ clickFun(graph){
console.log(graph,1) console.log(graph,1)
this.newGraph = graph this.newGraph = graph
...@@ -450,7 +474,7 @@ export default ({ ...@@ -450,7 +474,7 @@ export default ({
// var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串 // var myXmlVal = mxUtils.getXml(encodedModel);//xml字符串
var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串 var myXmlVal = mxUtils.getPrettyXml(encodedModel);//xml字符串
pamer.append("graphXml",myXmlVal); 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=>{
......
...@@ -270,6 +270,8 @@ ...@@ -270,6 +270,8 @@
<el-card class="box-card" style="margin-top:15px;"> <el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix"> <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="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> </div>
<table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list> <table-list ref="tableDia" :tableHead="tableHead" :tableData="tableData" :field.sync="editDia" :fieldClick="fieldClick"></table-list>
<!-- 编辑弹窗开始=========== --> <!-- 编辑弹窗开始=========== -->
...@@ -687,7 +689,7 @@ export default ({ ...@@ -687,7 +689,7 @@ export default ({
} }
}, },
//获取表输出 //获取表输出
inputOutputFields(){ inputOutputFields(par){
if(this.doubleClickCell){ if(this.doubleClickCell){
// var title=this.doubleClickCell.title; // var title=this.doubleClickCell.title;
var title=this.doubleClickCell.value.attributes.label.value var title=this.doubleClickCell.value.attributes.label.value
...@@ -710,7 +712,22 @@ export default ({ ...@@ -710,7 +712,22 @@ export default ({
pamer.append("query", ''); pamer.append("query", '');
inputOutputFields(pamer).then(res=>{ inputOutputFields(pamer).then(res=>{
console.log('字段',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 ({ ...@@ -746,6 +763,10 @@ export default ({
this.textFileForm.separator=tab; this.textFileForm.separator=tab;
console.log('分隔符============',this.textFileForm.separator); console.log('分隔符============',this.textFileForm.separator);
},
//删除字段
deleteFields(){
this.tableData=[];
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="基本配置" name="content"> <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-form-item label="提交记录数量:">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="23"> <el-col :span="23">
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-card class="box-card" style="margin-top:15px;"> <el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix"> <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="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> <el-button style="padding: 3px 0" type="text" @click="inputOutputFields('get')">获取字段</el-button>
</div> </div>
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<el-card class="box-card" style="margin-top:15px;"> <el-card class="box-card" style="margin-top:15px;">
<div slot="header" class="clearfix"> <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="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> <el-button style="padding: 3px 0" type="text" @click="inputOutputFields('update')">获取字段</el-button>
</div> </div>
...@@ -183,6 +183,7 @@ inputOutputFields,//获取表输出 ...@@ -183,6 +183,7 @@ inputOutputFields,//获取表输出
export default ({ export default ({
data(){ data(){
return{ return{
updateForm:this.updateFormSend,//解决子组件改变父组件传递props属性报错
newGraph:{}, newGraph:{},
fieldsList1:[], fieldsList1:[],
fieldsList2:[], fieldsList2:[],
...@@ -288,33 +289,37 @@ export default ({ ...@@ -288,33 +289,37 @@ export default ({
} }
}, },
watch:{ // watch:{
// synForm:{ // updateForm(n, o) {
// deep:true, // console.log("回显的表单数据===",n);
// immediate:true, // if(n){
// handler:function(n,o){ // var ny=JSON.parse(n.searchFields);
// console.log("回显的表单数据===",n); // var na=JSON.parse(n.updateFields);
// if(n){ // this.tableData=ny;
// var ny=JSON.parse(n.searchFields); // this.tableDataUpdate=na;
// var na=JSON.parse(n.updateFields); // }
// this.tableData=ny; // },
// this.tableDataUpdate=na; // },
// } watch:{
// 解决子组件改变父组件传进来的变量的属性不报错start------
// } updateFormSend(val){
// } console.log("回显的表单数据===",val);
updateForm(n, o) { this.updateForm=val;
console.log("回显的表单数据===",n); if(val.searchFields){
if(n){ var ny=JSON.parse(val.searchFields);
var ny=JSON.parse(n.searchFields); this.tableData=ny;
var na=JSON.parse(n.updateFields);
this.tableData=ny; }
if(val.updateFields){
var na=JSON.parse(val.updateFields);
this.tableDataUpdate=na; this.tableDataUpdate=na;
} }
},
},
// 解决子组件改变父组件传进来的变量的属性不报错start------
}, },
props:{ props:{
updateForm:Object, updateFormSend:Object,
title:{ title:{
type:String, type:String,
default:'' default:''
...@@ -337,6 +342,30 @@ export default ({ ...@@ -337,6 +342,30 @@ export default ({
}, },
methods:{ 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){ clickFun(graph){
console.log(graph,'双击获取值') console.log(graph,'双击获取值')
this.newGraph = 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