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
9896e145
Commit
9896e145
authored
Sep 30, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
layout config css store
parent
bade8ef3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
95 deletions
+159
-95
base.less
assets/css/base.less
+7
-0
index.vue
layouts/basic-layout/header-i18n/index.vue
+42
-35
index.vue
layouts/basic-layout/header-user/index.vue
+39
-40
index.vue
pages/account/login/index.vue
+2
-2
index.vue
pages/system/config/index.vue
+22
-7
base.css
src/assets/css/base.css
+6
-0
index.js
store/index.js
+41
-11
No files found.
assets/css/base.less
View file @
9896e145
...
...
@@ -285,6 +285,13 @@ html body {
.pl20 {
padding-left: 20px
}
.pr10 {
padding-right: 10px
}
.pr20 {
padding-right: 20px
}
.bnone {
border: none;
...
...
layouts/basic-layout/header-i18n/index.vue
View file @
9896e145
<
template
>
<span
class=
"i-layout-header-trigger i-layout-header-trigger-min"
>
<Dropdown
:trigger=
"isMobile ? 'click' : 'hover'"
class=
"i-layout-header-i18n"
:class=
"
{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon
type=
"md-globe"
/>
<DropdownMenu
slot=
"list"
>
<DropdownItem
v-for=
"(item, key) in languages"
:key=
"key"
:name=
"key"
:selected=
"locale === key"
>
<span>
{{
item
.
language
}}
</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
<span
class=
"i-layout-header-trigger i-layout-header-trigger-min"
>
<Dropdown
transfer
:trigger=
"isMobile ? 'click' : 'hover'"
class=
"i-layout-header-i18n"
:class=
"
{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon
type=
"md-globe"
/>
<DropdownMenu
slot=
"list"
>
<DropdownItem
v-for=
"(item, key) in languages"
:key=
"key"
:name=
"key"
:selected=
"locale === key"
>
<span>
{{
item
.
language
}}
</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
</
template
>
<
script
>
import
Languages
from
'@/i18n/locale'
;
import
{
mapState
,
mapActions
}
from
'vuex'
;
import
Languages
from
'@/i18n/locale'
;
import
{
mapState
,
mapActions
}
from
'vuex'
;
export
default
{
name
:
'iHeaderI18n'
,
data
()
{
return
{
languages
:
Languages
}
},
computed
:
{
...
mapState
(
'admin/i18n'
,
[
'locale'
]),
...
mapState
(
'admin/layout'
,
[
'isMobile'
])
},
methods
:
{
...
mapActions
(
'admin/i18n'
,
[
'setLocale'
]),
handleClick
(
locale
)
{
if
(
locale
===
this
.
locale
)
return
;
this
.
setLocale
({
locale
,
vm
:
this
});
}
export
default
{
name
:
'iHeaderI18n'
,
data
()
{
return
{
languages
:
Languages
}
},
computed
:
{
...
mapState
(
'admin/i18n'
,
[
'locale'
]),
...
mapState
(
'admin/layout'
,
[
'isMobile'
])
},
methods
:
{
...
mapActions
(
'admin/i18n'
,
[
'setLocale'
]),
handleClick
(
locale
)
{
if
(
locale
===
this
.
locale
)
return
;
this
.
setLocale
({
locale
,
vm
:
this
});
}
}
}
</
script
>
layouts/basic-layout/header-user/index.vue
View file @
9896e145
<
template
>
<span
class=
"i-layout-header-trigger i-layout-header-trigger-min"
>
<Dropdown
:trigger=
"isMobile ? 'click' : 'hover'"
class=
"i-layout-header-user"
:class=
"
{ 'i-layout-header-user-mobile': isMobile }"
@on-click="handleClick"
>
<Avatar
size=
"small"
:src=
"info.avatar"
v-if=
"info.avatar"
/>
<Avatar
size=
"small"
style=
"background-color: #87d068"
icon=
"ios-person"
v-else-if=
"!info.avatar"
/>
<span
class=
"i-layout-header-user-name"
v-if=
"!isMobile"
>
{{
info
.
name
}}
</span>
<DropdownMenu
slot=
"list"
>
<i-link
to=
"/basicData/userManagent/userInfo"
>
<DropdownItem>
<Icon
type=
"ios-contact-outline"
/>
<span>
{{
$t
(
'basicLayout.user.center'
)
}}
</span>
</DropdownItem>
</i-link>
<!--
<i-link
to=
"/setting/account"
>
<span
class=
"i-layout-header-trigger i-layout-header-trigger-min"
>
<Dropdown
transfer
:trigger=
"isMobile ? 'click' : 'hover'"
class=
"i-layout-header-user"
:class=
"
{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Avatar
size=
"small"
:src=
"info.avatar"
v-if=
"info.avatar"
/>
<Avatar
size=
"small"
style=
"background-color: #87d068"
icon=
"ios-person"
v-else-if=
"!info.avatar"
/>
<span
class=
"i-layout-header-user-name"
v-if=
"!isMobile"
>
{{
info
.
name
}}
</span>
<DropdownMenu
slot=
"list"
>
<i-link
to=
"/basicData/userManagent/userInfo"
>
<DropdownItem>
<Icon
type=
"ios-contact-outline"
/>
<span>
{{
$t
(
'basicLayout.user.center'
)
}}
</span>
</DropdownItem>
</i-link>
<!--
<i-link
to=
"/setting/account"
>
<DropdownItem>
<Icon
type=
"ios-settings-outline"
/>
<span>
{{
$t
(
'basicLayout.user.setting'
)
}}
</span>
</DropdownItem>
</i-link>
-->
<DropdownItem
divided
name=
"logout"
>
<Icon
type=
"ios-log-out"
/>
<span>
{{
$t
(
'basicLayout.user.logOut'
)
}}
</span>
</DropdownItem>
</DropdownMenu>
<DropdownItem
divided
name=
"logout"
>
<Icon
type=
"ios-log-out"
/>
<span>
{{
$t
(
'basicLayout.user.logOut'
)
}}
</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
</span>
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
"vuex"
;
import
{
mapState
,
mapActions
}
from
"vuex"
;
export
default
{
name
:
"iHeaderUser"
,
computed
:
{
...
mapState
(
"admin/user"
,
[
"info"
]),
...
mapState
(
"admin/layout"
,
[
"isMobile"
,
"logoutConfirm"
])
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"logout"
]),
handleClick
(
name
)
{
if
(
name
===
"logout"
)
{
this
.
logout
({
confirm
:
this
.
logoutConfirm
,
vm
:
this
});
}
name
:
"iHeaderUser"
,
computed
:
{
...
mapState
(
"admin/user"
,
[
"info"
]),
...
mapState
(
"admin/layout"
,
[
"isMobile"
,
"logoutConfirm"
])
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"logout"
]),
handleClick
(
name
)
{
if
(
name
===
"logout"
)
{
this
.
logout
({
confirm
:
this
.
logoutConfirm
,
vm
:
this
});
}
}
}
}
};
</
script
>
pages/account/login/index.vue
View file @
9896e145
...
...
@@ -106,8 +106,8 @@ export default {
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
let
info
=
res
.
result
;
info
.
tenantCode
=
info
.
auth
=
[
"admin"
];
info
.
tenantCode
=
''
;
info
.
auth
=
[
"admin"
];
info
.
avatar
=
info
.
avatarUrl
;
info
.
userId
=
info
.
id
;
info
.
name
=
info
.
userName
;
...
...
pages/system/config/index.vue
View file @
9896e145
...
...
@@ -7,9 +7,9 @@
</Menu>
</div>
<div
class=
"main fg"
id=
"mainDiv"
>
<div
class=
"tr lt40 fr divTop"
>
<div
class=
"tr lt40 fr divTop
pr20
"
>
<Button
type=
"primary"
size=
"small"
@
click=
"save"
>
保存
</Button>
<Button
type=
"text"
>
恢复默认
</Button>
<Button
type=
"text"
size=
"small"
@
click=
"reset"
>
恢复默认
</Button>
</div>
<Form
ref=
"form"
:model=
"config"
:rules=
"rules"
:label-width=
"120"
>
<div
id=
"site"
class=
"mt50"
>
...
...
@@ -136,21 +136,36 @@
</
template
>
<
script
>
import
config
from
"~/libs/config"
;
//
import config from "~/libs/config";
export
default
{
name
:
""
,
data
()
{
return
{
config
:
c
onfig
,
config
:
this
.
$store
.
state
.
siteC
onfig
,
rules
:
{},
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
'loadSiteConfig'
)
// 加载数据字典
},
mounted
()
{},
methods
:
{
//保存设置
save
()
{
//alert(JSON.stringify(this.config))
this
.
$store
.
dispatch
(
'saveConfig'
,
this
.
config
)
},
//恢复默认
reset
()
{
this
.
config
=
this
.
$store
.
state
.
defaultConfig
;
//重置为默认设置信息
let
configTemSite
=
this
.
$store
.
state
.
siteConfig
;
//获取组合设置信息
if
(
configTemSite
.
tenantCode
!=
''
)
{
this
.
config
.
tenantCode
=
configTemSite
.
tenantCode
}
},
reset
()
{},
//menu切换
pageTo
(
val
)
{
var
mainDiv
=
document
.
getElementById
(
'mainDiv'
);
var
site
=
document
.
getElementById
(
'site'
);
...
...
@@ -200,7 +215,7 @@ export default {
background: #fff;
height: 40px;
width: calc(~'100% - 560px');
z-index:
9999
;
z-index:
100
;
border-bottom: 1px #e4e6ed solid;
top: 105px
}
...
...
src/assets/css/base.css
View file @
9896e145
...
...
@@ -212,6 +212,12 @@ html body {
.pl20
{
padding-left
:
20px
;
}
.pr10
{
padding-right
:
10px
;
}
.pr20
{
padding-right
:
20px
;
}
.bnone
{
border
:
none
;
}
...
...
store/index.js
View file @
9896e145
import
createVuexAlong
from
'vuex-along'
import
Api
from
'@/plugins/request'
import
util
from
'@/libs/util'
;
export
const
state
=
()
=>
({
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
...
...
@@ -11,6 +12,7 @@ export const state = () => ({
},
siteConfig
:
{},
defaultConfig
:
{},
configId
:
null
,
})
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
...
...
@@ -56,10 +58,13 @@ export const mutations = {
state
.
dictionary
=
dictionary
;
},
setSiteConfig
(
state
,
config
)
{
state
.
siteConfig
=
config
;
state
.
siteConfig
=
JSON
.
parse
(
config
)
;
},
setDefaultConfig
(
state
,
config
)
{
state
.
defaultConfig
=
config
;
state
.
defaultConfig
=
JSON
.
parse
(
config
);
},
setConfigId
(
state
,
id
)
{
state
.
configId
=
id
;
}
}
...
...
@@ -100,8 +105,8 @@ export const actions = {
let
params
=
{
pageSize
:
2
,
conditions
:
[{
"fieldName"
:
"
key
"
,
"fieldValue"
:
"defaultConfig,tenant
-"
+
state
.
userInfo
.
tenantCode
,
"fieldName"
:
"
component
"
,
"fieldValue"
:
"defaultConfig,tenant
Config_"
+
util
.
cookies
.
get
(
'tenantCode'
)
,
"conditionalType"
:
"In"
,
},
]
}
...
...
@@ -109,18 +114,43 @@ export const actions = {
result
}
=
await
Api
.
post
(
`
${
systemUrl
}
/config/list`
,
params
);
if
(
result
[
0
])
{
commit
(
"setDefaultConfig"
,
result
[
0
])
commit
(
"setDefaultConfig"
,
result
[
0
]
.
content
)
}
if
(
result
[
1
])
{
commit
(
"setSiteConfig"
,
result
[
1
])
}
else
{
if
(
result
[
0
]){
commit
(
"setSiteConfig"
,
result
[
0
])
commit
(
"setSiteConfig"
,
result
[
1
].
content
)
commit
(
"setConfigId"
,
result
[
1
].
id
)
}
else
{
if
(
result
[
0
])
{
commit
(
"setSiteConfig"
,
result
[
0
].
content
)
}
}
},
async
saveConfig
({
commit
},
config
){
async
saveConfig
({
state
},
config
)
{
if
(
config
.
tenantCode
!=
''
)
{
let
configStr
=
JSON
.
stringify
(
config
);
let
params
=
{
id
:
state
.
configId
,
page
:
"config"
,
component
:
"tenantConfig_"
+
config
.
tenantCode
,
key
:
config
.
tenantCode
,
content
:
configStr
,
note
:
"配置信息"
}
await
Api
.
post
(
`
${
systemUrl
}
/config/update`
,
params
);
}
else
{
config
.
tenantCode
=
util
.
cookies
.
get
(
'tenantCode'
)
let
configStr
=
JSON
.
stringify
(
config
);
let
params
=
{
page
:
"config"
,
component
:
"defaultConfig"
+
config
.
tenantCode
,
key
:
config
.
tenantCode
,
content
:
configStr
,
note
:
"配置信息"
}
await
Api
.
post
(
`
${
systemUrl
}
/config/create`
,
params
);
}
}
}
...
...
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