Commit b0f6e301 by 匡雅琴

第一轮bug修复

1 parent d0446bfb
......@@ -64,20 +64,8 @@ export default {
this.chartBindEvent()
},
methods: {
tooltipFormatter(obj) {
var _currentItem = this.dataList[obj[0].dataIndex]
var _html = ''
var _txt = ''
this.tooltipFormatterObj.forEach(item => {
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${item.addSymbol || ''}</div></div>`
})
_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(dataList) {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: dataList })
this.barLineOptions = getBarLineOptions({ seriesData: dataList })
this.barLineOptions.xAxis.data = dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = dataList.map(item => item.channel_zx)
this.barLineOptions.series[1].data = dataList.map(item => item.channel_qd)
......
......@@ -3,13 +3,13 @@ import utils from '../../../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: tooltipFormatter || ''
},
// tooltip: {
// trigger: 'axis',
// borderWidth: 0,
// padding: 0,
// backgroundColor: '#051526',
// formatter: tooltipFormatter || ''
// },
xAxis: {
data: []
},
......@@ -23,7 +23,13 @@ function getBarLineOptions(obj) {
color: '#1d2a38'
}
},
splitNumber: 4
splitNumber: 4,
axisLabel: {
// 这种做法就是在y轴的数据的值旁边拼接单位,貌似也挺方便的
formatter: function(value) {
return `${value / 10000}万`
}
}
},
grid: {
left: '3%',
......@@ -43,29 +49,27 @@ function getBarLineOptions(obj) {
position: 'top',
color: '#fff',
formatter: params => {
params.value ? utils.numAddSymbol(params.value) : ''
return params.value
return params.value ? utils.numAddSymbol((params.value / 10000).toFixed(0)) : ''
}
},
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function (params) {
// const colorList = [
// ['#22D8FF', '#5C56FF'],
// ['#2AD190', '#00B7DF']
// ]
const colorList = ['#22D8FF', '#5C56FF']
// var colorItem = []
// colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
color: function(params) {
const colorList = [
['#22D8FF', '#5C56FF'],
['#2AD190', '#00B7DF']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
// 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorList[0]
color: colorItem[0]
}, // 柱图渐变色
{
offset: 1, // 指100%处的颜色
color: colorList[1]
color: colorItem[1]
}
])
}
......@@ -81,30 +85,28 @@ function getBarLineOptions(obj) {
position: 'top',
color: '#fff',
formatter: params => {
params.value ? utils.numAddSymbol(params.value) : ''
return params.value
return params.value ? utils.numAddSymbol((params.value / 10000).toFixed(0)) : ''
}
},
data: [],
itemStyle: {
barBorderRadius: [2, 2, 0, 0], // 柱体圆角
color: function (params) {
// const colorList = [
// ['#11627A', '#282F7A'],
// ['#145F4E', '#035972']
// ]
const colorList = ['#11627A', '#282F7A']
// var colorItem = []
// colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
color: function(params) {
const colorList = [
['#11627A', '#282F7A'],
['#145F4E', '#035972']
]
var colorItem = []
colorItem = params.dataIndex % 2 === 0 ? colorList[0] : colorList[1]
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
// 代表渐变色从正上方开始
offset: 0, // offset范围是0~1,用于表示位置,0是指0%处的颜色
color: colorList[0]
color: colorItem[0]
}, // 柱图渐变色
{
offset: 1, // 指100%处的颜色
color: colorList[1]
color: colorItem[1]
}
])
}
......
......@@ -20,7 +20,7 @@ export default {
},
boxWidth: {
type: String,
default: '5vw'
default: ''
},
unit: {
type: String,
......
......@@ -18,19 +18,31 @@
<DoubleBarChart ref="saleChartRef" domId="purchase" :height="chartHeight" :colorList="colorList" valueName="channel"></DoubleBarChart>
<div class="legend">
<div class="legend-item shop">
<span class="legend-even">直销</span>
<span class="legend-odd">渠道</span>
<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>
</div>
<div class="trend-box">
<div class="patch-title">按年统计客户销售金额的合理性 -<PriceSwitch class="rationality" unit="" isObject :selectList="selectList" @selectPrice="selectRationality"></PriceSwitch></div>
<div class="rationality-text">收入占比:{{ratio}}% <PriceSwitch style="display: inline-block;" :selectList="rationalityPriceList" @selectPrice="selectPrice"></PriceSwitch></div>
<div class="patch-title">
按年统计客户销售金额的合理性 -
<PriceSwitch class="rationality" unit="" isObject :selectList="selectList" @selectPrice="selectRationality"></PriceSwitch>
</div>
<div class="rationality-text">
收入占比:{{ ratio }}%
<PriceSwitch style="display: inline-block" :selectList="rationalityPriceList" @selectPrice="selectPrice"></PriceSwitch>
</div>
<BarChart ref="rationalityChartRef" domId="rationalityChart" height="13.99vh" label="statDate" :barWidth="'50'" :colorList="greenColorList" valueName="num"></BarChart>
</div>
<div class="trend-box">
<div class="patch-title">设备订阅数量和线索相关性分析</div>
<div class="correlation"><PriceSwitch style="display: inline-block;" unit="" boxWidth="6.94vw" :selectList="serviceList" @selectPrice="selectCorrelation"></PriceSwitch></div>
<div class="correlation"><PriceSwitch style="display: inline-block" unit="" boxWidth="6.94vw" :selectList="serviceList" @selectPrice="selectCorrelation"></PriceSwitch></div>
<LineChart ref="correlationChartRef" domId="correlationChart" height="13.99vh" :tooltipFormatterObj="correlationTooltips" :valName="correlationTooltips.attrName"></LineChart>
</div>
</div>
......@@ -171,7 +183,7 @@ export default {
.legend-even,
.legend-odd {
display: inline-block;
width: 1.83vw;
width: 0.83vw;
height: 1.33vh;
line-height: 1.33vh;
margin-right: 0.28vw;
......@@ -180,13 +192,21 @@ export default {
}
}
.shop {
.legend-even {
background-image: linear-gradient(180deg, #22d8ff 0%, #5c56ff 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #11627a 0%, #282f7a 100%);
}
}
.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%);
}
}
}
}
.trend-box {
......@@ -200,30 +220,29 @@ export default {
}
.rationality {
display: inline-block;
/deep/ {
.type-plugin{
.trend-type-box {
padding-left: 5px;
}
.text {
font-weight: 400;
font-size: 14px;
}
/deep/ {
.type-plugin {
.trend-type-box {
padding-left: 5px;
}
.text {
font-weight: 400;
font-size: 14px;
}
}
&-text {
display: flex;
justify-content: space-between;
font-size: 10px;
font-weight: 600;
color: #fff;
margin-top: 1.33vh;
}
}
&-text {
display: flex;
justify-content: space-between;
font-size: 10px;
font-weight: 600;
color: #fff;
margin-top: 1.33vh;
}
}
.correlation {
display: flex;
flex-direction: row-reverse;
margin-top: 1.33vh;
}
</style>
......@@ -50,7 +50,7 @@ export default {
name: 'purchaseamount',
hasIcon: '¥',
type: 'number',
width: '5vw'
width: '5.5vw'
}
]
}
......
......@@ -42,6 +42,9 @@ export default {
font-weight: 500;
font-size: 11px;
text-align: center;
height: 26.33vh;
overflow: auto;
background-color: #061422;
thead {
height: 3.11vh;
background: #0a214d;
......@@ -54,7 +57,7 @@ export default {
}
.el-table__body-wrapper {
max-height: 52vh;
overflow-y: scroll;
// overflow-y: scroll;
}
.el-table tr {
background-color: #061422;
......@@ -75,7 +78,7 @@ export default {
}
.el-table td.el-table__cell,
.el-table th.el-table__cell.is-leaf {
border-bottom: 1px solid #161C5F;
border-bottom: 1px solid #161c5f;
}
.el-table--border::after,
.el-table--group::after,
......@@ -97,7 +100,7 @@ export default {
line-height: 1vw;
}
.el-table__empty-text {
line-height: 2.11vh;
line-height: 2.11vh;
}
</style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!