| | |
| | | * @returns |
| | | */ |
| | | fetchHistroyData({ |
| | | deviceType, |
| | | deviceCode, |
| | | startTime, |
| | | endTime, |
| | |
| | | perPage |
| | | }) { |
| | | let params = `deviceCode=${deviceCode}&page=${page}&perPage=${perPage}`; |
| | | params += deviceType ? `&deviceType=${deviceType}` : ''; |
| | | params += dataType ? `&type=${dataType}` : ''; |
| | | params += startTime ? `&startTime=${startTime}` : ''; |
| | | params += endTime ? `&endTime=${endTime}` : ''; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹èµ°èªæ°æ®æ¥å£ |
| | | */ |
| | | export default { |
| | | /** |
| | | * å¯å¨è·åä»»å¡èå´å
çèµ°èªæ°æ®åå°ä»»å¡ |
| | | * @param {*} missionCode |
| | | */ |
| | | fetchMissionData(missionCode) { |
| | | let label = null; |
| | | if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | label = 'shenxin'; |
| | | } |
| | | if (!label) return; |
| | | |
| | | let params = `label=${label}&missionCode=${missionCode}`; |
| | | return $http |
| | | .get(`air/thirdParty/data/fetch/mission?${params}`) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * å¯å¨è·å设å¤å®æ¶ææ°èµ°èªæ°æ®åå°ä»»å¡ |
| | | * @param {*} deviceType |
| | | * @param {*} deviceCode |
| | | * @param {*} startTime |
| | | * @returns |
| | | */ |
| | | fetchLatestData(deviceType, deviceCode, startTime) { |
| | | let label = null; |
| | | if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | label = 'shenxin'; |
| | | } |
| | | if (!label) return; |
| | | |
| | | let params = `label=${label}&deviceType=${deviceType}&deviceCode=${deviceCode}`; |
| | | params += startTime ? `&startTime=${startTime}` : ''; |
| | | return $http |
| | | .get(`air/thirdParty/data/fetch/latest?${params}`) |
| | | .then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | mounted() { |
| | | this.lineChart = echarts.init(this.$refs.lineChart); |
| | | this.lineChart.on('click', (e) => { |
| | | console.log(e); |
| | | this.$emit('chartClick', this.sIndex + e.dataIndex); |
| | | }); |
| | | } |
| | |
| | | import moment from 'moment'; |
| | | import { ref, reactive, computed } from 'vue'; |
| | | import missionApi from '@/api/missionApi'; |
| | | import thirdPartyDataApi from '@/api/thirdPartyDataApi'; |
| | | import { useFormConfirm } from '@/composables/formConfirm'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import { useMissionStore } from '@/stores/mission'; |
| | |
| | | // message: 'æ¶é´ä¸è½ä¸ºç©º', |
| | | trigger: 'change', |
| | | validator: (rule, value, callback) => { |
| | | console.log(rule); |
| | | console.log(value); |
| | | if (value == null) { |
| | | callback(new Error('æ¶é´ä¸è½ä¸ºç©º')); |
| | | } else { |
| | |
| | | return missionApi.putNewMission(param.value).then((res) => { |
| | | dialogVisible.value = false; |
| | | missionStore.fetchMission(); |
| | | // éç¥æå¡ç«¯å¯å¨ä»»å¡èå´å
çç¬¬ä¸æ¹æ°æ®è·åä»»å¡ |
| | | thirdPartyDataApi.fetchMissionData(param.value.missionCode); |
| | | }); |
| | | }); |
| | | } |
| | |
| | | :show-summary="false" |
| | | :highlight-current-row="true" |
| | | @row-click="handleRowClick" |
| | | @sort-change="handleSort" |
| | | > |
| | | <el-table-column |
| | | :fixed="true" |
| | |
| | | :formatter="timeFormatter" |
| | | align="center" |
| | | width="66" |
| | | sortable="custom" |
| | | > |
| | | </el-table-column> |
| | | <template v-for="item in tableColumn" :key="item.name"> |
| | |
| | | :prop="item.name" |
| | | :label="item.label" |
| | | align="center" |
| | | width="64" |
| | | width="79" |
| | | sortable="custom" |
| | | /> |
| | | </template> |
| | | </el-table> |
| | |
| | | // console.log(row); |
| | | // console.log(col); |
| | | // console.log(event.target.getBoundingClientRect().height); |
| | | }, |
| | | handleSort({ column, prop, order }) { |
| | | console.log(column); |
| | | console.log(prop); |
| | | console.log(order); |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template #content> |
| | | <el-form :inline="true"> |
| | | <OptionMission v-model="mission"></OptionMission> |
| | | <OptionType v-model="formSearch.type"></OptionType> |
| | | <OptionType v-model="formSearch.deviceType"></OptionType> |
| | | <OptionDevice |
| | | :type="formSearch.type" |
| | | :type="formSearch.deviceType" |
| | | v-model="formSearch.deviceCode" |
| | | ></OptionDevice> |
| | | <OptionTime |
| | |
| | | return { |
| | | mission: undefined, |
| | | formSearch: { |
| | | type: '', |
| | | deviceType: '', |
| | | deviceCode: '', |
| | | timeArray: [] |
| | | }, |
| | |
| | | new Date(nV.endTime) |
| | | ]; |
| | | this.dateRange = [new Date(nV.startTime), new Date(nV.endTime)]; |
| | | this.formSearch.type = nV.deviceType; |
| | | this.formSearch.deviceType = nV.deviceType; |
| | | this.formSearch.deviceCode = nV.deviceCode; |
| | | |
| | | // ä»£è¡¨é¦æ¬¡è¿å
¥çé¢ï¼æ¤æ¶èªå¨æ§è¡é¦ä¸ªä»»å¡çæ°æ®æ¥è¯¢æä½ |
| | |
| | | * è·åå岿°æ® |
| | | */ |
| | | function fetchHistoryData(params) { |
| | | if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | const _params = { |
| | | compUser: 'user1', |
| | | compPassword: 'User1@jingan', |
| | | mn: params.deviceCode, |
| | | dtFrom: params.startTime |
| | | ? params.startTime |
| | | : moment().subtract(6, 'm').format('YYYY-MM-DD HH:mm:ss'), |
| | | dtTo: params.endTime |
| | | ? params.endTime |
| | | : moment().format('YYYY-MM-DD HH:mm:ss') |
| | | }; |
| | | return fetchThirdPartyData(_params); |
| | | } else { |
| | | // if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | // const _params = { |
| | | // compUser: 'user1', |
| | | // compPassword: 'User1@jingan', |
| | | // mn: params.deviceCode, |
| | | // dtFrom: params.startTime |
| | | // ? params.startTime |
| | | // : moment().subtract(6, 'm').format('YYYY-MM-DD HH:mm:ss'), |
| | | // dtTo: params.endTime |
| | | // ? params.endTime |
| | | // : moment().format('YYYY-MM-DD HH:mm:ss') |
| | | // }; |
| | | // return fetchThirdPartyData(_params); |
| | | // } else { |
| | | // return fetchOriginHistoryData(params); |
| | | // } |
| | | return fetchOriginHistoryData(params); |
| | | } |
| | | } |
| | | |
| | | var fetchingTask; |
| | |
| | | // æ°æ®è·åæ¹æ³ |
| | | let fetchFun; |
| | | if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | // è¯¥æ°æ®ä¼ è¾æä½é´é为1åéï¼æ¯æ¬¡è·åç»ææ¶é´èªå¨è°æ´ä¸ºå¼å§æ¶é´ç1åéå |
| | | // è¯¥æ°æ®ä¼ è¾æä½é´é为1åéï¼æ¯æ¬¡è·åç»ææ¶é´èªå¨è°æ´ä¸ºå¼å§æ¶é´ç0.5åéå |
| | | fetchFun = fetchThirdPartyData; |
| | | interval = 60 * 1000; |
| | | interval = 30 * 1000; |
| | | } else { |
| | | fetchFun = fetchOriginRealTimeData; |
| | | interval = 10 * 1000; |
| | |
| | | sector.clearSector(); |
| | | }); |
| | | }, |
| | | onFetchData(type, data) { |
| | | onFetchData(deviceType, data) { |
| | | // todo æ ¹æ®è®¾å¤ç±»å忢å°å¾çæµå åå±ç¤ºåéæ¡ãæçº¿å¾å¤éæ¡ãæ°æ®è¡¨æ ¼å¤éæ¡çå åç±»å |
| | | this.deviceType = type; |
| | | this.deviceType = deviceType; |
| | | this.factorDatas.setData(data, this.drawMode, () => { |
| | | this.factorDatas.refreshHeight(this.factorType); |
| | | this.draw(); |
| | | }); |
| | | }, |
| | | fetchHistroyData(option) { |
| | | const { deviceCode, type, timeArray } = option; |
| | | const { deviceType, deviceCode, timeArray } = option; |
| | | this.deviceType = deviceType; |
| | | this.deviceCode = deviceCode; |
| | | let startTime, endTime; |
| | | if (timeArray && timeArray.length == 2) { |
| | |
| | | } |
| | | this.fetchData((page, pageSize) => { |
| | | return fetchHistoryData({ |
| | | deviceType, |
| | | deviceCode, |
| | | startTime, |
| | | endTime, |
| | | page, |
| | | perPage: pageSize |
| | | }).then((res) => this.onFetchData(type, res.data)); |
| | | }).then((res) => this.onFetchData(deviceType, res.data)); |
| | | }); |
| | | } |
| | | // fetchRealTimeData() { |
| | |
| | | startLoopFetchRealTimeData, |
| | | clearFetchingTask |
| | | } from '@/utils/factor/data'; |
| | | import thirdPartyDataApi from '@/api/thirdPartyDataApi'; |
| | | |
| | | // const mapAnimation = new MapAnimation(); |
| | | |
| | |
| | | // this.fetchNextData(res.data[res.data.length - 1].time); |
| | | // } |
| | | this.fetchNextData(); |
| | | thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode); |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | (res) => { |
| | | this.onFetchData(res.data); |
| | | this.onMapData(res.data); |
| | | thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode); |
| | | } |
| | | ); |
| | | }, |