¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | import moment from 'moment'; |
| | | |
| | | export default { |
| | | fetchAOD(groupId, dataTime) { |
| | | return $http |
| | | .get(`air/satellite/grid/aod`, { |
| | | params: { |
| | | groupId, |
| | | dataTime |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | fetchAODDetail(aodId, groupId, cellId) { |
| | | return $http |
| | | .get(`air/satellite/aod/data/detail`, { |
| | | params: { |
| | | aodId, |
| | | groupId, |
| | | cellId |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | }; |
| | |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * è·åç½æ ¼ç»ä¸ç饿µaod |
| | | * @param {*} groupId |
| | | * @param {*} dataTime |
| | | * @returns |
| | | */ |
| | | fetchGridAod(groupId, dataTime) { |
| | | return $http |
| | | .get(`air/satellite/grid/aod`, { |
| | | params: { |
| | | groupId, |
| | | dataTime |
| | | } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | // /** |
| | | // * è·åç½æ ¼ç»ä¸ç饿µaod |
| | | // * @param {*} groupId |
| | | // * @param {*} dataTime |
| | | // * @returns |
| | | // */ |
| | | // fetchGridAod(groupId, dataTime) { |
| | | // return $http |
| | | // .get(`air/satellite/grid/aod`, { |
| | | // params: { |
| | | // groupId, |
| | | // dataTime |
| | | // } |
| | | // }) |
| | | // .then((res) => res.data); |
| | | // }, |
| | | |
| | | fetchGridDataDetail(dataId, groupId, cellId) { |
| | | return $http |
| | |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | createGridDataAndDataDetail(groupId, dataTime, dataDetailList) { |
| | | return $http |
| | | .post(`air/satellite/grid/data/create`, { |
| | | params: { |
| | | groupId, |
| | | dataTime |
| | | }, |
| | | data: dataDetailList |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | downloadTemplate() { |
| | | return $http |
| | | .get(`air/satellite/import/grid/data/download/template`, { |
| | |
| | | } |
| | | |
| | | if (debug) { |
| | | ip1 = 'http://192.168.0.110:8084/'; |
| | | // ip1 = 'http://192.168.0.110:8084/'; |
| | | ip1 = 'http://192.168.1.8:8084/'; |
| | | } |
| | | |
| | | const $http = axios.create({ |
| | |
| | | CardButton: typeof import('./components/CardButton.vue')['default'] |
| | | CardDialog: typeof import('./components/CardDialog.vue')['default'] |
| | | ConfigManage: typeof import('./components/map/ConfigManage.vue')['default'] |
| | | copy: typeof import('./components/search/OptionAOD.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'] |
| | |
| | | ElFormItem: typeof import('element-plus/es')['ElFormItem'] |
| | | ElIcon: typeof import('element-plus/es')['ElIcon'] |
| | | ElInput: typeof import('element-plus/es')['ElInput'] |
| | | ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElPopover: typeof import('element-plus/es')['ElPopover'] |
| | | ElRadio: typeof import('element-plus/es')['ElRadio'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | ElSlider: typeof import('element-plus/es')['ElSlider'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElTabPane: typeof import('element-plus/es')['ElTabPane'] |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElUpload: typeof import('element-plus/es')['ElUpload'] |
| | | FactorCheckbox: typeof import('./components/monitor/FactorCheckbox.vue')['default'] |
| | |
| | | MissionEdit: typeof import('./components/mission/MissionEdit.vue')['default'] |
| | | MissionImport: typeof import('./components/mission/MissionImport.vue')['default'] |
| | | MissionManage: typeof import('./components/mission/MissionManage.vue')['default'] |
| | | OptionAOD: typeof import('./components/search/OptionAOD.vue')['default'] |
| | | OptionDevice: typeof import('./components/search/OptionDevice.vue')['default'] |
| | | OptionGridGroup: typeof import('./components/search/OptionGridGroup.vue')['default'] |
| | | OptionLocation: typeof import('./components/search/OptionLocation.vue')['default'] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form-item label="AODæ°æ®"> |
| | | <el-select |
| | | :loading="loading" |
| | | v-model="index" |
| | | @change="handleChange" |
| | | placeholder="éæ©AODæ°æ®" |
| | | size="small" |
| | | class="w-150" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in aodList" |
| | | :key="i" |
| | | :label="timeFormatter(s.dataTime)" |
| | | :value="i" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import moment from 'moment'; |
| | | import aodApi from '@/api/aodApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | defineProps({ |
| | | modelValue: Object |
| | | }); |
| | | |
| | | const emits = defineEmits(['update:modelValue']); |
| | | |
| | | const { loading, fetchData } = useFetchData(); |
| | | const aodList = ref([]); |
| | | const index = ref(null); |
| | | |
| | | function fetchAOD(groupId, dataTime) { |
| | | return fetchData(() => { |
| | | return aodApi.fetchAOD(groupId, dataTime).then((res) => { |
| | | aodList.value = res.data; |
| | | if (res.data.length > 0) { |
| | | index.value = 0; |
| | | handleChange(0); |
| | | } else { |
| | | index.value = null; |
| | | handleChange(null); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | function timeFormatter(value) { |
| | | return moment(value).format('YYYY-MM-DD'); |
| | | } |
| | | |
| | | function handleChange(value) { |
| | | emits('update:modelValue', value != null ? aodList.value[value] : null); |
| | | } |
| | | |
| | | // onMounted(() => { |
| | | // fetchAOD(); |
| | | // }); |
| | | |
| | | defineExpose({ fetchAOD }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // import { ref } from 'vue'; |
| | | // import { defineStore } from 'pinia'; |
| | | // import { useFetchData } from '@/composables/fetchData'; |
| | | // import sceneInfoApi from '@/api/sceneInfoApi'; |
| | | // import { useToolboxStore } from '@/stores/toolbox'; |
| | | |
| | | // const toolboxStore = useToolboxStore(); |
| | | |
| | | // // èµ°èªè®¾å¤ |
| | | // export const useGridStore = defineStore('grid', () => { |
| | | // const selectedGrid = ref(undefined); |
| | | |
| | | // function searchScene(lng, lat) { |
| | | // // if (toolboxStore.sceneSearchStatus) { |
| | | // return fetchData(() => { |
| | | // return sceneInfoApi |
| | | // .searchByCoordinate(lng, lat, radius.value * 1000) |
| | | // .then((res) => { |
| | | // sceneList.value = res.data.filter((v) => { |
| | | // return v.typeId != 19 && v.typeId != 20; |
| | | // }); |
| | | // return res; |
| | | // }); |
| | | // }); |
| | | // // } |
| | | // } |
| | | |
| | | // return { radius, sceneList, loading, searchScene }; |
| | | // }); |
| | |
| | | return v.type == 1; |
| | | }); |
| | | }); |
| | | // ç½æ ¼æ°æ®è¯¦æ
|
| | | const gridDataDetailMap = new Map(); |
| | | const selectedGridData = ref(undefined) |
| | | |
| | | const selectedGridDataDetail = ref(undefined) |
| | | |
| | | // è·åç½æ ¼ä¿¡æ¯ |
| | | function fetchGridCell(groupId) { |
| | |
| | | } |
| | | |
| | | // è·å饿µåæ¥å
·ä½ç½æ ¼çæµæ°æ® |
| | | function fetchGridDataDetail(gridData) { |
| | | return gridApi |
| | | .fetchGridDataDetail(gridData.id, gridData.groupId) |
| | | .then((res) => { |
| | | gridData.dataDetail = res.data; |
| | | function fetchGridDataDetail(gridData, callback) { |
| | | if (gridDataDetailMap.has(gridData.id)) { |
| | | selectedGridData.value = gridDataDetailMap.get(gridData.id); |
| | | callback(selectedGridData.value); |
| | | } else { |
| | | gridApi.fetchGridDataDetail(gridData.id, gridData.groupId).then((res) => { |
| | | gridDataDetailMap.set(gridData.id, res.data); |
| | | selectedGridData.value = res.data; |
| | | callback(selectedGridData.value); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return { |
| | |
| | | allGridDataList, |
| | | gridDataList, |
| | | mixGridDataList, |
| | | selectedGridData, |
| | | fetchGridCell, |
| | | fetchGridData, |
| | | fetchGridDataDetail |
| | |
| | | <!-- <MapLocation></MapLocation> --> |
| | | <SceneSearch></SceneSearch> |
| | | <MapScene></MapScene> |
| | | <el-button |
| | | <!-- <el-button |
| | | @click="satelliteImportVisible = !satelliteImportVisible" |
| | | type="primary" |
| | | class="el-button-custom satellite-right-top p-events-auto" |
| | |
| | | type="primary" |
| | | class="el-button-custom aod-right-top p-events-auto" |
| | | >AODæ°æ®å¯¼å
¥</el-button |
| | | > |
| | | > --> |
| | | <ProductManage class="satellite-right-top"></ProductManage> |
| | | </el-row> |
| | | <!-- <CoreMenu></CoreMenu> --> |
| | | <router-view></router-view> |
| | |
| | | import { ref } from 'vue'; |
| | | import SatelliteImport from './satellitetelemetry/component/SatelliteImport.vue'; |
| | | import AODImport from './satellitetelemetry/component/AODImport.vue'; |
| | | import ProductManage from './dataproduct/ProductManage.vue'; |
| | | const satelliteImportVisible = ref(false); |
| | | const aodImportVisible = ref(false); |
| | | </script> |
| | |
| | | <template> |
| | | <div> |
| | | <el-button |
| | | @click="satelliteImportVisible = !satelliteImportVisible" |
| | | @click="dialogVisible = !dialogVisible" |
| | | type="primary" |
| | | class="el-button-custom satellite-right-top p-events-auto" |
| | | >AODæ°æ®å¯¼å
¥</el-button |
| | | class="el-button-custom p-events-auto" |
| | | >æ°æ®äº§å</el-button |
| | | > |
| | | </div> |
| | | |
| | | <el-table |
| | | :data="gridDataList" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | height="50vh" |
| | | row-class-name="t-row-normal" |
| | | cell-class-name="t-cell" |
| | | header-row-class-name="t-header-row" |
| | | header-cell-class-name="t-header-cell" |
| | | :highlight-current-row="true" |
| | | @row-click="handleRowClick" |
| | | <CardDialog |
| | | draggable |
| | | :modal="false" |
| | | title="æ°æ®äº§å管ç" |
| | | v-model="dialogVisible" |
| | | width="600px" |
| | | > |
| | | <el-table-column type="index" label="åºå·" align="center" width="50" /> |
| | | <el-table-column |
| | | prop="dataTime" |
| | | label="æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | prop="type" |
| | | label="æ°æ®ç±»å" |
| | | align="center" |
| | | :formatter="dataTypeFormatter" |
| | | width="150" |
| | | /> |
| | | </el-table> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="å级产åå¶ä½" name="first"> |
| | | <ProductMake></ProductMake> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="AODæ°æ®å¯¼å
¥" name="second"> |
| | | <AODImport></AODImport> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="å级产å导å
¥" name="third"> |
| | | <SatelliteImport></SatelliteImport> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="äºçº§äº§åå¶ä½" name="fourth"> |
| | | |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </CardDialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import SatelliteImport from "@/views/satellitetelemetry/component/SatelliteImport.vue"; |
| | | import AODImport from "@/views/satellitetelemetry/component/AODImport.vue"; |
| | | import ProductMake from "@/views/dataproduct/component/ProductMake.vue"; |
| | | import { ref, onMounted } from 'vue'; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const activeName = ref('first'); |
| | | |
| | | |
| | | |
| | | // AODæ°æ®æåï¼çæåçº§æ°æ®äº§å |
| | | // 1. å¯èªå¨éè¿å
¬å¼æå为PM2.5æ°æ®ï¼ç¨æ·å¯ä¿®æ¹ç¸å
³åæ°ï¼ |
| | |
| | | // 1. AODæ°æ®å¯¼å
¥ |
| | | // 2. AODæ°æ®æåï¼éæ©AODæ°æ®ç»ãå±ç¤ºå·²æç»æãè°æ´åæ°ãæ¾ç¤ºå¯¹åºæ¶é´çèæ¯æ°æ®ãæä¾ç»æçæäºæ¬¡ç¡®è®¤å
è®¸è°æ´åæ°éå¤çæãåå¨ææ´æ°ç»æ |
| | | </script> |
| | | <style scoped> |
| | | ::v-deep .el-tabs__item { |
| | | color: white; |
| | | } |
| | | ::v-deep .is-active { |
| | | color: #23dad0a2; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form |
| | | :inline="true" |
| | | :model="formObj" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | label-position="right" |
| | | label-width="80px" |
| | | > |
| | | <SatelliteSearchBar |
| | | label-width="80px" |
| | | :loading="loading" |
| | | @search="onSearchAOD" |
| | | ></SatelliteSearchBar> |
| | | <OptionAOD ref="optionAODRef" v-model="aodData"></OptionAOD> |
| | | <el-form-item label="产åè®°å½"> |
| | | <el-text :type="historyGridData ? 'warning' : 'success'">{{ |
| | | historyGridData ? 'å·²çæ' : 'æªçæ' |
| | | }}</el-text> |
| | | </el-form-item> |
| | | <el-form-item label="æåå
¬å¼"> |
| | | <div> |
| | | y = |
| | | <el-input-number |
| | | v-model="a" |
| | | :precision="2" |
| | | controls-position="right" |
| | | :controls="false" |
| | | placeholder="请è¾å
¥ç³»æ°a" |
| | | size="small" |
| | | /> |
| | | x + |
| | | <el-input-number |
| | | v-model="b" |
| | | :precision="2" |
| | | controls-position="right" |
| | | :controls="false" |
| | | placeholder="请è¾å
¥ç³»æ°b" |
| | | size="small" |
| | | /> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="handleShowAODClick" |
| | | > |
| | | {{ 'æ¾ç¤ºAODæ°æ®' }} |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="handlePreviewClick" |
| | | > |
| | | {{ 'æåé¢è§' }} |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="handleSaveClick" |
| | | > |
| | | {{ 'ä¿åæåç»æ' }} |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch } from 'vue'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import aodApi from '@/api/aodApi'; |
| | | import moment from 'moment'; |
| | | import SatelliteSearchBar from '@/views/satellitetelemetry/component/SatelliteSearchBar.vue'; |
| | | import { SatelliteProxy } from '@/views/satellitetelemetry/SatelliteProxy'; |
| | | |
| | | const satelliteProxy = new SatelliteProxy(); |
| | | |
| | | const optionAODRef = ref(null); |
| | | |
| | | const gridGroup = ref(null); |
| | | const aodData = ref(null); |
| | | const aodDataDetail = ref(null); |
| | | const historyGridData = ref(null); |
| | | const a = ref(null); |
| | | const b = ref(null); |
| | | const tempGridDataDetailList = ref(null); |
| | | |
| | | function handleShowAODClick() { |
| | | if (aodDataDetail.value) { |
| | | showAOD(aodDataDetail.value); |
| | | } else { |
| | | _fetchAODDetail().then((res) => { |
| | | showAOD(res); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // 计ç®PM2.5ç»æï¼åç»åºè¯¥å¨å端å®ç° |
| | | function calculatePM25(aod) { |
| | | return Math.round((a.value * aod + b.value) * 100) / 100; |
| | | } |
| | | |
| | | function handlePreviewClick() { |
| | | if (aodDataDetail.value) { |
| | | showPreview(aodDataDetail.value); |
| | | } else { |
| | | _fetchAODDetail().then((res) => { |
| | | showPreview(res); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function showAOD(data) { |
| | | const _aod = data.map((v, i) => { |
| | | return { |
| | | groupId: v.groupId, |
| | | cellId: v.cellId, |
| | | pm25: v.aod, |
| | | rank: i + 1 |
| | | }; |
| | | }); |
| | | satelliteProxy.drawGrid({ |
| | | gridData: _aod, |
| | | showDataTxt: true, |
| | | showRankTxt: true |
| | | }); |
| | | } |
| | | |
| | | function showPreview(data) { |
| | | tempGridDataDetailList.value = data.map((v, i) => { |
| | | return { |
| | | groupId: v.groupId, |
| | | cellId: v.cellId, |
| | | pm25: calculatePM25(v.aod), |
| | | rank: i + 1 |
| | | }; |
| | | }); |
| | | tempGridDataDetailList.value.sort((a, b) => { |
| | | return b.pm25 - a.pm25; |
| | | }); |
| | | satelliteProxy.drawGrid({ |
| | | gridData: tempGridDataDetailList.value, |
| | | showDataTxt: true, |
| | | showRankTxt: true |
| | | }); |
| | | } |
| | | |
| | | function handleSaveClick() {} |
| | | |
| | | function _fetchAODDetail() { |
| | | return aodApi |
| | | .fetchAODDetail(aodData.value.id, gridGroup.value.id) |
| | | .then((res) => { |
| | | res.data.sort((a, b) => { |
| | | return b.aod - a.aod; |
| | | }); |
| | | aodDataDetail.value = res.data; |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | function onSearchAOD(options) { |
| | | gridGroup.value = options; |
| | | gridApi.fetchGridCell(options.id).then((res) => { |
| | | satelliteProxy.gridPrepare(res.data); |
| | | }); |
| | | optionAODRef.value.fetchAOD(options.id); |
| | | } |
| | | |
| | | function checkHistoryGridData() { |
| | | if (aodData.value) { |
| | | const groupId = gridGroup.value.id; |
| | | const dataTime = moment(aodData.value.dataTime).format( |
| | | 'YYYY-MM-DD HH:mm:ss' |
| | | ); |
| | | // åå§å«ææ°æ® |
| | | const type = 0; |
| | | return gridApi.fetchGridData(groupId, dataTime, type).then((res) => { |
| | | if (res.data.length > 0) { |
| | | historyGridData.value = res.data[0]; |
| | | } else { |
| | | historyGridData.value = null; |
| | | } |
| | | }); |
| | | } else { |
| | | historyGridData.value = null; |
| | | } |
| | | } |
| | | |
| | | watch(aodData, (nv, ov) => { |
| | | if (nv != ov) { |
| | | aodDataDetail.value = null; |
| | | checkHistoryGridData(); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | import gridMapUtil from '@/utils/map/grid'; |
| | | import { map, onMapMounted } from '@/utils/map/index_old'; |
| | | |
| | | let districtPolygon; |
| | | export class SatelliteProxy { |
| | | // å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | mapViews; |
| | | |
| | | districtPolygon; |
| | | // ç»å¶åºå¿è¾¹ç |
| | | function drawDistrict(districtName, isNew) { |
| | | drawDistrict(districtName, isNew) { |
| | | onMapMounted(() => { |
| | | if (districtPolygon && !isNew) { |
| | | map.remove(districtPolygon); |
| | | map.add(districtPolygon); |
| | | if (this.districtPolygon && !isNew) { |
| | | map.remove(this.districtPolygon); |
| | | map.add(this.districtPolygon); |
| | | } else { |
| | | // eslint-disable-next-line no-undef |
| | | var district = new AMap.DistrictSearch({ |
| | | extensions: 'all', //è¿åè¡æ¿åºè¾¹çåæ çå
·ä½ä¿¡æ¯ |
| | | level: 'district' //设置æ¥è¯¢è¡æ¿åºçº§å«ä¸ºåº |
| | | }); |
| | | district.search(districtName, function (status, result) { |
| | | district.search(districtName, (status, result) => { |
| | | var bounds = result.districtList[0].boundaries; //è·åæé³åºçè¾¹çä¿¡æ¯ |
| | | if (bounds) { |
| | | for (var i = 0; i < bounds.length; i++) { |
| | | //çæè¡æ¿åºå polygon |
| | | // eslint-disable-next-line no-undef |
| | | districtPolygon = new AMap.Polygon({ |
| | | this.districtPolygon = new AMap.Polygon({ |
| | | map: map, //æ¾ç¤ºè¯¥è¦çç©çå°å¾å¯¹è±¡ |
| | | strokeWeight: 2, //è½®å»çº¿å®½åº¦ |
| | | path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» |
| | |
| | | }); |
| | | } |
| | | |
| | | function clearAll(mapViews) { |
| | | clearAll(mapViews) { |
| | | if (mapViews) { |
| | | if (typeof mapViews.textViews === 'object') { |
| | | map.remove(mapViews.textViews); |
| | | } |
| | | if (typeof mapViews.gridViews === 'object') { |
| | | map.remove(mapViews.gridViews); |
| | | } |
| | | } |
| | | this.clearText(mapViews); |
| | | } |
| | | |
| | | function clearText(mapViews) { |
| | | clearText(mapViews) { |
| | | if (mapViews) { |
| | | if (typeof mapViews.dataTxt === 'object') { |
| | | map.remove(mapViews.dataTxt); |
| | |
| | | } |
| | | |
| | | // ç»å¶ç½æ ¼çº¿ |
| | | function drawPolyline(gridInfo, event) { |
| | | drawPolyline(gridInfo, event) { |
| | | // ç»å¶ç½æ ¼ |
| | | const points = gridInfo.map((v) => { |
| | | return calculate.wgs84_To_Gcj02(v.longitude, v.latitude); |
| | |
| | | } |
| | | |
| | | // ç»å¶çæµæ°æ®å¼ |
| | | function drawDataText(points, gridDataDetail, textViews, labelsLayer) { |
| | | drawDataText(points, gridDataDetail, textViews, labelsLayer) { |
| | | const data = gridDataDetail.map((v, i) => { |
| | | return { |
| | | lnglat_GD: points[i], |
| | |
| | | } |
| | | |
| | | // ç»å¶çæµæ°æ®æåææ¬ |
| | | function drawRankText(points, gridDataDetail, textViews, labelsLayer) { |
| | | drawRankText(points, gridDataDetail, textViews, labelsLayer) { |
| | | const data = gridDataDetail.map((v, i) => { |
| | | return { |
| | | lnglat_GD: points[i], |
| | |
| | | } |
| | | |
| | | // ç»å¶çæµæ°æ®å¼å¯¹åºç½æ ¼é¢è² |
| | | function drawColor({ |
| | | drawColor({ |
| | | gridViews, |
| | | points, |
| | | gridDataDetail, |
| | |
| | | return { resGridViews, pointsRes }; |
| | | } |
| | | |
| | | export default { |
| | | drawDistrict, |
| | | drawPolyline, |
| | | drawDataText, |
| | | drawRankText, |
| | | drawColor, |
| | | clearText, |
| | | clearAll |
| | | }; |
| | | // å«æç½æ ¼é
ç½®åå¤ |
| | | gridPrepare(gridInfo, event) { |
| | | // clearText(mapViews); |
| | | this.clearAll(this.mapViews); |
| | | this.mapViews = this.drawPolyline(gridInfo, event); |
| | | } |
| | | |
| | | // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² |
| | | drawGrid({ |
| | | gridData, |
| | | useCustomColor, |
| | | opacity, |
| | | zIndex, |
| | | showDataTxt, |
| | | showRankTxt |
| | | }) { |
| | | // SatelliteProxy.clearText(mapViews); |
| | | const { resGridViews, pointsRes } = this.drawColor({ |
| | | gridViews: this.mapViews.gridViews, |
| | | points: this.mapViews.points, |
| | | gridDataDetail: gridData, |
| | | lastGridViews: this.mapViews.lastGridViews, |
| | | customColor: useCustomColor, |
| | | opacity: opacity, |
| | | zIndex: zIndex |
| | | }); |
| | | this.mapViews.lastGridViews = resGridViews; |
| | | this.mapViews.lastPoints = pointsRes; |
| | | |
| | | // æ°æ®æ è®° |
| | | const { textViews: dataTxt, labelsLayer: dataLayer } = this.drawDataText( |
| | | this.mapViews.lastPoints, |
| | | gridData, |
| | | this.mapViews.dataTxt, |
| | | this.mapViews.dataLayer |
| | | ); |
| | | this.mapViews.dataTxt = dataTxt; |
| | | this.mapViews.dataLayer = dataLayer; |
| | | |
| | | const { textViews: rankTxt, labelsLayer: rankLayer } = this.drawRankText( |
| | | this.mapViews.lastPoints, |
| | | gridData, |
| | | this.mapViews.rankTxt, |
| | | this.mapViews.rankLayer |
| | | ); |
| | | this.mapViews.rankTxt = rankTxt; |
| | | this.mapViews.rankLayer = rankLayer; |
| | | |
| | | if (showDataTxt) { |
| | | map.add(this.mapViews.dataTxt); |
| | | } |
| | | |
| | | if (showRankTxt) { |
| | | map.add(this.mapViews.rankTxt); |
| | | } |
| | | } |
| | | |
| | | // è°æ´åç±»å°å¾è¦çç©çå¯è§æ§ |
| | | changeVisibility({ showGridViews, showDataTxt, showRankTxt }) { |
| | | if (showGridViews != undefined) { |
| | | showGridViews |
| | | ? map.add(this.mapViews.lastGridViews) |
| | | : map.remove(this.mapViews.lastGridViews); |
| | | } |
| | | if (showDataTxt != undefined) { |
| | | showDataTxt |
| | | ? map.add(this.mapViews.dataTxt) |
| | | : map.remove(this.mapViews.dataTxt); |
| | | } |
| | | if (showRankTxt != undefined) { |
| | | showRankTxt |
| | | ? map.add(this.mapViews.rankTxt) |
| | | : map.remove(this.mapViews.rankTxt); |
| | | } |
| | | } |
| | | |
| | | changeGridOpacity({ isOpacity, opacityValue }) { |
| | | this.mapViews.lastGridViews.forEach((e) => { |
| | | e.setOptions({ |
| | | fillOpacity: opacityValue ? opacityValue : isOpacity ? 0.1 : 0.7 |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | setGridEvent(event) { |
| | | this.mapViews.gridViews.forEach((polygon) => { |
| | | event(polygon); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | // // å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | // let mapViews; |
| | | |
| | | // let districtPolygon; |
| | | // // ç»å¶åºå¿è¾¹ç |
| | | // function drawDistrict(districtName, isNew) { |
| | | // onMapMounted(() => { |
| | | // if (districtPolygon && !isNew) { |
| | | // map.remove(districtPolygon); |
| | | // map.add(districtPolygon); |
| | | // } else { |
| | | // // eslint-disable-next-line no-undef |
| | | // var district = new AMap.DistrictSearch({ |
| | | // extensions: 'all', //è¿åè¡æ¿åºè¾¹çåæ çå
·ä½ä¿¡æ¯ |
| | | // level: 'district' //设置æ¥è¯¢è¡æ¿åºçº§å«ä¸ºåº |
| | | // }); |
| | | // district.search(districtName, function (status, result) { |
| | | // var bounds = result.districtList[0].boundaries; //è·åæé³åºçè¾¹çä¿¡æ¯ |
| | | // if (bounds) { |
| | | // for (var i = 0; i < bounds.length; i++) { |
| | | // //çæè¡æ¿åºå polygon |
| | | // // eslint-disable-next-line no-undef |
| | | // districtPolygon = new AMap.Polygon({ |
| | | // map: map, //æ¾ç¤ºè¯¥è¦çç©çå°å¾å¯¹è±¡ |
| | | // strokeWeight: 2, //è½®å»çº¿å®½åº¦ |
| | | // path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» |
| | | // fillOpacity: 0, //å¤è¾¹å½¢å¡«å
éæåº¦ |
| | | // fillColor: '#CCF3FF', //å¤è¾¹å½¢å¡«å
é¢è² |
| | | // // strokeColor: '#ffffff' //线æ¡é¢è² |
| | | // strokeColor: '#0552f7', //线æ¡é¢è² |
| | | // zIndex: 9 |
| | | // }); |
| | | // } |
| | | // map.setFitView(); //å°è¦çç©è°æ´å°åéè§é |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | // function clearAll(mapViews) { |
| | | // if (mapViews) { |
| | | // if (typeof mapViews.gridViews === 'object') { |
| | | // map.remove(mapViews.gridViews); |
| | | // } |
| | | // } |
| | | // clearText(mapViews); |
| | | // } |
| | | |
| | | // function clearText(mapViews) { |
| | | // if (mapViews) { |
| | | // if (typeof mapViews.dataTxt === 'object') { |
| | | // map.remove(mapViews.dataTxt); |
| | | // } |
| | | // if (typeof mapViews.dataLayer === 'object') { |
| | | // map.remove(mapViews.dataLayer); |
| | | // } |
| | | // if (typeof mapViews.rankTxt === 'object') { |
| | | // map.remove(mapViews.rankTxt); |
| | | // } |
| | | // if (typeof mapViews.rankLayer === 'object') { |
| | | // map.remove(mapViews.rankLayer); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // // ç»å¶ç½æ ¼çº¿ |
| | | // function drawPolyline(gridInfo, event) { |
| | | // // ç»å¶ç½æ ¼ |
| | | // const points = gridInfo.map((v) => { |
| | | // return calculate.wgs84_To_Gcj02(v.longitude, v.latitude); |
| | | // // return [v.longitude, v.latitude]; |
| | | // }); |
| | | // // const gridPoints = gridMapUtil.parseGridPoint(points); |
| | | // // console.log('gridPoints:', gridPoints); |
| | | |
| | | // const gridPoints = gridInfo.map((v, i) => { |
| | | // return { |
| | | // path: [ |
| | | // calculate.wgs84_To_Gcj02(v.point1Lon, v.point1Lat), |
| | | // calculate.wgs84_To_Gcj02(v.point2Lon, v.point2Lat), |
| | | // calculate.wgs84_To_Gcj02(v.point3Lon, v.point3Lat), |
| | | // calculate.wgs84_To_Gcj02(v.point4Lon, v.point4Lat) |
| | | // // [v.point1Lon, v.point1Lat], |
| | | // // [v.point2Lon, v.point2Lat], |
| | | // // [v.point3Lon, v.point3Lat], |
| | | // // [v.point4Lon, v.point4Lat] |
| | | // ] |
| | | // // eslint-disable-next-line no-undef |
| | | // .map((d) => new AMap.LngLat(d[0], d[1])), |
| | | // extData: points[i] |
| | | // }; |
| | | // }); |
| | | // const gridViews = gridMapUtil.drawPolylines({ points: gridPoints, event }); |
| | | // return { gridViews, gridPoints, points }; |
| | | // } |
| | | |
| | | // // ç»å¶çæµæ°æ®å¼ |
| | | // function drawDataText(points, gridDataDetail, textViews, labelsLayer) { |
| | | // const data = gridDataDetail.map((v, i) => { |
| | | // return { |
| | | // lnglat_GD: points[i], |
| | | // // data: v.pm25 ? (v.pm25 + 'μg/m³') : '' |
| | | // data: v.pm25 ? v.pm25 : '' |
| | | // }; |
| | | // }); |
| | | // // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'bottom'); |
| | | // return gridMapUtil.drawGridText(data, textViews, 'top-center', 'data'); |
| | | // } |
| | | |
| | | // // ç»å¶çæµæ°æ®æåææ¬ |
| | | // function drawRankText(points, gridDataDetail, textViews, labelsLayer) { |
| | | // const data = gridDataDetail.map((v, i) => { |
| | | // return { |
| | | // lnglat_GD: points[i], |
| | | // // data: v.pm25 ? ('æå: ' + v.rank) : '' |
| | | // data: v.pm25 ? v.rank : '' |
| | | // }; |
| | | // }); |
| | | // // return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'top'); |
| | | // return gridMapUtil.drawGridText(data, textViews, 'bottom-center', 'rank'); |
| | | // } |
| | | |
| | | // // ç»å¶çæµæ°æ®å¼å¯¹åºç½æ ¼é¢è² |
| | | // function drawColor({ |
| | | // gridViews, |
| | | // points, |
| | | // gridDataDetail, |
| | | // lastGridViews, |
| | | // opacity, |
| | | // zIndex, |
| | | // customColor |
| | | // }) { |
| | | // // æ ¹æ®æ°æ®çéææ°æ®çç½æ ¼ |
| | | // const res = []; |
| | | // // 以å对åºçä¸å¿ç¹åæ |
| | | // const pointsRes = []; |
| | | // gridDataDetail.forEach((d) => { |
| | | // // æ ¹æ®æ°æ®å
³èçç½æ ¼ç¼å·ï¼æ¾å°å¯¹åºç½æ ¼ |
| | | // const cellId = d.cellId; |
| | | // if (cellId > gridViews.length) { |
| | | // throw Error( |
| | | // '饿µæ°æ®çç½æ ¼ç´¢å¼ç¼å·è¶
åºç½æ ¼ç»èå´ï¼æ°æ®åç½æ ¼ç»å¯è½ä¸å¯¹åº' |
| | | // ); |
| | | // } |
| | | // res.push(gridViews[cellId - 1]); |
| | | // pointsRes.push(points[cellId - 1]); |
| | | // }); |
| | | |
| | | // // æ ¹æ®ç»å¶é¢è²æ¹å¼ç»å¶ç½æ ¼ |
| | | // let resGridViews; |
| | | // if (customColor) { |
| | | // resGridViews = gridMapUtil.drawGridColorCustom( |
| | | // res, |
| | | // gridDataDetail, |
| | | // opacity, |
| | | // zIndex |
| | | // ); |
| | | // } else { |
| | | // resGridViews = gridMapUtil.drawGridColor( |
| | | // res, |
| | | // gridDataDetail, |
| | | // 'PM25', |
| | | // opacity, |
| | | // zIndex |
| | | // ); |
| | | // } |
| | | |
| | | // if (lastGridViews) { |
| | | // map.remove(lastGridViews); |
| | | // } |
| | | // map.add(resGridViews); |
| | | // map.setFitView(resGridViews); |
| | | |
| | | // return { resGridViews, pointsRes }; |
| | | // } |
| | | |
| | | // // å«æç½æ ¼é
ç½®åå¤ |
| | | // function gridPrepare(gridInfo, event) { |
| | | // // clearText(mapViews); |
| | | // clearAll(mapViews); |
| | | // mapViews = drawPolyline(gridInfo, event); |
| | | // } |
| | | |
| | | // // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² |
| | | // function drawGrid({ |
| | | // gridData, |
| | | // useCustomColor, |
| | | // opacity, |
| | | // zIndex, |
| | | // showDataTxt, |
| | | // showRankTxt |
| | | // }) { |
| | | // // SatelliteProxy.clearText(mapViews); |
| | | // const { resGridViews, pointsRes } = drawColor({ |
| | | // gridViews: mapViews.gridViews, |
| | | // points: mapViews.points, |
| | | // gridDataDetail: gridData, |
| | | // lastGridViews: mapViews.lastGridViews, |
| | | // customColor: useCustomColor, |
| | | // opacity: opacity, |
| | | // zIndex: zIndex |
| | | // }); |
| | | // mapViews.lastGridViews = resGridViews; |
| | | // mapViews.lastPoints = pointsRes; |
| | | |
| | | // // æ°æ®æ è®° |
| | | // const { textViews: dataTxt, labelsLayer: dataLayer } = drawDataText( |
| | | // mapViews.lastPoints, |
| | | // gridData, |
| | | // mapViews.dataTxt, |
| | | // mapViews.dataLayer |
| | | // ); |
| | | // mapViews.dataTxt = dataTxt; |
| | | // mapViews.dataLayer = dataLayer; |
| | | |
| | | // const { textViews: rankTxt, labelsLayer: rankLayer } = drawRankText( |
| | | // mapViews.lastPoints, |
| | | // gridData, |
| | | // mapViews.rankTxt, |
| | | // mapViews.rankLayer |
| | | // ); |
| | | // mapViews.rankTxt = rankTxt; |
| | | // mapViews.rankLayer = rankLayer; |
| | | |
| | | // if (showDataTxt) { |
| | | // map.add(mapViews.dataTxt); |
| | | // } |
| | | |
| | | // if (showRankTxt) { |
| | | // map.add(mapViews.rankTxt); |
| | | // } |
| | | // } |
| | | |
| | | // // è°æ´åç±»å°å¾è¦çç©çå¯è§æ§ |
| | | // function changeVisibility({ showGridViews, showDataTxt, showRankTxt }) { |
| | | // if (showGridViews != undefined) { |
| | | // showGridViews ? map.add(mapViews.lastGridViews) : map.remove(mapViews.lastGridViews); |
| | | // } |
| | | // if (showDataTxt != undefined) { |
| | | // showDataTxt ? map.add(mapViews.dataTxt) : map.remove(mapViews.dataTxt); |
| | | // } |
| | | // if (showRankTxt != undefined) { |
| | | // showRankTxt ? map.add(mapViews.rankTxt) : map.remove(mapViews.rankTxt); |
| | | // } |
| | | // } |
| | | |
| | | // function changeGridOpacity({ isOpacity, opacityValue }) { |
| | | // mapViews.lastGridViews.forEach((e) => { |
| | | // e.setOptions({ |
| | | // fillOpacity: opacityValue ? opacityValue : isOpacity ? 0.1 : 0.7 |
| | | // }); |
| | | // }); |
| | | // } |
| | | |
| | | // export default { |
| | | // drawDistrict, |
| | | // drawPolyline, |
| | | // drawDataText, |
| | | // drawRankText, |
| | | // drawColor, |
| | | // gridPrepare, |
| | | // drawGrid, |
| | | // changeVisibility, |
| | | // changeGridOpacity, |
| | | // clearText, |
| | | // clearAll |
| | | // }; |
| | |
| | | <template> |
| | | <SatelliteMixTool :group-id="3"></SatelliteMixTool> |
| | | |
| | | <el-row class="wrap"> |
| | | <el-col span="2"> |
| | | <!-- <div class="p-events-auto"> |
| | |
| | | </el-row> |
| | | <SatelliteDataMix class="data-mix" @mix-data="handleMixDataClick"> |
| | | </SatelliteDataMix> |
| | | <SatelliteMixTool :group-id="3"></SatelliteMixTool> |
| | | |
| | | <!-- <el-row class="historical" justify="center"> |
| | | <SatelliteAnimation |
| | |
| | | import SatelliteManage from './component/SatelliteManage.vue'; |
| | | import SatelliteDataMix from './component/SatelliteDataMix.vue'; |
| | | import SatelliteMixTool from './component/SatelliteMixTool.vue'; |
| | | import SatelliteProxy from './SatelliteProxy'; |
| | | import { SatelliteProxy } from './SatelliteProxy'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import { useSatelliteGridStore } from '@/stores/satellite-grid'; |
| | | import { useSceneStore } from '@/stores/scene'; |
| | | |
| | | const satelliteProxy = new SatelliteProxy(); |
| | | |
| | | const satelliteGridStore = useSatelliteGridStore(); |
| | | const { loading, fetchData } = useFetchData(10000); |
| | |
| | | // ç½æ ¼æ°æ®è¯¦æ
|
| | | const gridDataDetailMap = new Map(); |
| | | const gridDataDetailList = ref([]); |
| | | // å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | let mapViews; |
| | | |
| | | // æ¥è¯¢ç½æ ¼ä¿¡æ¯åé¥ææ°æ®ç» |
| | | function onSearch(options) { |
| | | satelliteGridStore.fetchGridCell(options.id).then(() => { |
| | | SatelliteProxy.clearText(mapViews); |
| | | drawGrid(satelliteGridStore.gridInfo); |
| | | // initDistrict(); |
| | | SatelliteProxy.drawDistrict('é¿å®åº'); |
| | | prepareGrid(satelliteGridStore.gridInfo); |
| | | satelliteProxy.drawDistrict('é¿å®åº'); |
| | | }); |
| | | satelliteGridStore.fetchGridData(options.id).then(() => { |
| | | max = satelliteGridStore.gridDataList.length; |
| | |
| | | } |
| | | } |
| | | |
| | | function drawGrid(gridInfo) { |
| | | SatelliteProxy.clearAll(mapViews); |
| | | mapViews = SatelliteProxy.drawPolyline(gridInfo, (polygon) => { |
| | | function prepareGrid(gridInfo) { |
| | | satelliteProxy.gridPrepare(gridInfo, (polygon) => { |
| | | //é¼ æ ç§»å
¥äºä»¶ |
| | | polygon.on('mouseover', () => { |
| | | polygon.setOptions({ |
| | |
| | | }); |
| | | } |
| | | |
| | | // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² |
| | | function drawTextAndColor(gridData) { |
| | | // SatelliteProxy.clearText(mapViews); |
| | | const { resGridViews, pointsRes } = SatelliteProxy.drawColor({ |
| | | gridViews: mapViews.gridViews, |
| | | points: mapViews.points, |
| | | gridDataDetail: gridData, |
| | | lastGridViews: mapViews.lastGridViews |
| | | }); |
| | | mapViews.lastGridViews = resGridViews; |
| | | mapViews.lastPoints = pointsRes; |
| | | // ææ¬æ è®° |
| | | const { textViews: dataTxt, labelsLayer: dataLayer } = |
| | | SatelliteProxy.drawDataText( |
| | | mapViews.lastPoints, |
| | | gridData, |
| | | mapViews.dataTxt, |
| | | mapViews.dataLayer |
| | | ); |
| | | mapViews.dataTxt = dataTxt; |
| | | mapViews.dataLayer = dataLayer; |
| | | const { textViews: rankTxt, labelsLayer: rankLayer } = |
| | | SatelliteProxy.drawRankText( |
| | | mapViews.lastPoints, |
| | | gridData, |
| | | mapViews.rankTxt, |
| | | mapViews.rankLayer |
| | | ); |
| | | mapViews.rankTxt = rankTxt; |
| | | mapViews.rankLayer = rankLayer; |
| | | function drawGrid(gridData) { |
| | | satelliteProxy.drawGrid({ gridData }); |
| | | } |
| | | |
| | | let selectedGridData; |
| | | function handleRowClick(row) { |
| | | if (gridDataDetailMap.has(row.id)) { |
| | | const gridData = gridDataDetailMap.get(row.id); |
| | | selectedGridData = gridData; |
| | | drawTextAndColor(gridData); |
| | | } else { |
| | | gridApi.fetchGridDataDetail(row.id, row.groupId).then((res) => { |
| | | gridDataDetailMap.set(row.id, res.data); |
| | | const gridData = res.data; |
| | | selectedGridData = gridData; |
| | | drawTextAndColor(gridData); |
| | | }); |
| | | } |
| | | satelliteGridStore.fetchGridDataDetail(row, drawGrid); |
| | | } |
| | | |
| | | function handleRankClick(rankVisible) { |
| | | // rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer); |
| | | rankVisible ? map.add(mapViews.rankTxt) : map.remove(mapViews.rankTxt); |
| | | satelliteProxy.changeVisibility({ showRankTxt: rankVisible }); |
| | | } |
| | | |
| | | function handleDataClick(dataVisible) { |
| | | // dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer); |
| | | dataVisible ? map.add(mapViews.dataTxt) : map.remove(mapViews.dataTxt); |
| | | satelliteProxy.changeVisibility({ showDataTxt: dataVisible }); |
| | | } |
| | | |
| | | function handleColorClick(isStandardColor) { |
| | | const { resGridViews, pointsRes } = SatelliteProxy.drawColor({ |
| | | gridViews: mapViews.gridViews, |
| | | points: mapViews.points, |
| | | gridDataDetail: selectedGridData, |
| | | lastGridViews: mapViews.lastGridViews, |
| | | customColor: !isStandardColor |
| | | satelliteProxy.drawGrid({ |
| | | gridData: satelliteGridStore.selectedGridData, |
| | | useCustomColor: !isStandardColor |
| | | }); |
| | | mapViews.lastGridViews = resGridViews; |
| | | mapViews.lastPoints = pointsRes; |
| | | } |
| | | |
| | | function handleOpacityClick(isOpacity) { |
| | | mapViews.lastGridViews.forEach((e) => { |
| | | e.setOptions({ |
| | | fillOpacity: isOpacity ? 0.1 : 0.7 |
| | | }); |
| | | }); |
| | | satelliteProxy.changeGridOpacity({ isOpacity }); |
| | | } |
| | | |
| | | function handleMixDataClick(gridData) { |
| | |
| | | <template> |
| | | <CardDialog title="AODæ°æ®å¯¼å
¥" :model-value="modelValue" :width="420" @changed="handleChange"> |
| | | <!-- <CardDialog title="AODæ°æ®å¯¼å
¥" :model-value="modelValue" :width="420" @changed="handleChange"> --> |
| | | <div class="download"> |
| | | <el-button @click="downloadTemplate" type="primary" class="el-button-custom" size="small" |
| | | v-loading="downloadLoading">ä¸è½½æ¨¡æ¿</el-button> |
| | |
| | | <el-text class="mx-1" type="success">{{ successTipMsg }}</el-text> |
| | | </el-form-item> |
| | | </el-form> |
| | | </CardDialog> |
| | | <!-- </CardDialog> --> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch, defineProps, defineEmits } from 'vue'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import aodApi from '@/api/aodApi'; |
| | | import { dayjs, ElMessage } from 'element-plus'; |
| | | import { useFormConfirm } from '@/composables/formConfirm'; |
| | | |
| | |
| | | |
| | | // éè¿ç½æ ¼ç»åæ¶é´ æ¥è¯¢ å¨è¿ä¸¤ä¸ªåæ°æ¡ä»¶ä¸æ¯å¦æç½æ ¼æ°æ®ï¼å¹¶æç¤ºå¨çé¢ä¸ææè
没æ |
| | | const checkEmpty = () => { |
| | | gridApi.fetchGridAod(gridGroup.value.id, dayjs(formObj.value.dateTime).format('YYYY-MM-DD HH:mm:ss')).then(res => { |
| | | aodApi.fetchAOD(gridGroup.value.id, dayjs(formObj.value.dateTime).format('YYYY-MM-DD HH:mm:ss')).then(res => { |
| | | if (res.data && res.data.length > 0) { |
| | | hasGridAod.value = true; |
| | | } else { |
| | |
| | | <template> |
| | | <CardDialog title="çæµæ°æ®å¯¼å
¥" :model-value="modelValue" :width="420" @changed="handleChange"> |
| | | <!-- <CardDialog title="çæµæ°æ®å¯¼å
¥" :model-value="modelValue" :width="420" @changed="handleChange"> --> |
| | | <div class="download"> |
| | | <el-button @click="downloadTemplate" type="primary" class="el-button-custom" size="small" |
| | | v-loading="downloadLoading">ä¸è½½æ¨¡æ¿</el-button> |
| | |
| | | <el-text class="mx-1" type="success">{{ successTipMsg }}</el-text> |
| | | </el-form-item> |
| | | </el-form> |
| | | </CardDialog> |
| | | <!-- </CardDialog> --> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch, defineProps, defineEmits } from 'vue'; |
| | |
| | | import SatelliteSearchBar from './SatelliteSearchBar.vue'; |
| | | // import { useFetchData } from '@/composables/fetchData'; |
| | | // import gridApi from '@/api/gridApi'; |
| | | // import SatelliteProxy from '../SatelliteProxy'; |
| | | |
| | | // eslint-disable-next-line no-unused-vars |
| | | function timeFormatter(row, col, cellValue, index) { |
| | |
| | | <template> |
| | | <div> |
| | | <el-button |
| | | @click="dialogVisible = !dialogVisible" |
| | | type="primary" |
| | | class="el-button-custom p-events-auto" |
| | | >èµ°èªèå</el-button |
| | | > |
| | | <CardDialog |
| | | v-model="dialogVisible" |
| | | title="èµ°èªèå" |
| | |
| | | </el-row> |
| | | </template> |
| | | </CardDialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, watch } from 'vue'; |
| | | import moment from 'moment'; |
| | | import { map, onMapMounted } from '@/utils/map/index_old'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import SatelliteProxy from '../SatelliteProxy'; |
| | | import { SatelliteProxy } from '../SatelliteProxy'; |
| | | |
| | | const satelliteProxy = new SatelliteProxy(); |
| | | |
| | | const props = defineProps({ |
| | | groupId: { |
| | |
| | | } |
| | | }); |
| | | |
| | | const dialogVisible = ref(true); |
| | | const dialogVisible = ref(false); |
| | | const mission = ref(undefined); |
| | | |
| | | const gridCellList = ref(undefined); |
| | |
| | | const isStandardColor = ref(true); |
| | | const isOpacity = ref(false); |
| | | |
| | | // å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | let mapViews; |
| | | |
| | | // æ£æ¥èµ°èªæ°æ®æ¯å¦å100ç±³ç½æ ¼å·²èå |
| | | function checkUnderwayFusionResult() { |
| | | const time = moment(mission.value.startTime).format('YYYY-MM-DD HH:mm:ss'); |
| | |
| | | }); |
| | | } |
| | | |
| | | function drawGrid(gridInfo) { |
| | | SatelliteProxy.clearAll(mapViews); |
| | | mapViews = SatelliteProxy.drawPolyline(gridInfo); |
| | | function resetButton() { |
| | | gridVisible.value = true; |
| | | underwayVisible.value = false; |
| | | rankVisible.value = false; |
| | | dataVisible.value = false; |
| | | isStandardColor.value = true; |
| | | isOpacity.value = false; |
| | | } |
| | | |
| | | function prepareGrid(gridInfo) { |
| | | satelliteProxy.gridPrepare(gridInfo); |
| | | } |
| | | |
| | | // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² |
| | | function drawTextAndColor(gridData) { |
| | | const { resGridViews, pointsRes } = SatelliteProxy.drawColor({ |
| | | gridViews: mapViews.gridViews, |
| | | points: mapViews.points, |
| | | gridDataDetail: gridData, |
| | | lastGridViews: mapViews.lastGridViews, |
| | | opacity: 1, |
| | | zIndex: 11 |
| | | }); |
| | | mapViews.lastGridViews = resGridViews; |
| | | mapViews.lastPoints = pointsRes; |
| | | // ææ¬æ è®° |
| | | const { textViews: dataTxt, labelsLayer: dataLayer } = |
| | | SatelliteProxy.drawDataText( |
| | | mapViews.lastPoints, |
| | | gridData, |
| | | mapViews.dataTxt, |
| | | mapViews.dataLayer |
| | | ); |
| | | mapViews.dataTxt = dataTxt; |
| | | mapViews.dataLayer = dataLayer; |
| | | const { textViews: rankTxt, labelsLayer: rankLayer } = |
| | | SatelliteProxy.drawRankText( |
| | | mapViews.lastPoints, |
| | | gridData, |
| | | mapViews.rankTxt, |
| | | mapViews.rankLayer |
| | | ); |
| | | mapViews.rankTxt = rankTxt; |
| | | mapViews.rankLayer = rankLayer; |
| | | function drawGrid(gridData) { |
| | | satelliteProxy.drawGrid({ gridData, opacity: 1, zIndex: 11 }); |
| | | } |
| | | |
| | | watch(mission, (nV, oV) => { |
| | |
| | | watch( |
| | | () => props.groupId, |
| | | (nV, oV) => { |
| | | if (nV != oV) { |
| | | if (dialogVisible.value && nV != oV) { |
| | | gridApi.fetchGridCell(nV).then((res) => { |
| | | gridCellList.value = res.data; |
| | | drawGrid(gridCellList.value); |
| | | prepareGrid(gridCellList.value); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | } |
| | | ); |
| | | |
| | | watch(dialogVisible, (nV, oV) => { |
| | | if (nV != oV) { |
| | | gridApi.fetchGridCell(props.groupId).then((res) => { |
| | | gridCellList.value = res.data; |
| | | prepareGrid(gridCellList.value); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | let selectedGridData; |
| | | // å å èå |
| | | function handleFusionClick() { |
| | | // resetButton(); |
| | | const d = fusionData.value; |
| | | if (gridDataDetailMap.has(d.id)) { |
| | | const gridData = gridDataDetailMap.get(d.id); |
| | | selectedGridData = gridData; |
| | | drawTextAndColor(gridData); |
| | | drawGrid(gridData); |
| | | } else { |
| | | gridApi.fetchGridDataDetail(d.id, d.groupId).then((res) => { |
| | | gridDataDetailMap.set(d.id, res.data); |
| | | const gridData = res.data; |
| | | selectedGridData = gridData; |
| | | drawTextAndColor(gridData); |
| | | drawGrid(gridData); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function handleGridClick() { |
| | | gridVisible.value = !gridVisible.value; |
| | | gridVisible.value |
| | | ? map.add(mapViews.lastGridViews) |
| | | : map.remove(mapViews.lastGridViews); |
| | | satelliteProxy.changeVisibility({ showGridViews: gridVisible.value }); |
| | | } |
| | | |
| | | function handleUnderwayClick() { |
| | |
| | | |
| | | function handleRankClick() { |
| | | rankVisible.value = !rankVisible.value; |
| | | rankVisible.value ? map.add(mapViews.rankTxt) : map.remove(mapViews.rankTxt); |
| | | satelliteProxy.changeVisibility({ showRankTxt: rankVisible.value }); |
| | | } |
| | | |
| | | function handleDataClick() { |
| | | dataVisible.value = !dataVisible.value; |
| | | dataVisible.value ? map.add(mapViews.dataTxt) : map.remove(mapViews.dataTxt); |
| | | satelliteProxy.changeVisibility({ showDataTxt: dataVisible.value }); |
| | | } |
| | | |
| | | function handleColorClick() { |
| | | isStandardColor.value = !isStandardColor.value; |
| | | const { resGridViews, pointsRes } = SatelliteProxy.drawColor({ |
| | | gridViews: mapViews.gridViews, |
| | | points: mapViews.points, |
| | | gridDataDetail: selectedGridData, |
| | | lastGridViews: mapViews.lastGridViews, |
| | | customColor: !isStandardColor.value, |
| | | satelliteProxy.drawGrid({ |
| | | gridData: selectedGridData, |
| | | useCustomColor: !isStandardColor.value, |
| | | opacity: 1, |
| | | zIndex: 11 |
| | | }); |
| | | mapViews.lastGridViews = resGridViews; |
| | | mapViews.lastPoints = pointsRes; |
| | | } |
| | | |
| | | function handleOpacityClick() { |
| | | isOpacity.value = !isOpacity.value; |
| | | mapViews.lastGridViews.forEach((e) => { |
| | | e.setOptions({ |
| | | fillOpacity: isOpacity.value ? 0.1 : 1 |
| | | }); |
| | | }); |
| | | satelliteProxy.changeGridOpacity({ opacityValue: isOpacity.value ? 0.1 : 1 }); |
| | | } |
| | | |
| | | /**èµ°èªè½¨è¿¹*******************************************************************/ |
| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <!-- <el-row> --> |
| | | <!-- <el-col :span="20"> --> |
| | | <el-form label-position="right" label-width="60px" :inline="false"> |
| | | <el-form-item label="åºå"> |
| | | <OptionLocation2 |
| | |
| | | v-model="gridGroup" |
| | | ></OptionGridGroup> |
| | | </el-form> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <!-- </el-col> --> |
| | | <!-- <el-col :span="4"> --> |
| | | <!-- <el-form-item> |
| | | <el-button |
| | | :loading="loading" |
| | | :disabled="!gridGroup" |
| | |
| | | > |
| | | æ¥è¯¢ |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> --> |
| | | <!-- </el-col> --> |
| | | <!-- </el-row> --> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch } from 'vue'; |
| | | |
| | | defineProps({ |
| | | loading: Boolean |
| | | loading: Boolean, |
| | | }); |
| | | |
| | | const location = ref(undefined); |
| | |
| | | }); |
| | | |
| | | watch(gridGroup, (nv, ov) => { |
| | | // 馿¬¡è¿å
¥èªå¨è§¦å䏿¬¡æ¥è¯¢äºä»¶ |
| | | if (ov == undefined && nv != ov) { |
| | | // èªå¨è§¦å䏿¬¡æ¥è¯¢äºä»¶ |
| | | // if (ov == undefined && nv != ov) { |
| | | if (nv != ov) { |
| | | handleClick(); |
| | | } |
| | | }); |