Commit 066a3d3f by 莫晓莉

保存databases稳定获取画布

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