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

feat: 运行数据图表联调

lixiangrui недель назад: 3
Родитель
Сommit
ec61bee1ef

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

@@ -207,7 +207,7 @@ onUnmounted(() => {
207
 defineExpose({
207
 defineExpose({
208
   getDefQuery() {
208
   getDefQuery() {
209
     return {
209
     return {
210
-      ...getTimeRange()
210
+      ...getTimeRange(),
211
     }
211
     }
212
   }
212
   }
213
 })
213
 })

+ 1 - 3
src/views/portraitManagement/deptProfile/component/runData.vue

@@ -118,7 +118,7 @@ const countSeizeSubjectCategoryQuantityData = ref([])
118
 const invokerCountSeizeSubjectCategoryQuantity = () => {
118
 const invokerCountSeizeSubjectCategoryQuantity = () => {
119
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
119
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
120
     if (res.code === 200 && res.data) {
120
     if (res.code === 200 && res.data) {
121
-      countSeizureInfoItemData.value = res.data || []
121
+      countSeizeSubjectCategoryQuantityData.value = res.data || []
122
     }
122
     }
123
   })
123
   })
124
 }
124
 }
@@ -128,8 +128,6 @@ const invokerCountSeizureTotalQuantity = () => {
128
   countSeizureTotalQuantity(props.queryParams).then(res => {
128
   countSeizureTotalQuantity(props.queryParams).then(res => {
129
     if (res.code === 200 && res.data) {
129
     if (res.code === 200 && res.data) {
130
       countSeizureTotalQuantityData.value = res.data || []
130
       countSeizureTotalQuantityData.value = res.data || []
131
-      console.log(countSeizureTotalQuantityData.value);
132
-      
133
     }
131
     }
134
   })
132
   })
135
 }
133
 }

+ 8 - 2
src/views/portraitManagement/deptProfile/index.vue

@@ -1,10 +1,10 @@
1
 <template>
1
 <template>
2
   <div class="group-profile-page">
2
   <div class="group-profile-page">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
4
-      <SearchBar v-model:visible="searchVisible" @search="handleSearch" :deptType="'BRIGADE'"/>
4
+      <SearchBar v-model:visible="searchVisible" ref="searchBar" @search="handleSearch" :deptType="'BRIGADE'"/>
5
       <PentagonGroup :items="pentagonItems" />
5
       <PentagonGroup :items="pentagonItems" />
6
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
6
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
7
-      <RunData v-else />
7
+      <RunData v-else :query-params="queryParams"/>
8
     </Page>
8
     </Page>
9
 
9
 
10
   </div>
10
   </div>
@@ -163,6 +163,12 @@ const handleSearch = (params) => {
163
 const handleTabChange = (index) => {
163
 const handleTabChange = (index) => {
164
   activeTab.value = index
164
   activeTab.value = index
165
 }
165
 }
166
+
167
+const searchBar = ref(null)
168
+onMounted(() => {
169
+  queryParams.value = Object.assign({ deptId: '' }, searchBar.value.getDefQuery())
170
+})
171
+
166
 </script>
172
 </script>
167
 
173
 
168
 <style lang="scss" scoped>
174
 <style lang="scss" scoped>

+ 2 - 5
src/views/portraitManagement/groupProfile/component/runData.vue

@@ -73,7 +73,6 @@ import SupervisionDistribution from '../../components/SupervisionDistribution.vu
73
 import InterceptionDistribution from '../../components/InterceptionDistribution.vue';
73
 import InterceptionDistribution from '../../components/InterceptionDistribution.vue';
74
 import { 
74
 import { 
75
   countLanePeakThroughput,
75
   countLanePeakThroughput,
76
-  countStationHourlyThroughput,
77
   countSeizureInfoItem,
76
   countSeizureInfoItem,
78
   countSeizeSubjectCategoryQuantity,
77
   countSeizeSubjectCategoryQuantity,
79
   countSeizureTotalQuantity,
78
   countSeizureTotalQuantity,
@@ -119,7 +118,7 @@ const countSeizeSubjectCategoryQuantityData = ref([])
119
 const invokerCountSeizeSubjectCategoryQuantity = () => {
118
 const invokerCountSeizeSubjectCategoryQuantity = () => {
120
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
119
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
121
     if (res.code === 200 && res.data) {
120
     if (res.code === 200 && res.data) {
122
-      countSeizureInfoItemData.value = res.data || []
121
+      countSeizeSubjectCategoryQuantityData.value = res.data || []
123
     }
122
     }
124
   })
123
   })
125
 }
