Commit f1f901a3 authored by 郭铭瑶's avatar 郭铭瑶 🤘

更新

parent 634a6357
...@@ -62,16 +62,21 @@ export default { ...@@ -62,16 +62,21 @@ export default {
options.yAxis = Object.assign(this.defaultOptions.yAxis, this.options.yAxis) options.yAxis = Object.assign(this.defaultOptions.yAxis, this.options.yAxis)
options.series = this.data.map((item, index) => { options.series = this.data.map((item, index) => {
let color = colors[index] let color = colors[index]
if (Array.isArray(color)) { let shadow = {}
if (Array.isArray(color)) { // 如果颜色是数组则渐变
color = new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [ color = new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0, color: color[0]}, {offset: 0, color: color[0]},
{offset: 1, color: color[1]} {offset: 1, color: color[1]}
]) ])
shadow = {
shadowColor: '#0076FF',
shadowBlur: 6,
}
} }
const result = { const result = {
name: item.name, name: item.name,
barWidth: '50%', barWidth: '50%',
itemStyle: { color }, itemStyle: { color, ...shadow },
data: item.data || [] data: item.data || []
} }
if (this.options.series) { if (this.options.series) {
......
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
const Main = () => import('@/views/main') // const Main = () => import('@/views/project-management/main')
const ChinaMap = () => import('@/views/china') // const ChinaMap = () => import('@/views/china')
const GDProduction = () => import('@/views/guangdong/gd-production') // const MapTest = () => import('@/views/map-test')
const GDTrade = () => import('@/views/guangdong/gd-trade') const GDProduction = () => import('@/views/guangdong/gd-production') // 广东 - 生产专题
const GDDisease = () => import('@/views/guangdong/gd-disease') const GDTrade = () => import('@/views/guangdong/gd-trade') // 广东 - 交易专题
const GDFish = () => import('@/views/guangdong/gd-fish') const GDDisease = () => import('@/views/guangdong/gd-disease') // 广东 - 疫病专题
const GDIndustry = () => import('@/views/guangdong/gd-industry') const GDFish = () => import('@/views/guangdong/gd-fish') // 广发 - 罗非鱼专题
const MapTest = () => import('@/views/map-test') const GDIndustry = () => import('@/views/guangdong/gd-industry') // 广东 - 产业分析专题
const Map3D = () => import('@/views/3d-map') const Map3D = () => import('@/views/3d-map') // 浦东 - 街镇电梯地图
Vue.use(Router) Vue.use(Router)
...@@ -44,6 +44,11 @@ export default new Router({ ...@@ -44,6 +44,11 @@ export default new Router({
name: 'industry', name: 'industry',
component: GDIndustry component: GDIndustry
}, },
{
path: '/map3d',
name: 'map3d',
component: Map3D
},
// { // {
// path: '/main', // path: '/main',
// name: 'main', // name: 'main',
...@@ -59,10 +64,5 @@ export default new Router({ ...@@ -59,10 +64,5 @@ export default new Router({
// name: 'map2', // name: 'map2',
// component: MapTest // component: MapTest
// }, // },
{
path: '/map3d',
name: 'map3d',
component: Map3D
},
] ]
}) })
...@@ -63,15 +63,18 @@ export default { ...@@ -63,15 +63,18 @@ export default {
resizeEnable: true, resizeEnable: true,
rotateEnable:true, rotateEnable:true,
pitchEnable:true, pitchEnable:true,
showLabel: false, showLabel: true,
zoom: 17, zoom: 17,
pitch:50, pitch:50,
rotation:45, rotation:45,
viewMode:'3D',//开启3D视图,默认为关闭 viewMode:'3D',//开启3D视图,默认为关闭
buildingAnimation:true,//楼块出现是否带动画 buildingAnimation:true,//楼块出现是否带动画
expandZoomRange:true, expandZoomRange:true,
zooms:[15,20], // zooms:[17,20],
center:[121.497915,31.218138], // 黄浦 zooms: [10,20],
// center:[121.497915,31.218138], // 黄浦
// center: [121.558,31.0727], //航头镇
center: [121.502, 31.1956], //南码头
showIndoorMap:false, showIndoorMap:false,
// mapStyle:'amap://styles/light', // mapStyle:'amap://styles/light',
...@@ -129,6 +132,31 @@ export default { ...@@ -129,6 +132,31 @@ export default {
const location = [e.lnglat.getLng(), e.lnglat.getLat()] const location = [e.lnglat.getLng(), e.lnglat.getLat()]
this.showDetail(e, location, marker.getExtData()) this.showDetail(e, location, marker.getExtData())
}) })
const searcher = new AMap.DistrictSearch({
level: 'district',
subdistric: 1,
})
searcher.search('浦东新区', (status, result) => {
console.log('---浦东新区街镇---', result.districtList[0].districtList)
})
// new AMap.DistrictSearch({
// level: 'district',
// extensions: 'all',
// subdistric: 1,
// }).search('浦东新区', (staus, result) => {
// var bounds = result.districtList[0].boundaries
// var polygon = new AMap.Polygon({
// strokeWeight: 1,
// path: bounds[0],
// fillOpacity: 0.4,
// fillColor: '#80d8ff',
// strokeColor: '#0091ea'
// })
// this.map.add([polygon])
// })
}, },
showDetail(e, location, data) { showDetail(e, location, data) {
// TODO // TODO
......
...@@ -115,6 +115,7 @@ export default { ...@@ -115,6 +115,7 @@ export default {
}, },
getOptions(data) { getOptions(data) {
return { return {
colors: [['#1FECFF', '#0076FF']],
xAxis: { xAxis: {
data: this.fishChartData.name, data: this.fishChartData.name,
}, },
...@@ -124,14 +125,6 @@ export default { ...@@ -124,14 +125,6 @@ export default {
series: { series: {
type: 'bar', type: 'bar',
barWidth: '40%', barWidth: '40%',
itemStyle: {
shadowColor: '#0076FF',
shadowBlur: 6,
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0, color: '#1FECFF'},
{offset: 1, color: '#0076FF'}
])
},
} }
} }
}, },
......
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
specialProduction: [], specialProduction: [],
cityData: [], cityData: [],
options: { options: {
colors: [['#1FECFF', '#B645FF']],
xAxis: { xAxis: {
data: [], data: [],
}, },
...@@ -55,14 +56,6 @@ export default { ...@@ -55,14 +56,6 @@ export default {
series: { series: {
type: 'bar', type: 'bar',
barWidth: '40%', barWidth: '40%',
itemStyle: {
shadowColor: '#0076FF',
shadowBlur: 6,
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{offset: 0, color: '#1FECFF'},
{offset: 1, color: '#B645FF'}
])
},
} }
}, },
data: [], data: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment