CN-1563 feat: 地图配置从接口获取
This commit is contained in:
@@ -223,6 +223,7 @@ export default {
|
|||||||
localStorage.setItem(storageKey.dateFormat, data.date_format)
|
localStorage.setItem(storageKey.dateFormat, data.date_format)
|
||||||
localStorage.setItem(storageKey.sysName, data.system_name)
|
localStorage.setItem(storageKey.sysName, data.system_name)
|
||||||
localStorage.setItem(storageKey.sysLogo, data.system_logo)
|
localStorage.setItem(storageKey.sysLogo, data.system_logo)
|
||||||
|
localStorage.setItem(storageKey.mapConfig, data.map_config)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted () {
|
async mounted () {
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export const storageKey = {
|
|||||||
linkInfo: 'cn-link-info',
|
linkInfo: 'cn-link-info',
|
||||||
history: 'cn-history',
|
history: 'cn-history',
|
||||||
schemaEntityExplore: 'schema_entity_explore',
|
schemaEntityExplore: 'schema_entity_explore',
|
||||||
trackingSubscribers: 'tracking-subscribers'
|
trackingSubscribers: 'cn-tracking-subscribers',
|
||||||
|
mapConfig: 'cn-map-config'
|
||||||
}
|
}
|
||||||
export const largeCountryList = ['CN', 'US', 'RU', 'AU', 'CA', 'KZ', 'IN', 'BR']
|
export const largeCountryList = ['CN', 'US', 'RU', 'AU', 'CA', 'KZ', 'IN', 'BR']
|
||||||
|
|
||||||
@@ -2531,6 +2532,14 @@ export const reg = {
|
|||||||
containChinese: /[\u4E00-\u9FA5\uF900-\uFA2D]+/
|
containChinese: /[\u4E00-\u9FA5\uF900-\uFA2D]+/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const defaultMapConfig = {
|
||||||
|
center: [116.38, 39.82], // 默认地图中心
|
||||||
|
maxZoom: 14, // 最大缩放等级
|
||||||
|
minZoom: 3, // 最小缩放等级
|
||||||
|
mapLevel: 2, // 数据精度 1、2、3,1最大
|
||||||
|
defaultZoom: 12 // 默认缩放等级
|
||||||
|
}
|
||||||
|
|
||||||
export const report = {
|
export const report = {
|
||||||
timeRuleList: [
|
timeRuleList: [
|
||||||
{ name: 'overall.today', value: 'today' },
|
{ name: 'overall.today', value: 'today' },
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ import maplibregl from 'maplibre-gl'
|
|||||||
import mapStyle from '@/views/charts2/charts/entityDetail/mapStyle'
|
import mapStyle from '@/views/charts2/charts/entityDetail/mapStyle'
|
||||||
import 'maplibre-gl/dist/maplibre-gl.css'
|
import 'maplibre-gl/dist/maplibre-gl.css'
|
||||||
import unitConvert, { valueToRangeValue } from '@/utils/unit-convert'
|
import unitConvert, { valueToRangeValue } from '@/utils/unit-convert'
|
||||||
import { unitTypes, storageKey } from '@/utils/constants'
|
import { unitTypes, storageKey, defaultMapConfig } from '@/utils/constants'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import { appListChartOption } from '@/views/charts2/charts/options/echartOption'
|
import { appListChartOption } from '@/views/charts2/charts/options/echartOption'
|
||||||
import { pieOption } from '@/views/location/chartOption'
|
import { pieOption } from '@/views/location/chartOption'
|
||||||
@@ -1687,6 +1687,8 @@ export default {
|
|||||||
baseStation: 153,
|
baseStation: 153,
|
||||||
human: 167
|
human: 167
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mapConfig = localStorage.getItem(storageKey.mapConfig) ? JSON.parse(localStorage.getItem(storageKey.mapConfig)) : defaultMapConfig
|
||||||
return {
|
return {
|
||||||
activeTab,
|
activeTab,
|
||||||
dropDownValue,
|
dropDownValue,
|
||||||
@@ -1719,12 +1721,12 @@ export default {
|
|||||||
currentShowSubscriber, // 当前在地图上展示轨迹的Subscriber
|
currentShowSubscriber, // 当前在地图上展示轨迹的Subscriber
|
||||||
trackingSubscriberRecordMap: [], // record数据量大时,vue监听性能开销太大,所以单独用非监听的数组来维护subscriberId与record的关系
|
trackingSubscriberRecordMap: [], // record数据量大时,vue监听性能开销太大,所以单独用非监听的数组来维护subscriberId与record的关系
|
||||||
loading, // 控制组件内各处loading图标
|
loading, // 控制组件内各处loading图标
|
||||||
maxZoom: 14, // 地图最小缩放比例
|
maxZoom: mapConfig.maxZoom, // 地图最小缩放比例
|
||||||
minZoom: 3, // 地图最大缩放比例
|
minZoom: mapConfig.minZoom, // 地图最大缩放比例
|
||||||
mapLevel: 2, // 地图精度 1、2、3
|
mapLevel: mapConfig.mapLevel, // 地图精度 1、2、3
|
||||||
unitTypes,
|
unitTypes,
|
||||||
defaultZoom: 12, // 地图默认缩放比例
|
defaultZoom: mapConfig.defaultZoom, // 地图默认缩放比例
|
||||||
center: [116.38, 39.82], // 地图默认中心点。北京:[116.38, 39.9] 纽约:[-73.94539, 40.841843]
|
center: mapConfig.center, // 地图默认中心点。北京:[116.38, 39.9] 纽约:[-73.94539, 40.841843]
|
||||||
debounceMinuteChange: shallowRef(null),
|
debounceMinuteChange: shallowRef(null),
|
||||||
debounceOnResize: shallowRef(null),
|
debounceOnResize: shallowRef(null),
|
||||||
debounceVisualChange: shallowRef(null),
|
debounceVisualChange: shallowRef(null),
|
||||||
|
|||||||
Reference in New Issue
Block a user