Commit 33c5b932 by 匡雅琴

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

2 parents cc9da4b9 50b13604
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:59:28
* @LastEditTime: 2023-07-10 11:15:12
-->
<template>
<div>
......@@ -72,14 +72,15 @@ export default {
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
this.tooltipFormatterObj.forEach(item => {
if (_txt) {
_txt = _txt + '<br>'
}
_txt = _txt + item.label + ':' + _currentItem[item.attrName] + (item.addSymbol || '')
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${_currentItem[item.attrName]}${item.addSymbol || ''}</div></div>`
})
return _txt
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt}
</div>`
return _html
},
drawBar() {
console.log(this.dataList)
......
......@@ -3,16 +3,16 @@
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 16:23:54
* @LastEditTime: 2023-07-10 14:50:24
*/
import * as echarts from 'echarts'
function getBarLineOptions(obj) {
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
show: false,
trigger: 'axis',
borderWidth: 0,
padding: 0,
formatter: tooltipFormatter || '',
confine: true
},
......@@ -91,6 +91,60 @@ function getBarLineOptions(obj) {
)
}
}
},
{
name: 'bar3',
type: 'bar',
label: {
show: true
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#FFC200'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#F2C101'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
},
{
name: 'bar4',
type: 'bar',
label: {
show: true
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function(params) {
return new echarts.graphic.LinearGradient(
0, 0, 0, 1, [{ // 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: '#E65C01'
}, // 柱图渐变色
{
offset: 0.5, // 指100%处的颜色
color: '#E65C17'
},
{
offset: 1, // 指100%处的颜色
color: '#061422'
}]
)
}
}
}
]
}
......
......@@ -4,6 +4,7 @@
<div class="statistics-top">
<div class="statistics-name">{{item.name}}</div>
<div class="statistics-price">¥<span class="statistics-price-number">{{item.value}}</span></div>
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}</span></div>
</div>
<div class="statistics-bottom">
<template v-if="bottomType == 'money'">
......@@ -14,6 +15,9 @@
<span>{{item.moneyName}}</span>
<span>{{item.moneyValue}}</span>
</template>
<template v-else-if="bottomType == 'slot'">
<slot name="bottom"></slot>
</template>
</div>
</div>
</div>
......@@ -57,7 +61,18 @@ export default {
}
}
&-top {
position: relative;
padding-left: 0.3vw;
&-rate {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
color: #95ACD9;
span {
color: #EB6001;
}
}
}
&-name {
font-weight: 500;
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:19:28
* @LastEditTime: 2023-07-10 11:36:28
-->
<template>
<div class="left">
......@@ -41,13 +41,15 @@ export default {
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
moneyValue: '2,280,708',
rate: '51%'
},
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
moneyValue: '2,280,708',
rate: '49%'
},
{
name: '总采购额',
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 16:30:49
* @LastEditTime: 2023-07-10 14:37:14
-->
<template>
<div class="merchant-box">
......@@ -29,11 +29,11 @@ export default {
return {
tooltipFormatterObj: [
{
label: '商城',
label: '开通商户',
attrName: 'data1'
},
{
label: '自采',
label: '采购商户',
attrName: 'data2'
}
],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!