Commit a2601de3 by 匡雅琴

Merge branch 'v1.0.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v1.0.0

2 parents ab10d19f 7fe54e20
...@@ -59,20 +59,18 @@ function getBarLineOptions(obj) { ...@@ -59,20 +59,18 @@ function getBarLineOptions(obj) {
itemStyle: { itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角 barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) { color: function(params) {
const colorList = [
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient( return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始 0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色 offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0] color: '#22D8FF'
}, // 柱图渐变色 }, // 柱图渐变色
{ {
offset: 0.5, // 指100%处的颜色
color: '#223FA9'
},
{
offset: 1, // 指100%处的颜色 offset: 1, // 指100%处的颜色
color: colorItem[1] color: '#061422'
}] }]
) )
} }
...@@ -94,20 +92,18 @@ function getBarLineOptions(obj) { ...@@ -94,20 +92,18 @@ function getBarLineOptions(obj) {
itemStyle: { itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角 barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) { color: function(params) {
const colorList = [
['#11627A', '#282F7A'],
['#145F4E', '#035972']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient( return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始 0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色 offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0] color: '#2AD191'
}, // 柱图渐变色 }, // 柱图渐变色
{ {
offset: 0.5, // 指100%处的颜色
color: '#0E958D'
},
{
offset: 1, // 指100%处的颜色 offset: 1, // 指100%处的颜色
color: colorItem[1] color: '#061422'
}] }]
) )
} }
......
<template>
<div>
<div id="map" class="map"></div>
</div>
</template>
<script>
import utils from '../../utils/util'
import * as echarts from 'echarts'
import mapBg from '../../assets/images/map-bg.png'
export default {
name: 'Map',
mounted() {
console.log(1111)
const imgDom = new Image()
imgDom.src = '../../assets/images/map-bg.png'
imgDom.alt = 'alt'
var option = {
tooltip: {
show: true,
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: function(params) {
var _html = `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
<div style="color: #fff;">${params.name}</div>
<div style="display:flex;"><div style="color: #c9c9c9">客单价:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.value1) : 0}</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">转化率:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.value2) : 0}%</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">占比:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.rate) : 0}%</div></div>
</div>`
return _html
}
},
series: [{
type: 'map',
map: 'china',
data: [
{ name: '北京', value: 100, value1: 2323, value2: 43, rate: '29' },
{ name: '上海', value: 200, value1: 2323, value2: 3, rate: '29' },
{ name: '广东', value: 300, value1: 2323, value2: 34, rate: '29' }
],
itemStyle: {
// areaColor: '#061422',
areaColor: {
image: mapBg,
repeat: 'repeat'
},
borderColor: '#65C6F8',
shadowBlur: 10,
shadowColor: 'rgba(61, 87, 255, 0.41)'
},
emphasis: {
label: {
color: '#fff'
},
itemStyle: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
}
},
select: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
}
}]
}
var myChart = echarts.init(document.getElementById('map'))
myChart.setOption(option)
}
}
</script>
<style lang="scss">
.map {
width: 39.58vw;
height: 44.89vh;
}
</style>
...@@ -3,15 +3,20 @@ ...@@ -3,15 +3,20 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-19 17:18:33 * @Date: 2023-07-19 17:18:33
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-19 17:33:58 * @LastEditTime: 2023-07-20 10:39:02
--> -->
<template> <template>
<div> <div>
<box-title title="区域门店数据"></box-title> <box-title title="区域门店数据"></box-title>
<Map></Map>
</div> </div>
</template> </template>
<script> <script>
import Map from '../Map.vue'
export default { export default {
name: 'StoreMap' name: 'StoreMap',
components: {
Map
}
} }
</script> </script>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-04 13:55:35 * @Date: 2023-07-04 13:55:35
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-12 15:44:42 * @LastEditTime: 2023-07-20 10:39:14
--> -->
<template> <template>
<div class="layout"> <div class="layout">
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
}, },
data() { data() {
return { return {
activeName: '1' activeName: '2'
} }
}, },
mounted() { mounted() {
......
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
name: '总采购额', name: '总采购额',
valueName: 'amounttotal', valueName: 'amounttotal',
value: '0', value: '0',
unit: '¥',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amounttotalThismonth', bottemName: 'amounttotalThismonth',
bottomValue: '0', bottomValue: '0',
...@@ -73,6 +74,7 @@ export default { ...@@ -73,6 +74,7 @@ export default {
name: '商城采购额', name: '商城采购额',
valueName: 'amountshop', valueName: 'amountshop',
value: '0', value: '0',
unit: '¥',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amountshopThismonth', bottemName: 'amountshopThismonth',
bottomValue: '0', bottomValue: '0',
...@@ -82,6 +84,7 @@ export default { ...@@ -82,6 +84,7 @@ export default {
name: '自采采购额', name: '自采采购额',
valueName: 'amountself', valueName: 'amountself',
value: '0', value: '0',
unit: '¥',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amountselfThismonth', bottemName: 'amountselfThismonth',
bottomValue: '0', bottomValue: '0',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!