|
|
@@ -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' }"
|