Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
quantum-blocks
Commits
9ca122df
Commit
9ca122df
authored
Aug 23, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加容器之间四边边距调整
parent
a2c35685
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
index.ts
app/web/page/editor/component/DynamicForm/index.ts
+31
-2
index.vue
app/web/page/editor/component/DynamicForm/index.vue
+3
-0
No files found.
app/web/page/editor/component/DynamicForm/index.ts
View file @
9ca122df
...
...
@@ -22,6 +22,9 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
@
State
(
state
=>
state
.
editor
.
curChildIndex
)
curChildIndex
;
@
Getter
(
'
pageData
'
)
pageData
;
prevCommonStyle
:
object
=
{
paddingTop
:
0
,
paddingBottom
:
0
,
paddingLeft
:
0
,
paddingRight
:
0
};
form
:
object
=
{};
styleSchame
:
object
=
{
curEle
:
[
...
...
@@ -132,7 +135,23 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
},
{
label
:
'
背景颜色
'
}
},
{
label
:
'
上边距
'
,
key
:
'
paddingTop
'
},
{
label
:
'
下边距
'
,
key
:
'
paddingBottom
'
},
{
label
:
'
左边距
'
,
key
:
'
paddingLeft
'
},
{
label
:
'
右边距
'
,
key
:
'
paddingRight
'
},
]
};
...
...
@@ -141,11 +160,12 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
}
get
point
()
{
console
.
log
(
this
.
curEleIndex
||
this
.
curEleIndex
===
0
?
cloneDeep
(
this
.
pageData
.
elements
[
this
.
curEleIndex
]?.
point
)
:
{
h
:
0
,
w
:
0
});
return
this
.
curEleIndex
||
this
.
curEleIndex
===
0
?
cloneDeep
(
this
.
pageData
.
elements
[
this
.
curEleIndex
]?.
point
)
:
{
h
:
0
,
w
:
0
};
}
get
commonStyle
()
{
let
rs
=
{
backgroundColor
:
''
,
backgroundImage
:
''
};
let
rs
=
{
backgroundColor
:
''
,
backgroundImage
:
''
,
paddingTop
:
0
,
paddingBottom
:
0
,
paddingLeft
:
0
,
paddingRight
:
0
};
if
(
this
.
curEleIndex
||
this
.
curEleIndex
===
0
)
{
if
(
this
.
curChildIndex
||
this
.
curChildIndex
===
0
)
{
rs
=
cloneDeep
({
...
rs
,
...
this
.
pageData
.
elements
[
this
.
curEleIndex
].
child
[
this
.
curChildIndex
].
commonStyle
});
...
...
@@ -314,4 +334,13 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
}
this
.
updatePageInfo
({
containerIndex
:
this
.
curEleIndex
,
childIndex
:
this
.
curChildIndex
,
data
:
{
...
elements
,
commonStyle
:
{
...
elements
.
commonStyle
,
left
,
top
}
}
});
}
changeMargin
()
{
// this.point.w = this.point.w - (this.commonStyle.paddingLeft || 0) - (this.commonStyle.paddingRight || 0);
this
.
point
.
h
=
this
.
point
.
h
-
(
this
.
prevCommonStyle
.
paddingTop
||
0
)
-
(
this
.
prevCommonStyle
.
paddingBottom
||
0
)
+
(
this
.
commonStyle
.
paddingTop
||
0
)
+
(
this
.
commonStyle
.
paddingBottom
||
0
);
this
.
updateCommonStyle
({
containerIndex
:
this
.
curEleIndex
,
childIndex
:
this
.
curChildIndex
,
data
:
this
.
commonStyle
});
this
.
prevCommonStyle
=
cloneDeep
(
this
.
commonStyle
);
this
.
updatePoint
();
// this.adjustHeight();
}
}
\ No newline at end of file
app/web/page/editor/component/DynamicForm/index.vue
View file @
9ca122df
...
...
@@ -48,6 +48,9 @@
<
InputNumber
class
=
"
Df-basic-inputnumber
"
:
max
=
"
375
"
:
min
=
"
0
"
v
-
model
=
"
point.w
"
@
on
-
change
=
"
updatePoint($event, 'w')
"
><
/InputNumber
>
<
InputNumber
:
max
=
"
667
"
:
min
=
"
0
"
v
-
model
=
"
point.h
"
@
on
-
change
=
"
updatePoint($event, 'h')
"
><
/InputNumber
>
<
/template
>
<
template
v
-
else
-
if
=
"
item.label.indexOf('边距') > -1
"
>
<
Slider
v
-
model
=
"
commonStyle[item.key]
"
@
on
-
change
=
"
changeMargin
"
/>
<
/template
>
<
upload
v
-
else
-
if
=
"
item.label === '背景图片'
"
v
-
model
=
"
commonStyle.backgroundImage
"
@
change
=
"
updateStyle($event, 'backgroundImage')
"
><
/upload
>
<
ColorSelector
v
-
else
-
if
=
"
item.label === '背景颜色'
"
v
-
model
=
"
commonStyle.backgroundColor
"
@
input
=
"
updateStyle($event, 'backgroundColor')
"
><
/ColorSelector
>
<
template
v
-
else
>
...
...
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