Sfoglia il codice sorgente

feat(marketingEdit): 添加撤销功能和更新按钮文本

- 在编辑信息区域添加撤销按钮,支持历史状态回退
- 将返回按钮文本更新为关闭
- 撤销功能仅在有历史记录时显示
- 撤销操作通过点击按钮触 historyState 方法
panqiuyao 6 giorni fa
parent
commit
fa4006b98b
1 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 10 2
      frontend/src/views/components/marketingEdit/tpl/header.js

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

@@ -10,8 +10,16 @@ export  default function tpl(){
   return `
       <div class="picture-editor-header flex between">
            
-           <div class="flex mar-left-10"> 
+           <div class="flex mar-left-10">
                 <div class="title">编辑信息</div>
+                <el-button
+                  v-if="!isEmpty && canUndo"
+                  @click="historyState(stateIndex - 1)"
+                  size="small"
+                  style="margin-left: 10px;"
+                >
+                  撤销
+                </el-button>
            </div>
            
            <div class="button" style="margin-right: 10px;">
@@ -75,7 +83,7 @@ export  default function tpl(){
             <el-button @click="addCanvas"  class="mar-left-10">新增画布</el-button>
             <el-button type="primary" @click="handleSave">保存</el-button>
              <!--  <el-button type="primary" @click="createImg">生成图片</el-button> -->
-            <el-button class="mar-left-10" @click="handleBack">返回</el-button>
+            <el-button class="mar-left-10" @click="handleBack">关闭</el-button>
            </div>
            
             <!-- 新增:调整画布尺寸弹窗 -->