Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
Project
Project
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
Administrator
web-monitor
Commits
bd3a2a11
Commit
bd3a2a11
authored
Feb 22, 2022
by
neogcg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev_gcg
parents
e4c36db6
6621c7eb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
114 deletions
+89
-114
index.vue
src/components/Pagination/index.vue
+0
-1
main.js
src/main.js
+2
-17
user.js
src/store/modules/user.js
+1
-1
global_main_loader.js
src/utils/global_main_loader.js
+11
-0
request.js
src/utils/request.js
+4
-3
index.vue
src/views/login/index.vue
+5
-21
password.vue
src/views/user/updateUser/components/password.vue
+1
-2
api.js
src/views/user/userList/api.js
+25
-0
index.vue
src/views/user/userList/index.vue
+40
-69
No files found.
src/components/Pagination/index.vue
View file @
bd3a2a11
<
template
>
<
template
>
<div
class=
"pagination-wraper"
>
<div
class=
"pagination-wraper"
>
<el-pagination
<el-pagination
layout=
"total, sizes, prev, pager, next, jumper"
layout=
"total, sizes, prev, pager, next, jumper"
prev-text=
"上一页"
prev-text=
"上一页"
next-text=
"下一页"
next-text=
"下一页"
...
...
src/main.js
View file @
bd3a2a11
...
@@ -14,25 +14,10 @@ import router from './router'
...
@@ -14,25 +14,10 @@ import router from './router'
import
'@/icons'
// icon
import
'@/icons'
// icon
import
'@/permission'
// permission control
import
'@/permission'
// permission control
import
performLoader
from
'@/utils/global_main_loader.js'
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online ! ! !
*/
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
const
{
mockXHR
}
=
require
(
'../mock'
)
mockXHR
()
}
// set ElementUI lang to EN
Vue
.
use
(
ElementUI
,
{
locale
})
Vue
.
use
(
ElementUI
,
{
locale
})
// 如果想要中文版 element-ui,按如下方式声明
performLoader
(
Vue
)
// 所有的第三方插件性质的东西都放到这里面了
// Vue.use(ElementUI)
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
new
Vue
({
new
Vue
({
...
...
src/store/modules/user.js
View file @
bd3a2a11
...
@@ -55,7 +55,7 @@ const actions = {
...
@@ -55,7 +55,7 @@ const actions = {
const
{
name
,
avatar
}
=
data
const
{
name
,
avatar
}
=
data
commit
(
'SET_NAME'
,
name
)
//
commit('SET_NAME', name)
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_AVATAR'
,
avatar
)
resolve
(
data
)
resolve
(
data
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
...
...
src/utils/global_main_loader.js
0 → 100644
View file @
bd3a2a11
import
Pagination
from
'@/components/Pagination/index.vue'
// import VueSocketIO from 'vue-socket.io'
export
default
function
performLoader
(
Vue
)
{
// self component
function
plugins
(
Vue
)
{
Vue
.
component
(
'Pagination'
,
Pagination
)
}
Vue
.
use
(
plugins
)
}
src/utils/request.js
View file @
bd3a2a11
...
@@ -34,7 +34,8 @@ service.interceptors.request.use(
...
@@ -34,7 +34,8 @@ service.interceptors.request.use(
config
=>
{
config
=>
{
// do something before request is sent
// do something before request is sent
startLoading
(
config
.
el
)
startLoading
(
config
.
el
)
// config.data = json.dumps(config.data)
config
.
headers
.
get
[
'Content-Type'
]
=
'application/json'
if
(
store
.
getters
.
token
)
{
if
(
store
.
getters
.
token
)
{
config
.
headers
[
'Authorization'
]
=
getToken
()
config
.
headers
[
'Authorization'
]
=
getToken
()
}
else
{
}
else
{
...
@@ -60,11 +61,11 @@ service.interceptors.response.use(
...
@@ -60,11 +61,11 @@ service.interceptors.response.use(
let
code
=
resFinal
.
errorCode
||
resFinal
.
code
let
code
=
resFinal
.
errorCode
||
resFinal
.
code
let
message
=
resFinal
.
message
||
resFinal
.
errorMsg
||
resFinal
.
error
||
'接口错误'
let
message
=
resFinal
.
message
||
resFinal
.
errorMsg
||
resFinal
.
error
||
'接口错误'
if
(
code
)
{
if
(
code
)
{
if
(
code
==
401
01
)
{
if
(
code
==
5
01
)
{
location
.
href
=
location
.
href
.
replace
(
/#.+/
,
''
)
+
'#/login'
location
.
href
=
location
.
href
.
replace
(
/#.+/
,
''
)
+
'#/login'
return
return
}
}
if
(
code
==
'
4
01'
)
{
if
(
code
==
'
5
01'
)
{
!
config
.
silence
&&
!
errorShowing
&&
Message
.
error
(
message
)
!
config
.
silence
&&
!
errorShowing
&&
Message
.
error
(
message
)
errorShowing
=
true
errorShowing
=
true
setTimeout
(()
=>
{
errorShowing
=
false
},
3000
)
setTimeout
(()
=>
{
errorShowing
=
false
},
3000
)
...
...
src/views/login/index.vue
View file @
bd3a2a11
...
@@ -142,7 +142,7 @@ export default {
...
@@ -142,7 +142,7 @@ export default {
username
,
username
,
password
password
}
=
this
.
loginForm
}
=
this
.
loginForm
let
{
token
}
=
await
login
({
let
{
userName
,
token
}
=
await
login
({
userName
:
username
,
userName
:
username
,
password
:
password
,
password
:
password
,
},
{
},
{
...
@@ -150,33 +150,17 @@ export default {
...
@@ -150,33 +150,17 @@ export default {
})
})
if
(
!
token
)
return
if
(
!
token
)
return
this
.
$store
.
commit
(
"user/SET_TOKEN"
,
token
)
this
.
$store
.
commit
(
"user/SET_TOKEN"
,
token
)
this
.
$store
.
commit
(
"user/SET_NAME"
,
userName
)
setToken
(
token
)
setToken
(
token
)
// this.$store.commit("user/SET_NAVIGATION_SHOW", false)
this
.
$router
.
push
({
path
:
"/"
})
this
.
$router
.
push
({
path
:
"/"
})
setTimeout
(()
=>
{
//
setTimeout(() => {
location
.
reload
()
//
location.reload()
},
10
)
//
}, 10)
},
},
handleLogin
()
{
handleLogin
()
{
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
toLogin
()
this
.
toLogin
()
// this.loading = true;
// this.$store
// .dispatch("user/login", this.loginForm)
// .then(() => {
// if (this.loginForm.password == "123456") {
// this.$router.push({ path: this.redirect || "/" });
// this.loading = false;
// } else {
// alert("密码错误");
// this.loading = false;
// return false;
// }
// })
// .catch(() => {
// this.loading = false;
// });
}
else
{
}
else
{
console
.
log
(
"error submit!!"
);
console
.
log
(
"error submit!!"
);
return
false
;
return
false
;
...
...
src/views/user/updateUser/components/password.vue
View file @
bd3a2a11
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
}
}
return
{
return
{
form
:
{
form
:
{
name
:
'admin'
,
name
:
this
.
$store
.
getters
.
name
,
oldPass
:
''
,
oldPass
:
''
,
newPass
:
''
,
newPass
:
''
,
confirmPwd
:
''
confirmPwd
:
''
...
@@ -45,7 +45,6 @@ export default {
...
@@ -45,7 +45,6 @@ export default {
oldPass
:
{
required
:
true
,
message
:
'请输入原密码'
,
trigger
:
'blur'
},
oldPass
:
{
required
:
true
,
message
:
'请输入原密码'
,
trigger
:
'blur'
},
newPass
:
{
required
:
true
,
message
:
'请输入新密码'
,
trigger
:
'blur'
},
newPass
:
{
required
:
true
,
message
:
'请输入新密码'
,
trigger
:
'blur'
},
confirmPwd
:
[{
required
:
true
,
validator
:
validatePass2
,
trigger
:
'blur'
}]
confirmPwd
:
[{
required
:
true
,
validator
:
validatePass2
,
trigger
:
'blur'
}]
}
}
}
}
},
},
...
...
src/views/user/userList/api.js
0 → 100644
View file @
bd3a2a11
import
request
from
'@/utils/request'
const
path
=
{
list
:
'user/selectUserPage'
,
create
:
'user/saveUser'
,
updatePwd
:
'user/updatePwd'
,
updateInfo
:
'user/updateUserBaseInfo'
,
}
export
function
list
()
{
return
request
.
post
(
path
.
list
,
...
arguments
)
}
export
function
create
()
{
return
request
.
post
(
path
.
create
,
...
arguments
)
}
export
function
updatePwd
()
{
return
request
.
post
(
path
.
updatePwd
,
...
arguments
)
}
export
function
updateInfo
()
{
return
request
.
post
(
path
.
updateInfo
,
...
arguments
)
}
src/views/user/userList/index.vue
View file @
bd3a2a11
...
@@ -2,36 +2,44 @@
...
@@ -2,36 +2,44 @@
<div
class=
"leakage-cable"
>
<div
class=
"leakage-cable"
>
<div
class=
"leakage-top"
>
<div
class=
"leakage-top"
>
<div
style=
"color: #666666"
></div>
<div
style=
"color: #666666"
></div>
<div
class=
"operate-btn"
>
<div
class=
"operate-btn"
>
<el-button
type=
"primary"
>
添加新用户
</el-button>
<el-button
type=
"primary"
>
添加新用户
</el-button>
</div>
</div>
</div>
</div>
<el-table
<el-table
v-loading=
"loading"
v-loading=
"loading"
:data=
"tableData
2
"
:data=
"tableData"
class=
"statistics-table"
class=
"statistics-table"
style=
"width: 100%"
style=
"width: 100%"
:row-class-name=
"tableRowClassName"
:row-class-name=
"tableRowClassName"
:header-cell-style=
"
{background:'#eaf1fe',color:'#000', fontWeight: 700, height: '50px'}"
:header-cell-style=
"
{
background: '#eaf1fe',
color: '#000',
fontWeight: 700,
height: '50px',
}"
>
>
<el-table-column
type=
"index"
label=
"用户编号"
align=
"center"
width=
"100"
/>
<el-table-column
<el-table-column
prop=
"name"
label=
"用户名"
align=
"center"
/>
type=
"index"
label=
"用户编号"
align=
"center"
width=
"100"
/>
<el-table-column
prop=
"userName"
label=
"用户名"
align=
"center"
/>
<el-table-column
prop=
"realName"
label=
"真实姓名"
align=
"center"
/>
<el-table-column
prop=
"realName"
label=
"真实姓名"
align=
"center"
/>
<el-table-column
prop=
"dept"
label=
"用户部门"
align=
"center"
/>
<el-table-column
prop=
"dept
Id
"
label=
"用户部门"
align=
"center"
/>
<el-table-column
prop=
"phone"
label=
"电话号码"
align=
"center"
/>
<el-table-column
prop=
"phone"
label=
"电话号码"
align=
"center"
/>
<el-table-column
prop=
"email"
label=
"邮箱"
align=
"center"
/>
<el-table-column
prop=
"email"
label=
"邮箱"
align=
"center"
/>
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<template>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
>
修改密码
</el-button>
<el-button
type=
"text"
@
click=
"toEditPwd(scope.row)"
>
修改密码
</el-button>
<el-button
type=
"text"
>
修改基本信息
</el-button>
<el-button
type=
"text"
@
click=
"toEditInfo(scope.row)"
>
修改基本信息
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<
p
agination
<
P
agination
:limit=
"
searchForm
.pageSize"
:limit=
"
params
.pageSize"
:page=
"
searchForm
.pageNum"
:page=
"
params
.pageNum"
:total=
"total"
:total=
"total"
class=
"pagination"
class=
"pagination"
@
pagination=
"handlePageChange"
@
pagination=
"handlePageChange"
...
@@ -40,56 +48,15 @@
...
@@ -40,56 +48,15 @@
</template>
</template>
<
script
>
<
script
>
import
Pagination
from
'@/components/Pagination'
import
{
list
,
create
,
updatePwd
,
updateInfo
}
from
'./api'
export
default
{
export
default
{
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
searchForm
:
{
params
:
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
},
},
tableData2
:[],
tableData
:
[],
tableData
:
[
{
name
:
'admin'
,
realName
:
'张三'
,
dept
:
'NetWork'
,
phone
:
'13912451245'
,
email
:
'123456@163.com'
},
{
name
:
'admin'
,
realName
:
'张三'
,
dept
:
'NetWork'
,
phone
:
'13912451245'
,
email
:
'123456@163.com'
},
{
name
:
'admin'
,
realName
:
'张三'
,
dept
:
'NetWork'
,
phone
:
'13912451245'
,
email
:
'123456@163.com'
},
{
name
:
'admin'
,
realName
:
'张三'
,
dept
:
'NetWork'
,
phone
:
'13912451245'
,
email
:
'123456@163.com'
},
{
name
:
'admin'
,
realName
:
'张三'
,
dept
:
'NetWork'
,
phone
:
'13912451245'
,
email
:
'123456@163.com'
}
],
total
:
5
,
total
:
5
,
loading
:
false
loading
:
false
}
}
...
@@ -99,16 +66,20 @@ export default {
...
@@ -99,16 +66,20 @@ export default {
return
rowIndex
%
2
===
0
?
''
:
'single-row'
return
rowIndex
%
2
===
0
?
''
:
'single-row'
},
},
handlePageChange
(
pageData
)
{
handlePageChange
(
pageData
)
{
this
.
searchForm
.
pageSize
=
pageData
.
size
this
.
params
.
pageSize
=
pageData
.
size
this
.
searchForm
.
pageNum
=
pageData
.
page
this
.
params
.
pageNum
=
pageData
.
page
this
.
getTableData
()
this
.
getTableData
()
},
},
getTableData
()
{
getTableData
()
{
this
.
tableData2
=
this
.
tableData
.
slice
((
this
.
searchForm
.
pageNum
-
1
)
*
this
.
searchForm
.
pageSize
,
let
params
=
{
this
.
searchForm
.
pageNum
*
this
.
searchForm
.
pageSize
current
:
this
.
params
.
pageNum
,
);
size
:
this
.
params
.
pageSize
this
.
total
=
this
.
tableData
.
length
}
list
(
params
).
then
(
res
=>
{
let
list
=
res
.
records
||
[]
this
.
tableData
=
list
this
.
total
=
res
.
total
})
},
},
},
},
mounted
()
{
mounted
()
{
...
...
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