Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
47749de4
Commit
47749de4
authored
Aug 13, 2020
by
kangzhenfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
saas优化
parent
d265c609
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
292 additions
and
54 deletions
+292
-54
sysUser.js
api/sysUser.js
+8
-4
zh-CN.js
i18n/locale/zh-CN.js
+22
-13
edit.vue
pages/basicData/dic/components/edit.vue
+2
-1
edit.vue
pages/system/datasource/edit.vue
+6
-3
edit.vue
pages/system/dic/components/edit.vue
+2
-1
api.js
pages/system/set_menu/api.js
+6
-0
index.vue
pages/system/tanant/index.vue
+33
-32
setdetail.vue
pages/system/tanant/setdetail.vue
+213
-0
No files found.
api/sysUser.js
View file @
47749de4
...
...
@@ -198,19 +198,23 @@ export default {
let
model
=
{
id
:
id
};
return
Api
.
post
(
`
${
systemUrl
}
/user/AccountReset`
,
model
);
// return Api.post(`${systemUrl}/user/AccountReset`, model);
return
Api
.
post
(
`
${
system
}
/account/AccountReset`
,
model
);
},
//根据id获取用户详情
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
)
{
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获取用户详情
getusermenuOld
()
{
return
Api
.
get
(
`
${
systemUrl
}
/usermenu/getusermenu`
);
// return Api.get(`${systemUrl}/usermenu/getusermenu`);
return
Api
.
get
(
`
${
system
}
/usermenu/getusermenu`
);
},
getFile
(
params
)
{
...
...
i18n/locale/zh-CN.js
View file @
47749de4
...
...
@@ -932,7 +932,7 @@ export default {
startTime
:
'服务开始时间'
,
endTime
:
'服务结束时间'
,
initialized
:
'是否已初始化'
,
dataSourceId
:
'数据源'
,
dataSourceId
:
'数据源
配置
'
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
...
...
@@ -960,20 +960,29 @@ export default {
lastLoginTime
:
'最后登录时间'
,
loginTimes
:
'累计登录次数'
,
},
databases
:{
hostName
:
"主机"
,
ip
:
"IP"
,
databaseTypeName
:
"数据库类型"
,
databaseName
:
"数据库"
,
databaseType
:
"数据字典主键"
,
port
:
"端口"
,
tenantId
:
0
,
},
//多租户-套餐管理
set_menu
:{
id
:
''
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
lastModifierUserId
:
'更新人'
,
isDeleted
:
'删除人'
,
deletionTime
:
'删除时间'
,
deleterUserId
:
'删除人'
,
title
:
'套餐名称'
,
remark
:
'备注'
,
status
:
'状态'
,
menuIds
:
'菜单'
id
:
''
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
lastModifierUserId
:
'更新人'
,
isDeleted
:
'删除人'
,
deletionTime
:
'删除时间'
,
deleterUserId
:
'删除人'
,
title
:
'套餐名称'
,
remark
:
'备注'
,
status
:
'状态'
,
menuIds
:
'菜单'
},
//多租户-菜单管理
menu
:
{
id
:
''
,
...
...
pages/basicData/dic/components/edit.vue
View file @
47749de4
...
...
@@ -69,7 +69,8 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
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
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
...
...
pages/system/datasource/edit.vue
View file @
47749de4
...
...
@@ -16,17 +16,20 @@
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('port')"
prop=
"port"
>
<InputNumber
v-model=
"entity.port"
></InputNumber>
<!--
<InputNumber
v-model=
"entity.port"
></InputNumber>
-->
<span>
{{
entity
.
port
}}
</span>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('userName')"
prop=
"userName"
>
<Input
v-model=
"entity.userName"
></Input>
<!--
<Input
v-model=
"entity.userName"
></Input>
-->
<span>
{{
entity
.
userName
}}
</span>
</FormItem>
</Col>
<Col
:span=
"24"
>
<FormItem
:label=
"l('password')"
prop=
"password"
>
<Input
v-model=
"entity.password"
></Input>
<!--
<Input
v-model=
"entity.password"
></Input>
-->
<span>
{{
entity
.
password
}}
</span>
</FormItem>
</Col>
</Row>
...
...
pages/system/dic/components/edit.vue
View file @
47749de4
...
...
@@ -69,7 +69,8 @@ export default {
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
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
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
'保存成功'
)
...
...
pages/system/set_menu/api.js
View file @
47749de4
...
...
@@ -4,6 +4,12 @@ export default {
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
){
return
Api
.
get
(
`
${
system
}
/setmenu/get`
,
params
);
},
...
...
pages/system/tanant/index.vue
View file @
47749de4
...
...
@@ -27,10 +27,10 @@
<Modal
v-model=
"detailModal"
title=
"详情"
>
<Detail
:eid=
"curId"
/>
</Modal>
<Modal
v-model=
"datadetailModal"
title=
"数据源
详情"
>
<dataDetail
:eid=
"datacurId"
/>
<Modal
v-model=
"datadetailModal"
title=
"数据源
配置"
footer-hide
width=
'830'
>
<dataDetail
:e
l
id=
"datacurId"
/>
</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"
/>
</Modal>
<Modal
v-model=
"apsModal"
title=
"APS配置"
footer-hide
>
...
...
@@ -57,7 +57,7 @@ import Add from './add'
import
Edit
from
'./edit'
import
Detail
from
'./detail'
import
Search
from
'./search'
import
dataDetail
from
'.
./data_source/
detail'
import
dataDetail
from
'.
/set
detail'
import
menuSet
from
'./menuset'
export
default
{
name
:
'list'
,
...
...
@@ -116,38 +116,40 @@ export default {
high
:
true
},
{
key
:
'endTime'
,
title
:
this
.
l
(
'endTime'
),
align
:
'left'
,
high
:
true
},
{
key
:
'initialized'
,
title
:
this
.
l
(
'initialized'
),
align
:
'left'
,
high
:
true
,
code
:
'system.Tanant.init'
},
//
{
//
key: 'initialized',
//
title: this.l('initialized'),
//
align: 'left',
//
high: true,
//
code: 'system.Tanant.init'
//
},
{
key
:
'hostTitle'
,
title
:
this
.
l
(
'hostId'
),
align
:
'left'
,
high
:
true
},
{
key
:
'dataSourceTitle'
,
// key: 'dataSourceTitle',
key
:
'id'
,
title
:
this
.
l
(
'dataSourceId'
),
align
:
'left'
,
width
:
120
,
align
:
'center'
,
render
:
(
h
,
params
)
=>
{
if
(
params
.
row
.
dataSourceId
==
0
)
{
return
''
}
//
if (params.row.dataSourceId == 0) {
//
return ''
//
}
return
h
(
'div'
,
{
class
:
'action'
},
[
h
(
'op'
,
{
attrs
:
{
oprate
:
'detail'
},
on
:
{
click
:
()
=>
this
.
datadetail
(
params
.
row
.
dataSourceI
d
)
click
:
()
=>
this
.
datadetail
(
params
.
row
.
i
d
)
}
},
params
.
row
.
dataSourceTitle
// params.row.dataSourceTitle
'配置'
)
])
}
...
...
@@ -265,14 +267,14 @@ export default {
},
'编辑'
),
h
(
'op'
,
{
attrs
:
{
oprate
:
'edit'
},
on
:
{
click
:
()
=>
this
.
TanantInit
(
params
.
row
)
}
},
'初始化'
),
//
h(
//
'op',
//
{
//
attrs: { oprate: 'edit' },
//
on: { click: () => this.TanantInit(params.row) }
//
},
//
'初始化'
//
),
h
(
'op'
,
{
...
...
@@ -339,6 +341,10 @@ export default {
this
.
setModal
=
true
this
.
curId
=
id
},
datadetail
(
id
)
{
this
.
datadetailModal
=
true
this
.
datacurId
=
id
},
setAps
(
id
){
this
.
aps
=
[]
this
.
disabled
=
false
...
...
@@ -355,11 +361,6 @@ export default {
this
.
detailModal
=
true
this
.
curId
=
id
},
datadetail
(
id
)
{
this
.
datadetailModal
=
true
this
.
datacurId
=
id
},
edit
(
id
)
{
this
.
editModal
=
true
this
.
curId
=
id
...
...
pages/system/tanant/setdetail.vue
0 → 100644
View file @
47749de4
<
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment