diff --git a/src/page/index/components/AccountsReceivableWarning/AccountsReceivableWarning.vue b/src/page/index/components/AccountsReceivableWarning/AccountsReceivableWarning.vue index 3b0d5f8..5ee00f5 100644 --- a/src/page/index/components/AccountsReceivableWarning/AccountsReceivableWarning.vue +++ b/src/page/index/components/AccountsReceivableWarning/AccountsReceivableWarning.vue @@ -60,7 +60,18 @@ const handleGetData = async () => { GetFromRedis: true // ProvinceCode: "340000", } - const data = await handleGetProjectSummaryInfo(req) + + + let AccountsReceivableWarning = sessionStorage.getItem('AccountsReceivableWarning') + let data: any = [] + if (AccountsReceivableWarning) { + data = JSON.parse(AccountsReceivableWarning) + } else { + data = await handleGetProjectSummaryInfo(req) + sessionStorage.setItem("AccountsReceivableWarning", JSON.stringify(data)) + } + + // const data = await handleGetProjectSummaryInfo(req) // 应收账款预警 diff --git a/src/page/index/components/AnnualAccountsReceivable/AnnualAccountsReceivable.vue b/src/page/index/components/AnnualAccountsReceivable/AnnualAccountsReceivable.vue index daf8d0d..61e9f27 100644 --- a/src/page/index/components/AnnualAccountsReceivable/AnnualAccountsReceivable.vue +++ b/src/page/index/components/AnnualAccountsReceivable/AnnualAccountsReceivable.vue @@ -138,7 +138,17 @@ const handleGetData = async () => { const req: any = { GetFromRedis: true } - const data = await handleGetProjectYearlyArrearageList(req) + + let AnnualAccountsReceivable = sessionStorage.getItem('AnnualAccountsReceivable') + let data: any = [] + if (AnnualAccountsReceivable) { + data = JSON.parse(AnnualAccountsReceivable) + } else { + data = await handleGetProjectYearlyArrearageList(req) + sessionStorage.setItem("AnnualAccountsReceivable", JSON.stringify(data)) + } + + // const data = await handleGetProjectYearlyArrearageList(req) let list: any = data.ProjectMonthlyCompleteList.slice(0, 5) list.reverse() diff --git a/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue b/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue index 36d7efc..c232d3b 100644 --- a/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue +++ b/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue @@ -105,7 +105,18 @@ const handleGetData = async () => { StatisticsDate: moment().subtract(1, 'd').format('YYYY-MM-DD'), // ServerpartId: '' } - const data = await handleGetBusinessBrandLevel(req) + + let BrandConsumptionLevel = sessionStorage.getItem('BrandConsumptionLevel') + let data: any = [] + if (BrandConsumptionLevel) { + data = JSON.parse(BrandConsumptionLevel) + } else { + data = await handleGetBusinessBrandLevel(req) + sessionStorage.setItem("BrandConsumptionLevel", JSON.stringify(data)) + } + + + // const data = await handleGetBusinessBrandLevel(req) category = data.legend diff --git a/src/page/index/components/BrandDetail/BrandDetail.vue b/src/page/index/components/BrandDetail/BrandDetail.vue index 913c948..62fcf61 100644 --- a/src/page/index/components/BrandDetail/BrandDetail.vue +++ b/src/page/index/components/BrandDetail/BrandDetail.vue @@ -145,7 +145,18 @@ const handleGetData = async () => { let req: any = { ProvinceCode: "530000" } - const data = await handleGetBrandStructureAnalysis(req) + // const data = await handleGetBrandStructureAnalysis(req) + let BrandDetail = sessionStorage.getItem('BrandDetail') + let data: any = [] + if (BrandDetail) { + data = JSON.parse(BrandDetail) + } else { + data = await handleGetBrandStructureAnalysis(req) + sessionStorage.setItem("BrandDetail", JSON.stringify(data)) + } + + + let category: any = [] let pieData: any = [] if (data && data.length > 0) { @@ -170,40 +181,63 @@ const handleGetData = async () => { // } // const data = await handleGetBusinessTradeTree(req) - const listData = await handleGetBusinessTradeTree({ - PROVINCE_CODE: "530000", - PageIndex: 1 - // BRAND_STATE: 1, - // SERVERPART_IDS: props.currentService?.SERVERPART_ID || "" - }) + // const listData = await handleGetBusinessTradeTree({ + // PROVINCE_CODE: "530000", + // PageIndex: 1 + // // BRAND_STATE: 1, + // // SERVERPART_IDS: props.currentService?.SERVERPART_ID || "" + // }) - let tableList: any = [] - if (listData && listData.length > 0) { - listData.forEach((item: any) => { - tableList.push({ label: item.AUTOSTATISTICS_NAME, value: item.AUTOSTATISTICS_ID }) + let BrandTab = sessionStorage.getItem('BrandTab') + let BrandTabList = sessionStorage.getItem('BrandTabList') + let listData: any = [] + if (BrandTab && BrandTabList) { + let obj = JSON.parse(BrandTab) + let list: any = JSON.parse(BrandTabList) + allBrandObjData.value = obj + brandListData.value = obj[list[0].value] + } else { + listData = await handleGetBusinessTradeTree({ + PROVINCE_CODE: "530000", + PageIndex: 1 + // BRAND_STATE: 1, + // SERVERPART_IDS: props.currentService?.SERVERPART_ID || "" }) - } + let tableList: any = [] - tabList.value = tableList + if (listData && listData.length > 0) { + listData.forEach((item: any) => { + tableList.push({ label: item.AUTOSTATISTICS_NAME, value: item.AUTOSTATISTICS_ID }) + }) + } - let obj: any = {} + tabList.value = tableList + sessionStorage.setItem("BrandTabList", JSON.stringify(tableList)) - if (tableList && tableList.length > 0) { - for (let i = 0; i < tableList.length; i++) { - obj[tableList[i].value] = await handleGetTableData(tableList[i].value) + let obj: any = {} - if (i === 0) { - console.log('i 0 ', obj[tableList[i].value]); - brandListData.value = obj[tableList[i].value] + if (tableList && tableList.length > 0) { + for (let i = 0; i < tableList.length; i++) { + obj[tableList[i].value] = await handleGetTableData(tableList[i].value) + + if (i === 0) { + console.log('i 0 ', obj[tableList[i].value]); + brandListData.value = obj[tableList[i].value] + } } } + console.log('obj', obj); + sessionStorage.setItem("BrandTab", JSON.stringify(obj)) + allBrandObjData.value = obj + brandListData.value = obj[tableList[0].value] + } - console.log('obj', obj); - allBrandObjData.value = obj - brandListData.value = obj[tableList[0].value] + + + // await handleGetTableData(tableList[0].value) let res: any = { diff --git a/src/page/index/components/BusinessCase/BusinessCase.vue b/src/page/index/components/BusinessCase/BusinessCase.vue index 7819133..fc3f5ab 100644 --- a/src/page/index/components/BusinessCase/BusinessCase.vue +++ b/src/page/index/components/BusinessCase/BusinessCase.vue @@ -88,7 +88,16 @@ const handleGetData = async () => { ServerpartId: props.currentService?.SERVERPART_ID || "", } - const data = await handleCodeGetRevenueCompare(req) + let BusinessCase = sessionStorage.getItem('BusinessCase') + let data: any = [] + if (BusinessCase) { + data = JSON.parse(BusinessCase) + } else { + data = await handleCodeGetRevenueCompare(req) + sessionStorage.setItem("BusinessCase", JSON.stringify(data)) + } + + // const data = await handleCodeGetRevenueCompare(req) getAllData.value = data diff --git a/src/page/index/components/BusinessStructure/BusinessStructure.vue b/src/page/index/components/BusinessStructure/BusinessStructure.vue index ef0b818..de7820b 100644 --- a/src/page/index/components/BusinessStructure/BusinessStructure.vue +++ b/src/page/index/components/BusinessStructure/BusinessStructure.vue @@ -166,7 +166,18 @@ const handleGetData = async () => { ServerpartId: props.currentService?.SERVERPART_ID || "" } - const data = await handleGetBusinessTradeRevenue(req) + let BusinessStructure = sessionStorage.getItem('BusinessStructure') + let data: any = [] + if (BusinessStructure) { + data = JSON.parse(BusinessStructure) + } else { + data = await handleGetBusinessTradeRevenue(req) + sessionStorage.setItem("BusinessStructure", JSON.stringify(data)) + } + + + + // const data = await handleGetBusinessTradeRevenue(req) let list: any = data.BusinessTradeRank diff --git a/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue b/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue index 16d0809..37dd321 100644 --- a/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue +++ b/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue @@ -206,7 +206,19 @@ const handleGetData = async () => { Statistics_Date: moment().subtract(1, 'd').format('YYYY-MM-DD'), Serverpart_ID: '' } - const data = await handleGetTransactionConvert(req) + + let ConsumptionConversion = sessionStorage.getItem('ConsumptionConversion') + let data: any = [] + if (ConsumptionConversion) { + data = JSON.parse(ConsumptionConversion) + } else { + data = await handleGetTransactionConvert(req) + sessionStorage.setItem("ConsumptionConversion", JSON.stringify(data)) + } + + + + // const data = await handleGetTransactionConvert(req) let carList = data.BayonetList.data diff --git a/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue b/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue index 199f972..5416b37 100644 --- a/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue +++ b/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue @@ -112,7 +112,18 @@ const handleGetData = async () => { StatisticsDate: moment().subtract(1, 'd').format('YYYY-MM-DD'), // ServerpartId: '' } - const data = await handleGetGetBusinessTradeLevel(req) + + let ConsumptionLevel = sessionStorage.getItem('ConsumptionLevel') + let data: any = [] + if (ConsumptionLevel) { + data = JSON.parse(ConsumptionLevel) + } else { + data = await handleGetGetBusinessTradeLevel(req) + sessionStorage.setItem("ConsumptionLevel", JSON.stringify(data)) + } + + + // const data = await handleGetGetBusinessTradeLevel(req) category = data.legend diff --git a/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue b/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue index c23f3a4..8a3f2a2 100644 --- a/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue +++ b/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue @@ -137,7 +137,18 @@ const handleGetData = async () => { Serverpart_ID: '', TimeSpan: 1 } - const data = await handleGetTransactionTimeAnalysis(req) + + + let ConsumptionPeriod = sessionStorage.getItem('ConsumptionPeriod') + let data: any = [] + if (ConsumptionPeriod) { + data = JSON.parse(ConsumptionPeriod) + } else { + data = await handleGetTransactionTimeAnalysis(req) + sessionStorage.setItem("ConsumptionPeriod", JSON.stringify(data)) + } + + // const data = await handleGetTransactionTimeAnalysis(req) if (data && data.length > 0) { diff --git a/src/page/index/components/ContractInformation/ContractInformation.vue b/src/page/index/components/ContractInformation/ContractInformation.vue index 717966f..fcf2736 100644 --- a/src/page/index/components/ContractInformation/ContractInformation.vue +++ b/src/page/index/components/ContractInformation/ContractInformation.vue @@ -45,7 +45,19 @@ const handleGetData = async () => { ProvinceCode: '530000', GetFromRedis: true } - const data = await handleGetProjectSummaryInfo(req) + + + let ContractInformation = sessionStorage.getItem('ContractInformation') + let data: any = [] + if (ContractInformation) { + data = JSON.parse(ContractInformation) + } else { + data = await handleGetProjectSummaryInfo(req) + sessionStorage.setItem("ContractInformation", JSON.stringify(data)) + } + + + // const data = await handleGetProjectSummaryInfo(req) console.log('handleGetDatahandleGetDatahandleGetDatahandleGetData', data); diff --git a/src/page/index/components/CoreBusinessData/CoreBusinessData.vue b/src/page/index/components/CoreBusinessData/CoreBusinessData.vue index be2b811..f19ff04 100644 --- a/src/page/index/components/CoreBusinessData/CoreBusinessData.vue +++ b/src/page/index/components/CoreBusinessData/CoreBusinessData.vue @@ -57,7 +57,19 @@ const handleGetMapRealData = async () => { const req: any = { serverPartId: props.currentService?.SERVERPART_ID || "" } - const data = await handleGetRealData(req) + + + let CoreBusinessData = sessionStorage.getItem('CoreBusinessData') + let data: any = [] + if (CoreBusinessData) { + data = JSON.parse(CoreBusinessData) + } else { + data = await handleGetRealData(req) + sessionStorage.setItem("CoreBusinessData", JSON.stringify(data)) + } + + + // const data = await handleGetRealData(req) // 【1000:门店营收 2000:油品 3000:加水 4000:尿素 5000:新能源 6000:断面流量 6001:入区车流 6002:入区客流】 console.log('实时数据', data); diff --git a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue index f987983..03940d2 100644 --- a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue +++ b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue @@ -185,7 +185,20 @@ const handleGetData = async () => { provinceCode: '530000', statisticsMonth: moment(moment().subtract(1, 'M')).format('YYYYMM'), } - const data = await handleGetCustomerAgeRatio(req) + + + + let CustomerAgeGroup = sessionStorage.getItem('CustomerAgeGroup') + let data: any = [] + if (CustomerAgeGroup) { + data = JSON.parse(CustomerAgeGroup) + } else { + data = await handleGetCustomerAgeRatio(req) + sessionStorage.setItem("CustomerAgeGroup", JSON.stringify(data)) + } + + + // const data = await handleGetCustomerAgeRatio(req) console.log('fdisfsauifhdsaj', data); diff --git a/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue b/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue index fc5582f..2c3e7d0 100644 --- a/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue +++ b/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue @@ -169,7 +169,16 @@ const handleGetData = async () => { sortStr: 'TOTAL_COUNT desc' } - const data = await handleGetCustomerSaleRatio(req) + let CustomerConsumptionPreferences = sessionStorage.getItem('CustomerConsumptionPreferences') + let data: any = [] + if (CustomerConsumptionPreferences) { + data = JSON.parse(CustomerConsumptionPreferences) + } else { + data = await handleGetCustomerSaleRatio(req) + sessionStorage.setItem("CustomerConsumptionPreferences", JSON.stringify(data)) + } + + // const data = await handleGetCustomerSaleRatio(req) let category: string[] = [] diff --git a/src/page/index/components/CustomerGroup/CustomerGroup.vue b/src/page/index/components/CustomerGroup/CustomerGroup.vue index 4a3b709..3ed3214 100644 --- a/src/page/index/components/CustomerGroup/CustomerGroup.vue +++ b/src/page/index/components/CustomerGroup/CustomerGroup.vue @@ -169,8 +169,17 @@ const handleGetData = async () => { serverpartId: props.currentService?.SERVERPART_ID || "", } - const data = await handleGetCustomerGroupRatio(req) - console.log('jfdjsfklasjflsd', data); + let CustomerGroup = sessionStorage.getItem('CustomerGroup') + let data: any = [] + if (CustomerGroup) { + data = JSON.parse(CustomerGroup) + } else { + data = await handleGetCustomerGroupRatio(req) + sessionStorage.setItem("CustomerGroup", JSON.stringify(data)) + } + + + // const data = await handleGetCustomerGroupRatio(req) let res: any = [] if (data && data.length > 0) { diff --git a/src/page/index/components/DetailedPayment/DetailedPayment.vue b/src/page/index/components/DetailedPayment/DetailedPayment.vue index a50f252..0c97340 100644 --- a/src/page/index/components/DetailedPayment/DetailedPayment.vue +++ b/src/page/index/components/DetailedPayment/DetailedPayment.vue @@ -103,8 +103,16 @@ const handleGetSectionFlowCount = async () => { const req: any = { GetFromRedis: true } - const data = await handleGetProjectYearlyArrearageList(req) - console.log('handleGetProjectYearlyArrearageListhandleGetProjectYearlyArrearageListhandleGetProjectYearlyArrearageList', data); + // const data = await handleGetProjectYearlyArrearageList(req) + let DetailedPayment = sessionStorage.getItem('DetailedPayment') + let data: any = [] + if (DetailedPayment) { + data = JSON.parse(DetailedPayment) + } else { + data = await handleGetProjectYearlyArrearageList(req) + sessionStorage.setItem("DetailedPayment", JSON.stringify(data)) + } + let category: any = [] let seriesData: any = [] diff --git a/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue b/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue index f4a20d7..7ab8add 100644 --- a/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue +++ b/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue @@ -11,6 +11,7 @@ import { LegendComponent } from 'echarts/components'; import { CanvasRenderer } from 'echarts/renderers'; +import { handleGetHolidayRevenueRatio } from '../../service'; // 注册组件 @@ -71,19 +72,19 @@ const handleGoMounted = async () => { legend: [ // 使用两个legend对象分别控制 // 第一行:外圈圆环图例 { - data: ['A类', 'B类', 'C类', 'D类'].map(name => ({ + data: res.bigType.map((name: string) => ({ name, icon: 'circle' })), orient: 'horizontal', top: 'bottom', left: 'center', - padding: [0, 0, 30, 0], // 下边距为内圈图例留空间 + padding: [0, 0, 60, 0], // 下边距为内圈图例留空间 textStyle: { color: '#fff' } }, // 第二行:内圈饼图图例 { - data: ['子类1', '子类2', '子类3'].map(name => ({ + data: res.smallType.map((name: string) => ({ name, icon: 'rect' })), @@ -98,14 +99,15 @@ const handleGoMounted = async () => { { name: '外圈数据', type: 'pie', - radius: ['50%', '70%'], - center: ['50%', '45%'], // 稍微上移给图例留空间 - data: [ - { value: 335, name: 'A类' }, - { value: 310, name: 'B类' }, - { value: 234, name: 'C类' }, - { value: 135, name: 'D类' } - ], + radius: ['50%', '65%'], + center: ['50%', '35%'], // 稍微上移给图例留空间 + data: res.bigData, + // data: [ + // { value: 335, name: 'A类' }, + // { value: 310, name: 'B类' }, + // { value: 234, name: 'C类' }, + // { value: 135, name: 'D类' } + // ], label: { show: false } }, // 内圈饼图 @@ -113,12 +115,13 @@ const handleGoMounted = async () => { name: '内圈数据', type: 'pie', radius: ['0%', '30%'], - center: ['50%', '45%'], // 与外圈同中心 - data: [ - { value: 100, name: '子类1' }, - { value: 200, name: '子类2' }, - { value: 300, name: '子类3' } - ], + center: ['50%', '35%'], // 与外圈同中心 + data: res.smallData, + // data: [ + // { value: 100, name: '子类1' }, + // { value: 200, name: '子类2' }, + // { value: 300, name: '子类3' } + // ], label: { show: false } } ] @@ -133,6 +136,52 @@ const handleGoMounted = async () => { // 拿到数据 const handleGetRealData = async () => { + const req: any = { + ProvinceCode: '530000' + } + + + + let FestivalRevenueSumInfo = sessionStorage.getItem('FestivalRevenueSumInfo') + let data: any = [] + if (FestivalRevenueSumInfo) { + data = JSON.parse(FestivalRevenueSumInfo) + } else { + data = await handleGetHolidayRevenueRatio(req) + sessionStorage.setItem("OverviewOfServiceAreaBusiness", JSON.stringify(data)) + } + + + // const data = await handleGetHolidayRevenueRatio(req) + console.log('datadatadatadatadata', data) + + // 圆环图数据 + let bigData: any = [] + let bigType: any = [] + // 里面的扇形数据 + let smallData: any = [] + let smallType: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + bigData.push({ name: `${item.name} ${item.value}%`, value: Number(item.value) }) + bigType.push(`${item.name} ${item.value}%`) + if (item.name === "节假日") { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + smallType.push(`${subItem.name} ${subItem.value}%`) + smallData.push({ name: `${subItem.name} ${subItem.value}%`, value: Number(subItem.value) }) + }) + } + } + }) + } + + return { + bigData: bigData, + smallData: smallData, + bigType: bigType, + smallType: smallType, + } } diff --git a/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue b/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue index 1828dfb..838061b 100644 --- a/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue +++ b/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue @@ -59,7 +59,7 @@ onMounted(async () => { return `