瀏覽代碼

feature 1001979

删除企业logo需二次确认
Kevin Jiang 2 年之前
父節點
當前提交
f955882a05
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 4 1
      src/views/report/ReportEditorView.vue
  2. 9 1
      src/views/report/components/LogoComponent.vue

+ 4 - 1
src/views/report/ReportEditorView.vue

@@ -83,11 +83,14 @@ function onLogoChange(file: File) {
 }
 
 function onLogoDelete() {
-  if (!report.value) {
+  if (!report.value || !report.value.logoPath) {
     return;
   }
   logoService.remove(report.value.id).then((resp) => {
     if (resp) {
+      if (report.value) {
+        report.value.logoPath = ''
+      }
       logoUrl.value = undefined
     }
   })

+ 9 - 1
src/views/report/components/LogoComponent.vue

@@ -95,7 +95,15 @@ function onDelete() {
           请按需上传企业logo<br />仅支持 jpg.  png.  格式图片
         </div>
         <div>
-          <a-button @click="onDelete"><delete-outlined /></a-button>
+          <a-popconfirm
+            title="确定删除此Logoo?"
+            ok-text="确定"
+            cancel-text="取消"
+            @confirm="onDelete"
+            placement="topRight"
+          >
+            <a-button :disabled="!url"><delete-outlined /></a-button>
+          </a-popconfirm>
         </div>
       </div>
     </a-col>