| | |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * è·åç½æ ¼ç»ä¸ç饿µæ°æ® |
| | | * @param {*} gridData ç½æ ¼æ°æ® |
| | | * @returns |
| | | */ |
| | | fetchGridData2(gridData) { |
| | | return $http |
| | | .post(`air/satellite/grid/data2`, gridData) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * å é¤ç½æ ¼æ°æ® |
| | | * @param {Number} dataId æ°æ®id |
| | | */ |
| | | deleteGridData(dataId) { |
| | | return $http |
| | | .delete(`air/satellite/grid/data/delete`, { |
| | | params: { dataId } |
| | | }) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | // /** |
| | | // * è·åç½æ ¼ç»ä¸ç饿µaod |
| | | // * @param {*} groupId |
| | |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | buildUnderwayProduct(missionCode, groupId) { |
| | | return $http.get(`air/satellite/import/grid/aod/download/template`, { |
| | | responseType: 'blob' |
| | | }); |
| | | /** |
| | | * çæèµ°èªç½æ ¼èåè®°å½ |
| | | * @param {*} gridData |
| | | * @returns |
| | | */ |
| | | buildUnderwayProduct(gridData) { |
| | | return $http |
| | | .post(`air/satellite/product/underway/build`, gridData) |
| | | .then((res) => res.data); |
| | | }, |
| | | |
| | | mixUnderwayGridData(groupId, dataIdList) { |
| | |
| | | import axios from 'axios'; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | const debug = true; |
| | | const debug = false; |
| | | |
| | | let ip1 = 'http://47.100.191.150:9029/'; |
| | | // console.log(import.meta.env); |
| | |
| | | OptionLocation: typeof import('./components/search/OptionLocation.vue')['default'] |
| | | OptionLocation2: typeof import('./components/search/OptionLocation2.vue')['default'] |
| | | OptionMission: typeof import('./components/search/OptionMission.vue')['default'] |
| | | OptionPollutionDegree: typeof import('./components/search/OptionPollutionDegree.vue')['default'] |
| | | OptionTime: typeof import('./components/search/OptionTime.vue')['default'] |
| | | OptionType: typeof import('./components/search/OptionType.vue')['default'] |
| | | ProgressLineChart: typeof import('./components/chart/ProgressLineChart.vue')['default'] |
| | |
| | | label="ç»çº¬åº¦" |
| | | :content="data.gridCell.longitude + ', ' + data.gridCell.latitude" |
| | | /> |
| | | <DescriptionsListItem label="åè³èå´" content="/" /> |
| | | <!-- <DescriptionsListItem label="åè³èå´" content="/" /> --> |
| | | </DescriptionsList> |
| | | |
| | | <el-tabs v-model="activeName" > |
| | | <el-tabs v-model="activeName"> |
| | | <el-tab-pane label="ç½æ ¼æ°æ®" name="first"> |
| | | <DescriptionsList> |
| | | <DescriptionsListItem |
| | |
| | | |
| | | const data = computed(() => { |
| | | if (gridStore.selectedGridCellAndDataDetail) { |
| | | // const { gridCell, gridDataDetail } = |
| | | // gridStore.selectedGridCellAndDataDetail; |
| | | // const res = []; |
| | | // // å¦æç½æ ¼æ°æ®ä¸ºèåæ°æ®ï¼åéè¦åæ¥å±ç¤ºåºåå§æ°æ® |
| | | // if (gridDataDetail.mixData) { |
| | | // } |
| | | return { |
| | | gridCell: gridStore.selectedGridCellAndDataDetail.gridCell, |
| | | gridDataDetail: gridStore.selectedGridCellAndDataDetail.gridDataDetail, |
| | | extData: gridStore.selectedGridCellAndDataDetail.extData |
| | | }; |
| | | // console.log(gridStore.selectedGridCellAndDataDetail); |
| | | |
| | | // return undefined; |
| | | // return gridStore.selectedGridCellAndDataDetail; |
| | | } else { |
| | | return undefined; |
| | | } |
| | |
| | | () => gridStore.selectedGridCellAndDataDetail, |
| | | (nv, ov) => { |
| | | if (nv != ov) { |
| | | activeName.value = 'first'; |
| | | dialogVisible.value = true; |
| | | } |
| | | }, |
| | |
| | | ); |
| | | </script> |
| | | <style scoped> |
| | | :deep(.el-tabs__item){ |
| | | :deep(.el-tabs__item) { |
| | | color: rgba(221, 221, 221, 0.806); |
| | | } |
| | | :deep(.is-active){ |
| | | :deep(.is-active) { |
| | | color: #f0ff1d; |
| | | } |
| | | </style> |
| | |
| | | <style> |
| | | .el-table { |
| | | --el-table-bg-color: transparent; |
| | | --el-table-row-hover-bg-color: var(--select_color); |
| | | --el-table-row-hover-bg-color: #bffff454; |
| | | /* --el-table-row-hover-bg-color: transparent; */ |
| | | --el-table-current-row-bg-color: var(--select_color); |
| | | /* --el-table-current-row-bg-color: #7dff5d96; */ |
| | | --el-table-text-color: var(--font-color); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-select |
| | | :model-value="modelValue" |
| | | @update:model-value="handleChange" |
| | | placeholder="污æèæ¯" |
| | | size="small" |
| | | class="w-120" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in pollutionList" |
| | | :key="i" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <script> |
| | | import { pollutionList } from '@/constant/pollution-degree'; |
| | | export default { |
| | | props: { |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue', 'initOver'], |
| | | data() { |
| | | return { |
| | | pollutionList: pollutionList() |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$emit('initOver'); |
| | | // this.handleChange(this.pollutionList[0].value); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | } |
| | | } |
| | | |
| | | // fixeme 2024.8.19 åç»è®¾å¤ç¼å·åºè¯¥ä»æå¡å¨å¨æè·åï¼åæ¶æè®¾å¤å·çå¨çº¿ç¼è¾åè½ |
| | | function deviceList(type) { |
| | | if (import.meta.env.VITE_DATA_MODE == 'jingan') { |
| | | return [ |
| | | { |
| | | label: '车载设å¤1å·', |
| | | value: 'TX105' |
| | | } |
| | | ]; |
| | | } else { |
| | | const t = type ? type : '0a'; |
| | | const _typeList = typeList(); |
| | | const typeStr = _typeList.find((v) => { |
| | | return v.value == t; |
| | | }); |
| | | return [1, 2, 3].map((v) => { |
| | | const label = `${typeStr.label}设å¤${v}å·`; |
| | | const value = `${t}000000000${v}`; |
| | | return { |
| | | label: label, |
| | | value: value |
| | | }; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function typeName(type) { |
| | | return typeList().find((v) => v.value == type).label; |
| | | } |
| | | |
| | | export { TYPE0, TYPE1, TYPE2, TYPE3, TYPE4, typeList, typeName, deviceList }; |
| | | export { TYPE0, TYPE1, TYPE2, TYPE3, TYPE4, typeList, typeName }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | function pollutionList() { |
| | | return [ |
| | | { |
| | | label: 'ä¼', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: 'è¯', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '轻度污æ', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: 'ä¸åº¦æ±¡æ', |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: 'é度污æ', |
| | | value: 5 |
| | | } |
| | | ]; |
| | | } |
| | | |
| | | function pollutionName(type) { |
| | | return pollutionList().find((v) => v.value == type).label; |
| | | } |
| | | |
| | | export { pollutionList, pollutionName }; |
| | |
| | | import { reactive } from 'vue'; |
| | | import calculate from '@/utils/map/calculate'; |
| | | import gridMapUtil from '@/utils/map/grid'; |
| | | import { map, onMapMounted } from '@/utils/map/index_old'; |
| | |
| | | |
| | | // é»è®¤å°å¾ç½æ ¼ç¸å
³å¯¹è±¡ |
| | | mapViews; |
| | | |
| | | gridState; |
| | | gridDataDetail; |
| | | |
| | | // å°å¾ç½æ ¼å¯¹è±¡Mapç»æï¼åå¨å¯¹åºkeyä¸çç½æ ¼å¯¹è±¡ãç½æ ¼åæ ä¿¡æ¯ |
| | | mapViewsMap = new Map(); |
| | | |
| | | // å°å¾ç½æ ¼å¯¹è±¡çåæ°ç¶æ |
| | | gridStateMap = new Map(); |
| | | |
| | | // ç½æ ¼æ°æ®Mapç»æï¼åå¨å¯¹åºkeyä¸çç½æ ¼çæµæ°æ®ä¿¡æ¯ |
| | | gridDataDetailMap = new Map(); |
| | | |
| | |
| | | map.remove(lastGridViews); |
| | | } |
| | | map.add(resGridViews); |
| | | // map.setFitView(resGridViews); |
| | | map.setFitView(resGridViews); |
| | | |
| | | return { resGridViews, pointsRes }; |
| | | } |
| | |
| | | // ç»å¶ç½æ ¼é¥ææ°æ®å¼åç½æ ¼é¢è² |
| | | drawGrid({ |
| | | mapViews, |
| | | gridState, |
| | | data, |
| | | grid = { useCustomColor: false, style: { opacity: 1, zIndex: 11 } }, |
| | | grid = { |
| | | useCustomColor: false, |
| | | style: { opacity: 1, zIndex: 11, isMixGridHighlight: false } |
| | | }, |
| | | dataTxt = { isShow: false, useCustomColor: false, useColor: false }, |
| | | rankTxt = { isShow: false } |
| | | }) { |
| | | // ç¡®å®ç»å¶çç½æ ¼ç»åå
¶åæ°å¯¹è±¡ |
| | | const _mapViews = mapViews ? mapViews : this.mapViews; |
| | | this.gridDataDetail = data; |
| | | const _gridState = gridState ? gridState : this.gridState; |
| | | |
| | | // æ ¹æ®ç½æ ¼æ°æ®ç»å¶å¯¹åºçç½æ ¼ |
| | | const { resGridViews, pointsRes } = this.drawColor({ |
| | | gridViews: _mapViews.gridViews, |
| | | points: _mapViews.points, |
| | |
| | | customColor: grid.useCustomColor, |
| | | style: grid.style |
| | | }); |
| | | // ä¿åå°å¾ç½æ ¼å¾å½¢å¯¹è±¡åç»çº¬åº¦å¯¹è±¡ |
| | | _mapViews.lastGridViews = resGridViews; |
| | | _mapViews.lastPoints = pointsRes; |
| | | // æ´æ°ç½æ ¼ç¶æåæ° |
| | | _gridState.showGrid = true; |
| | | _gridState.showGridCustomColor = false; |
| | | _gridState.gridOpacityValue = grid.style.opacity; |
| | | _gridState.gridZIndex = grid.style.zIndex; |
| | | _gridState.highlightFusionGrid = grid.style.isMixGridHighlight; |
| | | |
| | | // æ°æ®æ è®° |
| | | // ç»å¶æ°æ®ææ¬ |
| | | const { textViews: dtv } = this.drawDataText( |
| | | _mapViews.lastPoints, |
| | | data, |
| | |
| | | dataTxt.useColor |
| | | ); |
| | | _mapViews.dataTxt = dtv; |
| | | // æ´æ°æ°æ®ææ¬ç¶æåæ° |
| | | _gridState.showData = dataTxt.isShow; |
| | | _gridState.showDataColor = dataTxt.useColor; |
| | | _gridState.showDataCustomColor = dataTxt.useCustomColor; |
| | | |
| | | // ç»å¶æåææ¬ |
| | | const { textViews: rtv } = this.drawRankText( |
| | | _mapViews.lastPoints, |
| | | data, |
| | |
| | | _mapViews.rankLayer |
| | | ); |
| | | _mapViews.rankTxt = rtv; |
| | | // æ´æ°æåææ¬ç¶æåæ° |
| | | _gridState.showRank = rankTxt.isShow; |
| | | |
| | | if (dataTxt.isShow) { |
| | | map.add(_mapViews.dataTxt); |
| | |
| | | if (!this.mapViewsMap.has(tag)) { |
| | | const newMapViews = this._createNewMapViews({ extData }); |
| | | const newGridState = this._createNewGridState({ extData }); |
| | | this.gridStateMap.set(tag, newGridState); |
| | | this.mapViewsMap.set(tag, newMapViews); |
| | | map.on('zoomend', newMapViews.mapZoomEvent); |
| | | this.gridStateMap.set(tag, newGridState); |
| | | this.gridDataDetailMap.set(tag, data); |
| | | } |
| | | const _mapViews = this.mapViewsMap.get(tag); |
| | | const _gridState = this.gridStateMap.get(tag); |
| | | this.drawGrid({ |
| | | mapViews: _mapViews, |
| | | gridState: _gridState, |
| | | data, |
| | | grid, |
| | | dataTxt, |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ ç¾å é¤å¯¹åºçç½æ ¼ï¼åæ¶ç§»é¤å°å¾ç¼©æ¾äºä»¶ç |
| | | * @param {*} tags ç½æ ¼æ ç¾æ°ç» |
| | | */ |
| | | deleteTagGrid(tags) { |
| | | this.changeVisibility({ |
| | | tags, |
| | |
| | | showRankTxt: false |
| | | }); |
| | | tags.forEach((t) => { |
| | | const { mapZoomEvent } = this.mapViewsMap.get(t); |
| | | map.off('zoomend', mapZoomEvent); |
| | | this.mapViewsMap.delete(t); |
| | | this.gridDataDetailMap.delete(t); |
| | | this.gridStateMap.delete(t); |
| | |
| | | |
| | | // è°æ´åç±»å°å¾è¦çç©çå¯è§æ§ |
| | | changeVisibility({ tags = [], showGridViews, showDataTxt, showRankTxt }) { |
| | | let { _mapViewsList } = this._getMapViews(...tags); |
| | | let { _mapViewsList, _gridStateList } = this._getMapViews(...tags); |
| | | |
| | | if (showGridViews != undefined) { |
| | | if (showGridViews) { |
| | | // map.add(this.mapViews.lastGridViews); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.lastGridViews) { |
| | | map.add(v.lastGridViews); |
| | | v.show = true; |
| | | _gridStateList[i].showGrid = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.lastGridViews); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.lastGridViews) { |
| | | map.remove(v.lastGridViews); |
| | | v.show = false; |
| | | _gridStateList[i].showGrid = false; |
| | | _gridStateList[i].showHeatMap = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | if (showDataTxt != undefined) { |
| | | if (showDataTxt) { |
| | | // map.add(this.mapViews.dataTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.dataTxt) { |
| | | map.add(v.dataTxt); |
| | | v.showData = true; |
| | | _gridStateList[i].showData = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.dataTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.dataTxt) { |
| | | map.remove(v.dataTxt); |
| | | v.showData = false; |
| | | _gridStateList[i].showData = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | if (showRankTxt != undefined) { |
| | | if (showRankTxt) { |
| | | // map.add(this.mapViews.rankTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.rankTxt) { |
| | | map.add(v.rankTxt); |
| | | v.showRank = true; |
| | | _gridStateList[i].showRank = true; |
| | | } |
| | | }); |
| | | } else { |
| | | // map.remove(this.mapViews.rankTxt); |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.rankTxt) { |
| | | map.remove(v.rankTxt); |
| | | v.showRank = false; |
| | | _gridStateList[i].showRank = false; |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | changeGridOpacity({ tag, isOpacity, opacityValue }) { |
| | | let { _mapViewsList } = tag ? this._getMapViews(tag) : this._getMapViews(); |
| | | let { _mapViewsList, _gridStateList } = tag |
| | | ? this._getMapViews(tag) |
| | | : this._getMapViews(); |
| | | |
| | | _mapViewsList.forEach((v) => { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.lastGridViews) { |
| | | v.lastGridViews.forEach((e) => { |
| | | e.setOptions({ |
| | |
| | | : 0.7 |
| | | }); |
| | | }); |
| | | _gridStateList[i].gridOpacityValue = opacityValue; |
| | | } |
| | | }); |
| | | } |
| | |
| | | zIndex, |
| | | isMixGridHighlight |
| | | }) { |
| | | let { _mapViewsList, _gridDataDetailList } = this._getMapViews(...tags); |
| | | let { _mapViewsList, _gridDataDetailList, _gridStateList } = |
| | | this._getMapViews(...tags); |
| | | if (_mapViewsList.length == _gridDataDetailList.length) { |
| | | _mapViewsList.forEach((v, i) => { |
| | | if (v.lastGridViews) { |
| | | if (useCustomColor != undefined) v.showCustomColor = useCustomColor; |
| | | const lastGridDataDetail = _gridDataDetailList[i]; |
| | | if (v.showCustomColor) { |
| | | const _gridState = _gridStateList[i]; |
| | | if (useCustomColor != undefined) |
| | | _gridState.showGridCustomColor = useCustomColor; |
| | | if (useCustomColor) { |
| | | gridMapUtil.drawGridColorCustom( |
| | | v.lastGridViews, |
| | | lastGridDataDetail, |
| | | factorName ? factorName : this.selectedFactorType.name |
| | | ); |
| | | } else { |
| | | if (opacity != undefined) _gridState.gridOpacityValue = opacity; |
| | | if (zIndex != undefined) _gridState.gridZIndex = zIndex; |
| | | if (isMixGridHighlight != undefined) |
| | | _gridState.highlightFusionGrid = isMixGridHighlight; |
| | | gridMapUtil.drawGridColor( |
| | | v.lastGridViews, |
| | | lastGridDataDetail, |
| | |
| | | * éå çç½æ ¼è¿è¡çæµæ°æ®åå¼è®¡ç®å¹¶éæ°è®¡ç®å¯¹åºé¢è²ï¼å½¢ææ°çä¸ç»èåç½æ ¼ |
| | | * @param {Array} tags éè¦èåçç½æ ¼æ ç¾ï¼å½ä¸ºç©ºæ¶ï¼é»è®¤èåææç½æ ¼ |
| | | */ |
| | | mixGrid({ tags, isMixGridHighlight = true }) { |
| | | tags.sort((a, b) => { |
| | | return a < b ? -1 : 1; |
| | | }); |
| | | const mixTag = tags.join('-'); |
| | | if (this.mapViewsMap.has(mixTag)) { |
| | | this.changeVisibility({ |
| | | tags: [mixTag], |
| | | showGridViews: true |
| | | }); |
| | | this.changeGridColor({ tags: [mixTag], isMixGridHighlight }); |
| | | } else { |
| | | // æ ¹æ®æ ç¾tagï¼è·å对åºå¤ç»ç½æ ¼æ°æ® |
| | | let { _gridDataDetailList } = this._getMapViews(...tags); |
| | | const _dataMap = new Map(); |
| | | // å°æ¯ç»æ¯ä¸ªç½æ ¼æ°æ®æç
§ç½æ ¼ç¼å·è¿è¡åç±»ï¼ç¸åç½æ ¼çæ°ç»å½éè³ä¸èµ· |
| | | _gridDataDetailList.forEach((list) => { |
| | | list.forEach((gdd) => { |
| | | if (!_dataMap.has(gdd.cellId)) { |
| | | _dataMap.set(gdd.cellId, { |
| | | source: [], |
| | | res: {} |
| | | }); |
| | | } |
| | | _dataMap.get(gdd.cellId).source.push(gdd); |
| | | }); |
| | | }); |
| | | // è®¡ç®æ¯ä¸ªç½æ ¼ä¸çæ°æ®åå¼ |
| | | const resGridDataDetail = []; |
| | | _dataMap.forEach((v, k) => { |
| | | let total = 0, |
| | | count = v.source.length; |
| | | v.source.forEach((s) => { |
| | | total += s.pm25; |
| | | }); |
| | | v.res = { |
| | | isMixData: true, |
| | | groupId: v.source[0].groupId, |
| | | cellId: v.source[0].cellId, |
| | | pm25: count == 0 ? null : Math.round((total / count) * 10) / 10, |
| | | originData: v.source |
| | | }; |
| | | // æ°æ®éè¶
è¿1个æ¶ï¼è¡¨æè¯¥ç½æ ¼æ°æ®æ¯èåçï¼å±ç¤ºé«äº®çæ ·å¼ |
| | | if (count > 1) { |
| | | v.res.gridStyle = { |
| | | strokeWeight: 2, |
| | | strokeColor: '#23dad1' |
| | | }; |
| | | } |
| | | resGridDataDetail.push(v.res); |
| | | }); |
| | | // éæ°æç
§çæµæ°æ®æåºå¹¶æ è®°æå |
| | | resGridDataDetail.sort((a, b) => { |
| | | return b.pm25 - a.pm25; |
| | | }); |
| | | resGridDataDetail.forEach((gdd, i) => { |
| | | gdd.rank = i + 1; |
| | | }); |
| | | |
| | | this.drawTagGrid({ |
| | | tag: mixTag, |
| | | data: resGridDataDetail, |
| | | grid: { |
| | | style: { |
| | | isMixGridHighlight |
| | | } |
| | | }, |
| | | extData: { |
| | | name: `èµ°èªèå - ${mixTag}`, |
| | | type: 1 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return mixTag; |
| | | } |
| | | |
| | | mixGrid2({ tags, isMixGridHighlight = true, gridDataDetailList }) { |
| | | tags.sort((a, b) => { |
| | | return a < b ? -1 : 1; |
| | |
| | | |
| | | drawHeatGrid2(tag, headGridDataDetailList) { |
| | | const heatTag = `heat-${tag}`; |
| | | if (this.gridStateMap.has(tag)) { |
| | | this.gridStateMap.get(tag).showHeatMap = true; |
| | | } |
| | | if (this.mapViewsMap.has(heatTag)) { |
| | | this.changeVisibility({ |
| | | tags: [heatTag], |
| | |
| | | |
| | | _getMapViews(...tags) { |
| | | let _mapViewsList = [], |
| | | _gridDataDetailList = []; |
| | | _gridDataDetailList = [], |
| | | _gridStateList = []; |
| | | if (tags.length > 0) { |
| | | tags.forEach((tag) => { |
| | | if (this.mapViewsMap.has(tag) && this.gridDataDetailMap.has(tag)) { |
| | | _mapViewsList.push(this.mapViewsMap.get(tag)); |
| | | _gridDataDetailList.push(this.gridDataDetailMap.get(tag)); |
| | | _gridStateList.push(this.gridStateMap.get(tag)); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | this.gridDataDetailMap.forEach((v) => { |
| | | _gridDataDetailList.push(v); |
| | | }); |
| | | if (this.mapViews && this.gridDataDetail) { |
| | | this.gridStateMap.forEach((v) => { |
| | | _gridStateList.push(v); |
| | | }); |
| | | if (this.mapViews && this.gridDataDetail && this.gridState) { |
| | | _mapViewsList.push(this.mapViews); |
| | | _gridDataDetailList.push(this.gridDataDetail); |
| | | _gridStateList.push(this.gridState); |
| | | } |
| | | } |
| | | |
| | | return { _mapViewsList, _gridDataDetailList }; |
| | | return { _mapViewsList, _gridDataDetailList, _gridStateList }; |
| | | } |
| | | |
| | | _createNewMapViews({ extData }) { |
| | | _createNewMapViews({ tag, extData }) { |
| | | return { |
| | | gridViews: gridMapUtil.drawPolylines({ |
| | | points: this.mapViews.gridPoints, |
| | |
| | | gridPoints: JSON.parse(JSON.stringify(this.mapViews.gridPoints)), |
| | | points: JSON.parse(JSON.stringify(this.mapViews.points)), |
| | | extData, |
| | | show: true |
| | | show: true, |
| | | mapZoomEvent: () => { |
| | | const zoomLevel = map.getZoom(); |
| | | if (zoomLevel >= 16.5) { |
| | | this.changeGridOpacity({ tag, opacityValue: 0.1 }); |
| | | } else { |
| | | this.changeGridOpacity({ tag, opacityValue: 1 }); |
| | | } |
| | | // console.log('mapZoomEvent', map.getZoom()); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | _createNewGridState({ extData }) { |
| | | return { |
| | | type: undefined, |
| | | name: '', |
| | | showGrid: true, |
| | | showRank: false, |
| | | showData: false, |
| | | showCustomColor: false, |
| | | // ç½æ ¼åç§° |
| | | name: extData.name, |
| | | // ç½æ ¼ç±»åï¼0ï¼èµ°èªç½æ ¼ï¼1ï¼èµ°èªèåç½æ ¼ï¼2ï¼èµ°èªçåå¾ |
| | | type: extData.type, |
| | | // ç½æ ¼ç¸å
³åæ° |
| | | showGrid: true, // æ¯å¦æ¾ç¤ºç½æ ¼ |
| | | showGridCustomColor: false, // æ¯å¦æ¾ç¤ºå¯¹æ¯è² |
| | | gridOpacityValue: 1, // ç½æ ¼éæåº¦ |
| | | gridZIndex: 11, // ç½æ ¼zè½´é«åº¦ |
| | | |
| | | // æåææ¬ç¸å
³åæ° |
| | | showRank: false, // æåææ¬æ¯å¦æ¾ç¤º |
| | | |
| | | // æ°æ®ææ¬ç¸å
³åæ° |
| | | showData: false, // æ°æ®ææ¬æ¯å¦æ¾ç¤º |
| | | showDataColor: false, // æ°æ®ææ¬æ¯å¦ä½¿ç¨å¯¹åºçæµå åçæ åé¢è² |
| | | showDataCustomColor: false, // æ°æ®ææ¬æ¯å¦ä½¿ç¨å¯¹åºçæµå åç对æ¯é¢è² |
| | | |
| | | // æ¯å¦æ¾ç¤ºå¯¹åºçåå¾ |
| | | showHeatMap: false, |
| | | |
| | | // 妿æ¯èåç½æ ¼ï¼æ¯å¦é«äº®æ¾ç¤ºéå ç½æ ¼ |
| | | highlightFusionGrid: false, |
| | | |
| | | // å¦ææ¯æ®éçèµ°èªç½æ ¼ï¼æ¯å¦æ¾ç¤ºå¯¹åºçèµ°èªè½¨è¿¹ |
| | | showUnderway: false, |
| | | opacityValue: 1 |
| | | |
| | | // å¯è½çèªå®ä¹é¢å¤æ°æ® |
| | | extData |
| | | }; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // import { ref } from 'vue'; |
| | | // import { defineStore } from 'pinia'; |
| | | // import gridApi from '@/api/gridApi'; |
| | | // import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | // // èµ°èªä»»å¡ |
| | | // export const useMissionStore = defineStore('mission', () => { |
| | | // const missionList = ref([]); |
| | | // const { loading, fetchData } = useFetchData(1000); |
| | | |
| | | // function fetchMission(type) { |
| | | // return fetchData((page, pageSize) => { |
| | | // return missionApi |
| | | // .fethchMission({ type: type, page, pageSize }) |
| | | // .then((res) => { |
| | | // missionList.value = res.data; |
| | | // return res; |
| | | // }); |
| | | // }); |
| | | // } |
| | | |
| | | // function fetchFusionData() { |
| | | // return fetchData((page, pageSize) => { |
| | | // missionApi |
| | | // .fethchMission({ type: type, page, pageSize }) |
| | | // .then((res) => { |
| | | // missionList.value = res.data; |
| | | // return res; |
| | | // }); |
| | | |
| | | // return gridApi |
| | | // .fetchGridData(props.groupId, undefined, 3) |
| | | // .then((res) => { |
| | | // fusionDataList.value = res.data; |
| | | // }) |
| | | // .finally(() => (fusionLoading.value = false)); |
| | | // }); |
| | | // } |
| | | |
| | | // function deleteMission(missionCode) { |
| | | // return fetchData(() => { |
| | | // return missionApi.deleteMission(missionCode).then((res) => { |
| | | // let index = -1; |
| | | // for (let i = 0; i < missionList.value.length; i++) { |
| | | // const e = missionList.value[i]; |
| | | // if (e.missionCode == missionCode) { |
| | | // index = i; |
| | | // break; |
| | | // } |
| | | // } |
| | | // if (index != -1) { |
| | | // missionList.value.splice(index, 1); |
| | | // } |
| | | // return res; |
| | | // }); |
| | | // }); |
| | | // } |
| | | |
| | | // return { missionList, loading, fetchMission, deleteMission }; |
| | | // }); |
| | |
| | | } |
| | | |
| | | .el-button-custom-light { |
| | | --el-button-bg-color: var(--font-color); |
| | | --el-button-text-color: var(--bg-color); |
| | | --el-button-bg-color: var(--select_color); |
| | | // --el-button-text-color: var(--bg-color); |
| | | // --el-button-hover-text-color: var(--bg-color); |
| | | // --el-button-hover-bg-color: var(--font-color); |
| | | --el-button-hover-bg-color: var(--select_color); |
| | | --el-button-border-color: var(--bg-color); |
| | | --el-button-hover-bg-color: transparent; |
| | | --el-button-border-color: var(--font-color); |
| | | --el-button-active-border-color: transparent; |
| | | } |
| | | |
| | |
| | | > |
| | | {{ 'èååæ' }} |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="underwayMixDialogVisible = true" |
| | | > |
| | | {{ 'èå管ç' }} |
| | | </el-button> |
| | | <!-- <CheckButton |
| | | active-text="èååæ" |
| | | :default-value="false" |
| | |
| | | <!-- </el-row> --> |
| | | </el-col> |
| | | </el-row> |
| | | <GridStyleTool |
| | | :gridCtrls="gridCtrls" |
| | | @show-underway="handleUnderwayClick" |
| | | @on-delete="handleFusionDelete" |
| | | ></GridStyleTool> |
| | | </el-row> |
| | | <GridStyleTool |
| | | class="style-tool" |
| | | :gridCtrls="gridCtrls" |
| | | @show-underway="handleUnderwayClick" |
| | | @on-delete="handleFusionDelete" |
| | | ></GridStyleTool> |
| | | <!-- <el-row class="m-t-2"> |
| | | <FactorLegend class="m-t-2" @change="handleLegendTypeChange"></FactorLegend> |
| | | </el-row> --> |
| | | <UnderwayMixManage |
| | | :groupId="groupId" |
| | | v-model="underwayMixDialogVisible" |
| | | @onUpdated="fetchFusionData" |
| | | ></UnderwayMixManage> |
| | | <!-- </div> --> |
| | | </template> |
| | | |
| | |
| | | import moment from 'moment'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import { SatelliteGrid } from '@/model/SatelliteGrid'; |
| | | import GridStyleTool from './component/GridStyleTool.vue'; |
| | | import { useGridStore } from '@/stores/grid-info'; |
| | | import { TYPE0 } from '@/constant/device-type'; |
| | | import { defaultOptions } from '@/constant/radio-options'; |
| | | import { useMessageBox } from '@/composables/messageBox'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | |
| | | import GridStyleTool from './component/GridStyleTool.vue'; |
| | | import UnderwayMixManage from './component/UnderwayMixManage.vue'; |
| | | |
| | | const gridStore = useGridStore(); |
| | | |
| | |
| | | const props = defineProps({ |
| | | groupId: { |
| | | type: Number, |
| | | default: 3 |
| | | default: 2 |
| | | } |
| | | }); |
| | | const show = ref(true); |
| | |
| | | // çæµå åçç±»åç¼å· |
| | | const factorType = ref(defaultOptions(TYPE0)); |
| | | satelliteGrid.setShowFactorType(toRaw(factorType.value)); |
| | | // const factor = computed(()=>{ |
| | | |
| | | // }) |
| | | |
| | | function handleFactorTypeChange(e, item) { |
| | | factorType.value = item; |
| | | console.log(toRaw(factorType.value)); |
| | | // console.log(toRaw(factorType.value)); |
| | | satelliteGrid.setShowFactorType(toRaw(factorType.value)); |
| | | } |
| | | |
| | | const mission = ref(undefined); |
| | | const underwayMixDialogVisible = ref(false); |
| | | |
| | | const gridCellList = ref(undefined); |
| | | const fusionData = ref(undefined); |
| | |
| | | .finally(() => (fusionLoading.value = false)); |
| | | } |
| | | |
| | | // æ£æ¥èµ°èªæ°æ®æ¯å¦å100ç±³ç½æ ¼å·²èå |
| | | // function checkUnderwayFusionResult() { |
| | | // const time = moment(mission.value.startTime).format('YYYY-MM-DD HH:mm:ss'); |
| | | // gridApi.fetchGridData(props.groupId, time, 3).then((res) => { |
| | | // if (res.data.length > 0) { |
| | | // fusionData.value = res.data[0]; |
| | | // } else { |
| | | // fusionData.value = undefined; |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | function prepareGrid(gridInfo) { |
| | | satelliteGrid.gridPrepare(gridInfo, function (polygon) { |
| | | // const originOption = polygon.getOptions(); |
| | | // //é¼ æ ç§»å
¥äºä»¶ |
| | | // polygon.on('mouseover', () => { |
| | | // polygon.setOptions({ |
| | | // //ä¿®æ¹å¤è¾¹å½¢å±æ§çæ¹æ³ |
| | | // strokeWeight: 2, |
| | | // strokeColor: 'red' |
| | | // }); |
| | | // }); |
| | | // //é¼ æ ç§»åºäºä»¶ |
| | | // polygon.on('mouseout', () => { |
| | | // // polygon.setOptions({ |
| | | // // strokeWeight: originOption.strokeWeight, |
| | | // // strokeColor: originOption.strokeColor |
| | | // // }); |
| | | // polygon.setOptions(originOption); |
| | | // }); |
| | | }); |
| | | satelliteGrid.gridPrepare(gridInfo); |
| | | } |
| | | |
| | | watch( |
| | |
| | | tag: d.id, |
| | | data: gdd, |
| | | extData: { |
| | | name: `èµ°èªç½æ ¼ - ${d.mixDataId}`, |
| | | name: `èµ°èªç½æ ¼ - ${d.missionCode}`, |
| | | type: 0 |
| | | } |
| | | }); |
| | |
| | | } else { |
| | | const d = fusionDataList.value.find((v) => v.id == dataId); |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | return v.missionCode == d.missionCode; |
| | | }); |
| | | mapLine.hideLine(mission.missionCode); |
| | | done(); |
| | |
| | | tag: d.id, |
| | | data: gdd, |
| | | extData: { |
| | | name: `èµ°èªç½æ ¼ - ${d.mixDataId}`, |
| | | name: `èµ°èªç½æ ¼ - ${d.missionCode}`, |
| | | type: 0 |
| | | } |
| | | }); |
| | |
| | | tag: d.id, |
| | | data: gdd, |
| | | extData: { |
| | | name: `èµ°èªç½æ ¼ - ${d.mixDataId}`, |
| | | name: `èµ°èªç½æ ¼ - ${d.missionCode}`, |
| | | type: 0 |
| | | } |
| | | }); |
| | |
| | | if (isUnmounted.value) return Promise.resolve(); |
| | | const d = fusionDataList.value.find((v) => v.id == dataId); |
| | | const mission = missionStore.missionList.find((v) => { |
| | | return v.missionCode == d.mixDataId; |
| | | return v.missionCode == d.missionCode; |
| | | }); |
| | | |
| | | if (factorDataMap.has(mission.missionCode)) { |
| | |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .style-tool { |
| | | position: absolute; |
| | | top: 0; |
| | | right: 0; |
| | | } |
| | | |
| | | :deep(.el-table) { |
| | | --el-table-bg-color: transparent; |
| | | --el-table-row-hover-bg-color: var(--select_color); |
| | |
| | | ></CardButton> |
| | | </el-row> |
| | | </el-col> |
| | | |
| | | <el-col span="2"> |
| | | <BaseCard v-show="show" direction="right" borderless="r"> |
| | | <template #content> |
| | | <el-scrollbar class="content-wrap"> |
| | | <div v-for="(g, i) in gridCtrlList" :key="i"> |
| | | <span>{{ g.name }}</span> |
| | | <div v-for="(value, t) in g.views" :key="t"> |
| | | <el-row justify="space-between" align="middle"> |
| | | <div> |
| | | <span v-if="value.extData.type == 0">{{ |
| | | value.tag + '.' |
| | | }}</span> |
| | | {{ value.extData.name }} |
| | | </div> |
| | | <el-button |
| | | class="el-button-custom" |
| | | type="primary" |
| | | icon="Close" |
| | | circle |
| | | size="small" |
| | | @click="handleCloseClick(i, t, value)" |
| | | /> |
| | | <!-- <el-icon><Close /></el-icon> --> |
| | | </el-row> |
| | | <el-tabs |
| | | class="grid-ctrl-card" |
| | | v-model="activeGridCtrl" |
| | | type="border-card" |
| | | > |
| | | <el-tab-pane |
| | | v-for="(g, i) in gridCtrlList" |
| | | :key="g.name" |
| | | :label="g.name" |
| | | :name="i" |
| | | > |
| | | <el-tabs v-model="activeGrid"> |
| | | <el-tab-pane |
| | | v-for="(grid, y) in g.views" |
| | | :key="y" |
| | | :label="grid.name" |
| | | :name="y" |
| | | > |
| | | <div v-for="(value, t) in grid.views" :key="t"> |
| | | <el-row justify="space-between" align="middle"> |
| | | <div> |
| | | <span v-if="value.type == 0">{{ |
| | | value.tag + '.' |
| | | }}</span> |
| | | {{ value.name }} |
| | | </div> |
| | | <el-button |
| | | class="el-button-custom" |
| | | type="primary" |
| | | icon="Close" |
| | | circle |
| | | size="small" |
| | | @click="handleCloseClick(i, y, t, value)" |
| | | /> |
| | | </el-row> |
| | | |
| | | <!-- {{ key }} --> |
| | | <!-- <el-text>{{ g.name }}</el-text> --> |
| | | <!-- <div class="m-t-8">ç½æ ¼è¦ç´ </div> --> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <!-- <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="gridLoading = !gridLoading" |
| | | > |
| | | {{ 'èååæ' }} |
| | | </el-button> --> |
| | | <CheckButton |
| | | :loading="gridLoading" |
| | | v-model="value.show" |
| | | active-text="æ¾ç¤ºç½æ ¼" |
| | | inactive-text="éèç½æ ¼" |
| | | @change="(e) => handleGridClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="rankLoading" |
| | | v-model="value.showRank" |
| | | active-text="æ¾ç¤ºæå" |
| | | inactive-text="éèæå" |
| | | :default-value="false" |
| | | @change="(e) => handleRankClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="dataLoading" |
| | | v-model="value.showData" |
| | | active-text="æ¾ç¤ºæ°æ®" |
| | | inactive-text="éèæ°æ®" |
| | | :default-value="false" |
| | | @change="(e) => handleDataClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | </el-row> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <CheckButton |
| | | :loading="colorLoading" |
| | | v-model="value.showCustomColor" |
| | | active-text="ç»å¶å¯¹æ¯è²" |
| | | inactive-text="ç»å¶æ åè²" |
| | | :default-value="false" |
| | | @change="(e) => handleColorClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="heatMapLoading" |
| | | v-model="value.showHeatMap" |
| | | active-text="é£é©çåå¾" |
| | | inactive-text="é£é©çåå¾" |
| | | :default-value="false" |
| | | @change="(e) => handleHeatMapClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="underwayLoading" |
| | | v-if="value.extData.type == 0" |
| | | v-model="value.showUnderway" |
| | | active-text="æ¾ç¤ºèµ°èªè½¨è¿¹" |
| | | inactive-text="éèèµ°èªè½¨è¿¹" |
| | | :default-value="false" |
| | | @change="(e) => handleUnderwayClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="highlightLoading" |
| | | v-if="value.extData.type == 1" |
| | | v-model="value.highlightFusionGrid" |
| | | active-text="é«äº®èåç½æ ¼" |
| | | :default-value="true" |
| | | @change="(e) => handleHighlightGridClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | </el-row> |
| | | <!-- <el-row class="m-b-8" align="middle"> --> |
| | | <el-form-item label="éæåº¦"> |
| | | <!-- <div class="m-t-8">ç½æ ¼éæåº¦</div> --> |
| | | <el-slider |
| | | v-model="value.opacityValue" |
| | | :min="0" |
| | | :max="1" |
| | | :step="0.1" |
| | | show-stops |
| | | @change="(e) => handleOpacityChange(e, i, value)" |
| | | style="width: 150px" |
| | | /> |
| | | <el-input-number |
| | | class="m-l-16" |
| | | size="small" |
| | | v-model="value.opacityValue" |
| | | :min="0" |
| | | :max="1" |
| | | :step="0.1" |
| | | @change="(e) => handleOpacityChange(e, i, value)" |
| | | /> |
| | | </el-form-item> |
| | | <!-- </el-row> --> |
| | | <el-divider /> |
| | | </div> |
| | | </div> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <CheckButton |
| | | :loading="gridLoading" |
| | | v-model="value.showGrid" |
| | | active-text="æ¾ç¤ºç½æ ¼" |
| | | inactive-text="éèç½æ ¼" |
| | | @change="(e) => handleGridClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="rankLoading" |
| | | v-if="value.type != 2" |
| | | v-model="value.showRank" |
| | | active-text="æ¾ç¤ºæå" |
| | | inactive-text="éèæå" |
| | | :default-value="false" |
| | | @change="(e) => handleRankClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="dataLoading" |
| | | v-model="value.showData" |
| | | active-text="æ¾ç¤ºæ°æ®" |
| | | inactive-text="éèæ°æ®" |
| | | :default-value="false" |
| | | @change="(e) => handleDataClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | </el-row> |
| | | <el-row class="m-t-8" justify="space-between"> |
| | | <CheckButton |
| | | :loading="colorLoading" |
| | | v-model="value.showGridCustomColor" |
| | | active-text="ç»å¶å¯¹æ¯è²" |
| | | inactive-text="ç»å¶æ åè²" |
| | | :default-value="false" |
| | | @change="(e) => handleColorClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="heatMapLoading" |
| | | v-if="value.type != 2" |
| | | v-model="value.showHeatMap" |
| | | active-text="é£é©çåå¾" |
| | | inactive-text="é£é©çåå¾" |
| | | :default-value="false" |
| | | @change="(e) => handleHeatMapClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="underwayLoading" |
| | | v-if="value.type == 0" |
| | | v-model="value.showUnderway" |
| | | active-text="æ¾ç¤ºèµ°èªè½¨è¿¹" |
| | | inactive-text="éèèµ°èªè½¨è¿¹" |
| | | :default-value="false" |
| | | @change="(e) => handleUnderwayClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | <CheckButton |
| | | :loading="highlightLoading" |
| | | v-if="value.type == 1" |
| | | v-model="value.highlightFusionGrid" |
| | | active-text="é«äº®èåç½æ ¼" |
| | | :default-value="true" |
| | | @change="(e) => handleHighlightGridClick(e, i, value)" |
| | | > |
| | | </CheckButton> |
| | | </el-row> |
| | | <el-form-item label="éæåº¦"> |
| | | <el-slider |
| | | v-model="value.gridOpacityValue" |
| | | :min="0" |
| | | :max="1" |
| | | :step="0.1" |
| | | show-stops |
| | | @change="(e) => handleOpacityChange(e, i, value)" |
| | | style="width: 150px" |
| | | /> |
| | | <el-input-number |
| | | class="m-l-16" |
| | | size="small" |
| | | v-model="value.gridOpacityValue" |
| | | :min="0" |
| | | :max="1" |
| | | :step="0.1" |
| | | @change="(e) => handleOpacityChange(e, i, value)" |
| | | /> |
| | | </el-form-item> |
| | | <el-divider /> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-scrollbar> |
| | | </template> |
| | | </BaseCard> |
| | |
| | | /** |
| | | * ç½æ ¼æ ·å¼æ§å¶å·¥å
· |
| | | */ |
| | | import { ref, reactive, onMounted, onUnmounted, computed, toRaw } from 'vue'; |
| | | import { |
| | | ref, |
| | | reactive, |
| | | onMounted, |
| | | onUnmounted, |
| | | watch, |
| | | computed, |
| | | toRaw |
| | | } from 'vue'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import { useGridStore } from '@/stores/grid-info'; |
| | | |
| | |
| | | } |
| | | }); |
| | | |
| | | const activeGridCtrl = ref(0); |
| | | const activeGrid = ref(0); |
| | | |
| | | const gridLoading = ref(false); |
| | | const rankLoading = ref(false); |
| | | const dataLoading = ref(false); |
| | |
| | | |
| | | const emits = defineEmits(['showUnderway', 'onDelete']); |
| | | |
| | | const gridCtrlList = computed(() => { |
| | | return props.gridCtrls.map((g) => { |
| | | return reactive({ |
| | | const gridCtrlList = ref([]); |
| | | |
| | | const show = ref(false); |
| | | |
| | | watch( |
| | | () => props.gridCtrls, |
| | | (nV, oV) => { |
| | | if (nV) { |
| | | show.value = true; |
| | | refreshValue(); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | function refreshValue() { |
| | | gridCtrlList.value = props.gridCtrls.map((g) => { |
| | | const _tempMap = new Map(); |
| | | if (g.gridState) { |
| | | _tempMap.set('å«æç½æ ¼', [g.gridState]); |
| | | } |
| | | Array.from(g.gridStateMap).map((v) => { |
| | | const key = girdTypeToName(v[1].type); |
| | | if (!_tempMap.has(key)) { |
| | | _tempMap.set(key, []); |
| | | } |
| | | _tempMap.get(key).push({ |
| | | tag: v[0], |
| | | ...v[1] |
| | | }); |
| | | }); |
| | | const res = { |
| | | name: g.name, |
| | | views: Array.from(g.mapViewsMap).map((v) => { |
| | | views: Array.from(_tempMap).map((v) => { |
| | | return { |
| | | tag: v[0], |
| | | extData: v[1].extData, |
| | | show: v[1].show, |
| | | showRank: v[1].showRank, |
| | | showData: v[1].showData, |
| | | showCustomColor: v[1].showCustomColor, |
| | | showHeatMap: v[1].showHeatMap, |
| | | highlightFusionGrid: true, |
| | | // ...v[1], |
| | | opacityValue: 1 |
| | | name: v[0], |
| | | views: reactive(v[1]) |
| | | }; |
| | | }) |
| | | }); |
| | | }; |
| | | console.log(res); |
| | | |
| | | return res; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | const show = ref(true); |
| | | function girdTypeToName(type) { |
| | | switch (type) { |
| | | case 0: |
| | | return 'èµ°èªç½æ ¼'; |
| | | case 1: |
| | | return 'èåç½æ ¼'; |
| | | case 2: |
| | | return 'çåå¾'; |
| | | } |
| | | } |
| | | |
| | | function handleCloseClick(index, t, value) { |
| | | function handleCloseClick(index, y, t, value) { |
| | | const key = value.tag; |
| | | toRaw(props.gridCtrls[index]).deleteTagGrid([key]); |
| | | gridCtrlList.value[index].views.splice(t, 1); |
| | | gridCtrlList.value[index].views[y].views.splice(t, 1); |
| | | emits('onDelete', index, key); |
| | | } |
| | | |
| | |
| | | // value.opacityValue = e; |
| | | toRaw(props.gridCtrls[index]).changeGridOpacity({ |
| | | tag: key, |
| | | opacityValue: toRaw(value.opacityValue) |
| | | opacityValue: toRaw(value.gridOpacityValue) |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | function handleHighlightGridClick(e, index, value) { |
| | | highlightLoading.value = true; |
| | | toRaw(props.gridCtrls[index]).mixGrid({ |
| | | toRaw(props.gridCtrls[index]).mixGrid2({ |
| | | tags: value.tag.split('-'), |
| | | isMixGridHighlight: e |
| | | }); |
| | |
| | | showDataTxt: false, |
| | | showRankTxt: false |
| | | }); |
| | | // gridCtrlList.value.forEach((v) => { |
| | | // v.views.forEach((view) => { |
| | | // view.show = false; |
| | | // view.showData = false; |
| | | // view.showRank = false; |
| | | // }); |
| | | // }); |
| | | if (e) { |
| | | const data = _satelliteGrid.gridDataDetailMap.get(value.tag); |
| | | gridApi |
| | |
| | | .then((res) => { |
| | | heatTag = _satelliteGrid.drawHeatGrid2(value.tag, res.data); |
| | | _satelliteGrid.setDefaultGridClickEvent([heatTag]); |
| | | // _satelliteGrid.setGridEvent( |
| | | // [heatTag], |
| | | // 'click', |
| | | // (gridCell, gridDataDetail) => { |
| | | // gridStore.selectedGridCellAndDataDetail = { |
| | | // gridCell, |
| | | // gridDataDetail |
| | | // }; |
| | | // } |
| | | // ); |
| | | refreshValue(); |
| | | }) |
| | | .finally(() => (heatMapLoading.value = false)); |
| | | } else { |
| | |
| | | showGridViews: true |
| | | }); |
| | | heatMapLoading.value = false; |
| | | refreshValue(); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | :deep(.el-input-number) { |
| | | width: 80px; |
| | | } |
| | | |
| | | :deep(.el-tabs__item) { |
| | | color: rgba(221, 221, 221, 0.806); |
| | | } |
| | | :deep(.el-tabs__nav > .is-active) { |
| | | color: #f0ff1d; |
| | | } |
| | | :deep(.el-tabs--border-card) { |
| | | background: transparent; |
| | | border: 0px; |
| | | } |
| | | |
| | | :deep(.grid-ctrl-card > .el-tabs__content) { |
| | | padding: 0; |
| | | } |
| | | :deep(.grid-ctrl-card > .el-tabs__header) { |
| | | background: transparent; |
| | | border-bottom: 0px solid var(--el-border-color-light); |
| | | } |
| | | :deep( |
| | | .grid-ctrl-card |
| | | > .el-tabs__header |
| | | .el-tabs__nav-wrap |
| | | .el-tabs__nav-scroll |
| | | .el-tabs__nav |
| | | ) { |
| | | border: 1px solid var(--el-border-color-light); |
| | | } |
| | | :deep(.grid-ctrl-card > .el-tabs__header .el-tabs__item.is-active) { |
| | | color: var(--font-color); |
| | | background-color: transparent; |
| | | border-right-color: transparent; |
| | | border-left-color: transparent; |
| | | } |
| | | :deep(.el-tabs--border-card > .el-tabs__header .el-tabs__item) { |
| | | margin-top: 0px; |
| | | } |
| | | :deep(.el-tabs--border-card > .el-tabs__header .el-tabs__item:first-child) { |
| | | margin-left: 0px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <CardDialog |
| | | :title="dialogTitle" |
| | | :close-on-click-modal="!loading" |
| | | :model-value="modelValue" |
| | | @update:modelValue="(e) => $emit('update:modelValue', e)" |
| | | > |
| | | <el-form |
| | | :inline="false" |
| | | :model="formObj" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="100px" |
| | | > |
| | | <el-form-item label="åºå¿" prop="location"> |
| | | <OptionLocation2 |
| | | :disabled="true" |
| | | :level="3" |
| | | :initValue="false" |
| | | :checkStrictly="false" |
| | | :allOption="false" |
| | | v-model="formObj.location" |
| | | ></OptionLocation2> |
| | | </el-form-item> |
| | | <el-form-item label="ä»»å¡ç¼å·" prop="missionCode"> |
| | | <el-input |
| | | :disabled="true" |
| | | size="small" |
| | | clearable |
| | | v-model="formObj.missionCode" |
| | | placeholder="ä»»å¡ç¼å·" |
| | | class="w-150" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="åºå" prop="zone"> |
| | | <el-input |
| | | size="small" |
| | | clearable |
| | | v-model="formObj.zone" |
| | | placeholder="åºå" |
| | | class="w-150" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="污æèæ¯" prop="pollutionDegreeIndex"> |
| | | <OptionPollutionDegree |
| | | v-model="formObj.pollutionDegreeIndex" |
| | | ></OptionPollutionDegree> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | :disabled="!edit" |
| | | type="primary" |
| | | @click="onSubmit" |
| | | :loading="loading" |
| | | >æäº¤</el-button |
| | | > |
| | | <el-button @click="onCancel" :disabled="loading">åæ¶</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </CardDialog> |
| | | </template> |
| | | <script setup> |
| | | import { ref, onMounted, reactive, computed, watch } from 'vue'; |
| | | import { useFormConfirm } from '@/composables/formConfirm'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import { pollutionName } from '@/constant/pollution-degree'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: Boolean, |
| | | // èµ°èªèåç¼è¾æ¨¡å¼ï¼æ°å»ºææ´æ° |
| | | mode: { |
| | | type: String, |
| | | default: 'create' |
| | | }, |
| | | record: { |
| | | type: Object |
| | | }, |
| | | groupId: { |
| | | type: Number, |
| | | default: 2 |
| | | } |
| | | }); |
| | | const emits = defineEmits(['update:modelValue', 'onSubmit']); |
| | | |
| | | const dialogTitle = computed(() => { |
| | | return `${props.mode == 'create' ? 'çæ' : 'ä¿®æ¹'}èµ°èªèåè®°å½`; |
| | | }); |
| | | |
| | | const { loading, fetchData } = useFetchData(); |
| | | const { formObj, formRef, edit, onSubmit, onCancel } = useFormConfirm({ |
| | | submit: { |
| | | do: submitFusionRecord |
| | | }, |
| | | cancel: { |
| | | do: () => { |
| | | emits('update:modelValue', false); |
| | | } |
| | | } |
| | | }); |
| | | const rules = reactive({ |
| | | location: [ |
| | | { |
| | | required: true, |
| | | message: 'åºå¿ä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | missionCode: [ |
| | | { |
| | | required: true, |
| | | message: 'ä»»å¡ç¼å·ä¸è½ä¸ºç©º', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | zone: [ |
| | | { |
| | | required: true, |
| | | message: 'åºåä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | pollutionDegreeIndex: [ |
| | | { |
| | | required: true, |
| | | message: '污æèæ¯ä¸è½ä¸ºç©º', |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | const param = computed(() => { |
| | | return { |
| | | provinceCode: formObj.value.location.pCode, |
| | | provinceName: formObj.value.location.pName, |
| | | cityCode: formObj.value.location.cCode, |
| | | cityName: formObj.value.location.cName, |
| | | districtCode: formObj.value.location.dCode, |
| | | districtName: formObj.value.location.dName, |
| | | townCode: formObj.value.location.tCode, |
| | | townName: formObj.value.location.tName, |
| | | missionCode: formObj.value.missionCode, |
| | | // Fixme 2025.4.15: ç½æ ¼ç»idéè¦éè¿æå¡å¨å¨æè·å |
| | | groupId: props.groupId, |
| | | zone: formObj.value.zone, |
| | | pollutionDegreeIndex: formObj.value.pollutionDegreeIndex, |
| | | pollutionDegree: pollutionName(formObj.value.pollutionDegreeIndex) |
| | | }; |
| | | }); |
| | | |
| | | function submitFusionRecord() { |
| | | fetchData((page, pageSize) => { |
| | | return gridApi.buildUnderwayProduct(param.value).then((res) => { |
| | | emits('onSubmit', param.value.missionCode); |
| | | emits('update:modelValue', false); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // çå¬ä¼ å
¥çèµ°èªèåä¿¡æ¯ï¼å¨æ´æ°æ¨¡å¼ä¸ï¼å°èåä¿¡æ¯æ å°å°è¡¨åä¸ |
| | | watch( |
| | | () => props.record, |
| | | (nV, oV) => { |
| | | if (nV && nV != oV) { |
| | | const r = nV; |
| | | // å
³éå¯¹è¯æ¡æ¶ï¼ç´æ¥è¿å |
| | | if (!props.modelValue) { |
| | | return; |
| | | } |
| | | formObj.value.location = { |
| | | pCode: r.provinceCode, |
| | | pName: r.provinceName, |
| | | cCode: r.cityCode, |
| | | cName: r.cityName, |
| | | dCode: r.districtCode, |
| | | dName: r.districtName, |
| | | tCode: r.townCode, |
| | | tName: r.townName |
| | | }; |
| | | formObj.value.missionCode = r.missionCode; |
| | | formObj.value.groupId = props.groupId; |
| | | formObj.value.zone = r.districtName; |
| | | formObj.value.pollutionDegreeIndex = undefined; |
| | | formObj.value.pollutionDegree = undefined; |
| | | |
| | | if (r.fusionData && props.mode == 'update') { |
| | | const f = r.fusionData; |
| | | formObj.value.groupId = f.groupId; |
| | | formObj.value.zone = f.zone; |
| | | formObj.value.pollutionDegreeIndex = f.pollutionDegreeIndex; |
| | | formObj.value.pollutionDegree = f.pollutionDegree; |
| | | } |
| | | } |
| | | } |
| | | ); |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <CardDialog |
| | | v-bind="$attrs" |
| | | title="èµ°èªèå管ç" |
| | | :model-value="modelValue" |
| | | @update:modelValue="handleDialogChange" |
| | | > |
| | | <el-row class="mission-table"> |
| | | <el-col :span="24"> |
| | | <el-table |
| | | :data="missionStore.missionList" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :show-overflow-tooltip="true" |
| | | border |
| | | height="64vh" |
| | | 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" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | align="center" |
| | | width="50" |
| | | /> |
| | | <el-table-column prop="missionCode" label="ä»»å¡ç¼å·" align="center" /> |
| | | <el-table-column |
| | | prop="startTime" |
| | | label="å¼å§æ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | prop="endTime" |
| | | label="ç»ææ¶é´" |
| | | align="center" |
| | | :formatter="timeFormatter" |
| | | width="150" |
| | | /> |
| | | <el-table-column label="èåè®°å½" align="center" width="50"> |
| | | <template #default="{ row }"> |
| | | {{ row.fusionData ? 'æ' : 'æ ' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="管ç" width="160" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | v-if="row.fusionData" |
| | | type="primary" |
| | | size="small" |
| | | icon="EditPen" |
| | | class="el-button-custom-light" |
| | | :loading="row.loading" |
| | | @click="updateFusionRecord(row)" |
| | | >æ´æ°è®°å½</el-button |
| | | > |
| | | <el-button |
| | | v-else |
| | | type="primary" |
| | | size="small" |
| | | icon="Plus" |
| | | class="el-button-custom" |
| | | :loading="row.loading" |
| | | @click="createFusionRecord(row)" |
| | | >èåçæ</el-button |
| | | > |
| | | <el-button |
| | | v-if="row.fusionData" |
| | | type="primary" |
| | | size="small" |
| | | icon="Delete" |
| | | class="el-button-custom" |
| | | :disabled="row.loading" |
| | | @click="deleteFusionRecord(row)" |
| | | ></el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </CardDialog> |
| | | <MessageBox |
| | | v-model="msgBoxVisible" |
| | | :on-confirm="onConfirm" |
| | | title="å é¤èµ°èªèå" |
| | | msg="确认æ¯å¦å é¤è¯¥èµ°èªèå" |
| | | confirmText="å é¤" |
| | | ></MessageBox> |
| | | <UnderwayMixEdit |
| | | v-model="dialogVisible" |
| | | width="30%" |
| | | :group-id="groupId" |
| | | :mode="editMode" |
| | | :record="selectedFusionRecord" |
| | | @on-submit="refreshFusionRecord" |
| | | ></UnderwayMixEdit> |
| | | </template> |
| | | <script setup> |
| | | import { ref, watch, onMounted } from 'vue'; |
| | | import moment from 'moment'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import { useMissionStore } from '@/stores/mission'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | import UnderwayMixEdit from './UnderwayMixEdit.vue'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: Boolean, |
| | | groupId: { |
| | | type: Number, |
| | | default: 2 |
| | | } |
| | | }); |
| | | |
| | | const emits = defineEmits(['update:modelValue', 'onUpdated']); |
| | | |
| | | const { loading, fetchData } = useFetchData(); |
| | | const missionStore = useMissionStore(); |
| | | |
| | | const isEdited = ref(false); |
| | | const editMode = ref('create'); |
| | | const selectedFusionRecord = ref(undefined); |
| | | const dialogVisible = ref(false); |
| | | const msgBoxVisible = ref(false); |
| | | const onConfirm = ref(undefined); |
| | | |
| | | // eslint-disable-next-line no-unused-vars |
| | | function timeFormatter(row, col, cellValue, index) { |
| | | return moment(cellValue).format('YYYY-MM-DD HH:mm:ss'); |
| | | } |
| | | |
| | | // æ¥è¯¢èµ°èªèåè®°å½ |
| | | function fetchFusionRecord(row) { |
| | | row.loading = true; |
| | | gridApi |
| | | .fetchGridData2({ type: 3, missionCode: row.missionCode }) |
| | | .then((res) => { |
| | | // èµ°èªç½æ ¼èåï¼å个走èªå¨å¨åä¸ªç½æ ¼ç»ä¸åªæå¯ä¸è®°å½ |
| | | if (res.data.length > 0) { |
| | | row.fusionData = res.data[0]; |
| | | } else { |
| | | row.fusionData = undefined; |
| | | } |
| | | }) |
| | | .finally(() => (row.loading = false)); |
| | | } |
| | | |
| | | function createFusionRecord(row) { |
| | | editMode.value = 'create'; |
| | | selectedFusionRecord.value = row; |
| | | dialogVisible.value = true; |
| | | // row.loading = true; |
| | | // setTimeout(() => { |
| | | // row.loading = false; |
| | | // }, 1000); |
| | | } |
| | | |
| | | function updateFusionRecord(row) { |
| | | editMode.value = 'update'; |
| | | selectedFusionRecord.value = row; |
| | | dialogVisible.value = true; |
| | | } |
| | | |
| | | function deleteFusionRecord(row) { |
| | | this.onConfirm = () => { |
| | | gridApi.deleteGridData(row.fusionData.id).then((res) => { |
| | | if (res.data) { |
| | | refreshFusionRecord(row.missionCode); |
| | | } |
| | | }); |
| | | }; |
| | | this.msgBoxVisible = true; |
| | | } |
| | | |
| | | function refreshFusionRecord(missionCode) { |
| | | const m = missionStore.missionList.find((v) => v.missionCode == missionCode); |
| | | fetchFusionRecord(m); |
| | | isEdited.value = true; |
| | | } |
| | | |
| | | function handleDialogChange(e) { |
| | | emits('update:modelValue', e); |
| | | if (isEdited.value) { |
| | | emits('onUpdated'); |
| | | } |
| | | } |
| | | |
| | | watch( |
| | | () => props.modelValue, |
| | | (nV, oV) => { |
| | | if (nV) { |
| | | isEdited.value = false; |
| | | missionStore.missionList.forEach((v) => { |
| | | fetchFusionRecord(v); |
| | | }); |
| | | } |
| | | } |
| | | ); |
| | | </script> |
| | | <style scoped> |
| | | .flex-col { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 4px; |
| | | align-items: flex-end; |
| | | } |
| | | |
| | | :deep(.t-row-normal) { |
| | | background-color: transparent !important; |
| | | } |
| | | </style> |