Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
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
劳工
zeroing-editor
Commits
16b753e0
Commit
16b753e0
authored
Dec 07, 2019
by
张晨辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: image类型节点增加原图高宽度属性
parent
c0c6b795
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
+32
-3
index.vue
src/components/customSettings/source/index.vue
+4
-0
project.js
src/store/modules/project.js
+5
-3
common.js
src/utils/common.js
+5
-0
properties.js
src/utils/properties.js
+18
-0
No files found.
src/components/customSettings/source/index.vue
View file @
16b753e0
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
placement=
"top"
placement=
"top"
trigger=
"hover"
trigger=
"hover"
width=
"auto"
width=
"auto"
:disabled=
"!legalUrl"
:content=
"url"
:content=
"url"
>
>
<img
style=
"max-width: 200px;"
v-if=
"url"
:src=
"url"
alt=
""
/>
<img
style=
"max-width: 200px;"
v-if=
"url"
:src=
"url"
alt=
""
/>
...
@@ -51,6 +52,9 @@ export default {
...
@@ -51,6 +52,9 @@ export default {
}
else
{
}
else
{
return
''
;
return
''
;
}
}
},
legalUrl
:
function
()
{
return
(
this
.
swvalue
+
''
).
indexOf
(
'//'
)
>
-
1
;
}
}
}
}
};
};
...
...
src/store/modules/project.js
View file @
16b753e0
...
@@ -495,7 +495,9 @@ export const projectStore = {
...
@@ -495,7 +495,9 @@ export const projectStore = {
});
});
if
(
_props
.
source
)
{
if
(
_props
.
source
)
{
if
(
!
_props
.
width
||
!
_props
.
height
)
{
// imageWidth imageHeight
// 设置image类型节点的原图高宽度
if
(
!
_props
.
imageWidth
||
!
_props
.
imageHeight
)
{
let
_url
=
_props
.
source
;
//_source.value;
let
_url
=
_props
.
source
;
//_source.value;
if
(
_url
.
indexOf
(
'asset://'
)
===
0
)
{
if
(
_url
.
indexOf
(
'asset://'
)
===
0
)
{
let
uuid
=
_url
.
split
(
'//'
)[
1
];
let
uuid
=
_url
.
split
(
'//'
)[
1
];
...
@@ -505,8 +507,8 @@ export const projectStore = {
...
@@ -505,8 +507,8 @@ export const projectStore = {
let
_img
=
new
Image
();
let
_img
=
new
Image
();
_img
.
src
=
_url
;
_img
.
src
=
_url
;
_img
.
onload
=
function
()
{
_img
.
onload
=
function
()
{
_props
.
w
idth
=
_img
.
width
;
_props
.
imageW
idth
=
_img
.
width
;
_props
.
h
eight
=
_img
.
height
;
_props
.
imageH
eight
=
_img
.
height
;
commit
(
'modifyActiveView'
,
{
commit
(
'modifyActiveView'
,
{
properties
:
_props
properties
:
_props
});
});
...
...
src/utils/common.js
View file @
16b753e0
...
@@ -265,6 +265,11 @@ export const styles = {
...
@@ -265,6 +265,11 @@ export const styles = {
});
});
}
}
if
(
component
.
type
===
'image'
)
{
cmpSelfProps
.
width
=
cmpSelfProps
.
width
||
cmpSelfProps
.
imageWidth
;
cmpSelfProps
.
height
=
cmpSelfProps
.
height
||
cmpSelfProps
.
imageHeight
;
}
// 获取拖拽组件的样式,只生成operatProps中的属性
// 获取拖拽组件的样式,只生成operatProps中的属性
if
(
onlyOpera
)
{
if
(
onlyOpera
)
{
_
.
forIn
(
cmpSelfProps
,
(
val
,
key
)
=>
{
_
.
forIn
(
cmpSelfProps
,
(
val
,
key
)
=>
{
...
...
src/utils/properties.js
View file @
16b753e0
...
@@ -194,6 +194,24 @@ export default {
...
@@ -194,6 +194,24 @@ export default {
title
:
'来源'
,
title
:
'来源'
,
type
:
'source'
,
type
:
'source'
,
value
:
''
value
:
''
},
imageWidth
:
{
title
:
'原图宽度'
,
type
:
'input'
,
value
:
''
,
desc
:
'原图片的宽度'
,
props
:
{
disabled
:
true
}
},
imageHeight
:
{
title
:
'原图高度'
,
type
:
'input'
,
value
:
''
,
desc
:
'原图片的高度'
,
props
:
{
disabled
:
true
}
}
}
},
},
rect
:
{
rect
:
{
...
...
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