Selaa lähdekoodia

Merge branch 'dev' into dev_zyh

zhouyuhao 1 vuosi sitten
vanhempi
commit
8cf03a91a8

+ 12 - 0
src/api/module/common.ts

@@ -336,3 +336,15 @@ export const scoringgrade = (params: any, config: any) => {
     config
   )
 }
+/**
+ * 获取首页筛选条件
+ */
+export const getDashboardFilters = (config: any) => {
+  return HttpAxios.get(
+    `${baseUrl}`,
+    {
+      action: 'main_filter',
+    },
+    config
+  )
+}

+ 15 - 0
src/components/DateRange/src/DateRange.vue

@@ -129,6 +129,21 @@ const defaultDate = () => {
         }
       }
       emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
+    } else {
+      const data = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+      searchTableQeuryTracking.value =
+        JSON.parse(sessionStorage.getItem('searchTableQeuryTracking') as string) || {}
+      if (data.eta_start) {
+        DateEnd.value = [dayjs(data.eta_start), dayjs(data.eta_end)]
+        daterangeObj.ETA =
+          DateEnd.value[0].format('MMM/DD/YYYY') + ' To ' + DateEnd.value[1].format('MMM/DD/YYYY')
+        const obj = {
+          title: 'ETA',
+          data: [DateEnd.value[0].format('MM/DD/YYYY'), DateEnd.value[1].format('MM/DD/YYYY')]
+        }
+        daterangeObj2.ETA = obj
+        emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
+      }
     }
   } else {
     if (sessionStorage.getItem('searchTableQeury') == null) {

+ 12 - 7
src/components/DateRange/src/components/CalendarDate.vue

@@ -44,33 +44,34 @@ const ChangeToday = (val: any) => {
   if (val == 'Earliest') {
     // ETDDate.value = [dayjs(), dayjs()]
     ETDDate.value[0] = dayjs()
-    open.value = false
     const date1 = moment(String(ETDDate.value[0])).format('MM/DD/YYYY')
     DateList.value[0] = date1
     daterange(DateList.value[1])
   } else {
     ETDDate.value[1] = dayjs()
-    open.value = false
     const date1 = moment(String(ETDDate.value[1])).format('MM/DD/YYYY')
-    open.value = false
     DateList.value[1] = date1
     daterange(DateList.value[0])
   }
 }
-const handleCalendarOpen = () => {
+const handleCalendarOpen = (date: any) => {
   open.value = !open.value
+  if (open.value == false) {
+    if (date.length != 2) {
+      DateList.value = []
+      ETDDate.value = []
+    }
+  }
 }
 const Earliest = () => {
   ETDDate.value[0] = dayjs('Oct-05-2009')
   const date1 = moment(String(ETDDate.value[0])).format('MM/DD/YYYY')
   DateList.value[0] = date1
   daterange(DateList.value[1])
-  open.value = false
 }
 const Latest = () => {
   ETDDate.value[1] = dayjs()
   const date1 = moment(String(ETDDate.value[1])).format('MM/DD/YYYY')
-  open.value = false
   DateList.value[1] = date1
   daterange(DateList.value[0])
 }
@@ -92,6 +93,10 @@ const handlePanelChange = (value: any, mode: any) => {
     isShowExtra.value = true
   }
 }
+// 判断失焦时是否两个都有值
+const isTwoDate = (date: any) => {
+  console.log(date)
+}
 </script>
 <template>
   <div>
@@ -106,7 +111,7 @@ const handlePanelChange = (value: any, mode: any) => {
       :placeholder="['Start Time', 'End Time']"
       format="MMM-DD-YYYY"
       valueFormat="MM/DD/YYYY"
-      @openChange="handleCalendarOpen"
+      @openChange="handleCalendarOpen(ETDDate)"
       @panelChange="handlePanelChange"
       v-model:value="ETDDate"
     >

+ 1 - 1
src/components/MoreFilters/src/MoreFilters.vue

@@ -25,7 +25,7 @@ onMounted(() => {
       } else {
         InputForm.value.palces.Destination.push(reportlist._city_name)
         MoreFiltersObj.Destination = reportlist._city_name
-        MoreFiltersObj2.Destination = InputForm.value.palces.Origin
+        MoreFiltersObj2.Destination = InputForm.value.palces.Destination
       }
     }
   }

+ 6 - 5
src/views/Booking/src/components/BookingTable/src/BookingTable.vue

@@ -124,15 +124,16 @@ const assignTableData = (data: any) => {
   }, 1000)
 }
 // 获取表格数据
