diff --git a/WebRoot/html/dangjian/view/taskManageList.html b/WebRoot/html/dangjian/view/taskManageList.html index fd77f3b..cc72220 100644 --- a/WebRoot/html/dangjian/view/taskManageList.html +++ b/WebRoot/html/dangjian/view/taskManageList.html @@ -22,6 +22,11 @@ + + @@ -34,12 +39,13 @@ let cols = [ [ - { field: 'num', title: '名次', align: 'center', width: "10%" } + { field: 'num', title: '名次', align: 'center', width: "5%" } , { field: 'person_name', title: '姓名', align: 'center' } , { field: 'score', title: '得分', align: 'center', width: "10%" } , { field: 'start_time', title: '开始时间', align: 'center', width: "20%" } , { field: 'end_time', title: '交卷时间', align: 'center', width: "20%" } - , { field: 'ys', title: '用时', align: 'center', width: "20%" } + , { field: 'ys', title: '用时', align: 'center', width: "20%" } + , { field: '', title: '操作', toolbar: '#tableOperate', align: 'center', width: "5%" } ] ] @@ -61,15 +67,55 @@ defaultToolbar: [] }); } - + table.on('toolbar(task-table)', function (data) { if (data.event === 'add') { window.location = "/FengHuang/exam/exportExcel"; } - }); + }); + + table.on('tool(task-table)', function (data) { + if (data.event === 'remove') { + rankRemove(data.data.person_id); + } + }); + + + window.rankRemove = function (personId) { + layer.confirm('确定要删除该条数据吗?', { + icon: 3, + title: '提示' + }, function (index) { + $.ajax({ + url: "/FengHuang/exam/delPerson", + data: { "person_id": personId }, + type: 'POST', + success: function (result) { + console.log(result) + if (result.success) { + layer.msg("删除成功!", { + icon: 1, + time: 1000 + }, function () { + refresh(); + }); + } else { + layer.msg(result.msg, { + icon: 2, + time: 1000 + }); + } + } + }) + }); + } + + window.refresh = function (param) { + table.reload('task-table'); + } + - })