Commit 1ef02195 by 胡悦

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

2 parents 54fcd79a b177e247
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
colors: { colors: {
type: Array, type: Array,
default: () => ['#FF6E76', '#7CFFB2', ' #FDF006', '#4FA0FF', '#EB6001', '#BF98FF', '#58D9F9'] default: () => ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
}, },
size: { size: {
type: String, type: String,
......
<template> <template>
<div> <div>
<div v-for="(item, index) in rankingsList" :key="index" class="ranking-box-item" @click="goDetailPage(item)"> <div v-for="(item, index) in rankingsList" :key="index" class="ranking-box-item" @click="goDetailPage(item)">
<div v-for="(itm, inx) in rankingDataObj" :key="inx">
<template v-if="inx === 0">
<div class="ranking-box-item-left"> <div class="ranking-box-item-left">
<div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div> <div class="circle" :style="{ 'background-image': index < 3 ? RankColor[index] : '' }">{{ index + 1 }}</div>
<div class="text">{{ item.name }}</div> <div class="text">{{ item[itm.name] }}</div>
</div>
</template>
<template v-else>
<div class="ranking-box-item-right">{{ item[itm.name] }}</div>
</template>
</div> </div>
<div class="ranking-box-item-right">{{ item.value }}</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import datas from '@/utils/data' import datas from '@/utils/data'
import router from '../router'
export default { export default {
name: 'Ranking', name: 'Ranking',
props: { props: {
// 排名对象值
rankingsList: { rankingsList: {
type: Array, type: Array,
default: () => [] default: () => []
},
// 排名对象映射关系
rankingDataObj: {
type: Array,
default: () => []
} }
}, },
data() { data() {
...@@ -33,6 +46,7 @@ export default { ...@@ -33,6 +46,7 @@ export default {
// 跳转详情页面 // 跳转详情页面
goDetailPage(item) { goDetailPage(item) {
console.log(item) console.log(item)
router.push('/solarDetail')
} }
} }
} }
......
...@@ -15,6 +15,14 @@ const pages = [ ...@@ -15,6 +15,14 @@ const pages = [
keepAlive: true, keepAlive: true,
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
},
{
name: 'solarDetail',
meta: {
isTab: true,
keepAlive: true,
backgroundColor: '#F7F7F7'
}
} }
] ]
const keepAlives = [] const keepAlives = []
...@@ -50,6 +58,7 @@ const getPages = _ => { ...@@ -50,6 +58,7 @@ const getPages = _ => {
name, name,
meta: e.meta || {}, meta: e.meta || {},
component: resolve => require([`views/${name}/index.vue`], resolve) component: resolve => require([`views/${name}/index.vue`], resolve)
// component: resolve => require([`views/home/detail/${name}/index.vue`], resolve)
} }
if (e.children) route.children = setChildren(e, name) if (e.children) route.children = setChildren(e, name)
if (e.meta && e.meta.keepAlive) keepAlives.push(name) if (e.meta && e.meta.keepAlive) keepAlives.push(name)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div class="merchant-box-item-right">{{ item.value }}</div> <div class="merchant-box-item-right">{{ item.value }}</div>
</div> --> </div> -->
<ranking :rankingsList="merchantsList"></ranking> <ranking :rankingsList="merchantsList" :rankingDataObj="merchantsDataObj"></ranking>
</div> </div>
</div> </div>
</div> </div>
...@@ -70,25 +70,42 @@ export default { ...@@ -70,25 +70,42 @@ export default {
merchantsList: [ merchantsList: [
{ {
name: '公转一号店', name: '公转一号店',
merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
}, },
{ {
name: '公转一号店', name: '公转一号店',
merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
}, },
{ {
name: '公转一号店', name: '公转一号店',
merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
}, },
{ {
name: '公转一号店', name: '公转一号店',
merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
}, },
{ {
name: '公转一号店', name: '公转一号店',
merchant: '云南宏胜瑞达汽车销售',
value: '345489' value: '345489'
} }
], ],
merchantsDataObj: [
{
name: 'name'
},
{
name: 'merchant'
},
{
name: 'value',
type: 'number'
}
],
// 采购进度饼图结构 // 采购进度饼图结构
progressChart: { progressChart: {
id: 'progress', id: 'progress',
......
<!-- 太阳膜右侧下面两个盒子里面内容 --> <!-- 太阳膜右侧下面两个盒子里面内容
饼图左右结构都可用这个组件
-->
<template> <template>
<div class="main-box"> <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> <pie-chart class="pie-chart" :id="chart.id" :list="listData" :keys="chart.keys" :height="chart.height" :colors="chart.colors"></pie-chart>
......
<template>
<div class="layout">
<view-container>
<template #title>
<view-title></view-title>
</template>
<template #content>
<div class="solar-detail-content">
<view-date></view-date>
<!-- 采购趋势 -->
<div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title>
<Charts></Charts>
</div>
<!-- 商品占比 -->
<div class="propotion-box flex">
<div class="propotion-box-left">
<box-title title="商城采购商品占比"></box-title>
<RightViewContent class="content-box" :chart="shopmallChart" :listData="shopmallData" :legentList="shopmallLegend" :legendColors="shopmallLegendColors"></RightViewContent>
</div>
<div class="propotion-box-right">
<box-title title="自采商品占比"></box-title>
<RightViewContent class="content-box" :chart="selfPickChart" :listData="selfPickData" :legentList="selfPickLegend" :legendColors="selfPickLegendColors"></RightViewContent>
</div>
</div>
</div>
</template>
</view-container>
</div>
</template>
<script>
import RightViewContent from '../home/solar/RightViewContent.vue'
export default {
name: 'SolarDetail',
components: {
RightViewContent
},
data() {
return {
// 商城采购饼图结构
shopmallChart: {
id: 'shopmall',
keys: ['goodsName', 'per'],
height: '16vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
// 商城采购数据
shopmallData: [
{
goodsName: '商品1',
per: 0.36,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.2,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.16,
price: 4568,
averagePrice: 668
},
{
goodsName: '品1发货',
per: 0.1,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
}
],
shopmallLegend: [
{
name: 'goodsName'
},
{
name: 'per'
},
{
name: 'price',
hasIcon: '¥'
},
{
name: 'averagePrice',
hasIcon: '均价¥'
}
],
shopmallLegendColors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001'],
// 自采饼图结构
selfPickChart: {
id: 'selfPick',
keys: ['goodsName', 'per'],
height: '16vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
// 自采采购数据
selfPickData: [
{
goodsName: '商品1',
per: 0.36,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.2,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.16,
price: 4568,
averagePrice: 668
},
{
goodsName: '品1发货',
per: 0.1,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
},
{
goodsName: '商品1',
per: 0.09,
price: 4568,
averagePrice: 668
}
],
selfPickLegend: [
{
name: 'goodsName'
},
{
name: 'per'
},
{
name: 'price',
hasIcon: '¥'
},
{
name: 'averagePrice',
hasIcon: '均价¥'
}
],
selfPickLegendColors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.solar-detail-content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 1.78vh 24px;
gap: 0 16px;
.tendency-box {
width: 96.67vw;
height: 39.78vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
margin-top: 1.78vh;
}
.propotion-box {
justify-content: space-between;
margin-top: 1.78vh;
&-left,
&-right {
width: 47.78vw;
height: 25.33vh;
box-shadow: inset 0 0 20px 0 #3d57ff69;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!