|
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <view class="warning-page">
|
|
|
3
|
+ <view class="page-header">
|
|
|
4
|
+ <view class="header-title">综合预警工作台</view>
|
|
|
5
|
+ <view class="header-subtitle">员工综合评估(<75分红色预警 | ≥90分优秀)</view>
|
|
|
6
|
+ <view class="badge-group">
|
|
|
7
|
+ <view class="alert-badge">实时预警</view>
|
|
|
8
|
+ <view class="alert-badge orange">动态月度数据</view>
|
|
|
9
|
+ </view>
|
|
|
10
|
+ </view>
|
|
|
11
|
+
|
|
|
12
|
+ <view class="filter-bar">
|
|
|
13
|
+ <scroll-view scroll-x class="time-scroll">
|
|
|
14
|
+ <view class="time-tags">
|
|
|
15
|
+ <view v-for="(tag, index) in timeTags" :key="index"
|
|
|
16
|
+ :class="['time-tag', { active: selectedTimeTag === index }]" @click="onTimeTagClick(index)">
|
|
|
17
|
+ {{ tag }}
|
|
|
18
|
+ </view>
|
|
|
19
|
+ </view>
|
|
|
20
|
+ </scroll-view>
|
|
|
21
|
+ <view class="date-range-picker">
|
|
|
22
|
+ <picker mode="date" :value="beginTime" @change="onBeginTimeChange" class="date-picker-half">
|
|
|
23
|
+ <view class="date-input" :class="{ filled: beginTime }">
|
|
|
24
|
+ {{ beginTime || '开始日期' }}
|
|
|
25
|
+ </view>
|
|
|
26
|
+ </picker>
|
|
|
27
|
+ <text class="date-separator">至</text>
|
|
|
28
|
+ <picker mode="date" :value="endTime" @change="onEndTimeChange" class="date-picker-half">
|
|
|
29
|
+ <view class="date-input" :class="{ filled: endTime }">
|
|
|
30
|
+ {{ endTime || '结束日期' }}
|
|
|
31
|
+ </view>
|
|
|
32
|
+ </picker>
|
|
|
33
|
+ </view>
|
|
|
34
|
+
|
|
|
35
|
+ <view class="filter-row">
|
|
|
36
|
+ <view class="filter-select" @click="showOrgPicker = true">
|
|
|
37
|
+ <text class="filter-select-text">{{ selectedOrgName || '组织架构/员工' }}</text>
|
|
|
38
|
+ <u-icon name="arrow-down" size="14" color="#999"></u-icon>
|
|
|
39
|
+ </view>
|
|
|
40
|
+ <view class="filter-select" @click="showLevelPicker = true">
|
|
|
41
|
+ <text class="filter-select-text">{{ selectedLevelName || '预警等级' }}</text>
|
|
|
42
|
+ <u-icon name="arrow-down" size="14" color="#999"></u-icon>
|
|
|
43
|
+ </view>
|
|
|
44
|
+ </view>
|
|
|
45
|
+
|
|
|
46
|
+ <view class="filter-actions">
|
|
|
47
|
+ <view class="btn-search" @click="handleSearch">
|
|
|
48
|
+ <u-icon name="search" size="16" color="#fff"></u-icon>
|
|
|
49
|
+ <text>搜索</text>
|
|
|
50
|
+ </view>
|
|
|
51
|
+ <view class="btn-reset" @click="handleReset">重置</view>
|
|
|
52
|
+ </view>
|
|
|
53
|
+ </view>
|
|
|
54
|
+
|
|
|
55
|
+ <!-- 9个汇总卡片 -->
|
|
|
56
|
+ <view class="cards-grid">
|
|
|
57
|
+ <view class="summary-card" v-for="(card, index) in summaryCards" :key="index">
|
|
|
58
|
+ <view class="card-title">{{ card.title }}</view>
|
|
|
59
|
+ <view class="card-badge">{{ card.badge }}</view>
|
|
|
60
|
+ <view class="card-value" :style="{ color: card.color }">{{ card.value }}</view>
|
|
|
61
|
+ </view>
|
|
|
62
|
+ </view>
|
|
|
63
|
+
|
|
|
64
|
+ <view class="section-area">
|
|
|
65
|
+ <SectionTitle title="员工综合预警">
|
|
|
66
|
+ <view class="section-badge">评分依据:员工配分表</view>
|
|
|
67
|
+ </SectionTitle>
|
|
|
68
|
+
|
|
|
69
|
+ <view class="table-wrapper">
|
|
|
70
|
+ <statistic-table :columns="employeeColumns" :data="employeeList">
|
|
|
71
|
+ <template #column-overallScore="{ row }">
|
|
|
72
|
+ <text v-if="row.overallScore < 75" class="score-danger">{{ row.overallScore }}分</text>
|
|
|
73
|
+ <text v-else-if="row.overallScore >= 90" class="score-excellent">{{ row.overallScore }}分</text>
|
|
|
74
|
+ <text v-else>{{ row.overallScore }}分</text>
|
|
|
75
|
+ </template>
|
|
|
76
|
+ <template #column-detail="{ row }">
|
|
|
77
|
+ <text class="detail-link" @click="goToDetail(row)">详情</text>
|
|
|
78
|
+ </template>
|
|
|
79
|
+ </statistic-table>
|
|
|
80
|
+ </view>
|
|
|
81
|
+
|
|
|
82
|
+ <view class="pagination-wrapper" v-if="total > 0">
|
|
|
83
|
+ <uni-pagination :current="pageNum" :total="total" :page-size="pageSize" simple @change="onPageChange" />
|
|
|
84
|
+ </view>
|
|
|
85
|
+
|
|
|
86
|
+ <view class="warning-summary">
|
|
|
87
|
+ <view class="summary-item">
|
|
|
88
|
+ <view class="dot red"></view>
|
|
|
89
|
+ <text><strong>红色预警</strong> (<75分) 共计 {{ redAlertCount }} 人</text>
|
|
|
90
|
+ </view>
|
|
|
91
|
+ <view class="summary-item">
|
|
|
92
|
+ <view class="dot green"></view>
|
|
|
93
|
+ <text><strong>优秀标杆</strong> (≥90分) 共计 {{ excellentCount }} 人</text>
|
|
|
94
|
+ </view>
|
|
|
95
|
+ <view class="summary-item">
|
|
|
96
|
+ <text>全员平均综合得分: <strong>{{ avgScore }}</strong> 分</text>
|
|
|
97
|
+ </view>
|
|
|
98
|
+ </view>
|
|
|
99
|
+ </view>
|
|
|
100
|
+
|
|
|
101
|
+ <!-- 组织架构选择弹窗 -->
|
|
|
102
|
+ <u-popup :show="showOrgPicker" mode="bottom" :round="16" :mask-close-able="true"
|
|
|
103
|
+ @close="showOrgPicker = false">
|
|
|
104
|
+ <view class="picker-popup">
|
|
|
105
|
+ <view class="picker-header">
|
|
|
106
|
+ <text class="picker-title">选择组织架构/员工</text>
|
|
|
107
|
+ <u-icon name="close" size="20" @click="showOrgPicker = false"></u-icon>
|
|
|
108
|
+ </view>
|
|
|
109
|
+ <view class="search-box">
|
|
|
110
|
+ <u-input v-model="orgSearchKeyword" placeholder="搜索" @input="onOrgSearch"></u-input>
|
|
|
111
|
+ </view>
|
|
|
112
|
+ <scroll-view v-if="!orgSearchKeyword.trim()" scroll-y class="tree-list">
|
|
|
113
|
+ <employee-tree-node v-for="node in deptTreeData" :key="node.id" :node="node"
|
|
|
114
|
+ :expanded-ids="expandedDeptIds" :selected-id="selectedOrgId" @toggle="toggleDeptExpand"
|
|
|
115
|
+ @select="onOrgSelect" />
|
|
|
116
|
+ </scroll-view>
|
|
|
117
|
+ <scroll-view v-else scroll-y class="org-list">
|
|
|
118
|
+ <view class="org-item" v-for="item in filteredOrgList" :key="item.userId"
|
|
|
119
|
+ @click="onOrgSelect(item)">
|
|
|
120
|
+ <text class="org-item-name">{{ item.nickName }}</text>
|
|
|
121
|
+ <u-icon v-if="item.userId === selectedOrgId" name="checkmark" color="#34D399"
|
|
|
122
|
+ size="18"></u-icon>
|
|
|
123
|
+ </view>
|
|
|
124
|
+ </scroll-view>
|
|
|
125
|
+ </view>
|
|
|
126
|
+ </u-popup>
|
|
|
127
|
+
|
|
|
128
|
+ <!-- 预警等级选择弹窗 -->
|
|
|
129
|
+ <u-popup :show="showLevelPicker" mode="bottom" :round="16" :mask-close-able="true"
|
|
|
130
|
+ @close="showLevelPicker = false">
|
|
|
131
|
+ <view class="level-popup">
|
|
|
132
|
+ <view class="picker-header">
|
|
|
133
|
+ <text class="picker-title">选择预警等级</text>
|
|
|
134
|
+ <u-icon name="close" size="20" @click="showLevelPicker = false"></u-icon>
|
|
|
135
|
+ </view>
|
|
|
136
|
+ <view class="level-list">
|
|
|
137
|
+ <view class="level-item" :class="{ active: selectedAlertLevel === '' }" @click="selectLevel('')">
|
|
|
138
|
+ <text>全部</text>
|
|
|
139
|
+ </view>
|
|
|
140
|
+ <view class="level-item" v-for="item in alertLevelList" :key="item.value"
|
|
|
141
|
+ :class="{ active: selectedAlertLevel === item.value }" @click="selectLevel(item.value)">
|
|
|
142
|
+ <text>{{ item.label }}</text>
|
|
|
143
|
+ </view>
|
|
|
144
|
+ </view>
|
|
|
145
|
+ </view>
|
|
|
146
|
+ </u-popup>
|
|
|
147
|
+ </view>
|
|
|
148
|
+</template>
|
|
|
149
|
+
|
|
|
150
|
+<script>
|
|
|
151
|
+import SectionTitle from '@/components/SectionTitle.vue'
|
|
|
152
|
+import StatisticTable from '@/components/statistic-table/statistic-table.vue'
|
|
|
153
|
+import EmployeeTreeNode from '@/pages/components/EmployeeTreeNode.vue'
|
|
|
154
|
+import { getWarningPageData, getEmployeeWarningPageData } from '@/api/warningManage/index'
|
|
|
155
|
+import { getDeptUserTree } from '@/api/system/user'
|
|
|
156
|
+
|
|
|
157
|
+export default {
|
|
|
158
|
+ name: 'WarningPage',
|
|
|
159
|
+ components: {
|
|
|
160
|
+ SectionTitle,
|
|
|
161
|
+ StatisticTable,
|
|
|
162
|
+ EmployeeTreeNode
|
|
|
163
|
+ },
|
|
|
164
|
+ data() {
|
|
|
165
|
+ return {
|
|
|
166
|
+ selectedTimeTag: 1,
|
|
|
167
|
+ timeTags: ['近一周', '近一月', '近三月', '近一年'],
|
|
|
168
|
+ beginTime: '',
|
|
|
169
|
+ endTime: '',
|
|
|
170
|
+ selectedOrgId: null,
|
|
|
171
|
+ selectedOrgName: '',
|
|
|
172
|
+ selectedAlertLevel: '',
|
|
|
173
|
+ selectedLevelName: '全部',
|
|
|
174
|
+ showOrgPicker: false,
|
|
|
175
|
+ showLevelPicker: false,
|
|
|
176
|
+ orgSearchKeyword: '',
|
|
|
177
|
+ deptTreeData: [],
|
|
|
178
|
+ expandedDeptIds: [],
|
|
|
179
|
+ orgList: [],
|
|
|
180
|
+ alertLevelList: [
|
|
|
181
|
+ { label: '红色预警', value: '1' },
|
|
|
182
|
+ { label: '正常范围', value: '3' }
|
|
|
183
|
+ ],
|
|
|
184
|
+ summaryCards: [
|
|
|
185
|
+ { title: '部门监察问题', badge: '部门级', value: '0', color: '#b45309' },
|
|
|
186
|
+ { title: '实时质控拦截', badge: '部门级', value: '0', color: '#2563eb' },
|
|
|
187
|
+ { title: '不安全事件', badge: '一级预警', value: '0', color: '#dc2626' },
|
|
|
188
|
+ { title: '安保测试记录', badge: '部门级', value: '0', color: '#e67e22' },
|
|
|
189
|
+ { title: '旅客服务投诉', badge: '服务响应', value: '0', color: '#e67e22' },
|
|
|
190
|
+ { title: '服务巡查', badge: '部门级', value: '0', color: '#333' },
|
|
|
191
|
+ { title: '培训及考试成绩', badge: '平均分数', value: '0', color: '#333' },
|
|
|
192
|
+ { title: '航站楼', badge: '吞吐量', value: '0', color: '#059669' },
|
|
|
193
|
+ { title: '小额奖励', badge: '奖励次数', value: '0', color: '#7c3aed' }
|
|
|
194
|
+ ],
|
|
|
195
|
+ employeeColumns: [
|
|
|
196
|
+ { props: 'userId', title: '员工ID' },
|
|
|
197
|
+ { props: 'nickName', title: '姓名' },
|
|
|
198
|
+ { props: 'deptName', title: '所属部门' },
|
|
|
199
|
+ { props: 'overallScore', title: '综合评估得分', slot: true },
|
|
|
200
|
+ { props: 'warningLevel', title: '预警等级' },
|
|
|
201
|
+ { props: 'coreRisksOrOutstandingAchievements', title: '核心风险/优秀事迹' },
|
|
|
202
|
+ { props: 'statusLabel', title: '状态标签' },
|
|
|
203
|
+ { props: 'detail', title: '详情', slot: true }
|
|
|
204
|
+ ],
|
|
|
205
|
+ employeeList: [],
|
|
|
206
|
+ allEmployeeList: [],
|
|
|
207
|
+ pageNum: 1,
|
|
|
208
|
+ pageSize: 10,
|
|
|
209
|
+ total: 0,
|
|
|
210
|
+ redAlertCount: 0,
|
|
|
211
|
+ excellentCount: 0,
|
|
|
212
|
+ avgScore: 0,
|
|
|
213
|
+ warningDataMap: {
|
|
|
214
|
+ ledgerSupervisionProblem: 0,
|
|
|
215
|
+ ledgerRealtimeInterception: 1,
|
|
|
216
|
+ ledgerUnsafeEvent: 2,
|
|
|
217
|
+ ledgerSecurityTest: 3,
|
|
|
218
|
+ ledgerComplaint: 4,
|
|
|
219
|
+ ledgerServicePatrol: 5,
|
|
|
220
|
+ ledgerExamScore: 6,
|
|
|
221
|
+ ledgerTerminalBonus: 7,
|
|
|
222
|
+ ledgerRewardApproval: 8
|
|
|
223
|
+ }
|
|
|
224
|
+ }
|
|
|
225
|
+ },
|
|
|
226
|
+ computed: {
|
|
|
227
|
+ filteredOrgList() {
|
|
|
228
|
+ const keyword = this.orgSearchKeyword.trim().toLowerCase()
|
|
|
229
|
+ if (!keyword) return this.orgList
|
|
|
230
|
+ return this.orgList.filter(item =>
|
|
|
231
|
+ (item.nickName || '').toLowerCase().includes(keyword)
|
|
|
232
|
+ )
|
|
|
233
|
+ }
|
|
|
234
|
+ },
|
|
|
235
|
+ onLoad(options) {
|
|
|
236
|
+ if (options.id) {
|
|
|
237
|
+ this.selectedOrgId = Number(options.id)
|
|
|
238
|
+ }
|
|
|
239
|
+ },
|
|
|
240
|
+ mounted() {
|
|
|
241
|
+ this.loadDeptTree()
|
|
|
242
|
+ this.fetchData()
|
|
|
243
|
+ },
|
|
|
244
|
+ methods: {
|
|
|
245
|
+ formatDate(date) {
|
|
|
246
|
+ const y = date.getFullYear()
|
|
|
247
|
+ const m = String(date.getMonth() + 1).padStart(2, '0')
|
|
|
248
|
+ const d = String(date.getDate()).padStart(2, '0')
|
|
|
249
|
+ return `${y}-${m}-${d}`
|
|
|
250
|
+ },
|
|
|
251
|
+ getDateRange() {
|
|
|
252
|
+ const now = new Date()
|
|
|
253
|
+ let start = new Date(now)
|
|
|
254
|
+ switch (this.selectedTimeTag) {
|
|
|
255
|
+ case 0: start.setDate(now.getDate() - 7); break
|
|
|
256
|
+ case 1: start.setMonth(now.getMonth() - 1); break
|
|
|
257
|
+ case 2: start.setMonth(now.getMonth() - 3); break
|
|
|
258
|
+ case 3: start.setFullYear(now.getFullYear() - 1); break
|
|
|
259
|
+ default: break
|
|
|
260
|
+ }
|
|
|
261
|
+ return { startDate: this.formatDate(start), endDate: this.formatDate(now) }
|
|
|
262
|
+ },
|
|
|
263
|
+ onTimeTagClick(index) {
|
|
|
264
|
+ this.selectedTimeTag = index
|
|
|
265
|
+ },
|
|
|
266
|
+ onBeginTimeChange(e) {
|
|
|
267
|
+ this.beginTime = e.detail.value
|
|
|
268
|
+ },
|
|
|
269
|
+ onEndTimeChange(e) {
|
|
|
270
|
+ this.endTime = e.detail.value
|
|
|
271
|
+ },
|
|
|
272
|
+ flattenDeptTree(tree) {
|
|
|
273
|
+ const result = []
|
|
|
274
|
+ const traverse = (nodes) => {
|
|
|
275
|
+ nodes.forEach(node => {
|
|
|
276
|
+ const hasChildren = node.children && node.children.length > 0
|
|
|
277
|
+ if (!hasChildren && node.nodeType !== 'dept') {
|
|
|
278
|
+ result.push({
|
|
|
279
|
+ nodeType: node.nodeType || '',
|
|
|
280
|
+ userId: node.userId || node.id,
|
|
|
281
|
+ nickName: node.nickName || node.label || node.userName || ''
|
|
|
282
|
+ })
|
|
|
283
|
+ }
|
|
|
284
|
+ if (hasChildren) {
|
|
|
285
|
+ traverse(node.children)
|
|
|
286
|
+ }
|
|
|
287
|
+ })
|
|
|
288
|
+ }
|
|
|
289
|
+ traverse(tree)
|
|
|
290
|
+ return result
|
|
|
291
|
+ },
|
|
|
292
|
+ expandAllDepts(nodes) {
|
|
|
293
|
+ this.expandedDeptIds = []
|
|
|
294
|
+ const traverse = (list) => {
|
|
|
295
|
+ list.forEach(node => {
|
|
|
296
|
+ const hasChildren = node.children && node.children.length > 0
|
|
|
297
|
+ if (hasChildren || node.nodeType === 'dept') {
|
|
|
298
|
+ this.expandedDeptIds.push(node.id)
|
|
|
299
|
+ if (hasChildren) {
|
|
|
300
|
+ traverse(node.children)
|
|
|
301
|
+ }
|
|
|
302
|
+ }
|
|
|
303
|
+ })
|
|
|
304
|
+ }
|
|
|
305
|
+ traverse(nodes)
|
|
|
306
|
+ },
|
|
|
307
|
+ loadDeptTree() {
|
|
|
308
|
+ getDeptUserTree({}).then(res => {
|
|
|
309
|
+ if (res.code === 200) {
|
|
|
310
|
+ this.deptTreeData = res.data || []
|
|
|
311
|
+ this.orgList = this.flattenDeptTree(this.deptTreeData).filter(u => u.nodeType === 'user')
|
|
|
312
|
+ this.expandAllDepts(this.deptTreeData)
|
|
|
313
|
+ }
|
|
|
314
|
+ }).catch(() => { })
|
|
|
315
|
+ },
|
|
|
316
|
+ toggleDeptExpand(id) {
|
|
|
317
|
+ const index = this.expandedDeptIds.indexOf(id)
|
|
|
318
|
+ if (index > -1) {
|
|
|
319
|
+ this.expandedDeptIds.splice(index, 1)
|
|
|
320
|
+ } else {
|
|
|
321
|
+ this.expandedDeptIds.push(id)
|
|
|
322
|
+ }
|
|
|
323
|
+ },
|
|
|
324
|
+ onOrgSelect(item) {
|
|
|
325
|
+ this.selectedOrgId = item.userId
|
|
|
326
|
+ this.selectedOrgName = item.nickName
|
|
|
327
|
+ this.showOrgPicker = false
|
|
|
328
|
+ },
|
|
|
329
|
+ onOrgSearch() { },
|
|
|
330
|
+ selectLevel(value) {
|
|
|
331
|
+ this.selectedAlertLevel = value
|
|
|
332
|
+ const item = this.alertLevelList.find(l => l.value === value)
|
|
|
333
|
+ this.selectedLevelName = value === '' ? '全部' : (item ? item.label : '')
|
|
|
334
|
+ this.showLevelPicker = false
|
|
|
335
|
+ },
|
|
|
336
|
+ handleSearch() {
|
|
|
337
|
+ this.pageNum = 1
|
|
|
338
|
+ this.fetchData()
|
|
|
339
|
+ },
|
|
|
340
|
+ handleReset() {
|
|
|
341
|
+ this.selectedTimeTag = 1
|
|
|
342
|
+ this.beginTime = ''
|
|
|
343
|
+ this.endTime = ''
|
|
|
344
|
+ this.selectedOrgId = null
|
|
|
345
|
+ this.selectedOrgName = ''
|
|
|
346
|
+ this.selectedAlertLevel = ''
|
|
|
347
|
+ this.selectedLevelName = '全部'
|
|
|
348
|
+ this.pageNum = 1
|
|
|
349
|
+ this.fetchData()
|
|
|
350
|
+ },
|
|
|
351
|
+ onPageChange(e) {
|
|
|
352
|
+ this.pageNum = e.current
|
|
|
353
|
+ this.updatePagedData()
|
|
|
354
|
+ },
|
|
|
355
|
+ async fetchData() {
|
|
|
356
|
+ await Promise.all([this.fetchSummaryData(), this.fetchEmployeeData()])
|
|
|
357
|
+ },
|
|
|
358
|
+ async fetchSummaryData() {
|
|
|
359
|
+ let params = this.getQueryParams()
|
|
|
360
|
+ try {
|
|
|
361
|
+ const res = await getWarningPageData(params)
|
|
|
362
|
+ if (res.code === 200 && res.data) {
|
|
|
363
|
+ const d = res.data
|
|
|
364
|
+ this.summaryCards.forEach((card, idx) => {
|
|
|
365
|
+ for (const [key, i] of Object.entries(this.warningDataMap)) {
|
|
|
366
|
+ if (i === idx) {
|
|
|
367
|
+ card.value = d[key] !== undefined ? String(d[key]) : '0'
|
|
|
368
|
+ break
|
|
|
369
|
+ }
|
|
|
370
|
+ }
|
|
|
371
|
+ })
|
|
|
372
|
+ }
|
|
|
373
|
+ } catch (e) { }
|
|
|
374
|
+ },
|
|
|
375
|
+ async fetchEmployeeData() {
|
|
|
376
|
+ let params = this.getQueryParams()
|
|
|
377
|
+ try {
|
|
|
378
|
+ const res = await getEmployeeWarningPageData(params)
|
|
|
379
|
+ if (res.code === 200 && res.data) {
|
|
|
380
|
+ const data = res.data
|
|
|
381
|
+ this.allEmployeeList = data.ledgerWarningDetailItemList || []
|
|
|
382
|
+ this.total = this.allEmployeeList.length
|
|
|
383
|
+
|
|
|
384
|
+ this.redAlertCount = data.redAlertNum || 0
|
|
|
385
|
+ this.excellentCount = data.excellentBenchmarkNum || 0
|
|
|
386
|
+ this.avgScore = data.averageComprehensiveScore || 0
|
|
|
387
|
+ this.updatePagedData()
|
|
|
388
|
+ }
|
|
|
389
|
+ } catch (e) { }
|
|
|
390
|
+ },
|
|
|
391
|
+ updatePagedData() {
|
|
|
392
|
+ const start = (this.pageNum - 1) * this.pageSize
|
|
|
393
|
+ const end = start + this.pageSize
|
|
|
394
|
+ this.employeeList = this.allEmployeeList.slice(start, end)
|
|
|
395
|
+ },
|
|
|
396
|
+ getQueryParams() {
|
|
|
397
|
+ let params = {}
|
|
|
398
|
+ if (this.beginTime && this.endTime) {
|
|
|
399
|
+ params.startDate = this.beginTime
|
|
|
400
|
+ params.endDate = this.endTime
|
|
|
401
|
+ } else {
|
|
|
402
|
+ const range = this.getDateRange()
|
|
|
403
|
+ params.startDate = range.startDate
|
|
|
404
|
+ params.endDate = range.endDate
|
|
|
405
|
+ }
|
|
|
406
|
+ if (this.selectedOrgId) {
|
|
|
407
|
+ params.userId = this.selectedOrgId
|
|
|
408
|
+ }
|
|
|
409
|
+ if (this.selectedAlertLevel) {
|
|
|
410
|
+ params.warningLevel = this.selectedAlertLevel
|
|
|
411
|
+ }
|
|
|
412
|
+ return params
|
|
|
413
|
+ },
|
|
|
414
|
+ goToDetail(row) {
|
|
|
415
|
+ uni.navigateTo({
|
|
|
416
|
+ url: '/pages/redLineWarning/index?id=' + row.userId
|
|
|
417
|
+ })
|
|
|
418
|
+ }
|
|
|
419
|
+ }
|
|
|
420
|
+}
|
|
|
421
|
+</script>
|
|
|
422
|
+
|
|
|
423
|
+<style lang="scss" scoped>
|
|
|
424
|
+.warning-page {
|
|
|
425
|
+ min-height: 100vh;
|
|
|
426
|
+ background: #f5f7fa;
|
|
|
427
|
+ padding-bottom: 40rpx;
|
|
|
428
|
+}
|
|
|
429
|
+
|
|
|
430
|
+.page-header {
|
|
|
431
|
+ background: #fff;
|
|
|
432
|
+ padding: 24rpx 32rpx;
|
|
|
433
|
+ border-bottom: 1rpx solid #eee;
|
|
|
434
|
+}
|
|
|
435
|
+
|
|
|
436
|
+.header-title {
|
|
|
437
|
+ font-size: 36rpx;
|
|
|
438
|
+ font-weight: bold;
|
|
|
439
|
+ color: #1e3c72;
|
|
|
440
|
+}
|
|
|
441
|
+
|
|
|
442
|
+.header-subtitle {
|
|
|
443
|
+ font-size: 24rpx;
|
|
|
444
|
+ color: #666;
|
|
|
445
|
+ margin-top: 8rpx;
|
|
|
446
|
+}
|
|
|
447
|
+
|
|
|
448
|
+.badge-group {
|
|
|
449
|
+ display: flex;
|
|
|
450
|
+ gap: 16rpx;
|
|
|
451
|
+ margin-top: 16rpx;
|
|
|
452
|
+}
|
|
|
453
|
+
|
|
|
454
|
+.alert-badge {
|
|
|
455
|
+ padding: 8rpx 20rpx;
|
|
|
456
|
+ border-radius: 40rpx;
|
|
|
457
|
+ font-size: 24rpx;
|
|
|
458
|
+ font-weight: 500;
|
|
|
459
|
+ background: #fff1f0;
|
|
|
460
|
+ border-left: 5rpx solid #ef4444;
|
|
|
461
|
+ color: #ef4444;
|
|
|
462
|
+
|
|
|
463
|
+ &.orange {
|
|
|
464
|
+ border-left-color: #f97316;
|
|
|
465
|
+ color: #f97316;
|
|
|
466
|
+ }
|
|
|
467
|
+}
|
|
|
468
|
+
|
|
|
469
|
+.filter-bar {
|
|
|
470
|
+ background: #fff;
|
|
|
471
|
+ margin: 20rpx;
|
|
|
472
|
+ border-radius: 16rpx;
|
|
|
473
|
+ padding: 20rpx;
|
|
|
474
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
|
475
|
+}
|
|
|
476
|
+
|
|
|
477
|
+.time-scroll {
|
|
|
478
|
+ width: 100%;
|
|
|
479
|
+ margin-bottom: 16rpx;
|
|
|
480
|
+}
|
|
|
481
|
+
|
|
|
482
|
+.time-tags {
|
|
|
483
|
+ display: flex;
|
|
|
484
|
+ gap: 0;
|
|
|
485
|
+ width: 100%;
|
|
|
486
|
+}
|
|
|
487
|
+
|
|
|
488
|
+.time-tag {
|
|
|
489
|
+ flex: 1;
|
|
|
490
|
+ text-align: center;
|
|
|
491
|
+ padding: 12rpx 0;
|
|
|
492
|
+ background: #f8fafc;
|
|
|
493
|
+ border: 1rpx solid #e2e8f0;
|
|
|
494
|
+ font-size: 24rpx;
|
|
|
495
|
+ color: #333;
|
|
|
496
|
+
|
|
|
497
|
+ &.active {
|
|
|
498
|
+ background: #2563eb;
|
|
|
499
|
+ border-color: #2563eb;
|
|
|
500
|
+ color: #fff;
|
|
|
501
|
+ }
|
|
|
502
|
+}
|
|
|
503
|
+
|
|
|
504
|
+.date-range-picker {
|
|
|
505
|
+ display: flex;
|
|
|
506
|
+ align-items: center;
|
|
|
507
|
+ width: 100%;
|
|
|
508
|
+ margin-top: 16rpx;
|
|
|
509
|
+ margin-bottom: 16rpx;
|
|
|
510
|
+}
|
|
|
511
|
+
|
|
|
512
|
+.date-picker-half {
|
|
|
513
|
+ flex: 1;
|
|
|
514
|
+}
|
|
|
515
|
+
|
|
|
516
|
+.date-input {
|
|
|
517
|
+ width: 100%;
|
|
|
518
|
+ padding: 12rpx 16rpx;
|
|
|
519
|
+ border-radius: 8rpx;
|
|
|
520
|
+ background: #f5f5f5;
|
|
|
521
|
+ font-size: 24rpx;
|
|
|
522
|
+ color: #999;
|
|
|
523
|
+ text-align: center;
|
|
|
524
|
+ box-sizing: border-box;
|
|
|
525
|
+
|
|
|
526
|
+ &.filled {
|
|
|
527
|
+ color: #333;
|
|
|
528
|
+ }
|
|
|
529
|
+}
|
|
|
530
|
+
|
|
|
531
|
+.date-separator {
|
|
|
532
|
+ font-size: 24rpx;
|
|
|
533
|
+ color: #999;
|
|
|
534
|
+ flex-shrink: 0;
|
|
|
535
|
+ padding: 0 12rpx;
|
|
|
536
|
+}
|
|
|
537
|
+
|
|
|
538
|
+.filter-row {
|
|
|
539
|
+ display: flex;
|
|
|
540
|
+ gap: 12rpx;
|
|
|
541
|
+ margin-bottom: 16rpx;
|
|
|
542
|
+}
|
|
|
543
|
+
|
|
|
544
|
+.filter-select {
|
|
|
545
|
+ flex: 1;
|
|
|
546
|
+ display: flex;
|
|
|
547
|
+ align-items: center;
|
|
|
548
|
+ justify-content: space-between;
|
|
|
549
|
+ padding: 16rpx 20rpx;
|
|
|
550
|
+ background: #f5f5f5;
|
|
|
551
|
+ border-radius: 8rpx;
|
|
|
552
|
+ border: 1rpx solid #e0e0e0;
|
|
|
553
|
+}
|
|
|
554
|
+
|
|
|
555
|
+.filter-select-text {
|
|
|
556
|
+ font-size: 26rpx;
|
|
|
557
|
+ color: #333;
|
|
|
558
|
+}
|
|
|
559
|
+
|
|
|
560
|
+.filter-actions {
|
|
|
561
|
+ display: flex;
|
|
|
562
|
+ gap: 16rpx;
|
|
|
563
|
+}
|
|
|
564
|
+
|
|
|
565
|
+.btn-search {
|
|
|
566
|
+ flex: 1;
|
|
|
567
|
+ display: flex;
|
|
|
568
|
+ align-items: center;
|
|
|
569
|
+ justify-content: center;
|
|
|
570
|
+ gap: 8rpx;
|
|
|
571
|
+ padding: 16rpx;
|
|
|
572
|
+ background: #2563eb;
|
|
|
573
|
+ border-radius: 8rpx;
|
|
|
574
|
+ color: #fff;
|
|
|
575
|
+ font-size: 28rpx;
|
|
|
576
|
+}
|
|
|
577
|
+
|
|
|
578
|
+.btn-reset {
|
|
|
579
|
+ padding: 16rpx 32rpx;
|
|
|
580
|
+ background: #f5f5f5;
|
|
|
581
|
+ border-radius: 8rpx;
|
|
|
582
|
+ color: #666;
|
|
|
583
|
+ font-size: 28rpx;
|
|
|
584
|
+ text-align: center;
|
|
|
585
|
+}
|
|
|
586
|
+
|
|
|
587
|
+.cards-grid {
|
|
|
588
|
+ display: grid;
|
|
|
589
|
+ grid-template-columns: 1fr 1fr;
|
|
|
590
|
+ gap: 16rpx;
|
|
|
591
|
+ padding: 0 20rpx;
|
|
|
592
|
+ margin-bottom: 20rpx;
|
|
|
593
|
+}
|
|
|
594
|
+
|
|
|
595
|
+.summary-card {
|
|
|
596
|
+ background: #fff;
|
|
|
597
|
+ border-radius: 16rpx;
|
|
|
598
|
+ padding: 24rpx 20rpx;
|
|
|
599
|
+ text-align: center;
|
|
|
600
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
|
601
|
+ border: 1rpx solid #eef2f6;
|
|
|
602
|
+}
|
|
|
603
|
+
|
|
|
604
|
+.card-title {
|
|
|
605
|
+ font-size: 26rpx;
|
|
|
606
|
+ font-weight: bold;
|
|
|
607
|
+ color: #333;
|
|
|
608
|
+ margin-bottom: 8rpx;
|
|
|
609
|
+}
|
|
|
610
|
+
|
|
|
611
|
+.card-badge {
|
|
|
612
|
+ display: inline-block;
|
|
|
613
|
+ font-size: 20rpx;
|
|
|
614
|
+ background: #f1f5f9;
|
|
|
615
|
+ padding: 4rpx 16rpx;
|
|
|
616
|
+ border-radius: 30rpx;
|
|
|
617
|
+ color: #666;
|
|
|
618
|
+ margin-bottom: 12rpx;
|
|
|
619
|
+}
|
|
|
620
|
+
|
|
|
621
|
+.card-value {
|
|
|
622
|
+ font-size: 48rpx;
|
|
|
623
|
+ font-weight: 800;
|
|
|
624
|
+}
|
|
|
625
|
+
|
|
|
626
|
+.section-area {
|
|
|
627
|
+ margin: 0 20rpx;
|
|
|
628
|
+}
|
|
|
629
|
+
|
|
|
630
|
+.section-badge {
|
|
|
631
|
+ font-size: 22rpx;
|
|
|
632
|
+ background: #eef2ff;
|
|
|
633
|
+ padding: 6rpx 20rpx;
|
|
|
634
|
+ border-radius: 30rpx;
|
|
|
635
|
+ color: #666;
|
|
|
636
|
+}
|
|
|
637
|
+
|
|
|
638
|
+.table-wrapper {
|
|
|
639
|
+ background: #fff;
|
|
|
640
|
+ border-radius: 16rpx;
|
|
|
641
|
+ overflow-x: auto;
|
|
|
642
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
|
643
|
+}
|
|
|
644
|
+
|
|
|
645
|
+.pagination-wrapper {
|
|
|
646
|
+ display: flex;
|
|
|
647
|
+ justify-content: center;
|
|
|
648
|
+ padding: 20rpx 0;
|
|
|
649
|
+}
|
|
|
650
|
+
|
|
|
651
|
+.warning-summary {
|
|
|
652
|
+ background: #fff9f0;
|
|
|
653
|
+ border-radius: 16rpx;
|
|
|
654
|
+ padding: 20rpx;
|
|
|
655
|
+ margin-top: 20rpx;
|
|
|
656
|
+}
|
|
|
657
|
+
|
|
|
658
|
+.summary-item {
|
|
|
659
|
+ display: flex;
|
|
|
660
|
+ align-items: center;
|
|
|
661
|
+ gap: 12rpx;
|
|
|
662
|
+ padding: 8rpx 0;
|
|
|
663
|
+ font-size: 26rpx;
|
|
|
664
|
+ color: #333;
|
|
|
665
|
+}
|
|
|
666
|
+
|
|
|
667
|
+.dot {
|
|
|
668
|
+ width: 16rpx;
|
|
|
669
|
+ height: 16rpx;
|
|
|
670
|
+ border-radius: 50%;
|
|
|
671
|
+ flex-shrink: 0;
|
|
|
672
|
+
|
|
|
673
|
+ &.red {
|
|
|
674
|
+ background: #ef4444;
|
|
|
675
|
+ }
|
|
|
676
|
+
|
|
|
677
|
+ &.green {
|
|
|
678
|
+ background: #22c55e;
|
|
|
679
|
+ }
|
|
|
680
|
+}
|
|
|
681
|
+
|
|
|
682
|
+.score-danger {
|
|
|
683
|
+ font-weight: bold;
|
|
|
684
|
+ color: #dc2626;
|
|
|
685
|
+ background: #fee2e2;
|
|
|
686
|
+ padding: 4rpx 12rpx;
|
|
|
687
|
+ border-radius: 30rpx;
|
|
|
688
|
+ font-size: 24rpx;
|
|
|
689
|
+}
|
|
|
690
|
+
|
|
|
691
|
+.score-excellent {
|
|
|
692
|
+ font-weight: bold;
|
|
|
693
|
+ color: #15803d;
|
|
|
694
|
+ background: #dcfce7;
|
|
|
695
|
+ padding: 4rpx 12rpx;
|
|
|
696
|
+ border-radius: 30rpx;
|
|
|
697
|
+ font-size: 24rpx;
|
|
|
698
|
+}
|
|
|
699
|
+
|
|
|
700
|
+.detail-link {
|
|
|
701
|
+ color: #2563eb;
|
|
|
702
|
+ font-size: 24rpx;
|
|
|
703
|
+}
|
|
|
704
|
+
|
|
|
705
|
+.picker-popup,
|
|
|
706
|
+.level-popup {
|
|
|
707
|
+ background: #fff;
|
|
|
708
|
+ border-radius: 16rpx 16rpx 0 0;
|
|
|
709
|
+ max-height: 70vh;
|
|
|
710
|
+ display: flex;
|
|
|
711
|
+ flex-direction: column;
|
|
|
712
|
+}
|
|
|
713
|
+
|
|
|
714
|
+.picker-header {
|
|
|
715
|
+ display: flex;
|
|
|
716
|
+ justify-content: space-between;
|
|
|
717
|
+ align-items: center;
|
|
|
718
|
+ padding: 24rpx 32rpx;
|
|
|
719
|
+ border-bottom: 1rpx solid #eee;
|
|
|
720
|
+}
|
|
|
721
|
+
|
|
|
722
|
+.picker-title {
|
|
|
723
|
+ font-size: 32rpx;
|
|
|
724
|
+ font-weight: 600;
|
|
|
725
|
+ color: #333;
|
|
|
726
|
+}
|
|
|
727
|
+
|
|
|
728
|
+.search-box {
|
|
|
729
|
+ padding: 16rpx 32rpx;
|
|
|
730
|
+}
|
|
|
731
|
+
|
|
|
732
|
+.tree-list,
|
|
|
733
|
+.org-list {
|
|
|
734
|
+ flex: 1;
|
|
|
735
|
+ padding: 0 32rpx;
|
|
|
736
|
+ height: 0;
|
|
|
737
|
+ overflow: hidden;
|
|
|
738
|
+}
|
|
|
739
|
+
|
|
|
740
|
+.org-item {
|
|
|
741
|
+ display: flex;
|
|
|
742
|
+ align-items: center;
|
|
|
743
|
+ justify-content: space-between;
|
|
|
744
|
+ padding: 24rpx 0;
|
|
|
745
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
746
|
+}
|
|
|
747
|
+
|
|
|
748
|
+.org-item-name {
|
|
|
749
|
+ font-size: 28rpx;
|
|
|
750
|
+ color: #333;
|
|
|
751
|
+}
|
|
|
752
|
+
|
|
|
753
|
+.level-list {
|
|
|
754
|
+ padding: 16rpx 32rpx;
|
|
|
755
|
+}
|
|
|
756
|
+
|
|
|
757
|
+.level-item {
|
|
|
758
|
+ padding: 24rpx 0;
|
|
|
759
|
+ border-bottom: 1rpx solid #f0f0f0;
|
|
|
760
|
+ font-size: 28rpx;
|
|
|
761
|
+ color: #333;
|
|
|
762
|
+ text-align: center;
|
|
|
763
|
+
|
|
|
764
|
+ &.active {
|
|
|
765
|
+ color: #2563eb;
|
|
|
766
|
+ font-weight: 500;
|
|
|
767
|
+ }
|
|
|
768
|
+}
|
|
|
769
|
+</style>
|