Ver código fonte

feat:修改revenue图表,修改transport提交数据

AmandaG 10 meses atrás
pai
commit
23eff43541

+ 34 - 17
src/components/TransportMode/src/TransportMode.vue

@@ -5,6 +5,7 @@ import emitter from '@/utils/bus'
 
 interface ListItem {
   name: string
+  sname: string
   number: number
   icon: string
   checked: boolean
@@ -98,7 +99,7 @@ const changedata = ref()
 //点击搜索
 const TransportData = {
   title: 'Transport Mode',
-  data: ''
+  data: ['']
 }
 const TransportSearch = (visible: any) => {
   TransportList.value.forEach((item: any) => {
@@ -110,9 +111,9 @@ const TransportSearch = (visible: any) => {
     }
   })
   if (checkedCount.length == TransportList.value.length) {
-    changedata.value = 'All'
+    changedata.value = ['All']
   } else {
-    changedata.value = checkedCount.join(', ')
+    changedata.value = checkedCount
   }
   TransportData.data = changedata.value
   emit('TransportSearch', TransportData)
@@ -133,15 +134,22 @@ const defaultTransport = () => {
     ) {
       if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
         checkAll.value = true
-        TransportData.data = 'All'
+        TransportData.data = ['All']
       } else {
         searchTableQeuryTracking.value =
           JSON.parse(sessionStorage.getItem('searchTableQeuryTracking') as string) || {}
-        if (searchTableQeuryTracking.value.transport_mode == 'All') {
-          checkAll.value = true
-          TransportData.data = 'All'
+        if (searchTableQeuryTracking.value.transport_mode.length !== 0) {
+          TransportData.data = searchTableQeuryTracking.value.transport_mode
+          searchTableQeuryTracking.value.transport_mode.forEach((item: any) => {
+            if (item == 'All') {
+              checkAll.value = true
+            } else {
+              checkAll.value = false
+            }
+          })
         } else {
-          TransportData.data = ''
+          TransportData.data = []
+          checkAll.value = false
         }
       }
       emit('defaultTransport', TransportData, searchTableQeuryTracking.value)
@@ -154,24 +162,33 @@ const defaultTransport = () => {
           title: 'Transport Mode',
           data: data.transport_mode
         }
-        if (data.transport_mode == 'All') {
-          checkAll.value = true
-        }
+        data.transport_mode.forEach((item: any) => {
+          if (item == 'All') {
+            checkAll.value = true
+          }
+        })
         emit('defaultTransport', obj, searchTableQeuryTracking.value)
       }
     }
   } else {
     if (sessionStorage.getItem('searchTableQeury') == null) {
       checkAll.value = true
-      TransportData.data = 'All'
+      TransportData.data = ['All']
     } else {
       searchTableQeury.value =
         JSON.parse(sessionStorage.getItem('searchTableQeury') as string) || {}
-      if (searchTableQeury.value.transport_mode == 'All') {
-        checkAll.value = true
-        TransportData.data = 'All'
+      if (searchTableQeury.value.transport_mode.length !== 0) {
+        TransportData.data = searchTableQeury.value.transport_mode
+        searchTableQeury.value.transport_mode.forEach((item: any) => {
+          if (item == 'All') {
+            checkAll.value = true
+          } else {
+            checkAll.value = false
+          }
+        })
       } else {
-        TransportData.data = ''
+        TransportData.data = []
+        checkAll.value = false
       }
     }
     emit('defaultTransport', TransportData, searchTableQeury.value)
@@ -212,7 +229,7 @@ const defaultTransport = () => {
                 :value="item.name"
                 v-model="item.checked"
                 class="checkbox"
-                @change="handleCheckedTransportChange(item.name, item.checked, index)"
+                @change="handleCheckedTransportChange(item.sname, item.checked)"
               >
                 <div class="checkbox_title">
                   <span class="iconfont_icon">

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

@@ -512,9 +512,9 @@ const ClickParams = (val: any) => {
   const reportList: any = {}
   const handlereportlist = (transportation: any, type: any, name: any) => {
     if (transportation.includes('All')) {
-      reportList.transport_mode = 'All'
+      reportList.transport_mode = ['All']
     } else {
-      reportList.transport_mode = dashboardObj.ETDDefaultData.transportation
+      reportList.transport_mode = transportation
     }
     if (name == 'Container') {
       if (type == 'ETA') {

+ 17 - 5
src/views/Dashboard/src/components/RevenueChart.vue

@@ -18,21 +18,29 @@ const bar_ref = ref()
 watch(
   () => bar_data.value,
   (current) => {
-    console.log(current)
     bar_data.value = current
     initOption.xAxis.data = barName.value
     initOption.series = bar_series.value
     initOption.legend.data = Name.value
     initOption.toolbox.feature.saveAsImage.name = downloadName.value
     initOption.toolbox.show = isShowTooltips.value
+    initChart()
+  },
+  {
+    deep: true
+  }
+)
+watch(
+  () => bar_data.value,
+  (current) => {
+    bar_data.value = current
     initOption.yAxis.max = Max.value
     initOption.yAxis.interval = interval.value
-    initOption.title.text = bar_title.value
     initChart()
   },
   {
-    deep: true
-    // once: true
+    deep: true,
+    once: true
   }
 )
 // 最大值
@@ -291,14 +299,18 @@ onMounted(() => {
     () => themeStore.theme,
     (newVal) => {
       if (newVal === 'dark') {
+        initOption.title.textStyle.color = '#f0f1f3'
+        initOption.xAxis.axisLine.lineStyle.color = '#3F434A'
         initOption.xAxis.axisLine.lineStyle.color = '#3F434A'
         initOption.yAxis.axisLine.lineStyle.color = '#3F434A'
-        initOption.yAxis.splitLine.lineStyle.color = '#3F434A'
+        initOption.legend.textStyle.color = 'rgba(240,241,243,0.7)'
         initChart()
       } else {
+        initOption.title.textStyle.color = '#2B2F36'
         initOption.xAxis.axisLine.lineStyle.color = '#eaebed'
         initOption.yAxis.axisLine.lineStyle.color = '#eaebed'
         initOption.yAxis.splitLine.lineStyle.color = '#eaebed'
+        initOption.legend.textStyle.color = '#646A73'
         initChart()
       }
     },