Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
727d6dc3
Unverified
Commit
727d6dc3
authored
Aug 19, 2020
by
lyl_task
Committed by
GitHub
Aug 19, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6 from lanyulei/dev
添加系统配置管理页面
parents
cb39f04d
6c7a45ca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
250 additions
and
12 deletions
+250
-12
settings.js
src/api/system/settings.js
+19
-0
Logo.vue
src/layout/components/Sidebar/Logo.vue
+16
-6
index.scss
src/styles/index.scss
+1
-1
index.vue
src/views/login/index.vue
+9
-0
index.vue
src/views/system/loginlog/index.vue
+4
-4
index.vue
src/views/system/settings/index.vue
+200
-0
index.vue
src/views/system/sysuser/index.vue
+1
-1
No files found.
src/api/system/settings.js
0 → 100644
View file @
727d6dc3
import
request
from
'@/utils/request'
// 设置系统配置信息
export
function
setSettings
(
data
)
{
return
request
({
url
:
'/api/v1/settings'
,
method
:
'post'
,
data
})
}
// 获取系统配置信息
export
function
getSettings
(
params
)
{
return
request
({
url
:
'/api/v1/settings'
,
method
:
'get'
,
params
})
}
src/layout/components/Sidebar/Logo.vue
View file @
727d6dc3
...
...
@@ -2,18 +2,19 @@
<div
class=
"sidebar-logo-container"
:class=
"
{'collapse':collapse}">
<transition
name=
"sidebarLogoFade"
>
<router-link
v-if=
"collapse"
key=
"collapse"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
logo"
src=
"@/assets/logo/ferry_logo_white.png
"
class=
"sidebar-logo"
>
<h1
v-else
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.logo
"
class=
"sidebar-logo"
>
<h1
v-else
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
</router-link>
<router-link
v-else
key=
"expand"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
logo"
src=
"@/assets/logo/ferry_logo_white.png
"
class=
"sidebar-logo"
>
<h1
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.logo
"
class=
"sidebar-logo"
>
<h1
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
</router-link>
</transition>
</div>
</
template
>
<
script
>
import
{
getSettings
}
from
'@/api/system/settings'
export
default
{
name
:
'SidebarLogo'
,
props
:
{
...
...
@@ -24,9 +25,18 @@ export default {
},
data
()
{
return
{
title
:
'FERRY 管理平台'
,
logo
:
'@/assets/logo/ferry_logo_white.png'
sysInfo
:
{
name
:
''
,
logo
:
''
}
}
},
created
()
{
getSettings
({
classify
:
1
}).
then
(
response
=>
{
this
.
sysInfo
=
response
.
data
[
0
].
content
})
}
}
</
script
>
...
...
src/styles/index.scss
View file @
727d6dc3
...
...
@@ -121,7 +121,7 @@ aside {
//main-container全局样式
.app-container
{
padding
:
20
px
;
padding
:
15
px
;
}
.components-container
{
...
...
src/views/login/index.vue
View file @
727d6dc3
...
...
@@ -114,6 +114,7 @@
<
script
>
import
{
getCodeImg
}
from
'@/api/login'
import
{
getSettings
}
from
'@/api/system/settings'
import
moment
from
'moment'
import
SocialSign
from
'./components/SocialSignin'
...
...
@@ -171,6 +172,7 @@ export default {
this
.
getCode
()
// window.addEventListener('storage', this.afterQRScan)
this
.
getCurrentTime
()
this
.
getSystemSetting
()
},
mounted
()
{
if
(
this
.
loginForm
.
username
===
''
)
{
...
...
@@ -184,6 +186,13 @@ export default {
// window.removeEventListener('storage', this.afterQRScan)
},
methods
:
{
getSystemSetting
()
{
getSettings
({
classify
:
1
}).
then
(
response
=>
{
this
.
sysInfo
=
response
.
data
[
0
].
content
})
},
getCurrentTime
()
{
this
.
timer
=
setInterval
(
_
=>
{
this
.
currentTime
=
moment
().
format
(
'YYYY-MM-DD HH时mm分ss秒'
)
...
...
src/views/system/loginlog/index.vue
View file @
727d6dc3
...
...
@@ -62,10 +62,10 @@
<el-table
v-loading=
"loading"
border
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"编号"
width=
"
7
0"
align=
"center"
prop=
"infoId"
/>
<el-table-column
label=
"用户名称"
width=
"
85
"
align=
"center"
prop=
"username"
/>
<el-table-column
label=
"登录地址"
align=
"center"
prop=
"ipaddr"
width=
"130"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"登录地点"
align=
"center"
prop=
"loginLocation"
/>
<el-table-column
label=
"编号"
width=
"
10
0"
align=
"center"
prop=
"infoId"
/>
<el-table-column
label=
"用户名称"
width=
"
150
"
align=
"center"
prop=
"username"
/>
<
!--
<
el-table-column
label=
"登录地址"
align=
"center"
prop=
"ipaddr"
width=
"130"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"登录地点"
align=
"center"
prop=
"loginLocation"
/>
-->
<el-table-column
label=
"浏览器"
align=
"center"
prop=
"browser"
/>
<el-table-column
label=
"操作系统"
align=
"center"
prop=
"os"
/>
<el-table-column
label=
"操作信息"
width=
"120"
align=
"center"
prop=
"msg"
/>
...
...
src/views/system/settings/index.vue
0 → 100644
View file @
727d6dc3
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
配置信息
</span>
</div>
<div
class=
"text item"
>
<el-form
ref=
"ruleForm"
:model=
"ruleForm"
:rules=
"rules"
label-width=
"100px"
>
<el-form-item
label=
"系统名称:"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
/>
</el-form-item>
<el-form-item
label=
"系统Logo:"
prop=
"logo"
>
<el-upload
class=
"avatar-uploader"
:action=
"url"
:data=
"
{type:'1'}"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if=
"ruleForm.logo"
:src=
"ruleForm.logo"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
style=
"margin-bottom: 0"
>
<el-button
v-permisaction=
"['system:settings:index:config']"
type=
"primary"
@
click=
"submitForm('ruleForm', 1)"
>
确定
</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card
class=
"box-card"
style=
"margin-top: 15px"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
Ldap配置
</span>
</div>
<div
class=
"text item"
>
<el-alert
title=
"Ldap登陆验证通过后,会将用户同步至本地数据库中,请在此配置数据同步的映射关系。单击Ldap字段可编辑,双击可隐藏编辑。"
type=
"info"
style=
"margin-bottom: 10px"
/>
<el-table
:data=
"tableData"
border
style=
"width: 100%"
>
<el-table-column
prop=
"local_field_name"
label=
"字段名称"
width=
"150"
/>
<el-table-column
prop=
"local_field_nick"
label=
"字段昵称"
width=
"150"
/>
<el-table-column
prop=
"ldap_field_name"
label=
"Ldap字段"
>
<template
slot-scope=
"
{row, $index}">
<div
style=
"width: 100%; min-height: 24px;"
@
click=
"
{{
chengenum
(
$index
,
true
)
}}
" @dblclick="
{{
chengenum
(
$index
,
false
)
}}
">
<el-input
v-if=
"editable[$index]"
v-model=
"row.ldap_field_name"
/>
<span
v-else
>
{{
row
.
ldap_field_name
}}
</span>
</div>
</
template
>
</el-table-column>
</el-table>
<div
style=
"margin-top: 20px"
>
<el-button
v-permisaction=
"['system:settings:index:ldap']"
type=
"primary"
@
click=
"submitForm('ruleForm', 2)"
>
确定
</el-button>
</div>
</div>
</el-card>
</div>
</template>
<
script
>
import
{
setSettings
,
getSettings
}
from
'@/api/system/settings'
export
default
{
components
:
{
},
data
()
{
return
{
url
:
process
.
env
.
VUE_APP_BASE_API
+
'/api/v1/public/uploadFile'
,
editable
:
[],
ruleForm
:
{
name
:
''
,
logo
:
''
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入系统名称'
,
trigger
:
'blur'
},
{
min
:
3
,
max
:
15
,
message
:
'长度在 3 到 15 个字符'
,
trigger
:
'blur'
}
],
logo
:
[
{
required
:
true
,
message
:
'请设置Logo'
,
trigger
:
'blur'
}
]
},
tableData
:
[]
}
},
mounted
()
{
this
.
getSettingsInfo
()
},
methods
:
{
getSettingsInfo
()
{
getSettings
().
then
(
response
=>
{
for
(
var
v
of
response
.
data
)
{
if
(
v
.
classify
===
1
)
{
if
(
v
.
content
===
undefined
||
v
.
content
===
null
)
{
this
.
ruleForm
=
{
name
:
''
,
logo
:
''
}
}
else
{
this
.
ruleForm
=
v
.
content
}
}
else
if
(
v
.
classify
===
2
)
{
if
(
v
.
content
===
undefined
||
v
.
content
===
null
)
{
this
.
tableData
=
[]
}
else
{
this
.
tableData
=
v
.
content
}
}
}
})
},
// 提交配置信息
submitForm
(
formName
,
classify
)
{
var
requestStatus
=
false
var
jsonValue
=
{
classify
:
classify
}
if
(
classify
===
1
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
jsonValue
.
content
=
this
.
ruleForm
requestStatus
=
true
}
})
}
else
if
(
classify
===
2
)
{
jsonValue
.
content
=
this
.
tableData
requestStatus
=
true
}
if
(
requestStatus
)
{
setSettings
(
jsonValue
).
then
(
response
=>
{
this
.
$message
({
message
:
'设置成功'
,
type
:
'success'
})
})
}
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
resetFields
()
},
handleAvatarSuccess
(
res
,
file
)
{
this
.
ruleForm
.
logo
=
res
.
data
console
.
log
(
this
.
ruleForm
.
logo
)
},
beforeAvatarUpload
(
file
)
{
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
'上传头像图片大小不能超过 2MB!'
)
}
return
isLt2M
},
chengenum
(
row
,
status
)
{
// 我的方法
this
.
editable
[
row
]
=
status
this
.
$set
(
this
.
editable
,
row
,
status
)
}
}
}
</
script
>
<
style
>
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409EFF
;
}
.avatar-uploader-icon
{
font-size
:
28px
;
color
:
#8c939d
;
width
:
178px
;
height
:
178px
;
line-height
:
178px
;
text-align
:
center
;
}
.avatar
{
width
:
178px
;
height
:
178px
;
display
:
block
;
}
</
style
>
src/views/system/sysuser/index.vue
View file @
727d6dc3
...
...
@@ -2,7 +2,7 @@
<div
class=
"app-container"
>
<el-row
:gutter=
"20"
>
<!--部门数据-->
<el-col
:span=
"4"
:xs=
"24"
>
<el-col
:span=
"4"
:xs=
"24"
style=
"padding-right: 0;"
>
<el-card
class=
"box-card"
>
<div
class=
"head-container"
>
<el-input
...
...
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