浏览代码

Merge branch 'dev' into dev_zyh

zhouyuhao 11 月之前
父节点
当前提交
d506962e03

+ 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')
 }

+ 1 - 1
src/views/Booking/src/BookingView.vue

@@ -395,7 +395,7 @@ const SearchInput = () => {
     <div class="heaer_top">
       <div class="search">
         <el-input
-          placeholder="Search booking No./HBL No./PO No./Carrier Booking No."
+          placeholder="Enter Booking/HBL/PO/Container/Carrier Booking No. "
           v-model="BookingSearch"
         >
           <template #prefix>

+ 31 - 8
src/views/Dashboard/src/components/BarChart.vue

@@ -14,23 +14,22 @@ const props = defineProps({
 const bar_data = ref(props.BarData)
 const bar_ref = ref()
 watch(
-  () => props.BarData,
+  () => bar_data.value,
   (current) => {
     bar_data.value = current
     initOption.xAxis.data = barName.value
     initOption.series = bar_series.value
     initOption.legend.data = Name.value
-    initOption.yAxis.max = Max.value
-    initOption.yAxis.interval = interval.value
     initOption.toolbox.feature.saveAsImage.name = downloadName.value
     initOption.toolbox.show = isShowTooltips.value
+    initOption.yAxis.max = Max.value
+    initOption.yAxis.interval = interval.value
+    initOption.title.text = bar_title.value
     initChart()
-    if (props.isRevenue) {
-      initOption.title.text = bar_title.value
-    }
   },
   {
-    deep: true
+    deep: true,
+    once: true
   }
 )
 // 最大值
@@ -221,6 +220,7 @@ const initOption = reactive({
   },
   yAxis: {
     type: 'value',
+    scale: true,
     splitLine: {
       show: true,
       lineStyle: {
@@ -306,10 +306,11 @@ const initChart = () => {
   window.addEventListener('resize', () => {
     bar_chart.resize()
   })
-  bar_chart.on('legendselectchanged', function (event) {
+  bar_chart.on('legendselectchanged', function (event: any) {
     const selected = event.selected
     let trueCount = 0
     let trueObj: any = {}
+    let truearr: any = []
     for (var key in selected) {
       if (selected[key]) {
         trueCount++
@@ -329,6 +330,28 @@ const initChart = () => {
         initOption.title.text = `Total: `
       })
     }
+    if (trueCount != 0) {
+      initOption.series.forEach((item: any) => {
+        if (Object.keys(trueObj).includes(item.name)) {
+          truearr.push(item)
+        }
+      })
+      const max = Math.max.apply(
+        Math,
+        truearr.map((ele: any) => {
+          return ele.Max
+        })
+      )
+      const interval = Math.max.apply(
+        Math,
+        truearr.map((ele: any) => {
+          return ele.interval
+        })
+      )
+      initOption.yAxis.max = max
+      initOption.yAxis.interval = interval
+    }
+    bar_chart.setOption(initOption)
   })
   bar_chart.setOption(initOption)
 }

+ 1 - 1
src/views/Tracking/src/TrackingView.vue

@@ -643,7 +643,7 @@ const SearchInput = () => {
     <div class="heaer_top">
       <div class="search">
         <el-input
-          placeholder="Search booking No./HBL No./PO No./Carrier Booking No."
+          placeholder="Enter Booking/HBL/PO/Container/Carrier Booking No. "
           v-model="TrackingSearch"
         >
           <template #prefix>