|
|
@@ -507,30 +507,6 @@ export default {
|
|
|
background: back,
|
|
|
} = this.background || {};
|
|
|
|
|
|
- const hasNoRows = !Array.isArray(this.data?.row_list) || this.data.row_list.length === 0; // 判断是否没有行
|
|
|
- const projectCover = this.project?.cover_image_file_url || '';
|
|
|
-
|
|
|
- // 优先在空行时使用背景图或项目封面
|
|
|
- if (hasNoRows) {
|
|
|
- const backgroundImage = hasNoRows ? bcImgUrl || projectCover : bcImgUrl;
|
|
|
-
|
|
|
- // 保护性读取位置/大小值,避免 undefined 导致字符串 "undefined%"
|
|
|
- const widthPct = typeof pos.width === 'undefined' ? '' : pos.width;
|
|
|
- const heightPct = typeof pos.height === 'undefined' ? '' : pos.height;
|
|
|
- const leftPct = typeof pos.left === 'undefined' ? '' : pos.left;
|
|
|
- const topPct = typeof pos.top === 'undefined' ? '' : pos.top;
|
|
|
-
|
|
|
- const hasBcImg = Boolean(bcImgUrl);
|
|
|
- const backgroundSize = hasBcImg ? `${widthPct}% ${heightPct}%` : hasNoRows ? 'contain' : '';
|
|
|
- const backgroundPosition = hasBcImg ? `${leftPct}% ${topPct}%` : hasNoRows ? 'center' : '';
|
|
|
-
|
|
|
- return {
|
|
|
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : '',
|
|
|
- backgroundSize,
|
|
|
- backgroundPosition,
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
let canvasStyle = {
|
|
|
backgroundSize: bcImgUrl ? `${pos.width}% ${pos.height}%` : '',
|
|
|
backgroundPosition: bcImgUrl ? `${pos.left}% ${pos.top}%` : '',
|