Browse Source

feature:pc端的内容移植到移动端

huoyi 15 hours ago
parent
commit
e9adc680fb

+ 6 - 1
src/api/warningManage/index.js

@@ -17,5 +17,10 @@ export function getRedLineWarningPageData(data) {
17 17
 
18 18
 // 员工维度评分明细
19 19
 export function getEmployeeDimensionDetails(data) {
20
-    return request({ url: '/ledger/warning/employeeDimensionDetail', method: 'post', data })
20
+    return request({ url: '/ledger/warning/employeeDimensionScores', method: 'post', data })
21
+}
22
+
23
+//
24
+export function getDimensionAll(params) {
25
+  return request({ url: `/score/dimension/all`, method: 'get', params: params })
21 26
 }

+ 24 - 4
src/pages/components/EmployeeTreeNode.vue

@@ -4,14 +4,18 @@
4 4
             :class="['node-row', { 'is-dept': isDept, 'is-user': isUser }]"
5 5
             @click="handleClick"
6 6
         >
7
-            <view class="toggle-icon" v-if="isDept">
7
+            <view class="toggle-icon" v-if="isDept && !selectable">
8 8
                 <u-icon :name="expanded ? 'arrow-down' : 'arrow-right'" size="16" color="#999" />
9 9
             </view>
10
+            <view class="toggle-icon" v-else-if="isDept && selectable">
11
+                <text class="user-dot" style="color: #A78BFA">●</text>
12
+            </view>
10 13
             <view class="toggle-icon" v-else>
11 14
                 <text class="user-dot">●</text>
12 15
             </view>
13 16
             <text class="node-label">{{ nodeLabel }}</text>
14
-            <u-icon v-if="isUser && nodeId === selectedId" name="checkmark" color="#34D399" size="18" />
17
+            <u-icon v-if="selectable && nodeId === selectedId" name="checkmark" color="#34D399" size="18" />
18
+            <u-icon v-else-if="!selectable && isUser && nodeId === selectedId" name="checkmark" color="#34D399" size="18" />
15 19
         </view>
16 20
         <view v-if="isDept && expanded" class="node-children">
17 21
             <template v-for="child in nodeChildren">
@@ -20,6 +24,7 @@
20 24
                     :node="child"
21 25
                     :expanded-ids="expandedIds"
22 26
                     :selected-id="selectedId"
27
+                    :selectable="selectable"
23 28
                     @toggle="$emit('toggle', $event)"
24 29
                     @select="$emit('select', $event)"
25 30
                 />
@@ -43,6 +48,10 @@ export default {
43 48
         selectedId: {
44 49
             type: [String, Number],
45 50
             default: null
51
+        },
52
+        selectable: {
53
+            type: Boolean,
54
+            default: false
46 55
         }
47 56
     },
48 57
     computed: {
@@ -51,7 +60,7 @@ export default {
51 60
             return hasChildren || this.node.nodeType === 'dept'
52 61
         },
53 62
         isUser() {
54
-            return !this.isDept
63
+            return !this.isDept || this.selectable
55 64
         },
56 65
         nodeId() {
57 66
             return this.node.userId || this.node.id
@@ -73,10 +82,21 @@ export default {
73 82
         handleClick() {
74 83
             if (this.isDept) {
75 84
                 this.$emit('toggle', this.node.id)
85
+                if (this.selectable) {
86
+                    this.$emit('select', {
87
+                        userId: this.node.userId || this.node.id,
88
+                        nodeId: this.node.id,
89
+                        nickName: this.nodeLabel,
90
+                        nodeType: this.node.nodeType || 'dept',
91
+                        deptType: this.node.deptType || ''
92
+                    })
93
+                }
76 94
             } else {
77 95
                 this.$emit('select', {
78 96
                     userId: this.nodeId,
79
-                    nickName: this.nodeLabel
97
+                    nickName: this.nodeLabel,
98
+                    nodeType: this.node.nodeType || 'user',
99
+                    deptType: this.node.deptType || ''
80 100
                 })
81 101
             }
82 102
         }

+ 80 - 25
src/pages/employeeDimensionDetails/index.vue

@@ -58,11 +58,14 @@
58 58
 
59 59
             <view class="table-wrapper">
60 60
                 <statistic-table :columns="tableColumns" :data="tableData" />
61
+                <view class="loading-mask" v-if="loading">
62
+                    <u-loading-icon size="28"></u-loading-icon>
63
+                    <text class="loading-text">加载中...</text>
64
+                </view>
61 65
             </view>
62 66
 
63 67
             <view class="pagination-wrapper" v-if="total > 0">
64
-                <uni-pagination :current="pageNum" :total="total" :page-size="pageSize" :show-page-size="true"
65
-                    :page-size-range="[10, 20, 50]" @change="onPageChange" @pageSizeChange="onPageSizeChange" />
68
+                <uni-pagination :current="pageNum" :total="total" :page-size="pageSize" @change="onPageChange" />
66 69
             </view>
67 70
         </view>
68 71
 
@@ -79,7 +82,7 @@
79 82
                 </view>
80 83
                 <scroll-view v-if="!orgSearchKeyword.trim()" scroll-y class="tree-list">
81 84
                     <employee-tree-node v-for="(node, index) in deptTreeData" :key="node.id" :node="node" :expanded-ids="expandedDeptIds"
82
-                        :selected-id="selectedOrgId" @toggle="toggleDeptExpand" @select="onOrgSelect" />
85
+                        :selected-id="selectedOrgId" :selectable="true" @toggle="toggleDeptExpand" @select="onOrgSelect" />
83 86
                 </scroll-view>
84 87
                 <scroll-view v-else scroll-y class="org-list">
85 88
                     <view class="org-item" v-for="item in filteredOrgList" :key="item.userId"
@@ -117,7 +120,7 @@
117 120
 <script>
118 121
 import StatisticTable from '@/components/statistic-table/statistic-table.vue'
119 122
 import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
120
-import { getEmployeeDimensionDetails } from '@/api/warningManage/index'
123
+import { getEmployeeDimensionDetails, getDimensionAll } from '@/api/warningManage/index'
121 124
 import { getDeptUserTree } from '@/api/system/user'
122 125
 
123 126
 export default {
@@ -134,6 +137,7 @@ export default {
134 137
             endTime: '',
135 138
             selectedOrgId: null,
136 139
             selectedOrgName: '',
140
+            selectedDeptType: '',
137 141
             selectedDimension: '',
138 142
             selectedDimName: '全部',
139 143
             showOrgPicker: false,
@@ -142,24 +146,22 @@ export default {
142 146
             deptTreeData: [],
143 147
             expandedDeptIds: [],
144 148
             orgList: [],
145
-            dimensionOptions: [
146
-                { label: '安全响应能力', value: '安全响应能力' },
147
-                { label: '服务响应能力', value: '服务响应能力' }
148
-            ],
149
+            dimensionOptions: [],
149 150
             tableColumns: [
150 151
                 { props: 'userId', title: '员工ID' },
151
-                { props: 'nickName', title: '姓名' },
152
+                { props: 'personName', title: '姓名' },
152 153
                 { props: 'deptName', title: '部门' },
153 154
                 { props: 'teamName', title: '班组' },
154 155
                 { props: 'groupName', title: '小组' },
155
-                { props: 'dimName', title: '维度名称' },
156
-                { props: 'dimScore', title: '维度分值' }
156
+                { props: 'dimensionName', title: '维度名称' },
157
+                { props: 'dimensionScore', title: '维度分值' }
157 158
             ],
158 159
             tableData: [],
159 160
             allTableData: [],
160 161
             pageNum: 1,
161 162
             pageSize: 10,
162
-            total: 0
163
+            total: 0,
164
+            loading: false
163 165
         }
164 166
     },
165 167
     computed: {
@@ -173,6 +175,7 @@ export default {
173 175
     },
174 176
     mounted() {
175 177
         this.loadDeptTree()
178
+        this.loadDimensionOptions()
176 179
         this.fetchData()
177 180
     },
178 181
     methods: {
@@ -258,7 +261,9 @@ export default {
258 261
         onOrgSelect(item) {
259 262
             this.selectedOrgId = item.userId
260 263
             this.selectedOrgName = item.nickName
264
+            this.selectedDeptType = item.deptType || ''
261 265
             this.showOrgPicker = false
266
+         
262 267
         },
263 268
         onOrgSearch() { },
264 269
         selectDimension(value) {
@@ -277,33 +282,38 @@ export default {
277 282
             this.endTime = ''
278 283
             this.selectedOrgId = null
279 284
             this.selectedOrgName = ''
285
+            this.selectedDeptType = ''
280 286
             this.selectedDimension = ''
281 287
             this.selectedDimName = '全部'
282 288
             this.pageNum = 1
289
+            this.loadDimensionOptions()
283 290
             this.fetchData()
284 291
         },
285 292
         onPageChange(e) {
286 293
             this.pageNum = e.current
287
-            this.fetchData()
288
-        },
289
-        onPageSizeChange(e) {
290
-            this.pageSize = e.pageSize
291
-            this.pageNum = 1
292
-            this.fetchData()
294
+            this.updatePagedData()
293 295
         },
294 296
         async fetchData() {
297
+            this.loading = true
295 298
             let params = this.getQueryParams()
296
-            params.pageNum = this.pageNum
297
-            params.pageSize = this.pageSize
298 299
             try {
299 300
                 const res = await getEmployeeDimensionDetails(params)
300 301
                 if (res.code === 200 && res.data) {
301 302
                     const data = res.data
302 303
                     this.allTableData = data.list || data || []
303
-                    this.tableData = this.allTableData
304
-                    this.total = data.total || this.allTableData.length
304
+                    this.pageNum = 1
305
+                    this.updatePagedData()
305 306
                 }
306
-            } catch (e) { }
307
+            } catch (e) { } finally {
308
+                this.loading = false
309
+            }
310
+        },
311
+        updatePagedData() {
312
+            const data = this.allTableData
313
+            this.total = data.length
314
+            const start = (this.pageNum - 1) * this.pageSize
315
+            const end = start + this.pageSize
316
+            this.tableData = data.slice(start, end)
307 317
         },
308 318
         getQueryParams() {
309 319
             let params = {}
@@ -316,12 +326,35 @@ export default {
316 326
                 params.endDate = range.endDate
317 327
             }
318 328
             if (this.selectedOrgId) {
319
-                params.userId = this.selectedOrgId
329
+                const key = this.getOrgParamKey()
330
+                if (key){
331
+                    params[key] = this.selectedOrgId
332
+                }
320 333
             }
321 334
             if (this.selectedDimension) {
322
-                params.dimension = this.selectedDimension
335
+                params.dimensionId = this.selectedDimension
323 336
             }
324 337
             return params
338
+        },
339
+        getOrgParamKey() {
340
+            const deptType = this.selectedDeptType
341
+            if (deptType === 'BRIGADE') return 'deptId'
342
+            if (deptType === 'MANAGER') return 'teamId'
343
+            if (deptType === 'TEAMS') return 'groupId'
344
+            if (deptType === 'user') return 'userId'
345
+            return ''
346
+        },
347
+        async loadDimensionOptions() {
348
+            try {
349
+                
350
+                const res = await getDimensionAll({ pageNum: 1, pageSize: 100, org: 4 })
351
+                if (res.code === 200 && res.data) {
352
+                    this.dimensionOptions = (res.data || []).map(item => ({
353
+                        label: item.name || item.label || item.dimensionName || '',
354
+                        value: item.id != null ? String(item.id) : (item.value || item.name || '')
355
+                    }))
356
+                }
357
+            } catch (e) { }
325 358
         }
326 359
     }
327 360
 }
@@ -494,6 +527,28 @@ export default {
494 527
     border-radius: 16rpx;
495 528
     overflow-x: auto;
496 529
     box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
530
+    position: relative;
531
+    min-height: 200rpx;
532
+}
533
+
534
+.loading-mask {
535
+    position: absolute;
536
+    top: 0;
537
+    left: 0;
538
+    right: 0;
539
+    bottom: 0;
540
+    background: rgba(255, 255, 255, 0.8);
541
+    display: flex;
542
+    flex-direction: column;
543
+    align-items: center;
544
+    justify-content: center;
545
+    gap: 16rpx;
546
+    z-index: 10;
547
+}
548
+
549
+.loading-text {
550
+    font-size: 24rpx;
551
+    color: #999;
497 552
 }
498 553
 
499 554
 .pagination-wrapper {

+ 52 - 26
src/pages/redLineWarning/index.vue

@@ -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
     }

+ 47 - 12
src/pages/warningPage/index.vue

@@ -73,6 +73,12 @@
73 73
                         <text v-else-if="row.overallScore >= 90" class="score-excellent">{{ row.overallScore }}分</text>
74 74
                         <text v-else>{{ row.overallScore }}分</text>
75 75
                     </template>
76
+                    <template #column-warningLevel="{ row }">
77
+                        <text :style="{ color: row.warningLevel === '1' ? '#dc2626' : '' }">{{ getDictLabel(alertLevelList, row.warningLevel) }}</text>
78
+                    </template>
79
+                    <template #column-statusLabel="{ row }">
80
+                        <text :style="{ color: row.statusLabel === '1' ? '#dc2626' : '' }">{{ getDictLabel(statusLabelList, row.statusLabel) }}</text>
81
+                    </template>
76 82
                     <template #column-detail="{ row }">
77 83
                         <text class="detail-link" @click="goToDetail(row)">详情</text>
78 84
                     </template>
@@ -153,9 +159,11 @@ import StatisticTable from '@/components/statistic-table/statistic-table.vue'
153 159
 import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
154 160
 import { getWarningPageData, getEmployeeWarningPageData } from '@/api/warningManage/index'
155 161
 import { getDeptUserTree } from '@/api/system/user'
162
+import useDict from '@/utils/dict'
156 163
 
157 164
 export default {
158 165
     name: 'WarningPage',
166
+    mixins: [useDict],
159 167
     components: {
160 168
         SectionTitle,
161 169
         StatisticTable,
@@ -177,10 +185,8 @@ export default {
177 185
             deptTreeData: [],
178 186
             expandedDeptIds: [],
179 187
             orgList: [],
180
-            alertLevelList: [
181
-                { label: '红色预警', value: '1' },
182
-                { label: '正常范围', value: '3' }
183
-            ],
188
+            alertLevelList: [],
189
+            statusLabelList: [],
184 190
             summaryCards: [
185 191
                 { title: '部门监察问题', badge: '部门级', value: '0', color: '#b45309' },
186 192
                 { title: '实时质控拦截', badge: '部门级', value: '0', color: '#2563eb' },
@@ -197,9 +203,9 @@ export default {
197 203
                 { props: 'nickName', title: '姓名' },
198 204
                 { props: 'deptName', title: '所属部门' },
199 205
                 { props: 'overallScore', title: '综合评估得分', slot: true },
200
-                { props: 'warningLevel', title: '预警等级' },
206
+                { props: 'warningLevel', title: '预警等级', slot: true },
201 207
                 { props: 'coreRisksOrOutstandingAchievements', title: '核心风险/优秀事迹' },
202
-                { props: 'statusLabel', title: '状态标签' },
208
+                { props: 'statusLabel', title: '状态标签', slot: true },
203 209
                 { props: 'detail', title: '详情', slot: true }
204 210
             ],
205 211
             employeeList: [],
@@ -230,6 +236,10 @@ export default {
230 236
             return this.orgList.filter(item =>
231 237
                 (item.nickName || '').toLowerCase().includes(keyword)
232 238
             )
239
+        },
240
+        filteredEmployeeList() {
241
+            if (!this.selectedAlertLevel) return this.allEmployeeList
242
+            return this.allEmployeeList.filter(item => item.warningLevel === this.selectedAlertLevel)
233 243
         }
234 244
     },
235 245
     onLoad(options) {
@@ -239,9 +249,20 @@ export default {
239 249
     },
240 250
     mounted() {
241 251
         this.loadDeptTree()
252
+        this.loadDicts()
242 253
         this.fetchData()
243 254
     },
244 255
     methods: {
256
+        async loadDicts() {
257
+            const res = await this.useDict('alert_level', 'status_label')
258
+            this.alertLevelList = res.alert_level || []
259
+            this.statusLabelList = res.status_label || []
260
+        },
261
+        getDictLabel(dictList, value) {
262
+            if (!value) return ''
263
+            const item = dictList.find(d => d.value === value)
264
+            return item ? item.label : value
265
+        },
245 266
         formatDate(date) {
246 267
             const y = date.getFullYear()
247 268
             const m = String(date.getMonth() + 1).padStart(2, '0')
@@ -332,6 +353,8 @@ export default {
332 353
             const item = this.alertLevelList.find(l => l.value === value)
333 354
             this.selectedLevelName = value === '' ? '全部' : (item ? item.label : '')
334 355
             this.showLevelPicker = false
356
+            this.pageNum = 1
357
+            this.updatePagedData()
335 358
         },
336 359
         handleSearch() {
337 360
             this.pageNum = 1
@@ -379,19 +402,21 @@ export default {
379 402
                 if (res.code === 200 && res.data) {
380 403
                     const data = res.data
381 404
                     this.allEmployeeList = data.ledgerWarningDetailItemList || []
382
-                    this.total = this.allEmployeeList.length
383 405
                    
384 406
                     this.redAlertCount = data.redAlertNum || 0
385 407
                     this.excellentCount = data.excellentBenchmarkNum || 0
386 408
                     this.avgScore = data.averageComprehensiveScore || 0
409
+                    this.pageNum = 1
387 410
                     this.updatePagedData()
388 411
                 }
389 412
             } catch (e) { }
390 413
         },
391 414
         updatePagedData() {
415
+            const data = this.filteredEmployeeList
416
+            this.total = data.length
392 417
             const start = (this.pageNum - 1) * this.pageSize
393 418
             const end = start + this.pageSize
394
-            this.employeeList = this.allEmployeeList.slice(start, end)
419
+            this.employeeList = data.slice(start, end)
395 420
         },
396 421
         getQueryParams() {
397 422
             let params = {}
@@ -406,14 +431,24 @@ export default {
406 431
             if (this.selectedOrgId) {
407 432
                 params.userId = this.selectedOrgId
408 433
             }
409
-            if (this.selectedAlertLevel) {
410
-                params.warningLevel = this.selectedAlertLevel
411
-            }
412 434
             return params
413 435
         },
414 436
         goToDetail(row) {
437
+            const query = []
438
+            if (row.userId) {
439
+                query.push('id=' + row.userId)
440
+            }
441
+            if (this.beginTime && this.endTime) {
442
+                query.push('startDate=' + this.beginTime)
443
+                query.push('endDate=' + this.endTime)
444
+            } else {
445
+                query.push('activeRange=' + this.selectedTimeTag)
446
+            }
447
+            if (this.selectedAlertLevel) {
448
+                query.push('alertLevel=' + this.selectedAlertLevel)
449
+            }
415 450
             uni.navigateTo({
416
-                url: '/pages/redLineWarning/index?id=' + row.userId
451
+                url: '/pages/redLineWarning/index?' + query.join('&')
417 452
             })
418 453
         }
419 454
     }