forked from annv/MinigameTest
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
|
|
const table = {
|
||
|
|
// Tạo bảng kiểm tra
|
||
|
|
renderTableCheck,
|
||
|
|
createCheckList,
|
||
|
|
}
|
||
|
|
module.exports = table;
|
||
|
|
|
||
|
|
// Tạo danh sách kiểm tra
|
||
|
|
function createCheckList(checkList) {
|
||
|
|
let finfalList = '';
|
||
|
|
checkList.forEach((item, index) => {
|
||
|
|
finfalList += `
|
||
|
|
<tr>
|
||
|
|
<td style="text-align:center">${index + 1}</td>
|
||
|
|
<td>${item.label}</td>
|
||
|
|
<td id='js-${item.id}' style="text-align:center">Wait</td>
|
||
|
|
</tr>
|
||
|
|
`;
|
||
|
|
})
|
||
|
|
return finfalList;
|
||
|
|
}
|
||
|
|
|
||
|
|
function renderTableCheck(checkListTable) {
|
||
|
|
$("body").append(`
|
||
|
|
<div id="js-table-check"
|
||
|
|
style="position:fixed;right:10px;bottom:50px;background:#fff;box-shadow:0 1px 5px rgb(0 0 0 / 30%);padding:20px;">
|
||
|
|
<h2 class="text-center font-weight-700 mb-4">BẢNG KIỂM TRA AUTO-TEST</h2>
|
||
|
|
<table>
|
||
|
|
<tr>
|
||
|
|
<th style="padding:10px;">STT</th>
|
||
|
|
<th style="padding:10px;">Công việc</th>
|
||
|
|
<th style="padding:10px;">Kết quả</th>
|
||
|
|
</tr>
|
||
|
|
${checkListTable}
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
`);
|
||
|
|
}
|