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
02580396
Commit
02580396
authored
Dec 13, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 柱状图弹窗修改
parent
3c393b43
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
36 deletions
+52
-36
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+13
-4
ModelData.vue
components/ModelData/ModelData.vue
+31
-26
details.vue
pages/details/details.vue
+4
-5
index.vue
pages/index/index.vue
+4
-1
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
02580396
...
...
@@ -92,7 +92,16 @@ export default {
urls
:
urls
})
}
else
if
(
popup
)
{
uni
.
$emit
(
'showBarDetail'
,
{
let
routes
=
getCurrentPages
()
let
curRoute
=
routes
[
routes
.
length
-
1
].
route
let
eventName
=
''
if
(
curRoute
===
'pages/index/index'
)
{
eventName
=
'indexShowBar'
}
else
{
eventName
=
'detailShowBar'
}
uni
.
$emit
(
eventName
,
{
page
:
curRoute
,
popupShow
:
true
,
popupData
:
data
,
currentIndex
:
event
.
dataIndex
,
...
...
components/ModelData/ModelData.vue
View file @
02580396
<
template
>
<u-modal
class=
"model-data"
v-model=
"
popupShow"
:closeOnClickOverlay=
"true
"
title=
"明细"
@
close=
"close"
<u-modal
class=
"model-data"
v-model=
"
show
"
title=
"明细"
@
close=
"close"
@
confirm=
"close"
>
<view
class=
"slot-content"
@
touchstart=
"touchStart"
@
touchmove=
"touchMove"
@
touchend=
"touchEnd"
:animation=
"animationData"
>
<view
v-for=
"(val, key) in popupObject"
class=
"data-view"
>
<view
v-for=
"(val, key) in popupObject"
:key=
"key"
class=
"data-view"
>
<view
class=
"data-key ellipsis"
>
{{
key
}}
</view>
<template
v-if=
"customRender[key] === 'picture'"
>
<u-image
:height=
"100"
mode=
"aspectFit"
:src=
"val"
crossOrigin=
"anonymous"
style=
"width: 100%"
...
...
@@ -63,14 +63,19 @@
set
(
val
)
{
return
val
}
},
show
:
{
get
()
{
return
this
.
popupShow
},
set
(
val
)
{
return
val
}
}
},
methods
:
{
close
()
{
uni
.
$emit
(
'showBarDetail'
,
{
popupShow
:
false
,
popupData
:
[]
})
this
.
$emit
(
'close'
)
},
seeImage
(
key
)
{
var
images
=
[]
...
...
pages/details/details.vue
View file @
02580396
...
...
@@ -63,6 +63,7 @@
:popupData=
"popupData"
:currentIndex=
"currentIndex"
:customRender=
"customRender"
@
close=
"popupShow=false"
></ModelData>
</view>
</template>
...
...
@@ -161,7 +162,7 @@
uni
.
$on
(
'handleUpdateHeight'
,
(
height
)
=>
{
that
.
horizontalBarHeight
=
height
}),
uni
.
$on
(
'
showBarDetail
'
,
data
=>
{
uni
.
$on
(
'
detailShowBar
'
,
data
=>
{
const
{
popupShow
,
popupData
,
customRender
,
currentIndex
}
=
data
that
.
popupShow
=
popupShow
that
.
popupData
=
popupData
...
...
@@ -171,15 +172,13 @@
},
onUnload
()
{
// 如何监听页面卸载时候隐藏弹窗
uni
.
$on
(
'showBarDetail'
,
data
=>
{
that
.
popupShow
=
false
})
this
.
popupShow
=
false
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
uni
.
$off
(
'handleLinkComp'
)
uni
.
$off
(
'handleDataZoomParams'
)
uni
.
$off
(
'handleUpdateHeight'
)
uni
.
$off
(
'
showBarDetail
'
)
uni
.
$off
(
'
detailShowBar
'
)
clearInterval
(
this
.
timename
)
},
methods
:
{
...
...
pages/index/index.vue
View file @
02580396
...
...
@@ -66,6 +66,7 @@
:popupData=
"popupData"
:currentIndex=
"currentIndex"
:customRender=
"customRender"
@
close=
"popupShow=false"
></ModelData>
</view>
</template>
...
...
@@ -157,7 +158,7 @@
uni
.
$on
(
'handleUpdateHeight'
,
(
height
)
=>
{
that
.
horizontalBarHeight
=
height
})
uni
.
$on
(
'
showBarDetail
'
,
data
=>
{
uni
.
$on
(
'
indexShowBar
'
,
data
=>
{
const
{
popupShow
,
popupData
,
customRender
,
currentIndex
}
=
data
that
.
popupShow
=
popupShow
that
.
popupData
=
popupData
...
...
@@ -166,11 +167,13 @@
})
},
onHide
()
{
this
.
popupShow
=
false
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
uni
.
$off
(
'handleLinkComp'
)
uni
.
$off
(
'handleDataZoomParams'
)
uni
.
$off
(
'handleUpdateHeight'
)
uni
.
$off
(
'indexShowBar'
)
clearInterval
(
this
.
timename
)
},
methods
:
{
...
...
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