Commit f78ed2db by 莫晓莉

数据库回显

parent f25b3caa
......@@ -4,17 +4,11 @@
<el-row :gutter="10">
<el-col :span="14">
<!-- <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="form.connection" placeholder="请选择选择数据库连接" @focus="getGraphDataBases">
<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" @change="selectNameFunc">
<el-option v-for="(item,index) in namesList" :key="index" :label="item.name" :value="item"></el-option>
</el-select> -->
</el-col>
<el-col class="line" :span="3">
<el-button size="mini" @click.native="editDataBaseModal()">编辑</el-button></el-col
......@@ -30,7 +24,7 @@
<el-form-item label="目的模式:" >
<el-row :gutter="10">
<el-col :span="20">
<el-input v-model="newForm.schema"></el-input>
<el-input v-model="form.schema"></el-input>
</el-col>
<el-col class="line" :span="3">
......@@ -41,7 +35,7 @@
<el-form-item label="目标表:" prop="text">
<el-row :gutter="10">
<el-col :span="20">
<el-input ref="goal" v-model="newForm.table"></el-input>
<el-input ref="goal" v-model="form.table"></el-input>
</el-col>
<el-col class="line" :span="3">
......@@ -50,7 +44,7 @@
</el-row>
</el-form-item>
<estab-dialog ref="establishDia" :noneRespository="noneRespository" :graph.sync="newGraph" :getXmlVal="getXmlVal" :form="newForm" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames" :chooseFlag.sync="chooseFlag" :chooseType="chooseType"></estab-dialog>
<estab-dialog ref="establishDia" :noneRespository="noneRespository" :graph.sync="newGraph" :getXmlVal="getXmlVal" :form="form" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames" :chooseFlag.sync="chooseFlag" :chooseType="chooseType"></estab-dialog>
</div>
</template>
......@@ -83,11 +77,11 @@ export default {
noneRespository:1,//判断是保存画布还是传后台
dialogVisibleFourth:false,
namesList:[],
selectName:'',//当前选中的下拉框的数据
// selectName:'',//当前选中的下拉框的数据
connectionName:'',
curNode:[],
chooseFlag:false,//选择模式
newForm:{},
// newForm:{},
chooseType:'',
newGraph:{}
}
......@@ -102,7 +96,7 @@ export default {
props:["form","getXmlVal","graph"],
created() {
this.listNames();
this.newForm = this.form
// this.newForm = this.form
},
methods: {
clickFun(graph){
......@@ -120,21 +114,21 @@ export default {
// this.$refs.goal.refreshData(this.from)
if(this.chooseType=='表'){
console.log('进入表----',res);
this.$set(this.newForm,'table',this.curNode.data.text);
this.$set(this.form,'table',this.curNode.data.text);
this.$forceUpdate()
}
console.log('this.curNode.data.leaf=====:',this.curNode.data.leaf);
if(this.chooseType=='模式'&& this.curNode.data.leaf && this.curNode.parent.data.text ==this.chooseType){
console.log('进入模式----',res);
this.$set(this.newForm,'schema',this.curNode.data.text);
this.$set(this.form,'schema',this.curNode.data.text);
this.$forceUpdate()
}
// this.$forceUpdate()
console.log('chuanhuo=====', this.newForm);
console.log('chuanhuo=====', this.form);
// 发射回父组件
this.newForm.connection=this.selectName;
this.$emit("update:form", this.newForm);
this.form.connection=this.form.connection;
this.$emit("update:form", this.form);
}else if(typeof(res)=='boolean'){
this.dialogVisibleFourth=res;
......@@ -168,9 +162,9 @@ export default {
//选择数据库编辑
selectNameFunc(e){
console.log('当前选中的数',e);
console.log('当前选中的数-===',this.selectName);
this.selectName=this.se
this.newForm.connection=this.selectName;
console.log('当前选中的数-===',this.form.connection);
// this.selectName=this.se
// this.form.connection=this.form.connection;
},
//点击选择获取已经创建的数据库列表
clickFunc(){
......@@ -180,20 +174,20 @@ export default {
editDataBaseModal(){
// this.$refs.establishDia.clickFun(this.newGraph);//先传画布
this.$refs.establishDia.clickFun(this.graph);//先把画布传过去
if(this.selectName){
if(this.form.connection){
this.dialogVisibleFourth=true;
}
// this.$refs.establishDia.database(this.selectName);
this.$refs.establishDia.getTransDatabase(this.selectName);
this.$refs.establishDia.getTransDatabase(this.form.connection);
this.$refs.establishDia.accessMethod();//获取连接方式
},
//浏览
scanTree(type){
console.log('当前选中链接***************',this.selectName);
console.log('当前选中链接***************',this.form.selectName);
this.chooseType=type;
if(this.selectName){
if(this.form.connection){
// this.$refs.establishDia.database(this.selectName);
this.$refs.establishDia.getTransDatabase(this.selectName);
this.$refs.establishDia.getTransDatabase(this.form.connection);
console.log('当前选中数据库***************',this.connectionName);
if(this.connectionName){//判断后台有数据发射回来后再调用弹窗不然不显示树数据或者加载数据延迟
this.$refs.establishDia.scanDialogOpen();
......
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