浏览代码

fix: 修改自定义组件设计返回逻辑,激活左侧菜单并重新请求数据,修改数据集的分页样式

wu.jian2 1 年之前
父节点
当前提交
2c80b9b04a

+ 1 - 1
data-room-ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@gcpaas/data-room-ui",
-  "version": "0.0.1-2023070501-Alpha",
+  "version": "0.0.1-2023070601-Alpha",
   "description": "自定义大屏",
   "author": "gc-starter",
   "license": "MIT",

+ 7 - 12
data-room-ui/packages/BigScreenComponentMag/SideMenu.vue

@@ -14,7 +14,6 @@
   </div>
 </template>
 <script>
-
 export default {
   components: {},
   data () {
@@ -37,23 +36,19 @@ export default {
     }
   },
   created () {
-    const type = this.$route?.query?.type
-    if (type) {
-      this.componentHandle(this.componentList.find(item => item.type === type))
-    } else {
-      this.componentHandle(this.componentList[0])
+    const { globalData } = this.$router.app.$options
+    if (globalData?.componentsManagementType) {
+      this.activeType = globalData.componentsManagementType
+      this.$emit('getPageInfo', globalData.componentsManagementType)
+      // 清除this.$router.app.$options.globalData.componentsManagementType
+      delete globalData.componentsManagementType
     }
   },
   methods: {
     // 点击左侧组件
     componentHandle (com) {
       this.activeType = com.type
-      this.$router.push({
-        path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components',
-        query: {
-          type: com.type
-        }
-      })
+      this.$emit('getPageInfo', com.type)
     }
   }
 }

+ 9 - 4
data-room-ui/packages/BigScreenComponentMag/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="bs-manage-main-wrap">
-    <side-menu />
-    <menu-content />
+    <side-menu @getPageInfo="getPageInfo" />
+    <menu-content :catalog-info="catalogInfo" />
   </div>
 </template>
 <script>
@@ -14,10 +14,15 @@ export default {
   components: { SideMenu, MenuContent },
   data () {
     return {
+      catalogInfo: 'component'
     }
   },
-  mounted () { },
-  methods: { }
+  mounted () {},
+  methods: {
+    getPageInfo (type) {
+      this.catalogInfo = type
+    }
+  }
 }
 </script>
 

+ 7 - 4
data-room-ui/packages/BizComponent/index.vue

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

+ 7 - 6
data-room-ui/packages/ComponentList/index.vue

@@ -153,7 +153,6 @@
           </div>
         </div>
       </div>
-
       <div
         v-if="catalogInfo !== 'system'"
         class="footer-pagination-wrap"
@@ -203,12 +202,16 @@ import innerRemoteComponents, { getRemoteComponents } from 'packages/RemoteCompo
 export default {
   name: 'BigScreenList',
   mixins: [pageMixins],
-  props: { },
+  props: {
+    catalogInfo: {
+      type: String,
+      default: ''
+    }
+  },
   components: { EditForm, CatalogEditForm },
   data () {
     return {
       name: '',
-      catalogInfo: 'component',
       catalogVisible: false,
       templateLoading: false,
       searchKey: '',
@@ -235,8 +238,7 @@ export default {
     }
   },
   watch: {
-    $route (val) {
-      this.catalogInfo = val.query.type || 'component'
+    catalogInfo () {
       this.reset()
       this.init()
     },
@@ -245,7 +247,6 @@ export default {
     }
   },
   mounted () {
-    this.catalogInfo = this.$route.query.type || 'component'
     this.init()
   },
   methods: {

+ 3 - 2
data-room-ui/packages/DataSetManagement/src/CustomEditForm.vue

@@ -1071,13 +1071,11 @@ export default {
           customClass: 'bs-el-message-box'
         }).then(() => {
           this.saveFun(formName)
-
         }).catch(() => {
 
         })
       } else {
         this.saveFun(formName)
-
       }
     },
     /**
@@ -1470,6 +1468,9 @@ export default {
 }
 
 .bs-pagination {
+  position: relative !important;
+  bottom: 0 !important;
+  padding: 0 12px 16px 16px !important;
   ::v-deep .el-input__inner {
     width: 110px !important;
     border: none;

+ 4 - 3
data-room-ui/packages/DataSetManagement/src/OriginalEditForm.vue

@@ -1081,10 +1081,8 @@ export default {
 }
 
 /deep/ .bs-table-box.is-Edit .el-table {
-  max-height: calc(100vh - 532px) !important;
-
   .el-table__body-wrapper {
-    max-height: calc(100vh - 568px) !important;
+    max-height: unset !important;
   }
 }
 
@@ -1114,6 +1112,9 @@ export default {
 }
 
 .bs-pagination {
+  position: relative !important;
+  bottom: 0 !important;
+  padding: 0 12px 16px 16px !important;
   ::v-deep .el-input__inner {
     width: 110px !important;
     border: none;

+ 3 - 0
data-room-ui/packages/DataSetManagement/src/index.vue

@@ -608,6 +608,9 @@ export default {
   padding-left: 16px !important;
 }
 .bs-pagination {
+  position: relative !important;
+  bottom: 0 !important;
+  padding: 0 12px 16px 16px !important;
   ::v-deep .el-input__inner {
     width: 110px !important;
     border:none;

+ 18 - 1
data-room-ui/packages/DataSourceManagement/src/index.vue

@@ -146,6 +146,22 @@ export default {
   components: {
     setDatasource
   },
+  // 路由守卫-离开页面
+  beforeRouteLeave (to, from, next) {
+    const layoutEl = document.querySelector('.big-screen-router-view-wrap')
+    if (layoutEl) {
+      layoutEl.style.paddingLeft = '0'
+    }
+    next()
+  },
+  // 路由进入页面
+  beforeRouteEnter (to, from, next) {
+    const layoutEl = document.querySelector('.big-screen-router-view-wrap')
+    if (layoutEl) {
+      layoutEl.style.paddingLeft = '16px'
+    }
+    next()
+  },
   mixins: [pageMixins],
   props: {
     isDialog: {
@@ -176,11 +192,12 @@ export default {
       curRow: null
     }
   },
+  created () { },
   mounted () {
     this.init()
     const layoutEl = document.querySelector('.big-screen-router-view-wrap')
     if (layoutEl) {
-      layoutEl.style.padding = '16px'
+      layoutEl.style.paddingLeft = '16px'
     }
   },
   methods: {

+ 1 - 1
data-room-ui/public/config/index-development.js

@@ -1,6 +1,6 @@
 window.ENV = 'development'
 var developmentConfig = {
-  baseUrl: 'http://127.0.0.1:8081/bigScreenServer'
+  baseUrl: 'http://gcpaas.gccloud.com/bigScreenServer'
 }
 // 必须的
 window.CONFIG = configDeepMerge(window.CONFIG, developmentConfig)