From 9c7ea2527d6e079fec2ea419631c2542ce0244ba Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 4 Dec 2023 18:22:08 +0800 Subject: [PATCH] shit --- src/components/areaMap.vue | 279 ++++++++---------- src/view/detail.vue | 3 +- src/view/index.vue | 18 +- static/index/JS.png | Bin 0 -> 2962 bytes static/index/MC.png | Bin 1810 -> 2914 bytes static/index/{地方标签@3x.png => mapicon.png} | Bin static/jsonData/xuantan.js | 78 ++++- 7 files changed, 198 insertions(+), 180 deletions(-) create mode 100644 static/index/JS.png rename static/index/{地方标签@3x.png => mapicon.png} (100%) diff --git a/src/components/areaMap.vue b/src/components/areaMap.vue index 6925fd2..6a16cc2 100644 --- a/src/components/areaMap.vue +++ b/src/components/areaMap.vue @@ -44,74 +44,96 @@ import { ref, onMounted } from "vue" import axios from "axios"; import * as echarts from 'echarts'; import "echarts-gl" -// import geoJson from "/static/jsonData/xuantan.js" - +import iconbg from '/static/index/mapicon.png' +import geoJson from "/static/jsonData/xuantan.js" +const u = 'https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231129\/202311291816106120a4034.png' + const icon = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231204\/202312041608529c9e21252.png" + +const pointerFn = () => { + + // console.log() + let list = [] + geoJson.center.forEach((item, index) => { + + list.push({ + coord: item, + symbol: ('image://' + icon),// 自定义图片路径 + symbolSize: [100, 30], // 图片大小 + symbolOffset: ['50%', '-50%'], + value: geoJson.features[index].properties.name, + animation: true, + label: { + show: true, + color: 'white', + fontSize: 14, + }, + },) + }) + return list +} +// pointerFn() onMounted(() => { - const u = 'https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231129\/202311291816106120a4034.png' - - - axios.get('https://geo.datav.aliyun.com/areas_v3/bound/510500_full.json') - - - axios.get('https://geo.datav.aliyun.com/areas_v3/bound/510000_full.json') - .then(function (response) { - let geoJson = response.data - const dot = document.getElementById('img') var mapName = 'lz'; - let data = [ - ] const myChart = document.getElementById("chart2") /*获取地图数据*/ - - let option = { - - - geo: [ + + { - layoutSize: '100%',//大小 + type: "map", + map: mapName, + aspectScale: 1, + zoom: 1.2, + layoutCenter: ["50%", "51%"], + layoutSize: "100%", + roam: false, + label:{ + emphasis:{ + show:false + } + }, show: true, map: mapName, - - roam: false, zoom: 1.2, - layoutCenter: ["50%", "50%"], aspectScale: 1, - label: { - normal: { - show: false, - textStyle: { - color: '#fff' - } - }, - - }, + roam: false, itemStyle: { - areaColor: { - type: "linear", - x: 0, - y: 0, - x2: 0, - y2: 0, - colorStops: [{ - offset: 0, - color: "rgba(3,27,78,0.75)", // 0% 处的颜色 - }, { - offset: 1, - color: "rgba(58,149,253,0.75)", // 50% 处的颜色 - },], - global: true, // 缺省为 false + normal: { + areaColor: 'transparent', + }, - borderColor: "#D2F2FC", - borderWidth: 2, - shadowColor: "#8cd3ef", - shadowOffsetY: 10, - shadowBlur: 120, + emphasis: { + + areaColor: { + type: 'radial', // linear 线性渐变 radial径向渐变 + x: 0.5, // 0.5为正中心,如果小于渐变中心靠左 + y: 0.5, // 0.5为正中心,如果小于渐变中心靠上 + r: 1, + colorStops: [ + { + offset: 0, color: '#A46759' // 0% 处的颜色 + }, + { + offset: 0.1, color: '#A46759' // 0% 处的颜色 + }, + + + { + offset: 1, color: '#FFB821' // 100% 处的颜色 + }], + + } + + + // borderWidth: 0 + } + }, + }, @@ -125,20 +147,7 @@ onMounted(() => { layoutSize: "100%", roam: false, silent: true, - regions: [ - { - name: "南海诸岛", - itemStyle: { - // 隐藏地图 - normal: { - opacity: 0, // 为 0 时不绘制该图形 - } - }, - label: { - show: false // 隐藏文字 - } - } - ], + itemStyle: { normal: { borderWidth: 1, @@ -153,8 +162,6 @@ onMounted(() => { }, - - { type: "map", map: mapName, @@ -178,13 +185,15 @@ onMounted(() => { }, }, }, + + { type: "map", map: mapName, zlevel: -2, aspectScale: 1, zoom: 1.2, - layoutCenter: ["50%", "52%"], + layoutCenter: ["50%", "53%"], layoutSize: "100%", roam: false, silent: true, @@ -202,66 +211,17 @@ onMounted(() => { }, }, - // { - // type: "map", - // map: mapName, - // zlevel: -3, - // aspectScale: 1, - // zoom: 1.2, - // layoutCenter: ["50%", "53%"], - // layoutSize: "101%", - // roam: false, - // silent: true, - // regions: [ - // { - // name: "南海诸岛", - // itemStyle: { - // // 隐藏地图 - // normal: { - // opacity: 0, // 为 0 时不绘制该图形 - // } - // }, - // label: { - // show: false // 隐藏文字 - // } - // } - // ], - // itemStyle: { - // normal: { - // borderWidth: 1, - // // borderColor: "rgba(11, 43, 97,0.8)", - // borderColor: "rgba(58,149,253,0.4)", - // shadowColor: "rgba(58,149,253,1)", - // shadowOffsetY: 15, - // shadowBlur: 10, - // areaColor: "transpercent", - // }, - // }, - // }, { type: "map", map: mapName, zlevel: -4, aspectScale: 1, zoom: 1.2, - layoutCenter: ["50%", "53%"], + layoutCenter: ["50%", "54%"], layoutSize: "100%", roam: false, silent: true, - regions: [ - { - name: "南海诸岛", - itemStyle: { - // 隐藏地图 - normal: { - opacity: 0, // 为 0 时不绘制该图形 - } - }, - label: { - show: false // 隐藏文字 - } - } - ], + itemStyle: { normal: { borderWidth: 5, @@ -280,63 +240,54 @@ onMounted(() => { ], series: [ { - type: 'map', - map: mapName, - geoIndex: 0, - aspectScale: 1, //长宽比 - - showLegendSymbol: true, - roam: true, - label: { - show: true, - position: "top", - distance: -10, - formatter(params) { - return "2"; - }, - - textStyle: { - // color: "transparent", - padding: [15, 20], - backgroundColor: { - image: '/static/index/aa.png', - }, - // backgroundColor:"" - }, - }, - - - - animation: true, - markPoint: { - symbol: "none" + name: '资产数', + type: 'effectScatter', + coordinateSystem: 'geo', + rippleEffect: { + period: 4, //动画时间,值越小速度越快 + brushType: 'fill', //波纹绘制方式 stroke, fill + scale: 12, //波纹圆环最大限制,值越大波纹越大 + number: 2, }, - data: data, + + // 发散点的大小 + symbolSize: function (val) { + return 4 + // return val[2] / 10; + }, + markPoint: { + data:pointerFn() + }, + + data: (() => { + let data = { + 资产数: geoJson.center + + } + let finalData = [] + Object.keys(data).map((i, index) => { + let child = data[i].map((row) => ({ + value: row, + itemStyle: { + color: '#FFB922', + }, + })) + + finalData = [...finalData, ...child] + }) + return finalData + })(), }, - - ], }; - - - echarts.registerMap(mapName, geoJson) const bg = echarts.init(myChart) bg.setOption(option); - - - - - - - }) -}) - diff --git a/src/view/detail.vue b/src/view/detail.vue index 7e54c88..dc37c87 100644 --- a/src/view/detail.vue +++ b/src/view/detail.vue @@ -282,7 +282,8 @@ const test = () => { } onMounted(() => { - + document.getElementById("online").removeAttribute('_echarts_instance_'); + document.getElementById("offline").removeAttribute('_echarts_instance_'); initCharts('online', options.onLine) initCharts('offline', options.offLine) diff --git a/src/view/index.vue b/src/view/index.vue index 22f283a..ba1cc83 100644 --- a/src/view/index.vue +++ b/src/view/index.vue @@ -10,7 +10,6 @@
-
@@ -21,7 +20,6 @@
-
在线设备统计:45454
- -
- -
@@ -70,12 +64,12 @@
- 张伟
- 这是一名后端开发
@@ -173,7 +167,6 @@ const config3 = reactive({ ] }) - // 图表 const initCharts = (tag, option) => { var chartDom = document.getElementById(tag); @@ -181,9 +174,7 @@ const initCharts = (tag, option) => { myChart.setOption(option); } const ChildsDom = ref(null); - const showWarnPop = ref(false) - const hdClick = (e) => { // console.log(e) if (e.ceil) { @@ -192,7 +183,6 @@ const hdClick = (e) => { } } } - const showWarnDeatil = ref(false) const hdClick3 = (e) => { if (e.ceil) { @@ -203,7 +193,6 @@ const hdClick3 = (e) => { } } - const test = () => { router.replace('/detail') } @@ -221,7 +210,8 @@ const scrollTableFn = () => { } onMounted(() => { - + document.getElementById("online").removeAttribute('_echarts_instance_'); + document.getElementById("offline").removeAttribute('_echarts_instance_'); scrollTableFn() initCharts('online', options.onLine) initCharts('offline', options.offLine) diff --git a/static/index/JS.png b/static/index/JS.png new file mode 100644 index 0000000000000000000000000000000000000000..e18f674b6b48f7db55e51211fc5467693679fb4f GIT binary patch literal 2962 zcmV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