|
|
@@ -95,7 +95,8 @@ import {
|
|
95
|
95
|
brigadeDifficultyDistribution,
|
|
96
|
96
|
brigadeSupervisorDistribution,
|
|
97
|
97
|
brigadeMissCheckReasonDistribution,
|
|
98
|
|
- brigadeOperatingYearsDistribution
|
|
|
98
|
+ brigadeOperatingYearsDistribution,
|
|
|
99
|
+ tenureListAll
|
|
99
|
100
|
} from '@/api/blockingData/blockingDataScreen'
|
|
100
|
101
|
|
|
101
|
102
|
const props = defineProps({
|
|
|
@@ -152,7 +153,7 @@ const fetchData = async () => {
|
|
152
|
153
|
loading.value = true
|
|
153
|
154
|
try {
|
|
154
|
155
|
const processedParams = processFilterParams(props.filterParams)
|
|
155
|
|
- const [supervisorRes, teamRes, userRes, genderRes, certDetailRes, certBaseRes, locationRes, difficultyRes, supervisorDistRes, reasonRes, yearsRes] = await Promise.all([
|
|
|
156
|
+ const [supervisorRes, teamRes, userRes, genderRes, certDetailRes, certBaseRes, locationRes, difficultyRes, supervisorDistRes, reasonRes, yearsRes, tenureRes] = await Promise.allSettled([
|
|
156
|
157
|
brigadeSupervisorRanking(processedParams),
|
|
157
|
158
|
brigadeTeamLeaderRanking(processedParams),
|
|
158
|
159
|
brigadeReviewedUserRanking(processedParams),
|
|
|
@@ -163,12 +164,13 @@ const fetchData = async () => {
|
|
163
|
164
|
brigadeDifficultyDistribution(processedParams),
|
|
164
|
165
|
brigadeSupervisorDistribution(processedParams),
|
|
165
|
166
|
brigadeMissCheckReasonDistribution(processedParams),
|
|
166
|
|
- brigadeOperatingYearsDistribution(processedParams)
|
|
|
167
|
+ brigadeOperatingYearsDistribution(processedParams),
|
|
|
168
|
+ tenureListAll(processedParams)
|
|
167
|
169
|
])
|
|
168
|
170
|
|
|
169
|
|
- if (supervisorRes.data) {
|
|
|
171
|
+ if (supervisorRes.value?.data) {
|
|
170
|
172
|
rankData1.length = 0
|
|
171
|
|
- supervisorRes.data.slice(0, 10).forEach(item => {
|
|
|
173
|
+ supervisorRes.value.data.slice(0, 10).forEach(item => {
|
|
172
|
174
|
rankData1.push({
|
|
173
|
175
|
name: item.supervisorName || item.name || '',
|
|
174
|
176
|
value: item.count || item.value || 0
|
|
|
@@ -176,9 +178,9 @@ const fetchData = async () => {
|
|
176
|
178
|
})
|
|
177
|
179
|
}
|
|
178
|
180
|
|
|
179
|
|
- if (teamRes.data) {
|
|
|
181
|
+ if (teamRes.value?.data) {
|
|
180
|
182
|
rankData2.length = 0
|
|
181
|
|
- teamRes.data.slice(0, 10).forEach(item => {
|
|
|
183
|
+ teamRes.value.data.slice(0, 10).forEach(item => {
|
|
182
|
184
|
rankData2.push({
|
|
183
|
185
|
name: item.teamLeaderName || item.name || '',
|
|
184
|
186
|
value: item.count || item.value || 0
|
|
|
@@ -186,9 +188,9 @@ const fetchData = async () => {
|
|
186
|
188
|
})
|
|
187
|
189
|
}
|
|
188
|
190
|
|
|
189
|
|
- if (userRes.data) {
|
|
|
191
|
+ if (userRes.value?.data) {
|
|
190
|
192
|
rankData3.length = 0
|
|
191
|
|
- userRes.data.slice(0, 10).forEach(item => {
|
|
|
193
|
+ userRes.value.data.slice(0, 10).forEach(item => {
|
|
192
|
194
|
rankData3.push({
|
|
193
|
195
|
name: item.userName || item.name || '',
|
|
194
|
196
|
value: item.count || item.value || 0
|
|
|
@@ -196,46 +198,46 @@ const fetchData = async () => {
|
|
196
|
198
|
})
|
|
197
|
199
|
}
|
|
198
|
200
|
|
|
199
|
|
- if (genderRes.data) {
|
|
200
|
|
- const genderData = genderRes.data.map(item => ({
|
|
|
201
|
+ if (genderRes.value?.data) {
|
|
|
202
|
+ const genderData = genderRes.value.data.map(item => ({
|
|
201
|
203
|
name: item.gender || item.name || '',
|
|
202
|
204
|
value: item.percentage || item.value || 0
|
|
203
|
205
|
}))
|
|
204
|
206
|
setOption4(pieChartOption(genderData, ['#ec4899', '#3b82f6']))
|
|
205
|
207
|
}
|
|
206
|
208
|
|
|
207
|
|
- if (certDetailRes.data) {
|
|
208
|
|
- const certData = certDetailRes.data.map(item => ({
|
|
|
209
|
+ if (certDetailRes.value?.data) {
|
|
|
210
|
+ const certData = certDetailRes.value.data.map(item => ({
|
|
209
|
211
|
name: item.certificateLevel || item.name || '',
|
|
210
|
212
|
value: item.percentage || item.value || 0
|
|
211
|
213
|
}))
|
|
212
|
214
|
setOption5(pieChartOption(certData, ['#22c55e', '#3b82f6']))
|
|
213
|
215
|
}
|
|
214
|
216
|
|
|
215
|
|
- if (certBaseRes.data) {
|
|
216
|
|
- const baseData = certBaseRes.data.map(item => ({
|
|
|
217
|
+ if (certBaseRes.value?.data) {
|
|
|
218
|
+ const baseData = certBaseRes.value.data.map(item => ({
|
|
217
|
219
|
name: item.certificateLevel || item.name || '',
|
|
218
|
220
|
value: item.percentage || item.value || 0
|
|
219
|
221
|
}))
|
|
220
|
222
|
setOption6(pieChartOption(baseData, ['#22c55e', '#3b82f6']))
|
|
221
|
223
|
}
|
|
222
|
224
|
|
|
223
|
|
- if (locationRes.data) {
|
|
|
225
|
+ if (locationRes.value?.data) {
|
|
224
|
226
|
const colors = ['#8b5cf6', '#ec4899', '#f97316', '#22c55e', '#3b82f6', '#14b8a6', '#ef4444', '#fbbf24', '#6366f1', '#06b6d4', '#84cc16', '#e11d48']
|
|
225
|
|
- const locationData = locationRes.data.map(item => ({
|
|
226
|
|
- name: item.location || item.name || '',
|
|
|
227
|
+ const locationData = locationRes.value.data.map(item => ({
|
|
|
228
|
+ name: item.itemLocation || item.name || '',
|
|
227
|
229
|
value: item.percentage || item.value || 0
|
|
228
|
230
|
}))
|
|
229
|
231
|
setOption7(donutChartOption(locationData, colors))
|
|
230
|
232
|
}
|
|
231
|
233
|
|
|
232
|
|
- if (difficultyRes.data) {
|
|
|
234
|
+ if (difficultyRes.value?.data) {
|
|
233
|
235
|
let difficult = 0
|
|
234
|
236
|
let simple = 0
|
|
235
|
|
- difficultyRes.data.forEach(item => {
|
|
236
|
|
- if (item.difficulty === 'difficult' || item.difficulty === '困难') {
|
|
|
237
|
+ difficultyRes.value.data.forEach(item => {
|
|
|
238
|
+ if (item.difficultyLevel === '难') {
|
|
237
|
239
|
difficult = item.count || item.value || 0
|
|
238
|
|
- } else if (item.difficulty === 'simple' || item.difficulty === '简单') {
|
|
|
240
|
+ } else if (item.difficultyLevel === '简单') {
|
|
239
|
241
|
simple = item.count || item.value || 0
|
|
240
|
242
|
}
|
|
241
|
243
|
})
|
|
|
@@ -243,32 +245,69 @@ const fetchData = async () => {
|
|
243
|
245
|
simpleValue.value = simple
|
|
244
|
246
|
}
|
|
245
|
247
|
|
|
246
|
|
- if (supervisorDistRes.data) {
|
|
|
248
|
+ if (supervisorDistRes.value?.data) {
|
|
247
|
249
|
const colors = ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6', '#ef4444', '#fbbf24', '#6366f1', '#06b6d4', '#84cc16', '#e11d48', '#a855f7', '#f59e0b']
|
|
248
|
|
- const supervisorData = supervisorDistRes.data.map(item => ({
|
|
|
250
|
+ const supervisorData = supervisorDistRes.value.data.map(item => ({
|
|
249
|
251
|
name: item.supervisorName || item.name || '',
|
|
250
|
252
|
value: item.percentage || item.value || 0
|
|
251
|
253
|
}))
|
|
252
|
254
|
setOption10(donutChartOption(supervisorData, colors))
|
|
253
|
255
|
}
|
|
254
|
256
|
|
|
255
|
|
- if (reasonRes.data) {
|
|
|
257
|
+ if (reasonRes.value?.data) {
|
|
256
|
258
|
const colors = ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6', '#ef4444', '#fbbf24']
|
|
257
|
|
- const reasonData = reasonRes.data.map(item => ({
|
|
258
|
|
- name: item.reason || item.name || '',
|
|
259
|
|
- value: item.percentage || item.value || 0
|
|
|
259
|
+ const reasonData = reasonRes.value.data.map(item => ({
|
|
|
260
|
+ name: item.missCheckReasonCategory || '',
|
|
|
261
|
+ value: item.count || 0
|
|
260
|
262
|
}))
|
|
261
|
263
|
setOption11(pieChartOption(reasonData, colors))
|
|
262
|
264
|
}
|
|
263
|
265
|
|
|
264
|
|
- if (yearsRes.data) {
|
|
|
266
|
+ if (yearsRes.value?.data) {
|
|
265
|
267
|
const colors = ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6']
|
|
266
|
|
- const yearsData = yearsRes.data.map(item => ({
|
|
267
|
|
- name: item.yearsRange || item.name || '',
|
|
268
|
|
- value: item.percentage || item.value || 0
|
|
|
268
|
+ const yearsData = yearsRes.value.data.map(item => ({
|
|
|
269
|
+ name: item.operatingYears || '',
|
|
|
270
|
+ value: item.count || 0
|
|
269
|
271
|
}))
|
|
270
|
272
|
setOption12(pieChartOption(yearsData, colors))
|
|
271
|
273
|
}
|
|
|
274
|
+
|
|
|
275
|
+ if (tenureRes.value?.data) {
|
|
|
276
|
+ const xAxisData = tenureRes.value.data.map(item => item.brigadeName || '')
|
|
|
277
|
+ const seriesData = [
|
|
|
278
|
+ {
|
|
|
279
|
+ name: '5年及以上',
|
|
|
280
|
+ data: tenureRes.value.data.map(item => item.cntGe5Year || 0),
|
|
|
281
|
+ color: '#3b82f6'
|
|
|
282
|
+ },
|
|
|
283
|
+ {
|
|
|
284
|
+ name: '4年',
|
|
|
285
|
+ data: tenureRes.value.data.map(item => item.cnt4Years || 0),
|
|
|
286
|
+ color: '#22c55e'
|
|
|
287
|
+ },
|
|
|
288
|
+ {
|
|
|
289
|
+ name: '3年',
|
|
|
290
|
+ data: tenureRes.value.data.map(item => item.cnt3Years || 0),
|
|
|
291
|
+ color: '#f97316'
|
|
|
292
|
+ },
|
|
|
293
|
+ {
|
|
|
294
|
+ name: '2年',
|
|
|
295
|
+ data: tenureRes.value.data.map(item => item.cnt2Years || 0),
|
|
|
296
|
+ color: '#ec4899'
|
|
|
297
|
+ },
|
|
|
298
|
+ {
|
|
|
299
|
+ name: '1年',
|
|
|
300
|
+ data: tenureRes.value.data.map(item => item.cnt1Years || 0),
|
|
|
301
|
+ color: '#8b5cf6'
|
|
|
302
|
+ },
|
|
|
303
|
+ {
|
|
|
304
|
+ name: '不足1年',
|
|
|
305
|
+ data: tenureRes.value.data.map(item => item.cntLt1Year || 0),
|
|
|
306
|
+ color: '#14b8a6'
|
|
|
307
|
+ }
|
|
|
308
|
+ ]
|
|
|
309
|
+ setOption13(multiSeriesBarChartOption(xAxisData, seriesData))
|
|
|
310
|
+ }
|
|
272
|
311
|
} catch (error) {
|
|
273
|
312
|
console.error('获取数据失败:', error)
|
|
274
|
313
|
} finally {
|
|
|
@@ -282,23 +321,42 @@ watch(() => props.filterParams, () => {
|
|
282
|
321
|
|
|
283
|
322
|
const pieChartOption = (data, colors) => ({
|
|
284
|
323
|
color: colors,
|
|
|
324
|
+ tooltip: { trigger: 'item', formatter: '{b}: {c}' },
|
|
285
|
325
|
series: [{
|
|
286
|
326
|
type: 'pie',
|
|
287
|
327
|
radius: ['40%', '65%'],
|
|
288
|
328
|
center: ['50%', '55%'],
|
|
289
|
329
|
data: data,
|
|
290
|
|
- label: { show: true, formatter: '{b}\n{c}%', fontSize: 10 }
|
|
|
330
|
+ label: {
|
|
|
331
|
+ show: true,
|
|
|
332
|
+ formatter: (params) => {
|
|
|
333
|
+ const total = data.reduce((sum, item) => sum + item.value, 0)
|
|
|
334
|
+ const percentage = ((params.value / total) * 100).toFixed(2)
|
|
|
335
|
+ return `${params.name}\n${params.value}(${percentage}%)`
|
|
|
336
|
+ },
|
|
|
337
|
+ fontSize: 10
|
|
|
338
|
+ }
|
|
291
|
339
|
}]
|
|
292
|
340
|
})
|
|
293
|
341
|
|
|
294
|
342
|
const donutChartOption = (data, colors) => ({
|
|
295
|
343
|
color: colors,
|
|
|
344
|
+ tooltip: { trigger: 'item', formatter: '{b}: {c}' },
|
|
296
|
345
|
series: [{
|
|
297
|
346
|
type: 'pie',
|
|
298
|
347
|
radius: ['30%', '55%'],
|
|
299
|
348
|
center: ['50%', '55%'],
|
|
300
|
349
|
data: data,
|
|
301
|
|
- label: { show: true, formatter: '{b}', fontSize: 10, position: 'outside' }
|
|
|
350
|
+ label: {
|
|
|
351
|
+ show: true,
|
|
|
352
|
+ position: 'outside',
|
|
|
353
|
+ formatter: (params) => {
|
|
|
354
|
+ const total = data.reduce((sum, item) => sum + item.value, 0)
|
|
|
355
|
+ const percentage = ((params.value / total) * 100).toFixed(2)
|
|
|
356
|
+ return `${params.name} ${params.value}(${percentage}%)`
|
|
|
357
|
+ },
|
|
|
358
|
+ fontSize: 10
|
|
|
359
|
+ }
|
|
302
|
360
|
}]
|
|
303
|
361
|
})
|
|
304
|
362
|
|
|
|
@@ -309,82 +367,37 @@ const multiBarChartOption = (data, color) => ({
|
|
309
|
367
|
series: [{ type: 'bar', data: data.map(d => d.value), itemStyle: { color: color }, barWidth: 20 }]
|
|
310
|
368
|
})
|
|
311
|
369
|
|
|
|
370
|
+const multiSeriesBarChartOption = (xAxisData, series) => ({
|
|
|
371
|
+ grid: { left: '10%', top: '15%', right: '5%', bottom: '15%', containLabel: true },
|
|
|
372
|
+ xAxis: {
|
|
|
373
|
+ type: 'category',
|
|
|
374
|
+ data: xAxisData,
|
|
|
375
|
+ axisLine: { lineStyle: { color: '#999' } },
|
|
|
376
|
+ axisLabel: { fontSize: 10, color: '#666' }
|
|
|
377
|
+ },
|
|
|
378
|
+ yAxis: {
|
|
|
379
|
+ type: 'value',
|
|
|
380
|
+ axisLine: { lineStyle: { color: '#999' } },
|
|
|
381
|
+ axisLabel: { fontSize: 10, color: '#666' },
|
|
|
382
|
+ splitLine: { lineStyle: { color: '#eee' } }
|
|
|
383
|
+ },
|
|
|
384
|
+ legend: {
|
|
|
385
|
+ data: series.map(s => s.name),
|
|
|
386
|
+ top: '0%',
|
|
|
387
|
+ textStyle: { fontSize: 10 }
|
|
|
388
|
+ },
|
|
|
389
|
+ series: series.map(s => ({
|
|
|
390
|
+ name: s.name,
|
|
|
391
|
+ type: 'bar',
|
|
|
392
|
+ data: s.data,
|
|
|
393
|
+ itemStyle: { color: s.color },
|
|
|
394
|
+ barWidth: 15
|
|
|
395
|
+ }))
|
|
|
396
|
+})
|
|
|
397
|
+
|
|
312
|
398
|
onMounted(() => {
|
|
313
|
399
|
fetchData()
|
|
314
|
|
- setOption4(pieChartOption([
|
|
315
|
|
- { name: '女', value: 52.26 },
|
|
316
|
|
- { name: '男', value: 47.74 }
|
|
317
|
|
- ], ['#ec4899', '#3b82f6']))
|
|
318
|
|
-
|
|
319
|
|
- setOption5(pieChartOption([
|
|
320
|
|
- { name: '高级', value: 49.81 },
|
|
321
|
|
- { name: '中级', value: 50.19 }
|
|
322
|
|
- ], ['#22c55e', '#3b82f6']))
|
|
323
|
|
-
|
|
324
|
|
- setOption6(pieChartOption([
|
|
325
|
|
- { name: '高级证书', value: 1.59 },
|
|
326
|
|
- { name: '中级证书', value: 98.41 }
|
|
327
|
|
- ], ['#22c55e', '#3b82f6']))
|
|
328
|
|
-
|
|
329
|
|
- setOption7(donutChartOption([
|
|
330
|
|
- { name: '中下', value: 6.35 },
|
|
331
|
|
- { name: '中间', value: 11.85 },
|
|
332
|
|
- { name: '右下', value: 7.74 },
|
|
333
|
|
- { name: '右上', value: 7.56 },
|
|
334
|
|
- { name: '左中', value: 7.26 },
|
|
335
|
|
- { name: '左上', value: 6.61 },
|
|
336
|
|
- { name: '左上', value: 11.16 },
|
|
337
|
|
- { name: '右下', value: 6.45 },
|
|
338
|
|
- { name: '右上', value: 12.42 },
|
|
339
|
|
- { name: '中下', value: 7.41 },
|
|
340
|
|
- { name: '右上', value: 6.11 },
|
|
341
|
|
- { name: '左上', value: 10.24 }
|
|
342
|
|
- ], ['#8b5cf6', '#ec4899', '#f97316', '#22c55e', '#3b82f6', '#14b8a6', '#ef4444', '#fbbf24', '#6366f1', '#06b6d4', '#84cc16', '#e11d48']))
|
|
343
|
|
-
|
|
344
|
|
- setOption10(donutChartOption([
|
|
345
|
|
- { name: '赵德峰', value: 12.46 },
|
|
346
|
|
- { name: '刘佳', value: 7.94 },
|
|
347
|
|
- { name: '郑晓华', value: 7.94 },
|
|
348
|
|
- { name: '谢金艳', value: 7.82 },
|
|
349
|
|
- { name: '潘仁芳', value: 7.33 },
|
|
350
|
|
- { name: '张庆林', value: 7.2 },
|
|
351
|
|
- { name: '陈颖', value: 7.2 },
|
|
352
|
|
- { name: '李学芬', value: 7.2 },
|
|
353
|
|
- { name: '李俊峰', value: 7.08 },
|
|
354
|
|
- { name: '周雪梅', value: 7.08 },
|
|
355
|
|
- { name: '刘旭', value: 6.46 },
|
|
356
|
|
- { name: '李丽', value: 6.46 },
|
|
357
|
|
- { name: '任静', value: 6.46 },
|
|
358
|
|
- { name: '张静', value: 6.46 }
|
|
359
|
|
- ], ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6', '#ef4444', '#fbbf24', '#6366f1', '#06b6d4', '#84cc16', '#e11d48', '#a855f7', '#f59e0b']))
|
|
360
|
|
-
|
|
361
|
|
- setOption11(pieChartOption([
|
|
362
|
|
- { name: '问题判断不清,未按规范检查导致漏检', value: 23.20 },
|
|
363
|
|
- { name: '未按规范检查导致漏检', value: 7.04 },
|
|
364
|
|
- { name: '判断不清,漏检', value: 6.48 },
|
|
365
|
|
- { name: '未能辨别危险品', value: 5.92 },
|
|
366
|
|
- { name: '未能辨别危险品', value: 5.92 },
|
|
367
|
|
- { name: '未能辨别危险品', value: 2.88 },
|
|
368
|
|
- { name: '简单漏检未能认真判断', value: 21.23 },
|
|
369
|
|
- { name: '未能辨别危险品', value: 27.34 }
|
|
370
|
|
- ], ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6', '#ef4444', '#fbbf24']))
|
|
371
|
|
-
|
|
372
|
|
- setOption12(pieChartOption([
|
|
373
|
|
- { name: '5年及5年以上', value: 30.71 },
|
|
374
|
|
- { name: '4年人员数', value: 18.68 },
|
|
375
|
|
- { name: '3年人员数', value: 22.47 },
|
|
376
|
|
- { name: '2年人员数', value: 14.75 },
|
|
377
|
|
- { name: '1年人员数', value: 6.76 },
|
|
378
|
|
- { name: '不足1年人员数', value: 6.63 }
|
|
379
|
|
- ], ['#3b82f6', '#22c55e', '#f97316', '#ec4899', '#8b5cf6', '#14b8a6']))
|
|
380
|
|
-
|
|
381
|
|
- setOption13(multiBarChartOption([
|
|
382
|
|
- { name: '安检一大队', value: 104 },
|
|
383
|
|
- { name: '安检二大队', value: 39 },
|
|
384
|
|
- { name: '安检三大队', value: 14 },
|
|
385
|
|
- { name: '安检四大队', value: 13 },
|
|
386
|
|
- { name: '安检五大队', value: 12 }
|
|
387
|
|
- ], '#3b82f6'))
|
|
|
400
|
+
|
|
388
|
401
|
})
|
|
389
|
402
|
</script>
|
|
390
|
403
|
|
|
|
@@ -407,20 +420,19 @@ onMounted(() => {
|
|
407
|
420
|
flex: 1;
|
|
408
|
421
|
background: #fff;
|
|
409
|
422
|
border-radius: 6px;
|
|
410
|
|
- padding: 10px;
|
|
|
423
|
+ padding: 15px;
|
|
411
|
424
|
border: 1px solid #eee;
|
|
412
|
425
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
413
|
426
|
display: flex;
|
|
414
|
427
|
flex-direction: column;
|
|
415
|
|
- min-height: 200px;
|
|
|
428
|
+ min-height: 280px;
|
|
416
|
429
|
}
|
|
417
|
430
|
|
|
418
|
431
|
.chart-title {
|
|
419
|
|
- font-size: 14px;
|
|
420
|
|
- color: #333;
|
|
|
432
|
+ font-size: 17px;
|
|
|
433
|
+ color: black;
|
|
421
|
434
|
margin-bottom: 5px;
|
|
422
|
435
|
text-align: left;
|
|
423
|
|
- font-weight: 500;
|
|
424
|
436
|
}
|
|
425
|
437
|
|
|
426
|
438
|
.echarts {
|
|
|
@@ -445,7 +457,7 @@ onMounted(() => {
|
|
445
|
457
|
|
|
446
|
458
|
.number-unit {
|
|
447
|
459
|
font-size: 14px;
|
|
448
|
|
- color: #666;
|
|
|
460
|
+ color: #3b82f6;
|
|
449
|
461
|
margin-top: 5px;
|
|
450
|
462
|
}
|
|
451
|
463
|
</style>
|