Browse Source

Merge branch 'ai' into dev

huoyi 3 days ago
parent
commit
c436e8b912

+ 9 - 6
src/views/assistant/components/dutyOrganization.vue

@@ -18,16 +18,19 @@
18
           <div class="stat-content">
18
           <div class="stat-content">
19
             {{ attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
19
             {{ attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
20
               1]?.deptName : ''
20
               1]?.deptName : ''
21
-            }}出勤<span>{{ attendanceData && attendanceData.length > 3 ? attendanceData[3]?.currentValue : 0
21
+            }}出勤<span>{{ attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
22
+              1]?.currentValue : 0
22
             }}</span>人次,同比
23
             }}</span>人次,同比
23
             <span
24
             <span
24
-              :class="getTrendClass(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.yearOnYearValue : 0)">{{
25
-                formatRate(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.yearOnYearValue : 0) }}</span>
25
+              :class="getTrendClass(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length - 1]?.yearOnYearValue : 0)">{{
26
+                formatRate(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
27
+                  1]?.yearOnYearValue : 0) }}</span>
26
             <template v-if="props.queryForm.dateRangeQueryType !== 'YEAR'">
28
             <template v-if="props.queryForm.dateRangeQueryType !== 'YEAR'">
27
               ,环比
29
               ,环比
28
               <span
30
               <span
29
-                :class="getTrendClass(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.chainRatioValue : 0)">{{
30
-                  formatRate(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.chainRatioValue : 0)
31
+                :class="getTrendClass(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length - 1]?.chainRatioValue : 0)">{{
32
+                  formatRate(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
33
+                    1]?.chainRatioValue : 0)
31
                 }}</span>
34
                 }}</span>
32
             </template>
35
             </template>
33
           </div>
36
           </div>
@@ -188,7 +191,7 @@ const isStationType = computed(() => {
188
   return selectedDeptType.value === 'STATION' || !selectedDeptType.value
191
   return selectedDeptType.value === 'STATION' || !selectedDeptType.value
189
 })
192
 })
190
 const isDepartmentType = computed(() => {
193
 const isDepartmentType = computed(() => {
191
-  return selectedDeptType.value === 'DEPARTMENT'
194
+  return selectedDeptType.value === 'MANAGER'
192
 })
195
 })
193
 const isTeamsType = computed(() => {
196
 const isTeamsType = computed(() => {
194
   return selectedDeptType.value === 'TEAMS'
197
   return selectedDeptType.value === 'TEAMS'

+ 11 - 4
src/views/assistant/components/qualityControl.vue

@@ -156,7 +156,7 @@ const isStationType = computed(() => {
156
 
156
 
157
 // 计算属性:检查是否为DEPARTMENT类型
157
 // 计算属性:检查是否为DEPARTMENT类型
158
 const isDepartmentType = computed(() => {
158
 const isDepartmentType = computed(() => {
159
-  return selectedDeptType.value === 'DEPARTMENT'
159
+  return selectedDeptType.value === 'MANAGER'
160
 })
160
 })
161
 const isBrigadeType = computed(() => {
161
 const isBrigadeType = computed(() => {
162
   return selectedDeptType.value === 'BRIGADE'
162
   return selectedDeptType.value === 'BRIGADE'
@@ -296,13 +296,20 @@ const fetchAnalysisData = async (queryParams) => {
296
     // 添加null检查,防止props.selectedDeptObject为null
296
     // 添加null检查,防止props.selectedDeptObject为null
297
     const selectedDept = props.selectedDeptObject
297
     const selectedDept = props.selectedDeptObject
298
     const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
298
     const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
299
-
299
+    let progressParams = { ...queryParams }
300
+    if (progressParams.dateRangeQueryType === 'YEAR') {
301
+      progressParams.yearOnYear = true
302
+      delete progressParams.chainRatio
303
+    } else {
304
+      progressParams.chainRatio = true
305
+      progressParams.yearOnYear = true
306
+    }
300
     let rangParams = {
307
     let rangParams = {
301
       userId: deptType == 'USER' ? id : "",
308
       userId: deptType == 'USER' ? id : "",
302
-      deptId: ["STATION", "DEPARTMENT", "TEAMS", "BRIGADE"].includes(deptType) ? id : ""
309
+      deptId: ["STATION", "MANAGER", "TEAMS", "BRIGADE"].includes(deptType) ? id : ""
303
     }
310
     }
304
 
311
 
305
-    const response = await getAnalysisReport({ ...queryParams, ...rangParams })
312
+    const response = await getAnalysisReport({ ...progressParams, ...rangParams })
306
     console.log('质控分析数据:', response.data)
313
     console.log('质控分析数据:', response.data)
307
 
314
 
308
     // 解构赋值API返回的数据
315
     // 解构赋值API返回的数据

+ 1 - 1
src/views/assistant/components/riskHazard.vue

@@ -287,7 +287,7 @@ const isStationType = computed(() => {
287
 })
287
 })
288
 // 计算属性:检查是否为STATION类型
288
 // 计算属性:检查是否为STATION类型
289
 const isDepartmentType = computed(() => {
289
 const isDepartmentType = computed(() => {
290
-  return selectedDeptType.value === 'DEPARTMENT'
290
+  return selectedDeptType.value === 'MANAGER'
291
 })
291
 })
292
 
292
 
293
 const isBrigadeType = computed(() => {
293
 const isBrigadeType = computed(() => {