Commit 63ff204f by 匡雅琴

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

2 parents 22e4040f 6e681226
...@@ -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-17 15:58:43 * @LastEditTime: 2023-07-18 10:44:33
* @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
--> -->
...@@ -63,9 +63,9 @@ export default { ...@@ -63,9 +63,9 @@ export default {
timer: null timer: null
} }
}, },
created() { // created() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter }) // this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter })
}, // },
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)
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
return _html return _html
}, },
drawBarLine() { drawBarLine() {
this.barLineOptions = getBarLineOptions({ tooltipFormatter: this.tooltipFormatter, seriesData: this.dataList })
this.barLineOptions.xAxis.data = this.dataList.map(item => item.month) this.barLineOptions.xAxis.data = this.dataList.map(item => item.month)
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)
......
import * as echarts from 'echarts' import * as echarts from 'echarts'
import utils from '../utils/util' import utils from '../utils/util'
function getBarLineOptions(obj) { function getBarLineOptions(obj) {
const { tooltipFormatter } = obj const { tooltipFormatter, seriesData } = obj
var barLineOption = { var barLineOption = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -54,7 +54,9 @@ function getBarLineOptions(obj) { ...@@ -54,7 +54,9 @@ function getBarLineOptions(obj) {
position: 'top', position: 'top',
color: '#fff', color: '#fff',
formatter: (params) => { 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: { itemStyle: {
...@@ -89,7 +91,8 @@ function getBarLineOptions(obj) { ...@@ -89,7 +91,8 @@ function getBarLineOptions(obj) {
position: 'top', position: 'top',
color: '#fff', color: '#fff',
formatter: (params) => { formatter: (params) => {
return params.value ? utils.numAddSymbol(params.value) : '' // params.value ? utils.numAddSymbol(params.value) : ''
return ''
} }
}, },
data: [], data: [],
......
...@@ -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-14 10:57:38 * @LastEditTime: 2023-07-18 11:05:52
--> -->
<template> <template>
<div class="left"> <div class="left">
...@@ -37,19 +37,19 @@ export default { ...@@ -37,19 +37,19 @@ export default {
{ {
name: '总采购额', name: '总采购额',
valueName: 'amounttotal', valueName: 'amounttotal',
value: '2,280,708', value: '0',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amounttotalThismonth', bottemName: 'amounttotalThismonth',
bottomValue: '2,280,708', bottomValue: '0',
bottomType: 'money' bottomType: 'money'
}, },
{ {
name: '商城采购额', name: '商城采购额',
valueName: 'amountshop', valueName: 'amountshop',
value: '2,280,708', value: '0',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amountshopThismonth', bottemName: 'amountshopThismonth',
bottomValue: '2,280,708', bottomValue: '0',
rate: '51%', rate: '51%',
rateName: 'shopRate', rateName: 'shopRate',
bottomType: 'money' bottomType: 'money'
...@@ -57,10 +57,10 @@ export default { ...@@ -57,10 +57,10 @@ export default {
{ {
name: '自采采购额', name: '自采采购额',
valueName: 'amountself', valueName: 'amountself',
value: '2,280,708', value: '0',
bottomLabel: '本月采购额', bottomLabel: '本月采购额',
bottemName: 'amountselfThismonth', bottemName: 'amountselfThismonth',
bottomValue: '2,280,708', bottomValue: '0',
rate: '49%', rate: '49%',
rateName: 'selfRate', rateName: 'selfRate',
bottomType: 'money' bottomType: 'money'
...@@ -68,18 +68,18 @@ export default { ...@@ -68,18 +68,18 @@ export default {
{ {
name: '开通商户数', name: '开通商户数',
valueName: 'opentotal', valueName: 'opentotal',
value: '2,280,708', value: '0',
bottomLabel: '本月开通商户数', bottomLabel: '本月开通商户数',
bottemName: 'openThismonth', bottemName: 'openThismonth',
bottomValue: '2,280,708' bottomValue: '0'
}, },
{ {
name: '采购商户数', name: '采购商户数',
valueName: 'buytotal', valueName: 'buytotal',
value: '2,280,708', value: '0',
bottomLabel: '本月采购商户数', bottomLabel: '本月采购商户数',
bottemName: 'buyThismonth', bottemName: 'buyThismonth',
bottomValue: '2,280,708' bottomValue: '0'
} }
] ]
} }
...@@ -94,7 +94,6 @@ export default { ...@@ -94,7 +94,6 @@ export default {
async getSolarList() { async getSolarList() {
const _data = await this.api.solar.getAllPurchase({ year: this.$store.state.app.solarYear }) const _data = await this.api.solar.getAllPurchase({ year: this.$store.state.app.solarYear })
const _dataList = _data.data.dataList[0] const _dataList = _data.data.dataList[0]
console.log(_dataList)
this.$bus.$emit('businessstarttime', _dataList.businessstarttime) this.$bus.$emit('businessstarttime', _dataList.businessstarttime)
this.setSolarTime(_dataList.businessstarttime) this.setSolarTime(_dataList.businessstarttime)
console.log(this.$store.state.app) console.log(this.$store.state.app)
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* @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-14 14:27:08 * @LastEditTime: 2023-07-18 11:03:42
--> -->
<template> <template>
<div class="purchase-box"> <div class="purchase-box">
<box-title title="近一年采购额趋势"></box-title> <box-title title="采购额趋势"></box-title>
<div v-if="!isEmpty"> <div v-if="!isEmpty">
<BarLineChart ref="purchaseRef" height="30.23vh" 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">
......
...@@ -157,11 +157,11 @@ export default { ...@@ -157,11 +157,11 @@ export default {
this.openMessage('获取门店商品采购占比失败') this.openMessage('获取门店商品采购占比失败')
return return
} }
const _dataList = res.data.dataList if (!res.data || !res.data.dataList.length) {
if (!_dataList.length) {
this.isEmpty = true this.isEmpty = true
return return
} }
const _dataList = res.data.dataList
_dataList.forEach((item, index) => { _dataList.forEach((item, index) => {
this.dataList[index] = { this.dataList[index] = {
month: item.statDate, month: item.statDate,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!