소스 검색

fix: 修改自定义组件和业务组件设计时,返回按钮跳转逻辑

wu.jian2 1 년 전
부모
커밋
f04d921639

+ 2 - 4
data-room-ui/packages/BigScreenComponentMag/MenuContent.vue

@@ -12,14 +12,12 @@ export default {
   props: {
     catalogInfo: {
       type: String,
-      default: ''
+      default: 'component'
     }
   },
   components: { ComponentList },
   data () {
-    return {
-
-    }
+    return { }
   }
 }
 </script>

+ 3 - 3
data-room-ui/packages/BigScreenDesign/PageDesignTop.vue

@@ -299,9 +299,9 @@ export default {
       }
     },
     backManagement () {
-      this.$router.push({
-        path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home')
-      })
+      this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') })
+      const data = { componentsManagementType: 'component' }
+      this.$router.app.$options.globalData = data // 将数据存储在全局变量中
     },
     undo (isUndo) {
       this.undoTimeLine(isUndo)

+ 3 - 9
data-room-ui/packages/BizComponent/index.vue

@@ -135,12 +135,6 @@ export default {
     BizComponentPreview
   },
   props: {},
-  beforeRouteLeave (to, from, next) {
-  // 在离开当前页面之前执行逻辑
-    const data = { componentsManagementType: 'bizComponent' }
-    this.$router.app.$options.globalData = data // 将数据存储在全局变量中
-    next() // 继续导航
-  },
   data () {
     return {
       form: {
@@ -236,9 +230,9 @@ export default {
       }
     },
     backManagement () {
-      this.$router.push({
-        path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components'
-      })
+      this.$router.push({ path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components' })
+      const data = { componentsManagementType: 'bizComponent' }
+      this.$router.app.$options.globalData = data // 将数据存储在全局变量中
     },
     save () {
       this.loading = true