Commit 6509d200 by 匡雅琴

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

2 parents 09a0956f 98dc0c49
<!--
* @Description:
* @Description: 柱状图
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:24:23
* @LastEditTime: 2023-07-07 14:59:28
-->
<template>
<div>
......@@ -67,6 +67,7 @@ export default {
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
......@@ -86,6 +87,12 @@ export default {
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:04:18
* @LastEditTime: 2023-07-07 16:22:32
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -68,18 +68,20 @@ export default {
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
},
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
},
drawBarLine() {
console.log(this.dataList)
......@@ -88,6 +90,12 @@ export default {
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)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
}
}
}
......
......@@ -5,13 +5,26 @@ function getBarLineOptions(obj) {
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
padding: 0,
// borderColor: function(p) {
// return new echarts.graphic.LinearGradient(
// 0, 0, 0, 1, [{ // 代表渐变色从正上方开始
// offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
// color: '#074989'
// }, // 柱图渐变色
// {
// offset: 1, // 指100%处的颜色
// color: '#30DCFF'
// }]
// )
// },
backgroundColor: '#051526',
// textStyle: {
// color: '#c9c9c9',
// fontSize: '1.5px'
// },
formatter: tooltipFormatter || ''
// confine: true
},
xAxis: {
data: []
......@@ -41,7 +54,7 @@ function getBarLineOptions(obj) {
],
grid: {
left: '3%',
right: '4%',
right: '2%',
top: '20%',
bottom: '6%',
containLabel: true
......
......@@ -3,20 +3,16 @@
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:35:44
* @LastEditTime: 2023-07-07 16:23:54
*/
import * as echarts from 'echarts'
function getBarLineOptions(obj) {
const { tooltipFormatter } = obj
var barLineOption = {
tooltip: {
show: false,
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
},
......@@ -37,7 +33,7 @@ function getBarLineOptions(obj) {
grid: {
left: '3%',
right: '4%',
top: '10%',
top: '20%',
bottom: '6%',
containLabel: true
},
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-06 11:46:13
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 18:01:41
-->
<template>
<div class="main-box">
<div class="trapezoid"><div class="point">....</div></div>
<div class="right-box">
<div class="trangle"></div>
<div class="text-box">{{title}}</div>
</div>
<div class="trapezoid"> <div class="text-box">{{title}}</div></div>
</div>
</template>
......@@ -32,46 +35,22 @@ export default {
<style lang="scss" scoped>
.main-box {
position: relative;
background-image: url('../assets/images/title-bg.png');
background-repeat: no-repeat;
background-size: 9.04vw 3.33vh;
}
.trapezoid {
width: 0;
height: 0;
border-top: 30px solid #0085CD;
border-right: 8px solid transparent;
border-left: 10px solid #0085CD;
.point {
position: absolute;
top: 1px;
left: 1px;
font-size: 19px;
color: #fff;
transform: rotate(90deg);
}
}
.right-box {
position: absolute;
top: 0;
left: 15px;
display: flex;
.trangle {
width: 0;
height: 0;
border: #0085CD;
border-style: solid;
border-width: 20px 8px 0 0;
border-top: 30px solid transparent;
}
.text-box {
width: 126px;
height: 29.5px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 29.5px;
padding-left: 2px;
background-image: linear-gradient(270deg, #6578ff00 0%, #5542ff87 53%, #0085CD 100%);
height: 3.33vh;
.text-box {
// width: 126px;
height: 3.33vh;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 14px;
color: #FFFFFF;
line-height: 3.33vh;
margin-left: 1.67vw;
}
}
</style>
......@@ -46,6 +46,7 @@ export default {
.statistics {
display: flex;
color: #fff;
height: 11.78vh;
&-item {
padding: 0.89vh 0.53vw;
margin-right: 1.11vw;
......@@ -56,13 +57,13 @@ export default {
}
}
&-top {
padding-bottom: 0.89vh;
padding-left: 0.3vw;
}
&-name {
font-weight: 500;
font-size: 14px;
margin-bottom: 0.89vh;
height: 2.22vh;
}
&-price {
display: flex;
......@@ -70,6 +71,7 @@ export default {
color: #25D6FF;
font-weight: 600;
font-size: 14px;
height: 3.11vh;
&-number {
padding-left: 0.56vw;
font-size: 20px;
......@@ -86,6 +88,7 @@ export default {
color: #95ACD9;
border-top: 1px solid #2A3D72;
padding: 0.89vh 0.3vw 0;
margin-top: 0.89vh;
}
}
</style>
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:38:42
* @LastEditTime: 2023-07-07 14:19:28
-->
<template>
<div class="left">
......
......@@ -3,11 +3,19 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:35:36
* @LastEditTime: 2023-07-07 16:30:49
-->
<template>
<div class="merchant-box">
<box-title title="商户开通及使用趋势"></box-title>
<div class="legend">
<div class="legend-item">
<span class="open"></span>开通商户
</div>
<div class="legend-item">
<span class="procure"></span>采购商户
</div>
</div>
<BarChart ref="merchantTrendsRef" height="28.67vh" domId="merchantTrends" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarChart>
</div>
</template>
......@@ -55,8 +63,37 @@ export default {
</script>
<style scoped lang='scss'>
.merchant-box {
position: relative;
// margin: 1.78vh 0;
background-color: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.legend {
position: absolute;
display: flex;
align-items: center;
top: 3.97vh;
left: 50%;
transform: translateX(-50%);
&-item {
display: flex;
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
.open,
.procure {
width: 0.56vw;
height: 0.89vh;
}
.open {
background-image: linear-gradient(180deg, #22D8FF 0%, #223FA9 100%);
}
.procure {
background-image: linear-gradient(180deg, #38FBB0 1%, #00A89E 100%);
}
}
}
}
</style>
......@@ -3,12 +3,27 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:46:37
* @LastEditTime: 2023-07-07 18:08:57
-->
<template>
<div class="purchase-box">
<box-title title="采购额排名"></box-title>
<BarLineChart ref="purchaseRef" height="28.48vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<BarLineChart ref="purchaseRef" height="30.23vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<div class="legend">
<div class="legend-item shop">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
<span>商城</span>
</div>
<div class="legend-item self">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
自采
</div>
<div class="legend-item">
<img class="icon-line" src="@/assets/images/icon-line.png" alt="">商城采购占比
</div>
</div>
</div>
</template>
......@@ -61,8 +76,58 @@ export default {
</script>
<style scoped lang='scss'>
.purchase-box {
position: relative;
margin: 1.78vh 0;
background-color: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
.legend {
display: flex;
position: absolute;
right: 1.39vw;
top: 2.22vh;
&-item {
display: flex;
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
img {
width: 1.32vw;
height: 1vh;
margin-right: 0.28vw;
}
.icon-line {
width: 0.98vw;
height: 0.56vh;
}
.legend-even,
.legend-odd {
display: inline-block;
width: 0.83vw;
height: 1.33vh;
margin-right: 0.28vw;
font-size: 8px;
text-align: center;
}
}
}
}
.shop {
.legend-even {
background-image: linear-gradient(180deg, #2AD190 1%, #00B7DF 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #22D8FF 0%, #5C56FF 100%);
}
}
.self {
.legend-even {
background-image: linear-gradient(180deg, #145F4E 1%, #035972 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #11627A 0%, #282F7A 100%);
}
}
</style>
......@@ -11,7 +11,22 @@
<!-- 采购趋势 -->
<div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title>
<BarLineChart ref="purchaseTrend" height="31.78vh" domId="purchaseTrend" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<div class="legend">
<div class="legend-item shop">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
<span>商城</span>
</div>
<div class="legend-item self">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
自采
</div>
<div class="legend-item">
<img class="icon-line" src="@/assets/images/icon-line.png" alt="">商城采购占比
</div>
</div>
<BarLineChart ref="purchaseTrend" height="36.45vh" domId="purchaseTrend" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
</div>
<!-- 商品占比 -->
<div class="propotion-box flex">
......@@ -250,6 +265,7 @@ export default {
margin-top: 1.78vh;
}
.tendency-box {
position: relative;
width: 96.67vw;
height: 39.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
......@@ -269,4 +285,53 @@ export default {
}
}
}
.legend {
display: flex;
position: absolute;
right: 1.39vw;
top: 2.22vh;
&-item {
display: flex;
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
img {
width: 1.32vw;
height: 1vh;
margin-right: 0.28vw;
}
.icon-line {
width: 0.98vw;
height: 0.56vh;
}
.legend-even,
.legend-odd {
display: inline-block;
width: 0.83vw;
height: 1.33vh;
margin-right: 0.28vw;
font-size: 8px;
text-align: center;
}
}
}
.shop {
.legend-even {
background-image: linear-gradient(180deg, #2AD190 1%, #00B7DF 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #22D8FF 0%, #5C56FF 100%);
}
}
.self {
.legend-even {
background-image: linear-gradient(180deg, #145F4E 1%, #035972 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #11627A 0%, #282F7A 100%);
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!