1. 新增绘图模式的切换
2. 新增行政区划的切换展示
| | |
| | | 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'] |
| | |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | ElSlider: typeof import('element-plus/es')['ElSlider'] |
| | | ElSwitch: typeof import('element-plus/es')['ElSwitch'] |
| | | ElTable: typeof import('element-plus/es')['ElTable'] |
| | | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | |
| | | { |
| | | name: 'èµ°èªçæµ', |
| | | path: 'rmode' |
| | | }, |
| | | { |
| | | name: 'èµ°èªèå', |
| | | path: 'underwaymix' |
| | | } |
| | | // { |
| | | // name: 'æ±¡ææº¯æº2', |
| | |
| | | import sceneInfoApi from '@/api/sceneInfoApi'; |
| | | import marks from '@/utils/map/marks'; |
| | | import MapUtil from '@/utils/map/util'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | import { mapStores } from 'pinia'; |
| | | |
| | | const lableMarkMap = new Map(); |
| | | |
| | |
| | | sceneMap: new Map() |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapStores(useToolboxStore) |
| | | }, |
| | | watch: { |
| | | // å½åæ¢åºå¿æ¶ï¼æ¸
空ææé项 |
| | | districtCode(nV, oV) { |
| | | if (nV != oV) { |
| | | this.toolboxStore.selectedDistrict = nV; |
| | | this.handelCheckAllChange(false); |
| | | } |
| | | } |
| | |
| | | toolItem: [ |
| | | { |
| | | icon: 'fa fa-map-signs', |
| | | label: 'è¡æ¿åºå', |
| | | value: false, |
| | | click: function () { |
| | | this.value = !this.value; |
| | | toolbox.toggleDistrict(this.value); |
| | | } |
| | | }, |
| | | { |
| | | icon: 'fa fa-map-signs', |
| | | label: 'å°ç©æ 注', |
| | | value: false, |
| | | click: function () { |
| | |
| | | <span class="w-60 m-l-8">{{ item.unit }}</span> |
| | | </el-row> |
| | | </div> |
| | | <div> |
| | | 忢ç»å¾æ¨¡å¼ï¼ |
| | | <el-switch |
| | | v-model="legendType" |
| | | width="60" |
| | | inline-prompt |
| | | style="" |
| | | active-text="卿" |
| | | inactive-text="æ å" |
| | | @change="handleChange" |
| | | /> |
| | | </div> |
| | | </template> |
| | | </BaseCard> |
| | | </template> |
| | |
| | | default: () => new Factor() |
| | | } |
| | | }, |
| | | emits: ['change'], |
| | | data() { |
| | | return {}; |
| | | return { |
| | | // ç»å¾æ¨¡å¼ï¼false: æ 忍¡å¼ï¼trueï¼å¨ææ¨¡å¼ |
| | | legendType: false, |
| | | legends: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | factor(nValue, oValue) { |
| | | if (nValue != oValue && nValue) { |
| | | this.legends = this.refreshLegend( |
| | | nValue.factorName, |
| | | nValue.legendType, |
| | | nValue.min, |
| | | nValue.max |
| | | ); |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | legends() { |
| | | const res = this.factor |
| | | ? this.refreshLegend( |
| | | this.factor.factorName, |
| | | this.factor.legendType, |
| | | this.factor.min, |
| | | this.factor.max |
| | | ) |
| | | : []; |
| | | return res; |
| | | } |
| | | // legends() { |
| | | // const res = this.factor |
| | | // ? this.refreshLegend( |
| | | // this.factor.factorName, |
| | | // this.factor.legendType, |
| | | // this.factor.min, |
| | | // this.factor.max |
| | | // ) |
| | | // : []; |
| | | // return res; |
| | | // } |
| | | }, |
| | | methods: { |
| | | /** |
| | |
| | | } |
| | | |
| | | return legendList; |
| | | }, |
| | | |
| | | handleChange(value) { |
| | | this.$emit('change', value, () => { |
| | | this.legends = this.refreshLegend( |
| | | this.factor.factorName, |
| | | this.factor.legendType, |
| | | this.factor.min, |
| | | this.factor.max |
| | | ); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | |
| | | .text-center { |
| | | text-align: center; |
| | | } |
| | | |
| | | .el-switch { |
| | | --el-switch-on-color: #1f9956; |
| | | --el-switch-off-color: #8b8b8b; |
| | | } |
| | | </style> |
| | |
| | | this.fetchDevice(); |
| | | } else { |
| | | this.handleChange(this.deviceOptions[0].value); |
| | | this.$emit('initOver'); |
| | | } |
| | | } |
| | | }; |
| | |
| | | } else { |
| | | this.index = 0; |
| | | this.handleChange(0); |
| | | this.$emit('initOver'); |
| | | } |
| | | } |
| | | }; |
| | |
| | | handleClick() { |
| | | this.$emit('search', { ...this.formSearch, mission: this.mission }); |
| | | } |
| | | }, |
| | | created() { |
| | | initCount = 0; |
| | | initEvents = []; |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | this.standardMin = -1; //çæµå åç±»å对åºçæ åæå°å¼ |
| | | this.standardMax = -1; //çæµå åç±»å对åºçæ åæå¤§å¼ |
| | | |
| | | // this.legendType = Legend.S_TYPE; //å¾ä¾æ¨¡å¼ |
| | | this.legendType = Legend.D_TYPE; //å¾ä¾æ¨¡å¼ |
| | | this.legendType = Legend.S_TYPE; //å¾ä¾æ¨¡å¼ |
| | | // this.legendType = Legend.D_TYPE; //å¾ä¾æ¨¡å¼ |
| | | |
| | | if (options != undefined) { |
| | | this.datas = options.datas; |
| | | this.heights = options.heights; |
| | | this.min = options.min; |
| | | this.max = options.max; |
| | | this.originMin = options.originMin; |
| | | this.originMax = options.originMax; |
| | | if (typeof options === 'object') { |
| | | for (const key in options) { |
| | | if (Object.prototype.hasOwnProperty.call(options, key)) { |
| | | const value = options[key]; |
| | | this[key] = value; |
| | | } |
| | | } |
| | | |
| | | this.factorName = options.factorName; |
| | | this.factorId = options.factorId; |
| | | this.colors = options.colors; |
| | | this.bottomColors = options.bottomColors; |
| | | this.bottomColor = options.bottomColor; |
| | | this.standardMin = options.standardMin; |
| | | this.standardMax = options.standardMax; |
| | | // this.datas = options.datas; |
| | | // this.heights = options.heights; |
| | | // this.min = options.min; |
| | | // this.max = options.max; |
| | | // this.originMin = options.originMin; |
| | | // this.originMax = options.originMax; |
| | | |
| | | // this.factorName = options.factorName; |
| | | // this.factorId = options.factorId; |
| | | // this.colors = options.colors; |
| | | // this.bottomColors = options.bottomColors; |
| | | // this.bottomColor = options.bottomColor; |
| | | // this.standardMin = options.standardMin; |
| | | // this.standardMax = options.standardMax; |
| | | |
| | | // this.legendType = options.legendType; |
| | | } |
| | | } |
| | | |
| | |
| | | import { Factor } from './Factor'; |
| | | import calculate from '@/utils/map/calculate'; |
| | | import { Legend } from './Legend'; |
| | | |
| | | /** |
| | | * |
| | |
| | | // çæµå åæ°æ®ï¼Map<String, Factor> |
| | | this.factor = new Map(); |
| | | |
| | | if (options != undefined) { |
| | | this.times = options.times; |
| | | this.lnglats_GPS = options.lnglats_GPS; |
| | | this.lnglats_GD = options.lnglats_GD; |
| | | this.coors_GD = options.coors_GD; |
| | | this.factor = options.factor; |
| | | this.legendType = Legend.S_TYPE; //å¾ä¾æ¨¡å¼ |
| | | |
| | | // if (options != undefined) { |
| | | // this.times = options.times; |
| | | // this.lnglats_GPS = options.lnglats_GPS; |
| | | // this.lnglats_GD = options.lnglats_GD; |
| | | // this.coors_GD = options.coors_GD; |
| | | // this.factor = options.factor; |
| | | // this.legendType = options.legendType; |
| | | // } |
| | | |
| | | if (typeof options === 'object') { |
| | | for (const key in options) { |
| | | if (Object.prototype.hasOwnProperty.call(options, key)) { |
| | | const value = options[key]; |
| | | this[key] = value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | d.values.forEach((v) => { |
| | | var f = this.factor[v.factorId]; |
| | | if (f == undefined) { |
| | | f = new Factor(); |
| | | f = new Factor({ |
| | | legendType: this.legendType |
| | | }); |
| | | this.factor[v.factorId] = f; |
| | | } |
| | | f.pushData(v, drawMode == undefined ? 0 : drawMode); |
| | |
| | | |
| | | // 设置ç»å¾èå´ |
| | | setRange: function (key, range) { |
| | | this.legendType = Legend.C_TYPE; |
| | | if (key != undefined) { |
| | | this.factor[key].setRange(range); |
| | | } else { |
| | | for (const k in this.factor) { |
| | | this.factor[k].setRange(range); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // éç½®ç»å¾èå´ |
| | | resetRange: function (key) { |
| | | this.legendType = Legend.D_TYPE; |
| | | if (key != undefined) { |
| | | this.factor[key].clearRange(); |
| | | } else { |
| | | for (const k in this.factor) { |
| | | this.factor[k].clearRange(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 设置为æ åç»å¾èå´ |
| | | standardRange: function (key) { |
| | | this.legendType = Legend.S_TYPE; |
| | | if (key != undefined) { |
| | | this.factor[key].standardRange(); |
| | | } else { |
| | | for (const k in this.factor) { |
| | | this.factor[k].standardRange(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // æ ¹æ®å½åç»å¾èå´éæ°è®¡ç®ç»å¾é«åº¦ |
| | |
| | | name: 'realtimeMode', |
| | | component: () => import('@/views/realtimemode/RealtimeMode.vue') |
| | | }, |
| | | // èµ°èªèå |
| | | { |
| | | path: 'underwaymix', |
| | | name: 'underwayMixMode', |
| | | component: () => import('@/views/underwaymix/UnderwayMixMode.vue') |
| | | }, |
| | | // é£é©æ¨¡å |
| | | { |
| | | path: 'riskmode', |
| | |
| | | import { defineStore } from 'pinia'; |
| | | |
| | | export const useToolboxStore = defineStore('toolbox', () => { |
| | | const selectedDistrict = ref(null); |
| | | // å¼å
³è¡æ¿åºå |
| | | const districtStatus = ref(false); |
| | | // å¼å
³å°ç©æ 注 |
| | | const featuresStatus = ref(false); |
| | | // å¼å
³å«æå°å¾ |
| | |
| | | const sceneSearchStatus = ref(true); |
| | | |
| | | return { |
| | | selectedDistrict, |
| | | districtStatus, |
| | | featuresStatus, |
| | | satelliteStatus, |
| | | controlbarStatus, |
| | |
| | | } |
| | | |
| | | export default { |
| | | clear() { |
| | | if (_cylinder != undefined) { |
| | | object3Dlayer.remove(_cylinder); |
| | | } |
| | | }, |
| | | |
| | | drawMesh: drawMesh, |
| | | /** |
| | | * ç»å¶3Dèµ°è¡è·¯çº¿å¾ |
| | |
| | | /* eslint-disable no-undef */ |
| | | import { map, satellite } from './index_old'; |
| | | import { watch } from 'vue'; |
| | | import { map, satellite, onMapMounted } from './index_old'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | import { DialogUtil } from '@/utils/map/dialog'; |
| | | |
| | | const toolboxStore = useToolboxStore(); |
| | | watch( |
| | | () => toolboxStore.selectedDistrict, |
| | | (nV, oV) => { |
| | | if (nV != oV && toolboxStore.districtStatus) { |
| | | if (activeDistrict) map.remove(activeDistrict); |
| | | drawDistrict(toolboxStore.selectedDistrict); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | /** |
| | | * åæ æ¾åé¼ æ ç¹å»åè°äºä»¶ |
| | |
| | | } |
| | | } |
| | | |
| | | let districtPolygonMap = new Map(); |
| | | let activeDistrict = undefined; |
| | | // ç»å¶åºå¿è¾¹ç |
| | | function drawDistrict(districtName, isNew) { |
| | | onMapMounted(() => { |
| | | if (!isNew && districtPolygonMap.has(districtName)) { |
| | | const districtPolygon = districtPolygonMap.get(districtName); |
| | | map.remove(districtPolygon); |
| | | map.add(districtPolygon); |
| | | activeDistrict = 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 |
| | | const districtPolygon = new AMap.Polygon({ |
| | | map: map, //æ¾ç¤ºè¯¥è¦çç©çå°å¾å¯¹è±¡ |
| | | strokeWeight: 1, //è½®å»çº¿å®½åº¦ |
| | | path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» |
| | | fillOpacity: 0.6, //å¤è¾¹å½¢å¡«å
éæåº¦ |
| | | // fillColor: '#CCF3FF', //å¤è¾¹å½¢å¡«å
é¢è² |
| | | fillColor: '#0077ff', |
| | | // strokeColor: '#ffffff' //线æ¡é¢è² |
| | | strokeColor: 'white', //线æ¡é¢è² |
| | | zIndex: 9 |
| | | }); |
| | | |
| | | districtPolygonMap.set(districtName, districtPolygon); |
| | | activeDistrict = districtPolygon; |
| | | } |
| | | // map.setFitView(); //å°è¦çç©è°æ´å°åéè§é |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | export default { |
| | | /** |
| | | * å¼å
³è¡æ¿åºå |
| | | * @param {boolean} value |
| | | */ |
| | | toggleDistrict(value) { |
| | | if (value) { |
| | | if (toolboxStore.selectedDistrict) |
| | | drawDistrict(toolboxStore.selectedDistrict); |
| | | } else { |
| | | if (activeDistrict) map.remove(activeDistrict); |
| | | } |
| | | toolboxStore.districtStatus = value; |
| | | }, |
| | | |
| | | /** |
| | | * å¼å
³å°ç©æ 注 |
| | | * @param {boolean} value |
| | | */ |
| | |
| | | import { map, isDragging } from '@/utils/map/index_old'; |
| | | import marks from '@/utils/map/marks'; |
| | | import Layer from '@/utils/map/3dLayer'; |
| | | |
| | | /** |
| | | * åæ éåçæè¥¿åè§åæä¸åè§ |
| | |
| | | clearMap() { |
| | | marks.clearMassMarks(); |
| | | map.clearMap(); |
| | | Layer.clear(); |
| | | }, |
| | | setFitView(views) { |
| | | if (views) { |
| | |
| | | <script setup> |
| | | 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: 1, //è½®å»çº¿å®½åº¦ |
| | | path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» |
| | | fillOpacity: 0.6, //å¤è¾¹å½¢å¡«å
éæåº¦ |
| | | // fillColor: '#CCF3FF', //å¤è¾¹å½¢å¡«å
é¢è² |
| | | fillColor: '#0077ff', |
| | | // strokeColor: '#ffffff' //线æ¡é¢è² |
| | | strokeColor: 'white', //线æ¡é¢è² |
| | | zIndex: 9 |
| | | }); |
| | | } |
| | | map.setFitView(); //å°è¦çç©è°æ´å°åéè§é |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | // 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: 1, //è½®å»çº¿å®½åº¦ |
| | | // path: bounds[i], //å¤è¾¹å½¢è½®å»çº¿çèç¹åæ æ°ç» |
| | | // fillOpacity: 0.6, //å¤è¾¹å½¢å¡«å
éæåº¦ |
| | | // // fillColor: '#CCF3FF', //å¤è¾¹å½¢å¡«å
é¢è² |
| | | // fillColor: '#0077ff', |
| | | // // strokeColor: '#ffffff' //线æ¡é¢è² |
| | | // strokeColor: 'white', //线æ¡é¢è² |
| | | // zIndex: 9 |
| | | // }); |
| | | // } |
| | | // map.setFitView(); //å°è¦çç©è°æ´å°åéè§é |
| | | // } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | drawDistrict('é¿å®åº'); |
| | | // drawDistrict('é¿å®åº'); |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <FactorLegend |
| | | class="m-t-2" |
| | | :factor="factorDatas.factor[factorType]" |
| | | @change="handleLegendTypeChange" |
| | | ></FactorLegend> |
| | | </el-row> |
| | | <el-row class="historical" justify="center"> |
| | |
| | | this.sceneStore.searchScene(lng, lat); |
| | | } |
| | | }, |
| | | handleLegendTypeChange(value, done) { |
| | | if (value) { |
| | | this.factorDatas.resetRange(); |
| | | } else { |
| | | this.factorDatas.standardRange(); |
| | | } |
| | | done(); |
| | | this.draw(); |
| | | }, |
| | | draw() { |
| | | // å·æ°å¾ä¾ |
| | | const factor = this.factorDatas.factor[this.factorType]; |
| | | sector.clearSector(); |
| | | this.drawRoadLine(factor); |
| | | // this.drawRoadMap(factor); |
| | | // this.drawRoadLine(factor); |
| | | this.drawRoadMap(factor); |
| | | this.drawMassMarks(factor); |
| | | }, |
| | | // ç»å¶3Dèµ°è¡è·¯çº¿å¾ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-events-none m-t-2"></div> |
| | | </template> |
| | | |
| | | <script setup></script> |
| | | <style scoped></style> |