|
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="app-container">
|
|
|
3
|
+ <!-- 查询条件 -->
|
|
|
4
|
+ <div class="filter-section">
|
|
|
5
|
+ <el-card>
|
|
|
6
|
+ <div class="filter-container">
|
|
|
7
|
+ <el-form :model="queryParams" ref="queryFormRef" :inline="true" class="search-form">
|
|
|
8
|
+ <el-form-item label="考核月份" prop="assessmentMonth">
|
|
|
9
|
+ <el-date-picker v-model="queryParams.assessmentMonth" type="month" placeholder="请选择考核月份"
|
|
|
10
|
+ value-format="YYYY-MM" style="width: 200px" />
|
|
|
11
|
+ </el-form-item>
|
|
|
12
|
+
|
|
|
13
|
+ <el-form-item>
|
|
|
14
|
+ <el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
|
|
15
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
16
|
+ </el-form-item>
|
|
|
17
|
+ </el-form>
|
|
|
18
|
+
|
|
|
19
|
+ <div class="export-button">
|
|
|
20
|
+ <el-button type="warning" icon="Document" @click="handleExport">导出文档</el-button>
|
|
|
21
|
+ </div>
|
|
|
22
|
+ </div>
|
|
|
23
|
+ </el-card>
|
|
|
24
|
+ </div>
|
|
|
25
|
+
|
|
|
26
|
+ <!-- 非干部月度考核分数汇总 -->
|
|
|
27
|
+ <div class="main-section">
|
|
|
28
|
+ <h2 class="section-title">非干部月度考核分数汇总</h2>
|
|
|
29
|
+
|
|
|
30
|
+ <!-- 第一行:两个区块 -->
|
|
|
31
|
+ <div class="chart-row">
|
|
|
32
|
+ <!-- 整体分支分布柱状图 -->
|
|
|
33
|
+ <el-card class="chart-card">
|
|
|
34
|
+ <div class="chart-header">整体分支分布柱状图</div>
|
|
|
35
|
+ <div ref="overallBarChart" class="chart-container"></div>
|
|
|
36
|
+ </el-card>
|
|
|
37
|
+
|
|
|
38
|
+ <!-- 参与人数占比饼图 -->
|
|
|
39
|
+ <el-card class="chart-card">
|
|
|
40
|
+ <div class="chart-header">参与人数占比饼图</div>
|
|
|
41
|
+ <div ref="participantPieChart" class="chart-container"></div>
|
|
|
42
|
+ </el-card>
|
|
|
43
|
+ </div>
|
|
|
44
|
+
|
|
|
45
|
+ <!-- 第二行:两个区块 -->
|
|
|
46
|
+ <div class="chart-row">
|
|
|
47
|
+ <!-- 各部门分支分布对比图 -->
|
|
|
48
|
+ <el-card class="chart-card">
|
|
|
49
|
+ <div class="chart-header">各部门分支分布对比图</div>
|
|
|
50
|
+ <div ref="departmentComparisonChart" class="chart-container"></div>
|
|
|
51
|
+ </el-card>
|
|
|
52
|
+
|
|
|
53
|
+ <!-- 汇总表 -->
|
|
|
54
|
+ <el-card class="chart-card">
|
|
|
55
|
+ <div class="chart-header">汇总表</div>
|
|
|
56
|
+ <el-table :data="summaryTableData" border style="width: 100%; margin-top: 10px;">
|
|
|
57
|
+ <el-table-column prop="range" label="区间" align="center" min-width="100" />
|
|
|
58
|
+ <el-table-column prop="simulationScore" label="2026年1月模拟分数汇总" align="center" min-width="150" />
|
|
|
59
|
+ <el-table-column prop="team1" label="一队" align="center" min-width="100" />
|
|
|
60
|
+ <el-table-column prop="team2" label="二队" align="center" min-width="100" />
|
|
|
61
|
+ <el-table-column prop="team3" label="三队" align="center" min-width="100" />
|
|
|
62
|
+ </el-table>
|
|
|
63
|
+ </el-card>
|
|
|
64
|
+ </div>
|
|
|
65
|
+ </div>
|
|
|
66
|
+
|
|
|
67
|
+ <!-- 非干部月度考核分类结果汇总 -->
|
|
|
68
|
+ <div class="main-section">
|
|
|
69
|
+ <h2 class="section-title">非干部月度考核分类结果汇总</h2>
|
|
|
70
|
+
|
|
|
71
|
+ <!-- 汇总统计表格 -->
|
|
|
72
|
+ <el-card class="summary-table-card">
|
|
|
73
|
+ <div class="chart-header">汇总统计</div>
|
|
|
74
|
+ <el-table :data="classificationTableData" border style="width: 100%; margin-top: 10px;">
|
|
|
75
|
+ <el-table-column prop="assessmentGroup" label="考核组人数" align="center" min-width="120" />
|
|
|
76
|
+ <el-table-column prop="calculatedImprovement" label="测算待改进人数" align="center" min-width="140" />
|
|
|
77
|
+ <el-table-column prop="totalImprovement" label="待改进总人数" align="center" min-width="120" />
|
|
|
78
|
+ <el-table-column prop="exemption1" label="豁免" align="center" min-width="80" />
|
|
|
79
|
+ <el-table-column prop="actualImprovement" label="实际待改进总人数" align="center" min-width="140" />
|
|
|
80
|
+ <el-table-column prop="totalUnqualified" label="不称职总人数" align="center" min-width="120" />
|
|
|
81
|
+ <el-table-column prop="exemption2" label="豁免" align="center" min-width="80" />
|
|
|
82
|
+ <el-table-column prop="actualUnqualified" label="实际不称职人数" align="center" min-width="140" />
|
|
|
83
|
+ </el-table>
|
|
|
84
|
+ </el-card>
|
|
|
85
|
+
|
|
|
86
|
+ <!-- 第四行:两个区块 -->
|
|
|
87
|
+ <div class="chart-row">
|
|
|
88
|
+ <!-- 大队分布统计图 -->
|
|
|
89
|
+ <el-card class="chart-card">
|
|
|
90
|
+ <div class="chart-header">大队分布统计图</div>
|
|
|
91
|
+ <div class="pie-charts-container">
|
|
|
92
|
+ <div ref="brigadePieChart1" class="pie-chart"></div>
|
|
|
93
|
+ <div ref="brigadePieChart2" class="pie-chart"></div>
|
|
|
94
|
+ </div>
|
|
|
95
|
+ </el-card>
|
|
|
96
|
+
|
|
|
97
|
+ <!-- 岗位分布统计图 -->
|
|
|
98
|
+ <el-card class="chart-card">
|
|
|
99
|
+ <div class="chart-header">岗位分布统计图</div>
|
|
|
100
|
+ <div class="pie-charts-container">
|
|
|
101
|
+ <div ref="positionPieChart1" class="pie-chart"></div>
|
|
|
102
|
+ <div ref="positionPieChart2" class="pie-chart"></div>
|
|
|
103
|
+ </div>
|
|
|
104
|
+ </el-card>
|
|
|
105
|
+ </div>
|
|
|
106
|
+ </div>
|
|
|
107
|
+
|
|
|
108
|
+ <!-- 第一个遍历:表格和两个饼状图 -->
|
|
|
109
|
+ <div class="traversal-section">
|
|
|
110
|
+ <div v-for="(item, index) in traversalData1" :key="index" class="traversal-container">
|
|
|
111
|
+ <div class="traversal-header">{{ item.title }}</div>
|
|
|
112
|
+ <div class="traversal-content">
|
|
|
113
|
+ <!-- 左边表格 -->
|
|
|
114
|
+ <div class="table-section">
|
|
|
115
|
+ <el-table :data="item.tableData" border style="width: 100%;">
|
|
|
116
|
+ <el-table-column prop="brigade" label="大队" align="center" min-width="100" />
|
|
|
117
|
+ <el-table-column prop="assessmentGroup" label="考核组" align="center" min-width="100" />
|
|
|
118
|
+ <el-table-column prop="groupCount" label="考核组人数" align="center" min-width="120" />
|
|
|
119
|
+ <el-table-column prop="calculatedImprovement" label="测算待改进人数" align="center" min-width="140" />
|
|
|
120
|
+ <el-table-column prop="improvementCount" label="待改进人数" align="center" min-width="120" />
|
|
|
121
|
+ <el-table-column prop="exemption1" label="豁免" align="center" min-width="80" />
|
|
|
122
|
+ <el-table-column prop="actualImprovement" label="实际待改进人数" align="center" min-width="140" />
|
|
|
123
|
+ <el-table-column prop="unqualifiedCount" label="不称职人数" align="center" min-width="120" />
|
|
|
124
|
+ <el-table-column prop="exemption2" label="豁免" align="center" min-width="80" />
|
|
|
125
|
+ <el-table-column prop="actualUnqualified" label="实际不称职人数" align="center" min-width="140" />
|
|
|
126
|
+ </el-table>
|
|
|
127
|
+ </div>
|
|
|
128
|
+
|
|
|
129
|
+ <!-- 右边两个饼状图 -->
|
|
|
130
|
+ <div class="chart-section">
|
|
|
131
|
+ <div class="pie-chart-container">
|
|
|
132
|
+ <div class="pie-chart-title">考核结果分布</div>
|
|
|
133
|
+ <div :ref="el => setTraversalChartRef(el, `pieChart1_${index}`)" class="pie-chart"></div>
|
|
|
134
|
+ </div>
|
|
|
135
|
+ <div class="pie-chart-container">
|
|
|
136
|
+ <div class="pie-chart-title">改进情况分布</div>
|
|
|
137
|
+ <div :ref="el => setTraversalChartRef(el, `pieChart2_${index}`)" class="pie-chart"></div>
|
|
|
138
|
+ </div>
|
|
|
139
|
+ </div>
|
|
|
140
|
+ </div>
|
|
|
141
|
+ </div>
|
|
|
142
|
+ </div>
|
|
|
143
|
+
|
|
|
144
|
+ <!-- 第二个遍历:表格、柱状图和饼状图 -->
|
|
|
145
|
+ <div class="traversal-section">
|
|
|
146
|
+ <div v-for="(item, index) in traversalData2" :key="index" class="traversal-container">
|
|
|
147
|
+ <div class="traversal-header">{{ item.title }}</div>
|
|
|
148
|
+ <div class="traversal-content">
|
|
|
149
|
+ <!-- 左边表格 -->
|
|
|
150
|
+ <div class="table-section">
|
|
|
151
|
+ <el-table :data="item.tableData" border style="width: 100%;">
|
|
|
152
|
+ <el-table-column prop="brigade" label="大队" align="center" min-width="100" />
|
|
|
153
|
+ <el-table-column prop="assessmentGroup" label="考核组" align="center" min-width="100" />
|
|
|
154
|
+ <el-table-column prop="groupCount" label="考核组人数" align="center" min-width="120" />
|
|
|
155
|
+ <el-table-column prop="calculatedImprovement" label="测算待改进人数" align="center" min-width="140" />
|
|
|
156
|
+ <el-table-column prop="improvementCount" label="待改进人数" align="center" min-width="120" />
|
|
|
157
|
+ <el-table-column prop="exemption1" label="豁免" align="center" min-width="80" />
|
|
|
158
|
+ <el-table-column prop="actualImprovement" label="实际待改进人数" align="center" min-width="140" />
|
|
|
159
|
+ <el-table-column prop="unqualifiedCount" label="不称职人数" align="center" min-width="120" />
|
|
|
160
|
+ <el-table-column prop="exemption2" label="豁免" align="center" min-width="80" />
|
|
|
161
|
+ <el-table-column prop="actualUnqualified" label="实际不称职人数" align="center" min-width="140" />
|
|
|
162
|
+ </el-table>
|
|
|
163
|
+ </div>
|
|
|
164
|
+
|
|
|
165
|
+ <!-- 右边柱状图和饼状图 -->
|
|
|
166
|
+ <div class="chart-section">
|
|
|
167
|
+ <div class="bar-chart-container">
|
|
|
168
|
+ <div class="chart-title">考核分数分布</div>
|
|
|
169
|
+ <div :ref="el => setTraversalChartRef(el, `barChart_${index}`)" class="bar-chart"></div>
|
|
|
170
|
+ </div>
|
|
|
171
|
+ <div class="pie-chart-container">
|
|
|
172
|
+ <div class="pie-chart-title">岗位分布</div>
|
|
|
173
|
+ <div :ref="el => setTraversalChartRef(el, `pieChart3_${index}`)" class="pie-chart"></div>
|
|
|
174
|
+ </div>
|
|
|
175
|
+ </div>
|
|
|
176
|
+ </div>
|
|
|
177
|
+ </div>
|
|
|
178
|
+ </div>
|
|
|
179
|
+ </div>
|
|
|
180
|
+</template>
|
|
|
181
|
+
|
|
|
182
|
+<script setup>
|
|
|
183
|
+import { ref, reactive, onMounted, nextTick } from 'vue'
|
|
|
184
|
+import { ElMessage } from 'element-plus'
|
|
|
185
|
+import * as echarts from 'echarts'
|
|
|
186
|
+
|
|
|
187
|
+// API导入
|
|
|
188
|
+import { getNonCadreMonthlyScoreSum } from '@/api/performance/nonCadreMonthlyScoreSum.js'
|
|
|
189
|
+
|
|
|
190
|
+// 响应式数据
|
|
|
191
|
+const loading = ref(false)
|
|
|
192
|
+const queryFormRef = ref()
|
|
|
193
|
+
|
|
|
194
|
+// 查询参数
|
|
|
195
|
+const queryParams = reactive({
|
|
|
196
|
+ assessmentMonth: ''
|
|
|
197
|
+})
|
|
|
198
|
+
|
|
|
199
|
+// 图表引用
|
|
|
200
|
+const overallBarChart = ref(null)
|
|
|
201
|
+const participantPieChart = ref(null)
|
|
|
202
|
+const departmentComparisonChart = ref(null)
|
|
|
203
|
+const brigadePieChart1 = ref(null)
|
|
|
204
|
+const brigadePieChart2 = ref(null)
|
|
|
205
|
+const positionPieChart1 = ref(null)
|
|
|
206
|
+const positionPieChart2 = ref(null)
|
|
|
207
|
+
|
|
|
208
|
+// 遍历图表引用
|
|
|
209
|
+const traversalChartsRefs = ref({})
|
|
|
210
|
+
|
|
|
211
|
+// 表格数据
|
|
|
212
|
+const summaryTableData = ref([
|
|
|
213
|
+ { range: '90-100分', simulationScore: '85', team1: '15', team2: '20', team3: '25' },
|
|
|
214
|
+ { range: '80-89分', simulationScore: '120', team1: '30', team2: '35', team3: '40' },
|
|
|
215
|
+ { range: '70-79分', simulationScore: '95', team1: '25', team2: '30', team3: '35' },
|
|
|
216
|
+ { range: '60-69分', simulationScore: '60', team1: '15', team2: '20', team3: '25' },
|
|
|
217
|
+ { range: '60分以下', simulationScore: '20', team1: '5', team2: '8', team3: '7' }
|
|
|
218
|
+])
|
|
|
219
|
+
|
|
|
220
|
+const classificationTableData = ref([
|
|
|
221
|
+ {
|
|
|
222
|
+ assessmentGroup: '100',
|
|
|
223
|
+ calculatedImprovement: '15',
|
|
|
224
|
+ totalImprovement: '12',
|
|
|
225
|
+ exemption1: '2',
|
|
|
226
|
+ actualImprovement: '10',
|
|
|
227
|
+ totalUnqualified: '5',
|
|
|
228
|
+ exemption2: '1',
|
|
|
229
|
+ actualUnqualified: '4'
|
|
|
230
|
+ }
|
|
|
231
|
+])
|
|
|
232
|
+
|
|
|
233
|
+// 遍历数据
|
|
|
234
|
+const traversalData1 = ref([
|
|
|
235
|
+ {
|
|
|
236
|
+ title: '大队考核统计',
|
|
|
237
|
+ tableData: [
|
|
|
238
|
+ { brigade: '一大队', assessmentGroup: '一组', groupCount: 50, calculatedImprovement: 8, improvementCount: 6, exemption1: 1, actualImprovement: 5, unqualifiedCount: 2, exemption2: 0, actualUnqualified: 2 },
|
|
|
239
|
+ { brigade: '一大队', assessmentGroup: '二组', groupCount: 45, calculatedImprovement: 7, improvementCount: 5, exemption1: 1, actualImprovement: 4, unqualifiedCount: 1, exemption2: 0, actualUnqualified: 1 },
|
|
|
240
|
+ { brigade: '二大队', assessmentGroup: '一组', groupCount: 55, calculatedImprovement: 9, improvementCount: 7, exemption1: 1, actualImprovement: 6, unqualifiedCount: 3, exemption2: 1, actualUnqualified: 2 },
|
|
|
241
|
+ { brigade: '二大队', assessmentGroup: '二组', groupCount: 48, calculatedImprovement: 6, improvementCount: 5, exemption1: 0, actualImprovement: 5, unqualifiedCount: 2, exemption2: 0, actualUnqualified: 2 }
|
|
|
242
|
+ ]
|
|
|
243
|
+ }
|
|
|
244
|
+])
|
|
|
245
|
+
|
|
|
246
|
+const traversalData2 = ref([
|
|
|
247
|
+ {
|
|
|
248
|
+ title: '岗位考核统计',
|
|
|
249
|
+ tableData: [
|
|
|
250
|
+ { brigade: '安检员', assessmentGroup: '一组', groupCount: 60, calculatedImprovement: 10, improvementCount: 8, exemption1: 1, actualImprovement: 7, unqualifiedCount: 3, exemption2: 0, actualUnqualified: 3 },
|
|
|
251
|
+ { brigade: '安检员', assessmentGroup: '二组', groupCount: 55, calculatedImprovement: 8, improvementCount: 6, exemption1: 1, actualImprovement: 5, unqualifiedCount: 2, exemption2: 0, actualUnqualified: 2 },
|
|
|
252
|
+ { brigade: '设备操作员', assessmentGroup: '一组', groupCount: 40, calculatedImprovement: 5, improvementCount: 4, exemption1: 0, actualImprovement: 4, unqualifiedCount: 1, exemption2: 0, actualUnqualified: 1 }
|
|
|
253
|
+ ]
|
|
|
254
|
+ }
|
|
|
255
|
+])
|
|
|
256
|
+
|
|
|
257
|
+// 图表实例
|
|
|
258
|
+let overallBarChartInstance = null
|
|
|
259
|
+let participantPieChartInstance = null
|
|
|
260
|
+let departmentComparisonChartInstance = null
|
|
|
261
|
+let brigadePieChart1Instance = null
|
|
|
262
|
+let brigadePieChart2Instance = null
|
|
|
263
|
+let positionPieChart1Instance = null
|
|
|
264
|
+let positionPieChart2Instance = null
|
|
|
265
|
+
|
|
|
266
|
+// 初始化图表
|
|
|
267
|
+const initCharts = () => {
|
|
|
268
|
+ nextTick(() => {
|
|
|
269
|
+ // 整体分支分布柱状图
|
|
|
270
|
+ if (overallBarChart.value) {
|
|
|
271
|
+ overallBarChartInstance = echarts.init(overallBarChart.value)
|
|
|
272
|
+ overallBarChartInstance.setOption({
|
|
|
273
|
+ tooltip: { trigger: 'axis' },
|
|
|
274
|
+ xAxis: { type: 'category', data: ['90-100分', '80-89分', '70-79分', '60-69分', '60分以下'] },
|
|
|
275
|
+ yAxis: { type: 'value' },
|
|
|
276
|
+ series: [{ type: 'bar', data: [85, 120, 95, 60, 20], itemStyle: { color: '#3b82f6' } }]
|
|
|
277
|
+ })
|
|
|
278
|
+ }
|
|
|
279
|
+
|
|
|
280
|
+ // 参与人数占比饼图
|
|
|
281
|
+ if (participantPieChart.value) {
|
|
|
282
|
+ participantPieChartInstance = echarts.init(participantPieChart.value)
|
|
|
283
|
+ participantPieChartInstance.setOption({
|
|
|
284
|
+ tooltip: { trigger: 'item' },
|
|
|
285
|
+ series: [{
|
|
|
286
|
+ type: 'pie',
|
|
|
287
|
+ radius: '70%',
|
|
|
288
|
+ data: [
|
|
|
289
|
+ { value: 380, name: '参与考核' },
|
|
|
290
|
+ { value: 20, name: '未参与考核' }
|
|
|
291
|
+ ]
|
|
|
292
|
+ }]
|
|
|
293
|
+ })
|
|
|
294
|
+ }
|
|
|
295
|
+
|
|
|
296
|
+ // 各部门分支分布对比图
|
|
|
297
|
+ if (departmentComparisonChart.value) {
|
|
|
298
|
+ departmentComparisonChartInstance = echarts.init(departmentComparisonChart.value)
|
|
|
299
|
+ departmentComparisonChartInstance.setOption({
|
|
|
300
|
+ tooltip: { trigger: 'axis' },
|
|
|
301
|
+ legend: { data: ['一队', '二队', '三队'] },
|
|
|
302
|
+ xAxis: { type: 'category', data: ['90-100分', '80-89分', '70-79分', '60-69分', '60分以下'] },
|
|
|
303
|
+ yAxis: { type: 'value' },
|
|
|
304
|
+ series: [
|
|
|
305
|
+ { name: '一队', type: 'bar', data: [15, 30, 25, 15, 5] },
|
|
|
306
|
+ { name: '二队', type: 'bar', data: [20, 35, 30, 20, 8] },
|
|
|
307
|
+ { name: '三队', type: 'bar', data: [25, 40, 35, 25, 7] }
|
|
|
308
|
+ ]
|
|
|
309
|
+ })
|
|
|
310
|
+ }
|
|
|
311
|
+
|
|
|
312
|
+ // 大队分布饼图1
|
|
|
313
|
+ if (brigadePieChart1.value) {
|
|
|
314
|
+ brigadePieChart1Instance = echarts.init(brigadePieChart1.value)
|
|
|
315
|
+ brigadePieChart1Instance.setOption({
|
|
|
316
|
+ tooltip: { trigger: 'item' },
|
|
|
317
|
+ series: [{
|
|
|
318
|
+ type: 'pie',
|
|
|
319
|
+ radius: '70%',
|
|
|
320
|
+ data: [
|
|
|
321
|
+ { value: 120, name: '一队' },
|
|
|
322
|
+ { value: 150, name: '二队' },
|
|
|
323
|
+ { value: 130, name: '三队' }
|
|
|
324
|
+ ]
|
|
|
325
|
+ }]
|
|
|
326
|
+ })
|
|
|
327
|
+ }
|
|
|
328
|
+
|
|
|
329
|
+ // 大队分布饼图2
|
|
|
330
|
+ if (brigadePieChart2.value) {
|
|
|
331
|
+ brigadePieChart2Instance = echarts.init(brigadePieChart2.value)
|
|
|
332
|
+ brigadePieChart2Instance.setOption({
|
|
|
333
|
+ tooltip: { trigger: 'item' },
|
|
|
334
|
+ series: [{
|
|
|
335
|
+ type: 'pie',
|
|
|
336
|
+ radius: '70%',
|
|
|
337
|
+ data: [
|
|
|
338
|
+ { value: 45, name: '优秀' },
|
|
|
339
|
+ { value: 280, name: '合格' },
|
|
|
340
|
+ { value: 75, name: '待改进' }
|
|
|
341
|
+ ]
|
|
|
342
|
+ }]
|
|
|
343
|
+ })
|
|
|
344
|
+ }
|
|
|
345
|
+
|
|
|
346
|
+ // 岗位分布饼图1
|
|
|
347
|
+ if (positionPieChart1.value) {
|
|
|
348
|
+ positionPieChart1Instance = echarts.init(positionPieChart1.value)
|
|
|
349
|
+ positionPieChart1Instance.setOption({
|
|
|
350
|
+ tooltip: { trigger: 'item' },
|
|
|
351
|
+ series: [{
|
|
|
352
|
+ type: 'pie',
|
|
|
353
|
+ radius: '70%',
|
|
|
354
|
+ data: [
|
|
|
355
|
+ { value: 150, name: '安检员' },
|
|
|
356
|
+ { value: 120, name: '设备操作员' },
|
|
|
357
|
+ { value: 80, name: '管理人员' },
|
|
|
358
|
+ { value: 50, name: '其他' }
|
|
|
359
|
+ ]
|
|
|
360
|
+ }]
|
|
|
361
|
+ })
|
|
|
362
|
+ }
|
|
|
363
|
+
|
|
|
364
|
+ // 岗位分布饼图2
|
|
|
365
|
+ if (positionPieChart2.value) {
|
|
|
366
|
+ positionPieChart2Instance = echarts.init(positionPieChart2.value)
|
|
|
367
|
+ positionPieChart2Instance.setOption({
|
|
|
368
|
+ tooltip: { trigger: 'item' },
|
|
|
369
|
+ series: [{
|
|
|
370
|
+ type: 'pie',
|
|
|
371
|
+ radius: '70%',
|
|
|
372
|
+ data: [
|
|
|
373
|
+ { value: 35, name: '优秀' },
|
|
|
374
|
+ { value: 320, name: '合格' },
|
|
|
375
|
+ { value: 45, name: '待改进' }
|
|
|
376
|
+ ]
|
|
|
377
|
+ }]
|
|
|
378
|
+ })
|
|
|
379
|
+ }
|
|
|
380
|
+ })
|
|
|
381
|
+}
|
|
|
382
|
+
|
|
|
383
|
+// 设置遍历图表引用
|
|
|
384
|
+const setTraversalChartRef = (el, key) => {
|
|
|
385
|
+ if (el) {
|
|
|
386
|
+ traversalChartsRefs.value[key] = el
|
|
|
387
|
+ }
|
|
|
388
|
+}
|
|
|
389
|
+
|
|
|
390
|
+// 初始化遍历图表
|
|
|
391
|
+const initTraversalCharts = () => {
|
|
|
392
|
+ nextTick(() => {
|
|
|
393
|
+ // 第一个遍历的饼状图
|
|
|
394
|
+ traversalData1.value.forEach((item, index) => {
|
|
|
395
|
+ // 饼状图1:考核结果分布
|
|
|
396
|
+ const pieChart1Key = `pieChart1_${index}`
|
|
|
397
|
+ if (traversalChartsRefs.value[pieChart1Key]) {
|
|
|
398
|
+ const pieChart1 = echarts.init(traversalChartsRefs.value[pieChart1Key])
|
|
|
399
|
+ pieChart1.setOption({
|
|
|
400
|
+ tooltip: { trigger: 'item' },
|
|
|
401
|
+ series: [{
|
|
|
402
|
+ type: 'pie',
|
|
|
403
|
+ radius: '70%',
|
|
|
404
|
+ data: [
|
|
|
405
|
+ { value: 120, name: '优秀' },
|
|
|
406
|
+ { value: 280, name: '合格' },
|
|
|
407
|
+ { value: 75, name: '待改进' }
|
|
|
408
|
+ ]
|
|
|
409
|
+ }]
|
|
|
410
|
+ })
|
|
|
411
|
+ }
|
|
|
412
|
+
|
|
|
413
|
+ // 饼状图2:改进情况分布
|
|
|
414
|
+ const pieChart2Key = `pieChart2_${index}`
|
|
|
415
|
+ if (traversalChartsRefs.value[pieChart2Key]) {
|
|
|
416
|
+ const pieChart2 = echarts.init(traversalChartsRefs.value[pieChart2Key])
|
|
|
417
|
+ pieChart2.setOption({
|
|
|
418
|
+ tooltip: { trigger: 'item' },
|
|
|
419
|
+ series: [{
|
|
|
420
|
+ type: 'pie',
|
|
|
421
|
+ radius: '70%',
|
|
|
422
|
+ data: [
|
|
|
423
|
+ { value: 15, name: '已改进' },
|
|
|
424
|
+ { value: 60, name: '待改进' },
|
|
|
425
|
+ { value: 5, name: '未改进' }
|
|
|
426
|
+ ]
|
|
|
427
|
+ }]
|
|
|
428
|
+ })
|
|
|
429
|
+ }
|
|
|
430
|
+ })
|
|
|
431
|
+
|
|
|
432
|
+ // 第二个遍历的图表
|
|
|
433
|
+ traversalData2.value.forEach((item, index) => {
|
|
|
434
|
+ // 柱状图:考核分数分布
|
|
|
435
|
+ const barChartKey = `barChart_${index}`
|
|
|
436
|
+ if (traversalChartsRefs.value[barChartKey]) {
|
|
|
437
|
+ const barChart = echarts.init(traversalChartsRefs.value[barChartKey])
|
|
|
438
|
+ barChart.setOption({
|
|
|
439
|
+ tooltip: { trigger: 'axis' },
|
|
|
440
|
+ xAxis: { type: 'category', data: ['90-100分', '80-89分', '70-79分', '60-69分', '60分以下'] },
|
|
|
441
|
+ yAxis: { type: 'value' },
|
|
|
442
|
+ series: [{ type: 'bar', data: [85, 120, 95, 60, 20], itemStyle: { color: '#3b82f6' } }]
|
|
|
443
|
+ })
|
|
|
444
|
+ }
|
|
|
445
|
+
|
|
|
446
|
+ // 饼状图:岗位分布
|
|
|
447
|
+ const pieChart3Key = `pieChart3_${index}`
|
|
|
448
|
+ if (traversalChartsRefs.value[pieChart3Key]) {
|
|
|
449
|
+ const pieChart3 = echarts.init(traversalChartsRefs.value[pieChart3Key])
|
|
|
450
|
+ pieChart3.setOption({
|
|
|
451
|
+ tooltip: { trigger: 'item' },
|
|
|
452
|
+ series: [{
|
|
|
453
|
+ type: 'pie',
|
|
|
454
|
+ radius: '70%',
|
|
|
455
|
+ data: [
|
|
|
456
|
+ { value: 150, name: '安检员' },
|
|
|
457
|
+ { value: 120, name: '设备操作员' },
|
|
|
458
|
+ { value: 80, name: '管理人员' },
|
|
|
459
|
+ { value: 50, name: '其他' }
|
|
|
460
|
+ ]
|
|
|
461
|
+ }]
|
|
|
462
|
+ })
|
|
|
463
|
+ }
|
|
|
464
|
+ })
|
|
|
465
|
+ })
|
|
|
466
|
+}
|
|
|
467
|
+
|
|
|
468
|
+// 窗口大小变化时重绘图表
|
|
|
469
|
+const handleResize = () => {
|
|
|
470
|
+ const charts = [
|
|
|
471
|
+ overallBarChartInstance,
|
|
|
472
|
+ participantPieChartInstance,
|
|
|
473
|
+ departmentComparisonChartInstance,
|
|
|
474
|
+ brigadePieChart1Instance,
|
|
|
475
|
+ brigadePieChart2Instance,
|
|
|
476
|
+ positionPieChart1Instance,
|
|
|
477
|
+ positionPieChart2Instance
|
|
|
478
|
+ ]
|
|
|
479
|
+ charts.forEach(chart => {
|
|
|
480
|
+ if (chart) chart.resize()
|
|
|
481
|
+ })
|
|
|
482
|
+}
|
|
|
483
|
+
|
|
|
484
|
+// 获取数据
|
|
|
485
|
+const getList = async () => {
|
|
|
486
|
+ loading.value = true
|
|
|
487
|
+ try {
|
|
|
488
|
+ const res = await getNonCadreMonthlyScoreSum(queryParams)
|
|
|
489
|
+ // 这里可以根据实际API返回的数据更新图表和表格数据
|
|
|
490
|
+ console.log('获取汇总数据:', res)
|
|
|
491
|
+ } catch (error) {
|
|
|
492
|
+ console.error('获取汇总数据失败:', error)
|
|
|
493
|
+ ElMessage.error('获取汇总数据失败')
|
|
|
494
|
+ } finally {
|
|
|
495
|
+ loading.value = false
|
|
|
496
|
+ }
|
|
|
497
|
+}
|
|
|
498
|
+
|
|
|
499
|
+// 查询
|
|
|
500
|
+const handleQuery = () => {
|
|
|
501
|
+ getList()
|
|
|
502
|
+}
|
|
|
503
|
+
|
|
|
504
|
+// 重置查询
|
|
|
505
|
+const resetQuery = () => {
|
|
|
506
|
+ queryFormRef.value?.resetFields()
|
|
|
507
|
+ getList()
|
|
|
508
|
+}
|
|
|
509
|
+
|
|
|
510
|
+// 导出
|
|
|
511
|
+const handleExport = async () => {
|
|
|
512
|
+ try {
|
|
|
513
|
+ ElMessage.success('导出功能开发中')
|
|
|
514
|
+ } catch (error) {
|
|
|
515
|
+ ElMessage.error('导出失败')
|
|
|
516
|
+ }
|
|
|
517
|
+}
|
|
|
518
|
+
|
|
|
519
|
+onMounted(() => {
|
|
|
520
|
+ initCharts()
|
|
|
521
|
+ initTraversalCharts()
|
|
|
522
|
+ window.addEventListener('resize', handleResize)
|
|
|
523
|
+ getList()
|
|
|
524
|
+})
|
|
|
525
|
+
|
|
|
526
|
+// 组件卸载时移除事件监听器
|
|
|
527
|
+onUnmounted(() => {
|
|
|
528
|
+ window.removeEventListener('resize', handleResize)
|
|
|
529
|
+ // 销毁图表实例
|
|
|
530
|
+ const charts = [
|
|
|
531
|
+ overallBarChartInstance,
|
|
|
532
|
+ participantPieChartInstance,
|
|
|
533
|
+ departmentComparisonChartInstance,
|
|
|
534
|
+ brigadePieChart1Instance,
|
|
|
535
|
+ brigadePieChart2Instance,
|
|
|
536
|
+ positionPieChart1Instance,
|
|
|
537
|
+ positionPieChart2Instance
|
|
|
538
|
+ ]
|
|
|
539
|
+ charts.forEach(chart => {
|
|
|
540
|
+ if (chart) chart.dispose()
|
|
|
541
|
+ })
|
|
|
542
|
+})
|
|
|
543
|
+</script>
|
|
|
544
|
+
|
|
|
545
|
+<style lang="less" scoped>
|
|
|
546
|
+.app-container {
|
|
|
547
|
+ padding: 20px;
|
|
|
548
|
+}
|
|
|
549
|
+
|
|
|
550
|
+.filter-section {
|
|
|
551
|
+ margin-bottom: 20px;
|
|
|
552
|
+}
|
|
|
553
|
+
|
|
|
554
|
+.filter-container {
|
|
|
555
|
+ display: flex;
|
|
|
556
|
+ justify-content: space-between;
|
|
|
557
|
+ align-items: center;
|
|
|
558
|
+}
|
|
|
559
|
+
|
|
|
560
|
+.search-form {
|
|
|
561
|
+ display: flex;
|
|
|
562
|
+ align-items: center;
|
|
|
563
|
+ gap: 10px;
|
|
|
564
|
+}
|
|
|
565
|
+
|
|
|
566
|
+.export-button {
|
|
|
567
|
+ margin-left: auto;
|
|
|
568
|
+}
|
|
|
569
|
+
|
|
|
570
|
+.main-section {
|
|
|
571
|
+ margin-bottom: 30px;
|
|
|
572
|
+}
|
|
|
573
|
+
|
|
|
574
|
+.section-title {
|
|
|
575
|
+ font-size: 20px;
|
|
|
576
|
+ font-weight: bold;
|
|
|
577
|
+ color: #333;
|
|
|
578
|
+ margin-bottom: 20px;
|
|
|
579
|
+ text-align: center;
|
|
|
580
|
+}
|
|
|
581
|
+
|
|
|
582
|
+.chart-row {
|
|
|
583
|
+ display: grid;
|
|
|
584
|
+ grid-template-columns: 1fr 1fr;
|
|
|
585
|
+ gap: 20px;
|
|
|
586
|
+ margin-bottom: 20px;
|
|
|
587
|
+}
|
|
|
588
|
+
|
|
|
589
|
+.chart-card {
|
|
|
590
|
+ height: 400px;
|
|
|
591
|
+}
|
|
|
592
|
+
|
|
|
593
|
+.summary-table-card {
|
|
|
594
|
+ margin-bottom: 20px;
|
|
|
595
|
+}
|
|
|
596
|
+
|
|
|
597
|
+.chart-header {
|
|
|
598
|
+ font-size: 16px;
|
|
|
599
|
+ font-weight: 600;
|
|
|
600
|
+ color: #333;
|
|
|
601
|
+ margin-bottom: 10px;
|
|
|
602
|
+ text-align: center;
|
|
|
603
|
+}
|
|
|
604
|
+
|
|
|
605
|
+.chart-container {
|
|
|
606
|
+ width: 100%;
|
|
|
607
|
+ height: 350px;
|
|
|
608
|
+}
|
|
|
609
|
+
|
|
|
610
|
+.pie-charts-container {
|
|
|
611
|
+ display: grid;
|
|
|
612
|
+ grid-template-columns: 1fr 1fr;
|
|
|
613
|
+ gap: 10px;
|
|
|
614
|
+ height: 350px;
|
|
|
615
|
+}
|
|
|
616
|
+
|
|
|
617
|
+.pie-chart {
|
|
|
618
|
+ width: 100%;
|
|
|
619
|
+ height: 100%;
|
|
|
620
|
+}
|
|
|
621
|
+
|
|
|
622
|
+:deep(.el-table) {
|
|
|
623
|
+ .el-table__header th {
|
|
|
624
|
+ background-color: #f5f7fa;
|
|
|
625
|
+ font-weight: 600;
|
|
|
626
|
+ }
|
|
|
627
|
+}
|
|
|
628
|
+
|
|
|
629
|
+/* 遍历样式 */
|
|
|
630
|
+.traversal-section {
|
|
|
631
|
+ margin-bottom: 30px;
|
|
|
632
|
+}
|
|
|
633
|
+
|
|
|
634
|
+.traversal-container {
|
|
|
635
|
+ border: 1px solid #dcdfe6;
|
|
|
636
|
+ border-radius: 8px;
|
|
|
637
|
+ overflow: hidden;
|
|
|
638
|
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
|
639
|
+ margin-bottom: 20px;
|
|
|
640
|
+}
|
|
|
641
|
+
|
|
|
642
|
+.traversal-header {
|
|
|
643
|
+ background-color: #f5f7fa;
|
|
|
644
|
+ padding: 15px 20px;
|
|
|
645
|
+ font-size: 18px;
|
|
|
646
|
+ font-weight: 600;
|
|
|
647
|
+ color: #303133;
|
|
|
648
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
649
|
+ text-align: left;
|
|
|
650
|
+}
|
|
|
651
|
+
|
|
|
652
|
+.traversal-content {
|
|
|
653
|
+ display: grid;
|
|
|
654
|
+ grid-template-columns: 1fr 1fr;
|
|
|
655
|
+ gap: 20px;
|
|
|
656
|
+ padding: 20px;
|
|
|
657
|
+}
|
|
|
658
|
+
|
|
|
659
|
+.table-section {
|
|
|
660
|
+ min-height: 400px;
|
|
|
661
|
+}
|
|
|
662
|
+
|
|
|
663
|
+.chart-section {
|
|
|
664
|
+ display: grid;
|
|
|
665
|
+ grid-template-columns: 1fr 1fr;
|
|
|
666
|
+ gap: 15px;
|
|
|
667
|
+ height: 400px;
|
|
|
668
|
+}
|
|
|
669
|
+
|
|
|
670
|
+.pie-chart-container, .bar-chart-container {
|
|
|
671
|
+ display: flex;
|
|
|
672
|
+ flex-direction: column;
|
|
|
673
|
+ border: 1px solid #e4e7ed;
|
|
|
674
|
+ border-radius: 6px;
|
|
|
675
|
+ padding: 10px;
|
|
|
676
|
+ background-color: #fff;
|
|
|
677
|
+}
|
|
|
678
|
+
|
|
|
679
|
+.pie-chart-title, .chart-title {
|
|
|
680
|
+ font-size: 14px;
|
|
|
681
|
+ font-weight: 600;
|
|
|
682
|
+ color: #606266;
|
|
|
683
|
+ margin-bottom: 10px;
|
|
|
684
|
+ text-align: center;
|
|
|
685
|
+}
|
|
|
686
|
+
|
|
|
687
|
+.pie-chart, .bar-chart {
|
|
|
688
|
+ flex: 1;
|
|
|
689
|
+ min-height: 300px;
|
|
|
690
|
+}
|
|
|
691
|
+
|
|
|
692
|
+/* 响应式布局 */
|
|
|
693
|
+@media (max-width: 1200px) {
|
|
|
694
|
+ .chart-row {
|
|
|
695
|
+ grid-template-columns: 1fr;
|
|
|
696
|
+ }
|
|
|
697
|
+
|
|
|
698
|
+ .pie-charts-container {
|
|
|
699
|
+ grid-template-columns: 1fr;
|
|
|
700
|
+ }
|
|
|
701
|
+
|
|
|
702
|
+ .traversal-content {
|
|
|
703
|
+ grid-template-columns: 1fr;
|
|
|
704
|
+ gap: 15px;
|
|
|
705
|
+ }
|
|
|
706
|
+
|
|
|
707
|
+ .chart-section {
|
|
|
708
|
+ grid-template-columns: 1fr;
|
|
|
709
|
+ height: auto;
|
|
|
710
|
+ }
|
|
|
711
|
+
|
|
|
712
|
+ .pie-chart, .bar-chart {
|
|
|
713
|
+ min-height: 250px;
|
|
|
714
|
+ }
|
|
|
715
|
+}
|
|
|
716
|
+
|
|
|
717
|
+@media (max-width: 768px) {
|
|
|
718
|
+ .traversal-content {
|
|
|
719
|
+ padding: 15px;
|
|
|
720
|
+ }
|
|
|
721
|
+
|
|
|
722
|
+ .chart-section {
|
|
|
723
|
+ gap: 10px;
|
|
|
724
|
+ }
|
|
|
725
|
+
|
|
|
726
|
+ .pie-chart-container, .bar-chart-container {
|
|
|
727
|
+ padding: 8px;
|
|
|
728
|
+ }
|
|
|
729
|
+}
|
|
|
730
|
+</style>
|