refactor: change table column

This commit is contained in:
lbaf23 2021-08-03 13:31:24 +08:00
parent caabfd7f92
commit 109ae2a10d
5 changed files with 20 additions and 21 deletions

View File

@ -227,7 +227,6 @@ func (p *ProjectController) UpdateProjectWeight() {
}
pid, err := p.GetInt64(":id")
learnMinuteWeight, err := p.GetInt("learnMinuteWeight")
learnMinute, err := p.GetInt("learnMinute")
if err != nil {
resp = Response{
@ -241,7 +240,6 @@ func (p *ProjectController) UpdateProjectWeight() {
project := models.Project{
Id: pid,
LearnMinuteWeight: learnMinuteWeight,
LearnMinute: learnMinute,
}
tasks := make([]models.Task, 0)
err = json.Unmarshal([]byte(p.GetString("tasks")), &tasks)

View File

@ -11,14 +11,14 @@ type TaskResponse struct {
Learning bool `json:"learning"`
}
// GetSectionTasks
// GetSectionTasksDetail
// @Title
// @Description get all the tasks of a section
// @Description get section tasks with submit and survey
// @Param sid path string true ""
// @Success 200 {object}
// @Success 200 {object} TaskResponse
// @Failure 400
// @router /:projectId/section/:sectionId/tasks [get]
func (p *ProjectController) GetSectionTasks() {
func (p *ProjectController) GetSectionTasksDetail() {
var resp TaskResponse
sid := p.GetString(":sectionId")
var learning bool

View File

@ -28,7 +28,6 @@ type Project struct {
Published bool `json:"published" xorm:"default false index"`
LearnMinute int `json:"learnMinute" xorm:"default 10"`
LearnMinuteWeight int `json:"learnMinuteWeight" xorm:"default 100"`
}

View File

@ -68,21 +68,23 @@ function StudentAdmin(obj) {
<span>{util.FilterTime(joinTime)}</span>
)
},
{
title: '',
dataIndex: 'showEvidence',
render: (text, item, index) => (
<Link to={`/project/${pid}/student/${item.studentId}/evidence`}>
<Button type="text" >查看学习证据</Button>
</Link>
)
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
render: (action, record) => (
<>
<Tooltip placement="topLeft" title="点击查看学习证据">
<Link to={`/project/${pid}/student/${record.studentId}/evidence`}>
<Button type="text" icon={<ArrowRightOutlined />} style={{marginRight: '30px', width: '50px'}}/>
</Link>
</Tooltip>
<Popconfirm title="确定移除学生?" onConfirm={e=>removeStudent(action, record)}>
render: (action, item) => (
<Popconfirm title="确定移除学生?" onConfirm={e=>removeStudent(action, item)}>
<Button shape="circle" type="text" style={{color: 'red'}} icon={<DeleteOutlined/>}/>
</Popconfirm>
</>
)
},
]}

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})
@ -207,7 +207,7 @@ func init() {
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
beego.ControllerComments{
Method: "GetSectionTasks",
Method: "GetSectionTasksDetail",
Router: "/:projectId/section/:sectionId/tasks",
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),