Commit 4b78c1d1 by liwk

commit

1 parent 0470aa39
Showing 64 changed files with 1036 additions and 410 deletions
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"echarts-gl": "^1.1.1",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-axios": "^2.1.5", "vue-axios": "^2.1.5",
...@@ -26,11 +27,6 @@ ...@@ -26,11 +27,6 @@
"compression-webpack-plugin": "^3.0.0", "compression-webpack-plugin": "^3.0.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"postcss-aspect-ratio-mini": "^1.0.1",
"postcss-px-to-viewport": "^1.1.0",
"postcss-pxtorem": "^4.0.1",
"postcss-viewport-units": "^0.1.6",
"postcss-write-svg": "^3.0.1",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"uglifyjs-webpack-plugin": "^2.1.3", "uglifyjs-webpack-plugin": "^2.1.3",
"vue-template-compiler": "^2.6.10", "vue-template-compiler": "^2.6.10",
...@@ -50,27 +46,6 @@ ...@@ -50,27 +46,6 @@
"parser": "babel-eslint" "parser": "babel-eslint"
} }
}, },
"postcss": {
"plugins": {
"autoprefixer": {},
"postcss-aspect-ratio-mini": {},
"postcss-write-svg": {
"utf8": false
},
"postcss-px-to-viewport": {
"viewportWidth": 3066,
"unitPrecision": 5,
"selectorBlackList": [
".ignore",
".不转换的类名"
],
"viewportUnit": "vw",
"minPixelValue": 1,
"mediaQuery": false
},
"postcss-viewport-units": {}
}
},
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"type":"FeatureCollection","features":[{"id":"820001","geometry":{"type":"Polygon","coordinates":["@@LADC^umZ@DONWEBDCLHBH@DFBBNA"],"encodeOffsets":[[116285,22746]]},"properties":{"cp":[113.5528956,22.20787],"name":"花地瑪堂區","childNum":1}},{"id":"820002","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFHE"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.5489608,22.1992075],"name":"花王堂區","childNum":1}},{"id":"820003","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.5501828,22.19372083],"name":"望德堂區","childNum":1}},{"id":"820004","geometry":{"type":"Polygon","coordinates":["@@ŸYIPEL@JFCBBFADHDBBFDHIJJEFDPCHHlY"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.5536475,22.18853944],"name":"大堂區","childNum":1}},{"id":"820005","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDP^"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.5419278,22.18736806],"name":"風順堂區","childNum":1}},{"id":"820006","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@IN"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.5587044,22.15375944],"name":"嘉模堂區","childNum":1}},{"id":"820007","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBCDB@BFDDC"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.5695992,22.13663],"name":"路氹填海區","childNum":1}},{"id":"820008","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNP"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.5599542,22.12348639],"name":"聖方濟各堂區","childNum":1}}],"UTF8Encoding":true}
\ No newline at end of file \ No newline at end of file
{
"type": "FeatureCollection",
"features": [{
"id": "820001",
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
["@@LADC^umZ@DONWE@DALBBF@H@DFBBTC"],
["@@P@LC@AGM@OECMBABBTCD@DDH"]
],
"encodeOffsets": [
[
[116285, 22746]
],
[
[116303, 22746]
]
]
},
"properties": { "cp": [113.552965, 22.207882], "name": "花地玛堂区", "childNum": 2 }
}, {
"id": "820002",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@MK@CA@AAGDEB@NVFJG"],
"encodeOffsets": [
[116281, 22734]
]
},
"properties": { "cp": [113.549052, 22.199175], "name": "花王堂区", "childNum": 1 }
}, {
"id": "820003",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@EGOB@DNLHE@C"],
"encodeOffsets": [
[116285, 22729]
]
},
"properties": { "cp": [113.550252, 22.193791], "name": "望德堂区", "childNum": 1 }
}, {
"id": "820004",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@ŸYMVAN@BFCBBDAFHDBBFDHIJJEFDPCHHlYJQ"],
"encodeOffsets": [
[116313, 22707]
]
},
"properties": { "cp": [113.55374, 22.188119], "name": "大堂区", "childNum": 1 }
}, {
"id": "820005",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@JICGAECACGEBAAEDBFNXB@"],
"encodeOffsets": [
[116266, 22728]
]
},
"properties": { "cp": [113.54167, 22.187778], "name": "风顺堂区", "childNum": 1 }
}, {
"id": "820006",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@INEL"],
"encodeOffsets": [
[116265, 22694]
]
},
"properties": { "cp": [113.558783, 22.154124], "name": "嘉模堂区", "childNum": 1 }
}, {
"id": "820007",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBC@@FB@BDDDA\\M"],
"encodeOffsets": [
[116316, 22676]
]
},
"properties": { "cp": [113.56925, 22.136546], "name": "路凼填海区", "childNum": 1 }
}, {
"id": "820008",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": ["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNPZK"],
"encodeOffsets": [
[116329, 22670]
]
},
"properties": { "cp": [113.559954, 22.124049], "name": "圣方济各堂区", "childNum": 1 }
}],
"UTF8Encoding": true
}
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.

