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
7fbd5d6b
Commit
7fbd5d6b
authored
Oct 21, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
76421d2f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
264 additions
and
42 deletions
+264
-42
common.js
src/api/common/common.js
+24
-11
assistant-form.vue
src/components/school/assistant/assistant-form.vue
+2
-2
student-form.vue
src/components/school/student/student-form.vue
+203
-0
student.vue
src/pages/school/student.vue
+35
-29
No files found.
src/api/common/common.js
View file @
7fbd5d6b
import
request
from
'../../utils/request'
import
request
from
'../../utils/request'
/**
* 获取富文本编辑器Toolbar
*/
export
function
getToolBarConfig
()
{
return
[];
}
/**
/**
* 获取富文本编辑器Font
* 获取富文本编辑器Font
*/
*/
...
@@ -59,3 +50,25 @@ export function UploadSelfFile(path, file, callback) {
...
@@ -59,3 +50,25 @@ export function UploadSelfFile(path, file, callback) {
xhr
.
open
(
'post'
,
url
,
true
)
xhr
.
open
(
'post'
,
url
,
true
)
xhr
.
send
(
formData
)
xhr
.
send
(
formData
)
}
}
/**
* 获取省市区
*/
export
function
queryAreaTree
(
data
)
{
return
request
({
url
:
'/Public/GetAreaTree'
,
method
:
'post'
,
data
})
}
/**
* 获取省市区列表
*/
export
function
queryAreaList
(
data
)
{
return
request
({
url
:
'/Public/GetAreaList'
,
method
:
'post'
,
data
})
}
src/components/school/assistant/assistant-form.vue
View file @
7fbd5d6b
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</q-uploader>
</q-uploader>
</div>
</div>
</div>
</div>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
讲师
介绍
</div>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
助教
介绍
</div>
<ext-editor
:defaultMsg=
"objOption.AssistIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
<ext-editor
:defaultMsg=
"objOption.AssistIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
</q-card-section>
</q-card-section>
<q-separator
/>
<q-separator
/>
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
})
})
},
},
onRejected
(
rejectedEntries
)
{
onRejected
(
rejectedEntries
)
{
this
.
this
.
$q
.
notify
({
this
.
$q
.
notify
({
type
:
'negative'
,
type
:
'negative'
,
position
:
"top"
,
position
:
"top"
,
message
:
`文件验证失败,请重新上传`
message
:
`文件验证失败,请重新上传`
...
...
src/components/school/student/student-form.vue
0 → 100644
View file @
7fbd5d6b
<
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.StuName"
ref=
"StuName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"学员名称"
:rules=
"[val => !!val || '请填写学员姓名']"
/>
<q-select
filled
stack-label
option-value=
"value"
option-label=
"label"
v-model=
"objOption.StuSex"
ref=
"StuSex"
:options=
"SexOpts"
label=
"性别"
:dense=
"false"
class=
"col-6 q-pb-lg q-pb-lg"
emit-value
map-options
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.StuBirth"
ref=
"StuBirth"
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.StuTel"
ref=
"StuTel"
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.StuIcon + ')'}" 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>
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"objOption.School_Id"
ref=
"School_Id"
:options=
"schoolList"
label=
"所属校区"
:dense=
"false"
class=
"col-6 q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择所属校区']"
/>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"objOption.ProviceId"
ref=
"ProviceId"
:options=
"ProviceList"
label=
"省"
:dense=
"false"
class=
"col-6 q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择省份']"
@
input=
"getAreaTree(2,objOption.ProviceId)"
/>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"objOption.CityId"
ref=
"CityId"
:options=
"CityList"
label=
"市"
:dense=
"false"
class=
"col-6 q-pb-lg q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择城市']"
@
input=
"getAreaTree(3,objOption.CityId)"
/>
<q-select
filled
stack-label
option-value=
"ID"
option-label=
"Name"
v-model=
"objOption.AreaId"
ref=
"AreaId"
:options=
"AreaList"
label=
"区/县"
:dense=
"false"
class=
"col-6 q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择区域']"
/>
</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
,
saveStudent
}
from
'../../../api/school/index'
import
{
UploadSelfFile
,
queryAreaList
}
from
'../../../api/common/common'
export
default
{
components
:
{
},
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
objOption
:
{
StuId
:
0
,
//学生编号
School_Id
:
0
,
//学校编号
StuName
:
""
,
//学生姓名
StuTel
:
''
,
//学生电话
StuIcon
:
''
,
//学生头像
StuSex
:
0
,
//性别
StuBirth
:
""
,
//出生日期
ProviceId
:
0
,
//省份编号
CityId
:
0
,
//城市编号
AreaId
:
0
,
//地区编号
},
SexOpts
:
[{
label
:
'男'
,
value
:
0
},
{
label
:
'女'
,
value
:
1
},
],
optionTitle
:
""
,
schoolList
:
[],
saveLoading
:
false
,
ProviceList
:
[],
//省份列表
CityList
:
[],
//城市列表
AreaList
:
[],
//地区列表
}
},
created
()
{
this
.
getSchool
();
},
mounted
()
{
this
.
getAreaTree
(
1
,
1
);
this
.
initObj
()
},
methods
:
{
getAreaTree
(
type
,
parentId
)
{
queryAreaList
({
ParentID
:
parentId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
if
(
type
==
1
)
{
this
.
ProviceList
=
res
.
Data
;
}
else
if
(
type
==
2
)
{
this
.
CityList
=
res
.
Data
;
}
else
if
(
type
==
3
)
{
this
.
AreaList
=
res
.
Data
;
}
this
.
$forceUpdate
();
}
});
},
initObj
()
{
if
(
this
.
saveObj
)
{
this
.
optionTitle
=
"修改学员信息"
this
.
objOption
.
StuId
=
this
.
saveObj
.
StuId
;
this
.
objOption
.
School_Id
=
this
.
saveObj
.
School_Id
;
this
.
objOption
.
StuName
=
this
.
saveObj
.
StuName
;
this
.
objOption
.
StuTel
=
this
.
saveObj
.
StuTel
;
this
.
objOption
.
StuIcon
=
this
.
saveObj
.
StuIcon
;
this
.
objOption
.
StuSex
=
this
.
saveObj
.
StuSex
;
this
.
objOption
.
StuBirth
=
this
.
saveObj
.
StuBirthStr
;
this
.
getAreaTree
(
1
,
1
);
this
.
objOption
.
ProviceId
=
this
.
saveObj
.
ProviceId
;
if
(
this
.
saveObj
.
ProviceId
&&
this
.
saveObj
.
ProviceId
>
0
)
{
this
.
getAreaTree
(
2
,
this
.
saveObj
.
ProviceId
);
}
this
.
objOption
.
CityId
=
this
.
saveObj
.
CityId
;
if
(
this
.
saveObj
.
CityId
&&
this
.
saveObj
.
CityId
>
0
)
{
this
.
getAreaTree
(
3
,
this
.
saveObj
.
CityId
);
}
this
.
objOption
.
AreaId
=
this
.
saveObj
.
AreaId
;
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
.
StuIcon
=
res
.
FileUrl
;
}
})
},
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
setStudent
()
{
this
.
saveLoading
=
true
saveStudent
(
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/student.vue
View file @
7fbd5d6b
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</div>
</div>
</div>
</div>
<div
class=
"page-option"
>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增助教"
@
click=
"
addObj
(null)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增助教"
@
click=
"
EditStudent
(null)"
/>
<q-btn-dropdown
outline
color=
"dark"
label=
"更多"
>
<q-btn-dropdown
outline
color=
"dark"
label=
"更多"
>
<q-list>
<q-list>
<q-item
clickable
v-close-popup
>
<q-item
clickable
v-close-popup
>
...
@@ -53,6 +53,11 @@
...
@@ -53,6 +53,11 @@
<div
class=
"text-blue cursor-pointer"
>
{{
props
.
value
}}
</div>
<div
class=
"text-blue cursor-pointer"
>
{{
props
.
value
}}
</div>
</q-td>
</q-td>
</
template
>
</
template
>
<
template
v-slot:body-cell-StuSex=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==1?'女':'男'"
/>
</q-td>
</
template
>
<
template
v-slot:body-cell-IsDisable=
"props"
>
<
template
v-slot:body-cell-IsDisable=
"props"
>
<q-td
:props=
"props"
>
<q-td
:props=
"props"
>
<q-toggle
size=
"md"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"props.row.IsDisable"
<q-toggle
size=
"md"
color=
"primary"
:false-value=
"0"
:true-value=
"1"
v-model=
"props.row.IsDisable"
...
@@ -67,20 +72,18 @@
...
@@ -67,20 +72,18 @@
<
template
v-slot:body-cell-optioned=
"props"
>
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-td
:props=
"props"
>
<div
style=
"min-width:190px;width:100%"
>
<div
style=
"min-width:190px;width:100%"
>
<q-btn
v-if=
"props.row.AuditStatus==1"
flat
size=
"xs"
icon=
"iconfont icon-shenhe"
color=
"info"
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-ziyuan"
color=
"warning"
style=
"font-weight:400"
class=
"q-mr-xs"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
"审核"
@
click=
"showExamine(props.row)"
/>
label=
"重置密码"
@
click=
"resetPw(props.row.AId)"
/>
<q-btn
v-if=
"props.row.AuditStatus==2"
flat
size=
"xs"
icon=
"iconfont icon-ziyuan"
color=
"warning"
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
color=
"negative"
style=
"font-weight:400"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
"重置密码"
@
click=
"resetPw(props.row.AId)"
/>
class=
"q-mr-xs"
label=
"删除"
@
click=
"deleteUser(props.row.AId)"
/>
<q-btn
v-if=
"props.row.AuditStatus==3"
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
color=
"negative"
style=
"font-weight:400"
class=
"q-mr-xs"
label=
"删除"
@
click=
"deleteUser(props.row.AId)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"
addObj
(props.row)"
/>
@
click=
"
EditStudent
(props.row)"
/>
</div>
</div>
</q-td>
</q-td>
</
template
>
</
template
>
</q-table>
</q-table>
<
assista
nt-form
v-if=
"isShowStuForm"
:save-obj=
"stuOption"
@
close=
"closeStuForm"
@
success=
"refreshPage"
>
<
stude
nt-form
v-if=
"isShowStuForm"
:save-obj=
"stuOption"
@
close=
"closeStuForm"
@
success=
"refreshPage"
>
</
assista
nt-form>
</
stude
nt-form>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -94,15 +97,13 @@
...
@@ -94,15 +97,13 @@
import
{
import
{
resetPassword
resetPassword
}
from
'../../api/users/user.js'
}
from
'../../api/users/user.js'
import
assistantForm
from
'../../components/school/assistant/assistant-form'
import
studentForm
from
'../../components/school/student/student-form'
import
assistantShenhe
from
'../../components/school/assistant/assistant-shenhe'
export
default
{
export
default
{
meta
:
{
meta
:
{
title
:
"
助教
管理"
title
:
"
学员
管理"
},
},
components
:
{
components
:
{
assistantForm
,
studentForm
,
assistantShenhe
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -120,6 +121,12 @@
...
@@ -120,6 +121,12 @@
align
:
'left'
,
align
:
'left'
,
field
:
row
=>
row
.
StuName
field
:
row
=>
row
.
StuName
},
},
{
name
:
'StuSex'
,
label
:
'性别'
,
field
:
'StuSex'
,
align
:
'left'
},
{
{
name
:
'StuTel'
,
name
:
'StuTel'
,
label
:
'手机号码'
,
label
:
'手机号码'
,
...
@@ -132,6 +139,12 @@
...
@@ -132,6 +139,12 @@
field
:
'SName'
,
field
:
'SName'
,
align
:
'left'
,
align
:
'left'
,
},
},
{
name
:
'AreaName'
,
label
:
'区域'
,
field
:
'AreaName'
,
align
:
'left'
,
},
{
{
name
:
'IsDisable'
,
name
:
'IsDisable'
,
label
:
'状态'
,
label
:
'状态'
,
...
@@ -267,7 +280,7 @@
...
@@ -267,7 +280,7 @@
message
:
'数据删除成功!'
,
message
:
'数据删除成功!'
,
position
:
'top'
position
:
'top'
})
})
this
.
get
Assista
nt
()
this
.
get
Stude
nt
()
})
})
});
});
},
},
...
@@ -284,7 +297,6 @@
...
@@ -284,7 +297,6 @@
this
.
loading
=
true
;
this
.
loading
=
true
;
getStudentPage
(
this
.
msg
).
then
(
res
=>
{
getStudentPage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
console
.
log
(
"res.Data.PageData"
,
res
.
Data
.
PageData
);
this
.
data
=
res
.
Data
.
PageData
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
this
.
pageCount
=
res
.
Data
.
PageCount
}).
catch
(()
=>
{
}).
catch
(()
=>
{
...
@@ -299,29 +311,23 @@
...
@@ -299,29 +311,23 @@
this
.
msg
.
Status
=
"-1"
;
this
.
msg
.
Status
=
"-1"
;
this
.
msg
.
School_Id
=
0
;
this
.
msg
.
School_Id
=
0
;
}
}
this
.
get
Assista
nt
()
this
.
get
Stude
nt
()
},
},
addObj
(
obj
)
{
EditStudent
(
obj
)
{
if
(
obj
)
{
if
(
obj
)
{
this
.
stuOption
=
obj
this
.
stuOption
=
obj
;
}
else
{
}
else
{
this
.
stuOption
=
null
this
.
stuOption
=
null
;
}
}
this
.
isShowStuForm
=
false
this
.
isShowStuForm
=
true
;
},
showExamine
(
obj
)
{
this
.
stuOption
=
obj
this
.
isShowStuForm
=
true
},
},
closeStuForm
()
{
closeStuForm
()
{
this
.
isShowStuForm
=
false
;
this
.
isShowStuForm
=
false
}
}
},
},
}
}
</
script
>
</
script
>
<
style
lang=
"sass"
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass');
@import
url('~assets/css/table.sass');
...
...
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