Commit c381738a by 胡悦

修改样式

1 parent dcfb3847
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 15:58:43
* @LastEditTime: 2023-07-18 10:44:33
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -63,9 +63,9 @@ export default {
timer: null
}
},
created() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
},
// created() {
// this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
// },
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
......@@ -85,6 +85,7 @@ export default {
return _html
},
drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
this.barLineOptions.series[0].data = this.dataList.map(item => item.data1)
this.barLineOptions.series[1].data = this.dataList.map(item => item.data2)
......
import * as echarts from 'echarts'
import utils from '../utils/util'
function getBarLineOptions(obj) {
const { tooltipFormatter } = obj
const { tooltipFormatter, seriesData } = obj
var barLineOption = {
tooltip: {
trigger: 'axis',
......@@ -54,7 +54,9 @@ function getBarLineOptions(obj) {
position: 'top',
color: '#fff',
formatter: (params) => {
return params.value ? utils.numAddSymbol(params.value) : ''
const _dataIndex = params.dataIndex
const bar2Value = seriesData[_dataIndex].data2
return `${params.value ? utils.numAddSymbol(params.value) : 0}\n${bar2Value ? utils.numAddSymbol(bar2Value) : 0}`
}
},
itemStyle: {
......@@ -89,7 +91,8 @@ function getBarLineOptions(obj) {
position: 'top',
color: '#fff',
formatter: (params) => {
return params.value ? utils.numAddSymbol(params.value) : ''
// params.value ? utils.numAddSymbol(params.value) : ''
return ''
}
},
data: [],
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 10:57:38
* @LastEditTime: 2023-07-18 11:05:52
-->
<template>
<div class="left">
......@@ -37,19 +37,19 @@ export default {
{
name: '总采购额',
valueName: 'amounttotal',
value: '2,280,708',
value: '0',
bottomLabel: '本月采购额',
bottemName: 'amounttotalThismonth',
bottomValue: '2,280,708',
bottomValue: '0',
bottomType: 'money'
},
{
name: '商城采购额',
valueName: 'amountshop',
value: '2,280,708',
value: '0',
bottomLabel: '本月采购额',
bottemName: 'amountshopThismonth',
bottomValue: '2,280,708',
bottomValue: '0',
rate: '51%',
rateName: 'shopRate',
bottomType: 'money'
......@@ -57,10 +57,10 @@ export default {
{
name: '自采采购额',
valueName: 'amountself',
value: '2,280,708',
value: '0',
bottomLabel: '本月采购额',
bottemName: 'amountselfThismonth',
bottomValue: '2,280,708',
bottomValue: '0',
rate: '49%',
rateName: 'selfRate',
bottomType: 'money'
......@@ -68,18 +68,18 @@ export default {
{
name: '开通商户数',
valueName: 'opentotal',
value: '2,280,708',
value: '0',
bottomLabel: '本月开通商户数',
bottemName: 'openThismonth',
bottomValue: '2,280,708'
bottomValue: '0'
},
{
name: '采购商户数',
valueName: 'buytotal',
value: '2,280,708',
value: '0',
bottomLabel: '本月采购商户数',
bottemName: 'buyThismonth',
bottomValue: '2,280,708'
bottomValue: '0'
}
]
}
......@@ -94,7 +94,6 @@ export default {
async getSolarList() {
const _data = await this.api.solar.getAllPurchase({ year: this.$store.state.app.solarYear })
const _dataList = _data.data.dataList[0]
console.log(_dataList)
this.$bus.$emit('businessstarttime', _dataList.businessstarttime)
this.setSolarTime(_dataList.businessstarttime)
console.log(this.$store.state.app)
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 14:27:08
* @LastEditTime: 2023-07-18 11:03:42
-->
<template>
<div class="purchase-box">
<box-title title="近一年采购额趋势"></box-title>
<box-title title="采购额趋势"></box-title>
<div v-if="!isEmpty">
<BarLineChart ref="purchaseRef" height="30.23vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<div class="legend">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!