diff --git a/config/routes.js b/config/routes.js index 98340aa..0694538 100644 --- a/config/routes.js +++ b/config/routes.js @@ -91,10 +91,16 @@ export default [ ] }, // 隐患排查 - { + { path:'/topnavbar00/hrefficiency/hiddentrouble', name: 'hiddentrouble', component: './hrefficiency_hiddentrouble/HiddenTrouble', + }, + // 安全教育培训 + { + path:'/topnavbar00/hrefficiency/safetraining', + name: 'safetraining', + component: './safe_training/SafeTrainingList', } ], }, diff --git a/src/assets/img/safeEducationLight.svg b/src/assets/img/safeEducationLight.svg new file mode 100644 index 0000000..a9e31d3 --- /dev/null +++ b/src/assets/img/safeEducationLight.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/nav_system_content/SystemContentList.js b/src/pages/nav_system_content/SystemContentList.js index 597d77f..2f96260 100644 --- a/src/pages/nav_system_content/SystemContentList.js +++ b/src/pages/nav_system_content/SystemContentList.js @@ -19,6 +19,7 @@ import danger1 from '@/assets/img/danger1.svg' import license from '@/assets/img/license.svg' import people from '@/assets/img/people.svg' import risk from '@/assets/img/risk.svg' +import safeEducationLight from '@/assets/img/safeEducationLight.svg' import { CustomBreadcrumb } from '@/components/GlobalComponent' @@ -117,12 +118,18 @@ const SystemContentList = (props) => { "key": "/topnavbar00/hrefficiency/allstaffuph", "label": "全员效率监控" }, - { + { "path": "/topnavbar00/hrefficiency/hiddentrouble", icon: 工时仪表盘, "key": "/topnavbar00/hrefficiency/hiddentrouble", "label": "隐患排查" }, + { + "path": "/topnavbar00/hrefficiency/safetraining", + icon: 安全教育培训, + "key": "/topnavbar00/hrefficiency/safetraining", + "label": "安全教育培训" + }, { "path": "/topnavbar00/hrefficiency/system", icon: 工时仪表盘, @@ -368,6 +375,10 @@ const SystemContentList = (props) => { else if (item.key === '/topnavbar00/hrefficiency/staffsheet' && typeof danger1 !== 'undefined') { iconSrc = danger1; } + // 安全教育培训激活态使用safeEducationLight + else if (item.key === '/topnavbar00/hrefficiency/safetraining' && typeof safeEducationLight !== 'undefined') { + iconSrc = safeEducationLight; + } } icon = , + }, + { + title: '季度计划', + count: 14, + completed: 10, + icon: , + }, + { + title: '月度计划', + count: 32, + completed: 3, + icon: , + }, + { + title: '进行中的计划', + count: 16, + status: '进行中', + icon: , + }, +]; + +// 系统通知模拟数据 +const notifications = [ + { + title: '技术团队转胎前培训即将开始', + time: '培训时间:2023-08-05,请提前准备相关材料', + duration: '55分钟前', + }, + { + title: '新功能上线:培训计划模板已更新', + time: '新增5个行业特色培训模板,查看者使用', + duration: '295分钟前', + }, + { + title: '新功能上线:培训计划模板已更新', + time: '新增5个行业特色培训模板,查看者使用', + duration: '309分钟前', + }, +]; + +// 待审批模拟数据 +const pendingApprovals = [ + { + id: '1', + title: '销售团队能力培训计划', + submitter: '张经理', + time: '2023-08-28', + status: '通过', + }, + { + id: '2', + title: '产品知识更新培训', + submitter: '李总监', + time: '2023-08-29', + status: '通过', + }, + { + id: '3', + title: '销售团队能力培训计划', + submitter: '张经理', + time: '2023-08-28', + status: '通过', + }, + { + id: '4', + title: '销售团队能力培训计划', + submitter: '张经理', + time: '2023-08-28', + status: '通过', + }, +]; + +// 培训完成情况分析数据 +const trainingCompletionData = { + title: { + text: '培训完成情况分析', + left: 'center', + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + }, + legend: { + data: ['完成率'], + bottom: 0, + }, + grid: { + left: '3%', + right: '4%', + bottom: '15%', + containLabel: true, + }, + xAxis: { + type: 'category', + data: ['新员工培训', '新员工培训', '新员工培训', '新员工培训', '新员工培训'], + }, + yAxis: { + type: 'value', + max: 100, + }, + series: [ + { + name: '完成率', + type: 'bar', + data: [90, 70, 95, 75, 85], + itemStyle: { + color: '#3F8600', + }, + }, + ], +}; + +// 满意度评分数据 +const satisfactionData = { + title: { + text: '满意度评分', + left: 'center', + }, + tooltip: { + trigger: 'item', + }, + legend: { + orient: 'vertical', + left: 'left', + data: ['非常满意', '满意', '一般', '不满意'], + }, + series: [ + { + name: '满意度', + type: 'pie', + radius: '60%', + data: [ + { + value: 60, + name: '非常满意', + itemStyle: { + color: '#1890ff', + }, + }, + { + value: 20, + name: '满意', + itemStyle: { + color: '#52c41a', + }, + }, + { + value: 15, + name: '一般', + itemStyle: { + color: '#faad14', + }, + }, + { + value: 5, + name: '不满意', + itemStyle: { + color: '#f5222d', + }, + }, + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)', + }, + }, + }, + ], +}; + +// 近期培训计划数据 +const recentTrainingData = [ + { + id: '1', + name: '新员工入职培训-Q3', + target: '全厂员工', + type: '线上直播', + date: '2023-08-10至2023-08-15', + progress: '20%', + status: '进行中', + }, + { + id: '2', + name: '新员工入职培训-Q3', + target: '全厂员工', + type: '线上直播', + date: '2023-08-10至2023-08-15', + progress: '40%', + status: '已完成', + }, + { + id: '3', + name: '新员工入职培训-Q3', + target: '全厂员工', + type: '线上直播', + date: '2023-08-10至2023-08-15', + progress: '20%', + status: '待审核', + }, + { + id: '4', + name: '新员工入职培训-Q3', + target: '全厂员工', + type: '线上直播', + date: '2023-08-10至2023-08-15', + progress: '20%', + status: '待审核', + }, + { + id: '5', + name: '新员工入职培训-Q3', + target: '全厂员工', + type: '线上直播', + date: '2023-08-10至2023-08-15', + progress: '20%', + status: '待审核', + }, +]; + +const SafeTrainingList = () => { + const [currentPage, setCurrentPage] = useState(1); + const [pageSize, setPageSize] = useState(5); + + // 处理状态标签颜色 + const getStatusTag = (status) => { + switch (status) { + case '进行中': + return 进行中; + case '已完成': + return 已完成; + case '待审核': + return 待审核; + case '通过': + return 通过; + default: + return {status}; + } + }; + + // 处理操作按钮 + const handleViewDetails = (record) => { + // 查看详情逻辑 + console.log('查看详情:', record); + }; + + // 处理审批操作 + const handleApprove = (id) => { + // 审批逻辑 + console.log('审批通过:', id); + }; + + // 处理驳回操作 + const handleReject = (id) => { + // 驳回逻辑 + console.log('驳回:', id); + }; + + return ( +
+ {/* 统计数据卡片 */} + + {statsData.map((item, index) => ( + + +
+
{item.icon}
+
+
{item.title}
+
{item.count}
+ {item.completed !== undefined && ( +
已完成 {item.completed} 项
+ )} + {item.status && ( +
{item.status}
+ )} +
+
+
+ + ))} +
+ + {/* 第二行:系统通知、图表区域 */} + + {/* 系统通知 */} + + + ( + + + {item.title}} + description={ + <> + {item.time} + {item.duration} + + } + /> + + )} + /> + + + + {/* 培训完成情况分析图表 */} + + + + + + + {/* 满意度评分图表 */} + + + + + + + + {/* 第三行:待审批、近期培训计划 */} + + {/* 待审批 */} + + + ( + + + {item.title}} + description={ +
+ 提交人:{item.submitter} + 提交时间:{item.time} +
+ } + /> +
+ + +
+
+ )} + /> +
+ + + {/* 近期培训计划 */} + + + + `共 ${total} 条 ${range[0]}-${range[1]}` + }} + rowKey="id" + size="small" + className="training-plan-table" + > + + + + + + getStatusTag(status)} + /> + ( + + )} + /> +
+
+ +
+
+ ); +}; + +export default SafeTrainingList; \ No newline at end of file diff --git a/src/pages/safe_training/SafeTrainingList.less b/src/pages/safe_training/SafeTrainingList.less new file mode 100644 index 0000000..216147b --- /dev/null +++ b/src/pages/safe_training/SafeTrainingList.less @@ -0,0 +1,236 @@ +.safe-training-container { + padding: 16px; + background-color: #f0f2f5; +} + +/* 统计卡片样式 */ +.stats-row { + margin-bottom: 16px; +} + +.stat-card { + background-color: #fff; + border-radius: 4px; + border: 1px solid #e8e8e8; + overflow: hidden; + transition: all 0.3s; + + &:hover { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + transform: translateY(-2px); + } +} + +.stat-content { + display: flex; + align-items: center; + padding: 16px; +} + +.stat-icon { + width: 48px; + height: 48px; + display: flex; + align-items: center; + justify-content: center; + background-color: #e6f7ff; + border-radius: 4px; + font-size: 24px; + color: #1890ff; + margin-right: 16px; +} + +.stat-info { + flex: 1; +} + +.stat-title { + font-size: 14px; + color: #666; + margin-bottom: 4px; +} + +.stat-count { + font-size: 24px; + font-weight: 500; + color: #333; + margin-bottom: 4px; +} + +.stat-completed { + font-size: 12px; + color: #999; +} + +.stat-status { + font-size: 12px; + color: #1890ff; + font-weight: 500; +} + +/* 第二行样式 */ +.second-row { + margin-bottom: 16px; +} + +/* 系统通知样式 */ +.notification-card { + height: 100%; + background-color: #fff; + border-radius: 4px; +} + +.notification-list { + .notification-item { + padding: 12px 0; + border-bottom: 1px solid #f0f0f0; + + &:last-child { + border-bottom: none; + } + + .notification-dot { + margin-right: 8px; + } + + .notification-title { + font-size: 14px; + color: #333; + margin-bottom: 4px; + display: block; + } + + .notification-time { + font-size: 12px; + color: #999; + display: block; + margin-bottom: 2px; + } + + .notification-duration { + font-size: 12px; + color: #1890ff; + float: right; + } + } +} + +/* 图表区域样式 */ +.chart-card { + height: 100%; + background-color: #fff; + border-radius: 4px; +} + +/* 第三行样式 */ +.third-row { + margin-bottom: 16px; +} + +/* 待审批样式 */ +.approval-card { + height: 100%; + background-color: #fff; + border-radius: 4px; +} + +.approval-list { + .approval-item { + padding: 12px 0; + border-bottom: 1px solid #f0f0f0; + display: flex; + align-items: center; + + &:last-child { + border-bottom: none; + } + + .approval-dot { + margin-right: 8px; + } + + .approval-title { + font-size: 14px; + color: #333; + margin-bottom: 4px; + display: block; + } + + .approval-meta { + .approval-submitter { + font-size: 12px; + color: #999; + display: block; + margin-bottom: 2px; + } + + .approval-time { + font-size: 12px; + color: #999; + } + } + + .approval-actions { + margin-left: auto; + + .approve-btn { + color: #52c41a; + padding: 0 6px; + } + + .reject-btn { + color: #f5222d; + padding: 0 6px; + } + } + } +} + +/* 近期培训计划样式 */ +.training-plan-card { + height: 100%; + background-color: #fff; + border-radius: 4px; +} + +.training-plan-table { + .ant-table-thead > tr > th { + background-color: #fafafa; + border-bottom: 1px solid #f0f0f0; + } + + .ant-table-tbody > tr > td { + border-bottom: 1px solid #f0f0f0; + } + + .view-btn { + color: #1890ff; + } +} + +/* 响应式调整 */ +@media (max-width: 768px) { + .safe-training-container { + padding: 8px; + } + + .stat-content { + flex-direction: column; + text-align: center; + } + + .stat-icon { + margin-right: 0; + margin-bottom: 12px; + } + + .approval-item { + flex-direction: column; + align-items: flex-start !important; + } + + .approval-actions { + margin-left: 0 !important; + margin-top: 8px; + } +} \ No newline at end of file