|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
- <div class="roy-mark-line">
|
|
|
+ <div class="yvan-mark-line">
|
|
|
<div
|
|
|
v-for="line in lines"
|
|
|
v-show="lineStatus[line] || false"
|
|
|
- :id="`rot-editor-line-${line}`"
|
|
|
+ :id="`yvan-editor-line-${line}`"
|
|
|
:key="line"
|
|
|
- :class="line.includes('x') ? 'roy-mark-line--xline' : 'roy-mark-line--yline'"
|
|
|
- class="roy-mark-line__line"
|
|
|
+ :class="line.includes('x') ? 'yvan-mark-line--xline' : 'yvan-mark-line--yline'"
|
|
|
+ class="yvan-mark-line__line"
|
|
|
></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -44,7 +44,6 @@ export default {
|
|
|
eventBus.on('move', (isDownward, isRightward) => {
|
|
|
this.showLineMove(isDownward, isRightward)
|
|
|
})
|
|
|
-
|
|
|
eventBus.on('unmove', () => {
|
|
|
this.hideLine()
|
|
|
})
|
|
@@ -55,7 +54,6 @@ export default {
|
|
|
this.lineStatus[line] = false
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
showLineMove(isDownward, isRightward) {
|
|
|
const components = this.componentData || []
|
|
|
const curComponentStyle = getComponentRotatedStyle(this.curComponent?.style || {})
|
|
@@ -76,14 +74,14 @@ export default {
|
|
|
top: [
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.top, top),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-xt'), // xt
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-xt'), // xt
|
|
|
line: 'xt',
|
|
|
dragShift: top,
|
|
|
lineShift: top
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.bottom, top),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-xt'), // xt
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-xt'), // xt
|
|
|
line: 'xt',
|
|
|
dragShift: top - curComponentStyle.height,
|
|
|
lineShift: top
|
|
@@ -94,21 +92,21 @@ export default {
|
|
|
curComponentStyle.top + curComponentHalfHeight,
|
|
|
top + componentHalfHeight
|
|
|
),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-xc'), // xc
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-xc'), // xc
|
|
|
line: 'xc',
|
|
|
dragShift: top + componentHalfHeight - curComponentHalfHeight,
|
|
|
lineShift: top + componentHalfHeight
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.top, bottom),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-xb'), // xb
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-xb'), // xb
|
|
|
line: 'xb',
|
|
|
dragShift: bottom,
|
|
|
lineShift: bottom
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.bottom, bottom),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-xb'), // xb
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-xb'), // xb
|
|
|
line: 'xb',
|
|
|
dragShift: bottom - curComponentStyle.height,
|
|
|
lineShift: bottom
|
|
@@ -117,14 +115,14 @@ export default {
|
|
|
left: [
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.left, left),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-yl'), // yl
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-yl'), // yl
|
|
|
line: 'yl',
|
|
|
dragShift: left,
|
|
|
lineShift: left
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.right, left),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-yl'), // yl
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-yl'), // yl
|
|
|
line: 'yl',
|
|
|
dragShift: left - curComponentStyle.width,
|
|
|
lineShift: left
|
|
@@ -135,21 +133,21 @@ export default {
|
|
|
curComponentStyle.left + curComponentHalfWidth,
|
|
|
left + componentHalfWidth
|
|
|
),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-yc'), // yc
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-yc'), // yc
|
|
|
line: 'yc',
|
|
|
dragShift: left + componentHalfWidth - curComponentHalfWidth,
|
|
|
lineShift: left + componentHalfWidth
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.left, right),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-yr'), // yr
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-yr'), // yr
|
|
|
line: 'yr',
|
|
|
dragShift: right,
|
|
|
lineShift: right
|
|
|
},
|
|
|
{
|
|
|
isNearly: this.isNearly(curComponentStyle.right, right),
|
|
|
- lineNode: this.$el.querySelector('#rot-editor-line-yr'), // yr
|
|
|
+ lineNode: this.$el.querySelector('#yvan-editor-line-yr'), // yr
|
|
|
line: 'yr',
|
|
|
dragShift: right - curComponentStyle.width,
|
|
|
lineShift: right
|
|
@@ -185,16 +183,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
translatecurComponentShift(key, condition, curComponentStyle) {
|
|
|
const {width, height} = this.curComponent.style
|
|
|
if (key === 'top') {
|
|
|
return Math.round(condition.dragShift - (height - curComponentStyle.height) / 2)
|
|
|
}
|
|
|
-
|
|
|
return Math.round(condition.dragShift - (width - curComponentStyle.width) / 2)
|
|
|
},
|
|
|
-
|
|
|
chooseTheTureLine(needToShow, isDownward, isRightward) {
|
|
|
// 如果鼠标向右移动 则按从右到左的顺序显示竖线 否则按相反顺序显示
|
|
|
// 如果鼠标向下移动 则按从下到上的顺序显示横线 否则按相反顺序显示
|
|
@@ -216,7 +211,6 @@ export default {
|
|
|
this.lineStatus.yr = true
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (isDownward) {
|
|
|
if (needToShow.includes('xb')) {
|
|
|
this.lineStatus.xb = true
|
|
@@ -236,7 +230,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
isNearly(dragValue, targetValue) {
|
|
|
return Math.abs(dragValue - targetValue) <= this.diff
|
|
|
}
|
|
@@ -245,22 +238,22 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.roy-mark-line {
|
|
|
+.yvan-mark-line {
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
-.roy-mark-line__line {
|
|
|
- background: var(--roy-color-primary);
|
|
|
+.yvan-mark-line__line {
|
|
|
+ background: var(--yvan-color-primary);
|
|
|
position: absolute;
|
|
|
z-index: 1000;
|
|
|
}
|
|
|
|
|
|
-.roy-mark-line--xline {
|
|
|
+.yvan-mark-line--xline {
|
|
|
width: 100%;
|
|
|
height: 0.5px;
|
|
|
}
|
|
|
|
|
|
-.roy-mark-line--yline {
|
|
|
+.yvan-mark-line--yline {
|
|
|
width: 0.5px;
|
|
|
height: 100%;
|
|
|
}
|