Commit 9747ee1f by 胡悦

提交代码

1 parent 17ad3424
......@@ -54,8 +54,8 @@ const getRegionMerchant = params => {
}
// 总 - 获取春雷行动业务趋势
const getSpringbugTrend = params => {
return window.$HTTP.get('upgrade/getSpringbugTrend', params)
const getSpringbudTrend = params => {
return window.$HTTP.get('upgrade/getSpringbudTrend', params)
}
export default {
......@@ -70,5 +70,5 @@ export default {
getMerchantSupply,
getMerchantTrend,
getRegionMerchant,
getSpringbugTrend
getSpringbudTrend
}
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-07-21 15:11:43
* @LastEditTime: 2023-07-26 14:38:43
-->
<template>
<div>
......@@ -87,6 +87,8 @@ export default {
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)
this.barLineOptions.series[2].data = this.dataList.map(item => item.data3)
this.barLineOptions.series[3].data = this.dataList.map(item => item.data4)
this[this.domId].setOption(this.barLineOptions)
},
chartBindEvent() {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
* @LastEditTime: 2023-07-21 15:49:39
* @LastEditTime: 2023-07-26 14:24:59
-->
<template>
<div class="left">
......@@ -17,18 +17,20 @@
<script>
import BoutiqueDate from '../boutique/BoutiqueDate.vue'
import { changeMixin } from '@/mixins'
export default {
name: 'BoutiqueLeft',
components: {
BoutiqueDate
},
mixins: [changeMixin],
computed: {
tabName() {
let sname
console.log(this.$store.state.app)
switch (this.activeName) {
case 0:
sname = this.$store.state.app.boutique.channel.value == '1' ? 'BarTrends' : 'BusinessTrends'
sname = this.$store.state.app.boutique.channel.value == 'cl' ? 'BarTrends' : 'BusinessTrends'
break
case 1:
sname = 'StoreMap'
......@@ -53,74 +55,80 @@ export default {
}],
channelList: [{
label: '全部渠道',
value: ''
}, {
label: '春蕾行动',
value: '1'
value: 'all'
}, {
label: '广汇渠道',
value: '2'
value: 'gh'
}, {
label: '春蕾行动',
value: 'cl'
}],
boutiqueList: [
{
name: '总门店数',
valueName: 'amounttotal',
valueName: 'totalMer',
value: '2708',
bottomLabel: '上月新增门店数:',
bottemName: 'amounttotalThismonth',
bottemName: 'incrMer',
bottomValue: '21'
},
{
name: '总产值',
valueName: 'amounttotal',
valueName: 'outputvalue',
value: '1000000',
unit: '¥',
bottomType: 'ratio',
ratioLeftLabel: '月环比',
ratioLeftValueName: 'outputvalueHB',
ratioLeftValue: '12',
ratioRightLabel: '年同比',
ratioRightValueName: 'outputvalueTB',
ratioRightValue: '-7'
},
{
name: '客单价',
valueName: 'amounttotal',
valueName: 'perCusTrans',
value: '1003',
unit: '¥',
bottomType: 'ratio',
ratioLeftLabel: '月环比',
ratioLeftValueName: 'perCusTransHB',
ratioLeftValue: '12',
ratioRightLabel: '年同比',
ratioRightValueName: 'perCusTransTB',
ratioRightValue: '-7'
},
{
name: '总转化率',
valueName: 'amounttotal',
valueName: 'conversionRate',
value: '58',
unit: '%',
bottomType: 'ratio',
ratioLeftLabel: '月环比',
ratioLeftValueName: 'conversionRateHB',
ratioLeftValue: '12',
ratioRightLabel: '年同比',
ratioRightValueName: 'conversionRateTB',
ratioRightValue: '-7'
},
{
name: '在营门店数',
valueName: 'amounttotal',
valueName: 'openMer',
value: '233'
},
{
name: '发放电子券门店',
valueName: 'amounttotal',
valueName: 'usedelecMer',
value: '233'
},
{
name: '嘀加供货门店',
valueName: 'amounttotal',
valueName: 'djsupplyMer',
value: '233'
},
{
name: '停业门店',
valueName: 'amounttotal',
valueName: 'closedMer',
value: '233'
}
],
......@@ -131,8 +139,28 @@ export default {
mounted() { },
methods: {
changeTab(data) {
console.log(data)
this.activeName = data
},
init() {
this.getAllOverview()
},
async getAllOverview() {
const { boutique } = this.$store.state.app
const params = {
year: boutique.year,
channelName: boutique.channel.value
}
const _data = await this.api.boutique.getAllOverview(params)
const _dataList = _data.data.dataList[0]
this.businessTime = _dataList.startTime
this.boutiqueList.forEach(item => {
item.value = _dataList[item.valueName]
if (item.bottomValue) item.bottomValue = _dataList[item.bottemName]
if (item.bottomType === 'ratio') {
item.ratioLeftValue = _dataList[item.ratioLeftValueName]
item.ratioRightValue = _dataList[item.ratioRightValueName]
}
})
}
}
}
......
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-20 10:19:06
* @LastEditors: huyue
* @LastEditTime: 2023-07-26 16:07:04
-->
<template>
<div>
<div id="map" class="map"></div>
......@@ -9,80 +16,96 @@ import * as echarts from 'echarts'
import mapBg from '../../assets/images/map-bg.jpg'
export default {
name: 'Map',
props: {
storeDistrictList: Array
},
data() {
return {
myChart: ''
}
},
mounted() {
var option = {
tooltip: {
show: true,
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: function(params) {
var _html = `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
<div style="color: #fff;">${params.name}</div>
<div style="display:flex;"><div style="color: #c9c9c9">客单价:</div><div style="color: #fff;">¥${params.data ? utils.numAddSymbol(params.data.value1) : 0}</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">转化率:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.value2) : 0}%</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">占比:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.rate) : 0}%</div></div>
</div>`
return _html
}
},
series: [{
type: 'map',
map: 'china',
data: [
{ name: '北京', value: 100, value1: 2323, value2: 43, rate: '29' },
{ name: '上海', value: 200, value1: 2323, value2: 3, rate: '29' },
{ name: '广东', value: 300, value1: 2323, value2: 34, rate: '29' }
],
itemStyle: {
// areaColor: '#061422',
areaColor: {
image: mapBg,
repeat: 'repeat'
},
borderColor: '#65C6F8',
shadowBlur: 10,
shadowColor: 'rgba(61, 87, 255, 0.41)'
this.myChart = echarts.init(document.getElementById('map'))
},
methods: {
getOptions(data) {
var option = {
tooltip: {
show: true,
borderWidth: 0,
padding: 0,
backgroundColor: '#051526',
formatter: function(params) {
console.log(params)
var _html = `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
<div style="color: #fff;">${params.name}</div>
<div style="display:flex;"><div style="color: #c9c9c9">客单价:</div><div style="color: #fff;">¥${params.data ? utils.numAddSymbol(params.data.perCusTrans) : 0}</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">转化率:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.conversionRate) : 0}%</div></div>
<div style="display:flex;"><div style="color: #c9c9c9">占比:</div><div style="color: #fff;">${params.data ? utils.numAddSymbol(params.data.rate) : 0}%</div></div>
</div>`
return _html
}
},
emphasis: {
label: {
color: '#fff'
},
series: [{
type: 'map',
map: 'china',
data: data,
itemStyle: {
// areaColor: '#061422',
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 0,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
}
image: mapBg,
repeat: 'repeat'
},
borderColor: '#65C6F8',
shadowBlur: 10,
shadowColor: 'rgba(61, 87, 255, 0.41)'
},
select: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
emphasis: {
label: {
color: '#fff'
},
itemStyle: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 0,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
}
},
select: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#079FF1' // 0% 处的颜色
}, {
offset: 1, color: '#6578FF' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
}
}
}]
}]
}
return option
},
drawMap(data) {
this.mapOption = this.getOptions(data)
// console.log(data)
// this.mapOption.series[0].data = data
console.log(this.mapOption)
this.myChart.setOption(this.mapOption)
}
var myChart = echarts.init(document.getElementById('map'))
myChart.setOption(option)
}
}
</script>
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-19 17:18:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-21 15:31:16
* @LastEditTime: 2023-07-26 14:37:47
-->
<template>
<div>
......@@ -25,12 +25,20 @@ export default {
return {
tooltipFormatterObj: [
{
label: '开通商户',
label: '部署门店',
attrName: 'data1'
},
{
label: '采购商户',
label: '在营门店',
attrName: 'data2'
},
{
label: '嘀加供货',
attrName: 'data3'
},
{
label: '停业门店',
attrName: 'data4'
}
],
dataList: [],
......@@ -44,8 +52,14 @@ export default {
this.getDataList()
},
async getDataList() {
const { boutique } = this.$store.state.app
const params = {
year: boutique.year,
channelName: boutique.channel.value
}
this.dataList = []
const _data = await this.api.solar.getAllPurchaseTrend({ year: this.$store.state.app.solarYear })
const _data = await this.api.boutique.getSpringbudTrend(params)
console.log(_data)
const _dataList = _data.data.dataList
if (!_dataList.length) {
this.isEmpty = true
......@@ -53,10 +67,11 @@ export default {
}
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount,
data3: item.shopratio
month: item.statMonth,
data1: item.deploy_num,
data2: item.open_num,
data3: item.dj_supply,
data4: item.close_num
})
})
this.$refs.barTrendsRef.drawBar()
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-19 17:18:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-19 17:38:57
* @LastEditTime: 2023-07-26 14:32:32
-->
<template>
<div>
......@@ -25,15 +25,15 @@ export default {
return {
tooltipFormatterObj: [
{
label: '商城',
label: '总产值',
attrName: 'data1'
},
{
label: '自采',
label: '客单价',
attrName: 'data2'
},
{
label: '占比',
label: '转化率',
attrName: 'data3',
addSymbol: '%'
}
......@@ -49,8 +49,14 @@ export default {
this.getDataList()
},
async getDataList() {
const { boutique } = this.$store.state.app
const params = {
year: boutique.year,
channelName: boutique.channel.value
}
this.dataList = []
const _data = await this.api.solar.getAllPurchaseTrend({ year: this.$store.state.app.solarYear })
const _data = await this.api.boutique.getAllTrend(params)
console.log(_data)
const _dataList = _data.data.dataList
if (!_dataList.length) {
this.isEmpty = true
......@@ -58,10 +64,10 @@ export default {
}
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount,
data3: item.shopratio
month: item.statMonth,
data1: item.outputvalue,
data2: item.perCusTrans,
data3: item.conversionRate
})
})
this.$refs.purchaseRef.drawBarLine()
......
......@@ -3,13 +3,13 @@
* @Author: huyue
* @Date: 2023-07-19 17:18:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-20 17:42:42
* @LastEditTime: 2023-07-26 15:32:18
-->
<template>
<div>
<box-title title="区域门店数据"></box-title>
<div class="content">
<Map></Map>
<Map ref="map" :mapData="storeDistrictList"></Map>
<div class="content-right">
<div class="rank-title">区域门店排行</div>
<Ranking :id="'storeDistrict'" :rankingsList="storeDistrictList" :rankingDataObj="rankStoreObj"></Ranking>
......@@ -19,69 +19,86 @@
</template>
<script>
import Map from '../Map.vue'
import { changeMixin } from '@/mixins'
export default {
name: 'StoreMap',
components: {
Map
},
mixins: [changeMixin],
data() {
return {
storeDistrictList: [
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '广东省',
per: '1225家'
province: '广东省',
num: '1225家'
},
{
name: '宁夏回族自治区',
per: '1225家'
province: '宁夏回族自治区',
num: '1225家'
},
{
name: '西藏自治区',
per: '1225家'
province: '西藏自治区',
num: '1225家'
},
{
name: '新疆',
per: '1225家'
province: '新疆',
num: '1225家'
}
],
rankStoreObj: [
{
name: 'name',
name: 'province',
width: '9.72vw'
},
{
name: 'per'
name: 'num'
}
]
}
},
methods: {
init() {
this.getData()
},
async getData() {
const { boutique } = this.$store.state.app
const params = {
year: boutique.year,
channelName: boutique.channel.value
}
const _data = await this.api.boutique.getRegionMerchant(params)
this.storeDistrictList = _data.data.dataList
this.$refs.map.drawMap(this.storeDistrictList)
}
}
}
</script>
......
......@@ -67,7 +67,9 @@ export default {
mounted() {},
methods: {}
methods: {
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!