GZMachinesWeb/WebContent/WEB-INF/views/index/indexHome.jsp

1004 lines
29 KiB
Plaintext
Raw Normal View History

2025-06-20 17:47:53 +08:00
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="../baseset.jsp"%>
<!-- 预加载关键资源 -->
<link rel="stylesheet" href="${bonuspath}/static/css/index/indexHome.css" />
<%-- <script src="https://cdn.staticfile.org/echarts/5.4.3/echarts.min.js"></script>--%>
<%-- <link href="https://cdn.staticfile.org/twitter-bootstrap/4.6.0/css/bootstrap.min.css" rel="stylesheet">--%>
<%-- <link href="https://cdn.staticfile.org/layui/2.7.6/css/layui.css" rel="stylesheet">--%>
<%-- <script src="https://cdn.staticfile.org/layui/2.7.6/layui.min.js"></script>--%>
<!-- 预加载关键资源 -->
<script src="${bonuspath}/static/js/index/echarts.min.js"></script>
<link href="${bonuspath}/static/js/index/bootstrap.min.css" rel="stylesheet">
<link href="${bonuspath}/static/js/index/layui.css" rel="stylesheet">
<script src="${bonuspath}/static/js/index/layui.min.js"></script>
<!-- 在head中添加 -->
<script src="${bonuspath}/static/js/lunar-calendar/lunar-calendar.min.js"></script>
<style>
.equipment-types-block {
cursor: pointer;
}
.equipment-types-block:hover {
opacity: 0.9;
}
.equipment-types-container {
padding: 15px;
}
.filter-section {
margin-bottom: 15px;
padding: 15px;
background-color: #f8f8f8;
border-radius: 4px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
2025-07-04 16:32:00 +08:00
padding: 15px 0;
2025-06-20 17:47:53 +08:00
border-bottom: 1px solid #eee;
2025-07-04 16:32:00 +08:00
width: 100%;
2025-06-20 17:47:53 +08:00
}
.more-link {
font-size: 13px;
color: #666;
cursor: pointer;
transition: all 0.3s;
}
.more-link:hover {
color: #1E9FFF;
}
.tab-header {
margin: 0; /* 移除h4的默认margin */
}
.calendar-cell {
padding: 2px;
cursor: pointer;
}
.task-count {
font-size: 12px;
color: #666;
display: flex;
flex-direction: column;
gap: 2px;
}
.task-count span {
white-space: nowrap;
}
.quick-functions {
background: #fff;
border-radius: 8px;
padding: 15px;
margin-bottom: 20px;
box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.function-list {
display: flex;
flex-wrap: nowrap;
gap: 15px;
overflow-x: auto;
padding: 10px 0;
}
.function-item {
min-width: 100px;
padding: 12px 15px;
background: #f5f7fa;
border-radius: 6px;
text-align: center;
cursor: pointer;
transition: all 0.3s;
white-space: nowrap;
}
.function-item:hover {
background: #e6f7ff;
color: #1890ff;
}
.function-item i {
display: block;
font-size: 24px;
margin-bottom: 8px;
}
.function-item span {
font-size: 14px;
}
.section-title-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
}
.settings-btn {
cursor: pointer;
padding: 5px;
color: #666;
transition: all 0.3s;
}
.settings-btn:hover {
color: #1890ff;
}
/* 菜单设置弹窗样式 */
.menu-settings-dialog {
padding: 20px;
}
.menu-settings-list {
max-height: 500px;
overflow-y: auto;
}
.menu-item {
display: flex;
align-items: center;
padding: 10px;
border-bottom: 1px solid #eee;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-item label {
margin: 0;
padding-left: 10px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
}
.dialog-footer {
text-align: right;
padding-top: 20px;
border-top: 1px solid #eee;
}
.menu-item i {
font-size: 16px;
color: #666;
}
.menu-item input[type="checkbox"] {
margin: 0;
cursor: pointer;
}
2025-07-04 16:32:00 +08:00
/* 待办任务详细信息样式 */
.todo-desc {
font-size: 12px;
color: #999;
margin-top: 2px;
line-height: 1.4;
}
.todo-icon.other {
background: #ffa940;
}
.todo-item:hover {
background: #f5f5f5;
transition: all 0.3s;
}
.todo-content {
flex: 1;
padding-left: 10px;
}
.overview-card .todo-title {
font-weight: 600;
color: #333;
margin-bottom: 8px;
font-size: 14px;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.overview-card .todo-desc {
font-size: 11px;
color: #666;
margin-bottom: 4px;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 顶部待办事项表格样式 */
.overview-card .todo-list {
padding: 0;
position: relative;
min-height: 460px; /* 确保有足够的高度容纳分页控件 */
width: 100%; /* 确保占满容器宽度 */
}
.todo-table-container {
max-height: 420px;
overflow-y: auto;
border: 1px solid #e8e8e8;
border-radius: 8px;
padding-bottom: 40px; /* 为分页控件预留空间 */
width: 100%; /* 确保占满容器宽度 */
box-sizing: border-box; /* 包含边框在宽度内 */
display: block; /* 强制块级显示 */
margin: 0; /* 移除任何外边距 */
background: linear-gradient(to bottom, #fff 0%, #fafafa 100%);
}
/* 美化滚动条 */
.todo-table-container::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.todo-table-container::-webkit-scrollbar-track {
background: #f5f5f5;
border-radius: 4px;
}
.todo-table-container::-webkit-scrollbar-thumb {
background: #ddd;
border-radius: 4px;
}
.todo-table-container::-webkit-scrollbar-thumb:hover {
background: #ccc;
}
.todo-table {
width: 100% !important;
border-collapse: collapse;
background: #fff;
table-layout: fixed;
margin: 0;
padding: 0;
display: table;
}
.todo-table thead th {
background: #fafafa;
color: #333;
font-weight: 600;
padding: 12px 8px;
text-align: left;
border-bottom: 2px solid #e8e8e8;
font-size: 14px;
position: sticky;
top: 0;
z-index: 10;
}
/* 列宽分配 */
.todo-table th:nth-child(1),
.todo-table td:nth-child(1) {
width: 12% !important;
}
.todo-table th:nth-child(2),
.todo-table td:nth-child(2) {
width: 35% !important;
}
.todo-table th:nth-child(3),
.todo-table td:nth-child(3) {
width: 28% !important;
}
.todo-table th:nth-child(4),
.todo-table td:nth-child(4) {
width: 12% !important;
}
.todo-table th:nth-child(5),
.todo-table td:nth-child(5) {
width: 13% !important;
}
.todo-table tbody tr {
cursor: pointer;
transition: all 0.3s;
position: relative;
margin: 4px 0;
border-bottom: 1px solid #f0f0f0;
}
.todo-table tbody tr:hover {
background: #f8f9fa;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
z-index: 5;
}
.todo-table tbody tr:active {
background: #e6f7ff;
transition: background 0.1s;
}
.todo-table tbody tr:last-child {
border-bottom: none;
}
.todo-table tbody tr:nth-child(even) {
background: #fafafa;
}
.todo-table tbody tr:nth-child(even):hover {
background: #f8f9fa;
}
.todo-table tbody tr:after {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background: linear-gradient(to right, transparent, #e8e8e8, transparent);
}
.todo-table tbody td {
padding: 14px 10px;
vertical-align: middle;
font-size: 13px;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border-right: 1px solid #f0f0f0;
position: relative;
}
.todo-table tbody td:last-child {
border-right: none;
}
.todo-table tbody td:not(:last-child):after {
content: '';
position: absolute;
top: 25%;
right: 0;
height: 50%;
width: 1px;
background-color: #f0f0f0;
}
.todo-type-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
border-radius: 4px;
margin-right: 8px;
vertical-align: middle;
font-size: 10px;
color: #fff;
font-weight: 600;
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.todo-type-icon.new {
background: linear-gradient(135deg, #52c41a, #389e0d);
}
.todo-type-icon.out {
background: linear-gradient(135deg, #1890ff, #096dd9);
}
.todo-type-icon.return {
background: linear-gradient(135deg, #fa8c16, #d46b08);
}
.todo-type-icon.other {
background: linear-gradient(135deg, #722ed1, #531dab);
}
.todo-type-text {
display: inline-block;
vertical-align: middle;
font-weight: 500;
}
.todo-task-name {
font-weight: 500;
color: #1890ff;
position: relative;
padding-left: 2px;
}
.todo-task-name:hover {
color: #40a9ff;
text-decoration: underline;
}
.todo-code {
color: #666;
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
font-size: 12px;
border: 1px solid #eee;
}
.todo-user {
color: #333;
font-weight: 500;
background: #f9f9f9;
padding: 2px 6px;
border-radius: 12px;
display: inline-block;
border: 1px solid #f0f0f0;
}
.todo-time {
color: #999;
font-size: 12px;
white-space: nowrap;
}
/* 分页样式 */
.todo-pagination {
position: absolute;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 15px;
background: rgba(250, 250, 250, 0.95);
border-top: 1px solid #e8e8e8;
font-size: 12px;
z-index: 20;
backdrop-filter: blur(2px);
}
.todo-pagination .pagination-info {
color: #666;
font-size: 11px;
}
.todo-pagination .pagination-controls {
display: flex;
gap: 6px;
align-items: center;
}
.todo-pagination button {
padding: 3px 8px;
border: 1px solid #d9d9d9;
background: rgba(255, 255, 255, 0.9);
color: #333;
cursor: pointer;
border-radius: 3px;
font-size: 11px;
transition: all 0.2s;
min-width: 60px;
}
.todo-pagination button:hover:not(:disabled) {
border-color: #1890ff;
color: #1890ff;
background: rgba(24, 144, 255, 0.05);
}
.todo-pagination button:disabled {
background: rgba(245, 245, 245, 0.9);
color: #ccc;
cursor: not-allowed;
}
.todo-pagination .page-size-selector {
margin-left: 12px;
color: #666;
font-size: 11px;
}
.todo-pagination select {
padding: 2px 4px;
border: 1px solid #d9d9d9;
border-radius: 3px;
font-size: 11px;
margin-left: 4px;
background: rgba(255, 255, 255, 0.9);
}
#todoPageInfo {
font-size: 11px;
color: #666;
min-width: 40px;
text-align: center;
}
2025-06-20 17:47:53 +08:00
.month-stat-value {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 10px;
background: #f8f9fa;
border-radius: 4px;
margin-bottom: 10px;
}
.stat-item {
display: flex;
align-items: center;
gap: 5px;
padding: 5px 10px;
background: #fff;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.stat-label {
color: #666;
font-size: 13px;
}
.stat-number {
color: #1890ff;
font-weight: bold;
font-size: 14px;
}
title{
font-size: 16px;
}
</style>
</head>
<body>
<div class="dashboard">
<!-- 添加常用功能区域 -->
2025-07-04 16:32:00 +08:00
<div class="container-fluid" style="width: 100%; max-width: none; padding: 20px 0;">
<!-- 待办事项区域 - 占满一行 -->
<div style="width: 100%; display: block; margin: 0; padding: 0;">
<div style="width: 100%; display: block; margin: 0; padding: 0;">
<div style="width: 100%; display: block; background: #fff; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05);">
<div style="width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid #eee; background: linear-gradient(to right, #f9f9f9, #fff);">
<h4 style="margin: 0; font-size: 16px; font-weight: 600; color: #333; position: relative; padding-left: 15px;">
<span style="position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 18px; background: #1890ff; border-radius: 2px;"></span>
待办事项
</h4>
<a style="font-size: 13px; color: #1890ff; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: all 0.3s;" onmouseover="this.style.color='#40a9ff'" onmouseout="this.style.color='#1890ff'" onclick="showTodoList()">
查看更多 <span style="font-size: 12px;">▶</span>
</a>
</div>
<div style="width: 100%; padding: 0; position: relative; min-height: 440px;">
<!-- 待办事项表格将通过JavaScript动态生成 -->
<div style="width: 100%; max-height: 400px; overflow-y: auto; border: 1px solid #e8e8e8; border-radius: 8px; padding-bottom: 40px; display: block; margin: 15px 0 15px 0; box-shadow: 0 1px 6px rgba(0,0,0,0.05) inset;">
<table style="width: 100%; border: 1px solid #e8e8e8; border-collapse: separate; border-spacing: 0; background: #fff; table-layout: fixed; margin: 0; padding: 0; display: table; border-spacing: 0 1px;">
<thead>
<tr>
<th style="width: 12%; background: linear-gradient(to bottom, #fafafa, #f5f5f5); color: #333; font-weight: 600; padding: 14px 10px; text-align: left; border-bottom: 2px solid #1890ff; font-size: 14px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-right: 1px solid #e0e0e0;">任务类型</th>
<th style="width: 35%; background: linear-gradient(to bottom, #fafafa, #f5f5f5); color: #333; font-weight: 600; padding: 14px 10px; text-align: left; border-bottom: 2px solid #1890ff; font-size: 14px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-right: 1px solid #e0e0e0;">任务名称</th>
<th style="width: 28%; background: linear-gradient(to bottom, #fafafa, #f5f5f5); color: #333; font-weight: 600; padding: 14px 10px; text-align: left; border-bottom: 2px solid #1890ff; font-size: 14px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-right: 1px solid #e0e0e0;">任务单号</th>
<th style="width: 12%; background: linear-gradient(to bottom, #fafafa, #f5f5f5); color: #333; font-weight: 600; padding: 14px 10px; text-align: left; border-bottom: 2px solid #1890ff; font-size: 14px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-right: 1px solid #e0e0e0;">创建人</th>
<th style="width: 13%; background: linear-gradient(to bottom, #fafafa, #f5f5f5); color: #333; font-weight: 600; padding: 14px 10px; text-align: left; border-bottom: 2px solid #1890ff; font-size: 14px; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">创建时间</th>
</tr>
<tr style="height: 6px; background: transparent;"><td colspan="5" style="padding: 0; border: none;"></td></tr>
</thead>
<tbody>
<tr>
<td colspan="5" style="text-align: center; color: #999; padding: 40px 30px;">
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
<div style="width: 40px; height: 40px; border: 3px solid #f3f3f3; border-top: 3px solid #1890ff; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px;"></div>
<span style="font-size: 14px; color: #666;">正在加载待办事项...</span>
<span style="font-size: 12px; color: #999; margin-top: 8px;">请稍候,数据加载中</span>
</div>
</td>
</tr>
</tbody>
</table>
<style>
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</div>
<div style="position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(250,250,250,0.95)); border-top: 1px solid #e8e8e8; font-size: 12px; z-index: 20; backdrop-filter: blur(2px); width: 100%; box-shadow: 0 -2px 6px rgba(0,0,0,0.03); border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;">
<div style="color: #666; font-size: 12px; display: flex; align-items: center;">
<span style="background: #f0f7ff; padding: 2px 6px; border-radius: 4px; border: 1px solid #e6f7ff; margin-right: 5px; color: #1890ff; font-weight: 500;">共 <span id="todoTotal" style="font-weight: 600;">0</span> 条</span>
<span style="color: #999;">每页 <span id="todoPageSize">10</span> 条</span>
</div>
<div style="display: flex; gap: 8px; align-items: center;">
<button id="todoPrevBtn" disabled style="padding: 4px 12px; border: 1px solid #d9d9d9; background: #fff; color: #333; cursor: pointer; border-radius: 4px; font-size: 12px; transition: all 0.2s; min-width: 60px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
<span style="display: flex; align-items: center; justify-content: center; gap: 3px;">
<span style="font-size: 10px;">◀</span> 上一页
</span>
</button>
<span id="todoPageInfo" style="font-size: 12px; color: #333; min-width: 50px; text-align: center; background: #f5f7fa; padding: 3px 8px; border-radius: 4px; font-weight: 500;">1 / 1</span>
<button id="todoNextBtn" disabled style="padding: 4px 12px; border: 1px solid #d9d9d9; background: #fff; color: #333; cursor: pointer; border-radius: 4px; font-size: 12px; transition: all 0.2s; min-width: 60px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
<span style="display: flex; align-items: center; justify-content: center; gap: 3px;">
下一页 <span style="font-size: 10px;">▶</span>
</span>
</button>
<div style="margin-left: 12px; color: #666; font-size: 12px; display: flex; align-items: center; border-left: 1px solid #eee; padding-left: 12px;">
<span style="margin-right: 5px;">每页显示</span>
<select id="todoPageSizeSelect" style="padding: 3px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; background: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.03);">
<option value="5">5条</option>
<option value="10" selected>10条</option>
<option value="15">15条</option>
<option value="20">20条</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="quick-functions" style="display: none ;">
2025-06-20 17:47:53 +08:00
<div class="section-title-wrapper">
<div class="section-title">常用功能</div>
<div class="settings-btn" onclick="showMenuSettingsDialog()">
<i class="layui-icon layui-icon-set"></i>
</div>
</div>
<div class="function-list" id="functionList">
<!-- 功能按钮将通过JS动态添加 -->
</div>
</div>
<!-- 差缺排名和预警信息 -->
<div class="row">
<div class="col-md-8">
<div class="overview-card">
<div class="card-header">
<h4 class="tab-header" onclick="showProjectDetail()">差缺排名</h4>
<a class="more-link" onclick="showProjectDetail()">查看更多 ></a>
</div>
<div id="rankingList" class="ranking-list">
<table class="table">
<thead>
<tr>
<th>排名</th>
<th>工程名称</th>
<th>领用量</th>
<th>退回量</th>
<th>差缺量</th>
</tr>
</thead>
<tbody id="rankingBody">
</tbody>
</table>
</div>
</div>
</div>
<div class="col-md-4">
<div class="overview-card" onclick="showWarningInfo()">
<div class="section-title">预警信息</div>
<div class="warning-grid">
<div class="warning-item">
<div class="warning-icon warning-stock"></div>
<div class="warning-content">
<div class="warning-left">
<div class="warning-title">库存不足</div>
<span class="warning-desc">等于0</span>
</div>
<div class="warning-right">
<span id="storageNum" class="warning-value">0</span>
</div>
</div>
</div>
<div class="warning-item">
<div class="warning-icon warning-check"></div>
<div class="warning-content">
<div class="warning-left">
<div class="warning-title">检验周期临近</div>
<span class="warning-desc">1个月</span>
</div>
<div class="warning-right">
<span id="checkTimeNum" class="warning-value">0</span>
</div>
</div>
</div>
<div class="warning-item">
<div class="warning-icon warning-occupy"></div>
<div class="warning-content">
<div class="warning-left">
<div class="warning-title">长期占用</div>
<span class="warning-desc">领用超6个月未归还</span>
</div>
<div class="warning-right">
<span id="useNum" class="warning-value">0</span>
</div>
</div>
</div>
<div class="warning-item">
<div class="warning-icon warning-change"></div>
<div class="warning-content">
<div class="warning-left">
<div class="warning-title">保有量变化</div>
<span class="warning-desc">近30天</span>
</div>
<div class="warning-right">
<span id="changeNum" class="warning-value">0</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 机具日历 -->
<div class="overview-card">
<h4>机具日历</h4>
<div id="equipmentCalendarTableNum" class="month-overview">
<div class="month-stat-item">
<span class="month-stat-label">领料出库</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">退料接收</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">维修检验</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">机具报废</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">修试后入库</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">新购入库</span>
<span class="month-stat-value">0</span>
</div>
<div class="month-stat-item">
<span class="month-stat-label">库存盘点</span>
<span class="month-stat-value">0</span>
</div>
</div>
<div id="equipmentCalendar" class="calendar-container"></div>
</div>
<!-- 数据概览 -->
<div class="overview-card">
<div class="overview-title">数据概览</div>
<div class="overview-blocks">
<div class="data-block blue-bg equipment-types-block" onclick="showProjectDetail()">
<h3 id="projectCount">0</h3>
<p>工程数量</p>
</div>
<div class="data-block blue-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="equipmentTypes">0</h3>
<p>机具类别</p>
</div>
<div class="data-block blue-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="totalCount">0</h3>
<p>保有量</p>
</div>
<div class="data-block blue-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="stockCount">0</h3>
<p>库存量</p>
</div>
<div class="data-block blue-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="inUseCount">0</h3>
<p>在用量</p>
</div>
<div class="data-block blue-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="repairCount">0</h3>
<p>在修量</p>
</div>
<div class="data-block red-bg equipment-types-block" onclick="showEquipmentTypes()">
<h3 id="scrappedCount">0</h3>
<p>报废量</p>
</div>
</div>
</div>
2025-07-04 16:32:00 +08:00
<!-- 入库占比图表 -->
2025-06-20 17:47:53 +08:00
<div class="row">
2025-07-04 16:32:00 +08:00
<div class="col-md-12">
2025-06-20 17:47:53 +08:00
<div class="overview-card">
<div class="section-title">入库占比&nbsp; &nbsp;&nbsp; / &nbsp;&nbsp;&nbsp;机具类别</div>
<div class="chart-grid">
<div id="storageChart1" class="chart-item" onclick="showEquipmentTypes()"></div>
<div id="storageChart2" class="chart-item" onclick="showEquipmentTypes()"></div>
<div id="storageChart3" class="chart-item" onclick="showEquipmentTypes()"></div>
<div id="storageChart4" class="chart-item" onclick="showEquipmentTypes()"></div>
<div id="storageChart5" class="chart-item" onclick="showEquipmentTypes()"></div>
<div id="storageChart6" class="chart-item" onclick="showEquipmentTypes()"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="${bonuspath}/static/js/index/jquery.min.js"></script>
<script src="${bonuspath}/static/js/index/layer.min.js"></script>
<script src="${bonuspath}/static/js/index/bootstrap.bundle.min.js"></script>
<script src="${bonuspath}/static/js/index/indexHome.js?v=1"></script>
<script src="${bonuspath}/static/js/sys/index.js"></script>
<script src="${bonuspath}/static/js/ace/ace-extra.min.js"></script>
<script src="${bonuspath}/static/js/bootstrap/bootstrap.min.js"></script>
<script src="${bonuspath}/static/js/ace/typeahead-bs2.min.js"></script>
<script src="${bonuspath}/static/js/ace/ace-elements.min.js"></script>
<script src="${bonuspath}/static/js/ace/ace.min.js"></script>
<script src="${bonuspath}/static/js/jquery/jquery-ui-1.10.3.full.min.js"></script>
<script src="${bonuspath}/static/js/jquery/jquery.md5.js"></script>
<script src="${bonuspath}/static/plugins/tabs/js/tab-control.min.js"></script>
<script src="${bonuspath}/static/js/sys/main.js"></script>
<script src="${bonuspath}/static/js/layer.js"></script>
<script>
// 将函数定义移到全局作用域
window.loadMenuSettings = async function() {
try {
const data = await window.request(window.API.getAllMenus);
if (!data || !Array.isArray(data)) {
console.warn('菜单数据格式不正确:', data);
return;
}
const menuList = document.getElementById('menuSettingsList');
if (!menuList) {
console.error('菜单列表容器不存在');
return;
}
// 清空现有内容
menuList.innerHTML = '';
// 渲染菜单项
data.forEach(menu => {
const menuItem = document.createElement('div');
menuItem.className = 'menu-item';
menuItem.innerHTML = `
<input type="checkbox"
id="menu_${menu.rsId}"
value="${menu.rsId}"
${menu.isCheck ? 'checked' : ''}>
<label for="menu_${menu.rsId}">
<i class="${menu.rsIcon || 'layui-icon-app'}"></i>
${menu.rsName}
</label>
`;
menuList.appendChild(menuItem);
});
} catch (error) {
console.error('加载菜单设置失败:', error);
layer.msg('加载菜单设置失败', {icon: 2});
}
}
window.saveMenuSettings = async function() {
try {
const menuList = document.getElementById('menuSettingsList');
if (!menuList) {
console.error('菜单列表容器不存在');
return;
}
// 获取所有选中的菜单ID
const checkedMenus = Array.from(menuList.querySelectorAll('input[type="checkbox"]:checked'))
.map(checkbox => checkbox.value);
// 调用保存接口
await window.request(window.API.saveMenuSettings, {
menuIds: JSON.stringify(checkedMenus)
});
layer.msg('保存成功', {icon: 1});
layer.closeAll('page');
// 重新加载常用功能
await window.initQuickFunctions();
} catch (error) {
console.error('保存菜单设置失败:', error);
layer.msg('保存失败', {icon: 2});
}
}
function showWarningInfo() {
layer.open({
type: 2,
title: '预警信息',
area: ['95%', '95%'],
content: '${bonuspath}/backstage/indexHome/warning/info',
btn: ['关闭'], // 添加关闭按钮
yes: function(index, layero) {
layer.close(index); // 关闭当前弹窗
}
});
}
function showEquipmentTypes() {
layer.open({
type: 2,
title: '机具类别明细',
area: ['1500px', '700px'],
content: '${bonuspath}/backstage/indexHome/dataOverview/equipment/index',
btn: ['关闭'], // 添加关闭按钮
yes: function(index, layero) {
layer.close(index); // 关闭当前弹窗
}
});
}
function showProjectDetail() {
layer.open({
type: 2,
title: '工程详情',
area: ['95%', '95%'],
content: '${bonuspath}/backstage/indexHome/dataOverview/project/index',
maxmin: false,
btn: ['关闭'], // 添加关闭按钮
yes: function(index, layero) {
layer.close(index); // 关闭当前弹窗
}
});
}
function showTodoList() {
layer.open({
type: 2,
title: '待办事项',
area: ['95%', '95%'],
content: '${bonuspath}/backstage/indexHome/todo/index',
maxmin: false,
btn: ['关闭'], // 添加关闭按钮
yes: function(index, layero) {
layer.close(index); // 关闭当前弹窗
}
});
}
function showMenuSettingsDialog() {
console.log('显示功能设置弹窗');
layer.open({
type: 2,
title: '常用功能设置',
area: ['900px', '500px'],
content: '${bonuspath}/backstage/indexHome/menuSettings/index',
maxmin: false,
scrollbar: false,
btn: ['确定', '取消'],
yes: function(index, layero) {
// 获取iframe页面的window对象
var iframeWin = window[layero.find('iframe')[0]['name']];
// 调用iframe页面的保存方法
iframeWin.saveSettings();
// 关闭弹窗
layer.close(index);
},
btn2: function(index, layero) {
layer.close(index);
},
success: function() {
console.log('弹窗打开成功,准备加载菜单设置');
}
});
}
</script>
</body>
</html>