<template>
|
<div class="alarm-stats-report">
|
<el-card shadow="never" class="search-card">
|
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
|
<el-form-item label="报表类型">
|
<el-select v-model="searchForm.reportType" placeholder="请选择报表类型">
|
<el-option label="日报" value="日报" />
|
<el-option label="周报" value="周报" />
|
<el-option label="月报" value="月报" />
|
<el-option label="季报" value="季报" />
|
<el-option label="年报" value="年报" />
|
</el-select>
|
</el-form-item>
|
<el-form-item label="统计时间">
|
<el-date-picker
|
v-model="searchForm.statsDate"
|
type="date"
|
placeholder="选择统计日期"
|
format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">生成报表</el-button>
|
<el-button type="success" icon="el-icon-download" @click="handleExport">导出报表</el-button>
|
</el-form-item>
|
</el-form>
|
</el-card>
|
|
<el-card shadow="never" class="report-card">
|
<template #header>
|
<span>报警统计报表 - 2025年12月</span>
|
</template>
|
|
<div class="report-summary">
|
<el-row :gutter="20">
|
<el-col :span="8">
|
<div class="summary-item">
|
<div class="summary-label">总报警数</div>
|
<div class="summary-value">425</div>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="summary-item">
|
<div class="summary-label">已处理报警</div>
|
<div class="summary-value handled">398</div>
|
</div>
|
</el-col>
|
<el-col :span="8">
|
<div class="summary-item">
|
<div class="summary-label">未处理报警</div>
|
<div class="summary-value pending">27</div>
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
|
<div class="report-content">
|
<h3>1. 报警级别统计</h3>
|
<el-table :data="levelStats" style="width: 100%; margin-bottom: 20px;">
|
<el-table-column prop="level" label="报警级别" />
|
<el-table-column prop="count" label="数量" />
|
<el-table-column prop="percentage" label="占比" />
|
<el-table-column prop="handled" label="已处理" />
|
<el-table-column prop="pending" label="未处理" />
|
</el-table>
|
|
<h3>2. 设备类型报警统计</h3>
|
<el-table :data="equipmentStats" style="width: 100%; margin-bottom: 20px;">
|
<el-table-column prop="type" label="设备类型" />
|
<el-table-column prop="count" label="报警数量" />
|
<el-table-column prop="percentage" label="占比" />
|
</el-table>
|
|
<h3>3. 报警处理时效统计</h3>
|
<el-table :data="handlingTimeStats" style="width: 100%; margin-bottom: 20px;">
|
<el-table-column prop="range" label="处理时长范围" />
|
<el-table-column prop="count" label="报警数量" />
|
<el-table-column prop="percentage" label="占比" />
|
</el-table>
|
|
<h3>4. 月度报警趋势</h3>
|
<div ref="trendChart" class="trend-chart-container"></div>
|
</div>
|
</el-card>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: 'AlarmStatsReport',
|
data() {
|
return {
|
searchForm: {
|
reportType: '月报',
|
statsDate: '2025-12-01'
|
},
|
levelStats: [
|
{ level: '严重', count: 78, percentage: '18.35%', handled: 75, pending: 3 },
|
{ level: '中等', count: 178, percentage: '41.88%', handled: 170, pending: 8 },
|
{ level: '轻微', count: 169, percentage: '39.76%', handled: 153, pending: 16 }
|
],
|
equipmentStats: [
|
{ type: '工艺设备', count: 280, percentage: '65.88%' },
|
{ type: '检测设备', count: 85, percentage: '20.00%' },
|
{ type: '其他设备', count: 60, percentage: '14.12%' }
|
],
|
handlingTimeStats: [
|
{ range: '0-30分钟', count: 280, percentage: '65.88%' },
|
{ range: '30-60分钟', count: 75, percentage: '17.65%' },
|
{ range: '1-2小时', count: 45, percentage: '10.59%' },
|
{ range: '2小时以上', count: 25, percentage: '5.88%' }
|
]
|
}
|
},
|
mounted() {
|
this.initTrendChart()
|
},
|
methods: {
|
handleSearch() {
|
console.log('生成报表', this.searchForm)
|
},
|
handleExport() {
|
console.log('导出报表')
|
},
|
initTrendChart() {
|
console.log('初始化趋势图表')
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.alarm-stats-report {
|
padding: 16px;
|
background-color: #f0f2f5;
|
min-height: 100vh;
|
}
|
|
.search-card {
|
margin-bottom: 16px;
|
border-radius: 8px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
}
|
|
.report-card {
|
margin-top: 16px;
|
border-radius: 8px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
overflow: hidden;
|
}
|
|
.report-summary {
|
margin: 20px;
|
padding: 20px;
|
background-color: #fafafa;
|
border-radius: 8px;
|
border: 1px solid #e4e7ed;
|
}
|
|
.summary-item {
|
background-color: #ffffff;
|
padding: 24px 16px;
|
border-radius: 12px;
|
text-align: center;
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
transition: all 0.3s ease;
|
}
|
|
.summary-item:hover {
|
transform: translateY(-2px);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
}
|
|
.summary-label {
|
font-size: 14px;
|
color: #606266;
|
margin-bottom: 12px;
|
font-weight: 500;
|
}
|
|
.summary-value {
|
font-size: 32px;
|
font-weight: bold;
|
color: #409eff;
|
letter-spacing: 1px;
|
}
|
|
.summary-value.handled {
|
color: #67c23a;
|
}
|
|
.summary-value.pending {
|
color: #e6a23c;
|
}
|
|
.report-content {
|
margin: 20px;
|
}
|
|
.report-content h3 {
|
margin-bottom: 16px;
|
color: #303133;
|
font-size: 18px;
|
font-weight: 600;
|
padding-bottom: 8px;
|
border-bottom: 2px solid #409eff;
|
display: inline-block;
|
}
|
|
.trend-chart-container {
|
height: 350px;
|
background-color: #ffffff;
|
border-radius: 8px;
|
margin-top: 20px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
color: #909399;
|
border: 1px solid #e4e7ed;
|
}
|
|
/* 表格样式优化 */
|
:deep(.el-table) {
|
border-radius: 8px;
|
overflow: hidden;
|
margin-bottom: 20px;
|
}
|
|
:deep(.el-table__header-wrapper) {
|
background-color: #f5f7fa;
|
}
|
|
:deep(.el-table__header th) {
|
font-weight: 600;
|
background-color: #f5f7fa;
|
}
|
|
:deep(.el-table__body tr:hover) {
|
background-color: #f5f7fa;
|
}
|
|
/* 按钮样式优化 */
|
:deep(.el-button) {
|
border-radius: 6px;
|
padding: 8px 16px;
|
text-align: center;
|
white-space: nowrap;
|
}
|
|
/* 表单控件样式优化 */
|
:deep(.el-input__inner),
|
:deep(.el-select__input) {
|
border-radius: 6px;
|
}
|
|
:deep(.el-date-editor) {
|
border-radius: 6px;
|
}
|
</style>
|