Commit 343187e7 authored by Jenny's avatar Jenny

fix: APPF-3855 小程序报表切横屏样式修改

parent dc4728d1
...@@ -78,8 +78,9 @@ ...@@ -78,8 +78,9 @@
show: true, show: true,
icon: svg.enterFull, icon: svg.enterFull,
onclick() { onclick() {
const element = {...that.elementInfo} const { linkTabsId } = that.elementInfo
const url = "/pages/fullscreen/fullscreen?element=" + encodeURIComponent(JSON.stringify(element)) let url = `/pages/fullscreen/fullscreen?element=${encodeURIComponent(JSON.stringify(that.elementInfo))}`
if(linkTabsId) url = `${url}&linkTabsId=${linkTabsId}`
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
......
...@@ -64,8 +64,9 @@ ...@@ -64,8 +64,9 @@
show: true, show: true,
icon: svg.enterFull, icon: svg.enterFull,
onclick() { onclick() {
const element = {...that.elementInfo} const { linkTabsId } = that.elementInfo
const url = "/pages/fullscreen/fullscreen?element=" + encodeURIComponent(JSON.stringify(element)) let url = `/pages/fullscreen/fullscreen?element=${encodeURIComponent(JSON.stringify(that.elementInfo))}`
if(linkTabsId) url = `${url}&linkTabsId=${linkTabsId}`
uni.navigateTo({ uni.navigateTo({
url: url url: url
}) })
......
<template> <template>
<view class="wrapper" :style="[theStyle]"> <view class="wrapper" :class="{'tabs-layout': showTabs}">
<!-- 普通选项卡 --> <!-- 普通选项卡 -->
<NormalTabs v-if="linkTabsId && Object.keys(tabsElement).length" :elementInfo="tabsElement" class="tabs-position"></NormalTabs> <NormalTabs v-if="showTabs" :elementInfo="tabsElement" styleType="vertical" style="width: 15%;"></NormalTabs>
<view :style="{height: `${theStyle.height}px`, width: `${theStyle.width}px`}">
<!-- 普通柱状图 --> <!-- 普通柱状图 -->
<NormalBar v-if="element.type == 'NormalBar'" :elementInfo="element"></NormalBar> <NormalBar v-if="element.type == 'NormalBar'" :elementInfo="element"></NormalBar>
<!-- 普通折线图 --> <!-- 普通折线图 -->
...@@ -11,6 +12,8 @@ ...@@ -11,6 +12,8 @@
<!-- 折柱图 --> <!-- 折柱图 -->
<LineMixBar v-if="element.type == 'LineMixBar'" :elementInfo="element"></LineMixBar> <LineMixBar v-if="element.type == 'LineMixBar'" :elementInfo="element"></LineMixBar>
</view> </view>
</view>
</template> </template>
<script> <script>
...@@ -23,11 +26,15 @@ ...@@ -23,11 +26,15 @@
} }
}, },
computed: { computed: {
showTabs() {
return this.linkTabsId && Object.keys(this.tabsElement).length
},
theStyle() { theStyle() {
const { windowWidth, windowHeight } = uni.getSystemInfoSync() const { windowWidth, windowHeight, screenHeight, safeArea } = uni.getSystemInfoSync()
const reduceBottom = screenHeight - safeArea.bottom
return { return {
'height': `${windowHeight}px`, height: windowHeight - reduceBottom,
'width': `${windowWidth}px`, width: this.showTabs ? windowWidth * 0.85 : windowWidth
} }
}, },
}, },
...@@ -37,8 +44,7 @@ ...@@ -37,8 +44,7 @@
if(this.linkTabsId && uni.getStorageSync('reportInfo')) { if(this.linkTabsId && uni.getStorageSync('reportInfo')) {
let info = JSON.parse(uni.getStorageSync('reportInfo')) let info = JSON.parse(uni.getStorageSync('reportInfo'))
const data = info.list.find(item => item.id === this.linkTabsId) const data = info.list.find(item => item.id === this.linkTabsId)
// data.option.tabs.type = 'vertical' data.height = this.theStyle.height
// data.height = uni.getSystemInfoSync().windowHeight
data.option.tabs.defaultValue = data.child.data.find(item => item.comp === this.element.id).name data.option.tabs.defaultValue = data.child.data.find(item => item.comp === this.element.id).name
this.tabsElement = data this.tabsElement = data
} }
...@@ -52,21 +58,24 @@ ...@@ -52,21 +58,24 @@
*/ */
uni.$on('handleLinkComp', ({ showData, hideData }) => { uni.$on('handleLinkComp', ({ showData, hideData }) => {
let info = JSON.parse(uni.getStorageSync('reportInfo')) let info = JSON.parse(uni.getStorageSync('reportInfo'))
this.element = info.list.find(item => showData[0] === item.id) const data = info.list.find(item => showData[0] === item.id)
data.hide = false
// 去掉全屏的定制按钮 // 去掉全屏的定制按钮
const toolbox = {show: false} data.option.toolbox = { show: false }
this.element.option.toolbox = toolbox this.element = data
}) })
} }
} }
</script> </script>
<style> <style>
page {
height: 100%;
}
.wrapper { .wrapper {
position: relative; position: relative;
width: 100%; width: 100%;
user-select: none; user-select: none;
// overflow: auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-position: center; background-position: center;
...@@ -80,12 +89,4 @@ ...@@ -80,12 +89,4 @@
justify-content: space-between; justify-content: space-between;
} }
/* .tabs-position {
position: absolute;
left: 0;
top: 0;
width: 12%;
z-index: 999;
} */
</style> </style>
...@@ -319,6 +319,7 @@ ...@@ -319,6 +319,7 @@
} }
return item return item
}) })
uni.setStorageSync('reportInfo', JSON.stringify(that.reportInfo))
} }
}, },
getStickyTables() { getStickyTables() {
......
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