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
cfe6978c
Commit
cfe6978c
authored
Jan 19, 2022
by
chris.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:远程图片
parent
43cb0f32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
4 deletions
+61
-4
NormalImage.vue
components/NormalImage/NormalImage.vue
+4
-4
RemoteImage.vue
components/RemoteImage/RemoteImage.vue
+55
-0
index.vue
pages/index/index.vue
+2
-0
No files found.
components/NormalImage/NormalImage.vue
View file @
cfe6978c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<BasicText
:elementInfo=
"elementInfo.option.title"
></BasicText>
<BasicText
:elementInfo=
"elementInfo.option.title"
></BasicText>
<u-empty
<u-empty
v-if=
"!elementInfo.option.images.list.length"
></u-empty>
v-if=
"!elementInfo.option.images.list.length"
></u-empty>
<u-image
<u-image
class=
"uimage"
v-if=
"elementInfo.option.images.list.length === 1"
v-if=
"elementInfo.option.images.list.length === 1"
width=
"100%"
width=
"100%"
:height=
"imageHeight"
:height=
"imageHeight"
...
@@ -58,11 +58,11 @@
...
@@ -58,11 +58,11 @@
flex-direction
:
column
;
flex-direction
:
column
;
height
:
100%
;
height
:
100%
;
overflow
:
hidden
;
overflow
:
hidden
;
}
image
{
.u
image
{
max-width
:
100%
;
max-width
:
100%
;
max-height
:
100%
;
max-height
:
100%
;
object-fit
:
contain
;
object-fit
:
contain
;
}
}
}
</
style
>
</
style
>
components/RemoteImage/RemoteImage.vue
0 → 100644
View file @
cfe6978c
<
template
>
<view
class=
"remoteView"
>
<u-image
class=
"remoteImage"
:src=
"imageUrl"
width=
"100%"
:height=
"imageHeight"
></u-image>
</view>
</
template
>
<
script
>
import
echartElementData
from
'@/mixins/echartElementData.js'
export
default
{
name
:
"RemoteImage"
,
mixins
:
[
echartElementData
],
data
()
{
return
{
imageUrl
:
""
,
windowWidth
:
0
,
//屏幕宽度
imageHeight
:
0
//图片高度
};
},
computed
:{
},
methods
:{
initChart
()
{
uni
.
getSystemInfo
({
success
:
res
=>
{
this
.
windowWidth
=
res
.
windowWidth
;
this
.
imageHeight
=
(
this
.
windowWidth
*
this
.
elementInfo
.
height
)
/
this
.
elementInfo
.
width
;
}
});
this
.
$nextTick
(()
=>
{
this
.
imageUrl
=
this
.
elementData
.
dataList
.
imageUrl
})
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.remoteView
{
display
:
flex
;
flex-direction
:
column
;
height
:
100%
;
overflow
:
hidden
;
}
.remoteImage
{
object-fit
:
contain
;
}
</
style
>
pages/index/index.vue
View file @
cfe6978c
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
<NormalProgress
v-if=
"element.type == 'NormalProgress'"
:elementInfo=
"element"
></NormalProgress>
<NormalProgress
v-if=
"element.type == 'NormalProgress'"
:elementInfo=
"element"
></NormalProgress>
<!-- 普通图片 -->
<!-- 普通图片 -->
<NormalImage
v-if=
"element.type == 'NormalImage'"
:elementInfo=
"element"
></NormalImage>
<NormalImage
v-if=
"element.type == 'NormalImage'"
:elementInfo=
"element"
></NormalImage>
<!-- 远程图片 -->
<RemoteImage
v-if=
"element.type == 'RemoteImage'"
:elementInfo=
"element"
></RemoteImage>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
...
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