From df0e7a16d9356c81ff1b07cbf9e9d540a5d3d850 Mon Sep 17 00:00:00 2001 From: menxipeng Date: Sat, 29 Nov 2025 17:56:32 +0800 Subject: [PATCH] youhua1 --- src/components/pages/EquipmentPage.tsx | 12 ++++++------ src/components/pages/MallsPage.tsx | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/pages/EquipmentPage.tsx b/src/components/pages/EquipmentPage.tsx index 7dbf39e..9a9ab1d 100644 --- a/src/components/pages/EquipmentPage.tsx +++ b/src/components/pages/EquipmentPage.tsx @@ -653,10 +653,10 @@ export default function EquipmentPage() { const installDate = e.target.value setNewEquipment({ ...newEquipment, installDate }) - // 自动填充下一次检测时间(安装日期+1年) - if (installDate && !newEquipment.nextInspectionDate) { + // 自动更新下一次检测时间(安装日期+半年) + if (installDate) { const nextDate = new Date(installDate) - nextDate.setFullYear(nextDate.getFullYear() + 1) + nextDate.setMonth(nextDate.getMonth() + 6) const nextDateStr = nextDate.toISOString().split('T')[0] setNewEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr })) } @@ -869,10 +869,10 @@ export default function EquipmentPage() { const installDate = e.target.value setEditEquipment({ ...editEquipment, installDate }) - // 自动填充下一次检测时间(安装日期+1年) - if (installDate && !editEquipment.nextInspectionDate) { + // 自动更新下一次检测时间(安装日期+半年) + if (installDate) { const nextDate = new Date(installDate) - nextDate.setFullYear(nextDate.getFullYear() + 1) + nextDate.setMonth(nextDate.getMonth() + 6) const nextDateStr = nextDate.toISOString().split('T')[0] setEditEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr })) } diff --git a/src/components/pages/MallsPage.tsx b/src/components/pages/MallsPage.tsx index a30ef16..d142930 100644 --- a/src/components/pages/MallsPage.tsx +++ b/src/components/pages/MallsPage.tsx @@ -64,9 +64,11 @@ interface Mall { mallName: string addr: string province: string + provinceName?: string creator: string updator: string | null mallUser: string + mallUserName?: string status: string } @@ -823,7 +825,7 @@ export default function MallsPage() {
省份: - {deletingMall.province} + {deletingMall.provinceName || deletingMall.province}
创建者: @@ -899,9 +901,9 @@ export default function MallsPage() {
创建者: {mall.creator}
- 省份: {mall.province} + 省份: {mall.provinceName || mall.province} | - 管理员: {mall.mallUser} + 管理员: {mall.mallUserName || mall.mallUser}