From 4d1fd7136411c8b66df845040c0576222c48352b Mon Sep 17 00:00:00 2001 From: taiyi Date: Fri, 29 May 2026 23:13:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E9=86=92=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA=EF=BC=9A=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E8=A1=A5=E5=85=85content=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=A2=9E=E5=8A=A0title=E5=85=9C=E5=BA=95?= =?UTF-8?q?=EF=BC=8C=E6=B8=85=E9=99=A4=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99?= =?UTF-8?q?=E9=A1=B5=E7=A9=BAtoast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 _map_reminder 返回 reminder_content 作为 content 字段 - 前端 mockApi 透传 content 字段 - NotificationBell 弹窗展示 content,title 为空时显示"(无标题)" - 提醒中心和工作台页面 title 列增加空值兜底 - 删除 MasterDataPage 中 13 处 toast.success("") 空弹窗调用 Co-Authored-By: Claude Opus 4.7 --- backend/app/services/reminder_service.py | 1 + .../src/components/NotificationBell.vue | 4 +-- frontend/web-admin/src/mockApi.js | 1 + .../web-admin/src/views/MasterDataPage.vue | 26 +++++++++---------- .../src/views/ReminderCenterPage.vue | 2 +- .../src/components/NotificationBell.vue | 4 +-- frontend/web-sales/src/mockApi.js | 1 + .../web-sales/src/views/DashboardPage.vue | 2 +- .../web-sales/src/views/RemindersPage.vue | 2 +- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/backend/app/services/reminder_service.py b/backend/app/services/reminder_service.py index 3e91994..06a8477 100644 --- a/backend/app/services/reminder_service.py +++ b/backend/app/services/reminder_service.py @@ -261,6 +261,7 @@ class ReminderService: return { "reminder_id": reminder.id, "title": reminder.reminder_title, + "content": reminder.reminder_content, "type": reminder.reminder_type, "biz_type": reminder.biz_type, "biz_id": reminder.biz_id, diff --git a/frontend/web-admin/src/components/NotificationBell.vue b/frontend/web-admin/src/components/NotificationBell.vue index 0a2e315..64f310f 100644 --- a/frontend/web-admin/src/components/NotificationBell.vue +++ b/frontend/web-admin/src/components/NotificationBell.vue @@ -25,8 +25,8 @@ >
-

{{ item.title }}

-

{{ item.biz_type }} / {{ item.biz_id }}

+

{{ item.title || '(无标题)' }}

+

{{ item.content || item.type }}

diff --git a/frontend/web-admin/src/mockApi.js b/frontend/web-admin/src/mockApi.js index b1c3341..82fd603 100644 --- a/frontend/web-admin/src/mockApi.js +++ b/frontend/web-admin/src/mockApi.js @@ -776,6 +776,7 @@ function buildReminderRow(item) { return { reminder_id: item.reminder_id, title: item.title, + content: item.content, type: item.type, biz_type: item.biz_type, biz_id: item.biz_id, diff --git a/frontend/web-admin/src/views/MasterDataPage.vue b/frontend/web-admin/src/views/MasterDataPage.vue index 3a0d3a2..634da6c 100644 --- a/frontend/web-admin/src/views/MasterDataPage.vue +++ b/frontend/web-admin/src/views/MasterDataPage.vue @@ -1336,7 +1336,7 @@ async function handleSetDefaultSpec(spec) { return; } loadingProductDetail.value = true; - toast.success(""); + try { await setDefaultProductSpec(spec.product_id); if (productDetail.value?.product_name) { @@ -1409,7 +1409,7 @@ async function loadSuppliers() { async function handleSearchCustomers() { loadingCustomers.value = true; - toast.success(""); + try { const data = await loadCustomers(); } catch (error) { @@ -1450,7 +1450,7 @@ async function handleCreateCustomer() { return; } creatingCustomer.value = true; - toast.success(""); + try { const result = await createCustomer({ ...customerCreateForm, @@ -1472,7 +1472,7 @@ async function handleImportCustomers() { return; } importingCustomer.value = true; - toast.success(""); + try { const result = await importCustomers({ ...customerImportForm }); showImportCustomerForm.value = false; @@ -1489,7 +1489,7 @@ async function handleImportCustomers() { async function handleSearchCategories() { loadingCategories.value = true; - toast.success(""); + try { const data = await loadCategories(); } catch (error) { @@ -1515,7 +1515,7 @@ async function handleCreateCategory() { return; } creatingCategory.value = true; - toast.success(""); + try { const result = await createProductCategory({ ...categoryCreateForm }); showCreateCategoryForm.value = false; @@ -1558,7 +1558,7 @@ async function handleUpdateCategory() { return; } updatingCategory.value = true; - toast.success(""); + try { await updateProductCategory(editingCategoryId.value, { ...categoryEditForm }); resetCategoryEditForm(); @@ -1574,7 +1574,7 @@ async function handleUpdateCategory() { async function handleSearchProducts() { loadingProducts.value = true; - toast.success(""); + try { const data = await loadProducts(); } catch (error) { @@ -1603,7 +1603,7 @@ async function handleCreateProduct() { return; } creatingProduct.value = true; - toast.success(""); + try { const result = await createProduct({ product_name: productCreateForm.product_name.trim(), @@ -1666,7 +1666,7 @@ async function handleUpdateSpec() { return; } updatingSpec.value = true; - toast.success(""); + try { await updateProductSpecification(editingSpecId.value, { ...editingSpecForm, @@ -1689,7 +1689,7 @@ async function handleUpdateSpec() { async function handleSearchSuppliers() { loadingSuppliers.value = true; - toast.success(""); + try { const data = await loadSuppliers(); } catch (error) { @@ -1712,7 +1712,7 @@ async function handleCreateSupplier() { return; } creatingSupplier.value = true; - toast.success(""); + try { const result = await createSupplier({ ...supplierCreateForm }); showCreateSupplierForm.value = false; @@ -1745,7 +1745,7 @@ async function handleViewSupplierDetail(row) { async function switchTab(tabKey) { activeTab.value = tabKey; - toast.success(""); + if (tabKey === "categories" && !categoryRows.value.length) { await handleSearchCategories(); } diff --git a/frontend/web-admin/src/views/ReminderCenterPage.vue b/frontend/web-admin/src/views/ReminderCenterPage.vue index 193998b..54bf2d1 100644 --- a/frontend/web-admin/src/views/ReminderCenterPage.vue +++ b/frontend/web-admin/src/views/ReminderCenterPage.vue @@ -54,7 +54,7 @@ 标题类型业务对象状态操作 - {{ row.title }} + {{ row.title || '(无标题)' }} {{ row.type }} {{ row.biz_type }} / {{ row.biz_id }} {{ row.status }} diff --git a/frontend/web-sales/src/components/NotificationBell.vue b/frontend/web-sales/src/components/NotificationBell.vue index 2e98484..2eecae2 100644 --- a/frontend/web-sales/src/components/NotificationBell.vue +++ b/frontend/web-sales/src/components/NotificationBell.vue @@ -25,8 +25,8 @@ >
-

{{ item.title }}

-

{{ item.type }}

+

{{ item.title || '(无标题)' }}

+

{{ item.content || item.type }}

diff --git a/frontend/web-sales/src/mockApi.js b/frontend/web-sales/src/mockApi.js index 9ec4516..43429d5 100644 --- a/frontend/web-sales/src/mockApi.js +++ b/frontend/web-sales/src/mockApi.js @@ -225,6 +225,7 @@ export async function fetchRemindersPage(filters = {}) { reminderRows: (data.list || []).map((item) => ({ reminderId: item.reminder_id, title: item.title, + content: item.content, type: item.type, bizType: item.biz_type, bizId: item.biz_id, diff --git a/frontend/web-sales/src/views/DashboardPage.vue b/frontend/web-sales/src/views/DashboardPage.vue index 66e1fda..821eec1 100644 --- a/frontend/web-sales/src/views/DashboardPage.vue +++ b/frontend/web-sales/src/views/DashboardPage.vue @@ -59,7 +59,7 @@
暂无待处理提醒
- {{ item.title }} + {{ item.title || '(无标题)' }} {{ item.type || "-" }} {{ item.created_at || "-" }}
diff --git a/frontend/web-sales/src/views/RemindersPage.vue b/frontend/web-sales/src/views/RemindersPage.vue index 280def9..f4211c4 100644 --- a/frontend/web-sales/src/views/RemindersPage.vue +++ b/frontend/web-sales/src/views/RemindersPage.vue @@ -55,7 +55,7 @@ - {{ row.title }} + {{ row.title || '(无标题)' }} {{ row.type }} {{ row.status }} {{ row.createdAt }}