From da47a3349dcfd87db23ab8e64fbf35fe1aea5685 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期四, 14 十一月 2024 16:52:21 +0800 Subject: [PATCH] 预测项数据 --- src/views/data/point/DaPointChart.vue | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/views/data/point/DaPointChart.vue b/src/views/data/point/DaPointChart.vue index 305e0e7..e496d98 100644 --- a/src/views/data/point/DaPointChart.vue +++ b/src/views/data/point/DaPointChart.vue @@ -14,6 +14,8 @@ <el-date-picker size="mini" v-model="dataForm.startTime" + format="YYYY-MM-DD HH:mm:00" + value-format="YYYY-MM-DD HH:mm:00" type="datetime" :clearable="false" placeholder="选择日期时间"/> @@ -22,6 +24,8 @@ <el-date-picker size="mini" v-model="dataForm.endTime" + format="YYYY-MM-DD HH:mm:00" + value-format="YYYY-MM-DD HH:mm:00" type="datetime" :clearable="false" placeholder="选择日期时间"/> @@ -49,29 +53,24 @@ import {ref} from 'vue'; import * as echarts from 'echarts'; import * as DaPoint from '@/api/data/da/point/daPointChart' - import {getYMDHMS} from "@/utils/dateUtil" + import {getYMDHM0} from "@/utils/dateUtil" import download from "@/utils/download"; const message = useMessage() // 消息弹窗 const visible = ref(false); const chartDom = ref(null); let myChart = null; - const queryParams = reactive({ - codes: [], - startDate: undefined, - endDate: undefined, - }) const chartParams = reactive({ - pointNos:[], - start : undefined, - end : undefined, + codes:[], + startDate : undefined, + endDate: undefined, }) const dataForm = ref({ id: "", pointNo: "", pointName: "", pointTypeName: "", - startTime: getYMDHMS(new Date() - 1000 * 60 * 60), - endTime: getYMDHMS(new Date()), + startTime: getYMDHM0(new Date() - 60 * 60 * 1000), + endTime: "", }); /** 打开弹窗 */ @@ -80,8 +79,6 @@ dataForm.value.id = row.id; dataForm.value.pointNo = row.pointNo; dataForm.value.pointName = row.pointName; - dataForm.value.startTime = getYMDHMS(new Date(this.dataForm.startTime) - 1000 * 60 * 60); - dataForm.value.endTime = getYMDHMS(new Date(this.dataForm.endTime) - 1000 * 60 * 60), getDataList(); } @@ -91,10 +88,10 @@ visible.value = true; if (dataForm.value.id) { try { - queryParams.codes=[dataForm.value.pointNo]; - queryParams.startDate = getYMDHMS(new Date(this.dataForm.startTime) - 1000 * 60 * 60); - queryParams.endDate = getYMDHMS(new Date(this.dataForm.endTime) - 1000 * 60 * 60); - const data = await DaPoint.getPointDaChart(queryParams) + chartParams.codes=[dataForm.value.pointNo]; + chartParams.startDate = dataForm.value.startTime; + chartParams.endDate = dataForm.value.endTime; + const data = await DaPoint.getPointDaChart(chartParams) let seriesData = [] data.series.forEach(item => { seriesData.push({ @@ -168,15 +165,15 @@ /** 导出按钮操作 */ const exportLoading = ref(false) const handleExport = async () => { - chartParams.pointNos=[dataForm.value.pointNo]; - chartParams.start = dataForm.value.startTime; - chartParams.end = dataForm.value.endTime; + chartParams.codes=[dataForm.value.pointNo]; + chartParams.startDate = dataForm.value.startTime; + chartParams.endDate = dataForm.value.endTime; try { // 导出的二次确认 await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await DaPoint.exportDaPointValue(queryParams) + const data = await DaPoint.exportDaPointValue(chartParams) download.excel(data, dataForm.value.pointName +'.xls') } catch { } finally { -- Gitblit v1.9.3