Explorar el Código

fix(marketingEdit): 修复画布弹窗关闭行为和图标样式问题

- 为画布尺寸调整弹窗添加关闭控制属性,防止空内容时意外关闭
- 在画布弹窗底部添加条件渲染,仅在非空时显示取消按钮
- 调整商品图标样式,将宽度从34px增加到50px并添加高度和内容适应
- 优化商品数据组装逻辑,移除多余注释代码
panqiuyao hace 1 mes
padre
commit
febaca9fa9

+ 6 - 4
frontend/src/views/components/marketingEdit/index.vue

@@ -537,13 +537,13 @@ export default {
     async createImg(){
        // 1. 组装数据源(后续可以从接口/其他页面传入)
        const goodsData = [
-        JSON.parse(JSON.stringify(goods)), 
-        // JSON.parse(JSON.stringify(goods1)), 
+        JSON.parse(JSON.stringify(goods)),
+        // JSON.parse(JSON.stringify(goods1)),
         // JSON.parse(JSON.stringify(goods2)),
         JSON.parse(JSON.stringify(goods4)),
         JSON.parse(JSON.stringify(goods5))
       ]
-        
+
        const canvasJson = JSON.parse(JSON.stringify(canvas1))
 
        // 2. 针对每个款号,生成所有画布图片 + 组合长图(在内存中生成 dataURL)
@@ -751,7 +751,9 @@ export default {
       margin-right: 5px;
     }
     .icon-img {
-      width: 34px;
+      width: 50px;
+      height: 50px;
+      object-fit: contain;
       // height: 30px;
       border-radius: 5px;
       margin-right: 10px;

+ 2 - 2
frontend/src/views/components/marketingEdit/tpl/header.js

@@ -73,7 +73,7 @@ export  default function tpl(){
            </div>
            
             <!-- 新增:调整画布尺寸弹窗 -->
-            <el-dialog :title="canvasForm.type === 'add' ? '新增画布' : '编辑画布'" v-model="canvasForm.visible" append-to-body width="700px">
+            <el-dialog :title="canvasForm.type === 'add' ? '新增画布' : '编辑画布'" v-model="canvasForm.visible" append-to-body width="700px" :close-on-click-modal="!isEmpty" :close-on-press-escape="!isEmpty" :show-close="!isEmpty">
               <el-form :model="canvasForm" label-width="100px">
                 <el-form-item label="画布类型">
                   <el-radio-group
@@ -136,7 +136,7 @@ export  default function tpl(){
                 </template>
               </el-form>
               <div slot="footer" class="dialog-footer flex right">
-                <el-button @click="canvasForm.visible = false">取 消</el-button>
+                <el-button v-if="!isEmpty" @click="canvasForm.visible = false">取 消</el-button>
                 <el-button type="primary" @click="submitCanvasInfo">确 定</el-button>
               </div>
             </el-dialog>