Commit 3c393b43 authored by leon's avatar leon

feat: detail page add popup

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