update
This commit is contained in:
parent
5e82193c4d
commit
3cdcd625fb
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import moment from 'moment';
|
||||
import { handleGetFiveNumber } from '../../../../options/serveice';
|
||||
import { handleGetMonthlyBusinessRevenue, handleGetRealData } from '../../service';
|
||||
import { handleGetEnergyRevenueInfo, handleGetMonthlyBusinessRevenue, handleGetRealData } from '../../service';
|
||||
import CenterTitle from '../CenterTitle/CenterTitle.vue';
|
||||
import NumberRoller from '../TradingAlert/NumberRoller.vue';
|
||||
import './CoreBusinessData.less'
|
||||
@ -85,24 +85,95 @@ const handleGetMapRealData = async () => {
|
||||
serverPartId: props.currentService?.SERVERPART_ID || ""
|
||||
}
|
||||
|
||||
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 reqAddOil: any = {
|
||||
DataType: 2000,
|
||||
StatisticsDate: moment().format('YYYY-MM-DD'),
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
}
|
||||
|
||||
const reqAddWater: any = {
|
||||
DataType: 3000,
|
||||
StatisticsDate: moment().format('YYYY-MM-DD'),
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
}
|
||||
|
||||
const reqUreaData: any = {
|
||||
DataType: 4000,
|
||||
StatisticsDate: moment().format('YYYY-MM-DD'),
|
||||
ShowWY: true,
|
||||
ShowLargeUnit: true,
|
||||
}
|
||||
|
||||
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 OilData: any = await handleGetEnergyRevenueInfo(reqAddOil)
|
||||
const addWaterData: any = await handleGetEnergyRevenueInfo(reqAddWater)
|
||||
const UreaData: any = await handleGetEnergyRevenueInfo(reqUreaData)
|
||||
|
||||
// console.log('addWaterDataaddWaterDataaddWaterData', addWaterData);
|
||||
// console.log('UreaDataUreaDataUreaDataUreaData', UreaData);
|
||||
|
||||
// const data = await handleGetRealData(req)
|
||||
// 【1000:门店营收 2000:油品 3000:加水 4000:尿素 5000:新能源 6000:断面流量 6001:入区车流 6002:入区客流】
|
||||
|
||||
console.log('实时数据', data);
|
||||
|
||||
|
||||
// 给ai的数据
|
||||
let aiObj: any = {}
|
||||
|
||||
if (OilData) {
|
||||
// 油品
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(OilData.value) || 0,
|
||||
unit: '万元',
|
||||
totalCount: handleGetPonitFixed(OilData.data) || 0,
|
||||
totalCountUnit: '吨',
|
||||
}
|
||||
|
||||
aiObj["油品消耗"] = `${OilData.data}吨`
|
||||
oilConsumption.value = obj
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(oilConsumption)
|
||||
}
|
||||
|
||||
if (addWaterData) {
|
||||
// 加水量
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(addWaterData.value) || 0,
|
||||
unit: '万元',
|
||||
totalCount: handleGetPonitFixed(addWaterData.data) || 0,
|
||||
totalCountUnit: '吨',
|
||||
}
|
||||
|
||||
aiObj["加水量"] = `${addWaterData.data}吨`
|
||||
waterAddition.value = obj
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(waterAddition)
|
||||
}
|
||||
|
||||
if (UreaData) {
|
||||
// 尿素
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(UreaData.value) || 0,
|
||||
unit: '万元',
|
||||
totalCount: handleGetPonitFixed(UreaData.data) || 0,
|
||||
totalCountUnit: '吨',
|
||||
}
|
||||
|
||||
aiObj["尿素"] = `${UreaData.data}吨`
|
||||
urea.value = obj
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(urea)
|
||||
}
|
||||
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
// 门店营收
|
||||
@ -122,55 +193,59 @@ const handleGetMapRealData = async () => {
|
||||
revenueAmonut.value = obj
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(revenueAmonut)
|
||||
} else if (item.dataType === 2000) {
|
||||
// 油品消耗
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
unit: item.totalAmountUnit || '',
|
||||
totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
totalCountUnit: item.totalCountUnit || '',
|
||||
}
|
||||
// let obj: any = {
|
||||
// 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
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(oilConsumption)
|
||||
} else if (item.dataType === 3000) {
|
||||
// 加水量
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
unit: item.totalAmountUnit || '',
|
||||
totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
totalCountUnit: item.totalCountUnit || '',
|
||||
}
|
||||
// let obj: any = {
|
||||
// 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
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(waterAddition)
|
||||
} else if (item.dataType === 4000) {
|
||||
// 尿素
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
unit: item.totalAmountUnit || '',
|
||||
totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
totalCountUnit: item.totalCountUnit || '',
|
||||
}
|
||||
// let obj: any = {
|
||||
// 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
|
||||
// 启动滚动动画
|
||||
startSingleNumberAnimation(urea)
|
||||
} else if (item.dataType === 5000) {
|
||||
}
|
||||
// else if (item.dataType === 2000) {
|
||||
// // 油品消耗
|
||||
// let obj: any = {
|
||||
// value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
// unit: item.totalAmountUnit || '',
|
||||
// totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
// totalCountUnit: item.totalCountUnit || '',
|
||||
// }
|
||||
// // let obj: any = {
|
||||
// // 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
|
||||
// // 启动滚动动画
|
||||
// startSingleNumberAnimation(oilConsumption)
|
||||
// }
|
||||
// else if (item.dataType === 3000) {
|
||||
// // 加水量
|
||||
// let obj: any = {
|
||||
// value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
// unit: item.totalAmountUnit || '',
|
||||
// totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
// totalCountUnit: item.totalCountUnit || '',
|
||||
// }
|
||||
// // let obj: any = {
|
||||
// // 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
|
||||
// // 启动滚动动画
|
||||
// startSingleNumberAnimation(waterAddition)
|
||||
// }
|
||||
// else if (item.dataType === 4000) {
|
||||
// // 尿素
|
||||
// let obj: any = {
|
||||
// value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
// unit: item.totalAmountUnit || '',
|
||||
// totalCount: handleGetPonitFixed(item.totalCount) || 0,
|
||||
// totalCountUnit: item.totalCountUnit || '',
|
||||
// }
|
||||
// // let obj: any = {
|
||||
// // 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
|
||||
// // 启动滚动动画
|
||||
// startSingleNumberAnimation(urea)
|
||||
// }
|
||||
else if (item.dataType === 5000) {
|
||||
// 充电次数
|
||||
let obj: any = {
|
||||
value: handleGetPonitFixed(item.totalAmount) || 0,
|
||||
|
||||
@ -189,6 +189,15 @@ export async function handleGetRealData(params: any) {
|
||||
return data.Result_Data
|
||||
}
|
||||
|
||||
// .net的获取实时数据
|
||||
export async function handleGetEnergyRevenueInfo(params: any) {
|
||||
const data: any = await requestCode.encryptAESpost('/BigData/GetEnergyRevenueInfo', params)
|
||||
if (data.Result_Code !== 100) {
|
||||
return data
|
||||
}
|
||||
return data.Result_Data
|
||||
}
|
||||
|
||||
// 拿到实时数据 月度
|
||||
export async function handleGetMonthlyBusinessRevenue(params: any) {
|
||||
const data: any = await requestPos.post('/Revenue/GetMonthlyBusinessRevenue', params)
|
||||
|
||||
@ -2,6 +2,8 @@ import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
// import { notification } from 'antd';
|
||||
// import Cookies from 'js-cookie';
|
||||
import moment from 'moment';
|
||||
// @ts-ignore
|
||||
import { encryptAES } from '../options/handleAes.js'
|
||||
|
||||
// 定义 HTTP 状态码及其描述
|
||||
const codeMessage: Record<number, string> = {
|
||||
@ -73,6 +75,10 @@ instance.interceptors.response.use(
|
||||
const request = {
|
||||
get: (url: string, params?: any) => instance.get(url, { params }),
|
||||
post: (url: string, data?: any) => instance.post(url, data),
|
||||
encryptAESpost: (url: string, data?: any) => instance.post(url, {
|
||||
name: "",
|
||||
value: encryptAES(JSON.stringify(data))
|
||||
}),
|
||||
put: (url: string, data?: any) => instance.put(url, data),
|
||||
delete: (url: string, params?: any) => instance.delete(url, { params }),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user