Commit a95ecb1e by 匡雅琴

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

2 parents 9a285641 1ef02195
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:04:45
* @LastEditTime: 2023-07-07 14:24:23
-->
<template>
<div>
......@@ -13,7 +13,7 @@
<script type="text/ecmascript-6">
import * as echarts from 'echarts'
import getBarLineOptions from './BarLineOptions'
import BarOptions from './BarOptions'
export default {
name: 'BarChart',
props: {
......@@ -62,7 +62,7 @@ export default {
}
},
created() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
this.barLineOptions = BarOptions({ tooltipFormatter: this.tooltipFormatter })
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
......@@ -80,12 +80,11 @@ export default {
})
return _txt
},
drawBarLine() {
drawBar() {
console.log(this.dataList)
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this[this.domId].setOption(this.barLineOptions)
}
}
......
......@@ -48,7 +48,7 @@ function getBarLineOptions(obj) {
grid: {
left: '3%',
right: '4%',
top: '10%',
top: '20%',
bottom: '6%',
containLabel: true
},
......@@ -59,7 +59,9 @@ function getBarLineOptions(obj) {
stack: 'one',
data: [],
label: {
show: true
show: true,
position: 'insideTop',
color: '#fff'
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
......@@ -97,7 +99,9 @@ function getBarLineOptions(obj) {
type: 'bar',
stack: 'one',
label: {
show: true
show: true,
position: 'insideTop',
color: '#fff'
},
data: [],
itemStyle: {
......
/*
* @Description:
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:35:44
*/
import * as echarts from 'echarts'
function getBarLineOptions(obj) {
// const { tooltipFormatter } = obj
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
// trigger: 'axis',
// borderWidth: 0,
// backgroundColor: 'rgba(68,68,68,0.80)',
// textStyle: {
// color: 'rgba(255,255,255,0.6)',
// fontSize: '1.5px'
// },
// formatter: tooltipFormatter || '',
// confine: true
trigger: 'axis',
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: 'rgba(255,255,255,0.6)',
fontSize: '1.5px'
},
formatter: tooltipFormatter || '',
confine: true
},
xAxis: {
data: []
......@@ -19,8 +26,8 @@ function getBarLineOptions(obj) {
yAxis: {
name: '',
type: 'value',
min: 0,
max: 10000,
// min: 0,
// max: 100,
splitLine: {
lineStyle: {
color: '#1d2a38'
......@@ -38,7 +45,6 @@ function getBarLineOptions(obj) {
{
name: 'bar',
type: 'bar',
stack: 'one',
data: [],
label: {
show: true
......@@ -46,29 +52,18 @@ function getBarLineOptions(obj) {
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
const colorList = [
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF'],
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF'],
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF'],
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF'],
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF'],
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF']
]
var colorItem = colorList[params.dataIndex]
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0]
color: '#22D8FF'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#223FA9'
},
{
offset: 1, // 指100%处的颜色
color: colorItem[1]
color: '#061422'
}]
)
}
......@@ -77,7 +72,6 @@ function getBarLineOptions(obj) {
{
name: 'bar2',
type: 'bar',
stack: 'one',
label: {
show: true
},
......@@ -85,29 +79,18 @@ function getBarLineOptions(obj) {
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
const colorList = [
['#11627A', '#282F7A'],
['#145F4E', '#035972'],
['#11627A', '#282F7A'],
['#145F4E', '#035972'],
['#11627A', '#282F7A'],
['#145F4E', '#035972'],
['#11627A', '#282F7A'],
['#145F4E', '#035972'],
['#11627A', '#282F7A'],
['#145F4E', '#035972'],
['#11627A', '#282F7A'],
['#145F4E', '#035972']
]
var colorItem = colorList[params.dataIndex]
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorItem[0]
color: '#2AD191'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#0E958D'
},
{
offset: 1, // 指100%处的颜色
color: colorItem[1]
color: '#061422'
}]
)
}
......
......@@ -3,20 +3,26 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 17:41:10
* @LastEditTime: 2023-07-07 14:19:28
-->
<template>
<div class="left">
<StatisticsBox :list="solarList" bottomType="money"></StatisticsBox>
<PurchaseTrends></PurchaseTrends>
<div class="left-bottom">
<MerchantTrends class="bottom-trends"></MerchantTrends>
<div class="bottom-storage">ddd</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import PurchaseTrends from './PurchaseTrends.vue'
import MerchantTrends from './MerchantTrends.vue'
export default {
name: 'ContentLeft',
components: {
PurchaseTrends
PurchaseTrends,
MerchantTrends
},
data() {
return {
......@@ -63,5 +69,15 @@ export default {
width: 64.17vw;
overflow: hidden;
// background: #091C40;
&-bottom {
display: flex;
.bottom-trends {
width: 43.33vw;
margin-right: 1.11vw;
}
.bottom-storage {
flex: 1;
}
}
}
</style>
<!--
* @Description: 近一年采购额趋势图
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:35:36
-->
<template>
<div class="merchant-box">
<box-title title="商户开通及使用趋势"></box-title>
<BarChart ref="merchantTrendsRef" height="28.67vh" domId="merchantTrends" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarChart>
</div>
</template>
<script type="text/ecmascript-6">
import { changeMixin } from '@/mixins'
export default {
name: 'MerchantTrends',
mixins: [changeMixin],
data() {
return {
tooltipFormatterObj: [
{
label: '商城',
attrName: 'data1'
},
{
label: '自采',
attrName: 'data2'
}
],
dataList: []
}
},
mounted() {
},
methods: {
init() {
const p = new Promise((resolve) => {
for (let i = 0; i < 12; i++) {
this.dataList.push({
month: i + 1 + '月',
data1: +(Math.random() * 20).toFixed(2),
data2: +(Math.random() * 40).toFixed(2)
})
}
resolve()
})
p.then(() => {
this.$refs.merchantTrendsRef.drawBar()
})
}
}
}
</script>
<style scoped lang='scss'>
.merchant-box {
// margin: 1.78vh 0;
background-color: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
</style>
......@@ -3,12 +3,12 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 13:54:35
* @LastEditTime: 2023-07-07 14:22:00
-->
<template>
<div class="purchase-box">
<box-title title="采购额排名"></box-title>
<BarLineChart ref="purchaseRef" height="25.37vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<BarLineChart ref="purchaseRef" height="30.26vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
</div>
</template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!