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
7bd2aa5c
Commit
7bd2aa5c
authored
Dec 08, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 柱状图弹框 - 图片点击预览
parent
1601aefe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+4
-2
ModelData.vue
components/ModelData/ModelData.vue
+21
-2
index.vue
pages/index/index.vue
+5
-2
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
7bd2aa5c
...
@@ -73,7 +73,8 @@ export default {
...
@@ -73,7 +73,8 @@ export default {
}
}
chart
.
setOption
(
that
.
ec
.
option
)
chart
.
setOption
(
that
.
ec
.
option
)
chart
.
on
(
'click'
,
event
=>
{
chart
.
on
(
'click'
,
event
=>
{
const
{
preview
,
images
,
popup
,
data
}
=
that
.
elementData
.
dataList
const
{
preview
,
images
,
popup
,
data
,
customRender
}
=
that
.
elementData
.
dataList
var
urls
=
[]
var
urls
=
[]
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
images
&&
images
&&
...
@@ -93,7 +94,8 @@ export default {
...
@@ -93,7 +94,8 @@ export default {
}
else
if
(
popup
)
{
}
else
if
(
popup
)
{
uni
.
$emit
(
'showBarDetail'
,
{
uni
.
$emit
(
'showBarDetail'
,
{
popupShow
:
true
,
popupShow
:
true
,
popupData
:
data
[
event
.
dataIndex
]
popupData
:
data
[
event
.
dataIndex
],
customRender
})
})
}
else
{
}
else
{
that
.
handleEchartsClick
(
event
)
that
.
handleEchartsClick
(
event
)
...
...
components/ModelData/ModelData.vue
View file @
7bd2aa5c
...
@@ -10,7 +10,17 @@
...
@@ -10,7 +10,17 @@
<view
class=
"slot-content"
>
<view
class=
"slot-content"
>
<view
v-for=
"(val, key) in popupData"
class=
"data-view"
>
<view
v-for=
"(val, key) in popupData"
class=
"data-view"
>
<view
class=
"data-key ellipsis"
>
{{
key
}}
</view>
<view
class=
"data-key ellipsis"
>
{{
key
}}
</view>
<view
class=
"data-val ellipsis"
>
{{
val
}}
</view>
<template
v-if=
"customRender[key] === 'picture'"
>
<u-image
:height=
"100"
mode=
"aspectFit"
:src=
"val"
crossOrigin=
"anonymous"
style=
"width: 100%"
@
click=
"seeImage(val)"
></u-image>
</
template
>
<view
v-else
class=
"data-val ellipsis"
>
{{ val }}
</view>
</view>
</view>
</view>
</view>
</u-modal>
</u-modal>
...
@@ -30,15 +40,24 @@ export default {
...
@@ -30,15 +40,24 @@ export default {
popupShow
:
{
popupShow
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
customRender
:
{
type
:
Object
,
default
:
()
=>
{}
}
}
},
},
methods
:
{
methods
:
{
close
()
{
close
()
{
console
.
log
(
1
)
uni
.
$emit
(
'showBarDetail'
,
{
uni
.
$emit
(
'showBarDetail'
,
{
popupShow
:
false
,
popupShow
:
false
,
popupData
:
{}
popupData
:
{}
})
})
},
seeImage
(
url
)
{
uni
.
previewImage
({
current
:
0
,
urls
:
[
url
]
})
}
}
}
}
}
}
...
...
pages/index/index.vue
View file @
7bd2aa5c
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
style=
"position: relative;z-index: 99999;"
style=
"position: relative;z-index: 99999;"
:popupShow=
"popupShow"
:popupShow=
"popupShow"
:popupData=
"popupData"
:popupData=
"popupData"
:customRender=
"customRender"
></ModelData>
></ModelData>
</view>
</view>
</template>
</template>
...
@@ -78,7 +79,8 @@
...
@@ -78,7 +79,8 @@
stickyTables
:
[],
// 设置了吸顶的table
stickyTables
:
[],
// 设置了吸顶的table
horizontalBarHeight
:
0
,
horizontalBarHeight
:
0
,
popupShow
:
false
,
popupShow
:
false
,
popupData
:
{}
popupData
:
{},
customRender
:
{}
}
}
},
},
computed
:
{
computed
:
{
...
@@ -154,9 +156,10 @@
...
@@ -154,9 +156,10 @@
that
.
horizontalBarHeight
=
height
that
.
horizontalBarHeight
=
height
})
})
uni
.
$on
(
'showBarDetail'
,
data
=>
{
uni
.
$on
(
'showBarDetail'
,
data
=>
{
const
{
popupShow
,
popupData
}
=
data
const
{
popupShow
,
popupData
,
customRender
}
=
data
that
.
popupShow
=
popupShow
that
.
popupShow
=
popupShow
that
.
popupData
=
popupData
that
.
popupData
=
popupData
that
.
customRender
=
customRender
})
})
},
},
onHide
()
{
onHide
()
{
...
...
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