124
 }
@@ -128,9 +127,7 @@ const countSeizureTotalQuantityData = ref([])
128
 const invokerCountSeizureTotalQuantity = () => {
127
 const invokerCountSeizureTotalQuantity = () => {
129
   countSeizureTotalQuantity(props.queryParams).then(res => {
128
   countSeizureTotalQuantity(props.queryParams).then(res => {
130
     if (res.code === 200 && res.data) {
129
     if (res.code === 200 && res.data) {
131
-      countSeizureTotalQuantityData.value = res.data || []
132
-      console.log(countSeizureTotalQuantityData.value);
133
-      
130
+      countSeizureTotalQuantityData.value = res.data || []  
134
     }
131
     }
135
   })
132
   })
136
 }
133
 }

+ 8 - 4
src/views/portraitManagement/groupProfile/index.vue

@@ -2,7 +2,7 @@
2
   <div class="group-profile-page">
2
   <div class="group-profile-page">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
4
       <div style="margin-bottom: 30px;">
4
       <div style="margin-bottom: 30px;">
5
-        <SearchBar v-model:visible="searchVisible" @search="handleSearch"  :deptType="'TEAMS'" />
5
+        <SearchBar v-model:visible="searchVisible" ref="searchBar" @search="handleSearch"  :deptType="'TEAMS'" />
6
       </div>
6
       </div>
7
       <PentagonGroup :items="pentagonItems" />
7
       <PentagonGroup :items="pentagonItems" />
8
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
8
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
@@ -13,7 +13,7 @@
13
 </template>
13
 </template>
14
 
14
 
15
 <script setup>
15
 <script setup>
16
-import { ref, computed } from 'vue'
16
+import { ref, computed, onMounted } from 'vue'
17
 import Page from '../components/page.vue'
17
 import Page from '../components/page.vue'
18
 import SearchBar from '../components/SearchBar.vue'
18
 import SearchBar from '../components/SearchBar.vue'
19
 import Profile from './component/profile.vue'
19
 import Profile from './component/profile.vue'
@@ -159,13 +159,17 @@ const pentagonItems = computed(() => [
159
 ])
159
 ])
160
 const groupName = ref('')
160
 const groupName = ref('')
161
 const handleSearch = (params) => {
161
 const handleSearch = (params) => {
162
-  queryParams.value = { startDate: params.beginTime, endDate: params.endTime, groupId: params.groupId}
163
-  groupName.value = params.groupName
162
+  queryParams.value = params
164
 }
163
 }
165
 
164
 
166
 const handleTabChange = (index) => {
165
 const handleTabChange = (index) => {
167
   activeTab.value = index
166
   activeTab.value = index
168
 }
167
 }
168
+const searchBar = ref(null)
169
+onMounted(() => {
170
+  queryParams.value = Object.assign({ groupId: '' }, searchBar.value.getDefQuery())
171
+})
172
+
169
 </script>
173
 </script>
170
 
174
 
171
 <style lang="scss" scoped>
175
 <style lang="scss" scoped>

+ 121 - 48
src/views/portraitManagement/stationProfile/component/runData.vue

@@ -42,12 +42,12 @@
42
     </div>
42
     </div>
43
 
43
 
44
     <div class="content-row">
44
     <div class="content-row">
45
-      <SeizedInfo :chartsData="seizedInfoData" />
46
-      <SeizedItems :chartsData="seizedItemsData" />
45
+      <SeizedInfo :chartsData="countSeizureInfoItemData" />
46
+      <SeizedItems :chartsData="countSeizeSubjectCategoryQuantityData" />
47
     </div>
47
     </div>
48
 
48
 
49
     <div class="content-row">
49
     <div class="content-row">
50
-      <SeizedNumAll :chartsData="seizedNumAllData" />
50
+      <SeizedNumAll :chartsData="countSeizureTotalQuantityData" />
51
       <InfoCard title="每日查获数量(部门对比)">
