Commit 4670659f authored by kangzhenfei's avatar kangzhenfei

saas--数据源管理

parent c47a7dea
......@@ -1002,6 +1002,7 @@ export default {
id: '',
hostName: '主机名称',
hostId: '数据源ID',
hostsq: '数据库类型',
port: '端口',
userName: '用户名',
password: '密码',
......
......@@ -3,12 +3,15 @@
<Row>
<Col :span="24">
<FormItem :label="l('hostName')" prop="hostName">
<Input v-model="entity.hostName"></Input>
<Select @on-change="onchange_host" v-model="entity.hostId">
<Option v-for="(item,index) in hostlist" :key="index" :value="item.id">{{item.name}}</Option>
</Select>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('hostId')" prop="hostId">
<Dictionary v-model="entity.hostId"></Dictionary>
<FormItem :label="l('hostsq')" prop="hostId">
<Input v-model="entity.hostId"></Input>
<!-- <Dictionary v-model="entity.hostId"></Dictionary> -->
</FormItem>
</Col>
<Col :span="24">
......@@ -42,13 +45,26 @@ export default {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
hostName: [{ required: true, message: "必填", trigger: "blur" }]
},
hostlist: [],
};
},
props: {
v: Object
},
mounted() {
Api.bindhostlist()
.then((r) => {
if (r.success) {
this.hostlist = r.result
} else {
}
})
.catch((err) => {
console.warn(err)
})
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
......@@ -71,6 +87,9 @@ export default {
});
}
});
},
onchange_host(val) {
this.entity.hostId = val
},
handleClose() {
this.$emit("on-close");
......
......@@ -4,6 +4,9 @@ export default {
paged(params){
return Api.post(`${systemNew}/datasource/paged`,params);
},
bindhostlist() {
return Api.post(`${systemNew}/host/list`, {});
},
get(params){
return Api.get(`${systemNew}/datasource/get`,params);
},
......
......@@ -2,6 +2,7 @@
<div class="detail">
<Row>
<Filed :span="24" :name="l('hostName')">{{entity.hostName}}</Filed>
<Filed :span="24" :name="l('hostsq')">{{entity.hostName}}</Filed>
<Filed :span="24" :name="l('port')">{{entity.port}}</Filed>
<Filed :span="24" :name="l('userName')">{{entity.userName}}</Filed>
<Filed :span="24" :name="l('password')">{{entity.password}}</Filed>
......
......@@ -3,12 +3,15 @@
<Row>
<Col :span="24">
<FormItem :label="l('hostName')" prop="hostName">
<Input v-model="entity.hostName"></Input>
<Select @on-change="onchange_host" v-model="entity.hostId">
<Option v-for="(item,index) in hostlist" :key="index" :value="item.id">{{item.name}}</Option>
</Select>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('hostId')" prop="hostId">
<Dictionary v-model="entity.hostId"></Dictionary>
<FormItem :label="l('hostsq')" prop="hostId">
<Input v-model="entity.hostId"></Input>
<!-- <Dictionary v-model="entity.hostId"></Dictionary> -->
</FormItem>
</Col>
<Col :span="24">
......@@ -43,12 +46,25 @@ export default {
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
},
hostlist: [],
};
},
props: {
eid: Number
},
mounted() {
Api.bindhostlist()
.then((r) => {
if (r.success) {
this.hostlist = r.result
} else {
}
})
.catch((err) => {
console.warn(err)
})
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
......
......@@ -60,7 +60,8 @@ export default {
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{ key: 'hostName', title: this.l('hostName'), align: 'left', high: true },
{ key: 'hostId', title: this.l('hostId'), align: 'left', high: true },
{ key: 'hostId', title: this.l('hostsq'), align: 'left', high: true },
// { key: 'hostId', title: this.l('hostId'), align: 'left', high: true },
{ key: 'port', title: this.l('port'), align: 'left', high: true },
{
key: 'userName',
......
......@@ -19,7 +19,6 @@ export default {
},
bindhostlist() {
return Api.post(`${systemNew}/host/list`, {});
},
tanantinit(params) {
......
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