Commit 3c393b43 authored by leon's avatar leon

feat: detail page add popup

parent 18acb150
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
height: `${element.type == 'HorizontalBar' && horizontalBarHeight ? horizontalBarHeight : parseInt(element.height * scale)}px`, height: `${element.type == 'HorizontalBar' && horizontalBarHeight ? horizontalBarHeight : parseInt(element.height * scale)}px`,
left: `${parseInt(element.left * scale)}px`, left: `${parseInt(element.left * scale)}px`,
top: `${parseInt(element.top * scale)}px`, top: `${parseInt(element.top * scale)}px`,
zIndex: `${element.type == 'NormalTabs' || element.type == 'DateTimePicker' ? 999999 : index + 1}` zIndex: `${element.type == 'NormalTabs' || element.type == 'DateTimePicker' ? 9999 : index + 1}`
}" }"
> >
<!-- 普通柱状图 --> <!-- 普通柱状图 -->
...@@ -57,6 +57,13 @@ ...@@ -57,6 +57,13 @@
<!-- <Table v-if="element.type == 'NormalTable'" :elementInfo="element"></Table> --> <!-- <Table v-if="element.type == 'NormalTable'" :elementInfo="element"></Table> -->
</view> </view>
</template> </template>
<ModelData
style="position: relative;z-index: 99999;"
:popupShow="popupShow"
:popupData="popupData"
:currentIndex="currentIndex"
:customRender="customRender"
></ModelData>
</view> </view>
</template> </template>
...@@ -72,7 +79,12 @@ ...@@ -72,7 +79,12 @@
timename: null, timename: null,
pageScrollTop: 0, pageScrollTop: 0,
stickyTables: [], // 设置了吸顶的table stickyTables: [], // 设置了吸顶的table
horizontalBarHeight: 0 horizontalBarHeight: 0,
popupShow: false,
popupData: {},
customRender: {},
currentIndex: 0
} }
}, },
computed: { computed: {
...@@ -148,14 +160,26 @@ ...@@ -148,14 +160,26 @@
}) })
uni.$on('handleUpdateHeight', (height) => { uni.$on('handleUpdateHeight', (height) => {
that.horizontalBarHeight = height that.horizontalBarHeight = height
}),
uni.$on('showBarDetail', data => {
const { popupShow, popupData, customRender, currentIndex } = data
that.popupShow = popupShow
that.popupData = popupData
that.currentIndex = currentIndex
that.customRender = customRender
}) })
}, },
onUnload() { onUnload() {
// 如何监听页面卸载时候隐藏弹窗
uni.$on('showBarDetail', data => {
that.popupShow = false
})
// 移除监听事件 // 移除监听事件
uni.$off('handleLinkParams') uni.$off('handleLinkParams')
uni.$off('handleLinkComp') uni.$off('handleLinkComp')
uni.$off('handleDataZoomParams') uni.$off('handleDataZoomParams')
uni.$off('handleUpdateHeight') uni.$off('handleUpdateHeight')
uni.$off('showBarDetail')
clearInterval(this.timename) clearInterval(this.timename)
}, },
methods: { methods: {
......
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