diff --git a/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue b/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue index c232d3b..42a03c1 100644 --- a/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue +++ b/src/page/index/components/BrandConsumptionLevel/BrandConsumptionLevel.vue @@ -146,6 +146,19 @@ const handleGetData = async () => { seriesData: seriesData, } + + let BrandConsumptionLevelAI = sessionStorage.getItem('BrandConsumptionLevelAI') + if (BrandConsumptionLevelAI) { } else { + let aiObj: any = {} + + for (let i = 0; i < res.category.length; i++) { + aiObj[res.category[i]] = `低消费占比${list[0].data[i]},普通消费占比${list[1].data[i]},高消费占比${list[2].data[i]},` + } + + + sessionStorage.setItem("BrandConsumptionLevelAI", JSON.stringify(aiObj)) + } + return res } diff --git a/src/page/index/components/BusinessCase/BusinessCase.vue b/src/page/index/components/BusinessCase/BusinessCase.vue index fc3f5ab..fd07dc9 100644 --- a/src/page/index/components/BusinessCase/BusinessCase.vue +++ b/src/page/index/components/BusinessCase/BusinessCase.vue @@ -116,6 +116,7 @@ const handleGetData = async () => { }) } + let aiObj1: any = {} // 营收 let res: any = [] if (monthList && monthList.length > 0) { @@ -125,12 +126,14 @@ const handleGetData = async () => { let newData: any = subItem.data list.push(Number(((newData[item - 1][1]) / 10000).toFixed(2))) }) + aiObj1[`${item}月`] = `工作日平均${list[1]}元,周末平均${list[2]}元,节假日平均${list[3]}元` res.push(list) }) } // 客单量 let res2: any = [] + let aiObj2: any = {} if (monthList && monthList.length > 0) { monthList.forEach((item: number) => { let list: any = [`${item}月`] @@ -138,12 +141,14 @@ const handleGetData = async () => { let newData: any = subItem.data list.push(Number(((newData[item - 1][1]) / 10000).toFixed(2))) }) + aiObj2[`${item}月`] = `工作日平均${list[1]}元,周末平均${list[2]}元,节假日平均${list[3]}元` res2.push(list) }) } // 均价 let res3: any = [] + let aiObj3: any = {} if (monthList && monthList.length > 0) { monthList.forEach((item: number) => { let list: any = [`${item}月`] @@ -151,6 +156,7 @@ const handleGetData = async () => { let newData: any = subItem.data list.push(newData[item - 1][1]) }) + aiObj3[`${item}月`] = `工作日平均${list[1]}元,周末平均${list[2]}元,节假日平均${list[3]}元` res3.push(list) }) } @@ -163,6 +169,16 @@ const handleGetData = async () => { } realData.value = obj + let BusinessCaseAI = sessionStorage.getItem('BusinessCaseAI') + if (BusinessCaseAI) { } else { + let aiObj: any = { + "营收金额": aiObj1, + "客单量": aiObj2, + "客单均价": aiObj3, + } + sessionStorage.setItem("BusinessCaseAI", JSON.stringify(aiObj)) + } + handleShowData(selectTab.value) } diff --git a/src/page/index/components/BusinessStructure/BusinessStructure.vue b/src/page/index/components/BusinessStructure/BusinessStructure.vue index de7820b..ad31d18 100644 --- a/src/page/index/components/BusinessStructure/BusinessStructure.vue +++ b/src/page/index/components/BusinessStructure/BusinessStructure.vue @@ -179,7 +179,7 @@ const handleGetData = async () => { // const data = await handleGetBusinessTradeRevenue(req) - + let aiObj: any = {} let list: any = data.BusinessTradeRank let seriesData: any = [] let realData: any = [] @@ -200,6 +200,7 @@ const handleGetData = async () => { name: item.name, value: item.value }) + aiObj[item.name] = item.data }) } @@ -211,6 +212,13 @@ const handleGetData = async () => { lengedData: lengedData } lengedList.value = lengedLists + + let BusinessStructureAI = sessionStorage.getItem('BusinessStructureAI') + if (BusinessStructureAI) { } else { + sessionStorage.setItem("BusinessStructureAI", JSON.stringify(aiObj)) + } + + return res } diff --git a/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue b/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue index 37dd321..0b07cd6 100644 --- a/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue +++ b/src/page/index/components/ConsumptionConversion/ConsumptionConversion.vue @@ -225,10 +225,14 @@ const handleGetData = async () => { let orderList = data.TransactionList.data + let aiObjCar: any = {} + let aiOrder: any = {} + if (carList && carList.length > 0) { carList.forEach((item: any) => { carResList.push((item[1])) carRealResList.push(item[1]) + aiObjCar[`${item[0]}时`] = item[1] + '辆' }) } @@ -237,6 +241,7 @@ const handleGetData = async () => { category.push(item[0]) orderResList.push((item[1])) orderRealResList.push(item[1]) + aiOrder[`${item[0]}时`] = item[1] + '笔' }) } @@ -251,6 +256,16 @@ const handleGetData = async () => { } + let ConsumptionConversionAI = sessionStorage.getItem('ConsumptionConversionAI') + if (ConsumptionConversionAI) { } else { + let aiObj: any = { + "时段车流": aiObjCar, + "时段客单": aiOrder + } + sessionStorage.setItem("ConsumptionConversionAI", JSON.stringify(aiObj)) + } + + return res } diff --git a/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue b/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue index 5416b37..3aa0a82 100644 --- a/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue +++ b/src/page/index/components/ConsumptionLevel/ConsumptionLevel.vue @@ -129,6 +129,7 @@ const handleGetData = async () => { category = data.legend let list = data.ColumnList + if (list && list.length > 0) { list.forEach((item: any) => { seriesData.push({ @@ -153,6 +154,17 @@ const handleGetData = async () => { seriesData: seriesData, } + let ConsumptionLevelAI = sessionStorage.getItem('ConsumptionLevelAI') + if (ConsumptionLevelAI) { } else { + let aiObj: any = {} + + for (let i = 0; i < res.category.length; i++) { + aiObj[res.category[i]] = `低消费占比${list[0].data[i]},普通消费占比${list[1].data[i]},高消费占比${list[2].data[i]},` + } + + sessionStorage.setItem("ConsumptionLevelAI", JSON.stringify(aiObj)) + } + return res } diff --git a/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue b/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue index 8a3f2a2..50c70ca 100644 --- a/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue +++ b/src/page/index/components/ConsumptionPeriod/ConsumptionPeriod.vue @@ -150,7 +150,7 @@ const handleGetData = async () => { // const data = await handleGetTransactionTimeAnalysis(req) - + let aiObj: any = {} if (data && data.length > 0) { // 拿到笔数的合计 let orderSum: number = 0 @@ -158,7 +158,6 @@ const handleGetData = async () => { orderSum += Number(item.data) }) - // data 是笔数 key 是金额 data.forEach((item: any, index: number) => { if (index < 10) { @@ -168,18 +167,20 @@ const handleGetData = async () => { } seriesData.push(Number(((item.data / orderSum) * 100).toFixed(2))) + aiObj[`${item.name}时`] = item.data + '单' }) } - - - - let res: any = { category: category,// x轴的内容 seriesData: seriesData, } + let ConsumptionPeriodAI = sessionStorage.getItem('ConsumptionPeriodAI') + if (ConsumptionPeriodAI) { } else { + sessionStorage.setItem("ConsumptionPeriodAI", JSON.stringify(aiObj)) + } + return res } diff --git a/src/page/index/components/CoreBusinessData/CoreBusinessData.vue b/src/page/index/components/CoreBusinessData/CoreBusinessData.vue index f19ff04..983ea56 100644 --- a/src/page/index/components/CoreBusinessData/CoreBusinessData.vue +++ b/src/page/index/components/CoreBusinessData/CoreBusinessData.vue @@ -75,7 +75,8 @@ const handleGetMapRealData = async () => { console.log('实时数据', data); - + // 给ai的数据 + let aiObj: any = {} if (data && data.length > 0) { data.forEach((item: any) => { // 门店营收 @@ -88,6 +89,7 @@ const handleGetMapRealData = async () => { // value: item.totalAmount.toString().length > 8 ? Number((item.totalAmount / 10000).toFixed(2)).toLocaleString() : Number(item.totalAmount).toLocaleString(), // unit: item.totalAmount.toString().length > 8 ? '万元' : '元' // } + aiObj["门店营收"] = `${item.totalAmount}${item.totalAmountUnit}` revenueAmonut.value = obj } else if (item.dataType === 2000) { // 油品消耗 @@ -99,6 +101,7 @@ const handleGetMapRealData = async () => { // value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // unit: item.totalCount.toString().length > 8 ? '万升' : '升' // } + aiObj["油品消耗"] = `${item.totalCount}${item.totalCountUnit}` oilConsumption.value = obj } else if (item.dataType === 3000) { // 加水量 @@ -110,6 +113,7 @@ const handleGetMapRealData = async () => { // value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // unit: item.totalCount.toString().length > 8 ? '万升' : '升' // } + aiObj["加水量"] = `${item.totalCount}${item.totalCountUnit}` waterAddition.value = obj } else if (item.dataType === 4000) { // 尿素 @@ -121,6 +125,7 @@ const handleGetMapRealData = async () => { // value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // unit: item.totalCount.toString().length > 8 ? '万升' : '升' // } + aiObj["尿素"] = `${item.totalCount}${item.totalCountUnit}` urea.value = obj } else if (item.dataType === 5000) { // 充电次数 @@ -132,10 +137,17 @@ const handleGetMapRealData = async () => { // value: item.totalTicket.toString().length > 8 ? Number((item.totalTicket / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // unit: item.totalTicket.toString().length > 8 ? '万单' : '单' // } + aiObj["充电次数"] = `${item.totalTicket}${item.totalTicketUnit}` chargingCycles.value = obj } }) } + + let CoreBusinessDataAI = sessionStorage.getItem('CoreBusinessDataAI') + if (CoreBusinessDataAI) { } else { + sessionStorage.setItem("CoreBusinessDataAI", JSON.stringify(aiObj)) + } + } diff --git a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue index 03940d2..1af6d66 100644 --- a/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue +++ b/src/page/index/components/CustomerAgeGroup/CustomerAgeGroup.vue @@ -230,6 +230,20 @@ const handleGetData = async () => { seriesDataWoman: seriesDataWoman// 女生 } + + let CustomerAgeGroupAI = sessionStorage.getItem('CustomerAgeGroupAI') + if (CustomerAgeGroupAI) { } else { + let aiRes: any = {} + + for (let i = 0; i < res.category.length; i++) { + aiRes[res.category[i]] = { + "男性": seriesDataMan[i] + '%', + "女性": seriesDataWoman[i] + '%', + } + } + sessionStorage.setItem("CustomerAgeGroupAI", JSON.stringify(aiRes)) + } + return res } diff --git a/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue b/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue index 2c3e7d0..b2d5757 100644 --- a/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue +++ b/src/page/index/components/CustomerConsumptionPreferences/CustomerConsumptionPreferences.vue @@ -185,6 +185,8 @@ const handleGetData = async () => { let seriesData: number[] = [] let realData: string[] = [] + let aiObj: any = {} + if (data.CustomerSaleList && data.CustomerSaleList.length > 0) { let list = data.CustomerSaleList.slice(0, 15) @@ -192,9 +194,17 @@ const handleGetData = async () => { category.push(item.BusinessTradeName) seriesData.push(item.TotalRatio) realData.push(item.TotalRatio) + aiObj[item.BusinessTradeName] = `占比${item.TotalRatio}%` }) } + let CustomerConsumptionPreferencesAI = sessionStorage.getItem('CustomerConsumptionPreferencesAI') + if (CustomerConsumptionPreferencesAI) { } else { + + sessionStorage.setItem("CustomerConsumptionPreferencesAI", JSON.stringify(aiObj)) + } + + return { category: category, seriesData: seriesData, diff --git a/src/page/index/components/CustomerGroup/CustomerGroup.vue b/src/page/index/components/CustomerGroup/CustomerGroup.vue index 3ed3214..1dc4a08 100644 --- a/src/page/index/components/CustomerGroup/CustomerGroup.vue +++ b/src/page/index/components/CustomerGroup/CustomerGroup.vue @@ -182,18 +182,31 @@ const handleGetData = async () => { // const data = await handleGetCustomerGroupRatio(req) let res: any = [] + let aiObj: any = {} + if (data && data.length > 0) { data.forEach((item: any) => { // let list: any = [] + let obj: any = {} if (item.data && item.data.length > 0) { item.data.forEach((subItem: any) => { subItem.push(item.name) res.push(subItem) + obj[`${subItem[0]}岁`] = `交易金额${subItem[1]}元,占比${subItem[2]}%` }) } + aiObj[item.name] = obj // res.push(list) }) } + + + let CustomerGroupAI = sessionStorage.getItem('CustomerGroupAI') + if (CustomerGroupAI) { } else { + sessionStorage.setItem("CustomerGroupAI", JSON.stringify(aiObj)) + } + + return res } diff --git a/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue b/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue index 7ab8add..70900e1 100644 --- a/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue +++ b/src/page/index/components/FestivalRevenueSumInfo/FestivalRevenueSumInfo.vue @@ -140,21 +140,21 @@ const handleGetRealData = async () => { 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)) + sessionStorage.setItem("FestivalRevenueSumInfo", JSON.stringify(data)) } // const data = await handleGetHolidayRevenueRatio(req) console.log('datadatadatadatadata', data) + let bigAiObj: any = {} + let smallAiObj: any = {} // 圆环图数据 let bigData: any = [] let bigType: any = [] @@ -170,12 +170,27 @@ const handleGetRealData = async () => { item.children.forEach((subItem: any) => { smallType.push(`${subItem.name} ${subItem.value}%`) smallData.push({ name: `${subItem.name} ${subItem.value}%`, value: Number(subItem.value) }) + smallAiObj[subItem.name] = subItem.value + '%' }) } } + bigAiObj[item.name] = item.value + '%' }) } + + let FestivalRevenueSumInfoAI = sessionStorage.getItem('FestivalRevenueSumInfoAI') + if (FestivalRevenueSumInfoAI) { } else { + let aiObj: any = { + "节假日普通日": bigAiObj, + "具体节假日": smallAiObj + } + sessionStorage.setItem("FestivalRevenueSumInfoAI", JSON.stringify(aiObj)) + } + + + + return { bigData: bigData, smallData: smallData, diff --git a/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue b/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue index 838061b..dd22319 100644 --- a/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue +++ b/src/page/index/components/GenderCustomerGroup/GenderCustomerGroup.vue @@ -141,11 +141,14 @@ const handleGetSectionFlowCount = async () => { let realData: any = [] let legendData: any = [] + let aiObj: any = {} + if (data && data.length > 0) { data.forEach((item: any) => { if (item.name === '男性' || item.name === '女性') { seriesData.push({ name: `${item.name} ${item.data[0]}%`, value: item.data[0] }) legendData.push({ name: `${item.name} ${item.data[0]}%` }) + aiObj[item.name] = item.data[0] + '%' } }) } @@ -157,6 +160,12 @@ const handleGetSectionFlowCount = async () => { realData: realData,// 真实数据 legendData: legendData } + + let GenderCustomerGroupAI = sessionStorage.getItem('GenderCustomerGroupAI') + if (GenderCustomerGroupAI) { } else { + sessionStorage.setItem("GenderCustomerGroupAI", JSON.stringify(aiObj)) + } + return res } diff --git a/src/page/index/components/OverviewOfServiceArea/OverviewOfServiceArea.vue b/src/page/index/components/OverviewOfServiceArea/OverviewOfServiceArea.vue index 64a82c1..c36cf4b 100644 --- a/src/page/index/components/OverviewOfServiceArea/OverviewOfServiceArea.vue +++ b/src/page/index/components/OverviewOfServiceArea/OverviewOfServiceArea.vue @@ -64,6 +64,28 @@ const handleGetData = async () => { let ServerpartTotalCount: number = data.ServerpartTotalCount + let OverviewOfServiceAreaAI = sessionStorage.getItem('OverviewOfServiceAreaAI') + if (OverviewOfServiceAreaAI) { + + } else { + let res: any = { + "管理站点": data.ServerpartTotalCount, + "服务区": data.serviceAllTotal, + "停车区": data.ParkingServiceCount, + "加水站": data.WaterStationCount, + "观景台": data.ViewingDeckCount, + "休息区": data.RestAreaCount, + "加油站": data.REFUELINGGUNTotal, + "充电桩": data.ChargingStationTotal, + "司机之家": data.HASPILOTLOUNGETotal, + "母婴室": data.NursingRoomTotal, + "尿素": data.URECOUNTTotal, + "加水": data.WaterCount, + } + sessionStorage.setItem('OverviewOfServiceAreaAI', JSON.stringify(res)) + } + + // if (data && data.length > 0) { // data.forEach((item: any) => { // serviceAllTotal += 1 @@ -156,8 +178,19 @@ const handleGetData = async () => { sessionStorage.setItem("OverviewOfServiceAreaBusiness", JSON.stringify(businessData)) } + // 给AI分析准备的数据 + let OverviewOfServiceAreaBusinessAI = sessionStorage.getItem('OverviewOfServiceAreaBusinessAI') + if (OverviewOfServiceAreaBusinessAI) { + } else { + let res: any = { + "服务区承载": { + "繁忙": businessData.OtherData.value + '座', + "空闲": businessData.OtherData.data + '座' + } + } + sessionStorage.setItem('OverviewOfServiceAreaBusinessAI', JSON.stringify(res)) + } - console.log('服务区繁忙度数据:', businessData); let businessRes: any = businessData.OtherData @@ -236,12 +269,12 @@ const handleGetData = async () => {
加油站/座
{{ serviceInfo?.REFUELINGGUNTotal || "0" - }}
+ }}
充电桩/座
{{ serviceInfo?.ChargingStationTotal || "0" - }}
+ }}
+ + + +