Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-admin
Overview
Overview
Details
Activity
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
吴迪
gs1-admin
Commits
efb57e1d
Commit
efb57e1d
authored
Jan 16, 2022
by
Lyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台bug修改
parent
e7ff6004
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
312 additions
and
23 deletions
+312
-23
index.js
config/index.js
+2
-1
_base.scss
src/assets/scss/_base.scss
+3
-0
index.js
src/router/index.js
+8
-8
httpRequest.js
src/utils/httpRequest.js
+1
-1
login.vue
src/views/common/login.vue
+8
-8
main-navbar.vue
src/views/main-navbar.vue
+1
-1
main-sidebar.vue
src/views/main-sidebar.vue
+2
-2
announce-add-or-update.vue
src/views/modules/info/announce-add-or-update.vue
+277
-0
announce.vue
src/views/modules/info/announce.vue
+0
-0
oss-upload.vue
src/views/modules/oss/oss-upload.vue
+1
-1
doc.vue
src/views/modules/service/doc.vue
+9
-1
No files found.
config/index.js
View file @
efb57e1d
...
...
@@ -35,7 +35,8 @@ module.exports = {
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint
:
true
,
// useEslint: true,
useEslint
:
false
,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay
:
false
,
...
...
src/assets/scss/_base.scss
View file @
efb57e1d
...
...
@@ -373,6 +373,9 @@ img {
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploaderFile
>
.el-upload
{
border
:none
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409EFF
;
}
...
...
src/router/index.js
View file @
efb57e1d
...
...
@@ -90,7 +90,7 @@ const mainRoutes = {
],
beforeEnter
(
to
,
from
,
next
)
{
// let token = Vue.cookie.get('token')
let
token
=
session
Storage
.
getItem
(
'token'
)
let
token
=
local
Storage
.
getItem
(
'token'
)
if
(
!
token
||
!
/
\S
/
.
test
(
token
))
{
clearLoginInfo
()
next
({
name
:
'login'
})
...
...
@@ -115,8 +115,8 @@ router.beforeEach((to, from, next) => {
}
else
{
// fnAddDynamicMenuRoutes(menuData.navDataList)
// router.options.isAddDynamicMenuRoutes = true
//
session
Storage.setItem('menuList', JSON.stringify(menuData.navDataList || '[]'))
//
session
Storage.setItem('permissions', JSON.stringify(menuData.permissions || '[]'))
//
local
Storage.setItem('menuList', JSON.stringify(menuData.navDataList || '[]'))
//
local
Storage.setItem('permissions', JSON.stringify(menuData.permissions || '[]'))
// next({ ...to, replace: true })
http
({
...
...
@@ -127,12 +127,12 @@ router.beforeEach((to, from, next) => {
if
(
data
&&
data
.
code
===
0
)
{
fnAddDynamicMenuRoutes
(
data
.
menuList
)
router
.
options
.
isAddDynamicMenuRoutes
=
true
session
Storage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
.
menuList
||
'[]'
))
session
Storage
.
setItem
(
'permissions'
,
JSON
.
stringify
(
data
.
permissions
||
'[]'
))
local
Storage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
.
menuList
||
'[]'
))
local
Storage
.
setItem
(
'permissions'
,
JSON
.
stringify
(
data
.
permissions
||
'[]'
))
next
({
...
to
,
replace
:
true
})
}
else
{
session
Storage
.
setItem
(
'menuList'
,
'[]'
)
session
Storage
.
setItem
(
'permissions'
,
'[]'
)
local
Storage
.
setItem
(
'menuList'
,
'[]'
)
local
Storage
.
setItem
(
'permissions'
,
'[]'
)
next
()
}
}).
catch
((
e
)
=>
router
.
push
({
name
:
'login'
}))
...
...
@@ -201,7 +201,7 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
mainRoutes
,
{
path
:
'*'
,
redirect
:
{
name
:
'404'
}
}
])
session
Storage
.
setItem
(
'dynamicMenuRoutes'
,
JSON
.
stringify
(
mainRoutes
.
children
||
'[]'
))
local
Storage
.
setItem
(
'dynamicMenuRoutes'
,
JSON
.
stringify
(
mainRoutes
.
children
||
'[]'
))
console
.
log
(
'
\
n'
)
console
.
log
(
'%c!<-------------------- 动态(菜单)路由 s -------------------->'
,
'color:blue'
)
console
.
log
(
mainRoutes
.
children
)
...
...
src/utils/httpRequest.js
View file @
efb57e1d
...
...
@@ -18,7 +18,7 @@ const http = axios.create({
*/
http
.
interceptors
.
request
.
use
(
config
=>
{
// config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
config
.
headers
[
'token'
]
=
session
Storage
.
getItem
(
'token'
)
config
.
headers
[
'token'
]
=
local
Storage
.
getItem
(
'token'
)
return
config
},
error
=>
{
return
Promise
.
reject
(
error
)
...
...
src/views/common/login.vue
View file @
efb57e1d
...
...
@@ -52,19 +52,19 @@
}
},
created
()
{
this
.
dataForm
.
userName
=
session
Storage
.
getItem
(
'username'
)
this
.
dataForm
.
password
=
session
Storage
.
getItem
(
'password'
)
this
.
dataForm
.
userName
=
local
Storage
.
getItem
(
'username'
)
this
.
dataForm
.
password
=
local
Storage
.
getItem
(
'password'
)
},
methods
:
{
// 提交表单
dataFormSubmit
()
{
if
(
this
.
dataForm
.
checked
)
{
session
Storage
.
setItem
(
'username'
,
this
.
dataForm
.
userName
)
session
Storage
.
setItem
(
'password'
,
this
.
dataForm
.
password
)
local
Storage
.
setItem
(
'username'
,
this
.
dataForm
.
userName
)
local
Storage
.
setItem
(
'password'
,
this
.
dataForm
.
password
)
this
.
submit
()
}
else
{
session
Storage
.
removeItem
(
'username'
)
session
Storage
.
removeItem
(
'password'
)
local
Storage
.
removeItem
(
'username'
)
local
Storage
.
removeItem
(
'password'
)
this
.
submit
()
}
},
...
...
@@ -80,8 +80,8 @@
})
}).
then
(({
data
})
=>
{
if
(
data
&&
data
.
code
===
0
)
{
session
Storage
.
setItem
(
'token'
,
data
.
token
)
session
Storage
.
setItem
(
'username'
,
this
.
dataForm
.
userName
)
local
Storage
.
setItem
(
'token'
,
data
.
token
)
local
Storage
.
setItem
(
'username'
,
this
.
dataForm
.
userName
)
this
.
$router
.
replace
({
name
:
'home'
})
}
else
{
...
...
src/views/main-navbar.vue
View file @
efb57e1d
...
...
@@ -78,7 +78,7 @@
set
(
val
)
{
this
.
$store
.
commit
(
'common/updateMainTabs'
,
val
)
}
},
userName
:
{
get
()
{
return
session
Storage
.
getItem
(
'username'
)
}
get
()
{
return
local
Storage
.
getItem
(
'username'
)
}
}
},
methods
:
{
...
...
src/views/main-sidebar.vue
View file @
efb57e1d
...
...
@@ -75,8 +75,8 @@
$route
:
'routeHandle'
},
created
()
{
this
.
menuList
=
JSON
.
parse
(
session
Storage
.
getItem
(
'menuList'
)
||
'[]'
)
this
.
dynamicMenuRoutes
=
JSON
.
parse
(
session
Storage
.
getItem
(
'dynamicMenuRoutes'
)
||
'[]'
)
this
.
menuList
=
JSON
.
parse
(
local
Storage
.
getItem
(
'menuList'
)
||
'[]'
)
this
.
dynamicMenuRoutes
=
JSON
.
parse
(
local
Storage
.
getItem
(
'dynamicMenuRoutes'
)
||
'[]'
)
this
.
routeHandle
(
this
.
$route
)
},
methods
:
{
...
...
src/views/modules/info/announce-add-or-update.vue
0 → 100644
View file @
efb57e1d
<
template
>
<el-dialog
:title=
"!dataForm.id ? '新增' : this.showInfo?'详情':'修改'"
:close-on-click-modal=
"false"
:visible
.
sync=
"visible"
>
<el-form
:model=
"dataForm"
:rules=
"dataRule"
ref=
"dataForm"
@
keyup
.
enter
.
native=
"dataFormSubmit()"
label-width=
"120px"
v-loading=
'loading'
>
<el-form-item
label=
'分类:'
prop=
'announcetype'
>
<el-select
v-model=
"dataForm.announcetype"
placeholder=
"请选择分类"
clearable
>
<el-option
v-for=
"item in typeList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
'级别:'
prop=
'levels'
>
<el-select
v-model=
"dataForm.levels"
placeholder=
"请输入级别"
v-show=
"!showInfo"
>
<el-option
v-for=
"item in piclevelList"
:key=
"item"
:label=
"item"
:value=
"item"
>
</el-option>
</el-select>
<p
v-show=
"showInfo"
>
{{
dataForm
.
levels
}}
</p>
</el-form-item>
<el-form-item
label=
"标题:"
prop=
"title"
>
<el-input
v-model=
"dataForm.title"
placeholder=
"请输入显示标题"
v-show=
"!showInfo"
></el-input>
<p
v-show=
"showInfo"
>
{{
dataForm
.
title
}}
</p>
</el-form-item>
<!--
<el-form-item
label=
"跳转至:"
prop=
"directpath"
>
<el-input
v-model=
"dataForm.directpath"
placeholder=
"请输入跳转地址"
v-show=
"!showInfo"
></el-input>
<p
v-show=
"showInfo"
>
{{
dataForm
.
directpath
}}
</p>
</el-form-item>
-->
<el-form-item
label=
"作者:"
prop=
"author"
>
<el-input
v-model=
"dataForm.author"
placeholder=
"请输入作者"
v-show=
"!showInfo"
></el-input>
<p
v-show=
"showInfo"
>
{{
dataForm
.
author
}}
</p>
</el-form-item>
<el-form-item
label=
"显示时间:"
prop=
"showtime"
>
<el-date-picker
v-show=
"!showInfo"
v-model=
"dataForm.showtime"
value-format=
'yyyy-MM-dd'
type=
"date"
placeholder=
"选择日期"
>
</el-date-picker>
<p
v-show=
"showInfo"
>
{{
dataForm
.
showtime
}}
</p>
</el-form-item>
<el-form-item
label=
"附件路径:"
prop=
"fileUrl"
>
<el-upload
v-show=
"!showInfo"
class=
"avatar-uploaderFile"
action=
""
:show-file-list=
"false"
:http-request=
"Upload"
:before-upload=
"beforeAvatarUpload"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
<a
v-if=
"fileUrlStr"
:href=
"fileUrlStr"
target=
"_blank"
>
{{
fileUrlStr
}}
</a>
<p
v-show=
"showInfo"
><a
:href=
"fileUrlStr"
>
{{
fileUrlStr
}}
</a></p>
</el-form-item>
<el-form-item
label=
"文章内容:"
prop=
"content"
>
<Ueditor
@
ready=
"editorReady"
:value=
"ueditor.value"
:config=
"ueditor.config"
ref=
"ue"
v-show=
"!showInfo"
></Ueditor>
<div
v-show=
"showInfo"
v-html=
"dataForm.content"
></div>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
v-show=
"!showInfo"
>
<el-button
@
click=
"visible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"dataFormSubmit()"
>
确定
</el-button>
</span>
</el-dialog>
</
template
>
<
script
>
import
Ueditor
from
'../temps/ueditor'
export
default
{
components
:
{
Ueditor
},
data
()
{
return
{
loading
:
false
,
showInfo
:
false
,
visible
:
false
,
defaultProps
:
{
children
:
'children'
,
label
:
'label'
},
dataForm
:
{
id
:
0
,
title
:
''
,
author
:
''
,
levels
:
''
,
fileurl
:
''
,
content
:
''
,
showtime
:
''
,
announcetype
:
''
},
typeList
:
[
{
value
:
1
,
label
:
'中心公告'
},
{
value
:
2
,
label
:
'地方公告'
}
],
cclassidStr
:
undefined
,
dataRule
:
{
title
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
author
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
levels
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
type
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
// fileurl: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
showtime
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
]
},
fileUrl
:
new
FormData
(),
fileUrlStr
:
''
,
dialogVisible
:
false
,
ueditor
:
{
value
:
''
,
config
:
{}
},
piclevelList
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
],
id
:
[],
classidList
:
[],
cclassidList
:
[],
title
:
''
,
className
:
''
,
cclassName
:
''
}
},
created
()
{
},
mounted
()
{
},
methods
:
{
getSelectName
(
list
,
id
)
{
let
arr
=
list
.
filter
((
item
)
=>
{
return
item
.
id
===
id
})
return
arr
[
0
].
name
},
init
(
id
,
showInfo
)
{
this
.
dataForm
.
id
=
id
||
0
this
.
visible
=
true
this
.
showInfo
=
showInfo
this
.
$nextTick
(()
=>
{
this
.
clearInp
()
if
(
this
.
dataForm
.
id
)
{
this
.
loading
=
true
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/office/announce/info/
${
this
.
dataForm
.
id
}
`
),
method
:
'get'
,
params
:
this
.
$http
.
adornParams
()
}).
then
(({
data
})
=>
{
this
.
loading
=
false
if
(
data
&&
data
.
code
===
0
)
{
this
.
dataForm
=
data
.
announce
this
.
fileUrlStr
=
data
.
announce
.
fileUrlStr
this
.
dialogVisible
=
true
this
.
ueditor
.
value
=
this
.
dataForm
.
content
}
})
}
})
},
// 表单提交
dataFormSubmit
()
{
this
.
loading
=
true
this
.
$refs
[
'dataForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
`/office/announce/
${
!
this
.
dataForm
.
id
?
'save'
:
'update'
}
`
),
method
:
'post'
,
data
:
this
.
$http
.
adornData
({
'id'
:
this
.
dataForm
.
id
||
undefined
,
'title'
:
this
.
dataForm
.
title
,
'announcetype'
:
this
.
dataForm
.
announcetype
,
'author'
:
this
.
dataForm
.
author
,
'levels'
:
this
.
dataForm
.
levels
,
'fileurl'
:
this
.
dataForm
.
fileurl
,
'content'
:
this
.
dataForm
.
content
,
'showtime'
:
this
.
dataForm
.
showtime
})
}).
then
(({
data
})
=>
{
this
.
loading
=
false
if
(
data
&&
data
.
code
===
0
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
,
duration
:
1500
,
onClose
:
()
=>
{
this
.
visible
=
false
this
.
$emit
(
'refreshDataList'
)
}
})
}
else
{
this
.
$message
.
error
(
data
.
msg
)
}
})
}
})
},
// 上传之前校验
beforeAvatarUpload
(
file
)
{
if
(
file
)
{
var
windowURL
=
window
.
URL
||
window
.
webkitURL
this
.
fileUrlStr
=
windowURL
.
createObjectURL
(
file
)
this
.
dialogVisible
=
true
this
.
fileUrl
.
append
(
'file'
,
file
)
}
},
Upload
()
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/office/file/uploadFile'
),
method
:
'post'
,
data
:
this
.
fileUrl
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
dataForm
.
fileurl
=
res
.
data
.
data
this
.
fileUrlStr
=
res
.
data
.
data
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
clearInp
()
{
this
.
$refs
[
'dataForm'
].
resetFields
()
this
.
fileUrlStr
=
''
this
.
dialogVisible
=
false
this
.
ueditor
.
value
=
''
},
// 更新父子组件内容
editorReady
(
instance
)
{
instance
.
setContent
(
this
.
dataForm
.
content
)
instance
.
addListener
(
'contentChange'
,
()
=>
{
this
.
dataForm
.
content
=
instance
.
getContent
()
})
}
}
}
</
script
>
<
style
scoped
>
.avatar-uploader
>
.el-upload
{
border
:
none
!important
;
}
</
style
>
\ No newline at end of file
src/views/modules/info/announce.vue
0 → 100644
View file @
efb57e1d
This diff is collapsed.
Click to expand it.
src/views/modules/oss/oss-upload.vue
View file @
efb57e1d
...
...
@@ -32,7 +32,7 @@
},
methods
:
{
init
(
id
)
{
this
.
url
=
this
.
$http
.
adornUrl
(
`/office/sys/oss/upload?token=
${
session
Storage
.
getItem
(
'token'
)}
`
)
this
.
url
=
this
.
$http
.
adornUrl
(
`/office/sys/oss/upload?token=
${
local
Storage
.
getItem
(
'token'
)}
`
)
this
.
visible
=
true
},
// 上传之前
...
...
src/views/modules/service/doc.vue
View file @
efb57e1d
...
...
@@ -64,7 +64,7 @@
prop=
"category"
header-align=
"center"
align=
"center"
label=
"
状态
"
>
label=
"
类型
"
>
<
template
slot-scope=
"scope"
>
<div>
<span
v-if=
"scope.row.category === 1"
>
表格下载
</span>
...
...
@@ -73,6 +73,14 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"auditor"
header-align=
"center"
align=
"center"
label=
"审核人"
>
</el-table-column>
<el-table-column
fixed=
"right"
header-align=
"center"
align=
"center"
...
...
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