Sfoglia il codice sorgente

编辑器-热点编辑:在编辑时,直接点击其他模块导致退出编辑时,还是要二次提醒的。

任一存 2 anni fa
parent
commit
b3700bcd9d

+ 8 - 2
packages/qjkankan-editor/src/router/editorRouter.js

@@ -81,8 +81,14 @@ router.beforeEach(async (to, from, next) => {
     await OnlineDetector.listener();
     if (from.name == 'hotspot') {
       if (store.getters.isEditing) {
-        vue.$bus.emit('delhotspot') 
-        return next()
+        vue.$confirm({
+          content: i18n.t('hotspot.close_dialog'),
+          ok: () => {
+            vue.$bus.emit('delhotspot') 
+            return next()
+          }
+        });
+        return
       }
     }
 

+ 8 - 1
packages/qjkankan-editor/src/views/hotspot/HotSpotList.vue

@@ -120,8 +120,15 @@ export default {
       }
       if (this.editTitle == '新增' || this.editTitle == this.$i18n.t('hotspot.add')) {
         if (this.showPanel) {
-          this.deleteKRHotspot(this.hotspot)
+          return this.$confirm({
+            content: this.$i18n.t('hotspot.close_dialog'),
+            ok: () => {
+              this.deleteKRHotspot(this.hotspot)
+              this.open(this.someData.hotspots[idx])
+            }
+          })
         }
+
       }
 
       this.open(this.someData.hotspots[idx])