| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409 |
- <script lang="ts" setup>
- import { ref, onMounted, reactive } from 'vue'
- import QuickCalendarDate from '@/components/DateRange/src/components/QuickCalendarDate.vue'
- import { VueDraggable } from 'vue-draggable-plus'
- import PieChart from './components/PieChart.vue'
- import SellerChart from './components/SellerChart.vue'
- import BarChart from './components/BarChart.vue'
- import RecentStatus from './components/RecentStatus.vue'
- import ScoringSystem from './components/ScoringSystem.vue'
- import TopMap from './components/TopMap.vue'
- import DashFilters from './components/DashFiters.vue'
- import { useRouter } from 'vue-router'
- import { ElMessage } from 'element-plus'
- const router = useRouter()
- const activeName = ref('first')
- const SaveVisible = ref(false)
- // 可拖拽模块的列表
- interface ManagementItem {
- title: string
- switchValue: boolean
- text: string
- id: number
- title1: string
- title2: string
- }
- const Management = ref<ManagementItem[]>([])
- const changeCancel = (id: any) => {
- Management.value[id - 1].switchValue = false
- }
- //RecentStatusList
- const RecentStatusList = ref()
- const pageInfo = ref({ pageNo: 1, pageSize: 10, total: 10000 })
- const isShowtitle1 = ref(true)
- // 点击tab
- const handleTabClick = (tab: any) => {
- if (tab.props.name == 'first') {
- isShowtitle1.value = true
- } else {
- isShowtitle1.value = false
- }
- GetTop10ODEcharts(dashboardObj.Top10faultData)
- }
- const KPIDefaulteData = ref()
- const PendingDefaulteData = ref()
- const RecentDefaulteData = ref()
- const ETDDefaulteData = ref()
- const ContainerefaultData = ref()
- const Top10DefaultData = ref()
- const Co2OriginDefaultData = ref()
- const Co2DestinationDefaultData = ref()
- const RevenueDefaultData = ref()
- // 获取首页数据
- let dashboardObj: any = {}
- const GetDashboardData = () => {
- $api
- .getDashboardFilters({})
- .then((res: any) => {
- if (res.code == 200) {
- //给默认筛选条件赋值
- KPIDefaulteData.value = res.data.KPIDefaulteData
- dashboardObj.KPIDefaulteData = res.data.KPIDefaulteData
- PendingDefaulteData.value = res.data.PendingDefaultData
- dashboardObj.PendingDefaultData = res.data.PendingDefaultData
- RecentDefaulteData.value = res.data.RecentDefaultData
- dashboardObj.RecentDefaultData = res.data.RecentDefaultData
- ETDDefaulteData.value = res.data.ETDDefaultData
- dashboardObj.ETDDefaultData = res.data.ETDDefaultData
- ContainerefaultData.value = res.data.ContainerefaultData
- dashboardObj.ContainerefaultData = res.data.ContainerefaultData
- Top10DefaultData.value = res.data.Top10faultData
- dashboardObj.Top10faultData = res.data.Top10faultData
- Co2OriginDefaultData.value = res.data.OriginCo2Top10faultData
- dashboardObj.OriginCo2Top10faultData = res.data.OriginCo2Top10faultData
- Co2DestinationDefaultData.value = res.data.DestinationCo2Top10faultData
- dashboardObj.DestinationCo2Top10faultData = res.data.DestinationCo2Top10faultData
- RevenueDefaultData.value = res.data.RevenueDefaultData
- dashboardObj.RevenueDefaultData = res.data.RevenueDefaultData
- }
- })
- .finally(() => {
- nextTick(() => {
- GetKpiData(KPIDefaulteData.value)
- GetPendingEcharts(PendingDefaulteData.value)
- getTableData(false, RecentDefaulteData.value)
- GetETDEcharts(ETDDefaulteData.value)
- GetContainerCountEcharts(ContainerefaultData.value)
- GetTop10ODEcharts(Top10DefaultData.value)
- GetCo2EmissionEcharts(Co2OriginDefaultData.value)
- GetCo2DestinationEcharts(Co2DestinationDefaultData.value)
- GetRevenueEcharts(RevenueDefaultData.value)
- })
- })
- }
- // 获取表单数据
- const getTableData = (isPage: any, val: any) => {
- dashboardObj.RecentDefaultData = val
- const rc = isPage ? pageInfo.value.total : -1
- $api
- .GetDashboardData({
- cp: pageInfo.value.pageNo,
- ps: pageInfo.value.pageSize,
- rc,
- ...val
- })
- .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 KPIobj = reactive({
- ETD_Title: '',
- ETDList: [],
- ETD_Radius: [],
- download_name: ''
- })
- const Arrivalobj = reactive({
- ETD_Title: '',
- ETDList: [],
- ETD_Radius: [],
- download_name: ''
- })
- const KPILoading = ref(true)
- const KPIArrivalLoading = ref(true)
- //查询KPI
- const GetKpiData = (val: any) => {
- dashboardObj.KPIDefaulteData = val
- // 获取KPI Departure图表数据
- $api
- .GetKPIEcharts({
- r_type: 'atd_r4',
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- KPIobj.ETD_Title = `{a|${res.data.title1}}{b|${res.data.title2}}`
- KPIobj.ETDList = res.data.ETDList
- KPIobj.ETD_Radius = res.data.ETD_Radius
- KPIobj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- KPILoading.value = false
- })
- // 获取KPI Arrival图表数据
- $api
- .GetKPIEcharts({
- r_type: 'ata_r3',
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- Arrivalobj.ETD_Title = `{a|${res.data.title1}}{b|${res.data.title2}}`
- Arrivalobj.ETDList = res.data.ETDList
- Arrivalobj.ETD_Radius = res.data.ETD_Radius
- Arrivalobj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- KPIArrivalLoading.value = false
- })
- }
- const Pendingobj = reactive({
- ETD_Title: '',
- ETDList: [],
- ETD_Radius: [],
- download_name: ''
- })
- const PendingArrivalobj = reactive({
- ETD_Title: '',
- ETDList: [],
- ETD_Radius: [],
- download_name: ''
- })
- const PendingLoading = ref(true)
- const PendingArrivalLoading = ref(true)
- // 查询Pending
- const GetPendingEcharts = (val: any) => {
- dashboardObj.PendingDefaultData = val
- // 获取Pending Departure图表数据
- $api
- .GetPendingEcharts({
- r_type: 'r4',
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- Pendingobj.ETD_Title = `{a|${res.data.title1}}{b|${res.data.title2}}`
- Pendingobj.ETDList = res.data.ETDList
- Pendingobj.ETD_Radius = res.data.ETD_Radius
- Pendingobj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- PendingLoading.value = false
- })
- // 获取Pending Arrival图表数据
- $api
- .GetPendingEcharts({
- r_type: 'r3',
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- PendingArrivalobj.ETD_Title = `{a|${res.data.title1}}{b|${res.data.title2}}`
- PendingArrivalobj.ETDList = res.data.ETDList
- PendingArrivalobj.ETD_Radius = res.data.ETD_Radius
- PendingArrivalobj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- PendingArrivalLoading.value = false
- })
- }
- const ETDobj = reactive({
- ETD_Title: '',
- ETDList: [],
- ETD_Radius: [],
- download_name: ''
- })
- const ETDLoading = ref(true)
- // 获取ETD/ETA 图表数据
- const GetETDEcharts = (val: any) => {
- dashboardObj.ETDDefaultData = val
- $api
- .GetETDEcharts({
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- ETDobj.ETD_Title = `{a|${res.data.ETD_Title}}`
- ETDobj.ETDList = res.data.ETDList
- ETDobj.ETD_Radius = res.data.ETD_Radius
- ETDobj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- ETDLoading.value = false
- })
- }
- // 获取ContainerCount
- const containerObj = reactive({
- bar_title: '',
- barList: [],
- barSeries: [],
- Max: 0,
- interval: 0,
- download_name: ''
- })
- const containerLoading = ref(true)
- const GetContainerCountEcharts = (val: any) => {
- dashboardObj.ContainerefaultData = val
- $api
- .GetContainerCountEcharts({
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- containerObj.bar_title = res.data.ContainerCount_Title
- containerObj.barList = res.data.ContainerCountList
- containerObj.barSeries = res.data.ContainerCounSeries
- containerObj.Max = res.data.Max
- containerObj.interval = res.data.interval
- containerObj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- containerLoading.value = false
- })
- }
- const topdestinationinType = ref()
- const toporiginType = ref()
- //获取Top10 Origin/Destination
- const Top10Obj = reactive({
- OriginData: [],
- DestinationData: []
- })
- const Top1OInterval = reactive({
- Max: 0,
- interval: 0
- })
- const Top1OInterval_dest = reactive({
- Max: 0,
- interval: 0
- })
- const TopOriginLoading = ref(true)
- const Top10Originref = ref()
- const Top10Destinationref = ref()
- const GetTop10ODEcharts = (val: any) => {
- dashboardObj.Top10faultData = val
- $api
- .GetTop10ODEcharts({
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- // Top10Originref.value[0].updataMapObj(dashboardObj.Top10faultData)
- if (isShowtitle1.value) {
- Top10Originref.value[0].updataMapObj(res.data.toporiginMap)
- } else {
- Top10Destinationref.value[0].updataMapObj(res.data.topdestinationinMap)
- }
- 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 = false
- })
- }
- //获取CO2 Origin
- const EmissionLoading = ref(true)
- const EmissionObj = reactive({
- bar_title: '',
- barList: [],
- barSeries: [],
- Max: 0,
- interval: 0,
- download_name: ''
- })
- const GetCo2EmissionEcharts = (val: any) => {
- dashboardObj.OriginCo2Top10faultData = val
- $api
- .GetCo2EmissionEcharts({
- ...val
- })
- .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 = false
- })
- }
- //获取CO2 Destination
- const DestinationObj = reactive({
- bar_title: '',
- barList: [],
- barSeries: [],
- Max: 0,
- interval: 0,
- download_name: ''
- })
- const DestinationLoading = ref(true)
- const GetCo2DestinationEcharts = (val: any) => {
- dashboardObj.DestinationCo2Top10faultData = val
- $api
- .GetCo2DestinationEcharts({
- ...val
- })
- .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 = false
- })
- }
- //获取Revenue Spent
- const RevenueObj = reactive({
- bar_title: '',
- barList: [],
- barSeries: [],
- Max: 0,
- interval: 0,
- download_name: '',
- isShowTooltips: true
- })
- const RevenueLoading = ref(true)
- const revenue_date_start = ref()
- const revenue_date_end = ref()
- const GetRevenueEcharts = (val: any) => {
- revenue_date_start.value = val.date_start
- revenue_date_end.value = val.date_end
- dashboardObj.RevenueDefaultData = val
- $api
- .GetRevenueEcharts({
- ...val
- })
- .then((res: any) => {
- if (res.code === 200) {
- RevenueObj.bar_title = res.data.bar_title
- RevenueObj.barList = res.data.barList
- RevenueObj.barSeries = res.data.barSeries
- RevenueObj.Max = res.data.Max
- RevenueObj.interval = res.data.interval
- RevenueObj.download_name = res.data.download_name
- }
- })
- .finally(() => {
- RevenueLoading.value = false
- })
- }
- onMounted(() => {
- GetDashboardData()
- })
- // Save Layout
- const SaveLayout = () => {
- SaveVisible.value = false
- Management.value.forEach((item: any, index: any) => {
- item.id = index + 1
- })
- $api
- .SaveLayout({
- management: Management.value
- })
- .then((res: any) => {
- if (res.code == 200) {
- ElMessage({
- message: res.data.msg,
- duration: 3000,
- type: 'success'
- })
- }
- })
- }
- //Save Filters
- const SaveFilters = () => {
- SaveVisible.value = false
- Management.value.forEach((item: any, index: any) => {
- item.id = index + 1
- })
- $api
- .SaveLayout({
- management: Management.value,
- dashboardObj
- })
- .then((res: any) => {
- if (res.code == 200) {
- ElMessage({
- message: res.data.msg,
- duration: 3000,
- type: 'success'
- })
- }
- })
- }
- //ETD to ETA(DAYS)点击跳转
- const pie_chart_ETD = ref()
- const pie_chart_pending_arrival = ref()
- const pie_chart_pending_departure = ref()
- const pie_chart_kpi_departure = ref()
- const pie_chart_kpi_arrival = ref()
- 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
- 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 = startmonth.value + '/01/' + startyear.value
- reportList.eta_end =
- endmonth.value +
- '/' +
- new Date(endyear.value, endmonth.value, 0).getDate() +
- '/' +
- endyear.value
- }
- } else {
- if (startyear.value) {
- reportList.etd_start = startmonth.value + '/01/' + startyear.value
- reportList.etd_end =
- endmonth.value +
- '/' +
- new Date(endyear.value, endmonth.value, 0).getDate() +
- '/' +
- endyear.value
- }
- }
- } else {
- if (type == 'ETA') {
- if (startyear.value) {
- reportList.eta_start = startmonth.value + '/' + startday.value + '/' + startyear.value
- reportList.eta_end = endmonth.value + '/' + endday.value + '/' + endyear.value
- }
- } else {
- if (startyear.value) {
- reportList.etd_start = startmonth.value + '/' + startday.value + '/' + startyear.value
- reportList.etd_end = endmonth.value + '/' + endday.value + '/' + endyear.value
- }
- }
- }
- }
- // ETD to ETA(DAYS)点击跳转
- if (val == 'ETD to ETA (Days)') {
- handleTurnData(
- dashboardObj.ETDDefaultData.date_start,
- dashboardObj.ETDDefaultData.date_end,
- 'Container'
- )
- reportList._reportRef = pie_chart_ETD.value[0].paramsdata.name
- reportList._reportRefe_date = currentDate.getMonth() + 1 + '/' + currentDate.getFullYear()
- reportList._reportType = 'r1'
- reportList._reportRefb_date = tenmonth + '/' + tenyear
- handlereportlist(
- dashboardObj.ETDDefaultData.transportation,
- dashboardObj.ETDDefaultData.date_type,
- 'Container'
- )
- sessionStorage.setItem('clickParams', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'ETD to ETA (Days)'
- obj.name = pie_chart_ETD.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // PendingArrival点击跳转
- else if (val == 'Pending1') {
- handleTurnData(
- dashboardObj.PendingDefaultData.date_start,
- dashboardObj.PendingDefaultData.date_end,
- ''
- )
- reportList._reportRef = pie_chart_pending_arrival.value[0].paramsdata.name
- reportList._reportType = 'r3'
- handlereportlist(
- dashboardObj.PendingDefaultData.transportation,
- dashboardObj.PendingDefaultData.date_type,
- ''
- )
- sessionStorage.setItem('clickParams', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'Pending Arrival'
- obj.name = pie_chart_pending_arrival.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // PendingDeparture点击跳转
- else if (val == 'Pending0') {
- handleTurnData(
- dashboardObj.PendingDefaultData.date_start,
- dashboardObj.PendingDefaultData.date_end,
- ''
- )
- reportList._reportType = 'r4'
- reportList._reportRef = pie_chart_pending_departure.value[0].paramsdata.name
- handlereportlist(
- dashboardObj.PendingDefaultData.transportation,
- dashboardObj.PendingDefaultData.date_type,
- ''
- )
- sessionStorage.setItem('clickParams', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'Pending Departure'
- obj.name = pie_chart_pending_departure.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // KPIDeparture点击跳转
- else if (val == 'KPI0') {
- handleTurnData(
- dashboardObj.KPIDefaulteData.date_start,
- dashboardObj.KPIDefaulteData.date_end,
- ''
- )
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'KPI Departure'
- obj.name = pie_chart_kpi_departure.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // KPIArrival点击跳转
- else if (val == 'KPI1') {
- handleTurnData(
- dashboardObj.KPIDefaulteData.date_start,
- dashboardObj.KPIDefaulteData.date_end,
- ''
- )
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'KPI Arrival'
- obj.name = pie_chart_kpi_arrival.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // Top10 origin点击跳转
- else if (val == 'Top 10 Origin') {
- handleTurnData(dashboardObj.Top10faultData.date_start, dashboardObj.Top10faultData.date_end, '')
- reportList._reportRef = seller_chart_top10_origin.value[0].paramsdata
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'Top 10 Origin'
- obj.name = seller_chart_top10_origin.value[0].paramsdata
- obj.data = seller_chart_top10_origin.value[0].paramscityname
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // Top10 destination点击跳转
- else if (val == 'Top 10 Destination') {
- handleTurnData(dashboardObj.Top10faultData.date_start, dashboardObj.Top10faultData.date_end, '')
- reportList._reportRef = seller_chart_top10_destination.value[0].paramsdata
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'Top 10 Destination'
- obj.name = seller_chart_top10_destination.value[0].paramsdata
- obj.data = seller_chart_top10_destination.value[0].paramscityname
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // CO2e Emission by Origin (Top 10)点击跳转
- else if (val == 'CO2e Emission by Origin (Top 10)') {
- handleTurnData(
- dashboardObj.OriginCo2Top10faultData.date_start,
- dashboardObj.OriginCo2Top10faultData.date_end,
- ''
- )
- reportList._reportRef = seller_chart_CO2_origin.value[0].paramsdata.name
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'CO2e Emission by Origin (Top 10)'
- obj.name = seller_chart_CO2_origin.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- // CO2e Emission by Origin (Top 10)点击跳转
- else if (val == 'CO2e Emission by Destination (Top 10)') {
- handleTurnData(
- dashboardObj.DestinationCo2Top10faultData.date_start,
- dashboardObj.DestinationCo2Top10faultData.date_end,
- ''
- )
- reportList._reportRef = seller_chart_CO2_destination.value[0].paramsdata.name
- 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', 'clickParams')
- sessionStorage.setItem('reportList', JSON.stringify(reportList))
- let obj: any = {}
- obj.title = 'CO2e Emission by Destination (Top 10)'
- obj.name = seller_chart_CO2_destination.value[0].paramsdata.name
- sessionStorage.setItem('tagsList', JSON.stringify(obj))
- router.push({
- path: '/tracking'
- })
- }
- }
- </script>
- <template>
- <div class="dashboard">
- <!-- 评分 -->
- <ScoringSystem></ScoringSystem>
- <!-- Title -->
- <div class="Title">
- <div>Dashboard</div>
- <div>
- <el-popover trigger="click" width="400" popper-style="border-radius: 12px">
- <template #reference>
- <el-button class="el-button--default">
- <span class="iconfont_icon">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_view__management_b"></use>
- </svg>
- </span>
- View Management
- </el-button>
- </template>
- <div class="Management">
- <div class="title">View Management</div>
- <div class="management_content" v-for="(item, index) in Management" :key="index">
- <div class="management_flex">
- <div class="content_title">{{ item.title }}</div>
- <div><el-switch v-model="item.switchValue" /></div>
- </div>
- <div class="content_text">{{ item.text }}</div>
- </div>
- <el-divider />
- <div class="tips">
- <span class="iconfont_icon">
- <svg class="iconfont iconfont_tips" aria-hidden="true">
- <use xlink:href="#icon-icon_info_b"></use>
- </svg>
- </span>
- <div class="tips_text">
- Please remember to click the save button in order to keep the new dashboard layout
- and widgets.
- </div>
- </div>
- </div>
- </el-popover>
- <el-popover
- :visible="SaveVisible"
- :popper-style="{
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- backgroundColor: 'var(--management-bg-color)'
- }"
- >
- <template #reference>
- <el-button
- class="el-button--default"
- @blur="SaveVisible = false"
- @click="SaveVisible = !SaveVisible"
- >
- <span class="iconfont_icon">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_save_b"></use>
- </svg>
- </span>
- Save
- <span class="iconfont_icon">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_dropdown_b"></use>
- </svg>
- </span>
- </el-button>
- </template>
- <div class="Save_filters" @click="SaveFilters">
- <span class="iconfont_icon iconfont_icon_save">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_save_b"></use>
- </svg>
- </span>
- <div>Save Filters</div>
- </div>
- <div class="Save_filters" @click="SaveLayout">
- <span class="iconfont_icon iconfont_icon_save">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_save_b"></use>
- </svg>
- </span>
- <div>Save Layout</div>
- </div>
- </el-popover>
- </div>
- </div>
- <!-- 图表 -->
- <div class="echarts">
- <VueDraggable
- style="
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- gap: 8px;
- width: 100%;
- "
- ref="infoContentRef"
- ghost-class="ghost-class"
- :forceFallback="true"
- fallback-class="fallback-class"
- v-model="Management"
- handle=".handle-draggable"
- >
- <template v-for="item in Management" :key="item">
- <div v-if="item.title === 'KPI' && item.switchValue" class="filters_left">
- <!-- KPI -->
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="KPIDefaulteData"
- @FilterSearch="GetKpiData"
- ></DashFilters>
- <!-- <el-tooltip
- effect="dark"
- :offset="6"
- :content="item.text"
- placement="bottom-start"
- >
- <span class="iconfont_icon iconfont_icon_tip">
- <svg class="iconfont" aria-hidden="true">
- <use xlink:href="#icon-icon_info_b"></use>
- </svg>
- </span>
- </el-tooltip> -->
- </div>
- </template>
- <template #content>
- <div class="KPI_Pending">
- <div class="kpi">
- <PieChart
- ref="pie_chart_kpi_departure"
- @ClickParams="ClickParams(item.title + '0')"
- :PieData="KPIobj"
- v-vloading="KPILoading"
- style="height: 300px"
- ></PieChart>
- </div>
- <div class="kpi">
- <PieChart
- ref="pie_chart_kpi_arrival"
- :PieData="Arrivalobj"
- v-vloading="KPIArrivalLoading"
- @ClickParams="ClickParams(item.title + '1')"
- style="height: 300px"
- ></PieChart>
- </div>
- </div>
- </template>
- </VBox_Dashboard>
- </div>
- <div v-else-if="item.title === 'Pending' && item.switchValue" class="filters_left">
- <!-- Pending -->
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="PendingDefaulteData"
- :radioisDisabled="true"
- @FilterSearch="GetPendingEcharts"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <div class="KPI_Pending">
- <div class="kpi">
- <PieChart
- ref="pie_chart_pending_departure"
- :PieData="Pendingobj"
- v-vloading="PendingLoading"
- @ClickParams="ClickParams(item.title + '0')"
- style="height: 300px"
- ></PieChart>
- </div>
- <div class="kpi">
- <PieChart
- ref="pie_chart_pending_arrival"
- @ClickParams="ClickParams(item.title + '1')"
- :PieData="PendingArrivalobj"
- v-vloading="PendingArrivalLoading"
- style="height: 300px"
- ></PieChart>
- </div>
- </div>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- ETD to ETA -->
- <div
- v-else-if="item.title === 'ETD to ETA (Days)' && item.switchValue"
- class="filters_left"
- >
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="ETDDefaulteData"
- @FilterSearch="GetETDEcharts"
- :isETDToETA="true"
- :isContainer="true"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <PieChart
- ref="pie_chart_ETD"
- @ClickParams="ClickParams(item.title)"
- :PieData="ETDobj"
- v-vloading="ETDLoading"
- style="height: 300px"
- ></PieChart>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- Container Count -->
- <div
- v-else-if="item.title === 'Container Count' && item.switchValue"
- class="filters_left"
- >
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="ContainerefaultData"
- @FilterSearch="GetContainerCountEcharts"
- :isContainer="true"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <BarChart
- ref="seller_chart_Container_count"
- :BarData="containerObj"
- v-vloading="containerLoading"
- style="height: 300px"
- :isRevenue="true"
- :barHeight="{ height: '300px' }"
- ></BarChart>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- Top10 Origin/Top 10 Destination -->
- <div
- v-else-if="item.title === 'Top 10 Origin/Destination' && item.switchValue"
- class="KPI_Pending"
- >
- <VBox_Dashboard @changeCancel="changeCancel(item.id)" style="width: 100%">
- <template #header>
- <div class="Title_flex" style="height: 48px">
- <el-tabs
- v-model="activeName"
- class="demo-tabs"
- style="height: 48px"
- @tab-click="handleTabClick"
- >
- <el-tab-pane :label="item.title1" name="first"></el-tab-pane>
- <el-tab-pane :label="item.title2" name="second"></el-tab-pane>
- </el-tabs>
- <DashFilters
- :defaultData="Top10DefaultData"
- @FilterSearch="GetTop10ODEcharts"
- ></DashFilters>
- </div>
- </template>
- <template v-if="isShowtitle1" #content>
- <div class="KPI_Pending">
- <div class="seller_chart">
- <SellerChart
- ref="seller_chart_top10_origin"
- @clickParams="ClickParams(item.title1)"
- :SellerData="Top10Obj.OriginData"
- v-vloading="TopOriginLoading"
- :Interval="Top1OInterval"
- ></SellerChart>
- </div>
- <div class="map">
- <!-- <TopMap :obj="dashboardObj.Top10faultData" ref="Top10Originref"></TopMap> -->
- <TopMap ref="Top10Originref"></TopMap>
- </div>
- </div>
- </template>
- <template v-else #content2>
- <div class="KPI_Pending">
- <div class="seller_chart">
- <SellerChart
- ref="seller_chart_top10_destination"
- @clickParams="ClickParams(item.title2)"
- :SellerData="Top10Obj.DestinationData"
- :Interval="Top1OInterval_dest"
- v-vloading="TopOriginLoading"
- style="height: 272px"
- ></SellerChart>
- </div>
- <div class="map" style="height: 272px">
- <!-- <TopMap :obj="dashboardObj.Top10faultData" ref="Top10Destinationref"></TopMap> -->
- <TopMap ref="Top10Destinationref"></TopMap>
- </div>
- </div>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- CO2e Emission by Origin (Top 10) -->
- <div
- v-else-if="item.title === 'CO2e Emission by Origin (Top 10)' && item.switchValue"
- class="filters_left"
- >
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="Co2OriginDefaultData"
- @FilterSearch="GetCo2EmissionEcharts"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <BarChart
- ref="seller_chart_CO2_origin"
- :BarData="EmissionObj"
- @clickParams="ClickParams(item.title)"
- v-vloading="EmissionLoading"
- style="height: 250px"
- :isRevenue="true"
- :barHeight="{ height: '250px' }"
- ></BarChart>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- CO2e Emission by Destination (Top 10) -->
- <div
- v-else-if="item.title === 'CO2e Emission by Destination (Top 10)' && item.switchValue"
- class="filters_left"
- >
- <VBox_Dashboard @changeCancel="changeCancel(item.id)">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="Co2DestinationDefaultData"
- @FilterSearch="GetCo2DestinationEcharts"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <BarChart
- ref="seller_chart_CO2_destination"
- :BarData="DestinationObj"
- v-vloading="DestinationLoading"
- style="height: 250px"
- :isRevenue="true"
- @clickParams="ClickParams(item.title)"
- :barHeight="{ height: '250px' }"
- ></BarChart>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- <div
- v-else-if="item.title === 'Revenue' && item.switchValue"
- class="KPI_Pending"
- > -->
- <div
- v-else-if="
- item.title === 'Recent Status' && item.switchValue && RecentStatusList.length != 0
- "
- class="KPI_Pending"
- >
- <!-- Recent Status -->
- <VBox_Dashboard @changeCancel="changeCancel(item.id)" style="width: 100%">
- <template #header>
- <div class="Title_flex">
- {{ item.title }}
- <DashFilters
- :defaultData="RecentDefaulteData"
- @FilterSearch="getTableData"
- :isRecent="true"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <RecentStatus :RecentStatusList="RecentStatusList"></RecentStatus>
- <div class="pagination">
- <span>Total {{ pageInfo.total }}</span>
- <el-pagination
- v-model:current-page="pageInfo.pageNo"
- v-model:page-size="pageInfo.pageSize"
- :page-sizes="[10, 50, 100, 200]"
- layout="prev, pager, next"
- :pager-count="3"
- :total="pageInfo.total"
- @size-change="getTableData(true, RecentDefaulteData)"
- @current-change="getTableData(true, RecentDefaulteData)"
- />
- </div>
- </template>
- </VBox_Dashboard>
- </div>
- <!-- Revenue -->
- <div v-else-if="item.title === 'Revenue Spent' && item.switchValue" class="KPI_Pending">
- <VBox_Dashboard @changeCancel="changeCancel(item.id)" style="width: 100%">
- <template #header>
- <div class="Title_flex">
- Revenue Spent
- <DashFilters
- :defaultData="RevenueDefaultData"
- @FilterSearch="GetRevenueEcharts"
- :isRevenue="true"
- :isContainer="true"
- ></DashFilters>
- </div>
- </template>
- <template #content>
- <BarChart
- :BarData="RevenueObj"
- :isRevenue="false"
- v-vloading="RevenueLoading"
- :RevenueStartDate="revenue_date_start"
- :RevenueEndDate="revenue_date_end"
- style="height: 300px"
- :barHeight="{ height: '300px' }"
- ></BarChart>
- </template>
- </VBox_Dashboard>
- </div>
- </template>
- </VueDraggable>
- </div>
- </div>
- </template>
- <style lang="scss" scoped>
- .Title {
- display: flex;
- background-color: var(--color-mode);
- height: 68px;
- font-size: var(--font-size-6);
- font-weight: 700;
- padding: 0 24px;
- align-items: center;
- justify-content: space-between;
- }
- .iconfont {
- vertical-align: -2px;
- }
- .Management {
- max-height: 800px;
- overflow-y: auto;
- border-radius: 12px;
- background-color: var(--management-bg-color);
- }
- .title {
- font-weight: 700;
- font-size: var(--font-size-5);
- background-color: var(--color-header-bg);
- height: 48px;
- display: flex;
- align-items: center;
- padding-left: 16px;
- }
- .management_content {
- width: 368px;
- min-height: 54px;
- margin: 10px auto;
- background-color: var(--color-header-bg);
- border-radius: var(--border-radius-6);
- padding: 8px 16px;
- }
- .management_flex {
- display: flex;
- height: 20px;
- justify-content: space-between;
- align-items: center;
- }
- .content_title {
- font-weight: 700;
- font-size: var(--font-size-3);
- }
- .content_text {
- color: var(--color-neutral-2);
- font-size: var(--font-size-2);
- line-height: 16px;
- }
- .tips {
- display: flex;
- justify-content: center;
- }
- .iconfont_tips {
- fill: var(--color-neutral-2);
- }
- .tips_text {
- width: 278.43px;
- text-align: center;
- font-size: var(--font-size-2);
- color: var(--color-neutral-2);
- }
- .el-divider--horizontal {
- margin: 8px 0;
- }
- .Save_filters {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 40px;
- font-size: var(--font-size-3);
- width: 126px;
- margin: 4px 0;
- cursor: pointer;
- }
- .iconfont_icon_save {
- margin-right: 16px;
- fill: var(--color-neutral-1);
- }
- .Save_filters:hover {
- border-color: var(--color-btn-default-bg-hover);
- background-color: var(--color-btn-default-bg-hover);
- .iconfont_icon_save {
- fill: var(--color-theme);
- }
- div {
- color: var(--color-theme);
- }
- }
- .filters {
- display: flex;
- padding: 0 24px;
- height: 32px;
- align-items: center;
- margin-bottom: 8px;
- justify-content: space-between;
- }
- .KPI_Pending {
- display: flex;
- width: 100%;
- }
- .filters_left {
- border-radius: var(--border-radius-6);
- flex: 1 48%;
- }
- .KPI_title {
- border-bottom: 1px solid var(--color-border);
- height: 48px;
- line-height: 48px;
- align-items: center;
- justify-content: space-between;
- display: flex;
- padding-left: 16px;
- font-weight: 700;
- font-size: var(--font-size-5);
- }
- .tips_filter {
- margin-right: 8px;
- height: 32px;
- }
- .filters_right {
- width: 251px;
- height: 32px;
- margin-bottom: 8px;
- }
- :deep(.ETD_title) {
- margin-bottom: 0 !important;
- }
- :deep(:where(.css-dev-only-do-not-override-19iuou).ant-picker-range) {
- height: 32px;
- }
- .echarts {
- padding: 0 22px;
- background-color: var(--color-mode);
- }
- .kpi {
- width: 50%;
- border-right: 1px solid var(--color-border);
- }
- .kpi:last-child {
- border-right: none;
- }
- .ghost-class {
- opacity: 0;
- }
- .fallback-class {
- opacity: 1 !important;
- background-color: #fff;
- cursor: move !important;
- box-shadow: 4px 4px 32px 0px rgba(0, 0, 0, 0.2);
- border-radius: 12px;
- }
- .pagination {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-top: 1px solid var(--color-border);
- padding: 4px 8px;
- }
- .container-type {
- font-size: 14px;
- font-weight: 400;
- margin-right: 4px;
- }
- .seller_chart {
- width: 30%;
- border-right: 1px solid var(--color-border);
- }
- .map {
- width: 70%;
- }
- .Title_flex {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-right: 30px;
- }
- .iconfont_icon_tip {
- margin-left: 8px;
- width: 16px;
- height: 16px;
- display: flex;
- align-items: center;
- }
- .dashboard {
- z-index: 2014;
- position: relative;
- background-color: var(--color-mode);
- padding-bottom: 40px;
- }
- :deep(.el-tabs__header) {
- height: 48px;
- margin-bottom: 0;
- }
- </style>
|