Commit d5bf3460 by 李耀锟

解决冲突

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