Commit 2b4a5969 by 胡悦

修改样式

1 parent 98dc0c49
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-07 14:01:42 * @Date: 2023-07-07 14:01:42
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:59:28 * @LastEditTime: 2023-07-10 11:15:12
--> -->
<template> <template>
<div> <div>
...@@ -72,14 +72,15 @@ export default { ...@@ -72,14 +72,15 @@ export default {
methods: { methods: {
tooltipFormatter(obj) { tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex] var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = '' var _txt = ''
this.tooltipFormatterObj.forEach(item => { this.tooltipFormatterObj.forEach(item => {
if (_txt) { _txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${_currentItem[item.attrName]}${item.addSymbol || ''}</div></div>`
_txt = _txt + '<br>'
}
_txt = _txt + item.label + ':' + _currentItem[item.attrName] + (item.addSymbol || '')
}) })
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() { drawBar() {
console.log(this.dataList) console.log(this.dataList)
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-07 14:04:52 * @Date: 2023-07-07 14:04:52
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-07 16:23:54 * @LastEditTime: 2023-07-10 14:50:24
*/ */
import * as echarts from 'echarts' import * as echarts from 'echarts'
function getBarLineOptions(obj) { function getBarLineOptions(obj) {
const { tooltipFormatter } = obj const { tooltipFormatter } = obj
var barLineOption = { var barLineOption = {
tooltip: { tooltip: {
show: false,
trigger: 'axis', trigger: 'axis',
borderWidth: 0, borderWidth: 0,
padding: 0,
formatter: tooltipFormatter || '', formatter: tooltipFormatter || '',
confine: true confine: true
}, },
...@@ -91,6 +91,60 @@ function getBarLineOptions(obj) { ...@@ -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 @@ ...@@ -4,6 +4,7 @@
<div class="statistics-top"> <div class="statistics-top">
<div class="statistics-name">{{item.name}}</div> <div class="statistics-name">{{item.name}}</div>
<div class="statistics-price">¥<span class="statistics-price-number">{{item.value}}</span></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>
<div class="statistics-bottom"> <div class="statistics-bottom">
<template v-if="bottomType == 'money'"> <template v-if="bottomType == 'money'">
...@@ -14,6 +15,9 @@ ...@@ -14,6 +15,9 @@
<span>{{item.moneyName}}</span> <span>{{item.moneyName}}</span>
<span>{{item.moneyValue}}</span> <span>{{item.moneyValue}}</span>
</template> </template>
<template v-else-if="bottomType == 'slot'">
<slot name="bottom"></slot>
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -57,7 +61,18 @@ export default { ...@@ -57,7 +61,18 @@ export default {
} }
} }
&-top { &-top {
position: relative;
padding-left: 0.3vw; padding-left: 0.3vw;
&-rate {
position: absolute;
right: 0;
top: 0;
font-size: 12px;
color: #95ACD9;
span {
color: #EB6001;
}
}
} }
&-name { &-name {
font-weight: 500; font-weight: 500;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-05 10:35:43 * @Date: 2023-07-05 10:35:43
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:19:28 * @LastEditTime: 2023-07-10 11:36:28
--> -->
<template> <template>
<div class="left"> <div class="left">
...@@ -37,13 +37,15 @@ export default { ...@@ -37,13 +37,15 @@ export default {
name: '总采购额', name: '总采购额',
value: '2,280,708', value: '2,280,708',
moneyName: '本月采购额', moneyName: '本月采购额',
moneyValue: '2,280,708' moneyValue: '2,280,708',
rate: '51%'
}, },
{ {
name: '总采购额', name: '总采购额',
value: '2,280,708', value: '2,280,708',
moneyName: '本月采购额', moneyName: '本月采购额',
moneyValue: '2,280,708' moneyValue: '2,280,708',
rate: '49%'
}, },
{ {
name: '总采购额', name: '总采购额',
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2023-07-06 16:19:15 * @Date: 2023-07-06 16:19:15
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-07 16:30:49 * @LastEditTime: 2023-07-10 14:37:14
--> -->
<template> <template>
<div class="merchant-box"> <div class="merchant-box">
...@@ -29,11 +29,11 @@ export default { ...@@ -29,11 +29,11 @@ export default {
return { return {
tooltipFormatterObj: [ tooltipFormatterObj: [
{ {
label: '商城', label: '开通商户',
attrName: 'data1' attrName: 'data1'
}, },
{ {
label: '自采', label: '采购商户',
attrName: 'data2' attrName: 'data2'
} }
], ],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!