Commit f7125f68 by 前端

更新sass+代码

1 parent eadbc3db
...@@ -20,9 +20,9 @@ const getVehicleBrandTop5Monthly = params => { ...@@ -20,9 +20,9 @@ const getVehicleBrandTop5Monthly = params => {
} }
// 获取商品统计——整体品类排名 // 获取商品统计——整体品类排名
const getAllGoodsDistribution = params => { // const getAllGoodsDistribution = params => {
return window.$HTTP.get('CrowdFunding/getAllGoodsDistribution', params) // return window.$HTTP.get('CrowdFunding/getAllGoodsDistribution', params)
} // }
// 活动统计_整体车型排名 // 活动统计_整体车型排名
const getVehicleBrandRanking = params => { const getVehicleBrandRanking = params => {
...@@ -34,12 +34,24 @@ const getOrderMonthlyTrend = params => { ...@@ -34,12 +34,24 @@ const getOrderMonthlyTrend = params => {
return window.$HTTP.get('CrowdFunding/getOrderMonthlyTrend', params) return window.$HTTP.get('CrowdFunding/getOrderMonthlyTrend', params)
} }
// 滚动接口
const getGoodsOrderinfoMonthly = params => {
return window.$HTTP.get('/CrowdFunding/getGoodsMonthlyRanking', params)
}
const getAllGoodsDistribution = params => {
return window.$HTTP.get('/CrowdFunding/getVehicleBrandRanking', params)
}
export default { export default {
getTotal, getTotal,
getGoodsTop5Monthly, getGoodsTop5Monthly,
getMonth, getMonth,
getVehicleBrandTop5Monthly, getVehicleBrandTop5Monthly,
getAllGoodsDistribution, // getAllGoodsDistribution,
getVehicleBrandRanking, getVehicleBrandRanking,
getOrderMonthlyTrend getOrderMonthlyTrend,
// getGoodsOrderinfoMonthly,
getAllGoodsDistribution,
getGoodsOrderinfoMonthly
} }
...@@ -29,6 +29,15 @@ const getTop10Coupon = params => { ...@@ -29,6 +29,15 @@ const getTop10Coupon = params => {
const getOrderMonthlyTrend = params => { const getOrderMonthlyTrend = params => {
return window.$HTTP.get('ExpandedGold/getOrderMonthlyTrend', params) return window.$HTTP.get('ExpandedGold/getOrderMonthlyTrend', params)
} }
// 滚动接口
const getGoodsOrderinfoMonthly = params => {
return window.$HTTP.get('/ExpandedGold/getActivitiesMonthlyRanking', params)
}
const getAllGoodsDistribution = params => {
return window.$HTTP.get('/ExpandedGold/getTop10Coupon', params)
}
export default { export default {
getTotal, getTotal,
getMonth, getMonth,
...@@ -36,5 +45,7 @@ export default { ...@@ -36,5 +45,7 @@ export default {
getTop5CouponMonthly, getTop5CouponMonthly,
getActivitiesMonthly, getActivitiesMonthly,
getTop10Coupon, getTop10Coupon,
getOrderMonthlyTrend getOrderMonthlyTrend,
getGoodsOrderinfoMonthly,
getAllGoodsDistribution
} }
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
watch: { watch: {
list: { list: {
handler(newVal) { handler(newVal) {
if (newVal.length > 0) { if (newVal && newVal.length > 0) {
this.initData() this.initData()
this.$nextTick(() => { this.$nextTick(() => {
this.draw() this.draw()
...@@ -183,7 +183,7 @@ export default { ...@@ -183,7 +183,7 @@ export default {
}, },
//高亮 //高亮
pieActive() { pieActive() {
const dataLen = this.option.series[0].data.length const dataLen = this.option.series[0].data?.length
this.currentIndex = (this.currentIndex + 1) % dataLen this.currentIndex = (this.currentIndex + 1) % dataLen
this.highlightPie() this.highlightPie()
this.emitEvent(this.viewData[this.currentIndex]) this.emitEvent(this.viewData[this.currentIndex])
......
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
<div class='content-wrap'> <div class='content-wrap'>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>订单量</div> <div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum11 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.orderNum11) }}</div>
</div> </div>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>产值</div> <div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue11 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.outputValue11) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -51,11 +51,11 @@ ...@@ -51,11 +51,11 @@
<div class='content-wrap'> <div class='content-wrap'>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>订单量</div> <div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum12 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.orderNum12) }}</div>
</div> </div>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>产值</div> <div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue12 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.outputValue12) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -67,11 +67,11 @@ ...@@ -67,11 +67,11 @@
<div class='content-wrap'> <div class='content-wrap'>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>订单量</div> <div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum13 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.orderNum13) }}</div>
</div> </div>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>产值</div> <div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue13 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.outputValue13) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -83,11 +83,11 @@ ...@@ -83,11 +83,11 @@
<div class='content-wrap'> <div class='content-wrap'>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>订单量</div> <div class='content-title'>订单量</div>
<div class='content-num'>{{ everyBusinessOrder.orderNum21 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.orderNum21) }}</div>
</div> </div>
<div class='business-content'> <div class='business-content'>
<div class='content-title'>产值</div> <div class='content-title'>产值</div>
<div class='content-num'>{{ everyBusinessOrder.outputValue21 }}</div> <div class='content-num'>{{ toThousands(everyBusinessOrder.outputValue21) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -148,7 +148,14 @@ export default { ...@@ -148,7 +148,14 @@ export default {
// }) // })
}, },
methods: { methods: {
toThousands(n) {
// return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
return n && n.toString().replace(/\d+/, function(m) {
return m.replace(/(\d)(?=(\d{3})+$)/g, function(y) {
return y + ','
})
})
},
getEveryBusinessOrder() { getEveryBusinessOrder() {
this.api.springbudAtion.getEveryBusinessOrder().then(res => { this.api.springbudAtion.getEveryBusinessOrder().then(res => {
if (res.code == 0) { if (res.code == 0) {
......
...@@ -86,8 +86,6 @@ export default { ...@@ -86,8 +86,6 @@ export default {
}) })
}, },
changeTitles() { changeTitles() {
console.log('???????')
console.log(!this.titleClick)
this.titleClick = !this.titleClick this.titleClick = !this.titleClick
}, },
goPage(val) { goPage(val) {
......
...@@ -124,7 +124,6 @@ export default { ...@@ -124,7 +124,6 @@ export default {
}, },
// 鼠标移入时停止滚动 // 鼠标移入时停止滚动
mouseenter() { mouseenter() {
console.log(this.timer2)
clearInterval(this.timer2) clearInterval(this.timer2)
}, },
// 鼠标移开继续滚动 // 鼠标移开继续滚动
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
import utils from '../utils/util' import utils from '../utils/util'
function getBarOptions(obj) { function getBarOptions(obj) {
const { analysisList, rotate } = obj const { analysisList, labelName } = obj
const num = analysisList.map(item => item.totalNum) const num = analysisList.map(item => item.totalNum)
const name = analysisList.map(item => item[labelName])
const name = analysisList.map(item => item.goodsName) const showName = labelName == 'goodsName' ? '商品' : labelName == 'vehicleBrand' ? '车型' : '优惠券'
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -31,14 +31,14 @@ function getBarOptions(obj) { ...@@ -31,14 +31,14 @@ function getBarOptions(obj) {
}, },
formatter: function(item) { formatter: function(item) {
const items = item[0] const items = item[0]
return `商品:${items.axisValueLabel}<br>数量:${items.value}` return `${showName}:${items.axisValueLabel}<br>数量:${items.value}`
} }
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
axisLabel: { axisLabel: {
color: '#fff', color: '#fff',
fontSize: '0.72em' fontSize: '0.70em'
}, },
splitLine: { splitLine: {
show: false show: false
...@@ -512,284 +512,284 @@ function lineAndBarZoomOptions(list, namelist) { ...@@ -512,284 +512,284 @@ function lineAndBarZoomOptions(list, namelist) {
const items = list[item[0].dataIndex] const items = list[item[0].dataIndex]
return namelist ? `${items.statDate}<br>订单成功的门店数:${items.merchantNum}<br>订单数:${items.orderNum}<br>订单金额:${items.totalPrice}` : `订单数:${items.orderNum} return namelist ? `${items.statDate}<br>订单成功的门店数:${items.merchantNum}<br>订单数:${items.orderNum}<br>订单金额:${items.totalPrice}` : `订单数:${items.orderNum}
<br>订单金额:${items.orderMoney}` <br>订单金额:${items.orderMoney}`
} }
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
axisLabel: { axisLabel: {
color: '#fff', color: '#fff',
fontSize: '0.75em' fontSize: '0.75em'
}, },
splitLine: { splitLine: {
show: false show: false
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLine: { axisLine: {
show: false show: false
}, },
data: statDate data: statDate
} }
], ],
dataZoom: [{ dataZoom: [{
type: 'slider', type: 'slider',
show: false, show: false,
// start: 100, // start: 100,
// end: 90, // end: 90,
// start: statDate.length - statDate.length, // start: statDate.length - statDate.length,
startValue: 0, startValue: 0,
endValue: statDate.length - 1, endValue: statDate.length - 1,
handleSize: 8 handleSize: 8
}, },
{ {
type: 'inside', type: 'inside',
start: 0, start: 0,
end: 100 end: 100
}, },
{ {
type: 'slider', type: 'slider',
show: false, show: false,
yAxisIndex: 0, yAxisIndex: 0,
filterMode: 'empty', filterMode: 'empty',
width: 12, width: 12,
height: '70%', height: '70%',
handleSize: 10, handleSize: 10,
showDataShadow: true, showDataShadow: true,
left: '93%' left: '93%'
} }
], ],
grid: { grid: {
left: '6%', left: '6%',
right: '5%', right: '5%',
top: '6%', top: '6%',
bottom: '1%', bottom: '1%',
containLabel: true containLabel: true
}, },
yAxis: [ yAxis: [
{ {
name: 'bar', name: 'bar',
nameGap: 30, nameGap: 30,
type: 'value', type: 'value',
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#2F314F' color: '#2F314F'
} }
}, },
axisLabel: { axisLabel: {
color: '#FFD241', color: '#FFD241',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
}, },
{ {
name: 'line', name: 'line',
nameGap: 30, nameGap: 30,
type: 'value', type: 'value',
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#2F314F' color: '#2F314F'
} }
}, },
axisLabel: { axisLabel: {
color: '#769EFF', color: '#769EFF',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
} }
], ],
series: [ series: [
{ {
name: 'line', name: 'line',
type: 'line', type: 'line',
symbol: 'circle', symbol: 'circle',
itemStyle: { itemStyle: {
color: '#F5AA01' color: '#F5AA01'
}, },
// 平滑曲线 // 平滑曲线
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
// 折线背景色 // 折线背景色
areaStyle: { areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [ colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(254, 84, 0, 0.3)' color: 'rgba(254, 84, 0, 0.3)'
}, },
{ {
offset: 1, offset: 1,
color: 'rgba(254, 84, 0, 0.01)' color: 'rgba(254, 84, 0, 0.01)'
} }
] ]
} }
}, },
data: orderMoney data: orderMoney
}, },
{ {
name: 'bar', name: 'bar',
type: 'bar', type: 'bar',
symbol: 'circle', symbol: 'circle',
backgroundStyle: { backgroundStyle: {
color: '#6578FF' color: '#6578FF'
}, },
yAxisIndex: 1, yAxisIndex: 1,
barWidth: '30%', barWidth: '30%',
data: orderNum data: orderNum
} }
] ]
} }
return options return options
} }
function lineAndBarOptions(list, namelist) { function lineAndBarOptions(list, namelist) {
const statDate = namelist ? list.map(item => item[namelist.xName]) : list.map(item => item.statMonth) const statDate = namelist ? list.map(item => item[namelist.xName]) : list.map(item => item.statMonth)
const orderNum = namelist ? list.map(item => item[namelist.leftYName]) : list.map(item => item.orderNum) const orderNum = namelist ? list.map(item => item[namelist.leftYName]) : list.map(item => item.orderNum)
const orderMoney = namelist ? list.map(item => item[namelist.rightYName]) : list.map(item => item.orderMoney) const orderMoney = namelist ? list.map(item => item[namelist.rightYName]) : list.map(item => item.orderMoney)
var options = { var options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
lineStyle: { lineStyle: {
type: 'solid' type: 'solid'
} }
}, },
padding: 5, padding: 5,
borderWidth: 1, borderWidth: 1,
backgroundColor: 'rgba(35, 45, 152, 1)', backgroundColor: 'rgba(35, 45, 152, 1)',
borderRadius: 4, borderRadius: 4,
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: 10 fontSize: 10
}, },
formatter: function(item) { formatter: function(item) {
// console.log(item) // console.log(item)
const items = list[item[0].dataIndex] const items = list[item[0].dataIndex]
return `${items.statMonth}<br>订单数:${items.orderNum}<br>订单收入:${items.orderMoney}` return `${items.statMonth}<br>订单数:${items.orderNum}<br>订单收入:${items.orderMoney}`
} }
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
axisLabel: { axisLabel: {
color: '#fff', color: '#fff',
fontSize: '0.75em' fontSize: '0.75em'
}, },
splitLine: { splitLine: {
show: false show: false
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLine: { axisLine: {
show: false show: false
}, },
data: statDate data: statDate
} }
], ],
grid: { grid: {
left: '6%', left: '6%',
right: '5%', right: '5%',
top: '10%', top: '10%',
bottom: '1%', bottom: '1%',
containLabel: true containLabel: true
}, },
yAxis: [ yAxis: [
{ {
name: '', name: '',
nameGap: 30, nameGap: 30,
type: 'value', type: 'value',
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#2F314F' color: '#2F314F'
} }
}, },
axisLabel: { axisLabel: {
color: '#FFD241', color: '#FFD241',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
}, },
{ {
name: '', name: '',
nameGap: 30, nameGap: 30,
type: 'value', type: 'value',
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#2F314F' color: '#2F314F'
} }
}, },
axisLabel: { axisLabel: {
color: '#769EFF', color: '#769EFF',
fontSize: '0.8em' fontSize: '0.8em'
}, },
splitNumber: 4 splitNumber: 4
} }
], ],
series: [ series: [
{ {
name: 'line', name: 'line',
type: 'line', type: 'line',
symbol: 'circle', symbol: 'circle',
itemStyle: { itemStyle: {
color: '#F5AA01' color: '#F5AA01'
}, },
// 平滑曲线 // 平滑曲线
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
// 折线背景色 // 折线背景色
areaStyle: { areaStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [ colorStops: [
{ {
offset: 0, offset: 0,
color: 'rgba(254, 84, 0, 0.3)' color: 'rgba(254, 84, 0, 0.3)'
}, },
{ {
offset: 1, offset: 1,
color: 'rgba(254, 84, 0, 0.01)' color: 'rgba(254, 84, 0, 0.01)'
} }
] ]
} }
}, },
data: orderMoney data: orderMoney
}, },
{ {
name: 'bar', name: 'bar',
type: 'bar', type: 'bar',
symbol: 'circle', symbol: 'circle',
backgroundStyle: { backgroundStyle: {
color: '#6578FF' color: '#6578FF'
}, },
yAxisIndex: 1, yAxisIndex: 1,
barWidth: '30%', barWidth: '30%',
data: orderNum data: orderNum
} }
] ]
} }
return options return options
} }
export { export {
getBarReverseOptions, getBarReverseOptions,
getBarOptions, getBarOptions,
lineAndBarOptions, lineAndBarOptions,
getLineOptions, getLineOptions,
lineAndBarZoomOptions, lineAndBarZoomOptions,
getLineDoubleOptions getLineDoubleOptions
} }
...@@ -17,7 +17,6 @@ export default { ...@@ -17,7 +17,6 @@ export default {
methods: { methods: {
getClientData() { getClientData() {
console.log(22)
this.api.customer.getEnterpriseDistribution().then(res => { this.api.customer.getEnterpriseDistribution().then(res => {
if (res.code == 0) { if (res.code == 0) {
res.data.dataList.forEach(item => { res.data.dataList.forEach(item => {
......
...@@ -34,7 +34,6 @@ export default { ...@@ -34,7 +34,6 @@ export default {
}, },
mounted() { mounted() {
this.$bus.$on('totalRank', data => { this.$bus.$on('totalRank', data => {
console.log(data)
this.totalNumData = data.datalist this.totalNumData = data.datalist
}) })
}, },
......
...@@ -311,7 +311,7 @@ export default { ...@@ -311,7 +311,7 @@ export default {
} }
} }
this.api.map.getMerchantInProgressThisMonth(params).then(res=>{ this.api.map.getMerchantInProgressThisMonth(params).then(res=>{
}) })
}, },
methods: { methods: {
...@@ -369,7 +369,6 @@ export default { ...@@ -369,7 +369,6 @@ export default {
borderWidth: 1, borderWidth: 1,
padding: 0, padding: 0,
formatter: function (params) { formatter: function (params) {
console.log(params)
let name = params.name let name = params.name
var str = `<div style = "background:url( ${require("@/assets/images/province.png")}) no-repeat; var str = `<div style = "background:url( ${require("@/assets/images/province.png")}) no-repeat;
width:20vw;height:28vh;background-size:cover"> width:20vw;height:28vh;background-size:cover">
......
<template> <template>
<div class='content'> <div class='content'>
<select-container></select-container> <select-container></select-container>
<conversion-plus-content v-if='isShowConversion'></conversion-plus-content> <!-- v-if='isShowConversion'-->
<expanded-gold-content v-else></expanded-gold-content> <conversion-plus-content ></conversion-plus-content>
<!-- <expanded-gold-content v-else></expanded-gold-content>-->
</div> </div>
</template> </template>
...@@ -10,24 +11,24 @@ ...@@ -10,24 +11,24 @@
import SelectContainer from 'views/sassPlus/componts/selectContainer' import SelectContainer from 'views/sassPlus/componts/selectContainer'
import ConversionPlusContent from 'views/sassPlus/conversionPlus/conversionPlusContent' import ConversionPlusContent from 'views/sassPlus/conversionPlus/conversionPlusContent'
import ExpandedGoldContent from 'views/sassPlus/expandedGold/expandedGoldContent' // import ExpandedGoldContent from 'views/sassPlus/expandedGold/expandedGoldContent'
export default { export default {
// name: 'sassPlusContent', // name: 'sassPlusContent',
components: { components: {
ExpandedGoldContent, // ExpandedGoldContent,
ConversionPlusContent, ConversionPlusContent,
SelectContainer SelectContainer
}, },
data() { data() {
return { return {
isShowConversion: true // isShowConversion: true
} }
}, },
mounted() { mounted() {
this.$bus.$on('changeBussiness', data => { // this.$bus.$on('changeBussiness', data => {
this.isShowConversion = data.bussinessType == 'transWork' || data.bussinessType == 'noWorries' // this.isShowConversion = data.bussinessType == 'transWork' || data.bussinessType == 'noWorries'
}) // })
} }
} }
</script> </script>
......
<template> <template>
<div class='select-Container'> <div class='select-Container'>
<SelectCpn :selectName="'业务筛选:'" :selectArr='businessList' :selectType="'business'"></SelectCpn> <SelectCpn :selectName="'业务筛选:'" :selectArr='businessList' :selectType="'business'"></SelectCpn>
<SelectCpn v-if='isShowSystem' :selectName="'系统筛选:'" :selectArr='systemList' :selectType="'system'"></SelectCpn> <!-- <SelectCpn v-if='isShowSystem' :selectName="'系统筛选:'" :selectArr='systemList' :selectType="'system'"></SelectCpn>-->
<SelectCpn <SelectCpn
:selectName="'月份筛选:'" :selectName="'月份筛选:'"
:selectArr='monthList' :selectArr='monthList'
...@@ -26,10 +26,10 @@ export default { ...@@ -26,10 +26,10 @@ export default {
{ label: '1.3众筹', value: 'crowdFunding' }, { label: '1.3众筹', value: 'crowdFunding' },
{ label: '2.1车损无忧', value: 'noWorries' } { label: '2.1车损无忧', value: 'noWorries' }
], ],
systemList: [ // systemList: [
{ label: '广联', value: 'gl' }, // { label: '广联', value: 'gl' },
{ label: '广汇', value: 'gh' } // { label: '广汇', value: 'gh' }
], // ],
monthList: [], monthList: [],
isShowSystem: false isShowSystem: false
} }
...@@ -42,9 +42,9 @@ export default { ...@@ -42,9 +42,9 @@ export default {
}, },
mounted() { mounted() {
this.$bus.$on('changeBussiness', data => { // this.$bus.$on('changeBussiness', data => {
this.isShowSystem = data.bussinessType == 'expandedGold' || data.bussinessType =='crowdFunding' // this.isShowSystem = data.bussinessType == 'expandedGold' || data.bussinessType =='crowdFunding'
}) // })
} }
} }
</script> </script>
......
...@@ -70,16 +70,17 @@ export default { ...@@ -70,16 +70,17 @@ export default {
if (this.selectArr.length) { if (this.selectArr.length) {
this.selStr = this.selectArr[0][this.valName] this.selStr = this.selectArr[0][this.valName]
} }
this.$bus.$on('changeBussiness', data => { // this.$bus.$on('changeBussiness', data => {
const { bussinessType } = data // const { bussinessType } = data
this.showFirstSelStaus = bussinessType == 'expandedGold' || bussinessType == 'crowdFunding' // this.showFirstSelStaus = bussinessType == 'expandedGold' || bussinessType == 'crowdFunding'
}) // })
}, },
methods: { methods: {
selectBtn(type) { selectBtn(type) {
switch (type) { switch (type) {
case 'business': case 'business':
// eslint-disable-next-line no-case-declarations
let title let title
this.selectArr.forEach(item => { this.selectArr.forEach(item => {
if (item.value == this.selStr) { if (item.value == this.selStr) {
...@@ -88,9 +89,9 @@ export default { ...@@ -88,9 +89,9 @@ export default {
}) })
this.$bus.$emit('changeBussiness', { bussinessTitle: title + '业务', bussinessType: this.selStr }) this.$bus.$emit('changeBussiness', { bussinessTitle: title + '业务', bussinessType: this.selStr })
break break
case 'system': // case 'system':
this.$bus.$emit('changeSystem', { systemType: this.selStr }) // this.$bus.$emit('changeSystem', { systemType: this.selStr })
break // break
case 'months': case 'months':
this.$bus.$emit('changeMonths', { month: this.selStr }) this.$bus.$emit('changeMonths', { month: this.selStr })
break break
......
<template> <template>
<div class='category-distribution'> <div class='category-distribution'>
<view-sub-title title='商品品类订单数前10' /> <view-sub-title :title='diffsTitle[bussinessType]' />
<bar-chart domId='analyseChart' boxHeight='14.54vh' :analysisList='allGoodsDistribution'></bar-chart> <bar-chart
class='barChartStyle'
:labelName='labelName'
domId='analyseChart'
boxHeight='14.54vh'
:analysisList='allGoodsDistribution'></bar-chart>
</div> </div>
</template> </template>
...@@ -10,6 +15,14 @@ export default { ...@@ -10,6 +15,14 @@ export default {
name: 'CategoryDistribution', name: 'CategoryDistribution',
data() { data() {
return { return {
diffsTitle: {
'transWork': '商品品类订单数前10',
'expandedGold': '订单量排名优惠券前10',
'crowdFunding': '整体车型排名前10',
'noWorries': '商品品类订单数前10'
},
labelName: '',
bussinessType: '',
chart: { chart: {
id: 'glproduct', id: 'glproduct',
keys: ['goodsName', 'totalNum'] keys: ['goodsName', 'totalNum']
...@@ -20,6 +33,8 @@ export default { ...@@ -20,6 +33,8 @@ export default {
}, },
mounted() { mounted() {
this.$bus.$on('allGoodsDistribution', data => { this.$bus.$on('allGoodsDistribution', data => {
this.bussinessType = data.bussinessType
this.labelName = data.bussinessType === 'expandedGold' ? 'couponName' : data.bussinessType === 'crowdFunding' ? 'vehicleBrand' : 'goodsName'
this.allGoodsDistribution = data.allGoodsDistribution this.allGoodsDistribution = data.allGoodsDistribution
}) })
} }
...@@ -27,5 +42,7 @@ export default { ...@@ -27,5 +42,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.barChartStyle {
margin-top: 3vh;
}
</style> </style>
<template> <template>
<div class='conversion-left'> <div class='conversion-left'>
<view-sub-title title='各类商品每月订单数' /> <view-sub-title :title='diffsTitle[copyBussinessType]' />
<div class='component'> <div class='component'>
<div class='titles'> <div class='titles'>
<span>订单月份</span> <span>订单月份</span>
<span>商品名称</span> <span>{{ copyBussinessType == 'expandedGold' ? '活动名称' : '商品名称' }}</span>
<span>订单数</span> <span>订单数</span>
</div> </div>
<div <div
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
@mouseleave="currentIndex = ''" @mouseleave="currentIndex = ''"
@mouseenter='mouseenterList(item,index)'> @mouseenter='mouseenterList(item,index)'>
<div>{{ item.statMonth }}</div> <div>{{ item.statMonth }}</div>
<div>{{ item.goodsName }}</div> <div>{{ item[diffsGoodsName[copyBussinessType]] }}</div>
<div>{{ item.orderNum }}</div> <div>{{ item[diffsNum[copyBussinessType]] }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -37,6 +37,24 @@ export default { ...@@ -37,6 +37,24 @@ export default {
name: 'ConversionLeft', name: 'ConversionLeft',
data() { data() {
return { return {
diffsTitle: {
'transWork': '各类商品每月订单数',
'expandedGold': '各活动场次订单量',
'crowdFunding': '各月各商品订单量排名',
'noWorries': '各类商品每月订单数'
},
diffsGoodsName: {
'transWork': 'goodsName',
'expandedGold': 'activityName',
'crowdFunding': 'goodsName',
'noWorries': 'goodsName'
},
diffsNum:{
'transWork': 'orderNum',
'expandedGold': 'totalNum',
'crowdFunding': 'totalNum',
'noWorries': 'totalNum'
},
totalCount: 10000, // 总数 totalCount: 10000, // 总数
scrollContentHeight: 0, // 滚动内容的高度 scrollContentHeight: 0, // 滚动内容的高度
scrollBoxHeight: 0, // 滚动父级盒子的高度 scrollBoxHeight: 0, // 滚动父级盒子的高度
...@@ -102,7 +120,6 @@ export default { ...@@ -102,7 +120,6 @@ export default {
this.scrollBoxHeight = this.$refs.forwardContent ? this.$refs.forwardScrollBox.getBoundingClientRect().height : '' this.scrollBoxHeight = this.$refs.forwardContent ? this.$refs.forwardScrollBox.getBoundingClientRect().height : ''
// 可以滚动的高度 // 可以滚动的高度
this.scrollableHeight = this.scrollContentHeight - this.scrollBoxHeight this.scrollableHeight = this.scrollContentHeight - this.scrollBoxHeight
console.log('内容高度', this.scrollContentHeight, '盒子高度', this.scrollBoxHeight, '可以滚动的高度', this.scrollableHeight)
this.autoScroll() this.autoScroll()
}, },
// 自动滚动 // 自动滚动
...@@ -156,7 +173,7 @@ export default { ...@@ -156,7 +173,7 @@ export default {
//display: flex; //display: flex;
//justify-content: space-between; //justify-content: space-between;
display: grid; display: grid;
grid-template-columns:30% 40% 30%; grid-template-columns:28% 54% 18%;
font-size: 0.9vw; font-size: 0.9vw;
} }
...@@ -166,7 +183,7 @@ export default { ...@@ -166,7 +183,7 @@ export default {
.list_dv { .list_dv {
width: 100%; width: 100%;
height:77vh; height: 77vh;
overflow-y: auto; overflow-y: auto;
font-size: 0.6vw; font-size: 0.6vw;
color: #d4eaf6; color: #d4eaf6;
...@@ -180,14 +197,18 @@ export default { ...@@ -180,14 +197,18 @@ export default {
.dataList { .dataList {
display: grid; display: grid;
grid-template-columns: 30% 40% 30%; grid-template-columns: 28% 54% 18%;
cursor: pointer; cursor: pointer;
//div{ div{
// width: 100%; width: 100%;
// &:nth-child(2){ &:nth-child(2){
// width: 70px; width: 93%;
// } overflow: hidden; //超出隐藏
//} white-space: nowrap; //不折行
text-overflow: ellipsis; //溢出显示省略号
}
}
} }
.selectMerchant { .selectMerchant {
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
<div class='business-top flex'> <div class='business-top flex'>
<div class='business-border'> <div class='business-border'>
<div class='business-title'>订单总数</div> <div class='business-title'>订单总数</div>
<div class='business-number'>{{ orderList.totalNum }}</div> <div class='business-number'>{{ toThousands(orderList.totalNum) }}</div>
</div> </div>
<div class='business-border'> <div class='business-border'>
<div class='business-title'>今年新增</div> <div class='business-title'>今年新增</div>
<div class='business-number'>{{ orderList.thisyear }}</div> <div class='business-number'>{{ toThousands(orderList.thisyear) }}</div>
</div> </div>
<div class='business-border'> <div class='business-border'>
<div class='business-title'>订单总金额</div> <div class='business-title'>订单总金额</div>
<div class='business-number'>{{ orderList.totalMoney }}</div> <div class='business-number'>{{ toThousands(orderList.totalMoney) }}</div>
</div> </div>
<div class='business-border' v-if='orderList.activityTimes'> <div class='business-border' v-if='orderList.activityTimes'>
<div class='business-title'>活动总数</div> <div class='business-title'>活动总数</div>
<div class='business-number'>{{ orderList.activityTimes }}</div> <div class='business-number'>{{ toThousands(orderList.activityTimes) }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -39,7 +39,16 @@ export default { ...@@ -39,7 +39,16 @@ export default {
}) })
}, },
methods: {} methods: {
toThousands(n) {
// return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
return n && n.toString().replace(/\d+/, function(m) {
return m.replace(/(\d)(?=(\d{3})+$)/g, function(y) {
return y + ','
})
})
}
}
} }
</script> </script>
d d
......
...@@ -38,30 +38,32 @@ export default { ...@@ -38,30 +38,32 @@ export default {
const { bussinessType, bussinessTitle } = data const { bussinessType, bussinessTitle } = data
this.bussinessTitle = bussinessTitle this.bussinessTitle = bussinessTitle
this.bussinessType = bussinessType this.bussinessType = bussinessType
this.bussinessInit(bussinessType)
// this.isShowTransWork = bussinessType == 'transWork' || bussinessType == 'noWorries' // this.isShowTransWork = bussinessType == 'transWork' || bussinessType == 'noWorries'
if (bussinessType == 'transWork' || bussinessType == 'noWorries') { // if (bussinessType == 'transWork' || bussinessType == 'noWorries') {
this.bussinessInit(bussinessType) // this.bussinessInit(bussinessType)
} // }
if (bussinessType == 'expandedGold' || bussinessType == 'crowdFunding') { // if (bussinessType == 'expandedGold' || bussinessType == 'crowdFunding') {
const { systemType } = this // const { systemType } = this
this.crowdFundingInit(bussinessType, systemType, '') // this.crowdFundingInit(bussinessType, systemType, '')
} // }
}) })
// this.$bus.$off('changeSystem') // this.$bus.$off('changeSystem')
this.$bus.$on('changeSystem', data => { // this.$bus.$on('changeSystem', data => {
this.systemType = data.systemType // this.systemType = data.systemType
const { systemType, bussinessType, month } = this // const { systemType, bussinessType, month } = this
this.crowdFundingInit(bussinessType, systemType, month) // this.crowdFundingInit(bussinessType, systemType, month)
}) // })
this.$bus.$on('changeMonths', data => { this.$bus.$on('changeMonths', data => {
this.month = data.month this.month = data.month
const { bussinessType, systemType, month } = this // const { bussinessType, systemType, month } = this
if (bussinessType == 'expandedGold' || bussinessType == 'crowdFunding') { // if (bussinessType == 'expandedGold' || bussinessType == 'crowdFunding') {
this.getActivitiesMonthly(bussinessType, systemType, month) // this.getActivitiesMonthly(bussinessType, systemType, month)
this.getTop5CouponMonthly(bussinessType, systemType, month) // this.getTop5CouponMonthly(bussinessType, systemType, month)
} // }
}) })
}, },
...@@ -77,15 +79,15 @@ export default { ...@@ -77,15 +79,15 @@ export default {
}, },
// 1.2 1.3的初始化 // 1.2 1.3的初始化
crowdFundingInit(bussinessType, systemType, month) { // crowdFundingInit(bussinessType, systemType, month) {
this.getMonth(bussinessType) // 获取可选月份 // this.getMonth(bussinessType) // 获取可选月份
this.getTotal(bussinessType, systemType) // 获取订单详情 // this.getTotal(bussinessType, systemType) // 获取订单详情
this.getOrderMonthlyTrend(bussinessType, systemType) // 获取月度趋势 // this.getOrderMonthlyTrend(bussinessType, systemType) // 获取月度趋势
this.getActivitiesMonthly(bussinessType, systemType, month) // 获取页面左边排名前五的数据 // this.getActivitiesMonthly(bussinessType, systemType, month) // 获取页面左边排名前五的数据
this.getTop5CouponMonthly(bussinessType, systemType, month)// 获取页面右边排名前五的数据 // this.getTop5CouponMonthly(bussinessType, systemType, month)// 获取页面右边排名前五的数据
this.getTop10Coupon(bussinessType, systemType) // 获取页面右边排名前10的数据 // this.getTop10Coupon(bussinessType, systemType) // 获取页面右边排名前10的数据
this.getTop10Acitivity(bussinessType, systemType)// 获取页面左边排名前10的数据 // this.getTop10Acitivity(bussinessType, systemType)// 获取页面左边排名前10的数据
}, // },
// 获取订单总数、今年新增订单数、收入总额 // 获取订单总数、今年新增订单数、收入总额
getTotal(val, type) { getTotal(val, type) {
...@@ -109,9 +111,10 @@ export default { ...@@ -109,9 +111,10 @@ export default {
await this.api[val].getMonth().then(res => { await this.api[val].getMonth().then(res => {
if (res.code == 0) { if (res.code == 0) {
const monthList = res.data.dataList const monthList = res.data.dataList
if (this.bussinessType == 'transWork' || this.bussinessType == 'noWorries') { // if (this.bussinessType == 'transWork' || this.bussinessType == 'noWorries') {
monthList.unshift({ month: '' }) // monthList.unshift({ month: '' })
} // }
monthList.unshift({ month: '' })
this.$bus.$emit('monthList', { monthList }) this.$bus.$emit('monthList', { monthList })
} }
}) })
...@@ -139,7 +142,7 @@ export default { ...@@ -139,7 +142,7 @@ export default {
this.api[val].getAllGoodsDistribution().then(res => { this.api[val].getAllGoodsDistribution().then(res => {
if (res.code == 0) { if (res.code == 0) {
const allGoodsDistribution = res.data.dataList const allGoodsDistribution = res.data.dataList
this.$bus.$emit('allGoodsDistribution', { allGoodsDistribution }) this.$bus.$emit('allGoodsDistribution', { allGoodsDistribution, bussinessType: this.bussinessType })
} }
}) })
}, },
...@@ -151,74 +154,74 @@ export default { ...@@ -151,74 +154,74 @@ export default {
// 获取排名前十的数据 右边 // 获取排名前十的数据 右边
getTop10Coupon(bussinessType, queryItem) { // getTop10Coupon(bussinessType, queryItem) {
// bussinessType 通过不同业务调用不同的接口 // // bussinessType 通过不同业务调用不同的接口
// expandedGold 1.2业务 crowdFunding 1.3 // // expandedGold 1.2业务 crowdFunding 1.3
// queryItem 系统参数 // // queryItem 系统参数
// gl 广联 gh 广汇 // // gl 广联 gh 广汇
bussinessType == 'expandedGold' // bussinessType == 'expandedGold'
? this.getTopTenData(bussinessType, 'getTop10Coupon', queryItem, 'Top10Right') // ? this.getTopTenData(bussinessType, 'getTop10Coupon', queryItem, 'Top10Right')
: this.getTopTenData(bussinessType, 'getVehicleBrandRanking', queryItem, 'Top10Right') // : this.getTopTenData(bussinessType, 'getVehicleBrandRanking', queryItem, 'Top10Right')
}, // },
// 获取排名前十的数据 左边 // 获取排名前十的数据 左边
getTop10Acitivity(bussinessType, queryItem) { // getTop10Acitivity(bussinessType, queryItem) {
// bussinessType 通过不同业务调用不同的接口 // // bussinessType 通过不同业务调用不同的接口
// expandedGold 1.2业务 crowdFunding 1.3 // // expandedGold 1.2业务 crowdFunding 1.3
// queryItem 系统参数 // // queryItem 系统参数
// gl 广联 gh 广汇 // // gl 广联 gh 广汇
bussinessType == 'expandedGold' // bussinessType == 'expandedGold'
? this.getTopTenData(bussinessType, 'getTop5Activities', queryItem, 'Top10Left') // ? this.getTopTenData(bussinessType, 'getTop5Activities', queryItem, 'Top10Left')
: this.getTopTenData(bussinessType, 'getAllGoodsDistribution', queryItem, 'Top10Left') // : this.getTopTenData(bussinessType, 'getAllGoodsDistribution', queryItem, 'Top10Left')
}, // },
// 获取前十的数据 // 获取前十的数据
getTopTenData(bussinessType, method, queryItem, emitName) { // getTopTenData(bussinessType, method, queryItem, emitName) {
const params = { queryItem } // const params = { queryItem }
this.api[bussinessType][method](params).then(res => { // this.api[bussinessType][method](params).then(res => {
if (res.code == 0) { // if (res.code == 0) {
this.$bus.$emit(emitName, { list: res.data.dataList, bussinessType }) // this.$bus.$emit(emitName, { list: res.data.dataList, bussinessType })
} // }
}) // })
}, // },
// 获取排名前5的数据 -左边 // 获取排名前5的数据 -左边
getActivitiesMonthly(bussinessType, systemType, month) { // getActivitiesMonthly(bussinessType, systemType, month) {
// bussinessType 通过不同业务调用不同的接口 // // bussinessType 通过不同业务调用不同的接口
// expandedGold 1.2业务 crowdFunding 1.3 // // expandedGold 1.2业务 crowdFunding 1.3
// systemType 系统参数 // // systemType 系统参数
// gl 广联 gh 广汇 // // gl 广联 gh 广汇
bussinessType == 'expandedGold' // bussinessType == 'expandedGold'
? this.getMonthlyRankingData(bussinessType, 'getActivitiesMonthly', month, systemType, 'topFiveRankingTopLeft') // ? this.getMonthlyRankingData(bussinessType, 'getActivitiesMonthly', month, systemType, 'topFiveRankingTopLeft')
: this.getMonthlyRankingData(bussinessType, 'getGoodsTop5Monthly', month, systemType, 'topFiveRankingTopLeft') // : this.getMonthlyRankingData(bussinessType, 'getGoodsTop5Monthly', month, systemType, 'topFiveRankingTopLeft')
}, // },
// 获取排名前5的数据 -右边 // 获取排名前5的数据 -右边
getTop5CouponMonthly(bussinessType, systemType, month) { // getTop5CouponMonthly(bussinessType, systemType, month) {
bussinessType == 'expandedGold' // bussinessType == 'expandedGold'
? this.getMonthlyRankingData(bussinessType, 'getTop5CouponMonthly', month, systemType, 'topFiveRankingTopRight') // ? this.getMonthlyRankingData(bussinessType, 'getTop5CouponMonthly', month, systemType, 'topFiveRankingTopRight')
: this.getMonthlyRankingData(bussinessType, 'getVehicleBrandTop5Monthly', month, systemType, 'topFiveRankingTopRight') // : this.getMonthlyRankingData(bussinessType, 'getVehicleBrandTop5Monthly', month, systemType, 'topFiveRankingTopRight')
}, // },
// 获取排名前五数据 // 获取排名前五数据
getMonthlyRankingData(bussinessType, method, month, queryItem, emitName) { // getMonthlyRankingData(bussinessType, method, month, queryItem, emitName) {
let getmonth = month // let getmonth = month
if (!getmonth) { // if (!getmonth) {
const date = new Date() // 获取时间 // const date = new Date() // 获取时间
const year = date.getFullYear() // 获取年 // const year = date.getFullYear() // 获取年
const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1// 获取月 // const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1// 获取月
getmonth = year + '-' + month // getmonth = year + '-' + month
} // }
const params = { // const params = {
month: getmonth, // month: getmonth,
queryItem // queryItem
} // }
this.api[bussinessType][method](params).then(res => { // this.api[bussinessType][method](params).then(res => {
if (res.code == 0) { // if (res.code == 0) {
this.$bus.$emit(emitName, { list: res.data.dataList, bussinessType }) // this.$bus.$emit(emitName, { list: res.data.dataList, bussinessType })
} // }
}) // })
} // }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!