Commit 613a74e7 authored by leon's avatar leon

feat: tabs add new style options

parent 838e84ce
......@@ -27,6 +27,12 @@
</view>
</swiper-item>
</swiper>
<template v-if="elementInfo.option.tabs.type === 'switch'">
<view @click="handleChangeSwitchValue()" class="switch-view" :style="[tabsStyle]">
{{elementData.dataList.series[currentTabs].name}}
</view>
</template>
</view>
</template>
......@@ -107,6 +113,11 @@
}
}
}
if (this.elementInfo.option.tabs.type === 'switch') {
this.currentTabs = this.elementData.dataList.series.findIndex(
item => item.value === this.tabsValue
)
}
},
handleShowSelect() {
uni.$emit('showSelect', {
......@@ -125,6 +136,7 @@
this.setTabsValue(index)
this.tabsValueChange()
},
handleSelectChange(e) {
this.selectValue = e[0].label
this.tabsValue = e[0].value
......@@ -139,6 +151,18 @@
this.tabsValue = value
this.tabsValueChange()
},
handleChangeSwitchValue() {
const count = this.elementData.dataList.series.length
if(this.currentTabs === count - 1) {
this.currentTabs = 0
} else {
this.currentTabs += 1
}
this.tabsValue = this.elementData.dataList.series[this.currentTabs].value
this.tabsValueChange()
},
/** 清除值 */
handleClearValue() {
this.tabsValue = ''
......@@ -153,6 +177,7 @@
paramName,
data
} = this.elementInfo.child
console.log(this.tabsValue)
if (this.elementInfo.child.type === 'param') {
uni.$emit('handleLinkParams', {
index,
......@@ -235,4 +260,13 @@
transform: translateY(-50%);
z-index: 2;
}
.switch-view {
width: 100%;
font-size: var(--font-size);
color: var(--color);
background: var(--item-background-color);
display: flex;
align-items: center;
justify-content: center;
}
</style>
......@@ -239,7 +239,7 @@
async getReportCharts() {
clearInterval(this.timename)
const that = this
let res = await that.$u.api.getReportCharts({id: '627a16644606332538b4633c'})
let res = await that.$u.api.getReportCharts({id: '63647c3932f1997dd2ed53bf'})
uni.stopPullDownRefresh()
uni.$emit('handlePullDownRefresh')
const { Status, Result: { info, list } } = res.data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment