Commit d5bf3460 by 李耀琨

解决冲突

parents 3754814b 23bdee92
...@@ -26,23 +26,23 @@ ...@@ -26,23 +26,23 @@
</el-col> </el-col>
<el-col class="line" :span="3"> <el-col class="line" :span="3">
<el-button size="mini" @click.native="scanTree">浏览</el-button></el-col <el-button size="mini" @click.native="scanTree('模式')">浏览</el-button></el-col
> >
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="目标表:"> <el-form-item label="目标表:" prop="text">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="20"> <el-col :span="20">
<el-input v-model="form.name"></el-input> <el-input ref="goal" v-model="newForm.text"></el-input>
</el-col> </el-col>
<el-col class="line" :span="3"> <el-col class="line" :span="3">
<el-button size="mini" @click.native="scanTree">浏览</el-button></el-col <el-button size="mini" @click.native="scanTree('表')">浏览</el-button></el-col
> >
</el-row> </el-row>
</el-form-item> </el-form-item>
<estab-dialog ref="establishDia" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames"></estab-dialog> <estab-dialog ref="establishDia" :form="newForm" :dialogVisibleFourth.sync='dialogVisibleFourth' @getSonValue="getSonValue" :listNames="listNames" :chooseFlag.sync="chooseFlag" :chooseType="chooseType"></estab-dialog>
</div> </div>
</template> </template>
...@@ -51,16 +51,7 @@ ...@@ -51,16 +51,7 @@
// import { exptree,expRespository,download } from "@/api/kettle/file"; // import { exptree,expRespository,download } from "@/api/kettle/file";
import { import {
types,
getLinkList,
accessMethod,//获取连接方式列表
accessData,//获取连接类型
create,
listNames,//获取已经创建的数据库列表 listNames,//获取已经创建的数据库列表
database,//编辑数据库信息
check,//编辑数据库
loginRepository,//连接数据库
addRepository,//资源库信息
} from "@/api/kettle/link"; } from "@/api/kettle/link";
export default { export default {
...@@ -71,7 +62,10 @@ export default { ...@@ -71,7 +62,10 @@ export default {
namesList:[], namesList:[],
selectName:'',//当前选中的下拉框的数据 selectName:'',//当前选中的下拉框的数据
dataBaseName:'', dataBaseName:'',
curNode:[] curNode:[],
chooseFlag:false,//选择模式
newForm:{},
chooseType:'模式'
} }
}, },
...@@ -80,25 +74,32 @@ export default { ...@@ -80,25 +74,32 @@ export default {
}, },
created() { created() {
this.listNames(); this.listNames();
this.newForm = this.form
}, },
methods: { methods: {
//获取新建弹窗返回来的值 //获取新建弹窗返回来的值
getSonValue(res){ getSonValue(res){
if(typeof(res)=='object'){ if(typeof(res)=='string'){
this.dataBaseName=res.name this.dataBaseName=res
console.log('接收子组件的值1111111----',this.dataBaseName); console.log('接收子组件的值1111111----',this.dataBaseName);
}else if(res instanceof Array){ }else if(typeof(res)=='object'){
console.log('接收子组件的值55555----',this.dataBaseName); console.log('接收子组件的值55555----',res);
this.curNode=res; this.curNode=res;
// DOM 更新后
// this.$nextTick(() => {
// this.form.text=this.curNode.data.text;
// // this.$refs.goal.values=this.curNode.data.text;
// // this.$refs.goal.refreshData(this.from)
// })
this.$set(this.newForm,'text',this.curNode.data.text)
this.$forceUpdate()
// this.form.text=this.curNode.data.text;
console.log('chuanhuo=====', this.newForm);
}else if(typeof(res)=='boolean'){ }else if(typeof(res)=='boolean'){
this.dialogVisibleFourth=res; this.dialogVisibleFourth=res;
console.log('接收子组件的值2222222----',this.dialogVisibleFourth); console.log('接收子组件的值2222222----',this.dialogVisibleFourth);
} }
// this.dataBaseName=res[0];
// this.dialogVisibleFourth=[1];
console.log('接收子组件的值----',res,typeof(res));
}, },
//查询已经建立的所有数据库列表 //查询已经建立的所有数据库列表
listNames(){ listNames(){
...@@ -136,13 +137,14 @@ export default { ...@@ -136,13 +137,14 @@ export default {
this.$refs.establishDia.accessMethod();//获取连接方式 this.$refs.establishDia.accessMethod();//获取连接方式
}, },
//浏览 //浏览
scanTree(){ scanTree(type){
if(this.selectName){ if(this.selectName){
this.$refs.establishDia.database(this.selectName); this.$refs.establishDia.database(this.selectName);
console.log('当前选中数据库***************',this.dataBaseName); console.log('当前选中数据库***************',this.dataBaseName);
if(this.dataBaseName){ if(this.dataBaseName){
this.$refs.establishDia.scanDialogOpen(); this.$refs.establishDia.scanDialogOpen();
this.chooseFlag=true;
this.chooseType=type;
} }
}else{ }else{
this.$message.error('请选择数据库') this.$message.error('请选择数据库')
...@@ -158,10 +160,15 @@ export default { ...@@ -158,10 +160,15 @@ export default {
console.log('obj changed'); console.log('obj changed');
if(newValue){ if(newValue){
this.$refs.establishDia.scanDialogOpen(); this.$refs.establishDia.scanDialogOpen();
this.chooseFlag=true;
} }
}, },
deep: true deep: true
} },
// form(newValue, oldValue){
// this.form=newValue;
// }
}, },
}; };
......
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
<!-- 文件夹存放区域end --> <!-- 文件夹存放区域end -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <el-button @click="handleClose">取 消</el-button> --> <!-- <el-button @click="handleClose">取 消</el-button> -->
<el-button type="primary" @click="handleCloseScan">确 定</el-button> <el-button type="primary" @click="handleCloseScanOK">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -360,6 +360,7 @@ export default { ...@@ -360,6 +360,7 @@ export default {
name: "estab-dialog", name: "estab-dialog",
data() { data() {
return { return {
curChooseNode:null,//当前选择的节点
checkModel:[], checkModel:[],
linkType: [ linkType: [
{ value: 0, text: "一般" }, { value: 0, text: "一般" },
...@@ -426,6 +427,15 @@ export default { ...@@ -426,6 +427,15 @@ export default {
props: { props: {
dialogVisibleFourth: Boolean, dialogVisibleFourth: Boolean,
listNames: Function, //父传过来的方法 listNames: Function, //父传过来的方法
chooseFlag:Boolean,//选择判断
form:Object,
chooseType:String,
},
watch:{
form(n,o){
console.log('值变化',n,o)
}
}, },
created() { created() {
this.accessData(); this.accessData();
...@@ -820,20 +830,59 @@ export default { ...@@ -820,20 +830,59 @@ export default {
handleNodeClick(data,node){ handleNodeClick(data,node){
console.log('点击当前节点node===',node); console.log('点击当前节点node===',node);
console.log('点击当前节点data===',data); console.log('点击当前节点data===',data);
var arr=[{node:node}] // var arr=[{node:node}]
this.$emit("getSonValue", arr); //组件要传回父组件的值,关闭弹窗 this.curChooseNode=node;
// this.$emit("getSonValue", this.curChooseNode); //组件要传回父组件的值,关闭弹窗
// this.nodePath=data.path;//当前选择数 // this.nodePath=data.path;//当前选择数
// this.curNodeIconCls=data.iconCls;//当前选中节点 // this.curNodeIconCls=data.iconCls;//当前选中节点
// console.log('当前节点的文件夹路径:',this.nodePath); // console.log('当前节点的文件夹路径:',this.nodePath);
// console.log(data,'当前节点的父节点:',node.parent.data); // console.log(data,'当前节点的父节点:',node.parent.data);
}, },
handleCloseScan() {
this.scanDialogVisible = false;
this.scanFlag = false;
this.scanfileTreeList = [];
this.nodeId = "";
this.text = "root";
this.node = "xnode-4528";
this.$emit("getSonValue", this.curChooseNode);
this.$emit("update:chooseFlag", false);
},
handleCloseScan() { handleCloseScanOK() {
this.scanDialogVisible = false; if(this.chooseFlag){
this.scanFlag = false; if(!this.curChooseNode){
this.scanfileTreeList = []; this.$message.error('请选择节点!');
(this.nodeId = ""), (this.text = "root"), (this.node = "xnode-4528"); return;
}else{
if(this.curChooseNode.data){
if(!this.curChooseNode.data.leaf) {
this.$message.error('请选择有效节点!');
return;
}
}
console.log('有效类型变量==========',this.chooseType);
if(this.curChooseNode.parent.data.text !=this.chooseType){
this.$message.error('请选择'+this.chooseType+'下的有效节点!');
return;
}
}
}
this.scanDialogVisible = false;
this.scanFlag = false;
this.scanfileTreeList = [];
this.nodeId = "";
this.text = "root";
this.node = "xnode-4528";
this.$emit("getSonValue", this.curChooseNode);
this.$emit("update:chooseFlag", false);
}, },
}, },
......
...@@ -811,7 +811,9 @@ export default { ...@@ -811,7 +811,9 @@ export default {
}, },
//获取新建弹窗返回来的值 //获取新建弹窗返回来的值
getSonValue(res){ getSonValue(res){
if(typeof(res)=='boolean'){
this.dialogVisibleFourth=res; this.dialogVisibleFourth=res;
}
this.linkCheckedIdx=this.initlinkTypeIdx;//关闭弹窗后初始化选择oracle数据 this.linkCheckedIdx=this.initlinkTypeIdx;//关闭弹窗后初始化选择oracle数据
this.methodHoverIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条 this.methodHoverIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条
this.methodCheckedIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条 this.methodCheckedIdx=0;//关闭弹窗后初始化选择oracle数据对应第一条
......
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