| | |
| | | <template> |
| | | <div class="fy-container"> |
| | | <div class="p-events-none m-t-2"> |
| | | <el-row justify="center"> |
| | | <SearchBar search-time="" @search="fetchHistroyData"></SearchBar> |
| | | <SearchBar |
| | | :search-time="searchTime" |
| | | @search="fetchHistroyData" |
| | | ></SearchBar> |
| | | </el-row> |
| | | <FactorRadio |
| | | :device-type="deviceType" |
| | | @change="(e) => (factorType = e)" |
| | | ></FactorRadio> |
| | | <el-row class="m-t-2"> |
| | | <FactorRadio |
| | | :device-type="deviceType" |
| | | @change="(e) => (factorType = e)" |
| | | ></FactorRadio> |
| | | </el-row> |
| | | <el-row class="m-t-2"> |
| | | <FactorLegend |
| | | class="m-t-2" |
| | | :factor="factorDatas.factor[factorType]" |
| | | ></FactorLegend> |
| | | </el-row> |
| | | <TrendAnalysis |
| | | class="trend-analysis" |
| | | :factor-datas="factorDatas" |
| | | ></TrendAnalysis> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import moment from 'moment'; |
| | | import { TYPE0 } from '@/constant/device-type'; |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | import TrendAnalysis from './component/TrendAnalysis.vue'; |
| | | |
| | | export default { |
| | | components: { TrendAnalysis }, |
| | | setup() { |
| | | const { loading, fetchData } = useFetchData(10000); |
| | | return { loading, fetchData }; |
| | |
| | | // this.factorMode = factorMode; |
| | | // this.factorType = factorType; |
| | | // this.factorName = factorName; |
| | | // this.factorDatas.refreshHeight(this.factorType + 1 + ''); |
| | | // this.refreshLegend(this.factorDatas); |
| | | this.factorDatas.refreshHeight(this.factorType); |
| | | // this.mapMaker.setFactorType(factorType); |
| | | // if (!this.mapMaker.runStatus()) { |
| | | |
| | |
| | | deviceCode, |
| | | startTime, |
| | | endTime, |
| | | type, |
| | | page, |
| | | perPage: pageSize |
| | | }) |
| | |
| | | }, |
| | | fetchRealTimeData() { |
| | | // fixme 2024.5.3 此处初始获取的数据,参数应该由searchbar决定,后续修改 |
| | | this.fetchData((page, pageSize) => { |
| | | this.fetchData((page) => { |
| | | return monitorDataApi |
| | | .fetchHistroyData({ |
| | | deviceCode: '0a0000000001', |
| | |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.length > 0) { |
| | | const s = new Date(res.data[0].time); |
| | | const e = new Date(res.data[res.data.length - 1].time); |
| | | const s = new Date(res.data[0].time.replace(' ', 'T')); |
| | | const e = new Date( |
| | | res.data[res.data.length - 1].time.replace(' ', 'T') |
| | | ); |
| | | this.searchTime = [s, e]; |
| | | } |
| | | this.onFetchData(TYPE0, res.data); |
| | |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .fy-container { |
| | | .trend-analysis { |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 2px; |
| | | } |
| | | </style> |