Commit 48d39d0d by liwk

commit

1 parent 72e0c4af
<template> <template>
<div id="app"> <div id="app">
<page1 /> <page2></page2>
</div> </div>
</template> </template>
<script> <script>
import page1 from './pages/page1' import page1 from './pages/page1'
import page2 from './pages/page2'
export default { export default {
data () { data () {
return { return {
...@@ -12,7 +13,8 @@ export default { ...@@ -12,7 +13,8 @@ export default {
} }
}, },
components: { components: {
page1 page1,
page2
} }
} }
</script> </script>
......
...@@ -16,12 +16,17 @@ export default { ...@@ -16,12 +16,17 @@ export default {
canvas: null, canvas: null,
index: 6, index: 6,
labels: [], labels: [],
values: [] values: [],
second: [],
lineData: []
} }
}, },
props: { props: {
data: Array, data: null,
days: Array, days: {
type: Array,
default: []
},
type: { type: {
type: String, type: String,
default: 'line' default: 'line'
...@@ -43,10 +48,10 @@ export default { ...@@ -43,10 +48,10 @@ export default {
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
createdCanvas () { createdCanvas () {
if (this.canvas) { if (this.canvas) {
this.labels = [] this.labels = []
this.values = [] this.values = []
...@@ -55,10 +60,100 @@ export default { ...@@ -55,10 +60,100 @@ export default {
this.index = this.days.length < this.index ? this.days.length : this.index this.index = this.days.length < this.index ? this.days.length : this.index
for (let i = 0; i < this.index; i++) { for (let i = 0; i < this.index; i++) {
this.labels.push(this.days[i]) this.labels.push(this.days[i])
if (this.haveLine) {
this.values.push(this.data.first[i])
this.second.push(this.data.second[i])
this.lineData.push(this.data.line[i])
} else {
this.values.push(this.data[i]) this.values.push(this.data[i])
} }
}
this.canvas = echarts.init(this.$refs.canvas) this.canvas = echarts.init(this.$refs.canvas)
let options = { let options = null
if (this.type == 'themeRiver') {
options = {
tooltip: {
trigger: 'axis',
padding: [8, 9, 8, 9],
axisPointer: {
type: 'line',
lineStyle: {
color: 'rgba(0,0,0,0.2)',
width: 1,
type: 'solid'
}
}
},
legend: {
top: '15px',
icon: 'rect',
itemGap: 42,
itemWidth: 10,
itemHeight: 10,
data: ['保养', '送修', '车险', '设备'],
textStyle: {
color: '#fff',
fontSize: 16
}
},
color: ['#0592b9', '#24bfff', '#0a83f3', '#0a4dc9'],
singleAxis: {
top: '95px',
left: '120px',
right: '120px',
bottom: '103px',
nameLocation: 'center',
boundaryGap: ['1000px', '1000px'],
type: 'time',
axisPointer: {
label: {
show: false
}
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
color: 'rgba(45,153,186,0.5)',
}
},
axisTick: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(45,153,186,0.2)'
}
},
axisLabel: {
margin: 33,
color: '#8e99a6',
fontSize: 18,
formatter: (val, index) => {
let value = this.days[index]
return value
}
}
},
series: [
{
type: 'themeRiver',
label: false,
itemStyle: {
emphasis: {
shadowBlur: 20,
shadowColor: 'rgba(0, 0, 0, 0.8)'
}
},
data: this.data
}
]
}
} else {
options = {
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.labels, data: this.labels,
...@@ -106,13 +201,13 @@ export default { ...@@ -106,13 +201,13 @@ export default {
{ {
data: this.values, data: this.values,
type: this.type, type: this.type,
barWidth: '60px', barWidth: this.haveLine ? '30px' : '60px',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
symbolSize: 14, symbolSize: 14,
label: { label: {
color: '#fff', color: '#fff',
fontSize: 26, fontSize: this.haveLine ? 16 : 26,
position: 'top', position: 'top',
offset: [0, -5], offset: [0, -5],
show: true show: true
...@@ -138,7 +233,7 @@ export default { ...@@ -138,7 +233,7 @@ export default {
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: this.type == 'bar' ? new echarts.graphic.LinearGradient( color: this.type == 'bar' ? this.haveLine ? '#0093fd' : new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ 0, 0, 0, 1, [{
offset: 0, offset: 0,
color: '#0DFF85' color: '#0DFF85'
...@@ -170,12 +265,52 @@ export default { ...@@ -170,12 +265,52 @@ export default {
data: this.values data: this.values
}) })
} }
this.canvas.setOption(options) if (this.haveLine) {
if (this.days.length > 6) { options.series.push({
setInterval(() => { type: 'line',
this.moveCanvas(options) data: this.lineData,
}, this.speed * 1000) label: {
color: '#fff',
fontSize: 16,
position: 'top',
offset: [0, -5],
show: true
},
lineStyle: {
width: 3,
color: '#a8f4ff'
},
itemStyle: {
normal: {
color: 'rgba(0,0,0,0)',
borderWidth: 6,
borderColor: '#cdf9ff'
} }
}
}, {
type: "bar",
data: this.second,
barWidth: '30px',
label: {
color: '#fff',
fontSize: 16,
position: 'top',
offset: [0, -5],
show: true
},
itemStyle: {
color: '#08dede'
},
})
}
}
this.canvas.setOption(options)
// if (this.days.length > 6) {
// setInterval(() => {
// this.moveCanvas(options)
// }, this.speed * 1000)
// }
}, },
moveCanvas (options) { moveCanvas (options) {
if (this.index > this.days.length - 1) { if (this.index > this.days.length - 1) {
......
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
ref="map" ref="map"
> >
</div> </div>
<div class="activation">
<div
class="activation-box"
:style="activationStyle"
>
<div class="activation-title">
广东
<div class="activation-time">2019-12-10 10:32</div>
</div>
<div class="activation-info">
新用户 45******** 注册成功
<p class="activation-dev">设备类型:大屏车机</p>
</div>
</div>
</div>
<div <div
class="map-back" class="map-back"
v-show='mapName != "china"' v-show='mapName != "china"'
...@@ -22,6 +37,7 @@ import china from '@p/map/china.json' ...@@ -22,6 +37,7 @@ import china from '@p/map/china.json'
import "echarts-gl" import "echarts-gl"
import { request } from 'https' import { request } from 'https'
import map_code from '@p/map/mapId.js' import map_code from '@p/map/mapId.js'
import { setInterval } from 'timers'
Array.prototype.max = function () { Array.prototype.max = function () {
return Math.max.apply({}, this) return Math.max.apply({}, this)
} }
...@@ -36,6 +52,10 @@ export default { ...@@ -36,6 +52,10 @@ export default {
map: null, map: null,
visualMapRange: [], visualMapRange: [],
pid: null, pid: null,
activationStyle: {
top: 0,
left: 0
},
options: { options: {
visualMap: { visualMap: {
show: false, show: false,
...@@ -43,13 +63,35 @@ export default { ...@@ -43,13 +63,35 @@ export default {
color: ['#1DE6EE', '#0B7FE1'] color: ['#1DE6EE', '#0B7FE1']
} }
}, },
tooltip: { // tooltip: {
position: 'top', // padding: 0,
}, // enterable: true,
// transitionDuration: 1,
// textStyle: {
// color: '#fff',
// decoration: 'none',
// },
// backgroundColor: 'rgab(0,0,0,0)',
// alwaysShowContent: true,
// formatter: params => {
// let tipHtml = `<div class="activation-box">
// <div class="activation-title">
// 广东
// <div class="activation-time">2019-12-10 10:32</div>
// </div>
// <div class="activation-info">
// 新用户 45******** 注册成功
// <p class="activation-dev">设备类型:大屏车机</p>
// </div>
// </div>`
// return tipHtml
// }
// },
series: [ series: [
{ {
type: 'map3D', type: 'map3D',
name: 'china', name: 'china',
top: '-15%',
selectedMode: "single",//地图高亮单选 selectedMode: "single",//地图高亮单选
boxDepth: 90,//地图倾斜度 boxDepth: 90,//地图倾斜度
regionHeight: 2,//地图高度 regionHeight: 2,//地图高度
...@@ -63,7 +105,7 @@ export default { ...@@ -63,7 +105,7 @@ export default {
show: true, show: true,
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontSize: 16, fontSize: 32,
backgroundColor: 'rgba(0,0,0,0)' backgroundColor: 'rgba(0,0,0,0)'
} }
}, },
...@@ -93,9 +135,12 @@ export default { ...@@ -93,9 +135,12 @@ export default {
viewControl: { viewControl: {
alpha: 40, alpha: 40,
beta: 0, beta: 0,
maxAlpha: 45, maxAlpha: 35,
distance: 100,
maxBeta: 360,
animationDurationUpdate: 3000 animationDurationUpdate: 3000
} },
} }
] ]
}, },
...@@ -192,11 +237,18 @@ export default { ...@@ -192,11 +237,18 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$refs.map.classList.remove('back') this.$refs.map.classList.remove('back')
}, 1000) }, 1000)
// setTimeout(() => { // setInterval(() => {
// let num = Math.floor(Math.random() * (80 - 1)) + 1 // let alphaNum = Math.floor(Math.random() * (45 - 1)) + 1
// options.series[0].viewControl.alpha = num // let betaNum = Math.floor(Math.random() * (80 - 1)) + 1
// options.series[0].viewControl.beta = num // let maxLeft = Math.floor(Math.random() * (1488 - 0)) + 0
// this.map.setOption(options) // let maxTop = Math.floor(Math.random() * (736 - 0)) + 0
// options.series[0].viewControl.alpha = alphaNum
// options.series[0].viewControl.beta = betaNum
// this.activationStyle = {
// top: `${maxTop}px`,
// left: `${maxLeft}px`
// }
// // this.map.setOption(options)
// }, 5000) // }, 5000)
} }
} }
......
<template> <template>
<div class='header'> <div class='header'>
<h1>广联用户总数</h1> <h1 v-if="$slots.title">
<slot name='title'></slot>
</h1>
<div> <div>
<slot></slot> <slot></slot>
</div> </div>
......
<template>
<div
class='order-data'
ref='data'
>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Order',
data () {
return {
}
},
props: {
list: {
type: Array,
default: [
{
name: '广东',
value: 1236
},
{
name: '上海',
value: 1145
},
{
name: '北京',
value: 1023
},
{
name: '福建',
value: 941
},
{
name: '四川',
value: 876
},
{
name: '河北',
value: 792
},
{
name: '重庆',
value: 651
},
{
name: '湖北',
value: 519
},
{
name: '湖南',
value: 492
},
{
name: '广西',
value: 441
}
]
}
},
mounted () {
this.createdCanvas()
},
watch: {
'list' (n, o) {
if (n) {
}
}
},
methods: {
createdCanvas () {
let list = this.list
let data = []
list.forEach(e => {
data.push(e.value)
})
let canvas = echarts.init(this.$refs.data)
let options = {
xAxis: [{
type: 'value',
min: 0,
max: 100,
gridIndex: 0,
axisTick: { show: false, inside: false },
axisLabel: { show: false },
axisLine: {// Y轴轴线样式
show: false,
},
splitLine: {
show: false
}
},
{
gridIndex: 1,
show: false,
}],
yAxis: [{
type: 'category',
gridIndex: 0,
inverse: true,
data: data,
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: 24,
align: 'left'
},
},
data: data
}],
grid: [{
top: 30,
bottom: 0,
width: '180px',
left: '165px',
gridIndex: 0,
containLabel: true,
},
{
show: false,
left: '395px',
top: 30,
bottom: 0,
gridIndex: 1,
width: '0%',
},],
series: [
{
type: 'bar',
barWidth: '10',
gridIndex: 0,
itemStyle: {
show: true,
color: new echarts.graphic.LinearGradient(
0, 0, 1, 0, [{
offset: 0,
color: '#0070FB'
},
{
offset: 1,
color: '#0DFF85'
}
]),
barBorderRadius: 4,
},
// data: list
},
{
name: 'border',
type: 'bar',
barWidth: '10',
label: {
color: '#ffffff',
fontSize: 24,
position: 'left',
offset: [-38, 0],
show: true,
formatter: val => {
let label = ''
list.forEach((e, ind) => {
if (val.dataIndex == ind) label = `${ind + 1}\t\t\t${e.name}`
})
return label
}
},
itemStyle: {
normal: {
barBorderRadius: 4,
color: 'rgba(44, 145, 255, 0.1)' //rgba设置透明度0.14
}
},
barGap: '-100%',
z: 0,
data: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
}
]
}
canvas.setOption(options)
}
}
}
</script>
<style scoped lang='scss'>
.order-data {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class='radar'>
<div
ref='radar'
class='radar-canvas'
></div>
<div class="radar-title">{{listData.data[0].name}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Radar',
data () {
return {
}
},
props: {
listData: {
type: Object,
default: {}
},
isRowIndex: {
type: Array,
default: []
},
itemColor: {
type: String,
default: '#00e0b3'
}
},
mounted () {
this.draw()
},
methods: {
draw () {
let canvas = echarts.init(this.$refs.radar)
let obj = this.listData
let indicator = obj.indicator
let data = obj.data
data[0].value.forEach((e, i) => {
indicator[i].value = e
indicator[i].index = i
})
let options = {
radar: {
radius: '50%',
splitNumber: 5,
center: ['50%', '40%'],
name: {
formatter: (value, indicator) => {
let row_column = true
let val = `{a|${value}}\n{b|${indicator.value}}`
this.isRowIndex.forEach(e => {
if (e == indicator.index) val = `{a|${value}}\t{b|${indicator.value}}`
})
return val
},
rich: {
a: {
color: '#fff',
fontSize: 16,
align: 'center'
},
b: {
color: '#fff',
fontSize: 16,
lineHeight: 25,
align: 'right'
},
},
},
axisLine: false,
splitLine: {
lineStyle: {
width: 3,
color: 'rgba(45,153,186,0.2)'
}
},
splitArea: false,
indicator: indicator
},
series: [{
type: 'radar',
symbolSize: 0,
areaStyle: {
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.8,
colorStops: [{
offset: 0, color: 'rgba(0,0,0,0)' // 0% 处的颜色
}, {
offset: 1, color: this.itemColor // 100% 处的颜色
}],
globalCoord: false
},
},
lineStyle: {
color: this.itemColor
},
data: data
}],
}
canvas.setOption(options)
}
}
}
</script>
<style scoped lang='scss'>
.radar {
width: 100%;
height: 100%;
position: relative;
&-canvas {
width: 100%;
height: 100%;
}
&-title {
position: absolute;
left: 0;
bottom: 20px;
width: 100%;
text-align: center;
font-size: 24px;
color: #8e99a6;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -110,9 +110,8 @@ export default { ...@@ -110,9 +110,8 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.rose { .rose {
float: left; width: 100%;
width: 50%; height: 100%;
height: 50%;
position: relative; position: relative;
&-canvas { &-canvas {
width: 100%; width: 100%;
......
...@@ -6,6 +6,8 @@ import User from './User.vue' ...@@ -6,6 +6,8 @@ import User from './User.vue'
import Rose from './Rose.vue' import Rose from './Rose.vue'
import GlLineBar from './GlLineBar.vue' import GlLineBar from './GlLineBar.vue'
import Count from './Count.vue' import Count from './Count.vue'
import Order from './Order.vue'
import Radar from './Radar.vue'
const components = [ const components = [
Header, Header,
Box, Box,
...@@ -14,7 +16,9 @@ const components = [ ...@@ -14,7 +16,9 @@ const components = [
User, User,
Rose, Rose,
GlLineBar, GlLineBar,
Count Count,
Order,
Radar
] ]
const GlsxVueComponents = {} const GlsxVueComponents = {}
GlsxVueComponents.install = Vue => { GlsxVueComponents.install = Vue => {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class='view-box'> <div class='view-box'>
<div class='view-box-bg'></div> <div class='view-box-bg'></div>
<Header> <Header>
<h1 slot='title'>广联用户总数</h1>
<div class="header-count"> <div class="header-count">
<countTo <countTo
:startVal="0" :startVal="0"
...@@ -74,25 +75,33 @@ ...@@ -74,25 +75,33 @@
<User :list='userList'></User> <User :list='userList'></User>
<div class='box-center'></div> <div class='box-center'></div>
<div class="rose-box"> <div class="rose-box">
<div class="rose-item">
<Rose <Rose
:list='city' :list='city'
haveBorder haveBorder
> >
用户城市排行 用户城市排行
</Rose> </Rose>
</div>
<div class="rose-item">
<Rose :list='carBrand'> <Rose :list='carBrand'>
用户车辆价格分布 用户车辆价格分布
</Rose> </Rose>
</div>
<div class="rose-item">
<Rose <Rose
:list='dayMileage' :list='dayMileage'
haveBorder haveBorder
> >
用户日均行驶里程分布 用户日均行驶里程分布
</Rose> </Rose>
</div>
<div class="rose-item">
<Rose :list='driving'> <Rose :list='driving'>
用户月均行驶天数分布 用户月均行驶天数分布
</Rose> </Rose>
</div> </div>
</div>
</Box> </Box>
</div> </div>
</div> </div>
...@@ -175,12 +184,6 @@ export default { ...@@ -175,12 +184,6 @@ export default {
} }
}, },
mounted () { mounted () {
// for (let i = 1; i <= 30; i++) {
// let str = `2019-11-${i < 10 ? '0' + i : i}`
// let num = Math.floor(Math.random() * (200 - 1)) + 1
// this.days.push(str)
// this.user.push(num)
// }
this.getUserGenderData() this.getUserGenderData()
this.getUserTotal() this.getUserTotal()
this.getUserTrend() this.getUserTrend()
...@@ -435,113 +438,12 @@ export default { ...@@ -435,113 +438,12 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.view-box-bg { .rose-box {
width: 100%; height: calc(100% - 557px);
height: 100%; .rose-item {
position: absolute;
top: 0;
left: 0;
background: url("~@a/bg2.png") no-repeat;
background-size: 100% 100%;
z-index: 2;
pointer-events: none;
}
.header-count {
letter-spacing: 32px;
}
.main {
padding-top: 24px;
&-top {
height: calc(100% - 519px);
margin-bottom: 9px;
&-left,
&-right {
width: 988px;
height: 100%;
position: relative;
z-index: 3;
}
&-left {
float: left;
margin-left: 36px;
}
&-right {
float: right;
margin-right: 37px;
}
&-center {
position: absolute;
width: 4088px;
height: 1728px;
top: 0;
left: 0;
box-sizing: border-box;
}
}
&-bottom {
position: relative;
width: 100%;
height: 510px;
background: url("~@a/bottom-bg.png") no-repeat;
background-size: cover;
box-sizing: border-box;
z-index: 3;
left: 0;
&-item {
float: left;
width: 25%;
height: 100%;
}
}
}
.ball-box {
margin-bottom: 9px;
height: 278px;
.ball {
float: left;
width: 278px;
height: 100%;
position: relative;
background: url("~@a/ball.png") no-repeat;
background-size: cover;
font-size: 66px;
&-content {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 100%;
text-align: center;
}
p {
font-size: 22px;
color: #8e99a6;
}
}
.ball-online {
margin: 0 132px 0 136px;
}
}
.count {
padding-top: 24px;
.count-item {
float: left; float: left;
width: 50%; width: 50%;
text-align: center; height: 50%;
font-size: 72px;
font-weight: 700;
p {
font-weight: normal;
font-size: 24px;
margin-top: 8px;
color: #8e99a6;
}
}
.marginBottom {
margin-bottom: 74px;
} }
} }
.rose-box {
height: calc(100% - 557px);
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -40,3 +40,171 @@ ...@@ -40,3 +40,171 @@
background: url('~@a/box-center.png') no-repeat; background: url('~@a/box-center.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.activation {
position: absolute;
height: calc(100% - 697px);
width: calc(100% - 2048px);
top: 180px;
left: 50%;
transform: translateX(-50%);
z-index: 9;
pointer-events: none;
&-box {
position: absolute;
width: 552px;
height: 294px;
background: url("~@a/activation-box.png") no-repeat;
background-size: cover;
box-sizing: border-box;
padding: 23px 11px;
transition: all 0.5s;
}
&-title {
height: 60px;
line-height: 60px;
font-size: 28px;
color: #fff;
position: relative;
text-indent: 78px;
border-bottom: 2px solid rgba($color: #fff, $alpha: 0.2);
div {
font-size: 24px;
opacity: 0.7;
float: right;
margin-right: 10px;
}
}
&-title:after {
content: "";
position: absolute;
width: 72px;
height: 100px;
background: url("~@a/address.png") no-repeat;
background-size: cover;
left: 6px;
bottom: 8px;
}
&-info {
height: calc(100% - 62px);
box-sizing: border-box;
padding-top: 53px;
text-align: center;
font-size: 30px;
color: #fff;
p {
margin-top: 5px;
}
}
}
.view-box-bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: url("~@a/bg2.png") no-repeat;
background-size: 100% 100%;
z-index: 2;
pointer-events: none;
}
.header-count {
letter-spacing: 32px;
}
.main {
padding-top: 24px;
&-top {
height: calc(100% - 519px);
margin-bottom: 9px;
&-left,
&-right {
width: 988px;
height: 100%;
position: relative;
z-index: 3;
}
&-left {
float: left;
margin-left: 36px;
}
&-right {
float: right;
margin-right: 37px;
}
&-center {
position: absolute;
width: 4088px;
height: 1728px;
top: 0;
left: 0;
box-sizing: border-box;
}
}
&-bottom {
position: relative;
width: 100%;
height: 510px;
background: url("~@a/bottom-bg.png") no-repeat;
background-size: cover;
box-sizing: border-box;
z-index: 3;
left: 0;
&-item {
float: left;
width: 25%;
height: 100%;
}
}
}
.ball-box {
margin-bottom: 9px;
height: 278px;
.ball {
float: left;
width: 278px;
height: 100%;
position: relative;
background: url("~@a/ball.png") no-repeat;
background-size: cover;
font-size: 66px;
&-content {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
width: 100%;
text-align: center;
}
p {
font-size: 22px;
color: #8e99a6;
}
}
.ball-online {
margin: 0 132px 0 136px;
}
}
.count {
padding-top: 24px;
.count-item {
float: left;
width: 50%;
text-align: center;
font-size: 72px;
font-weight: 700;
p {
font-weight: normal;
font-size: 24px;
margin-top: 8px;
color: #8e99a6;
}
}
.marginBottom {
margin-bottom: 74px;
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!