Commit 7a0eddb2 authored by kangzhenfei's avatar kangzhenfei

saas--数据管理

parent 94f6d8cc
......@@ -966,6 +966,7 @@ export default {
databaseTypeName: "数据库类型",
databaseName: "数据库",
databaseType: "数据字典主键",
displayName: "用途",
port: "端口",
tenantId: 0,
},
......
......@@ -3,23 +3,23 @@
<Row>
<Col :span="24">
<FormItem :label="l('hostName')" prop="hostName">
<!-- @on-change="onchange_host" -->
<Select v-model="entity.hostId">
<Option v-for="(item,index) in hostlist" :key="index" :value="item.id">{{item.name}}</Option>
</Select>
<!-- @on-change="onchange_host" -->
<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('hostsq')" prop="hostId">
<!-- <Input v-model="entity.hostId"></Input> -->
<Dictionary code="datasource.type" v-model="entity.id" type="select"></Dictionary>
<!-- <Input v-model="entity.hostId"></Input> -->
<Dictionary code="datasource.type" v-model="entity.id" type="select"></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="24">
<FormItem :label="l('port')" prop="port">
<InputNumber v-model="entity.port"></InputNumber>
</FormItem>
</Col> -->
</Col>-->
<Col :span="24">
<FormItem :label="l('userName')" prop="userName">
<Input v-model="entity.userName"></Input>
......@@ -45,15 +45,14 @@ export default {
return {
disabled: false,
entity: {
id: null,
id: null
},
rules: {
// hostName: [{ required: true, message: "必选", type:"number",trigger: "change" }],
// hostName: [{ required: true, message: '单位不能为空', trigger: 'change',type: 'number' }],
// hostId:[{ required: true, message: "必选", type: "number",trigger: "change" }],
},
hostlist: [],
hostlist: []
};
},
props: {
......@@ -61,17 +60,17 @@ export default {
},
mounted() {
Api.bindhostlist()
.then((r) => {
console.log(r)
.then(r => {
console.log(r);
if (r.success) {
this.hostlist = r.result
this.hostlist = r.result;
} else {
}
// this.hostlist.map(u=>{u.id = u.id+''})
})
.catch((err) => {
console.warn(err)
})
.catch(err => {
console.warn(err);
});
},
methods: {
handleSubmit() {
......@@ -97,9 +96,12 @@ export default {
});
},
onchange_host(val) {
// console.log(val)
console.log(typeof(val))
this.entity.id = val
console.log(val);
this.hostlist.map(u => {
if(u.id == val){
this.entity.hostName = u.name
}
});
},
handleClose() {
this.$emit("on-close");
......
......@@ -72,6 +72,12 @@ export default {
align: "center",
width: 140
},
{
key: "displayName",
title: this.l("displayName"),
align: "center",
width: 100
},
{
key: "databaseName",
title: this.l("databaseName"),
......
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