225 KB | W: | H:

103 KB | W: | H:

src/assets/title-bg.png
src/assets/title-bg.png
src/assets/title-bg.png
src/assets/title-bg.png
  • 2-up
  • Swipe
  • Onion skin
<template> <template>
<div class='box'> <div class='box'>
<div class="box-left-top top"></div> <div class="box-title">
<div class="box-right-top top"></div> <div class='box-title-arrow'></div>
<div class="box-right-bottom bottom"></div> <div class='box-title-name'>
<div class="box-left-bottom bottom"></div> <slot name="title"></slot>
<!-- <div class="box-cap"> </div>
<div class="top-box"></div> </div>
<div class="bottom-box"></div>
</div> -->
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
...@@ -26,105 +24,33 @@ export default { ...@@ -26,105 +24,33 @@ export default {
.box { .box {
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: rgba(0, 0, 0, 0.07); color: #fff;
border: 1px solid rgba(19, 107, 153, 0.5); background: url("~@a/box-bottom.png") no-repeat;
background-size: 100% 76px;
background-position-y: bottom;
position: relative; position: relative;
&-title {
&-left-top, height: 125px;
&-left-bottom,
&-right-top,
&-right-bottom {
width: 29px;
height: 28px;
background-size: cover;
position: absolute;
background-repeat: no-repeat;
z-index: 10;
background-image: url("~@a/l-t.png");
}
&-left-top {
left: -3px;
top: -1px;
// animation: topMove 2s forwards;
}
&-left-bottom {
left: -3px;
bottom: -1px;
transform: rotate(-90deg);
// animation: bottomMove 2s forwards;
}
&-right-top {
top: -1px;
right: -3px;
transform: rotate(90deg);
// animation: topMove 2s forwards;
}
&-right-bottom {
bottom: -1px;
right: -3px;
transform: rotate(180deg);
// animation: bottomMove 2s forwards;
}
}
@keyframes topMove {
from {
top: 50%;
}
to {
top: -1px;
}
}
@keyframes bottomMove {
from {
bottom: 50%;
}
to {
bottom: -1px;
}
}
.box-cap {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
overflow: hidden;
z-index: 1;
.top-box,
.bottom-box {
width: 100%; width: 100%;
height: 50%; background: url("~@a/box-top.png") no-repeat;
position: absolute; background-size: 100% 100%;
left: 0; position: relative;
background: #000; box-sizing: border-box;
} padding: 40px 0 0 44px;
.top-box { &-arrow {
top: 0; float: left;
// animation: topHidden 2s forwards; width: 20px;
} height: 32px;
.bottom-box { background: url("~@a/arrow.png") no-repeat;
bottom: 0; background-size: cover;
// animation: bottomHidden 2s forwards; transform: translateY(6px);
} }
} &-name {
@keyframes topHidden { float: left;
from { padding-left: 30px;
top: 0; font-size: 34px;
opacity: 1; letter-spacing: 8px;
} }
to {
opacity: 0.2;
top: -50%;
}
}
@keyframes bottomHidden {
from {
opacity: 1;
bottom: 0;
}
to {
opacity: 0.2;
bottom: -50%;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div class='count-box'>
<div
v-for='(i,index) in numbers'
:key='index'
class='count-item'
>
<div
class='number-box'
:style="{'top':`-${i * 100}%`}"
>
<div
v-for='(n,ind) in num'
:key='ind'
>{{n}}</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import countTo from "vue-count-to"
export default {
name: 'Count',
components: {
countTo
},
props: {
number: {
type: Number,
default: 11
}
},
data () {
return {
numbers: [],
num: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}
},
methods: {
},
watch: {
'number' (newVal, oldVal) {
if (newVal) {
newVal = newVal.toString().split('')
this.numbers = []
this.setNumber(newVal)
}
}
},
mounted () {
this.number = this.number.toString().split('')
this.setNumber(this.number)
},
methods: {
setNumber (data) {
data.forEach(e => {
this.numbers.push(
Number(e)
)
})
}
}
}
</script>
<style scoped lang='scss'>
.count-box {
text-align: center;
padding-top: 15px;
margin-bottom: 61px;
font-size: 0;
.count-item {
display: inline-block;
width: 94px;
height: 150px;
line-height: 150px;
font-size: 80px;
margin-right: 5px;
font-weight: 700;
background: url("~@a/count-box.png") no-repeat;
background-size: cover;
position: relative;
overflow: hidden;
.number-box {
position: absolute;
width: 100%;
height: 100%;
left: 0;
transition: all 0.1s;
}
}
}
.count-item:last-of-type {
margin-right: 0;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class='gl-line-bar'>
<slot></slot>
<div
ref='canvas'
class="l-b-box"
></div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'gl-line-bar',
data () {
return {
canvas: null,
index: 6
}
},
props: {
data: null,
days: Array,
type: {
type: String,
default: 'line'
},
color: null,
dotColor: null,
dotBorderColor: null,
haveLine: null,
speed: {
type: Number,
default: 5
}
},
watch: {
'days' (newVal, oldVal) {
if (newVal) {
this.createdCanvas()
}
}
},
mounted () {
},
methods: {
createdCanvas () {
let days = []
let data = []
for (let i = 0; i < this.index; i++) {
days.push(this.days[i])
data.push(this.data[i])
}
let canvas = echarts.init(this.$refs.canvas)
let options = {
xAxis: {
type: 'category',
data: days,
axisLabel: {
show: true,
margin: 33,
textStyle: {
color: '#8e99a6',
fontSize: 18,
},
},
axisTick: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: '#2d99ba'
}
},
},
grid: {
top: '95px',
left: '64.5px',
right: '64.5px',
bottom: '103px',
},
yAxis: {
type: 'value',
nameTextStyle: {
color: '#fff'
},
nameLocation: 'middle',
axisTick: { show: false },
axisLabel: { show: false },
axisLine: { show: false },
splitLine: {
show: true,
lineStyle: {
color: 'rgba(45,153,186,0.2)'
}
}
},
series: [
{
data: data,
name: '出行次数',
type: this.type,
barWidth: '60px',
smooth: true,
symbol: 'circle',
symbolSize: 14,
label: {
color: '#fff',
fontSize: 26,
position: 'top',
offset: [0, -5],
show: true
},
lineStyle: {
width: 8,
color: `rgb(${this.color})`
},
areaStyle: {
color: this.type == 'bar' ? null : {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0, color: `rgba(${this.color},0.4)`, // 0% 处的颜色
}, {
offset: 1, color: 'rgba(0, 0, 0, 0)' // 100% 处的颜色
}]
}
},
itemStyle: {
normal: {
color: this.type == 'bar' ? new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{
offset: 0,
color: '#0DFF85'
},
{
offset: 1,
color: '#0070FB'
}
]) : this.dotColor,
borderWidth: this.type != 'bar' ? 16 : 0,
borderColor: `rgba${this.dotBorderColor}`
}
}
}
]
}
if (this.type != 'bar') {
options.series.push({
type: "bar",
barWidth: 1,
itemStyle: {
borderColor: `rgb(${this.color})`,
opacity: 0.18,
borderWidth: 1,
borderType: 'dashed'
},
barGap: '-100%',
z: 0,
data: data
})
}
canvas.setOption(options)
setInterval(() => {
this.moveCanvas(options, canvas)
}, this.speed * 1000)
},
moveCanvas (options, canvas) {
let index = this.index
let days = []
let data = []
if (index > this.days.length) {
index = 6
for (let i = 0; i < index; i++) {
days.push(this.days[i])
data.push(this.data[i])
}
} else {
++index
for (let i = index - 6; i < index - 1; i++) {
days.push(this.days[i])
data.push(this.data[i])
}
}
if (this.type != 'bar') {
options.series[1].data = data
}
options.xAxis.data = days
options.series[0].data = data
canvas.setOption(options)
this.index = index
}
},
}
</script>
<style scoped lang='scss'>
.gl-line-bar {
width: 100%;
height: calc(100% - 82px);
position: relative;
}
.l-b-box {
height: 100%;
}
.l-b-border {
position: absolute;
right: 23px;
top: 50%;
transform: translateY(-50%);
width: 2px;
height: 86%;
background: rgba($color: #336aa0, $alpha: 0.2);
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -5,166 +5,116 @@ ...@@ -5,166 +5,116 @@
ref="map" ref="map"
> >
</div> </div>
<div
class='back'
v-show="mapName!='china'"
@click='back'
></div>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import countTo from "vue-count-to"
import china from '@p/map/china.json' import china from '@p/map/china.json'
import axios from 'axios' import axios from 'axios'
import "echarts-gl"
import { request } from 'https'
export default { export default {
name: 'GlMap', name: 'GlMap',
data () { data () {
return { return {
mapName: 'china', mapName: 'china',
map: null, map: null,
timeTicket: null, options: {
count: 0,
}
},
mounted () {
this.chinaConfigure(this.mapName, china)
},
methods: {
back () {
this.mapName = 'china'
this.map.clear()
this.chinaConfigure(this.mapName, china)
},
chinaConfigure (mapName, data) {
echarts.registerMap(mapName, data)
this.map = echarts.init(this.$refs.map)
window.onresize = this.map.resize
let options = {
tooltip: { tooltip: {
padding: 0, position: 'top',
enterable: true,
transitionDuration: 1,
textStyle: {
color: '#fff',
decoration: 'none',
},
alwaysShowContent: true,
formatter: params => {
let tipHtml = `<div class='map-tooltip'>
<p class='map-tooltip-title'>
<i class='address'></i>
${params.name}
</p>
<div class='map-item'>
<div class='map-list map-border' >
${params.value ? params.value : 0}
<p class='map-tooltip-name' >用户总数</p>
</div>
<div class='map-list map-left' >
854
<p class='map-tooltip-name' >当前在线用户数</p>
</div>
</div>
</div>`
return tipHtml
}
},
visualMap: {
min: 0,
max: 100,
left: '13%',
bottom: '4.5%',
orient: 'horizontal',
itemWidth: '5',
itemHeight: '100',
text: [100, 0],
inRange: {
color: ['#1DE6EE', '#0B7FE1']
},
textStyle: {
color: '#F9F9F9',
fontSize: 10
}
},
animationDuration: 5000,
animationEasing: 'cubicOut',
animationDurationUpdate: 5000,
geo: {
show: true,
label: {
show: mapName == 'china',
align: 'center',
color: '#333',
verticalAlign: 'middle',
},
map: mapName,
zoom: mapName == 'china' ? 1 : 0.8,
top: mapName == '广东' ? '0' : mapName == '甘肃' ? '20%' : 'middle',
left: mapName == '甘肃' ? '25%' : 'center',
}, },
series: [ series: [
{ {
type: 'map', type: 'map3D',
geoIndex: 0, name: 'china',
data: [ selectedMode: "single",//地图高亮单选
{ boxDepth: 90,//地图倾斜度
name: '广东', regionHeight: 8,//地图高度
value: 100 map: 'china',
itemStyle: {
color: "#40a7ee",
borderWidth: 1,//分界线wdith
borderColor: "#6ce3ec",//分界线颜色
},
label: {
show: true,
textStyle: {
color: '#fff',
fontSize: 16,
backgroundColor: 'rgba(0,0,0,0)'
}
},
emphasis: {
label: {
show: true,//是否显示高亮
textStyle: {
color: '#fff',//高亮文字颜色
}
}, },
{ itemStyle: {
name: '上海', color: '#ffd900',//地图高亮颜色
value: 10 }
},
light: { //光照阴影
main: {
color: '#fff', //光照颜色
intensity: 0.855, //光照强度
shadow: false, //是否显示阴影
alpha: 55,
beta: 10
}, },
{ ambient: {
name: '北京', intensity: 0.3
value: 30
} }
] },
viewControl: {
alpha: 40,
beta: 0,
maxAlpha: 45,
animationDurationUpdate: 3000
}
} }
] ]
} }
console.log(options) }
this.map.setOption(options) },
let dataLength = options.series[0].data.length mounted () {
this.map.on('click', val => { this.map = echarts.init(this.$refs.map)
if (this.mapName == 'china' && val.name != '南海诸岛') { this.map.showLoading()
this.map.clear() this.chinaConfigure(this.mapName, china)
this.mapName = val.name this.map.on('click', even => {
axios.get(`/map/province/${val.name}.json`).then(res => { console.log(even)
this.chinaConfigure(val.name, res.data) if (this.mapName == 'china') {
}) this.$refs.map.classList.add('test')
}
})
this.mapName = even.name
axios.get(`/map/province/${even.name}.json`).then(res => {
this.map.clear()
this.chinaConfigure(even.name, res.data)
this.map.on('mouseover', val => {
clearInterval(this.timeTicket)
})
this.map.on('mouseout', val => {
this.mapTooltipMove(dataLength, this.map)
})
this.mapTooltipMove(dataLength, this.map)
},
mapTooltipMove (dataLength, map) {
this.timeTicket && clearInterval(this.timeTicket)
this.timeTicket = setInterval(_ => {
map.dispatchAction({
type: 'downplay',
seriesIndex: 0,
}) })
map.dispatchAction({ }
type: 'highlight', })
seriesIndex: 0, },
dataIndex: (this.count) % dataLength methods: {
}) chinaConfigure (mapName, data) {
map.dispatchAction({ this.map.hideLoading()
type: 'showTip', echarts.registerMap(mapName, data)
seriesIndex: 0, window.onresize = this.map.resize
dataIndex: (this.count) % dataLength let options = this.options
}) options.series[0].name = options.series[0].map = mapName
this.count++ this.map.setOption(options)
}, 3000) setTimeout(() => {
if (this.mapName != 'china') {
this.$refs.map.classList.add('test1')
}
}, 500)
setInterval(() => {
let num = Math.floor(Math.random() * (80 - 1)) + 1
options.series[0].viewControl.alpha = num
options.series[0].viewControl.beta = num
this.map.setOption(options)
}, 5000)
} }
} }
} }
...@@ -203,4 +153,26 @@ export default { ...@@ -203,4 +153,26 @@ export default {
z-index: 10; z-index: 10;
cursor: pointer; cursor: pointer;
} }
.test {
animation: a 0.5s forwards;
}
.test1 {
animation: identifier 0.5s forwards;
}
@keyframes a {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes identifier {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class='header'> <div class='header'>
<div class="header-bg"></div> <h1>广联用户总数</h1>
<slot></slot> <div>
<slot></slot>
</div>
</div> </div>
</template> </template>
...@@ -17,34 +19,27 @@ export default { ...@@ -17,34 +19,27 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.header { .header {
position: relative; position: absolute;
width: 100%; top: 0;
height: 132px; left: 50%;
line-height: 132px; transform: translateX(-50%);
font-size: 48px; width: 1565px;
height: 187px;
font-size: 70px;
font-weight: bold;
color: #ffffff; color: #ffffff;
letter-spacing: 8px; letter-spacing: 8px;
text-align: center; text-align: center;
background: url("~@a/title-bg.png") no-repeat;
&-bg { background-size: cover;
position: absolute; background-position-x: center;
width: 100%; z-index: 3;
height: 100%; h1 {
top: 0; padding: 27px 0 0;
left: 50%; font-size: 30px;
transform: translateX(-50%);
// animation: move 3.5s ease-out forwards;
background: url("~@a/title-bg.png") no-repeat;
background-size: cover;
background-position-x: center;
}
}
@keyframes move {
from {
width: 0;
} }
to { div {
width: 100%; transform: translateY(-6px);
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div class='rose'>
<div
class="rose-canvas"
ref='data'
></div>
<div class='rose-title'>
<slot></slot>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Rose',
props: {
data: null
},
data () {
return {
roseColors: ['#773ae6', '#372ef0', '#5242f3', '#0060ff', '#0096ff', '#00e5dd', '#36a8ff', '#0078f4']
}
},
mounted () {
this.createdCanvas()
},
methods: {
createdCanvas () {
let roseColors = []
let data = this.data.sort(function (a, b) {
return a.value - b.value
})
data.forEach((e, i) => {
roseColors.push(this.roseColors[8 - data.length + i])
})
let canvas = echarts.init(this.$refs.data)
let options = {
series: [{
type: 'pie',
radius: '65%',
center: ['50%', 120],
color: roseColors,
data: data,
roseType: 'radius',
label: {
normal: {
show: false,
formatter: ['{b|{b}}', '{c|{c}}'].join('\n'),
rich: {
c: {
color: '#fff',
fontSize: 16,
},
b: {
color: '#fff',
fontSize: 16,
},
},
}
},
labelLine: {
normal: {
lineStyle: {
color: '#fff',
},
smooth: 0.1,
length: 1,
length2: 14,
}
},
itemStyle: {
normal: {
shadowColor: 'rgba(0,0,0,0.5)',
shadowBlur: 50,
}
}
}]
}
canvas.on('mouseover', params => {
options.series[0].data[params.dataIndex].labelLine = options.series[0].data[params.dataIndex].label = {
normal: {
show: true
}
}
canvas.setOption(options)
})
canvas.on('mouseout', params => {
options.series[0].data[params.dataIndex].label = options.series[0].data[params.dataIndex].labelLine = {
normal: {
show: false
}
}
})
canvas.setOption(options)
}
}
}
</script>
<style scoped lang='scss'>
.rose {
float: left;
width: 50%;
height: 50%;
position: relative;
&-canvas {
width: 100%;
height: 100%;
}
&-title {
position: absolute;
left: 0;
bottom: 38px;
width: 100%;
text-align: center;
font-size: 24px;
color: #8e99a6;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -18,18 +18,23 @@ export default { ...@@ -18,18 +18,23 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.title { .title {
width: 100%; width: 100%;
padding: 30px;
box-sizing: border-box; box-sizing: border-box;
font-size: 20px; font-size: 34px;
color: #ffffff; color: #ffffff;
letter-spacing: 4px; letter-spacing: 4px;
height: 82px;
line-height: 82px;
position: relative;
text-indent: 82px;
i { i {
display: inline-block; position: absolute;
height: 20px; left: 38px;
width: 5px; top: 50%;
background: #28c5ff; transform: translateY(-50%);
margin-right: 20px; width: 20px;
vertical-align: middle; height: 32px;
background: url("~@a/arrow.png") no-repeat;
background-size: cover;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div class='user-box'>
<div class="user-title">
<div>
<img src="~@a/man.png">
男
<span>{{list.man.percent}}</span>
</div>
<div style="padding-left:130px;">
<img src="~@a/women.png">
女
<span>{{list.women.percent}}</span>
</div>
</div>
<div
class='user-data'
ref='data'
>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'User',
data () {
return {
labelData: ['00后', '90后', '80后', '70后', '60后']
}
},
props: {
list: null
},
mounted () {
this.createdCanvas()
},
methods: {
createdCanvas () {
let manData = []
this.list.man.data.forEach(e => {
manData.push(e * -1)
})
let canvas = echarts.init(this.$refs.data)
let options = {
xAxis: [{
type: 'value',
min: -100,
max: 0,
gridIndex: 0,
axisTick: { show: false, inside: false },
axisLabel: { show: false },
axisLine: {// Y轴轴线样式
show: false,
},
splitLine: {
show: false
}
},
{
gridIndex: 1,
show: false,
}, {
type: 'value',
gridIndex: 2,
min: 0,
max: 100,
axisTick: { show: false }, //是否显示刻度
axisLine: { show: false, },
axisLabel: { show: false },
splitLine: { show: false }
}],
yAxis: [{
type: 'category',
gridIndex: 0,
inverse: true,
data: this.labelData,
axisTick: { show: false },
axisLabel: { show: false },
axisLine: { show: false }
},
{
gridIndex: 1,
type: 'category',
inverse: true,
position: 'left',
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: true,
textStyle: {
color: '#ffffff',
fontSize: 26,
},
},
data: this.labelData
}, {
type: 'category',
gridIndex: 2,
inverse: true,
data: this.labelData,
axisTick: { show: false },
axisLabel: {
show: false,
textStyle: {
fontSize: 20,
color: '#ffffff',
}
},
axisLine: {
show: false //是否显示轴线
}
}
],
grid: [{
top: 20,
bottom: 0,
width: '180px',
left: '204px',
gridIndex: 0,
containLabel: true,
},
{
show: false,
left: '54.5%',
top: 20,
bottom: 0,
gridIndex: 1,
width: '0%',
},
{
width: '180px',
top: 20,
bottom: 0,
right: '204px',
gridIndex: 2,
containLabel: true,
}],
color: ['#2C91FF', '#FF5526'],
series: [
{
name: 'man',
type: 'bar',
barWidth: '10',
gridIndex: 0,
itemStyle: {
normal: {
show: true,
color: '#2C91FF',
barBorderRadius: 4,
}
},
data: manData
},
{
name: 'manBorder',
type: 'bar',
barWidth: '10',
gridIndex: 0,
label: {
color: '#ffffff',
fontSize: 24,
position: 'left',
offset: [-36, 0],
show: true,
formatter: val => {
let value = 0
let sum = 0
this.list.man.data.forEach((e, index) => {
sum = sum + e
if (index == val.dataIndex) value = e
})
return ((value * -1) / (sum * -1) * 100).toFixed(2) + '%'
}
},
itemStyle: {
normal: {
barBorderRadius: 4,
color: 'rgba(44, 145, 255, 0.1)' //rgba设置透明度0.14
}
},
barGap: '-100%',
z: 0,
data: [-100, -100, -100, -100, -100]
},
{
name: 'women',
type: 'bar',
barWidth: '10',
xAxisIndex: 2,
yAxisIndex: 2,
itemStyle: {
normal: {
show: true,
color: '#FF5526',
barBorderRadius: 4,
borderWidth: 0,
borderColor: '#333',
}
},
data: this.list.women.data
},
{
name: 'womenBorder',
type: 'bar',
barWidth: '10',
xAxisIndex: 2,
yAxisIndex: 2,
label: {
color: '#ffffff',
fontSize: 24,
show: true,
position: 'right',
offset: [36, 0],
formatter: (val, index) => {
let value = ''
let sum = 0
this.list.women.data.forEach((e, index) => {
sum = sum + e
if (index == val.dataIndex) value = e
})
return (value / sum * 100).toFixed(2) + '%'
}
},
itemStyle: {
normal: {
barBorderRadius: 4,
color: 'rgba(23, 105, 152, 0.2)',
}
},
barGap: '-100%',
z: 0,
data: [100, 100, 100, 100, 100]
},
]
}
canvas.setOption(options)
}
}
}
</script>
<style scoped lang='scss'>
.user {
&-box {
height: 310px;
box-sizing: border-box;
padding-top: 10px;
}
&-title {
font-size: 26px;
color: #ffffff;
letter-spacing: 1px;
display: flex;
height: 53px;
line-height: 53px;
position: relative;
i {
position: absolute;
top: 50%;
left: 50%;
width: 2px;
height: 44px;
transform: translate(-50%, -50%);
background: rgba($color: #2d99ba, $alpha: 0.8);
}
div {
flex: 1;
text-align: left;
padding-left: 80px;
}
img {
width: 24px;
height: 50px;
vertical-align: top;
margin-right: 15px;
}
}
&-data {
width: 100%;
height: calc(100% - 53px);
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -2,11 +2,19 @@ import Header from './Header.vue' ...@@ -2,11 +2,19 @@ import Header from './Header.vue'
import Box from './Box.vue' import Box from './Box.vue'
import Title from './Title.vue' import Title from './Title.vue'
import GlMap from './GlMap.vue' import GlMap from './GlMap.vue'
import User from './User.vue'
import Rose from './Rose.vue'
import GlLineBar from './GlLineBar.vue'
import Count from './Count.vue'
const components = [ const components = [
Header, Header,
Box, Box,
GlMap, GlMap,
Title Title,
User,
Rose,
GlLineBar,
Count
] ]
const GlsxVueComponents = {} const GlsxVueComponents = {}
GlsxVueComponents.install = Vue => { GlsxVueComponents.install = Vue => {
......
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import components from '@c/index.js' import components from '@c/index.js'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(components) Vue.use(components)
......
...@@ -4,118 +4,39 @@ ...@@ -4,118 +4,39 @@
user-select: none; user-select: none;
} }
.map-tooltip { .clearfix::after {
background-image: linear-gradient(180deg, rgba(26, 76, 139, 0.95) 0%, rgba(7, 45, 93, 0.95) 100%); display: block;
border: 1px solid #5acbff; content: '';
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5); clear: both;
color: #F9F9F9;
font-size: 24px;
} }
.map-tooltip-title { .pull-left {
margin-bottom: 33px; float: left;
padding: 22px 24px;
} }
.map-item { .pull-right {
display: flex; float: right;
padding: 0 33px 41px;
}
.map-tooltip-name {
font-size: 24px;
margin-top: 8px;
}
.map-left {
padding-left: 36px;
}
.map-border {
padding-right: 50px;
border-right: 1px solid #3F5E86;
}
.map-list {
font-size: 40px;
letter-spacing: 1px;
text-align: center;
}
.map-line {
padding-right: 50px;
border-right: 1px solid #3F5E86;
}
.address {
display: inline-block;
width: 22px;
height: 28px;
background: url('~@a/address.png') no-repeat;
background-size: cover;
margin-right: 18px;
vertical-align: middle;
}
.view-box {
width: 100%;
height: 100vh;
background: url("~@a/bg.png") no-repeat;
background-size: cover;
box-sizing: border-box;
} }
.main { .main {
width: 100%; width: 100%;
height: calc(100% - 132px); height: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 49px 45px 65px;
flex-direction: column;
display: flex;
&-top {
flex: 2;
display: flex;
margin-bottom: 16px;
flex-direction: row;
}
}
.main-top {
flex: 3.5;
display: flex;
margin-bottom: 16px;
flex-direction: row;
}
.main-bottom {
flex: 1.5;
}
.m-t-left,
.m-t-right {
flex: 1;
display: flex;
flex-direction: column;
}
.m-t-left .m-t-left-top {
flex: 1;
margin-bottom: 17px;
}
.m-t-left .m-t-left-bottom {
flex: 2;
}
.m-t-center {
flex: 2;
margin: 0 14.5px;
} }
.m-t-right>div { .view-box {
flex: 1; width: 4088px;
height: 1728px;
background: url("~@a/bg.jpg") no-repeat;
background-size: 100% 100%;
background-position: center center;
box-sizing: border-box;
position: relative;
} }
.m-t-right>div:first-of-type { .box-center {
margin-bottom: 15px; width: 100%;
height: 122px;
background: url('~@a/box-center.png') no-repeat;
background-size: 100% 100%;
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,9 +13,7 @@ const cdn = { ...@@ -13,9 +13,7 @@ const cdn = {
js: [ js: [
`${CDN_DOMAIN}/vue/2.6.10/vue.min.js`, `${CDN_DOMAIN}/vue/2.6.10/vue.min.js`,
`${CDN_DOMAIN}/vue-router/3.0.6/vue-router.min.js`, `${CDN_DOMAIN}/vue-router/3.0.6/vue-router.min.js`,
`${CDN_DOMAIN}/echarts/4.4.0-rc.1/echarts.min.js`, `${CDN_DOMAIN}/echarts/4.1.0.rc2/echarts.min.js`
`${CDN_DOMAIN}/highcharts/7.2.0/highcharts.js`,
`${CDN_DOMAIN}/highcharts/7.2.0/highcharts-3d.js`
] ]
}; };
// version_lib = version_lib.replace(/\./g,'_'); // version_lib = version_lib.replace(/\./g,'_');
...@@ -54,8 +52,6 @@ module.exports = { ...@@ -54,8 +52,6 @@ module.exports = {
config.externals = { config.externals = {
vue: "Vue", vue: "Vue",
"vue-router": "VueRouter", "vue-router": "VueRouter",
"highcharts-3d": "Highcharts3D",
highcharts: "Highcharts",
echarts: "echarts" echarts: "echarts"
}; // 防止将某些 import 的包(package)打包到 bundle 中,而是在运行时(runtime)再去从外部获取这些扩展依赖(用于cdn引入) }; // 防止将某些 import 的包(package)打包到 bundle 中,而是在运行时(runtime)再去从外部获取这些扩展依赖(用于cdn引入)
if (isProduction) { if (isProduction) {
...@@ -129,7 +125,7 @@ module.exports = { ...@@ -129,7 +125,7 @@ module.exports = {
data: `@import "@/styles/common.scss";` data: `@import "@/styles/common.scss";`
}, },
css: {}, // 这里的选项会传递给 css-loader css: {}, // 这里的选项会传递给 css-loader
postcss: {} // 这里的选项会传递给 postcss-loader // postcss: {} // 这里的选项会传递给 postcss-loader
}, // css预设器配置项 }, // css预设器配置项
modules: false // 启用 CSS modules for all css / pre-processor files. modules: false // 启用 CSS modules for all css / pre-processor files.
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!