| | |
| | | BaseMap: typeof import('./components/map/BaseMap.vue')['default'] |
| | | CardButton: typeof import('./components/CardButton.vue')['default'] |
| | | CardDialog: typeof import('./components/CardDialog.vue')['default'] |
| | | cop: typeof import('./components/monitor/WeatherData.vue')['default'] |
| | | copy: typeof import('./components/monitor/WeatherData.vue')['default'] |
| | | CoreHeader: typeof import('./components/core/CoreHeader.vue')['default'] |
| | | CoreMenu: typeof import('./components/core/CoreMenu.vue')['default'] |
| | | DataSummary: typeof import('./components/monitor/DataSummary.vue')['default'] |
| | |
| | | FactorTrend: typeof import('./components/monitor/FactorTrend.vue')['default'] |
| | | GaugeChart: typeof import('./components/chart/GaugeChart.vue')['default'] |
| | | HistoricalTrajectory: typeof import('./components/animation/HistoricalTrajectory.vue')['default'] |
| | | LineChart: typeof import('./components/chart/LineChart.vue')['default'] |
| | | MapToolbox: typeof import('./components/map/MapToolbox.vue')['default'] |
| | | MIssionCreate: typeof import('./components/mission/MIssionCreate.vue')['default'] |
| | | MissionImport: typeof import('./components/mission/MissionImport.vue')['default'] |
| | |
| | | TrajectoryState: typeof import('./components/animation/TrajectoryState.vue')['default'] |
| | | VehicleData: typeof import('./components/monitor/VehicleData.vue')['default'] |
| | | WeatherData: typeof import('./components/monitor/WeatherData.vue')['default'] |
| | | 'WeatherData cop': typeof import('./components/monitor/WeatherData.vue')['default'] |
| | | WeatherDataCopy: typeof import('./components/monitor/WeatherData-copy.vue')['default'] |
| | | } |
| | | export interface ComponentCustomProperties { |
| | | vLoading: typeof import('element-plus/es')['ElLoadingDirective'] |
| | |
| | | mapAnimation.setOnStopCallback(() => { |
| | | this.$emit('stop'); |
| | | }); |
| | | }, |
| | | unmounted() { |
| | | mapAnimation.stop(); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | justify-content: center; |
| | | } |
| | | .line-chart { |
| | | width: 300px; |
| | | width: 318px; |
| | | height: 140px; |
| | | /* border-bottom: 1px solid rgba(255, 255, 255, 0.329); */ |
| | | } |
| | |
| | | name: 'èµ°èªçæµ', |
| | | path: 'rmode' |
| | | }, |
| | | { |
| | | name: 'ç½æ ¼åçæµ', |
| | | path: 'gridmonitor' |
| | | } |
| | | // { |
| | | // name: 'ç½æ ¼åçæµ', |
| | | // path: 'gridmonitor' |
| | | // } |
| | | // { |
| | | // name: 'ç¨çµéçæµ', |
| | | // path: 'emode' |
| | |
| | | export default { |
| | | props: { |
| | | loading: Boolean, |
| | | factorDatas: FactorDatas |
| | | factorDatas: FactorDatas, |
| | | speed: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | speed: 0 |
| | | // speed: 0 |
| | | }; |
| | | }, |
| | | watch: { |
| | | factorDatas: { |
| | | handler(nV) { |
| | | this.speed = this.lastOne(nV, '14'); |
| | | // this.speed = this.lastOne(nV, '14'); |
| | | }, |
| | | deep: true |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-row class="wrap"> |
| | | <el-form :inline="true" class="form"> |
| | | <el-form-item label="温度ï¼" class="w-tag"> |
| | | {{ temprature }} |
| | | </el-form-item> |
| | | <el-form-item label="湿度ï¼" class="w-tag"> |
| | | {{ humidity }} |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <div class="w-tag">{{ temprature }}</div> |
| | | <div class="w-tag">{{ humidity }}</div> --> |
| | | </el-row> |
| | | <el-row class="wrap"> |
| | | <el-form :inline="true" class="form"> |
| | | <el-form-item label="é£åï¼" class="w-tag"> |
| | | {{ windDirection }} |
| | | </el-form-item> |
| | | <el-form-item label="é£éï¼" class="w-tag"> |
| | | {{ windSpeed }} |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <div class="w-tag">{{ windDirection }}</div> |
| | | <div class="w-tag">{{ windSpeed }}</div> --> |
| | | </el-row> |
| | | </template> |
| | | <script> |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | |
| | | export default { |
| | | props: { |
| | | loading: Boolean, |
| | | factorDatas: FactorDatas |
| | | }, |
| | | data() { |
| | | return { |
| | | temprature: '--â', |
| | | humidity: '--%', |
| | | windDirection: '--', |
| | | windSpeed: '--m/s', |
| | | }; |
| | | }, |
| | | watch: { |
| | | factorDatas: { |
| | | handler(nV) { |
| | | this.temprature = this.lastOne(nV, '8') + 'â'; |
| | | this.humidity = this.lastOne(nV, '9') + '%'; |
| | | this.windDirection = this.lastOne(nV, '17'); |
| | | this.windSpeed = this.lastOne(nV, '16') + 'm/s'; |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | lastOne(factorDatas, key) { |
| | | const f = factorDatas.factor[key]; |
| | | if (f) { |
| | | const lastIndex = f.datas.length - 1; |
| | | return factorDatas.factor[key].datas[lastIndex].factorData; |
| | | } else { |
| | | return '--'; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .w-tag { |
| | | padding: 2px 4px; |
| | | /* background-color: green; */ |
| | | border: 1px solid white; |
| | | border-radius: 2px; |
| | | -moz-border-radius: 25px; |
| | | width: 130px; |
| | | /* Old Firefox */ |
| | | } |
| | | |
| | | .form { |
| | | display: flex; |
| | | gap: 4px; |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 4px; |
| | | margin-right: 0px !important; |
| | | } |
| | | </style> |
| | |
| | | <el-row class="wrap"> |
| | | <el-form :inline="true" class="form"> |
| | | <el-form-item label="温度ï¼" class="w-tag"> |
| | | {{ temprature }} |
| | | {{ temprature }}â |
| | | </el-form-item> |
| | | <el-form-item label="湿度ï¼" class="w-tag"> |
| | | {{ humidity }} |
| | | {{ humidity }}% |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <div class="w-tag">{{ temprature }}</div> |
| | |
| | | <el-row class="wrap"> |
| | | <el-form :inline="true" class="form"> |
| | | <el-form-item label="é£åï¼" class="w-tag"> |
| | | {{ windDirection }} |
| | | {{ _windDir }} |
| | | </el-form-item> |
| | | <el-form-item label="é£éï¼" class="w-tag"> |
| | | {{ windSpeed }} |
| | | {{ windSpeed }}m/s |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <div class="w-tag">{{ windDirection }}</div> |
| | |
| | | </template> |
| | | <script> |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | import { windDir } from '../../constant/wind-dir'; |
| | | |
| | | export default { |
| | | props: { |
| | | loading: Boolean, |
| | | factorDatas: FactorDatas |
| | | factorDatas: FactorDatas, |
| | | temprature: { |
| | | type: String, |
| | | default: '--' |
| | | }, |
| | | humidity: { |
| | | type: String, |
| | | default: '--' |
| | | }, |
| | | windDirection: { |
| | | type: String, |
| | | default: '--' |
| | | }, |
| | | windSpeed: { |
| | | type: String, |
| | | default: '--' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | temprature: '--â', |
| | | humidity: '--%', |
| | | windDirection: '--', |
| | | windSpeed: '--m/s' |
| | | }; |
| | | return {}; |
| | | }, |
| | | watch: { |
| | | factorDatas: { |
| | | handler(nV) { |
| | | this.temprature = this.lastOne(nV, '8') + 'â'; |
| | | this.humidity = this.lastOne(nV, '9') + '%'; |
| | | this.windDirection = this.lastOne(nV, '17'); |
| | | this.windSpeed = this.lastOne(nV, '16') + 'm/s'; |
| | | // this.temprature = this.lastOne(nV, '8') + 'â'; |
| | | // this.humidity = this.lastOne(nV, '9') + '%'; |
| | | // this.windDirection = this.lastOne(nV, '17'); |
| | | // this.windSpeed = this.lastOne(nV, '16') + 'm/s'; |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | computed: { |
| | | _windDir() { |
| | | return windDir(this.windDirection); |
| | | } |
| | | }, |
| | | methods: { |
| | | lastOne(factorDatas, key) { |
| | | const f = factorDatas.factor[key]; |
| | |
| | | deviceList() { |
| | | const t = this.type ? this.type : '0a'; |
| | | return [1, 2, 3].map((v) => { |
| | | const text = `${t}000000000${v}`; |
| | | const label = `${this.getDeviceType(t)}设å¤${v}å·`; |
| | | const value = `${t}000000000${v}`; |
| | | return { |
| | | label: text, |
| | | value: text |
| | | label: label, |
| | | value: value |
| | | }; |
| | | }); |
| | | } |
| | |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | }, |
| | | getDeviceType(t) { |
| | | switch (t) { |
| | | case '0a': |
| | | return '车载'; |
| | | case '0b': |
| | | return 'æ 人æº'; |
| | | case '0c': |
| | | return 'æ 人è¹'; |
| | | default: |
| | | return '车载'; |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | |
| | | this.isPause = false; |
| | | this.isRunning = false; |
| | | this.isStop = false; |
| | | // æ¯å¦å¼å¯å¨æç»å¶é度 |
| | | this.dynamicSpeed = false; |
| | | // æ¯ä¸ªä»»å¡èæ¶ï¼ç§ï¼ |
| | |
| | | start: function () { |
| | | if (this.intervalFlag != undefined) { |
| | | this.isPause = false; |
| | | this.isStop = false; |
| | | } else { |
| | | this.isRunning = true; |
| | | this._doTask(); |
| | |
| | | |
| | | this.isRunning = false; |
| | | this.isPause = false; |
| | | this.isStop = true; |
| | | this.lastestTime = undefined; |
| | | this.speed = 1; |
| | | }, |
| | | setOnStopCallback: function (callback) { |
| | | this.onStopCallback = callback; |
| | |
| | | t.task(t.data, index, t.count); |
| | | |
| | | index += this.speed; |
| | | // console.log("_doTask:" + index); |
| | | }, this.timeout); |
| | | } |
| | | }, |
| | |
| | | this._fps = this.frameAnimation.fps; |
| | | // ç»å¶å¾å½¢ç¼å |
| | | this.moveViews = {}; |
| | | this.clear = true; |
| | | } |
| | | |
| | | MapAnimation.prototype = { |
| | |
| | | Layer.drawMesh(d, f); |
| | | // é£åé£é |
| | | sector.drawSectorAna(d, start + index); |
| | | // æ§è¡çå¬å½æ° |
| | | if (typeof that.OnEachFrameCallback === 'function') { |
| | | that.OnEachFrameCallback(d, start + index); |
| | | } |
| | | // ç»å¶3Då¾å½¢æ¶ï¼æå°éè¦2ä¸ªç¹æå¯ç»å¶å¾å½¢ |
| | | // å æ¤æ¤å¤ç´¢å¼åªå°åæ°ç¬¬äºä¸ªç¹å°±ç»æï¼æ¤æ¶æ§è¡è¿æ®µä»»å¡ç»æççå¬åè° |
| | | if (typeof that.OnEachTaskEndCallback === 'function') { |
| | | that.OnEachTaskEndCallback(d); |
| | | } |
| | | } |
| | | |
| | | var pos = d.lnglats_GD[d.lnglats_GD.length - 1]; |
| | |
| | | this.start(); |
| | | }, |
| | | |
| | | /** |
| | | * 设置æ¯ä¸å¸§ççå¬å½æ° |
| | | * @param {Function} callback |
| | | */ |
| | | setOnEachFrameCallback(callback) { |
| | | this.OnEachFrameCallback = callback; |
| | | }, |
| | | |
| | | /** |
| | | * 设置æ¯ä¸æ®µä»»å¡ç»æççå¬å½æ° |
| | | * @param {Function} callback |
| | | */ |
| | | setOnEachTaskEndCallback(callback) { |
| | | this.OnEachTaskEndCallback = callback; |
| | | }, |
| | | |
| | | /*******************************å¨ç»ä»»å¡é»è¾ -start ******************************/ |
| | | start: function () { |
| | | sector.clearSector(); |
| | | if (this.frameAnimation.isStop) { |
| | | sector.clearSector(); |
| | | } |
| | | this.frameAnimation.start(); |
| | | }, |
| | | changeSpeed: function (speed) { |
| | |
| | | stop: function () { |
| | | this.factorDatas = undefined; |
| | | this.frameAnimation.addOnNextTasks(undefined); |
| | | // this.OnEachFrameCallback = undefined; |
| | | // this.OnEachTaskEndCallback = undefined; |
| | | this.frameAnimation.stop(); |
| | | }, |
| | | setOnStopCallback: function (callback) { |
| | |
| | | /*******************************å¨ç»ä»»å¡é»è¾ -end ******************************/ |
| | | |
| | | _clearMap: function () { |
| | | if (!this.clear) return; |
| | | |
| | | var list = []; |
| | | for (const key in this.moveViews) { |
| | | list.push(this.moveViews[key]); |
| | |
| | | } |
| | | }; |
| | | |
| | | export { MapAnimation }; |
| | | const realTimeMapAnimation = new MapAnimation(); |
| | | realTimeMapAnimation.clear = false; |
| | | |
| | | export { realTimeMapAnimation, MapAnimation }; |
| | |
| | | }, |
| | | // ç»å¶3Dèµ°è¡è·¯çº¿å¾ |
| | | drawRoadMap(e) { |
| | | // this.factorMode = factorMode; |
| | | // this.factorType = factorType; |
| | | // this.factorName = factorName; |
| | | this.factorDatas.refreshHeight(this.factorType); |
| | | // this.mapMaker.setFactorType(factorType); |
| | | // if (!this.mapMaker.runStatus()) { |
| | | |
| | | Layer.drawRoadMap(this.factorDatas, e, this.merge, this.setCenter); |
| | | // } |
| | |
| | | }); |
| | | }, |
| | | drawSector(index) { |
| | | // 1. ç»å¶æå½¢åºå |
| | | // 1. ç»å¶æ°æå½¢åºå |
| | | sector.drawSector(this.factorDatas, index); |
| | | // 2. ç»å¶å¯¹è¯æ¡ |
| | | DialogUtil.openNewWindow(this.factorDatas, index, () => { |
| | |
| | | <template> |
| | | <div class="p-events-none m-t-2"> |
| | | <el-row justify="center" align="middle" class="top-wrap"> </el-row> |
| | | <el-row justify="center" align="middle" class="top-wrap"> |
| | | <DeviceChange @change="onDeviceChange"></DeviceChange> |
| | | </el-row> |
| | | <el-row class="m-t-2"> |
| | | <FactorRadio |
| | | :device-type="deviceType" |
| | |
| | | :factor="factorDatas.factor[factorType]" |
| | | ></FactorLegend> |
| | | </el-row> |
| | | <el-row class="m-t-2" justify="start"> |
| | | <DashBoard :factor-datas="factorDatas"></DashBoard> |
| | | </el-row> |
| | | <DashBoard class="dash-board" :factor-datas="factorDatas"></DashBoard> |
| | | <RealTimeTrend |
| | | class="real-time-trend" |
| | | :factor-datas="factorDatas" |
| | |
| | | import monitorDataApi from '@/api/monitorDataApi'; |
| | | import DashBoard from './component/DashBoard.vue'; |
| | | import RealTimeTrend from './component/RealTimeTrend.vue'; |
| | | import { MapAnimation } from '@/utils/map/animation'; |
| | | import DeviceChange from './component/DeviceChange.vue'; |
| | | import { realTimeMapAnimation } from '@/utils/map/animation'; |
| | | |
| | | const mapAnimation = new MapAnimation(); |
| | | // const mapAnimation = new MapAnimation(); |
| | | |
| | | export default { |
| | | components: { DashBoard, RealTimeTrend }, |
| | | components: { DashBoard, RealTimeTrend, DeviceChange }, |
| | | setup() { |
| | | const { loading, fetchData } = useFetchData(10000); |
| | | return { loading, fetchData }; |
| | |
| | | allFactorDatas: new FactorDatas() |
| | | }; |
| | | }, |
| | | watch: { |
| | | factorType(nV, oV) { |
| | | if (nV != oV) { |
| | | realTimeMapAnimation.setFactorType(nV); |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | latestTime() { |
| | | if (this.factorDatas.times.length == 0) { |
| | | return '----/--/-- --:--:--'; |
| | | return ''; |
| | | } else { |
| | | return this.factorDatas.times[this.factorDatas.times.length - 1]; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onDeviceChange({ type, deviceCode }) { |
| | | this.deviceType = type; |
| | | this.deviceCode = deviceCode; |
| | | this.clearFetchingTask(); |
| | | realTimeMapAnimation.stop(); |
| | | this.allFactorDatas.clearData(); |
| | | this.factorDatas.clearData(); |
| | | this.notFirstFetch = false; |
| | | this.fetchRealTimeData(); |
| | | }, |
| | | onFetchData(data) { |
| | | // todo æ ¹æ®è®¾å¤ç±»å忢å°å¾çæµå åå±ç¤ºåéæ¡ãæçº¿å¾å¤éæ¡ãæ°æ®è¡¨æ ¼å¤éæ¡çå åç±»å |
| | | // this.deviceType = type; |
| | |
| | | return monitorDataApi |
| | | .fetchHistroyData({ |
| | | deviceCode: this.deviceCode, |
| | | startTime: '2021-11-04 09:53:35', |
| | | // startTime: '2021-11-04 09:53:35', |
| | | page, |
| | | perPage: 100 |
| | | }) |
| | |
| | | clearFetchingTask() { |
| | | if (this.fetchingTask) { |
| | | clearInterval(this.fetchingTask); |
| | | this.fetchingTask = undefined; |
| | | } |
| | | }, |
| | | fetchNextData() { |
| | |
| | | .fetchNextData({ |
| | | deviceCode: this.deviceCode, |
| | | updateTime: this.latestTime, |
| | | perPage: 2 |
| | | perPage: 10 |
| | | }) |
| | | .then((res) => { |
| | | this.onFetchData(res.data); |
| | |
| | | this.notFirstFetch = true; |
| | | } |
| | | startIndex = startIndex < 0 ? 0 : startIndex; |
| | | this.allFactorDatas.addData(dataList, this.drawMode, () => { |
| | | mapAnimation.moveAnimation( |
| | | this.allFactorDatas, |
| | | this.factorType, |
| | | startIndex |
| | | ); |
| | | return new Promise((resolve, reject) => { |
| | | this.allFactorDatas.addData(dataList, this.drawMode, () => { |
| | | realTimeMapAnimation.moveAnimation( |
| | | this.allFactorDatas, |
| | | this.factorType, |
| | | startIndex |
| | | ); |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | }, |
| | | unmounted() { |
| | | this.clearFetchingTask(); |
| | | mapAnimation.stop(); |
| | | realTimeMapAnimation.stop(); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .dash-board { |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 2px; |
| | | } |
| | | .real-time-trend { |
| | | position: absolute; |
| | | right: 0; |
| | |
| | | <el-col v-show="show" span="10"> |
| | | <BaseCard> |
| | | <template #content> |
| | | <WeatherData :factor-datas="factorDatas"></WeatherData> |
| | | <VehicleData :factor-datas="factorDatas"></VehicleData> |
| | | <WeatherData |
| | | :factor-datas="factorDatas" |
| | | :temprature="temprature" |
| | | :humidity="humidity" |
| | | :wind-direction="windDirection" |
| | | :wind-speed="windSpeed" |
| | | ></WeatherData> |
| | | <VehicleData :factor-datas="factorDatas" :speed="speed"></VehicleData> |
| | | <el-row justify="center"> |
| | | <div class="tag-time">æ¶é´ï¼{{ time }}</div> |
| | | </el-row> |
| | | </template> |
| | | </BaseCard> |
| | | </el-col> |
| | |
| | | </template> |
| | | <script> |
| | | import { FactorDatas } from '@/model/FactorDatas'; |
| | | import { realTimeMapAnimation } from '@/utils/map/animation'; |
| | | |
| | | export default { |
| | | props: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | show: true |
| | | show: true, |
| | | temprature: '--', |
| | | humidity: '--', |
| | | windDirection: '--', |
| | | windSpeed: '--', |
| | | speed: '0', |
| | | time: '----/--/--' |
| | | }; |
| | | }, |
| | | methods: { |
| | | getFactorData(factorDatas, index, key, scale = 10) { |
| | | let d = factorDatas.factor[key].datas[index].factorData; |
| | | return Math.round(d * scale) / scale; |
| | | }, |
| | | refresh(factorDatas, index) { |
| | | this.temprature = this.getFactorData(factorDatas, index, '8') + ''; |
| | | this.humidity = this.getFactorData(factorDatas, index, '9') + ''; |
| | | this.windDirection = this.getFactorData(factorDatas, index, '17') + ''; |
| | | this.windSpeed = this.getFactorData(factorDatas, index, '16') + ''; |
| | | this.speed = this.getFactorData(factorDatas, index, '14', 1); |
| | | this.time = factorDatas.times[index]; |
| | | } |
| | | }, |
| | | mounted() { |
| | | realTimeMapAnimation.setOnEachFrameCallback(this.refresh); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .tag-time { |
| | | padding: 2px 4px; |
| | | border: 1px solid white; |
| | | border-radius: 2px; |
| | | -moz-border-radius: 25px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BaseCard size="middle-s" direction="down"> |
| | | <template #content> |
| | | <el-form :inline="true"> |
| | | <OptionType v-model="formSearch.type"></OptionType> |
| | | <OptionDevice |
| | | :type="formSearch.type" |
| | | v-model="formSearch.deviceCode" |
| | | ></OptionDevice> |
| | | <el-button type="primary" class="el-button-custom" @click="handleClick"> |
| | | 忢 |
| | | </el-button> |
| | | </el-form> |
| | | </template> |
| | | </BaseCard> |
| | | </template> |
| | | |
| | | <script> |
| | | // æç´¢æ¡ |
| | | export default { |
| | | data() { |
| | | return { |
| | | formSearch: { |
| | | type: '', |
| | | deviceCode: '' |
| | | } |
| | | }; |
| | | }, |
| | | emits: ['change'], |
| | | methods: { |
| | | handleClick() { |
| | | this.$emit('change', this.formSearch); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | | .map-date-selector { |
| | | display: inline-block; |
| | | position: relative; |
| | | /* left: 0; |
| | | right: 0; |
| | | top: 0px; */ |
| | | /* padding: 0 4px; */ |
| | | /* color: ffffffbd; */ |
| | | /* background-color: antiquewhite; */ |
| | | } |
| | | </style> |