From ad52c6bbf93d3b6f54dd6d029327d4b4f21317d6 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Fri, 28 Feb 2025 18:14:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E7=BB=91=E5=AE=9Aon=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../points/pointsconfig/Memberpointsconfig/Content.vue | 8 ++++++-- .../points/pointsconfig/ProductSettingsconfig/Content.vue | 5 ++--- .../points/pointsconfig/exchangerecordsconfig/Content.vue | 7 +++++-- src/views/mytemplate/indexconfig/Content.vue | 6 ++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/views/application/marketing/points/pointsconfig/Memberpointsconfig/Content.vue b/src/views/application/marketing/points/pointsconfig/Memberpointsconfig/Content.vue index d2e013e..ea94955 100644 --- a/src/views/application/marketing/points/pointsconfig/Memberpointsconfig/Content.vue +++ b/src/views/application/marketing/points/pointsconfig/Memberpointsconfig/Content.vue @@ -38,10 +38,14 @@ const myDialogRef = ref(null) const ruleFormRef = ref(null) onMounted(() => { getList() + eventBus.on('search', (res) => { + getList(res) + }) }) -eventBus.on('search', (res) => { - getList(res) +onBeforeUnmount(() => { + eventBus.off('search') }) + async function getList(data = {}) { const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data }) datas.tableData = res.records diff --git a/src/views/application/marketing/points/pointsconfig/ProductSettingsconfig/Content.vue b/src/views/application/marketing/points/pointsconfig/ProductSettingsconfig/Content.vue index 16c921c..298706c 100644 --- a/src/views/application/marketing/points/pointsconfig/ProductSettingsconfig/Content.vue +++ b/src/views/application/marketing/points/pointsconfig/ProductSettingsconfig/Content.vue @@ -98,9 +98,8 @@ const ruleFormRef = ref(null) onMounted(() => { getList() }) -eventBus.on('search', (res) => { - getList(res) -}) + + async function getList(data = {}) { const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data }) datas.tableData = res.records diff --git a/src/views/application/marketing/points/pointsconfig/exchangerecordsconfig/Content.vue b/src/views/application/marketing/points/pointsconfig/exchangerecordsconfig/Content.vue index 080bb71..41c806d 100644 --- a/src/views/application/marketing/points/pointsconfig/exchangerecordsconfig/Content.vue +++ b/src/views/application/marketing/points/pointsconfig/exchangerecordsconfig/Content.vue @@ -56,9 +56,12 @@ const myDialogRef = ref(null) const ruleFormRef = ref(null) onMounted(() => { getList() + eventBus.on('search', (res) => { + getList(res) + }) }) -eventBus.on('search', (res) => { - getList(res) +onBeforeUnmount(() => { + eventBus.off('search') }) async function getList(data = {}) { const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data }) diff --git a/src/views/mytemplate/indexconfig/Content.vue b/src/views/mytemplate/indexconfig/Content.vue index 8b7d28b..31606a9 100644 --- a/src/views/mytemplate/indexconfig/Content.vue +++ b/src/views/mytemplate/indexconfig/Content.vue @@ -84,6 +84,12 @@ const myDialogRef = ref(null) const ruleFormRef = ref(null) onMounted(() => { getList() + eventBus.on('search', (res) => { + getList(res) + }) +}) +onBeforeUnmount(() => { + eventBus.off('search') }) eventBus.on('search', (res) => { getList(res)