From 54ef36700435d541a1154503b14f25ad984f6f90 Mon Sep 17 00:00:00 2001
From: zhouwenxuan <1175765986@qq.com>
Date: Tue, 05 Sep 2023 13:21:29 +0800
Subject: [PATCH] 实时监控页面
---
src/views/monitorData/weatherData/index.vue | 34 ++++++++++------------------------
1 files changed, 10 insertions(+), 24 deletions(-)
diff --git a/src/views/monitorData/weatherData/index.vue b/src/views/monitorData/weatherData/index.vue
index f8f4ad4..eda444c 100644
--- a/src/views/monitorData/weatherData/index.vue
+++ b/src/views/monitorData/weatherData/index.vue
@@ -8,7 +8,6 @@
v-model="state.tableData.listQuery.searchParams.time"
type="datetimerange"
format="YYYY-MM-DD HH:mm:ss"
- value-format="YYYY-MM-DD HH:mm:ss"
range-separator="~"
start-placeholder="开始时间"
end-placeholder="结束时间"
@@ -72,6 +71,7 @@
import * as echarts from "echarts";
import { ElMessage, ElMessageBox } from 'element-plus'
import {TableWeatherState} from "/@/types/monitorData";
+import moment from "moment/moment";
const infoRef = ref();
const state = reactive<TableWeatherState>({
@@ -138,6 +138,7 @@
() => {
getNowTime();
initCharts();
+ initInfoData()
}
);
const getNowTime = () => {
@@ -145,11 +146,14 @@
let sTime = `${isDate.getFullYear()}-${isDate.getMonth() + 1}-${isDate.getDate()}`
let eTime = `${isDate.getFullYear()}-${isDate.getMonth() + 1}-${isDate.getDate()}`
sTime = `${sTime} 00:00:00`
- eTime = `${eTime} 23:59:59`
+ eTime = `${eTime} ` + moment().format('HH:mm:ss')
state.tableData.listQuery.searchParams.time = [sTime ,eTime];
- console.log("time",state.tableData.listQuery.searchParams.time)
}
const initInfoData = () => {
+ const param = {
+ startTime: moment(state.tableData.listQuery.searchParams.time[0]).format('YYYY-MM-DD HH:mm:ss'),
+ endTime: moment(state.tableData.listQuery.searchParams.time[1]).format('YYYY-MM-DD HH:mm:ss')
+ }
console.log("数据列表")
};
const onHandleSizeChange = (val: number) => {
@@ -161,34 +165,16 @@
state.tableData.listQuery.pageIndex = val;
initInfoData();
};
-const openDialog = (type: string, value: any) => {
- infoRef.value.openDialog(type, value);
-};
-const del = (val: any) => {
- ElMessageBox.confirm(
- '确定删除此条数据?',
- '提示',
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- ElMessage({
- type: 'success',
- message: '删除成功',
- })
- })
-};
const search = () => {
console.log("vla",state.tableData.listQuery.searchParams)
+ initInfoData();
}
const reset = () => {
state.tableData.listQuery.searchParams.time = [];
-
state.tableData.listQuery.searchParams.weatherType = '';
+ state.tableData.listQuery.pageIndex = 1;
+ initInfoData();
}
const initCharts = () => {
--
Gitblit v1.9.2