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
daeca6f5
Commit
daeca6f5
authored
May 07, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
25a47f09
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
286 additions
and
134 deletions
+286
-134
playground.scss
src/themes/light/playground.scss
+3
-3
Playground.vue
src/views/Editor/Playground.vue
+81
-8
editControlView.vue
src/views/Editor/components/editControlView.vue
+202
-123
No files found.
src/themes/light/playground.scss
View file @
daeca6f5
.zero-playground-body-center
{
position
:
relative
;
width
:
750px
;
height
:
1
206
px
;
height
:
1
624
px
;
margin
:
10px
auto
;
// max-height: 1200px;
background-color
:
transparent
;
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
0
.4
);
overflow-x
:
hidden
;
overflow-y
:
auto
;
//
overflow-x: hidden;
//
overflow-y: auto;
/*transform: scale(.5, .5);
transform-origin: 50% 0%;*/
//zoom: 0.5;
...
...
src/views/Editor/Playground.vue
View file @
daeca6f5
<
template
>
<pane
icon=
"el-icon-s-open"
class=
"pane-playground"
:title=
"$t('panes.Playground')"
>
<div
class=
"zero-playground-body-center"
:style=
"playgroundStyle"
>
<div
class=
"draw-body"
>
<div
class=
"playground-con"
>
<!--
<label
class=
"el-form-item__label"
>
滑动滚轮进行缩放
</label>
-->
<el-button
size=
"mini"
@
click=
"setZoom(true)"
><i
class=
"el-icon-plus"
></i></el-button>
<el-input
class=
"el-input el-input--mini"
:value=
"parseInt(zoom*100)+'%'"
style=
"width:60px"
readonly
/>
<el-button
size=
"mini"
@
click=
"setZoom(false)"
><i
class=
"el-icon-minus"
></i></el-button>
</div>
<div
class=
"zero-playground-body-center"
:style=
"playgroundStyle"
>
<!--
<div
class=
"zero-playground-draw-panel"
>
-->
<draw-canvas-panel></draw-canvas-panel>
<!--
</div>
-->
</div>
</div>
</pane>
</
template
>
...
...
@@ -18,21 +28,51 @@ export default {
name
:
'Playground'
,
components
:
{
Pane
,
DrawPanel
,
DrawCanvasPanel
},
props
:
{
zoom
:
0.5
},
data
:{
data
()
{
return
{
zoom
:
0.5
,
hasCtrlState
:
false
}
},
methods
:
{
mouseWheel
(
e
){
console
.
log
(
e
)
console
.
log
(
this
.
hasCtrlState
)
if
(
!
this
.
hasCtrlState
){
return
;
}
if
(
e
.
deltaY
>
0
){
this
.
zoom
-=
0.1
this
.
setZoom
(
false
)
}
else
if
(
e
.
deltaY
<
0
){
this
.
zoom
+=
0.1
this
.
setZoom
(
true
)
}
console
.
log
(
this
.
zoom
)
// this.$set(this.zoom, this.zoomj)
},
setZoom
(
state
){
if
(
state
){
if
(
this
.
zoom
>=
1.4
){
this
.
zoom
=
1.4
}
else
{
this
.
zoom
+=
0.05
}
}
else
{
if
(
this
.
zoom
<=
0.2
){
this
.
zoom
=
0.2
}
else
{
this
.
zoom
-=
0.05
}
}
// this.zoom=this.zoom.toFixed(2)
events
.
$emit
(
'setPlaygroundZoom'
,
{
zoom
:
this
.
zoom
});
},
keyDo
(
state
){
console
.
log
(
state
)
this
.
hasCtrlState
=
state
;
}
},
computed
:
{
...
...
@@ -48,13 +88,46 @@ export default {
created
(){
//alert()
this
.
zoom
=
0.5
;
document
.
body
.
addEventListener
(
'mousewheel'
,(
e
)
=>
{
this
.
mouseWheel
(
e
)
},
false
)
document
.
onkeydown
=
(
e
)
=>
{
let
key
=
window
.
event
.
keyCode
;
if
(
key
==
18
)
{
this
.
keyDo
(
true
);
}
};
document
.
onkeyup
=
(
e
)
=>
{
let
key
=
window
.
event
.
keyCode
;
if
(
key
==
18
)
{
this
.
keyDo
(
false
);
}
};
},
mounted
(){
events
.
$emit
(
'setPlaygroundZoom'
,
{
zoom
:
this
.
zoom
});
console
.
log
(
123
)
}
};
</
script
>
<
style
scoped
>
</
style
>
<
style
lang=
"scss"
>
.pane-playground
{
}
.draw-body
{
width
:
100%
;
height
:
100%
;
overflow
:
auto
;
}
.playground-con
{
width
:
100%
;
height
:
50px
;
}
</
style
>
\ No newline at end of file
src/views/Editor/components/editControlView.vue
View file @
daeca6f5
This diff is collapsed.
Click to expand it.
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