Explorar el Código

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

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

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

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

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

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

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

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

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

@@ -77,7 +77,7 @@
77
             </view>
77
             </view>
78
 
78
 
79
             <view v-if="activeTab === 'data'">
79
             <view v-if="activeTab === 'data'">
80
-                <SectionTitle title="当日开航每小时通道过检率">
80
+                <SectionTitle title="每日通道过检率">
81
                     <PassengerChart :chartsData="passengerData" />
81
                     <PassengerChart :chartsData="passengerData" />
82
                 </SectionTitle>
82
                 </SectionTitle>
83
 
83
 
@@ -343,7 +343,7 @@ export default {
343
             getDeptUserTree(params).then(res => {
343
             getDeptUserTree(params).then(res => {
344
                 if (res.code === 200) {
344
                 if (res.code === 200) {
345
                     let allDepts = this.flattenDeptTree(res.data || [])
345
                     let allDepts = this.flattenDeptTree(res.data || [])
346
-                    this.deptList = allDepts
346
+                    this.deptList = this.isStationMaster() ? allDepts.filter(d => d.deptType === 'BRIGADE') : allDepts
347
                     if (userInfo && userInfo.deptId) {
347
                     if (userInfo && userInfo.deptId) {
348
                         const dept = this.deptList.find(d => d.deptId === userInfo.deptId)
348
                         const dept = this.deptList.find(d => d.deptId === userInfo.deptId)
349
                         if (dept) {
349
                         if (dept) {
@@ -391,17 +391,17 @@ export default {
391
             this.fetchMemberDistribution(params)
391
             this.fetchMemberDistribution(params)
392
             this.fetchPositionDistribution(params)
392
             this.fetchPositionDistribution(params)
393
             const copyParams = { startDate: params.startDate, endDate: params.endDate }
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
         buildTimeParams() {
406
         buildTimeParams() {
407
             const now = new Date()
407
             const now = new Date()

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

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

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

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

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

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