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