51
       <InfoCard title="每日查获数量(部门对比)">
52
         <div ref="dailySeizedAreaRef" class="daily-chart"></div>
52
         <div ref="dailySeizedAreaRef" class="daily-chart"></div>
53
       </InfoCard>
53
       </InfoCard>
@@ -56,19 +56,19 @@
56
 
56
 
57
 
57
 
58
     <div class="content-row">
58
     <div class="content-row">
59
-      <SeizedWorkArea :chartsData="workAreaDistData" />
59
+      <SeizedWorkArea :chartsData="countSeizeAreaQuantityData" />
60
     </div>
60
     </div>
61
 
61
 
62
     <div class="content-row">
62
     <div class="content-row">
63
-      <EventItems :chartsData="unsafeItemDistData" />
64
-      <EventType :chartsData="unsafeTypeDistData" />
65
-      <EventWorkArea :chartsData="unsafePostDistData" />
63
+      <EventItems :chartsData="countSeizureStatsItemData" />
64
+      <EventType :chartsData="countSeizureStatsTypeData" />
65
+      <EventWorkArea :chartsData="countSeizureStatsPostData" />
66
     </div>
66
     </div>
67
 
67
 
68
     <div class="content-row">
68
     <div class="content-row">
69
-      <TestItems :chartsData="securityTestItemData" />
70
-      <TestResult :chartsData="securityTestPassData" />
71
-      <TestArea :chartsData="securityTestAreaData" />
69
+      <TestItems :chartsData="securityTestItemClassificationData" />
70
+      <TestResult :chartsData="securityTestPassingStatusData" />
71
+      <TestArea :chartsData="securityTestRegionData" />
72
     </div>
72
     </div>
73
   </div>
73
   </div>
74
 </template>
74
 </template>
@@ -87,7 +87,20 @@ import EventWorkArea from '../../components/EventWorkArea.vue'
87
 import TestItems from '../../components/TestItems.vue'
87
 import TestItems from '../../components/TestItems.vue'
88
 import TestResult from '../../components/TestResult.vue'
88
 import TestResult from '../../components/TestResult.vue'
89
 import TestArea from '../../components/TestArea.vue'
89
 import TestArea from '../../components/TestArea.vue'
90
-import { securityTestItemClassification, securityTestPassingStatus, securityTestRegion } from '@/api/portraitManagement/portraitManagement'
90
+import {
91
+  countSeizureInfoItem,
92
+  countSeizeSubjectCategoryQuantity,
93
+  countSeizureTotalQuantity,
94
+  countSeizureSingleQuantity,
95
+  countSeizeAreaQuantity,
96
+  countSeizureStatsItem,
97
+  countSeizureStatsType,
98
+  countSeizureStatsPost,
99
+  securityTestItemClassification,
100
+  securityTestPassingStatus,
101
+  securityTestRegion,
102
+
103
+} from '@/api/portraitManagement/portraitManagement'
91
 
104
 
