Commit 47749de4 authored by kangzhenfei's avatar kangzhenfei

saas优化

parent d265c609
...@@ -198,19 +198,23 @@ export default { ...@@ -198,19 +198,23 @@ export default {
let model = { let model = {
id: id id: id
}; };
return Api.post(`${systemUrl}/user/AccountReset`, model); // return Api.post(`${systemUrl}/user/AccountReset`, model);
return Api.post(`${system}/account/AccountReset`, model);
}, },
//根据id获取用户详情 //根据id获取用户详情
getuserinfo(params) { getuserinfo(params) {
return Api.get(`${systemUrl}/user/getuserinfo`,params); // return Api.get(`${systemUrl}/user/getuserinfo`,params);
return Api.get(`${system}/account/getuserinfo`,params);
}, },
//修改用户头像 //修改用户头像
changeavatar(params) { changeavatar(params) {
return Api.post(`${systemUrl}/user/changeavatar`, params, true); // return Api.post(`${systemUrl}/user/changeavatar`, params, true);
return Api.post(`${system}/account/changeavatar`, params, true);
}, },
//根据id获取用户详情 //根据id获取用户详情
getusermenuOld() { getusermenuOld() {
return Api.get(`${systemUrl}/usermenu/getusermenu`); // return Api.get(`${systemUrl}/usermenu/getusermenu`);
return Api.get(`${system}/usermenu/getusermenu`);
}, },
getFile(params) getFile(params)
{ {
......
...@@ -932,7 +932,7 @@ export default { ...@@ -932,7 +932,7 @@ export default {
startTime: '服务开始时间', startTime: '服务开始时间',
endTime: '服务结束时间', endTime: '服务结束时间',
initialized: '是否已初始化', initialized: '是否已初始化',
dataSourceId: '数据源', dataSourceId: '数据源配置 ',
creationTime: '创建时间', creationTime: '创建时间',
creatorUserId: '创建人', creatorUserId: '创建人',
lastModificationTime: '更新时间', lastModificationTime: '更新时间',
...@@ -960,6 +960,15 @@ export default { ...@@ -960,6 +960,15 @@ export default {
lastLoginTime:'最后登录时间', lastLoginTime:'最后登录时间',
loginTimes:'累计登录次数', loginTimes:'累计登录次数',
}, },
databases:{
hostName: "主机",
ip: "IP",
databaseTypeName: "数据库类型",
databaseName: "数据库",
databaseType: "数据字典主键",
port: "端口",
tenantId: 0,
},
//多租户-套餐管理 //多租户-套餐管理
set_menu:{ set_menu:{
id:'', id:'',
......
...@@ -69,7 +69,8 @@ export default { ...@@ -69,7 +69,8 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
var url2 = `${systemUrl}/Dictionary/createorupdate` // var url2 = `${systemUrl}/Dictionary/createorupdate`
var url2 = `${system}/Dictionary/createorupdate`
this.$api.post(url2, { Dictionary: this.entity }).then((r) => { this.$api.post(url2, { Dictionary: this.entity }).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success('保存成功')
......
...@@ -16,17 +16,20 @@ ...@@ -16,17 +16,20 @@
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('port')" prop="port"> <FormItem :label="l('port')" prop="port">
<InputNumber v-model="entity.port"></InputNumber> <!-- <InputNumber v-model="entity.port"></InputNumber> -->
<span>{{entity.port}}</span>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('userName')" prop="userName"> <FormItem :label="l('userName')" prop="userName">
<Input v-model="entity.userName"></Input> <!-- <Input v-model="entity.userName"></Input> -->
<span>{{entity.userName}}</span>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('password')" prop="password"> <FormItem :label="l('password')" prop="password">
<Input v-model="entity.password"></Input> <!-- <Input v-model="entity.password"></Input> -->
<span>{{entity.password}}</span>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -69,7 +69,8 @@ export default { ...@@ -69,7 +69,8 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
var url2 = `${systemUrl}/Dictionary/createorupdate` // var url2 = `${systemUrl}/Dictionary/createorupdate`
var url2 = `${system}/Dictionary/createorupdate`
this.$api.post(url2, { Dictionary: this.entity }).then((r) => { this.$api.post(url2, { Dictionary: this.entity }).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success('保存成功') this.$Message.success('保存成功')
......
...@@ -4,6 +4,12 @@ export default { ...@@ -4,6 +4,12 @@ export default {
paged(params){ paged(params){
return Api.post(`${system}/setmenu/paged`,params); return Api.post(`${system}/setmenu/paged`,params);
}, },
pagedSql(params) {
return Api.get(`${system}/tenant/gettenantdatabases`, params);
},
setMenuSql(params) {
return Api.post(`${system}/tenant/configdatasource`,params );
},
get(params){ get(params){
return Api.get(`${system}/setmenu/get`,params); return Api.get(`${system}/setmenu/get`,params);
}, },
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<Modal v-model="detailModal" title="详情"> <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="datadetailModal" title="数据源详情"> <Modal v-model="datadetailModal" title="数据源配置" footer-hide width='830'>
<dataDetail :eid="datacurId" /> <dataDetail :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"/>
...@@ -57,7 +57,7 @@ import Add from './add' ...@@ -57,7 +57,7 @@ import Add from './add'
import Edit from './edit' import Edit from './edit'
import Detail from './detail' import Detail from './detail'
import Search from './search' import Search from './search'
import dataDetail from '../data_source/detail' import dataDetail from './setdetail'
import menuSet from './menuset' import menuSet from './menuset'
export default { export default {
name: 'list', name: 'list',
...@@ -116,38 +116,40 @@ export default { ...@@ -116,38 +116,40 @@ export default {
high: true high: true
}, },
{ key: 'endTime', title: this.l('endTime'), align: 'left', high: true }, { key: 'endTime', title: this.l('endTime'), align: 'left', high: true },
{ // {
key: 'initialized', // key: 'initialized',
title: this.l('initialized'), // title: this.l('initialized'),
align: 'left', // align: 'left',
high: true, // high: true,
code: 'system.Tanant.init' // code: 'system.Tanant.init'
}, // },
{ {
key: 'hostTitle', key: 'hostTitle',
title: this.l('hostId'), title: this.l('hostId'),
align: 'left', align: 'left',
high: true high: true
}, },
{ {
key: 'dataSourceTitle', // key: 'dataSourceTitle',
key: 'id',
title: this.l('dataSourceId'), title: this.l('dataSourceId'),
align: 'left', width:120,
align:'center',
render: (h, params) => { render: (h, params) => {
if (params.row.dataSourceId == 0) { // if (params.row.dataSourceId == 0) {
return '' // return ''
} // }
return h('div', { class: 'action' }, [ return h('div', { class: 'action' }, [
h( h(
'op', 'op',
{ {
attrs: { oprate: 'detail' }, attrs: { oprate: 'detail' },
on: { on: {
click: () => this.datadetail(params.row.dataSourceId) click: () => this.datadetail(params.row.id)
} }
}, },
params.row.dataSourceTitle // params.row.dataSourceTitle
'配置'
) )
]) ])
} }
...@@ -265,14 +267,14 @@ export default { ...@@ -265,14 +267,14 @@ export default {
}, },
'编辑' '编辑'
), ),
h( // h(
'op', // 'op',
{ // {
attrs: { oprate: 'edit' }, // attrs: { oprate: 'edit' },
on: { click: () => this.TanantInit(params.row) } // on: { click: () => this.TanantInit(params.row) }
}, // },
'初始化' // '初始化'
), // ),
h( h(
'op', 'op',
{ {
...@@ -339,6 +341,10 @@ export default { ...@@ -339,6 +341,10 @@ export default {
this.setModal=true this.setModal=true
this.curId=id this.curId=id
}, },
datadetail(id) {
this.datadetailModal = true
this.datacurId = id
},
setAps(id){ setAps(id){
this.aps=[] this.aps=[]
this.disabled=false this.disabled=false
...@@ -355,11 +361,6 @@ export default { ...@@ -355,11 +361,6 @@ export default {
this.detailModal = true this.detailModal = true
this.curId = id this.curId = id
}, },
datadetail(id) {
this.datadetailModal = true
this.datacurId = id
},
edit(id) { edit(id) {
this.editModal = true this.editModal = true
this.curId = id this.curId = id
......
<template>
<div>
<p class="tr pb5">
<Button type="primary" @click="setSql()" :disabled="disabled">保11存</Button>
</p>
<DataGrid
:columns="columns"
ref="grid"
:data="list"
:high="false"
:set="false"
:tool="false"
:height="400"
:page="false"
></DataGrid>
<!-- <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal> -->
</div>
</template>
<script>
import Api1 from "./api";
import Api from "../set_menu/api";
// import Detail from "../set_menu/detail";
import Search from "../set_menu/search";
import api from "../account/api";
export default {
name: "menuSet",
components: {
// Detail,
Search
},
data() {
return {
action: "",
easySearch: {
keys: { op: "title,remark", value: null }
},
disabled: false,
detailModal: false,
list: [],
curId: 0,
currentChoose: 0,
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;
}
}
})
]);
}
},
{
key: "hostName",
title: this.l("hostName"),
align: "center",
easy: true,
high: true,
},
// { key:"remark",title:this.l("remark") ,align:"left" ,easy:true ,high:true },
{
key: "ip",
title: this.l("ip"),
align: "center",
high: true,
width: 140,
// code: "crm.customer.status"
},
{
key: "databaseTypeName",
title: this.l("databaseTypeName"),
align: "center",
width: 140
},
{
key: "databaseName",
title: this.l("databaseName"),
align: "center",
width: 100
},
{
key: "port",
title: this.l("port"),
align: "center",
width: 80
},
// {
// title: "操作",
// key: "id",
// width: 100,
// align: "center",
// render: (h, params) => {
// return h("div", { class: "action" }, [
// h(
// "op",
// {
// attrs: { oprate: "detail" },
// on: { click: () => this.detail(params.row.id) }
// },
// "查看"
// )
// ]);
// }
// }
]
};
},
props: {
v: Object,
elid: Number
},
mounted() {
console.log(this.action);
},
methods: {
//保存公司的数据源
setSql() {
// console.log(this.currentChoose)
if (this.currentChoose == 0) {
return;
}
let id = this.elid;
var a = {};
(a.tenantId = id), (a.dbSourceIdList = this.currentChoose);
this.disabled = true;
Api.setMenuSql(a).then(r => {
if (r.success) {
this.$Message.success("保存成功");
this.currentChoose = 0;
this.disabled = false;
this.$emit("set-ok");
}
});
},
search() {
this.$refs.grid.reload(this.easySearch);
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
getAll() {
// debugger
let params = {
pageIndex: 1,
pageSize: 20,
conditions: [],
type: this.elid
};
this.currentChoose = 0;
Api.pagedSql(params).then(r => {
this.list = r.result;
r.result.forEach(data => {
if (data.id == data.checkedId) {
this.currentChoose = data.id;
}
});
});
},
l(key) {
/*
databases:{
databaseName: "mes"
databaseType: "0"
databaseTypeName: "MySql"
hostName: "腾讯云服务器"
ip: "49.232.68.61"
port: 1333
tenantId: 0
}
*/
let vkey = "databases" + "." + key;
return this.$t(vkey) || key;
}
},
watch: {
// v() {
// this.entity = this.$u.clone(this.v)
// },
elid() {
this.getAll();
}
}
};
</script>
<style lang="less">
</style>
\ No newline at end of file
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