Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
bdd20e06
Commit
bdd20e06
authored
Oct 21, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
9b6d29a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
193 additions
and
73 deletions
+193
-73
index.js
src/api/school/index.js
+3
-3
manager-form.vue
src/components/school/manager/manager-form.vue
+138
-0
sysuser.vue
src/pages/school/sysuser.vue
+52
-70
No files found.
src/api/school/index.js
View file @
bdd20e06
...
...
@@ -315,7 +315,7 @@ export function queryManagerPage(data) {
/**
* 新增修改管理者
*/
export
function
saveManager
()
{
export
function
saveManager
(
data
)
{
return
request
({
url
:
'/User/SetManager'
,
method
:
'post'
,
...
...
@@ -326,7 +326,7 @@ export function saveManager() {
/**
* 获取管理者信息
*/
export
function
queryManagerInfo
()
{
export
function
queryManagerInfo
(
data
)
{
return
request
({
url
:
'/User/GetManager'
,
method
:
'post'
,
...
...
@@ -338,7 +338,7 @@ export function queryManagerInfo() {
/**
* 获取管理者信息
*/
export
function
deleteManagerInfo
()
{
export
function
deleteManagerInfo
(
data
)
{
return
request
({
url
:
'/User/RemoveManager'
,
method
:
'post'
,
...
...
src/components/school/manager/manager-form.vue
0 → 100644
View file @
bdd20e06
<
template
>
<q-dialog
v-model=
"persistent"
content-class=
"bg-grey-1"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
StuId
==
0
?
'新增管理者信息'
:
'修改管理者信息'
}}
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-md q-px-xs text-grey-6"
>
基本资料
</div>
<div
class=
"row wrap"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.MName"
ref=
"MName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"管理者名称"
:rules=
"[val => !!val || '请填写管理者姓名']"
/>
<q-input
type=
"tel"
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"objOption.MTel"
ref=
"MTel"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"联系电话"
:rules=
"[val => !!val || '请填写管理者联系电话']"
/>
<div
class=
"col-6 q-pb-lg"
>
<q-uploader
style=
"display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat"
:style=
"
{'background-image':'url(' + objOption.MHead + ')'}" max-files="1" hide-upload-btn
@rejected="onRejected" label="管理者头像" :max-file-size="512*1024" accept=".jpg, image/*" auto-upload
:factory="uploadFile" no-thumbnails>
</q-uploader>
</div>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
color=
"dark"
style=
"font-weight:400 !important"
@
click=
"closeSaveForm"
/>
<q-btn
label=
"立即提交"
color=
"accent"
class=
"q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveLoading"
@
click=
"setStudent"
/>
</q-card-actions>
</q-card>
</q-dialog>
</
template
>
<
script
>
import
{
getSchoolDropdown
,
saveManager
}
from
'../../../api/school/index'
import
{
UploadSelfFile
,
}
from
'../../../api/common/common'
export
default
{
components
:
{},
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
objOption
:
{
MId
:
0
,
//管理者编号
School_Id
:
0
,
//学校编号
MName
:
""
,
//管理者姓名
MTel
:
''
,
//管理者电话
MHead
:
''
,
//头像
},
optionTitle
:
""
,
schoolList
:
[],
saveLoading
:
false
,
}
},
created
()
{
this
.
getSchool
();
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
initObj
()
{
if
(
this
.
saveObj
)
{
this
.
optionTitle
=
"修改管理者信息"
this
.
objOption
.
MId
=
this
.
saveObj
.
MId
;
this
.
objOption
.
School_Id
=
this
.
saveObj
.
School_Id
;
this
.
objOption
.
MName
=
this
.
saveObj
.
MName
;
this
.
objOption
.
MTel
=
this
.
saveObj
.
MTel
;
this
.
objOption
.
MHead
=
this
.
saveObj
.
MHead
;
this
.
$forceUpdate
();
}
else
{
this
.
optionTitle
=
"新增管理者"
}
},
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
this
.
$forceUpdate
();
})
},
onRejected
(
rejectedEntries
)
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
`文件验证失败,请重新上传`
})
},
uploadFile
(
files
)
{
UploadSelfFile
(
'studentIcon'
,
files
[
0
],
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
objOption
.
MHead
=
res
.
FileUrl
;
}
})
},
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
setStudent
()
{
this
.
saveLoading
=
true
saveManager
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
},
},
}
</
script
>
<
style
>
.upload-assiatant-box
.q-uploader__list
{
display
:
none
;
}
.upload-assiatant-box
.q-uploader
{
width
:
auto
;
}
</
style
>
src/pages/school/sysuser.vue
View file @
bdd20e06
...
...
@@ -3,10 +3,10 @@
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-3"
>
<q-input
@
input=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.
StuName"
label=
"学员名称
"
/>
<q-input
@
input=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.
MName"
label=
"姓名
"
/>
</div>
<div
class=
"col-3"
>
<q-input
@
input=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.
StuTel"
label=
"学员
电话"
/>
<q-input
@
input=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.
MTel"
label=
"
电话"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
clearable
filled
stack-label
option-value=
"SId"
option-label=
"SName"
...
...
@@ -18,23 +18,23 @@
</div>
</div>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增
学员"
@
click=
"EditStudent
(null)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增
管理者"
@
click=
"EditManager
(null)"
/>
</div>
</div>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-right-column-table sticky-tow-column-table"
separator=
"none"
title=
"后台用户信息"
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:body-cell-
StuIcon
=
"props"
>
<template
v-slot:body-cell-
MHead
=
"props"
>
<q-td
auto-width
:props=
"props"
>
<q-avatar
size=
"md"
v-if=
"props.value"
>
<img
:src=
"props.value"
/>
</q-avatar>
<q-avatar
size=
"md"
color=
"teal-10"
text-color=
"white"
v-if=
"!props.value"
>
{{
props
.
row
.
Stu
Name
}}
</q-avatar>
{{
props
.
row
.
M
Name
}}
</q-avatar>
</q-td>
</
template
>
<
template
v-slot:body-cell-
Stu
Name=
"props"
>
<
template
v-slot:body-cell-
M
Name=
"props"
>
<q-td
:props=
"props"
>
<div
class=
"text-blue cursor-pointer"
>
{{
props
.
value
}}
</div>
</q-td>
...
...
@@ -46,9 +46,8 @@
</
template
>
<
template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-toggle
disable
size=
"md"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"props.row.Status"
title=
"注意:关闭后,学员将无法正常使用."
/>
<!--@input="DeleteMenu(props.row)"-->
<q-toggle
disable
size=
"md"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"props.row.Status"
title=
"注意:关闭后,管理员将无法正常使用."
/>
</q-td>
</
template
>
<
template
v-slot:bottom
>
...
...
@@ -59,69 +58,57 @@
<q-td
:props=
"props"
>
<div
style=
"min-width:190px;width:100%"
>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-ziyuan"
color=
"warning"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
"重置密码"
@
click=
"resetPw(props.row.
Stu
Id)"
/>
label=
"重置密码"
@
click=
"resetPw(props.row.
M
Id)"
/>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
color=
"negative"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
"删除"
@
click=
"deleteUser(props.row.
Stu
Id)"
/>
class=
"q-mr-xs"
label=
"删除"
@
click=
"deleteUser(props.row.
M
Id)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"Edit
Student
(props.row)"
/>
@
click=
"Edit
Manager
(props.row)"
/>
</div>
</q-td>
</
template
>
</q-table>
<
student-form
v-if=
"isShowStuForm"
:save-obj=
"stu
Option"
@
close=
"closeStuForm"
@
success=
"refreshPage"
>
</
student
-form>
<
manager-form
v-if=
"isShowManagerForm"
:save-obj=
"manager
Option"
@
close=
"closeStuForm"
@
success=
"refreshPage"
>
</
manager
-form>
</div>
</div>
</template>
<
script
>
import
{
getStudent
Page
,
queryManager
Page
,
getSchoolDropdown
,
delete
Student
delete
ManagerInfo
}
from
'../../api/school/index'
import
{
resetPassword
}
from
'../../api/users/user.js'
import
studentForm
from
'../../components/school/student/student
-form'
import
managerForm
from
'../../components/school/manager/manager
-form'
export
default
{
meta
:
{
title
:
"后台用户管理"
},
components
:
{
student
Form
,
manager
Form
,
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'
StuIcon
'
,
name
:
'
MHead
'
,
label
:
''
,
field
:
'
StuIcon
'
,
field
:
'
MHead
'
,
align
:
'left'
,
},
{
name
:
'
Stu
Name'
,
name
:
'
M
Name'
,
required
:
true
,
label
:
'
学员昵称
'
,
label
:
'
管理者姓名
'
,
align
:
'left'
,
field
:
row
=>
row
.
Stu
Name
field
:
row
=>
row
.
M
Name
},
{
name
:
'StuSex'
,
label
:
'性别'
,
field
:
'StuSex'
,
align
:
'left'
},
{
name
:
'StuBirthStr'
,
label
:
'出生日期'
,
field
:
'StuBirthStr'
,
align
:
'left'
},
{
name
:
'StuTel'
,
name
:
'MTel'
,
label
:
'手机号码'
,
field
:
'
Stu
Tel'
,
field
:
'
M
Tel'
,
align
:
'left'
},
{
...
...
@@ -130,12 +117,7 @@
field
:
'SName'
,
align
:
'left'
,
},
{
name
:
'AreaName'
,
label
:
'区域'
,
field
:
'AreaName'
,
align
:
'left'
,
},
{
name
:
'Status'
,
label
:
'状态'
,
...
...
@@ -150,14 +132,14 @@
},
{
name
:
'CreateTimeStr'
,
label
:
'
入学
时间'
,
label
:
'
创建
时间'
,
align
:
'left'
,
field
:
'CreateTimeStr'
},
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'
Stu
Id'
field
:
'
M
Id'
}
],
data
:
[],
...
...
@@ -179,23 +161,23 @@
pageIndex
:
1
,
pageSize
:
12
,
rowsPerPage
:
12
,
Stu
Name
:
""
,
Stu
Tel
:
""
,
M
Name
:
""
,
M
Tel
:
""
,
Status
:
"-1"
,
School_Id
:
0
School_Id
:
0
,
},
schoolTemp
:
""
,
pageCount
:
0
,
stu
Option
:
null
,
manager
Option
:
null
,
schoolList
:
[],
isShow
Stu
Form
:
false
,
isShow
Manager
Form
:
false
,
resetLoading
:
false
}
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
this
.
getSchool
()
this
.
get
Student
()
this
.
get
Manager
()
},
methods
:
{
resetSearch
()
{
...
...
@@ -205,7 +187,7 @@
}
else
{
this
.
msg
.
School_Id
=
0
}
this
.
get
Student
()
this
.
get
Manager
()
},
resetPw
(
id
)
{
let
that
=
this
...
...
@@ -225,7 +207,7 @@
}).
onOk
(()
=>
{
that
.
resetLoading
=
true
resetPassword
({
AccountType
:
4
,
AccountType
:
1
,
AccountId
:
id
}).
then
(
res
=>
{
that
.
resetLoading
=
false
...
...
@@ -247,8 +229,8 @@
deleteUser
(
id
)
{
let
that
=
this
this
.
$q
.
dialog
({
title
:
"删除
学员
"
,
message
:
"你正在进行删除
学员
行为,一旦执行无法找回,是否确认执行?"
,
title
:
"删除
管理者
"
,
message
:
"你正在进行删除
管理者
行为,一旦执行无法找回,是否确认执行?"
,
persistent
:
true
,
cancel
:
{
label
:
"取消"
,
...
...
@@ -261,8 +243,8 @@
}
}).
onOk
(()
=>
{
that
.
resetLoading
=
true
delete
Student
({
Stu
Id
:
id
delete
ManagerInfo
({
M
Id
:
id
}).
then
(
res
=>
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
...
...
@@ -271,22 +253,22 @@
message
:
'数据删除成功!'
,
position
:
'top'
})
this
.
get
Student
()
this
.
get
Manager
()
})
});
},
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
get
Student
();
this
.
get
Manager
();
},
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
})
},
get
Student
()
{
get
Manager
()
{
this
.
loading
=
true
;
getStudent
Page
(
this
.
msg
).
then
(
res
=>
{
queryManager
Page
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
...
...
@@ -295,25 +277,25 @@
})
},
refreshPage
()
{
if
(
!
this
.
stu
Option
)
{
if
(
!
this
.
manager
Option
)
{
this
.
msg
.
pageIndex
=
1
;
this
.
msg
.
Stu
Name
=
""
;
this
.
msg
.
Stu
Tel
=
""
;
this
.
msg
.
M
Name
=
""
;
this
.
msg
.
M
Tel
=
""
;
this
.
msg
.
Status
=
"-1"
;
this
.
msg
.
School_Id
=
0
;
}
this
.
get
Student
()
this
.
get
Manager
()
},
Edit
Student
(
obj
)
{
Edit
Manager
(
obj
)
{
if
(
obj
)
{
this
.
stu
Option
=
obj
;
this
.
manager
Option
=
obj
;
}
else
{
this
.
stu
Option
=
null
;
this
.
manager
Option
=
null
;
}
this
.
isShow
Stu
Form
=
true
;
this
.
isShow
Manager
Form
=
true
;
},
closeStuForm
()
{
this
.
isShow
Stu
Form
=
false
;
this
.
isShow
Manager
Form
=
false
;
}
},
}
...
...
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