Commit 387c3363 authored by kangzhenfei's avatar kangzhenfei

saas--数据源配置

parent 47749de4
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="datadetailModal" title="数据源配置" footer-hide width='830'> <Modal v-model="datadetailModal" title="数据源配置" footer-hide width='830'>
<dataDetail :elid="datacurId" /> <dataDetail ref='dataDetail' @set-ok="setSqlOk" :elid="datacurId" />
</Modal> </Modal>
<Modal v-model="setModal" title="套餐配置" footer-hide width='830'> <Modal v-model="setModal" title="套餐配置" footer-hide width='830'>
<menuSet :companyId="curId" @set-ok="setOk"/> <menuSet :companyId="curId" @set-ok="setOk"/>
...@@ -342,9 +342,15 @@ export default { ...@@ -342,9 +342,15 @@ export default {
this.curId=id this.curId=id
}, },
datadetail(id) { datadetail(id) {
this.$refs.dataDetail.list = []
this.datadetailModal = true this.datadetailModal = true
this.datacurId = id this.datacurId = id
}, },
setSqlOk(){
this.$refs.grid.load()
this.datadetailModal = false
this.datacurId = 0
},
setAps(id){ setAps(id){
this.aps=[] this.aps=[]
this.disabled=false this.disabled=false
......
<template> <template>
<div> <div>
<div class="fr pb5"> <p class="tr pb5">
<Button type="primary" @click="set()" :disabled="disabled">保存</Button> <Button type="primary" @click="set()" :disabled="disabled">保存</Button>
</div> </p>
<DataGrid <DataGrid
:columns="columns" :columns="columns"
ref="grid" ref="grid"
......
<template> <template>
<div> <div>
<p class="tr pb5"> <p class="tr pb5">
<Button type="primary" @click="setSql()" :disabled="disabled">11</Button> <Button type="primary" @click="setSql()" :disabled="disabled">保存</Button>
</p> </p>
<DataGrid <DataGrid
:columns="columns" :columns="columns"
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
:tool="false" :tool="false"
:height="400" :height="400"
:page="false" :page="false"
:batch="false" @on-selection-change="selectInfo"
></DataGrid> ></DataGrid>
<!-- <Modal v-model="detailModal" title="详情"> <!-- <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> --> </Modal>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -41,45 +42,20 @@ export default { ...@@ -41,45 +42,20 @@ export default {
list: [], list: [],
curId: 0, curId: 0,
currentChoose: 0, currentChoose: 0,
selecIds:[],
columns: [ columns: [
{ {
key: "id", type: "selection",
title: "", // key:'_checked',
width: 70, width: 60,
align: "center", align: "center"
render: (h, params) => {
let self = this;
let id = params.row.id;
// let cid=params.row.checkedId
let flag = false;
if (self.currentChoose === id) {
flag = true;
} else {
flag = false;
}
return h("div", [
h("Checkbox", {
props: {
value: flag
},
on: {
"on-change": () => {
// var ra=
self.currentChoose = id;
}
}
})
]);
}
}, },
{ {
key: "hostName", key: "hostName",
title: this.l("hostName"), title: this.l("hostName"),
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true
}, },
// { key:"remark",title:this.l("remark") ,align:"left" ,easy:true ,high:true }, // { key:"remark",title:this.l("remark") ,align:"left" ,easy:true ,high:true },
{ {
...@@ -87,7 +63,7 @@ export default { ...@@ -87,7 +63,7 @@ export default {
title: this.l("ip"), title: this.l("ip"),
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140
// code: "crm.customer.status" // code: "crm.customer.status"
}, },
{ {
...@@ -107,7 +83,7 @@ export default { ...@@ -107,7 +83,7 @@ export default {
title: this.l("port"), title: this.l("port"),
align: "center", align: "center",
width: 80 width: 80
}, }
// { // {
// title: "操作", // title: "操作",
// key: "id", // key: "id",
...@@ -140,15 +116,15 @@ export default { ...@@ -140,15 +116,15 @@ export default {
methods: { methods: {
//保存公司的数据源 //保存公司的数据源
setSql() { setSql() {
// console.log(this.currentChoose)
if (this.currentChoose == 0) {
return;
}
let id = this.elid; let id = this.elid;
var a = {}; var params = {
(a.tenantId = id), (a.dbSourceIdList = this.currentChoose); tenantId:this.elid,
dbSourceIdList:this.selecIds
};
// ( = id), (a.dbSourceIdList = );
console.log(params)
this.disabled = true; this.disabled = true;
Api.setMenuSql(a).then(r => { Api.setMenuSql(params).then(r => {
if (r.success) { if (r.success) {
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.currentChoose = 0; this.currentChoose = 0;
...@@ -165,23 +141,33 @@ export default { ...@@ -165,23 +141,33 @@ export default {
this.curId = id; this.curId = id;
}, },
getAll() { getAll() {
// debugger
let params = { let params = {
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
conditions: [], conditions: [],
type: this.elid tenantId: this.elid
}; };
this.currentChoose = 0;
Api.pagedSql(params).then(r => { Api.pagedSql(params).then(r => {
// console.log(r);
this.list = r.result; this.list = r.result;
r.result.forEach(data => { this.list.forEach(data => {
if (data.id == data.checkedId) { if (data.tenantId>0) {
this.currentChoose = data.id; data._checked = true
this.selecIds.push(data.id);
}else{
data._checked = false
} }
}); });
}); });
}, },
selectInfo(itemRow) {
this.selecIds = [];
let selecArry = itemRow
selecArry.map(item=>{
this.selecIds.push(item.id);
})
console.log('选中:',this.selecIds)
},
l(key) { l(key) {
/* /*
databases:{ databases:{
......
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