Просмотр исходного кода

refactor: 优化多个页面图表尺寸与接口参数逻辑

1. 调整SeizedNumAll、SupervisionDistribution、DailySeizureChart组件的图表容器高度
2. 修改work/index页面顶部欢迎文案为“欢迎使用智慧安检移动端”
3. 优化teamProfile、groupProfile、deptProfile页面的接口参数传递逻辑
4. 给deptProfile页面添加部门列表过滤逻辑,适配站长角色
huoyi 1 неделя назад
Родитель
Сommit
6ed168d4b7

+ 2 - 2
src/pages/components/DailySeizureChart.vue

@@ -164,7 +164,7 @@ export default {
164 164
           left: '10%',
165 165
           right: '5%',
166 166
           bottom: '14%',
167
-          top: '15%'
167
+          top: '22%'
168 168
         },
169 169
         xAxis: {
170 170
           type: 'category',
@@ -227,7 +227,7 @@ export default {
227 227
   }
228 228
   
229 229
   .chart-container {
230
-    height: 250rpx;
230
+    height:400rpx;
231 231
   }
232 232
 }
233 233
 </style>

+ 1 - 1
src/pages/components/SeizedNumAll.vue

@@ -124,7 +124,7 @@ export default {
124 124
 .seized-num-all {
125 125
     .chart-container {
126 126
         width: 100%;
127
-        height: 250rpx;
127
+        height: 450rpx;
128 128
     }
129 129
 }
130 130
 </style>

+ 1 - 1
src/pages/components/SupervisionDistribution.vue

@@ -121,7 +121,7 @@ export default {
121 121
 .supervision-distribution {
122 122
     .chart-container {
123 123
         width: 100%;
124
-        height: 250rpx;
124
+        height: 450rpx;
125 125
     }
126 126
 }
127 127
 </style>

+ 13 - 13
src/pages/deptProfile/index.vue

@@ -77,7 +77,7 @@
77 77
             </view>
78 78
 
79 79
             <view v-if="activeTab === 'data'">
80
-                <SectionTitle title="当日开航每小时通道过检率">
80
+                <SectionTitle title="每日通道过检率">
81 81
                     <PassengerChart :chartsData="passengerData" />
82 82
                 </SectionTitle>
83 83
 
@@ -343,7 +343,7 @@ export default {
343 343
             getDeptUserTree(params).then(res => {
344 344
                 if (res.code === 200) {
345 345
                     let allDepts = this.flattenDeptTree(res.data || [])
346
-                    this.deptList = allDepts
346
+                    this.deptList = this.isStationMaster() ? allDepts.filter(d => d.deptType === 'BRIGADE') : allDepts
347 347
                     if (userInfo && userInfo.deptId) {
348 348
                         const dept = this.deptList.find(d => d.deptId === userInfo.deptId)
349 349
                         if (dept) {
@@ -391,17 +391,17 @@ export default {
391 391
             this.fetchMemberDistribution(params)
392 392
             this.fetchPositionDistribution(params)
393 393
             const copyParams = { startDate: params.startDate, endDate: params.endDate }
394
-            this.fetchPassengerData(copyParams)
395
-            this.fetchSeizureInfo(copyParams)
396
-            this.fetchItemDistribution(copyParams)
397
-            this.fetchDailySeizure(copyParams)
398
-            this.fetchAreaDistribution(copyParams)
399
-            this.fetchUnsafeItems(copyParams)
400
-            this.fetchUnsafeTypes(copyParams)
401
-            this.fetchUnsafePosition(copyParams)
402
-            this.fetchSecurityTestData(copyParams)
403
-            this.fetchSupervisionData(copyParams)
404
-            this.fetchInterceptionData(copyParams)
394
+            this.fetchPassengerData(params)
395
+            this.fetchSeizureInfo(params)
396
+            this.fetchItemDistribution(params)
397
+            this.fetchDailySeizure(params)
398
+            this.fetchAreaDistribution(params)
399
+            this.fetchUnsafeItems(params)
400
+            this.fetchUnsafeTypes(params)
401
+            this.fetchUnsafePosition(params)
402
+            this.fetchSecurityTestData(params)
403
+            this.fetchSupervisionData(params)
404
+            this.fetchInterceptionData(params)
405 405
         },
406 406
         buildTimeParams() {
407 407
             const now = new Date()

+ 7 - 5
src/pages/groupProfile/index.vue

@@ -404,7 +404,8 @@ export default {
404 404
             this.fetchTeamData(params)
405 405
             this.fetchMemberDistribution(params)
406 406
             this.fetchPositionDistribution(params)
407
-            const copyParams = { startDate: params.startDate, endDate: params.endDate }
407
+            const copyParams = { ...params }
408
+            delete copyParams.deptId
408 409
             this.fetchPassengerData(copyParams)
409 410
             this.fetchSeizureInfo(copyParams)
410 411
             this.fetchItemDistribution(copyParams)
@@ -421,11 +422,12 @@ export default {
421 422
             const now = new Date()
422 423
             const today = this.formatDate(now)
423 424
             const deptId = this.selectedDeptId || 100
425
+            const groupId = this.selectedDeptId || 100
424 426
             if (this.selectedTimeTag === 4) {
425 427
                 if (this.startDate && this.endDate) {
426
-                    return { startDate: this.startDate, endDate: this.endDate, deptId }
428
+                    return { startDate: this.startDate, endDate: this.endDate, deptId, groupId }
427 429
                 }
428
-                return { deptId }
430
+                return { deptId, groupId }  
429 431
             }
430 432
             let startDate
431 433
             switch (this.selectedTimeTag) {
@@ -442,9 +444,9 @@ export default {
442 444
                     startDate = new Date(now.getFullYear() - 1, now.getMonth(), now.getDate())
443 445
                     break
444 446
                 default:
445
-                    return { deptId }
447
+                    return { deptId, groupId }  
446 448
             }
447
-            return { startDate: this.formatDate(startDate), endDate: today, deptId }
449
+            return { startDate: this.formatDate(startDate), endDate: today, deptId, groupId }
448 450
         },
449 451
         formatDate(date) {
450 452
             const y = date.getFullYear()

+ 7 - 5
src/pages/teamProfile/index.vue

@@ -407,7 +407,8 @@ export default {
407 407
             this.fetchTeamData(params)
408 408
             this.fetchMemberDistribution(params)
409 409
             this.fetchPositionDistribution(params)
410
-            const copyParams = { startDate: params.startDate, endDate: params.endDate }
410
+            const copyParams = { ...params }
411
+            delete copyParams.deptId
411 412
             this.fetchPassengerData(copyParams)
412 413
             this.fetchSeizureInfo(copyParams)
413 414
             this.fetchItemDistribution(copyParams)
@@ -424,11 +425,12 @@ export default {
424 425
             const now = new Date()
425 426
             const today = this.formatDate(now)
426 427
             const deptId = this.selectedDeptId || 100
428
+            const teamId = this.selectedTeamId || 100
427 429
             if (this.selectedTimeTag === 4) {
428 430
                 if (this.startDate && this.endDate) {
429
-                    return { startDate: this.startDate, endDate: this.endDate, deptId }
431
+                    return { startDate: this.startDate, endDate: this.endDate, deptId, teamId }
430 432
                 }
431
-                return { deptId }
433
+                return { deptId, teamId }
432 434
             }
433 435
             let startDate
434 436
             switch (this.selectedTimeTag) {
@@ -445,9 +447,9 @@ export default {
445 447
                     startDate = new Date(now.getFullYear() - 1, now.getMonth(), now.getDate())
446 448
                     break
447 449
                 default:
448
-                    return { deptId }
450
+                    return { deptId, teamId }
449 451
             }
450
-            return { startDate: this.formatDate(startDate), endDate: today, deptId }
452
+            return { startDate: this.formatDate(startDate), endDate: today, deptId, teamId }
451 453
         },
452 454
         formatDate(date) {
453 455
             const y = date.getFullYear()

+ 1 - 1
src/pages/work/index.vue

@@ -3,7 +3,7 @@
3 3
     <div class="work-container">
4 4
       <!-- 顶部状态栏 -->
5 5
       <view class="status-bar">
6
-        <text class="welcome">欢迎使用考勤系统</text>
6
+        <text class="welcome">欢迎使用智慧安检移动端</text>
7 7
         <text class="date">{{ currentDate }}</text>
8 8
       </view>
9 9