|
|
@@ -113,21 +113,6 @@
|
|
|
:row-list="data.row_list"
|
|
|
@computedMoveData="computedMoveData"
|
|
|
/>
|
|
|
-
|
|
|
- <FullTextSettings
|
|
|
- :book-id="project_id"
|
|
|
- :visible.sync="visibleFullTextSettings"
|
|
|
- :settings="data.unified_attrib"
|
|
|
- @fullTextSettings="fullTextSettings"
|
|
|
- />
|
|
|
-
|
|
|
- <SetBackground
|
|
|
- :visible.sync="visibleBackground"
|
|
|
- :url="data.background_image_url"
|
|
|
- :position="data.background_position"
|
|
|
- :background-data="data.background"
|
|
|
- @setBackground="setBackground"
|
|
|
- />
|
|
|
</main>
|
|
|
</template>
|
|
|
|
|
|
@@ -144,15 +129,11 @@ import _ from 'lodash';
|
|
|
import { unified_attrib } from '@/common/data';
|
|
|
|
|
|
import PreviewEdit from './PreviewEdit.vue';
|
|
|
-import FullTextSettings from '../components/FullTextSettings.vue';
|
|
|
-import SetBackground from '../components/SetBackground.vue';
|
|
|
|
|
|
export default {
|
|
|
name: 'CreateCanvas',
|
|
|
components: {
|
|
|
PreviewEdit,
|
|
|
- FullTextSettings,
|
|
|
- SetBackground,
|
|
|
},
|
|
|
inject: ['getCurSettingId'],
|
|
|
provide() {
|
|
|
@@ -395,9 +376,6 @@ export default {
|
|
|
changeData() {
|
|
|
this.$emit('changeData');
|
|
|
},
|
|
|
- showFullTextSettings() {
|
|
|
- this.visibleFullTextSettings = true;
|
|
|
- },
|
|
|
fullTextSettings(data) {
|
|
|
this.$refs.component.forEach((item) => {
|
|
|
item.updateProperty('view_pinyin', data.view_pinyin);
|
|
|
@@ -543,9 +521,6 @@ export default {
|
|
|
|
|
|
this.$message.success('设置背景图成功');
|
|
|
},
|
|
|
- showSetBackground() {
|
|
|
- this.visibleBackground = true;
|
|
|
- },
|
|
|
/**
|
|
|
* 显示设置
|
|
|
* @param {object} setting 组件设置数据
|
|
|
@@ -1662,54 +1637,47 @@ export default {
|
|
|
const { background_image_url, background_position, background } = this.data;
|
|
|
|
|
|
let canvasStyle = {
|
|
|
- backgroundSize: background_image_url ? `${background_position.width}% ${background_position.height}%` : '',
|
|
|
- backgroundPosition: background_image_url ? `${background_position.left}% ${background_position.top}%` : '',
|
|
|
- backgroundImage: background_image_url ? `url(${background_image_url})` : '',
|
|
|
- backgroundColor: background_image_url ? `rgba(255, 255, 255, ${1 - background.image_opacity / 100})` : '',
|
|
|
+ '--bg-size': background_image_url ? `${background_position.width}% ${background_position.height}%` : '',
|
|
|
+ '--bg-position': background_image_url ? `${background_position.left}% ${background_position.top}%` : '',
|
|
|
+ '--bg-image': background_image_url ? `url(${background_image_url})` : '',
|
|
|
+ '--bg-opacity': background_image_url && background.mode === 'image' ? background.image_opacity / 100 : 1,
|
|
|
};
|
|
|
|
|
|
if (background) {
|
|
|
- if (background.mode === 'image') {
|
|
|
- canvasStyle['backgroundBlendMode'] = 'lighten';
|
|
|
- } else {
|
|
|
- canvasStyle['backgroundBlendMode'] = '';
|
|
|
- }
|
|
|
-
|
|
|
if (background.imageMode === 'fill') {
|
|
|
- canvasStyle['backgroundRepeat'] = 'repeat';
|
|
|
+ canvasStyle['--bg-repeat'] = 'repeat';
|
|
|
} else {
|
|
|
- canvasStyle['backgroundRepeat'] = 'no-repeat';
|
|
|
+ canvasStyle['--bg-repeat'] = 'no-repeat';
|
|
|
}
|
|
|
|
|
|
if (background.imageMode === 'stretch') {
|
|
|
- canvasStyle['backgroundSize'] = '100% 100%';
|
|
|
+ canvasStyle['--bg-size'] = '100% 100%';
|
|
|
}
|
|
|
|
|
|
if (background.imageMode === 'adapt') {
|
|
|
- canvasStyle['backgroundSize'] = 'contain';
|
|
|
+ canvasStyle['--bg-size'] = 'contain';
|
|
|
}
|
|
|
|
|
|
if (background.mode === 'color') {
|
|
|
- canvasStyle['backgroundColor'] = background.color;
|
|
|
- canvasStyle['backgroundImage'] = '';
|
|
|
- canvasStyle['backgroundRepeat'] = '';
|
|
|
- canvasStyle['backgroundPosition'] = '';
|
|
|
- canvasStyle['backgroundSize'] = '';
|
|
|
+ canvasStyle['--bg-color'] = background.color;
|
|
|
+ canvasStyle['--bg-image'] = '';
|
|
|
+ canvasStyle['--bg-repeat'] = '';
|
|
|
+ canvasStyle['--bg-position'] = '';
|
|
|
+ canvasStyle['--bg-size'] = '';
|
|
|
}
|
|
|
|
|
|
if (background.enable_border) {
|
|
|
- canvasStyle['border'] = `${background.border_width}px ${background.border_style} ${background.border_color}`;
|
|
|
+ canvasStyle['--bg-border'] =
|
|
|
+ `${background.border_width}px ${background.border_style} ${background.border_color}`;
|
|
|
} else {
|
|
|
- canvasStyle['border'] = 'none';
|
|
|
+ canvasStyle['--bg-border'] = 'none';
|
|
|
}
|
|
|
|
|
|
if (background.enable_radius) {
|
|
|
- canvasStyle['border-top-left-radius'] = `${background.top_left_radius}px`;
|
|
|
- canvasStyle['border-top-right-radius'] = `${background.top_right_radius}px`;
|
|
|
- canvasStyle['border-bottom-left-radius'] = `${background.bottom_left_radius}px`;
|
|
|
- canvasStyle['border-bottom-right-radius'] = `${background.bottom_right_radius}px`;
|
|
|
- } else {
|
|
|
- canvasStyle['border-radius'] = '0';
|
|
|
+ canvasStyle['--bg-border-radius-top-left'] = `${background.top_left_radius}px`;
|
|
|
+ canvasStyle['--bg-border-radius-top-right'] = `${background.top_right_radius}px`;
|
|
|
+ canvasStyle['--bg-border-radius-bottom-left'] = `${background.bottom_left_radius}px`;
|
|
|
+ canvasStyle['--bg-border-radius-bottom-right'] = `${background.bottom_right_radius}px`;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1722,6 +1690,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.canvas {
|
|
|
position: relative;
|
|
|
+ z-index: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
row-gap: 8px;
|
|
|
@@ -1732,6 +1701,26 @@ export default {
|
|
|
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: '';
|
|
|
+ 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;
|