92
 const props = defineProps({
105
 const props = defineProps({
93
   queryParams: {
106
   queryParams: {
@@ -141,57 +154,117 @@ const seizedInfoData = [
141
   { num: 481 }
154
   { num: 481 }
142
 ]
155
 ]
143
 
156
 
144
-const seizedItemsData = ref([])
145
-const securityTestItemData = ref([])
146
 
157
 
147
-const fetchSeizedItemsData = async () => {
148
-  try {
149
-    const res = await securityTestItemClassification(props.queryParams)
158
+const countSeizureInfoItemData = ref({ totalSeizeNum: 0, itemList: [] })
159
+const invokerCountSeizureInfoItem = () => {
160
+  countSeizureInfoItem(props.queryParams).then(res => {
150
     if (res.code === 200 && res.data) {
161
     if (res.code === 200 && res.data) {
151
-      securityTestItemData.value = res.data.map(item => ({
152
-        num: item.total,
153
-        name: item.name
154
-      }))
162
+      countSeizureInfoItemData.value = res.data || { totalSeizeNum: 0, itemList: [] }
155
     }
163
     }
156
-  } catch (error) {
157
-    console.error('获取安保测试物品分类数据失败', error)
158
-  }
164
+  })
159
 }
165
 }
160
-const securityTestPassData = ref([])
161
-const securityTestAreaData = ref([])
162
 
166
 
163
-const fetchSecurityTestPassData = async () => {
164
-  try {
165
-    const res = await securityTestPassingStatus(props.queryParams)
167
+const countSeizeSubjectCategoryQuantityData = ref([])
168
+const invokerCountSeizeSubjectCategoryQuantity = () => {
169
+  countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
166
     if (res.code === 200 && res.data) {
170
     if (res.code === 200 && res.data) {
167
-      securityTestPassData.value = res.data.map(item => ({
168
-        num: item.total,
169
-        name: item.name
170
-      }))
171
+      countSeizeSubjectCategoryQuantityData.value = res.data || []
171
     }
172
     }
172
-  } catch (error) {
173
-    console.error('获取安保测试通过情况数据失败', error)
174
-  }
173
+  })
175
 }
174
 }
176
 
175
 
177
-const fetchSecurityTestAreaData = async () => {
178
-  try {
179
-    const res = await securityTestRegion(props.queryParams)
176
+const countSeizureTotalQuantityData = ref([])
177
+const invokerCountSeizureTotalQuantity = () => {
178
+  countSeizureTotalQuantity(props.queryParams).then(res => {
180
     if (res.code === 200 && res.data) {
179
     if (res.code === 200 && res.data) {
181
-      securityTestAreaData.value = res.data.map(item => ({
182
-        num: item.total,
183
-        name: item.name
184
-      }))
180
+      countSeizureTotalQuantityData.value = res.data || []
185
     }
181
     }
186
-  } catch (error) {
187
-    console.error('获取安保测试区域情况数据失败', error)
188
-  }
182
+  })
189
 }
183
 }
190
 
184
 
185
+const countSeizureSingleQuantityData = ref([])
186
+const invokerCountSeizureSingleQuantity = () => {
187
+  countSeizureSingleQuantity(props.queryParams).then(res => {
188
+    if (res.code === 200 && res.data) {
189
+      countSeizureSingleQuantityData.value = res.data || []
190
+    }
191
+  })
192
+}
193
+
194
+const countSeizeAreaQuantityData = ref([])
195
+const invokerCountSeizeAreaQuantity = () => {
196
+  countSeizeAreaQuantity(props.queryParams).then(res => {
197
+    if (res.code === 200 && res.data) {
198
+      countSeizeAreaQuantityData.value = res.data || []
199
+    }
200
+  })
201
+}
202
+
203
+const countSeizureStatsItemData = ref([])
204
+const invokerCountSeizureStatsItem = () => {
205
+  countSeizureStatsItem(props.queryParams).then(res => {
206
+    if (res.code === 200 && res.data) {
207
+      countSeizureStatsItemData.value = res.data || []
208
+    }
209
+  })
210
+}
211
+const countSeizureStatsTypeData = ref([])
212
+const invokerCountSeizureStatsType = () => {
213
+  countSeizureStatsType(props.queryParams).then(res => {
214
+    if (res.code === 200 && res.data) {
215
+      countSeizureStatsTypeData.value = res.data || []
216
+    }
217
+  })
218
+}
219
+const countSeizureStatsPostData = ref([])
220
+const invokerCountSeizureStatsPost = () => {
221
+  countSeizureStatsPost(props.queryParams).then(res => {
222
+    if (res.code === 200 && res.data) {
223
+      countSeizureStatsPostData.value = res.data || []
224
+    }
225
+  })
226
+}
227
+
228
+const securityTestItemClassificationData = ref([])
229
+const invokerSecurityTestItemClassification = () => {
230
+  securityTestItemClassification(props.queryParams).then(res => {
231
+    if (res.code === 200 && res.data) {
232
+      securityTestItemClassificationData.value = res.data || []
233
+    }
234
+  })
235
+}
236
+
237
+const securityTestPassingStatusData = ref([])
238
+const invokerSecurityTestPassingStatus = () => {
239
+    securityTestPassingStatus(props.queryParams).then(res => {
240
+    if (res.code === 200 && res.data) {
241
+      securityTestPassingStatusData.value = res.data || []
242
+    }
243
+  })
244
+}
245
+const securityTestRegionData = ref([])
246
+const invokerSecurityTestRegion = () => {
247
+    securityTestRegion(props.queryParams).then(res => {
248
+    if (res.code === 200 && res.data) {
249
+      securityTestRegionData.value = res.data || []
250
+    }
251
+  })
252
+}
253
+
254
+
255
+
191
 const fetchData = () => {
256
 const fetchData = () => {
192
-  fetchSeizedItemsData()
193
-  fetchSecurityTestPassData()
194
-  fetchSecurityTestAreaData()
257
+  invokerCountSeizureInfoItem()
258
+  invokerCountSeizeSubjectCategoryQuantity()
259
+  invokerCountSeizureTotalQuantity()
260
+  invokerCountSeizureSingleQuantity()
261
+  invokerCountSeizeAreaQuantity()
262
+  invokerCountSeizureStatsItem()
263
+  invokerCountSeizureStatsType()
264
+  invokerCountSeizureStatsPost()
265
+  invokerSecurityTestItemClassification()
266
+  invokerSecurityTestPassingStatus()
267
+  invokerSecurityTestRegion()
195
 }
268
 }
196
 
269
 
197
 watch(() => props.queryParams, () => {
270
 watch(() => props.queryParams, () => {

+ 1 - 3
src/views/portraitManagement/teamProfile/component/runData.vue

@@ -119,7 +119,7 @@ const countSeizeSubjectCategoryQuantityData = ref([])
119
 const invokerCountSeizeSubjectCategoryQuantity = () => {
119
 const invokerCountSeizeSubjectCategoryQuantity = () => {
120
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
120
   countSeizeSubjectCategoryQuantity(props.queryParams).then(res => {
121
     if (res.code === 200 && res.data) {
121
     if (res.code === 200 && res.data) {
122
-      countSeizureInfoItemData.value = res.data || []
122
+      countSeizeSubjectCategoryQuantityData.value = res.data || []
123
     }
123
     }
124
   })
124
   })
125
 }
125
 }
@@ -129,8 +129,6 @@ const invokerCountSeizureTotalQuantity = () => {
129
   countSeizureTotalQuantity(props.queryParams).then(res => {
129
   countSeizureTotalQuantity(props.queryParams).then(res => {
130
     if (res.code === 200 && res.data) {
130
     if (res.code === 200 && res.data) {
131
       countSeizureTotalQuantityData.value = res.data || []
131
       countSeizureTotalQuantityData.value = res.data || []
132
-      console.log(countSeizureTotalQuantityData.value);
133
-      
134
     }
132
     }
135
   })
133
   })
136
 }
134
 }

+ 8 - 2
src/views/portraitManagement/teamProfile/index.vue

@@ -1,10 +1,10 @@
1
 <template>
1
 <template>
2
   <div class="group-profile-page">
2
   <div class="group-profile-page">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
3
     <Page title="安检人事管理可视化大屏" :tabs="['能力画像', '运行数据']" @tab-change="handleTabChange">
4
-      <SearchBar v-model:visible="searchVisible" @search="handleSearch" :deptType="'MANAGER'"/>
4
+      <SearchBar v-model:visible="searchVisible" ref="searchBar" @search="handleSearch" :deptType="'MANAGER'"/>
5
       <PentagonGroup :items="pentagonItems" />
5
       <PentagonGroup :items="pentagonItems" />
6
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
6
       <Profile v-if="activeTab === 0" :query-params="queryParams" />
7
-      <RunData v-else />
7
+      <RunData v-else :query-params="queryParams"/>
8
     </Page>
8
     </Page>
9
 
9
 
10
   </div>
10
   </div>
@@ -163,6 +163,12 @@ const handleSearch = (params) => {
163
 const handleTabChange = (index) => {
163
 const handleTabChange = (index) => {
164
   activeTab.value = index
164
   activeTab.value = index
165
 }
165
 }
166
+
167
+const searchBar = ref(null)
168
+onMounted(() => {
169
+  queryParams.value = Object.assign({ teamId: '' }, searchBar.value.getDefQuery())
170
+})
171
+
166
 </script>
172
 </script>
167
 
173
 
168
 <style lang="scss" scoped>
174
 <style lang="scss" scoped>