diff --git a/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/index.vue b/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/index.vue
index 0e30219f3..b985a8142 100644
--- a/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/index.vue
+++ b/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/index.vue
@@ -241,7 +241,7 @@ const eachCube = (callback: (x: number, y: number, cube: Cube) => void) => {
- {{ `${hotArea.width}×${hotArea.height}`}}
+ {{ `${hotArea.width}×${hotArea.height}` }}
@@ -259,6 +259,11 @@ const eachCube = (callback: (x: number, y: number, cube: Cube) => void) => {
text-align: center;
cursor: pointer;
border: 1px solid var(--el-border-color);
+ line-height: 1;
+
+ :deep(.iconify) {
+ display: inline-block;
+ }
&.active {
background: var(--el-color-primary-light-9);
diff --git a/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/util.ts b/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/util.ts
index 152ce0cbe..6e3eb7cd2 100644
--- a/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/util.ts
+++ b/apps/web-ele/src/views/mall/promotion/components/magic-cube-editor/util.ts
@@ -43,7 +43,6 @@ export function isContains(hotArea: Rect, point: Point): boolean {
);
}
-// TODO @AI:linter 修复
/**
* 在两个坐标点中间,创建一个矩形
*
@@ -58,8 +57,12 @@ export function isContains(hotArea: Rect, point: Point): boolean {
*/
export function createRect(a: Point, b: Point): Rect {
// 计算矩形的范围
- const [left, left2] = [a.x, b.x].sort();
- const [top, top2] = [a.y, b.y].sort();
+ let [left, left2] = [a.x, b.x].sort();
+ left = left ?? 0;
+ left2 = left2 ?? 0;
+ let [top, top2] = [a.y, b.y].sort();
+ top = top ?? 0;
+ top2 = top2 ?? 0;
const right = left2 + 1;
const bottom = top2 + 1;
const height = bottom - top;