Sfoglia il codice sorgente

refactor: 优化多个页面的UI和交互逻辑

1. 调整两个图表的轴标签样式,添加旋转避免文字重叠
2. 统一多个页面的"查获人/被查人"为"责任人"文案
3. 将预警页面原生表格替换为ElTable并添加分页功能
huoyi 1 settimana fa
parent
commit
0e32c286bf

+ 3 - 3
src/views/ledger/realtimeInterception/index.vue

@@ -7,8 +7,8 @@
7
       <el-form-item label="队室/班组" prop="teamName">
7
       <el-form-item label="队室/班组" prop="teamName">
8
         <el-input v-model="queryParams.teamName" placeholder="请输入队室/班组" clearable @keyup.enter="handleQuery" />
8
         <el-input v-model="queryParams.teamName" placeholder="请输入队室/班组" clearable @keyup.enter="handleQuery" />
9
       </el-form-item>
9
       </el-form-item>
10
-      <el-form-item label="查获人" prop="inspectorName">
11
-        <el-input v-model="queryParams.inspectorName" placeholder="请输入查获人" clearable @keyup.enter="handleQuery" />
10
+      <el-form-item label="责任人" prop="inspectorName">
11
+        <el-input v-model="queryParams.inspectorName" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
12
       </el-form-item>
12
       </el-form-item>
13
 
13
 
14
       <el-form-item label="记录日期">
14
       <el-form-item label="记录日期">
@@ -35,7 +35,7 @@
35
       </el-table-column>
35
       </el-table-column>
36
       <el-table-column label="部门名称" align="center" prop="deptName" />
36
       <el-table-column label="部门名称" align="center" prop="deptName" />
37
       <el-table-column label="队室/班组" align="center" prop="teamName" />
37
       <el-table-column label="队室/班组" align="center" prop="teamName" />
38
-      <el-table-column label="查获人" align="center" prop="inspectorName" />
38
+      <el-table-column label="责任人" align="center" prop="inspectorName" />
39
       <el-table-column label="通道号" align="center" prop="channelNo" />
39
       <el-table-column label="通道号" align="center" prop="channelNo" />
40
       <el-table-column label="旅客姓名" align="center" prop="passengerName" />
40
       <el-table-column label="旅客姓名" align="center" prop="passengerName" />
41
       <el-table-column label="航班号" align="center" prop="flightNo" />
41
       <el-table-column label="航班号" align="center" prop="flightNo" />

+ 3 - 3
src/views/ledger/servicePatrol/index.vue

@@ -7,8 +7,8 @@
7
       <el-form-item label="队室/班组" prop="teamName">
7
       <el-form-item label="队室/班组" prop="teamName">
8
         <el-input v-model="queryParams.teamName" placeholder="请输入队室/班组" clearable @keyup.enter="handleQuery" />
8
         <el-input v-model="queryParams.teamName" placeholder="请输入队室/班组" clearable @keyup.enter="handleQuery" />
9
       </el-form-item>
9
       </el-form-item>
10
-      <el-form-item label="被查人" prop="inspectedName">
11
-        <el-input v-model="queryParams.inspectedName" placeholder="请输入被查人" clearable @keyup.enter="handleQuery" />
10
+      <el-form-item label="责任人" prop="inspectedName">
11
+        <el-input v-model="queryParams.inspectedName" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
12
       </el-form-item>
12
       </el-form-item>
13
 
13
 
14
       <el-form-item label="记录日期">
14
       <el-form-item label="记录日期">
@@ -36,7 +36,7 @@
36
       <el-table-column label="部门名称" align="center" prop="deptName" />
36
       <el-table-column label="部门名称" align="center" prop="deptName" />
37
       <el-table-column label="队室/班组" align="center" prop="teamName" />
37
       <el-table-column label="队室/班组" align="center" prop="teamName" />
38
       <el-table-column label="巡查人" align="center" prop="inspectorName" />
38
       <el-table-column label="巡查人" align="center" prop="inspectorName" />
39
-      <el-table-column label="被查人" align="center" prop="inspectedName" />
39
+      <el-table-column label="责任人" align="center" prop="inspectedName" />
40
       <el-table-column label="服务类型" align="center" prop="serviceType" />
40
       <el-table-column label="服务类型" align="center" prop="serviceType" />
41
       <el-table-column label="问题描述" align="center" prop="problemDesc" show-overflow-tooltip />
41
       <el-table-column label="问题描述" align="center" prop="problemDesc" show-overflow-tooltip />
42
       <el-table-column label="扣分" align="center" prop="deductScore">
42
       <el-table-column label="扣分" align="center" prop="deductScore">

+ 3 - 3
src/views/ledger/supervisionProblem/index.vue

@@ -10,8 +10,8 @@
10
       <el-form-item label="巡查人" prop="inspectorName">
10
       <el-form-item label="巡查人" prop="inspectorName">
11
         <el-input v-model="queryParams.inspectorName" placeholder="请输入巡查人" clearable @keyup.enter="handleQuery" />
11
         <el-input v-model="queryParams.inspectorName" placeholder="请输入巡查人" clearable @keyup.enter="handleQuery" />
12
       </el-form-item>
12
       </el-form-item>
13
-      <el-form-item label="被查人" prop="inspectedName">
14
-        <el-input v-model="queryParams.inspectedName" placeholder="请输入被查人" clearable @keyup.enter="handleQuery" />
13
+      <el-form-item label="责任人" prop="inspectedName">
14
+        <el-input v-model="queryParams.inspectedName" placeholder="请输入责任人" clearable @keyup.enter="handleQuery" />
15
       </el-form-item>
