Commit 526d2b54 by 胡悦

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

2 parents b061c075 99c4f028
<template>
<div class="legend">
<div class="legend" :style="legendStyle">
<div class="legend-item flex" v-for="(item, index) in dataList" :key="index">
<div class="icon" :style="{ background: colors[index] }"></div>
<div class="item-content">{{ item.name }}</div>
<div v-for="(itm, inx) in legentList" :key="inx">
<template v-if="inx == 0">
<div class="flex legend-item-right">
<div class="icon" :style="{ background: colors[index] }"></div>
<div class="item-content">{{ item[itm.name] }}</div>
</div>
</template>
<template v-else>
<div class="flex item-content">
<div v-show="itm.hasIcon">{{ itm.hasIcon }}</div>
<div>{{ item[itm.name] }}</div>
</div>
</template>
</div>
</div>
</div>
</template>
......@@ -19,9 +31,17 @@ export default {
type: Array,
default: () => []
},
legentList: {
type: Array,
default: () => []
},
colors: {
type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#BF98FF', '#58D9F9']
},
legendStyle: {
type: String,
default: ''
}
},
watch: {
......@@ -36,26 +56,19 @@ export default {
<style lang="scss" scoped>
.legend {
display: flex;
align-items: center;
flex-wrap: wrap;
width: 7.7vw;
height: 8.54vh;
margin-left: 0.42vw;
.legend-item {
width: 3.68vw;
height: 2.44vh;
background: #0d133b;
align-items: center;
font-size: 7px;
color: #fff;
box-sizing: border-box;
margin: 2px 2px 2px 0;
white-space: nowrap;
font-size: 12px;
font-weight: 400;
line-height: 24px;
color: #c9c9c9ff;
justify-content: space-between;
&-right {
// margin-right: 1.39vw;
}
.item-content {
width: 2.5vw;
overflow: hidden;
text-align: left;
}
.icon {
width: 5px;
......
......@@ -2,12 +2,12 @@
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<!-- <div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> -->
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> -->
<!-- <div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div> -->
<div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }}
</div> -->
</div>
</template>
......@@ -39,7 +39,7 @@ export default {
},
colors: {
type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006']
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#58D9F9']
},
size: {
type: String,
......@@ -75,7 +75,8 @@ export default {
}
},
mounted() {},
mounted() {
},
methods: {
// 初始化数据
......@@ -88,7 +89,6 @@ export default {
value: item[keys[1]]
})
})
console.log(this.viewData)
},
draw() {
if (this.mTime) clearInterval(this.mTime)
......@@ -151,7 +151,6 @@ export default {
this.mainValue = data.data.value
this.numDesc = data.data.name
this.descColor = data.color
// 停止定时器,清除之前的高亮
clearInterval(this.mTime)
this.currentIndex = data.dataIndex
......
<template>
<div>
<div v-for="(item, index) in rankingsList" :key="index" class="ranking-box-item" @click="goDetailPage(item)">
<div class="ranking-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item.name }}</div>
</div>
<div class="ranking-box-item-right">{{ item.value }}</div>
</div>
</div>
</template>
<script>
import datas from '@/utils/data'
export default {
name: 'Ranking',
props: {
rankingsList: {
type: Array,
default: () => []
}
},
data() {
return {
RankColor: datas.RankColor
}
},
mounted() {
},
methods: {
// 跳转详情页面
goDetailPage(item) {
console.log(item)
}
}
}
</script>
<style lang="scss" scoped>
.ranking-box-item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 4px;
&-left {
display: flex;
.circle {
width: 20px;
height: 20px;
border-radius: 20px;
font-size: 14px;
color: #ffffff;
text-align: center;
background: #1e3372;
}
.text {
font-weight: 400;
font-size: 14px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
}
.text:hover {
padding-bottom: 1px;
border-bottom: 1px solid #fff;
}
}
&-right {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #95acd9;
text-align: right;
}
}
</style>
......@@ -20,6 +20,9 @@ const DefaultData = {
]
}
const RankColor = ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)']
export default Object.freeze({
DefaultData
DefaultData,
RankColor
})
......@@ -23,25 +23,27 @@
</div>
<!-- 门店排行 -->
<div class="merchant-box">
<div v-for="(item, index) in merchantsList" :key="index" class="merchant-box-item">
<!-- <div v-for="(item, index) in merchantsList" :key="index" class="merchant-box-item">
<div class="merchant-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? perchaseColorList[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item.name }}</div>
</div>
<div class="merchant-box-item-right">{{ item.value }}</div>
</div>
</div> -->
<ranking :rankingsList="merchantsList"></ranking>
</div>
</div>
</div>
<!-- 右侧第一个盒子 -->
<div class="right-box2">
<box-title title="商城采购进度分析"></box-title>
<RightViewContent :chart="progressChart" :listData="progressData"></RightViewContent>
<RightViewContent class="content-box" :chart="progressChart" :listData="progressData" :legentList="progressLegend" :legendColors="progressLegendColors"></RightViewContent>
<!-- 内容 -->
</div>
<!-- 右侧第一个盒子 -->
<div class="right-box3">
<box-title title="商城采购额商品占比"></box-title>
<RightViewContent class="content-box" :chart="propertionChart" :listData="propertionData" :legentList="propertionLegend" :legendColors="propertionLegendColors"></RightViewContent>
<!-- 内容 -->
</div>
</div>
......@@ -63,7 +65,7 @@ export default {
// 采购额排名当前选中值
purchase: '商城采购',
// 采购额排名前三图标颜色
perchaseColorList: ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)'],
// perchaseColorList: ['linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)', 'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)', 'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)'],
// 采购额排名门店数据
merchantsList: [
{
......@@ -90,7 +92,9 @@ export default {
// 采购进度饼图结构
progressChart: {
id: 'progress',
keys: ['isDelivery', 'per']
keys: ['isDelivery', 'per'],
height: '15.34vh',
colors: ['#34AFFF', '#FFC200', '#16E193']
},
// 采购进度数据
progressData: [
......@@ -101,7 +105,7 @@ export default {
},
{
isDelivery: '未发货',
per: 0.2,
per: 0.25,
price: 4568
},
{
......@@ -109,7 +113,74 @@ export default {
per: 0.44,
price: 4568
}
]
],
progressLegend: [{
name: 'isDelivery'
}, {
name: 'per'
}, {
name: 'price',
hasIcon: '¥'
}],
progressLegendColors: ['#34AFFF', '#FFC200', '#16E193'],
// 采购占比饼图结构
propertionChart: {
id: 'propertion',
keys: ['name', 'per'],
height: '15.34vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
// 采购占比数据
propertionData: [
{
name: '商品1',
per: 0.36,
price: 4568,
averagePrice: 668
},
{
name: '商品1',
per: 0.20,
price: 4568,
averagePrice: 668
},
{
name: '商品1',
per: 0.16,
price: 4568,
averagePrice: 668
},
{
name: '品1发货',
per: 0.10,
price: 4568,
averagePrice: 668
},
{
name: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
},
{
name: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
}
],
propertionLegend: [{
name: 'name'
}, {
name: 'per'
}, {
name: 'price',
hasIcon: '¥'
}, {
name: 'averagePrice',
hasIcon: '均价¥'
}],
propertionLegendColors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
}
},
methods: {
......@@ -130,8 +201,6 @@ export default {
flex-direction: column;
width: 31.39vw;
overflow: hidden;
background: #091c40;
// background: #061422;
&-box1,
&-box2,
......@@ -199,42 +268,12 @@ export default {
}
.merchant-box {
margin-top: 2.06vh;
&-item {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 1vh;
&-left {
display: flex;
.circle {
width: 20px;
height: 20px;
border-radius: 20px;
font-size: 14px;
color: #ffffff;
text-align: center;
background: #1e3372;
}
.text {
font-weight: 400;
font-size: 14px;
color: #ffffff;
margin-left: 1.11vw;
cursor: default;
}
.text:hover {
padding-bottom: 1px;
border-bottom: 1px solid #fff;
}
}
&-right {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #95acd9;
text-align: right;
}
}
}
}
&-box2 {
.content-box {
padding: 3.78vh 1.39vw 1.39vh;
}
}
......
<!-- 太阳膜右侧下面两个盒子里面内容 -->
<template>
<div>
<pie-chart :id="chart.id" :list="listData" :keys="chart.keys"></pie-chart>
<div class="main-box">
<pie-chart class="pie-chart" :id="chart.id" :list="listData" :keys="chart.keys" :height="chart.height" :colors="chart.colors"></pie-chart>
<Legend class="legend" :list="listData" :legentList="legentList" :colors="legendColors"></Legend>
</div>
</template>
<script>
// import * as echarts from 'echarts'
import Legend from '../../../components/Legend.vue'
export default {
components: { Legend },
name: 'RightViewContent',
props: {
chart: {
......@@ -16,6 +19,14 @@ export default {
listData: {
type: Array,
default: () => []
},
legentList: {
type: Array,
default: () => []
},
legendColors: {
type: Array,
default: () => []
}
},
data() {
......@@ -28,4 +39,17 @@ export default {
}
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.main-box {
display: flex;
align-items: center;
.pie-chart {
// width: 138px;
// height: 138px;
width: 20%;
}
.legend {
flex: 1;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!