|
|
@@ -2,7 +2,7 @@
|
|
2
|
2
|
<view class="redline-page">
|
|
3
|
3
|
<view class="page-header">
|
|
4
|
4
|
<view class="header-title">红线指标预警</view>
|
|
5
|
|
- <view class="header-subtitle">权重扣分 ≥ 3分自动进入红色预警区</view>
|
|
|
5
|
+ <view class="header-subtitle">员工综合评估(<75分红色预警 | ≥90分优秀)</view>
|
|
6
|
6
|
<view class="badge-group">
|
|
7
|
7
|
<view class="alert-badge">红色预警</view>
|
|
8
|
8
|
<view class="alert-badge orange">动态月度数据</view>
|
|
|
@@ -55,7 +55,7 @@
|
|
55
|
55
|
<!-- 员工列表 -->
|
|
56
|
56
|
<view class="section-area">
|
|
57
|
57
|
<SectionTitle title="红线指标预警明细">
|
|
58
|
|
- <view class="section-badge">权重扣分 ≥ 3分</view>
|
|
|
58
|
+ <view class="section-badge">评分依据:员工配分表</view>
|
|
59
|
59
|
</SectionTitle>
|
|
60
|
60
|
|
|
61
|
61
|
<view class="table-wrapper">
|
|
|
@@ -64,12 +64,17 @@
|
|
64
|
64
|
<text v-if="row.totalScore >= 3" class="score-danger">{{ row.totalScore }}</text>
|
|
65
|
65
|
<text v-else>{{ row.totalScore }}</text>
|
|
66
|
66
|
</template>
|
|
|
67
|
+ <template #column-warningLevel="{ row }">
|
|
|
68
|
+ <text :style="{ color: row.warningLevel === '1' ? '#dc2626' : '' }">{{ getDictLabel(alertLevelList, row.warningLevel) }}</text>
|
|
|
69
|
+ </template>
|
|
|
70
|
+ <template #column-statusLabel="{ row }">
|
|
|
71
|
+ <text :style="{ color: row.statusLabel === '1' ? '#dc2626' : '' }">{{ getDictLabel(statusLabelList, row.statusLabel) }}</text>
|
|
|
72
|
+ </template>
|
|
67
|
73
|
</statistic-table>
|
|
68
|
74
|
</view>
|
|
69
|
75
|
|
|
70
|
76
|
<view class="pagination-wrapper" v-if="total > 0">
|
|
71
|
|
- <uni-pagination :current="pageNum" :total="total" :page-size="pageSize" :show-page-size="true"
|
|
72
|
|
- :page-size-range="[10, 20, 50]" @change="onPageChange" @pageSizeChange="onPageSizeChange" />
|
|
|
77
|
+ <uni-pagination :current="pageNum" :total="total" :page-size="pageSize" simple @change="onPageChange" />
|
|
73
|
78
|
</view>
|
|
74
|
79
|
|
|
75
|
80
|
<view class="warning-summary">
|
|
|
@@ -142,9 +147,11 @@ import StatisticTable from '@/components/statistic-table/statistic-table.vue'
|
|
142
|
147
|
import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
|
|
143
|
148
|
import { getRedLineWarningPageData } from '@/api/warningManage/index'
|
|
144
|
149
|
import { getDeptUserTree } from '@/api/system/user'
|
|
|
150
|
+import useDict from '@/utils/dict'
|
|
145
|
151
|
|
|
146
|
152
|
export default {
|
|
147
|
153
|
name: 'RedLineWarning',
|
|
|
154
|
+ mixins: [useDict],
|
|
148
|
155
|
components: {
|
|
149
|
156
|
SectionTitle,
|
|
150
|
157
|
StatisticTable,
|
|
|
@@ -166,10 +173,8 @@ export default {
|
|
166
|
173
|
deptTreeData: [],
|
|
167
|
174
|
expandedDeptIds: [],
|
|
168
|
175
|
orgList: [],
|
|
169
|
|
- alertLevelList: [
|
|
170
|
|
- { label: '红色预警', value: '1' },
|
|
171
|
|
- { label: '正常范围', value: '3' }
|
|
172
|
|
- ],
|
|
|
176
|
+ alertLevelList: [],
|
|
|
177
|
+ statusLabelList: [],
|
|
173
|
178
|
tableColumns: [
|
|
174
|
179
|
{ props: 'nickName', title: '姓名' },
|
|
175
|
180
|
{ props: 'deptName', title: '部门' },
|
|
|
@@ -177,8 +182,9 @@ export default {
|
|
177
|
182
|
{ props: 'level2Name', title: '二级指标' },
|
|
178
|
183
|
{ props: 'totalScore', title: '扣分合计', slot: true },
|
|
179
|
184
|
{ props: 'occurrenceCount', title: '发生次数' },
|
|
180
|
|
- { props: 'warningLevel', title: '预警等级' },
|
|
181
|
|
- { props: 'coreRisks', title: '核心风险' }
|
|
|
185
|
+ { props: 'warningLevel', title: '预警等级', slot: true },
|
|
|
186
|
+ { props: 'coreRisks', title: '核心风险' },
|
|
|
187
|
+ { props: 'statusLabel', title: '状态标签', slot: true }
|
|
182
|
188
|
],
|
|
183
|
189
|
tableData: [],
|
|
184
|
190
|
allTableData: [],
|
|
|
@@ -197,6 +203,10 @@ export default {
|
|
197
|
203
|
return this.orgList.filter(item =>
|
|
198
|
204
|
(item.nickName || '').toLowerCase().includes(keyword)
|
|
199
|
205
|
)
|
|
|
206
|
+ },
|
|
|
207
|
+ filteredTableData() {
|
|
|
208
|
+ if (!this.selectedAlertLevel) return this.allTableData
|
|
|
209
|
+ return this.allTableData.filter(item => item.warningLevel === this.selectedAlertLevel)
|
|
200
|
210
|
}
|
|
201
|
211
|
},
|
|
202
|
212
|
onLoad(options) {
|
|
|
@@ -211,16 +221,15 @@ export default {
|
|
211
|
221
|
this.endTime = options.endDate
|
|
212
|
222
|
}
|
|
213
|
223
|
if (options.activeRange) {
|
|
214
|
|
- this.selectedTimeTag = options.activeRange
|
|
|
224
|
+ this.selectedTimeTag = Number(options.activeRange)
|
|
215
|
225
|
}
|
|
216
|
226
|
if (options.alertLevel) {
|
|
217
|
227
|
this.selectedAlertLevel = options.alertLevel
|
|
218
|
|
- const item = this.alertLevelList.find(l => l.value === options.alertLevel)
|
|
219
|
|
- if (item) this.selectedLevelName = item.label
|
|
220
|
228
|
}
|
|
221
|
229
|
},
|
|
222
|
230
|
mounted() {
|
|
223
|
231
|
this.loadDeptTree()
|
|
|
232
|
+ this.loadDicts()
|
|
224
|
233
|
this.fetchData()
|
|
225
|
234
|
},
|
|
226
|
235
|
methods: {
|
|
|
@@ -292,6 +301,10 @@ export default {
|
|
292
|
301
|
this.deptTreeData = res.data || []
|
|
293
|
302
|
this.orgList = this.flattenDeptTree(this.deptTreeData).filter(u => u.nodeType === 'user')
|
|
294
|
303
|
this.expandAllDepts(this.deptTreeData)
|
|
|
304
|
+ if (this.selectedOrgId) {
|
|
|
305
|
+ const user = this.orgList.find(u => u.userId === this.selectedOrgId)
|
|
|
306
|
+ if (user) this.selectedOrgName = user.nickName
|
|
|
307
|
+ }
|
|
295
|
308
|
}
|
|
296
|
309
|
}).catch(() => { })
|
|
297
|
310
|
},
|
|
|
@@ -314,6 +327,8 @@ export default {
|
|
314
|
327
|
const item = this.alertLevelList.find(l => l.value === value)
|
|
315
|
328
|
this.selectedLevelName = value === '' ? '全部' : (item ? item.label : '')
|
|
316
|
329
|
this.showLevelPicker = false
|
|
|
330
|
+ this.pageNum = 1
|
|
|
331
|
+ this.updatePagedData()
|
|
317
|
332
|
},
|
|
318
|
333
|
handleSearch() {
|
|
319
|
334
|
this.pageNum = 1
|
|
|
@@ -332,30 +347,44 @@ export default {
|
|
332
|
347
|
},
|
|
333
|
348
|
onPageChange(e) {
|
|
334
|
349
|
this.pageNum = e.current
|
|
335
|
|
- this.fetchData()
|
|
336
|
|
- },
|
|
337
|
|
- onPageSizeChange(e) {
|
|
338
|
|
- this.pageSize = e.pageSize
|
|
339
|
|
- this.pageNum = 1
|
|
340
|
|
- this.fetchData()
|
|
|
350
|
+ this.updatePagedData()
|
|
341
|
351
|
},
|
|
342
|
352
|
async fetchData() {
|
|
343
|
353
|
let params = this.getQueryParams()
|
|
344
|
|
- params.pageNum = this.pageNum
|
|
345
|
|
- params.pageSize = this.pageSize
|
|
346
|
354
|
try {
|
|
347
|
355
|
const res = await getRedLineWarningPageData(params)
|
|
348
|
356
|
if (res.code === 200 && res.data) {
|
|
349
|
357
|
const data = res.data
|
|
350
|
358
|
this.allTableData = data || []
|
|
351
|
|
- this.tableData = this.allTableData
|
|
352
|
|
- this.total = data.total || this.allTableData.length
|
|
353
|
359
|
this.redAlertCount = data.redAlertNum || 0
|
|
354
|
360
|
this.excellentCount = data.excellentBenchmarkNum || 0
|
|
355
|
361
|
this.avgScore = data.averageComprehensiveScore || 0
|
|
|
362
|
+ this.pageNum = 1
|
|
|
363
|
+ this.updatePagedData()
|
|
356
|
364
|
}
|
|
357
|
365
|
} catch (e) { }
|
|
358
|
366
|
},
|
|
|
367
|
+ async loadDicts() {
|
|
|
368
|
+ const res = await this.useDict('alert_level', 'status_label')
|
|
|
369
|
+ this.alertLevelList = res.alert_level || []
|
|
|
370
|
+ this.statusLabelList = res.status_label || []
|
|
|
371
|
+ if (this.selectedAlertLevel) {
|
|
|
372
|
+ const item = this.alertLevelList.find(l => l.value === this.selectedAlertLevel)
|
|
|
373
|
+ if (item) this.selectedLevelName = item.label
|
|
|
374
|
+ }
|
|
|
375
|
+ },
|
|
|
376
|
+ getDictLabel(dictList, value) {
|
|
|
377
|
+ if (!value) return ''
|
|
|
378
|
+ const item = dictList.find(d => d.value === value)
|
|
|
379
|
+ return item ? item.label : value
|
|
|
380
|
+ },
|
|
|
381
|
+ updatePagedData() {
|
|
|
382
|
+ const data = this.filteredTableData
|
|
|
383
|
+ this.total = data.length
|
|
|
384
|
+ const start = (this.pageNum - 1) * this.pageSize
|
|
|
385
|
+ const end = start + this.pageSize
|
|
|
386
|
+ this.tableData = data.slice(start, end)
|
|
|
387
|
+ },
|
|
359
|
388
|
getQueryParams() {
|
|
360
|
389
|
let params = {}
|
|
361
|
390
|
if (this.beginTime && this.endTime) {
|
|
|
@@ -369,9 +398,6 @@ export default {
|
|
369
|
398
|
if (this.selectedOrgId) {
|
|
370
|
399
|
params.userId = this.selectedOrgId
|
|
371
|
400
|
}
|
|
372
|
|
- if (this.selectedAlertLevel) {
|
|
373
|
|
- params.warningLevel = this.selectedAlertLevel
|
|
374
|
|
- }
|
|
375
|
401
|
return params
|
|
376
|
402
|
}
|
|
377
|
403
|
}
|