diff --git a/src/components/pages/CompanyPermissionsPage.tsx b/src/components/pages/CompanyPermissionsPage.tsx index ccd92ad..d645af4 100644 --- a/src/components/pages/CompanyPermissionsPage.tsx +++ b/src/components/pages/CompanyPermissionsPage.tsx @@ -14,7 +14,7 @@ import { DialogTrigger, } from "../ui/dialog" import { Label } from "../ui/label" -import { Plus, Search, Download, User, Shield, Building, Store, Wrench, Eye, Edit, Trash2 } from "lucide-react" +import { Plus, Search, User, Shield, Building, Store, Wrench, Eye, Edit, Trash2 } from "lucide-react" import { apiGet, apiPost, apiPut, apiDelete } from "../../lib/services/api" import { getUserData } from "../../lib/utils/storage" @@ -547,11 +547,6 @@ export default function CompanyPermissionsPage() { 锁定 - - {/* Tabs */} diff --git a/src/components/pages/EquipmentPage.tsx b/src/components/pages/EquipmentPage.tsx index a3288b8..9277c6e 100644 --- a/src/components/pages/EquipmentPage.tsx +++ b/src/components/pages/EquipmentPage.tsx @@ -15,7 +15,7 @@ import { DialogTitle, DialogTrigger, } from "../ui/dialog" -import { Plus, Filter, Download, MapPin, Calendar, Shield, ChevronLeft, ChevronRight, Minus, Plus as PlusIcon, Search } from "lucide-react" +import { Plus, Download, MapPin, Calendar, Shield, ChevronLeft, ChevronRight, Minus, Plus as PlusIcon, Search } from "lucide-react" import { apiGet, apiPost, apiPut } from "../../lib/services/api" // 商户数据类型(根据新接口返回格式定义) @@ -188,9 +188,9 @@ export default function EquipmentPage() { } const lowerSearch = searchTerm.toLowerCase() return merchants.filter(merchant => - merchant.merchantName.toLowerCase().includes(lowerSearch) || - merchant.contactPerson.toLowerCase().includes(lowerSearch) || - merchant.contactPhone.includes(lowerSearch) || + (merchant.merchantName && merchant.merchantName.toLowerCase().includes(lowerSearch)) || + (merchant.contactPerson && merchant.contactPerson.toLowerCase().includes(lowerSearch)) || + (merchant.contactPhone && merchant.contactPhone.includes(lowerSearch)) || (merchant.mallLocation && merchant.mallLocation.toLowerCase().includes(lowerSearch)) ) } @@ -544,252 +544,10 @@ export default function EquipmentPage() {

设备管理

管理所有消防设备的档案和状态

-
- - - { - setIsAddEquipmentOpen(open) - if (!open) { - setMerchantSearchForAdd("") - } - }}> - - - - - - 添加新设备 - 填写设备基本信息和安装详情 - -
-
- - setNewEquipment({ ...newEquipment, name: e.target.value })} - placeholder="请输入设备名称" - /> -
-
- - -
-
- - setNewEquipment({ ...newEquipment, model: e.target.value })} - placeholder="请输入设备型号" - /> -
-
- - setMerchantSearchForAdd(e.target.value)} - className="pl-8 h-8 text-sm" - onClick={(e) => e.stopPropagation()} - onKeyDown={(e) => e.stopPropagation()} - /> -
-
-
- {merchants.length === 0 && !loadingMerchants ? ( - - 点击加载商户数据 - - ) : filterMerchants(merchants, merchantSearchForAdd).length === 0 ? ( -
- 未找到匹配的商户 -
- ) : ( - filterMerchants(merchants, merchantSearchForAdd).map((merchant) => ( - - {merchant.merchantName} - {merchant.contactPerson} - - )) - )} -
- - -
-
- - setNewEquipment({ ...newEquipment, location: e.target.value })} - placeholder="请输入安装位置" - /> -
-
- - { - const installDate = e.target.value - setNewEquipment({ ...newEquipment, installDate }) +
- // 自动更新下一次检测时间(安装日期+半年) - if (installDate) { - const nextDate = new Date(installDate) - nextDate.setMonth(nextDate.getMonth() + 6) - const nextDateStr = nextDate.toISOString().split('T')[0] - setNewEquipment(prev => ({ ...prev, nextInspectionDate: nextDateStr })) - } - }} - /> - -
- -
- setNewEquipment({ ...newEquipment, nextInspectionDate: e.target.value })} - className="flex-1 min-w-0" - /> -
- - -
-
-
-
- - -
-
- -