This commit is contained in:
ylj20011123 2025-11-25 17:07:33 +08:00
parent 5e82193c4d
commit 3cdcd625fb
4 changed files with 149 additions and 59 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import moment from 'moment'; import moment from 'moment';
import { handleGetFiveNumber } from '../../../../options/serveice'; import { handleGetFiveNumber } from '../../../../options/serveice';
import { handleGetMonthlyBusinessRevenue, handleGetRealData } from '../../service'; import { handleGetEnergyRevenueInfo, handleGetMonthlyBusinessRevenue, handleGetRealData } from '../../service';
import CenterTitle from '../CenterTitle/CenterTitle.vue'; import CenterTitle from '../CenterTitle/CenterTitle.vue';
import NumberRoller from '../TradingAlert/NumberRoller.vue'; import NumberRoller from '../TradingAlert/NumberRoller.vue';
import './CoreBusinessData.less' import './CoreBusinessData.less'
@ -85,24 +85,95 @@ const handleGetMapRealData = async () => {
serverPartId: props.currentService?.SERVERPART_ID || "" serverPartId: props.currentService?.SERVERPART_ID || ""
} }
let CoreBusinessData = sessionStorage.getItem('CoreBusinessData') // 尿
let data: any = [] const reqAddOil: any = {
if (CoreBusinessData) { DataType: 2000,
data = JSON.parse(CoreBusinessData) StatisticsDate: moment().format('YYYY-MM-DD'),
} else { ShowWY: true,
data = await handleGetRealData(req) ShowLargeUnit: true,
sessionStorage.setItem("CoreBusinessData", JSON.stringify(data))
} }
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) // const data = await handleGetRealData(req)
// 1000 2000 3000 4000尿 5000 6000 6001 6002 // 1000 2000 3000 4000尿 5000 6000 6001 6002
console.log('实时数据', data); console.log('实时数据', data);
// ai // ai
let aiObj: any = {} 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) { if (data && data.length > 0) {
data.forEach((item: any) => { data.forEach((item: any) => {
// //
@ -122,55 +193,59 @@ const handleGetMapRealData = async () => {
revenueAmonut.value = obj revenueAmonut.value = obj
// //
startSingleNumberAnimation(revenueAmonut) startSingleNumberAnimation(revenueAmonut)
} else if (item.dataType === 2000) { }
// // else if (item.dataType === 2000) {
let obj: any = { // //
value: handleGetPonitFixed(item.totalAmount) || 0, // let obj: any = {
unit: item.totalAmountUnit || '', // value: handleGetPonitFixed(item.totalAmount) || 0,
totalCount: handleGetPonitFixed(item.totalCount) || 0, // unit: item.totalAmountUnit || '',
totalCountUnit: item.totalCountUnit || '', // 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(), // // let obj: any = {
// unit: item.totalCount.toString().length > 8 ? '' : '' // // 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 // aiObj[""] = `${item.totalCount}${item.totalCountUnit}`
// // oilConsumption.value = obj
startSingleNumberAnimation(oilConsumption) // //
} else if (item.dataType === 3000) { // startSingleNumberAnimation(oilConsumption)
// // }
let obj: any = { // else if (item.dataType === 3000) {
value: handleGetPonitFixed(item.totalAmount) || 0, // //
unit: item.totalAmountUnit || '', // let obj: any = {
totalCount: handleGetPonitFixed(item.totalCount) || 0, // value: handleGetPonitFixed(item.totalAmount) || 0,
totalCountUnit: item.totalCountUnit || '', // unit: item.totalAmountUnit || '',
} // totalCount: handleGetPonitFixed(item.totalCount) || 0,
// let obj: any = { // totalCountUnit: item.totalCountUnit || '',
// value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // }
// unit: item.totalCount.toString().length > 8 ? '' : '' // // let obj: any = {
// } // // value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(),
aiObj["加水量"] = `${item.totalCount}${item.totalCountUnit}` // // unit: item.totalCount.toString().length > 8 ? '' : ''
waterAddition.value = obj // // }
// // aiObj[""] = `${item.totalCount}${item.totalCountUnit}`
startSingleNumberAnimation(waterAddition) // waterAddition.value = obj
} else if (item.dataType === 4000) { // //
// 尿 // startSingleNumberAnimation(waterAddition)
let obj: any = { // }
value: handleGetPonitFixed(item.totalAmount) || 0, // else if (item.dataType === 4000) {
unit: item.totalAmountUnit || '', // // 尿
totalCount: handleGetPonitFixed(item.totalCount) || 0, // let obj: any = {
totalCountUnit: item.totalCountUnit || '', // value: handleGetPonitFixed(item.totalAmount) || 0,
} // unit: item.totalAmountUnit || '',
// let obj: any = { // totalCount: handleGetPonitFixed(item.totalCount) || 0,
// value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(), // totalCountUnit: item.totalCountUnit || '',
// unit: item.totalCount.toString().length > 8 ? '' : '' // }
// } // // let obj: any = {
aiObj["尿素"] = `${item.totalCount}${item.totalCountUnit}` // // value: item.totalCount.toString().length > 8 ? Number((item.totalCount / 10000).toFixed(2)).toLocaleString() : Number(item.totalCount).toLocaleString(),
urea.value = obj // // unit: item.totalCount.toString().length > 8 ? '' : ''
// // // }
startSingleNumberAnimation(urea) // aiObj["尿"] = `${item.totalCount}${item.totalCountUnit}`
} else if (item.dataType === 5000) { // urea.value = obj
// //
// startSingleNumberAnimation(urea)
// }
else if (item.dataType === 5000) {
// //
let obj: any = { let obj: any = {
value: handleGetPonitFixed(item.totalAmount) || 0, value: handleGetPonitFixed(item.totalAmount) || 0,

View File

@ -189,6 +189,15 @@ export async function handleGetRealData(params: any) {
return data.Result_Data 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) { export async function handleGetMonthlyBusinessRevenue(params: any) {
const data: any = await requestPos.post('/Revenue/GetMonthlyBusinessRevenue', params) const data: any = await requestPos.post('/Revenue/GetMonthlyBusinessRevenue', params)

View File

@ -2,6 +2,8 @@ import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
// import { notification } from 'antd'; // import { notification } from 'antd';
// import Cookies from 'js-cookie'; // import Cookies from 'js-cookie';
import moment from 'moment'; import moment from 'moment';
// @ts-ignore
import { encryptAES } from '../options/handleAes.js'
// 定义 HTTP 状态码及其描述 // 定义 HTTP 状态码及其描述
const codeMessage: Record<number, string> = { const codeMessage: Record<number, string> = {
@ -73,6 +75,10 @@ instance.interceptors.response.use(
const request = { const request = {
get: (url: string, params?: any) => instance.get(url, { params }), get: (url: string, params?: any) => instance.get(url, { params }),
post: (url: string, data?: any) => instance.post(url, data), 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), put: (url: string, data?: any) => instance.put(url, data),
delete: (url: string, params?: any) => instance.delete(url, { params }), delete: (url: string, params?: any) => instance.delete(url, { params }),
}; };