Commit 44e89bd8 by 乔延琦

Merge branch 'develop-zhouyi' into 'develop'

fix: 组件注销问题

See merge request GFP/RBC/rbc-frontend!144
parents 0b0ea426 9742d178
...@@ -193,9 +193,9 @@ export default { ...@@ -193,9 +193,9 @@ export default {
window.GMS.vbus.$on('approval-user-control-add', this.handleAdd) window.GMS.vbus.$on('approval-user-control-add', this.handleAdd)
this.getSuggestionOptions() this.getSuggestionOptions()
}, },
beforeUnmount() { beforeDestroy() {
window.GMS.vbus.$off('approval-user-control-edit') window.GMS.vbus.$off('approval-user-control-edit', this.openEditModal)
window.GMS.vbus.$off('approval-user-control-add') window.GMS.vbus.$off('approval-user-control-add', this.handleAdd)
}, },
methods: { methods: {
showDeletePopover(suggestion) { showDeletePopover(suggestion) {
......
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
} }
this.$refs.modal.$el.addEventListener('click', this.stopPropagation) this.$refs.modal.$el.addEventListener('click', this.stopPropagation)
}, },
beforeUnmount() { beforeDestroy() {
this.$refs.modal.$el.removeeventlistener('click', this.stopPropagation) this.$refs.modal.$el.removeeventlistener('click', this.stopPropagation)
}, },
methods: { methods: {
......
...@@ -42,18 +42,19 @@ export default { ...@@ -42,18 +42,19 @@ export default {
} }
}, },
mounted() { mounted() {
window.GMS.vbus.$on('widgetPluginPropertiesChange', (val) => { window.GMS.vbus.$on('widgetPluginPropertiesChange', this.widgetPluginPropertiesChange)
if (!val.id || val.id != this.itemSetting.type + this.itemSetting.id) return
val = val.properties || []
this.reimburseList = this.mapProperties(val)
})
this.$root.$on('updated', this.refresh) this.$root.$on('updated', this.refresh)
}, },
beforeUnmount() { beforeDestroy() {
this.$root.$off('updated', this.refresh) this.$root.$off('updated', this.refresh)
window.GMS.vbus.$off('widgetPluginPropertiesChange') window.GMS.vbus.$off('widgetPluginPropertiesChange', this.widgetPluginPropertiesChange)
}, },
methods: { methods: {
widgetPluginPropertiesChange(val) {
if (!val.id || val.id != this.itemSetting.type + this.itemSetting.id) return
val = val.properties || []
this.reimburseList = this.mapProperties(val)
},
refresh(visible) { refresh(visible) {
if (visible == 'show') { if (visible == 'show') {
const list = [...this.reimburseList] const list = [...this.reimburseList]
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
} }
this.$root.$on('updated', this.refresh) this.$root.$on('updated', this.refresh)
}, },
beforeUnmount() { beforeDestroy() {
this.$root.$off('updated', this.refresh) this.$root.$off('updated', this.refresh)
}, },
methods: { methods: {
......
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
window.GMS.vbus.$on('refresh-workflow-job-view', this.handleSearch) window.GMS.vbus.$on('refresh-workflow-job-view', this.handleSearch)
this.$root.$on('updated', this.handleSearch) this.$root.$on('updated', this.handleSearch)
}, },
beforeUnmount() { beforeDestroy() {
window.GMS.vbus.$off('refresh-workflow-job-view', this.handleSearch) window.GMS.vbus.$off('refresh-workflow-job-view', this.handleSearch)
this.$root.$off('updated', this.handleSearch) this.$root.$off('updated', this.handleSearch)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment