Commit 48d39d0d by liwk

commit

1 parent 72e0c4af
<template>
<div id="app">
<page1 />
<page2></page2>
</div>
</template>
<script>
import page1 from './pages/page1'
import page2 from './pages/page2'
export default {
data () {
return {
......@@ -12,7 +13,8 @@ export default {
}
},
components: {
page1
page1,
page2
}
}
</script>
......
......@@ -16,12 +16,17 @@ export default {
canvas: null,
index: 6,
labels: [],
values: []
values: [],
second: [],
lineData: []
}
},
props: {
data: Array,
days: Array,
data: null,
days: {
type: Array,
default: []
},
type: {
type: String,
default: 'line'
......@@ -43,10 +48,10 @@ export default {
}
},
mounted () {
},
methods: {
createdCanvas () {
if (this.canvas) {
this.labels = []
this.values = []
......@@ -55,127 +60,257 @@ export default {
this.index = this.days.length < this.index ? this.days.length : this.index
for (let i = 0; i < this.index; i++) {
this.labels.push(this.days[i])
this.values.push(this.data[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.canvas = echarts.init(this.$refs.canvas)
let options = {
xAxis: {
type: 'category',
data: this.labels,
axisLabel: {
show: true,
margin: 33,
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: {
type: 'category',
data: this.labels,
axisLabel: {
show: true,
margin: 33,
textStyle: {
color: '#8e99a6',
fontSize: 18,
},
},
axisTick: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: '#2d99ba'
}
},
},
axisTick: {
show: false
grid: {
top: '95px',
left: '64.5px',
right: '64.5px',
bottom: '103px',
},
axisLine: {
show: true,
lineStyle: {
color: '#2d99ba'
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)'
}
}
},
},
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: this.values,
type: this.type,
barWidth: this.haveLine ? '30px' : '60px',
smooth: true,
symbol: 'circle',
symbolSize: 14,
label: {
color: '#fff',
fontSize: this.haveLine ? 16 : 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' ? this.haveLine ? '#0093fd' : 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}`
}
}
}
}
},
series: [
{
data: this.values,
type: this.type,
barWidth: '60px',
smooth: true,
symbol: 'circle',
symbolSize: 14,
]
}
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: this.values
})
}
if (this.haveLine) {
options.series.push({
type: 'line',
data: this.lineData,
label: {
color: '#fff',
fontSize: 26,
fontSize: 16,
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% 处的颜色
}]
}
width: 3,
color: '#a8f4ff'
},
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}`
color: 'rgba(0,0,0,0)',
borderWidth: 6,
borderColor: '#cdf9ff'
}
}
}
]
}
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: this.values
})
}, {
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)
}
// if (this.days.length > 6) {
// setInterval(() => {
// this.moveCanvas(options)
// }, this.speed * 1000)
// }
},
moveCanvas (options) {
if (this.index > this.days.length - 1) {
......
......@@ -5,6 +5,21 @@
ref="map"
>
</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
class="map-back"
v-show='mapName != "china"'
......@@ -22,6 +37,7 @@ import china from '@p/map/china.json'
import "echarts-gl"
import { request } from 'https'
import map_code from '@p/map/mapId.js'
import { setInterval } from 'timers'
Array.prototype.max = function () {
return Math.max.apply({}, this)
}
......@@ -36,6 +52,10 @@ export default {
map: null,
visualMapRange: [],
pid: null,
activationStyle: {
top: 0,
left: 0
},
options: {
visualMap: {
show: false,
......@@ -43,13 +63,35 @@ export default {
color: ['#1DE6EE', '#0B7FE1']
}
},
tooltip: {
position: 'top',
},
// tooltip: {
// 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: [
{
type: 'map3D',
name: 'china',
top: '-15%',
selectedMode: "single",//地图高亮单选
boxDepth: 90,//地图倾斜度
regionHeight: 2,//地图高度
......@@ -63,7 +105,7 @@ export default {
show: true,
textStyle: {
color: '#fff',
fontSize: 16,
fontSize: 32,
backgroundColor: 'rgba(0,0,0,0)'
}
},
......@@ -93,9 +135,12 @@ export default {
viewControl: {
alpha: 40,
beta: 0,
maxAlpha: 45,
maxAlpha: 35,
distance: 100,
maxBeta: 360,
animationDurationUpdate: 3000
}
},
}
]
},
......@@ -192,11 +237,18 @@ export default {
setTimeout(() => {
this.$refs.map.classList.remove('back')
}, 1000)
// setTimeout(() => {
// 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)
// setInterval(() => {
// let alphaNum = Math.floor(Math.random() * (45 - 1)) + 1
// let betaNum = Math.floor(Math.random() * (80 - 1)) + 1
// let maxLeft = Math.floor(Math.random() * (1488 - 0)) + 0
// 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)
}
}
......
<template>
<div class='header'>
<h1>广联用户总数</h1>
<h1 v-if="$slots.title">
<slot name='title'></slot>
</h1>
<div>
<slot></slot>
</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
<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
......@@ -110,9 +110,8 @@ export default {
<style scoped lang='scss'>
.rose {
float: left;
width: 50%;
height: 50%;
width: 100%;
height: 100%;
position: relative;
&-canvas {
width: 100%;
......
......@@ -6,6 +6,8 @@ import User from './User.vue'
import Rose from './Rose.vue'
import GlLineBar from './GlLineBar.vue'
import Count from './Count.vue'
import Order from './Order.vue'
import Radar from './Radar.vue'
const components = [
Header,
Box,
......@@ -14,7 +16,9 @@ const components = [
User,
Rose,
GlLineBar,
Count
Count,
Order,
Radar
]
const GlsxVueComponents = {}
GlsxVueComponents.install = Vue => {
......
......@@ -2,6 +2,7 @@
<div class='view-box'>
<div class='view-box-bg'></div>
<Header>
<h1 slot='title'>广联用户总数</h1>
<div class="header-count">
<countTo
:startVal="0"
......@@ -74,24 +75,32 @@
<User :list='userList'></User>
<div class='box-center'></div>
<div class="rose-box">
<Rose
:list='city'
haveBorder
>
用户城市排行
</Rose>
<Rose :list='carBrand'>
用户车辆价格分布
</Rose>
<Rose
:list='dayMileage'
haveBorder
>
用户日均行驶里程分布
</Rose>
<Rose :list='driving'>
用户月均行驶天数分布
</Rose>
<div class="rose-item">
<Rose
:list='city'
haveBorder
>
用户城市排行
</Rose>
</div>
<div class="rose-item">
<Rose :list='carBrand'>
用户车辆价格分布
</Rose>
</div>
<div class="rose-item">
<Rose
:list='dayMileage'
haveBorder
>
用户日均行驶里程分布
</Rose>
</div>
<div class="rose-item">
<Rose :list='driving'>
用户月均行驶天数分布
</Rose>
</div>
</div>
</Box>
</div>
......@@ -175,12 +184,6 @@ export default {
}
},
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.getUserTotal()
this.getUserTrend()
......@@ -435,113 +438,12 @@ export default {
</script>
<style scoped lang='scss'>
.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 {
.rose-box {
height: calc(100% - 557px);
.rose-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;
height: 50%;
}
}
.rose-box {
height: calc(100% - 557px);
}
</style>
\ No newline at end of file
......@@ -39,4 +39,172 @@
height: 122px;
background: url('~@a/box-center.png') no-repeat;
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!