Commit c75d24bb authored by lwy's avatar lwy

Merge branch 'b-master' of http://gitlab.91isoft.com:90/hikvision/web-project into b-master

parents 59c280d9 35aec1ff
import http from './http' import http from './http'
import {reportHeatAnalysis,reportHeatForecast,reportTransferEnergy,reportTransferArea,reportPrintHeatForecast} from "../../src/dataJson/productData/mock"
//热量分析报表 //热量分析报表
export const postHeatAnalysis = params => { /*export const postHeatAnalysis = params => {
return http.post(`/api/analysis/report/HeatAnalysis`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/HeatAnalysis`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
}*/
//静态资源 热量分析报表
export const postHeatAnalysis = params => {
return Promise.resolve(reportHeatAnalysis);
} }
//明日预测报表(实时或历史查询) //明日预测报表(实时或历史查询)
export const postHeatForecast = params => { /*export const postHeatForecast = params => {
return http.post(`/api/analysis/report/HeatForecast`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/HeatForecast`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
}*/
//静态资源 明日预测报表(实时或历史查询)
export const postHeatForecast = params => {
return Promise.resolve(reportHeatForecast);
} }
//明日预测报表(打印查询) //明日预测报表(打印查询)
export const postPrintHeatForecast = params => { /*export const postPrintHeatForecast = params => {
return http.post(`/api/analysis/report/PrintHeatForecast`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/PrintHeatForecast`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
}*/
//静态资源 明日预测报表(打印查询)
export const postPrintHeatForecast = params => {
return Promise.resolve(reportPrintHeatForecast);
} }
//明日预测报表(保存打印记录) //明日预测报表(保存打印记录)
/*export const postSaveHeatForecast = params => {
return http.post(`/api/analysis/report/SaveHeatForecast`, params).then(res => res).catch(function (error) {
console.log(error);
})
}*/
//静态资源 明日预测报表(保存打印记录)
export const postSaveHeatForecast = params => { export const postSaveHeatForecast = params => {
return http.post(`/api/analysis/report/SaveHeatForecast`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/SaveHeatForecast`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
//换热站能耗报表 //换热站能耗报表
export const postTransferEnergy = params => { /*export const postTransferEnergy = params => {
return http.post(`/api/analysis/report/TransferEnergy`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/TransferEnergy`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
}*/
//静态资源 换热站能耗报表
export const postTransferEnergy = params => {
return Promise.resolve(reportTransferEnergy);
} }
//换热站面积报表 //换热站面积报表
export const postTransferArea = params => { /*export const postTransferArea = params => {
return http.post(`/api/analysis/report/TransferArea`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/TransferArea`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
}*/
//静态资源 换热站面积报表
export const postTransferArea = params => {
return Promise.resolve(reportTransferArea);
} }
//热量实时分析报表 //热量实时分析报表
export const postRealAnalysis = params => { export const postRealAnalysis = params => {
return http.post(`/api/analysis/report/RealAnalysis`, params).then(res => res).catch(function (error) { return http.post(`/api/analysis/report/RealAnalysis`, params).then(res => res).catch(function (error) {
console.log(error); console.log(error);
}) })
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -33,7 +33,8 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue'; ...@@ -33,7 +33,8 @@ import { ref, reactive, onMounted, onUnmounted } from 'vue';
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import store from "../../store/index"; import store from "../../store/index";
import http from '../../api/http'; import http from '../../api/http';
import { weatherArt } from '../../dataJson/RealPage/boilerArt';
import { pipeRealArt } from '../../dataJson/RealPage/measureArt';
const props = defineProps(['id', 'refreshTime']); const props = defineProps(['id', 'refreshTime']);
const route = useRoute() const route = useRoute()
const Pipe = ref(); const Pipe = ref();
...@@ -83,7 +84,6 @@ const BackFlowSum = ref(); ...@@ -83,7 +84,6 @@ const BackFlowSum = ref();
getSupplysList(); getSupplysList();
function getSupplysList() { function getSupplysList() {
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
console.log(result);
if (result) { if (result) {
result.forEach(element => { result.forEach(element => {
if (element.enterpriseId === enterpriseId.value) { if (element.enterpriseId === enterpriseId.value) {
...@@ -112,23 +112,50 @@ function getSupplysList() { ...@@ -112,23 +112,50 @@ function getSupplysList() {
} }
//获取气象实时数据 //获取气象实时数据
// function getweather() {
// http.post("/api/weather/Real", SupplyId.value).then((result) => {
// temperature.value = result.data["temperature"];
// wind.value = result.data["wind"];
// illumination.value = result.data["illumination"];
// humidity.value = result.data["humidity"];
// })
// }
function getweather() { function getweather() {
http.post("/api/weather/Real", SupplyId.value).then((result) => { temperature.value = weatherArt.data["temperature"];
temperature.value = result.data["temperature"]; wind.value = weatherArt.data["wind"];
wind.value = result.data["wind"]; illumination.value = weatherArt.data["illumination"];
illumination.value = result.data["illumination"]; humidity.value =weatherArt.data["humidity"];
humidity.value = result.data["humidity"];
})
} }
getPipeData(); getPipeData();
//获取计量站实时数据 // //获取计量站实时数据
// function getPipeData() {
// let deviceType = 8;
// http.post("/api/pipe/Real", { "enterpriseId": enterpriseId.value, "deviceType": deviceType }).then((result) => {
// // console.log(JSON.stringify(result));
// result.data.title.forEach(element => {
// result.data.realData.forEach(item => {
// if (item.id === id.value) {
// PipeData[element.enName] = item[element.enName[0].toLowerCase() + element.enName.substring(1)];
// }
// })
// })
// SupplyClearPressure.value = PipeData["SupplyClearPressure"];
// SupplyValuePressure.value = PipeData["SupplyValuePressure"];
// FirstInTemp.value = PipeData["FirstInTemp"];
// SupplyFlow.value = PipeData["SupplyFlow"];
// SupplyFlowSum.value = PipeData["SupplyFlowSum"];
// SupplyHeat.value = PipeData["SupplyHeat"];
// SupplyHeatSum.value = PipeData["SupplyHeatSum"];
// FirstOutTemp.value = PipeData["FirstOutTemp"];
// BackClearPressure.value = PipeData["BackClearPressure"];
// BackFlow.value = PipeData["BackFlow"];
// BackFlowSum.value = PipeData["BackFlowSum"];
// })
// }
//静态
function getPipeData() { function getPipeData() {
let deviceType = 8; pipeRealArt.title.forEach(element => {
http.post("/api/pipe/Real", { "enterpriseId": enterpriseId.value, "deviceType": deviceType }).then((result) => { pipeRealArt.realData.forEach(item => {
console.log(result);
result.data.title.forEach(element => {
result.data.realData.forEach(item => {
if (item.id === id.value) { if (item.id === id.value) {
PipeData[element.enName] = item[element.enName[0].toLowerCase() + element.enName.substring(1)]; PipeData[element.enName] = item[element.enName[0].toLowerCase() + element.enName.substring(1)];
} }
...@@ -145,7 +172,6 @@ function getPipeData() { ...@@ -145,7 +172,6 @@ function getPipeData() {
BackClearPressure.value = PipeData["BackClearPressure"]; BackClearPressure.value = PipeData["BackClearPressure"];
BackFlow.value = PipeData["BackFlow"]; BackFlow.value = PipeData["BackFlow"];
BackFlowSum.value = PipeData["BackFlowSum"]; BackFlowSum.value = PipeData["BackFlowSum"];
})
} }
setInterval(() => { setInterval(() => {
getPipeData(); getPipeData();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import { createStore } from 'vuex' import { createStore } from 'vuex'
import { orgFn } from '@/api/org' import { orgFn } from '@/api/org'
import { homeGetOrg } from '../dataJson/common/common.js'
import {AIAPIExternalSERVEICE, AIAPIWithinSERVEICE, ExternalSERVEICE, WithinSERVEICE} from '../../public/config' import {AIAPIExternalSERVEICE, AIAPIWithinSERVEICE, ExternalSERVEICE, WithinSERVEICE} from '../../public/config'
const keys = { USER: 'user', ENTERPRISE:'enterprise', SERVEICE:'SERVEICE', AIAPISERVEICE:'AIAPISERVEICE' } const keys = { USER: 'user', ENTERPRISE:'enterprise', SERVEICE:'SERVEICE', AIAPISERVEICE:'AIAPISERVEICE' }
...@@ -194,12 +195,15 @@ const store = createStore({ ...@@ -194,12 +195,15 @@ const store = createStore({
//actions里面的方法是异步操作 //actions里面的方法是异步操作
//异步操作就使用promise //异步操作就使用promise
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
orgFn().then(res=>{ /* orgFn().then(res=>{
//console.log(res) //console.log(res)
context.commit('setEnterprise',res.data) context.commit('setEnterprise',res.data)
context.commit('setEnterpriseId',res.data[0].enterpriseId) context.commit('setEnterpriseId',res.data[0].enterpriseId)
resolve(res) resolve(res)
}).catch(err=>reject(err)) }).catch(err=>reject(err))*/
context.commit('setEnterprise',homeGetOrg.data)
context.commit('setEnterpriseId',homeGetOrg.data[0].enterpriseId)
resolve(homeGetOrg)
}) })
} }
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -367,9 +367,15 @@ function postTransferEnergyFun() { ...@@ -367,9 +367,15 @@ function postTransferEnergyFun() {
postTransferEnergy(enertyInfo).then((res) => { postTransferEnergy(enertyInfo).then((res) => {
if (res.success === true) { if (res.success === true) {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.area = item.area.toFixed(4); // 尝试将 item.area 转换为数字
if (item.transferName != "总计") { let area = Number(item.area);
tableData.value.push(item); if (!isNaN(area)) {
item.area = area.toFixed(4);
if (item.transferName != "总计") {
tableData.value.push(item);
}
} else {
console.error('item.area is not a valid number:', item.area);
} }
}); });
} else { } else {
...@@ -478,4 +484,4 @@ table.botList td { ...@@ -478,4 +484,4 @@ table.botList td {
height: 76vh; height: 76vh;
} }
} }
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment