From 4f198678236bd76e0a300aca4a421812d21b37d0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 21 May 2021 14:25:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=94=B6=E8=97=8F=E5=AE=9E=E6=97=B6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/enshrine/index.vue | 2 ++ frontend/src/views/panel/list/PanelViewShow.vue | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/frontend/src/views/panel/enshrine/index.vue b/frontend/src/views/panel/enshrine/index.vue index f2b10f89ba..3f6fadbbbb 100644 --- a/frontend/src/views/panel/enshrine/index.vue +++ b/frontend/src/views/panel/enshrine/index.vue @@ -28,6 +28,7 @@ import { deleteEnshrine, enshrineList } from '@/api/panel/enshrine' import { uuid } from 'vue-uuid' import { get } from '@/api/panel/panel' +import bus from '@/utils/bus' export default { name: 'Enshrine', data() { @@ -36,6 +37,7 @@ export default { } }, created() { + bus.$on('panle_start_list_refresh', this.initData) this.initData() }, methods: { diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 7337dd8929..4390ea6b44 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -67,6 +67,7 @@ import { mapState } from 'vuex' import html2canvas from 'html2canvas' import FileSaver from 'file-saver' import { enshrineList, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' +import bus from '@/utils/bus' export default { name: 'PanelViewShow', components: { Preview, SaveToTemplate }, @@ -161,11 +162,13 @@ export default { star() { this.panelInfo && saveEnshrine(this.panelInfo.id).then(res => { this.hasStar = true + this.refreshStarList() }) }, unstar() { this.panelInfo && deleteEnshrine(this.panelInfo.id).then(res => { this.hasStar = false + this.refreshStarList() }) }, initHasStar() { @@ -173,6 +176,9 @@ export default { enshrineList(param).then(res => { this.hasStar = res.data && res.data.some(item => item.panelGroupId === this.panelInfo.id) }) + }, + refreshStarList() { + bus.$emit('panle_start_list_refresh') } }