Commit 790980a8 by 匡雅琴

添加tab栏区域选择和时间选择

1 parent 396b4d90
......@@ -39,6 +39,7 @@ export default {
<style lang="scss" scoped>
.tab-box {
height: 4.44vh;
display: flex;
justify-content: space-between;
padding: 0.2vh 0.2vw;
box-sizing: border-box;
......
<template>
<div class="right-tab-box">
<div class="flex area-box" v-show="tabActive == 0">
<span class="area-text">区域:</span>
<div class="area-plugin">
<div class="area" @click.stop="switchArea">
{{ area || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div>
<SelectBox
:isShow="isShowArea"
isObject
:defaultValue.sync="defaultArea"
@clickOutside="clickOutsideArea"
:dataList.sync="areaDataList"
:boxWidth="'8.61vw'"
@selectVal="selectAreaVal"
:labelName="'name'"
:valueName="'name'"
></SelectBox>
</div>
</div>
<div class="flex">
<span class="month-text">时间:</span>
<div class="month-plugin">
<div class="month" @click.stop="switchMonth">
{{ month || '全部' }}
<img class="arrow-down" src="@/assets/images/arrow-down.png" alt="" />
</div>
<SelectBox
:isShow="isShowMonth"
isObject
:defaultValue.sync="defaultMonth"
@clickOutside="clickOutsideMonth"
:dataList.sync="monthDataList"
:boxWidth="'8.61vw'"
@selectVal="selectMonthVal"
:valueName="'statemonth'"
:labelName="'statemonth'"
></SelectBox>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'RightTab',
props: {
tabActive: Number
},
data() {
return {
area: '',
isShowArea: false,
defaultArea: {},
areaDataList: [
{
name: '广东',
val: 0
},
{
name: '福建',
val: 1
},
{
name: '湖南',
val: 2
},
{
name: '广西',
val: 3
}
],
month: '',
isShowMonth: false,
defaultMonth: {},
monthDataList: [
{
statemonth: '2023-08'
},
{
statemonth: '2023-09'
},
{
statemonth: '2023-10'
},
{
statemonth: '2023-11'
},
{
statemonth: '2023-12'
}
]
}
},
mounted() {},
methods: {
switchArea() {
this.isShowArea = !this.isShowArea
},
clickOutsideArea() {
this.isShowArea = false
},
selectAreaVal(val) {
this.area = val.name
},
switchMonth() {
this.isShowMonth = !this.isShowMonth
},
clickOutsideMonth() {
this.isShowMonth = false
},
selectMonthVal(val) {
this.month = val.statemonth
}
}
}
</script>
<style lang="scss" scoped>
.right-tab-box {
display: flex;
.flex {
display: flex;
}
.area-box {
margin-right: 3.06vw;
}
.month-text,
.area-text {
font-weight: 400;
font-size: 14px;
color: #c9c9c9;
}
.month-plugin,
.area-plugin {
position: relative;
}
.month,
.area {
display: flex;
align-items: center;
justify-content: space-between;
width: 8.61vw;
height: 4vh;
padding: 0 0.56vw;
box-sizing: border-box;
background-image: linear-gradient(270deg, #6578ff 0%, #079ff1 100%);
margin-right: 0.56vw;
color: #ffffff;
.arrow-down {
width: 0.69vw;
height: 0.67vh;
}
}
}
</style>
......@@ -7,7 +7,11 @@
-->
<template>
<div class="view-content">
<TopTab :tabList="tabList" @tabChange="changeTab" class="top-tab"></TopTab>
<TopTab class="top-tab" :tabList="tabList" @tabChange="changeTab">
<template #right>
<RightTab :tabActive="tabActive"></RightTab>
</template>
</TopTab>
<template v-if="tabActive == 0">
<Resident></Resident>
</template>
......@@ -20,11 +24,13 @@
<script>
import Resident from '../../equity/Resident.vue'
import Wholesale from '../../equity/Wholesale.vue'
import RightTab from '../../equity/components/RightTab.vue'
export default {
name: 'ViewEquity',
components: {
Resident,
Wholesale
Wholesale,
RightTab
},
data() {
return {
......@@ -51,6 +57,7 @@ export default {
gap: 0 16px;
.top-tab {
margin-bottom: 1.78vh;
height: 5vh;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!