Commit 613a74e7 authored by leon's avatar leon

feat: tabs add new style options

parent 838e84ce
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </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> </view>
</template> </template>
...@@ -107,6 +113,11 @@ ...@@ -107,6 +113,11 @@
} }
} }
} }
if (this.elementInfo.option.tabs.type === 'switch') {
this.currentTabs = this.elementData.dataList.series.findIndex(
item => item.value === this.tabsValue
)
}
}, },
handleShowSelect() { handleShowSelect() {
uni.$emit('showSelect', { uni.$emit('showSelect', {
...@@ -125,6 +136,7 @@ ...@@ -125,6 +136,7 @@
this.setTabsValue(index) this.setTabsValue(index)
this.tabsValueChange() this.tabsValueChange()
}, },
handleSelectChange(e) { handleSelectChange(e) {
this.selectValue = e[0].label this.selectValue = e[0].label
this.tabsValue = e[0].value this.tabsValue = e[0].value
...@@ -139,6 +151,18 @@ ...@@ -139,6 +151,18 @@
this.tabsValue = value this.tabsValue = value
this.tabsValueChange() 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() { handleClearValue() {
this.tabsValue = '' this.tabsValue = ''
...@@ -153,6 +177,7 @@ ...@@ -153,6 +177,7 @@
paramName, paramName,
data data
} = this.elementInfo.child } = this.elementInfo.child
console.log(this.tabsValue)
if (this.elementInfo.child.type === 'param') { if (this.elementInfo.child.type === 'param') {
uni.$emit('handleLinkParams', { uni.$emit('handleLinkParams', {
index, index,
...@@ -235,4 +260,13 @@ ...@@ -235,4 +260,13 @@
transform: translateY(-50%); transform: translateY(-50%);
z-index: 2; 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> </style>
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
async getReportCharts() { async getReportCharts() {
clearInterval(this.timename) clearInterval(this.timename)
const that = this const that = this
let res = await that.$u.api.getReportCharts({id: '627a16644606332538b4633c'}) let res = await that.$u.api.getReportCharts({id: '63647c3932f1997dd2ed53bf'})
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
uni.$emit('handlePullDownRefresh') uni.$emit('handlePullDownRefresh')
const { Status, Result: { info, list } } = res.data 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