Commit c8fc3c80 by 匡雅琴

1.1tab

1 parent ab7c4c12
...@@ -134,7 +134,6 @@ export default { ...@@ -134,7 +134,6 @@ export default {
const _dataIndex = params.dataIndex const _dataIndex = params.dataIndex
const _purchaseamount = utils.numAddSymbol(_this.list[_dataIndex].purchaseamount) const _purchaseamount = utils.numAddSymbol(_this.list[_dataIndex].purchaseamount)
const _avarage = utils.numAddSymbol(_this.list[_dataIndex].averprice) const _avarage = utils.numAddSymbol(_this.list[_dataIndex].averprice)
console.log(_purchaseamount, _avarage)
if (_this.formatter) return `{a|¥ ${_purchaseamount}}\n{b|均价¥ ${_avarage}}` if (_this.formatter) return `{a|¥ ${_purchaseamount}}\n{b|均价¥ ${_avarage}}`
return `${params.name}` return `${params.name}`
}, },
......
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-bottom: 0.89vh; padding-bottom: 0.69vh;
box-sizing: border-box; box-sizing: border-box;
&-left { &-left {
display: flex; display: flex;
......
<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)">
{{ item }}
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Tab',
props: {
list: {
type: Array,
default: () => []
},
width: Number
},
data() {
return {
tabActive: 0
}
},
mounted() {},
methods: {
// 切换tab
changeTab(index) {
this.tabActive = index
this.$emit('changeTab', index)
}
}
}
</script>
<style lang="scss" scoped>
.tab-box {
margin: 0 auto;
.tab-item-box {
display: flex;
padding: 0.44vh 0.28vw;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223c 99%);
cursor: pointer;
.tab-item {
padding: 0.56vh 0.9vw;
box-sizing: border-box;
font-weight: 400;
font-size: 16px;
color: #ffffffbf;
&-active {
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
color: #ffffff;
}
}
}
}
</style>
...@@ -6,14 +6,18 @@ ...@@ -6,14 +6,18 @@
* @LastEditTime: 2023-07-19 10:34:43 * @LastEditTime: 2023-07-19 10:34:43
--> -->
<template> <template>
<div class="right">aaaaaa</div> <div class="right">
<Tab :list="tabList" :width="14.83"></Tab>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'ContentRight', name: 'ContentRight',
data() { data() {
return {} return {
tabList: ['门店排行榜', '员工排行榜']
}
}, },
mounted() { }, mounted() { },
methods: { methods: {
......
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
\ No newline at end of file \ No newline at end of file
...@@ -113,10 +113,10 @@ export default { ...@@ -113,10 +113,10 @@ export default {
async init() { async init() {
this.tabObject = this.$route.query this.tabObject = this.$route.query
const { merchantid, purchaseType, year } = this.$route.query const { merchantid, purchaseType, year } = this.$route.query
this.defaultYear = year
const _merchantList = await this.getAllRanking(purchaseType) const _merchantList = await this.getAllRanking(purchaseType)
this.merchantList = _merchantList this.merchantList = _merchantList
this.purchaseType = purchaseType this.purchaseType = purchaseType
this.defaultYear = year
this.getMerchantGoodsRatio(merchantid) this.getMerchantGoodsRatio(merchantid)
this.getMerchantPurchase(merchantid) this.getMerchantPurchase(merchantid)
this.getMerchantPurchaseTrend(merchantid) this.getMerchantPurchaseTrend(merchantid)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!