|
|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div ref="courserware" class="courserware" :style="computedCourserwareStyle()" @mouseup="handleTextSelection">
|
|
|
- <div v-if="heightPrompt" class="height-prompt"></div>
|
|
|
<template v-for="(row, i) in data.row_list">
|
|
|
<div v-show="computedRowVisibility(row.row_id)" :key="i" class="row" :style="getMultipleColStyle(i)">
|
|
|
<el-checkbox
|
|
|
@@ -167,8 +166,6 @@ export default {
|
|
|
},
|
|
|
selectedInfo: null,
|
|
|
selectHandleInfo: null,
|
|
|
- resizeObserver: null, // 用于监听高度变化
|
|
|
- heightPrompt: false, // 是否显示高度提示线
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -197,17 +194,9 @@ export default {
|
|
|
top: rect.top,
|
|
|
};
|
|
|
window.addEventListener('mousedown', this.handleMouseDown);
|
|
|
-
|
|
|
- // 监听 courserware 高度变化,获取其高度
|
|
|
- this.resizeObserver = new ResizeObserver(() => {
|
|
|
- const rect = element.getBoundingClientRect();
|
|
|
- this.heightPrompt = rect.height > 1620;
|
|
|
- });
|
|
|
- this.resizeObserver.observe(element);
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
window.removeEventListener('mousedown', this.handleMouseDown);
|
|
|
- this.resizeObserver.disconnect();
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
@@ -559,6 +548,7 @@ export default {
|
|
|
if (back.imageMode === 'fill') {
|
|
|
canvasStyle['backgroundRepeat'] = 'repeat';
|
|
|
canvasStyle['backgroundSize'] = '';
|
|
|
+ canvasStyle['backgroundPosition'] = '';
|
|
|
} else {
|
|
|
canvasStyle['backgroundRepeat'] = 'no-repeat';
|
|
|
}
|
|
|
@@ -571,6 +561,10 @@ export default {
|
|
|
canvasStyle['backgroundSize'] = 'contain';
|
|
|
}
|
|
|
|
|
|
+ if (back.imageMode === 'auto') {
|
|
|
+ canvasStyle['backgroundPosition'] = `${pos.imgX}% ${pos.imgY}%`;
|
|
|
+ }
|
|
|
+
|
|
|
if (back.mode === 'color') {
|
|
|
canvasStyle['backgroundColor'] = back.color;
|
|
|
canvasStyle['backgroundImage'] = '';
|
|
|
@@ -1006,14 +1000,6 @@ export default {
|
|
|
bottom: -15px;
|
|
|
}
|
|
|
|
|
|
- .height-prompt {
|
|
|
- position: absolute;
|
|
|
- top: 1620px;
|
|
|
- left: -200px;
|
|
|
- width: 1400px;
|
|
|
- border-top: 2px dashed #903ff8;
|
|
|
- }
|
|
|
-
|
|
|
.row {
|
|
|
display: grid;
|
|
|
gap: $component-spacing;
|