Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
9620cd71
提交
9620cd71
authored
11月 12, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dataease/dataease into dev
上级
d283f6a9
75a22aab
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
18 行删除
+34
-18
index.vue
frontend/src/components/DeDrag/index.vue
+34
-18
没有找到文件。
frontend/src/components/DeDrag/index.vue
浏览文件 @
9620cd71
...
...
@@ -3,14 +3,12 @@
:style=
"style"
:class=
"[
{
[classNameActive]: enabled ,
[classNameDragging]: dragging,
[classNameResizing]: resizing,
[classNameDraggable]: draggable,
[classNameResizable]: resizable,
[classNameRotating]: rotating,
[classNameRotatable]: rotatable,
[classNameMouseOn]: mouseOn || active,
['linkageSetting']:linkageActive,
['positionChange']:!(dragging || resizing||rotating)
},
...
...
@@ -21,19 +19,28 @@
@mouseenter="enter"
@mouseleave="leave"
>
<edit-bar
v-if=
"curComponent&&(active||linkageSettingStatus)"
style=
"transform: translateZ(10px)"
:active-model=
"'edit'"
:element=
"element"
@
showViewDetails=
"showViewDetails"
@
amRemoveItem=
"amRemoveItem"
@
amAddItem=
"amAddItem"
@
resizeView=
"resizeView"
@
linkJumpSet=
"linkJumpSet"
/>
<div
v-if=
"resizing"
style=
"transform: translateZ(11px);position: absolute; z-index: 3"
:style=
"resizeShadowStyle"
/>
<div
v-for=
"(handlei, indexi) in actualHandles"
:key=
"indexi"
:class=
"[classNameHandle, classNameHandle + '-' + handlei]"
:style=
"handleStyle(handlei, indexi)"
@
mousedown
.
stop
.
prevent=
"handleDown(handlei, $event)"
@
touchstart
.
stop
.
prevent=
"handleTouchDown(handlei, $event)"
:class=
"[
{
[classNameActive]: enabled ,
[classNameMouseOn]: mouseOn || active
},
className
]"
:style="mainSlotStyle"
>
<slot
:name=
"handlei"
/>
</div>
<div
:style=
"mainSlotStyle"
:class=
"
{'gap_class':canvasStyleData.panel.gap==='yes'}">
<edit-bar
v-if=
"curComponent&&(active||linkageSettingStatus)"
style=
"transform: translateZ(10px)"
:active-model=
"'edit'"
:element=
"element"
@
showViewDetails=
"showViewDetails"
@
amRemoveItem=
"amRemoveItem"
@
amAddItem=
"amAddItem"
@
resizeView=
"resizeView"
@
linkJumpSet=
"linkJumpSet"
/>
<div
v-if=
"resizing"
style=
"transform: translateZ(11px);position: absolute; z-index: 3"
:style=
"resizeShadowStyle"
/>
<div
v-for=
"(handlei, indexi) in actualHandles"
:key=
"indexi"
:class=
"[classNameHandle, classNameHandle + '-' + handlei]"
:style=
"handleStyle(handlei, indexi)"
@
mousedown
.
stop
.
prevent=
"handleDown(handlei, $event)"
@
touchstart
.
stop
.
prevent=
"handleTouchDown(handlei, $event)"
>
<slot
:name=
"handlei"
/>
</div>
<slot
/>
</div>
</div>
...
...
@@ -437,6 +444,7 @@ export default {
style
()
{
// console.log('style-top:' + this.y + '--' + this.top)
return
{
padding
:
(
this
.
canvasStyleData
.
panel
.
gap
===
'yes'
?
this
.
componentGap
:
0
)
+
'px'
,
transform
:
`translate(
${
this
.
left
}
px,
${
this
.
top
}
px) rotate(
${
this
.
rotate
}
deg)`
,
width
:
this
.
computedWidth
,
height
:
this
.
computedHeight
,
...
...
@@ -479,6 +487,7 @@ export default {
// 根据left right 算出元素的宽度
computedMainSlotWidth
()
{
const
gap
=
(
this
.
canvasStyleData
.
panel
.
gap
===
'yes'
?
this
.
componentGap
:
0
)
*
2
if
(
this
.
w
===
'auto'
)
{
if
(
!
this
.
widthTouched
)
{
return
'auto'
...
...
@@ -486,13 +495,14 @@ export default {
}
if
(
this
.
element
.
auxiliaryMatrix
)
{
const
width
=
Math
.
round
(
this
.
width
/
this
.
curCanvasScale
.
matrixStyleWidth
)
*
this
.
curCanvasScale
.
matrixStyleWidth
return
width
+
'px'
return
(
width
-
gap
)
+
'px'
}
else
{
return
this
.
width
+
'px'
return
(
this
.
width
-
gap
)
+
'px'
}
},
// 根据top bottom 算出元素的宽度
computedMainSlotHeight
()
{
const
gap
=
(
this
.
canvasStyleData
.
panel
.
gap
===
'yes'
?
this
.
componentGap
:
0
)
*
2
if
(
this
.
h
===
'auto'
)
{
if
(
!
this
.
heightTouched
)
{
return
'auto'
...
...
@@ -500,9 +510,9 @@ export default {
}
if
(
this
.
element
.
auxiliaryMatrix
)
{
const
height
=
Math
.
round
(
this
.
height
/
this
.
curCanvasScale
.
matrixStyleHeight
)
*
this
.
curCanvasScale
.
matrixStyleHeight
return
height
+
'px'
return
(
height
-
gap
)
+
'px'
}
else
{
return
this
.
height
+
'px'
return
(
this
.
height
-
gap
)
+
'px'
}
},
...
...
@@ -522,7 +532,8 @@ export default {
'editor'
,
'curCanvasScale'
,
'canvasStyleData'
,
'linkageSettingStatus'
'linkageSettingStatus'
,
'componentGap'
])
},
watch
:
{
...
...
@@ -1792,6 +1803,11 @@ export default {
padding
:
5px
;
}
.de-drag-active
{
outline
:
1px
solid
#70c0ff
;
user-select
:
none
;
}
/*.mouseOn >>> .icon-shezhi{*/
/* z-index: 2;*/
/* display:block!important;*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论