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 * @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:24:23 * @LastEditTime: 2023-07-07 14:59:28
--> -->
<template> <template>
<div> <div>
...@@ -67,6 +67,7 @@ export default { ...@@ -67,6 +67,7 @@ export default {
mounted() { mounted() {
this.barLineDom = document.getElementById(this.domId) this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom) this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
}, },
methods: { methods: {
tooltipFormatter(obj) { tooltipFormatter(obj) {
...@@ -86,6 +87,12 @@ export default { ...@@ -86,6 +87,12 @@ export default {
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1) 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[1].data = this.dataList.map(item => item.data2)
this[this.domId].setOption(this.barLineOptions) this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:04:18 * @LastEditTime: 2023-07-07 16:22:32
* @FilePath: \dj-data-view\src\components\ViewTitle.vue * @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -68,18 +68,20 @@ export default { ...@@ -68,18 +68,20 @@ export default {
mounted() { mounted() {
this.barLineDom = document.getElementById(this.domId) this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom) this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
}, },
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
}, },
drawBarLine() { drawBarLine() {
console.log(this.dataList) console.log(this.dataList)
...@@ -88,6 +90,12 @@ export default { ...@@ -88,6 +90,12 @@ export default {
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2) this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3) this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this[this.domId].setOption(this.barLineOptions) this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
// resize
window.addEventListener('resize', () => {
this[this.domId].resize()
})
} }
} }
} }
......
...@@ -5,13 +5,26 @@ function getBarLineOptions(obj) { ...@@ -5,13 +5,26 @@ function getBarLineOptions(obj) {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
borderWidth: 0, borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)', padding: 0,
textStyle: { // borderColor: function(p) {
color: 'rgba(255,255,255,0.6)', // return new echarts.graphic.LinearGradient(
fontSize: '1.5px' // 0, 0, 0, 1, [{ // 代表渐变色从正上方开始
}, // offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
formatter: tooltipFormatter || '', // color: '#074989'
confine: true // }, // 柱图渐变色
// {
// offset: 1, // 指100%处的颜色
// color: '#30DCFF'
// }]
// )
// },
backgroundColor: '#051526',
// textStyle: {
// color: '#c9c9c9',
// fontSize: '1.5px'
// },
formatter: tooltipFormatter || ''
// confine: true
}, },
xAxis: { xAxis: {
data: [] data: []
...@@ -41,7 +54,7 @@ function getBarLineOptions(obj) { ...@@ -41,7 +54,7 @@ function getBarLineOptions(obj) {
], ],
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '2%',
top: '20%', top: '20%',
bottom: '6%', bottom: '6%',
containLabel: true containLabel: true
......
...@@ -3,20 +3,16 @@ ...@@ -3,20 +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 14:35:44 * @LastEditTime: 2023-07-07 16:23:54
*/ */
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,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: 'rgba(255,255,255,0.6)',
fontSize: '1.5px'
},
formatter: tooltipFormatter || '', formatter: tooltipFormatter || '',
confine: true confine: true
}, },
...@@ -37,7 +33,7 @@ function getBarLineOptions(obj) { ...@@ -37,7 +33,7 @@ function getBarLineOptions(obj) {
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
top: '10%', top: '20%',
bottom: '6%', bottom: '6%',
containLabel: true containLabel: true
}, },
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-06 11:46:13
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 18:01:41
-->
<template> <template>
<div class="main-box"> <div class="main-box">
<div class="trapezoid"><div class="point">....</div></div> <div class="trapezoid"> <div class="text-box">{{title}}</div></div>
<div class="right-box">
<div class="trangle"></div>
<div class="text-box">{{title}}</div>
</div>
</div> </div>
</template> </template>
...@@ -32,46 +35,22 @@ export default { ...@@ -32,46 +35,22 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.main-box { .main-box {
position: relative; position: relative;
background-image: url('../assets/images/title-bg.png');
background-repeat: no-repeat;
background-size: 9.04vw 3.33vh;
} }
.trapezoid { .trapezoid {
width: 0; height: 3.33vh;
height: 0; .text-box {
border-top: 30px solid #0085CD; // width: 126px;
border-right: 8px solid transparent; height: 3.33vh;
border-left: 10px solid #0085CD; font-family: PingFangSC-Medium;
.point { font-weight: 500;
position: absolute; font-size: 14px;
top: 1px; color: #FFFFFF;
left: 1px; line-height: 3.33vh;
font-size: 19px; margin-left: 1.67vw;
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%);
} }
} }
</style> </style>
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
.statistics { .statistics {
display: flex; display: flex;
color: #fff; color: #fff;
height: 11.78vh;
&-item { &-item {
padding: 0.89vh 0.53vw; padding: 0.89vh 0.53vw;
margin-right: 1.11vw; margin-right: 1.11vw;
...@@ -56,13 +57,13 @@ export default { ...@@ -56,13 +57,13 @@ export default {
} }
} }
&-top { &-top {
padding-bottom: 0.89vh;
padding-left: 0.3vw; padding-left: 0.3vw;
} }
&-name { &-name {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
margin-bottom: 0.89vh; margin-bottom: 0.89vh;
height: 2.22vh;
} }
&-price { &-price {
display: flex; display: flex;
...@@ -70,6 +71,7 @@ export default { ...@@ -70,6 +71,7 @@ export default {
color: #25D6FF; color: #25D6FF;
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
height: 3.11vh;
&-number { &-number {
padding-left: 0.56vw; padding-left: 0.56vw;
font-size: 20px; font-size: 20px;
...@@ -86,6 +88,7 @@ export default { ...@@ -86,6 +88,7 @@ export default {
color: #95ACD9; color: #95ACD9;
border-top: 1px solid #2A3D72; border-top: 1px solid #2A3D72;
padding: 0.89vh 0.3vw 0; padding: 0.89vh 0.3vw 0;
margin-top: 0.89vh;
} }
} }
</style> </style>
...@@ -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:38:42 * @LastEditTime: 2023-07-07 14:19:28
--> -->
<template> <template>
<div class="left"> <div class="left">
......
...@@ -3,11 +3,19 @@ ...@@ -3,11 +3,19 @@
* @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 14:35:36 * @LastEditTime: 2023-07-07 16:30:49
--> -->
<template> <template>
<div class="merchant-box"> <div class="merchant-box">
<box-title title="商户开通及使用趋势"></box-title> <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> <BarChart ref="merchantTrendsRef" height="28.67vh" domId="merchantTrends" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarChart>
</div> </div>
</template> </template>
...@@ -55,8 +63,37 @@ export default { ...@@ -55,8 +63,37 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.merchant-box { .merchant-box {
position: relative;
// margin: 1.78vh 0; // margin: 1.78vh 0;
background-color: #061422; background-color: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69; 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> </style>
...@@ -3,12 +3,27 @@ ...@@ -3,12 +3,27 @@
* @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 14:46:37 * @LastEditTime: 2023-07-07 18:08:57
--> -->
<template> <template>
<div class="purchase-box"> <div class="purchase-box">
<box-title title="采购额排名"></box-title> <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> </div>
</template> </template>
...@@ -61,8 +76,58 @@ export default { ...@@ -61,8 +76,58 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.purchase-box { .purchase-box {
position: relative;
margin: 1.78vh 0; margin: 1.78vh 0;
background-color: #061422; background-color: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69; 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> </style>
...@@ -11,7 +11,22 @@ ...@@ -11,7 +11,22 @@
<!-- 采购趋势 --> <!-- 采购趋势 -->
<div class="tendency-box"> <div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title> <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>
<!-- 商品占比 --> <!-- 商品占比 -->
<div class="propotion-box flex"> <div class="propotion-box flex">
...@@ -250,6 +265,7 @@ export default { ...@@ -250,6 +265,7 @@ export default {
margin-top: 1.78vh; margin-top: 1.78vh;
} }
.tendency-box { .tendency-box {
position: relative;
width: 96.67vw; width: 96.67vw;
height: 39.78vh; height: 39.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69; box-shadow: inset 0 0 20px 0 #3d57ff69;
...@@ -269,4 +285,53 @@ export default { ...@@ -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> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!