瀏覽代碼

feat:修改跳转的数据回显

AmandaG 1 年之前
父節點
當前提交
cacef146c4

+ 16 - 2
src/components/DateRange/src/DateRange.vue

@@ -68,7 +68,7 @@ const defaultDate = () => {
       sessionStorage.getItem('clickParams') == '{}'
       sessionStorage.getItem('clickParams') == '{}'
     ) {
     ) {
       if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
       if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
-        DateStart.value = [dayjs().subtract(1, 'month').startOf('month'), dayjs()]
+        DateStart.value = [dayjs().subtract(2, 'month').startOf('month'), dayjs().add(1, 'month')]
         daterangeObj.ETD =
         daterangeObj.ETD =
           DateStart.value[0].format('MMM/DD/YYYY') +
           DateStart.value[0].format('MMM/DD/YYYY') +
           ' To ' +
           ' To ' +
@@ -144,10 +144,24 @@ const defaultDate = () => {
         daterangeObj2.ETA = obj
         daterangeObj2.ETA = obj
         emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
         emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
       }
       }
+
+      if (data.etd_start) {
+        DateStart.value = [dayjs(data.etd_start), dayjs(data.etd_end)]
+        daterangeObj.ETD =
+          DateStart.value[0].format('MMM/DD/YYYY') +
+          ' To ' +
+          DateStart.value[1].format('MMM/DD/YYYY')
+        const obj = {
+          title: 'ETD',
+          data: [DateStart.value[0].format('MM/DD/YYYY'), DateStart.value[1].format('MM/DD/YYYY')]
+        }
+        daterangeObj2.ETA = obj
+        emit('defaultDate', daterangeObj, daterangeObj2, searchTableQeuryTracking.value)
+      }
     }
     }
   } else {
   } else {
     if (sessionStorage.getItem('searchTableQeury') == null) {
     if (sessionStorage.getItem('searchTableQeury') == null) {
-      DateStart.value = [dayjs().subtract(1, 'month').startOf('month'), dayjs()]
+      DateStart.value = [dayjs().subtract(2, 'month').startOf('month'), dayjs().add(1, 'month')]
       daterangeObj.ETD =
       daterangeObj.ETD =
         DateStart.value[0].format('MMM/DD/YYYY') + ' To ' + DateStart.value[1].format('MMM/DD/YYYY')
         DateStart.value[0].format('MMM/DD/YYYY') + ' To ' + DateStart.value[1].format('MMM/DD/YYYY')
       const obj = {
       const obj = {

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

@@ -18,6 +18,7 @@ const TransportList = ref(props.TransportListItem)
 watch(
 watch(
   () => props.TransportListItem,
   () => props.TransportListItem,
   (current) => {
   (current) => {
+    console.log(current)
     TransportList.value = current
     TransportList.value = current
   }
   }
 )
 )
@@ -140,6 +141,20 @@ const defaultTransport = () => {
         }
         }
       }
       }
       emit('defaultTransport', TransportData, searchTableQeuryTracking.value)
       emit('defaultTransport', TransportData, searchTableQeuryTracking.value)
+    } else {
+      const data = JSON.parse(sessionStorage.getItem('reportList') as string) || {}
+      searchTableQeuryTracking.value =
+        JSON.parse(sessionStorage.getItem('searchTableQeuryTracking') as string) || {}
+      if (data.transport_mode) {
+        const obj = {
+          title: 'Transport Mode',
+          data: data.transport_mode
+        }
+        if (data.transport_mode == 'All') {
+          checkAll.value = true
+        }
+        emit('defaultTransport', obj, searchTableQeuryTracking.value)
+      }
     }
     }
   } else {
   } else {
     if (sessionStorage.getItem('searchTableQeury') == null) {
     if (sessionStorage.getItem('searchTableQeury') == null) {

+ 174 - 20
src/views/Dashboard/src/DashboardView.vue

@@ -13,7 +13,6 @@ import { useRouter } from 'vue-router'
 import { ElMessage } from 'element-plus'
 import { ElMessage } from 'element-plus'
 
 
 const router = useRouter()
 const router = useRouter()
-const value = ref('All')
 const activeName = ref('first')
 const activeName = ref('first')
 const SaveVisible = ref(false)
 const SaveVisible = ref(false)
 // 可拖拽模块的列表
 // 可拖拽模块的列表
@@ -422,23 +421,100 @@ const seller_chart_top10_origin = ref()
 const seller_chart_top10_destination = ref()
 const seller_chart_top10_destination = ref()
 const seller_chart_CO2_origin = ref()
 const seller_chart_CO2_origin = ref()
 const seller_chart_CO2_destination = ref()
 const seller_chart_CO2_destination = ref()
+const startyear = ref()
+const startmonth = ref()
+const startday = ref()
+const endyear = ref()
+const endmonth = ref()
+const endday = ref()
+//处理跳转数据
+const handleTurnData = (startdate: any, enddata: any, name: any) => {
+  if (name == 'Container') {
+    if (startdate != '') {
+      startmonth.value = startdate.split('/')[0]
+      startyear.value = startdate.split('/')[1]
+    }
+    if (enddata != '') {
+      endmonth.value = enddata.split('/')[0]
+      endyear.value = enddata.split('/')[1]
+    }
+  } else {
+    if (startdate != '') {
+      startmonth.value = startdate.split('/')[0]
+      startyear.value = startdate.split('/')[2]
+      startday.value = startdate.split('/')[1]
+    }
+    if (enddata != '') {
+      endmonth.value = enddata.split('/')[0]
+      endyear.value = enddata.split('/')[2]
+      endday.value = enddata.split('/')[1]
+    }
+  }
+}
 const ClickParams = (val: any) => {
 const ClickParams = (val: any) => {
   const currentDate = new Date()
   const currentDate = new Date()
   let tenyear = currentDate.getFullYear()
   let tenyear = currentDate.getFullYear()
   let tenmonth = currentDate.getMonth() - 11
   let tenmonth = currentDate.getMonth() - 11
-  let month = currentDate.getMonth() + 1
   if (tenmonth < 0) {
   if (tenmonth < 0) {
     tenyear -= 1
     tenyear -= 1
     tenmonth += 11
     tenmonth += 11
   }
   }
   const reportList: any = {}
   const reportList: any = {}
+  const handlereportlist = (transportation: any, type: any, name: any) => {
+    if (transportation.includes('All')) {
+      reportList.transport_mode = 'All'
+    } else {
+      reportList.transport_mode = dashboardObj.ETDDefaultData.transportation
+    }
+    if (name == 'Container') {
+      if (type == 'ETA') {
+        if (startyear.value) {
+          reportList.eta_start = startyear.value + '-' + startmonth.value + '-01'
+          reportList.eta_end =
+            endyear.value +
+            '-' +
+            endmonth.value +
+            '-' +
+            new Date(endyear.value, endmonth.value, 0).getDate()
+        }
+      } else {
+        if (startyear.value) {
+          reportList.etd_start = startyear.value + '-' + startmonth.value + '-01'
+          reportList.etd_end =
+            endyear.value +
+            '-' +
+            endmonth.value +
+            '-' +
+            new Date(endyear.value, endmonth.value, 0).getDate()
+        }
+      }
+    } else {
+      if (type == 'ETA') {
+        if (startyear.value) {
+          reportList.eta_start = startyear.value + '-' + startmonth.value + startday.value
+          reportList.eta_end = endyear.value + '-' + endmonth.value + '-' + endday.value
+        }
+      } else {
+        if (startyear.value) {
+          reportList.etd_start = startyear.value + '-' + startmonth.value + startday.value
+          reportList.etd_end = endyear.value + '-' + endmonth.value + '-' + endday.value
+        }
+      }
+    }
+  }
   // ETD to ETA(DAYS)点击跳转
   // ETD to ETA(DAYS)点击跳转
   if (val == 'ETD to ETA (Days)') {
   if (val == 'ETD to ETA (Days)') {
+    handleTurnData(
+      dashboardObj.ETDDefaultData.date_start,
+      dashboardObj.ETDDefaultData.date_end,
+      'Container'
+    )
     $api
     $api
       .ClickEtdToEta({
       .ClickEtdToEta({
         _reportRef: pie_chart_ETD.value[0].paramsdata.name,
         _reportRef: pie_chart_ETD.value[0].paramsdata.name,
         _reportRefe_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
         _reportRefe_date: currentDate.getMonth() + 1 + '/' + currentDate.getFullYear(),
-        _reportRefb_date: tenmonth + '/' + tenyear
+        _reportRefb_date: tenmonth + '/' + tenyear,
+        ...dashboardObj.ETDDefaultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -446,13 +522,11 @@ const ClickParams = (val: any) => {
           reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
           reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
           reportList._reportType = 'r1'
           reportList._reportType = 'r1'
           reportList._reportRefb_date = tenmonth + '/' + tenyear
           reportList._reportRefb_date = tenmonth + '/' + tenyear
-          reportList.eta_start = tenyear + '-' + tenmonth + '-01'
-          reportList.eta_end =
-            currentDate.getFullYear() +
-            '-' +
-            month +
-            '-' +
-            new Date(currentDate.getFullYear(), month, 0).getDate()
+          handlereportlist(
+            dashboardObj.ETDDefaultData.transportation,
+            dashboardObj.ETDDefaultData.date_type,
+            'Container'
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -467,14 +541,25 @@ const ClickParams = (val: any) => {
   }
   }
   //  PendingArrival点击跳转
   //  PendingArrival点击跳转
   else if (val == 'Pending1') {
   else if (val == 'Pending1') {
+    handleTurnData(
+      dashboardObj.PendingDefaultData.date_start,
+      dashboardObj.PendingDefaultData.date_end,
+      ''
+    )
     $api
     $api
       .ClickPendingArrival({
       .ClickPendingArrival({
-        _reportRef: pie_chart_pending_arrival.value[0].paramsdata.name
+        _reportRef: pie_chart_pending_arrival.value[0].paramsdata.name,
+        ...dashboardObj.PendingDefaultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_pending_arrival.value[0].paramsdata.name
           reportList._reportRef = pie_chart_pending_arrival.value[0].paramsdata.name
           reportList._reportType = 'r3'
           reportList._reportType = 'r3'
+          handlereportlist(
+            dashboardObj.PendingDefaultData.transportation,
+            dashboardObj.PendingDefaultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -489,14 +574,25 @@ const ClickParams = (val: any) => {
   }
   }
   // PendingDeparture点击跳转
   // PendingDeparture点击跳转
   else if (val == 'Pending0') {
   else if (val == 'Pending0') {
+    handleTurnData(
+      dashboardObj.PendingDefaultData.date_start,
+      dashboardObj.PendingDefaultData.date_end,
+      ''
+    )
     $api
     $api
       .ClickPendingDeparture({
       .ClickPendingDeparture({
-        _reportRef: pie_chart_pending_departure.value[0].paramsdata.name
+        _reportRef: pie_chart_pending_departure.value[0].paramsdata.name,
+        ...dashboardObj.PendingDefaultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
           reportList._reportType = 'r4'
           reportList._reportType = 'r4'
           reportList._reportRef = pie_chart_pending_departure.value[0].paramsdata.name
           reportList._reportRef = pie_chart_pending_departure.value[0].paramsdata.name
+          handlereportlist(
+            dashboardObj.PendingDefaultData.transportation,
+            dashboardObj.PendingDefaultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -511,14 +607,25 @@ const ClickParams = (val: any) => {
   }
   }
   // KPIDeparture点击跳转
   // KPIDeparture点击跳转
   else if (val == 'KPI0') {
   else if (val == 'KPI0') {
+    handleTurnData(
+      dashboardObj.KPIDefaulteData.date_start,
+      dashboardObj.KPIDefaulteData.date_end,
+      ''
+    )
     $api
     $api
       .ClickKPIDeparture({
       .ClickKPIDeparture({
-        _reportRef: pie_chart_kpi_departure.value[0].paramsdata.name
+        _reportRef: pie_chart_kpi_departure.value[0].paramsdata.name,
+        ...dashboardObj.KPIDefaulteData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_kpi_departure.value[0].paramsdata.name
           reportList._reportRef = pie_chart_kpi_departure.value[0].paramsdata.name
           reportList._reportType = 'atd_r4'
           reportList._reportType = 'atd_r4'
+          handlereportlist(
+            dashboardObj.KPIDefaulteData.transportation,
+            dashboardObj.KPIDefaulteData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -533,14 +640,25 @@ const ClickParams = (val: any) => {
   }
   }
   // KPIArrival点击跳转
   // KPIArrival点击跳转
   else if (val == 'KPI1') {
   else if (val == 'KPI1') {
+    handleTurnData(
+      dashboardObj.KPIDefaulteData.date_start,
+      dashboardObj.KPIDefaulteData.date_end,
+      ''
+    )
     $api
     $api
       .ClickKPIArrival({
       .ClickKPIArrival({
-        _reportRef: pie_chart_kpi_arrival.value[0].paramsdata.name
+        _reportRef: pie_chart_kpi_arrival.value[0].paramsdata.name,
+        ...dashboardObj.KPIDefaulteData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
           reportList._reportRef = pie_chart_kpi_arrival.value[0].paramsdata.name
           reportList._reportRef = pie_chart_kpi_arrival.value[0].paramsdata.name
           reportList._reportType = 'ata_r3'
           reportList._reportType = 'ata_r3'
+          handlereportlist(
+            dashboardObj.KPIDefaulteData.transportation,
+            dashboardObj.KPIDefaulteData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -555,11 +673,13 @@ const ClickParams = (val: any) => {
   }
   }
   // Top10 origin点击跳转
   // Top10 origin点击跳转
   else if (val == 'Top 10 Origin') {
   else if (val == 'Top 10 Origin') {
+    handleTurnData(dashboardObj.Top10faultData.date_start, dashboardObj.Top10faultData.date_end, '')
     $api
     $api
       .ClickTop10({
       .ClickTop10({
         _reportRef: seller_chart_top10_origin.value[0].paramsdata,
         _reportRef: seller_chart_top10_origin.value[0].paramsdata,
         _reportStationType: toporiginType.value,
         _reportStationType: toporiginType.value,
-        _city_name: seller_chart_top10_origin.value[0].paramscityname
+        _city_name: seller_chart_top10_origin.value[0].paramscityname,
+        ...dashboardObj.Top10faultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -567,6 +687,11 @@ const ClickParams = (val: any) => {
           reportList._reportType = 'top'
           reportList._reportType = 'top'
           reportList._reportStationType = toporiginType.value
           reportList._reportStationType = toporiginType.value
           reportList._city_name = seller_chart_top10_origin.value[0].paramscityname
           reportList._city_name = seller_chart_top10_origin.value[0].paramscityname
+          handlereportlist(
+            dashboardObj.Top10faultData.transportation,
+            dashboardObj.Top10faultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -582,11 +707,13 @@ const ClickParams = (val: any) => {
   }
   }
   // Top10 destination点击跳转
   // Top10 destination点击跳转
   else if (val == 'Top 10 Destination') {
   else if (val == 'Top 10 Destination') {
+    handleTurnData(dashboardObj.Top10faultData.date_start, dashboardObj.Top10faultData.date_end, '')
     $api
     $api
       .ClickTop10({
       .ClickTop10({
         _reportRef: seller_chart_top10_destination.value[0].paramsdata,
         _reportRef: seller_chart_top10_destination.value[0].paramsdata,
         _reportStationType: topdestinationinType.value,
         _reportStationType: topdestinationinType.value,
-        _city_name: seller_chart_top10_destination.value[0].paramscityname
+        _city_name: seller_chart_top10_destination.value[0].paramscityname,
+        ...dashboardObj.Top10faultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -594,6 +721,11 @@ const ClickParams = (val: any) => {
           reportList._reportStationType = topdestinationinType.value
           reportList._reportStationType = topdestinationinType.value
           reportList._reportType = 'top'
           reportList._reportType = 'top'
           reportList._city_name = seller_chart_top10_destination.value[0].paramscityname
           reportList._city_name = seller_chart_top10_destination.value[0].paramscityname
+          handlereportlist(
+            dashboardObj.Top10faultData.transportation,
+            dashboardObj.Top10faultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -609,11 +741,17 @@ const ClickParams = (val: any) => {
   }
   }
   // CO2e Emission by Origin (Top 10)点击跳转
   // CO2e Emission by Origin (Top 10)点击跳转
   else if (val == 'CO2e Emission by Origin (Top 10)') {
   else if (val == 'CO2e Emission by Origin (Top 10)') {
+    handleTurnData(
+      dashboardObj.OriginCo2Top10faultData.date_start,
+      dashboardObj.OriginCo2Top10faultData.date_end,
+      ''
+    )
     $api
     $api
       .ClickCO2({
       .ClickCO2({
         _reportRef: seller_chart_CO2_origin.value[0].paramsdata.name,
         _reportRef: seller_chart_CO2_origin.value[0].paramsdata.name,
         _reportDataType: seller_chart_CO2_origin.value[0].paramsdata.type,
         _reportDataType: seller_chart_CO2_origin.value[0].paramsdata.type,
-        _reportStationType: 'origin'
+        _reportStationType: 'origin',
+        ...dashboardObj.OriginCo2Top10faultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -621,6 +759,11 @@ const ClickParams = (val: any) => {
           reportList._reportDataType = seller_chart_CO2_origin.value[0].paramsdata.type
           reportList._reportDataType = seller_chart_CO2_origin.value[0].paramsdata.type
           reportList._reportStationType = 'origin'
           reportList._reportStationType = 'origin'
           reportList._reportType = 'co2e'
           reportList._reportType = 'co2e'
+          handlereportlist(
+            dashboardObj.OriginCo2Top10faultData.transportation,
+            dashboardObj.OriginCo2Top10faultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -635,11 +778,17 @@ const ClickParams = (val: any) => {
   }
   }
   // CO2e Emission by Origin (Top 10)点击跳转
   // CO2e Emission by Origin (Top 10)点击跳转
   else if (val == 'CO2e Emission by Destination (Top 10)') {
   else if (val == 'CO2e Emission by Destination (Top 10)') {
+    handleTurnData(
+      dashboardObj.DestinationCo2Top10faultData.date_start,
+      dashboardObj.DestinationCo2Top10faultData.date_end,
+      ''
+    )
     $api
     $api
       .ClickCO2({
       .ClickCO2({
         _reportRef: seller_chart_CO2_destination.value[0].paramsdata.name,
         _reportRef: seller_chart_CO2_destination.value[0].paramsdata.name,
         _reportDataType: seller_chart_CO2_destination.value[0].paramsdata.type,
         _reportDataType: seller_chart_CO2_destination.value[0].paramsdata.type,
-        _reportStationType: 'agent'
+        _reportStationType: 'agent',
+        ...dashboardObj.DestinationCo2Top10faultData
       })
       })
       .then((res: any) => {
       .then((res: any) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -647,6 +796,11 @@ const ClickParams = (val: any) => {
           reportList._reportDataType = seller_chart_CO2_destination.value[0].paramsdata.type
           reportList._reportDataType = seller_chart_CO2_destination.value[0].paramsdata.type
           reportList._reportType = 'co2e'
           reportList._reportType = 'co2e'
           reportList._reportStationType = 'agent'
           reportList._reportStationType = 'agent'
+          handlereportlist(
+            dashboardObj.DestinationCo2Top10faultData.transportation,
+            dashboardObj.DestinationCo2Top10faultData.date_type,
+            ''
+          )
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('clickParams', JSON.stringify(res.data))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           sessionStorage.setItem('reportList', JSON.stringify(reportList))
           let obj: any = {}
           let obj: any = {}
@@ -976,7 +1130,7 @@ const ClickParams = (val: any) => {
                     ></SellerChart>
                     ></SellerChart>
                   </div>
                   </div>
                   <div class="map">
                   <div class="map">
-                    <TopMap></TopMap>
+                    <TopMap :obj="dashboardObj.Top10faultData"></TopMap>
                   </div>
                   </div>
                 </div>
                 </div>
               </template>
               </template>
@@ -993,7 +1147,7 @@ const ClickParams = (val: any) => {
                     ></SellerChart>
                     ></SellerChart>
                   </div>
                   </div>
                   <div class="map" style="height: 272px">
                   <div class="map" style="height: 272px">
-                    <TopMap></TopMap>
+                    <TopMap :obj="dashboardObj.Top10faultData"></TopMap>
                   </div>
                   </div>
                 </div>
                 </div>
               </template>
               </template>

+ 1 - 0
src/views/Dashboard/src/components/SellerChart.vue

@@ -132,6 +132,7 @@ const initOption = reactive({
     {
     {
       type: 'bar',
       type: 'bar',
       data: sellerValue,
       data: sellerValue,
+      barWidth: '10%',
       itemStyle: {
       itemStyle: {
         color: function (params: { dataIndex: number }) {
         color: function (params: { dataIndex: number }) {
           return ColorValue.value[params.dataIndex % ColorValue.value.length]
           return ColorValue.value[params.dataIndex % ColorValue.value.length]

+ 32 - 16
src/views/Dashboard/src/components/TopMap.vue

@@ -1,8 +1,20 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { onMounted, ref } from 'vue'
+import { onMounted, ref, watch } from 'vue'
 import OriginIcon from '../image/hhh_2.png'
 import OriginIcon from '../image/hhh_2.png'
 import L from 'leaflet'
 import L from 'leaflet'
 const MapDataList = ref([])
 const MapDataList = ref([])
+const props = defineProps({
+  obj: {
+    type: Object
+  }
+})
+const mapobj = ref(props.obj)
+watch(
+  () => props.obj,
+  (current) => {
+    mapobj.value = current
+  }
+)
 
 
 const originIcon = L.icon({
 const originIcon = L.icon({
   iconUrl: OriginIcon,
   iconUrl: OriginIcon,
@@ -98,23 +110,27 @@ const init = () => {
       }, 0)
       }, 0)
     }
     }
   }
   }
-  $api.GetTop10ODEcharts({}).then((res: any) => {
-    if (res.code === 200) {
-      res.data.toporiginMap &&
-        res.data.toporiginMap.forEach((item: any) => {
-          MapDataList.value.push({
-            color: item.color,
-            name: item.name,
-            qandl: item.qandl,
-            textcolor: item.textcolor,
-            value: item.value
+  $api
+    .GetTop10ODEcharts({
+      ...mapobj.value
+    })
+    .then((res: any) => {
+      if (res.code === 200) {
+        res.data.toporiginMap &&
+          res.data.toporiginMap.forEach((item: any) => {
+            MapDataList.value.push({
+              color: item.color,
+              name: item.name,
+              qandl: item.qandl,
+              textcolor: item.textcolor,
+              value: item.value
+            })
           })
           })
-        })
 
 
-      // 请求成功后添加标记,并动态添加重置按钮
-      addMarkersToMap()
-    }
-  })
+        // 请求成功后添加标记,并动态添加重置按钮
+        addMarkersToMap()
+      }
+    })
 }
 }
 onMounted(() => {
 onMounted(() => {
   init()
   init()