Commit 7fc46dcf authored by 朱超's avatar 朱超

明日预测报表

parent 44215dce
...@@ -14,3 +14,9 @@ export const postHeatForecast = params => { ...@@ -14,3 +14,9 @@ export const postHeatForecast = params => {
}) })
} }
//明日预测报表(打印查询)
export const postPrintHeatForecast = params => {
return http.post(`/api/analysis/report/PrintHeatForecast`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<th width="25%"> <th width="25%">
<span>记录时间</span> <span>记录时间</span>
</th> </th>
<th width="25%"> <th style="text-align: left; background-color: #ffffff">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker <el-date-picker
type="datetime" type="datetime"
...@@ -23,37 +23,35 @@ ...@@ -23,37 +23,35 @@
/> />
</el-config-provider> </el-config-provider>
</th> </th>
<th width="25%"></th> <th width="25%">
<th>
<el-button <el-button
type="primary" type="primary"
style="min-width: 70px" style="min-width: 70px"
@click="postHeatAnalysisFun" @click="postHeatForecastFun"
>历史查询</el-button >历史查询</el-button
> >
</th> </th>
</tr> </tr>
<tr> <tr>
<th width="25%"> <th>
<span>打印时间</span> <span>打印时间</span>
</th> </th>
<th width="25%"> <th style="text-align: left; background-color: #ffffff">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
<el-date-picker <el-date-picker
type="datetime" type="date"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD"
placeholder="选择查询时间" placeholder="选择查询时间"
style="width: 180px" style="width: 180px"
v-model="enertyInfo.queryTime" v-model="enertyInfo.printTime"
/> />
</el-config-provider> </el-config-provider>
</th> </th>
<th width="25%"></th>
<th> <th>
<el-button <el-button
type="primary" type="primary"
style="min-width: 70px" style="min-width: 70px"
@click="postHeatAnalysisFun" @click="postPrintHeatForecastFun"
>打印查询</el-button >打印查询</el-button
> >
</th> </th>
...@@ -67,11 +65,11 @@ ...@@ -67,11 +65,11 @@
<tr> <tr>
<th style="width: 25%">天气状况</th> <th style="width: 25%">天气状况</th>
<th style="width: 25%; background-color: #a6ffa6"> <th style="width: 25%; background-color: #a6ffa6">
{{ weather.weatherCondition }} {{ weather.weatherCondition ? weather.weatherCondition : "-" }}
</th> </th>
<th style="width: 25%">风力</th> <th style="width: 25%">风力</th>
<th style="width: 25%; background-color: #a6ffa6"> <th style="width: 25%; background-color: #a6ffa6">
{{ weather.wind }} {{ weather.wind ? weather.wind : "-" }}
</th> </th>
</tr> </tr>
</table> </table>
...@@ -215,9 +213,9 @@ ...@@ -215,9 +213,9 @@
</tr> </tr>
<tr> <tr>
<th>时间</th> <th>时间</th>
<td colspan="5">{{ dataTime.createBillTime }}</td> <td colspan="5">{{ dataTime.createBillTime ? dataTime.createBillTime : "-" }}</td>
<td>{{ dataTime.datePrediction }}</td> <td>{{ dataTime.datePrediction ? dataTime.datePrediction : "-" }}</td>
<td>{{ dataTime.degreeDatePrediction }}</td> <td>{{ dataTime.degreeDatePrediction ? dataTime.degreeDatePrediction : "-" }}</td>
</tr> </tr>
</table> </table>
<table <table
...@@ -276,14 +274,14 @@ import zhCn from "element-plus/dist/locale/zh-cn.mjs"; ...@@ -276,14 +274,14 @@ import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style"; import XLSX from "xlsx-js-style";
import { postHeatForecast } from "../../api/report"; import { postHeatForecast, postPrintHeatForecast } from "../../api/report";
const temp = ref([]); //24小时室外预测值 const temp = ref([]); //24小时室外预测值
const weather = ref([]); //当日气象信息 const weather = ref([]); //当日气象信息
const predTemp = ref([]); //24小时室外体感预测值 const predTemp = ref([]); //24小时室外体感预测值
const dataList = ref([]); //预测热量明细 const dataList = ref([]); //预测热量明细
const dataTime = ref([]); //报表记录时间及总计 const dataTime = ref([]); //报表记录时间及总计
const enertyInfo = reactive({ const enertyInfo = reactive({
nowTime: null, printTime: null,
queryTime: "2024-1-1 09:00:00", queryTime: "2024-1-1 09:00:00",
}); });
function timeFun() { function timeFun() {
...@@ -316,33 +314,27 @@ function timeFun() { ...@@ -316,33 +314,27 @@ function timeFun() {
dateArr[4] = "0" + dateArr[4]; dateArr[4] = "0" + dateArr[4];
} }
let endTimes = let endTimes =
year + year + "-" + dateArr[0] + "-" + dateArr[1] + " " + endTimeHour + ":00:00";
"-" + // enertyInfo.printTime =
dateArr[0] + // year +
"-" + // "-" +
dateArr[1] + // dateArr[0] +
" " + // "-" +
endTimeHour + // dateArr[1] +
":" + // " " +
dateArr[3] + // dateArr[2] +
":" + // ":" +
dateArr[4]; // dateArr[3] +
enertyInfo.nowTime = // ":" +
year + // dateArr[4];
"-" +
dateArr[0] +
"-" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
enertyInfo.queryTime = endTimes; enertyInfo.queryTime = endTimes;
} }
function postHeatForecastFun() { function postHeatForecastFun() {
if(enertyInfo.queryTime == null) {
ElMessage.error("请选择记录时间");
return false;
}
let params = { let params = {
QueryTime: enertyInfo.queryTime, QueryTime: enertyInfo.queryTime,
}; };
...@@ -358,8 +350,29 @@ function postHeatForecastFun() { ...@@ -358,8 +350,29 @@ function postHeatForecastFun() {
} }
}); });
} }
function postPrintHeatForecastFun() {
if(enertyInfo.printTime == null) {
ElMessage.error("请选择打印时间");
return false;
}
let params = {
QueryTime: enertyInfo.printTime,
};
postPrintHeatForecast(params).then((res) => {
if (res.success === true) {
temp.value = res.data.temp;
predTemp.value = res.data.predTemp;
weather.value = res.data.weather;
dataList.value = res.data.list;
dataTime.value = res.data.time;
} else {
ElMessage.error(res.message);
}
});
}
onMounted(() => { onMounted(() => {
//timeFun(); timeFun();
postHeatForecastFun(); postHeatForecastFun();
}); });
onUnmounted(() => {}); onUnmounted(() => {});
......
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