fix: show count

This commit is contained in:
lbaf23 2021-08-06 18:21:01 +08:00
parent 0aeeb57f37
commit fa066e49d3
3 changed files with 9 additions and 7 deletions

View File

@ -132,6 +132,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
teacherScore := false
uid := user.Username
editable := true
showCount := false
pid := p.GetString(":projectId")
@ -140,6 +141,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
showSubmit = true
editable = false
teacherScore = true
showCount = true
}
if user.Tag != "student" {
learning = false
@ -169,6 +171,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
Learning: learning,
Editable: editable,
TeacherScore: teacherScore,
ShowCount: showCount,
}
}
p.ServeJSON()

View File

@ -75,9 +75,8 @@ function FillSurvey(obj) {
}
const showCount = e => {
const openCount = e => {
if (e.length > 0) {
console.log('draw')
}
}
const getOption = subIndex => {
@ -175,7 +174,7 @@ function FillSurvey(obj) {
</div>
{obj.showCount || obj.item.submitted ?
<div style={{textAlign: 'left', marginTop: '20px'}}>
<Collapse onChange={showCount}>
<Collapse onChange={openCount}>
<Collapse.Panel key={1} header="查看统计结果">
{obj.item.questions.map((subItem, subIndex)=>(
<div key={subIndex.toString()}>

View File

@ -45,18 +45,18 @@ func init() {
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
beego.ControllerComments{
Method: "GetProjectDetail",
Method: "UpdateProject",
Router: "/:id",
AllowHTTPMethods: []string{"get"},
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
beego.ControllerComments{
Method: "UpdateProject",
Method: "GetProjectDetail",
Router: "/:id",
AllowHTTPMethods: []string{"post"},
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})