Commit 9e69639a authored by Jenny's avatar Jenny

feat: 横向柱状图点击弹框

parent 9a44378f
This diff is collapsed.
<template>
<u-modal
class="model-data"
v-model="popupShow"
:closeOnClickOverlay="true"
title="明细"
@close="close"
@confirm="close"
>
<view class="slot-content">
<view v-for="(val, key) in popupData" class="data-view">
<view class="data-key ellipsis">{{ key }}</view>
<view class="data-val ellipsis">{{ val }}</view>
</view>
</view>
</u-modal>
</template>
<script>
export default {
name: 'ModelData',
data() {
return {}
},
props: {
popupData: {
type: Object,
default: () => {}
},
popupShow: {
type: Boolean,
default: false
}
},
methods: {
close() {
console.log(1)
uni.$emit('showBarDetail', {
popupShow: false,
popupData: {}
})
}
}
}
</script>
<style scoped>
.model-data {
position: relative;
z-index: 9999999;
}
.slot-content {
margin: 10px;
font-size: 12px;
border: 1px solid #eee;
border-radius: 5px;
}
.data-view {
display: flex;
align-self: center;
border-bottom: 1px solid #eee;
padding: 5px;
}
.data-key {
min-width: 28%;
margin-right: 10px;
border-right: 1px solid #eee;
}
</style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,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}`
}" }"
> >
<!-- 普通柱状图 --> <!-- 普通柱状图 -->
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
<!-- <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"
></ModelData>
</view> </view>
</template> </template>
...@@ -70,7 +76,9 @@ ...@@ -70,7 +76,9 @@
timename: null, timename: null,
pageScrollTop: 0, pageScrollTop: 0,
stickyTables: [], // 设置了吸顶的table stickyTables: [], // 设置了吸顶的table
horizontalBarHeight: 0 horizontalBarHeight: 0,
popupShow: false,
popupData: {}
} }
}, },
computed: { computed: {
...@@ -145,6 +153,11 @@ ...@@ -145,6 +153,11 @@
uni.$on('handleUpdateHeight', (height) => { uni.$on('handleUpdateHeight', (height) => {
that.horizontalBarHeight = height that.horizontalBarHeight = height
}) })
uni.$on('showBarDetail', data => {
const { popupShow, popupData } = data
that.popupShow = popupShow
that.popupData = popupData
})
}, },
onHide() { onHide() {
// 移除监听事件 // 移除监听事件
......
...@@ -26,4 +26,10 @@ ...@@ -26,4 +26,10 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display:block; display:block;
}
.ellipsis {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
} }
\ No newline at end of file
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