Commit bdbc670c by 胡悦

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

2 parents 940cf2d0 14ef3fe8
......@@ -47,8 +47,12 @@ export default {
default: '12px'
},
formatter: {
type: Boolean,
default: false
type: String,
default: ''
},
formatterName: {
type: String,
default: ''
}
},
......@@ -133,24 +137,46 @@ export default {
fontSize: this.size,
fontWeight: 'bold',
color: '#fff',
formatter: function(params) {
formatter: (params) => {
const _dataIndex = params.dataIndex
// 价格
const _purchaseamount = utils.numAddSymbol(_this.list[_dataIndex].purchaseamount)
// 均价
const _avarage = utils.numAddSymbol(_this.list[_dataIndex].averprice)
// const _html = `<div>¥${_purchaseamount}</div><div style="padding-left: 7px;">均价¥ ${_avarage}</div>`
if (_this.formatter) return `{a|¥${_purchaseamount}}\n{b|均价¥ ${_avarage}}`
return `${params.name}`
// return _html
// 总价
let _totalValue = 0
_this.list.forEach(item => {
_totalValue += item.value
})
let _html
/**
* price -- 价格+均价组合
* total -- 名称+总数组合
* none -- 不显示内容
* 默认显示名称
*/
switch (_this.formatter) {
case 'price':
_html = `{a|¥${_purchaseamount}}\n{b|均价¥ ${_avarage}}`
break
case 'total':
_html = `${_this.formatterName}\n${_totalValue}`
break
case 'none':
_html = ''
break
default:
_html = params.name
}
return _html
},
rich: {
a: {
color: '#c8c8c8',
wordSpacing: '5px'
},
b: {
color: '#ffffff66',
fontSize: '12px',
// padding: ['7px', 0, 0, 0],
lineHeight: '28'
}
}
......
......@@ -5,12 +5,12 @@
<template v-if="inx === 0">
<div class="ranking-box-item-left" @click="goDetailPage(item)">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text" :style="{ width: itm.width }">{{ item[itm.name] }}</div>
<div class="text" :class="itm.action ? 'action-text' : ''" :style="{ width: itm.width }">{{ item[itm.name] }}</div>
</div>
</template>
<template v-else>
<div class="ranking-box-item-right" :style="{ width: itm.width, color: itm.color, 'text-align': inx + 1 == rankingDataObj.length ? 'right' : '' }">
{{ itm.type == 'number' ? numAddSymbol(item[itm.name]) : itm.type == 'decimal' ? toPercent(item[itm.name]) : item[itm.name] }}
{{ itm.preunit }}{{ itm.type == 'number' ? numAddSymbol(item[itm.name]) : itm.type == 'decimal' ? toPercent(item[itm.name]) : item[itm.name] }}{{ itm.sufunit }}
</div>
</template>
</div>
......@@ -91,7 +91,7 @@ export default {
width: 17vw;
height: 20px;
}
.text:hover {
.action-text:hover {
box-sizing: border-box;
// padding-bottom: 1px;
// border-bottom: 1px solid #fff;
......@@ -105,10 +105,6 @@ export default {
font-weight: 400;
font-size: 14px;
color: #95acd9;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
// text-align: right;
}
}
</style>
<template>
<div class="tab-box">
<div class="tab-item-box" :style="{ width: width + 'vw' }">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
<div :class="['tab-item', tabActive == index ? 'tab-item-active' : '']" :style="{ width: itemWidth + 'vw' }" v-for="(item, index) in list" :key="index" @click="changeTab(index)">
{{ item }}
</div>
</div>
......@@ -16,7 +16,8 @@ export default {
type: Array,
default: () => []
},
width: Number
width: Number,
itemWidth: Number
},
data() {
return {
......@@ -47,7 +48,8 @@ export default {
background-image: linear-gradient(180deg, #001948 0%, #00223c 99%);
cursor: pointer;
.tab-item {
padding: 0.56vh 0.9vw;
padding: 0.56vh 0;
text-align: center;
box-sizing: border-box;
font-weight: 400;
font-size: 16px;
......
......@@ -10,7 +10,7 @@
<BoutiqueDate :defaultYear="defaultYear" :yearList="yearList" :channelList="channelList" :businessTime="businessTime"></BoutiqueDate>
<StatisticsBox :list="boutiqueList.slice(0,4)"></StatisticsBox>
<StatisticsBox class="sencod-box" :list="boutiqueList.slice(4,9)"></StatisticsBox>
<Tab class="tab-box" :list="tabList" :width="19.17" @changeTab="changeTab"></Tab>
<Tab class="tab-box" :list="tabList" :width="19.17" :itemWidth="10" @changeTab="changeTab"></Tab>
<components class="tab-content" :is="tabName"></components>
</div>
</template>
......
......@@ -7,7 +7,7 @@
-->
<template>
<div class="right">
<Tab class="tab-box" :list="tabList" :width="14.83" @changeTab="changeTab"></Tab>
<Tab class="tab-box" :list="tabList" :width="14.83" :itemWidth="7.78" @changeTab="changeTab"></Tab>
<components :is="tabName"></components>
</div>
</template>
......
......@@ -3,23 +3,32 @@
<!-- 第一个盒子 -->
<div class="rank-box">
<box-title title="门店产值排名"></box-title>
<div class="content">
<div class="content" v-if="storeOutputList.length">
<Ranking :id="'storeOutput'" :rankingsList="storeOutputList" :rankingDataObj="rankingDataObj" @goDetailPage="goDetailPage"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
<!-- 第二个盒子 -->
<div class="rank-box">
<box-title title="门店转化率排行"></box-title>
<div class="content">
<div class="content" v-if="storePercentList.length">
<Ranking :id="'storePercent'" :rankingsList="storePercentList" :rankingDataObj="rankPercentObj" @goDetailPage="goDetailPage"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
<!-- 第三个盒子 -->
<div class="rank-box">
<box-title title="门店客单价排行"></box-title>
<div class="content">
<div class="content" v-if="storePriceList.length">
<Ranking :id="'storePrice'" :rankingsList="storePriceList" :rankingDataObj="rankingDataObj" @goDetailPage="goDetailPage"></Ranking>
</div>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</div>
</template>
......@@ -132,7 +141,8 @@ export default {
rankingDataObj: [
{
name: 'name',
width: '9.72vw'
width: '9.72vw',
action: true
},
{
name: 'province',
......@@ -153,7 +163,8 @@ export default {
rankPercentObj: [
{
name: 'name',
width: '9.72vw'
width: '9.72vw',
action: true
},
{
name: 'province',
......@@ -206,5 +217,10 @@ export default {
.content {
padding: 1.67vh 1.39vw;
}
.empty {
height: 21.78vh;
display: flex;
align-items: center;
}
}
</style>
......@@ -46,12 +46,14 @@ export default {
id: 'goodsPay',
keys: ['name', 'value'],
height: '15.34vh',
colors: ['#34AFFF', '#16E193', '#FFC200']
colors: ['#34AFFF', '#16E193', '#FFC200'],
formatter: 'total',
formatterName: '支付订单'
},
goodsPayLegend: [
{
name: 'name',
width: '5vw'
width: '4vw'
},
{
name: 'rate',
......
<template>
<div class="goods-rank-box">
<box-title title="商品销售排行"></box-title>
<div v-if="goodsRankingList.length">
<div v-if="goodsRankingList.length" class="content">
<Ranking :id="'storePrice'" :rankingsList="goodsRankingList" :rankingDataObj="goodsRankingDataObj"></Ranking>
</div>
<div v-else class="empty">
......@@ -38,21 +38,27 @@ export default {
price: 95489
},
{
name: '低价只想隔热G70 前挡',
name: '低价只想隔热低价只想隔热G70 前挡',
value: 80,
price: 95489
}
],
goodsRankingDataObj: [
{
name: 'name'
name: 'name',
width: '14.58vw'
},
{
name: 'value'
name: 'value',
color: '#C0C0C0',
width: '3vw',
sufunit: '单'
},
{
name: 'price',
type: 'number'
type: 'number',
width: '5vw',
preunit: '¥'
}
]
}
......@@ -70,6 +76,9 @@ export default {
background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
height: 25.11vh;
.content {
padding: 1.67vh 1.39vw;
}
.empty {
height: 21.78vh;
display: flex;
......
......@@ -40,7 +40,9 @@ export default {
id: 'boutiquePropertion',
keys: ['name', 'value'],
height: '15.34vh',
colors: ['#16E193', '#34AFFF']
colors: ['#16E193', '#34AFFF'],
formatter: 'total',
formatterName: '总商品数'
},
propertionLegend: [
{
......
......@@ -26,7 +26,7 @@ export default {
keys: ['goodsname', 'purchaseamount'],
height: '17.34vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001'],
formatter: true
formatter: 'price'
},
// 采购占比数据
propertionData: [],
......
......@@ -62,7 +62,8 @@ export default {
merchantsDataObj: [
{
name: 'merchantname',
width: '20.3vw'
width: '20.3vw',
action: true
},
{
name: 'num',
......
......@@ -3,7 +3,7 @@
-->
<template>
<div class="main-box">
<pie-chart class="pie-chart" :id="chart.id" :list="listData" :keys="chart.keys" :formatter="chart.formatter" :height="chart.height" :colors="chart.colors"></pie-chart>
<pie-chart class="pie-chart" :id="chart.id" :list="listData" :keys="chart.keys" :formatter="chart.formatter" :formatterName="chart.formatterName" :height="chart.height" :colors="chart.colors"></pie-chart>
<Legend class="legend" :list="listData" :legentList="legentList" :colors="legendColors"></Legend>
</div>
</template>
......
......@@ -56,7 +56,7 @@ export default {
keys: ['goodsname', 'purchaseamount'],
height: '18vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001'],
formatter: true
formatter: 'price'
},
shopmallLegend: [
{
......@@ -87,7 +87,7 @@ export default {
keys: ['goodsname', 'purchaseamount'],
height: '18vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001'],
formatter: true
formatter: 'price'
},
selfPickLegend: [
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!