Przeglądaj źródła

Merge branch 'dev' into dev_zyh

zhouyuhao 1 rok temu
rodzic
commit
322a204a0d
2 zmienionych plików z 22 dodań i 23 usunięć
  1. 1 2
      src/auto-imports.d.ts
  2. 21 21
      src/views/Dashboard/src/DashboardView.vue

+ 1 - 2
src/auto-imports.d.ts

@@ -3,7 +3,6 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
-// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -69,6 +68,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 21 - 21
src/views/Dashboard/src/DashboardView.vue

@@ -124,16 +124,16 @@ const ETDobj = reactive({
 })
 const GetETDEcharts = () => {
   const currentDate = new Date()
-  let tenyear: any = 0
-  if (currentDate.getMonth() - 11 < 0) {
-    tenyear = currentDate.getFullYear() - 1
-  } else {
-    tenyear = currentDate.getFullYear()
+  let tenyear = currentDate.getFullYear()
+  let tenmonth = currentDate.getMonth() - 11
+  if (tenmonth < 0) {
+    tenyear -= 1
+    tenmonth += 11
   }
   $api
     .GetETDEcharts({
-      b_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-      e_date: currentDate.getMonth() + 3 + '/' + tenyear
+      e_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
+      b_date: tenmonth + '/' + tenyear
     })
     .then((res: any) => {
       if (res.code === 200) {
@@ -240,17 +240,17 @@ const containerObj = reactive({
 const containerType = ref([])
 const GetContainerCountEcharts = (val: any) => {
   const currentDate = new Date()
-  let tenyear: any = 0
-  if (currentDate.getMonth() - 11 < 0) {
-    tenyear = currentDate.getFullYear() - 1
-  } else {
-    tenyear = currentDate.getFullYear()
+  let tenyear = currentDate.getFullYear()
+  let tenmonth = currentDate.getMonth() - 11
+  if (tenmonth < 0) {
+    tenyear -= 1
+    tenmonth += 11
   }
   containerType.value = []
   $api
     .GetContainerCountEcharts({
-      b_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-      e_date: currentDate.getMonth() + 3 + '/' + tenyear,
+      e_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
+      b_date: tenmonth + '/' + tenyear,
       ...val
     })
     .then((res: any) => {
@@ -418,11 +418,11 @@ const seller_chart_CO2_origin = ref()
 const seller_chart_CO2_destination = ref()
 const ClickParams = (val: any) => {
   const currentDate = new Date()
-  let tenyear: any = 0
-  if (currentDate.getMonth() - 11 < 0) {
-    tenyear = currentDate.getFullYear() - 1
-  } else {
-    tenyear = currentDate.getFullYear()
+  let tenyear = currentDate.getFullYear()
+  let tenmonth = currentDate.getMonth() - 11
+  if (tenmonth < 0) {
+    tenyear -= 1
+    tenmonth += 11
   }
   const reportList: any = {}
   // ETD to ETA(DAYS)点击跳转
@@ -431,14 +431,14 @@ const ClickParams = (val: any) => {
       .ClickEtdToEta({
         _reportRef: pie_chart_ETD.value[0].paramsdata.name,
         _reportRefe_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-        _reportRefb_date: currentDate.getMonth() + 3 + '/' + tenyear
+        _reportRefb_date: tenmonth + '/' + tenyear
       })
       .then((res: any) => {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_ETD.value[0].paramsdata.name
           reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
           reportList._reportType = 'r1'
-          reportList._reportRefb_date = currentDate.getMonth() + 3 + '/' + tenyear
+          reportList._reportRefb_date = tenmonth + '/' + tenyear
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}