-const getTableData = () => {
+const getTableData = async (isPageChange?: boolean) => {
+  const rc = isPageChange ? pageInfo.value.total : -1
   // 保存页长以及当前页码
   sessionStorage.setItem('bookingTablePageInfo', JSON.stringify(pageInfo.value))
   tableLoadingTable.value = true
-  $api
+  await $api
     .getBookingTableData({
       cp: pageInfo.value.pageNo,
       ps: pageInfo.value.pageSize,
-      rc: -1,
+      rc,
       other_filed: '',
       ...filterdataobj.value
     })
@@ -495,8 +496,8 @@ defineExpose({
           background
           layout="sizes, prev, pager, next"
           :total="pageInfo.total"
-          @size-change="getTableData"
-          @current-change="getTableData"
+          @size-change="getTableData(true)"
+          @current-change="getTableData(true)"
         />
       </div>
     </div>

+ 140 - 55
src/views/Dashboard/src/DashboardView.vue

@@ -62,29 +62,42 @@ const handleTabClick = (tab: any) => {
     isShowtitle1.value = false
   }
 }
-const DashDate = ref([dayjs().startOf('month'), dayjs().endOf('month')])
+const DashDate = ref()
 // 获取首页数据
-let dashboardObj: any = {
-  date_start: DashDate.value[0].format('MM/DD/YYYY'),
-  date_end: DashDate.value[1].format('MM/DD/YYYY'),
-  date_type: changeCheckboxGroup2.value
-}
+let dashboardObj: any = {}
 const GetDashboardData = (value: any, is_default: any) => {
   $api
-    .GetDashboardData({
-      cp: pageInfo.value.pageNo,
-      ps: pageInfo.value.pageSize,
-      rc: -1,
-      is_default: is_default,
-      ...value
-    })
+    .getDashboardFilters({})
     .then((res: any) => {
-      if (res.code === 200) {
-        pageInfo.value.total = Number(res.data.rc)
-        Management.value = res.data.Management
-        RecentStatusList.value = res.data.searchData
+      if (res.code == 200) {
+        DashDate.value = [dayjs(res.data.date_start), dayjs(res.data.date_end)]
+        BookingSearch.value = res.data.customer
+        changeCheckboxGroup2.value = res.data.date_type
+        dashboardObj.date_start = DashDate.value[0].format('MM/DD/YYYY')
+        dashboardObj.date_end = DashDate.value[1].format('MM/DD/YYYY')
+        dashboardObj.date_type = changeCheckboxGroup2.value
+        dashboardObj.customer = BookingSearch.value
       }
     })
+    .finally(() => {
+      nextTick(() => {
+        $api
+          .GetDashboardData({
+            cp: pageInfo.value.pageNo,
+            ps: pageInfo.value.pageSize,
+            rc: -1,
+            is_default: is_default,
+            ...value
+          })
+          .then((res: any) => {
+            if (res.code === 200) {
+              pageInfo.value.total = Number(res.data.rc)
+              Management.value = res.data.Management
+              RecentStatusList.value = res.data.searchData
+            }
+          })
+      })
+    })
 }
 // 获取表单数据
 const getTableData = () => {
@@ -122,18 +135,25 @@ const ETDobj = reactive({
   ETD_Radius: [],
   download_name: ''
 })
+const ETDLoading = ref(false)
 const GetETDEcharts = () => {
   const currentDate = new Date()
   let tenyear = currentDate.getFullYear()
   let tenmonth = currentDate.getMonth() - 11
+  let month = currentDate.getMonth() + 1
   if (tenmonth < 0) {
     tenyear -= 1
     tenmonth += 11
   }
   $api
     .GetETDEcharts({
-      e_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-      b_date: tenmonth + '/' + tenyear
+      e_date:
+        currentDate.getFullYear() +
+        '-' +
+        month +
+        '-' +
+        new Date(currentDate.getFullYear(), month, 0).getDate(),
+      b_date: tenyear + '-' + tenmonth + '-01'
     })
     .then((res: any) => {
       if (res.code === 200) {
@@ -143,6 +163,9 @@ const GetETDEcharts = () => {
         ETDobj.download_name = res.data.download_name
       }
     })
+    .finally(() => {
+      ETDLoading.value = true
+    })
 }
 // 获取KPI Departure图表数据
 const KPIobj = reactive({
@@ -151,6 +174,7 @@ const KPIobj = reactive({
   ETD_Radius: [],
   download_name: ''
 })
+const KPILoading = ref(false)
 const GetKPIEcharts = () => {
   $api
     .GetKPIEcharts({
@@ -164,6 +188,9 @@ const GetKPIEcharts = () => {
         KPIobj.download_name = res.data.download_name
       }
     })
+    .finally(() => {
+      KPILoading.value = true
+    })
 }
 // 获取KPI Arrival图表数据
 const Arrivalobj = reactive({
@@ -172,6 +199,7 @@ const Arrivalobj = reactive({
   ETD_Radius: [],
   download_name: ''
 })
+const KPIArrivalLoading = ref(false)
 const GetKPIArrivalEcharts = () => {
   $api
     .GetKPIEcharts({
@@ -185,6 +213,9 @@ const GetKPIArrivalEcharts = () => {
         Arrivalobj.download_name = res.data.download_name
       }
     })
+    .finally(() => {
+      KPIArrivalLoading.value = true
+    })
 }
 // 获取Pending Departure图表数据
 const Pendingobj = reactive({
@@ -193,6 +224,7 @@ const Pendingobj = reactive({
   ETD_Radius: [],
   download_name: ''
 })
+const PendingLoading = ref(false)
 const GetPendingEcharts = () => {
   $api
     .GetPendingEcharts({
@@ -206,6 +238,9 @@ const GetPendingEcharts = () => {
         Pendingobj.download_name = res.data.download_name
       }
     })
+    .finally(() => {
+      PendingLoading.value = true
+    })
 }
 // 获取Pending Arrival图表数据
 const PendingArrivalobj = reactive({
@@ -214,6 +249,7 @@ const PendingArrivalobj = reactive({
   ETD_Radius: [],
   download_name: ''
 })
+const PendingArrivalLoading = ref(false)
 const GetPendingArrivalEcharts = () => {
   $api
     .GetPendingEcharts({
@@ -227,6 +263,9 @@ const GetPendingArrivalEcharts = () => {
         PendingArrivalobj.download_name = res.data.download_name
       }
     })
+    .finally(() => {
+      PendingArrivalLoading.value = true
+    })
 }
 // 获取ContainerCount
 const containerObj = reactive({
@@ -238,10 +277,12 @@ const containerObj = reactive({
   download_name: ''
 })
 const containerType = ref([])
+const containerLoading = ref(false)
 const GetContainerCountEcharts = (val: any) => {
   const currentDate = new Date()
   let tenyear = currentDate.getFullYear()
   let tenmonth = currentDate.getMonth() - 11
+  let month = currentDate.getMonth() + 1
   if (tenmonth < 0) {
     tenyear -= 1
     tenmonth += 11
@@ -249,8 +290,13 @@ const GetContainerCountEcharts = (val: any) => {
   containerType.value = []
   $api
     .GetContainerCountEcharts({
-      e_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-      b_date: tenmonth + '/' + tenyear,
+      e_date:
+        currentDate.getFullYear() +
+        '-' +
+        month +
+        '-' +
+        new Date(currentDate.getFullYear(), month, 0).getDate(),
+      b_date: tenyear + '-' + tenmonth + '-01',
       ...val
     })
     .then((res: any) => {
@@ -267,8 +313,12 @@ const GetContainerCountEcharts = (val: any) => {
         containerType.value.push('All')
       }
     })
+    .finally(() => {
+      containerLoading.value = true
+    })
 }
 //获取CO2 Origin
+const EmissionLoading = ref(false)
 const EmissionObj = reactive({
   bar_title: '',
   barList: [],
@@ -278,16 +328,21 @@ const EmissionObj = reactive({
   download_name: ''
 })
 const GetCo2EmissionEcharts = () => {
-  $api.GetCo2EmissionEcharts({}).then((res: any) => {
-    if (res.code === 200) {
-      EmissionObj.bar_title = res.data.ContainerCount_Title
-      EmissionObj.barList = res.data.ContainerCountList
-      EmissionObj.barSeries = res.data.ContainerCounSeries
-      EmissionObj.Max = res.data.Max
-      EmissionObj.interval = res.data.interval
-      EmissionObj.download_name = res.data.download_name
-    }
-  })
+  $api
+    .GetCo2EmissionEcharts({})
+    .then((res: any) => {
+      if (res.code === 200) {
+        EmissionObj.bar_title = res.data.ContainerCount_Title
+        EmissionObj.barList = res.data.ContainerCountList
+        EmissionObj.barSeries = res.data.ContainerCounSeries
+        EmissionObj.Max = res.data.Max
+        EmissionObj.interval = res.data.interval
+        EmissionObj.download_name = res.data.download_name
+      }
+    })
+    .finally(() => {
+      EmissionLoading.value = true
+    })
 }
 //获取CO2 Destination
 const DestinationObj = reactive({
@@ -298,17 +353,23 @@ const DestinationObj = reactive({
   interval: 0,
   download_name: ''
 })
+const DestinationLoading = ref(false)
 const GetCo2DestinationEcharts = () => {
-  $api.GetCo2DestinationEcharts({}).then((res: any) => {
-    if (res.code === 200) {
-      DestinationObj.bar_title = res.data.ContainerCount_Title
-      DestinationObj.barList = res.data.ContainerCountList
-      DestinationObj.barSeries = res.data.ContainerCounSeries
-      DestinationObj.Max = res.data.Max
-      DestinationObj.interval = res.data.interval
-      DestinationObj.download_name = res.data.download_name
-    }
-  })
+  $api
+    .GetCo2DestinationEcharts({})
+    .then((res: any) => {
+      if (res.code === 200) {
+        DestinationObj.bar_title = res.data.ContainerCount_Title
+        DestinationObj.barList = res.data.ContainerCountList
+        DestinationObj.barSeries = res.data.ContainerCounSeries
+        DestinationObj.Max = res.data.Max
+        DestinationObj.interval = res.data.interval
+        DestinationObj.download_name = res.data.download_name
+      }
+    })
+    .finally(() => {
+      DestinationLoading.value = true
+    })
 }
 const topdestinationinType = ref()
 const toporiginType = ref()
@@ -325,19 +386,25 @@ const Top1OInterval_dest = reactive({
   Max: 0,
   interval: 0
 })
+const TopOriginLoading = ref(false)
 const GetTop10ODEcharts = () => {
-  $api.GetTop10ODEcharts({}).then((res: any) => {
-    if (res.code === 200) {
-      Top10Obj.DestinationData = res.data.seller_data_list_destination
-      Top10Obj.OriginData = res.data.seller_data_list_origin
-      Top1OInterval.Max = res.data.Max
-      Top1OInterval.interval = res.data.interval
-      Top1OInterval_dest.Max = res.data.dest_Max
-      Top1OInterval_dest.interval = res.data.dest_interval
-      topdestinationinType.value = res.data.topdestinationinType
-      toporiginType.value = res.data.toporiginType
-    }
-  })
+  $api
+    .GetTop10ODEcharts({})
+    .then((res: any) => {
+      if (res.code === 200) {
+        Top10Obj.DestinationData = res.data.seller_data_list_destination
+        Top10Obj.OriginData = res.data.seller_data_list_origin
+        Top1OInterval.Max = res.data.Max
+        Top1OInterval.interval = res.data.interval
+        Top1OInterval_dest.Max = res.data.dest_Max
+        Top1OInterval_dest.interval = res.data.dest_interval
+        topdestinationinType.value = res.data.topdestinationinType
+        toporiginType.value = res.data.toporiginType
+      }
+    })
+    .finally(() => {
+      TopOriginLoading.value = true
+    })
 }
 onMounted(() => {
   GetDashboardData(dashboardObj, 'yes')
@@ -420,6 +487,7 @@ const ClickParams = (val: any) => {
   const currentDate = new Date()
   let tenyear = currentDate.getFullYear()
   let tenmonth = currentDate.getMonth() - 11
+  let month = currentDate.getMonth() + 1
   if (tenmonth < 0) {
     tenyear -= 1
     tenmonth += 11
@@ -439,6 +507,13 @@ const ClickParams = (val: any) => {
           reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
           reportList._reportType = 'r1'
           reportList._reportRefb_date = tenmonth + '/' + tenyear
+          reportList.eta_start = tenyear + '-' + tenmonth + '-01'
+          reportList.eta_end =
+            currentDate.getFullYear() +
+            '-' +
+            month +
+            '-' +
+            new Date(currentDate.getFullYear(), month, 0).getDate()
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
@@ -452,7 +527,7 @@ const ClickParams = (val: any) => {
       })
   }
   //  PendingArrival点击跳转
-  else if (val == 'Pending Departure & Arrival1') {
+  else if (val == 'Pending1') {
     $api
       .ClickPendingArrival({
         _reportRef: pie_chart_pending_arrival.value[0].paramsdata.name
@@ -474,7 +549,7 @@ const ClickParams = (val: any) => {
       })
   }
   // PendingDeparture点击跳转
-  else if (val == 'Pending Departure & Arrival0') {
+  else if (val == 'Pending0') {
     $api
       .ClickPendingDeparture({
         _reportRef: pie_chart_pending_departure.value[0].paramsdata.name
@@ -813,6 +888,7 @@ const ClickParams = (val: any) => {
                       ref="pie_chart_kpi_departure"
                       @ClickParams="ClickParams(item.title + '0')"
                       :PieData="KPIobj"
+                      :isLoading="KPILoading"
                       style="height: 300px"
                     ></PieChart>
                   </div>
@@ -820,6 +896,7 @@ const ClickParams = (val: any) => {
                     <PieChart
                       ref="pie_chart_kpi_arrival"
                       :PieData="Arrivalobj"
+                      :isLoading="KPIArrivalLoading"
                       @ClickParams="ClickParams(item.title + '1')"
                       style="height: 300px"
                     ></PieChart>
@@ -849,6 +926,7 @@ const ClickParams = (val: any) => {
                     <PieChart
                       ref="pie_chart_pending_departure"
                       :PieData="Pendingobj"
+                      :isLoading="PendingLoading"
                       @ClickParams="ClickParams(item.title + '0')"
                       style="height: 300px"
                     ></PieChart>
@@ -858,6 +936,7 @@ const ClickParams = (val: any) => {
                       ref="pie_chart_pending_arrival"
                       @ClickParams="ClickParams(item.title + '1')"
                       :PieData="PendingArrivalobj"
+                      :isLoading="PendingArrivalLoading"
                       style="height: 300px"
                     ></PieChart>
                   </div>
@@ -936,6 +1015,7 @@ const ClickParams = (val: any) => {
                   ref="pie_chart_ETD"
                   @ClickParams="ClickParams(item.title)"
                   :PieData="ETDobj"
+                  :isLoading="ETDLoading"
                   style="height: 300px"
                 ></PieChart>
               </template>
@@ -986,6 +1066,7 @@ const ClickParams = (val: any) => {
                 <BarChart
                   ref="seller_chart_Container_count"
                   :BarData="containerObj"
+                  :isLoading="containerLoading"
                   style="height: 300px"
                   :barHeight="{ height: '300px' }"
                 ></BarChart>
@@ -1030,6 +1111,7 @@ const ClickParams = (val: any) => {
                       ref="seller_chart_top10_origin"
                       @clickParams="ClickParams(item.title1)"
                       :SellerData="Top10Obj.OriginData"
+                      :isLoading="TopOriginLoading"
                       :Interval="Top1OInterval"
                     ></SellerChart>
                   </div>
@@ -1046,6 +1128,7 @@ const ClickParams = (val: any) => {
                       @clickParams="ClickParams(item.title2)"
                       :SellerData="Top10Obj.DestinationData"
                       :Interval="Top1OInterval_dest"
+                      :isLoading="TopOriginLoading"
                       style="height: 272px"
                     ></SellerChart>
                   </div>
@@ -1084,6 +1167,7 @@ const ClickParams = (val: any) => {
                   ref="seller_chart_CO2_origin"
                   :BarData="EmissionObj"
                   @clickParams="ClickParams(item.title)"
+                  :isLoading="EmissionLoading"
                   style="height: 250px"
                   :barHeight="{ height: '250px' }"
                 ></BarChart>
@@ -1117,6 +1201,7 @@ const ClickParams = (val: any) => {
                 <BarChart
                   ref="seller_chart_CO2_destination"
                   :BarData="DestinationObj"
+                  :isLoading="DestinationLoading"
                   style="height: 250px"
                   @clickParams="ClickParams(item.title)"
                   :barHeight="{ height: '250px' }"

+ 28 - 6
src/views/Dashboard/src/components/BarChart.vue

@@ -4,9 +4,11 @@ import * as echarts from 'echarts'
 import { onMounted, ref, reactive, watch, computed } from 'vue'
 const props = defineProps({
   BarData: Object,
-  barHeight: Object
+  barHeight: Object,
+  isLoading: Boolean
 })
 const bar_data = ref(props.BarData)
+const bar_loading = ref(props.isLoading)
 const bar_ref = ref()
 watch(
   () => props.BarData,
@@ -25,6 +27,16 @@ watch(
     deep: true
   }
 )
+watch(
+  () => props.isLoading,
+  (current) => {
+    bar_loading.value = current
+    initChart()
+  },
+  {
+    deep: true
+  }
+)
 // 最大值
 const Max = computed(() => {
   return bar_data.value?.Max
@@ -181,7 +193,7 @@ const initOption = reactive({
         borderColor: '#ff7500'
       } // hover上去时的颜色
     },
-    show: true, // 显示工具箱
+    show: false, // 显示工具箱
     feature: {
       restore: { show: true },
       saveAsImage: { show: true, name: downloadName.value }
@@ -210,11 +222,21 @@ const clickParams = () => {
 }
 const initChart = () => {
   const bar_chart = echarts.init(bar_ref.value)
-  bar_chart.setOption(initOption)
-  //图表响应式
-  window.addEventListener('resize', () => {
-    bar_chart.resize()
+  bar_chart.showLoading({
+    text: 'Loading',
+    color: '#ed6d00',
+    textColor: '#ed6d00',
+    maskColor: 'rgba(0,0,0,0.1)',
+    zlevel: 0
   })
+  if (bar_loading.value) {
+    bar_chart.hideLoading()
+    bar_chart.setOption(initOption)
+    //图表响应式
+    window.addEventListener('resize', () => {
+      bar_chart.resize()
+    })
+  }
 }
 defineExpose({
   paramsdata

+ 28 - 6
src/views/Dashboard/src/components/PieChart.vue

@@ -3,9 +3,11 @@
 import * as echarts from 'echarts'
 import { onMounted, ref, reactive, watch, computed } from 'vue'
 const props = defineProps({
-  PieData: Object
+  PieData: Object,
+  isLoading: Boolean
 })
 const pie_data = ref(props.PieData)
+const pie_loading = ref(props.isLoading)
 watch(
   () => props.PieData,
   (current) => {
@@ -18,6 +20,16 @@ watch(
     deep: true
   }
 )
+watch(
+  () => props.isLoading,
+  (current) => {
+    pie_loading.value = current
+    initChart()
+  },
+  {
+    deep: true
+  }
+)
 const pie_ref = ref()
 
 // legend
@@ -95,7 +107,7 @@ const initOption: any = reactive({
         borderColor: '#ff7500'
       } // hover上去时的颜色
     },
-    show: true, // 显示工具箱
+    show: false, // 显示工具箱
     feature: {
       restore: { show: true },
       saveAsImage: { show: true, name: downloadName.value }
@@ -177,11 +189,21 @@ const clickParams = () => {
 }
 const initChart = () => {
   const pie_chart = echarts.init(pie_ref.value)
-  pie_chart.setOption(initOption)
-  //图表响应式
-  window.addEventListener('resize', () => {
-    pie_chart.resize()
+  pie_chart.showLoading({
+    text: 'Loading',
+    color: '#ed6d00',
+    textColor: '#ed6d00',
+    maskColor: 'rgba(0,0,0,0.1)',
+    zlevel: 0
   })
+  if (pie_loading.value) {
+    pie_chart.hideLoading()
+    pie_chart.setOption(initOption)
+    //图表响应式
+    window.addEventListener('resize', () => {
+      pie_chart.resize()
+    })
+  }
 }
 defineExpose({
   paramsdata

+ 27 - 4
src/views/Dashboard/src/components/SellerChart.vue

@@ -4,10 +4,12 @@ import * as echarts from 'echarts'
 import { onMounted, ref, reactive, watch, computed } from 'vue'
 const props = defineProps({
   SellerData: Array,
-  Interval: Object
+  Interval: Object,
+  isLoading: Boolean
 })
 const seller_data = ref(props.SellerData)
 const seller_interval = ref(props.Interval)
+const seller_loading = ref(props.isLoading)
 const seller_ref = ref()
 watch(
   () => props.SellerData,
@@ -31,6 +33,16 @@ watch(
     deep: true
   }
 )
+watch(
+  () => props.isLoading,
+  (current) => {
+    seller_loading.value = current
+    initChart()
+  },
+  {
+    deep: true
+  }
+)
 // 最大值
 const Max = computed(() => {
   return seller_interval.value?.Max
@@ -180,11 +192,22 @@ const initChart = () => {
     return a.value - b.value // 从大到小排序
   })
   const seller_chart = echarts.init(seller_ref.value)
-  seller_chart.setOption(initOption)
   //图表响应式
-  window.addEventListener('resize', () => {
-    seller_chart.resize()
+  seller_chart.showLoading({
+    text: 'Loading',
+    color: '#ed6d00',
+    textColor: '#ed6d00',
+    maskColor: 'rgba(0,0,0,0.1)',
+    zlevel: 0
   })
+  if (seller_loading.value) {
+    seller_chart.hideLoading()
+    seller_chart.setOption(initOption)
+    //图表响应式
+    window.addEventListener('resize', () => {
+      seller_chart.resize()
+    })
+  }
 }
 defineExpose({
   paramsdata,

+ 7 - 6
src/views/OperationLog/src/components/BookingTable/src/BookingTable.vue

@@ -19,7 +19,8 @@ const handleColumns = (columns: any, status?: string) => {
     let curColumn: any = {
       title: item.title,
       field: item.field,
-      sortable: true
+      sortable: true,
+      minWidth: 120
     }
     // 设置插槽
     if (item.type === 'status' && status !== 'all') {
@@ -73,7 +74,7 @@ const getTableColumns = async () => {
     }
   })
   nextTick(() => {
-    tableRef.value && autoWidth(bookingTable.value, tableRef.value)
+    // tableRef.value && autoWidth(bookingTable.value, tableRef.value)
     tableLoadingColumn.value = false
     selectedNumber.value = 0
     selectedTableData.value = []
@@ -93,7 +94,7 @@ const assignTableData = (data: any) => {
     allTable.value.data = data.searchData || []
     // 为了让导出的表格列宽度自适应
     nextTick(() => {
-      allTableRef.value && autoWidth(allTable.value, allTableRef.value)
+      // allTableRef.value && autoWidth(allTable.value, allTableRef.value)
     })
   }, 1000)
 }
@@ -119,7 +120,7 @@ const getTableData = async (isPageChange?: boolean) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        tableRef.value && autoWidth(bookingTable.value, tableRef.value)
+        // tableRef.value && autoWidth(bookingTable.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
@@ -143,7 +144,7 @@ const SearchOperationLog = (val: any) => {
       selectedNumber.value = 0
       selectedTableData.value = []
       nextTick(() => {
-        tableRef.value && autoWidth(bookingTable.value, tableRef.value)
+        // tableRef.value && autoWidth(bookingTable.value, tableRef.value)
         tableLoadingTableData.value = false
       })
     })
@@ -151,7 +152,7 @@ const SearchOperationLog = (val: any) => {
 onMounted(() => {
   Promise.all([getTableColumns(), getTableData()]).finally(() => {
     nextTick(() => {
-      tableRef.value && autoWidth(bookingTable.value, tableRef.value)
+      // tableRef.value && autoWidth(bookingTable.value, tableRef.value)
     })
   })
 })

+ 5 - 0
src/views/Tracking/src/TrackingView.vue

@@ -156,6 +156,11 @@ const defaultDate = (val: any, value: any, data: any) => {
         searchTableQeuryTracking.etd_start = value[key].data[0]
         searchTableQeuryTracking.etd_end = value[key].data[1]
       }
+    } else {
+      for (const key in value) {
+        searchTableQeuryTracking.etd_start = value[key].data[0]
+        searchTableQeuryTracking.etd_end = value[key].data[1]
+      }
     }
   } else {
     searchTableQeuryTracking = data

+ 53 - 32
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -164,41 +164,62 @@ const getTableData = async (isPageChange?: boolean) => {
   sessionStorage.setItem('trackingTablePageInfo', JSON.stringify(pageInfo.value))
   tableLoadingTable.value = true
   const rc = isPageChange ? pageInfo.value.total : -1
-  if (
-    sessionStorage.getItem('clickParams') != null &&
-    sessionStorage.getItem('clickParams') != '{}'
-  ) {
-    const data = JSON.parse(sessionStorage.getItem('clickParams') as string) || {}
-    assignTableData(data)
-    nextTick(() => {
-      tableRef.value && autoWidth(trackingTable.value, tableRef.value)
-      tableLoadingTable.value = false
+  await $api
+    .getTrackingTableData({
+      cp: pageInfo.value.pageNo,
+      ps: pageInfo.value.pageSize,
+      rc,
+      other_filed: '',
+      ...filterdataobj.value
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        assignTableData(res.data)
+      }
+    })
+    .finally(() => {
+      nextTick(() => {
+        tableRef.value && autoWidth(trackingTable.value, tableRef.value)
+        tableLoadingTable.value = false
+      })
       selectedNumber.value = 0
       selectedTableData.value = []
     })
-  } else {
-    await $api
-      .getTrackingTableData({
-        cp: pageInfo.value.pageNo,
-        ps: pageInfo.value.pageSize,
-        rc,
-        other_filed: '',
-        ...filterdataobj.value
-      })
-      .then((res: any) => {
-        if (res.code === 200) {
-          assignTableData(res.data)
-        }
-      })
-      .finally(() => {
-        nextTick(() => {
-          tableRef.value && autoWidth(trackingTable.value, tableRef.value)
-          tableLoadingTable.value = false
-        })
-        selectedNumber.value = 0
-        selectedTableData.value = []
-      })
-  }
+  // if (
+  //   sessionStorage.getItem('clickParams') != null &&
+  //   sessionStorage.getItem('clickParams') != '{}'
+  // ) {
+  //   const data = JSON.parse(sessionStorage.getItem('clickParams') as string) || {}
+  //   assignTableData(data)
+  //   nextTick(() => {
+  //     tableRef.value && autoWidth(trackingTable.value, tableRef.value)
+  //     tableLoadingTable.value = false
+  //     selectedNumber.value = 0
+  //     selectedTableData.value = []
+  //   })
+  // } else {
+  //   await $api
+  //     .getTrackingTableData({
+  //       cp: pageInfo.value.pageNo,
+  //       ps: pageInfo.value.pageSize,
+  //       rc,
+  //       other_filed: '',
+  //       ...filterdataobj.value
+  //     })
+  //     .then((res: any) => {
+  //       if (res.code === 200) {
+  //         assignTableData(res.data)
+  //       }
+  //     })
+  //     .finally(() => {
+  //       nextTick(() => {
+  //         tableRef.value && autoWidth(trackingTable.value, tableRef.value)
+  //         tableLoadingTable.value = false
+  //       })
+  //       selectedNumber.value = 0
+  //       selectedTableData.value = []
+  //     })
+  // }
 }
 
 // 查询列表数据