15
       </el-form-item>
16
       <el-form-item label="记录日期">
16
       <el-form-item label="记录日期">
17
         <el-date-picker v-model="dateRange" type="daterange" value-format="YYYY-MM-DD"
17
         <el-date-picker v-model="dateRange" type="daterange" value-format="YYYY-MM-DD"
@@ -39,7 +39,7 @@
39
       <el-table-column label="队室/班组" align="center" prop="teamName" />
39
       <el-table-column label="队室/班组" align="center" prop="teamName" />
40
       <el-table-column label="小组" align="center" prop="groupName" />
40
       <el-table-column label="小组" align="center" prop="groupName" />
41
       <el-table-column label="巡查人" align="center" prop="inspectorName" />
41
       <el-table-column label="巡查人" align="center" prop="inspectorName" />
42
-      <el-table-column label="被查人" align="center" prop="inspectedName" />
42
+      <el-table-column label="责任人" align="center" prop="inspectedName" />
43
       <el-table-column label="问题类型" align="center" prop="problemType" />
43
       <el-table-column label="问题类型" align="center" prop="problemType" />
44
       <el-table-column label="问题描述" align="center" prop="problemDesc" show-overflow-tooltip />
44
       <el-table-column label="问题描述" align="center" prop="problemDesc" show-overflow-tooltip />
45
       <el-table-column label="问题地点" align="center" prop="location" />
45
       <el-table-column label="问题地点" align="center" prop="location" />

+ 1 - 1
src/views/portraitManagement/components/ProfilePositionDistribution.vue

@@ -180,7 +180,7 @@ const updatePostChart = (data) => {
180
     xAxis: {
180
     xAxis: {
181
       type: 'category',
181
       type: 'category',
182
       data: chartData.categories,
182
       data: chartData.categories,
183
-      axisLabel: { color: '#a0c4ff', fontSize: 10 },
183
+      axisLabel: { color: '#a0c4ff', fontSize: 10,rotate: 30 },
184
       axisLine: { lineStyle: { color: 'rgba(15,70,250,0.3)' } }
184
       axisLine: { lineStyle: { color: 'rgba(15,70,250,0.3)' } }
185
     },
185
     },
186
     yAxis: {
186
     yAxis: {

+ 1 - 1
src/views/portraitManagement/components/SupervisionDistribution.vue

@@ -33,7 +33,7 @@ const setChartsOptionsBar = computed(() => {
33
     xAxis: {
33
     xAxis: {
34
       type: 'category',
34
       type: 'category',
35
       data: labels,
35
       data: labels,
36
-      axisLabel: { color: '#fff', fontSize: 14 },
36
+      axisLabel: { color: '#fff', fontSize: 13, rotate: 30 },
37
       axisLine: { lineStyle: { color: '#344067' } }
37
       axisLine: { lineStyle: { color: '#344067' } }
38
     },
38
     },
39
     yAxis: [
39
     yAxis: [

+ 81 - 56
src/views/warningPage/index.vue

@@ -74,52 +74,56 @@
74
             </div>
74
             </div>
75
             <div class="employee-card">
75
             <div class="employee-card">
76
                 <div style="overflow-x: auto;">
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
                 </div>
127
                 </div>
124
                 <div class="warning-summary">
128
                 <div class="warning-summary">
125
                     <div><i class="fas fa-circle" style="color:#ef4444;"></i> <strong>红色预警</strong> (综合评估 &lt; 75分) 共计
129
                     <div><i class="fas fa-circle" style="color:#ef4444;"></i> <strong>红色预警</strong> (综合评估 &lt; 75分) 共计
@@ -190,6 +194,10 @@ const coreRisksOrOutstandingAchievementsList = [
190
 ]
194
 ]
191
 
195
 
192
 const employeesData = ref([])
196
 const employeesData = ref([])
197
+const queryParams = reactive({
198
+  pageNum: 1,
199
+  pageSize: 10
200
+})
193
 
201
 
194
 for (let i = 0; i < newNames.length; i++) {
202
 for (let i = 0; i < newNames.length; i++) {
195
     employeesData.value.push({
203
     employeesData.value.push({
@@ -250,10 +258,8 @@ const getSelectedInfo = (selectedValue) => {
250
     return findNodeByValue(cascadeOptions.value, selectedValue)
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
     if (selectedAlertLevel.value) {
265
     if (selectedAlertLevel.value) {
@@ -272,11 +278,26 @@ const filteredEmployees = computed(() => {
272
         }
278
         }
273
     }
279
     }
274
 
280
 
275
-
276
-
277
     return result
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
 const redAlertCount = computed(() => {
301
 const redAlertCount = computed(() => {
281
     return employeesData.value?.redAlertNum || 0
302
     return employeesData.value?.redAlertNum || 0
282
 })
303
 })
@@ -289,9 +310,9 @@ const avgScore = computed(() => {
289
     return employeesData.value?.averageComprehensiveScore || 0
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
     return ""
316
     return ""
296
 }
317
 }
297
 
318
 
@@ -348,7 +369,7 @@ const warningDataMap = {
348
 }
369
 }
349
 
370
 
350
 const fetchWarningData = async () => {
371
 const fetchWarningData = async () => {
351
-    
372
+    queryParams.pageNum = 1
352
     let params = {}
373
     let params = {}
353
     if (startDate.value && endDate.value) {
374
     if (startDate.value && endDate.value) {
354
         params.startDate = formatDate(startDate.value)
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
 watch(() => route.query, (query) => {
448
 watch(() => route.query, (query) => {
424
     const { id } = query
449
     const { id } = query