Commit e9238d4f by 李耀琨

连接获取节点

parent 5a14ffb7
ENV = 'development' ENV = 'development'
#VUE_APP_BASE_API = 'http://192.168.0.2:9888/' VUE_APP_BASE_API = 'http://192.168.0.2:9888/'
#VUE_APP_WS_API = 'ws://192.168.0.2:9888/' VUE_APP_WS_API = 'ws://192.168.0.2:9888/'
VUE_APP_BASE_API = 'http://192.168.0.44:9882/' #VUE_APP_BASE_API = 'http://192.168.0.44:9882/'
VUE_APP_WS_API = 'ws://192.168.0.44:9882/' #VUE_APP_WS_API = 'ws://192.168.0.44:9882/'
......
...@@ -212,6 +212,27 @@ export function randomValueFunc(data){ ...@@ -212,6 +212,27 @@ export function randomValueFunc(data){
//数据库表路径
export function explorer(data){
return request({
url: 'etlweb/database/explorer',
data,
method: 'post'
})
}
//获取数据库信息
export function listDatabases(data){
return request({
url: 'etlweb/database/listDatabases',
data,
method: 'post'
})
}
import Vue from 'vue'
export default new Vue;
\ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<script> <script>
import { systemDataTypes } from "@/api/kettle/link"; import { systemDataTypes } from "@/api/kettle/link";
export default { export default {
props: ["information"], props: [],
data() { data() {
return { return {
form: {}, form: {},
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
}) })
.catch((_) => {}); .catch((_) => {});
}, },
handleClick(val) { handleClick(val) {
this.addField = !this.addField; this.addField = !this.addField;
this.form = val; this.form = val;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-form-item> <el-form-item>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="13"> <el-col :span="13">
<el-select v-model="form.type" style="width: 100%"> <el-select v-model="form.connection" style="width: 100%" @change="getField(form.connection)">
<el-option <el-option
v-for="item in ComboBox" v-for="item in ComboBox"
:key="item.id" :key="item.id"
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
<el-button size="mini">编辑</el-button></el-col <el-button size="mini">编辑</el-button></el-col
> >
<el-col class="line" :span="2"> <el-col class="line" :span="2">
<el-button size="mini">新建</el-button></el-col <el-button size="mini" >新建</el-button></el-col
> >
<el-col class="line" :span="2"> <el-col class="line" :span="2">
<el-button size="mini">向导</el-button></el-col <el-button size="mini">向导</el-button></el-col
> >
<el-col class="line" :span="5"> <el-col class="line" :span="5">
<el-button size="mini">获取SQL查询语句</el-button></el-col <el-button size="mini" @click="SQLPopup">获取SQL查询语句</el-button></el-col
> >
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -35,47 +35,71 @@ ...@@ -35,47 +35,71 @@
<el-form ref="form" :model="form" label-width="160px"> <el-form ref="form" :model="form" label-width="160px">
<el-form-item label="允许简易转换:"> <el-form-item label="允许简易转换:">
<el-checkbox v-model="form.wLazyConversion"></el-checkbox> <el-checkbox v-model="form.lazy_conversion_active"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="替换SQL语句里的变量:"> <el-form-item label="替换SQL语句里的变量:">
<el-checkbox v-model="form.wVariables"></el-checkbox> <el-checkbox v-model="form.variables_active"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="从步骤插入数据:"> <el-form-item label="从步骤插入数据:">
<el-select v-model="form.space" style="width: 100%"> <el-select v-model="form.lookup" style="width: 100%">
<el-option label="不去掉空格" value="none"></el-option> <el-option v-for="item in connectionNode"
<el-option label="去掉左空格" value="left"></el-option> :key="item.id"
<el-option label="去掉右空格" value="right"></el-option> :label="item.name"
<el-option label="去掉左右两端空格" value="both"></el-option> :value="item.name"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="执行每一行:"> <el-form-item label="执行每一行:">
<el-checkbox v-model="form.wEachRow"></el-checkbox> <el-checkbox v-model="form.execute_each_row"></el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="记录数量限制:"> <el-form-item label="记录数量限制:">
<el-input v-model="form.currency"></el-input> <el-input v-model="form.limit"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-dialog
title="数据库浏览"
:visible.sync="browsing"
width="500px"
:before-close="handleClose"
:modal="false"
>
<span slot="footer" class="dialog-footer">
<el-button @click="browsing = false">取 消</el-button>
<el-button type="primary" @click="browsing = false">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listNames } from "@/api/kettle/link"; import { listNames,explorer,listDatabases } from "@/api/kettle/link";
export default { export default {
props: ["table"], props: ["connectionNode"],//从父组件传过来的值
data() { data() {
return { return {
browsing:false,
form: { form: {
wLazyConversion:false, wLazyConversion:false,
wVariables:false, wVariables:false,
wEachRow:false, wEachRow:false,
}, },
ComboBox: {}, ComboBox: {},
libraryName:[],
}; };
}, },
...@@ -84,12 +108,44 @@ export default { ...@@ -84,12 +108,44 @@ export default {
}, },
methods: { methods: {
getField(val){
console.log(val);
listDatabases({name:val}).then(res=>{
console.log(res);
})
// this.libraryName = val
},
SQLPopup(){
if (this.form.connection) {
this.browsing = !this.browsing
explorer({databaseInfo:{name:this.libraryName}}).then(res=>{
console.log(res);
})
}else{
this.$message.error("请选择数据库");
}
},
handleClose(done) {
this.browsing = !this.browsing
// this.$confirm("确认关闭?")
// .then((_) => {
// done();
// })
// .catch((_) => {});
},
listNamesFun() { listNamesFun() {
let pamer = new FormData(); // 创建form对象 let pamer = new FormData(); // 创建form对象
pamer.append("query", ""); pamer.append("query", "");
listNames(pamer).then((res) => { listNames(pamer).then((res) => {
this.ComboBox = res; this.ComboBox = res;
}); });
console.log(this.connectionNode);
}, },
}, },
}; };
......
...@@ -520,6 +520,7 @@ import { ...@@ -520,6 +520,7 @@ import {
export default { export default {
components: { components: {
FlowDesigner, FlowDesigner,
...@@ -792,13 +793,23 @@ export default { ...@@ -792,13 +793,23 @@ export default {
}; };
}, },
mounted () { mounted () {
this.dragControllerDiv();//左右窗体调整宽度 this.dragControllerDiv();//左右窗体调整宽度
// this.treeRevert(this.jobTreeList); // this.treeRevert(this.jobTreeList);
this.accessData();//页面一加载就获取连接类型 this.accessData();//页面一加载就获取连接类型
this.explorer('');//获取文件夹列表 this.explorer('');//获取文件夹列表
},
},
methods: { methods: {
//文件夹列表 //文件夹列表
explorer(path){ explorer(path){
var formData = new FormData(); var formData = new FormData();
......
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