Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lihuizhen
ec-report-refactor
Commits
9e69639a
Commit
9e69639a
authored
Dec 08, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 横向柱状图点击弹框
parent
9a44378f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
416 additions
and
291 deletions
+416
-291
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+326
-289
ModelData.vue
components/ModelData/ModelData.vue
+69
-0
index.vue
pages/index/index.vue
+15
-2
common.scss
static/style/common.scss
+6
-0
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
9e69639a
This diff is collapsed.
Click to expand it.
components/ModelData/ModelData.vue
0 → 100644
View file @
9e69639a
<
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
>
pages/index/index.vue
View file @
9e69639a
...
...
@@ -15,7 +15,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' ? 9999
99
: index + 1}`
zIndex: `${element.type == 'NormalTabs' || element.type == 'DateTimePicker' ? 9999 : index + 1}`
}"
>
<!-- 普通柱状图 -->
...
...
@@ -59,6 +59,12 @@
<!--
<Table
v-if=
"element.type == 'NormalTable'"
:elementInfo=
"element"
></Table>
-->
</view>
</
template
>
<ModelData
style=
"position: relative;z-index: 99999;"
:popupShow=
"popupShow"
:popupData=
"popupData"
></ModelData>
</view>
</template>
...
...
@@ -70,7 +76,9 @@
timename
:
null
,
pageScrollTop
:
0
,
stickyTables
:
[],
// 设置了吸顶的table
horizontalBarHeight
:
0
horizontalBarHeight
:
0
,
popupShow
:
false
,
popupData
:
{}
}
},
computed
:
{
...
...
@@ -145,6 +153,11 @@
uni
.
$on
(
'handleUpdateHeight'
,
(
height
)
=>
{
that
.
horizontalBarHeight
=
height
})
uni
.
$on
(
'showBarDetail'
,
data
=>
{
const
{
popupShow
,
popupData
}
=
data
that
.
popupShow
=
popupShow
that
.
popupData
=
popupData
})
},
onHide
()
{
// 移除监听事件
...
...
static/style/common.scss
View file @
9e69639a
...
...
@@ -26,4 +26,10 @@
width
:
100%
;
height
:
100%
;
display
:block
;
}
.ellipsis
{
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment