|
@@ -616,16 +616,27 @@ const addTimeLine = (value: TimeList) => {
|
|
|
timeLineIndex.value = value.index;
|
|
|
};
|
|
|
|
|
|
+// 获取当前日期(格式:YYYY-MM-DD)
|
|
|
+const getCurrentDate = () => {
|
|
|
+ const date = new Date();
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份补零
|
|
|
+ const day = String(date.getDate()).padStart(2, '0'); // 日期补零
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+};
|
|
|
+
|
|
|
const confirmTimeLine = () => {
|
|
|
handleRequest(async () => {
|
|
|
if (gradeTwo.value) {
|
|
|
- monitoringPointList.value = await getRegionsPointsValue(gradeTwo.value, {
|
|
|
- endTime: chooseTime.value ? chooseTime.value : '',
|
|
|
- });
|
|
|
- mergeData();
|
|
|
- monitoringPointData.value = monitoringPointList.value;
|
|
|
- monitoringId.value = monitoringPointData.value[0].id;
|
|
|
- selectId.value = monitoringPointData.value[0].regionId;
|
|
|
+ if (chooseTime.value) {
|
|
|
+ monitoringPointList.value = await getRegionsPointsValue(gradeTwo.value, {
|
|
|
+ endTime: `${getCurrentDate()} ${chooseTime.value}:00`,
|
|
|
+ });
|
|
|
+ mergeData();
|
|
|
+ monitoringPointData.value = monitoringPointList.value;
|
|
|
+ monitoringId.value = monitoringPointData.value[0].id;
|
|
|
+ selectId.value = monitoringPointData.value[0].regionId;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
};
|