Commit 066a3d3f by 莫晓莉

保存databases稳定获取画布

parent da189fdb
......@@ -1638,7 +1638,7 @@ export default {
// q[key.name] = key.value;
// }
this.outPutFormData1 = this.showDataFunc();
this.$refs.tableOutPut.clickFun(this.graph)
this.$refs.tableOutPut.clickFun(this.graph);
return;
} else if (cell.ids == "step16" || cell.value.attributes.ctype.value == "Update" ) {
//更新
......
......@@ -7,11 +7,11 @@
<!-- <el-select style="width: 100%" v-model="selectName" placeholder="请选择选择数据库连接" @focus="clickFunc" @change="selectNameFunc">
<el-option v-for="(item,index) in namesList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select> -->
<el-select style="width: 100%" v-model="selectName" placeholder="请选择选择数据库连接" @focus="getGraphDataBases" >
<el-select style="width: 100%" v-model="selectName" placeholder="请选择选择数据库连接" @focus="getGraphDataBases" @change="selectNameFunc">
<el-option v-for="(item,index) in namesList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
<!-- <el-select style="width: 100%" v-model="selectModel" placeholder="请选择选择数据库连接" @focus="getGraphDataBases" >
<!-- <el-select style="width: 100%" v-model="selectName" placeholder="请选择选择数据库连接" @focus="getGraphDataBases" @change="selectNameFunc">
<el-option v-for="(item,index) in namesList" :key="index" :label="item.name" :value="item"></el-option>
</el-select> -->
......@@ -66,7 +66,7 @@ export default {
name: "database-choose",
data() {
return {
selectModel:
// selectModel:
noneRespository:1,//判断是保存画布还是传后台
dialogVisibleFourth:false,
namesList:[],
......@@ -146,9 +146,11 @@ export default {
newAdd(){
this.dialogVisibleFourth=true;
// this.$refs.establishDia.database();
// this.$refs.establishDia.clickFun(this.newGraph);//先把画布传过去
this.$refs.establishDia.clickFun(this.graph);//先把画布传过去
this.$refs.establishDia.getTransDatabase();
this.$refs.establishDia.accessMethod();//获取连接方式
this.$refs.establishDia.clickFun(this.newGraph)
},
......@@ -156,6 +158,7 @@ export default {
selectNameFunc(e){
console.log('当前选中的数',e);
console.log('当前选中的数-===',this.selectName);
this.selectName=this.se
this.newForm.connection=this.selectName;
},
//点击选择获取已经创建的数据库列表
......@@ -164,7 +167,8 @@ export default {
},
// 编辑
editDataBaseModal(){
this.$refs.establishDia.clickFun(this.newGraph)
// this.$refs.establishDia.clickFun(this.newGraph);//先传画布
this.$refs.establishDia.clickFun(this.graph);//先把画布传过去
if(this.selectName){
this.dialogVisibleFourth=true;
}
......@@ -194,13 +198,14 @@ export default {
// 获取保存到画布的databases
getGraphDataBases(){
// var graph = this.getGraph();
var root = this.newGraph.getDefaultParent(), data = [];
var root = this.graph.getDefaultParent(), data = [];
if(root.getAttribute('databases') != null)
data=JSON.parse(root.getAttribute('databases'));
console.log('获取到画布上的databases====',data);
this.namesList=data;
}
},
},
......
......@@ -511,6 +511,10 @@ export default {
if (res) {
console.log("数据库详情:", res);
this.dataBaseDetail = res;
// 写死测试----------
// var testJson={"name":"mytest","type":"MYSQL","access":0,"hostname":"192.168.0.44","databaseName":"test","port":"3306","username":"root","password":"123456","supportBooleanDataType":true,"supportTimestampDataType":true,"preserveReservedCaseCheck":true,"extraOptions":[],"usingConnectionPool":"N","initialPoolSize":"5","maximumPoolSize":"10","partitioned":"N","partitionInfo":[]};
// this.dataBaseDetail=JSON.parse(testJson);
// 写死测试-------
this.chooseParams(this.dataBaseDetail);
} else {
this.$message.error(res.errMsg);
......
......@@ -329,7 +329,8 @@ export default ({
clickFun(graph){
console.log(graph,'双击获取值')
this.newGraph = graph
this.$refs.databaseChoose.clickFun(graph)
// this.$refs.databaseChoose.clickFun(graph);
this.$refs.databaseChoose.clickFun(this.newGraph);
},
confirm(){
this.tableOutForm.label=this.doubleClickCell.title;
......
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