From f6d02d534b2a61cada555a68948c51fd9f231e7e Mon Sep 17 00:00:00 2001 From: "hong.yang" Date: Sat, 28 Oct 2023 16:36:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E7=82=B9=E3=80=81=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E6=A8=A1=E5=BC=8F=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=92=8C=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/BasicComponents/FlyMap/index.vue | 2 +- .../packages/BasicComponents/Map/index.vue | 76 ++++-------- .../packages/BasicComponents/Map/setting.vue | 112 ++++++++++++++++-- .../BasicComponents/Map/settingConfig.js | 16 ++- .../RightSetting/DataSetting.vue | 45 ++++++- 5 files changed, 177 insertions(+), 74 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/FlyMap/index.vue b/data-room-ui/packages/BasicComponents/FlyMap/index.vue index 71235bd9..7d42edf7 100644 --- a/data-room-ui/packages/BasicComponents/FlyMap/index.vue +++ b/data-room-ui/packages/BasicComponents/FlyMap/index.vue @@ -117,7 +117,7 @@ export default { let mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/map/info/${config.customize.mapId}` // 如果设置了地图id,就用地图id获取地图数据,否则用默认的世界地图 if (!hasMapId) { - mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.fileUrlPrefix}/worldMap/world.json` + mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/map/default/worldMap/world` } this.$dataRoomAxios.get(mapInfoUrl, {}, true).then(res => { if (this.config.option.data) { diff --git a/data-room-ui/packages/BasicComponents/Map/index.vue b/data-room-ui/packages/BasicComponents/Map/index.vue index 985940fb..142da97b 100644 --- a/data-room-ui/packages/BasicComponents/Map/index.vue +++ b/data-room-ui/packages/BasicComponents/Map/index.vue @@ -155,7 +155,7 @@ export default { }, // 鼠标放上去高亮的样式 emphasis: { - areaColor: '#389BB7', + areaColor: config.customize.emphasisColor ? config.customize.emphasisColor :'#389BB7', borderWidth: 0 } } @@ -179,51 +179,30 @@ export default { }, showDelay: 100 }, + // 视觉映射 + visualMap: { + show: !config.customize.scatter, + calculable: config.customize.visual, + min: config.customize.range[0], + max: config.customize.range[1], + seriesIndex: [0], + inRange: { + color: config.customize.rangeColor + } + }, series: config.customize.scatter ? [ - // { - // type: 'effectScatter', - // coordinateSystem: 'geo', - // effectType: 'ripple', - // showEffectOn: 'render', - // rippleEffect: { - // period: 10, - // scale: 10, - // brushType: 'fill' - // }, - - // hoverAnimation: true, - // itemStyle: { - // normal: { - // color: 'rgba(255, 235, 59, .7)', - // shadowBlur: 10, - // shadowColor: '#333' - // } - // }, - // tooltip: { - // formatter(params) { - // return `

${ - // params.name - // }

- //
GDP${ - // params.data?.value[2] || '--' - // }
` - // }, - // show: true - // }, - // zlevel: 1, - // data: [ - // { name: '西藏自治区', value: [91.23, 29.5, 1] }, - // { name: '黑龙江省', value: [128.03, 47.01, 1007] }, - // { name: '北京市', value: [116.4551, 40.2539, 5007] } - // ] - // } { type: 'scatter', + // 坐标系类型 coordinateSystem: 'geo', - symbol: 'pin', + // 标记符号形状 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none' + symbol: config.customize.scatterSymbol ? config.customize.scatterSymbol : 'pin', + // 是否允许图例和散点图之间的联动效果 legendHoverLink: true, - symbolSize: [60, 60], + // 散点图标记符号的大小,[宽度,高度] + symbolSize: config.customize.scatterSize ? [config.customize.scatterSize, config.customize.scatterSize] : [40, 40], + // 触发特效的方式 showEffectOn: 'render', rippleEffect: { brushType: 'stroke' @@ -232,7 +211,7 @@ export default { zlevel: 11, // 这里渲染标志里的内容以及样式 label: { - show: true, + show: config.customize.hasOwnProperty('showScatterValue') ? config.customize.showScatterValue : true, formatter(value) { return value.data.value[2] }, @@ -264,7 +243,7 @@ export default { return `

${ params.name }

-
GDP${ +
${config.customize.tooltipTitle ? config.customize.tooltipTitle : 'GDP'}${ params.data?.value[2] || '--' }
` }, @@ -273,23 +252,12 @@ export default { } ] } - if (config.customize.visual) { - this.option.visualMap = { - show: true, - min: config.customize.range[0], - max: config.customize.range[1], - seriesIndex: [0], - inRange: { - color: config.customize.rangeColor - } - } - } let hasMapId = !!config.customize.mapId // 根据mapId获取地图数据 let mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/map/info/${config.customize.mapId}` // 如果设置了地图id,就用地图id获取地图数据,否则用默认的世界地图 if (!hasMapId) { - mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.fileUrlPrefix}/chinaMap/country/中华人民共和国.json` + mapInfoUrl = `${window.BS_CONFIG?.httpConfigs?.baseURL}/bigScreen/map/default/chinaMap.country/中华人民共和国` } const mapResp = await this.$dataRoomAxios.get(decodeURI(mapInfoUrl), {}, true) const map = hasMapId ? JSON.parse(mapResp.data.geoJson) : mapResp diff --git a/data-room-ui/packages/BasicComponents/Map/setting.vue b/data-room-ui/packages/BasicComponents/Map/setting.vue index 9bc69513..b22aee3c 100644 --- a/data-room-ui/packages/BasicComponents/Map/setting.vue +++ b/data-room-ui/packages/BasicComponents/Map/setting.vue @@ -191,27 +191,46 @@ /> - + + 打点 + + + 色块 + + + +
+ 打点模式 +
+ + + + + + + + + + + + + +
+ 色块模式 +
+ + +
+ + +