From e3bf9c93f6112658b38b2d3767e36a651aa4261c Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Mon, 26 Jun 2023 10:36:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BA=93=E7=82=B9=E5=87=BB=E8=8F=9C=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BigScreenComponentMag/SideMenu.vue | 14 ++++++++----- .../packages/BigScreenComponentMag/index.vue | 17 ++++------------ data-room-ui/packages/ComponentList/index.vue | 20 ++++++++++--------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue index b9b05a2b..c064b8af 100644 --- a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue +++ b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue @@ -39,17 +39,21 @@ export default { created () { const type = this.$route?.query?.type if (type) { - this.activeType = type - this.$nextTick(() => { - this.$emit('getPageInfo', type) - }) + this.componentHandle(this.componentList.find(item => item.type === type)) + } else { + this.componentHandle(this.componentList[0]) } }, methods: { // 点击左侧组件 componentHandle (com) { this.activeType = com.type - this.$emit('getPageInfo', com.type) + this.$router.push({ + path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components', + query: { + type: com.type + } + }) } } } diff --git a/data-room-ui/packages/BigScreenComponentMag/index.vue b/data-room-ui/packages/BigScreenComponentMag/index.vue index 0d1f741f..48a7aae2 100644 --- a/data-room-ui/packages/BigScreenComponentMag/index.vue +++ b/data-room-ui/packages/BigScreenComponentMag/index.vue @@ -1,11 +1,7 @@ diff --git a/data-room-ui/packages/ComponentList/index.vue b/data-room-ui/packages/ComponentList/index.vue index f0d059bb..06175a43 100644 --- a/data-room-ui/packages/ComponentList/index.vue +++ b/data-room-ui/packages/ComponentList/index.vue @@ -201,16 +201,12 @@ import innerRemoteComponents, { getRemoteComponents } from 'packages/RemoteCompo export default { name: 'BigScreenList', mixins: [pageMixins], - props: { - catalogInfo: { - type: String, - default: '' - } - }, + props: { }, components: { EditForm, CatalogEditForm }, data () { return { name: '', + catalogInfo: 'component', catalogVisible: false, templateLoading: false, searchKey: '', @@ -238,7 +234,8 @@ export default { } }, watch: { - catalogInfo () { + $route (val) { + this.catalogInfo = val.query.type || 'component' this.reset() this.init() }, @@ -247,6 +244,7 @@ export default { } }, mounted () { + this.catalogInfo = this.$route.query.type || 'component' this.init() }, methods: { @@ -279,8 +277,12 @@ export default { this.$refs.CatalogEditForm.formVisible = true }, // 获取分组列表 - async getCatalogList () { - this.catalogList = await get(`/bigScreen/type/list/${this.catalogType}`) + getCatalogList () { + get(`/bigScreen/type/list/${this.catalogType}`) + .then((data) => { + this.catalogList = data + }) + .catch(() => {}) }, getDataList () { this.loading = true