Commit 387c3363 authored by kangzhenfei's avatar kangzhenfei

saas--数据源配置

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