src/api/aodApi.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@ 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); }, }; src/api/gridApi.js
@@ -45,22 +45,22 @@ .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 @@ -73,6 +73,19 @@ }) .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`, { src/api/index.js
@@ -10,7 +10,8 @@ } 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({ src/components.d.ts
@@ -12,6 +12,7 @@ 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'] @@ -33,17 +34,16 @@ 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'] @@ -59,6 +59,7 @@ 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'] src/components/search/OptionAOD.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ <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> src/stores/grid-info.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@ // 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 }; // }); src/stores/satellite-grid.js
@@ -22,6 +22,11 @@ return v.type == 1; }); }); // ç½æ ¼æ°æ®è¯¦æ const gridDataDetailMap = new Map(); const selectedGridData = ref(undefined) const selectedGridDataDetail = ref(undefined) // è·åç½æ ¼ä¿¡æ¯ function fetchGridCell(groupId) { @@ -38,12 +43,17 @@ } // è·å饿µåæ¥å ·ä½ç½æ ¼çæµæ°æ® 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 { @@ -51,6 +61,7 @@ allGridDataList, gridDataList, mixGridDataList, selectedGridData, fetchGridCell, fetchGridData, fetchGridDataDetail src/utils/grid/map-grid.js
src/views/HomePage.vue
@@ -10,7 +10,7 @@ <!-- <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" @@ -21,7 +21,8 @@ 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> @@ -35,6 +36,7 @@ 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> src/views/dataproduct/ProductManage.vue
@@ -1,46 +1,46 @@ <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" > <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> <CardDialog draggable :modal="false" title="æ°æ®äº§å管ç" v-model="dialogVisible" width="600px" > <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æ°æ®ï¼ç¨æ·å¯ä¿®æ¹ç¸å ³åæ°ï¼ @@ -50,3 +50,11 @@ // 1. AODæ°æ®å¯¼å ¥ // 2. AODæ°æ®æåï¼éæ©AODæ°æ®ç»ãå±ç¤ºå·²æç»æãè°æ´åæ°ãæ¾ç¤ºå¯¹åºæ¶é´çèæ¯æ°æ®ãæä¾ç»æçæäºæ¬¡ç¡®è®¤å è®¸è°æ´åæ°éå¤çæãåå¨ææ´æ°ç»æ </script> <style scoped> ::v-deep .el-tabs__item { color: white; } ::v-deep .is-active { color: #23dad0a2; } </style> src/views/dataproduct/component/ProductMake.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,199 @@ <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> src/views/satellitetelemetry/SatelliteProxy.js
@@ -2,188 +2,542 @@ import gridMapUtil from '@/utils/map/grid'; import { map, onMapMounted } from '@/utils/map/index_old'; 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(); //å°è¦çç©è°æ´å°åéè§é } }); } }); } export class SatelliteProxy { // å°å¾ç½æ ¼ç¸å ³å¯¹è±¡ mapViews; function clearAll(mapViews) { if (mapViews) { if (typeof mapViews.textViews === 'object') { map.remove(mapViews.textViews); } if (typeof mapViews.gridViews === 'object') { map.remove(mapViews.gridViews); } } } 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] ] districtPolygon; // ç»å¶åºå¿è¾¹ç drawDistrict(districtName, isNew) { onMapMounted(() => { if (this.districtPolygon && !isNew) { map.remove(this.districtPolygon); map.add(this.districtPolygon); } else { // 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 }; } var district = new AMap.DistrictSearch({ extensions: 'all', //è¿åè¡æ¿åºè¾¹çåæ çå ·ä½ä¿¡æ¯ level: 'district' //设置æ¥è¯¢è¡æ¿åºçº§å«ä¸ºåº }); 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 this.districtPolygon = new AMap.Polygon({ map: map, //æ¾ç¤ºè¯¥è¦çç©çå°å¾å¯¹è±¡ strokeWeight: 2, //è½®å»çº¿å®½åº¦ path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» fillOpacity: 0, //å¤è¾¹å½¢å¡«å éæåº¦ fillColor: '#CCF3FF', //å¤è¾¹å½¢å¡«å é¢è² // strokeColor: '#ffffff' //线æ¡é¢è² strokeColor: '#0552f7', //线æ¡é¢è² zIndex: 9 }); } map.setFitView(); //å°è¦çç©è°æ´å°åéè§é } }); } }); } // ç»å¶çæµæ°æ®å¼ 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'); } clearAll(mapViews) { if (mapViews) { if (typeof mapViews.gridViews === 'object') { map.remove(mapViews.gridViews); } } this.clearText(mapViews); } // ç»å¶çæµæ°æ®æåææ¬ 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'); } 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 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( '饿µæ°æ®çç½æ ¼ç´¢å¼ç¼å·è¶ åºç½æ ¼ç»èå´ï¼æ°æ®åç½æ ¼ç»å¯è½ä¸å¯¹åº' // ç»å¶ç½æ ¼çº¿ 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 }; } // ç»å¶çæµæ°æ®å¼ 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'); } // ç»å¶çæµæ°æ®æåææ¬ 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'); } // ç»å¶çæµæ°æ®å¼å¯¹åºç½æ ¼é¢è² 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 ); } 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 }; } if (lastGridViews) { map.remove(lastGridViews); // å«æç½æ ¼é ç½®åå¤ gridPrepare(gridInfo, event) { // clearText(mapViews); this.clearAll(this.mapViews); this.mapViews = this.drawPolyline(gridInfo, event); } map.add(resGridViews); map.setFitView(resGridViews); return { resGridViews, pointsRes }; // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² 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); }); } } export default { drawDistrict, drawPolyline, drawDataText, drawRankText, drawColor, clearText, clearAll }; // // å°å¾ç½æ ¼ç¸å ³å¯¹è±¡ // 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 // }; src/views/satellitetelemetry/SatelliteTelemetry.vue
@@ -1,4 +1,6 @@ <template> <SatelliteMixTool :group-id="3"></SatelliteMixTool> <el-row class="wrap"> <el-col span="2"> <!-- <div class="p-events-auto"> @@ -46,7 +48,6 @@ </el-row> <SatelliteDataMix class="data-mix" @mix-data="handleMixDataClick"> </SatelliteDataMix> <SatelliteMixTool :group-id="3"></SatelliteMixTool> <!-- <el-row class="historical" justify="center"> <SatelliteAnimation @@ -67,10 +68,12 @@ 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); @@ -83,16 +86,12 @@ // ç½æ ¼æ°æ®è¯¦æ 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; @@ -127,9 +126,8 @@ } } function drawGrid(gridInfo) { SatelliteProxy.clearAll(mapViews); mapViews = SatelliteProxy.drawPolyline(gridInfo, (polygon) => { function prepareGrid(gridInfo) { satelliteProxy.gridPrepare(gridInfo, (polygon) => { //é¼ æ ç§»å ¥äºä»¶ polygon.on('mouseover', () => { polygon.setOptions({ @@ -154,82 +152,31 @@ }); } // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² 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) { src/views/satellitetelemetry/component/AODImport.vue
@@ -1,5 +1,5 @@ <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> @@ -44,11 +44,12 @@ <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'; @@ -90,7 +91,7 @@ // éè¿ç½æ ¼ç»åæ¶é´ æ¥è¯¢ å¨è¿ä¸¤ä¸ªåæ°æ¡ä»¶ä¸æ¯å¦æç½æ ¼æ°æ®ï¼å¹¶æç¤ºå¨çé¢ä¸ææè 没æ 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 { src/views/satellitetelemetry/component/SatelliteImport.vue
@@ -1,5 +1,5 @@ <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> @@ -44,7 +44,7 @@ <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'; src/views/satellitetelemetry/component/SatelliteManage.vue
@@ -92,7 +92,6 @@ 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) { src/views/satellitetelemetry/component/SatelliteMixTool.vue
@@ -1,94 +1,104 @@ <template> <CardDialog v-model="dialogVisible" title="èµ°èªèå" draggable :modal="false" width="400px" > <template #default> <el-row> <OptionMission v-model="mission"></OptionMission> <el-text size="small" :type="fusionData ? 'success' : 'warning'">{{ fusionData ? 'èµ°èªæ°æ®å·²èå' : 'èµ°èªæ°æ®æªèå' }}</el-text> </el-row> <el-row> <el-button type="primary" class="el-button-custom" size="small" :disabled="!gridCellList || !fusionData" @click="handleFusionClick" > {{ 'å å èå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleGridClick" > {{ gridVisible ? 'éèèå' : 'æ¾ç¤ºèå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" :loading="loading" @click="handleUnderwayClick" > {{ underwayVisible ? 'éèèµ°èªè·¯çº¿' : 'æ¾ç¤ºèµ°èªè·¯çº¿' }} </el-button> </el-row> <el-row class="m-t-8"> <el-button type="primary" class="el-button-custom" size="small" @click="handleRankClick" > {{ rankVisible ? 'éèæå' : 'æ¾ç¤ºæå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleDataClick" > {{ dataVisible ? 'éèæ°æ®' : 'æ¾ç¤ºæ°æ®' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleColorClick" > {{ isStandardColor ? 'ç»å¶å¯¹æ¯è²' : 'ç»å¶æ åè²' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleOpacityClick" > {{ !isOpacity ? 'éæå' : 'åæ¶éæå' }} </el-button> </el-row> </template> <template #footer> <el-row justify="start" align="middle" class="p-b-2 one-row"> <!-- <el-text size="small" type="warning">æç´¢èå´</el-text> --> </el-row> </template> </CardDialog> <div> <el-button @click="dialogVisible = !dialogVisible" type="primary" class="el-button-custom p-events-auto" >èµ°èªèå</el-button > <CardDialog v-model="dialogVisible" title="èµ°èªèå" draggable :modal="false" width="400px" > <template #default> <el-row> <OptionMission v-model="mission"></OptionMission> <el-text size="small" :type="fusionData ? 'success' : 'warning'">{{ fusionData ? 'èµ°èªæ°æ®å·²èå' : 'èµ°èªæ°æ®æªèå' }}</el-text> </el-row> <el-row> <el-button type="primary" class="el-button-custom" size="small" :disabled="!gridCellList || !fusionData" @click="handleFusionClick" > {{ 'å å èå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleGridClick" > {{ gridVisible ? 'éèèå' : 'æ¾ç¤ºèå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" :loading="loading" @click="handleUnderwayClick" > {{ underwayVisible ? 'éèèµ°èªè·¯çº¿' : 'æ¾ç¤ºèµ°èªè·¯çº¿' }} </el-button> </el-row> <el-row class="m-t-8"> <el-button type="primary" class="el-button-custom" size="small" @click="handleRankClick" > {{ rankVisible ? 'éèæå' : 'æ¾ç¤ºæå' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleDataClick" > {{ dataVisible ? 'éèæ°æ®' : 'æ¾ç¤ºæ°æ®' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleColorClick" > {{ isStandardColor ? 'ç»å¶å¯¹æ¯è²' : 'ç»å¶æ åè²' }} </el-button> <el-button type="primary" class="el-button-custom" size="small" @click="handleOpacityClick" > {{ !isOpacity ? 'éæå' : 'åæ¶éæå' }} </el-button> </el-row> </template> <template #footer> <el-row justify="start" align="middle" class="p-b-2 one-row"> <!-- <el-text size="small" type="warning">æç´¢èå´</el-text> --> </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: { @@ -97,7 +107,7 @@ } }); const dialogVisible = ref(true); const dialogVisible = ref(false); const mission = ref(undefined); const gridCellList = ref(undefined); @@ -111,9 +121,6 @@ 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'); @@ -126,42 +133,22 @@ }); } 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) => { @@ -174,10 +161,10 @@ 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); }); } }, @@ -186,29 +173,37 @@ } ); 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() { @@ -218,36 +213,27 @@ 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 }); } /**èµ°èªè½¨è¿¹*******************************************************************/ src/views/satellitetelemetry/component/SatelliteSearchBar.vue
@@ -1,6 +1,6 @@ <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 @@ -16,9 +16,9 @@ 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" @@ -29,15 +29,15 @@ > æ¥è¯¢ </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); @@ -63,8 +63,9 @@ }); watch(gridGroup, (nv, ov) => { // 馿¬¡è¿å ¥èªå¨è§¦å䏿¬¡æ¥è¯¢äºä»¶ if (ov == undefined && nv != ov) { // èªå¨è§¦å䏿¬¡æ¥è¯¢äºä»¶ // if (ov == undefined && nv != ov) { if (nv != ov) { handleClick(); } });