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

明日预测报表

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