| | |
| | | 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="结束时间" |
| | |
| | | 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>({ |
| | |
| | | () => { |
| | | getNowTime(); |
| | | initCharts(); |
| | | initInfoData() |
| | | } |
| | | ); |
| | | const getNowTime = () => { |
| | |
| | | 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) => { |
| | |
| | | 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 = () => { |