upload labor

This commit is contained in:
18218461270@163.com 2025-09-20 17:59:12 +08:00
commit 7ea4dec28e
13 changed files with 117 additions and 0 deletions

19
labor/config.js Normal file
View File

@ -0,0 +1,19 @@
const groupStartDate = new Date("2025-9-9");
const project = [
{
name: "淋浴间台子",
interval: 2,
startDate: new Date("2025-9-9")
},
{
name: "公共区域地板",
interval: 7,
startDate: new Date("2025-9-9")
},
{
name: "公共区域桌子",
interval: 7,
startDate: new Date("2025-9-10")
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

26
labor/index.html Normal file
View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>7-453 值日排班</title>
<link rel="stylesheet" href="jquery-ui.min.css" />
<link rel="stylesheet" href="jquery-ui.theme.min.css" />
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script src="config.js"></script>
<script src="main.js"></script>
</head>
<body>
<p id="date"></p>
<p id="group"></p>
<p id="content"></p>
<p>
<button id="prev">昨天</button>
<button id="next">明天</button>
</p>
<p>
或者选择日期:
<input type="text" id="datepicker" />
</p>
</body>
</html>

7
labor/jquery-ui.min.css vendored Normal file

File diff suppressed because one or more lines are too long

6
labor/jquery-ui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
labor/jquery-ui.theme.min.css vendored Normal file

File diff suppressed because one or more lines are too long

2
labor/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

52
labor/main.js Normal file
View File

@ -0,0 +1,52 @@
let curDate = new Date();
function printDate(date) {
return date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日";
}
function render() {
$("#date").text(printDate(curDate));
const daysAfter = (curDate - groupStartDate) / 86400000;
$("#group").text("值日生房间号:" + ((daysAfter % 5) * 2 + 1) + "、" + ((daysAfter % 5) * 2 + 2));
let projects = "项目:";
let first = true;
project.forEach((x, _) => {
const daysAfter = (curDate - x.startDate) / 86400000;
if (daysAfter % x.interval === 0) {
if (!first) {
projects += "、";
}
first = false;
projects += x.name;
}
});
if (projects.length === 3) {
projects += "无";
}
$("#content").text(projects);
}
$(document).ready(() => {
$("#prev").click(() => {
curDate = new Date(curDate.getTime() - 86400000);
render();
});
$("#next").click(() => {
curDate = new Date(curDate.getTime() + 86400000);
render();
});
$("#datepicker").datepicker({
showOtherMonths: true,
selectOtherMonths: true
});
$("#datepicker").change(function() {
curDate = new Date($(this).val());
render();
});
curDate = new Date();
curDate.setHours(0, 0, 0, 0);
render();
});