upload labor
This commit is contained in:
commit
7ea4dec28e
19
labor/config.js
Normal file
19
labor/config.js
Normal 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")
|
||||
}
|
||||
]
|
BIN
labor/images/ui-icons_444444_256x240.png
Normal file
BIN
labor/images/ui-icons_444444_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
labor/images/ui-icons_555555_256x240.png
Normal file
BIN
labor/images/ui-icons_555555_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
labor/images/ui-icons_777620_256x240.png
Normal file
BIN
labor/images/ui-icons_777620_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
BIN
labor/images/ui-icons_777777_256x240.png
Normal file
BIN
labor/images/ui-icons_777777_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
labor/images/ui-icons_cc0000_256x240.png
Normal file
BIN
labor/images/ui-icons_cc0000_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
BIN
labor/images/ui-icons_ffffff_256x240.png
Normal file
BIN
labor/images/ui-icons_ffffff_256x240.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
26
labor/index.html
Normal file
26
labor/index.html
Normal 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
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
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
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
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
52
labor/main.js
Normal 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();
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user