|
|
@@ -0,0 +1,507 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="zh-CN">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <title>星级文明班级评比总表</title>
|
|
|
+ <style>
|
|
|
+ body {
|
|
|
+ margin: 18px;
|
|
|
+ color: #111;
|
|
|
+ background: #fff;
|
|
|
+ font-family: "Microsoft YaHei", sans-serif;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-area {
|
|
|
+ margin: 0 0 20px;
|
|
|
+ padding: 15px;
|
|
|
+ border: 1px solid #dee2e6;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: #f8f9fa;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-item {
|
|
|
+ display: inline-block;
|
|
|
+ margin-right: 20px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-item label {
|
|
|
+ margin-right: 5px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-btn,
|
|
|
+ .export-btn,
|
|
|
+ .reset-btn {
|
|
|
+ padding: 6px 15px;
|
|
|
+ border: none;
|
|
|
+ border-radius: 4px;
|
|
|
+ color: #fff;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .query-btn {
|
|
|
+ background-color: #007bff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .export-btn {
|
|
|
+ margin-left: 10px;
|
|
|
+ background-color: #28a745;
|
|
|
+ }
|
|
|
+
|
|
|
+ .reset-btn {
|
|
|
+ margin-left: 10px;
|
|
|
+ background-color: #dc3545;
|
|
|
+ }
|
|
|
+
|
|
|
+ select,
|
|
|
+ input[type="month"] {
|
|
|
+ width: 150px;
|
|
|
+ padding: 6px;
|
|
|
+ border: 1px solid #ced4da;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .report-title {
|
|
|
+ margin: 20px 0;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .report-info {
|
|
|
+ margin: -8px 0 12px;
|
|
|
+ text-align: right;
|
|
|
+ color: #555;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .report-info span {
|
|
|
+ margin-left: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ border-collapse: collapse;
|
|
|
+ font-size: 9pt;
|
|
|
+ }
|
|
|
+
|
|
|
+ table,
|
|
|
+ th,
|
|
|
+ td {
|
|
|
+ border: 1px solid #000;
|
|
|
+ }
|
|
|
+
|
|
|
+ th,
|
|
|
+ td {
|
|
|
+ padding: 6px 5px;
|
|
|
+ text-align: center;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ th {
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ tbody tr:hover {
|
|
|
+ background-color: #f7fbff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .total-cell {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .empty-row td {
|
|
|
+ padding: 40px 10px;
|
|
|
+ color: #777;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-footer {
|
|
|
+ margin-top: 10px;
|
|
|
+ color: #666;
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="query-area">
|
|
|
+ <div class="query-item">
|
|
|
+ <label for="departmentFilter">院系:</label>
|
|
|
+ <select id="departmentFilter">
|
|
|
+ <option value="">全部院系</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <label for="majorFilter">专业:</label>
|
|
|
+ <select id="majorFilter">
|
|
|
+ <option value="">全部专业</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <label for="classFilter">班级:</label>
|
|
|
+ <select id="classFilter">
|
|
|
+ <option value="">全部班级</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <label for="starFilter">星级:</label>
|
|
|
+ <select id="starFilter">
|
|
|
+ <option value="">全部星级</option>
|
|
|
+ <option value="五星级">五星级</option>
|
|
|
+ <option value="四星级">四星级</option>
|
|
|
+ <option value="三星级">三星级</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <label for="monthFilter">月份:</label>
|
|
|
+ <input type="month" id="monthFilter">
|
|
|
+ </div>
|
|
|
+ <button type="button" class="query-btn" id="searchButton">搜索</button>
|
|
|
+ <button type="button" class="export-btn" id="exportButton">导出Excel</button>
|
|
|
+ <button type="button" class="reset-btn" id="resetButton">清空</button>
|
|
|
+</div>
|
|
|
+
|
|
|
+<div class="report-title">星级文明班级评比总表</div>
|
|
|
+<div class="report-info">
|
|
|
+ <span>名称:星级文明班级评比总表</span>
|
|
|
+ <span>年份:<b id="yearText">-</b></span>
|
|
|
+ <span>月份:<b id="monthText">-</b></span>
|
|
|
+ <span>状态:<b id="statusText">演示数据</b></span>
|
|
|
+</div>
|
|
|
+
|
|
|
+<table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>院系</th>
|
|
|
+ <th>专业</th>
|
|
|
+ <th>班级</th>
|
|
|
+ <th>宿舍评分汇总<br>(20%)</th>
|
|
|
+ <th>课堂考核<br>(5%)</th>
|
|
|
+ <th>升旗礼广播操集会<br>(14%)</th>
|
|
|
+ <th>清洁卫生<br>(18%)</th>
|
|
|
+ <th>风纪仪容<br>(20%)</th>
|
|
|
+ <th>考勤<br>(15%)</th>
|
|
|
+ <th>增分</th>
|
|
|
+ <th>减分</th>
|
|
|
+ <th>月份合计</th>
|
|
|
+ <th>星级</th>
|
|
|
+ <th>部门排名</th>
|
|
|
+ <th>全校排名</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="reportBody"></tbody>
|
|
|
+</table>
|
|
|
+
|
|
|
+<div class="table-footer">
|
|
|
+ <span id="filterSummary">当前显示当前月份全部演示数据</span>
|
|
|
+ ,共 <b id="resultCount">0</b> 条
|
|
|
+</div>
|
|
|
+
|
|
|
+<script>
|
|
|
+ (function () {
|
|
|
+ "use strict";
|
|
|
+
|
|
|
+ const DEMO_ROWS = [
|
|
|
+ {
|
|
|
+ month: "2026-10",
|
|
|
+ department: "现代服务部",
|
|
|
+ major: "会计",
|
|
|
+ className: "25会计2",
|
|
|
+ dormScore: "89.41",
|
|
|
+ classroomScore: "100.0",
|
|
|
+ flagCeremonyScore: "72.0",
|
|
|
+ cleaningScore: "100.0",
|
|
|
+ disciplineScore: "100.0",
|
|
|
+ attendanceScore: "100.0",
|
|
|
+ bonus: "7.5",
|
|
|
+ deduction: "0.0",
|
|
|
+ monthTotal: "93.46",
|
|
|
+ starLevel: "五星级",
|
|
|
+ departmentRank: "1",
|
|
|
+ schoolRank: "1"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ month: "2026-10",
|
|
|
+ department: "服装技术部",
|
|
|
+ major: "服装陈列",
|
|
|
+ className: "25服5",
|
|
|
+ dormScore: "86.36",
|
|
|
+ classroomScore: "100.0",
|
|
|
+ flagCeremonyScore: "66.0",
|
|
|
+ cleaningScore: "100.0",
|
|
|
+ disciplineScore: "100.0",
|
|
|
+ attendanceScore: "100.0",
|
|
|
+ bonus: "7.0",
|
|
|
+ deduction: "0.0",
|
|
|
+ monthTotal: "91.51",
|
|
|
+ starLevel: "五星级",
|
|
|
+ departmentRank: "1",
|
|
|
+ schoolRank: "2"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ month: "2026-10",
|
|
|
+ department: "智能制造部",
|
|
|
+ major: "数控技术应用",
|
|
|
+ className: "24数控1",
|
|
|
+ dormScore: "85.20",
|
|
|
+ classroomScore: "98.0",
|
|
|
+ flagCeremonyScore: "70.0",
|
|
|
+ cleaningScore: "100.0",
|
|
|
+ disciplineScore: "100.0",
|
|
|
+ attendanceScore: "100.0",
|
|
|
+ bonus: "6.5",
|
|
|
+ deduction: "1.0",
|
|
|
+ monthTotal: "88.70",
|
|
|
+ starLevel: "四星级",
|
|
|
+ departmentRank: "2",
|
|
|
+ schoolRank: "4"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ month: "2026-09",
|
|
|
+ department: "现代服务部",
|
|
|
+ major: "电子商务",
|
|
|
+ className: "24电商1",
|
|
|
+ dormScore: "88.10",
|
|
|
+ classroomScore: "99.0",
|
|
|
+ flagCeremonyScore: "74.0",
|
|
|
+ cleaningScore: "100.0",
|
|
|
+ disciplineScore: "100.0",
|
|
|
+ attendanceScore: "100.0",
|
|
|
+ bonus: "7.2",
|
|
|
+ deduction: "0.0",
|
|
|
+ monthTotal: "92.80",
|
|
|
+ starLevel: "五星级",
|
|
|
+ departmentRank: "1",
|
|
|
+ schoolRank: "2"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ month: "2026-09",
|
|
|
+ department: "服装技术部",
|
|
|
+ major: "服装设计与工艺",
|
|
|
+ className: "24服2",
|
|
|
+ dormScore: "84.75",
|
|
|
+ classroomScore: "98.0",
|
|
|
+ flagCeremonyScore: "68.0",
|
|
|
+ cleaningScore: "100.0",
|
|
|
+ disciplineScore: "100.0",
|
|
|
+ attendanceScore: "99.0",
|
|
|
+ bonus: "6.8",
|
|
|
+ deduction: "0.5",
|
|
|
+ monthTotal: "87.42",
|
|
|
+ starLevel: "四星级",
|
|
|
+ departmentRank: "1",
|
|
|
+ schoolRank: "5"
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ const yearText = document.getElementById("yearText");
|
|
|
+ const monthText = document.getElementById("monthText");
|
|
|
+ const statusText = document.getElementById("statusText");
|
|
|
+ const reportBody = document.getElementById("reportBody");
|
|
|
+ const filterSummary = document.getElementById("filterSummary");
|
|
|
+ const resultCount = document.getElementById("resultCount");
|
|
|
+ const departmentFilter = document.getElementById("departmentFilter");
|
|
|
+ const majorFilter = document.getElementById("majorFilter");
|
|
|
+ const classFilter = document.getElementById("classFilter");
|
|
|
+ const starFilter = document.getElementById("starFilter");
|
|
|
+ const monthFilter = document.getElementById("monthFilter");
|
|
|
+
|
|
|
+ function getCurrentMonth() {
|
|
|
+ const now = new Date();
|
|
|
+ return now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, "0");
|
|
|
+ }
|
|
|
+
|
|
|
+ function uniqueValues(field) {
|
|
|
+ return Array.from(new Set(DEMO_ROWS.map(function (row) {
|
|
|
+ return row[field];
|
|
|
+ }).filter(Boolean))).sort(function (a, b) {
|
|
|
+ return a.localeCompare(b, "zh-CN");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function fillSelect(select, placeholder, values, selectedValue) {
|
|
|
+ select.innerHTML = "";
|
|
|
+ const defaultOption = document.createElement("option");
|
|
|
+ defaultOption.value = "";
|
|
|
+ defaultOption.textContent = placeholder;
|
|
|
+ select.appendChild(defaultOption);
|
|
|
+
|
|
|
+ values.forEach(function (value) {
|
|
|
+ const option = document.createElement("option");
|
|
|
+ option.value = value;
|
|
|
+ option.textContent = value;
|
|
|
+ select.appendChild(option);
|
|
|
+ });
|
|
|
+ select.value = selectedValue || "";
|
|
|
+ }
|
|
|
+
|
|
|
+ function initializeFilters() {
|
|
|
+ fillSelect(departmentFilter, "全部院系", uniqueValues("department"));
|
|
|
+ fillSelect(majorFilter, "全部专业", uniqueValues("major"));
|
|
|
+ fillSelect(classFilter, "全部班级", uniqueValues("className"));
|
|
|
+ }
|
|
|
+
|
|
|
+ function refreshMajorOptions() {
|
|
|
+ const department = departmentFilter.value;
|
|
|
+ const rows = department
|
|
|
+ ? DEMO_ROWS.filter(function (row) { return row.department === department; })
|
|
|
+ : DEMO_ROWS;
|
|
|
+ const previousMajor = majorFilter.value;
|
|
|
+ fillSelect(majorFilter, "全部专业", Array.from(new Set(rows.map(function (row) {
|
|
|
+ return row.major;
|
|
|
+ }))).sort(function (a, b) {
|
|
|
+ return a.localeCompare(b, "zh-CN");
|
|
|
+ }), previousMajor);
|
|
|
+ refreshClassOptions();
|
|
|
+ }
|
|
|
+
|
|
|
+ function refreshClassOptions() {
|
|
|
+ const rows = DEMO_ROWS.filter(function (row) {
|
|
|
+ return (!departmentFilter.value || row.department === departmentFilter.value)
|
|
|
+ && (!majorFilter.value || row.major === majorFilter.value);
|
|
|
+ });
|
|
|
+ const previousClass = classFilter.value;
|
|
|
+ fillSelect(classFilter, "全部班级", Array.from(new Set(rows.map(function (row) {
|
|
|
+ return row.className;
|
|
|
+ }))).sort(function (a, b) {
|
|
|
+ return a.localeCompare(b, "zh-CN");
|
|
|
+ }), previousClass);
|
|
|
+ }
|
|
|
+
|
|
|
+ function filterRows() {
|
|
|
+ return DEMO_ROWS.filter(function (row) {
|
|
|
+ return (!monthFilter.value || row.month === monthFilter.value)
|
|
|
+ && (!departmentFilter.value || row.department === departmentFilter.value)
|
|
|
+ && (!majorFilter.value || row.major === majorFilter.value)
|
|
|
+ && (!classFilter.value || row.className === classFilter.value)
|
|
|
+ && (!starFilter.value || row.starLevel === starFilter.value);
|
|
|
+ }).sort(function (a, b) {
|
|
|
+ if (a.month !== b.month) {
|
|
|
+ return b.month.localeCompare(a.month);
|
|
|
+ }
|
|
|
+ return Number(a.schoolRank) - Number(b.schoolRank);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function createCell(value, className) {
|
|
|
+ const cell = document.createElement("td");
|
|
|
+ cell.textContent = value == null || value === "" ? "-" : value;
|
|
|
+ if (className) {
|
|
|
+ cell.className = className;
|
|
|
+ }
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
+
|
|
|
+ function renderRows(rows) {
|
|
|
+ reportBody.innerHTML = "";
|
|
|
+ if (!rows.length) {
|
|
|
+ const emptyRow = document.createElement("tr");
|
|
|
+ emptyRow.className = "empty-row";
|
|
|
+ const emptyCell = document.createElement("td");
|
|
|
+ emptyCell.colSpan = 16;
|
|
|
+ emptyCell.textContent = "暂无数据";
|
|
|
+ emptyRow.appendChild(emptyCell);
|
|
|
+ reportBody.appendChild(emptyRow);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ rows.forEach(function (row, index) {
|
|
|
+ const tr = document.createElement("tr");
|
|
|
+ tr.appendChild(createCell(String(index + 1)));
|
|
|
+ tr.appendChild(createCell(row.department));
|
|
|
+ tr.appendChild(createCell(row.major));
|
|
|
+ tr.appendChild(createCell(row.className));
|
|
|
+ tr.appendChild(createCell(row.dormScore));
|
|
|
+ tr.appendChild(createCell(row.classroomScore));
|
|
|
+ tr.appendChild(createCell(row.flagCeremonyScore));
|
|
|
+ tr.appendChild(createCell(row.cleaningScore));
|
|
|
+ tr.appendChild(createCell(row.disciplineScore));
|
|
|
+ tr.appendChild(createCell(row.attendanceScore));
|
|
|
+ tr.appendChild(createCell(row.bonus));
|
|
|
+ tr.appendChild(createCell(row.deduction));
|
|
|
+ tr.appendChild(createCell(row.monthTotal, "total-cell"));
|
|
|
+ tr.appendChild(createCell(row.starLevel));
|
|
|
+ tr.appendChild(createCell(row.departmentRank));
|
|
|
+ tr.appendChild(createCell(row.schoolRank));
|
|
|
+ reportBody.appendChild(tr);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function updateInfo(rows) {
|
|
|
+ const parts = monthFilter.value.split("-");
|
|
|
+ yearText.textContent = parts[0] || "-";
|
|
|
+ monthText.textContent = parts[1] ? String(Number(parts[1])) : "-";
|
|
|
+ statusText.textContent = "演示数据";
|
|
|
+ resultCount.textContent = String(rows.length);
|
|
|
+
|
|
|
+ const selectedFilters = [
|
|
|
+ departmentFilter.value,
|
|
|
+ majorFilter.value,
|
|
|
+ classFilter.value,
|
|
|
+ starFilter.value
|
|
|
+ ].filter(Boolean);
|
|
|
+ filterSummary.textContent = selectedFilters.length
|
|
|
+ ? "筛选条件:" + selectedFilters.join(" / ")
|
|
|
+ : "当前显示当前月份全部演示数据";
|
|
|
+ }
|
|
|
+
|
|
|
+ function validateMonth() {
|
|
|
+ const currentMonth = getCurrentMonth();
|
|
|
+ if (!monthFilter.value) {
|
|
|
+ monthFilter.value = currentMonth;
|
|
|
+ }
|
|
|
+ if (monthFilter.value > currentMonth) {
|
|
|
+ window.alert("不能查询未来月份,已恢复为当前月份。");
|
|
|
+ monthFilter.value = currentMonth;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function executeSearch() {
|
|
|
+ validateMonth();
|
|
|
+ const rows = filterRows();
|
|
|
+ renderRows(rows);
|
|
|
+ updateInfo(rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ function resetFilters() {
|
|
|
+ departmentFilter.value = "";
|
|
|
+ fillSelect(majorFilter, "全部专业", uniqueValues("major"));
|
|
|
+ fillSelect(classFilter, "全部班级", uniqueValues("className"));
|
|
|
+ starFilter.value = "";
|
|
|
+ monthFilter.value = getCurrentMonth();
|
|
|
+ executeSearch();
|
|
|
+ }
|
|
|
+
|
|
|
+ departmentFilter.addEventListener("change", function () {
|
|
|
+ majorFilter.value = "";
|
|
|
+ classFilter.value = "";
|
|
|
+ refreshMajorOptions();
|
|
|
+ });
|
|
|
+
|
|
|
+ majorFilter.addEventListener("change", function () {
|
|
|
+ classFilter.value = "";
|
|
|
+ refreshClassOptions();
|
|
|
+ });
|
|
|
+
|
|
|
+ document.getElementById("searchButton").addEventListener("click", executeSearch);
|
|
|
+ document.getElementById("resetButton").addEventListener("click", resetFilters);
|
|
|
+ document.getElementById("exportButton").addEventListener("click", function () {
|
|
|
+ window.alert("当前为演示数据,真实数据接入后再开放导出功能。");
|
|
|
+ });
|
|
|
+ monthFilter.addEventListener("change", validateMonth);
|
|
|
+
|
|
|
+ const currentMonth = getCurrentMonth();
|
|
|
+ monthFilter.max = currentMonth;
|
|
|
+ monthFilter.value = currentMonth;
|
|
|
+ initializeFilters();
|
|
|
+ executeSearch();
|
|
|
+ }());
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|