|
|
@@ -74,52 +74,56 @@
|
|
74
|
74
|
</div>
|
|
75
|
75
|
<div class="employee-card">
|
|
76
|
76
|
<div style="overflow-x: auto;">
|
|
77
|
|
- <table class="data-table" style="width:100%;">
|
|
78
|
|
- <thead>
|
|
79
|
|
- <tr>
|
|
80
|
|
- <th>员工ID</th>
|
|
81
|
|
- <th>姓名</th>
|
|
82
|
|
- <th>所属部门</th>
|
|
83
|
|
- <th>综合评估得分</th>
|
|
84
|
|
- <th>预警等级</th>
|
|
85
|
|
- <th>核心风险/优秀事迹</th>
|
|
86
|
|
- <th>状态标签</th>
|
|
87
|
|
- </tr>
|
|
88
|
|
- </thead>
|
|
89
|
|
- <tbody>
|
|
90
|
|
- <tr v-for="emp in filteredEmployees" :key="emp.id" :class="getRowClass(emp.overallScore)">
|
|
91
|
|
- <td>{{ emp.userId }}</td>
|
|
92
|
|
- <td><strong>{{ emp.nickName }}</strong></td>
|
|
93
|
|
- <td>{{ emp.deptName }}</td>
|
|
94
|
|
- <td>
|
|
95
|
|
- <span v-if="emp.overallScore < 75" class="score-danger">{{ emp.overallScore }}
|
|
96
|
|
- 分</span>
|
|
97
|
|
- <span v-else-if="emp.overallScore >= 90" class="score-excellent">{{ emp.overallScore
|
|
98
|
|
- }}
|
|
99
|
|
- 分</span>
|
|
100
|
|
- <span v-else style="font-weight:600;">{{ emp.overallScore }} 分</span>
|
|
101
|
|
- </td>
|
|
102
|
|
- <td>
|
|
103
|
|
- <span v-if="emp.overallScore < 75" class="status-badge"
|
|
104
|
|
- style="animation: subtlePulse 1s infinite;"><i
|
|
105
|
|
- class="fas fa-exclamation-triangle"></i> 红色预警</span>
|
|
106
|
|
- <span v-else-if="emp.overallScore >= 90" class="status-excellent"
|
|
107
|
|
- style="background:#d1fae5; color:#065f46;"><i class="fas fa-star"></i>
|
|
108
|
|
- 优秀标杆</span>
|
|
109
|
|
- <span v-else class="status-warning">正常范围</span>
|
|
110
|
|
- </td>
|
|
111
|
|
- <td style="font-size:0.75rem;">{{ emp.coreRisksOrOutstandingAchievements }}</td>
|
|
112
|
|
- <td>
|
|
113
|
|
- <span v-if="emp.overallScore < 75" style="color:#b91c1c;"><i
|
|
114
|
|
- class="fas fa-bell"></i>
|
|
115
|
|
- {{ getAlertLabel(emp.statusLabel) }}</span>
|
|
116
|
|
- <span v-else-if="emp.overallScore >= 90" style="color:#15803d;"><i
|
|
117
|
|
- class="fas fa-crown"></i> {{ getAlertLabel(emp.statusLabel) }}</span>
|
|
118
|
|
- <span v-else>{{ getAlertLabel(emp.statusLabel) }}</span>
|
|
119
|
|
- </td>
|
|
120
|
|
- </tr>
|
|
121
|
|
- </tbody>
|
|
122
|
|
- </table>
|
|
|
77
|
+ <el-table :data="filteredEmployees" :row-class-name="getRowClass" style="width:100%;" border stripe>
|
|
|
78
|
+ <el-table-column prop="userId" label="员工ID" />
|
|
|
79
|
+ <el-table-column prop="nickName" label="姓名">
|
|
|
80
|
+ <template #default="{ row }">
|
|
|
81
|
+ <strong>{{ row.nickName }}</strong>
|
|
|
82
|
+ </template>
|
|
|
83
|
+ </el-table-column>
|
|
|
84
|
+ <el-table-column prop="deptName" label="所属部门" />
|
|
|
85
|
+ <el-table-column prop="eventTime" label="事件时间" sortable width="180" />
|
|
|
86
|
+ <el-table-column prop="overallScore" label="综合评估得分" sortable>
|
|
|
87
|
+ <template #default="{ row }">
|
|
|
88
|
+ <span v-if="row.overallScore < 75" class="score-danger">{{ row.overallScore }} 分</span>
|
|
|
89
|
+ <span v-else-if="row.overallScore >= 90" class="score-excellent">{{ row.overallScore }} 分</span>
|
|
|
90
|
+ <span v-else style="font-weight:600;">{{ row.overallScore }} 分</span>
|
|
|
91
|
+ </template>
|
|
|
92
|
+ </el-table-column>
|
|
|
93
|
+ <el-table-column prop="overallScore" label="预警等级">
|
|
|
94
|
+ <template #default="{ row }">
|
|
|
95
|
+ <span v-if="row.overallScore < 75" class="status-badge"
|
|
|
96
|
+ style="animation: subtlePulse 1s infinite;"><i
|
|
|
97
|
+ class="fas fa-exclamation-triangle"></i> 红色预警</span>
|
|
|
98
|
+ <span v-else-if="row.overallScore >= 90" class="status-excellent"
|
|
|
99
|
+ style="background:#d1fae5; color:#065f46;"><i class="fas fa-star"></i>
|
|
|
100
|
+ 优秀标杆</span>
|
|
|
101
|
+ <span v-else class="status-warning">正常范围</span>
|
|
|
102
|
+ </template>
|
|
|
103
|
+ </el-table-column>
|
|
|
104
|
+ <el-table-column prop="coreRisksOrOutstandingAchievements" label="核心风险/优秀事迹" />
|
|
|
105
|
+ <el-table-column prop="statusLabel" label="状态标签">
|
|
|
106
|
+ <template #default="{ row }">
|
|
|
107
|
+ <span v-if="row.overallScore < 75" style="color:#b91c1c;"><i
|
|
|
108
|
+ class="fas fa-bell"></i>
|
|
|
109
|
+ {{ getAlertLabel(row.statusLabel) }}</span>
|
|
|
110
|
+ <span v-else-if="row.overallScore >= 90" style="color:#15803d;"><i
|
|
|
111
|
+ class="fas fa-crown"></i> {{ getAlertLabel(row.statusLabel) }}</span>
|
|
|
112
|
+ <span v-else>{{ getAlertLabel(row.statusLabel) }}</span>
|
|
|
113
|
+ </template>
|
|
|
114
|
+ </el-table-column>
|
|
|
115
|
+ </el-table>
|
|
|
116
|
+ <el-pagination
|
|
|
117
|
+ v-show="total > 0"
|
|
|
118
|
+ :total="total"
|
|
|
119
|
+ v-model:current-page="queryParams.pageNum"
|
|
|
120
|
+ v-model:page-size="queryParams.pageSize"
|
|
|
121
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
122
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
123
|
+ @size-change="handleSizeChange"
|
|
|
124
|
+ @current-change="handlePageChange"
|
|
|
125
|
+ style="margin-top: 16px; justify-content: flex-end;"
|
|
|
126
|
+ />
|
|
123
|
127
|
</div>
|
|
124
|
128
|
<div class="warning-summary">
|
|
125
|
129
|
<div><i class="fas fa-circle" style="color:#ef4444;"></i> <strong>红色预警</strong> (综合评估 < 75分) 共计
|
|
|
@@ -190,6 +194,10 @@ const coreRisksOrOutstandingAchievementsList = [
|
|
190
|
194
|
]
|
|
191
|
195
|
|
|
192
|
196
|
const employeesData = ref([])
|
|
|
197
|
+const queryParams = reactive({
|
|
|
198
|
+ pageNum: 1,
|
|
|
199
|
+ pageSize: 10
|
|
|
200
|
+})
|
|
193
|
201
|
|
|
194
|
202
|
for (let i = 0; i < newNames.length; i++) {
|
|
195
|
203
|
employeesData.value.push({
|
|
|
@@ -250,10 +258,8 @@ const getSelectedInfo = (selectedValue) => {
|
|
250
|
258
|
return findNodeByValue(cascadeOptions.value, selectedValue)
|
|
251
|
259
|
}
|
|
252
|
260
|
|
|
253
|
|
-const filteredEmployees = computed(() => {
|
|
254
|
|
- let result = employeesData.value.ledgerWarningDetailItemList
|
|
255
|
|
-
|
|
256
|
|
-
|
|
|
261
|
+const allFilteredEmployees = computed(() => {
|
|
|
262
|
+ let result = employeesData.value.ledgerWarningDetailItemList || []
|
|
257
|
263
|
|
|
258
|
264
|
// 预警等级筛选
|
|
259
|
265
|
if (selectedAlertLevel.value) {
|
|
|
@@ -272,11 +278,26 @@ const filteredEmployees = computed(() => {
|
|
272
|
278
|
}
|
|
273
|
279
|
}
|
|
274
|
280
|
|
|
275
|
|
-
|
|
276
|
|
-
|
|
277
|
281
|
return result
|
|
278
|
282
|
})
|
|
279
|
283
|
|
|
|
284
|
+const filteredEmployees = computed(() => {
|
|
|
285
|
+ const start = (queryParams.pageNum - 1) * queryParams.pageSize
|
|
|
286
|
+ const end = start + queryParams.pageSize
|
|
|
287
|
+ return allFilteredEmployees.value.slice(start, end)
|
|
|
288
|
+})
|
|
|
289
|
+
|
|
|
290
|
+const total = computed(() => allFilteredEmployees.value.length)
|
|
|
291
|
+
|
|
|
292
|
+function handlePageChange(newPage) {
|
|
|
293
|
+ queryParams.pageNum = newPage
|
|
|
294
|
+}
|
|
|
295
|
+
|
|
|
296
|
+function handleSizeChange(newSize) {
|
|
|
297
|
+ queryParams.pageSize = newSize
|
|
|
298
|
+ queryParams.pageNum = 1
|
|
|
299
|
+}
|
|
|
300
|
+
|
|
280
|
301
|
const redAlertCount = computed(() => {
|
|
281
|
302
|
return employeesData.value?.redAlertNum || 0
|
|
282
|
303
|
})
|
|
|
@@ -289,9 +310,9 @@ const avgScore = computed(() => {
|
|
289
|
310
|
return employeesData.value?.averageComprehensiveScore || 0
|
|
290
|
311
|
})
|
|
291
|
312
|
|
|
292
|
|
-const getRowClass = (score) => {
|
|
293
|
|
- if (score < 75) return "employee-warning-row"
|
|
294
|
|
- if (score >= 90) return "employee-excellent-row"
|
|
|
313
|
+const getRowClass = ({ row }) => {
|
|
|
314
|
+ if (row.overallScore < 75) return "employee-warning-row"
|
|
|
315
|
+ if (row.overallScore >= 90) return "employee-excellent-row"
|
|
295
|
316
|
return ""
|
|
296
|
317
|
}
|
|
297
|
318
|
|
|
|
@@ -348,7 +369,7 @@ const warningDataMap = {
|
|
348
|
369
|
}
|
|
349
|
370
|
|
|
350
|
371
|
const fetchWarningData = async () => {
|
|
351
|
|
-
|
|
|
372
|
+ queryParams.pageNum = 1
|
|
352
|
373
|
let params = {}
|
|
353
|
374
|
if (startDate.value && endDate.value) {
|
|
354
|
375
|
params.startDate = formatDate(startDate.value)
|
|
|
@@ -419,6 +440,10 @@ watch(cascadeOptions, (val) => {
|
|
419
|
440
|
}
|
|
420
|
441
|
})
|
|
421
|
442
|
|
|
|
443
|
+watch(selectedAlertLevel, () => {
|
|
|
444
|
+ queryParams.pageNum = 1
|
|
|
445
|
+})
|
|
|
446
|
+
|
|
422
|
447
|
// 监听路由参数变化,回显到级联选择器
|
|
423
|
448
|
watch(() => route.query, (query) => {
|
|
424
|
449
|
const { id } = query
|