|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<main ref="canvas" class="canvas" :style="computedCanvasStyle()">
|
|
|
- <template v-if="isEdit">
|
|
|
+ <div v-if="isEdit" class="edit">
|
|
|
<div v-for="item in lineList" :key="item[0]" class="group-line" :style="computedGroupLine(item)"></div>
|
|
|
<span class="drag-line" data-row="-1"></span>
|
|
|
<!-- 行 -->
|
|
|
@@ -104,7 +104,7 @@
|
|
|
<span v-if="i < data.row_list.length - 1" :key="`row-${row.row_id}`" class="drag-line" :data-row="i"></span>
|
|
|
</template>
|
|
|
<span class="drag-line" :data-row="data.row_list.length - 1"></span>
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
|
|
|
<PreviewEdit
|
|
|
v-else
|
|
|
@@ -1704,125 +1704,126 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.canvas {
|
|
|
- position: relative;
|
|
|
- z-index: 0;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- row-gap: 8px;
|
|
|
- width: $courseware-width;
|
|
|
- min-height: calc(100% - 6px);
|
|
|
- padding: 24px;
|
|
|
- margin: 0 auto;
|
|
|
- background-color: #fff;
|
|
|
- background-repeat: no-repeat;
|
|
|
-
|
|
|
- &::before {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- z-index: -1; // 背景在最底层
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- pointer-events: none; // 背景不接受鼠标事件
|
|
|
- content: '';
|
|
|
+ .edit {
|
|
|
+ position: relative;
|
|
|
+ z-index: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ row-gap: 8px;
|
|
|
+ width: $courseware-width;
|
|
|
+ min-height: calc(100vh - 240px);
|
|
|
+ padding: 24px;
|
|
|
+ margin: 0 auto;
|
|
|
background-color: #fff;
|
|
|
- background-image: var(--bg-image);
|
|
|
- background-repeat: var(--bg-repeat);
|
|
|
- background-position: var(--bg-position);
|
|
|
- background-size: var(--bg-size);
|
|
|
- border: var(--bg-border);
|
|
|
- border-radius: var(--bg-border-radius-top-left) var(--bg-border-radius-top-right)
|
|
|
- var(--bg-border-radius-bottom-right) var(--bg-border-radius-bottom-left);
|
|
|
- opacity: var(--bg-opacity);
|
|
|
- }
|
|
|
-
|
|
|
- .group-line {
|
|
|
- position: absolute;
|
|
|
- left: 11px;
|
|
|
- width: 1px;
|
|
|
- background-color: #165dff;
|
|
|
- }
|
|
|
-
|
|
|
- .row {
|
|
|
- display: grid;
|
|
|
- row-gap: 16px;
|
|
|
|
|
|
- .row-checkbox {
|
|
|
+ &::before {
|
|
|
position: absolute;
|
|
|
- left: 4px;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: -1; // 背景在最底层
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ pointer-events: none; // 背景不接受鼠标事件
|
|
|
+ content: '';
|
|
|
+ background-color: #fff;
|
|
|
+ background-image: var(--bg-image);
|
|
|
+ background-repeat: var(--bg-repeat);
|
|
|
+ background-position: var(--bg-position);
|
|
|
+ background-size: var(--bg-size);
|
|
|
+ border: var(--bg-border);
|
|
|
+ border-radius: var(--bg-border-radius-top-left) var(--bg-border-radius-top-right)
|
|
|
+ var(--bg-border-radius-bottom-right) var(--bg-border-radius-bottom-left);
|
|
|
+ opacity: var(--bg-opacity);
|
|
|
}
|
|
|
|
|
|
- > .drag-vertical-line:not(:first-child, :last-child, .grid-line) {
|
|
|
- left: 6px;
|
|
|
+ .group-line {
|
|
|
+ position: absolute;
|
|
|
+ left: 11px;
|
|
|
+ width: 1px;
|
|
|
+ background-color: #165dff;
|
|
|
}
|
|
|
|
|
|
- .drag-vertical-line.grid-line-right,
|
|
|
- .drag-vertical-line.grid-line-left {
|
|
|
- top: 25%;
|
|
|
- height: 50%;
|
|
|
- }
|
|
|
+ .row {
|
|
|
+ display: grid;
|
|
|
+ row-gap: 16px;
|
|
|
|
|
|
- .drag-vertical-line.col-start {
|
|
|
- left: -12px;
|
|
|
- }
|
|
|
+ .row-checkbox {
|
|
|
+ position: absolute;
|
|
|
+ left: 4px;
|
|
|
+ }
|
|
|
|
|
|
- .drag-vertical-line.col-end {
|
|
|
- right: -8px;
|
|
|
- }
|
|
|
+ > .drag-vertical-line:not(:first-child, :last-child, .grid-line) {
|
|
|
+ left: 6px;
|
|
|
+ }
|
|
|
|
|
|
- .col {
|
|
|
- display: grid;
|
|
|
+ .drag-vertical-line.grid-line-right,
|
|
|
+ .drag-vertical-line.grid-line-left {
|
|
|
+ top: 25%;
|
|
|
+ height: 50%;
|
|
|
+ }
|
|
|
|
|
|
- .drag-vertical-line:first-child {
|
|
|
- left: -8px;
|
|
|
+ .drag-vertical-line.col-start {
|
|
|
+ left: -12px;
|
|
|
}
|
|
|
|
|
|
- .drag-vertical-line:not(:first-child, :last-child, .grid-line) {
|
|
|
- left: 6px;
|
|
|
+ .drag-vertical-line.col-end {
|
|
|
+ right: -8px;
|
|
|
}
|
|
|
|
|
|
- .drag-vertical-line:last-child {
|
|
|
- right: -4px;
|
|
|
+ .col {
|
|
|
+ display: grid;
|
|
|
+
|
|
|
+ .drag-vertical-line:first-child {
|
|
|
+ left: -8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .drag-vertical-line:not(:first-child, :last-child, .grid-line) {
|
|
|
+ left: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .drag-vertical-line:last-child {
|
|
|
+ right: -4px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .drag-line {
|
|
|
- z-index: 2;
|
|
|
- width: calc(100% - 16px);
|
|
|
- height: 4px;
|
|
|
- margin: 0 8px;
|
|
|
- background-color: #379fff;
|
|
|
- border-radius: 4px;
|
|
|
- opacity: 0;
|
|
|
-
|
|
|
- &.drag-row {
|
|
|
- width: 50%;
|
|
|
- margin-left: 25%;
|
|
|
- background-color: $right-color;
|
|
|
- }
|
|
|
+ .drag-line {
|
|
|
+ z-index: 2;
|
|
|
+ width: calc(100% - 16px);
|
|
|
+ height: 4px;
|
|
|
+ margin: 0 8px;
|
|
|
+ background-color: #379fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ opacity: 0;
|
|
|
+
|
|
|
+ &.drag-row {
|
|
|
+ width: 50%;
|
|
|
+ margin-left: 25%;
|
|
|
+ background-color: $right-color;
|
|
|
+ }
|
|
|
|
|
|
- &.grid-line:not(:first-child, :last-child) {
|
|
|
- position: relative;
|
|
|
- top: 6px;
|
|
|
- }
|
|
|
+ &.grid-line:not(:first-child, :last-child) {
|
|
|
+ position: relative;
|
|
|
+ top: 6px;
|
|
|
+ }
|
|
|
|
|
|
- &.grid-line {
|
|
|
- background-color: #f43;
|
|
|
+ &.grid-line {
|
|
|
+ background-color: #f43;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .drag-vertical-line {
|
|
|
- position: relative;
|
|
|
- z-index: 2;
|
|
|
- width: 4px;
|
|
|
- height: 100%;
|
|
|
- background-color: #f43;
|
|
|
- border-radius: 4px;
|
|
|
- opacity: 0;
|
|
|
-
|
|
|
- &.grid-line {
|
|
|
+ .drag-vertical-line {
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+ width: 4px;
|
|
|
+ height: 100%;
|
|
|
background-color: #f43;
|
|
|
+ border-radius: 4px;
|
|
|
+ opacity: 0;
|
|
|
+
|
|
|
+ &.grid-line {
|
|
|
+ background-color: #f43;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|