forked from github/dataease
feat: 仪表板取消收藏实时展示
This commit is contained in:
parent
a588e9e29a
commit
4f19867823
@ -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: {
|
||||
|
@ -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')
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user