From 3d574f204a20bedadb52e91bc7419ba8ebc9b1b7 Mon Sep 17 00:00:00 2001 From: uiujun Date: Wed, 22 Apr 2026 17:45:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E5=A4=A7=E9=9D=A2=E7=A7=AF?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E7=BA=A7=E9=A1=B5=E9=9D=A2=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/skills/list-page-actions/SKILL.md | 104 + .../assets/list-page-template.tsx | 105 + .../references/component-api.md | 67 + .../references/migration-guide.md | 97 + gencode.json | 1 + src/common/components/MyTableActions.tsx | 48 + src/common/components/MyToolBarActions.tsx | 12 + src/common/components/schema/MyColumns.tsx | 4 +- src/common/index.tsx | 2 + src/common/typings.d.ts | 2 +- src/components/MyExport.tsx | 50 +- src/components/Select.tsx | 66 + src/gen/ApiTypes.d.ts | 147 ++ src/gen/Apis.ts | 97 +- src/gen/Enums.ts | 2286 +++++++---------- .../approval/pending/modals/Forwarded.tsx | 2 +- src/pages/approval/templates/index.tsx | 50 +- .../templates/modals/BatchModifyApprover.tsx | 2 +- src/pages/asset/accounts/index.tsx | 33 +- src/pages/asset/activities/index.tsx | 163 +- .../asset/activities/modals/EnrollsList.tsx | 2 +- src/pages/asset/announcement/index.tsx | 113 +- src/pages/asset/asset_list/index.tsx | 154 +- .../asset_list/modals/BuildingsManage.tsx | 18 + .../asset_list/modals/ParkingsManage.tsx | 18 + src/pages/asset/grids/index.tsx | 58 +- src/pages/asset/grids/modals/GridCreate.tsx | 24 +- src/pages/asset/houses/index.tsx | 65 +- src/pages/asset/parking_area/index.tsx | 47 +- src/pages/asset/parking_space/index.tsx | 98 +- .../asset/parking_space/modals/AreaUpdate.tsx | 105 + .../parking_space/modals/SpaceUpdate.tsx | 2 +- .../components/ProjectConfig.tsx | 75 - .../asset/project_configuration/index.tsx | 68 - .../modals/AssetCreate.tsx | 169 -- .../modals/AssetInfo.tsx | 91 - .../modals/AssetUpdate.tsx | 184 -- .../table/Activities.tsx | 149 -- .../table/Announcement.tsx | 142 - .../table/AssetAccounts.tsx | 90 - .../table/AssetBuildings.tsx | 364 --- .../project_configuration/table/AssetGrid.tsx | 78 - .../table/ChargeStandard.tsx | 143 -- .../table/ConvenienceServices.tsx | 101 - src/pages/asset/services/index.tsx | 60 +- .../attendance/attendance_configs/index.tsx | 165 +- .../attendance/attendance_employees/index.tsx | 56 +- .../attendance_employees_tracks/index.tsx | 19 +- .../attendance/attendance_records/index.tsx | 88 +- .../attendance/attendance_schedules/index.tsx | 102 +- .../attendance_schedules/pages/create.tsx | 367 ++- .../attendance/attendance_shifts/index.tsx | 297 ++- src/pages/attendance/employee_tracks/$id.tsx | 545 ++-- .../attendance/employee_tracks/ending.png | Bin 0 -> 5837 bytes .../attendance/employee_tracks/starting.png | Bin 0 -> 4477 bytes .../attendance/employee_tracks/style.scss | 154 +- src/pages/bills/all_bills/audit/index.tsx | 80 - .../bills/all_bills/audit/modals/Review.tsx | 77 - src/pages/bills/all_bills/index.tsx | 31 - src/pages/bills/all_bills/list/index.tsx | 91 - .../bills/all_bills/list/modals/PayCreate.tsx | 88 - src/pages/bills/house_bills/index.tsx | 221 +- src/pages/bills/house_bills/modals/Pay.tsx | 161 ++ src/pages/bills/house_bills/modals/QrCode.tsx | 156 ++ .../house_bills/modals/RefundComplete.tsx | 84 + src/pages/bills/order/index.tsx | 131 +- src/pages/bills/order_online/index.tsx | 108 +- src/pages/bills/payment/index.tsx | 105 - src/pages/bills/summary/table/PaidBill.tsx | 28 +- src/pages/bills/summary/table/UnpaidBill.tsx | 38 +- .../bills/summary/table/modals/Refund.tsx | 75 + .../bills/summary/table/modals/ShowQrCode.tsx | 151 ++ src/pages/charge/refunds/index.tsx | 39 +- .../charge/standard/components/CarPortFee.tsx | 164 -- .../standard/components/ElectricityFee.tsx | 171 -- .../charge/standard/components/HasCar.tsx | 1 + .../charge/standard/components/HasHouse.tsx | 1 + .../charge/standard/components/Instrument.tsx | 2 +- .../standard/components/MaintenanceFund.tsx | 174 -- .../standard/components/PropertyFee.tsx | 172 -- .../components/SharedElectricityFee.tsx | 171 -- .../standard/components/SharedWaterFee.tsx | 171 -- .../charge/standard/components/WaterFee.tsx | 167 -- src/pages/charge/standard/index.tsx | 212 +- .../modals/ChargeStandardHasMeter.tsx | 211 ++ .../CreateStandard.tsx} | 199 +- src/pages/charge/standard/modals/Show.tsx | 99 + .../standard/pages/CreateCarPortFee.tsx | 522 ---- .../standard/pages/CreateMaintenanceFund.tsx | 529 ---- .../standard/pages/CreatePropertyfee.tsx | 529 ---- .../pages/CreateSharedElectricityFee.tsx | 539 ---- .../standard/pages/CreateSharedWaterFee.tsx | 541 ---- .../charge/standard/pages/CreateWaterFee.tsx | 529 ---- src/pages/charge/standard/show/$id.tsx | 101 - src/pages/charge/tasks/index.tsx | 653 +++-- src/pages/charge/tasks/modals/TaskCreate.tsx | 69 +- src/pages/charge/tasks/modals/TaskShow.tsx | 39 +- src/pages/company/accounts/index.tsx | 65 +- src/pages/company/brand/index.tsx | 45 +- src/pages/company/employees/index.tsx | 126 +- .../employees/modals/EmployeeCreate.tsx | 2 +- .../employees/modals/EmployeeUpdate.tsx | 8 +- .../organization_has_projects/index.tsx | 75 - .../modals/HasProjects.tsx | 65 - src/pages/company/organizations/index.tsx | 128 +- .../modals/NextOrganizationChange.tsx | 2 +- .../modals/OrganizationChange.tsx | 10 +- src/pages/company/positions/index.tsx | 45 +- .../contract/contract_archive_use/index.tsx | 49 - .../contract_archives/finished/index.tsx | 265 +- .../contract/contract_archives/index.tsx | 163 +- .../{unfinished => }/modals/Archive.tsx | 0 .../{unfinished => }/modals/Orther.tsx | 0 .../{finished => }/modals/Save.tsx | 1 - .../{finished => }/modals/Show.tsx | 0 .../{finished => }/modals/TransfersCreate.tsx | 30 - .../{finished => }/modals/Update.tsx | 20 - .../contract_archives/transfers/index.tsx | 156 +- .../contract_archives/unfinished/index.tsx | 108 - .../contract/contract_bill_payments/index.tsx | 36 +- .../contract/contract_bills/Expense/index.tsx | 114 +- .../contract/contract_bills/Income/index.tsx | 105 +- .../borrows => contract_borrows}/index.tsx | 62 +- .../modals/Create.tsx | 0 .../modals/Show.tsx | 0 .../modals/Update.tsx | 0 .../read/index.tsx | 2 +- .../read/modals/Read.tsx | 0 .../read/modals/Show.tsx | 0 .../contract/contract_seal_logs/index.tsx | 180 +- .../{used => }/modals/Show.tsx | 38 +- .../{used => }/modals/Update.tsx | 51 +- .../{unused => }/modals/UseSeal.tsx | 50 +- .../contract_seal_logs/seals/SealsManage.tsx | 16 + .../contract_seal_logs/unused/index.tsx | 105 - .../contract_seal_logs/used/index.tsx | 110 - .../contract/contract_templates/index.tsx | 84 +- src/pages/contract/contract_types/index.tsx | 38 +- src/pages/contract/contracts/index.tsx | 324 ++- .../show/components/ArchivingLogs.tsx | 2 +- src/pages/contract/contracts_add/index.tsx | 160 +- .../show/components/ArchivingLogs.tsx | 6 +- .../show/components/UsedLogs.tsx | 2 +- src/pages/contract/contracts_other/index.tsx | 58 +- src/pages/customer/archive/index.tsx | 70 +- .../archive/table_prepay/DeductionRecords.tsx | 69 - .../archive/table_prepay/PrePayRecords.tsx | 69 - .../customer/house_registers_audit/index.tsx | 22 +- src/pages/customer/houses/index.tsx | 169 -- src/pages/customer/list/index.tsx | 57 +- src/pages/customer/register_list/index.tsx | 84 - src/pages/customer/registers/index.tsx | 22 +- src/pages/goods_releases/{list => }/index.tsx | 50 +- .../{list => }/modals/Audit.tsx | 0 .../goods_releases/{list => }/modals/Show.tsx | 0 .../{list => }/pages/create.tsx | 0 .../house_charage/house_door_cards/index.tsx | 66 +- src/pages/login.tsx | 2 +- src/pages/meter/house_meter/index.tsx | 4 +- src/pages/meter/house_meter/modals/Create.tsx | 4 +- src/pages/meter/house_meter/modals/Update.tsx | 4 +- src/pages/patrol/index.tsx | 205 +- .../{patrol_tasks => }/modals/Create.tsx | 0 src/pages/patrol/modals/LocationsManage.tsx | 19 + .../modals/PatrolOrderAssign.tsx | 0 .../modals/PatrolOrderShow.tsx | 0 src/pages/patrol/modals/RoutesManage.tsx | 19 + src/pages/patrol/patrol_locations/index.tsx | 92 +- src/pages/patrol/patrol_routes/index.tsx | 47 +- src/pages/patrol/patrol_tasks/index.tsx | 139 - .../quality/emergency/categories/index.tsx | 4 +- .../{events/show => }/components/Info.tsx | 0 src/pages/quality/emergency/events/index.tsx | 103 - src/pages/quality/emergency/follows/index.tsx | 4 +- src/pages/quality/emergency/index.tsx | 210 +- src/pages/quality/emergency/levels/index.tsx | 4 +- .../Create.tsx => modals/CategoryCreate.tsx} | 0 .../Update.tsx => modals/CategoryUpdate.tsx} | 0 .../EventApplyClose.tsx} | 0 .../Create.tsx => modals/EventCreate.tsx} | 2 +- .../Review.tsx => modals/EventReview.tsx} | 0 .../Update.tsx => modals/EventUpdate.tsx} | 0 .../Create.tsx => modals/FollowCreate.tsx} | 0 .../modals/Show.tsx => modals/FollowShow.tsx} | 0 .../Create.tsx => modals/LevelCreate.tsx} | 0 .../Update.tsx => modals/LevelUpdate.tsx} | 0 .../Create.tsx => modals/TeamCreate.tsx} | 0 .../Update.tsx => modals/TeamUpdate.tsx} | 0 .../emergency/{events => }/show/$id.tsx | 4 +- src/pages/quality/emergency/teams/index.tsx | 4 +- src/pages/quality/marketing/ad/index.tsx | 103 - .../marketing/ad/modals/BannerCreate.tsx | 171 -- .../marketing/ad/modals/BannerShow.tsx | 150 -- .../marketing/ad/modals/BannerUpdate.tsx | 164 -- .../quality/marketing/ad_location/$id.tsx | 52 - .../ad_location/components/BannerList.tsx | 88 - .../components/BannerSpaceInfo.tsx | 31 - .../quality/marketing/ad_location/index.tsx | 85 - .../ad_location/modals/BannerSpaceCreate.tsx | 59 - .../ad_location/modals/BannerSpaceUpdate.tsx | 66 - .../survey/components/SurveyReleasesList.tsx | 75 - src/pages/quality/marketing/survey/index.tsx | 47 - .../quality/renovation/application/index.tsx | 194 -- src/pages/quality/renovation/audit/index.tsx | 2 +- .../{application => }/components/Deposit.tsx | 0 .../components/WorkerTable.tsx | 4 +- .../{application => }/components/info.tsx | 0 src/pages/quality/renovation/config/$id.tsx | 2 +- .../quality/renovation/deposit/index.tsx | 2 +- src/pages/quality/renovation/index.tsx | 250 +- .../index.tsx | 4 +- .../Review.tsx => modals/AuditReview.tsx} | 0 .../quality/renovation/modals/DepositPay.tsx | 110 + .../DepositPayCreate.tsx} | 0 .../renovation/modals/DepositRefund.tsx | 117 + .../InspectionRuleCreate.tsx} | 0 .../InspectionRuleUpdate.tsx} | 0 .../Create.tsx => modals/WorkersCreate.tsx} | 0 .../Update.tsx => modals/WorkersUpdate.tsx} | 0 .../{application => }/pages/create.tsx | 0 .../renovation/{audit => }/pages/review.tsx | 2 +- .../{application => }/pages/show.tsx | 0 .../{application => }/pages/update.tsx | 0 .../{renovation_workers => workers}/index.tsx | 4 +- .../components/QuestionCategoriesList.tsx | 0 .../survey/components/QuestionsList.tsx | 0 .../survey/components/SurveyReleasesList.tsx | 122 + .../survey/components/SurveyResponsesList.tsx | 17 +- .../survey/components/SurveysList.tsx | 0 src/pages/quality/survey/index.tsx | 15 + .../modals/QuestionCategoriesCreate.tsx | 0 .../modals/QuestionCategoriesManage.tsx | 31 + .../modals/QuestionCategoriesUpdate.tsx | 0 .../survey/modals/QuestionsCreate.tsx | 0 .../quality/survey/modals/QuestionsManage.tsx | 31 + .../survey/modals/QuestionsUpdate.tsx | 0 .../survey/modals/SurveyReleasesCreate.tsx | 0 .../survey/modals/SurveyReleasesUpdate.tsx | 0 .../modals/SurveyResponsesByRelease.tsx | 36 + .../survey/modals/SurveyResponsesShow.tsx | 0 .../survey/modals/SurveysListShow.tsx | 1 + .../quality/survey/modals/SurveysManage.tsx | 31 + .../survey/modals/SurveysSelectList.tsx | 0 .../survey/pages/create_surveys.tsx | 0 .../survey/pages/update_surveys.tsx | 0 src/pages/supplier/internal/index.tsx | 45 +- src/pages/supplier/outside/index.tsx | 130 +- .../supplier/outside/modals/AddBlack.tsx | 7 +- src/pages/system/admins/index copy.tsx | 74 - src/pages/system/admins/index.tsx | 65 - src/pages/system/admins/modals/Create.tsx | 45 - src/pages/system/admins/modals/Update.tsx | 49 - src/pages/system/sys_permissions/index.tsx | 59 - .../system/sys_permissions/modals/Create.tsx | 84 - .../system/sys_permissions/modals/Update.tsx | 74 - .../sys_roles/components/AdminRole/index.tsx | 233 +- .../sys_roles/components/AdminsList/index.tsx | 64 - .../components/AdminsList/modals/Create.tsx | 54 - .../components/AdminsList/modals/Update.tsx | 49 - .../components/EditPermissions/index.tsx | 94 - .../components/EmployeeRole/index.tsx | 228 +- .../components/EmployeeRole/modals/Create.tsx | 47 - .../sys_roles/components/PermissionTree.tsx | 76 + .../sys_roles/components/RoleFormModal.tsx | 117 + .../system/sys_roles/components/RoleTable.tsx | 125 + src/pages/system/sys_roles/index1.tsx | 190 -- src/pages/system/sys_roles/index2.tsx | 113 - src/pages/system/sys_roles/modals/Create.tsx | 47 - .../sys_roles/modals/EditPermissions copy.tsx | 54 - src/pages/system/sys_roles/modals/Update.tsx | 49 - .../{visitor_applies => visitor}/index.tsx | 51 +- .../modals/Review.tsx | 0 src/pages/work_order/complaint/index.tsx | 98 +- src/pages/work_order/evaluated/index.tsx | 42 +- src/pages/work_order/list/index.tsx | 149 +- src/pages/work_order/managers/index.tsx | 95 + .../managers/modals/ManagersCreate.tsx | 93 + src/pages/work_order/patrol_work/index.tsx | 167 +- 278 files changed, 9251 insertions(+), 15315 deletions(-) create mode 100644 .claude/skills/list-page-actions/SKILL.md create mode 100644 .claude/skills/list-page-actions/assets/list-page-template.tsx create mode 100644 .claude/skills/list-page-actions/references/component-api.md create mode 100644 .claude/skills/list-page-actions/references/migration-guide.md create mode 100644 src/common/components/MyTableActions.tsx create mode 100644 src/common/components/MyToolBarActions.tsx create mode 100644 src/pages/asset/asset_list/modals/BuildingsManage.tsx create mode 100644 src/pages/asset/asset_list/modals/ParkingsManage.tsx create mode 100644 src/pages/asset/parking_space/modals/AreaUpdate.tsx delete mode 100644 src/pages/asset/project_configuration/components/ProjectConfig.tsx delete mode 100644 src/pages/asset/project_configuration/index.tsx delete mode 100644 src/pages/asset/project_configuration/modals/AssetCreate.tsx delete mode 100644 src/pages/asset/project_configuration/modals/AssetInfo.tsx delete mode 100644 src/pages/asset/project_configuration/modals/AssetUpdate.tsx delete mode 100644 src/pages/asset/project_configuration/table/Activities.tsx delete mode 100644 src/pages/asset/project_configuration/table/Announcement.tsx delete mode 100644 src/pages/asset/project_configuration/table/AssetAccounts.tsx delete mode 100644 src/pages/asset/project_configuration/table/AssetBuildings.tsx delete mode 100644 src/pages/asset/project_configuration/table/AssetGrid.tsx delete mode 100644 src/pages/asset/project_configuration/table/ChargeStandard.tsx delete mode 100644 src/pages/asset/project_configuration/table/ConvenienceServices.tsx create mode 100644 src/pages/attendance/employee_tracks/ending.png create mode 100644 src/pages/attendance/employee_tracks/starting.png delete mode 100644 src/pages/bills/all_bills/audit/index.tsx delete mode 100644 src/pages/bills/all_bills/audit/modals/Review.tsx delete mode 100644 src/pages/bills/all_bills/index.tsx delete mode 100644 src/pages/bills/all_bills/list/index.tsx delete mode 100644 src/pages/bills/all_bills/list/modals/PayCreate.tsx create mode 100644 src/pages/bills/house_bills/modals/Pay.tsx create mode 100644 src/pages/bills/house_bills/modals/QrCode.tsx create mode 100644 src/pages/bills/house_bills/modals/RefundComplete.tsx delete mode 100644 src/pages/bills/payment/index.tsx create mode 100644 src/pages/bills/summary/table/modals/Refund.tsx create mode 100644 src/pages/bills/summary/table/modals/ShowQrCode.tsx delete mode 100644 src/pages/charge/standard/components/CarPortFee.tsx delete mode 100644 src/pages/charge/standard/components/ElectricityFee.tsx delete mode 100644 src/pages/charge/standard/components/MaintenanceFund.tsx delete mode 100644 src/pages/charge/standard/components/PropertyFee.tsx delete mode 100644 src/pages/charge/standard/components/SharedElectricityFee.tsx delete mode 100644 src/pages/charge/standard/components/SharedWaterFee.tsx delete mode 100644 src/pages/charge/standard/components/WaterFee.tsx create mode 100644 src/pages/charge/standard/modals/ChargeStandardHasMeter.tsx rename src/pages/charge/standard/{pages/CreateElectricityFee.tsx => modals/CreateStandard.tsx} (81%) create mode 100644 src/pages/charge/standard/modals/Show.tsx delete mode 100644 src/pages/charge/standard/pages/CreateCarPortFee.tsx delete mode 100644 src/pages/charge/standard/pages/CreateMaintenanceFund.tsx delete mode 100644 src/pages/charge/standard/pages/CreatePropertyfee.tsx delete mode 100644 src/pages/charge/standard/pages/CreateSharedElectricityFee.tsx delete mode 100644 src/pages/charge/standard/pages/CreateSharedWaterFee.tsx delete mode 100644 src/pages/charge/standard/pages/CreateWaterFee.tsx delete mode 100644 src/pages/charge/standard/show/$id.tsx delete mode 100644 src/pages/company/organization_has_projects/index.tsx delete mode 100644 src/pages/company/organization_has_projects/modals/HasProjects.tsx delete mode 100644 src/pages/contract/contract_archive_use/index.tsx rename src/pages/contract/contract_archives/{unfinished => }/modals/Archive.tsx (100%) rename src/pages/contract/contract_archives/{unfinished => }/modals/Orther.tsx (100%) rename src/pages/contract/contract_archives/{finished => }/modals/Save.tsx (97%) rename src/pages/contract/contract_archives/{finished => }/modals/Show.tsx (100%) rename src/pages/contract/contract_archives/{finished => }/modals/TransfersCreate.tsx (67%) rename src/pages/contract/contract_archives/{finished => }/modals/Update.tsx (92%) delete mode 100644 src/pages/contract/contract_archives/unfinished/index.tsx rename src/pages/contract/{contract_archive_use/borrows => contract_borrows}/index.tsx (71%) rename src/pages/contract/{contract_archive_use/borrows => contract_borrows}/modals/Create.tsx (100%) rename src/pages/contract/{contract_archive_use/borrows => contract_borrows}/modals/Show.tsx (100%) rename src/pages/contract/{contract_archive_use/borrows => contract_borrows}/modals/Update.tsx (100%) rename src/pages/contract/{contract_archive_use => contract_borrows}/read/index.tsx (97%) rename src/pages/contract/{contract_archive_use => contract_borrows}/read/modals/Read.tsx (100%) rename src/pages/contract/{contract_archive_use => contract_borrows}/read/modals/Show.tsx (100%) rename src/pages/contract/contract_seal_logs/{used => }/modals/Show.tsx (71%) rename src/pages/contract/contract_seal_logs/{used => }/modals/Update.tsx (82%) rename src/pages/contract/contract_seal_logs/{unused => }/modals/UseSeal.tsx (71%) create mode 100644 src/pages/contract/contract_seal_logs/seals/SealsManage.tsx delete mode 100644 src/pages/contract/contract_seal_logs/unused/index.tsx delete mode 100644 src/pages/contract/contract_seal_logs/used/index.tsx delete mode 100644 src/pages/customer/archive/table_prepay/DeductionRecords.tsx delete mode 100644 src/pages/customer/archive/table_prepay/PrePayRecords.tsx delete mode 100644 src/pages/customer/houses/index.tsx delete mode 100644 src/pages/customer/register_list/index.tsx rename src/pages/goods_releases/{list => }/index.tsx (82%) rename src/pages/goods_releases/{list => }/modals/Audit.tsx (100%) rename src/pages/goods_releases/{list => }/modals/Show.tsx (100%) rename src/pages/goods_releases/{list => }/pages/create.tsx (100%) rename src/pages/patrol/{patrol_tasks => }/modals/Create.tsx (100%) create mode 100644 src/pages/patrol/modals/LocationsManage.tsx rename src/pages/patrol/{patrol_tasks => }/modals/PatrolOrderAssign.tsx (100%) rename src/pages/patrol/{patrol_tasks => }/modals/PatrolOrderShow.tsx (100%) create mode 100644 src/pages/patrol/modals/RoutesManage.tsx delete mode 100644 src/pages/patrol/patrol_tasks/index.tsx rename src/pages/quality/emergency/{events/show => }/components/Info.tsx (100%) delete mode 100644 src/pages/quality/emergency/events/index.tsx rename src/pages/quality/emergency/{categories/modals/Create.tsx => modals/CategoryCreate.tsx} (100%) rename src/pages/quality/emergency/{categories/modals/Update.tsx => modals/CategoryUpdate.tsx} (100%) rename src/pages/quality/emergency/{events/modals/ApplyClose.tsx => modals/EventApplyClose.tsx} (100%) rename src/pages/quality/emergency/{events/modals/Create.tsx => modals/EventCreate.tsx} (98%) rename src/pages/quality/emergency/{events/modals/Review.tsx => modals/EventReview.tsx} (100%) rename src/pages/quality/emergency/{events/modals/Update.tsx => modals/EventUpdate.tsx} (100%) rename src/pages/quality/emergency/{follows/modals/Create.tsx => modals/FollowCreate.tsx} (100%) rename src/pages/quality/emergency/{follows/modals/Show.tsx => modals/FollowShow.tsx} (100%) rename src/pages/quality/emergency/{levels/modals/Create.tsx => modals/LevelCreate.tsx} (100%) rename src/pages/quality/emergency/{levels/modals/Update.tsx => modals/LevelUpdate.tsx} (100%) rename src/pages/quality/emergency/{teams/modals/Create.tsx => modals/TeamCreate.tsx} (100%) rename src/pages/quality/emergency/{teams/modals/Update.tsx => modals/TeamUpdate.tsx} (100%) rename src/pages/quality/emergency/{events => }/show/$id.tsx (93%) delete mode 100644 src/pages/quality/marketing/ad/index.tsx delete mode 100644 src/pages/quality/marketing/ad/modals/BannerCreate.tsx delete mode 100644 src/pages/quality/marketing/ad/modals/BannerShow.tsx delete mode 100644 src/pages/quality/marketing/ad/modals/BannerUpdate.tsx delete mode 100644 src/pages/quality/marketing/ad_location/$id.tsx delete mode 100644 src/pages/quality/marketing/ad_location/components/BannerList.tsx delete mode 100644 src/pages/quality/marketing/ad_location/components/BannerSpaceInfo.tsx delete mode 100644 src/pages/quality/marketing/ad_location/index.tsx delete mode 100644 src/pages/quality/marketing/ad_location/modals/BannerSpaceCreate.tsx delete mode 100644 src/pages/quality/marketing/ad_location/modals/BannerSpaceUpdate.tsx delete mode 100644 src/pages/quality/marketing/survey/components/SurveyReleasesList.tsx delete mode 100644 src/pages/quality/marketing/survey/index.tsx delete mode 100644 src/pages/quality/renovation/application/index.tsx rename src/pages/quality/renovation/{application => }/components/Deposit.tsx (100%) rename src/pages/quality/renovation/{application => }/components/WorkerTable.tsx (96%) rename src/pages/quality/renovation/{application => }/components/info.tsx (100%) rename src/pages/quality/renovation/{renovation_inspection_rules => inspection_rules}/index.tsx (94%) rename src/pages/quality/renovation/{audit/modals/Review.tsx => modals/AuditReview.tsx} (100%) create mode 100644 src/pages/quality/renovation/modals/DepositPay.tsx rename src/pages/quality/renovation/{deposit/modals/PayCreate.tsx => modals/DepositPayCreate.tsx} (100%) create mode 100644 src/pages/quality/renovation/modals/DepositRefund.tsx rename src/pages/quality/renovation/{renovation_inspection_rules/modals/Create.tsx => modals/InspectionRuleCreate.tsx} (100%) rename src/pages/quality/renovation/{renovation_inspection_rules/modals/Update.tsx => modals/InspectionRuleUpdate.tsx} (100%) rename src/pages/quality/renovation/{renovation_workers/modals/Create.tsx => modals/WorkersCreate.tsx} (100%) rename src/pages/quality/renovation/{renovation_workers/modals/Update.tsx => modals/WorkersUpdate.tsx} (100%) rename src/pages/quality/renovation/{application => }/pages/create.tsx (100%) rename src/pages/quality/renovation/{audit => }/pages/review.tsx (99%) rename src/pages/quality/renovation/{application => }/pages/show.tsx (100%) rename src/pages/quality/renovation/{application => }/pages/update.tsx (100%) rename src/pages/quality/renovation/{renovation_workers => workers}/index.tsx (96%) rename src/pages/quality/{marketing => }/survey/components/QuestionCategoriesList.tsx (100%) rename src/pages/quality/{marketing => }/survey/components/QuestionsList.tsx (100%) create mode 100644 src/pages/quality/survey/components/SurveyReleasesList.tsx rename src/pages/quality/{marketing => }/survey/components/SurveyResponsesList.tsx (77%) rename src/pages/quality/{marketing => }/survey/components/SurveysList.tsx (100%) create mode 100644 src/pages/quality/survey/index.tsx rename src/pages/quality/{marketing => }/survey/modals/QuestionCategoriesCreate.tsx (100%) create mode 100644 src/pages/quality/survey/modals/QuestionCategoriesManage.tsx rename src/pages/quality/{marketing => }/survey/modals/QuestionCategoriesUpdate.tsx (100%) rename src/pages/quality/{marketing => }/survey/modals/QuestionsCreate.tsx (100%) create mode 100644 src/pages/quality/survey/modals/QuestionsManage.tsx rename src/pages/quality/{marketing => }/survey/modals/QuestionsUpdate.tsx (100%) rename src/pages/quality/{marketing => }/survey/modals/SurveyReleasesCreate.tsx (100%) rename src/pages/quality/{marketing => }/survey/modals/SurveyReleasesUpdate.tsx (100%) create mode 100644 src/pages/quality/survey/modals/SurveyResponsesByRelease.tsx rename src/pages/quality/{marketing => }/survey/modals/SurveyResponsesShow.tsx (100%) rename src/pages/quality/{marketing => }/survey/modals/SurveysListShow.tsx (99%) create mode 100644 src/pages/quality/survey/modals/SurveysManage.tsx rename src/pages/quality/{marketing => }/survey/modals/SurveysSelectList.tsx (100%) rename src/pages/quality/{marketing => }/survey/pages/create_surveys.tsx (100%) rename src/pages/quality/{marketing => }/survey/pages/update_surveys.tsx (100%) delete mode 100644 src/pages/system/admins/index copy.tsx delete mode 100644 src/pages/system/admins/index.tsx delete mode 100644 src/pages/system/admins/modals/Create.tsx delete mode 100644 src/pages/system/admins/modals/Update.tsx delete mode 100644 src/pages/system/sys_permissions/index.tsx delete mode 100644 src/pages/system/sys_permissions/modals/Create.tsx delete mode 100644 src/pages/system/sys_permissions/modals/Update.tsx delete mode 100644 src/pages/system/sys_roles/components/AdminsList/index.tsx delete mode 100644 src/pages/system/sys_roles/components/AdminsList/modals/Create.tsx delete mode 100644 src/pages/system/sys_roles/components/AdminsList/modals/Update.tsx delete mode 100644 src/pages/system/sys_roles/components/EditPermissions/index.tsx delete mode 100644 src/pages/system/sys_roles/components/EmployeeRole/modals/Create.tsx create mode 100644 src/pages/system/sys_roles/components/PermissionTree.tsx create mode 100644 src/pages/system/sys_roles/components/RoleFormModal.tsx create mode 100644 src/pages/system/sys_roles/components/RoleTable.tsx delete mode 100644 src/pages/system/sys_roles/index1.tsx delete mode 100644 src/pages/system/sys_roles/index2.tsx delete mode 100644 src/pages/system/sys_roles/modals/Create.tsx delete mode 100644 src/pages/system/sys_roles/modals/EditPermissions copy.tsx delete mode 100644 src/pages/system/sys_roles/modals/Update.tsx rename src/pages/{visitor_applies => visitor}/index.tsx (70%) rename src/pages/{visitor_applies => visitor}/modals/Review.tsx (100%) create mode 100644 src/pages/work_order/managers/index.tsx create mode 100644 src/pages/work_order/managers/modals/ManagersCreate.tsx diff --git a/.claude/skills/list-page-actions/SKILL.md b/.claude/skills/list-page-actions/SKILL.md new file mode 100644 index 0000000..9ff777f --- /dev/null +++ b/.claude/skills/list-page-actions/SKILL.md @@ -0,0 +1,104 @@ +--- +name: list-page-actions +description: This skill standardizes list-page action buttons with permission control and automatic overflow folding. Use it when creating or refactoring ProTable-based list pages that need toolbar buttons or row-level action buttons filtered by `useCurrentPermissions`, especially when more than 3 buttons should collapse into a "更多" dropdown. +--- + +# List Page Actions + +## Overview + +This skill provides a reusable architecture for permission-controlled action buttons in ProTable list pages. It replaces scattered `toolBarRender` and `tableRender` boilerplate with two components: + +- `MyToolBarActions` — for toolbar buttons (export, add, etc.) +- `MyTableActions` — for row-level buttons with automatic "更多" dropdown when buttons exceed `maxVisible` + +Both components encapsulate `useCurrentPermissions` so list pages no longer need to manually call the hook for button rendering. + +## When to Use + +- Creating a new ProTable list page with permission-controlled buttons +- Refactoring an existing list page that manually calls `useCurrentPermissions` in `toolBarRender` or `tableRender` +- Adding automatic button folding ("更多" dropdown) to row-level actions +- Fixing toolbar buttons that disappear after wrapping them in a helper component + +## Core Components + +### MyToolBarActions + +Renders toolbar buttons filtered by current-page permissions. Returns a plain array so it can be placed directly inside `toolBarRender`. + +```tsx +toolBarRender={(action) => [ + , + add: , + }} + />, +]} +``` + +**Important:** `MyToolBarActions` returns an array of React nodes. Do not wrap the return value in a `<>...` Fragment, or ProTable may fail to render the buttons. + +### MyTableActions + +Renders row-level buttons filtered by permissions. Automatically moves overflow into an Ant Design `Dropdown` labeled "更多". + +```tsx +, + update: , + delete: {}} />, + }} + maxVisible={3} +/> +``` + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `actions` | `Record` | required | Permission-key to node map | +| `maxVisible` | `number` | `3` | Buttons shown directly; remainder folded | +| `path` | `string` | current path | Override route for permission lookup | + +## Workflow: Creating a New List Page + +1. Copy the template from `assets/list-page-template.tsx` into the new page directory. +2. Replace placeholder API paths (`Apis.Module.Resource`) with real ones. +3. Replace placeholder modals (`MyCreate`, `MyUpdate`) with real modal components. +4. Map backend permission keys to the `actions` object keys. +5. Adjust `maxVisible` based on design needs. + +## Workflow: Migrating an Existing List Page + +1. Remove local `toolBarRender` and `tableRender` functions. +2. Remove any manual `permissionsSpace` / `Others` / `Dropdown` boilerplate. +3. Import `MyToolBarActions` and `MyTableActions` from `@/common`. +4. Replace `toolBarRender` with `MyToolBarActions`. +5. Replace `MyColumns.Option` render body with `MyTableActions`. +6. See `references/migration-guide.md` for detailed before/after examples. + +## Special Case: Permission-Controlled Links in Columns + +If a column render includes a clickable link (e.g., `AssetInfo`) that should also respect permissions: + +```tsx +const getCurrentPermissions = useCurrentPermissions(); +const hasInfo = getCurrentPermissions({ info: true }).length > 0; + +{ + title: '名称', + dataIndex: 'name', + render: (_, item: any) => { + if (!hasInfo) return item?.name; + return ; + }, +} +``` + +## Resources + +- `references/component-api.md` — API docs for `MyTableActions` and `MyToolBarActions` +- `references/migration-guide.md` — Step-by-step migration instructions with code diffs +- `assets/list-page-template.tsx` — Complete copy-paste template for new list pages diff --git a/.claude/skills/list-page-actions/assets/list-page-template.tsx b/.claude/skills/list-page-actions/assets/list-page-template.tsx new file mode 100644 index 0000000..051ef2d --- /dev/null +++ b/.claude/skills/list-page-actions/assets/list-page-template.tsx @@ -0,0 +1,105 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { MyExport } from '@/components/MyExport'; +import { Apis } from '@/gen/Apis'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import MyCreate from './modals/MyCreate'; +import MyUpdate from './modals/MyUpdate'; + +export default function Index({ title = '页面标题' }) { + const navigate = useNavigate(); + const [params, setParams] = useState({}); + + return ( + + { + setParams(query); + return MyProTableProps.request( + query, + sort, + Apis.Module.Resource.List, + ); + }} + headerTitle="列表标题" + toolBarRender={(action) => [ + + ), + add: ( + + ), + }} + />, + ]} + columns={[ + MyColumns.ID(), + { + title: '名称', + dataIndex: 'name', + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + { + navigate(`/module/resource/show/${item.id}`); + }} + /> + ), + update: ( + + ), + delete: ( + + Apis.Module.Resource.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + }} + maxVisible={2} + /> + + ), + }), + ]} + /> + + ); +} diff --git a/.claude/skills/list-page-actions/references/component-api.md b/.claude/skills/list-page-actions/references/component-api.md new file mode 100644 index 0000000..d7ea111 --- /dev/null +++ b/.claude/skills/list-page-actions/references/component-api.md @@ -0,0 +1,67 @@ +# Component API Reference + +## MyTableActions + +Renders row-level action buttons with permission filtering and automatic folding into a "更多" dropdown. + +```tsx +import { MyTableActions } from '@/common'; + +, + update: , + delete: {}} />, + }} + maxVisible={3} +/> +``` + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `actions` | `Record` | required | Map of permission keys to React nodes. | +| `maxVisible` | `number` | `3` | Maximum buttons shown directly; overflow goes to dropdown. | +| `path` | `string` | `location.pathname` | Optional route path for permission lookup. | + +### Behavior + +- Calls `useCurrentPermissions` internally. +- Filters `actions` by the current page's submenu permissions. +- If no permissions match, returns `null`. +- If visible count ≤ `maxVisible`, renders in a ``. +- If visible count > `maxVisible`, renders `maxVisible` buttons + a "更多" dropdown with the rest. + +--- + +## MyToolBarActions + +Renders toolbar buttons (e.g., export, add) with permission filtering. Intended for `ProTable.toolBarRender`. + +```tsx +import { MyToolBarActions } from '@/common'; + +toolBarRender={(action) => [ + , + add: , + }} + />, +]} +``` + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `actions` | `Record` | required | Map of permission keys to React nodes. | +| `path` | `string` | `location.pathname` | Optional route path for permission lookup. | + +### Behavior + +- Calls `useCurrentPermissions` internally. +- Returns an array of matched nodes (no wrapping element). +- Safe to place directly inside `toolBarRender` arrays. diff --git a/.claude/skills/list-page-actions/references/migration-guide.md b/.claude/skills/list-page-actions/references/migration-guide.md new file mode 100644 index 0000000..12e6cc9 --- /dev/null +++ b/.claude/skills/list-page-actions/references/migration-guide.md @@ -0,0 +1,97 @@ +# Migration Guide: Old List Pages → Unified Action Pattern + +## Before (Manual Pattern) + +```tsx +const getCurrentPermissions = useCurrentPermissions(); + +let toolBarRender = (action: any) => { + return getCurrentPermissions({ + export: , + }); +}; + +let tableRender = (item: any, action: any) => { + let permissions = getCurrentPermissions({ + view: , + update: , + }); + let permissionsSpace = getCurrentPermissions({ + delete: { key: '1', label: }, + }); + let Others = ( + + + + ); + return [...permissions, ...[Others]]; +}; + +toolBarRender={(action) => [toolBarRender(action)]} +// ... +MyColumns.Option({ + render: (_, item, index, action) => ( + + <>{tableRender(item, action)} + + ), +}) +``` + +## After (Unified Pattern) + +```tsx +import { MyTableActions, MyToolBarActions } from '@/common'; + +toolBarRender={(action) => [ + , + }} + />, +]} + +MyColumns.Option({ + render: (_, item, index, action) => ( + + , + update: , + delete: , + }} + maxVisible={2} + /> + + ), +}) +``` + +## Steps + +1. Remove `useCurrentPermissions` import if it is no longer needed elsewhere. +2. Remove `toolBarRender` local function; replace `toolBarRender` prop with `MyToolBarActions`. +3. Remove `tableRender` local function and any `permissionsSpace` / `Others` / `Dropdown` boilerplate. +4. Replace `MyColumns.Option` render body with `MyTableActions`. +5. Tune `maxVisible` based on design needs (default `3`). + +## Special Case: Link in Column Render + +If a column (e.g., "名称") renders a clickable `AssetInfo` link that should also be permission-controlled: + +```tsx +const getCurrentPermissions = useCurrentPermissions(); +const hasInfo = getCurrentPermissions({ info: true }).length > 0; + +{ + title: '名称', + dataIndex: 'name', + render: (_, item: any) => { + if (!hasInfo) return item?.name; + return ; + }, +} +``` + +Note: `useCurrentPermissions` may still be imported for this use case. diff --git a/gencode.json b/gencode.json index fafe60a..5a779fb 100644 --- a/gencode.json +++ b/gencode.json @@ -1,5 +1,6 @@ { "url": "http://10.39.13.78:8002/api/docs/openapi", + "module": "Company", "outPath": "./src/gen/", "apis": { diff --git a/src/common/components/MyTableActions.tsx b/src/common/components/MyTableActions.tsx new file mode 100644 index 0000000..3b045e3 --- /dev/null +++ b/src/common/components/MyTableActions.tsx @@ -0,0 +1,48 @@ +import { MoreOutlined } from '@ant-design/icons'; +import { Button, Dropdown, Space } from 'antd'; +import { ReactNode } from 'react'; +import { useCurrentPermissions } from './GetRPermission'; + +interface MyTableActionsProps { + actions: Record; + maxVisible?: number; + path?: string; +} + +export const MyTableActions = ({ + actions, + maxVisible = 3, + path, +}: MyTableActionsProps) => { + const getCurrentPermissions = useCurrentPermissions(); + const permittedActions = getCurrentPermissions(actions, path); + + if (permittedActions.length === 0) { + return null; + } + + if (permittedActions.length <= maxVisible) { + return {permittedActions}; + } + + const visible = permittedActions.slice(0, maxVisible); + const overflow = permittedActions.slice(maxVisible); + + return ( + + {visible} + ({ + key: index.toString(), + label: node, + })), + }} + > + + + + ); +}; diff --git a/src/common/components/MyToolBarActions.tsx b/src/common/components/MyToolBarActions.tsx new file mode 100644 index 0000000..1e49d03 --- /dev/null +++ b/src/common/components/MyToolBarActions.tsx @@ -0,0 +1,12 @@ +import { ReactNode } from 'react'; +import { useCurrentPermissions } from './GetRPermission'; + +interface MyToolBarActionsProps { + actions: Record; + path?: string; +} + +export const MyToolBarActions = ({ actions, path }: MyToolBarActionsProps) => { + const getCurrentPermissions = useCurrentPermissions(); + return getCurrentPermissions(actions, path); +}; diff --git a/src/common/components/schema/MyColumns.tsx b/src/common/components/schema/MyColumns.tsx index ef30e5b..494c1c1 100644 --- a/src/common/components/schema/MyColumns.tsx +++ b/src/common/components/schema/MyColumns.tsx @@ -253,11 +253,11 @@ export const MyColumns = { if (!item) return <>-; // return {item.text}; //颜色底,白字 - return {item.text}; + // return {item.text}; //灰底,颜色字 // return {item.text}; //灰底,黑字 - // return {item.text}; + return {item.text}; //修改列表的标签样式 }, diff --git a/src/common/index.tsx b/src/common/index.tsx index befee3f..ea88c8e 100644 --- a/src/common/index.tsx +++ b/src/common/index.tsx @@ -23,6 +23,8 @@ export * from './components/schema/MyFormItems'; export * from './components/MyButtons'; export * from './components/MyIcons'; export * from './components/MyStatistics'; +export * from './components/MyTableActions'; +export * from './components/MyToolBarActions'; // libs export * from './libs/umi/layoutConfig'; diff --git a/src/common/typings.d.ts b/src/common/typings.d.ts index ba74425..eb12ff2 100644 --- a/src/common/typings.d.ts +++ b/src/common/typings.d.ts @@ -56,10 +56,10 @@ type MyProFormFieldProps = { export type MyBetaModalFormProps = { title?: string; - // action: ActionType | undefined; reload?: () => void; item?: Record; extra?: React.ReactNode; + trigger?: React.ReactNode; onOpenChange?: (open: boolean) => void; open?: boolean; }; diff --git a/src/components/MyExport.tsx b/src/components/MyExport.tsx index d9363fe..fa7177a 100644 --- a/src/components/MyExport.tsx +++ b/src/components/MyExport.tsx @@ -1,45 +1,17 @@ -import { Button, Dropdown, MenuProps } from 'antd'; +import { Button } from 'antd'; export const MyExport = (props: any) => { - const items: MenuProps['items'] = [ - { - key: '1', - label: '当前页(含查询条件)', - onClick: () => - props?.keyParams - ? props?.download?.({ download_type: 'page', ...props?.item }) - : props?.download?.Export?.({ - download_type: 'page', - ...props?.item, - }), - }, - { - key: '2', - label: '所有页(含查询条件)', - onClick: () => - props?.keyParams - ? props?.download?.({ download_type: 'query', ...props?.item }) - : props?.download?.Export?.({ - download_type: 'query', - ...props?.item, - }), - }, - { - key: '3', - label: '所有记录', - onClick: () => - props?.keyParams - ? props?.download?.({ download_type: 'all', ...props?.item }) - : props?.download?.Export?.({ - download_type: 'all', - ...props?.item, - }), - }, - ]; + const handleExport = () => + props?.keyParams + ? props?.download?.({ download_type: 'query', ...props?.item }) + : props?.download?.Export?.({ + download_type: 'query', + ...props?.item, + }); return ( - - - + ); }; diff --git a/src/components/Select.tsx b/src/components/Select.tsx index c402a59..15128c8 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -1167,4 +1167,70 @@ export const Selects = { }, }; }, + + //获取巡逻位置 + PatrolLocationsSelect(props?: PropsType): ReturnType { + const { + title = '选择巡逻位置', + key = 'patrol_location', + required = false, + hideInTable = true, + ...rest + } = props ?? {}; + + return { + title: title, + key: key, + valueType: 'select', + hideInTable: hideInTable, + formItemProps: { ...(required ? rulesHelper.number : {}) }, + request: async (params) => { + let res = await Apis.Patrol.PatrolLocations.Select({ + ...params, + name: params?.keyWords || undefined, + }); + return res?.data; + }, + ...rest, + fieldProps: { + showSearch: true, + fieldNames: { + label: 'name', + value: 'id', + }, + ...rest?.fieldProps, + }, + }; + }, + + //获取巡逻路线 + PatrolRoutesSelect(props?: PropsType): ReturnType { + const { + title = '选择巡逻路线', + key = 'patrol_routes_id', + required = false, + hideInTable = true, + ...rest + } = props ?? {}; + + return { + title: title, + key: key, + valueType: 'select', + hideInTable: hideInTable, + formItemProps: { ...(required ? rulesHelper.number : {}) }, + request: async (params) => { + let res = await Apis.Patrol.PatrolRoutes.Select({ + ...params, + name: params?.keyWords || undefined, + }); + return res?.data; + }, + ...rest, + fieldProps: { + showSearch: true, + ...rest?.fieldProps, + }, + }; + }, }; diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 8897ba1..9684a94 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -143,6 +143,10 @@ declare namespace ApiTypes { "type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum] "asset_projects_id"?: number; // 所属项目id }; + type ReplaceApprover = { + "from_employee_id": number; // 原审批人ID + "to_employee_id": number; // 新审批人ID + }; } } namespace Archive { @@ -947,6 +951,9 @@ declare namespace ApiTypes { "late_start_date"?: Date; // 滞纳金起算日期 "collected_late_fee_days"?: number; // 已收滞纳金天数 "remark"?: string; // 备注 + "approval_templates_id": number; // 审批模板id + "approval_remark"?: string; // 审批备注 + "node_approvers"?: string[]; // 各节点审批人员列表 }; type Show = { "id": number; // id @@ -957,6 +964,12 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Restore = { + "id": number; // id + }; + type Import = { + "upload_file": mimes:xlsx,xls; // 上传文件 + }; type Export = { "asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses] "full_name"?: string; // 模糊搜索:房屋名称 @@ -1093,6 +1106,12 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; type Select = { "organizations_id"?: number; // 所属组织id,[ref:organizations] "keywords"?: string; // 关键词 @@ -2722,6 +2741,7 @@ declare namespace ApiTypes { type List = { "id"?: number; // id 任务id "charge_standard_name"?: string; // 模糊搜索:收费标准名称 + "house_charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards] "asset_projects_id"?: number; // 资产项目id,[ref:asset_projects] "status"?: string; // 任务状态,[enum:HouseChargeTasksStatusEnum] "type"?: string; // 类型,[enum:HouseChargeTasksTypeEnum] @@ -3187,6 +3207,129 @@ declare namespace ApiTypes { }; } } + namespace Patrol { + namespace PatrolLocations { + type List = { + "name"?: string; // 模糊搜索:名称 + "code"?: string; // 位置编码 + "asset_projects_id"?: number; // 项目id + "project_name"?: string; // 项目名称 + }; + type Store = { + "asset_projects_id": number; // 项目id + "name": string; // 名称 + "is_enabled"?: number; // 是否启用 + "remark"?: string; // 备注 + }; + type Update = { + "id": number; // id + "asset_projects_id": number; // 项目id + "name": string; // 名称 + "is_enabled"?: number; // 是否启用 + "remark"?: string; // 备注 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + type Select = { + "asset_projects_id"?: number; // 项目id + "name"?: string; // 模糊搜索:名称 + }; + } + namespace PatrolRoutes { + type List = { + "name"?: string; // 模糊搜索:名称 + "asset_projects_id"?: number; // 项目id + "project_name"?: string; // 项目名称 + "is_enabled"?: number; // 是否启用 + "generation_method"?: string; // 生成方式 + }; + type Store = { + "asset_projects_id": number; // 项目id + "name": string; // 名称 + "generation_method": string; // 生成方式 + "date"?: string[]; // 生成日期 + "is_enabled"?: number; // 是否启用 + "task_start_time": date_format:H:i; // 任务开始时间 + "task_end_time": date_format:H:i; // 任务结束时间 + "clock_start_time": date_format:H:i; // 可打卡开始时间 + "clock_end_time": date_format:H:i; // 可打卡结束时间 + "remark"?: string; // 备注 + "patrol_location": string[]; // 巡逻地点 + }; + type Update = { + "id": number; // id + "asset_projects_id": number; // 项目id + "name": string; // 名称 + "generation_method": string; // 生成方式 + "date"?: string[]; // 生成日期 + "is_enabled"?: number; // 是否启用 + "task_start_time": date_format:H:i; // 任务开始时间 + "task_end_time": date_format:H:i; // 任务结束时间 + "clock_start_time": date_format:H:i; // 可打卡开始时间 + "clock_end_time": date_format:H:i; // 可打卡结束时间 + "remark"?: string; // 备注 + "patrol_location": string[]; // 巡逻地点 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + type Select = { + "name"?: string; // 模糊搜索:名称 + "asset_projects_id"?: number; // 项目id + "project_name"?: string; // 项目名称 + "is_enabled"?: number; // 是否启用 + "generation_method"?: string; // 生成方式 + }; + } + namespace PatrolTasks { + type List = { + "name"?: string; // 模糊搜索:名称 + "asset_projects_id"?: number; // 项目id + "project_name"?: string; // 模糊搜索:项目名称 + "patrol_route_name"?: string; // 模糊搜索:巡逻路线名称 + "date_time"?: string[]; // 时间范围[start_time, end_time] + "create_type"?: string; // 创建方式 + }; + type Store = { + "patrol_routes_id": number; // 巡逻路线id + "start_time"?: Date; // 任务开始时间 + "end_time"?: Date; // 任务结束时间 + "level"?: string; // 优先级 + "remark"?: string; // 备注 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } + } namespace Permission { namespace Roles { type List = { @@ -3398,6 +3541,7 @@ declare namespace ApiTypes { "audit_remark"?: string; // 驳回理由 "is_deposit"?: number; // 是否有保证金 "deposit_amount"?: number; // 保证金金额 + "receipt_accounts_id"?: number; // 收款账户 }; type UpdateDeposit = { "id": number; // 装修申请id @@ -3415,6 +3559,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Bills = { + "id": number; // 装修申请id + }; } namespace RenovationInspectionRules { type List = { diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index a8c6304..afdc650 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -96,6 +96,9 @@ export const Apis = { Select(data?: ApiTypes.Approval.ApprovalTemplates.Select): Promise { return request('company/approval/approval_templates/select', { data }); }, + ReplaceApprover(data: ApiTypes.Approval.ApprovalTemplates.ReplaceApprover): Promise { + return request('company/approval/approval_templates/replace_approver', { data }); + }, }, }, Archive: { @@ -237,7 +240,7 @@ export const Apis = { return request('company/asset/asset_houses/import', { data }); }, Export(data: ApiTypes.Asset.AssetHouses.Export): Promise { - return request('company/asset/asset_houses/export', { responseType: 'blob',data }); + return request('company/asset/asset_houses/export', { data }); }, }, AssetParkingPlaces: { @@ -494,6 +497,15 @@ export const Apis = { Delete(data: ApiTypes.Bill.HouseBills.Delete): Promise { return request('company/bill/house_bills/delete', { data }); }, + Restore(data: ApiTypes.Bill.HouseBills.Restore): Promise { + return request('company/bill/house_bills/restore', { data }); + }, + Import(data: ApiTypes.Bill.HouseBills.Import): Promise { + return request('company/bill/house_bills/import', { data }); + }, + DownloadTemplate(): Promise { + return request('company/bill/house_bills/download_template', {}); + }, Export(data: ApiTypes.Bill.HouseBills.Export): Promise { return request('company/bill/house_bills/export', { data }); }, @@ -591,6 +603,12 @@ export const Apis = { Delete(data: ApiTypes.Company.CompanyEmployees.Delete): Promise { return request('company/company/company_employees/delete', { data }); }, + SoftDelete(data: ApiTypes.Company.CompanyEmployees.SoftDelete): Promise { + return request('company/company/company_employees/soft_delete', { data }); + }, + Restore(data: ApiTypes.Company.CompanyEmployees.Restore): Promise { + return request('company/company/company_employees/restore', { data }); + }, Select(data?: ApiTypes.Company.CompanyEmployees.Select): Promise { return request('company/company/company_employees/select', { data }); }, @@ -1761,6 +1779,80 @@ export const Apis = { }, }, }, + Patrol: { + PatrolLocations: { + List(data?: ApiTypes.Patrol.PatrolLocations.List): Promise { + return request('company/patrol/patrol_locations/list', { data }); + }, + Store(data: ApiTypes.Patrol.PatrolLocations.Store): Promise { + return request('company/patrol/patrol_locations/store', { data }); + }, + Update(data: ApiTypes.Patrol.PatrolLocations.Update): Promise { + return request('company/patrol/patrol_locations/update', { data }); + }, + Show(data: ApiTypes.Patrol.PatrolLocations.Show): Promise { + return request('company/patrol/patrol_locations/show', { data }); + }, + SoftDelete(data: ApiTypes.Patrol.PatrolLocations.SoftDelete): Promise { + return request('company/patrol/patrol_locations/soft_delete', { data }); + }, + Restore(data: ApiTypes.Patrol.PatrolLocations.Restore): Promise { + return request('company/patrol/patrol_locations/restore', { data }); + }, + Delete(data: ApiTypes.Patrol.PatrolLocations.Delete): Promise { + return request('company/patrol/patrol_locations/delete', { data }); + }, + Select(data?: ApiTypes.Patrol.PatrolLocations.Select): Promise { + return request('company/patrol/patrol_locations/select', { data }); + }, + }, + PatrolRoutes: { + List(data?: ApiTypes.Patrol.PatrolRoutes.List): Promise { + return request('company/patrol/patrol_routes/list', { data }); + }, + Store(data: ApiTypes.Patrol.PatrolRoutes.Store): Promise { + return request('company/patrol/patrol_routes/store', { data }); + }, + Update(data: ApiTypes.Patrol.PatrolRoutes.Update): Promise { + return request('company/patrol/patrol_routes/update', { data }); + }, + Show(data: ApiTypes.Patrol.PatrolRoutes.Show): Promise { + return request('company/patrol/patrol_routes/show', { data }); + }, + SoftDelete(data: ApiTypes.Patrol.PatrolRoutes.SoftDelete): Promise { + return request('company/patrol/patrol_routes/soft_delete', { data }); + }, + Restore(data: ApiTypes.Patrol.PatrolRoutes.Restore): Promise { + return request('company/patrol/patrol_routes/restore', { data }); + }, + Delete(data: ApiTypes.Patrol.PatrolRoutes.Delete): Promise { + return request('company/patrol/patrol_routes/delete', { data }); + }, + Select(data?: ApiTypes.Patrol.PatrolRoutes.Select): Promise { + return request('company/patrol/patrol_routes/select', { data }); + }, + }, + PatrolTasks: { + List(data?: ApiTypes.Patrol.PatrolTasks.List): Promise { + return request('company/patrol/patrol_tasks/list', { data }); + }, + Store(data: ApiTypes.Patrol.PatrolTasks.Store): Promise { + return request('company/patrol/patrol_tasks/store', { data }); + }, + Show(data: ApiTypes.Patrol.PatrolTasks.Show): Promise { + return request('company/patrol/patrol_tasks/show', { data }); + }, + SoftDelete(data: ApiTypes.Patrol.PatrolTasks.SoftDelete): Promise { + return request('company/patrol/patrol_tasks/soft_delete', { data }); + }, + Restore(data: ApiTypes.Patrol.PatrolTasks.Restore): Promise { + return request('company/patrol/patrol_tasks/restore', { data }); + }, + Delete(data: ApiTypes.Patrol.PatrolTasks.Delete): Promise { + return request('company/patrol/patrol_tasks/delete', { data }); + }, + }, + }, Permission: { Roles: { List(data?: ApiTypes.Permission.Roles.List): Promise { @@ -1856,6 +1948,9 @@ export const Apis = { Delete(data: ApiTypes.Renovation.RenovationApplies.Delete): Promise { return request('company/renovation/renovation_applies/delete', { data }); }, + Bills(data: ApiTypes.Renovation.RenovationApplies.Bills): Promise { + return request('company/renovation/renovation_applies/bills', { data }); + }, }, RenovationInspectionRules: { List(data?: ApiTypes.Renovation.RenovationInspectionRules.List): Promise { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index a6f09f5..a03a32f 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -1,1921 +1,1429 @@ // ActivitiesPublishStatusEnum -export const ActivitiesPublishStatusEnum = { - Unpublished: { text: '未发布', color: '#9e9e9e', value: 'Unpublished' }, - Published: { text: '已发布', color: '#00c853', value: 'Published' }, - Unlisted: { text: '已下架', color: '#d32f2f', value: 'Unlisted' }, +export const ActivitiesPublishStatusEnum= { + 'Unpublished': {"text":"未发布","color":"#9e9e9e","value":"Unpublished"}, + 'Published': {"text":"已发布","color":"#00c853","value":"Published"}, + 'Unlisted': {"text":"已下架","color":"#d32f2f","value":"Unlisted"}, }; // ActivitiesPublishTypeEnum -export const ActivitiesPublishTypeEnum = { - Manual: { text: '手动', color: '#4caf50', value: 'Manual' }, - Schedule: { text: '定时', color: '#2196f3', value: 'Schedule' }, +export const ActivitiesPublishTypeEnum= { + 'Manual': {"text":"手动","color":"#4caf50","value":"Manual"}, + 'Schedule': {"text":"定时","color":"#2196f3","value":"Schedule"}, }; // ActivitiesStatusEnum -export const ActivitiesStatusEnum = { - NotStarted: { text: '未开始', color: '#9e9e9e', value: 'NotStarted' }, - InProgress: { text: '进行中', color: '#00c853', value: 'InProgress' }, - Finished: { text: '已结束', color: '#d32f2f', value: 'Finished' }, +export const ActivitiesStatusEnum= { + 'NotStarted': {"text":"未开始","color":"#9e9e9e","value":"NotStarted"}, + 'InProgress': {"text":"进行中","color":"#00c853","value":"InProgress"}, + 'Finished': {"text":"已结束","color":"#d32f2f","value":"Finished"}, }; // ActivityEnrollsStatusEnum -export const ActivityEnrollsStatusEnum = { - PendingReview: { text: '待审核', color: '#2196f3', value: 'PendingReview' }, - Success: { text: '成功', color: '#00c853', value: 'Success' }, - Failed: { text: '失败', color: '#d32f2f', value: 'Failed' }, - Cancelled: { text: '取消', color: '#ff9800', value: 'Cancelled' }, +export const ActivityEnrollsStatusEnum= { + 'PendingReview': {"text":"待审核","color":"#2196f3","value":"PendingReview"}, + 'Success': {"text":"成功","color":"#00c853","value":"Success"}, + 'Failed': {"text":"失败","color":"#d32f2f","value":"Failed"}, + 'Cancelled': {"text":"取消","color":"#ff9800","value":"Cancelled"}, }; // API凭证状态枚举 -export const ApiCredentialStatusEnum = { - Active: { text: '启用', color: '#28A745', value: 'Active' }, - Inactive: { text: '禁用', color: '#6C757D', value: 'Inactive' }, - Expired: { text: '已过期', color: '#DC3545', value: 'Expired' }, +export const ApiCredentialStatusEnum= { + 'Active': {"text":"启用","color":"#28A745","value":"Active"}, + 'Inactive': {"text":"禁用","color":"#6C757D","value":"Inactive"}, + 'Expired': {"text":"已过期","color":"#DC3545","value":"Expired"}, }; // 审批实例状态枚举 -export const ApprovalInstancesStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, - Cancelled: { text: '已取消', color: '#9e9e9e', value: 'Cancelled' }, +export const ApprovalInstancesStatusEnum= { + 'Pending': {"text":"待审批","color":"#ff9800","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#4caf50","value":"Approved"}, + 'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"}, + 'Cancelled': {"text":"已取消","color":"#9e9e9e","value":"Cancelled"}, }; // 审批记录状态枚举 -export const ApprovalRecordsStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Approved: { text: '同意', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '拒绝', color: '#f44336', value: 'Rejected' }, - Transferred: { text: '转交', color: '#9c27b0', value: 'Transferred' }, +export const ApprovalRecordsStatusEnum= { + 'Pending': {"text":"待审批","color":"#ff9800","value":"Pending"}, + 'Approved': {"text":"同意","color":"#4caf50","value":"Approved"}, + 'Rejected': {"text":"拒绝","color":"#f44336","value":"Rejected"}, + 'Transferred': {"text":"转交","color":"#9c27b0","value":"Transferred"}, }; // 审批方式枚举 -export const ApprovalTemplateNodesApproveTypeEnum = { - And: { text: '会签', color: '#4caf50', value: 'And' }, - Or: { text: '或签', color: '#ff9800', value: 'Or' }, +export const ApprovalTemplateNodesApproveTypeEnum= { + 'And': {"text":"会签","color":"#4caf50","value":"And"}, + 'Or': {"text":"或签","color":"#ff9800","value":"Or"}, }; // 审批节点类型枚举 -export const ApprovalTemplateNodesNodeTypeEnum = { - Approver: { text: '审批人', color: '#2196f3', value: 'Approver' }, - CC: { text: '抄送人', color: '#9e9e9e', value: 'CC' }, +export const ApprovalTemplateNodesNodeTypeEnum= { + 'Approver': {"text":"审批人","color":"#2196f3","value":"Approver"}, + 'CC': {"text":"抄送人","color":"#9e9e9e","value":"CC"}, }; // 审批业务类型枚举 -export const ApprovalTemplatesTypeEnum = { - Contract: { text: '合同', color: '#2196f3', value: 'Contract' }, - Finance: { text: '财务', color: '#4caf50', value: 'Finance' }, - Refund: { text: '退款', color: '#f44336', value: 'Refund' }, - ContractTermination: { - text: '合同终止', - color: '#ff9800', - value: 'ContractTermination', - }, - ContractBorrow: { - text: '合同借用', - color: '#9c27b0', - value: 'ContractBorrow', - }, - ContractPayment: { - text: '合同支付', - color: '#00bcd4', - value: 'ContractPayment', - }, - OtherContractSeal: { - text: '其它合同用印', - color: '#795548', - value: 'OtherContractSeal', - }, +export const ApprovalTemplatesTypeEnum= { + 'Contract': {"text":"合同","color":"#2196f3","value":"Contract"}, + 'Finance': {"text":"财务","color":"#4caf50","value":"Finance"}, + 'Refund': {"text":"退款","color":"#f44336","value":"Refund"}, + 'ContractTermination': {"text":"合同终止","color":"#ff9800","value":"ContractTermination"}, + 'ContractBorrow': {"text":"合同借用","color":"#9c27b0","value":"ContractBorrow"}, + 'ContractPayment': {"text":"合同支付","color":"#00bcd4","value":"ContractPayment"}, + 'OtherContractSeal': {"text":"其它合同用印","color":"#795548","value":"OtherContractSeal"}, + 'HouseBillUpdate': {"text":"物业账单修改","color":"#607d8b","value":"HouseBillUpdate"}, }; // 车位产权类型 -export const AssetCarPortsPropertyTypeEnum = { - Ownership: { text: '产权车位', color: '#1e90ff', value: 'Ownership' }, - CivilDefense: { text: '人防车位', color: '#32cd32', value: 'CivilDefense' }, - Public: { text: '公共车位', color: '#ff8c00', value: 'Public' }, - Temporary: { text: '临时车位', color: '#ba55d3', value: 'Temporary' }, - Other: { text: '其他', color: '#a9a9a9', value: 'Other' }, +export const AssetCarPortsPropertyTypeEnum= { + 'Ownership': {"text":"产权车位","color":"#1e90ff","value":"Ownership"}, + 'CivilDefense': {"text":"人防车位","color":"#32cd32","value":"CivilDefense"}, + 'Public': {"text":"公共车位","color":"#ff8c00","value":"Public"}, + 'Temporary': {"text":"临时车位","color":"#ba55d3","value":"Temporary"}, + 'Other': {"text":"其他","color":"#a9a9a9","value":"Other"}, }; // 车位状态 -export const AssetCarPortsStatusEnum = { - Unsold: { text: '未售', color: '#6b7280', value: 'Unsold' }, - Sold: { text: '已售', color: '#10b981', value: 'Sold' }, - Rented: { text: '已租', color: '#3b82f6', value: 'Rented' }, - Unrented: { text: '未租', color: '#f59e0b', value: 'Unrented' }, - Other: { text: '其他', color: '#9ca3af', value: 'Other' }, +export const AssetCarPortsStatusEnum= { + 'Unsold': {"text":"未售","color":"#6b7280","value":"Unsold"}, + 'Sold': {"text":"已售","color":"#10b981","value":"Sold"}, + 'Rented': {"text":"已租","color":"#3b82f6","value":"Rented"}, + 'Unrented': {"text":"未租","color":"#f59e0b","value":"Unrented"}, + 'Other': {"text":"其他","color":"#9ca3af","value":"Other"}, }; // 车位类型 -export const AssetCarPortsTypeEnum = { - Standard: { text: '标准车位', color: '#1e90ff', value: 'Standard' }, - Mini: { text: '微型车位', color: '#32cd32', value: 'Mini' }, - Accessible: { text: '无障碍车位', color: '#ff8c00', value: 'Accessible' }, - Tandem: { text: '子母车位', color: '#ba55d3', value: 'Tandem' }, - Mechanical: { text: '机械车位', color: '#20b2aa', value: 'Mechanical' }, - Other: { text: '其他', color: '#a9a9a9', value: 'Other' }, +export const AssetCarPortsTypeEnum= { + 'Standard': {"text":"标准车位","color":"#1e90ff","value":"Standard"}, + 'Mini': {"text":"微型车位","color":"#32cd32","value":"Mini"}, + 'Accessible': {"text":"无障碍车位","color":"#ff8c00","value":"Accessible"}, + 'Tandem': {"text":"子母车位","color":"#ba55d3","value":"Tandem"}, + 'Mechanical': {"text":"机械车位","color":"#20b2aa","value":"Mechanical"}, + 'Other': {"text":"其他","color":"#a9a9a9","value":"Other"}, }; // AssetHousesOrientationEnum -export const AssetHousesOrientationEnum = { - East: { text: '东', color: '#007bff', value: 'East' }, - South: { text: '南', color: '#28a745', value: 'South' }, - West: { text: '西', color: '#ffc107', value: 'West' }, - North: { text: '北', color: '#dc3545', value: 'North' }, - Southeast: { text: '东南', color: '#20c997', value: 'Southeast' }, - Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' }, - Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' }, - Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' }, - EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' }, - SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' }, +export const AssetHousesOrientationEnum= { + 'East': {"text":"东","color":"#007bff","value":"East"}, + 'South': {"text":"南","color":"#28a745","value":"South"}, + 'West': {"text":"西","color":"#ffc107","value":"West"}, + 'North': {"text":"北","color":"#dc3545","value":"North"}, + 'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"}, + 'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"}, + 'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"}, + 'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"}, + 'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"}, + 'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"}, }; // AssetHousesOwnershipTypeEnum -export const AssetHousesOwnershipTypeEnum = { - CommodityHousing: { - text: '商品房', - color: '#007bff', - value: 'CommodityHousing', - }, - FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' }, - MilitaryHousing: { - text: '军产房', - color: '#17a2b8', - value: 'MilitaryHousing', - }, - AffordableHousing: { - text: '保障房', - color: '#ffc107', - value: 'AffordableHousing', - }, - RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' }, - CommercialOffice: { - text: '商业写字楼', - color: '#fd7e14', - value: 'CommercialOffice', - }, - CommercialComplex: { - text: '商业综合体', - color: '#dc3545', - value: 'CommercialComplex', - }, - ResettlementHousing: { - text: '回迁房', - color: '#20c997', - value: 'ResettlementHousing', - }, +export const AssetHousesOwnershipTypeEnum= { + 'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"}, + 'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"}, + 'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"}, + 'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"}, + 'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"}, + 'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"}, + 'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"}, + 'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"}, }; // AssetHousesPropertyOwnershipEnum -export const AssetHousesPropertyOwnershipEnum = { - Individual: { text: '个人', color: '#2db7f5', value: 'Individual' }, - Enterprise: { text: '企业', color: '#87d068', value: 'Enterprise' }, - Developer: { text: '开发商', color: '#fa8c16', value: 'Developer' }, - Government: { text: '政府', color: '#f5222d', value: 'Government' }, +export const AssetHousesPropertyOwnershipEnum= { + 'Individual': {"text":"个人","color":"#2db7f5","value":"Individual"}, + 'Enterprise': {"text":"企业","color":"#87d068","value":"Enterprise"}, + 'Developer': {"text":"开发商","color":"#fa8c16","value":"Developer"}, + 'Government': {"text":"政府","color":"#f5222d","value":"Government"}, }; // AssetHousesStatusEnum -export const AssetHousesStatusEnum = { - Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' }, - SoldNotDelivered: { - text: '已售未交房', - color: '#ffc107', - value: 'SoldNotDelivered', - }, - SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, - Rented: { text: '出租', color: '#007bff', value: 'Rented' }, - Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, +export const AssetHousesStatusEnum= { + 'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"}, + 'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"}, + 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, + 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, + 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, }; // AssetHousesUsageEnum -export const AssetHousesUsageEnum = { - Residence: { text: '住宅', color: '#007bff', value: 'Residence' }, - Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' }, - Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' }, - Shop: { text: '商铺', color: '#ffc107', value: 'Shop' }, - ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' }, - Office: { text: '写字楼', color: '#6610f2', value: 'Office' }, - Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' }, - PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' }, +export const AssetHousesUsageEnum= { + 'Residence': {"text":"住宅","color":"#007bff","value":"Residence"}, + 'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"}, + 'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"}, + 'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"}, + 'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"}, + 'Office': {"text":"写字楼","color":"#6610f2","value":"Office"}, + 'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"}, + 'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"}, }; // 车场收费类型 -export const AssetParkingPlacesChargeTypeEnum = { - Free: { text: '免费', color: '#32cd32', value: 'Free' }, - TemporaryCharge: { - text: '临停收费', - color: '#1e90ff', - value: 'TemporaryCharge', - }, - MonthlyCharge: { text: '月卡收费', color: '#ff8c00', value: 'MonthlyCharge' }, - MixedCharge: { text: '混合收费', color: '#ba55d3', value: 'MixedCharge' }, +export const AssetParkingPlacesChargeTypeEnum= { + 'Free': {"text":"免费","color":"#32cd32","value":"Free"}, + 'TemporaryCharge': {"text":"临停收费","color":"#1e90ff","value":"TemporaryCharge"}, + 'MonthlyCharge': {"text":"月卡收费","color":"#ff8c00","value":"MonthlyCharge"}, + 'MixedCharge': {"text":"混合收费","color":"#ba55d3","value":"MixedCharge"}, }; // 车场位置类型 -export const AssetParkingPlacesLocationTypeEnum = { - GroundParking: { text: '地面车场', color: '#ffa500', value: 'GroundParking' }, - UndergroundParking: { - text: '地下车场', - color: '#4682b4', - value: 'UndergroundParking', - }, +export const AssetParkingPlacesLocationTypeEnum= { + 'GroundParking': {"text":"地面车场","color":"#ffa500","value":"GroundParking"}, + 'UndergroundParking': {"text":"地下车场","color":"#4682b4","value":"UndergroundParking"}, }; // 车场产权类型 -export const AssetParkingPlacesPropertyTypeEnum = { - DispersedOwnership: { - text: '分散产权', - color: '#ff7f50', - value: 'DispersedOwnership', - }, - SingleOwnership: { - text: '单一产权', - color: '#1e90ff', - value: 'SingleOwnership', - }, - SharedOwnership: { - text: '共有产权', - color: '#32cd32', - value: 'SharedOwnership', - }, +export const AssetParkingPlacesPropertyTypeEnum= { + 'DispersedOwnership': {"text":"分散产权","color":"#ff7f50","value":"DispersedOwnership"}, + 'SingleOwnership': {"text":"单一产权","color":"#1e90ff","value":"SingleOwnership"}, + 'SharedOwnership': {"text":"共有产权","color":"#32cd32","value":"SharedOwnership"}, }; // 车场类型 -export const AssetParkingPlacesTypeEnum = { - ResidentialSupporting: { - text: '住宅配套车场', - color: '#ff8c00', - value: 'ResidentialSupporting', - }, - Commercial: { text: '商业车场', color: '#1e90ff', value: 'Commercial' }, - Mixed: { text: '混合车场', color: '#32cd32', value: 'Mixed' }, +export const AssetParkingPlacesTypeEnum= { + 'ResidentialSupporting': {"text":"住宅配套车场","color":"#ff8c00","value":"ResidentialSupporting"}, + 'Commercial': {"text":"商业车场","color":"#1e90ff","value":"Commercial"}, + 'Mixed': {"text":"混合车场","color":"#32cd32","value":"Mixed"}, }; // AssetProjectsChargeEnum -export const AssetProjectsChargeEnum = { - Contract: { text: '包干制', color: '#007bff', value: 'Contract' }, - Commission: { text: '酬金制', color: '#28a745', value: 'Commission' }, +export const AssetProjectsChargeEnum= { + 'Contract': {"text":"包干制","color":"#007bff","value":"Contract"}, + 'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"}, }; // AssetProjectsEntrustTypeEnum -export const AssetProjectsEntrustTypeEnum = { - DeveloperJointEntrust: { - text: '开发商全委', - color: '#007bff', - value: 'DeveloperJointEntrust', - }, - OwnersFullEntrust: { - text: '业委会全委', - color: '#28a745', - value: 'OwnersFullEntrust', - }, - GovernmentFullEntrust: { - text: '政府类全委', - color: '#ffc107', - value: 'GovernmentFullEntrust', - }, +export const AssetProjectsEntrustTypeEnum= { + 'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"}, + 'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"}, + 'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"}, }; // 业权类型 -export const AssetProjectsOwnershipTypeEnum = { - SingleOwnership: { - text: '单业权', - color: '#00cc66', - value: 'SingleOwnership', - }, - MultipleOwnership: { - text: '多业权', - color: '#0099ff', - value: 'MultipleOwnership', - }, +export const AssetProjectsOwnershipTypeEnum= { + 'SingleOwnership': {"text":"单业权","color":"#00cc66","value":"SingleOwnership"}, + 'MultipleOwnership': {"text":"多业权","color":"#0099ff","value":"MultipleOwnership"}, }; // AssetProjectsPropertyTypeEnum -export const AssetProjectsPropertyTypeEnum = { - Residence: { text: '住宅', color: '#ff0000', value: 'Residence' }, - Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' }, - Office: { text: '办公', color: '#ffcc00', value: 'Office' }, - IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' }, - Complex: { text: '综合体', color: '#0099ff', value: 'Complex' }, - Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' }, - Venue: { text: '场馆', color: '#9966ff', value: 'Venue' }, - Education: { text: '教育', color: '#339999', value: 'Education' }, - Medical: { text: '医疗', color: '#cc3366', value: 'Medical' }, +export const AssetProjectsPropertyTypeEnum= { + 'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"}, + 'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"}, + 'Office': {"text":"办公","color":"#ffcc00","value":"Office"}, + 'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"}, + 'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"}, + 'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"}, + 'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"}, + 'Education': {"text":"教育","color":"#339999","value":"Education"}, + 'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"}, }; // AssetProjectsStatusEnum -export const AssetProjectsStatusEnum = { - SignedNotDelivered: { - text: '签约未交付', - color: '#6c757d', - value: 'SignedNotDelivered', - }, - RollingDevelopment: { - text: '滚动开发', - color: '#007bff', - value: 'RollingDevelopment', - }, - ManagedAndClosed: { - text: '在管封园', - color: '#ffc107', - value: 'ManagedAndClosed', - }, - Exited: { text: '退出', color: '#dc3545', value: 'Exited' }, +export const AssetProjectsStatusEnum= { + 'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"}, + 'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"}, + 'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"}, + 'Exited': {"text":"退出","color":"#dc3545","value":"Exited"}, }; // AssetUnitsBuildingStructureEnum -export const AssetUnitsBuildingStructureEnum = { - SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' }, - SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' }, - BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' }, - BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' }, +export const AssetUnitsBuildingStructureEnum= { + 'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"}, + 'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"}, + 'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"}, + 'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"}, }; // AssetUnitsBuildingTypeEnum -export const AssetUnitsBuildingTypeEnum = { - SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' }, - Slab: { text: '板楼', color: '#28a745', value: 'Slab' }, - Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' }, +export const AssetUnitsBuildingTypeEnum= { + 'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"}, + 'Slab': {"text":"板楼","color":"#28a745","value":"Slab"}, + 'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"}, }; // AttendanceRecordsCheckinTypeEnum -export const AttendanceRecordsCheckinTypeEnum = { - CheckIn: { text: '上班', color: '#1890ff', value: 'CheckIn' }, - CheckOut: { text: '下班', color: '#52c41a', value: 'CheckOut' }, +export const AttendanceRecordsCheckinTypeEnum= { + 'CheckIn': {"text":"上班","color":"#1890ff","value":"CheckIn"}, + 'CheckOut': {"text":"下班","color":"#52c41a","value":"CheckOut"}, }; // AttendanceRecordsStatusEnum -export const AttendanceRecordsStatusEnum = { - Normal: { text: '正常', color: '#52c41a', value: 'Normal' }, - Late: { text: '迟到', color: '#faad14', value: 'Late' }, - EarlyLeave: { text: '早退', color: '#fa8c16', value: 'EarlyLeave' }, - OutOfRange: { text: '范围外', color: '#ff4d4f', value: 'OutOfRange' }, - Reissue: { text: '补卡', color: '#1890ff', value: 'Reissue' }, +export const AttendanceRecordsStatusEnum= { + 'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, + 'Late': {"text":"迟到","color":"#faad14","value":"Late"}, + 'EarlyLeave': {"text":"早退","color":"#fa8c16","value":"EarlyLeave"}, + 'OutOfRange': {"text":"范围外","color":"#ff4d4f","value":"OutOfRange"}, + 'Reissue': {"text":"补卡","color":"#1890ff","value":"Reissue"}, }; // AttendanceSchedulesStatusEnum -export const AttendanceSchedulesStatusEnum = { - Pending: { text: '待生效', color: '#faad14', value: 'Pending' }, - Active: { text: '生效中', color: '#52c41a', value: 'Active' }, - Cancelled: { text: '已取消', color: '#ff4d4f', value: 'Cancelled' }, +export const AttendanceSchedulesStatusEnum= { + 'Pending': {"text":"待生效","color":"#faad14","value":"Pending"}, + 'Active': {"text":"生效中","color":"#52c41a","value":"Active"}, + 'Cancelled': {"text":"已取消","color":"#ff4d4f","value":"Cancelled"}, }; // 打卡状态枚举 -export const AttendanceStatusEnum = { - Normal: { text: '正常', color: '#52c41a', value: 'Normal' }, - Late: { text: '迟到', color: '#faad14', value: 'Late' }, - Early: { text: '早退', color: '#faad14', value: 'Early' }, - OutOfRange: { text: '范围外', color: '#ff4d4f', value: 'OutOfRange' }, - MakeUp: { text: '补卡', color: '#722ed1', value: 'MakeUp' }, +export const AttendanceStatusEnum= { + 'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, + 'Late': {"text":"迟到","color":"#faad14","value":"Late"}, + 'Early': {"text":"早退","color":"#faad14","value":"Early"}, + 'OutOfRange': {"text":"范围外","color":"#ff4d4f","value":"OutOfRange"}, + 'MakeUp': {"text":"补卡","color":"#722ed1","value":"MakeUp"}, }; // BannerSpacesTypeEnum -export const BannerSpacesTypeEnum = { - Popup: { text: '弹窗', color: '#ff0000', value: 'Popup' }, - Banner: { text: '横幅广告', color: '#00ff00', value: 'Banner' }, - FloatingButton: { - text: '悬浮按钮', - color: '#0000ff', - value: 'FloatingButton', - }, +export const BannerSpacesTypeEnum= { + 'Popup': {"text":"弹窗","color":"#ff0000","value":"Popup"}, + 'Banner': {"text":"横幅广告","color":"#00ff00","value":"Banner"}, + 'FloatingButton': {"text":"悬浮按钮","color":"#0000ff","value":"FloatingButton"}, }; // BannersRedirectTypeEnum -export const BannersRedirectTypeEnum = { - InnerPage: { text: '跳内页', color: '#ff0000', value: 'InnerPage' }, - H5: { text: '跳H5', color: '#00ff00', value: 'H5' }, - MiniProgramHome: { - text: '跳小程序首屏', - color: '#0000ff', - value: 'MiniProgramHome', - }, - AnotherMiniProgram: { - text: '跳另一个小程序', - color: '#ffa500', - value: 'AnotherMiniProgram', - }, +export const BannersRedirectTypeEnum= { + 'InnerPage': {"text":"跳内页","color":"#ff0000","value":"InnerPage"}, + 'H5': {"text":"跳H5","color":"#00ff00","value":"H5"}, + 'MiniProgramHome': {"text":"跳小程序首屏","color":"#0000ff","value":"MiniProgramHome"}, + 'AnotherMiniProgram': {"text":"跳另一个小程序","color":"#ffa500","value":"AnotherMiniProgram"}, }; // BannersTypeEnum -export const BannersTypeEnum = { - Image: { text: '图片', color: '#ff0000', value: 'Image' }, - Video: { text: '视频', color: '#00ff00', value: 'Video' }, - Text: { text: '文本', color: '#0000ff', value: 'Text' }, +export const BannersTypeEnum= { + 'Image': {"text":"图片","color":"#ff0000","value":"Image"}, + 'Video': {"text":"视频","color":"#00ff00","value":"Video"}, + 'Text': {"text":"文本","color":"#0000ff","value":"Text"}, }; -// -export const BillPaymentsStatusEnum = { - Pending: { text: '待审', color: '#faad14', value: 'Pending' }, - Approved: { text: '已审', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, +// +export const BillPaymentsStatusEnum= { + 'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"已审","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, }; -// -export const BillPaymentsTypeEnum = { - DoorCard: { text: '门卡', color: '#2196f3', value: 'DoorCard' }, - ResourceOrder: { text: '资源订单', color: '#4caf50', value: 'ResourceOrder' }, - EmergencyEvent: { - text: '突发事件', - color: '#ef4444', - value: 'EmergencyEvent', - }, - RenovationDeposit: { - text: '装修押金', - color: '#f59e0b', - value: 'RenovationDeposit', - }, +// +export const BillPaymentsTypeEnum= { + 'DoorCard': {"text":"门卡","color":"#2196f3","value":"DoorCard"}, + 'ResourceOrder': {"text":"资源订单","color":"#4caf50","value":"ResourceOrder"}, + 'EmergencyEvent': {"text":"突发事件","color":"#ef4444","value":"EmergencyEvent"}, + 'RenovationDeposit': {"text":"装修押金","color":"#f59e0b","value":"RenovationDeposit"}, }; -// -export const BillsFlowTypeEnum = { - Income: { text: '收入', color: '#10b981', value: 'Income' }, - Expense: { text: '支出', color: '#ef4444', value: 'Expense' }, +// +export const BillsFlowTypeEnum= { + 'Income': {"text":"收入","color":"#10b981","value":"Income"}, + 'Expense': {"text":"支出","color":"#ef4444","value":"Expense"}, }; -// -export const BillsRefundStatusEnum = { - Requested: { text: '已申请', color: '#2196f3', value: 'Requested' }, - Reviewing: { text: '审核中', color: '#ff9800', value: 'Reviewing' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, - Processing: { text: '退款中', color: '#9c27b0', value: 'Processing' }, - Refunded: { text: '已退款', color: '#4caf50', value: 'Refunded' }, - Failed: { text: '退款失败', color: '#e91e63', value: 'Failed' }, +// +export const BillsRefundStatusEnum= { + 'Requested': {"text":"已申请","color":"#2196f3","value":"Requested"}, + 'Reviewing': {"text":"审核中","color":"#ff9800","value":"Reviewing"}, + 'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"}, + 'Processing': {"text":"退款中","color":"#9c27b0","value":"Processing"}, + 'Refunded': {"text":"已退款","color":"#4caf50","value":"Refunded"}, + 'Failed': {"text":"退款失败","color":"#e91e63","value":"Failed"}, }; -// -export const BillsStatusEnum = { - PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' }, - Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, - Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' }, - Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, +// +export const BillsStatusEnum= { + 'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, + 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, + 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, }; // 缓存类型 -export const CacheTypeEnum = { - MobilePhoneVerificationCode: { - text: '手机验证码', - color: '#306cc3', - value: 'MobilePhoneVerificationCode', - }, +export const CacheTypeEnum= { + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#32265e","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum -export const CompaniesMerchantTypeEnum = { - PropertyManagement: { - text: '物业公司', - color: '#007bff', - value: 'PropertyManagement', - }, - ServiceProvider: { - text: '服务商', - color: '#28a745', - value: 'ServiceProvider', - }, +export const CompaniesMerchantTypeEnum= { + 'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"}, + 'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"}, }; // CompanyAppsAppTypeEnum -export const CompanyAppsAppTypeEnum = { - MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, - MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, - WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, +export const CompanyAppsAppTypeEnum= { + 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, + 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, + 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, }; // CompanyAppsModuleEnum -export const CompanyAppsModuleEnum = { - Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' }, - Customer: { text: '客户端', color: '#10b981', value: 'Customer' }, +export const CompanyAppsModuleEnum= { + 'Employee': {"text":"员工端","color":"#3b82f6","value":"Employee"}, + 'Customer': {"text":"客户端","color":"#10b981","value":"Customer"}, }; // CompanyAppsWorkTypeEnum -export const CompanyAppsWorkTypeEnum = { - WorkWechatApp: { text: '企微应用', color: '#00c853', value: 'WorkWechatApp' }, - WorkWechat: { text: '企微', color: '#0091ea', value: 'WorkWechat' }, +export const CompanyAppsWorkTypeEnum= { + 'WorkWechatApp': {"text":"企微应用","color":"#00c853","value":"WorkWechatApp"}, + 'WorkWechat': {"text":"企微","color":"#0091ea","value":"WorkWechat"}, }; // CompanyConfigsConfigKeyEnum -export const CompanyConfigsConfigKeyEnum = { - Theme: { text: '主题色', color: '#3b82f6', value: 'Theme' }, +export const CompanyConfigsConfigKeyEnum= { + 'Theme': {"text":"主题色","color":"#3b82f6","value":"Theme"}, }; // CompanyEmployeeBacklogsStatusEnum -export const CompanyEmployeeBacklogsStatusEnum = { - Pending: { text: '待办', color: '#FF6600', value: 'Pending' }, - Completed: { text: '已办', color: '#2A82E4', value: 'Completed' }, +export const CompanyEmployeeBacklogsStatusEnum= { + 'Pending': {"text":"待办","color":"#FF6600","value":"Pending"}, + 'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, }; // CompanyEmployeeBacklogsTypeEnum -export const CompanyEmployeeBacklogsTypeEnum = { - WorkOrder: { text: '工单', color: '#FF6600', value: 'WorkOrder' }, - Contract: { text: '合同', color: '#2A82E4', value: 'Contract' }, - MomentTask: { text: '朋友圈任务', color: '#FF6600', value: 'MomentTask' }, +export const CompanyEmployeeBacklogsTypeEnum= { + 'WorkOrder': {"text":"工单","color":"#FF6600","value":"WorkOrder"}, + 'Contract': {"text":"合同","color":"#2A82E4","value":"Contract"}, + 'MomentTask': {"text":"朋友圈任务","color":"#FF6600","value":"MomentTask"}, }; // CompanyEmployeesTypeEnum -export const CompanyEmployeesTypeEnum = { - Staff: { text: '员工', color: '#1890ff', value: 'Staff' }, - WeCom: { text: '企微', color: '#2196f3', value: 'WeCom' }, - External: { text: '外部', color: '#4caf50', value: 'External' }, +export const CompanyEmployeesTypeEnum= { + 'Staff': {"text":"员工","color":"#1890ff","value":"Staff"}, + 'WeCom': {"text":"企微","color":"#2196f3","value":"WeCom"}, + 'External': {"text":"外部","color":"#4caf50","value":"External"}, }; // CompanyReceiptAccountsPayChannelEnum -export const CompanyReceiptAccountsPayChannelEnum = { - WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, - BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, - TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, +export const CompanyReceiptAccountsPayChannelEnum= { + 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, + 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, + 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, + 'CCB': {"text":"建行惠市宝","color":"#003da5","value":"CCB"}, }; // 公司印章类型枚举 -export const CompanySealsTypeEnum = { - OfficialSeal: { text: '公章', color: '#007bff', value: 'OfficialSeal' }, - FinanceSeal: { text: '财务专用章', color: '#28a745', value: 'FinanceSeal' }, - ContractSeal: { text: '合同专用章', color: '#17a2b8', value: 'ContractSeal' }, - LegalRepresentativeSeal: { - text: '法定代表人章', - color: '#ffc107', - value: 'LegalRepresentativeSeal', - }, - InvoiceSeal: { text: '发票专用章', color: '#dc3545', value: 'InvoiceSeal' }, - HRSeal: { text: '人事专用章', color: '#6f42c1', value: 'HRSeal' }, +export const CompanySealsTypeEnum= { + 'OfficialSeal': {"text":"公章","color":"#007bff","value":"OfficialSeal"}, + 'FinanceSeal': {"text":"财务专用章","color":"#28a745","value":"FinanceSeal"}, + 'ContractSeal': {"text":"合同专用章","color":"#17a2b8","value":"ContractSeal"}, + 'LegalRepresentativeSeal': {"text":"法定代表人章","color":"#ffc107","value":"LegalRepresentativeSeal"}, + 'InvoiceSeal': {"text":"发票专用章","color":"#dc3545","value":"InvoiceSeal"}, + 'HRSeal': {"text":"人事专用章","color":"#6f42c1","value":"HRSeal"}, }; // CompanySuppliersCertificateTypeEnum -export const CompanySuppliersCertificateTypeEnum = { - IdCard: { text: '身份证', color: '#1e90ff', value: 'IdCard' }, - BusinessLicense: { - text: '营业执照', - color: '#32cd32', - value: 'BusinessLicense', - }, +export const CompanySuppliersCertificateTypeEnum= { + 'IdCard': {"text":"身份证","color":"#1e90ff","value":"IdCard"}, + 'BusinessLicense': {"text":"营业执照","color":"#32cd32","value":"BusinessLicense"}, }; // CompanySuppliersCounterpartyEnum -export const CompanySuppliersCounterpartyEnum = { - Supplier: { text: '供应商', color: '#1e90ff', value: 'Supplier' }, - InternalCompany: { - text: '内部企业', - color: '#32cd32', - value: 'InternalCompany', - }, - CustomerCompany: { - text: '客户单位', - color: '#ff8c00', - value: 'CustomerCompany', - }, - Other: { text: '其他', color: '#808080', value: 'Other' }, +export const CompanySuppliersCounterpartyEnum= { + 'Supplier': {"text":"供应商","color":"#1e90ff","value":"Supplier"}, + 'InternalCompany': {"text":"内部企业","color":"#32cd32","value":"InternalCompany"}, + 'CustomerCompany': {"text":"客户单位","color":"#ff8c00","value":"CustomerCompany"}, + 'Other': {"text":"其他","color":"#808080","value":"Other"}, }; // CompanySuppliersGradeEnum -export const CompanySuppliersGradeEnum = { - Excellent: { text: '优秀', color: '#10b981', value: 'Excellent' }, - Qualified: { text: '合格', color: '#3b82f6', value: 'Qualified' }, - ToImprove: { text: '待整改', color: '#f59e0b', value: 'ToImprove' }, - Eliminated: { text: '淘汰', color: '#ef4444', value: 'Eliminated' }, +export const CompanySuppliersGradeEnum= { + 'Excellent': {"text":"优秀","color":"#10b981","value":"Excellent"}, + 'Qualified': {"text":"合格","color":"#3b82f6","value":"Qualified"}, + 'ToImprove': {"text":"待整改","color":"#f59e0b","value":"ToImprove"}, + 'Eliminated': {"text":"淘汰","color":"#ef4444","value":"Eliminated"}, }; // CompanySuppliersSupplierTypeEnum -export const CompanySuppliersSupplierTypeEnum = { - Individual: { text: '个人', color: '#1e90ff', value: 'Individual' }, - Enterprise: { text: '企业', color: '#32cd32', value: 'Enterprise' }, +export const CompanySuppliersSupplierTypeEnum= { + 'Individual': {"text":"个人","color":"#1e90ff","value":"Individual"}, + 'Enterprise': {"text":"企业","color":"#32cd32","value":"Enterprise"}, }; // 合同归档借用状态枚举 -export const ContractArchiveBorrowStatusEnum = { - Pending: { text: '审批中', color: '#f59e0b', value: 'Pending' }, - Approved: { text: '已通过', color: '#10b981', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#ef4444', value: 'Rejected' }, - Borrowing: { text: '借用中', color: '#007bff', value: 'Borrowing' }, - Returned: { text: '已归还', color: '#28a745', value: 'Returned' }, - Overdue: { text: '已逾期', color: '#dc3545', value: 'Overdue' }, +export const ContractArchiveBorrowStatusEnum= { + 'Pending': {"text":"审批中","color":"#f59e0b","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#10b981","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#ef4444","value":"Rejected"}, + 'Borrowing': {"text":"借用中","color":"#007bff","value":"Borrowing"}, + 'Returned': {"text":"已归还","color":"#28a745","value":"Returned"}, + 'Overdue': {"text":"已逾期","color":"#dc3545","value":"Overdue"}, }; // 合同归档文件归还状态枚举 -export const ContractArchiveFileReturnStatusEnum = { - NotReturned: { text: '未归还', color: '#6c757d', value: 'NotReturned' }, - Intact: { text: '完好', color: '#28a745', value: 'Intact' }, - PartialLost: { text: '部分遗失', color: '#ffc107', value: 'PartialLost' }, - AllLost: { text: '全部遗失', color: '#dc3545', value: 'AllLost' }, - AllDamaged: { text: '全部损毁', color: '#dc3545', value: 'AllDamaged' }, - PartialDamaged: { - text: '部分损毁', - color: '#fd7e14', - value: 'PartialDamaged', - }, - NoNeedReturn: { text: '无需归还', color: '#17a2b8', value: 'NoNeedReturn' }, +export const ContractArchiveFileReturnStatusEnum= { + 'NotReturned': {"text":"未归还","color":"#6c757d","value":"NotReturned"}, + 'Intact': {"text":"完好","color":"#28a745","value":"Intact"}, + 'PartialLost': {"text":"部分遗失","color":"#ffc107","value":"PartialLost"}, + 'AllLost': {"text":"全部遗失","color":"#dc3545","value":"AllLost"}, + 'AllDamaged': {"text":"全部损毁","color":"#dc3545","value":"AllDamaged"}, + 'PartialDamaged': {"text":"部分损毁","color":"#fd7e14","value":"PartialDamaged"}, + 'NoNeedReturn': {"text":"无需归还","color":"#17a2b8","value":"NoNeedReturn"}, }; // 合同归档归还状态枚举 -export const ContractArchiveReturnStatusEnum = { - NotReturned: { text: '未归还', color: '#6c757d', value: 'NotReturned' }, - Returned: { text: '已归还', color: '#28a745', value: 'Returned' }, +export const ContractArchiveReturnStatusEnum= { + 'NotReturned': {"text":"未归还","color":"#6c757d","value":"NotReturned"}, + 'Returned': {"text":"已归还","color":"#28a745","value":"Returned"}, }; // ContractArchivesConfidentialityLevelEnum -export const ContractArchivesConfidentialityLevelEnum = { - TopSecret: { text: '绝密', color: '#dc3545', value: 'TopSecret' }, - Confidential: { text: '机密', color: '#fd7e14', value: 'Confidential' }, - Secret: { text: '保密', color: '#ffc107', value: 'Secret' }, - Internal: { text: '内部公开', color: '#17a2b8', value: 'Internal' }, - Public: { text: '公开', color: '#28a745', value: 'Public' }, +export const ContractArchivesConfidentialityLevelEnum= { + 'TopSecret': {"text":"绝密","color":"#dc3545","value":"TopSecret"}, + 'Confidential': {"text":"机密","color":"#fd7e14","value":"Confidential"}, + 'Secret': {"text":"保密","color":"#ffc107","value":"Secret"}, + 'Internal': {"text":"内部公开","color":"#17a2b8","value":"Internal"}, + 'Public': {"text":"公开","color":"#28a745","value":"Public"}, }; // ContractArchivesFileStatusEnum -export const ContractArchivesFileStatusEnum = { - Intact: { text: '完好', color: '#28a745', value: 'Intact' }, - SlightDamage: { text: '轻度损伤', color: '#ffc107', value: 'SlightDamage' }, - ModerateDamage: { - text: '中度损伤', - color: '#fd7e14', - value: 'ModerateDamage', - }, - SevereDamage: { text: '重度损伤', color: '#dc3545', value: 'SevereDamage' }, +export const ContractArchivesFileStatusEnum= { + 'Intact': {"text":"完好","color":"#28a745","value":"Intact"}, + 'SlightDamage': {"text":"轻度损伤","color":"#ffc107","value":"SlightDamage"}, + 'ModerateDamage': {"text":"中度损伤","color":"#fd7e14","value":"ModerateDamage"}, + 'SevereDamage': {"text":"重度损伤","color":"#dc3545","value":"SevereDamage"}, }; // ContractArchivesFileTypeEnum -export const ContractArchivesFileTypeEnum = { - PaperOriginal: { text: '纸质原件', color: '#007bff', value: 'PaperOriginal' }, - ElectronicOriginal: { - text: '电子原件', - color: '#28a745', - value: 'ElectronicOriginal', - }, - Copy: { text: '复印件', color: '#ffc107', value: 'Copy' }, +export const ContractArchivesFileTypeEnum= { + 'PaperOriginal': {"text":"纸质原件","color":"#007bff","value":"PaperOriginal"}, + 'ElectronicOriginal': {"text":"电子原件","color":"#28a745","value":"ElectronicOriginal"}, + 'Copy': {"text":"复印件","color":"#ffc107","value":"Copy"}, }; // ContractArchivesPeriodTypeEnum -export const ContractArchivesPeriodTypeEnum = { - FixedTerm: { text: '定期', color: '#007bff', value: 'FixedTerm' }, - Permanent: { text: '永久', color: '#28a745', value: 'Permanent' }, +export const ContractArchivesPeriodTypeEnum= { + 'FixedTerm': {"text":"定期","color":"#007bff","value":"FixedTerm"}, + 'Permanent': {"text":"永久","color":"#28a745","value":"Permanent"}, }; // ContractBillObjectsAuditStatusEnum -export const ContractBillObjectsAuditStatusEnum = { - Pending: { text: '审批中', color: '#f59e0b', value: 'Pending' }, - Approved: { text: '已通过', color: '#10b981', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#ef4444', value: 'Rejected' }, +export const ContractBillObjectsAuditStatusEnum= { + 'Pending': {"text":"审批中","color":"#f59e0b","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#10b981","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#ef4444","value":"Rejected"}, }; // ContractBillObjectsStatusEnum -export const ContractBillObjectsStatusEnum = { - Pending: { text: '待执行', color: '#6c757d', value: 'Pending' }, - InProgress: { text: '执行中', color: '#007bff', value: 'InProgress' }, - Completed: { text: '已完成', color: '#28a745', value: 'Completed' }, - Cancelled: { text: '已取消', color: '#dc3545', value: 'Cancelled' }, +export const ContractBillObjectsStatusEnum= { + 'Pending': {"text":"待执行","color":"#6c757d","value":"Pending"}, + 'InProgress': {"text":"执行中","color":"#007bff","value":"InProgress"}, + 'Completed': {"text":"已完成","color":"#28a745","value":"Completed"}, + 'Cancelled': {"text":"已取消","color":"#dc3545","value":"Cancelled"}, }; // ContractBillPaymentsStatusEnum -export const ContractBillPaymentsStatusEnum = { - Pending: { text: '待审', color: '#faad14', value: 'Pending' }, - Approved: { text: '已审', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, +export const ContractBillPaymentsStatusEnum= { + 'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"已审","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, }; // ContractBillsAuditStatusEnum -export const ContractBillsAuditStatusEnum = { - NotApplied: { text: '未申请', color: '#9ca3af', value: 'NotApplied' }, - Pending: { text: '审批中', color: '#f59e0b', value: 'Pending' }, - Approved: { text: '已通过', color: '#10b981', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#ef4444', value: 'Rejected' }, +export const ContractBillsAuditStatusEnum= { + 'NotApplied': {"text":"未申请","color":"#9ca3af","value":"NotApplied"}, + 'Pending': {"text":"审批中","color":"#f59e0b","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#10b981","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#ef4444","value":"Rejected"}, }; // ContractBillsCostTypeEnum -export const ContractBillsCostTypeEnum = { - Income: { text: '收入', color: '#52c41a', value: 'Income' }, - Expense: { text: '支出', color: '#f5222d', value: 'Expense' }, +export const ContractBillsCostTypeEnum= { + 'Income': {"text":"收入","color":"#52c41a","value":"Income"}, + 'Expense': {"text":"支出","color":"#f5222d","value":"Expense"}, }; // ContractBillsIncomeExpenseTypeEnum -export const ContractBillsIncomeExpenseTypeEnum = { - Increase: { text: '增加', color: '#10b981', value: 'Increase' }, - Decrease: { text: '减少', color: '#ef4444', value: 'Decrease' }, - Neutral: { text: '不变', color: '#9ca3af', value: 'Neutral' }, +export const ContractBillsIncomeExpenseTypeEnum= { + 'Increase': {"text":"增加","color":"#10b981","value":"Increase"}, + 'Decrease': {"text":"减少","color":"#ef4444","value":"Decrease"}, + 'Neutral': {"text":"不变","color":"#9ca3af","value":"Neutral"}, }; // ContractOthersStatusEnum -export const ContractOthersStatusEnum = { - Pending: { text: '审批中', color: '#f59e0b', value: 'Pending' }, - Approved: { text: '已通过', color: '#10b981', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#ef4444', value: 'Rejected' }, +export const ContractOthersStatusEnum= { + 'Pending': {"text":"审批中","color":"#f59e0b","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#10b981","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#ef4444","value":"Rejected"}, }; // ContractPeoplesSignPartyEnum -export const ContractPeoplesSignPartyEnum = { - PartyA: { text: '甲方', color: '#007bff', value: 'PartyA' }, - PartyB: { text: '乙方', color: '#28a745', value: 'PartyB' }, - PartyC: { text: '丙方', color: '#ffc107', value: 'PartyC' }, - PartyD: { text: '丁方', color: '#dc3545', value: 'PartyD' }, +export const ContractPeoplesSignPartyEnum= { + 'PartyA': {"text":"甲方","color":"#007bff","value":"PartyA"}, + 'PartyB': {"text":"乙方","color":"#28a745","value":"PartyB"}, + 'PartyC': {"text":"丙方","color":"#ffc107","value":"PartyC"}, + 'PartyD': {"text":"丁方","color":"#dc3545","value":"PartyD"}, }; // ContractTemplatesIncomeExpenseTypeEnum -export const ContractTemplatesIncomeExpenseTypeEnum = { - Income: { text: '收入类', color: '#32cd32', value: 'Income' }, - Expense: { text: '支出类', color: '#ff4500', value: 'Expense' }, - None: { text: '无收无支', color: '#808080', value: 'None' }, +export const ContractTemplatesIncomeExpenseTypeEnum= { + 'Income': {"text":"收入类","color":"#32cd32","value":"Income"}, + 'Expense': {"text":"支出类","color":"#ff4500","value":"Expense"}, + 'None': {"text":"无收无支","color":"#808080","value":"None"}, }; // ContractTemplatesSourceEnum -export const ContractTemplatesSourceEnum = { - Internal: { text: '内部', color: '#1e90ff', value: 'Internal' }, - External: { text: '外部', color: '#32cd32', value: 'External' }, +export const ContractTemplatesSourceEnum= { + 'Internal': {"text":"内部","color":"#1e90ff","value":"Internal"}, + 'External': {"text":"外部","color":"#32cd32","value":"External"}, }; // ContractsContractNatureEnum -export const ContractsContractNatureEnum = { - RegularContract: { - text: '常规合同', - color: '#007bff', - value: 'RegularContract', - }, - FrameworkAgreement: { - text: '框架协议', - color: '#28a745', - value: 'FrameworkAgreement', - }, - Other: { text: '其它', color: '#28a745', value: 'Other' }, +export const ContractsContractNatureEnum= { + 'RegularContract': {"text":"常规合同","color":"#007bff","value":"RegularContract"}, + 'FrameworkAgreement': {"text":"框架协议","color":"#28a745","value":"FrameworkAgreement"}, + 'Other': {"text":"其它","color":"#28a745","value":"Other"}, }; // ContractsSettlementModeEnum -export const ContractsSettlementModeEnum = { - LumpSumContract: { - text: '总价合同', - color: '#007bff', - value: 'LumpSumContract', - }, - OpenContract: { text: '开口合同', color: '#28a745', value: 'OpenContract' }, +export const ContractsSettlementModeEnum= { + 'LumpSumContract': {"text":"总价合同","color":"#007bff","value":"LumpSumContract"}, + 'OpenContract': {"text":"开口合同","color":"#28a745","value":"OpenContract"}, }; // ContractsStatusEnum -export const ContractsStatusEnum = { - TemporaryStorage: { - text: '暂存', - color: '#6c757d', - value: 'TemporaryStorage', - }, - UnderApproval: { text: '审核中', color: '#007bff', value: 'UnderApproval' }, - Approved: { text: '已通过', color: '#28a745', value: 'Approved' }, - Rejected: { text: '已退回', color: '#dc3545', value: 'Rejected' }, - Signed: { text: '已签约', color: '#17a2b8', value: 'Signed' }, - Archived: { text: '已归档', color: '#20c997', value: 'Archived' }, - Terminating: { text: '解除中', color: '#ffc107', value: 'Terminating' }, - Terminated: { text: '已解除', color: '#fd7e14', value: 'Terminated' }, - Closed: { text: '已终止', color: '#343a40', value: 'Closed' }, - Voided: { text: '已撤销', color: '#6610f2', value: 'Voided' }, - Cancelled: { text: '已取消', color: '#e83e8c', value: 'Cancelled' }, +export const ContractsStatusEnum= { + 'TemporaryStorage': {"text":"暂存","color":"#6c757d","value":"TemporaryStorage"}, + 'UnderApproval': {"text":"审核中","color":"#007bff","value":"UnderApproval"}, + 'Approved': {"text":"已通过","color":"#28a745","value":"Approved"}, + 'Rejected': {"text":"已退回","color":"#dc3545","value":"Rejected"}, + 'Signed': {"text":"已签约","color":"#17a2b8","value":"Signed"}, + 'Archived': {"text":"已归档","color":"#20c997","value":"Archived"}, + 'Terminating': {"text":"解除中","color":"#ffc107","value":"Terminating"}, + 'Terminated': {"text":"已解除","color":"#fd7e14","value":"Terminated"}, + 'Closed': {"text":"已终止","color":"#343a40","value":"Closed"}, + 'Voided': {"text":"已撤销","color":"#6610f2","value":"Voided"}, + 'Cancelled': {"text":"已取消","color":"#e83e8c","value":"Cancelled"}, }; // ConvenienceServicesTypeEnum -export const ConvenienceServicesTypeEnum = { - PropertyExclusive: { - text: '物业专属', - color: '#8b5cf6', - value: 'PropertyExclusive', - }, - EmergencyRepair: { - text: '紧急抢修', - color: '#ef4444', - value: 'EmergencyRepair', - }, - LifeService: { text: '生活服务', color: '#3b82f6', value: 'LifeService' }, - GovernmentConsulting: { - text: '政务咨询', - color: '#10b981', - value: 'GovernmentConsulting', - }, +export const ConvenienceServicesTypeEnum= { + 'PropertyExclusive': {"text":"物业专属","color":"#8b5cf6","value":"PropertyExclusive"}, + 'EmergencyRepair': {"text":"紧急抢修","color":"#ef4444","value":"EmergencyRepair"}, + 'LifeService': {"text":"生活服务","color":"#3b82f6","value":"LifeService"}, + 'GovernmentConsulting': {"text":"政务咨询","color":"#10b981","value":"GovernmentConsulting"}, }; -// -export const CooperationSuggestionEnum = { - Recommend: { text: '建议合作', color: '#28a745', value: 'Recommend' }, - Restrict: { text: '建议限制合作', color: '#ffc107', value: 'Restrict' }, - Pause: { text: '建议暂不合作', color: '#fd7e14', value: 'Pause' }, - Eliminate: { text: '建议淘汰', color: '#dc3545', value: 'Eliminate' }, +// +export const CooperationSuggestionEnum= { + 'Recommend': {"text":"建议合作","color":"#28a745","value":"Recommend"}, + 'Restrict': {"text":"建议限制合作","color":"#ffc107","value":"Restrict"}, + 'Pause': {"text":"建议暂不合作","color":"#fd7e14","value":"Pause"}, + 'Eliminate': {"text":"建议淘汰","color":"#dc3545","value":"Eliminate"}, }; -// -export const CreditRatingEnum = { - AAA: { text: 'AAA', color: '#28a745', value: 'AAA' }, - AA: { text: 'AA', color: '#28a745', value: 'AA' }, - A: { text: 'A', color: '#28a745', value: 'A' }, - BBB: { text: 'BBB', color: '#ffc107', value: 'BBB' }, - BB: { text: 'BB', color: '#ffc107', value: 'BB' }, - B: { text: 'B', color: '#ffc107', value: 'B' }, - CCC: { text: 'CCC', color: '#dc3545', value: 'CCC' }, +// +export const CreditRatingEnum= { + 'AAA': {"text":"AAA","color":"#28a745","value":"AAA"}, + 'AA': {"text":"AA","color":"#28a745","value":"AA"}, + 'A': {"text":"A","color":"#28a745","value":"A"}, + 'BBB': {"text":"BBB","color":"#ffc107","value":"BBB"}, + 'BB': {"text":"BB","color":"#ffc107","value":"BB"}, + 'B': {"text":"B","color":"#ffc107","value":"B"}, + 'CCC': {"text":"CCC","color":"#dc3545","value":"CCC"}, }; // CustomerBacklogsStatusEnum -export const CustomerBacklogsStatusEnum = { - Pending: { text: '待办', color: '#faad14', value: 'Pending' }, - Completed: { text: '已办', color: '#2A82E4', value: 'Completed' }, +export const CustomerBacklogsStatusEnum= { + 'Pending': {"text":"待办","color":"#faad14","value":"Pending"}, + 'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, }; // CustomerBacklogsTypeEnum -export const CustomerBacklogsTypeEnum = { - RegisterApply: { text: '登记申请', color: '#2db7f5', value: 'RegisterApply' }, - PaymentPending: { - text: '费用待缴', - color: '#faad14', - value: 'PaymentPending', - }, - ContractTodo: { text: '合同待办', color: '#722ed1', value: 'ContractTodo' }, +export const CustomerBacklogsTypeEnum= { + 'RegisterApply': {"text":"登记申请","color":"#2db7f5","value":"RegisterApply"}, + 'PaymentPending': {"text":"费用待缴","color":"#faad14","value":"PaymentPending"}, + 'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"}, }; // CustomerMomentTasksStatusEnum -export const CustomerMomentTasksStatusEnum = { - NotSent: { text: '未发', color: '#FF4500', value: 'NotSent' }, - Sent: { text: '已发', color: '#32CD32', value: 'Sent' }, +export const CustomerMomentTasksStatusEnum= { + 'NotSent': {"text":"未发","color":"#FF4500","value":"NotSent"}, + 'Sent': {"text":"已发","color":"#32CD32","value":"Sent"}, }; // CustomerMomentsChannelEnum -export const CustomerMomentsChannelEnum = { - MomentCorp: { text: '朋友圈(企业)', color: '#1E90FF', value: 'MomentCorp' }, - CustomerDirectCorp: { - text: '客户1对1消息群发(企业)', - color: '#FFA500', - value: 'CustomerDirectCorp', - }, - CustomerGroupCorp: { - text: '客户群群发(企业)', - color: '#FF69B4', - value: 'CustomerGroupCorp', - }, +export const CustomerMomentsChannelEnum= { + 'MomentCorp': {"text":"朋友圈(企业)","color":"#1E90FF","value":"MomentCorp"}, + 'CustomerDirectCorp': {"text":"客户1对1消息群发(企业)","color":"#FFA500","value":"CustomerDirectCorp"}, + 'CustomerGroupCorp': {"text":"客户群群发(企业)","color":"#FF69B4","value":"CustomerGroupCorp"}, }; // CustomerMomentsContentTypeEnum -export const CustomerMomentsContentTypeEnum = { - Image: { text: '图片消息', color: '#1E90FF', value: 'Image' }, - Link: { text: '转载链接消息', color: '#32CD32', value: 'Link' }, - MiniProgram: { text: '跳小程序', color: '#FFA500', value: 'MiniProgram' }, - Video: { text: '视频消息', color: '#FF69B4', value: 'Video' }, +export const CustomerMomentsContentTypeEnum= { + 'Image': {"text":"图片消息","color":"#1E90FF","value":"Image"}, + 'Link': {"text":"转载链接消息","color":"#32CD32","value":"Link"}, + 'MiniProgram': {"text":"跳小程序","color":"#FFA500","value":"MiniProgram"}, + 'Video': {"text":"视频消息","color":"#FF69B4","value":"Video"}, }; // CustomerMomentsPushStatusEnum -export const CustomerMomentsPushStatusEnum = { - NotPushed: { text: '未推送', color: '#FF4500', value: 'NotPushed' }, - Pushed: { text: '已推送', color: '#32CD32', value: 'Pushed' }, +export const CustomerMomentsPushStatusEnum= { + 'NotPushed': {"text":"未推送","color":"#FF4500","value":"NotPushed"}, + 'Pushed': {"text":"已推送","color":"#32CD32","value":"Pushed"}, }; // CustomerMomentsPushTypeEnum -export const CustomerMomentsPushTypeEnum = { - ManualPush: { text: '手动推送', color: '#1E90FF', value: 'ManualPush' }, - ScheduledPush: { text: '定时推送', color: '#32CD32', value: 'ScheduledPush' }, +export const CustomerMomentsPushTypeEnum= { + 'ManualPush': {"text":"手动推送","color":"#1E90FF","value":"ManualPush"}, + 'ScheduledPush': {"text":"定时推送","color":"#32CD32","value":"ScheduledPush"}, }; // CustomerMomentsRangeTypeEnum -export const CustomerMomentsRangeTypeEnum = { - Project: { text: '按项目推送', color: '#1E90FF', value: 'Project' }, +export const CustomerMomentsRangeTypeEnum= { + 'Project': {"text":"按项目推送","color":"#1E90FF","value":"Project"}, }; // CustomerMomentsSkipTypeEnum -export const CustomerMomentsSkipTypeEnum = { - H5: { text: 'H5', color: '#1E90FF', value: 'H5' }, +export const CustomerMomentsSkipTypeEnum= { + 'H5': {"text":"H5","color":"#1E90FF","value":"H5"}, }; // CustomerMomentsTaskEndTypeEnum -export const CustomerMomentsTaskEndTypeEnum = { - AfterNDays: { text: '发送后N天', color: '#1E90FF', value: 'AfterNDays' }, - ScheduledEnd: { text: '定时结束', color: '#32CD32', value: 'ScheduledEnd' }, +export const CustomerMomentsTaskEndTypeEnum= { + 'AfterNDays': {"text":"发送后N天","color":"#1E90FF","value":"AfterNDays"}, + 'ScheduledEnd': {"text":"定时结束","color":"#32CD32","value":"ScheduledEnd"}, }; // CustomerOpinionsTypeEnum -export const CustomerOpinionsTypeEnum = { - FeatureException: { - text: '功能异常', - color: '#ff0000', - value: 'FeatureException', - }, - FeatureSuggestion: { - text: '新功能建议', - color: '#00bfff', - value: 'FeatureSuggestion', - }, +export const CustomerOpinionsTypeEnum= { + 'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"}, + 'FeatureSuggestion': {"text":"新功能建议","color":"#00bfff","value":"FeatureSuggestion"}, }; // 突发事件账单收支类型 -export const EmergencyEventBillsCostTypeEnum = { - Income: { text: '收入', color: '#4caf50', value: 'Income' }, - Expense: { text: '支出', color: '#f44336', value: 'Expense' }, +export const EmergencyEventBillsCostTypeEnum= { + 'Income': {"text":"收入","color":"#4caf50","value":"Income"}, + 'Expense': {"text":"支出","color":"#f44336","value":"Expense"}, }; // 突发事件账单费用类型 -export const EmergencyEventBillsFeeTypeEnum = { - Compensation: { text: '赔偿', color: '#f44336', value: 'Compensation' }, - Penalty: { text: '罚款', color: '#ff9800', value: 'Penalty' }, +export const EmergencyEventBillsFeeTypeEnum= { + 'Compensation': {"text":"赔偿","color":"#f44336","value":"Compensation"}, + 'Penalty': {"text":"罚款","color":"#ff9800","value":"Penalty"}, }; // 突发事件账单支付方式 -export const EmergencyEventBillsPaymentMethodEnum = { - WeChat: { text: '微信支付', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, - BankTransfer: { text: '银行转账', color: '#2196f3', value: 'BankTransfer' }, - TongLian: { text: '通联支付', color: '#ff9800', value: 'TongLian' }, - Prepayment: { text: '预付款', color: '#9c27b0', value: 'Prepayment' }, - POS: { text: 'POS机', color: '#607d8b', value: 'POS' }, - Cash: { text: '现金', color: '#4caf50', value: 'Cash' }, +export const EmergencyEventBillsPaymentMethodEnum= { + 'WeChat': {"text":"微信支付","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, + 'BankTransfer': {"text":"银行转账","color":"#2196f3","value":"BankTransfer"}, + 'TongLian': {"text":"通联支付","color":"#ff9800","value":"TongLian"}, + 'Prepayment': {"text":"预付款","color":"#9c27b0","value":"Prepayment"}, + 'POS': {"text":"POS机","color":"#607d8b","value":"POS"}, + 'Cash': {"text":"现金","color":"#4caf50","value":"Cash"}, }; // 突发事件账单支付状态 -export const EmergencyEventBillsPaymentStatusEnum = { - Pending: { text: '待支付', color: '#ff9800', value: 'Pending' }, - ToBeConfirmed: { text: '待确认', color: '#2196f3', value: 'ToBeConfirmed' }, - Paid: { text: '已支付', color: '#4caf50', value: 'Paid' }, - Refunded: { text: '已退款', color: '#9c27b0', value: 'Refunded' }, - Cancelled: { text: '已取消', color: '#9e9e9e', value: 'Cancelled' }, - Failed: { text: '支付失败', color: '#f44336', value: 'Failed' }, +export const EmergencyEventBillsPaymentStatusEnum= { + 'Pending': {"text":"待支付","color":"#ff9800","value":"Pending"}, + 'ToBeConfirmed': {"text":"待确认","color":"#2196f3","value":"ToBeConfirmed"}, + 'Paid': {"text":"已支付","color":"#4caf50","value":"Paid"}, + 'Refunded': {"text":"已退款","color":"#9c27b0","value":"Refunded"}, + 'Cancelled': {"text":"已取消","color":"#9e9e9e","value":"Cancelled"}, + 'Failed': {"text":"支付失败","color":"#f44336","value":"Failed"}, }; // 突发事件审核状态 -export const EmergencyEventsAuditStatusEnum = { - Pending: { text: '待审', color: '#ff9800', value: 'Pending' }, - Approved: { text: '通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f44336', value: 'Rejected' }, +export const EmergencyEventsAuditStatusEnum= { + 'Pending': {"text":"待审","color":"#ff9800","value":"Pending"}, + 'Approved': {"text":"通过","color":"#4caf50","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f44336","value":"Rejected"}, }; // 突发事件赔偿类型 -export const EmergencyEventsCompensationTypeEnum = { - Ours: { text: '我方', color: '#2196f3', value: 'Ours' }, - Others: { text: '他方', color: '#9c27b0', value: 'Others' }, +export const EmergencyEventsCompensationTypeEnum= { + 'Ours': {"text":"我方","color":"#2196f3","value":"Ours"}, + 'Others': {"text":"他方","color":"#9c27b0","value":"Others"}, }; // 突发事件状态 -export const EmergencyEventsStatusEnum = { - PendingFollowUp: { - text: '待跟进', - color: '#ff9800', - value: 'PendingFollowUp', - }, - InProgress: { text: '跟进中', color: '#2196f3', value: 'InProgress' }, - PendingReview: { text: '待审核', color: '#9c27b0', value: 'PendingReview' }, - Closed: { text: '已关闭', color: '#9e9e9e', value: 'Closed' }, +export const EmergencyEventsStatusEnum= { + 'PendingFollowUp': {"text":"待跟进","color":"#ff9800","value":"PendingFollowUp"}, + 'InProgress': {"text":"跟进中","color":"#2196f3","value":"InProgress"}, + 'PendingReview': {"text":"待审核","color":"#9c27b0","value":"PendingReview"}, + 'Closed': {"text":"已关闭","color":"#9e9e9e","value":"Closed"}, }; // 突发事件行动组成员职位 -export const EmergencyTeamMembersPositionEnum = { - Leader: { text: '应急组长', color: '#f44336', value: 'Leader' }, - Member: { text: '现场处置员', color: '#2196f3', value: 'Member' }, - Liaison: { text: '信息联络员', color: '#ffeb3b', value: 'Liaison' }, - Support: { text: '后勤保障员', color: '#4caf50', value: 'Support' }, - Reserve: { text: '机动预备员', color: '#9c27b0', value: 'Reserve' }, +export const EmergencyTeamMembersPositionEnum= { + 'Leader': {"text":"应急组长","color":"#f44336","value":"Leader"}, + 'Member': {"text":"现场处置员","color":"#2196f3","value":"Member"}, + 'Liaison': {"text":"信息联络员","color":"#ffeb3b","value":"Liaison"}, + 'Support': {"text":"后勤保障员","color":"#4caf50","value":"Support"}, + 'Reserve': {"text":"机动预备员","color":"#9c27b0","value":"Reserve"}, }; // 物品放行审核状态 -export const GoodsReleasesAuditStatusEnum = { - Pending: { text: '待审核', color: '#faad14', value: 'Pending' }, - Approved: { text: '已通过', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '已退回', color: '#ff4d4f', value: 'Rejected' }, +export const GoodsReleasesAuditStatusEnum= { + 'Pending': {"text":"待审核","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"已退回","color":"#ff4d4f","value":"Rejected"}, }; // 物品放行通行类型 -export const GoodsReleasesPassedTypeEnum = { - Moving: { text: '搬家', color: '#1890ff', value: 'Moving' }, - Delivery: { text: '出货', color: '#52c41a', value: 'Delivery' }, - Other: { text: '其他', color: '#faad14', value: 'Other' }, +export const GoodsReleasesPassedTypeEnum= { + 'Moving': {"text":"搬家","color":"#1890ff","value":"Moving"}, + 'Delivery': {"text":"出货","color":"#52c41a","value":"Delivery"}, + 'Other': {"text":"其他","color":"#faad14","value":"Other"}, }; // 物品放行状态 -export const GoodsReleasesStatusEnum = { - Pending: { text: '待审核', color: '#faad14', value: 'Pending' }, - OwnerApproved: { text: '业主已审', color: '#1890ff', value: 'OwnerApproved' }, - Approved: { text: '已通过', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '已退回', color: '#ff4d4f', value: 'Rejected' }, - Released: { text: '已放行', color: '#722ed1', value: 'Released' }, +export const GoodsReleasesStatusEnum= { + 'Pending': {"text":"待审核","color":"#faad14","value":"Pending"}, + 'OwnerApproved': {"text":"业主已审","color":"#1890ff","value":"OwnerApproved"}, + 'Approved': {"text":"已通过","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"已退回","color":"#ff4d4f","value":"Rejected"}, + 'Released': {"text":"已放行","color":"#722ed1","value":"Released"}, }; // 账单状态枚举 -export const HouseBillsBillStatusEnum = { - PendingPayment: { text: '待收款', color: '#facc15', value: 'PendingPayment' }, - ToBeConfirmed: { text: '待确认', color: '#fb923c', value: 'ToBeConfirmed' }, - PartiallyPaid: { text: '部分收款', color: '#60a5fa', value: 'PartiallyPaid' }, - Paid: { text: '已收款', color: '#10b981', value: 'Paid' }, - Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' }, - Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, +export const HouseBillsBillStatusEnum= { + 'PendingPayment': {"text":"待收款","color":"#facc15","value":"PendingPayment"}, + 'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"}, + 'PartiallyPaid': {"text":"部分收款","color":"#60a5fa","value":"PartiallyPaid"}, + 'Paid': {"text":"已收款","color":"#10b981","value":"Paid"}, + 'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, + 'UnderApproval': {"text":"审批中","color":"#8b5cf6","value":"UnderApproval"}, + 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, }; // 房屋账单类型枚举 -export const HouseBillsTypeEnum = { - PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' }, - MaintenanceFund: { - text: '维修基金', - color: '#10b981', - value: 'MaintenanceFund', - }, - WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' }, - ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' }, - SharedWaterFee: { - text: '公摊水费', - color: '#8b5cf6', - value: 'SharedWaterFee', - }, - SharedElectricityFee: { - text: '公摊电费', - color: '#ec4899', - value: 'SharedElectricityFee', - }, - CarPortFee: { text: '车位费', color: '#f59e0b', value: 'CarPortFee' }, - WorkOrderRepairFee: { - text: '工单维修费', - color: '#f97316', - value: 'WorkOrderRepairFee', - }, +export const HouseBillsTypeEnum= { + 'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"}, + 'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"}, + 'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"}, + 'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"}, + 'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"}, + 'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"}, + 'CarPortFee': {"text":"车位费","color":"#f59e0b","value":"CarPortFee"}, + 'WorkOrderRepairFee': {"text":"工单维修费","color":"#f97316","value":"WorkOrderRepairFee"}, }; // HouseChargeStandardsApportionmentMethodEnum -export const HouseChargeStandardsApportionmentMethodEnum = { - HouseCount: { text: '房屋数分摊', color: '#3b82f6', value: 'HouseCount' }, - AreaProportion: { - text: '房屋计费面积分摊', - color: '#10b981', - value: 'AreaProportion', - }, - FixedRatio: { text: '按固定比例分摊', color: '#f59e0b', value: 'FixedRatio' }, +export const HouseChargeStandardsApportionmentMethodEnum= { + 'HouseCount': {"text":"房屋数分摊","color":"#3b82f6","value":"HouseCount"}, + 'AreaProportion': {"text":"房屋计费面积分摊","color":"#10b981","value":"AreaProportion"}, + 'FixedRatio': {"text":"按固定比例分摊","color":"#f59e0b","value":"FixedRatio"}, }; // HouseChargeStandardsCalculationMethodEnum -export const HouseChargeStandardsCalculationMethodEnum = { - ChargeableArea: { - text: '计费面积', - color: '#3b82f6', - value: 'ChargeableArea', - }, - BuiltArea: { text: '建筑面积', color: '#10b981', value: 'BuiltArea' }, - InsideArea: { text: '套内面积', color: '#f59e0b', value: 'InsideArea' }, - PerUnit: { text: '按套', color: '#06b6d4', value: 'PerUnit' }, - ElectricityUsage: { - text: '用电量', - color: '#8b5cf6', - value: 'ElectricityUsage', - }, - WaterUsage: { text: '用水量', color: '#ec4899', value: 'WaterUsage' }, +export const HouseChargeStandardsCalculationMethodEnum= { + 'ChargeableArea': {"text":"计费面积","color":"#3b82f6","value":"ChargeableArea"}, + 'BuiltArea': {"text":"建筑面积","color":"#10b981","value":"BuiltArea"}, + 'InsideArea': {"text":"套内面积","color":"#f59e0b","value":"InsideArea"}, + 'PerUnit': {"text":"按套","color":"#06b6d4","value":"PerUnit"}, + 'ElectricityUsage': {"text":"用电量","color":"#8b5cf6","value":"ElectricityUsage"}, + 'WaterUsage': {"text":"用水量","color":"#ec4899","value":"WaterUsage"}, }; // HouseChargeStandardsCalculationModeEnum -export const HouseChargeStandardsCalculationModeEnum = { - FixedAmount: { text: '固定金额', color: '#3b82f6', value: 'FixedAmount' }, - QuantityPrice: { - text: '数量*单价', - color: '#10b981', - value: 'QuantityPrice', - }, +export const HouseChargeStandardsCalculationModeEnum= { + 'FixedAmount': {"text":"固定金额","color":"#3b82f6","value":"FixedAmount"}, + 'QuantityPrice': {"text":"数量*单价","color":"#10b981","value":"QuantityPrice"}, }; // HouseChargeStandardsCalculationPeriodEnum -export const HouseChargeStandardsCalculationPeriodEnum = { - PerTime: { text: '按次', color: '#3b82f6', value: 'PerTime' }, - PerDay: { text: '按日', color: '#10b981', value: 'PerDay' }, - PerMonth: { text: '按月', color: '#f59e0b', value: 'PerMonth' }, - PerYear: { text: '按年', color: '#8b5cf6', value: 'PerYear' }, +export const HouseChargeStandardsCalculationPeriodEnum= { + 'PerTime': {"text":"按次","color":"#3b82f6","value":"PerTime"}, + 'PerDay': {"text":"按日","color":"#10b981","value":"PerDay"}, + 'PerMonth': {"text":"按月","color":"#f59e0b","value":"PerMonth"}, + 'PerYear': {"text":"按年","color":"#8b5cf6","value":"PerYear"}, }; // HouseChargeStandardsPriceAlgorithmEnum -export const HouseChargeStandardsPriceAlgorithmEnum = { - Fixed: { text: '固定', color: '#4caf50', value: 'Fixed' }, - Tiered: { text: '分级价阶梯', color: '#2196f3', value: 'Tiered' }, - Peak: { text: '最高价阶梯', color: '#ff9800', value: 'Peak' }, +export const HouseChargeStandardsPriceAlgorithmEnum= { + 'Fixed': {"text":"固定","color":"#4caf50","value":"Fixed"}, + 'Tiered': {"text":"分级价阶梯","color":"#2196f3","value":"Tiered"}, + 'Peak': {"text":"最高价阶梯","color":"#ff9800","value":"Peak"}, }; // HouseChargeStandardsStatusEnum -export const HouseChargeStandardsStatusEnum = { - Active: { text: '启用', color: '#3b82f6', value: 'Active' }, - Inactive: { text: '禁用', color: '#ef4444', value: 'Inactive' }, +export const HouseChargeStandardsStatusEnum= { + 'Active': {"text":"启用","color":"#3b82f6","value":"Active"}, + 'Inactive': {"text":"禁用","color":"#ef4444","value":"Inactive"}, }; // HouseChargeStandardsTypeEnum -export const HouseChargeStandardsTypeEnum = { - House: { text: '房屋', color: '#3b82f6', value: 'House' }, - Meter: { text: '仪表', color: '#10b981', value: 'Meter' }, - CarPort: { text: '车位', color: '#f59e0b', value: 'CarPort' }, +export const HouseChargeStandardsTypeEnum= { + 'House': {"text":"房屋","color":"#3b82f6","value":"House"}, + 'Meter': {"text":"仪表","color":"#10b981","value":"Meter"}, + 'CarPort': {"text":"车位","color":"#f59e0b","value":"CarPort"}, }; // HouseChargeTaskDetailsStatusEnum -export const HouseChargeTaskDetailsStatusEnum = { - Pending: { text: '待处理', color: '#f59e0b', value: 'Pending' }, - Success: { text: '成功', color: '#22c55e', value: 'Success' }, - Failed: { text: '失败', color: '#ef4444', value: 'Failed' }, +export const HouseChargeTaskDetailsStatusEnum= { + 'Pending': {"text":"待处理","color":"#f59e0b","value":"Pending"}, + 'Success': {"text":"成功","color":"#22c55e","value":"Success"}, + 'Failed': {"text":"失败","color":"#ef4444","value":"Failed"}, }; // HouseChargeTaskDetailsTargetTypeEnum -export const HouseChargeTaskDetailsTargetTypeEnum = { - House: { text: '房屋', color: '#3b82f6', value: 'House' }, - CarPort: { text: '车位', color: '#f59e0b', value: 'CarPort' }, +export const HouseChargeTaskDetailsTargetTypeEnum= { + 'House': {"text":"房屋","color":"#3b82f6","value":"House"}, + 'CarPort': {"text":"车位","color":"#f59e0b","value":"CarPort"}, }; // HouseChargeTasksStatusEnum -export const HouseChargeTasksStatusEnum = { - Pending: { text: '待执行', color: '#f59e0b', value: 'Pending' }, - InProgress: { text: '执行中', color: '#3b82f6', value: 'InProgress' }, - Completed: { text: '已完成', color: '#10b981', value: 'Completed' }, - Failed: { text: '失败', color: '#ef4444', value: 'Failed' }, +export const HouseChargeTasksStatusEnum= { + 'Pending': {"text":"待执行","color":"#f59e0b","value":"Pending"}, + 'InProgress': {"text":"执行中","color":"#3b82f6","value":"InProgress"}, + 'Completed': {"text":"已完成","color":"#10b981","value":"Completed"}, + 'Failed': {"text":"失败","color":"#ef4444","value":"Failed"}, }; // HouseChargeTasksTypeEnum -export const HouseChargeTasksTypeEnum = { - Scheduled: { text: '定时创建', color: '#3b82f6', value: 'Scheduled' }, - Manual: { text: '手动创建', color: '#10b981', value: 'Manual' }, +export const HouseChargeTasksTypeEnum= { + 'Scheduled': {"text":"定时创建","color":"#3b82f6","value":"Scheduled"}, + 'Manual': {"text":"手动创建","color":"#10b981","value":"Manual"}, }; // HouseCollectionRecordsCollectionResultEnum -export const HouseCollectionRecordsCollectionResultEnum = { - PromiseToPay: { text: '承诺缴费', color: '#4caf50', value: 'PromiseToPay' }, - RefuseToPay: { text: '拒绝缴费', color: '#f44336', value: 'RefuseToPay' }, - NotReached: { text: '未联系到', color: '#9e9e9e', value: 'NotReached' }, - NeedFollowUp: { text: '需要跟进', color: '#ff9800', value: 'NeedFollowUp' }, +export const HouseCollectionRecordsCollectionResultEnum= { + 'PromiseToPay': {"text":"承诺缴费","color":"#4caf50","value":"PromiseToPay"}, + 'RefuseToPay': {"text":"拒绝缴费","color":"#f44336","value":"RefuseToPay"}, + 'NotReached': {"text":"未联系到","color":"#9e9e9e","value":"NotReached"}, + 'NeedFollowUp': {"text":"需要跟进","color":"#ff9800","value":"NeedFollowUp"}, }; // HouseCollectionRecordsSmsStatusEnum -export const HouseCollectionRecordsStatusEnum = { - NotNotified: { text: '未通知', color: '#808080', value: 'NotNotified' }, - Notified: { text: '已通知', color: '#00cc00', value: 'Notified' }, - Failed: { text: '失败', color: '#ff0000', value: 'Failed' }, +export const HouseCollectionRecordsStatusEnum= { + 'NotNotified': {"text":"未通知","color":"#808080","value":"NotNotified"}, + 'Notified': {"text":"已通知","color":"#00cc00","value":"Notified"}, + 'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, }; // HouseCollectionTasksChannelEnum -export const HouseCollectionTasksChannelEnum = { - SMS: { text: '短信', color: '#1E90FF', value: 'SMS' }, - MiniProgram: { text: '小程序', color: '#00BFFF', value: 'MiniProgram' }, - OfficialAccount: { - text: '公众号', - color: '#32CD32', - value: 'OfficialAccount', - }, - PhoneCall: { text: '电话催缴', color: '#FF8C00', value: 'PhoneCall' }, - Visit: { text: '上门催缴', color: '#8B4513', value: 'Visit' }, - WeChat: { text: '微信联系', color: '#20B2AA', value: 'WeChat' }, - WrittenNotice: { text: '书面通知', color: '#708090', value: 'WrittenNotice' }, +export const HouseCollectionTasksChannelEnum= { + 'SMS': {"text":"短信","color":"#1E90FF","value":"SMS"}, + 'MiniProgram': {"text":"小程序","color":"#00BFFF","value":"MiniProgram"}, + 'OfficialAccount': {"text":"公众号","color":"#32CD32","value":"OfficialAccount"}, + 'PhoneCall': {"text":"电话催缴","color":"#FF8C00","value":"PhoneCall"}, + 'Visit': {"text":"上门催缴","color":"#8B4513","value":"Visit"}, + 'WeChat': {"text":"微信联系","color":"#20B2AA","value":"WeChat"}, + 'WrittenNotice': {"text":"书面通知","color":"#708090","value":"WrittenNotice"}, }; // HouseCollectionTasksStatusEnum -export const HouseCollectionTasksStatusEnum = { - Processing: { text: '进行中', color: '#ffcc00', value: 'Processing' }, - Completed: { text: '已完成', color: '#00cc00', value: 'Completed' }, - Failed: { text: '失败', color: '#ff0000', value: 'Failed' }, +export const HouseCollectionTasksStatusEnum= { + 'Processing': {"text":"进行中","color":"#ffcc00","value":"Processing"}, + 'Completed': {"text":"已完成","color":"#00cc00","value":"Completed"}, + 'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, }; // HouseMeterReadingsOperationTypeEnum -export const HouseMeterReadingsOperationTypeEnum = { - NormalReading: { text: '正常抄表', color: '#4caf50', value: 'NormalReading' }, - ResetReading: { text: '重置读数', color: '#f44336', value: 'ResetReading' }, - CorrectReading: { - text: '修正读数', - color: '#ff9800', - value: 'CorrectReading', - }, +export const HouseMeterReadingsOperationTypeEnum= { + 'NormalReading': {"text":"正常抄表","color":"#4caf50","value":"NormalReading"}, + 'ResetReading': {"text":"重置读数","color":"#f44336","value":"ResetReading"}, + 'CorrectReading': {"text":"修正读数","color":"#ff9800","value":"CorrectReading"}, }; // HouseMeterTasksGenerationMethodEnum -export const HouseMeterTasksGenerationMethodEnum = { - Building: { text: '按楼栋', color: '#4caf50', value: 'Building' }, - Unit: { text: '按单元', color: '#2196f3', value: 'Unit' }, - Meter: { text: '按仪表', color: '#ff9800', value: 'Meter' }, +export const HouseMeterTasksGenerationMethodEnum= { + 'Building': {"text":"按楼栋","color":"#4caf50","value":"Building"}, + 'Unit': {"text":"按单元","color":"#2196f3","value":"Unit"}, + 'Meter': {"text":"按仪表","color":"#ff9800","value":"Meter"}, }; // HouseMetersMeterTypeEnum -export const HouseMetersMeterTypeEnum = { - HouseMeter: { text: '房屋表', color: '#4caf50', value: 'HouseMeter' }, - CommonMeter: { text: '公摊表', color: '#2196f3', value: 'CommonMeter' }, +export const HouseMetersMeterTypeEnum= { + 'HouseMeter': {"text":"房屋表","color":"#4caf50","value":"HouseMeter"}, + 'CommonMeter': {"text":"公摊表","color":"#2196f3","value":"CommonMeter"}, }; // HouseMetersUsageTypeEnum -export const HouseMetersUsageTypeEnum = { - WaterMeter: { text: '水表', color: '#2196f3', value: 'WaterMeter' }, - ElectricMeter: { text: '电表', color: '#ff9800', value: 'ElectricMeter' }, - GasMeter: { text: '燃气表', color: '#f44336', value: 'GasMeter' }, - HeatingMeter: { text: '暖气表', color: '#9c27b0', value: 'HeatingMeter' }, +export const HouseMetersUsageTypeEnum= { + 'WaterMeter': {"text":"水表","color":"#2196f3","value":"WaterMeter"}, + 'ElectricMeter': {"text":"电表","color":"#ff9800","value":"ElectricMeter"}, + 'GasMeter': {"text":"燃气表","color":"#f44336","value":"GasMeter"}, + 'HeatingMeter': {"text":"暖气表","color":"#9c27b0","value":"HeatingMeter"}, }; // HouseOccupantsCardTypeEnum -export const HouseOccupantsCardTypeEnum = { - MainlandID: { - text: '中国大陆居民身份证', - color: '#2db7f5', - value: 'MainlandID', - }, - HKPermit: { - text: '香港来往大陆通行证(回乡证)', - color: '#fa8c16', - value: 'HKPermit', - }, - MOPermit: { - text: '澳门来往大陆通行证(回乡证)', - color: '#faad14', - value: 'MOPermit', - }, - TWPermit: { - text: '台湾来往大陆通行证(台胞证)', - color: '#87d068', - value: 'TWPermit', - }, - Passport: { text: '护照', color: '#108ee9', value: 'Passport' }, - BusinessLicense: { - text: '营业执照', - color: '#f5222d', - value: 'BusinessLicense', - }, +export const HouseOccupantsCardTypeEnum= { + 'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"}, + 'HKPermit': {"text":"香港来往大陆通行证(回乡证)","color":"#fa8c16","value":"HKPermit"}, + 'MOPermit': {"text":"澳门来往大陆通行证(回乡证)","color":"#faad14","value":"MOPermit"}, + 'TWPermit': {"text":"台湾来往大陆通行证(台胞证)","color":"#87d068","value":"TWPermit"}, + 'Passport': {"text":"护照","color":"#108ee9","value":"Passport"}, + 'BusinessLicense': {"text":"营业执照","color":"#f5222d","value":"BusinessLicense"}, }; // HouseOccupantsHouseRelationEnum -export const HouseOccupantsHouseRelationEnum = { - Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' }, - NonOwner: { text: '非产权人', color: '#fa8c16', value: 'NonOwner' }, +export const HouseOccupantsHouseRelationEnum= { + 'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, + 'NonOwner': {"text":"非产权人","color":"#fa8c16","value":"NonOwner"}, }; // HouseOccupantsRelationWithOwnerEnum -export const HouseOccupantsRelationWithOwnerEnum = { - Self: { text: '本人', color: '#52c41a', value: 'Self' }, - Spouse: { text: '配偶', color: '#2db7f5', value: 'Spouse' }, - Children: { text: '子女', color: '#87d068', value: 'Children' }, - Parents: { text: '父母', color: '#faad14', value: 'Parents' }, - Siblings: { text: '兄弟姐妹', color: '#fa8c16', value: 'Siblings' }, - OtherRelatives: { text: '其他', color: '#f5222d', value: 'OtherRelatives' }, - PrimaryTenant: { text: '主租客', color: '#722ed1', value: 'PrimaryTenant' }, - Tenant: { text: '租客', color: '#1890ff', value: 'Tenant' }, +export const HouseOccupantsRelationWithOwnerEnum= { + 'Self': {"text":"本人","color":"#52c41a","value":"Self"}, + 'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"}, + 'Children': {"text":"子女","color":"#87d068","value":"Children"}, + 'Parents': {"text":"父母","color":"#faad14","value":"Parents"}, + 'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"}, + 'OtherRelatives': {"text":"其他","color":"#f5222d","value":"OtherRelatives"}, + 'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"}, + 'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"}, }; // HouseOccupantsResidentialRelationEnum -export const HouseOccupantsResidentialRelationEnum = { - PropertyOwner: { text: '产权人', color: '#722ed1', value: 'PropertyOwner' }, - Resident: { text: '住户', color: '#2db7f5', value: 'Resident' }, - PrimaryTenant: { text: '主租人', color: '#87d068', value: 'PrimaryTenant' }, - Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' }, +export const HouseOccupantsResidentialRelationEnum= { + 'PropertyOwner': {"text":"产权人","color":"#722ed1","value":"PropertyOwner"}, + 'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"}, + 'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"}, + 'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"}, }; // HouseOccupantsStatusEnum -export const HouseOccupantsStatusEnum = { - Normal: { text: '绑定', color: '#52c41a', value: 'Normal' }, - Unbound: { text: '解绑', color: '#f5222d', value: 'Unbound' }, +export const HouseOccupantsStatusEnum= { + 'Normal': {"text":"绑定","color":"#52c41a","value":"Normal"}, + 'Unbound': {"text":"解绑","color":"#f5222d","value":"Unbound"}, }; // HouseOrderRefundsRefundStatusEnum -export const HouseOrderRefundsRefundStatusEnum = { - Requested: { text: '已申请', color: '#2196f3', value: 'Requested' }, - Reviewing: { text: '审核中', color: '#ff9800', value: 'Reviewing' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, - Processing: { text: '退款中', color: '#9c27b0', value: 'Processing' }, - Refunded: { text: '已退款', color: '#4caf50', value: 'Refunded' }, - Failed: { text: '退款失败', color: '#e91e63', value: 'Failed' }, +export const HouseOrderRefundsRefundStatusEnum= { + 'Requested': {"text":"已申请","color":"#2196f3","value":"Requested"}, + 'Reviewing': {"text":"审核中","color":"#ff9800","value":"Reviewing"}, + 'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"}, + 'Processing': {"text":"退款中","color":"#9c27b0","value":"Processing"}, + 'Refunded': {"text":"已退款","color":"#4caf50","value":"Refunded"}, + 'Failed': {"text":"退款失败","color":"#e91e63","value":"Failed"}, }; // 订单审核状态枚举 -export const HouseOrdersAuditStatusEnum = { - Pending: { text: '待审核', color: '#f59e0b', value: 'Pending' }, - Approved: { text: '已通过', color: '#10b981', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#ef4444', value: 'Rejected' }, +export const HouseOrdersAuditStatusEnum= { + 'Pending': {"text":"待审核","color":"#f59e0b","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#10b981","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#ef4444","value":"Rejected"}, }; // 订单状态枚举 -export const HouseOrdersOrderStatusEnum = { - Pending: { text: '待支付', color: '#facc15', value: 'Pending' }, - ToBeConfirmed: { text: '待确认', color: '#fb923c', value: 'ToBeConfirmed' }, - Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, - Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' }, - Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, - Failed: { text: '支付失败', color: '#ef4444', value: 'Failed' }, +export const HouseOrdersOrderStatusEnum= { + 'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, + 'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"}, + 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"}, + 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, + 'Failed': {"text":"支付失败","color":"#ef4444","value":"Failed"}, }; // HouseOrdersPaymentMethodEnum -export const HouseOrdersPaymentMethodEnum = { - WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, - BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, - TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, - Prepayment: { text: '预缴支付', color: '#f59e0b', value: 'Prepayment' }, - POS: { text: 'POS机', color: '#8b5cf6', value: 'POS' }, - Cash: { text: '现金', color: '#dc2626', value: 'Cash' }, +export const HouseOrdersPaymentMethodEnum= { + 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, + 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, + 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, + 'Prepayment': {"text":"预缴支付","color":"#f59e0b","value":"Prepayment"}, + 'POS': {"text":"POS机","color":"#8b5cf6","value":"POS"}, + 'Cash': {"text":"现金","color":"#dc2626","value":"Cash"}, + 'CCB': {"text":"建行惠市宝","color":"#003da5","value":"CCB"}, }; // HousePrepaymentLogsTypeEnum -export const HousePrepaymentLogsTypeEnum = { - Add: { text: '加', color: '#52c41a', value: 'Add' }, - Subtract: { text: '减', color: '#f5222d', value: 'Subtract' }, +export const HousePrepaymentLogsTypeEnum= { + 'Add': {"text":"加","color":"#52c41a","value":"Add"}, + 'Subtract': {"text":"减","color":"#f5222d","value":"Subtract"}, }; // HouseRegistersCustomerTypeEnum -export const HouseRegistersCustomerTypeEnum = { - Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' }, - Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' }, - Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' }, - Government: { text: '政府组织', color: '#f5222d', value: 'Government' }, +export const HouseRegistersCustomerTypeEnum= { + 'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"}, + 'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"}, + 'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"}, + 'Government': {"text":"政府组织","color":"#f5222d","value":"Government"}, }; // HouseRegistersHouseStatusEnum -export const HouseRegistersHouseStatusEnum = { - SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, - Rented: { text: '出租', color: '#007bff', value: 'Rented' }, - Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, +export const HouseRegistersHouseStatusEnum= { + 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, + 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, + 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, }; // 房屋登记身份类型 -export const HouseRegistersIdentityTypeEnum = { - Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' }, - Tenant: { text: '租客', color: '#87d068', value: 'Tenant' }, - CoResident: { text: '同住人(亲属)', color: '#108ee9', value: 'CoResident' }, +export const HouseRegistersIdentityTypeEnum= { + 'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, + 'Tenant': {"text":"租客","color":"#87d068","value":"Tenant"}, + 'CoResident': {"text":"同住人(亲属)","color":"#108ee9","value":"CoResident"}, }; // HouseRegistersStatusEnum -export const HouseRegistersStatusEnum = { - Pending: { text: '待审', color: '#faad14', value: 'Pending' }, - Approved: { text: '通过', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, +export const HouseRegistersStatusEnum= { + 'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"通过","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, }; // HouseRegistersTypeEnum -export const HouseRegistersTypeEnum = { - AddOwner: { text: '添加产权人', color: '#52c41a', value: 'AddOwner' }, - RemoveOwner: { text: '减少产权人', color: '#d9363e', value: 'RemoveOwner' }, - AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' }, - RemoveOccupant: { - text: '移除住户', - color: '#fa8c16', - value: 'RemoveOccupant', - }, - MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' }, - MoveIn: { text: '搬入登记', color: '#ffc53d', value: 'MoveIn' }, - UpdateInfo: { text: '修改信息', color: '#722ed1', value: 'UpdateInfo' }, - UpdatePhone: { text: '修改电话', color: '#13c2c2', value: 'UpdatePhone' }, - GoodsRelease: { text: '物品放行', color: '#a0d911', value: 'GoodsRelease' }, - VisitorApplies: { - text: '来访申请', - color: '#a0d911', - value: 'VisitorApplies', - }, +export const HouseRegistersTypeEnum= { + 'AddOwner': {"text":"添加产权人","color":"#52c41a","value":"AddOwner"}, + 'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"}, + 'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"}, + 'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"}, + 'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"}, + 'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"}, + 'UpdateInfo': {"text":"修改信息","color":"#722ed1","value":"UpdateInfo"}, + 'UpdatePhone': {"text":"修改电话","color":"#13c2c2","value":"UpdatePhone"}, + 'GoodsRelease': {"text":"物品放行","color":"#a0d911","value":"GoodsRelease"}, + 'VisitorApplies': {"text":"来访申请","color":"#a0d911","value":"VisitorApplies"}, + 'Transfer': {"text":"过户","color":"#1890ff","value":"Transfer"}, }; // HouseRegistersUsagePlanEnum -export const HouseRegistersUsagePlanEnum = { - Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' }, - Vacation: { text: '度假', color: '#faad14', value: 'Vacation' }, - Rental: { text: '出租', color: '#2db7f5', value: 'Rental' }, - Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' }, +export const HouseRegistersUsagePlanEnum= { + 'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"}, + 'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"}, + 'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"}, + 'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"}, }; // HouseWorkOrdersAcceptResultEnum -export const HouseWorkOrdersAcceptResultEnum = { - Satisfied: { text: '满意', color: '#28A745', value: 'Satisfied' }, - Unsatisfied: { text: '不满意', color: '#DC3545', value: 'Unsatisfied' }, +export const HouseWorkOrdersAcceptResultEnum= { + 'Satisfied': {"text":"满意","color":"#28A745","value":"Satisfied"}, + 'Unsatisfied': {"text":"不满意","color":"#DC3545","value":"Unsatisfied"}, }; // HouseWorkOrdersAssignStatusEnum -export const HouseWorkOrdersAssignStatusEnum = { - Unassigned: { text: '未指派', color: '#ff0000', value: 'Unassigned' }, - Assigned: { text: '已指派', color: '#00ff00', value: 'Assigned' }, +export const HouseWorkOrdersAssignStatusEnum= { + 'Unassigned': {"text":"未指派","color":"#ff0000","value":"Unassigned"}, + 'Assigned': {"text":"已指派","color":"#00ff00","value":"Assigned"}, }; // HouseWorkOrdersComplaintTypeEnum -export const HouseWorkOrdersComplaintTypeEnum = { - Hygiene: { text: '卫生环境', color: '#ff0000', value: 'Hygiene' }, - Greening: { text: '绿植绿化', color: '#00aaff', value: 'Greening' }, - Safety: { text: '安全问题', color: '#ffaa00', value: 'Safety' }, - Maintenance: { text: '维修问题', color: '#aa00ff', value: 'Maintenance' }, - PropertyService: { - text: '物业服务', - color: '#00aa55', - value: 'PropertyService', - }, - Staff: { text: '工作人员', color: '#ff00aa', value: 'Staff' }, - Other: { text: '其他', color: '#aaaaaa', value: 'Other' }, +export const HouseWorkOrdersComplaintTypeEnum= { + 'Hygiene': {"text":"卫生环境","color":"#ff0000","value":"Hygiene"}, + 'Greening': {"text":"绿植绿化","color":"#00aaff","value":"Greening"}, + 'Safety': {"text":"安全问题","color":"#ffaa00","value":"Safety"}, + 'Maintenance': {"text":"维修问题","color":"#aa00ff","value":"Maintenance"}, + 'PropertyService': {"text":"物业服务","color":"#00aa55","value":"PropertyService"}, + 'Staff': {"text":"工作人员","color":"#ff00aa","value":"Staff"}, + 'Other': {"text":"其他","color":"#aaaaaa","value":"Other"}, }; // HouseWorkOrdersLevelEnum -export const HouseWorkOrdersLevelEnum = { - Urgent: { text: '紧急', color: '#ff0000', value: 'Urgent' }, - High: { text: '高', color: '#ff7f00', value: 'High' }, - Medium: { text: '中', color: '#00cc00', value: 'Medium' }, - Low: { text: '低', color: '#999999', value: 'Low' }, +export const HouseWorkOrdersLevelEnum= { + 'Urgent': {"text":"紧急","color":"#ff0000","value":"Urgent"}, + 'High': {"text":"高","color":"#ff7f00","value":"High"}, + 'Medium': {"text":"中","color":"#00cc00","value":"Medium"}, + 'Low': {"text":"低","color":"#999999","value":"Low"}, }; // HouseWorkOrdersLocationEnum -export const HouseWorkOrdersLocationEnum = { - CommonArea: { text: '公共区域', color: '#ff0000', value: 'CommonArea' }, - MyHome: { text: '房屋', color: '#00ff00', value: 'MyHome' }, +export const HouseWorkOrdersLocationEnum= { + 'CommonArea': {"text":"公共区域","color":"#ff0000","value":"CommonArea"}, + 'MyHome': {"text":"房屋","color":"#00ff00","value":"MyHome"}, }; // HouseWorkOrdersRefundStatusEnum -export const HouseWorkOrdersRefundStatusEnum = { - Refunding: { text: '退款中', color: '#FFA500', value: 'Refunding' }, - Refunded: { text: '已退款', color: '#28A745', value: 'Refunded' }, - PartialRefund: { text: '部分退款', color: '#17A2B8', value: 'PartialRefund' }, +export const HouseWorkOrdersRefundStatusEnum= { + 'Refunding': {"text":"退款中","color":"#FFA500","value":"Refunding"}, + 'Refunded': {"text":"已退款","color":"#28A745","value":"Refunded"}, + 'PartialRefund': {"text":"部分退款","color":"#17A2B8","value":"PartialRefund"}, }; // HouseWorkOrdersStatusEnum -export const HouseWorkOrdersStatusEnum = { - Pending: { text: '待处理', color: '#FFA500', value: 'Pending' }, - Processing: { text: '处理中', color: '#1E90FF', value: 'Processing' }, - PendingPayment: { text: '待支付', color: '#FF8C00', value: 'PendingPayment' }, - PendingAcceptance: { - text: '待验收', - color: '#17A2B8', - value: 'PendingAcceptance', - }, - Completed: { text: '已完成', color: '#28A745', value: 'Completed' }, - Closed: { text: '已关闭', color: '#6C757D', value: 'Closed' }, +export const HouseWorkOrdersStatusEnum= { + 'Pending': {"text":"待处理","color":"#FFA500","value":"Pending"}, + 'Processing': {"text":"处理中","color":"#1E90FF","value":"Processing"}, + 'PendingPayment': {"text":"待支付","color":"#FF8C00","value":"PendingPayment"}, + 'PendingAcceptance': {"text":"待验收","color":"#17A2B8","value":"PendingAcceptance"}, + 'Completed': {"text":"已完成","color":"#28A745","value":"Completed"}, + 'Closed': {"text":"已关闭","color":"#6C757D","value":"Closed"}, }; // HouseWorkOrdersTypeEnum -export const HouseWorkOrdersTypeEnum = { - Repair: { text: '报修', color: '#ff0000', value: 'Repair' }, - Incident: { text: '报事', color: '#00aaff', value: 'Incident' }, - Complaint: { text: '投诉', color: '#aa00ff', value: 'Complaint' }, - QualityCheck: { text: '品质检查', color: '#16a085', value: 'QualityCheck' }, - RenovationInspection: { - text: '装修巡检', - color: '#8e44ad', - value: 'RenovationInspection', - }, - RenovationAcceptance: { - text: '装修验收', - color: '#2980b9', - value: 'RenovationAcceptance', - }, +export const HouseWorkOrdersTypeEnum= { + 'Repair': {"text":"报修","color":"#ff0000","value":"Repair"}, + 'Incident': {"text":"报事","color":"#00aaff","value":"Incident"}, + 'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"}, + 'QualityCheck': {"text":"品质检查","color":"#16a085","value":"QualityCheck"}, + 'RenovationInspection': {"text":"装修巡检","color":"#8e44ad","value":"RenovationInspection"}, + 'RenovationAcceptance': {"text":"装修验收","color":"#2980b9","value":"RenovationAcceptance"}, + 'SecurityInspection': {"text":"安全巡检","color":"#e67e22","value":"SecurityInspection"}, }; -// -export const InfoVerificationEnum = { - Authentic: { text: '真实完整', color: '#28a745', value: 'Authentic' }, - Discrepancy: { text: '存在差异', color: '#ffc107', value: 'Discrepancy' }, - Fake: { text: '信息造假', color: '#dc3545', value: 'Fake' }, +// +export const InfoVerificationEnum= { + 'Authentic': {"text":"真实完整","color":"#28a745","value":"Authentic"}, + 'Discrepancy': {"text":"存在差异","color":"#ffc107","value":"Discrepancy"}, + 'Fake': {"text":"信息造假","color":"#dc3545","value":"Fake"}, }; // 公告阅读者类型 -export const MsgPropertyAnnouncementReadsReaderTypeEnum = { - Customer: { text: '客户', color: '#3b82f6', value: 'Customer' }, - Employee: { text: '员工', color: '#10b981', value: 'Employee' }, +export const MsgPropertyAnnouncementReadsReaderTypeEnum= { + 'Customer': {"text":"客户","color":"#3b82f6","value":"Customer"}, + 'Employee': {"text":"员工","color":"#10b981","value":"Employee"}, }; // 公告接收对象 -export const MsgPropertyAnnouncementsObjectEnum = { - Customer: { text: '客户', color: '#3b82f6', value: 'Customer' }, - Employee: { text: '员工', color: '#10b981', value: 'Employee' }, +export const MsgPropertyAnnouncementsObjectEnum= { + 'Customer': {"text":"客户","color":"#3b82f6","value":"Customer"}, + 'Employee': {"text":"员工","color":"#10b981","value":"Employee"}, }; // MsgPropertyAnnouncementsPublishTypeEnum -export const MsgPropertyAnnouncementsPublishTypeEnum = { - Manual: { text: '手动', color: '#4caf50', value: 'Manual' }, - Schedule: { text: '定时', color: '#2196f3', value: 'Schedule' }, +export const MsgPropertyAnnouncementsPublishTypeEnum= { + 'Manual': {"text":"手动","color":"#4caf50","value":"Manual"}, + 'Schedule': {"text":"定时","color":"#2196f3","value":"Schedule"}, }; // OrganizationsTypeEnum -export const OrganizationsTypeEnum = { - Group: { text: '集团', color: '#007bff', value: 'Group' }, - Company: { text: '公司', color: '#28a745', value: 'Company' }, - ManagementOffice: { - text: '管理处', - color: '#ffc107', - value: 'ManagementOffice', - }, - Department: { text: '部门', color: '#dc3545', value: 'Department' }, +export const OrganizationsTypeEnum= { + 'Group': {"text":"集团","color":"#007bff","value":"Group"}, + 'Company': {"text":"公司","color":"#28a745","value":"Company"}, + 'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"}, + 'Department': {"text":"部门","color":"#dc3545","value":"Department"}, +}; + +// 巡逻路线生成方式 +export const PatrolRoutesGenerationMethodEnum= { + 'Daily': {"text":"按天","color":"#007bff","value":"Daily"}, + 'Weekly': {"text":"按周","color":"#28a745","value":"Weekly"}, + 'Monthly': {"text":"按月","color":"#ffc107","value":"Monthly"}, +}; + +// 巡逻任务地点状态 +export const PatrolTaskLocationsStatusEnum= { + 'Incomplete': {"text":"未完成","color":"#ff9800","value":"Incomplete"}, + 'Completed': {"text":"已完成","color":"#4caf50","value":"Completed"}, +}; + +// 巡逻任务创建方式 +export const PatrolTasksCreateTypeEnum= { + 'Auto': {"text":"定时生成","color":"#2196f3","value":"Auto"}, + 'Manual': {"text":"手动创建","color":"#4caf50","value":"Manual"}, +}; + +// 巡逻任务状态 +export const PatrolTasksStatusEnum= { + 'Unassigned': {"text":"未分配","color":"#9e9e9e","value":"Unassigned"}, + 'Pending': {"text":"待执行","color":"#ff9800","value":"Pending"}, + 'InProgress': {"text":"进行中","color":"#2196f3","value":"InProgress"}, + 'Completed': {"text":"已完成","color":"#4caf50","value":"Completed"}, + 'Canceled': {"text":"已取消","color":"#f44336","value":"Canceled"}, + 'Overdue': {"text":"已超期","color":"#e91e63","value":"Overdue"}, }; // PayTypeEnum -export const PayTypeEnum = { - WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, +export const PayTypeEnum= { + 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, }; -// -export const QualificationEvaluationEnum = { - Compliant: { text: '合规', color: '#28a745', value: 'Compliant' }, - BasicCompliant: { - text: '基本合规', - color: '#ffc107', - value: 'BasicCompliant', - }, - NonCompliant: { text: '不合规', color: '#dc3545', value: 'NonCompliant' }, +// +export const QualificationEvaluationEnum= { + 'Compliant': {"text":"合规","color":"#28a745","value":"Compliant"}, + 'BasicCompliant': {"text":"基本合规","color":"#ffc107","value":"BasicCompliant"}, + 'NonCompliant': {"text":"不合规","color":"#dc3545","value":"NonCompliant"}, }; // 题目类型枚举 -export const QuestionsTypeEnum = { - Score: { text: '评分题', color: '#4caf50', value: 'Score' }, - Fill: { text: '填空题', color: '#2196f3', value: 'Fill' }, +export const QuestionsTypeEnum= { + 'Score': {"text":"评分题","color":"#4caf50","value":"Score"}, + 'Fill': {"text":"填空题","color":"#2196f3","value":"Fill"}, }; -// -export const RatingOutlookEnum = { - Stable: { text: '稳定', color: '#28a745', value: 'Stable' }, - Positive: { text: '正面', color: '#17a2b8', value: 'Positive' }, - Negative: { text: '负面', color: '#dc3545', value: 'Negative' }, - Observation: { text: '观察', color: '#ffc107', value: 'Observation' }, +// +export const RatingOutlookEnum= { + 'Stable': {"text":"稳定","color":"#28a745","value":"Stable"}, + 'Positive': {"text":"正面","color":"#17a2b8","value":"Positive"}, + 'Negative': {"text":"负面","color":"#dc3545","value":"Negative"}, + 'Observation': {"text":"观察","color":"#ffc107","value":"Observation"}, }; // 退款状态枚举 -export const RefundsStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Reviewing: { text: '审核中', color: '#2196f3', value: 'Reviewing' }, - Approved: { text: '已审批', color: '#9c27b0', value: 'Approved' }, - Processing: { text: '退款中', color: '#00bcd4', value: 'Processing' }, - Completed: { text: '已退款', color: '#4caf50', value: 'Completed' }, - PartialRefund: { text: '部分退款', color: '#8bc34a', value: 'PartialRefund' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, - Failed: { text: '退款失败', color: '#e91e63', value: 'Failed' }, - Cancelled: { text: '已取消', color: '#9e9e9e', value: 'Cancelled' }, +export const RefundsStatusEnum= { + 'Pending': {"text":"待审批","color":"#ff9800","value":"Pending"}, + 'Reviewing': {"text":"审核中","color":"#2196f3","value":"Reviewing"}, + 'Approved': {"text":"已审批","color":"#9c27b0","value":"Approved"}, + 'Processing': {"text":"退款中","color":"#00bcd4","value":"Processing"}, + 'Completed': {"text":"已退款","color":"#4caf50","value":"Completed"}, + 'PartialRefund': {"text":"部分退款","color":"#8bc34a","value":"PartialRefund"}, + 'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"}, + 'Failed': {"text":"退款失败","color":"#e91e63","value":"Failed"}, + 'Cancelled': {"text":"已取消","color":"#9e9e9e","value":"Cancelled"}, }; // 退款类型枚举 -export const RefundsTypeEnum = { - HouseBill: { text: '物业费退款', color: '#2196f3', value: 'HouseBill' }, - Bill: { text: '账单退款', color: '#4caf50', value: 'Bill' }, - ContractBill: { text: '合同退款', color: '#ff9800', value: 'ContractBill' }, - RenovationApply: { - text: '退保证金', - color: '#86aac3ff', - value: 'RenovationApply', - }, - HouseDoorCard: { text: '门禁退款', color: '#9c27b0', value: 'HouseDoorCard' }, - HouseWorkOrder: { - text: '工单退款', - color: '#00bcd4', - value: 'HouseWorkOrder', - }, - Other: { text: '其他退款', color: '#607d8b', value: 'Other' }, +export const RefundsTypeEnum= { + 'HouseBill': {"text":"物业费退款","color":"#2196f3","value":"HouseBill"}, + 'Bill': {"text":"账单退款","color":"#4caf50","value":"Bill"}, + 'ContractBill': {"text":"合同退款","color":"#ff9800","value":"ContractBill"}, + 'RenovationApply': {"text":"退保证金","color":"#86aac3ff","value":"RenovationApply"}, + 'HouseDoorCard': {"text":"门禁退款","color":"#9c27b0","value":"HouseDoorCard"}, + 'HouseWorkOrder': {"text":"工单退款","color":"#00bcd4","value":"HouseWorkOrder"}, + 'Other': {"text":"其他退款","color":"#607d8b","value":"Other"}, }; // 装修验收状态 -export const RenovationAppliesAcceptanceStatusEnum = { - PendingAcceptance: { - text: '待验收', - color: '#f1c40f', - value: 'PendingAcceptance', - }, - Accepted: { text: '验收合格', color: '#2ecc71', value: 'Accepted' }, - Rejected: { text: '验收不合格', color: '#e74c3c', value: 'Rejected' }, - Cancelled: { text: '已取消', color: '#95a5a6', value: 'Cancelled' }, +export const RenovationAppliesAcceptanceStatusEnum= { + 'PendingAcceptance': {"text":"待验收","color":"#f1c40f","value":"PendingAcceptance"}, + 'Accepted': {"text":"验收合格","color":"#2ecc71","value":"Accepted"}, + 'Rejected': {"text":"验收不合格","color":"#e74c3c","value":"Rejected"}, + 'Cancelled': {"text":"已取消","color":"#95a5a6","value":"Cancelled"}, }; // 装修施工状态 -export const RenovationAppliesConstructionStatusEnum = { - PendingConstruction: { - text: '待施工', - color: '#f1c40f', - value: 'PendingConstruction', - }, - NormalConstruction: { - text: '正常施工', - color: '#2ecc71', - value: 'NormalConstruction', - }, - StoppedConstruction: { - text: '已停工', - color: '#e74c3c', - value: 'StoppedConstruction', - }, - CompletedConstruction: { - text: '已竣工', - color: '#3498db', - value: 'CompletedConstruction', - }, +export const RenovationAppliesConstructionStatusEnum= { + 'PendingConstruction': {"text":"待施工","color":"#f1c40f","value":"PendingConstruction"}, + 'NormalConstruction': {"text":"正常施工","color":"#2ecc71","value":"NormalConstruction"}, + 'StoppedConstruction': {"text":"已停工","color":"#e74c3c","value":"StoppedConstruction"}, + 'CompletedConstruction': {"text":"已竣工","color":"#3498db","value":"CompletedConstruction"}, }; // 装修办理类型 -export const RenovationAppliesProcessTypeEnum = { - OwnerProcess: { text: '业主办理', color: '#3498db', value: 'OwnerProcess' }, - AgentProcess: { text: '代理人办理', color: '#9b59b6', value: 'AgentProcess' }, +export const RenovationAppliesProcessTypeEnum= { + 'OwnerProcess': {"text":"业主办理","color":"#3498db","value":"OwnerProcess"}, + 'AgentProcess': {"text":"代理人办理","color":"#9b59b6","value":"AgentProcess"}, }; // 装修内容 -export const RenovationAppliesRenovationContentEnum = { - PartialRenovation: { - text: '局部装修', - color: '#f39c12', - value: 'PartialRenovation', - }, - FullHouseRenovation: { - text: '全屋装修', - color: '#2ecc71', - value: 'FullHouseRenovation', - }, - PartialRefurbishment: { - text: '部分翻新', - color: '#3498db', - value: 'PartialRefurbishment', - }, +export const RenovationAppliesRenovationContentEnum= { + 'PartialRenovation': {"text":"局部装修","color":"#f39c12","value":"PartialRenovation"}, + 'FullHouseRenovation': {"text":"全屋装修","color":"#2ecc71","value":"FullHouseRenovation"}, + 'PartialRefurbishment': {"text":"部分翻新","color":"#3498db","value":"PartialRefurbishment"}, }; // 装修申请状态 -export const RenovationAppliesStatusEnum = { - Draft: { text: '暂存', color: '#f39c12', value: 'Draft' }, - Pending: { text: '审核中', color: '#faad14', value: 'Pending' }, - Approved: { text: '已完成', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, - Cancelled: { text: '作废', color: '#9b59b6', value: 'Cancelled' }, +export const RenovationAppliesStatusEnum= { + 'Draft': {"text":"暂存","color":"#f39c12","value":"Draft"}, + 'Pending': {"text":"审核中","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"已完成","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, + 'Cancelled': {"text":"作废","color":"#9b59b6","value":"Cancelled"}, }; // 装修类型 -export const RenovationAppliesTypeEnum = { - SelfRenovation: { text: '自装', color: '#1abc9c', value: 'SelfRenovation' }, - RenovationCompany: { - text: '装修公司', - color: '#e67e22', - value: 'RenovationCompany', - }, +export const RenovationAppliesTypeEnum= { + 'SelfRenovation': {"text":"自装","color":"#1abc9c","value":"SelfRenovation"}, + 'RenovationCompany': {"text":"装修公司","color":"#e67e22","value":"RenovationCompany"}, }; // ResourceOrdersPaymentStatusEnum -export const ResourceOrdersPaymentStatusEnum = { - Unpaid: { text: '未支付', color: '#f59e0b', value: 'Unpaid' }, - Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, - Refunded: { text: '已退款', color: '#3b82f6', value: 'Refunded' }, +export const ResourceOrdersPaymentStatusEnum= { + 'Unpaid': {"text":"未支付","color":"#f59e0b","value":"Unpaid"}, + 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'Refunded': {"text":"已退款","color":"#3b82f6","value":"Refunded"}, }; // ResourceOrdersStatusEnum -export const ResourceOrdersStatusEnum = { - Locked: { text: '已锁定', color: '#8b5cf6', value: 'Locked' }, - Reserved: { text: '已预约', color: '#3b82f6', value: 'Reserved' }, - Used: { text: '已使用', color: '#10b981', value: 'Used' }, - Overed: { text: '已结束', color: '#fca5a5', value: 'Overed' }, - Refunding: { text: '退订中', color: '#f59e0b', value: 'Refunding' }, - Refunded: { text: '已退订', color: '#ef4444', value: 'Refunded' }, - Closed: { text: '已关闭', color: '#6b7280', value: 'Closed' }, +export const ResourceOrdersStatusEnum= { + 'Locked': {"text":"已锁定","color":"#8b5cf6","value":"Locked"}, + 'Reserved': {"text":"已预约","color":"#3b82f6","value":"Reserved"}, + 'Used': {"text":"已使用","color":"#10b981","value":"Used"}, + 'Overed': {"text":"已结束","color":"#fca5a5","value":"Overed"}, + 'Refunding': {"text":"退订中","color":"#f59e0b","value":"Refunding"}, + 'Refunded': {"text":"已退订","color":"#ef4444","value":"Refunded"}, + 'Closed': {"text":"已关闭","color":"#6b7280","value":"Closed"}, }; // ResourceTypesTypeEnum -export const ResourceTypesCategoryEnum = { - Advertising: { text: '广告', color: '#ff9800', value: 'Advertising' }, - Venue: { text: '场地', color: '#4caf50', value: 'Venue' }, +export const ResourceTypesCategoryEnum= { + 'Advertising': {"text":"广告","color":"#ff9800","value":"Advertising"}, + 'Venue': {"text":"场地","color":"#4caf50","value":"Venue"}, }; // ResourcesChannelEnum -export const ResourcesChannelEnum = { - Consumer: { text: 'ToC', color: '#3b82f6', value: 'Consumer' }, - Business: { text: 'ToB', color: '#10b981', value: 'Business' }, +export const ResourcesChannelEnum= { + 'Consumer': {"text":"ToC","color":"#3b82f6","value":"Consumer"}, + 'Business': {"text":"ToB","color":"#10b981","value":"Business"}, }; // ResourcesOpenDaysEnum -export const ResourcesOpenDaysEnum = { - Monday: { text: '星期一', color: '#3b82f6', value: 'Monday' }, - Tuesday: { text: '星期二', color: '#3b82f6', value: 'Tuesday' }, - Wednesday: { text: '星期三', color: '#3b82f6', value: 'Wednesday' }, - Thursday: { text: '星期四', color: '#3b82f6', value: 'Thursday' }, - Friday: { text: '星期五', color: '#3b82f6', value: 'Friday' }, - Saturday: { text: '星期六', color: '#10b981', value: 'Saturday' }, - Sunday: { text: '星期日', color: '#ef4444', value: 'Sunday' }, +export const ResourcesOpenDaysEnum= { + 'Monday': {"text":"星期一","color":"#3b82f6","value":"Monday"}, + 'Tuesday': {"text":"星期二","color":"#3b82f6","value":"Tuesday"}, + 'Wednesday': {"text":"星期三","color":"#3b82f6","value":"Wednesday"}, + 'Thursday': {"text":"星期四","color":"#3b82f6","value":"Thursday"}, + 'Friday': {"text":"星期五","color":"#3b82f6","value":"Friday"}, + 'Saturday': {"text":"星期六","color":"#10b981","value":"Saturday"}, + 'Sunday': {"text":"星期日","color":"#ef4444","value":"Sunday"}, }; // ResourcesReservationRuleEnum -export const ResourcesReservationRuleEnum = { - ByDay: { text: '按天', color: '#3b82f6', value: 'ByDay' }, - BySession: { text: '按场次', color: '#10b981', value: 'BySession' }, +export const ResourcesReservationRuleEnum= { + 'ByDay': {"text":"按天","color":"#3b82f6","value":"ByDay"}, + 'BySession': {"text":"按场次","color":"#10b981","value":"BySession"}, }; // ResourcesReservationStatusEnum -export const ResourcesReservationStatusEnum = { - Fully: { text: '全部预约', color: '#4caf50', value: 'Fully' }, - Partially: { text: '部分预约', color: '#ff9800', value: 'Partially' }, - Not: { text: '无预约', color: '#f44336', value: 'Not' }, +export const ResourcesReservationStatusEnum= { + 'Fully': {"text":"全部预约","color":"#4caf50","value":"Fully"}, + 'Partially': {"text":"部分预约","color":"#ff9800","value":"Partially"}, + 'Not': {"text":"无预约","color":"#f44336","value":"Not"}, }; -// -export const RiskLevelEnum = { - Low: { text: '低风险', color: '#28a745', value: 'Low' }, - Medium: { text: '中风险', color: '#ffc107', value: 'Medium' }, - High: { text: '高风险', color: '#dc3545', value: 'High' }, +// +export const RiskLevelEnum= { + 'Low': {"text":"低风险","color":"#28a745","value":"Low"}, + 'Medium': {"text":"中风险","color":"#ffc107","value":"Medium"}, + 'High': {"text":"高风险","color":"#dc3545","value":"High"}, }; // 性别 -export const SexEnum = { - Male: { text: '男', color: '#0000ff', value: 'Male' }, - FeMale: { text: '女', color: '#ff0000', value: 'FeMale' }, +export const SexEnum= { + 'Male': {"text":"男","color":"#0000ff","value":"Male"}, + 'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"}, }; // 问卷发布方式枚举 -export const SurveyReleasesTypeEnum = { - Manual: { text: '手动发布', color: '#4caf50', value: 'Manual' }, - Timing: { text: '定时发布', color: '#2196f3', value: 'Timing' }, +export const SurveyReleasesTypeEnum= { + 'Manual': {"text":"手动发布","color":"#4caf50","value":"Manual"}, + 'Timing': {"text":"定时发布","color":"#2196f3","value":"Timing"}, }; // SysModuleEnum -export const SysModuleEnum = { - Admin: { text: '管理员', color: '#cf1322', value: 'Admin' }, - Company: { text: '机构', color: '#1890ff', value: 'Company' }, - Employee: { text: '员工', color: '#1890ff', value: 'Employee' }, +export const SysModuleEnum= { + 'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, + 'Company': {"text":"机构","color":"#1890ff","value":"Company"}, + 'Employee': {"text":"员工","color":"#1890ff","value":"Employee"}, }; // SysPermissionsTypeEnum -export const SysPermissionsTypeEnum = { - Directory: { text: '目录', color: '#6d7e14', value: 'Directory' }, - Page: { text: '页面', color: '#4d9a13', value: 'Page' }, - Button: { text: '按钮', color: '#97224f', value: 'Button' }, - QuickAction: { text: '金刚区', color: '#2563eb', value: 'QuickAction' }, - Module: { text: '模块', color: '#0d9488', value: 'Module' }, +export const SysPermissionsTypeEnum= { + 'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"}, + 'Page': {"text":"页面","color":"#4d9a13","value":"Page"}, + 'Button': {"text":"按钮","color":"#97224f","value":"Button"}, + 'QuickAction': {"text":"金刚区","color":"#2563eb","value":"QuickAction"}, + 'Module': {"text":"模块","color":"#0d9488","value":"Module"}, }; // 来访事由 -export const VisitReasonEnum = { - Visit: { text: '拜访', color: '#2196f3', value: 'Visit' }, - Business: { text: '商务', color: '#3f51b5', value: 'Business' }, - Interview: { text: '面试', color: '#9c27b0', value: 'Interview' }, - Private: { text: '私人', color: '#e91e63', value: 'Private' }, - Express: { text: '快递', color: '#00bcd4', value: 'Express' }, - Renovation: { text: '装修', color: '#ff5722', value: 'Renovation' }, - Other: { text: '其他', color: '#607d8b', value: 'Other' }, +export const VisitReasonEnum= { + 'Visit': {"text":"拜访","color":"#2196f3","value":"Visit"}, + 'Business': {"text":"商务","color":"#3f51b5","value":"Business"}, + 'Interview': {"text":"面试","color":"#9c27b0","value":"Interview"}, + 'Private': {"text":"私人","color":"#e91e63","value":"Private"}, + 'Express': {"text":"快递","color":"#00bcd4","value":"Express"}, + 'Renovation': {"text":"装修","color":"#ff5722","value":"Renovation"}, + 'Other': {"text":"其他","color":"#607d8b","value":"Other"}, }; // 访客申请状态 -export const VisitorAppliesStatusEnum = { - Pending: { text: '审核中', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#f44336', value: 'Rejected' }, - Expired: { text: '已失效', color: '#9e9e9e', value: 'Expired' }, +export const VisitorAppliesStatusEnum= { + 'Pending': {"text":"审核中","color":"#ff9800","value":"Pending"}, + 'Approved': {"text":"已通过","color":"#4caf50","value":"Approved"}, + 'Rejected': {"text":"已驳回","color":"#f44336","value":"Rejected"}, + 'Expired': {"text":"已失效","color":"#9e9e9e","value":"Expired"}, }; // 访客申请类型 -export const VisitorApplyTypeEnum = { - invite: { text: '业主邀请', color: '#2196f3', value: 'invite' }, - register: { text: '访客登记', color: '#ff9800', value: 'register' }, +export const VisitorApplyTypeEnum= { + 'invite': {"text":"业主邀请","color":"#2196f3","value":"invite"}, + 'register': {"text":"访客登记","color":"#ff9800","value":"register"}, }; // 通行码状态 -export const VisitorCodeStatusEnum = { - unused: { text: '未使用', color: '#2196f3', value: 'unused' }, - used: { text: '已使用', color: '#4caf50', value: 'used' }, - expired: { text: '已过期', color: '#f44336', value: 'expired' }, +export const VisitorCodeStatusEnum= { + 'unused': {"text":"未使用","color":"#2196f3","value":"unused"}, + 'used': {"text":"已使用","color":"#4caf50","value":"used"}, + 'expired': {"text":"已过期","color":"#f44336","value":"expired"}, }; // 访客扫码类型 -export const VisitorScanTypeEnum = { - enter: { text: '进入', color: '#4caf50', value: 'enter' }, - exit: { text: '离开', color: '#f44336', value: 'exit' }, +export const VisitorScanTypeEnum= { + 'enter': {"text":"进入","color":"#4caf50","value":"enter"}, + 'exit': {"text":"离开","color":"#f44336","value":"exit"}, }; // WechatAuthsPlatformEnum -export const WechatAuthsPlatformEnum = { - MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, - MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, - WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, +export const WechatAuthsPlatformEnum= { + 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, + 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, + 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, }; -// AssetItemDisposalConfirmStatusEnum -export const AssetItemDisposalConfirmStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#f44336', value: 'Rejected' }, -}; - -// AssetItemDisposalResultEnum -export const AssetItemDisposalResultEnum = { - Disposing: { text: '处置中', color: '#ff9800', value: 'Disposing' }, - Disposed: { text: '已处置', color: '#4caf50', value: 'Disposed' }, -}; - -// AssetItemInventoryDetailResultEnum -export const AssetItemInventoryDetailResultEnum = { - Normal: { text: '正常', color: '#4caf50', value: 'Normal' }, - Loss: { text: '盘亏', color: '#f44336', value: 'Loss' }, -}; - -// AssetItemInventoryResultEnum -export const AssetItemInventoryResultEnum = { - Normal: { text: '正常', color: '#4caf50', value: 'Normal' }, - Loss: { text: '盘亏', color: '#f44336', value: 'Loss' }, - Surplus: { text: '盘盈', color: '#2196f3', value: 'Surplus' }, -}; - -// AssetItemInventoryStatusEnum -export const AssetItemInventoryStatusEnum = { - Pending: { text: '待处理', color: '#ff9800', value: 'Pending' }, - Processing: { text: '处理中', color: '#2196f3', value: 'Processing' }, - Completed: { text: '已完成', color: '#4caf50', value: 'Completed' }, - Closed: { text: '已关闭', color: '#607d8b', value: 'Closed' }, -}; - -// AssetItemMaintenanceRuleStatusEnum -export const AssetItemMaintenanceRuleStatusEnum = { - Enabled: { text: '启用', color: '#4caf50', value: 'Enabled' }, - Disabled: { text: '禁用', color: '#f44336', value: 'Disabled' }, -}; - -// AssetItemMaintenanceSourceEnum -export const AssetItemMaintenanceSourceEnum = { - Auto: { text: '自动生成', color: '#2196f3', value: 'Auto' }, - Manual: { text: '手动创建', color: '#ff9800', value: 'Manual' }, -}; - -// AssetItemMaintenanceStatusEnum -export const AssetItemMaintenanceStatusEnum = { - Pending: { text: '待处理', color: '#ff9800', value: 'Pending' }, - Assigned: { text: '待开始', color: '#2196f3', value: 'Assigned' }, - Processing: { text: '处理中', color: '#9c27b0', value: 'Processing' }, - Completed: { text: '已完成', color: '#4caf50', value: 'Completed' }, - Closed: { text: '已关闭', color: '#607d8b', value: 'Closed' }, -}; - -// AssetItemMaintenanceTypeEnum -export const AssetItemMaintenanceTypeEnum = { - Maintenance: { text: '维保', color: '#4caf50', value: 'Maintenance' }, - Repair: { text: '维修', color: '#f44336', value: 'Repair' }, -}; - -// AssetItemMarkingConfirmStatusEnum -export const AssetItemMarkingConfirmStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#f44336', value: 'Rejected' }, -}; - -// AssetItemMarkingTypeEnum -export const AssetItemMarkingTypeEnum = { - Damaged: { text: '损毁', color: '#f44336', value: 'Damaged' }, - Lost: { text: '丢失', color: '#9c27b0', value: 'Lost' }, -}; - -// AssetItemReceiveConfirmStatusEnum -export const AssetItemReceiveConfirmStatusEnum = { - Pending: { text: '待确认', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已确认', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, -}; - -// AssetItemReturnConfirmStatusEnum -export const AssetItemReturnConfirmStatusEnum = { - Pending: { text: '待确认', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已确认', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已拒绝', color: '#f44336', value: 'Rejected' }, -}; - -// AssetItemTransferConfirmStatusEnum -export const AssetItemTransferConfirmStatusEnum = { - Pending: { text: '待审批', color: '#ff9800', value: 'Pending' }, - Approved: { text: '已通过', color: '#4caf50', value: 'Approved' }, - Rejected: { text: '已驳回', color: '#f44336', value: 'Rejected' }, -}; - -// AssetItemsEntryTypeEnum -export const AssetItemsEntryTypeEnum = { - Purchase: { text: '采购入库', color: '#2196f3', value: 'Purchase' }, - Inventory: { text: '盘盈入库', color: '#4caf50', value: 'Inventory' }, - Donation: { text: '捐赠入库', color: '#9c27b0', value: 'Donation' }, - Transfer: { text: '调拨入库', color: '#ff9800', value: 'Transfer' }, -}; - -// AssetItemsManageStatusEnum -export const AssetItemsManageStatusEnum = { - Idle: { text: '闲置', color: '#9e9e9e', value: 'Idle' }, - Storing: { text: '入库中', color: '#2196f3', value: 'Storing' }, - Transferring: { text: '调拨中', color: '#ff9800', value: 'Transferring' }, - StockLoss: { text: '盘亏', color: '#f44336', value: 'StockLoss' }, - Disposing: { text: '处置中', color: '#9c27b0', value: 'Disposing' }, - Disposed: { text: '已处置', color: '#607d8b', value: 'Disposed' }, - Checking: { text: '盘点中', color: '#00bcd4', value: 'Checking' }, - Maintaining: { text: '维护中', color: '#673ab7', value: 'Maintaining' }, - Receiving: { text: '领用中', color: '#4caf50', value: 'Receiving' }, - Received: { text: '已领用', color: '#8bc34a', value: 'Received' }, -}; - -// AssetItemsStatusEnum -export const AssetItemsStatusEnum = { - Good: { text: '良好', color: '#4caf50', value: 'Good' }, - WaitRepair: { text: '待维修', color: '#ff9800', value: 'WaitRepair' }, - Repairing: { text: '维修中', color: '#2196f3', value: 'Repairing' }, - WaitMaintain: { text: '待保养', color: '#9c27b0', value: 'WaitMaintain' }, - Maintaining: { text: '保养中', color: '#673ab7', value: 'Maintaining' }, - Damaged: { text: '损毁', color: '#f44336', value: 'Damaged' }, - Lost: { text: '丢失', color: '#607d8b', value: 'Lost' }, -}; - -// 下载记录状态 -export const DownloadRecordsStatusEnum = { - Pending: { text: '待处理', color: '#909399', value: 'Pending' }, - Processing: { text: '处理中', color: '#409EFF', value: 'Processing' }, - Done: { text: '已完成', color: '#67C23A', value: 'Done' }, - Failed: { text: '失败', color: '#F56C6C', value: 'Failed' }, -}; - -// HouseDoorCardLogsTypeEnum -export const HouseDoorCardLogsTypeEnum = { - View: { text: '查看', color: '#2196f3', value: 'View' }, - Update: { text: '修改', color: '#4caf50', value: 'Update' }, - ReportLoss: { text: '挂失', color: '#ff9800', value: 'ReportLoss' }, - Invalidate: { text: '作废', color: '#f44336', value: 'Invalidate' }, -}; - -// PatrolRoutesGenerationMethodEnum -export const PatrolRoutesGenerationMethodEnum = { - Daily: { text: '按天', color: '#007bff', value: 'Daily' }, - Weekly: { text: '按周', color: '#28a745', value: 'Weekly' }, - Monthly: { text: '按月', color: '#ffc107', value: 'Monthly' }, -}; - -// PatrolTaskLocationsStatusEnum -export const PatrolTaskLocationsStatusEnum = { - Incomplete: { text: '未完成', color: '#ff9800', value: 'Incomplete' }, - Completed: { text: '已完成', color: '#4caf50', value: 'Completed' }, -}; - -// PatrolTasksCreateTypeEnum -export const PatrolTasksCreateTypeEnum = { - Auto: { text: '定时生成', color: '#2196f3', value: 'Auto' }, - Manual: { text: '手动创建', color: '#4caf50', value: 'Manual' }, -}; - -// PatrolTasksStatusEnum -export const PatrolTasksStatusEnum = { - Unassigned: { text: '未分配', color: '#9e9e9e', value: 'Unassigned' }, - Pending: { text: '待执行', color: '#ff9800', value: 'Pending' }, - InProgress: { text: '进行中', color: '#2196f3', value: 'InProgress' }, - Completed: { text: '已完成', color: '#4caf50', value: 'Completed' }, - Canceled: { text: '已取消', color: '#f44336', value: 'Canceled' }, - Overdue: { text: '已超期', color: '#e91e63', value: 'Overdue' }, -}; - -// 通联交易类型 -export const TongLianPayTypeEnum = { - W06: { text: '微信小程序', color: '#07c160', value: 'W06' }, - A01: { text: '支付宝扫码', color: '#1677ff', value: 'A01' }, - A02: { text: '支付宝JSAPI', color: '#1677ff', value: 'A02' }, -}; diff --git a/src/pages/approval/pending/modals/Forwarded.tsx b/src/pages/approval/pending/modals/Forwarded.tsx index 6d00f09..ea909db 100644 --- a/src/pages/approval/pending/modals/Forwarded.tsx +++ b/src/pages/approval/pending/modals/Forwarded.tsx @@ -12,7 +12,7 @@ import { Form, message } from 'antd'; export default function Index(props: MyBetaModalFormProps & { item: any }) { const [form] = Form.useForm(); return ( - + {...MyModalFormProps.props} title={`转交他人审核`} wrapperCol={{ span: 24 }} diff --git a/src/pages/approval/templates/index.tsx b/src/pages/approval/templates/index.tsx index 0345c32..dd9659b 100644 --- a/src/pages/approval/templates/index.tsx +++ b/src/pages/approval/templates/index.tsx @@ -3,11 +3,12 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ApprovalTemplatesTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import BatchModifyApprover from './modals/BatchModifyApprover'; import Create from './modals/Create'; import Update from './modals/Update'; @@ -31,12 +32,21 @@ export default function Index({ title = '审批模板' }) { } headerTitle={title} toolBarRender={(action) => [ - + ), + add: ( + + ), + }} />, - , ]} columns={[ MyColumns.ID({ @@ -63,17 +73,23 @@ export default function Index({ title = '审批模板' }) { }), MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Approval.ApprovalTemplates.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + render: (_, item: any, _index, action) => ( + + ), + delete: ( + + Apis.Approval.ApprovalTemplates.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/approval/templates/modals/BatchModifyApprover.tsx b/src/pages/approval/templates/modals/BatchModifyApprover.tsx index fa787fa..019158b 100644 --- a/src/pages/approval/templates/modals/BatchModifyApprover.tsx +++ b/src/pages/approval/templates/modals/BatchModifyApprover.tsx @@ -12,7 +12,7 @@ import { Form, message } from 'antd'; export default function Index(props: MyBetaModalFormProps) { const [form] = Form.useForm(); return ( - + {...MyModalFormProps.props} title={`批量修改审批人`} wrapperCol={{ span: 24 }} diff --git a/src/pages/asset/accounts/index.tsx b/src/pages/asset/accounts/index.tsx index 1be6cf6..0ed5523 100644 --- a/src/pages/asset/accounts/index.tsx +++ b/src/pages/asset/accounts/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -38,7 +40,18 @@ export default function Index({ title = '项目账号配置' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -88,12 +101,18 @@ export default function Index({ title = '项目账号配置' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - - Apis.Company.CompanyProjectReceiptAccounts.Delete({ - id: item.id, - }).then(() => action?.reload()) - } + + Apis.Company.CompanyProjectReceiptAccounts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), diff --git a/src/pages/asset/activities/index.tsx b/src/pages/asset/activities/index.tsx index 7b6a87f..320e01c 100644 --- a/src/pages/asset/activities/index.tsx +++ b/src/pages/asset/activities/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -20,80 +21,6 @@ import ActivityUpdate from './modals/ActivityUpdate'; import EnrollsList from './modals/EnrollsList'; export default function Index({ title = '项目活动' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - add: ( - - ), - }); - }; - - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: ( - - ), - enrolls: , - publish: ( - { - let newStatus; - if ( - item.publish_status === - ActivitiesPublishStatusEnum.Unpublished.value - ) { - newStatus = ActivitiesPublishStatusEnum.Published.value; - } else if ( - item.publish_status === - ActivitiesPublishStatusEnum.Published.value - ) { - newStatus = ActivitiesPublishStatusEnum.Unlisted.value; - } else { - newStatus = ActivitiesPublishStatusEnum.Published.value; - } - Apis.Activity.Activities.ChangePublishStatus({ - id: item.id, - publish_status: newStatus, - }).then(() => action?.reload()); - }} - /> - ), - delete: ( - - Apis.Activity.Activities.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; return ( MyProTableProps.request(params, sort, Apis.Activity.Activities.List) } - toolBarRender={(action) => [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ @@ -193,7 +133,76 @@ export default function Index({ title = '项目活动' }) { render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + + ), + enrolls: ( + + ), + publish: ( + { + let newStatus; + if ( + item.publish_status === + ActivitiesPublishStatusEnum.Unpublished.value + ) { + newStatus = + ActivitiesPublishStatusEnum.Published.value; + } else if ( + item.publish_status === + ActivitiesPublishStatusEnum.Published.value + ) { + newStatus = + ActivitiesPublishStatusEnum.Unlisted.value; + } else { + newStatus = + ActivitiesPublishStatusEnum.Published.value; + } + Apis.Activity.Activities.ChangePublishStatus({ + id: item.id, + publish_status: newStatus, + }).then(() => action?.reload()); + }} + /> + ), + delete: ( + + Apis.Activity.Activities.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/activities/modals/EnrollsList.tsx b/src/pages/asset/activities/modals/EnrollsList.tsx index f5d4164..0344ed6 100644 --- a/src/pages/asset/activities/modals/EnrollsList.tsx +++ b/src/pages/asset/activities/modals/EnrollsList.tsx @@ -18,7 +18,7 @@ export default function EnrollsList(props: MyBetaModalFormProps) { width="800px" modal={{ btnProps: { - disabled: !props?.item.is_enroll, + disabled: !props?.item?.is_enroll, }, }} node={ diff --git a/src/pages/asset/announcement/index.tsx b/src/pages/asset/announcement/index.tsx index 5b7648b..3a3e568 100644 --- a/src/pages/asset/announcement/index.tsx +++ b/src/pages/asset/announcement/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -15,60 +16,6 @@ import AnnouncementShow from './modals/AnnouncementShow'; import AnnouncementUpdate from './modals/AnnouncementUpdate'; export default function Index({ title = '项目公告' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - add: ( - - ), - }); - }; - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: ( - - ), - publish: ( - { - let newStatus: boolean; - if (item.is_publish === 0) { - newStatus = true; - } else { - newStatus = false; - } - Apis.Msg.MsgPropertyAnnouncements.IsPublish({ - id: item.id, - is_publish: Boolean(newStatus), - }).then(() => action?.reload()); - }} - /> - ), - delete: ( - - Apis.Msg.MsgPropertyAnnouncements.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ Selects?.AssetProjects({ title: '选择项目', @@ -165,7 +125,46 @@ export default function Index({ title = '项目公告' }) { render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + + ), + publish: ( + { + let newStatus: boolean; + if (item.is_publish === 0) { + newStatus = true; + } else { + newStatus = false; + } + Apis.Msg.MsgPropertyAnnouncements.IsPublish({ + id: item.id, + is_publish: Boolean(newStatus), + }).then(() => action?.reload()); + }} + /> + ), + delete: ( + + Apis.Msg.MsgPropertyAnnouncements.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/asset_list/index.tsx b/src/pages/asset/asset_list/index.tsx index 9a23bae..f2c156c 100644 --- a/src/pages/asset/asset_list/index.tsx +++ b/src/pages/asset/asset_list/index.tsx @@ -1,9 +1,9 @@ import { - MyButtons, MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { MyExport } from '@/components/MyExport'; import { Selects } from '@/components/Select'; @@ -18,57 +18,14 @@ import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import AssetInfo from './modals/AssetInfo'; import AssetUpdate from './modals/AssetUpdate'; +import BuildingsManage from './modals/BuildingsManage'; import HasProjects from './modals/HasProjects'; +import ParkingsManage from './modals/ParkingsManage'; export default function Index({ title = '项目信息' }) { const navigate = useNavigate(); const [getParams, setParams] = useState({}); - const getCurrentPermissions = useCurrentPermissions(); - - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - export: ( - - ), - // add: , - }); - }; - let tableRender = (item: any, action: any) => { - console.log(item, 'item'); - let permissions = getCurrentPermissions({ - config: ( - { - navigate(`/asset/asset_list/show/${item.id}`); - }} - /> - ), - has: ( - - ), - update: ( - - ), - }); - return [...permissions]; - }; return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ - MyColumns.ID(), + // MyColumns.ID(), // 组织树选择器 Selects?.OrganizationSearch({ title: '所属组织', @@ -118,9 +87,9 @@ export default function Index({ title = '项目信息' }) { title: '项目名称', dataIndex: 'name', search: false, - // render: (_, item: any) => ( - // - // ), + render: (_, item: any) => ( + + ), }, { title: '所在城市', @@ -133,26 +102,12 @@ export default function Index({ title = '项目信息' }) { }, }, }, - { - title: '项目地址', - render: (_, i: any) => { - return ` ${i?.area || ''}${i?.district || ''}${ - i?.address || '' - } `; - }, - search: false, - }, MyColumns.EnumTag({ title: '项目状态', dataIndex: 'status', valueEnum: AssetProjectsStatusEnum, search: false, }), - { - title: '接管日期', - dataIndex: 'takeover_date', - search: false, - }, MyColumns.EnumTag({ title: '项目类型', @@ -171,37 +126,58 @@ export default function Index({ title = '项目信息' }) { }, search: false, }, + { + title: '接管日期', + dataIndex: 'takeover_date', + search: false, + }, { title: '所属组织', dataIndex: ['organization', 'name'], search: false, }, - // { - // title: '品牌', - // dataIndex: ['company_property_brand', 'name'], - // search: { - // transform: (value) => { - // return { property_brand_name: value }; - // }, - // }, - // }, - // MyColumns.SoftDelete({ - // title: '启/禁用', - // onRestore: Apis.Asset.AssetProjects.Restore, - // onSoftDelete: Apis.Asset.AssetProjects.SoftDelete, - // search: false, - // setPermissions: getCurrentPermissions({ - // enableDisable: true, - // }), - // }), - // MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => { - console.log(item, 'item2'); return ( - - <>{tableRender(item, action)} + + ), + buildings: ( + + ), + parkings: ( + + ), + has: ( + + ), + }} + maxVisible={3} + /> ); }, diff --git a/src/pages/asset/asset_list/modals/BuildingsManage.tsx b/src/pages/asset/asset_list/modals/BuildingsManage.tsx new file mode 100644 index 0000000..9abd14c --- /dev/null +++ b/src/pages/asset/asset_list/modals/BuildingsManage.tsx @@ -0,0 +1,18 @@ +import { MyBetaModalFormProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import AssetBuildings from '../table/AssetBuildings'; + +export default function BuildingsManage(props: MyBetaModalFormProps) { + return ( + } + /> + ); +} diff --git a/src/pages/asset/asset_list/modals/ParkingsManage.tsx b/src/pages/asset/asset_list/modals/ParkingsManage.tsx new file mode 100644 index 0000000..144a461 --- /dev/null +++ b/src/pages/asset/asset_list/modals/ParkingsManage.tsx @@ -0,0 +1,18 @@ +import { MyBetaModalFormProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import AssetParkings from '../table/AssetParkings'; + +export default function ParkingsManage(props: MyBetaModalFormProps) { + return ( + } + /> + ); +} diff --git a/src/pages/asset/grids/index.tsx b/src/pages/asset/grids/index.tsx index 6e8d2e2..0bf71a2 100644 --- a/src/pages/asset/grids/index.tsx +++ b/src/pages/asset/grids/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -15,28 +16,6 @@ import GridMannger from './modals/GridMannger'; import GridUpdate from './modals/GridUpdate'; export default function Index({ title = '楼栋管家' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - select: ( - - ), - }); - }; - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: , - mannger: , - delete: ( - - Apis.Grid.Grids.Delete({ id: item.id }).then(() => action?.reload()) - } - /> - ), - }); - }; - return ( MyProTableProps.request(params, sort, Apis.Grid.Grids.List) } - toolBarRender={(action) => [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ @@ -86,7 +78,23 @@ export default function Index({ title = '楼栋管家' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + , + mannger: ( + + ), + delete: ( + + Apis.Grid.Grids.Delete({ id: item.id }).then(() => + action?.reload(), + ) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/grids/modals/GridCreate.tsx b/src/pages/asset/grids/modals/GridCreate.tsx index 218be41..9435225 100644 --- a/src/pages/asset/grids/modals/GridCreate.tsx +++ b/src/pages/asset/grids/modals/GridCreate.tsx @@ -60,20 +60,24 @@ export default function Create(props: MyBetaModalFormProps) { valueType: 'dependency', name: ['asset_projects_id'], columns: ({ asset_projects_id }) => { + const projectId = asset_projects_id || props?.item?.id; return [ { valueType: 'group', columns: [ - Selects?.GetGridMark({ - key: 'grid_mark', - title: '范围标识', - params: { - asset_projects_id: - asset_projects_id || props?.item?.id || 0, - }, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), + ...(projectId + ? [ + Selects?.GetGridMark({ + key: 'grid_mark', + title: '范围标识', + params: { + asset_projects_id: projectId, + }, + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }), + ] + : []), { key: 'grid_ranges', title: '选择单元', diff --git a/src/pages/asset/houses/index.tsx b/src/pages/asset/houses/index.tsx index f7db7b3..8c80cd1 100644 --- a/src/pages/asset/houses/index.tsx +++ b/src/pages/asset/houses/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { MyExport } from '@/components/MyExport'; import { Selects } from '@/components/Select'; @@ -20,32 +21,6 @@ import HousesUpdate from './modals/HousesUpdate'; export default function Index({ title = '房屋列表' }) { const [getParams, setParams] = useState({}); - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = () => { - return getCurrentPermissions({ - export: ( - - ), - }); - }; - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: , - delete: ( - - Apis.Asset.AssetHouses.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; return ( [toolBarRender()]} + toolBarRender={() => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ @@ -183,7 +171,26 @@ export default function Index({ title = '房屋列表' }) { render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + + ), + delete: ( + + Apis.Asset.AssetHouses.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/parking_area/index.tsx b/src/pages/asset/parking_area/index.tsx index 59cd991..0808bdc 100644 --- a/src/pages/asset/parking_area/index.tsx +++ b/src/pages/asset/parking_area/index.tsx @@ -3,7 +3,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -20,21 +20,6 @@ import Update from './modals/AreaUpdate'; export default function Index({ title = '车场车位' }) { const navigate = useNavigate(); - const getCurrentPermissions = useCurrentPermissions(); - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: , - delete: ( - - Apis.Asset.AssetParkingPlaces.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - ), - }); - }; return ( - <>{tableRender(item, action)} - - {/* - - Apis.Asset.AssetParkingPlaces.Delete({ id: item.id }).then( - () => action?.reload(), - ) - } - /> */} + + ), + delete: ( + + Apis.Asset.AssetParkingPlaces.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/parking_space/index.tsx b/src/pages/asset/parking_space/index.tsx index 9691a65..27ab566 100644 --- a/src/pages/asset/parking_space/index.tsx +++ b/src/pages/asset/parking_space/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { MyExport } from '@/components/MyExport'; import { Selects } from '@/components/Select'; @@ -17,26 +18,12 @@ import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useState } from 'react'; +import AreaUpdate from './modals/AreaUpdate'; import SpaceShow from './modals/SpaceShow'; import SpaceUpdate from './modals/SpaceUpdate'; export default function Index({ title = '车位列表' }) { const [getParams, setParams] = useState({ page: 1 }); - const getCurrentPermissions = useCurrentPermissions(); - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: , - delete: ( - - Apis.Asset.AssetCarPorts.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; return ( MyProTableProps.request( params, @@ -57,13 +44,19 @@ export default function Index({ title = '车位列表' }) { ) } toolBarRender={(action) => [ - + ), + }} />, - // , ]} columns={[ MyColumns.ID({ search: false }), @@ -75,13 +68,12 @@ export default function Index({ title = '车位列表' }) { { title: '项目名称', dataIndex: ['asset_project', 'name'], - // search: { - // transform: (value) => { - // return { project_name: value }; - // }, - // }, search: false, }, + { + title: '车位全称', + dataIndex: 'full_name', + }, { title: '车场名称', dataIndex: ['asset_parking_place', 'name'], @@ -90,21 +82,23 @@ export default function Index({ title = '车位列表' }) { return { parking_place_name: value }; }, }, + render: (_, item: any) => ( + + ), }, { title: '车位号', dataIndex: 'name', search: false, }, - { - title: '车位全称', - dataIndex: 'full_name', - }, - { - title: '建筑面积', - dataIndex: 'built_area', - search: false, - }, + MyColumns.EnumTag({ title: '类型', dataIndex: 'type', @@ -120,12 +114,38 @@ export default function Index({ title = '车位列表' }) { dataIndex: 'status', valueEnum: AssetCarPortsStatusEnum, }), - MyColumns.CreatedAt(), + { + title: '建筑面积', + dataIndex: 'built_area', + search: false, + }, + + // MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( - {tableRender(item, action)} + + ), + delete: ( + + Apis.Asset.AssetCarPorts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/asset/parking_space/modals/AreaUpdate.tsx b/src/pages/asset/parking_space/modals/AreaUpdate.tsx new file mode 100644 index 0000000..b07b348 --- /dev/null +++ b/src/pages/asset/parking_space/modals/AreaUpdate.tsx @@ -0,0 +1,105 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { + AssetParkingPlacesChargeTypeEnum, + AssetParkingPlacesLocationTypeEnum, + AssetParkingPlacesPropertyTypeEnum, + AssetParkingPlacesTypeEnum, +} from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Update(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`编辑${props.title}`} + trigger={} + // wrapperCol={{ span: 24 }} + layout="horizontal" + labelCol={{ span: 4 }} + wrapperCol={{ span: 24 }} + labelAlign="left" + width="600px" + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open && props.item) { + form.setFieldsValue(props.item); + } + }} + onFinish={async (values) => + Apis.Asset.AssetParkingPlaces.Update({ + ...values, + id: props.item?.id ?? 0, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + Selects?.AssetProjects({ + key: 'asset_projects_id', + title: '选择项目', + colProps: { span: 24 }, + required: true, + }), + { + key: 'name', + title: '车场名称', + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.EnumRadio({ + key: 'type', + title: '类型', + valueEnum: AssetParkingPlacesTypeEnum, + required: true, + }), + MyFormItems.EnumRadio({ + key: 'property_type', + title: '产权类型', + valueEnum: AssetParkingPlacesPropertyTypeEnum, + required: true, + }), + MyFormItems.EnumRadio({ + key: 'location_type', + title: '位置类型', + valueEnum: AssetParkingPlacesLocationTypeEnum, + required: true, + }), + MyFormItems.EnumRadio({ + key: 'charge_type', + title: '收费类型', + valueEnum: AssetParkingPlacesChargeTypeEnum, + required: true, + }), + { + key: 'import_numbers', + title: '入口数量', + colProps: { span: 24 }, + }, + { + key: 'export_numbers', + title: '出口数量', + colProps: { span: 24 }, + }, + { + key: 'remark', + title: '备注', + valueType: 'textarea', + }, + ]} + /> + ); +} diff --git a/src/pages/asset/parking_space/modals/SpaceUpdate.tsx b/src/pages/asset/parking_space/modals/SpaceUpdate.tsx index ca36d3a..88a30aa 100644 --- a/src/pages/asset/parking_space/modals/SpaceUpdate.tsx +++ b/src/pages/asset/parking_space/modals/SpaceUpdate.tsx @@ -20,7 +20,7 @@ export default function Update(props: MyBetaModalFormProps) { return ( {...MyModalFormProps.props} - title={`编辑${props.title}`} + title={`编辑`} trigger={} wrapperCol={{ span: 24 }} layout="horizontal" diff --git a/src/pages/asset/project_configuration/components/ProjectConfig.tsx b/src/pages/asset/project_configuration/components/ProjectConfig.tsx deleted file mode 100644 index 25e5345..0000000 --- a/src/pages/asset/project_configuration/components/ProjectConfig.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { MyBetaModalFormProps } from '@/common'; -import { Tabs } from 'antd'; -import Activities from '../table/Activities'; -import Announcement from '../table/Announcement'; -import AssetAccounts from '../table/AssetAccounts'; -import MyAssetBuildings from '../table/AssetBuildings'; -import AssetGrid from '../table/AssetGrid'; -import ChargeStandard from '../table/ChargeStandard'; -import ConvenienceServices from '../table/ConvenienceServices'; - -export default function ProjectConfig(props: MyBetaModalFormProps) { - // const [data, setShow] = useState({}); - - // 注册当前页面为标签页 - // const { addTab } = usePageTabs({ - // tabKey: `asset-show-${id}`, - // tabLabel: data?.name || title || '项目详情', - // }); - - // const loadShow = () => { - // Apis.Asset.AssetProjects.Show({ id: props?.item?.id }).then((res) => { - // setShow(res?.data); - // }); - // }; - - // useEffect(() => { - // loadShow(); - // }, [props?.item?.id]); - - let items = [ - { - label: '楼栋管理', - key: 'asset_buildings', - closable: false, - children: , - }, - { - label: '楼栋划分', - key: 'grid', - closable: false, - children: , - }, - { - label: '收费标准', - key: 'charge_standard', - closable: false, - children: , - }, - { - label: '收款账号', - key: 'asset_accounts', - closable: false, - children: , - }, - { - label: '项目公告', - key: 'announcement', - closable: false, - children: , - }, - { - label: '项目活动', - key: 'activities', - closable: false, - children: , - }, - { - label: '便民信息', - key: 'convenience_services', - closable: false, - children: , - }, - ]; - return ; -} diff --git a/src/pages/asset/project_configuration/index.tsx b/src/pages/asset/project_configuration/index.tsx deleted file mode 100644 index 20dddda..0000000 --- a/src/pages/asset/project_configuration/index.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { MyPageContainer, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; -import { useState } from 'react'; -import MyProjectConfig from './components/ProjectConfig'; - -export default function Index({ title = '项目配置' }) { - const [selectedProject, setSelectedProject] = useState(null); - - return ( - -
- - { - let res = await MyProTableProps.request( - params, - sort, - Apis.Asset.AssetProjects.List, - ); - if (res?.data?.length) { - setSelectedProject(res?.data[0]); - } - return res || []; - }} - rowClassName={(record: any) => { - return selectedProject?.id === record?.id - ? 'ant-table-row-selected' - : ''; - }} - onRow={(record: any) => { - return { - onClick: () => { - setSelectedProject(record); - }, - style: { - cursor: 'pointer', - }, - }; - }} - options={false} - columns={[ - { - title: '项目名称', - dataIndex: 'name', - align: 'center', - }, - ]} - /> - - - - -
-
- ); -} diff --git a/src/pages/asset/project_configuration/modals/AssetCreate.tsx b/src/pages/asset/project_configuration/modals/AssetCreate.tsx deleted file mode 100644 index c0cb1e2..0000000 --- a/src/pages/asset/project_configuration/modals/AssetCreate.tsx +++ /dev/null @@ -1,169 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Address } from '@/components/Address'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { - AssetProjectsChargeEnum, - AssetProjectsEntrustTypeEnum, - AssetProjectsPropertyTypeEnum, - AssetProjectsStatusEnum, -} from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - width="600px" - trigger={} - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - form.setFieldsValue({ - companies_id: props?.item?.id, - }); - } - }} - onFinish={async (values: any) => - Apis.Asset.AssetProjects.Store({ - ...values, - longitude: values?.location ? values.location.split(',')[0] : '', - latitude: values?.location ? values.location.split(',')[1] : '', - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '项目名称', - colProps: { span: 12 }, - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'alias_name', - title: '项目别名', - colProps: { span: 12 }, - }, - { - valueType: 'dependency', - name: ['companies_id'], - columns: ({ companies_id }) => { - return [ - Selects?.PropertyBrands({ - title: '选择物业品牌', - key: 'company_property_brands_id', - params: { - companies_id: companies_id, - }, - colProps: { span: 12 }, - formItemProps: { ...rulesHelper.text }, - fieldProps: { - showSearch: true, - }, - }), - ]; - }, - }, - Address.Cascader({ - key: 'casacader', - title: '选择地址', - colProps: { span: 16 }, - keys: ['province', 'city', 'area', 'street'], - required: true, - }), - { - key: 'address', - title: '详细地址', - colProps: { span: 8 }, - formItemProps: { ...rulesHelper.text }, - }, - - MyFormItems.EnumSelect({ - key: 'property_type', - title: '项目类型', - colProps: { span: 8 }, - valueEnum: AssetProjectsPropertyTypeEnum, - // required: true, - }), - MyFormItems.EnumSelect({ - key: 'status', - title: '项目状态', - colProps: { span: 8 }, - valueEnum: AssetProjectsStatusEnum, - // required: true, - }), - MyFormItems.EnumSelect({ - key: 'entrust_type', - title: '委托类型', - colProps: { span: 8 }, - valueEnum: AssetProjectsEntrustTypeEnum, - // required: true, - }), - MyFormItems.EnumRadio({ - key: 'charge', - title: '收费方式', - colProps: { span: 8 }, - valueEnum: AssetProjectsChargeEnum, - // required: true, - }), - { - key: 'takeover_date', - title: '接管日期', - valueType: 'date', - fieldProps: { - style: { - width: '100%', - }, - }, - colProps: { span: 8 }, - }, - { - key: 'closure_date', - title: '封园日期', - valueType: 'date', - fieldProps: { - style: { - width: '100%', - }, - }, - colProps: { span: 8 }, - }, - { - title: '项目经纬度', - dataIndex: 'location', - colProps: { span: 24 }, - fieldProps: { - addonAfter: ( - { - window.open( - 'https://api.map.baidu.com/lbsapi/getpoint/index.html', - ); - }} - /> - ), - }, - }, - ]} - /> - ); -} diff --git a/src/pages/asset/project_configuration/modals/AssetInfo.tsx b/src/pages/asset/project_configuration/modals/AssetInfo.tsx deleted file mode 100644 index 1d03416..0000000 --- a/src/pages/asset/project_configuration/modals/AssetInfo.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { MyBetaModalFormProps, renderTextHelper } from '@/common'; -import { MyModal } from '@/components/MyModal'; -import { - AssetProjectsChargeEnum, - AssetProjectsEntrustTypeEnum, - AssetProjectsPropertyTypeEnum, - AssetProjectsStatusEnum, -} from '@/gen/Enums'; -import { ProCard, ProDescriptions } from '@ant-design/pro-components'; -import { Space } from 'antd'; - -export default function AssetInfo(props: MyBetaModalFormProps) { - return ( - - - - - -
{props?.item?.company?.name}
-
-
- - -
- {props?.item?.name} - {props?.item?.alias_name - ? `(${props?.item?.alias_name})` - : ''} -
-
-
- - {props?.item?.province || ''} - {props?.item?.city || ''} - {props?.item?.district || ''} - {props?.item?.address || ''} - - - - - - - - - - - - - - - - {props?.item?.takeover_date} - - - {props?.item?.closure_date} - - - - {props?.item?.created_at} - - - {props?.item?.updated_at} - -
-
- - } - /> - ); -} diff --git a/src/pages/asset/project_configuration/modals/AssetUpdate.tsx b/src/pages/asset/project_configuration/modals/AssetUpdate.tsx deleted file mode 100644 index 841ff17..0000000 --- a/src/pages/asset/project_configuration/modals/AssetUpdate.tsx +++ /dev/null @@ -1,184 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Address } from '@/components/Address'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { - AssetProjectsChargeEnum, - AssetProjectsEntrustTypeEnum, - AssetProjectsPropertyTypeEnum, - AssetProjectsStatusEnum, -} from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - title={`编辑${props.title}`} - trigger={} - wrapperCol={{ span: 24 }} - width="600px" - key={new Date().getTime()} - form={form} - onOpenChange={(open: any, props: any) => { - if (open && props.item) { - form.setFieldsValue({ - companies_id: props.item?.companies_id, - location: `${props.item?.longitude || ''},${ - props.item?.latitude || '' - }`, - }); - } - }} - request={() => - Promise.resolve({ - ...props.item, - location: `${props.item?.longitude || ''},${ - props.item?.latitude || '' - }`, - casacader: [ - props.item?.province_id || '', - props.item?.city_id || '', - props.item?.area_id || '', - props.item?.street_id || '', - ], - }) - } - onFinish={async (values: any) => - Apis.Asset.AssetProjects.Update({ - ...values, - id: props.item?.id ?? 0, - longitude: values?.location ? values.location.split(',')[0] : '', - latitude: values?.location ? values.location.split(',')[1] : '', - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '项目名称', - colProps: { span: 12 }, - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'alias_name', - title: '项目别名', - colProps: { span: 12 }, - }, - // Selects?.Companies({ - // key: 'companies_id', - // title: '所属机构', - // colProps: { span: 24 }, - // formItemProps: { ...rulesHelper.number }, - // }), - Selects?.PropertyBrands({ - title: '选择物业品牌', - key: 'company_property_brands_id', - params: { - companies_id: props.item?.companies_id, - }, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - fieldProps: { - showSearch: true, - }, - }), - Address.Cascader({ - key: 'casacader', - title: '选择地址', - colProps: { span: 16 }, - keys: ['province', 'city', 'area', 'street'], - required: true, - }), - { - key: 'address', - title: '详细地址', - colProps: { span: 8 }, - formItemProps: { ...rulesHelper.text }, - }, - - MyFormItems.EnumSelect({ - key: 'property_type', - title: '项目类型', - colProps: { span: 8 }, - valueEnum: AssetProjectsPropertyTypeEnum, - // required: true, - }), - MyFormItems.EnumSelect({ - key: 'status', - title: '项目状态', - colProps: { span: 8 }, - valueEnum: AssetProjectsStatusEnum, - // required: true, - }), - MyFormItems.EnumSelect({ - key: 'entrust_type', - title: '委托类型', - colProps: { span: 8 }, - valueEnum: AssetProjectsEntrustTypeEnum, - // required: true, - }), - MyFormItems.EnumRadio({ - key: 'charge', - title: '收费方式', - colProps: { span: 8 }, - valueEnum: AssetProjectsChargeEnum, - // required: true, - }), - { - key: 'takeover_date', - title: '接管日期', - valueType: 'date', - fieldProps: { - style: { - width: '100%', - }, - }, - colProps: { span: 8 }, - }, - { - key: 'closure_date', - title: '封园日期', - valueType: 'date', - fieldProps: { - style: { - width: '100%', - }, - }, - colProps: { span: 8 }, - }, - { - title: '项目经纬度', - dataIndex: 'location', - colProps: { span: 24 }, - fieldProps: { - addonAfter: ( - { - window.open( - 'https://api.map.baidu.com/lbsapi/getpoint/index.html', - ); - }} - /> - ), - }, - }, - ]} - /> - ); -} diff --git a/src/pages/asset/project_configuration/table/Activities.tsx b/src/pages/asset/project_configuration/table/Activities.tsx deleted file mode 100644 index 787efaa..0000000 --- a/src/pages/asset/project_configuration/table/Activities.tsx +++ /dev/null @@ -1,149 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - ActivitiesPublishStatusEnum, - ActivitiesPublishTypeEnum, - ActivitiesStatusEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import ActivityCreate from '../../activities/modals/ActivityCreate'; -import ActivityShow from '../../activities/modals/ActivityShow'; -import ActivityUpdate from '../../activities/modals/ActivityUpdate'; -import EnrollsList from '../../activities/modals/EnrollsList'; - -export default function Index({ ...rest }) { - return ( - <> - > - {...MyProTableProps.props} - request={async (params, sort) => - MyProTableProps.request(params, sort, Apis.Activity.Activities.List) - } - params={{ asset_projects_id: rest.item?.id }} - options={false} - search={false} - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '活动标题', - dataIndex: 'title', - }, - MyColumns.EnumTag({ - title: '发布方式', - dataIndex: 'publish_type', - valueEnum: ActivitiesPublishTypeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '发布状态', - dataIndex: 'publish_status', - valueEnum: ActivitiesPublishStatusEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '活动状态', - dataIndex: 'status', - valueEnum: ActivitiesStatusEnum, - search: false, - }), - { - title: '开始时间', - dataIndex: 'start_time', - search: false, - }, - { - title: '结束时间', - dataIndex: 'end_time', - search: false, - }, - { - title: '发布时间', - dataIndex: 'publish_time', - search: false, - }, - MyColumns.SoftDelete({ - onRestore: Apis.Activity.Activities.Restore, - onSoftDelete: Apis.Activity.Activities.SoftDelete, - search: false, - }), - MyColumns.UpdatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - { - let newStatus; - if ( - item.publish_status === - ActivitiesPublishStatusEnum.Unpublished.value - ) { - newStatus = ActivitiesPublishStatusEnum.Published.value; - } else if ( - item.publish_status === - ActivitiesPublishStatusEnum.Published.value - ) { - newStatus = ActivitiesPublishStatusEnum.Unlisted.value; - } else { - newStatus = ActivitiesPublishStatusEnum.Published.value; - } - Apis.Activity.Activities.ChangePublishStatus({ - id: item.id, - publish_status: newStatus, - }).then(() => action?.reload()); - }} - /> - - - Apis.Activity.Activities.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/project_configuration/table/Announcement.tsx b/src/pages/asset/project_configuration/table/Announcement.tsx deleted file mode 100644 index 0e07d43..0000000 --- a/src/pages/asset/project_configuration/table/Announcement.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { MsgPropertyAnnouncementsPublishTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import AnnouncementCreate from '../../announcement/modals/AnnouncementCreate'; -import AnnouncementShow from '../../announcement/modals/AnnouncementShow'; -import AnnouncementUpdate from '../../announcement/modals/AnnouncementUpdate'; - -export default function Index({ ...rest }) { - return ( - <> - > - {...MyProTableProps.props} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Msg.MsgPropertyAnnouncements.List, - ) - } - params={{ asset_projects_id: rest.item?.id }} - toolBarRender={(action) => [ - , - ]} - options={false} - search={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - search: false, - render: (_, record) => { - return record?.asset_project?.name; - }, - }, - { - title: '公告标题', - dataIndex: 'title', - width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) - render: (text) => ( -
- {text} -
- ), - }, - { - title: '落款日期', - dataIndex: 'publish_at', - valueType: 'date', - search: false, - }, - MyColumns.EnumTag({ - title: '发布方式', - dataIndex: 'publish_type', - valueEnum: MsgPropertyAnnouncementsPublishTypeEnum, - search: false, - }), - { - title: '发布时间', - dataIndex: 'schedule_publish_at', - valueType: 'dateTime', - search: false, - }, - { - title: '是否发布', - dataIndex: 'is_publish', - search: false, - render: (text) => (text ? '是' : '否'), - }, - MyColumns.SoftDelete({ - title: '启/禁用', - onRestore: Apis.Msg.MsgPropertyAnnouncements.Restore, - onSoftDelete: Apis.Msg.MsgPropertyAnnouncements.SoftDelete, - search: false, - }), - MyColumns.UpdatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - { - let newStatus: boolean; - if (item.is_publish === 0) { - newStatus = true; - } else { - newStatus = false; - } - Apis.Msg.MsgPropertyAnnouncements.IsPublish({ - id: item.id, - is_publish: Boolean(newStatus), - }).then(() => action?.reload()); - }} - /> - - - Apis.Msg.MsgPropertyAnnouncements.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/project_configuration/table/AssetAccounts.tsx b/src/pages/asset/project_configuration/table/AssetAccounts.tsx deleted file mode 100644 index 6358da8..0000000 --- a/src/pages/asset/project_configuration/table/AssetAccounts.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyColumns, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import AccountsGet from '../../accounts/modals/AccountsGet'; - -export default function ReceiptAccounts(props: MyBetaModalFormProps) { - return ( - <> - > - {...MyProTableProps.props} - search={false} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Company.CompanyProjectReceiptAccounts.List, - ) - } - options={false} - params={{ - projects_id: props?.item?.id, - companies_id: props?.item?.companies_id, - }} - toolBarRender={(action) => [ - , - ]} - // options={false} - columns={[ - { - title: 'ID', - dataIndex: 'id', - // width: 360, - search: false, - }, - { - title: '收款账户', - dataIndex: ['receipt_account', 'company_name'], - // width: 360, - }, - { - title: '开户行', - dataIndex: ['receipt_account', 'company_bank'], - search: false, - // width: 200, - }, - { - title: '收款账号', - dataIndex: ['receipt_account', 'company_account'], - search: false, - // width: 200, - }, - // { - // title: '是否默认', - // dataIndex: 'is_default', - // search: false, - // render(_, record) { - // return `${record?.is_default ? '是' : '否'} `; - // }, - // }, - // MyColumns.UpdatedAt(), - // MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - Apis.Company.CompanyProjectReceiptAccounts.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/project_configuration/table/AssetBuildings.tsx b/src/pages/asset/project_configuration/table/AssetBuildings.tsx deleted file mode 100644 index 4bd623d..0000000 --- a/src/pages/asset/project_configuration/table/AssetBuildings.tsx +++ /dev/null @@ -1,364 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyColumns, - MyImportModal, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - AssetHousesOwnershipTypeEnum, - AssetHousesUsageEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Alert, message, Space, Typography } from 'antd'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import BuildingsCreate from '../../houses/modals/BuildingsCreate'; -import AssetBuildingsUpdate from '../../houses/modals/BuildingsUpdate'; -import HousesCreate from '../../houses/modals/HousesCreate'; -import HousesUpdate from '../../houses/modals/HousesUpdate'; -import AssetUnitsCreate from '../../houses/modals/UnitsCreate'; -import AssetUnitsUpdate from '../../houses/modals/UnitsUpdate'; - -const { Title } = Typography; - -interface SelectedBuilding { - id: number; - name: string; -} - -interface SelectedUnit { - id: number; - name: string; -} - -export default function AssetBuildings(props: MyBetaModalFormProps) { - const actionBuildingsRef: any = useRef(); - const actionUnitsRef: any = useRef(); - const actionHousesRef: any = useRef(); - const [selectedBuilding, setSelectedBuilding] = - useState(null); - const [selectedUnit, setSelectedUnit] = useState(null); - - // 选择楼栋的回调函数 - const handleBuildingSelect = useCallback((building?: SelectedBuilding) => { - setSelectedBuilding(building || null); - setSelectedUnit(null); // 重置单元选择 - // 刷新单元和房屋列表 - actionUnitsRef?.current?.reload(); - actionHousesRef?.current?.reload(); - }, []); - - // 选择单元的回调函数 - const handleUnitSelect = useCallback((unit: SelectedUnit) => { - setSelectedUnit(unit); - // 刷新房屋列表 - actionHousesRef?.current?.reload(); - }, []); - - // 删除操作的通用处理 - const handleDelete = useCallback( - async (deleteApi: any, id: number, reloadAction: any, itemName: string) => { - try { - await deleteApi({ id }); - message.success(`${itemName}删除成功`); - reloadAction(); - } catch (error) { - message.error(`${itemName}删除失败`); - } - }, - [], - ); - - useEffect(() => { - if (props?.item?.id) { - handleBuildingSelect(); - } - }, [props?.item?.id]); - - return ( - - - - {/* 楼栋列表 */} -
- - <Space style={{ display: 'flex', justifyContent: 'space-between' }}> - 楼栋信息 - <Space> - <MyImportModal - key="ImportHouse" - params={{ asset_projects_id: props?.item?.id }} - title="批量导入" - type="default" - size="middle" - templateApi={Apis.Asset.AssetHouses.DownloadTemplate} - importApi={Apis.Asset.AssetHouses.Import} - reload={props?.reload} - /> - <BuildingsCreate - key="BuildingsCreate" - item={props?.item} - reload={() => actionBuildingsRef?.current?.reload()} - title="楼栋" - /> - </Space> - </Space> - - > - {...MyProTableProps.props} - search={false} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Asset.AssetBuildings.List, - ) - } - options={false} - params={{ asset_projects_id: props?.item?.id }} - actionRef={actionBuildingsRef} - rowClassName={(record: any) => { - return selectedBuilding?.id === record?.id - ? 'ant-table-row-selected' - : ''; - }} - onRow={(record: any) => { - return { - onClick: () => { - handleBuildingSelect(record); - }, - style: { - cursor: 'pointer', - }, - }; - }} - pagination={{ - pageSize: 10, - showSizeChanger: false, - }} - columns={[ - { - title: '楼栋', - dataIndex: 'name', - ellipsis: true, - width: 200, - }, - MyColumns.Option({ - width: 120, - render: (_, item: any, index, action) => ( - - - - handleDelete( - Apis.Asset.AssetBuildings.Delete, - item.id, - action?.reload, - '楼栋', - ) - } - /> - - ), - }), - ]} - /> -
- - {/* 单元列表 */} - {selectedBuilding && ( -
- - <Space - style={{ display: 'flex', justifyContent: 'space-between' }} - > - {selectedBuilding.name} - {selectedBuilding && ( - <AssetUnitsCreate - key="UnitsCreate" - item={{ - ...props?.item, - asset_buildings_id: selectedBuilding?.id, - }} - reload={() => actionUnitsRef?.current?.reload()} - title="单元" - // title={`添加${selectedBuilding.name}单元`} - /> - )} - </Space> - - > - {...MyProTableProps.props} - search={false} - actionRef={actionUnitsRef} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Asset.AssetUnits.List, - ) - } - params={{ - asset_projects_id: props?.item?.id, - asset_buildings_id: selectedBuilding?.id, - }} - rowClassName={(record: any) => { - return selectedUnit?.id === record?.id - ? 'ant-table-row-selected' - : ''; - }} - onRow={(record: any) => { - return { - onClick: () => { - handleUnitSelect(record); - }, - style: { - cursor: 'pointer', - }, - }; - }} - options={false} - pagination={{ - pageSize: 10, - showSizeChanger: false, - }} - columns={[ - { - title: '单元', - dataIndex: 'name', - ellipsis: true, - width: 200, - }, - MyColumns.Option({ - width: 120, - render: (_, item: any, index, action) => ( - - - - handleDelete( - Apis.Asset.AssetUnits.Delete, - item.id, - action?.reload, - '单元', - ) - } - /> - - ), - }), - ]} - /> -
- )} - - {/* 房屋列表 */} - {selectedUnit && ( -
- - <Space - style={{ display: 'flex', justifyContent: 'space-between' }} - > - {selectedUnit.name} - {selectedUnit && ( - <HousesCreate - key="HousesCreate" - item={{ - ...props?.item, - asset_buildings_id: selectedBuilding?.id, - asset_units_id: selectedUnit?.id, - }} - reload={() => actionHousesRef?.current?.reload()} - title="房屋" - // title={`${selectedUnit.name}房屋`} - /> - )} - </Space> - - > - {...MyProTableProps.props} - search={false} - actionRef={actionHousesRef} - params={{ - asset_projects_id: props?.item?.id, - asset_buildings_id: selectedBuilding?.id, - asset_units_id: selectedUnit?.id, - }} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Asset.AssetHouses.List, - ) - } - options={false} - pagination={{ - pageSize: 10, - showSizeChanger: false, - }} - columns={[ - { - title: '楼层', - dataIndex: 'floor', - width: 80, - render(_, record) { - return `${record?.floor}层`; - }, - }, - { - title: '房号', - dataIndex: 'name', - width: 80, - }, - MyColumns.EnumTag({ - title: '用途', - dataIndex: 'usage', - valueEnum: AssetHousesUsageEnum, - width: 100, - }), - MyColumns.EnumTag({ - title: '房屋属性', - dataIndex: 'ownership_type', - valueEnum: AssetHousesOwnershipTypeEnum, - width: 100, - }), - MyColumns.Option({ - width: 150, - render: (_, item: any, index, action) => ( - - {/* */} - - - handleDelete( - Apis.Asset.AssetHouses.Delete, - item.id, - action?.reload, - '房屋', - ) - } - /> - - ), - }), - ]} - /> -
- )} -
-
- ); -} diff --git a/src/pages/asset/project_configuration/table/AssetGrid.tsx b/src/pages/asset/project_configuration/table/AssetGrid.tsx deleted file mode 100644 index a6a5327..0000000 --- a/src/pages/asset/project_configuration/table/AssetGrid.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import GridCreate from '../../grids/modals/GridCreate'; -import GridMannger from '../../grids/modals/GridMannger'; -import GridCreateUpdate from '../../grids/modals/GridUpdate'; - -export default function Index({ ...rest }) { - // useEffect(() => { - // console.log(rest.item?.id, projectId, 'rest.item?.id'); - // if (rest.item?.id && rest.item?.id !== projectId) { - // projectId = rest.item?.id; - // actionLooks?.current.reloadAndRest(); - // } - // }, [rest.item?.id]); - - return ( - <> - > - {...MyProTableProps.props} - request={async (params, sort) => - MyProTableProps.request(params, sort, Apis.Grid.Grids.List) - } - params={{ asset_projects_id: rest.item?.id }} - toolBarRender={(action) => [ - , - ]} - options={false} - search={false} - columns={[ - { - title: 'ID', - dataIndex: 'id', - }, - { - title: '板块名称', - dataIndex: 'name', - }, - { - title: '板块标识', - dataIndex: 'grid_mark', - }, - { - title: '管理员', - dataIndex: ['company_employee', 'name'], - render: (_, item: any) => - `${item?.company_employee?.name || ''}-${ - item?.company_employee?.phone || '' - }`, - }, - // MyColumns.CreatedAt(), - MyColumns.UpdatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - Apis.Grid.Grids.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/project_configuration/table/ChargeStandard.tsx b/src/pages/asset/project_configuration/table/ChargeStandard.tsx deleted file mode 100644 index 482cd2f..0000000 --- a/src/pages/asset/project_configuration/table/ChargeStandard.tsx +++ /dev/null @@ -1,143 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyColumns, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - HouseBillsTypeEnum, - HouseChargeStandardsCalculationMethodEnum, - HouseChargeStandardsCalculationModeEnum, - HouseChargeStandardsCalculationPeriodEnum, - HouseChargeStandardsPriceAlgorithmEnum, -} from '@/gen/Enums'; - -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; - -export default function ReceiptAccounts(props: MyBetaModalFormProps) { - const navigate = useNavigate(); - - return ( - <> - > - {...MyProTableProps.props} - search={false} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.HouseCharge.HouseChargeStandards.List, - ) - } - options={false} - params={{ asset_projects_id: props?.item?.id }} - // toolBarRender={(action) => [ - // , - // ]} - // options={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '收费名称', - dataIndex: 'name', - search: false, - }, - MyColumns.EnumTag({ - title: '收费项', - dataIndex: 'charge_type', - valueEnum: HouseBillsTypeEnum, - }), - MyColumns.EnumTag({ - title: '计量单位', - dataIndex: 'calculation_method', - valueEnum: HouseChargeStandardsCalculationMethodEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '计费模式', - dataIndex: 'calculation_mode', - valueEnum: HouseChargeStandardsCalculationModeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '计费算法', - dataIndex: 'price_algorithm', - valueEnum: HouseChargeStandardsPriceAlgorithmEnum, - search: false, - }), - { - title: '价格', - dataIndex: 'price', - search: false, - render(_, record) { - if (record?.price_algorithm === 'Fixed') { - return record?.price; - } else { - return ( -
- {record?.tiered_rates?.map((rate: any, index: number) => ( -
- {rate?.min_quantity} - {rate?.max_quantity} : - {rate?.price} -
- ))} -
- ); - } - }, - }, - MyColumns.EnumTag({ - title: '账单计费周期', - dataIndex: 'calculation_period', - valueEnum: HouseChargeStandardsCalculationPeriodEnum, - search: false, - }), - { - title: '账单自动生成日期', - dataIndex: 'auto_date', - search: false, - }, - { - title: '是否分摊', - dataIndex: 'is_apportionment', - search: false, - render(_, record) { - return `${record?.is_apportionment ? '是' : '否'} `; - }, - }, - // MyColumns.UpdatedAt(), - // MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate(`/charge/standard/show/${item.id}`); - }} - /> - - Apis.HouseCharge.HouseChargeStandards.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/project_configuration/table/ConvenienceServices.tsx b/src/pages/asset/project_configuration/table/ConvenienceServices.tsx deleted file mode 100644 index 3a95656..0000000 --- a/src/pages/asset/project_configuration/table/ConvenienceServices.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ConvenienceServicesTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import ServiceCreate from '../../services/modals/ServiceCreate'; -import ServiceUpdate from '../../services/modals/ServiceUpdate'; - -export default function Index({ ...rest }) { - return ( - <> - > - {...MyProTableProps.props} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Common.ConvenienceServices.List, - ) - } - params={{ asset_projects_id: rest.item?.id }} - options={false} - search={false} - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - // search: { - // transform: (value) => { - // return { project_name: value }; - // }, - // }, - search: false, - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: ConvenienceServicesTypeEnum, - search: false, - }), - { - title: '服务名称', - dataIndex: 'name', - }, - - { - title: '联系方式', - render(_, record) { - const content = record?.content || []; - - // 过滤有效数据 - const validItems = content.filter( - (item: any) => item?.name && item?.phone, - ); - - return ( -
- {validItems.length > 0 ? ( - validItems.map((item: any, index: number) => ( - // 每个客户信息单独一行 -
- {item.name}: {item.phone} -
- )) - ) : ( - 暂无客户信息 - )} -
- ); - }, - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Common.ConvenienceServices.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/asset/services/index.tsx b/src/pages/asset/services/index.tsx index 3c65950..457b4ee 100644 --- a/src/pages/asset/services/index.tsx +++ b/src/pages/asset/services/index.tsx @@ -3,42 +3,18 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { ConvenienceServicesTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import ServiceCreate from './modals/ServiceCreate'; import ServiceUpdate from './modals/ServiceUpdate'; export default function Index({ title = '便民服务' }) { - const navigate = useNavigate(); - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - select: ( - - ), - }); - }; - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: , - delete: ( - - Apis.Common.ConvenienceServices.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; - return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ @@ -117,7 +106,22 @@ export default function Index({ title = '便民服务' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + + ), + delete: ( + + Apis.Common.ConvenienceServices.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/attendance/attendance_configs/index.tsx b/src/pages/attendance/attendance_configs/index.tsx index b10f58a..5375ce4 100644 --- a/src/pages/attendance/attendance_configs/index.tsx +++ b/src/pages/attendance/attendance_configs/index.tsx @@ -1,8 +1,9 @@ import { MyButtons, MyColumns, - MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; @@ -10,76 +11,98 @@ import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; -export default function Index({ title = '打卡配置' }) { +export default function Index({ + title = '打卡配置', + noPermission, +}: { + title?: string; + noPermission?: boolean; +}) { return ( - - - MyProTableProps.request( - params, - sort, - Apis.Attendance.AttendanceConfigs.List, - ) - } - headerTitle="打卡参数配置" - toolBarRender={(action) => [ - , - ]} - search={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '可打卡范围(米内)', - dataIndex: 'check_in_range', - search: false, - }, - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - search: false, - }, - MyColumns.Boolean({ - dataIndex: 'require_photo', - title: '是否要求拍照打卡', - search: false, - }), - // MyColumns.Boolean({ - // dataIndex: 'allow_out_range_checkin', - // title: '是否允许范围外打卡', - // search: false, - // }), - // MyColumns.IsEnabled({ - // onRestore: Apis.Attendance.AttendanceConfigs.Enable, - // onSoftDelete: Apis.Attendance.AttendanceConfigs.Enable, - // search: false, - // }), - // MyColumns.CreatedAt(), - MyColumns.UpdatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Attendance.AttendanceConfigs.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - + + MyProTableProps.request( + params, + sort, + Apis.Attendance.AttendanceConfigs.List, + ) + } + headerTitle="打卡参数配置" + toolBarRender={(action) => + noPermission + ? [] + : [ + + ), + }} + />, + ] + } + search={false} + columns={[ + MyColumns.ID({ + search: false, + }), + { + title: '可打卡范围(米内)', + dataIndex: 'check_in_range', + search: false, + }, + { + title: '关联项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, + MyColumns.Boolean({ + dataIndex: 'require_photo', + title: '是否要求拍照打卡', + search: false, + }), + // MyColumns.Boolean({ + // dataIndex: 'allow_out_range_checkin', + // title: '是否允许范围外打卡', + // search: false, + // }), + // MyColumns.IsEnabled({ + // onRestore: Apis.Attendance.AttendanceConfigs.Enable, + // onSoftDelete: Apis.Attendance.AttendanceConfigs.Enable, + // search: false, + // }), + // MyColumns.CreatedAt(), + MyColumns.UpdatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + ), + delete: ( + + Apis.Attendance.AttendanceConfigs.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> + + ), + }), + ]} + /> ); } diff --git a/src/pages/attendance/attendance_employees/index.tsx b/src/pages/attendance/attendance_employees/index.tsx index cb84a79..9128afd 100644 --- a/src/pages/attendance/attendance_employees/index.tsx +++ b/src/pages/attendance/attendance_employees/index.tsx @@ -3,6 +3,8 @@ import { MyImportModal, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, renderTextHelper, useCurrentPermissions, } from '@/common'; @@ -39,16 +41,29 @@ export default function Index({ title = '外包人员' }) { ) } toolBarRender={(action) => [ - + ), + add: ( + + ), + }} />, - , ]} columns={[ MyColumns.ID({ search: false }), @@ -99,13 +114,24 @@ export default function Index({ title = '外包人员' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - + ), + change: ( + + ), + }} /> - - ), }), diff --git a/src/pages/attendance/attendance_employees_tracks/index.tsx b/src/pages/attendance/attendance_employees_tracks/index.tsx index 44923ad..12ccac9 100644 --- a/src/pages/attendance/attendance_employees_tracks/index.tsx +++ b/src/pages/attendance/attendance_employees_tracks/index.tsx @@ -3,6 +3,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, renderTextHelper, } from '@/common'; import { Selects } from '@/components/Select'; @@ -92,12 +93,18 @@ export default function Index({ title = '员工轨迹' }) { MyColumns.Option({ render: (_, item: any, index) => ( - - navigate(`/attendance/employee_tracks/${item.id}`) - } + + navigate(`/attendance/employee_tracks/${item.id}`) + } + /> + ), + }} /> ), diff --git a/src/pages/attendance/attendance_records/index.tsx b/src/pages/attendance/attendance_records/index.tsx index c2c768d..95dd344 100644 --- a/src/pages/attendance/attendance_records/index.tsx +++ b/src/pages/attendance/attendance_records/index.tsx @@ -1,4 +1,12 @@ -import { MyColumns, MyPageContainer, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyModalFormProps, + MyPageContainer, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; import { MyExport } from '@/components/MyExport'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -6,12 +14,15 @@ import { AttendanceRecordsCheckinTypeEnum, AttendanceRecordsStatusEnum, } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Image } from 'antd'; +import { BetaSchemaForm, ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Form, Image, Space } from 'antd'; import { useState } from 'react'; export default function Index({ title = '打卡记录' }) { const [getParams, setParams] = useState({}); + const navigate = useNavigate(); + const [form] = Form.useForm(); return ( [ - + } + width="500px" + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); + } + }} + onFinish={async (values: any) => { + navigate( + `/attendance/employee_tracks/${values.company_employees_id}`, + ); + return true; + }} + columns={[ + Selects?.Employees({ + title: '请选择员工', + key: 'company_employees_id', + required: true, + colProps: { span: 24 }, + }), + ]} + /> + ), + export: ( + + ), + }} />, ]} columns={[ @@ -55,7 +108,7 @@ export default function Index({ title = '打卡记录' }) { { title: '员工', dataIndex: ['company_employee', 'name'], - search: false, + // search: false, }, { title: '打卡时间', @@ -113,6 +166,25 @@ export default function Index({ title = '打卡记录' }) { }, }, // MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index) => ( + + + navigate(`/attendance/employee_tracks/${item.id}`) + } + /> + ), + }} + /> + + ), + }), ]} /> diff --git a/src/pages/attendance/attendance_schedules/index.tsx b/src/pages/attendance/attendance_schedules/index.tsx index 1ff2ce8..925dcf0 100644 --- a/src/pages/attendance/attendance_schedules/index.tsx +++ b/src/pages/attendance/attendance_schedules/index.tsx @@ -3,17 +3,24 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { AttendanceSchedulesStatusEnum } from '@/gen/Enums'; +import AttendanceConfigs from '@/pages/attendance/attendance_configs'; +import AttendanceShifts from '@/pages/attendance/attendance_shifts'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space, Tooltip } from 'antd'; +import { Modal, Space, Tooltip } from 'antd'; +import { useState } from 'react'; import Update from './modals/Update'; export default function Index({ title = '排班管理' }) { const navigate = useNavigate(); + const [configModalVisible, setConfigModalVisible] = useState(false); + const [shiftModalVisible, setShiftModalVisible] = useState(false); return ( [ - { - navigate('/attendance/attendance_schedules/pages/create'); + { + navigate('/attendance/attendance_schedules/pages/create'); + }} + title="批量排班" + /> + ), + config: ( + setConfigModalVisible(true)} + title="打卡配置" + /> + ), + shift: ( + setShiftModalVisible(true)} + title="班次管理" + /> + ), }} - title="批量排班 / 批量调整" />, ]} columns={[ @@ -135,24 +165,56 @@ export default function Index({ title = '排班管理' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - - - Apis.Attendance.AttendanceSchedules.Cancel({ - id: item.id, - }).then(() => action?.reload()) - } + + ), + cancel: ( + + Apis.Attendance.AttendanceSchedules.Cancel({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), }), ]} /> + setConfigModalVisible(false)} + width={1200} + footer={null} + destroyOnClose + > + + + setShiftModalVisible(false)} + width={1200} + footer={null} + destroyOnClose + > + + ); } diff --git a/src/pages/attendance/attendance_schedules/pages/create.tsx b/src/pages/attendance/attendance_schedules/pages/create.tsx index faf9e9b..d87255a 100644 --- a/src/pages/attendance/attendance_schedules/pages/create.tsx +++ b/src/pages/attendance/attendance_schedules/pages/create.tsx @@ -14,91 +14,144 @@ import { import { useNavigate } from '@umijs/max'; import { Form, message, Space } from 'antd'; import dayjs from 'dayjs'; -import { useState } from 'react'; -let optionsData: any = []; +import { useCallback, useMemo, useRef, useState } from 'react'; + +interface SchedulePerson { + id: number; + name: string; + [date: string]: any; +} + +interface ScheduleItem { + company_employees_id: number; + attendance_shifts_id: number; + schedule_date: string; + status: string; +} + +const BASE_COLUMNS = [ + { title: '员工ID', dataIndex: 'id', readonly: true }, + { title: '员工', dataIndex: 'name', readonly: true }, +]; + export default function Index({ title = '批量排班' }) { const [form] = Form.useForm(); const navigate = useNavigate(); - const [startDate, setStartDate] = useState([]); - const [dataSource, setDataSource] = useState([]); + + const [originalData, setOriginalData] = useState([]); + const [dataSource, setDataSource] = useState([]); + const [fetchLoading, setFetchLoading] = useState(false); + const [scheduleDate, setScheduleDate] = useState(''); + const shiftOptionsRef = useRef([]); // 动态提取日期(排除 id 和 name 字段) - const extractDates = (data: any) => { + const extractDates = useCallback((data: SchedulePerson[]): string[] => { + if (!data || data.length === 0) return []; const firstPerson = data[0]; return Object.keys(firstPerson).filter( (key) => key !== 'id' && key !== 'name' && !isNaN(Date.parse(key)), ); - }; + }, []); - const getOptionsData = async (params: any) => { - if (optionsData?.length) { - return optionsData || []; + // 获取班次选项(组件内缓存,不会跨实例共享) + const getShiftOptions = useCallback(async (keywords?: string) => { + if (shiftOptionsRef.current.length) { + return shiftOptionsRef.current; } - let res: any = await Apis.Attendance.AttendanceShifts.Select({ - ...params, - name: params?.keyWords || undefined, + const res = await Apis.Attendance.AttendanceShifts.Select({ + name: keywords || undefined, }); - optionsData = [...res?.data, ...[{ id: -1, name: '取消班次' }]]; - console.log(optionsData, '1'); - return optionsData || []; - }; - // 生成未来7天日期的函数 - const generateFutureDates = (startDate: string) => { - const dates = []; + const options = [...(res?.data || []), { id: -1, name: '休息' }]; + shiftOptionsRef.current = options; + return options; + }, []); - const columns = [ - { - title: '员工ID', - dataIndex: 'id', - readonly: true, - }, - { - title: '员工', - dataIndex: 'name', - readonly: true, - }, - ]; - const start = dayjs(startDate); + // 生成未来 7 天的列配置(缓存避免每次渲染重建) + const scheduleColumns = useMemo(() => { + if (!scheduleDate) return BASE_COLUMNS; + const start = dayjs(scheduleDate); + const dateColumns = []; for (let i = 0; i < 7; i++) { const currentDate = start.clone().add(i, 'day').format('YYYY-MM-DD'); - dates.push({ + dateColumns.push({ title: currentDate, key: currentDate, dataIndex: currentDate, formItemProps: { ...rulesHelper.number }, valueType: 'select', - request: async (params: any) => { - return getOptionsData(params); - }, + request: async (params: any) => getShiftOptions(params?.keyWords), fieldProps: { showSearch: true, allowClear: false, - // placeholder: '请选择班次', - fieldNames: { - label: 'name', - value: 'id', - }, + fieldNames: { label: 'name', value: 'id' }, }, }); } - console.log(dates); - if (startDate && dates?.length) { - return [...columns, ...dates]; - } else { - return columns; + return [...BASE_COLUMNS, ...dateColumns]; + }, [scheduleDate, getShiftOptions]); + + // 将排班数据转换为提交格式 + const transformScheduleData = useCallback( + ( + data: SchedulePerson[], + originals: SchedulePerson[], + dates: string[], + ): ScheduleItem[] => { + return data.flatMap((person) => + dates.map((date) => { + let shiftId = person[date]; + // 如果选的是休息(-1),回查原始排班数据 + if (shiftId === -1) { + const originalPerson = originals.find( + (item) => item.id === person.id, + ); + shiftId = originalPerson?.[date] ?? 0; + } + return { + company_employees_id: person.id, + attendance_shifts_id: shiftId || 0, + schedule_date: date, + status: person[date] < 0 ? 'Cancelled' : '', + }; + }), + ); + }, + [], + ); + + // 获取人员信息 + const handleFetchEmployees = useCallback(() => { + const organizations_id = form.getFieldValue('organizations_id'); + const date = form.getFieldValue('schedule_date'); + + if (!organizations_id?.length) { + message.warning('请先选择组织'); + return; } - }; + if (!date) { + message.warning('请先选择开始日期'); + return; + } + + setFetchLoading(true); + Apis.Attendance.AttendanceSchedules.ShiftList({ + schedule_date: date, + organizations_id: organizations_id[organizations_id.length - 1], + }) + .then((res) => { + const list = JSON.parse(JSON.stringify(res?.data || [])); + setOriginalData(list); + setDataSource(list); + setScheduleDate(date); + shiftOptionsRef.current = []; + }) + .finally(() => setFetchLoading(false)); + }, [form]); return ( { - navigate(-1); - }} - > - {/* */} + navigate(-1)}> {title} } @@ -109,100 +162,58 @@ export default function Index({ title = '批量排班' }) {
- + { + if (changedValues.schedule_date !== undefined) { + setScheduleDate(changedValues.schedule_date); + } + }} submitter={{ - render: (props) => { - return [ - { - props.submit(); - }} - title="提交保存" - />, - ]; - }, + render: (props) => [ + props.submit()} + title="提交保存" + />, + ], }} onFinish={async () => { - const dates = extractDates(dataSource); - const missingData: string[] = []; + try { + const dates = extractDates(dataSource); + const transformedData = transformScheduleData( + dataSource, + originalData, + dates, + ); + const filteredData = transformedData.filter( + (item) => + item.attendance_shifts_id !== null && + item.attendance_shifts_id !== 0, + ); - // // 先检查所有数据是否完整 - for (const person of dataSource) { - for (const date of dates) { - const shiftId = person[date]; - if (shiftId === undefined || shiftId === null) { - missingData.push(`员工 ${person?.name} 在 ${date}`); - } - } - } - - // 如果有缺失数据,提示并停止执行(只提示一次) - // if (missingData.length > 0) { - // message.error( - // `存在 ${missingData.length} 条未填写的排班数据,请完善后再提交`, - // ); - // return false; - // } - // 数据完整,进行转换和提交 - const transformedData: any = dataSource.flatMap((person: any) => { - console.log(person, 'person'); - - return dates.map((date) => { - let startDateItem: any = {}; - if (person[date] === -1) { - startDate?.flatMap((item: any) => { - if (item?.id === person?.id) { - startDateItem = item; - } - }); - } - console.log(startDateItem, 'startDateItem'); - return { - company_employees_id: person.id, - attendance_shifts_id: - person[date] === -1 - ? startDateItem[date] - : person[date] || 0, - schedule_date: date, - status: person[date] < 0 ? 'Cancelled' : '', - }; + await Apis.Attendance.AttendanceSchedules.BatchStore({ + schedules: filteredData, }); - }); - const filteredData = transformedData.filter( - (item: any) => - item.attendance_shifts_id !== null && - item.attendance_shifts_id !== 0, - ); - console.log(transformedData, startDate, 'startDate'); - - console.log(filteredData, 'filteredData'); - // return; - Apis.Attendance.AttendanceSchedules.BatchStore({ - schedules: filteredData || [], - }) - .then(() => { - navigate(-1); - message.success('提交成功'); - }) - .catch(() => false); - console.log(transformedData); + message.success('提交成功'); + navigate(-1); + } catch { + return false; + } }} columns={[ Selects?.OrganizationsTree({ @@ -227,70 +238,44 @@ export default function Index({ title = '批量排班' }) { valueType: 'dependency', name: ['organizations_id', 'schedule_date'], colProps: { span: 24 }, - columns: ({ schedule_date, organizations_id }) => { + columns: () => { return [ { - renderFormItem: () => { - console.log(schedule_date, organizations_id); - return ( - { - // getEmployeesExternal(organizations_id || []); //获取外部员工 - Apis.Attendance.AttendanceSchedules.ShiftList({ - schedule_date: schedule_date, - organizations_id: - organizations_id?.[ - organizations_id?.length - 1 - ], - }).then((res) => { - setStartDate( - JSON.parse(JSON.stringify(res?.data || [])), - ); - setDataSource( - JSON.parse(JSON.stringify(res?.data || [])), - ); - console.log(res); - }); - }} - /> - ); - }, + renderFormItem: () => ( + + ), }, { - renderFormItem: () => { - return ( - - - key={schedule_date} - headerTitle="第四步:设置员工班次(按周)" - bordered - recordCreatorProps={false} - columns={generateFutureDates(schedule_date || '')} - rowKey="id" - value={dataSource} - onChange={(values) => { - setDataSource(values); - }} - editable={{ - type: 'multiple', - editableKeys: dataSource?.map( - (item: any) => item?.id, - ), - onValuesChange: (record, recordList: any) => { - setDataSource(recordList); - }, - onSave: async (rowKey, data, row) => { - console.log(rowKey, data, row); - }, - }} - /> - - ); - }, + renderFormItem: () => ( + + + headerTitle="第四步:设置员工班次(按周)" + bordered + recordCreatorProps={false} + columns={scheduleColumns} + rowKey="id" + value={dataSource} + onChange={(values) => { + setDataSource(values as SchedulePerson[]); + }} + editable={{ + type: 'multiple', + editableKeys: dataSource?.map((item) => item?.id), + onValuesChange: (record, recordList) => { + setDataSource(recordList as SchedulePerson[]); + }, + onSave: async () => {}, + }} + /> + + ), }, ]; }, diff --git a/src/pages/attendance/attendance_shifts/index.tsx b/src/pages/attendance/attendance_shifts/index.tsx index 278df92..7636c83 100644 --- a/src/pages/attendance/attendance_shifts/index.tsx +++ b/src/pages/attendance/attendance_shifts/index.tsx @@ -1,8 +1,9 @@ import { MyButtons, MyColumns, - MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -10,145 +11,173 @@ import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space, Tooltip } from 'antd'; -export default function Index({ title = '班次管理' }) { +export default function Index({ + title = '班次管理', + noPermission, +}: { + title?: string; + noPermission?: boolean; +}) { const navigate = useNavigate(); return ( - - - MyProTableProps.request( - params, - sort, - Apis.Attendance.AttendanceShifts.List, - ) - } - headerTitle={title} - toolBarRender={() => [ - { - navigate('/attendance/attendance_shifts/pages/create'); - }} - title="新增班次" - />, - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - Selects?.AssetProjects({ - title: '选择项目', - key: 'asset_projects_id', - hidden: true, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - // search: { - // transform: (value) => { - // return { project_name: value }; - // }, - // }, - search: false, - }, - { - title: '班次名称', - dataIndex: 'name', - }, + + MyProTableProps.request( + params, + sort, + Apis.Attendance.AttendanceShifts.List, + ) + } + headerTitle={title} + toolBarRender={() => + noPermission + ? [ + { + navigate('/attendance/attendance_shifts/pages/create'); + }} + title="新增班次" + />, + ] + : [ + { + navigate('/attendance/attendance_shifts/pages/create'); + }} + title="新增班次" + /> + ), + }} + />, + ] + } + columns={[ + MyColumns.ID({ + search: false, + }), + Selects?.AssetProjects({ + title: '选择项目', + key: 'asset_projects_id', + hidden: true, + }), + { + title: '关联项目', + dataIndex: ['asset_project', 'name'], + // search: { + // transform: (value) => { + // return { project_name: value }; + // }, + // }, + search: false, + }, + { + title: '班次名称', + dataIndex: 'name', + }, - { - title: '时段要求', - dataIndex: 'attendance_shift_periods', - search: false, - render: (_, item: any) => { - const periods = item?.attendance_shift_periods || []; - const periodTexts = periods.map((res: any) => { - return `时段${ - res?.period_order - }: ${res?.work_start_time?.substring( - 0, - 5, - )}-${res?.work_end_time?.substring(0, 5)}`; - }); - const allPeriodsText = periodTexts.join(' '); + { + title: '时段要求', + dataIndex: 'attendance_shift_periods', + search: false, + render: (_, item: any) => { + const periods = item?.attendance_shift_periods || []; + const periodTexts = periods.map((res: any) => { + return `时段${ + res?.period_order + }: ${res?.work_start_time?.substring( + 0, + 5, + )}-${res?.work_end_time?.substring(0, 5)}`; + }); + const allPeriodsText = periodTexts.join(' '); - return ( - ( -
{text}
- )) || '' - } - > -
- {allPeriodsText} -
-
- ); - }, - }, - - { - title: '可打卡时间范围', - render(_, record) { - return `${record?.allow_checkin_start} - ${record?.allow_checkin_end}`; - }, - search: false, - }, - { - title: '备注', - dataIndex: 'remark', - search: false, - }, - MyColumns.Boolean({ - dataIndex: 'is_enabled', - title: '启用', - }), - - // MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate( - `/attendance/attendance_shifts/pages/update?id=${item.id}`, - ); + return ( + ( +
{text}
+ )) || '' + } + > +
+ > + {allPeriodsText} +
+
+ ); + }, + }, - - Apis.Attendance.AttendanceShifts.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> -
- ), - }), - ]} - /> -
+ { + title: '可打卡时间范围', + render(_, record) { + return `${record?.allow_checkin_start} - ${record?.allow_checkin_end}`; + }, + search: false, + }, + { + title: '备注', + dataIndex: 'remark', + search: false, + }, + MyColumns.Boolean({ + dataIndex: 'is_enabled', + title: '启用', + search: false, + }), + + // MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + { + navigate( + `/attendance/attendance_shifts/pages/update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + delete: ( + + Apis.Attendance.AttendanceShifts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> + + ), + }), + ]} + /> ); } diff --git a/src/pages/attendance/employee_tracks/$id.tsx b/src/pages/attendance/employee_tracks/$id.tsx index 847bbb8..9e37bf0 100644 --- a/src/pages/attendance/employee_tracks/$id.tsx +++ b/src/pages/attendance/employee_tracks/$id.tsx @@ -1,36 +1,58 @@ -import { MyPageContainer } from '@/common'; import { getTodayDate } from '@/common/utils/day'; import { mapKey } from '@/common/utils/mapConfig'; import { Apis } from '@/gen/Apis'; -import { LeftOutlined } from '@ant-design/icons'; +import { + CaretRightOutlined, + ExpandOutlined, + LeftOutlined, + PauseOutlined, +} from '@ant-design/icons'; import { ProCard } from '@ant-design/pro-components'; import { useNavigate, useParams } from '@umijs/max'; -import { Button, DatePicker, Space } from 'antd'; +import { Button, DatePicker, message, Select, Space, Spin } from 'antd'; import dayjs from 'dayjs'; import * as L from 'leaflet'; import 'leaflet/dist/leaflet.css'; -import { useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; +import endingPng from './ending.png'; +import startingPng from './starting.png'; import './style.scss'; + const dateFormat = 'YYYY/MM/DD'; + export default function Index({ title = '员工轨迹' }) { const navigate = useNavigate(); const { id } = useParams<{ id: string }>(); const mapRef = useRef(null); const mapInstanceRef = useRef(null); - // 初始化地图 - const initMap = () => { - if (!mapRef.current) return; + const movingMarkerRef = useRef(null); + const trackLineRef = useRef(null); + const animationRef = useRef(null); + const trackPointsRef = useRef([]); + + const [loading, setLoading] = useState(false); + const [isPlaying, setIsPlaying] = useState(false); + const [trackInfo, setTrackInfo] = useState<{ + count: number; + startTime: string; + endTime: string; + } | null>(null); + const [employees, setEmployees] = useState([]); + const [employeeLoading, setEmployeeLoading] = useState(false); + + // 初始化地图 + const initMap = (center?: L.LatLngTuple) => { + if (!mapRef.current || mapInstanceRef.current) return; - // 创建地图实例 const map = L.map(mapRef.current, { - center: [30.258134, 120.19382669582967], // 默认中心点(长江三角洲) - zoom: 10, + center: center || [35.8617, 104.1954], + zoom: center ? 14 : 4, maxZoom: 18, zoomControl: false, attributionControl: false, }); - // 添加天地图底图层(矢量地图) + // 天地图底图层 L.tileLayer( `https://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=${mapKey}`, { @@ -41,7 +63,7 @@ export default function Index({ title = '员工轨迹' }) { }, ).addTo(map); - // 添加天地图文字描述层(矢量注记) + // 天地图文字注记层 L.tileLayer( `https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=${mapKey}`, { @@ -52,31 +74,50 @@ export default function Index({ title = '员工轨迹' }) { }, ).addTo(map); + // 添加缩放控件到右下角 + L.control + .zoom({ + position: 'bottomright', + }) + .addTo(map); + mapInstanceRef.current = map; }; - // 显示轨迹 - const showTrack = (data: any[]) => { - if (!mapInstanceRef.current) return; - + // 清除轨迹图层(保留底图) + const clearTrackLayers = () => { const map = mapInstanceRef.current; + if (!map) return; - // 首先清除所有旧的轨迹(无论是否有新数据) map.eachLayer((layer: L.Layer) => { - if (layer instanceof L.Polyline || layer instanceof L.Marker) { + if ( + layer instanceof L.Polyline || + layer instanceof L.Marker || + layer instanceof L.CircleMarker + ) { map.removeLayer(layer); } }); - // 如果没有新的轨迹数据,直接返回 - if (!data || data.length === 0) return; + trackLineRef.current = null; + }; + + // 显示轨迹 + const showTrack = useCallback((data: any[]) => { + const map = mapInstanceRef.current; + if (!map) return; + + clearTrackLayers(); + + if (!data || data.length === 0) { + setTrackInfo(null); + return; + } - // 过滤有效坐标并保留原始数据 const validPoints = data.filter( (point) => point.latitude && point.longitude, ); - // 转换为Leaflet可识别的坐标格式 const trackPoints: L.LatLngTuple[] = validPoints.map( (point) => [ @@ -85,205 +126,391 @@ export default function Index({ title = '员工轨迹' }) { ] as L.LatLngTuple, ); - // 如果过滤后没有有效坐标,返回 - if (trackPoints.length === 0) return; + if (trackPoints.length === 0) { + setTrackInfo(null); + return; + } - // 创建轨迹线 + trackPointsRef.current = trackPoints; + + // 创建带流动动画的轨迹线 const trackLine = L.polyline(trackPoints, { - color: '#f00', + color: '#f5222d', weight: 4, - opacity: 1, + opacity: 0.85, + dashArray: '12, 8', + lineCap: 'round', + lineJoin: 'round', }).addTo(map); + trackLineRef.current = trackLine; // 添加起点标记 - const startMarker = L.marker(trackPoints[0], { + const startPoint = validPoints[0]; + L.marker(trackPoints[0], { icon: L.divIcon({ className: 'track-start-marker', - html: "", + html: `起点`, + iconSize: [36, 36], + iconAnchor: [18, 36], }), - }).addTo(map); - - // 为起点添加弹窗 - const startPoint = validPoints[0]; - startMarker.bindPopup(` -
-

起点

-

序号: 1

-

时间: ${startPoint.track_time || '未知'}

-

坐标: ${startPoint.latitude}, ${ - startPoint.longitude - }

-
- `); + zIndexOffset: 1000, + }) + .bindPopup( + `
+

起点

+

时间: ${startPoint.track_time || '未知'}

+

坐标: ${startPoint.latitude}, ${ + startPoint.longitude + }

+
`, + ) + .addTo(map); // 添加终点标记 - const endMarker = L.marker(trackPoints[trackPoints.length - 1], { + const endPoint = validPoints[validPoints.length - 1]; + L.marker(trackPoints[trackPoints.length - 1], { icon: L.divIcon({ className: 'track-end-marker', - html: "", + html: `终点`, + iconSize: [36, 36], + iconAnchor: [18, 36], }), - }).addTo(map); + zIndexOffset: 1000, + }) + .bindPopup( + `
+

终点

+

时间: ${endPoint.track_time || '未知'}

+

坐标: ${endPoint.latitude}, ${ + endPoint.longitude + }

+
`, + ) + .addTo(map); - // 为终点添加弹窗 - const endPoint = validPoints[validPoints.length - 1]; - endMarker.bindPopup(` -
-

终点

-

序号: ${validPoints.length}

-

时间: ${endPoint.track_time || '未知'}

-

坐标: ${endPoint.latitude}, ${ - endPoint.longitude - }

-
- `); - - // 为每个轨迹点添加序号标记和弹窗 + // 中间点标记(每隔几个点显示一个,避免过多) + const step = Math.max(1, Math.floor(trackPoints.length / 20)); trackPoints.forEach((point, index) => { - // 跳过起点和终点,只标记中间点 if (index === 0 || index === trackPoints.length - 1) return; + if (index % step !== 0) return; const currentPoint = validPoints[index]; - const marker = L.marker(point, { + L.marker(point, { icon: L.divIcon({ className: 'track-point-marker', - html: `
${ + html: `
${ index + 1 }
`, - iconSize: [24, 24], + iconSize: [22, 22], + iconAnchor: [11, 11], }), - }).addTo(map); - - // 为中间点添加弹窗 - marker.bindPopup(` -
-

点位 ${index + 1}

-

时间: ${currentPoint.track_time || '未知'}

-

坐标: ${currentPoint.latitude}, ${ - currentPoint.longitude - }

-
- `); + }) + .bindPopup( + `
+

点位 ${index + 1}

+

时间: ${currentPoint.track_time || '未知'}

+

坐标: ${currentPoint.latitude}, ${ + currentPoint.longitude + }

+
`, + ) + .addTo(map); }); - // 自动调整地图视图以显示整个轨迹 - map.fitBounds(trackLine.getBounds()); - }; + // 自动调整视图 + map.fitBounds(trackLine.getBounds(), { padding: [40, 40] }); - const loadShow = (day: any) => { - // showTrack([ - // { latitude: 22.566729, longitude: 114.062952 }, - // { latitude: 22.567982, longitude: 114.06278 }, - // { latitude: 22.569394, longitude: 114.062694 }, - // ]); - Apis.Attendance.AttendanceEmployeeTracks.Heatmap({ - company_employees_id: Number(id), - date: day, // 转换为Date类型 - }).then((res) => { - console.log(res); - // 假设API返回的数据结构为{ data: [{ latitude, longitude, time }, ...] } - showTrack(res?.data); - // setTrackData(res.data || []); + // 更新统计信息 + setTrackInfo({ + count: validPoints.length, + startTime: startPoint.track_time || '未知', + endTime: endPoint.track_time || '未知', }); - }; + }, []); + + // 播放轨迹动画 + const playTrack = useCallback(() => { + const map = mapInstanceRef.current; + const points = trackPointsRef.current; + if (!map || points.length < 2 || isPlaying) return; + + setIsPlaying(true); + + // 移除旧的移动标记 + if (movingMarkerRef.current) { + map.removeLayer(movingMarkerRef.current); + } + + const movingIcon = L.divIcon({ + className: 'track-moving-marker', + html: '
', + iconSize: [28, 28], + iconAnchor: [14, 14], + }); + + const marker = L.marker(points[0], { + icon: movingIcon, + zIndexOffset: 2000, + }).addTo(map); + movingMarkerRef.current = marker; + + let currentIndex = 0; + let progress = 0; + const speed = 0.03; // 动画速度 + + const animate = () => { + if (currentIndex >= points.length - 1) { + setIsPlaying(false); + return; + } + + progress += speed; + + if (progress >= 1) { + progress = 0; + currentIndex++; + } + + const start = L.latLng(points[currentIndex]); + const end = L.latLng(points[currentIndex + 1]); + const lat = start.lat + (end.lat - start.lat) * progress; + const lng = start.lng + (end.lng - start.lng) * progress; + + marker.setLatLng([lat, lng]); + + // 自动跟随视角(可选:平滑移动) + if (currentIndex % 5 === 0 && progress < 0.1) { + map.panTo([lat, lng], { animate: true, duration: 0.3 }); + } + + animationRef.current = requestAnimationFrame(animate); + }; + + animationRef.current = requestAnimationFrame(animate); + }, [isPlaying]); + + // 暂停轨迹 + const pauseTrack = useCallback(() => { + if (animationRef.current) { + cancelAnimationFrame(animationRef.current); + animationRef.current = null; + } + setIsPlaying(false); + }, []); + + // 重置视图 + const resetView = useCallback(() => { + const map = mapInstanceRef.current; + const line = trackLineRef.current; + if (map && line) { + map.fitBounds(line.getBounds(), { padding: [40, 40] }); + } + }, []); + + // 加载轨迹数据 + const loadShow = useCallback( + (day: any) => { + setLoading(true); + pauseTrack(); + + Apis.Attendance.AttendanceEmployeeTracks.Heatmap({ + company_employees_id: Number(id), + date: day, + }) + .then((res) => { + const data = res?.data || []; + const validPoints = data.filter( + (point: any) => point.latitude && point.longitude, + ); + + if (validPoints.length === 0) { + message.info('当天没有轨迹'); + clearTrackLayers(); + setTrackInfo(null); + return; + } + + const firstPoint: L.LatLngTuple = [ + parseFloat(validPoints[0].latitude), + parseFloat(validPoints[0].longitude), + ]; + initMap(firstPoint); + showTrack(data); + }) + .finally(() => { + setLoading(false); + }); + }, + [id, pauseTrack, showTrack], + ); + + // 加载员工列表 + const loadEmployees = useCallback(() => { + setEmployeeLoading(true); + Apis.Company.CompanyEmployees.Select() + .then((res) => { + const list = res?.data || []; + setEmployees(list); + }) + .finally(() => { + setEmployeeLoading(false); + }); + }, []); + useEffect(() => { - // 初始化地图 - initMap(); - // 加载轨迹数据 + loadEmployees(); loadShow(new Date(getTodayDate())); - // 组件卸载时清理地图实例 return () => { + if (animationRef.current) { + cancelAnimationFrame(animationRef.current); + } if (mapInstanceRef.current) { mapInstanceRef.current.remove(); mapInstanceRef.current = null; } }; - }, [id]); - - // // 当轨迹数据变化时,显示轨迹 - // useEffect(() => { - // if (trackData.length > 0) { - // showTrack(trackData); - // } - // }, [trackData]); + }, [id, loadEmployees, loadShow]); return ( - - } - onClick={() => navigate(-1)} - > - 员工轨迹底图 - - } - headerBordered - extra={ + } + onClick={() => navigate(-1)} + > + 员工轨迹底图 + + } + headerBordered + extra={ + + { + setSelectedProject(value); + setSelectedStandard(null); + }} + placeholder="请选择项目" + > + {projects.map((project) => ( + + {project.label} + + ))} + + + + + + + { + if (date) { + const newYear = date.year(); + setCurrentYear(newYear); + if (selectedProject && selectedStandard) { + loadTasks(newYear); + } + } + }} /> - - - Apis.HouseCharge.HouseChargeTasks.Delete({ - id: item.id, - }).then(() => action?.reload()) + + + + + + {!selectedProject || !selectedStandard ? ( +
+ 请先选择项目与收费标准! +
+ ) : ( +
+ {Array.from({ length: 12 }, (_, i) => { + const month = i + 1; + const { status, label, task } = getMonthTaskStatus(month); + const isCompleted = + status === HouseChargeTasksStatusEnum.Completed.value; + const isProcessing = + status === HouseChargeTasksStatusEnum.InProgress.value; + const isPending = + status === HouseChargeTasksStatusEnum.Pending.value; + const isFailed = + status === HouseChargeTasksStatusEnum.Failed.value; + const isNone = status === 'none'; + + let tagColor = 'default'; + let cardBgColor = '#ffffff'; + let cardBorderColor = '#f0f0f0'; + + if (isCompleted) { + tagColor = 'success'; + cardBgColor = '#f6ffed'; + cardBorderColor = '#b7eb8f'; } - /> - - ), - }), - ]} + if (isProcessing) { + tagColor = 'processing'; + cardBgColor = '#e6f7ff'; + cardBorderColor = '#91d5ff'; + } + if (isPending) { + tagColor = 'warning'; + cardBgColor = '#fff7e6'; + cardBorderColor = '#ffd591'; + } + if (isFailed) { + tagColor = 'error'; + cardBgColor = '#fff1f0'; + cardBorderColor = '#ffa39e'; + } + if (isNone) { + tagColor = 'default'; + cardBgColor = '#ffffff'; + cardBorderColor = '#f0f0f0'; + } + + return ( +
{ + if (isNone) { + e.currentTarget.style.backgroundColor = '#e6f7ff'; + e.currentTarget.style.borderColor = '#1890ff'; + e.currentTarget.style.boxShadow = + '0 4px 12px rgba(24, 144, 255, 0.15)'; + } else { + // 为不同状态添加对应的悬停效果 + if (isCompleted) { + e.currentTarget.style.backgroundColor = '#d9f7be'; + e.currentTarget.style.borderColor = '#95de64'; + } else if (isProcessing) { + e.currentTarget.style.backgroundColor = '#bae7ff'; + e.currentTarget.style.borderColor = '#69c0ff'; + } else if (isPending) { + e.currentTarget.style.backgroundColor = '#ffecb3'; + e.currentTarget.style.borderColor = '#ffc53d'; + } else if (isFailed) { + e.currentTarget.style.backgroundColor = '#ffccc7'; + e.currentTarget.style.borderColor = '#ff7875'; + } + e.currentTarget.style.boxShadow = + '0 4px 12px rgba(0, 0, 0, 0.1)'; + } + }} + onMouseLeave={(e) => { + if (isNone) { + e.currentTarget.style.backgroundColor = '#ffffff'; + e.currentTarget.style.borderColor = '#f0f0f0'; + } else { + // 恢复为原始状态颜色 + e.currentTarget.style.backgroundColor = cardBgColor; + e.currentTarget.style.borderColor = cardBorderColor; + } + e.currentTarget.style.boxShadow = + '0 2px 8px rgba(0, 0, 0, 0.06)'; + }} + > +
+ {currentYear}年- + {month}月 +
+
+ + {label} + {task?.task_count ? `(${task.task_count})` : ''} + +
+
+ {task?.start_date + ? `${task.start_date} 至 ${task.end_date}` + : ''} +
+ {isNone && ( + + + + )} + {(isPending || isFailed || isCompleted) && task && ( + + {(isPending || isFailed) && } + {isCompleted && ( + <> + + + + )} + + )} +
+ ); + })} +
+ )} +
+
+ + + ); diff --git a/src/pages/charge/tasks/modals/TaskCreate.tsx b/src/pages/charge/tasks/modals/TaskCreate.tsx index baa44b9..3e271f4 100644 --- a/src/pages/charge/tasks/modals/TaskCreate.tsx +++ b/src/pages/charge/tasks/modals/TaskCreate.tsx @@ -11,6 +11,7 @@ import { Form, message } from 'antd'; export default function Create(props: MyBetaModalFormProps) { const [form] = Form.useForm(); + return ( {...MyModalFormProps.props} @@ -20,20 +21,66 @@ export default function Create(props: MyBetaModalFormProps) { labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left" - trigger={} key={new Date().getTime()} + trigger={} form={form} onOpenChange={(open: any) => { if (open) { - form.resetFields(); // 清空表单数据 + form.resetFields(); + if (props?.item?.asset_projects_id) { + form.setFieldsValue({ + asset_projects_id: props?.item?.asset_projects_id, + }); + } + if (props?.item?.house_charge_standards_id) { + form.setFieldsValue({ + house_charge_standards_id: props?.item?.house_charge_standards_id, + }); + } + if (props?.item?.month) { + form.setFieldsValue({ + month: `${props?.item?.year}-${String( + props?.item?.month, + ).padStart(2, '0')}`, + start_date: rulesHelper.getMonthStartDate( + `${props?.item?.year}-${String(props?.item?.month).padStart( + 2, + '0', + )}`, + ), + end_date: rulesHelper.getMonthEndDate( + `${props?.item?.year}-${String(props?.item?.month).padStart( + 2, + '0', + )}`, + ), + }); + } } }} onFinish={async (values) => Apis.HouseCharge.HouseChargeTasks.Store(values) - .then(() => { - props.reload?.(); - message.success(props.title + '账单任务创建成功'); - return true; + .then((response) => { + const taskId = response?.data?.id; + if (taskId) { + return Apis.HouseCharge.HouseChargeTasks.ExecuteTask({ + id: taskId, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '账单任务创建并执行成功'); + return true; + }) + .catch(() => { + props.reload?.(); + message.success(props.title + '账单任务创建成功,但执行失败'); + return true; + }); + } else { + props.reload?.(); + message.success(props.title + '账单任务创建成功'); + return true; + } }) .catch(() => false) } @@ -67,6 +114,14 @@ export default function Create(props: MyBetaModalFormProps) { formItemProps: { ...rulesHelper.text }, fieldProps: { showSearch: true, + labelRender: (res: any) => { + console.log(res, '222'); + if (res?.label) { + return res?.label; + } else { + return props?.item?.name; + } + }, }, }), ]; @@ -123,7 +178,7 @@ export default function Create(props: MyBetaModalFormProps) { formItemProps: { labelCol: { span: 0 }, wrapperCol: { span: 24 } }, renderFormItem: () => ( - 提示:【确认】后,需在列表中【手动执行】。 + 提示:【确认】后,系统将自动执行账单生成任务。 ), }, diff --git a/src/pages/charge/tasks/modals/TaskShow.tsx b/src/pages/charge/tasks/modals/TaskShow.tsx index 4dc87c5..34b0e20 100644 --- a/src/pages/charge/tasks/modals/TaskShow.tsx +++ b/src/pages/charge/tasks/modals/TaskShow.tsx @@ -8,16 +8,23 @@ import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; -export default function TaskShow(props: MyBetaModalFormProps) { - const navigate = useNavigate(); +interface TaskShowProps extends MyBetaModalFormProps { + open?: boolean; + setOpen?: (open: boolean) => void; + item?: any; +} + +export default function TaskShow(props: TaskShowProps) { return ( props.setOpen?.(false)} node={ ( - // { - // navigate(`/bills/summary/show/${record.asset_houses_id}`); - // }} - // /> - // ), + // render: (_, record) => { + // return record.asset_houses_id ? ( + // { + // record.asset_houses_id + // ? navigate( + // `/bills/summary/show/${record.asset_houses_id}`, + // ) + // : ''; + // }} + // /> + // ) : ( + // '车位| ' + record.asset_car_port.full_name + // ); + // }, search: { transform: (value) => ({ full_name: value }) }, }, { diff --git a/src/pages/company/accounts/index.tsx b/src/pages/company/accounts/index.tsx index ea96026..e05d280 100644 --- a/src/pages/company/accounts/index.tsx +++ b/src/pages/company/accounts/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { CompanyReceiptAccountsPayChannelEnum } from '@/gen/Enums'; @@ -32,19 +34,28 @@ export default function Index({ title = '账号管理' }) { ) } toolBarRender={(action) => [ - , - { - navigate('/asset/accounts'); + + ), + config: ( + { + navigate('/asset/accounts'); + }} + size="middle" + title="去配置项目账号" + /> + ), }} - size="middle" - title="去配置项目账号" />, ]} columns={[ @@ -79,17 +90,25 @@ export default function Index({ title = '账号管理' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - - - Apis.Company.CompanyReceiptAccounts.Delete({ - id: item.id, - }).then(() => action?.reload()) - } + + ), + delete: ( + + Apis.Company.CompanyReceiptAccounts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), diff --git a/src/pages/company/brand/index.tsx b/src/pages/company/brand/index.tsx index e3ca1de..5c38fe1 100644 --- a/src/pages/company/brand/index.tsx +++ b/src/pages/company/brand/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; @@ -35,7 +37,18 @@ export default function Index({ title = '品牌管理' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -66,17 +79,25 @@ export default function Index({ title = '品牌管理' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - - - Apis.Company.CompanyPropertyBrands.Delete({ - id: item.id, - }).then(() => action?.reload()) - } + + ), + delete: ( + + Apis.Company.CompanyPropertyBrands.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), diff --git a/src/pages/company/employees/index.tsx b/src/pages/company/employees/index.tsx index d2ac3da..11bf919 100644 --- a/src/pages/company/employees/index.tsx +++ b/src/pages/company/employees/index.tsx @@ -3,12 +3,13 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, renderTextHelper, - useCurrentPermissions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; -import { Dropdown, Space } from 'antd'; +import { Space } from 'antd'; import Change from './modals/Change'; import { Selects } from '@/components/Select'; @@ -17,63 +18,6 @@ import EmployeeUpdate from './modals/EmployeeUpdate'; import Role from './modals/Role'; export default function Index({ title = '员工管理' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - add: , - }); - }; - let tableRender = (item: any, action: any) => { - let permissions = getCurrentPermissions({ - update: ( - - ), - CompanyEmployees: ( - - ), - }); - let permissionsSpace = getCurrentPermissions({ - Role: { - key: '1', - label: , - }, - ResetPassword: { - key: '2', - label: ( - - Apis.Company.CompanyEmployees.ResetPassword({ - id: item.id, - password: 'ly#123', - }).then(() => action?.reload()) - } - /> - ), - }, - delete: { - key: '3', - label: ( - - Apis.Company.CompanyEmployees.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - ), - }, - }); - let Others = ( - - - - ); - return [...permissions, ...[Others]]; - }; return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false, @@ -130,13 +87,13 @@ export default function Index({ title = '员工管理' }) { search: false, }, { - title: '员工端角色', + title: '员工角色', dataIndex: 'employee_roles', renderText: renderTextHelper.TagList, hideInSearch: true, }, { - title: '系统后台角色', + title: '后台角色', dataIndex: 'company_roles', renderText: renderTextHelper.TagList, hideInSearch: true, @@ -161,7 +118,50 @@ export default function Index({ title = '员工管理' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - <>{tableRender(item, action)} + + ), + CompanyEmployees: ( + + ), + Role: ( + + ), + ResetPassword: ( + + Apis.Company.CompanyEmployees.ResetPassword({ + id: item.id, + password: 'ly#123', + }).then(() => action?.reload()) + } + /> + ), + delete: ( + + Apis.Company.CompanyEmployees.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), diff --git a/src/pages/company/employees/modals/EmployeeCreate.tsx b/src/pages/company/employees/modals/EmployeeCreate.tsx index e41b574..41c3a36 100644 --- a/src/pages/company/employees/modals/EmployeeCreate.tsx +++ b/src/pages/company/employees/modals/EmployeeCreate.tsx @@ -95,7 +95,7 @@ export default function Create(props: MyBetaModalFormProps) { required: false, }), SysSelects.SysRoles({ - title: '系统角色', + title: '后台角色', required: false, }), { diff --git a/src/pages/company/employees/modals/EmployeeUpdate.tsx b/src/pages/company/employees/modals/EmployeeUpdate.tsx index 66e7043..a109b42 100644 --- a/src/pages/company/employees/modals/EmployeeUpdate.tsx +++ b/src/pages/company/employees/modals/EmployeeUpdate.tsx @@ -112,7 +112,7 @@ export default function Update(props: MyBetaModalFormProps) { }, }), SysSelects.SysRoles({ - title: '系统角色', + title: '后台角色', required: false, fieldProps: { labelRender: (res: any) => { @@ -126,12 +126,6 @@ export default function Update(props: MyBetaModalFormProps) { }, }, }), - // { - // key: 'password', - // title: '密码', - // colProps: { span: 24 }, - // valueType: 'password', - // }, { key: 'remark', title: '备注', diff --git a/src/pages/company/organization_has_projects/index.tsx b/src/pages/company/organization_has_projects/index.tsx deleted file mode 100644 index eee89ec..0000000 --- a/src/pages/company/organization_has_projects/index.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { - MyColumns, - MyPageContainer, - MyProTableProps, - useCurrentPermissions, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import HasProjects from './modals/HasProjects'; - -export default function Index({ title = '组织项目关联' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - has: ( - - ), - }); - }; - - return ( - - - MyProTableProps.request( - params, - sort, - Apis.Company.OrganizationHasProjects.List, - ) - } - toolBarRender={(action) => [toolBarRender(action)]} - headerTitle="组织项目关联" - tooltip="组织项目关联关系会影响所在组织员工权限,需在【配置】中进行操作" - // options={false} - // search={false} - columns={[ - { - title: 'ID', - dataIndex: 'id', - search: false, - }, - { - title: '组织名称', - dataIndex: ['organization', 'name'], - search: { - transform: (value) => { - return { organization_name: value }; - }, - }, - }, - { - title: '项目名称', - dataIndex: ['asset_project', 'name'], - search: { - transform: (value) => { - return { project_name: value }; - }, - }, - }, - MyColumns.UpdatedAt(), - ]} - /> - - ); -} diff --git a/src/pages/company/organization_has_projects/modals/HasProjects.tsx b/src/pages/company/organization_has_projects/modals/HasProjects.tsx deleted file mode 100644 index 349db73..0000000 --- a/src/pages/company/organization_has_projects/modals/HasProjects.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function OrganizationHasProjects(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - width="500px" - trigger={} - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - } - }} - onFinish={async (values: any) => - Apis.Company.OrganizationHasProjects.BatchStore({ - ...values, - organizations_id: - values?.organizations_id?.[values.organizations_id.length - 1], - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - Selects?.OrganizationsTree({ - title: '选择组织', - key: 'organizations_id', - colProps: { span: 24 }, - fieldProps: { - showSearch: true, - }, - formItemProps: { ...rulesHelper.text }, - }), - Selects?.AssetProjects({ - key: 'asset_projects_ids', - title: '选择项目', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.array }, - fieldProps: { - showSearch: true, - mode: 'multiple', - }, - }), - ]} - /> - ); -} diff --git a/src/pages/company/organizations/index.tsx b/src/pages/company/organizations/index.tsx index 0702a46..ae1eb36 100644 --- a/src/pages/company/organizations/index.tsx +++ b/src/pages/company/organizations/index.tsx @@ -3,19 +3,34 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { OrganizationsTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; +import { useRef, useState } from 'react'; import NextOrganizationChange from './modals/NextOrganizationChange'; import OrganizationChange from './modals/OrganizationChange'; import OrganizationCreate from './modals/OrganizationCreate'; import OrganizationUpdate from './modals/OrganizationUpdate'; +const collectExpandKeys = (data: any[], depth = 0): React.Key[] => { + if (!data || depth >= 2) return []; + let keys: React.Key[] = []; + data.forEach((item: any) => { + if (item.children && item.children.length > 0) { + keys.push(item.id); + keys.push(...collectExpandKeys(item.children, depth + 1)); + } + }); + return keys; +}; + export default function Index({ title = '组织管理' }) { - const navigate = useNavigate(); + const [expandedKeys, setExpandedKeys] = useState([]); + const hasExpanded = useRef(false); return ( - MyProTableProps.request( + pagination={false} + request={async (params, sort) => { + const result = await MyProTableProps.request( params, sort, Apis.Company.Organizations.TreeList, - ) - } + ); + if (result.data && !hasExpanded.current) { + setExpandedKeys(collectExpandKeys(result.data)); + hasExpanded.current = true; + } + return result; + }} headerTitle="组织列表" options={false} + expandable={{ + expandedRowKeys: expandedKeys, + onExpandedRowsChange: (keys: readonly React.Key[]) => + setExpandedKeys([...keys]), + childrenColumnName: 'children', + }} toolBarRender={(action) => [ - + ), + }} />, ]} columns={[ { - title: '组织ID', - dataIndex: 'id', - search: false, - }, - { - title: '名称', + title: '组织名称', dataIndex: 'name', + width: 300, }, MyColumns.EnumTag({ title: '类型', dataIndex: 'type', valueEnum: OrganizationsTypeEnum, search: false, + width: 120, }), - - { - title: '上级组织', - dataIndex: ['organization_parent', 'name'], - search: false, - }, MyColumns.Option({ + fixed: 'right', + width: 280, render: (_, item: any, index, action) => ( - {item?.type !== OrganizationsTypeEnum.Group.value && ( - - )} - - - - - Apis.Company.Organizations.Delete({ id: item.id }).then( - () => action?.reload(), - ) - } + + ), + change: ( + + ), + next: ( + + ), + delete: ( + + Apis.Company.Organizations.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), diff --git a/src/pages/company/organizations/modals/NextOrganizationChange.tsx b/src/pages/company/organizations/modals/NextOrganizationChange.tsx index b94de60..33997da 100644 --- a/src/pages/company/organizations/modals/NextOrganizationChange.tsx +++ b/src/pages/company/organizations/modals/NextOrganizationChange.tsx @@ -19,7 +19,7 @@ export default function Create(props: MyBetaModalFormProps) { title={`添加${props.title}`} wrapperCol={{ span: 24 }} width="500px" - trigger={} + trigger={} key={new Date().getTime()} form={form} onOpenChange={(open: any) => { diff --git a/src/pages/company/organizations/modals/OrganizationChange.tsx b/src/pages/company/organizations/modals/OrganizationChange.tsx index c4deda2..f2bfad7 100644 --- a/src/pages/company/organizations/modals/OrganizationChange.tsx +++ b/src/pages/company/organizations/modals/OrganizationChange.tsx @@ -6,6 +6,7 @@ import { } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; +import { OrganizationsTypeEnum } from '@/gen/Enums'; import { BetaSchemaForm } from '@ant-design/pro-components'; import { Form, message } from 'antd'; @@ -16,7 +17,14 @@ export default function Update(props: MyBetaModalFormProps) { {...MyModalFormProps.props} title={`${props.title}调整`} form={form} - trigger={} + trigger={ + + } wrapperCol={{ span: 24 }} width="500px" onOpenChange={(open: any) => { diff --git a/src/pages/company/positions/index.tsx b/src/pages/company/positions/index.tsx index 3592044..be498af 100644 --- a/src/pages/company/positions/index.tsx +++ b/src/pages/company/positions/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; @@ -29,7 +31,18 @@ export default function Index({ title = '岗位管理' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -54,17 +67,25 @@ export default function Index({ title = '岗位管理' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - - - Apis.Company.CompanyPositions.Delete({ id: item.id }).then( - () => action?.reload(), - ) - } + + ), + delete: ( + + Apis.Company.CompanyPositions.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} /> ), diff --git a/src/pages/contract/contract_archive_use/index.tsx b/src/pages/contract/contract_archive_use/index.tsx deleted file mode 100644 index 71c6689..0000000 --- a/src/pages/contract/contract_archive_use/index.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { MyPageContainer } from '@/common'; -import { useSearchParams } from '@umijs/max'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import Borrows from './borrows'; -import Read from './read'; - -export default function Index({ title = '合同档案利用' }) { - const [searchParams] = useSearchParams(); - const [activeKey, setActiveKey] = useState('Borrows'); - - const items: TabsProps['items'] = [ - { - key: 'Borrows', - label: '合同借用', - children: , - }, - { - key: 'Read', - label: '合同借阅', - children: , - }, - ]; - - useEffect(() => { - if (searchParams?.get('key')) { - setActiveKey(searchParams?.get('key') || 'Borrows'); - } - }, []); - - return ( - - { - setActiveKey(key); - }} - /> - - ); -} diff --git a/src/pages/contract/contract_archives/finished/index.tsx b/src/pages/contract/contract_archives/finished/index.tsx index 0f2d3f4..d8b5fae 100644 --- a/src/pages/contract/contract_archives/finished/index.tsx +++ b/src/pages/contract/contract_archives/finished/index.tsx @@ -1,154 +1,137 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, +} from '@/common'; import { Apis } from '@/gen/Apis'; import { ContractArchivesConfidentialityLevelEnum, ContractArchivesPeriodTypeEnum, } from '@/gen/Enums'; - import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; +import Save from '../modals/Save'; +import Show from '../modals/Show'; +import TransfersCreate from '../modals/TransfersCreate'; +import Update from '../modals/Update'; -import Save from './modals/Save'; -import Show from './modals/Show'; -import TransfersCreate from './modals/TransfersCreate'; -import Update from './modals/Update'; - -export default function Index() { - // let toolBarRender = (action: any) => { - // return getCurrentPermissions( - // { - // borrow: ( - // - // ), - // }, - // 'Finished', - // ); - // }; +export default function Index({ title = '归档记录' }) { + const navigate = useNavigate(); return ( - - MyProTableProps.request( - params, - sort, - Apis.Contract.ContractArchives.List, - ) - } - // toolBarRender={(action) => [toolBarRender(action)]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '归档编号', - dataIndex: 'code', - // render: (_, item: any) => ( - // { - // navigate( - // `/contract/contract_archives/show/${item.contracts_id}`, - // ); - // }} - // > - // {item?.code} - // - // ), - }, - { - title: '合同名称', - dataIndex: 'name', - }, - MyColumns.EnumTag({ - title: '保密等级', - dataIndex: 'confidentiality_level', - valueEnum: ContractArchivesConfidentialityLevelEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '期限类型', - dataIndex: 'period_type', - valueEnum: ContractArchivesPeriodTypeEnum, - search: false, - }), - - { - title: '保管年限', - dataIndex: 'storage_years', - valueType: 'digit', - search: false, - }, - // { - // title: '案卷编号', - // dataIndex: 'file_number', - // }, - { - title: '文件盒编号', - dataIndex: 'box_number', - }, - { - title: '文件柜编号', - dataIndex: 'cabinet_number', - }, - - // { - // title: '归档年份', - // dataIndex: 'archive_year', - // valueType: 'dateYear', - // search: false, - // }, - { - title: '归档日期', - dataIndex: 'archive_date', - valueType: 'date', - sorter: true, - search: false, - }, - { - title: '保管人', - dataIndex: 'keeper_name', - search: false, - }, - { - title: '文件信息', - render: (_, item: any) => { - return item?.archive_files?.map((res: any, index: number) => { - return ( -
- 文件:{res?.name},已借:{res?.borrowed_number}份,遗失: - {res?.lost_number}份 -
- ); - }); + + + MyProTableProps.request( + params, + sort, + Apis.Contract.ContractArchives.List, + ) + } + headerTitle="归档记录" + toolBarRender={(action) => [ + { + navigate('/contract/contract_archives'); + }} + />, + ]} + columns={[ + MyColumns.ID({ search: false }), + { + title: '归档编号', + dataIndex: 'code', }, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - - - Apis.Contract.ContractArchives.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> + { + title: '合同名称', + dataIndex: 'name', + }, + MyColumns.EnumTag({ + title: '保密等级', + dataIndex: 'confidentiality_level', + valueEnum: ContractArchivesConfidentialityLevelEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '期限类型', + dataIndex: 'period_type', + valueEnum: ContractArchivesPeriodTypeEnum, + search: false, + }), + { + title: '保管年限', + dataIndex: 'storage_years', + valueType: 'digit', + search: false, + }, + { + title: '文件盒编号', + dataIndex: 'box_number', + }, + { + title: '文件柜编号', + dataIndex: 'cabinet_number', + }, + { + title: '归档日期', + dataIndex: 'archive_date', + valueType: 'date', + sorter: true, + search: false, + }, + { + title: '保管人', + dataIndex: 'keeper_name', + search: false, + }, + { + title: '文件信息', + render: (_, item: any) => { + return item?.archive_files?.map((res: any, index: number) => { + return ( +
+ 文件:{res?.name},已借:{res?.borrowed_number}份,遗失: + {res?.lost_number}份 +
+ ); + }); + }, + }, + MyColumns.Option({ + render: (_, item: any, _index, action) => ( + + + + + + + Apis.Contract.ContractArchives.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> +
); } diff --git a/src/pages/contract/contract_archives/index.tsx b/src/pages/contract/contract_archives/index.tsx index 4337a5b..b8c4849 100644 --- a/src/pages/contract/contract_archives/index.tsx +++ b/src/pages/contract/contract_archives/index.tsx @@ -1,39 +1,24 @@ -import { MyPageContainer } from '@/common'; -import { useSearchParams } from '@umijs/max'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import Finished from './finished'; -import Transfers from './transfers'; -import Unfinished from './unfinished'; +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + ContractsContractNatureEnum, + ContractsStatusEnum, + ContractTemplatesIncomeExpenseTypeEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import dayjs from 'dayjs'; +import Archive from './modals/Archive'; +import Orther from './modals/Orther'; export default function Index({ title = '合同归档' }) { - const [searchParams] = useSearchParams(); - const [activeKey, setActiveKey] = useState('Unfinished'); - - const items: TabsProps['items'] = [ - { - key: 'Unfinished', - label: '未归档合同', - children: , - }, - { - key: 'Finished', - label: '归档记录', - children: , - }, - { - key: 'Transfers', - label: '转移记录', - children: , - }, - ]; - - useEffect(() => { - if (searchParams?.get('key')) { - setActiveKey(searchParams?.get('key') || 'Unfinished'); - } - }, []); + const navigate = useNavigate(); return ( - { - setActiveKey(key); + { + return MyProTableProps.request( + { + ...params, + status: ContractsStatusEnum.Signed.value, + }, + sort, + Apis.Contract.Contracts.List, + ); }} - type="card" + headerTitle="未归档合同" + toolBarRender={(action) => [ + { + navigate('/contract/contract_archives/finished'); + }} + />, + { + navigate('/contract/contract_archives/transfers'); + }} + />, + , + ]} + columns={[ + MyColumns.ID({ search: false }), + { + title: '合同类型', + dataIndex: 'contract_type_name', + search: false, + }, + { + title: '合同名称', + dataIndex: 'name', + }, + { + title: '合同编号', + dataIndex: 'code', + render: (_: any, item: any) => { + return ( + { + navigate(`/contract/contracts/show/${item.id}`); + }} + > + {item?.name} + + ); + }, + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: ContractsStatusEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '收支类型', + dataIndex: 'income_expense_type', + valueEnum: ContractTemplatesIncomeExpenseTypeEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '合同性质', + dataIndex: 'contract_nature', + valueEnum: ContractsContractNatureEnum, + search: false, + }), + { + title: '有效期', + search: false, + render: (_: any, item: any) => { + return `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( + item.end_time, + ).format('YYYY-MM-DD')}`; + }, + }, + { + title: '签订时间', + dataIndex: 'sign_time', + render: (_: any, item: any) => { + return item.sign_time + ? dayjs(item.sign_time).format('YYYY-MM-DD') + : '-'; + }, + search: false, + }, + MyColumns.Option({ + render: (_: any, item: any, _index: any, action: any) => ( + + + + ), + }), + ]} /> ); diff --git a/src/pages/contract/contract_archives/unfinished/modals/Archive.tsx b/src/pages/contract/contract_archives/modals/Archive.tsx similarity index 100% rename from src/pages/contract/contract_archives/unfinished/modals/Archive.tsx rename to src/pages/contract/contract_archives/modals/Archive.tsx diff --git a/src/pages/contract/contract_archives/unfinished/modals/Orther.tsx b/src/pages/contract/contract_archives/modals/Orther.tsx similarity index 100% rename from src/pages/contract/contract_archives/unfinished/modals/Orther.tsx rename to src/pages/contract/contract_archives/modals/Orther.tsx diff --git a/src/pages/contract/contract_archives/finished/modals/Save.tsx b/src/pages/contract/contract_archives/modals/Save.tsx similarity index 97% rename from src/pages/contract/contract_archives/finished/modals/Save.tsx rename to src/pages/contract/contract_archives/modals/Save.tsx index d2fd49a..91cb653 100644 --- a/src/pages/contract/contract_archives/finished/modals/Save.tsx +++ b/src/pages/contract/contract_archives/modals/Save.tsx @@ -62,7 +62,6 @@ export default function Save(props: MyBetaModalFormProps) { checkedChildren: '操作封存', unCheckedChildren: '取消封存', onChange: () => { - // 切换计量单位时清空计费模式 form.setFieldValue('seal_date', undefined); }, }, diff --git a/src/pages/contract/contract_archives/finished/modals/Show.tsx b/src/pages/contract/contract_archives/modals/Show.tsx similarity index 100% rename from src/pages/contract/contract_archives/finished/modals/Show.tsx rename to src/pages/contract/contract_archives/modals/Show.tsx diff --git a/src/pages/contract/contract_archives/finished/modals/TransfersCreate.tsx b/src/pages/contract/contract_archives/modals/TransfersCreate.tsx similarity index 67% rename from src/pages/contract/contract_archives/finished/modals/TransfersCreate.tsx rename to src/pages/contract/contract_archives/modals/TransfersCreate.tsx index 44c7af6..e0d343a 100644 --- a/src/pages/contract/contract_archives/finished/modals/TransfersCreate.tsx +++ b/src/pages/contract/contract_archives/modals/TransfersCreate.tsx @@ -58,36 +58,6 @@ export default function Index(props: MyBetaModalFormProps) { }, required: true, }), - // Address.Cascader({ - // key: 'casacader', - // title: '选择地址', - // colProps: { span: 12 }, - // keys: ['province', 'city', 'area', 'street'], - // }), - // { - // key: 'address', - // title: '详细地址', - // dataIndex: 'address', - // colProps: { span: 12 }, - // }, - // { - // key: 'file_number', - // title: '案卷编号', - // dataIndex: 'file_number', - // colProps: { span: 12 }, - // }, - // { - // key: 'box_number', - // title: '文件盒编号', - // dataIndex: 'box_number', - // colProps: { span: 12 }, - // }, - // { - // key: 'cabinet_number', - // title: '文件柜编号', - // dataIndex: 'cabinet_number', - // colProps: { span: 12 }, - // }, { key: 'remark', title: '备注', diff --git a/src/pages/contract/contract_archives/finished/modals/Update.tsx b/src/pages/contract/contract_archives/modals/Update.tsx similarity index 92% rename from src/pages/contract/contract_archives/finished/modals/Update.tsx rename to src/pages/contract/contract_archives/modals/Update.tsx index c73a580..da40a33 100644 --- a/src/pages/contract/contract_archives/finished/modals/Update.tsx +++ b/src/pages/contract/contract_archives/modals/Update.tsx @@ -28,7 +28,6 @@ export default function Update(props: MyBetaModalFormProps) { labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left" - // 高度固定,高度滚动,宽度限定 style={{ padding: '20px', height: '680px', @@ -121,12 +120,6 @@ export default function Update(props: MyBetaModalFormProps) { }, valueEnum: ContractArchivesConfidentialityLevelEnum, }), - // { - // key: 'file_number', - // title: '案卷编号', - // formItemProps: { ...rulesHelper.text }, - // colProps: { span: 12 }, - // }, { key: 'box_number', title: '文件盒编号', @@ -157,18 +150,6 @@ export default function Update(props: MyBetaModalFormProps) { }, colProps: { span: 12 }, }, - // Address.Cascader({ - // key: 'casacader', - // title: '存放地区', - // colProps: { span: 12 }, - // keys: ['province', 'city', 'area', 'street'], - // }), - // { - // key: 'address', - // title: '详细地址', - // colProps: { span: 12 }, - // }, - { key: 'archive_year', title: '归档年份', @@ -196,7 +177,6 @@ export default function Update(props: MyBetaModalFormProps) { colProps: { span: 24 }, fieldProps: { copyIconProps: false, - // deleteIconProps: false, itemRender: ({ listDom, action }: any, { index }: any) => { return ( - MyProTableProps.request( - params, - sort, - Apis.Contract.ContractArchiveTransfers.List, - ) - } - headerTitle="合同转交记录列表" - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '合同ID', - dataIndex: 'contracts_id', - hidden: true, - }, - { - title: '原保管人', - dataIndex: 'old_keeper_name', - hidden: true, - }, - { - title: '新保管人', - dataIndex: 'new_keeper_name', - hidden: true, - }, - { - title: '原保管人', - search: false, - render: (_, item: any) => { - return `${item?.old_keeper_name}:${item?.old_keeper_phone}`; + + + MyProTableProps.request( + params, + sort, + Apis.Contract.ContractArchiveTransfers.List, + ) + } + headerTitle="转移记录" + toolBarRender={() => [ + { + navigate('/contract/contract_archives'); + }} + />, + ]} + columns={[ + MyColumns.ID({ search: false }), + { + title: '合同ID', + dataIndex: 'contracts_id', + hidden: true, }, - }, - { - title: '新保管人', - search: false, - render: (_, item: any) => { - return `${item?.new_keeper_name}:${item?.new_keeper_phone}`; + { + title: '原保管人', + dataIndex: 'old_keeper_name', + hidden: true, }, - }, - { - title: '新存放位置', - search: false, - render: (_, res: any) => { - return `${res?.contract_archive?.province || ''}${ - res?.contract_archive?.city || '' - }${res?.contract_archive?.area}${ - res?.contract_archive?.street || '' - }${res?.contract_archive?.address || ''}`; + { + title: '新保管人', + dataIndex: 'new_keeper_name', + hidden: true, }, - }, - { - title: '文件盒编号', - dataIndex: ['contract_archive', 'box_number'], - search: false, - }, - { - title: '文件柜编号', - dataIndex: ['contract_archive', 'cabinet_number'], - search: false, - }, - MyColumns.CreatedAt(), - ]} - /> + { + title: '原保管人', + search: false, + render: (_, item: any) => { + return `${item?.old_keeper_name}:${item?.old_keeper_phone}`; + }, + }, + { + title: '新保管人', + search: false, + render: (_, item: any) => { + return `${item?.new_keeper_name}:${item?.new_keeper_phone}`; + }, + }, + { + title: '新存放位置', + search: false, + render: (_, res: any) => { + return `${res?.contract_archive?.province || ''}${ + res?.contract_archive?.city || '' + }${res?.contract_archive?.area}${ + res?.contract_archive?.street || '' + }${res?.contract_archive?.address || ''}`; + }, + }, + { + title: '文件盒编号', + dataIndex: ['contract_archive', 'box_number'], + search: false, + }, + { + title: '文件柜编号', + dataIndex: ['contract_archive', 'cabinet_number'], + search: false, + }, + MyColumns.CreatedAt(), + ]} + /> + ); } diff --git a/src/pages/contract/contract_archives/unfinished/index.tsx b/src/pages/contract/contract_archives/unfinished/index.tsx deleted file mode 100644 index bc0b0d6..0000000 --- a/src/pages/contract/contract_archives/unfinished/index.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - ContractsContractNatureEnum, - ContractsStatusEnum, - ContractTemplatesIncomeExpenseTypeEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; -import dayjs from 'dayjs'; -import Archive from './modals/Archive'; -import Orther from './modals/Orther'; - -export default function Index() { - const navigate = useNavigate(); - - return ( - { - return MyProTableProps.request( - { - ...params, - status: ContractsStatusEnum.Signed.value, - }, - sort, - Apis.Contract.Contracts.List, - ); - }} - headerTitle="未归档合同" - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ search: false }), - { - title: '合同类型', - dataIndex: 'contract_type_name', - search: false, - }, - { - title: '合同名称', - dataIndex: 'name', - }, - { - title: '合同编号', - dataIndex: 'code', - render: (_, item: any) => { - return ( - { - navigate(`/contract/contracts/show/${item.id}`); - }} - > - {item?.name} - - ); - }, - }, - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: ContractsStatusEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '收支类型', - dataIndex: 'income_expense_type', - valueEnum: ContractTemplatesIncomeExpenseTypeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '合同性质', - dataIndex: 'contract_nature', - valueEnum: ContractsContractNatureEnum, - search: false, - }), - { - title: '有效期', - search: false, - render: (_, item: any) => { - return `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( - item.end_time, - ).format('YYYY-MM-DD')}`; - }, - }, - { - title: '签订时间', - dataIndex: 'sign_time', - render: (_, item: any) => { - return item.sign_time - ? dayjs(item.sign_time).format('YYYY-MM-DD') - : '-'; - }, - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/contract/contract_bill_payments/index.tsx b/src/pages/contract/contract_bill_payments/index.tsx index e75b6df..bd2f3fb 100644 --- a/src/pages/contract/contract_bill_payments/index.tsx +++ b/src/pages/contract/contract_bill_payments/index.tsx @@ -3,6 +3,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { @@ -13,7 +14,6 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; export default function Index({ title = '登记审核' }) { const navigate = useNavigate(); @@ -110,21 +110,25 @@ export default function Index({ title = '登记审核' }) { }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index) => ( - - { - navigate( - `/contract/contract_bill_payments/pages/review?id=${item.id}`, - ); - }} - title="查看并审核" - /> - + render: (_, item: any) => ( + { + navigate( + `/contract/contract_bill_payments/pages/review?id=${item.id}`, + ); + }} + title="查看并审核" + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contract_bills/Expense/index.tsx b/src/pages/contract/contract_bills/Expense/index.tsx index bbe7ae4..b20aa55 100644 --- a/src/pages/contract/contract_bills/Expense/index.tsx +++ b/src/pages/contract/contract_bills/Expense/index.tsx @@ -2,7 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { MyExport } from '@/components/MyExport'; import { Apis } from '@/gen/Apis'; @@ -22,7 +23,6 @@ import CompleteApply from './modals/CompleteApply'; export default function Index() { const navigate = useNavigate(); const [getParams, setParams] = useState({}); - const getCurrentPermissions = useCurrentPermissions(); return ( [ - // { - // navigate('/contract/contract_bills/pages/create'); - // }} - // title="新增合同账单" - // />, - + ), }} - // download={Apis.Contract.ContractBills} />, ]} headerTitle="合同应付账单" @@ -139,42 +136,51 @@ export default function Index() { MyColumns.UpdatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - { - navigate( - `/contract/contract_bills/pages/update?id=${item.id}`, - ); - }} - title="编辑" - /> - - Apis.Contract.ContractBills.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - {/* {tableRender(item, action)} */} - + render: (_, item: any, _index, action) => ( + + ), + pay: ( + + ), + update: ( + { + navigate( + `/contract/contract_bills/pages/update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + delete: ( + + Apis.Contract.ContractBills.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contract_bills/Income/index.tsx b/src/pages/contract/contract_bills/Income/index.tsx index b97903b..94516ce 100644 --- a/src/pages/contract/contract_bills/Income/index.tsx +++ b/src/pages/contract/contract_bills/Income/index.tsx @@ -1,4 +1,10 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; import { MyExport } from '@/components/MyExport'; import { Apis } from '@/gen/Apis'; import { @@ -33,23 +39,20 @@ export default function Index() { ); }} toolBarRender={(action: any) => [ - // { - // navigate('/contract/contract_bills/pages/create'); - // }} - // title="新增合同账单" - // />, - + ), }} - // download={Apis.Contract.ContractBills} />, ]} headerTitle="合同应收账单" @@ -132,36 +135,44 @@ export default function Index() { MyColumns.UpdatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - { - navigate( - `/contract/contract_bills/pages/update?id=${item.id}`, - ); - }} - title="编辑" - /> - - Apis.Contract.ContractBills.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - + render: (_, item: any, _index, action) => ( + + ), + update: ( + { + navigate( + `/contract/contract_bills/pages/update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + delete: ( + + Apis.Contract.ContractBills.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contract_archive_use/borrows/index.tsx b/src/pages/contract/contract_borrows/index.tsx similarity index 71% rename from src/pages/contract/contract_archive_use/borrows/index.tsx rename to src/pages/contract/contract_borrows/index.tsx index dbcaeba..d6cd38a 100644 --- a/src/pages/contract/contract_archive_use/borrows/index.tsx +++ b/src/pages/contract/contract_borrows/index.tsx @@ -1,13 +1,19 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; import { Apis } from '@/gen/Apis'; import { ContractArchiveBorrowStatusEnum } from '@/gen/Enums'; import EmployeeShow from '@/pages/company/employees/modals/EmployeeShow'; -import CodeInfo from '@/pages/contract/contract_archives/finished/modals/Show'; +import CodeInfo from '@/pages/contract/contract_archives/modals/Show'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import Create from './modals/Create'; import Show from './modals/Show'; import Update from './modals/Update'; +import Read from './read/modals/Read'; export default function Index({ title = '合同借用' }) { return ( @@ -22,7 +28,13 @@ export default function Index({ title = '合同借用' }) { } headerTitle="合同借用列表" toolBarRender={(action) => [ - , + , + read: , + }} + />, ]} columns={[ MyColumns.ID({ @@ -117,23 +129,31 @@ export default function Index({ title = '合同借用' }) { MyColumns.UpdatedAt(), MyColumns.Option({ width: 100, - render: (_, item: any, index, action) => ( - - - - Apis.Contract.ContractArchiveBorrows.Borrow({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - + render: (_, item: any, _index, action) => ( + + ), + record: ( + + Apis.Contract.ContractArchiveBorrows.Borrow({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + update: ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contract_archive_use/borrows/modals/Create.tsx b/src/pages/contract/contract_borrows/modals/Create.tsx similarity index 100% rename from src/pages/contract/contract_archive_use/borrows/modals/Create.tsx rename to src/pages/contract/contract_borrows/modals/Create.tsx diff --git a/src/pages/contract/contract_archive_use/borrows/modals/Show.tsx b/src/pages/contract/contract_borrows/modals/Show.tsx similarity index 100% rename from src/pages/contract/contract_archive_use/borrows/modals/Show.tsx rename to src/pages/contract/contract_borrows/modals/Show.tsx diff --git a/src/pages/contract/contract_archive_use/borrows/modals/Update.tsx b/src/pages/contract/contract_borrows/modals/Update.tsx similarity index 100% rename from src/pages/contract/contract_archive_use/borrows/modals/Update.tsx rename to src/pages/contract/contract_borrows/modals/Update.tsx diff --git a/src/pages/contract/contract_archive_use/read/index.tsx b/src/pages/contract/contract_borrows/read/index.tsx similarity index 97% rename from src/pages/contract/contract_archive_use/read/index.tsx rename to src/pages/contract/contract_borrows/read/index.tsx index 3ea7ded..d8d47cb 100644 --- a/src/pages/contract/contract_archive_use/read/index.tsx +++ b/src/pages/contract/contract_borrows/read/index.tsx @@ -3,7 +3,7 @@ import { Apis } from '@/gen/Apis'; import EmployeeShow from '@/pages/company/employees/modals/EmployeeShow'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import CodeInfo from '../../contract_archives/finished/modals/Show'; +import CodeInfo from '../../contract_archives/modals/Show'; import Read from './modals/Read'; import Show from './modals/Show'; diff --git a/src/pages/contract/contract_archive_use/read/modals/Read.tsx b/src/pages/contract/contract_borrows/read/modals/Read.tsx similarity index 100% rename from src/pages/contract/contract_archive_use/read/modals/Read.tsx rename to src/pages/contract/contract_borrows/read/modals/Read.tsx diff --git a/src/pages/contract/contract_archive_use/read/modals/Show.tsx b/src/pages/contract/contract_borrows/read/modals/Show.tsx similarity index 100% rename from src/pages/contract/contract_archive_use/read/modals/Show.tsx rename to src/pages/contract/contract_borrows/read/modals/Show.tsx diff --git a/src/pages/contract/contract_seal_logs/index.tsx b/src/pages/contract/contract_seal_logs/index.tsx index bbcc345..3af4f81 100644 --- a/src/pages/contract/contract_seal_logs/index.tsx +++ b/src/pages/contract/contract_seal_logs/index.tsx @@ -1,48 +1,156 @@ -import { MyPageContainer } from '@/common'; -import { useSearchParams } from '@umijs/max'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import Seals from './seals'; -import UnusedSeal from './unused'; -import UsedSeal from './used'; +import { + MyColumns, + MyPageContainer, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + ContractsContractNatureEnum, + ContractsStatusEnum, + ContractTemplatesIncomeExpenseTypeEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Radio } from 'antd'; +import dayjs from 'dayjs'; +import { useState } from 'react'; +import Show from './modals/Show'; +import Update from './modals/Update'; +import UseSeal from './modals/UseSeal'; +import SealsManage from './seals/SealsManage'; export default function Index({ title = '合同用印' }) { - const [searchParams] = useSearchParams(); - const [activeKey, setActiveKey] = useState('1'); - - const items: TabsProps['items'] = [ - { - key: 'UnusedSeal', - label: '未用印合同', - children: , - }, - { - key: 'UsedSeal', - label: '已用印合同', - children: , - }, - { - key: 'Seals', - label: '印章管理', - children: , - }, - ]; - - useEffect(() => { - if (searchParams?.get('key')) { - setActiveKey(searchParams?.get('key') || '1'); - } - }, []); + const navigate = useNavigate(); + const [isUseSeal, setIsUseSeal] = useState(false); return ( - + { + return MyProTableProps.request( + { + ...params, + is_use_seal: isUseSeal, + ...(isUseSeal + ? {} + : { status: ContractsStatusEnum.Approved.value }), + }, + sort, + Apis.Contract.Contracts.List, + ); + }} + headerTitle={ + setIsUseSeal(e.target.value)} + optionType="button" + buttonStyle="solid" + > + 未用印 + 已用印 + + } + toolBarRender={() => [ + , + }} + />, + ]} + columns={[ + MyColumns.ID({ search: false }), + { + title: '合同类型', + dataIndex: 'contract_type_name', + search: false, + }, + { + title: '合同名称', + dataIndex: 'name', + }, + { + title: '合同编号', + dataIndex: 'code', + render: (_, item: any) => { + return ( + { + navigate(`/contract/contracts/show/${item.id}`); + }} + > + {item?.name} + + ); + }, + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: ContractsStatusEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '收支类型', + dataIndex: 'income_expense_type', + valueEnum: ContractTemplatesIncomeExpenseTypeEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '合同性质', + dataIndex: 'contract_nature', + valueEnum: ContractsContractNatureEnum, + search: false, + }), + { + title: '有效期', + search: false, + render: (_, item: any) => { + return `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( + item.end_time, + ).format('YYYY-MM-DD')}`; + }, + }, + { + title: '签订时间', + dataIndex: 'sign_time', + render: (_, item: any) => { + return item.sign_time + ? dayjs(item.sign_time).format('YYYY-MM-DD') + : '-'; + }, + search: false, + }, + MyColumns.Option({ + render: (_, item: any, __, action) => ( + + ) : undefined, + show: isUseSeal ? : undefined, + update: isUseSeal ? ( + + ) : undefined, + }} + /> + ), + }), + ]} + /> ); } diff --git a/src/pages/contract/contract_seal_logs/used/modals/Show.tsx b/src/pages/contract/contract_seal_logs/modals/Show.tsx similarity index 71% rename from src/pages/contract/contract_seal_logs/used/modals/Show.tsx rename to src/pages/contract/contract_seal_logs/modals/Show.tsx index 835d774..a7dbdae 100644 --- a/src/pages/contract/contract_seal_logs/used/modals/Show.tsx +++ b/src/pages/contract/contract_seal_logs/modals/Show.tsx @@ -11,10 +11,18 @@ export default function Show(props: MyBetaModalFormProps) { const [data, setData] = useState({}); const handleOpenModal = () => { - if (props?.item?.id) { + const contractsId = props?.item?.id; + if (contractsId) { setLoading(true); - Apis.Contract.ContractSealLogs.Show({ id: props.item.id }) - .then((res) => { + Apis.Contract.ContractSealLogs.List({ contracts_id: contractsId }) + .then((res: any) => { + const list = res?.data || []; + if (list.length > 0) { + return Apis.Contract.ContractSealLogs.Show({ id: list[0].id }); + } + return Promise.resolve({ data: {} }); + }) + .then((res: any) => { setData(res?.data || {}); }) .finally(() => { @@ -22,6 +30,7 @@ export default function Show(props: MyBetaModalFormProps) { }); } }; + return ( - {/* 基本信息 */} {data?.contracts_id} @@ -44,33 +52,13 @@ export default function Show(props: MyBetaModalFormProps) { {data?.use_seal_time} - {/* 用印详情 */} {data?.number_contract_copies} - {/* */} {data?.is_use_seal ? '是' : '否'} - {/* - - */} - {/* 印章信息 */} {data?.seal_ids?.map((sealId: string, index: number) => ( @@ -83,12 +71,10 @@ export default function Show(props: MyBetaModalFormProps) { )) || '-'} - {/* 其他信息 */} {data?.remarks || '-'} - {/* 时间信息 */} {data?.created_at} diff --git a/src/pages/contract/contract_seal_logs/used/modals/Update.tsx b/src/pages/contract/contract_seal_logs/modals/Update.tsx similarity index 82% rename from src/pages/contract/contract_seal_logs/used/modals/Update.tsx rename to src/pages/contract/contract_seal_logs/modals/Update.tsx index 7d8b6df..8d4745e 100644 --- a/src/pages/contract/contract_seal_logs/used/modals/Update.tsx +++ b/src/pages/contract/contract_seal_logs/modals/Update.tsx @@ -8,9 +8,32 @@ import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { BetaSchemaForm } from '@ant-design/pro-components'; import { Form, message } from 'antd'; +import { useState } from 'react'; export default function Update(props: MyBetaModalFormProps) { const [form] = Form.useForm(); + const [sealLogId, setSealLogId] = useState(0); + + const handleOpen = (open: boolean) => { + if (open && props.item?.id) { + Apis.Contract.ContractSealLogs.List({ + contracts_id: props.item.id, + }).then((res: any) => { + const list = res?.data || []; + if (list.length > 0) { + const log = list[0]; + setSealLogId(log.id); + form.resetFields(); + form.setFieldsValue({ + ...log, + seal_ids: log?.seal_info?.map((item: any) => ({ + seal_id: item?.id || item, + })), + }); + } + }); + } + }; return ( @@ -24,23 +47,14 @@ export default function Update(props: MyBetaModalFormProps) { width="600px" key={new Date().getTime()} form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue({ - ...props.item, - seal_ids: props.item?.seal_info?.map((item: any) => ({ - seal_id: item?.id || item, - })), - }); - } - }} + onOpenChange={handleOpen} onFinish={async (values: any) => Apis.Contract.ContractSealLogs.Update({ ...values, contracts_id: props?.item?.id, is_use_seal: values?.is_use_seal ? 1 : 0, is_external_seal_usage: values?.is_external_seal_usage ? 1 : 0, - id: props.item?.id ?? 0, + id: sealLogId, seal_ids: values?.seal_ids?.map((item: any) => item.seal_id), }) .then(() => { @@ -76,9 +90,8 @@ export default function Update(props: MyBetaModalFormProps) { width: '100%', }, disabledDate: (current: any) => { - // 只能选今天及以后的日期 const today = new Date(); - today.setHours(0, 0, 0, 0); // 设置为今天的00:00:00 + today.setHours(0, 0, 0, 0); return current && current > today; }, }, @@ -94,17 +107,6 @@ export default function Update(props: MyBetaModalFormProps) { unCheckedChildren: '未用印', }, }, - // { - // title: '是否外出用印', - // tooltip: '本次用印,是否在非公司办公范围内', - // key: 'is_external_seal_usage', - // valueType: 'switch', - // colProps: { span: 24 }, - // fieldProps: { - // checkedChildren: '是', - // unCheckedChildren: '否', - // }, - // }, { valueType: 'formList', dataIndex: 'seal_ids', @@ -112,7 +114,6 @@ export default function Update(props: MyBetaModalFormProps) { formItemProps: { ...rulesHelper.array }, fieldProps: { copyIconProps: false, - // deleteIconProps: false, }, columns: [ { diff --git a/src/pages/contract/contract_seal_logs/unused/modals/UseSeal.tsx b/src/pages/contract/contract_seal_logs/modals/UseSeal.tsx similarity index 71% rename from src/pages/contract/contract_seal_logs/unused/modals/UseSeal.tsx rename to src/pages/contract/contract_seal_logs/modals/UseSeal.tsx index 47ff543..839de90 100644 --- a/src/pages/contract/contract_seal_logs/unused/modals/UseSeal.tsx +++ b/src/pages/contract/contract_seal_logs/modals/UseSeal.tsx @@ -28,7 +28,7 @@ export default function UseSeal(props: MyBetaModalFormProps) { form={form} onOpenChange={(open: any) => { if (open) { - form.resetFields(); // 清空表单数据 + form.resetFields(); form.setFieldsValue({ seal_ids: props?.item?.seal_info || [], }); @@ -43,7 +43,6 @@ export default function UseSeal(props: MyBetaModalFormProps) { /> } onFinish={async (values: any) => { - console.log(values, 'values'); return Apis.Contract.ContractSealLogs.Store({ ...values, contracts_id: props?.item?.id, @@ -60,10 +59,8 @@ export default function UseSeal(props: MyBetaModalFormProps) { }} columns={[ { - // title: '登记信息', dataIndex: '合同信息', valueType: 'text', - renderFormItem: () => ( @@ -111,13 +108,10 @@ export default function UseSeal(props: MyBetaModalFormProps) { colProps: { span: 24 }, formItemProps: { ...rulesHelper.text }, fieldProps: { - style: { - width: '100%', - }, + style: { width: '100%' }, disabledDate: (current: any) => { - // 只能选今天及以后的日期 const today = new Date(); - today.setHours(0, 0, 0, 0); // 设置为今天的00:00:00 + today.setHours(0, 0, 0, 0); return current && current > today; }, }, @@ -133,44 +127,6 @@ export default function UseSeal(props: MyBetaModalFormProps) { unCheckedChildren: '未用印', }, }, - // { - // title: '是否外出用印', - // tooltip: '本次用印,是否在非公司办公范围内', - // key: 'is_external_seal_usage', - // valueType: 'switch', - // colProps: { span: 24 }, - // fieldProps: { - // checkedChildren: '是', - // unCheckedChildren: '否', - // }, - // }, - // { - // valueType: 'formList', - // dataIndex: 'seal_ids', - // title: '实际用章', - // formItemProps: { ...rulesHelper.array }, - // fieldProps: { - // copyIconProps: false, - // // deleteIconProps: false, - // }, - // columns: [ - // { - // valueType: 'group', - // colProps: { span: 24 }, - // columns: [ - // Selects?.CompanySeals({ - // title: '', - // key: 'seal_id', - // colProps: { span: 24 }, - // required: true, - // fieldProps: { - // placeholder: '请选择要使用的印章(可搜索)', - // }, - // }), - // ], - // }, - // ], - // }, { title: '备注', key: 'remarks', diff --git a/src/pages/contract/contract_seal_logs/seals/SealsManage.tsx b/src/pages/contract/contract_seal_logs/seals/SealsManage.tsx new file mode 100644 index 0000000..719e91d --- /dev/null +++ b/src/pages/contract/contract_seal_logs/seals/SealsManage.tsx @@ -0,0 +1,16 @@ +import { MyButtons } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import Seals from '.'; + +export default function SealsManage() { + return ( + + } + modal={{ title: '印章管理' }} + width="900px" + node={} + /> + ); +} diff --git a/src/pages/contract/contract_seal_logs/unused/index.tsx b/src/pages/contract/contract_seal_logs/unused/index.tsx deleted file mode 100644 index b7515cc..0000000 --- a/src/pages/contract/contract_seal_logs/unused/index.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - ContractsContractNatureEnum, - ContractsStatusEnum, - ContractTemplatesIncomeExpenseTypeEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; -import dayjs from 'dayjs'; -import UseSeal from './modals/UseSeal'; - -export default function Index() { - const navigate = useNavigate(); - - return ( - { - return MyProTableProps.request( - { - ...params, - status: ContractsStatusEnum.Approved.value, - is_use_seal: false, - }, - sort, - Apis.Contract.Contracts.List, - ); - }} - headerTitle="未用印合同" - columns={[ - MyColumns.ID({ search: false }), - { - title: '合同类型', - dataIndex: 'contract_type_name', - search: false, - }, - { - title: '合同名称', - dataIndex: 'name', - }, - { - title: '合同编号', - dataIndex: 'code', - render: (_, item: any) => { - return ( - { - navigate(`/contract/contracts/show/${item.id}`); - }} - > - {item?.name} - - ); - }, - }, - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: ContractsStatusEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '收支类型', - dataIndex: 'income_expense_type', - valueEnum: ContractTemplatesIncomeExpenseTypeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '合同性质', - dataIndex: 'contract_nature', - valueEnum: ContractsContractNatureEnum, - search: false, - }), - { - title: '有效期', - search: false, - render: (_, item: any) => { - return `${dayjs(item.start_time).format('YYYY-MM-DD')}至${dayjs( - item.end_time, - ).format('YYYY-MM-DD')}`; - }, - }, - { - title: '签订时间', - dataIndex: 'sign_time', - render: (_, item: any) => { - return item.sign_time - ? dayjs(item.sign_time).format('YYYY-MM-DD') - : '-'; - }, - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/contract/contract_seal_logs/used/index.tsx b/src/pages/contract/contract_seal_logs/used/index.tsx deleted file mode 100644 index df72f75..0000000 --- a/src/pages/contract/contract_seal_logs/used/index.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate, useParams } from '@umijs/max'; -import { Space } from 'antd'; -import Show from './modals/Show'; -import Update from './modals/Update'; - -export default function Index({ title = '合同用章' }) { - const navigate = useNavigate(); - - const { id } = useParams<{ id: string }>(); - return ( - > - {...MyProTableProps.props} - request={async (params, sort) => - MyProTableProps.request( - params, - sort, - Apis.Contract.ContractSealLogs.List, - ) - } - headerTitle="已用印合同" - params={{ contracts_id: id }} - // toolBarRender={(action) => [ - // , - // ]} - columns={[ - // MyColumns.ID({ - // search: false, - // }), - - { - title: '合同名称', - dataIndex: ['contract', 'name'], - }, - { - title: '合同编号', - dataIndex: ['contract', 'code'], - render: (_, item: any) => { - return ( - { - navigate(`/contract/contracts/show/${item.contracts_id}`); - }} - > - {item?.contract?.code} - - ); - }, - }, - { - title: '合同编号', - dataIndex: 'code', - hidden: true, - }, - // { - // title: '合同ID', - // dataIndex: 'contracts_id', - // }, - { - title: '印章', - search: false, - render: (_, item: any) => ( - - {item?.seal_info?.map((res: any) => { - return res?.company_name; - })} - - ), - }, - { - title: '申请用印人', - dataIndex: ['company_employee', 'name'], - search: false, - }, - - { - title: '用印合同', - dataIndex: 'number_contract_copies', - search: false, - }, - // MyColumns.Boolean({ - // dataIndex: 'is_external_seal_usage', - // title: '是否外出用印', - // search: false, - // }), - { - title: '操作印章人', - dataIndex: ['operator_employee', 'name'], - search: false, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/contract/contract_templates/index.tsx b/src/pages/contract/contract_templates/index.tsx index 1b75d0a..495ae6f 100644 --- a/src/pages/contract/contract_templates/index.tsx +++ b/src/pages/contract/contract_templates/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { SelectContract } from '@/components/SelectContract'; import { Apis } from '@/gen/Apis'; @@ -35,7 +37,14 @@ export default function Index({ title = '合同模版' }) { } headerTitle="合同模版列表" toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -94,35 +103,50 @@ export default function Index({ title = '合同模版' }) { {item.is_enabled === 1 && ( )} - - - Apis.Contract.ContractTemplates.Update({ - id: item.id ?? 0, - is_enabled: item.is_enabled === 1 ? 0 : 1, - name: item.name, - code: item.code, - source: item.source, - income_expense_type: item.income_expense_type, - contract_types_id: item.contract_types_id, - }).then(() => action?.reload()) - } - /> - - Apis.Contract.ContractTemplates.Delete({ - id: item.id, - }).then(() => action?.reload()) - } + + ), + enabled: ( + + Apis.Contract.ContractTemplates.Update({ + id: item.id ?? 0, + is_enabled: item.is_enabled === 1 ? 0 : 1, + name: item.name, + code: item.code, + source: item.source, + income_expense_type: item.income_expense_type, + contract_types_id: item.contract_types_id, + }).then(() => action?.reload()) + } + /> + ), + delete: ( + + Apis.Contract.ContractTemplates.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + maxVisible={3} /> ), diff --git a/src/pages/contract/contract_types/index.tsx b/src/pages/contract/contract_types/index.tsx index 282d543..631a885 100644 --- a/src/pages/contract/contract_types/index.tsx +++ b/src/pages/contract/contract_types/index.tsx @@ -3,10 +3,11 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; @@ -28,7 +29,12 @@ export default function Index({ title = '合同类型' }) { ) } toolBarRender={(action) => [ - , + , + }} + />, ]} search={false} columns={[ @@ -46,17 +52,23 @@ export default function Index({ title = '合同类型' }) { }), MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Contract.ContractTypes.Delete({ id: item.id }).then( - () => action?.reload(), - ) - } - /> - + render: (_, item: any, _index, action) => ( + + ), + delete: ( + + Apis.Contract.ContractTypes.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contracts/index.tsx b/src/pages/contract/contracts/index.tsx index a458764..344d786 100644 --- a/src/pages/contract/contracts/index.tsx +++ b/src/pages/contract/contracts/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -13,11 +15,10 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate, useSearchParams } from '@umijs/max'; -import { Dropdown, Space } from 'antd'; import dayjs from 'dayjs'; -import Archives from '../contract_archives/unfinished/modals/Archive'; -import UseSeal from '../contract_seal_logs/unused/modals/UseSeal'; +import Archives from '../contract_archives/modals/Archive'; +import UseSeal from '../contract_seal_logs/modals/UseSeal'; import Change from './modals/Change'; import Terminated from './modals/Terminated'; import Voided from './modals/Voided'; @@ -26,118 +27,6 @@ export default function Index({ title = '合同拟制' }) { const navigate = useNavigate(); const [searchParams, setSearchParams]: any = useSearchParams(); - let tableRender = (item: any, action: any) => { - console.log(item, 'item'); - let permissions = [ - { - if (item.parent_id) { - navigate( - `/contract/contracts/pages/contract_add_update?id=${item.id}`, - ); - } else { - navigate(`/contract/contracts/pages/contract_update?id=${item.id}`); - } - }} - title="编辑" - />, - ]; - - let permissionsSpace: any = [ - , - { - navigate(`/contract/contracts/show/${item.id}?key=4`); - }} - />, - , - , - { - navigate(`/contract/contracts/pages/contract_add?id=${item.id}`); - }} - title="补充" - />, - , - , - , - { - Apis.Contract.Contracts.ContractCopy({ - id: item?.id ?? 0, - }).then((res) => { - navigate( - `/contract/contracts/pages/contract_update?id=${res?.data?.id}`, - ); - }); - console.log(item); - }} - />, - - Apis.Contract.Contracts.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - />, - ]; - - let Others = ( - - - - ); - return [...permissions, ...[Others]]; - }; - return ( [ - { - navigate('/contract/contracts/pages/contract_create'); + { + navigate('/contract/contracts/pages/contract_create'); + }} + title="新增合同" + /> + ), }} - title="新增合同" />, ]} columns={[ @@ -179,22 +75,6 @@ export default function Index({ title = '合同拟制' }) { key: 'asset_projects_id', hidden: true, }), - // Selects?.OrganizationSearch({ - // title: '签订部门', - // key: 'organizations_id', - // colProps: { span: 24 }, - // fieldProps: { - // showSearch: true, - // }, - // search: { - // transform: (value) => { - // return { - // organization_name: - // value.length > 0 ? value[value.length - 1] : '', - // }; - // }, - // }, - // }), MyColumns.EnumTag({ title: '合同状态', dataIndex: 'status', @@ -210,17 +90,6 @@ export default function Index({ title = '合同拟制' }) { { title: '合同名称', dataIndex: 'name', - // render: (_, item: any) => { - // return ( - // { - // navigate(`/contract/contracts/show/${item.id}`); - // }} - // > - // {item?.name} - // - // ); - // }, }, { title: '合同类型', @@ -300,11 +169,6 @@ export default function Index({ title = '合同拟制' }) { // }, search: false, }, - // { - // title: '签订部门', - // dataIndex: 'sign_department', - // search: false, - // }, { title: '合同对接人', @@ -333,18 +197,148 @@ export default function Index({ title = '合同拟制' }) { }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate(`/contract/contracts/show/${item.id}`); - }} - /> - <>{tableRender(item, action)} - + render: (_, item: any, __, action) => ( + { + navigate(`/contract/contracts/show/${item.id}`); + }} + /> + ), + Update: ( + { + if (item.parent_id) { + navigate( + `/contract/contracts/pages/contract_add_update?id=${item.id}`, + ); + } else { + navigate( + `/contract/contracts/pages/contract_update?id=${item.id}`, + ); + } + }} + title="编辑" + /> + ), + UseSeal: ( + + ), + Bill: ( + { + navigate(`/contract/contracts/show/${item.id}?key=4`); + }} + /> + ), + Archives: ( + + ), + Change: ( + + ), + Supplement: ( + { + navigate( + `/contract/contracts/pages/contract_add?id=${item.id}`, + ); + }} + title="补充" + /> + ), + Terminated: ( + + ), + Voided: ( + + ), + Copy: ( + { + Apis.Contract.Contracts.ContractCopy({ + id: item?.id ?? 0, + }).then((res) => { + navigate( + `/contract/contracts/pages/contract_update?id=${res?.data?.id}`, + ); + }); + }} + /> + ), + Delete: ( + + Apis.Contract.Contracts.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contracts/show/components/ArchivingLogs.tsx b/src/pages/contract/contracts/show/components/ArchivingLogs.tsx index 1b727a4..56840ca 100644 --- a/src/pages/contract/contracts/show/components/ArchivingLogs.tsx +++ b/src/pages/contract/contracts/show/components/ArchivingLogs.tsx @@ -8,7 +8,7 @@ import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; -import Show from '../../../contract_archives/finished/modals/Show'; +import Show from '../../../contract_archives/modals/Show'; export default function Index(props: MyBetaModalFormProps) { const navigate = useNavigate(); diff --git a/src/pages/contract/contracts_add/index.tsx b/src/pages/contract/contracts_add/index.tsx index 77d7ce8..ff19b89 100644 --- a/src/pages/contract/contracts_add/index.tsx +++ b/src/pages/contract/contracts_add/index.tsx @@ -3,6 +3,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -13,11 +14,10 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate, useSearchParams } from '@umijs/max'; -import { Dropdown, Space } from 'antd'; import dayjs from 'dayjs'; -import Archives from '../contract_archives/unfinished/modals/Archive'; -import UseSeal from '../contract_seal_logs/unused/modals/UseSeal'; +import Archives from '../contract_archives/modals/Archive'; +import UseSeal from '../contract_seal_logs/modals/UseSeal'; import Terminated from './modals/Terminated'; import Voided from './modals/Voided'; @@ -25,69 +25,6 @@ export default function Index({ title = '补充协议' }) { const navigate = useNavigate(); const [searchParams, setSearchParams]: any = useSearchParams(); - let tableRender = (item: any, action: any) => { - console.log(item, 'item'); - let permissions = [ - { - navigate( - `/contract/contracts/pages/contract_add_update?id=${item.id}`, - ); - }} - title="编辑" - />, - ]; - - let permissionsSpace: any = [ - , - , - , - , - - Apis.Contract.Contracts.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - />, - ]; - - let Others = ( - - - - ); - return [...permissions, ...[Others]]; - }; - return ( ( - - { - navigate(`/contract/contracts/show/${item.parent_id}`); - }} - /> - <>{tableRender(item, action)} - + render: (_, item: any, __, action) => ( + { + navigate(`/contract/contracts/show/${item.parent_id}`); + }} + /> + ), + update: ( + { + navigate( + `/contract/contracts/pages/contract_add_update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + useSeal: ( + + ), + archives: ( + + ), + Terminated: ( + + ), + voided: ( + + ), + delete: ( + + Apis.Contract.Contracts.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/contract/contracts_add/show/components/ArchivingLogs.tsx b/src/pages/contract/contracts_add/show/components/ArchivingLogs.tsx index 2f2af75..56a8da4 100644 --- a/src/pages/contract/contracts_add/show/components/ArchivingLogs.tsx +++ b/src/pages/contract/contracts_add/show/components/ArchivingLogs.tsx @@ -13,9 +13,9 @@ import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; -import Archives from '@/pages/contract/contract_archives/unfinished/modals/Archive'; -import Show from '../../../contract_archives/finished/modals/Show'; -import Update from '../../../contract_archives/finished/modals/Update'; +import Archives from '@/pages/contract/contract_archives/modals/Archive'; +import Show from '../../../contract_archives/modals/Show'; +import Update from '../../../contract_archives/modals/Update'; export default function Index(props: MyBetaModalFormProps) { const navigate = useNavigate(); diff --git a/src/pages/contract/contracts_add/show/components/UsedLogs.tsx b/src/pages/contract/contracts_add/show/components/UsedLogs.tsx index 0c7dd42..0b9ee06 100644 --- a/src/pages/contract/contracts_add/show/components/UsedLogs.tsx +++ b/src/pages/contract/contracts_add/show/components/UsedLogs.tsx @@ -1,6 +1,6 @@ import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; -import UseSeal from '@/pages/contract/contract_seal_logs/unused/modals/UseSeal'; +import UseSeal from '@/pages/contract/contract_seal_logs/modals/UseSeal'; import { ProTable } from '@ant-design/pro-components'; import { useParams } from '@umijs/max'; import { Space } from 'antd'; diff --git a/src/pages/contract/contracts_other/index.tsx b/src/pages/contract/contracts_other/index.tsx index 7b7cc54..0b8307e 100644 --- a/src/pages/contract/contracts_other/index.tsx +++ b/src/pages/contract/contracts_other/index.tsx @@ -3,13 +3,14 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { ApprovalInstancesStatusEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useSearchParams } from '@umijs/max'; -import { Space } from 'antd'; import Create from './modals/Create'; import Show from './modals/Show'; import Update from './modals/Update'; @@ -40,7 +41,14 @@ export default function Index({ title = '其他用印' }) { }} headerTitle="其他用印列表" toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -93,23 +101,35 @@ export default function Index({ title = '其他用印' }) { }, MyColumns.UpdatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - Apis.Contract.ContractOthers.Seal({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + render: (_, item: any, __, action) => ( + , + update: ( + + ), + useSeal: ( + + Apis.Contract.ContractOthers.Seal({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/customer/archive/index.tsx b/src/pages/customer/archive/index.tsx index a446bb2..e2fca2a 100644 --- a/src/pages/customer/archive/index.tsx +++ b/src/pages/customer/archive/index.tsx @@ -4,6 +4,8 @@ import { MyImportModal, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -13,7 +15,7 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space, Tag } from 'antd'; +import { Tag } from 'antd'; import Delivery from './modals/Delivery'; export default function Index({ title = '房屋档案' }) { @@ -33,14 +35,21 @@ export default function Index({ title = '房屋档案' }) { MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List) } toolBarRender={(action) => [ - + ), + }} />, ]} columns={[ @@ -134,29 +143,26 @@ export default function Index({ title = '房屋档案' }) { search: false, }, MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate(`/customer/archive/show/${item.id}`); - }} - /> - - {/* {!item?.house_occupants?.length ? ( - - ) : ( - '' - )} */} - + render: (_, item: any, __, action) => ( + { + navigate(`/customer/archive/show/${item.id}`); + }} + /> + ), + create: ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/customer/archive/table_prepay/DeductionRecords.tsx b/src/pages/customer/archive/table_prepay/DeductionRecords.tsx deleted file mode 100644 index 5ba058a..0000000 --- a/src/pages/customer/archive/table_prepay/DeductionRecords.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useEffect, useRef } from 'react'; - -export default function Index({ ...rest }) { - const actionLooks = useRef(); - useEffect(() => { - actionLooks?.current.reloadAndRest(); - }, [rest.loadmore]); - - return ( - <> - > - {...MyProTableProps.props} - actionRef={actionLooks} - request={async (params, sort) => - MyProTableProps.request( - { - ...params, - asset_houses_id: rest.item?.asset_houses_id, - }, - sort, - Apis.HouseOrder.HousePrepaymentLogs.List, - ) - } - search={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '客户信息', - render(_, record) { - return ( - record?.customer_info?.map((res: any) => res?.name).join(';') || - '-' - ); // 无数据时显示 - - }, - search: false, - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: HouseRegistersTypeEnum, - }), - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: HouseRegistersStatusEnum, - }), - { - title: '登记时间', - dataIndex: 'created_at', - valueType: 'dateTime', - search: false, - }, - { - title: '更新时间', - dataIndex: 'updated_at', - valueType: 'dateTime', - search: false, - }, - ]} - /> - - ); -} diff --git a/src/pages/customer/archive/table_prepay/PrePayRecords.tsx b/src/pages/customer/archive/table_prepay/PrePayRecords.tsx deleted file mode 100644 index b7817d9..0000000 --- a/src/pages/customer/archive/table_prepay/PrePayRecords.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useEffect, useRef } from 'react'; - -export default function Index({ ...rest }) { - const actionLooks = useRef(); - useEffect(() => { - actionLooks?.current.reloadAndRest(); - }, [rest.loadmore]); - - return ( - <> - > - {...MyProTableProps.props} - actionRef={actionLooks} - request={async (params, sort) => - MyProTableProps.request( - { - ...params, - asset_houses_id: rest.item?.asset_houses_id, - }, - sort, - Apis.HouseOrder.HousePrepaymentPayments.List, - ) - } - search={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '客户信息', - render(_, record) { - return ( - record?.customer_info?.map((res: any) => res?.name).join(';') || - '-' - ); // 无数据时显示 - - }, - search: false, - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: HouseRegistersTypeEnum, - }), - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: HouseRegistersStatusEnum, - }), - { - title: '登记时间', - dataIndex: 'created_at', - valueType: 'dateTime', - search: false, - }, - { - title: '更新时间', - dataIndex: 'updated_at', - valueType: 'dateTime', - search: false, - }, - ]} - /> - - ); -} diff --git a/src/pages/customer/house_registers_audit/index.tsx b/src/pages/customer/house_registers_audit/index.tsx index f6dcdc0..5168294 100644 --- a/src/pages/customer/house_registers_audit/index.tsx +++ b/src/pages/customer/house_registers_audit/index.tsx @@ -1,8 +1,12 @@ -import { MyColumns, MyPageContainer, MyProTableProps } from '@/common'; +import { + MyColumns, + MyPageContainer, + MyProTableProps, + MyTableActions, +} from '@/common'; import { Apis } from '@/gen/Apis'; import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import { useNavigate } from 'umi'; import Audit from './modals/Audit'; import Show from './modals/Show'; @@ -87,11 +91,15 @@ export default function Index({ title = '登记审核' }) { MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - , - + render: (_, item: any, __, action) => ( + + ), + view: , + }} + /> ), }), ]} diff --git a/src/pages/customer/houses/index.tsx b/src/pages/customer/houses/index.tsx deleted file mode 100644 index 22e33b1..0000000 --- a/src/pages/customer/houses/index.tsx +++ /dev/null @@ -1,169 +0,0 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, -} from '@/common'; -import { MyExport } from '@/components/MyExport'; -import { Apis } from '@/gen/Apis'; -import { - AssetHousesOwnershipTypeEnum, - AssetHousesUsageEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import { useState } from 'react'; - -export default function Index({ title = '房屋列表' }) { - const [getParams, setParams] = useState({}); - - return ( - - { - setParams(params); - return MyProTableProps.request( - params, - sort, - Apis.Asset.AssetHouses.List, - ); - }} - toolBarRender={() => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '项目名称', - dataIndex: ['asset_project', 'name'], - search: { - transform: (value) => { - return { project_name: value }; - }, - }, - }, - { - title: '房屋名称', - dataIndex: 'full_name', - }, - { - title: '楼栋名称', - dataIndex: 'building_name', - hidden: true, - }, - { - title: '单元名称', - dataIndex: 'unit_name', - hidden: true, - }, - MyColumns.EnumTag({ - title: '用途', - dataIndex: 'usage', - valueEnum: AssetHousesUsageEnum, - }), - { - title: '楼层', - dataIndex: 'floor', - render(_, record) { - return `${record?.floor}层`; - }, - search: false, - }, - - { - title: '建筑面积', - dataIndex: 'built_area', - render(_, record) { - return `${ - record?.built_area ? record?.built_area + ' m²' : '-' - } `; - }, - search: false, - }, - { - title: '套内面积', - dataIndex: 'inside_area', - render(_, record) { - return `${ - record?.inside_area ? record?.inside_area + ' m²' : '-' - } `; - }, - search: false, - }, - { - title: '计费面积', - dataIndex: 'chargeable_area', - render(_, record) { - return `${ - record?.chargeable_area ? record?.chargeable_area + ' m²' : '-' - } `; - }, - search: false, - }, - { - title: '户型', - render(_, record) { - return `${record?.room || 'x'}室${record?.hall || 'x'}厅${ - record?.bathroom || 'x' - }卫${record?.kitchen || 'x'}厨${record?.balcony || 'x'}阳台`; - }, - search: false, - }, - // MyColumns.EnumTag({ - // title: '朝向', - // dataIndex: 'orientation', - // valueEnum: AssetHousesOrientationEnum, - // search: false, - // }), - // MyColumns.EnumTag({ - // title: '房屋状态', - // dataIndex: 'status', - // valueEnum: AssetHousesStatusEnum, - // search: false, - // }), - MyColumns.EnumTag({ - title: '房屋属性', - dataIndex: 'ownership_type', - valueEnum: AssetHousesOwnershipTypeEnum, - search: false, - }), - - // { - // title: '产权年限', - // dataIndex: 'ownership_term', - // render(_, record) { - // return `${record?.ownership_term || '-'} 年`; - // }, - // search: false, - // }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - Apis.Asset.AssetHouses.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/customer/list/index.tsx b/src/pages/customer/list/index.tsx index 693bc5b..fb62207 100644 --- a/src/pages/customer/list/index.tsx +++ b/src/pages/customer/list/index.tsx @@ -1,8 +1,11 @@ import { MyButtons, MyColumns, + MyImportModal, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -13,7 +16,6 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; export default function Index({ title = '客户列表' }) { const navigate = useNavigate(); @@ -41,17 +43,24 @@ export default function Index({ title = '客户列表' }) { Apis.Archive.HouseOccupants.List, ) } - // toolBarRender={(action) => [ - // , - // ]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), Selects?.AssetProjects({ @@ -106,15 +115,21 @@ export default function Index({ title = '客户列表' }) { search: false, }), MyColumns.Option({ - render: (_, item: any, index) => ( - - { - navigate(`/customer/archive/show/${item.asset_houses_id}`); - }} - /> - + render: (_, item: any) => ( + { + navigate( + `/customer/archive/show/${item.asset_houses_id}`, + ); + }} + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/customer/register_list/index.tsx b/src/pages/customer/register_list/index.tsx deleted file mode 100644 index 89a320c..0000000 --- a/src/pages/customer/register_list/index.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { MyColumns, MyPageContainer, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; -import RegistersShow from '../archive/table/modals/RegistersShow'; - -export default function Index({ title = '客户列表' }) { - const navigate = useNavigate(); - - return ( - - - MyProTableProps.request( - params, - sort, - Apis.Archive.HouseRegisters.List, - ) - } - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '房屋信息', - dataIndex: ['asset_house', 'full_name'], - render: (text, record) => ( - - navigate(`/customer/archive/show/${record.model_id}`) - } - > - {text} - - ), - }, - - { - title: '客户信息', - render(_, record) { - return ( - record?.customer_info?.map((res: any) => res?.name).join(';') || - '-' - ); // 无数据时显示 - - }, - search: false, - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: HouseRegistersTypeEnum, - }), - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: HouseRegistersStatusEnum, - }), - { - title: '更新时间', - dataIndex: 'updated_at', - valueType: 'dateTime', - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/customer/registers/index.tsx b/src/pages/customer/registers/index.tsx index 8ce23b6..78e66ef 100644 --- a/src/pages/customer/registers/index.tsx +++ b/src/pages/customer/registers/index.tsx @@ -3,12 +3,12 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; import RegistersShow from '../archive/table/modals/RegistersShow'; export default function Index({ title = '变更记录' }) { @@ -106,14 +106,18 @@ export default function Index({ title = '变更记录' }) { search: false, }, MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - + render: (_, item: any, __, action) => ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/goods_releases/list/index.tsx b/src/pages/goods_releases/index.tsx similarity index 82% rename from src/pages/goods_releases/list/index.tsx rename to src/pages/goods_releases/index.tsx index e63d5f2..4a36f21 100644 --- a/src/pages/goods_releases/list/index.tsx +++ b/src/pages/goods_releases/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { @@ -11,7 +13,7 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space, Tooltip } from 'antd'; +import { Tooltip } from 'antd'; import Audit from './modals/Audit'; import Show from './modals/Show'; @@ -35,14 +37,21 @@ export default function Index({ title = '物品放行' }) { } headerTitle={`${title}列表`} toolBarRender={() => [ - { - navigate('/goods_releases/list/pages/create'); + { + navigate('/goods_releases/list/pages/create'); + }} + title="物品放行申请" + /> + ), }} - title="物品放行申请" />, ]} columns={[ @@ -163,14 +172,23 @@ export default function Index({ title = '物品放行' }) { // MyColumns.CreatedAt(), MyColumns.UpdatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - {item?.status === - GoodsReleasesAuditStatusEnum.Pending.value && ( - - )} - - + render: (_, item: any, __, action) => ( + + ) : null, + view: ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/goods_releases/list/modals/Audit.tsx b/src/pages/goods_releases/modals/Audit.tsx similarity index 100% rename from src/pages/goods_releases/list/modals/Audit.tsx rename to src/pages/goods_releases/modals/Audit.tsx diff --git a/src/pages/goods_releases/list/modals/Show.tsx b/src/pages/goods_releases/modals/Show.tsx similarity index 100% rename from src/pages/goods_releases/list/modals/Show.tsx rename to src/pages/goods_releases/modals/Show.tsx diff --git a/src/pages/goods_releases/list/pages/create.tsx b/src/pages/goods_releases/pages/create.tsx similarity index 100% rename from src/pages/goods_releases/list/pages/create.tsx rename to src/pages/goods_releases/pages/create.tsx diff --git a/src/pages/house_charage/house_door_cards/index.tsx b/src/pages/house_charage/house_door_cards/index.tsx index bea4980..d1d8cdd 100644 --- a/src/pages/house_charage/house_door_cards/index.tsx +++ b/src/pages/house_charage/house_door_cards/index.tsx @@ -3,43 +3,15 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; export default function Index({ title = '门禁卡' }) { - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - add: , - }); - }; - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - update: ( - - ), - delete: ( - - Apis.HouseCharge.HouseDoorCards.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - }; return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + , + }} + />, + ]} columns={[ MyColumns.ID({ search: false, @@ -96,8 +75,29 @@ export default function Index({ title = '门禁卡' }) { }), MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - {tableRender(item, action)} + render: (_, item: any, __, action) => ( + + ), + delete: ( + + Apis.HouseCharge.HouseDoorCards.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 68a08ad..4cc314c 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -5,7 +5,7 @@ export default function Login() {
- 邻壹科技有限公司 | + 邻壹科技 | ), - exportmeter: ( + importmeter: ( ), - exporthouse: ( + importhouse: ( , - }, - { - key: '2', - label: '路线配置', - children: , - }, - { - key: '3', - label: '点位配置', - children: , - }, - { - key: '4', - label: '巡更工单', - children: , - }, - ]; - - useEffect(() => { - if (searchParams?.get('key')) { - setActiveKey(searchParams?.get('key') || '1'); - } - }, []); +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { PatrolTasksCreateTypeEnum, PatrolTasksStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import Create from './modals/Create'; +import LocationsManage from './modals/LocationsManage'; +import PatrolOrderAssign from './modals/PatrolOrderAssign'; +import PatrolOrderShow from './modals/PatrolOrderShow'; +import RoutesManage from './modals/RoutesManage'; +export default function Index({ title = '巡更任务' }) { return ( - - + + + MyProTableProps.request(params, sort, Apis.Patrol.PatrolTasks.List) + } + toolBarRender={(action) => [ + , + routes: , + create: ( + + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + Selects?.AssetProjects({ + title: '选择项目', + key: 'asset_projects_id', + hidden: true, + }), + { + title: '关联项目', + dataIndex: ['asset_project', 'name'], + search: { + transform: (value) => { + return { project_name: value }; + }, + }, + }, + { + title: '路线名称', + dataIndex: ['patrol_route', 'name'], + search: { + transform: (value) => { + return { patrol_route_name: value }; + }, + }, + }, + + { + title: '任务时段', + dataIndex: 'start_time', + valueType: 'dateTime', + render: (_, item: any) => { + const formatStartTime = (timeStr: string) => { + if (!timeStr) return ''; + const [date, time] = timeStr.split(' '); + if (!time) return date; + return `${date} ${time.split(':').slice(0, 2).join(':')}`; + }; + + const formatEndTime = (timeStr: string) => { + if (!timeStr) return ''; + const [, time] = timeStr.split(' '); + if (!time) return ''; + return time.split(':').slice(0, 2).join(':'); + }; + + return `${formatStartTime(item.start_time)} - ${formatEndTime( + item.end_time, + )}`; + }, + search: false, + }, + { + title: '任务时段', + dataIndex: 'date_time', + valueType: 'dateRange', + hideInTable: true, + }, + MyColumns.EnumTag({ + title: '生成方式', + dataIndex: 'create_type', + valueEnum: PatrolTasksCreateTypeEnum, + }), + MyColumns.EnumTag({ + title: '任务状态', + dataIndex: 'status', + valueEnum: PatrolTasksStatusEnum, + search: false, + }), + { + title: '指派时间', + dataIndex: 'assign_time', + search: false, + }, + { + title: '关联工单', + dataIndex: 'house_work_orders_id', + search: false, + }, + { + title: '完成时间', + dataIndex: 'complete_time', + search: false, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, __, action) => ( + + ) : null, + assign: + item?.status === 'Unassigned' ? ( + + ) : null, + delete: ( + + Apis.Patrol.PatrolTasks.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + }} + /> + ), + }), + ]} + /> ); } diff --git a/src/pages/patrol/patrol_tasks/modals/Create.tsx b/src/pages/patrol/modals/Create.tsx similarity index 100% rename from src/pages/patrol/patrol_tasks/modals/Create.tsx rename to src/pages/patrol/modals/Create.tsx diff --git a/src/pages/patrol/modals/LocationsManage.tsx b/src/pages/patrol/modals/LocationsManage.tsx new file mode 100644 index 0000000..f742c78 --- /dev/null +++ b/src/pages/patrol/modals/LocationsManage.tsx @@ -0,0 +1,19 @@ +import { MyBetaModalFormProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import MyPatrolLocations from '../patrol_locations'; + +export default function LocationsManage(props: MyBetaModalFormProps) { + return ( + } + size="middle" + /> + ); +} diff --git a/src/pages/patrol/patrol_tasks/modals/PatrolOrderAssign.tsx b/src/pages/patrol/modals/PatrolOrderAssign.tsx similarity index 100% rename from src/pages/patrol/patrol_tasks/modals/PatrolOrderAssign.tsx rename to src/pages/patrol/modals/PatrolOrderAssign.tsx diff --git a/src/pages/patrol/patrol_tasks/modals/PatrolOrderShow.tsx b/src/pages/patrol/modals/PatrolOrderShow.tsx similarity index 100% rename from src/pages/patrol/patrol_tasks/modals/PatrolOrderShow.tsx rename to src/pages/patrol/modals/PatrolOrderShow.tsx diff --git a/src/pages/patrol/modals/RoutesManage.tsx b/src/pages/patrol/modals/RoutesManage.tsx new file mode 100644 index 0000000..4694dea --- /dev/null +++ b/src/pages/patrol/modals/RoutesManage.tsx @@ -0,0 +1,19 @@ +import { MyBetaModalFormProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import MyPatrolRoutes from '../patrol_routes'; + +export default function RoutesManage(props: MyBetaModalFormProps) { + return ( + } + size="middle" + /> + ); +} diff --git a/src/pages/patrol/patrol_locations/index.tsx b/src/pages/patrol/patrol_locations/index.tsx index aced01c..8a99caa 100644 --- a/src/pages/patrol/patrol_locations/index.tsx +++ b/src/pages/patrol/patrol_locations/index.tsx @@ -1,8 +1,14 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; -import { message, Progress, Space } from 'antd'; +import { message, Progress } from 'antd'; import { saveAs } from 'file-saver'; import JSZip from 'jszip'; import { useState } from 'react'; @@ -162,14 +168,21 @@ export default function Index({ title = '点位配置' }) { onClick={() => download(1)} />, download(2)} />, - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ @@ -204,38 +217,45 @@ export default function Index({ title = '点位配置' }) { }), MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Patrol.PatrolLocations.Update({ - id: item.id ?? 0, - is_enabled: item.is_enabled === 1 ? 0 : 1, - name: item.name, - code: item.code, - asset_projects_id: item.asset_projects_id, - }).then(() => action?.reload()) - } - /> - - - Apis.Patrol.PatrolLocations.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - + render: (_, item: any, __, action) => ( + + ), + toggle: ( + + Apis.Patrol.PatrolLocations.Update({ + id: item.id ?? 0, + is_enabled: item.is_enabled === 1 ? 0 : 1, + name: item.name, + code: item.code, + asset_projects_id: item.asset_projects_id, + }).then(() => action?.reload()) + } + /> + ), + delete: ( + + Apis.Patrol.PatrolLocations.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/patrol/patrol_routes/index.tsx b/src/pages/patrol/patrol_routes/index.tsx index f92902b..2c08072 100644 --- a/src/pages/patrol/patrol_routes/index.tsx +++ b/src/pages/patrol/patrol_routes/index.tsx @@ -1,10 +1,16 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; import { showTime } from '@/common/utils/day'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { PatrolRoutesGenerationMethodEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { Space, Tooltip } from 'antd'; +import { Tooltip } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; @@ -16,7 +22,14 @@ export default function Index() { MyProTableProps.request(params, sort, Apis.Patrol.PatrolRoutes.List) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ @@ -144,17 +157,23 @@ export default function Index() { }), MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Patrol.PatrolRoutes.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - + render: (_, item: any, __, action) => ( + + ), + delete: ( + + Apis.Patrol.PatrolRoutes.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/patrol/patrol_tasks/index.tsx b/src/pages/patrol/patrol_tasks/index.tsx deleted file mode 100644 index e645449..0000000 --- a/src/pages/patrol/patrol_tasks/index.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { PatrolTasksCreateTypeEnum, PatrolTasksStatusEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Create from './modals/Create'; -import PatrolOrderAssign from './modals/PatrolOrderAssign'; -import PatrolOrderShow from './modals/PatrolOrderShow'; - -export default function Index({ title = '巡更任务' }) { - return ( - - MyProTableProps.request(params, sort, Apis.Patrol.PatrolTasks.List) - } - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - Selects?.AssetProjects({ - title: '选择项目', - key: 'asset_projects_id', - hidden: true, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - search: { - transform: (value) => { - return { project_name: value }; - }, - }, - }, - { - title: '路线名称', - dataIndex: ['patrol_route', 'name'], - search: { - transform: (value) => { - return { patrol_route_name: value }; - }, - }, - }, - - { - title: '任务时段', - dataIndex: 'start_time', - valueType: 'dateTime', - render: (_, item: any) => { - // 格式化开始时间(显示日期和时分) - const formatStartTime = (timeStr: string) => { - if (!timeStr) return ''; - const [date, time] = timeStr.split(' '); - if (!time) return date; - return `${date} ${time.split(':').slice(0, 2).join(':')}`; - }; - - // 格式化结束时间(只显示时分) - const formatEndTime = (timeStr: string) => { - if (!timeStr) return ''; - const [, time] = timeStr.split(' '); - if (!time) return ''; - return time.split(':').slice(0, 2).join(':'); - }; - - return `${formatStartTime(item.start_time)} - ${formatEndTime( - item.end_time, - )}`; - }, - search: false, - }, - { - title: '任务时段', - dataIndex: 'date_time', - valueType: 'dateRange', - hideInTable: true, - }, - MyColumns.EnumTag({ - title: '生成方式', - dataIndex: 'create_type', - valueEnum: PatrolTasksCreateTypeEnum, - }), - MyColumns.EnumTag({ - title: '任务状态', - dataIndex: 'status', - valueEnum: PatrolTasksStatusEnum, - search: false, - }), - { - title: '指派时间', - dataIndex: 'assign_time', - search: false, - }, - { - title: '关联工单', - dataIndex: 'house_work_orders_id', - search: false, - }, - { - title: '完成时间', - dataIndex: 'complete_time', - search: false, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - {item?.status === 'Unassigned' && ( - - )} - {item.status !== 'Unassigned' && ( - - )} - - Apis.Patrol.PatrolTasks.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/quality/emergency/categories/index.tsx b/src/pages/quality/emergency/categories/index.tsx index e130fef..44d5315 100644 --- a/src/pages/quality/emergency/categories/index.tsx +++ b/src/pages/quality/emergency/categories/index.tsx @@ -2,8 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; +import Create from '../modals/CategoryCreate'; +import Update from '../modals/CategoryUpdate'; export default function Index({ title = '分类' }) { return ( diff --git a/src/pages/quality/emergency/events/show/components/Info.tsx b/src/pages/quality/emergency/components/Info.tsx similarity index 100% rename from src/pages/quality/emergency/events/show/components/Info.tsx rename to src/pages/quality/emergency/components/Info.tsx diff --git a/src/pages/quality/emergency/events/index.tsx b/src/pages/quality/emergency/events/index.tsx deleted file mode 100644 index c71edcb..0000000 --- a/src/pages/quality/emergency/events/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { - EmergencyEventsCompensationTypeEnum, - EmergencyEventsStatusEnum, -} from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Assign from './modals/ApplyClose'; -import Create from './modals/Create'; -import Review from './modals/Review'; -import Update from './modals/Update'; - -export default function Index({ title = '突发事件' }) { - return ( - - MyProTableProps.request( - params, - sort, - Apis.Emergency.EmergencyEvents.List, - ) - } - headerTitle={`${title}列表`} - toolBarRender={(action: any) => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '名称', - dataIndex: 'name', - }, - { - title: '所属项目', - dataIndex: ['asset_project', 'name'], - search: false, - }, - MyColumns.EnumTag({ - title: '状态', - dataIndex: 'status', - valueEnum: EmergencyEventsStatusEnum, - }), - MyColumns.EnumTag({ - title: '赔偿方', - dataIndex: 'compensation_type', - valueEnum: EmergencyEventsCompensationTypeEnum, - }), - { - title: '赔偿事项', - search: false, - render: (_, item: any) => { - return ( -
-
赔偿比例:{item?.compensation_rate}%
-
赔偿金额:{item?.compensation_amount}元
-
已支付赔偿金额:{item?.compensation_paid_amount}元
-
- ); - }, - }, - { - title: '分类', - search: false, - render: (_, item: any) => { - return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`; - }, - }, - { - title: '等级', - dataIndex: 'emergency_event_levels_name', - search: false, - }, - MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - - - Apis.Emergency.EmergencyEvents.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/quality/emergency/follows/index.tsx b/src/pages/quality/emergency/follows/index.tsx index e07a5c6..0c8ad36 100644 --- a/src/pages/quality/emergency/follows/index.tsx +++ b/src/pages/quality/emergency/follows/index.tsx @@ -7,8 +7,8 @@ import { import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Image, Space } from 'antd'; -import Create from './modals/Create'; -import Show from './modals/Show'; +import Create from '../modals/FollowCreate'; +import Show from '../modals/FollowShow'; export default function Index(props: MyBetaModalFormProps) { return ( diff --git a/src/pages/quality/emergency/index.tsx b/src/pages/quality/emergency/index.tsx index 4eed4a4..cf7e487 100644 --- a/src/pages/quality/emergency/index.tsx +++ b/src/pages/quality/emergency/index.tsx @@ -1,42 +1,178 @@ -import { MyPageContainer } from '@/common'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import MyCategories from './categories'; -import MyEvents from './events'; -import MyLevels from './levels'; -import MyTeams from './teams'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + EmergencyEventsCompensationTypeEnum, + EmergencyEventsStatusEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import EventApplyClose from './modals/EventApplyClose'; +import EventCreate from './modals/EventCreate'; +import EventReview from './modals/EventReview'; +import EventUpdate from './modals/EventUpdate'; export default function Index({ title = '突发事件' }) { - const items: TabsProps['items'] = [ - { - key: 'MyEvents', - label: '突发事件', - children: , - }, - { - key: 'MyTeams', - label: '应急小组', - children: , - }, - { - key: 'MyCategories', - label: '事件分类', - children: , - }, - { - key: 'MyLevels', - label: '事件级别', - children: , - }, - ]; + const navigate = useNavigate(); + return ( - - - + + MyProTableProps.request( + params, + sort, + Apis.Emergency.EmergencyEvents.List, + ) + } + headerTitle={`${title}列表`} + toolBarRender={(action: any) => [ + + ), + teams: ( + { + navigate('/quality/emergency/teams'); + }} + title="应急小组" + /> + ), + categories: ( + { + navigate('/quality/emergency/categories'); + }} + title="事件分类" + /> + ), + levels: ( + { + navigate('/quality/emergency/levels'); + }} + title="级别配置" + /> + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + { + title: '名称', + dataIndex: 'name', + }, + { + title: '所属项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: EmergencyEventsStatusEnum, + }), + MyColumns.EnumTag({ + title: '赔偿方', + dataIndex: 'compensation_type', + valueEnum: EmergencyEventsCompensationTypeEnum, + }), + { + title: '赔偿事项', + search: false, + render: (_, item: any) => { + return ( +
+
赔偿比例:{item?.compensation_rate}%
+
赔偿金额:{item?.compensation_amount}元
+
已支付赔偿金额:{item?.compensation_paid_amount}元
+
+ ); + }, + }, + { + title: '分类', + search: false, + render: (_, item: any) => { + return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`; + }, + }, + { + title: '等级', + dataIndex: 'emergency_event_levels_name', + search: false, + }, + MyColumns.UpdatedAt(), + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + ), + close: ( + + ), + update: ( + + ), + audit: ( + + ), + delete: ( + + Apis.Emergency.EmergencyEvents.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + maxVisible={3} + /> + + ), + }), + ]} + /> ); } diff --git a/src/pages/quality/emergency/levels/index.tsx b/src/pages/quality/emergency/levels/index.tsx index 845d731..a442246 100644 --- a/src/pages/quality/emergency/levels/index.tsx +++ b/src/pages/quality/emergency/levels/index.tsx @@ -2,8 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; +import Create from '../modals/LevelCreate'; +import Update from '../modals/LevelUpdate'; export default function Index({ title = '等级' }) { return ( diff --git a/src/pages/quality/emergency/categories/modals/Create.tsx b/src/pages/quality/emergency/modals/CategoryCreate.tsx similarity index 100% rename from src/pages/quality/emergency/categories/modals/Create.tsx rename to src/pages/quality/emergency/modals/CategoryCreate.tsx diff --git a/src/pages/quality/emergency/categories/modals/Update.tsx b/src/pages/quality/emergency/modals/CategoryUpdate.tsx similarity index 100% rename from src/pages/quality/emergency/categories/modals/Update.tsx rename to src/pages/quality/emergency/modals/CategoryUpdate.tsx diff --git a/src/pages/quality/emergency/events/modals/ApplyClose.tsx b/src/pages/quality/emergency/modals/EventApplyClose.tsx similarity index 100% rename from src/pages/quality/emergency/events/modals/ApplyClose.tsx rename to src/pages/quality/emergency/modals/EventApplyClose.tsx diff --git a/src/pages/quality/emergency/events/modals/Create.tsx b/src/pages/quality/emergency/modals/EventCreate.tsx similarity index 98% rename from src/pages/quality/emergency/events/modals/Create.tsx rename to src/pages/quality/emergency/modals/EventCreate.tsx index f6dcfe3..c60d825 100644 --- a/src/pages/quality/emergency/events/modals/Create.tsx +++ b/src/pages/quality/emergency/modals/EventCreate.tsx @@ -25,7 +25,7 @@ export default function Create(props: MyBetaModalFormProps) { form.setFieldsValue(props.item); } }} - trigger={} + trigger={} onFinish={async (values: any) => Apis.Emergency.EmergencyEvents.Store({ ...values, diff --git a/src/pages/quality/emergency/events/modals/Review.tsx b/src/pages/quality/emergency/modals/EventReview.tsx similarity index 100% rename from src/pages/quality/emergency/events/modals/Review.tsx rename to src/pages/quality/emergency/modals/EventReview.tsx diff --git a/src/pages/quality/emergency/events/modals/Update.tsx b/src/pages/quality/emergency/modals/EventUpdate.tsx similarity index 100% rename from src/pages/quality/emergency/events/modals/Update.tsx rename to src/pages/quality/emergency/modals/EventUpdate.tsx diff --git a/src/pages/quality/emergency/follows/modals/Create.tsx b/src/pages/quality/emergency/modals/FollowCreate.tsx similarity index 100% rename from src/pages/quality/emergency/follows/modals/Create.tsx rename to src/pages/quality/emergency/modals/FollowCreate.tsx diff --git a/src/pages/quality/emergency/follows/modals/Show.tsx b/src/pages/quality/emergency/modals/FollowShow.tsx similarity index 100% rename from src/pages/quality/emergency/follows/modals/Show.tsx rename to src/pages/quality/emergency/modals/FollowShow.tsx diff --git a/src/pages/quality/emergency/levels/modals/Create.tsx b/src/pages/quality/emergency/modals/LevelCreate.tsx similarity index 100% rename from src/pages/quality/emergency/levels/modals/Create.tsx rename to src/pages/quality/emergency/modals/LevelCreate.tsx diff --git a/src/pages/quality/emergency/levels/modals/Update.tsx b/src/pages/quality/emergency/modals/LevelUpdate.tsx similarity index 100% rename from src/pages/quality/emergency/levels/modals/Update.tsx rename to src/pages/quality/emergency/modals/LevelUpdate.tsx diff --git a/src/pages/quality/emergency/teams/modals/Create.tsx b/src/pages/quality/emergency/modals/TeamCreate.tsx similarity index 100% rename from src/pages/quality/emergency/teams/modals/Create.tsx rename to src/pages/quality/emergency/modals/TeamCreate.tsx diff --git a/src/pages/quality/emergency/teams/modals/Update.tsx b/src/pages/quality/emergency/modals/TeamUpdate.tsx similarity index 100% rename from src/pages/quality/emergency/teams/modals/Update.tsx rename to src/pages/quality/emergency/modals/TeamUpdate.tsx diff --git a/src/pages/quality/emergency/events/show/$id.tsx b/src/pages/quality/emergency/show/$id.tsx similarity index 93% rename from src/pages/quality/emergency/events/show/$id.tsx rename to src/pages/quality/emergency/show/$id.tsx index 2c7e519..975b849 100644 --- a/src/pages/quality/emergency/events/show/$id.tsx +++ b/src/pages/quality/emergency/show/$id.tsx @@ -3,8 +3,8 @@ import { Apis } from '@/gen/Apis'; import { useParams } from '@umijs/max'; import { Tabs } from 'antd'; import { useEffect, useState } from 'react'; -import MyFollows from '../../follows'; -import Info from './components/Info'; +import MyFollows from '../follows'; +import Info from '../components/Info'; export default function Show({ title = '详情' }: { title?: string } = {}) { const { id } = useParams<{ id: string }>(); diff --git a/src/pages/quality/emergency/teams/index.tsx b/src/pages/quality/emergency/teams/index.tsx index 329bb26..2f541bd 100644 --- a/src/pages/quality/emergency/teams/index.tsx +++ b/src/pages/quality/emergency/teams/index.tsx @@ -2,8 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; +import Create from '../modals/TeamCreate'; +import Update from '../modals/TeamUpdate'; export default function Index({ title = '应急小组' }) { return ( diff --git a/src/pages/quality/marketing/ad/index.tsx b/src/pages/quality/marketing/ad/index.tsx deleted file mode 100644 index 279c49c..0000000 --- a/src/pages/quality/marketing/ad/index.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import BannerCreate from './modals/BannerCreate'; -import BannerShow from './modals/BannerShow'; -import BannerUpdate from './modals/BannerUpdate'; - -export default function Index({ title = 'Banner投放' }) { - return ( - - - MyProTableProps.request(params, sort, Apis.Banner.Banners.List) - } - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ search: false }), - { - title: 'Banner名称', - dataIndex: 'name', - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: BannersTypeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '跳转类型', - dataIndex: 'redirect_type', - valueEnum: BannersRedirectTypeEnum, - search: false, - }), - { - title: '开始时间', - dataIndex: 'start_time', - valueType: 'dateTime', - search: false, - }, - { - title: '结束时间', - dataIndex: 'end_time', - valueType: 'dateTime', - search: false, - }, - { - title: '广告位', - dataIndex: ['banner_space', 'name'], - search: false, - render: (_, record) => { - return record?.banner_space?.name; - }, - }, - { - //创建日期 - title: '创建日期', - dataIndex: 'created_at', - valueType: 'dateTime', - search: false, - render: (_, record) => { - return record?.created_at?.substring(0, 10); - }, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - Apis.Banner.Banners.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/quality/marketing/ad/modals/BannerCreate.tsx b/src/pages/quality/marketing/ad/modals/BannerCreate.tsx deleted file mode 100644 index 3eb7fc2..0000000 --- a/src/pages/quality/marketing/ad/modals/BannerCreate.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`添加Banner`} - wrapperCol={{ span: 19 }} - width="600px" - layout="horizontal" - labelCol={{ span: 5 }} - labelAlign="left" - key={new Date().getTime()} - trigger={} - form={form} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - form.setFieldsValue({ - banner_spaces_id: props.item?.banner_spaces_id, - }); - } - }} - onFinish={async (values) => - Apis.Banner.Banners.Store(values) - .then(() => { - props.reload?.(); - message.success('添加广告内容成功'); - return true; - }) - .catch(() => false) - } - columns={[ - Selects?.GetBannerSpace({ - key: 'banner_spaces_id', - title: '投放位置', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - fieldProps: { - showSearch: true, - optionFilterProp: 'label', - }, - }), - { - key: 'name', - title: 'Banner名称', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - { - valueType: 'group', - columns: [ - MyFormItems.EnumRadio({ - key: 'type', - title: '展示类型', - colProps: { span: 24 }, - valueEnum: BannersTypeEnum, - required: true, - }), - { - name: ['type'], - valueType: 'dependency', - columns: ({ type }: any) => { - return type === 'Text' - ? [ - { - title: '文本内容', - key: ['source', 0, 'text'], - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - ] - : type === 'Image' - ? [ - MyFormItems.UploadImages({ - key: 'source', - title: '广告图片', - uploadType: 'file', - max: 1, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), - ] - : type === 'Video' - ? [ - MyFormItems.UploadImages({ - key: 'source', - title: '广告视频', - uploadType: 'file', - max: 1, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), - ] - : []; - }, - }, - ], - }, - MyFormItems.EnumRadio({ - key: 'redirect_type', - title: '跳转类型', - colProps: { span: 24 }, - valueEnum: BannersRedirectTypeEnum, - required: false, - }), - { - key: 'redirect_path', - title: '跳转链接', - colProps: { span: 24 }, - fieldProps: { - placeholder: '请输入跳转链接', - }, - }, - { - name: ['redirect_type'], - valueType: 'dependency', - columns: ({ redirect_type }: any) => { - return redirect_type === 'AnotherMiniProgram' - ? [ - { - title: '小程序AppID', - dataIndex: 'app_id', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - ] - : []; - }, - }, - - { - key: 'start_time', - title: '开始时间', - valueType: 'dateTime', - colProps: { span: 24 }, - }, - { - key: 'end_time', - title: '结束时间', - valueType: 'dateTime', - colProps: { span: 24 }, - }, - { - key: 'sort', - title: '排序', - valueType: 'digit', - colProps: { span: 24 }, - fieldProps: { - placeholder: '数值越大越靠前', - min: 0, - style: { width: '100%' }, - }, - initialValue: 0, - }, - ]} - /> - ); -} diff --git a/src/pages/quality/marketing/ad/modals/BannerShow.tsx b/src/pages/quality/marketing/ad/modals/BannerShow.tsx deleted file mode 100644 index 862397e..0000000 --- a/src/pages/quality/marketing/ad/modals/BannerShow.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import { MyBetaModalFormProps, renderTextHelper } from '@/common'; -import { MyModal } from '@/components/MyModal'; -import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; -import { ProCard, ProDescriptions } from '@ant-design/pro-components'; -import { Image, Space, Typography } from 'antd'; - -const { Text } = Typography; - -export default function info(props: MyBetaModalFormProps) { - // 根据类型渲染内容 - const renderContent = () => { - const { type, source } = props?.item || {}; - if (!source || !Array.isArray(source) || source.length === 0) { - return 暂无内容; - } - - switch (type) { - case 'Text': - return ( -
- {source?.[0]?.text} -
- ); - - case 'Image': - return ( - - {source.map((res: any, index: number) => ( - - - - ))} - - ); - - case 'Video': - return ( -
- {source.map((res: any, index: number) => ( - - ))} -
- ); - default: - return 未知内容类型; - } - }; - - return ( - - - - - {props?.item?.name || '-'} - - - - - - - {props?.item?.start_time || '-'} - - - {props?.item?.end_time || '-'} - - - {props?.item?.sort || '-'} - - - {props?.item?.create_at || '-'} - - - {props?.item?.updated_at || '-'} - - - - - - - - - - {props?.item?.redirect_type === 'AnotherMiniProgram' && ( - - {props?.item?.app_id || '-'} - - )} - - {props?.item?.redirect_path || '-'} - - - - - -
{renderContent()}
-
- - } - /> - ); -} diff --git a/src/pages/quality/marketing/ad/modals/BannerUpdate.tsx b/src/pages/quality/marketing/ad/modals/BannerUpdate.tsx deleted file mode 100644 index e45c5b4..0000000 --- a/src/pages/quality/marketing/ad/modals/BannerUpdate.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`编辑广告内容`} - trigger={} - width="600px" - layout="horizontal" - labelCol={{ span: 5 }} - wrapperCol={{ span: 24 }} - labelAlign="left" - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue(props.item); - } - }} - onFinish={async (values) => - Apis.Banner.Banners.Update({ ...values, id: props.item?.id ?? 0 }) - .then(() => { - props.reload?.(); - message.success('编辑广告内容成功'); - return true; - }) - .catch(() => false) - } - columns={[ - Selects?.GetBannerSpace({ - key: 'banner_spaces_id', - title: '选择广告位', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), - { - key: 'name', - title: '内容名称', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - { - valueType: 'group', - columns: [ - MyFormItems.EnumRadio({ - key: 'type', - title: '展示类型', - colProps: { span: 24 }, - valueEnum: BannersTypeEnum, - required: true, - }), - { - name: ['type'], - valueType: 'dependency', - columns: ({ type }: any) => { - return type === 'Text' - ? [ - { - key: ['source', 0, 'text'], - title: '文本内容', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - ] - : type === 'Image' - ? [ - MyFormItems.UploadImages({ - key: 'source', - title: '广告图片', - uploadType: 'file', - max: 1, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), - ] - : type === 'Video' - ? [ - MyFormItems.UploadImages({ - key: 'source', - title: '广告视频', - uploadType: 'file', - max: 1, - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }), - ] - : []; - }, - }, - ], - }, - MyFormItems.EnumRadio({ - key: 'redirect_type', - title: '跳转类型', - colProps: { span: 24 }, - valueEnum: BannersRedirectTypeEnum, - required: false, - }), - { - key: 'redirect_path', - title: '跳转链接', - colProps: { span: 24 }, - fieldProps: { - placeholder: '请输入跳转链接', - }, - }, - { - name: ['redirect_type'], - valueType: 'dependency', - columns: ({ redirect_type }: any) => { - return redirect_type === 'AnotherMiniProgram' - ? [ - { - title: '小程序AppID', - dataIndex: 'app_id', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - ] - : []; - }, - }, - - { - key: 'start_time', - title: '开始时间', - valueType: 'dateTime', - colProps: { span: 24 }, - }, - { - key: 'end_time', - title: '结束时间', - valueType: 'dateTime', - colProps: { span: 24 }, - }, - { - key: 'sort', - title: '排序', - valueType: 'digit', - colProps: { span: 24 }, - fieldProps: { - placeholder: '数值越大越靠前', - min: 0, - style: { width: '100%' }, - }, - initialValue: 0, - }, - ]} - /> - ); -} diff --git a/src/pages/quality/marketing/ad_location/$id.tsx b/src/pages/quality/marketing/ad_location/$id.tsx deleted file mode 100644 index dd5c623..0000000 --- a/src/pages/quality/marketing/ad_location/$id.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { MyPageContainer, usePageTabs } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProCard } from '@ant-design/pro-components'; -import { useParams } from '@umijs/max'; -import { Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import BannerList from './components/BannerList'; -import BannerSpaceInfo from './components/BannerSpaceInfo'; - -export default function Show({ title }: { title?: string } = {}) { - const { id } = useParams<{ id: string }>(); - const [data, setShow] = useState({}); - - // 注册当前页面为标签页 - const { addTab } = usePageTabs({ - tabKey: `banner-space-${id}`, - tabLabel: data?.name || title || '广告位详情', - }); - - const loadShow = () => { - let paramsId: any = { id: id ?? 0 }; - Apis.Banner.BannerSpaces.Show(paramsId).then((res) => { - setShow(res?.data); - }); - }; - - useEffect(() => { - loadShow(); - }, [id]); - - let items = [ - { - label: '广告投放', - key: '1', - closable: false, - children: ( - loadShow()} - /> - ), - }, - ]; - return ( - - - - - - - ); -} diff --git a/src/pages/quality/marketing/ad_location/components/BannerList.tsx b/src/pages/quality/marketing/ad_location/components/BannerList.tsx deleted file mode 100644 index a34ebe8..0000000 --- a/src/pages/quality/marketing/ad_location/components/BannerList.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import { useEffect, useRef } from 'react'; -import BannerCreate from '../../ad/modals/BannerCreate'; -import BannerShow from '../../ad/modals/BannerShow'; -import BannerUpdate from '../../ad/modals/BannerUpdate'; - -export default function Index({ ...rest }) { - const actionLooks = useRef(); - useEffect(() => { - actionLooks?.current.reloadAndRest(); - }, [rest.loadmore]); - - return ( - <> - > - {...MyProTableProps.props} - actionRef={actionLooks} - request={async (params, sort) => - MyProTableProps.request( - { - ...params, - banner_spaces_id: rest.item?.banner_spaces_id, - }, - sort, - Apis.Banner.Banners.List, - ) - } - toolBarRender={(action) => [ - , - ]} - search={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '广告名称', - dataIndex: 'name', - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: BannersTypeEnum, - search: false, - }), - MyColumns.EnumTag({ - title: '跳转类型', - dataIndex: 'redirect_type', - valueEnum: BannersRedirectTypeEnum, - search: false, - }), - { - title: '开始时间', - dataIndex: 'start_time', - valueType: 'dateTime', - search: false, - }, - { - title: '结束时间', - dataIndex: 'end_time', - valueType: 'dateTime', - search: false, - }, - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/quality/marketing/ad_location/components/BannerSpaceInfo.tsx b/src/pages/quality/marketing/ad_location/components/BannerSpaceInfo.tsx deleted file mode 100644 index 2d9297e..0000000 --- a/src/pages/quality/marketing/ad_location/components/BannerSpaceInfo.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { MyBetaModalFormProps, renderTextHelper } from '@/common'; -import { BannerSpacesTypeEnum } from '@/gen/Enums'; -import { ProCard, ProDescriptions } from '@ant-design/pro-components'; -import { Space } from 'antd'; - -export default function info(props: MyBetaModalFormProps) { - const { item } = props; - - return ( - - - - - {item?.name} - - - - - - - {item?.remark} - - - - - ); -} diff --git a/src/pages/quality/marketing/ad_location/index.tsx b/src/pages/quality/marketing/ad_location/index.tsx deleted file mode 100644 index 98f21d2..0000000 --- a/src/pages/quality/marketing/ad_location/index.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BannerSpacesTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; -import BannerSpaceCreate from './modals/BannerSpaceCreate'; -import BannerSpaceUpdate from './modals/BannerSpaceUpdate'; - -export default function Index({ title = '广告位' }) { - const navigate = useNavigate(); - - return ( - - - MyProTableProps.request(params, sort, Apis.Banner.BannerSpaces.List) - } - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ search: false }), - { - title: '广告位名称', - dataIndex: 'name', - }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'type', - valueEnum: BannerSpacesTypeEnum, - search: false, - }), - { - title: '备注', - dataIndex: 'remark', - search: false, - ellipsis: true, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - { - navigate(`/marketing/ad_location/${item.id}`); - }} - /> - - Apis.Banner.BannerSpaces.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/quality/marketing/ad_location/modals/BannerSpaceCreate.tsx b/src/pages/quality/marketing/ad_location/modals/BannerSpaceCreate.tsx deleted file mode 100644 index c3117de..0000000 --- a/src/pages/quality/marketing/ad_location/modals/BannerSpaceCreate.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BannerSpacesTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - return ( - - {...MyModalFormProps.props} - title={`添加广告位`} - wrapperCol={{ span: 24 }} - width="500px" - trigger={} - key={new Date().getTime()} - onFinish={async (values) => - Apis.Banner.BannerSpaces.Store(values) - .then(() => { - props.reload?.(); - message.success('添加广告位成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '广告位名称', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - MyFormItems.EnumRadio({ - key: 'type', - title: '类型', - colProps: { span: 24 }, - valueEnum: BannerSpacesTypeEnum, - required: true, - }), - { - key: 'remark', - title: '备注', - valueType: 'textarea', - colProps: { span: 24 }, - fieldProps: { - rows: 4, - maxLength: 500, - showCount: true, - }, - }, - ]} - /> - ); -} diff --git a/src/pages/quality/marketing/ad_location/modals/BannerSpaceUpdate.tsx b/src/pages/quality/marketing/ad_location/modals/BannerSpaceUpdate.tsx deleted file mode 100644 index 22fc147..0000000 --- a/src/pages/quality/marketing/ad_location/modals/BannerSpaceUpdate.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BannerSpacesTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`编辑广告位`} - trigger={} - wrapperCol={{ span: 24 }} - width="600px" - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue(props.item); - } - }} - onFinish={async (values) => - Apis.Banner.BannerSpaces.Update({ ...values, id: props.item?.id ?? 0 }) - .then(() => { - props.reload?.(); - message.success('编辑广告位成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '广告位名称', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - MyFormItems.EnumRadio({ - key: 'type', - title: '类型', - colProps: { span: 24 }, - valueEnum: BannerSpacesTypeEnum, - required: true, - }), - { - key: 'remark', - title: '备注', - valueType: 'textarea', - colProps: { span: 24 }, - fieldProps: { - rows: 4, - maxLength: 500, - showCount: true, - }, - }, - ]} - /> - ); -} diff --git a/src/pages/quality/marketing/survey/components/SurveyReleasesList.tsx b/src/pages/quality/marketing/survey/components/SurveyReleasesList.tsx deleted file mode 100644 index e444db3..0000000 --- a/src/pages/quality/marketing/survey/components/SurveyReleasesList.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { SurveyReleasesTypeEnum } from '@/gen/Enums'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Create from '../modals/SurveyReleasesCreate'; -import Update from '../modals/SurveyReleasesUpdate'; - -export default function SurveyReleasesList({ title = '问卷发布列表' }) { - return ( - - MyProTableProps.request(params, sort, Apis.Survey.SurveyReleases.List) - } - toolBarRender={(action) => [ - , - ]} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '问卷ID', - hidden: true, - dataIndex: 'surveys_id', - // search: { - // transform: (value) => { - // return { surveys_id: value }; - // }, - // }, - }, - MyColumns.EnumTag({ - title: '方式', - dataIndex: 'release_type', - valueEnum: SurveyReleasesTypeEnum, - }), - MyColumns.Boolean({ - title: '是否发布', - dataIndex: 'status', - }), - { dataIndex: ['survey', 'name'], title: '发布的问卷', search: false }, - { dataIndex: 'start_date', title: '开始时间', search: false }, - { dataIndex: 'end_date', title: '结束时间', search: false }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - Apis.Survey.SurveyReleases.Publish({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - - Apis.Survey.SurveyReleases.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/quality/marketing/survey/index.tsx b/src/pages/quality/marketing/survey/index.tsx deleted file mode 100644 index 7ddd4ae..0000000 --- a/src/pages/quality/marketing/survey/index.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { MyPageContainer } from '@/common'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import MyQuestionCategoriesList from './components/QuestionCategoriesList'; -import MyQuestionsList from './components/QuestionsList'; -import MySurveyReleasesList from './components/SurveyReleasesList'; -import MySurveyResponsesList from './components/SurveyResponsesList'; -import MySurveysList from './components/SurveysList'; -export default function Index({ title = '问卷调查' }) { - const items: TabsProps['items'] = [ - { - key: 'MySurveyReleasesList', - label: '问卷发布', - children: , - }, - { - key: 'MySurveyResponsesList', - label: '问卷回收', - children: , - }, - { - key: 'MySurveysList', - label: '问卷设置', - children: , - }, - { - key: 'MyQuestionsList', - label: '题库设置', - children: , - }, - { - key: 'MyQuestionCategoriesList', - label: '题目分类', - children: , - }, - ]; - return ( - - - - ); -} diff --git a/src/pages/quality/renovation/application/index.tsx b/src/pages/quality/renovation/application/index.tsx deleted file mode 100644 index 8ec74cf..0000000 --- a/src/pages/quality/renovation/application/index.tsx +++ /dev/null @@ -1,194 +0,0 @@ -import { MyButtons, MyColumns, MyProTableProps } from '@/common'; -import { Selects } from '@/components/Select'; -import { Apis } from '@/gen/Apis'; -import { - RenovationAppliesConstructionStatusEnum, - RenovationAppliesStatusEnum, -} from '@/gen/Enums'; -import { PlusOutlined } from '@ant-design/icons'; -import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; -import MyWorkerCreate from '../modals/WorkerCreate'; - -export default function Index() { - const navigate = useNavigate(); - - return ( - - MyProTableProps.request( - params, - sort, - Apis.Renovation.RenovationApplies.List, - ) - } - headerTitle="装修申请列表" - toolBarRender={() => [ - } - onClick={() => { - navigate('/quality/renovation/application/pages/create'); - }} - title="装修申请" - />, - ]} - columns={[ - MyColumns.ID({ search: false }), - Selects?.AssetProjects({ - title: '选择项目', - key: 'id', - hidden: true, - }), - MyColumns.EnumTag({ - title: '登记状态', - dataIndex: 'status', - valueEnum: RenovationAppliesStatusEnum, - search: false, - }), - { - title: '关联项目', - dataIndex: ['asset_project', 'name'], - search: false, - // search: { - // transform: (value) => { - // return { project_name: value }; - // }, - // }, - }, - // MyColumns.EnumTag({ - // title: '状态', - // dataIndex: 'status', - // valueEnum: () => { - // let obj: any = JSON.parse( - // JSON.stringify(RenovationAppliesStatusEnum), - // ); - // delete obj?.Pending; - // return obj; - // }, - // hidden: true, - // }), - { - title: '房屋', - dataIndex: ['asset_house', 'full_name'], - search: { - transform: (value) => { - return { full_name: value }; - }, - }, - }, - { - title: '装修人', - dataIndex: 'owner_name', - }, - // { - // title: '代理人', - // dataIndex: 'agent_name', - // }, - { - title: '装修公司', - dataIndex: 'company_name', - search: false, - // render: (_, item: any) => { - // return ( - // - //
{item?.company_name || '-'}
- //
- // {item?.company_principal_name || ''} - //
- //
- // ); - // }, - }, - - { - title: '施工负责人', - dataIndex: 'construction_principal_name', - search: false, - // render: (_, item: any) => { - // return
{item?.construction_principal_name || ''}
; - // }, - }, - MyColumns.EnumTag({ - title: '施工状态', - dataIndex: 'construction_status', - valueEnum: RenovationAppliesConstructionStatusEnum, - search: false, - }), - - { - title: '保证金', - dataIndex: 'deposit_amount', - search: false, - }, - { - title: '施工时间', - search: false, - render: (_, item: any) => { - return ( -
- {item?.construction_start_date || ''} 至 - {item?.construction_end_date || ''} -
- ); - }, - }, - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate( - `/quality/renovation/application/pages/show?id=${item.id}`, - ); - }} - title="查看" - /> - - { - navigate( - `/quality/renovation/application/pages/update?id=${item.id}`, - ); - }} - title="编辑" - /> - - Apis.Renovation.RenovationApplies.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/quality/renovation/audit/index.tsx b/src/pages/quality/renovation/audit/index.tsx index 4837e3a..70c4e74 100644 --- a/src/pages/quality/renovation/audit/index.tsx +++ b/src/pages/quality/renovation/audit/index.tsx @@ -82,7 +82,7 @@ export default function Index() { type="primary" onClick={() => { navigate( - `/quality/renovation/audit/pages/review?id=${item.id}`, + `/quality/renovation/application/pages/review?id=${item.id}`, ); }} title="查看并审核" diff --git a/src/pages/quality/renovation/application/components/Deposit.tsx b/src/pages/quality/renovation/components/Deposit.tsx similarity index 100% rename from src/pages/quality/renovation/application/components/Deposit.tsx rename to src/pages/quality/renovation/components/Deposit.tsx diff --git a/src/pages/quality/renovation/application/components/WorkerTable.tsx b/src/pages/quality/renovation/components/WorkerTable.tsx similarity index 96% rename from src/pages/quality/renovation/application/components/WorkerTable.tsx rename to src/pages/quality/renovation/components/WorkerTable.tsx index 946b81f..7f045ef 100644 --- a/src/pages/quality/renovation/application/components/WorkerTable.tsx +++ b/src/pages/quality/renovation/components/WorkerTable.tsx @@ -8,8 +8,8 @@ import { Apis } from '@/gen/Apis'; import { HouseOccupantsCardTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Image, Space } from 'antd'; -import MyWorkerCreate from '../../modals/WorkerCreate'; -import MyWorkerUpdate from '../../modals/WorkerUpdate'; +import MyWorkerCreate from '../modals/WorkerCreate'; +import MyWorkerUpdate from '../modals/WorkerUpdate'; export default function Index(props: MyBetaModalFormProps) { return ( diff --git a/src/pages/quality/renovation/application/components/info.tsx b/src/pages/quality/renovation/components/info.tsx similarity index 100% rename from src/pages/quality/renovation/application/components/info.tsx rename to src/pages/quality/renovation/components/info.tsx diff --git a/src/pages/quality/renovation/config/$id.tsx b/src/pages/quality/renovation/config/$id.tsx index 92eca7f..64451f9 100644 --- a/src/pages/quality/renovation/config/$id.tsx +++ b/src/pages/quality/renovation/config/$id.tsx @@ -3,7 +3,7 @@ import { Apis } from '@/gen/Apis'; import { useParams } from '@umijs/max'; import { Tabs } from 'antd'; import { useEffect, useState } from 'react'; -import MyRenovationWorkers from '../renovation_workers'; +import MyRenovationWorkers from '../workers'; export default function Config({ title }: { title?: string } = {}) { const { id } = useParams<{ id: string }>(); diff --git a/src/pages/quality/renovation/deposit/index.tsx b/src/pages/quality/renovation/deposit/index.tsx index 503a1d9..c18a7a3 100644 --- a/src/pages/quality/renovation/deposit/index.tsx +++ b/src/pages/quality/renovation/deposit/index.tsx @@ -4,7 +4,7 @@ import { Apis } from '@/gen/Apis'; import { BillPaymentsTypeEnum, BillsStatusEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import PayCreate from './modals/PayCreate'; +import PayCreate from '../modals/DepositPayCreate'; export default function Index() { return ( diff --git a/src/pages/quality/renovation/index.tsx b/src/pages/quality/renovation/index.tsx index 5dee3c4..628f9d4 100644 --- a/src/pages/quality/renovation/index.tsx +++ b/src/pages/quality/renovation/index.tsx @@ -1,43 +1,215 @@ -import { MyPageContainer } from '@/common'; -// import MyDecorationWorkorder from '@/pages/work_order/renovation'; -import type { TabsProps } from 'antd'; -import { Tabs } from 'antd'; -import MyRenovationApplies from './application'; -import MyRenovationAppliesAudit from './audit'; -import MyRenovationApply from './deposit'; -import MyRenovationInspectionRules from './renovation_inspection_rules'; +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { + RenovationAppliesConstructionStatusEnum, + RenovationAppliesStatusEnum, +} from '@/gen/Enums'; +import { PlusOutlined } from '@ant-design/icons'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import DepositPay from './modals/DepositPay'; +import DepositRefund from './modals/DepositRefund'; +import MyWorkerCreate from './modals/WorkerCreate'; + +export default function Index() { + const navigate = useNavigate(); -export default function Index({ title = '装修管理' }) { - const items: TabsProps['items'] = [ - { - key: 'MyRenovationApplies', - label: '装修申请', - children: , - }, - { - key: 'MyRenovationAppliesAudit', - label: '资料审核', - children: , - }, - { - key: 'MyRenovationInspectionRules', - label: '巡检规则配置', - children: , - }, - { - key: 'MyRenovationApply', - label: '装修押金', - children: , - }, - ]; return ( - - - + + MyProTableProps.request( + params, + sort, + Apis.Renovation.RenovationApplies.List, + ) + } + headerTitle="装修申请列表" + toolBarRender={(action) => [ + } + onClick={() => { + navigate('/quality/renovation/pages/create'); + }} + title="装修申请" + /> + ), + rules: ( + { + navigate('/quality/renovation/inspection_rules'); + }} + title="巡检配置" + /> + ), + audit: ( + { + navigate('/quality/renovation/audit'); + }} + title="资料审核" + /> + ), + }} + />, + ]} + columns={[ + MyColumns.ID({ search: false }), + Selects?.AssetProjects({ + title: '选择项目', + key: 'id', + hidden: true, + }), + MyColumns.EnumTag({ + title: '登记状态', + dataIndex: 'status', + valueEnum: RenovationAppliesStatusEnum, + search: false, + }), + { + title: '关联项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, + { + title: '房屋', + dataIndex: ['asset_house', 'full_name'], + search: { + transform: (value) => { + return { full_name: value }; + }, + }, + }, + { + title: '装修人', + dataIndex: 'owner_name', + }, + { + title: '装修公司', + dataIndex: 'company_name', + search: false, + }, + { + title: '施工负责人', + dataIndex: 'construction_principal_name', + search: false, + }, + MyColumns.EnumTag({ + title: '施工状态', + dataIndex: 'construction_status', + valueEnum: RenovationAppliesConstructionStatusEnum, + search: false, + }), + { + title: '保证金', + dataIndex: 'deposit_amount', + search: false, + }, + { + title: '施工时间', + search: false, + render: (_, item: any) => { + return ( +
+ {item?.construction_start_date || ''} 至 + {item?.construction_end_date || ''} +
+ ); + }, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + { + navigate( + `/quality/renovation/pages/show?id=${item.id}`, + ); + }} + title="查看" + /> + ), + worker: ( + + ), + update: ( + { + navigate( + `/quality/renovation/pages/update?id=${item.id}`, + ); + }} + title="编辑" + /> + ), + pay: ( + + ), + refund: ( + + ), + delete: ( + + Apis.Renovation.RenovationApplies.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + maxVisible={3} + /> + + ), + }), + ]} + /> ); } diff --git a/src/pages/quality/renovation/renovation_inspection_rules/index.tsx b/src/pages/quality/renovation/inspection_rules/index.tsx similarity index 94% rename from src/pages/quality/renovation/renovation_inspection_rules/index.tsx rename to src/pages/quality/renovation/inspection_rules/index.tsx index d851fea..36bc840 100644 --- a/src/pages/quality/renovation/renovation_inspection_rules/index.tsx +++ b/src/pages/quality/renovation/inspection_rules/index.tsx @@ -2,8 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; +import Create from '../modals/InspectionRuleCreate'; +import Update from '../modals/InspectionRuleUpdate'; export default function Index({ title = '巡检规则' }) { return ( diff --git a/src/pages/quality/renovation/audit/modals/Review.tsx b/src/pages/quality/renovation/modals/AuditReview.tsx similarity index 100% rename from src/pages/quality/renovation/audit/modals/Review.tsx rename to src/pages/quality/renovation/modals/AuditReview.tsx diff --git a/src/pages/quality/renovation/modals/DepositPay.tsx b/src/pages/quality/renovation/modals/DepositPay.tsx new file mode 100644 index 0000000..da5a5f7 --- /dev/null +++ b/src/pages/quality/renovation/modals/DepositPay.tsx @@ -0,0 +1,110 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseOrdersPaymentMethodEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function DepositPay(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`收取装修押金`} + labelCol={{ span: 4 }} + wrapperCol={{ span: 20 }} + width="600px" + layout="horizontal" + trigger={ + + } + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); + form.setFieldsValue({ + deposit_amount: props?.item?.deposit_amount, + }); + } + }} + key={new Date().getTime()} + form={form} + onFinish={async (values) => + Apis.Renovation.RenovationApplies.UpdateDeposit({ + ...values, + id: props?.item?.id, + }) + .then(() => { + props.reload?.(); + message.success('押金收取成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'deposit_amount', + title: '押金金额', + valueType: 'digit', + colProps: { span: 24 }, + initialValue: props?.item?.deposit_amount, + fieldProps: { + style: { width: '100%' }, + addonAfter: '元', + }, + formItemProps: { ...rulesHelper.number }, + }, + MyFormItems.EnumRadio({ + key: 'payment_method', + title: '收款方式', + colProps: { span: 24 }, + valueEnum: () => { + const obj: Record = JSON.parse( + JSON.stringify(HouseOrdersPaymentMethodEnum), + ); + delete obj.WeChat; + delete obj.Alipay; + delete obj.TongLian; + delete obj.Prepayment; + return obj; + }, + required: true, + }), + { + key: 'paid_time', + title: '收款日期', + valueType: 'date', + formItemProps: { ...rulesHelper.text }, + colProps: { span: 24 }, + }, + { + key: 'remark', + title: '收款备注', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + placeholder: '请详细描述收款内容', + rows: 4, + }, + }, + MyFormItems.UploadImages({ + key: 'pay_certificate', + title: '收款凭证', + tooltip: '最多上传5张图片', + max: 5, + colProps: { span: 24 }, + formItemProps: { required: false }, + }), + ]} + /> + ); +} diff --git a/src/pages/quality/renovation/deposit/modals/PayCreate.tsx b/src/pages/quality/renovation/modals/DepositPayCreate.tsx similarity index 100% rename from src/pages/quality/renovation/deposit/modals/PayCreate.tsx rename to src/pages/quality/renovation/modals/DepositPayCreate.tsx diff --git a/src/pages/quality/renovation/modals/DepositRefund.tsx b/src/pages/quality/renovation/modals/DepositRefund.tsx new file mode 100644 index 0000000..c4b14d5 --- /dev/null +++ b/src/pages/quality/renovation/modals/DepositRefund.tsx @@ -0,0 +1,117 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; +import { useState } from 'react'; + +export default function DepositRefund(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + const [billId, setBillId] = useState(null); + + const handleOpenChange = (open: boolean) => { + if (open) { + form.resetFields(); + setBillId(null); + Apis.Renovation.RenovationApplies.Bills({ + id: props?.item?.id, + }).then((res: any) => { + const bills = res?.data || []; + const depositBill = bills.find( + (b: any) => b.type === 'RenovationDeposit', + ); + if (depositBill?.id) { + setBillId(depositBill.id); + form.setFieldsValue({ + refund_amount: depositBill?.amount, + }); + } + }); + } + }; + + return ( + + {...MyModalFormProps.props} + title={`装修押金退款`} + labelCol={{ span: 4 }} + wrapperCol={{ span: 20 }} + width="600px" + layout="horizontal" + trigger={ + + } + onOpenChange={handleOpenChange} + key={new Date().getTime()} + form={form} + onFinish={async (values) => { + if (!billId) { + message.error('未找到押金账单,无法退款'); + return false; + } + return Apis.Bill.BillRefunds.Store({ + ...values, + bill_id: billId, + }) + .then(() => { + props.reload?.(); + message.success('押金退款申请提交成功'); + return true; + }) + .catch(() => false); + }} + columns={[ + { + key: 'refund_amount', + title: '退款金额', + valueType: 'digit', + colProps: { span: 24 }, + fieldProps: { + style: { width: '100%' }, + addonAfter: '元', + }, + formItemProps: { ...rulesHelper.number }, + }, + { + key: 'refund_reason', + title: '退款原因', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + placeholder: '请详细描述退款原因', + rows: 4, + }, + }, + { + key: 'refund_notes', + title: '退款备注', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + placeholder: '请填写退款备注', + rows: 4, + }, + }, + MyFormItems.UploadImages({ + key: 'pay_certificate', + title: '退款凭证', + tooltip: '最多上传5张图片', + max: 5, + colProps: { span: 24 }, + formItemProps: { required: false }, + }), + ]} + /> + ); +} diff --git a/src/pages/quality/renovation/renovation_inspection_rules/modals/Create.tsx b/src/pages/quality/renovation/modals/InspectionRuleCreate.tsx similarity index 100% rename from src/pages/quality/renovation/renovation_inspection_rules/modals/Create.tsx rename to src/pages/quality/renovation/modals/InspectionRuleCreate.tsx diff --git a/src/pages/quality/renovation/renovation_inspection_rules/modals/Update.tsx b/src/pages/quality/renovation/modals/InspectionRuleUpdate.tsx similarity index 100% rename from src/pages/quality/renovation/renovation_inspection_rules/modals/Update.tsx rename to src/pages/quality/renovation/modals/InspectionRuleUpdate.tsx diff --git a/src/pages/quality/renovation/renovation_workers/modals/Create.tsx b/src/pages/quality/renovation/modals/WorkersCreate.tsx similarity index 100% rename from src/pages/quality/renovation/renovation_workers/modals/Create.tsx rename to src/pages/quality/renovation/modals/WorkersCreate.tsx diff --git a/src/pages/quality/renovation/renovation_workers/modals/Update.tsx b/src/pages/quality/renovation/modals/WorkersUpdate.tsx similarity index 100% rename from src/pages/quality/renovation/renovation_workers/modals/Update.tsx rename to src/pages/quality/renovation/modals/WorkersUpdate.tsx diff --git a/src/pages/quality/renovation/application/pages/create.tsx b/src/pages/quality/renovation/pages/create.tsx similarity index 100% rename from src/pages/quality/renovation/application/pages/create.tsx rename to src/pages/quality/renovation/pages/create.tsx diff --git a/src/pages/quality/renovation/audit/pages/review.tsx b/src/pages/quality/renovation/pages/review.tsx similarity index 99% rename from src/pages/quality/renovation/audit/pages/review.tsx rename to src/pages/quality/renovation/pages/review.tsx index 420ed9d..25a2d9b 100644 --- a/src/pages/quality/renovation/audit/pages/review.tsx +++ b/src/pages/quality/renovation/pages/review.tsx @@ -15,7 +15,7 @@ import { BetaSchemaForm, ProCard } from '@ant-design/pro-components'; import { useNavigate, useSearchParams } from '@umijs/max'; import { Form, Space } from 'antd'; import { useEffect, useState } from 'react'; -import Review from '../modals/Review'; +import Review from '../modals/AuditReview'; export default function Index({ title = '装修申请审核' }) { const [form] = Form.useForm(); const navigate = useNavigate(); diff --git a/src/pages/quality/renovation/application/pages/show.tsx b/src/pages/quality/renovation/pages/show.tsx similarity index 100% rename from src/pages/quality/renovation/application/pages/show.tsx rename to src/pages/quality/renovation/pages/show.tsx diff --git a/src/pages/quality/renovation/application/pages/update.tsx b/src/pages/quality/renovation/pages/update.tsx similarity index 100% rename from src/pages/quality/renovation/application/pages/update.tsx rename to src/pages/quality/renovation/pages/update.tsx diff --git a/src/pages/quality/renovation/renovation_workers/index.tsx b/src/pages/quality/renovation/workers/index.tsx similarity index 96% rename from src/pages/quality/renovation/renovation_workers/index.tsx rename to src/pages/quality/renovation/workers/index.tsx index 9e47f10..2bc34c1 100644 --- a/src/pages/quality/renovation/renovation_workers/index.tsx +++ b/src/pages/quality/renovation/workers/index.tsx @@ -8,8 +8,8 @@ import { Apis } from '@/gen/Apis'; import { HouseOccupantsCardTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Image, Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; +import Create from '../modals/WorkersCreate'; +import Update from '../modals/WorkersUpdate'; export default function Index(props: MyBetaModalFormProps) { return ( diff --git a/src/pages/quality/marketing/survey/components/QuestionCategoriesList.tsx b/src/pages/quality/survey/components/QuestionCategoriesList.tsx similarity index 100% rename from src/pages/quality/marketing/survey/components/QuestionCategoriesList.tsx rename to src/pages/quality/survey/components/QuestionCategoriesList.tsx diff --git a/src/pages/quality/marketing/survey/components/QuestionsList.tsx b/src/pages/quality/survey/components/QuestionsList.tsx similarity index 100% rename from src/pages/quality/marketing/survey/components/QuestionsList.tsx rename to src/pages/quality/survey/components/QuestionsList.tsx diff --git a/src/pages/quality/survey/components/SurveyReleasesList.tsx b/src/pages/quality/survey/components/SurveyReleasesList.tsx new file mode 100644 index 0000000..6e48742 --- /dev/null +++ b/src/pages/quality/survey/components/SurveyReleasesList.tsx @@ -0,0 +1,122 @@ +import { + MyButtons, + MyColumns, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { SurveyReleasesTypeEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import QuestionCategoriesManage from '../modals/QuestionCategoriesManage'; +import QuestionsManage from '../modals/QuestionsManage'; +import Create from '../modals/SurveyReleasesCreate'; +import Update from '../modals/SurveyReleasesUpdate'; +import SurveyResponsesByRelease from '../modals/SurveyResponsesByRelease'; +import SurveysListShow from '../modals/SurveysListShow'; +import SurveysManage from '../modals/SurveysManage'; + +export default function SurveyReleasesList({ title = '问卷发布列表' }) { + return ( + + MyProTableProps.request(params, sort, Apis.Survey.SurveyReleases.List) + } + toolBarRender={(action) => [ + , + questionCategories: ( + + ), + questions: , + surveys: , + }} + />, + ]} + columns={[ + MyColumns.ID({ + search: false, + }), + { + title: '问卷ID', + hidden: true, + dataIndex: 'surveys_id', + }, + MyColumns.EnumTag({ + title: '方式', + dataIndex: 'release_type', + valueEnum: SurveyReleasesTypeEnum, + }), + MyColumns.Boolean({ + title: '是否发布', + dataIndex: 'status', + }), + { + dataIndex: ['survey', 'name'], + title: '发布的问卷', + search: false, + render: (_, item: any) => ( + {item?.survey?.name}
} + /> + ), + }, + { + title: '开始时间', + dataIndex: 'start_date', + search: false, + //日期 + valueType: 'date', + }, + { + title: '结束时间', + dataIndex: 'end_date', + valueType: 'date', + search: false, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, _index, action) => ( + + Apis.Survey.SurveyReleases.Publish({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + update: ( + + ), + delete: ( + + Apis.Survey.SurveyReleases.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + ), + viewResponses: , + }} + maxVisible={3} + /> + ), + }), + ]} + /> + ); +} diff --git a/src/pages/quality/marketing/survey/components/SurveyResponsesList.tsx b/src/pages/quality/survey/components/SurveyResponsesList.tsx similarity index 77% rename from src/pages/quality/marketing/survey/components/SurveyResponsesList.tsx rename to src/pages/quality/survey/components/SurveyResponsesList.tsx index 30656cc..1b2d082 100644 --- a/src/pages/quality/marketing/survey/components/SurveyResponsesList.tsx +++ b/src/pages/quality/survey/components/SurveyResponsesList.tsx @@ -2,13 +2,26 @@ import { MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import MyShow from '../modals/SurveyResponsesShow'; -export default function SurveyResponsesList({ title = '客户提交问卷' }) { + +interface SurveyResponsesListProps { + title?: string; + releaseId?: number; +} + +export default function SurveyResponsesList({ + title = '客户提交问卷', + releaseId, +}: SurveyResponsesListProps) { return ( - MyProTableProps.request(params, sort, Apis.Survey.SurveyResponses.List) + MyProTableProps.request( + { ...params, ...(releaseId ? { release_id: releaseId } : {}) }, + sort, + Apis.Survey.SurveyResponses.List, + ) } columns={[ // MyColumns.ID({ diff --git a/src/pages/quality/marketing/survey/components/SurveysList.tsx b/src/pages/quality/survey/components/SurveysList.tsx similarity index 100% rename from src/pages/quality/marketing/survey/components/SurveysList.tsx rename to src/pages/quality/survey/components/SurveysList.tsx diff --git a/src/pages/quality/survey/index.tsx b/src/pages/quality/survey/index.tsx new file mode 100644 index 0000000..c9fb323 --- /dev/null +++ b/src/pages/quality/survey/index.tsx @@ -0,0 +1,15 @@ +import { MyPageContainer } from '@/common'; +import SurveyReleasesList from './components/SurveyReleasesList'; + +export default function Index({ title = '问卷发布' }) { + return ( + + + + ); +} diff --git a/src/pages/quality/marketing/survey/modals/QuestionCategoriesCreate.tsx b/src/pages/quality/survey/modals/QuestionCategoriesCreate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/QuestionCategoriesCreate.tsx rename to src/pages/quality/survey/modals/QuestionCategoriesCreate.tsx diff --git a/src/pages/quality/survey/modals/QuestionCategoriesManage.tsx b/src/pages/quality/survey/modals/QuestionCategoriesManage.tsx new file mode 100644 index 0000000..fe1270f --- /dev/null +++ b/src/pages/quality/survey/modals/QuestionCategoriesManage.tsx @@ -0,0 +1,31 @@ +import { MyButtons } from '@/common'; +import { Modal } from 'antd'; +import { useState } from 'react'; +import QuestionCategoriesList from '../components/QuestionCategoriesList'; + +export default function QuestionCategoriesManage() { + const [open, setOpen] = useState(false); + + return ( + <> + setOpen(true)} + /> + setOpen(false)} + footer={null} + width="85%" + style={{ top: 20 }} + destroyOnClose + > +
+ +
+
+ + ); +} diff --git a/src/pages/quality/marketing/survey/modals/QuestionCategoriesUpdate.tsx b/src/pages/quality/survey/modals/QuestionCategoriesUpdate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/QuestionCategoriesUpdate.tsx rename to src/pages/quality/survey/modals/QuestionCategoriesUpdate.tsx diff --git a/src/pages/quality/marketing/survey/modals/QuestionsCreate.tsx b/src/pages/quality/survey/modals/QuestionsCreate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/QuestionsCreate.tsx rename to src/pages/quality/survey/modals/QuestionsCreate.tsx diff --git a/src/pages/quality/survey/modals/QuestionsManage.tsx b/src/pages/quality/survey/modals/QuestionsManage.tsx new file mode 100644 index 0000000..c7bbddb --- /dev/null +++ b/src/pages/quality/survey/modals/QuestionsManage.tsx @@ -0,0 +1,31 @@ +import { MyButtons } from '@/common'; +import { Modal } from 'antd'; +import { useState } from 'react'; +import QuestionsList from '../components/QuestionsList'; + +export default function QuestionsManage() { + const [open, setOpen] = useState(false); + + return ( + <> + setOpen(true)} + /> + setOpen(false)} + footer={null} + width="90%" + style={{ top: 20 }} + destroyOnClose + > +
+ +
+
+ + ); +} diff --git a/src/pages/quality/marketing/survey/modals/QuestionsUpdate.tsx b/src/pages/quality/survey/modals/QuestionsUpdate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/QuestionsUpdate.tsx rename to src/pages/quality/survey/modals/QuestionsUpdate.tsx diff --git a/src/pages/quality/marketing/survey/modals/SurveyReleasesCreate.tsx b/src/pages/quality/survey/modals/SurveyReleasesCreate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/SurveyReleasesCreate.tsx rename to src/pages/quality/survey/modals/SurveyReleasesCreate.tsx diff --git a/src/pages/quality/marketing/survey/modals/SurveyReleasesUpdate.tsx b/src/pages/quality/survey/modals/SurveyReleasesUpdate.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/SurveyReleasesUpdate.tsx rename to src/pages/quality/survey/modals/SurveyReleasesUpdate.tsx diff --git a/src/pages/quality/survey/modals/SurveyResponsesByRelease.tsx b/src/pages/quality/survey/modals/SurveyResponsesByRelease.tsx new file mode 100644 index 0000000..42c1ba8 --- /dev/null +++ b/src/pages/quality/survey/modals/SurveyResponsesByRelease.tsx @@ -0,0 +1,36 @@ +import { MyButtons } from '@/common'; +import { Modal } from 'antd'; +import { useState } from 'react'; +import SurveyResponsesList from '../components/SurveyResponsesList'; + +interface Props { + releaseId: number; +} + +export default function SurveyResponsesByRelease({ releaseId }: Props) { + const [open, setOpen] = useState(false); + + return ( + <> + setOpen(true)} + /> + setOpen(false)} + footer={null} + width="90%" + style={{ top: 20 }} + destroyOnClose + > +
+ +
+
+ + ); +} diff --git a/src/pages/quality/marketing/survey/modals/SurveyResponsesShow.tsx b/src/pages/quality/survey/modals/SurveyResponsesShow.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/SurveyResponsesShow.tsx rename to src/pages/quality/survey/modals/SurveyResponsesShow.tsx diff --git a/src/pages/quality/marketing/survey/modals/SurveysListShow.tsx b/src/pages/quality/survey/modals/SurveysListShow.tsx similarity index 99% rename from src/pages/quality/marketing/survey/modals/SurveysListShow.tsx rename to src/pages/quality/survey/modals/SurveysListShow.tsx index 43f4826..08df7e5 100644 --- a/src/pages/quality/marketing/survey/modals/SurveysListShow.tsx +++ b/src/pages/quality/survey/modals/SurveysListShow.tsx @@ -15,6 +15,7 @@ export default function SurveysListShow(props: MyBetaModalFormProps) { title={props.title || '查看问卷'} type={props.item?.type || 'primary'} width="800px" + trigger={props?.trigger} onOpen={() => { if (props?.item?.id) { setLoading(true); diff --git a/src/pages/quality/survey/modals/SurveysManage.tsx b/src/pages/quality/survey/modals/SurveysManage.tsx new file mode 100644 index 0000000..7c4949e --- /dev/null +++ b/src/pages/quality/survey/modals/SurveysManage.tsx @@ -0,0 +1,31 @@ +import { MyButtons } from '@/common'; +import { Modal } from 'antd'; +import { useState } from 'react'; +import SurveysList from '../components/SurveysList'; + +export default function SurveysManage() { + const [open, setOpen] = useState(false); + + return ( + <> + setOpen(true)} + /> + setOpen(false)} + footer={null} + width="90%" + style={{ top: 20 }} + destroyOnClose + > +
+ +
+
+ + ); +} diff --git a/src/pages/quality/marketing/survey/modals/SurveysSelectList.tsx b/src/pages/quality/survey/modals/SurveysSelectList.tsx similarity index 100% rename from src/pages/quality/marketing/survey/modals/SurveysSelectList.tsx rename to src/pages/quality/survey/modals/SurveysSelectList.tsx diff --git a/src/pages/quality/marketing/survey/pages/create_surveys.tsx b/src/pages/quality/survey/pages/create_surveys.tsx similarity index 100% rename from src/pages/quality/marketing/survey/pages/create_surveys.tsx rename to src/pages/quality/survey/pages/create_surveys.tsx diff --git a/src/pages/quality/marketing/survey/pages/update_surveys.tsx b/src/pages/quality/survey/pages/update_surveys.tsx similarity index 100% rename from src/pages/quality/marketing/survey/pages/update_surveys.tsx rename to src/pages/quality/survey/pages/update_surveys.tsx diff --git a/src/pages/supplier/internal/index.tsx b/src/pages/supplier/internal/index.tsx index 98ae850..0e43e4c 100644 --- a/src/pages/supplier/internal/index.tsx +++ b/src/pages/supplier/internal/index.tsx @@ -3,11 +3,12 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { CompanySuppliersCounterpartyEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; @@ -33,7 +34,14 @@ export default function Index({ title = '企业信息' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -51,25 +59,26 @@ export default function Index({ title = '企业信息' }) { render: (_, item: any) => { return `${item.province} ${item.city || ''} `; }, - // render: (_, item: any) => { - // return `${item.province} ${item.city || ''} ${item.area || ''} ${ - // item.street || '' - // }${item.address || ''}`; - // }, }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.CompanySupplier.CompanySuppliers.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + render: (_, item: any, __, action) => ( + + ), + delete: ( + + Apis.CompanySupplier.CompanySuppliers.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/supplier/outside/index.tsx b/src/pages/supplier/outside/index.tsx index f989bc5..22ca930 100644 --- a/src/pages/supplier/outside/index.tsx +++ b/src/pages/supplier/outside/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { @@ -12,7 +14,6 @@ import { } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; -import { Space } from 'antd'; import dayjs from 'dayjs'; import AddBlack from './modals/AddBlack'; import AddGrade from './modals/AddGrade'; @@ -42,37 +43,33 @@ export default function Index({ title = '供应商' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ - // MyColumns.ID({ search: false }), { title: '供应商名称', dataIndex: 'name', }, - MyColumns.EnumTag({ - title: '类型', - dataIndex: 'supplier_type', - valueEnum: CompanySuppliersSupplierTypeEnum, - }), - // MyColumns.EnumTag({ - // title: '证件类型', - // dataIndex: 'certificate_type', - // valueEnum: CompanySuppliersCertificateTypeEnum, - // search: false, - // }), + { title: '所在城市', search: false, render: (_, item: any) => { return `${item.city || ''} `; }, - // render: (_, item: any) => { - // return `${item.province} ${item.city || ''} ${item.area || ''} ${ - // item.street || '' - // }${item.address || ''}`; - // }, }, + MyColumns.EnumTag({ + title: '类型', + dataIndex: 'supplier_type', + valueEnum: CompanySuppliersSupplierTypeEnum, + }), MyColumns.EnumTag({ title: '等级', dataIndex: 'grade', @@ -87,51 +84,68 @@ export default function Index({ title = '供应商' }) { }, search: false, }, - //是否黑名单 MyColumns.Boolean({ dataIndex: 'is_blacklisted', title: '是否拉黑', }), - MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - navigate(`/supplier/outside/show/${item.id}`); - }} - /> - - - {!item.is_blacklisted && ( - - )} - {item.is_blacklisted === 1 && ( - - Apis.CompanySupplier.CompanySuppliers.Update({ - id: item.id ?? 0, - is_blacklisted: false, - counterparty: item.counterparty ?? 0, - supplier_type: item.supplier_type ?? 0, - name: item.name ?? '', - reason: '', - }).then(() => action?.reload()) - } - /> - )} - - Apis.CompanySupplier.CompanySuppliers.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + render: (_, item: any, __, action) => ( + { + navigate(`/supplier/outside/show/${item.id}`); + }} + /> + ), + update: ( + + ), + grade: ( + + ), + black: ( + + ), + whitelist: + item.is_blacklisted === 1 ? ( + + Apis.CompanySupplier.CompanySuppliers.Update({ + id: item.id ?? 0, + is_blacklisted: false, + counterparty: item.counterparty ?? 0, + supplier_type: item.supplier_type ?? 0, + name: item.name ?? '', + reason: '', + }).then(() => action?.reload()) + } + /> + ) : null, + delete: ( + + Apis.CompanySupplier.CompanySuppliers.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/supplier/outside/modals/AddBlack.tsx b/src/pages/supplier/outside/modals/AddBlack.tsx index 25bce0e..7d6edaa 100644 --- a/src/pages/supplier/outside/modals/AddBlack.tsx +++ b/src/pages/supplier/outside/modals/AddBlack.tsx @@ -14,7 +14,12 @@ export default function Update(props: MyBetaModalFormProps) { {...MyModalFormProps.props} title={`黑名单`} - trigger={} + trigger={ + + } layout="horizontal" labelCol={{ span: 5 }} wrapperCol={{ span: 19 }} diff --git a/src/pages/system/admins/index copy.tsx b/src/pages/system/admins/index copy.tsx deleted file mode 100644 index 4612e57..0000000 --- a/src/pages/system/admins/index copy.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, - renderTextHelper, - usePageTabs, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; - -export default function Index({ title = '管理员' }) { - // 注册当前页面为标签页 - usePageTabs({ - tabKey: 'system-admins', - tabLabel: title, - }); - - return ( - - - MyProTableProps.request(params, sort, Apis.Common.Admins.List) - } - headerTitle={title} - toolBarRender={(action) => [ - , - ]} - options={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '账号', - dataIndex: 'username', - }, - { - title: '角色', - dataIndex: 'roles', - renderText: renderTextHelper.TagList, - hideInSearch: true, - }, - MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Common.Admins.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - - ); -} diff --git a/src/pages/system/admins/index.tsx b/src/pages/system/admins/index.tsx deleted file mode 100644 index 4ad12c8..0000000 --- a/src/pages/system/admins/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { - MyButtons, - MyColumns, - MyProTableProps, - renderTextHelper, - usePageTabs, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; - -export default function Index({ title = '管理员' }) { - // 注册当前页面为标签页 - usePageTabs({ - tabKey: 'system-admins', - tabLabel: title, - }); - - return ( - - MyProTableProps.request(params, sort, Apis.Common.Admins.List) - } - toolBarRender={(action) => [ - , - ]} - options={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '账号', - dataIndex: 'username', - }, - { - title: '角色', - dataIndex: 'roles', - renderText: renderTextHelper.TagList, - hideInSearch: true, - }, - MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Common.Admins.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/system/admins/modals/Create.tsx b/src/pages/system/admins/modals/Create.tsx deleted file mode 100644 index 97ee470..0000000 --- a/src/pages/system/admins/modals/Create.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - return ( - - {...MyModalFormProps.props} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - width="500px" - trigger={} - onFinish={async (values) => - Apis.Common.Admins.Store(values) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'username', - title: '用户名', - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'password', - title: '密码', - valueType: 'password', - formItemProps: { ...rulesHelper.text }, - }, - SysSelects.SysRoles(), - ]} - /> - ); -} diff --git a/src/pages/system/admins/modals/Update.tsx b/src/pages/system/admins/modals/Update.tsx deleted file mode 100644 index c4d4e93..0000000 --- a/src/pages/system/admins/modals/Update.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`编辑${props.title}`} - trigger={} - wrapperCol={{ span: 24 }} - width="500px" - form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue({ - ...props.item, - roles_id: props.item?.roles?.map((item: any) => item.value), - }); - } - }} - onFinish={async (values) => - Apis.Common.Admins.Update({ ...values, id: props.item?.id ?? 0 }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'username', - title: '用户名', - readonly: true, - }, - { - key: 'password', - title: '密码', - valueType: 'password', - }, - SysSelects.SysRoles(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_permissions/index.tsx b/src/pages/system/sys_permissions/index.tsx deleted file mode 100644 index 656ea96..0000000 --- a/src/pages/system/sys_permissions/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { MyPageContainer, MyProTableProps } from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ActionType, ProTable } from '@ant-design/pro-components'; -import { useEffect, useRef, useState } from 'react'; - -export default function Index({ title = '功能' }) { - const [data, setData] = useState([]); - const [loading, setLoading] = useState(false); - const actionRef = useRef(); - const [guardName] = useState('Admin'); - - const getData = async () => { - let data = await Apis.Permission.Roles.PermissionTree(); - setLoading(true); - setData(data.data); - }; - - useEffect(() => { - getData(); - }, [guardName]); - - const ShowTable = () => { - return ( - { - return `${record.id}_${record?.name}`; - }, - }, - // { title: '前端表示', dataIndex: 'key' }, - ]} - /> - ); - }; - - return ( - - {loading ? : null} - - ); -} diff --git a/src/pages/system/sys_permissions/modals/Create.tsx b/src/pages/system/sys_permissions/modals/Create.tsx deleted file mode 100644 index b0af9c2..0000000 --- a/src/pages/system/sys_permissions/modals/Create.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { SysPermissionsTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { ButtonProps, Form, message } from 'antd'; - -export default function Create( - props: { - buttonProps?: ButtonProps; - guardName: string; - item?: any; - } & MyBetaModalFormProps, -) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`添加${props.title}`} - layout="horizontal" - labelCol={{ span: 4 }} - wrapperCol={{ span: 20 }} - labelAlign="left" - width="600px" - trigger={ - - } - // 确保正确弹窗,使用动态的时间参数 - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - // 如果有传入的item,设置为上级菜单 - if (props.item?.id) { - form.setFieldsValue({ - parent_id: props.item.id, - }); - } - } - }} - onFinish={async (values) => { - return Apis.Permission.SysPermissions.Store({ - ...values, - guard_name: props.guardName, - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false); - }} - columns={[ - SysSelects.SysPermissionsTree({ guard_name: props.guardName }), - { - key: 'name', - title: '标题', - required: true, - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'key', - title: '标识(en)', - }, - MyFormItems.IconSelect(), - MyFormItems.EnumRadio({ - key: 'type', - title: '类型', - valueEnum: SysPermissionsTypeEnum, - required: true, - }), - { key: 'path', title: '路由' }, - SysSelects.Api(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_permissions/modals/Update.tsx b/src/pages/system/sys_permissions/modals/Update.tsx deleted file mode 100644 index 5512655..0000000 --- a/src/pages/system/sys_permissions/modals/Update.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyFormItems, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { SysPermissionsTypeEnum } from '@/gen/Enums'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update( - props: { guardName: string } & MyBetaModalFormProps, -) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - title={`编辑${props.title}`} - layout="horizontal" - labelCol={{ span: 4 }} - wrapperCol={{ span: 20 }} - labelAlign="left" - width="600px" - key={new Date().getTime()} - form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue(props.item); - } - }} - onFinish={async (values) => { - return Apis.Permission.SysPermissions.Update({ - ...values, - guard_name: props.guardName, - id: props.item?.id, - icon: values.icon || '', - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false); - }} - trigger={} - columns={[ - SysSelects.SysPermissionsTree({ guard_name: props.guardName }), - { - key: 'name', - title: '标题', - required: true, - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'key', - title: '标识(en)', - }, - MyFormItems.IconSelect(), - MyFormItems.EnumRadio({ - key: 'type', - title: '类型', - valueEnum: SysPermissionsTypeEnum, - required: true, - }), - { key: 'path', title: '路由' }, - SysSelects.Api(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/components/AdminRole/index.tsx b/src/pages/system/sys_roles/components/AdminRole/index.tsx index 06101dc..b3650b4 100644 --- a/src/pages/system/sys_roles/components/AdminRole/index.tsx +++ b/src/pages/system/sys_roles/components/AdminRole/index.tsx @@ -1,229 +1,14 @@ -import { MyButtons, MyProTableProps, useCurrentPermissions } from '@/common'; -import { flattenToMultiLevelFormatWithRowSpanAdvancedNew } from '@/common/utils/flattenIterative'; import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; -import { Checkbox, message, Space, Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import Create from '../../modals/Create'; -interface SelectedBuilding { - id: number; - name: string; -} -export default function Index({ title = '角色' }) { - const getCurrentPermissions = useCurrentPermissions(); - const [selectedBuilding, setSelectedBuilding] = - useState(null); - const [selectedPermissionsIds, setSelectedPermissionsIds] = useState( - [], - ); - const [dataSource, setDataSource] = useState([]); - const [dataTabsSource, setDataTabsSource] = useState([]); - const [tabsKey, setTabsKey] = useState(''); - const getSysPermissions = () => { - Apis.Permission.Roles.PermissionTree().then((res) => { - setDataSource( - flattenToMultiLevelFormatWithRowSpanAdvancedNew( - res?.data[0]?.children || [], - ), - ); - console.log(res, 'res'); - }); - }; - - const onSave = () => { - if (selectedPermissionsIds?.length && selectedBuilding?.id) { - Apis.Permission.Roles.SetPermissions({ - permissions_ids: selectedPermissionsIds, - id: selectedBuilding?.id || 0, - }).then(() => { - message.success('保存成功'); - }); - } else { - message.error('请选择角色和勾选权限!'); - } - }; - - const getPermissions = (id: any) => { - setTabsKey(id); - // 更新选中的角色信息 - const selectedRole = dataTabsSource.find((item: any) => item.id === id); - if (selectedRole) { - setSelectedBuilding({ - id: selectedRole.id, - name: selectedRole.name, - }); - } - Apis.Permission.Roles.GetPermissions({ - id: id ?? 0, - }).then((res) => { - setSelectedPermissionsIds(res?.data?.permissions_ids || []); - }); - }; - - const getSysRoles = () => { - Apis.Permission.Roles.List({ guard_name: 'Company' }).then((res) => { - setDataTabsSource(res?.data || []); - if (res?.data?.length) { - const firstRole = res?.data[0]; - getPermissions(firstRole?.id || 0); - // 初始化选中第一个角色 - setSelectedBuilding({ - id: firstRole?.id, - name: firstRole?.name, - }); - } - console.log(res, 'res'); - }); - }; - - const onSelect = () => { - //删除角色 - Apis.Permission.Roles.Delete({ - id: tabsKey, - }).then(() => { - getSysRoles(); - message.success('删除成功'); - }); - }; - - useEffect(() => { - getSysRoles(); - getSysPermissions(); - }, []); - - let toolBarRender = () => { - return getCurrentPermissions({ - add: getSysRoles()} title={title} />, - delete: ( - onSelect()} - // 如果当前选中角色是管理员,则禁用删除按钮 - disabled={selectedBuilding?.name === '管理员'} - /> - ), - save: ( - onSave()} - /> - ), - }); - }; +import RoleTable from '../RoleTable'; +export default function Index() { return ( - {toolBarRender()}} - headerBordered - > -
-
- ({ - label: item?.name, - key: item?.id, - }))} - activeKey={tabsKey} - onChange={(key: any) => { - getPermissions(key); - console.log(key, 'key'); - }} - /> -
- -
- { - setSelectedPermissionsIds(e); - console.log(e, 'e'); - }} - > - ( - // { - // setGuardName(e as string); - // }} - // value={guardName} - // /> - // )} - style={{ - width: '100%', - maxHeight: 'calc(100vh - 280px)', // 设置最大高度,可根据实际需求调整 - overflowY: 'auto', // 启用垂直滚动 - }} - dataSource={dataSource} - options={false} - size="small" - columns={[ - { - title: '目录', - dataIndex: 'name', - key: 'name', - width: '120px', - render: (_, item: any) => { - return {item?.name}; - }, - onCell: (res, index?: number) => { - const rowSpan = res.row_spans?.rowSpan; - const firstIndex = res.row_spans?.firstIndex; - if (index === firstIndex && rowSpan > 0) { - return { rowSpan }; - } - return { rowSpan: 0 }; - }, - }, - { - title: '页面', - dataIndex: 'name2', - key: 'name2', - width: '160px', - render: (_, item: any) => { - return item?.name2 ? ( - {item?.name2} - ) : null; - }, - }, - { - title: '页签/按钮', - width: '800px', - render: (_, item: any) => { - if (item?.buttonList?.length) { - return item?.buttonList?.map( - (res: any, index: number) => { - return res?.name ? ( - - {res?.name} - - ) : null; - }, - ); - } - }, - }, - ]} - /> - -
-
-
+ + Apis.Permission.Roles.List({ ...data, guard_name: 'Company' }) + } + /> ); } diff --git a/src/pages/system/sys_roles/components/AdminsList/index.tsx b/src/pages/system/sys_roles/components/AdminsList/index.tsx deleted file mode 100644 index 34ae0ab..0000000 --- a/src/pages/system/sys_roles/components/AdminsList/index.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyColumns, - MyProTableProps, - renderTextHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProTable } from '@ant-design/pro-components'; -import { Space } from 'antd'; -import Create from './modals/Create'; -import Update from './modals/Update'; - -export default function Index(props: MyBetaModalFormProps) { - return ( - - MyProTableProps.request(params, sort, Apis.Common.Admins.List) - } - toolBarRender={(action) => [ - , - ]} - options={false} - columns={[ - MyColumns.ID({ - search: false, - }), - { - title: '账号', - dataIndex: 'username', - }, - { - title: '角色', - dataIndex: 'roles', - renderText: renderTextHelper.TagList, - hideInSearch: true, - }, - MyColumns.UpdatedAt(), - MyColumns.CreatedAt(), - MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - Apis.Common.Admins.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> - - ), - }), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/components/AdminsList/modals/Create.tsx b/src/pages/system/sys_roles/components/AdminsList/modals/Create.tsx deleted file mode 100644 index 701eb12..0000000 --- a/src/pages/system/sys_roles/components/AdminsList/modals/Create.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - width="500px" - form={form} - trigger={} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue({ - roles_id: [props?.item?.id], - }); - } - }} - onFinish={async (values) => - Apis.Common.Admins.Store(values) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'username', - title: '用户名', - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'password', - title: '密码', - valueType: 'password', - formItemProps: { ...rulesHelper.text }, - }, - SysSelects.SysRoles(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/components/AdminsList/modals/Update.tsx b/src/pages/system/sys_roles/components/AdminsList/modals/Update.tsx deleted file mode 100644 index c4d4e93..0000000 --- a/src/pages/system/sys_roles/components/AdminsList/modals/Update.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common'; -import { SysSelects } from '@/components/SysSelects'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - return ( - - {...MyModalFormProps.props} - title={`编辑${props.title}`} - trigger={} - wrapperCol={{ span: 24 }} - width="500px" - form={form} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue({ - ...props.item, - roles_id: props.item?.roles?.map((item: any) => item.value), - }); - } - }} - onFinish={async (values) => - Apis.Common.Admins.Update({ ...values, id: props.item?.id ?? 0 }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'username', - title: '用户名', - readonly: true, - }, - { - key: 'password', - title: '密码', - valueType: 'password', - }, - SysSelects.SysRoles(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/components/EditPermissions/index.tsx b/src/pages/system/sys_roles/components/EditPermissions/index.tsx deleted file mode 100644 index 1a4f735..0000000 --- a/src/pages/system/sys_roles/components/EditPermissions/index.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - MyTreeCheckable, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; -import { useEffect } from 'react'; -export default function EditPermissions(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - useEffect(() => { - if (props?.item?.id) { - Apis.Permission.SysRoles.GetPermissions({ - id: props?.item?.id ?? 0, - }).then((res) => { - form.setFieldsValue({ - id: props?.item?.id, - permissions_ids: res.data?.permissions_ids, - }); - }); - } - }, [props?.item?.id]); - - const onSave = () => { - let ids = form.getFieldValue('permissions_ids'); - console.log(ids); - if (ids?.length && props.item?.id) { - Apis.Permission.SysRoles.SetPermissions({ - permissions_ids: ids, - id: props.item?.id || 0, - }).then(() => { - message.success('保存成功'); - }); - } else { - message.error('请选择角色和勾选权限!'); - } - }; - - return ( - <> -
- - {...MyModalFormProps.props} - title={props.title} - wrapperCol={{ span: 24 }} - width="600px" - layoutType="Form" - form={form} - submitter={false} - trigger={} - onFinish={async (values) => { - return Apis.Permission.SysRoles.SetPermissions({ - ...values, - id: props.item?.id ?? 0, - }) - .then(() => { - props.reload?.(); - message.success('保存成功!'); - return true; - }) - .catch(() => false); - }} - columns={[ - { - key: 'permissions_ids', - title: '选择权限', - ...rulesHelper.array, - renderFormItem: () => ( - - ), - }, - ]} - /> - onSave()} - /> -
- - ); -} diff --git a/src/pages/system/sys_roles/components/EmployeeRole/index.tsx b/src/pages/system/sys_roles/components/EmployeeRole/index.tsx index 7c08a6b..537b41c 100644 --- a/src/pages/system/sys_roles/components/EmployeeRole/index.tsx +++ b/src/pages/system/sys_roles/components/EmployeeRole/index.tsx @@ -1,227 +1,11 @@ -import { MyButtons, MyProTableProps, useCurrentPermissions } from '@/common'; -import { flattenToMultiLevelFormatWithRowSpanAdvancedNew } from '@/common/utils/flattenIterative'; import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; -import { Checkbox, message, Space, Tabs } from 'antd'; -import { useEffect, useState } from 'react'; -import Create from './modals/Create'; -interface SelectedBuilding { - id: number; - name: string; -} -export default function Index({ title = '角色' }) { - const getCurrentPermissions = useCurrentPermissions(); - const [selectedBuilding, setSelectedBuilding] = - useState(null); - const [selectedPermissionsIds, setSelectedPermissionsIds] = useState( - [], - ); - const [dataSource, setDataSource] = useState([]); - const [dataTabsSource, setDataTabsSource] = useState([]); - const [tabsKey, setTabsKey] = useState(''); - const getSysPermissions = () => { - Apis.Company.EmployeeRoles.PermissionTree().then((res) => { - setDataSource( - flattenToMultiLevelFormatWithRowSpanAdvancedNew( - res?.data[0]?.children || [], - ), - ); - console.log(res, 'res'); - }); - }; - - const onSave = () => { - if (selectedPermissionsIds?.length && selectedBuilding?.id) { - Apis.Company.EmployeeRoles.SetPermissions({ - permissions_ids: selectedPermissionsIds, - id: selectedBuilding?.id || 0, - }).then(() => { - message.success('保存成功'); - }); - } else { - message.error('请选择角色和勾选权限!'); - } - }; - - const getPermissions = (id: any) => { - setTabsKey(id); - // 更新选中的角色信息 - const selectedRole = dataTabsSource.find((item: any) => item.id === id); - if (selectedRole) { - setSelectedBuilding({ - id: selectedRole.id, - name: selectedRole.name, - }); - } - Apis.Company.EmployeeRoles.GetPermissions({ - id: id ?? 0, - }).then((res) => { - setSelectedPermissionsIds(res?.data?.permissions_ids || []); - }); - }; - - const getSysRoles = () => { - Apis.Company.EmployeeRoles.List().then((res) => { - setDataTabsSource(res?.data || []); - if (res?.data?.length) { - const firstRole = res?.data[0]; - getPermissions(firstRole?.id || 0); - // 初始化选中第一个角色 - setSelectedBuilding({ - id: firstRole?.id, - name: firstRole?.name, - }); - } - console.log(res, 'res'); - }); - }; - - const onSelect = () => { - //删除角色 - Apis.Company.EmployeeRoles.Delete({ - id: tabsKey, - }).then(() => { - getSysRoles(); - message.success('删除成功'); - }); - }; - - useEffect(() => { - getSysRoles(); - getSysPermissions(); - }, []); - - let toolBarRender = () => { - return getCurrentPermissions({ - add: getSysRoles()} title={title} />, - delete: ( - onSelect()} - /> - ), - save: ( - onSave()} - /> - ), - }); - }; +import RoleTable from '../RoleTable'; +export default function Index() { return ( - {toolBarRender()}} - > -
-
- ({ - label: item?.name, - key: item?.id, - }))} - activeKey={tabsKey} - onChange={(key: any) => { - getPermissions(key); - console.log(key, 'key'); - }} - /> -
- -
- { - setSelectedPermissionsIds(e); - console.log(e, 'e'); - }} - > - ( - // { - // setGuardName(e as string); - // }} - // value={guardName} - // /> - // )} - style={{ - width: '100%', - maxHeight: 'calc(100vh - 280px)', // 设置最大高度,可根据实际需求调整 - overflowY: 'auto', // 启用垂直滚动 - }} - dataSource={dataSource} - options={false} - size="small" - columns={[ - { - title: '目录', - dataIndex: 'name', - key: 'name', - width: '120px', - render: (_, item: any) => { - return {item?.name}; - }, - onCell: (res, index?: number) => { - const rowSpan = res.row_spans?.rowSpan; - const firstIndex = res.row_spans?.firstIndex; - if (index === firstIndex && rowSpan > 0) { - return { rowSpan }; - } - return { rowSpan: 0 }; - }, - }, - { - title: '页面', - dataIndex: 'name2', - key: 'name2', - width: '160px', - render: (_, item: any) => { - return item?.name2 ? ( - {item?.name2} - ) : null; - }, - }, - { - title: '页签/按钮', - width: '800px', - render: (_, item: any) => { - if (item?.buttonList?.length) { - return item?.buttonList?.map( - (res: any, index: number) => { - return res?.name ? ( - - {res?.name} - - ) : null; - }, - ); - } - }, - }, - ]} - /> - -
-
-
+ ); } diff --git a/src/pages/system/sys_roles/components/EmployeeRole/modals/Create.tsx b/src/pages/system/sys_roles/components/EmployeeRole/modals/Create.tsx deleted file mode 100644 index 04ed21c..0000000 --- a/src/pages/system/sys_roles/components/EmployeeRole/modals/Create.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - form={form} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - key={new Date().getTime()} - width="420px" - trigger={} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - } - }} - onFinish={async (values) => - Apis.Company.EmployeeRoles.Store(values) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '角色名称', - formItemProps: { ...rulesHelper.text }, - }, - // MyFormItems.ColorPicker(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/components/PermissionTree.tsx b/src/pages/system/sys_roles/components/PermissionTree.tsx new file mode 100644 index 0000000..085aa3e --- /dev/null +++ b/src/pages/system/sys_roles/components/PermissionTree.tsx @@ -0,0 +1,76 @@ +import { MyResponseType } from '@/common'; +import { Tree, TreeProps } from 'antd'; +import { DataNode } from 'antd/es/tree'; +import { Key, useEffect, useState } from 'react'; + +interface PermissionTreeProps + extends Omit { + api: () => Promise; + value?: Key[]; + onChange?: (value: Key[]) => void; +} + +export default function PermissionTree({ + api, + value, + onChange, + ...rest +}: PermissionTreeProps) { + const [treeData, setTreeData] = useState([]); + const [expandedKeys, setExpandedKeys] = useState([]); + + const processTree = (item: any): DataNode => { + return { + key: item.id, + title: item.name, + children: item.children?.map(processTree), + }; + }; + + const collectLeafKeys = (nodes: DataNode[]): Key[] => { + const keys: Key[] = []; + nodes.forEach((node) => { + if (!node.children || node.children.length === 0) { + keys.push(node.key); + } else { + keys.push(...collectLeafKeys(node.children)); + } + }); + return keys; + }; + + useEffect(() => { + api().then((res: any) => { + const data = res.data?.map(processTree) || []; + setTreeData(data); + setExpandedKeys(data.map((node: DataNode) => node.key)); + }); + }, [api]); + + const leafKeys = collectLeafKeys(treeData); + + const onCheck: TreeProps['onCheck'] = (_, info) => { + const ids: Key[] = []; + info.checkedNodes?.forEach((item: any) => { + if (!item.children || item.children.length === 0) { + ids.push(item.key); + } + }); + onChange?.(ids); + }; + + const checkedKeys = (value ?? []).filter((v) => leafKeys.includes(v)); + + return ( + setExpandedKeys(keys)} + checkedKeys={checkedKeys} + onCheck={onCheck} + {...rest} + /> + ); +} diff --git a/src/pages/system/sys_roles/components/RoleFormModal.tsx b/src/pages/system/sys_roles/components/RoleFormModal.tsx new file mode 100644 index 0000000..48e4224 --- /dev/null +++ b/src/pages/system/sys_roles/components/RoleFormModal.tsx @@ -0,0 +1,117 @@ +import { MyResponseType } from '@/common'; +import { Form, Input, Modal, message } from 'antd'; +import { useEffect, useState } from 'react'; +import PermissionTree from './PermissionTree'; + +interface RoleFormModalProps { + open: boolean; + onCancel: () => void; + onSuccess: () => void; + item?: Record; + title: string; + storeApi: (data: any) => Promise; + updateApi: (data: any) => Promise; + setPermissionsApi: (data: any) => Promise; + getPermissionsApi: (data: any) => Promise; + permissionTreeApi: () => Promise; +} + +export default function RoleFormModal({ + open, + onCancel, + onSuccess, + item, + title, + storeApi, + updateApi, + setPermissionsApi, + getPermissionsApi, + permissionTreeApi, +}: RoleFormModalProps) { + const [form] = Form.useForm(); + const [loading, setLoading] = useState(false); + const isEdit = !!item?.id; + + useEffect(() => { + if (!open) return; + + if (isEdit && item) { + form.setFieldsValue({ name: item.name }); + let cancelled = false; + getPermissionsApi({ id: item.id }).then((res: any) => { + if (cancelled) return; + const ids = res.data?.permissions_ids || []; + form.setFieldsValue({ permissions_ids: ids }); + }); + return () => { + cancelled = true; + }; + } + + form.resetFields(); + }, [open, item]); + + const extractId = (res: MyResponseType): number | undefined => { + const data = (res as any).data; + if (typeof data === 'number') return data; + if (data && typeof data === 'object') { + return data.id ?? data.data?.id; + } + return undefined; + }; + + const handleOk = async () => { + const values = await form.validateFields(); + setLoading(true); + try { + let roleId = item?.id; + if (!isEdit) { + const res = await storeApi({ name: values.name }); + roleId = extractId(res); + if (!roleId) { + throw new Error('创建角色失败,未返回角色ID'); + } + } else { + await updateApi({ id: roleId, name: values.name }); + } + + await setPermissionsApi({ + id: roleId, + permissions_ids: values.permissions_ids || [], + }); + + message.success('保存成功'); + onSuccess(); + } catch (err: any) { + message.error(err?.message || '保存失败'); + } finally { + setLoading(false); + } + }; + + return ( + +
+ + + + + + +
+
+ ); +} diff --git a/src/pages/system/sys_roles/components/RoleTable.tsx b/src/pages/system/sys_roles/components/RoleTable.tsx new file mode 100644 index 0000000..bfaca9d --- /dev/null +++ b/src/pages/system/sys_roles/components/RoleTable.tsx @@ -0,0 +1,125 @@ +import { + MyButtons, + MyColumns, + MyProTableProps, + MyResponseType, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { ActionType, ProTable } from '@ant-design/pro-components'; +import { message } from 'antd'; +import { useRef, useState } from 'react'; +import RoleFormModal from './RoleFormModal'; + +interface RoleApis { + List: (data?: any) => Promise; + Delete: (data: any) => Promise; + Store: (data: any) => Promise; + Update: (data: any) => Promise; + SetPermissions: (data: any) => Promise; + GetPermissions: (data: any) => Promise; + PermissionTree: () => Promise; +} + +interface RoleTableProps { + title: string; + apis: RoleApis; + listApi?: (data?: any) => Promise; +} + +export default function RoleTable({ title, apis, listApi }: RoleTableProps) { + const actionRef = useRef(); + const [modalOpen, setModalOpen] = useState(false); + const [editingItem, setEditingItem] = useState< + Record | undefined + >(); + + const handleEdit = (item: Record) => { + setEditingItem(item); + setModalOpen(true); + }; + + const handleCreate = () => { + setEditingItem(undefined); + setModalOpen(true); + }; + + const handleSuccess = () => { + setModalOpen(false); + actionRef.current?.reload(); + }; + + return ( + <> + + MyProTableProps.request(params, sort, listApi ?? apis.List) + } + toolBarRender={() => [ + + ), + }} + />, + ]} + options={false} + columns={[ + MyColumns.ID({ search: false }), + { + title: '角色名称', + dataIndex: 'name', + }, + MyColumns.UpdatedAt(), + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, __, action) => ( + handleEdit(item)} + /> + ), + delete: ( + + apis.Delete({ id: item.id }).then(() => { + message.success('删除成功'); + action?.reload(); + }) + } + /> + ), + }} + /> + ), + }), + ]} + /> + setModalOpen(false)} + onSuccess={handleSuccess} + item={editingItem} + title={title} + storeApi={apis.Store} + updateApi={apis.Update} + setPermissionsApi={apis.SetPermissions} + getPermissionsApi={apis.GetPermissions} + permissionTreeApi={apis.PermissionTree} + /> + + ); +} diff --git a/src/pages/system/sys_roles/index1.tsx b/src/pages/system/sys_roles/index1.tsx deleted file mode 100644 index 39c67a2..0000000 --- a/src/pages/system/sys_roles/index1.tsx +++ /dev/null @@ -1,190 +0,0 @@ -import { - MyButtons, - MyPageContainer, - MyProTableProps, - usePageTabs, -} from '@/common'; -import { flattenToMultiLevelFormatWithRowSpanAdvancedNew } from '@/common/utils/flattenIterative'; -import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; -import { Checkbox, message } from 'antd'; -import { useEffect, useState } from 'react'; -import Create from './modals/Create'; -interface SelectedBuilding { - id: number; - name: string; -} -export default function Index({ title = '角色' }) { - const [selectedBuilding, setSelectedBuilding] = - useState(null); - const [selectedPermissionsIds, setSelectedPermissionsIds] = useState( - [], - ); - const [dataSource, setDataSource] = useState([]); - // 注册当前页面为标签页 - usePageTabs({ - tabKey: 'system-roles', - tabLabel: title, - }); - - const getSysPermissions = () => { - Apis.Permission.SysPermissions.List({ guard_name: 'Admin' }).then((res) => { - setDataSource( - flattenToMultiLevelFormatWithRowSpanAdvancedNew( - res?.data[0]?.children || [], - ), - ); - console.log(res, 'res'); - }); - }; - - useEffect(() => { - getSysPermissions(); - }, []); - - const onSave = () => { - if (selectedPermissionsIds?.length && selectedBuilding?.id) { - Apis.Permission.SysRoles.SetPermissions({ - permissions_ids: selectedPermissionsIds, - id: selectedBuilding?.id || 0, - }).then(() => { - message.success('保存成功'); - }); - } else { - message.error('请选择角色和勾选权限!'); - } - }; - - return ( - - - - - MyProTableProps.request( - params, - sort, - Apis.Permission.SysRoles.List, - ) - } - toolBarRender={(action) => [ - , - ]} - rowClassName={(record: any) => { - return selectedBuilding?.id === record?.id - ? 'ant-table-row-selected' - : ''; - }} - onRow={(record: any) => { - return { - onClick: () => { - setSelectedBuilding(record); - Apis.Permission.SysRoles.GetPermissions({ - id: record?.id, - }).then((res) => { - setSelectedPermissionsIds(res?.data?.permissions_ids || []); - }); - }, - style: { - cursor: 'pointer', - }, - }; - }} - options={false} - columns={[{ dataIndex: 'name', title: '名称' }]} - /> - - - - { - setSelectedPermissionsIds(e); - console.log(e, 'e'); - }} - > - [ - onSave()} - />, - ]} - columns={[ - { - title: '目录', - dataIndex: 'name', - key: 'name', - width: '120px', - render: (_, item: any) => { - return {item?.name}; - }, - onCell: (res, index?: number) => { - const rowSpan = res.row_spans?.rowSpan; - const firstIndex = res.row_spans?.firstIndex; - if (index === firstIndex && rowSpan > 0) { - return { rowSpan }; - } - return { rowSpan: 0 }; - }, - }, - { - title: '页面', - dataIndex: 'name2', - key: 'name2', - width: '140px', - render: (_, item: any) => { - return {item?.name2}; - }, - }, - { - title: '页签/按钮', - width: '800px', - render: (_, item: any) => { - if (item?.buttonList?.length) { - return item?.buttonList?.map( - (res: any, index: number) => { - return ( - - {res?.name} - - ); - }, - ); - } - }, - }, - ]} - /> - - - - - ); -} diff --git a/src/pages/system/sys_roles/index2.tsx b/src/pages/system/sys_roles/index2.tsx deleted file mode 100644 index 0060fdb..0000000 --- a/src/pages/system/sys_roles/index2.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import { - MyButtons, - MyColumns, - MyPageContainer, - MyProTableProps, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; -import { Space, Tabs, type TabsProps } from 'antd'; -import { useState } from 'react'; -// import MyAdmins from './components/AdminsList'; -import EditPermissions from './components/EditPermissions'; -import Create from './modals/Create'; -import Update from './modals/Update'; -interface SelectedBuilding { - id: number; - name: string; -} -export default function Index({ title = '权限配置' }) { - const [selectedInfo, setSelectedInfo] = useState( - null, - ); - - const items: TabsProps['items'] = [ - { - key: '1', - label: '权限配置', - children: , - }, - // { - // key: '2', - // label: '管理员账号', - // children: , - // }, - ]; - - return ( - -
-
- { - let res = await MyProTableProps.request( - params, - sort, - Apis.Permission.SysRoles.List, - ); - if (res?.data?.length) { - setSelectedInfo(res?.data[0]); - } - return res || []; - }} - toolBarRender={(action) => [ - , - ]} - rowClassName={(record: any) => { - return selectedInfo?.id === record?.id - ? 'ant-table-row-selected' - : ''; - }} - onRow={(record: any) => { - return { - onClick: () => { - setSelectedInfo(record); - }, - style: { - cursor: 'pointer', - }, - }; - }} - options={false} - columns={[ - { dataIndex: 'name', title: '角色名称' }, - MyColumns.Option({ - width: 120, - render: (_, item: any, index, action) => ( - - - - Apis.Permission.SysRoles.Delete({ id: item.id }).then( - () => action?.reload(), - ) - } - /> - - ), - }), - ]} - /> -
- - {/* */} - - -
-
- ); -} diff --git a/src/pages/system/sys_roles/modals/Create.tsx b/src/pages/system/sys_roles/modals/Create.tsx deleted file mode 100644 index 4fcb8b7..0000000 --- a/src/pages/system/sys_roles/modals/Create.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Create(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - form={form} - title={`添加${props.title}`} - wrapperCol={{ span: 24 }} - key={new Date().getTime()} - width="420px" - trigger={} - onOpenChange={(open: any) => { - if (open) { - form.resetFields(); // 清空表单数据 - } - }} - onFinish={async (values) => - Apis.Permission.Roles.Store(values) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false) - } - columns={[ - { - key: 'name', - title: '角色名称', - formItemProps: { ...rulesHelper.text }, - }, - // MyFormItems.ColorPicker(), - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/modals/EditPermissions copy.tsx b/src/pages/system/sys_roles/modals/EditPermissions copy.tsx deleted file mode 100644 index 7bfcb47..0000000 --- a/src/pages/system/sys_roles/modals/EditPermissions copy.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - MyTreeCheckable, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { message } from 'antd'; - -export default function EditPermissions(props: MyBetaModalFormProps) { - return ( - - {...MyModalFormProps.props} - title={props.title} - wrapperCol={{ span: 24 }} - width="600px" - trigger={} - request={() => - Apis.Permission.SysRoles.GetPermissions({ - id: props?.item?.id ?? 0, - }).then((res) => { - return { - id: props?.item?.id, - permissions_ids: res.data?.permissions_ids, - }; - }) - } - onFinish={async (values) => { - return Apis.Permission.SysRoles.SetPermissions({ - ...values, - id: props.item?.id ?? 0, - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false); - }} - columns={[ - { - key: 'permissions_ids', - title: '选择权限', - ...rulesHelper.array, - renderFormItem: () => ( - - ), - }, - ]} - /> - ); -} diff --git a/src/pages/system/sys_roles/modals/Update.tsx b/src/pages/system/sys_roles/modals/Update.tsx deleted file mode 100644 index 22c3755..0000000 --- a/src/pages/system/sys_roles/modals/Update.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { - MyBetaModalFormProps, - MyButtons, - MyModalFormProps, - rulesHelper, -} from '@/common'; -import { Apis } from '@/gen/Apis'; -import { BetaSchemaForm } from '@ant-design/pro-components'; -import { Form, message } from 'antd'; - -export default function Update(props: MyBetaModalFormProps) { - const [form] = Form.useForm(); - - return ( - - {...MyModalFormProps.props} - form={form} - title={`编辑${props.title}`} - key={new Date().getTime()} - wrapperCol={{ span: 24 }} - width="420px" - trigger={} - onOpenChange={(open: any) => { - if (open && props.item) { - form.setFieldsValue(props.item); - } - }} - onFinish={async (values) => { - return Apis.Permission.SysRoles.Update({ - ...values, - id: props.item?.id ?? 0, - }) - .then(() => { - props.reload?.(); - message.success(props.title + '成功'); - return true; - }) - .catch(() => false); - }} - columns={[ - { - key: 'name', - title: '角色名称', - formItemProps: { ...rulesHelper.text }, - }, - ]} - /> - ); -} diff --git a/src/pages/visitor_applies/index.tsx b/src/pages/visitor/index.tsx similarity index 70% rename from src/pages/visitor_applies/index.tsx rename to src/pages/visitor/index.tsx index b9a5935..8a063c9 100644 --- a/src/pages/visitor_applies/index.tsx +++ b/src/pages/visitor/index.tsx @@ -3,6 +3,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; @@ -93,28 +94,34 @@ export default function Index({ title = '访客预约' }) { }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - { - Apis.Visitor.VisitorApplies.Approve({ - id: item?.id ?? 0, - }) - .then(() => { - message.success('审核成功'); - action?.reload(); - }) - .catch(() => false); - }} - /> - - + render: (_, item: any, __, action) => ( + { + Apis.Visitor.VisitorApplies.Approve({ + id: item?.id ?? 0, + }) + .then(() => { + message.success('审核成功'); + action?.reload(); + }) + .catch(() => false); + }} + /> + ), + view: ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/visitor_applies/modals/Review.tsx b/src/pages/visitor/modals/Review.tsx similarity index 100% rename from src/pages/visitor_applies/modals/Review.tsx rename to src/pages/visitor/modals/Review.tsx diff --git a/src/pages/work_order/complaint/index.tsx b/src/pages/work_order/complaint/index.tsx index 3f3b49e..92df74a 100644 --- a/src/pages/work_order/complaint/index.tsx +++ b/src/pages/work_order/complaint/index.tsx @@ -3,6 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { @@ -11,7 +13,7 @@ import { HouseWorkOrdersTypeEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { Space, Tooltip } from 'antd'; +import { Tooltip } from 'antd'; import Assign from './modals/Assign'; import ComplaintShow from './modals/ComplaintShow'; @@ -52,7 +54,14 @@ export default function Index({ title = '客户投诉' }) { ) } toolBarRender={(action) => [ - , + + ), + }} + />, ]} columns={[ MyColumns.ID({ search: false }), @@ -65,18 +74,18 @@ export default function Index({ title = '客户投诉' }) { title: '工单描述', dataIndex: 'content', search: false, - width: 200, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + width: 200, render: (text) => (
{text} @@ -115,34 +124,51 @@ export default function Index({ title = '客户投诉' }) { }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - {item.status === 'Pending' && ( - - )} - {item.assign_status === 'Unassigned' && ( - - )} - {item.status === 'Completed' && item.is_visited === 0 && ( - - )} - - Apis.WorkOrder.HouseWorkOrders.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + render: (_, item: any, __, action) => ( + + ), + update: + item.status === 'Pending' ? ( + + ) : null, + assign: + item.assign_status === 'Unassigned' ? ( + + ) : null, + visit: + item.status === 'Completed' && item.is_visited === 0 ? ( + + ) : null, + delete: ( + + Apis.WorkOrder.HouseWorkOrders.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/work_order/evaluated/index.tsx b/src/pages/work_order/evaluated/index.tsx index 9292db3..bc5e882 100644 --- a/src/pages/work_order/evaluated/index.tsx +++ b/src/pages/work_order/evaluated/index.tsx @@ -2,7 +2,7 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, } from '@/common'; import { Apis } from '@/gen/Apis'; import { @@ -16,14 +16,7 @@ import { Space } from 'antd'; import WorkOrderShow from '../list/modals/WorkOrderShow'; export default function Index({ title = '客户评价' }) { - const [searchParams, setSearchParams]: any = useSearchParams(); - const getCurrentPermissions = useCurrentPermissions(); - - let tableRender = (item: any, action: any) => { - return getCurrentPermissions({ - show: , - }); - }; + const [searchParams] = useSearchParams(); return ( > {...MyProTableProps.props} - // headerTitle={title} request={async (params, sort) => MyProTableProps.request( { @@ -97,17 +89,16 @@ export default function Index({ title = '客户评价' }) { title: '工单描述', dataIndex: 'content', search: false, - width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + width: 120, render: (text) => (
{text} @@ -119,13 +110,11 @@ export default function Index({ title = '客户评价' }) { dataIndex: 'evaluation_score', search: false, render: (dom: React.ReactNode) => { - // 确保score是1-5之间的有效数字 const score = Number(dom); const validScore = Math.max( 0, Math.min(5, isNaN(score) ? 0 : score), ); - // 创建对应数量的星星 return (
{Array(validScore) @@ -147,12 +136,19 @@ export default function Index({ title = '客户评价' }) { ); }, }, - // MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - <>{tableRender(item, action)} - + render: (_, item: any, __, action) => ( + + ), + }} + /> ), }), ]} diff --git a/src/pages/work_order/list/index.tsx b/src/pages/work_order/list/index.tsx index d2fe698..98c8796 100644 --- a/src/pages/work_order/list/index.tsx +++ b/src/pages/work_order/list/index.tsx @@ -3,7 +3,8 @@ import { MyColumns, MyPageContainer, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -24,68 +25,6 @@ import WorkOrderUpdate from './modals/WorkOrderUpdate'; export default function Index({ title = '报修报事' }) { const [searchParams, setSearchParams]: any = useSearchParams(); - const getCurrentPermissions = useCurrentPermissions(); - let toolBarRender = (action: any) => { - return getCurrentPermissions({ - create: ( - - ), - }); - }; - let tableRender = (item: any, action: any) => { - let permissions = getCurrentPermissions({ - show: , - update: ( - <> - { - let obj: any = JSON.parse( - JSON.stringify(HouseWorkOrdersTypeEnum), - ); - delete obj.RenovationAcceptance; - delete obj.EquipmentMaintenance; - delete obj.RenovationInspection; - delete obj.Emergency; - delete obj.EmergEquipmentMaintenancency; - delete obj.SecurityInspection; - delete obj.Complaint; - delete obj.QualityCheck; - return obj; - }, - }} - reload={action?.reload} - title={title} - /> - - ), - assign: ( - <> - - - ), - // completed: ( - // <> - // {item.status === 'Completed' && item.is_visited === 0 && ( - // - // )} - // - // ), - delete: ( - - Apis.WorkOrder.HouseWorkOrders.Delete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }); - - return [...permissions]; - }; return ( [toolBarRender(action)]} + toolBarRender={(action) => [ + + ), + }} + />, + ]} columns={[ MyColumns.ID({ search: false }), MyColumns.EnumTag({ @@ -174,18 +126,18 @@ export default function Index({ title = '报修报事' }) { title: '工单描述', dataIndex: 'content', search: false, - width: 200, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + width: 200, render: (text) => (
{text} @@ -225,12 +177,59 @@ export default function Index({ title = '报修报事' }) { }`; }, }, - // MyColumns.UpdatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - <>{tableRender(item, action)} - + render: (_, item: any, __, action) => ( + + ), + update: ( + { + let obj: any = JSON.parse( + JSON.stringify(HouseWorkOrdersTypeEnum), + ); + delete obj.RenovationAcceptance; + delete obj.EquipmentMaintenance; + delete obj.RenovationInspection; + delete obj.Emergency; + delete obj.EmergEquipmentMaintenancency; + delete obj.SecurityInspection; + delete obj.Complaint; + delete obj.QualityCheck; + return obj; + }, + }} + reload={action?.reload} + title={title} + /> + ), + assign: ( + + ), + delete: ( + + Apis.WorkOrder.HouseWorkOrders.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> ), }), ]} diff --git a/src/pages/work_order/managers/index.tsx b/src/pages/work_order/managers/index.tsx new file mode 100644 index 0000000..0aea39f --- /dev/null +++ b/src/pages/work_order/managers/index.tsx @@ -0,0 +1,95 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + MyTableActions, + MyToolBarActions, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersTypeEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import ManagersCreate from './modals/ManagersCreate'; + +export default function Index({ title = '工单管理员' }) { + return ( + + > + {...MyProTableProps.props} + request={async (params, sort) => + MyProTableProps.request( + params, + sort, + Apis.Asset.AssetProjectAdmins.List, + ) + } + headerTitle="工单管理员(配置后,对应人员可在员工端分配工单)" + toolBarRender={(action) => [ + + ), + }} + />, + ]} + columns={[ + MyColumns.ID(), + Selects?.AssetProjects({ + title: '选择项目', + key: 'asset_projects_id', + hidden: true, + }), + { + title: '项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, + MyColumns.EnumTag({ + title: '工单类型', + dataIndex: 'type', + valueEnum: HouseWorkOrdersTypeEnum, + }), + { + title: '工单管理员', + dataIndex: ['company_employee', 'name'], + render: (_, item: any) => + `${item?.company_employee?.name || ''}-${ + item?.company_employee?.phone || '' + }`, + search: false, + }, + MyColumns.UpdatedAt(), + MyColumns.Option({ + render: (_, item: any, __, action) => ( + + Apis.Asset.AssetProjectAdmins.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + /> + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/work_order/managers/modals/ManagersCreate.tsx b/src/pages/work_order/managers/modals/ManagersCreate.tsx new file mode 100644 index 0000000..756b28a --- /dev/null +++ b/src/pages/work_order/managers/modals/ManagersCreate.tsx @@ -0,0 +1,93 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersTypeEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + + return ( + } + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); + } + }} + onFinish={async (values: any) => { + const { type, ...restValues } = values; + const promises = (type || []).map((t: any) => + Apis.Asset.AssetProjectAdmins.Store({ + ...restValues, + type: t, + }), + ); + + return Promise.all(promises) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false); + }} + columns={[ + Selects?.AssetProjects({ + title: '选择项目', + dataIndex: 'asset_projects_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + showSearch: true, + }, + required: true, + }), + Selects?.Employees({ + title: '选择员工', + dataIndex: 'company_employees_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + showSearch: true, + }, + required: true, + }), + MyFormItems.EnumCheckbox({ + key: 'type', + title: '工单类型', + colProps: { span: 24 }, + valueEnum: HouseWorkOrdersTypeEnum, + formItemProps: { ...rulesHelper.array }, + fieldProps: { + options: Object.entries(HouseWorkOrdersTypeEnum).map( + ([key, value]) => ({ + label: value.text, + value: value.value, + }), + ), + optionType: 'default', + style: { + display: 'grid', + gridTemplateColumns: 'repeat(3, 1fr)', + gap: '8px', + }, + }, + }), + ]} + /> + ); +} diff --git a/src/pages/work_order/patrol_work/index.tsx b/src/pages/work_order/patrol_work/index.tsx index 1e15d32..7be447f 100644 --- a/src/pages/work_order/patrol_work/index.tsx +++ b/src/pages/work_order/patrol_work/index.tsx @@ -2,7 +2,8 @@ import { MyButtons, MyColumns, MyProTableProps, - useCurrentPermissions, + MyTableActions, + MyToolBarActions, } from '@/common'; import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; @@ -27,67 +28,6 @@ export const RenovationWorkOrdersStatusEnum = { }; export default function PatrolWorkIndex({ title = '巡更工单' }) { - const getCurrentPermissions = useCurrentPermissions(); - - let tableRender = (item: any, action: any) => { - return getCurrentPermissions( - { - show: ( - - ), - assign: ( - <> - {item.assign_status === 'Unassigned' && - item.type !== 'SecurityInspection' && ( - - )} - - ), - update: ( - <> - {item.status === 'Pending' && ( - - )} - - ), - delete: ( - - Apis.WorkOrder.HouseWorkOrders.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - ), - }, - 'MyDecorationWorkorder', - ); - }; - - const WorkTypeEnum: any = () => { - let obj: any = JSON.parse(JSON.stringify(HouseWorkOrdersTypeEnum)); - delete obj.Repair; - delete obj.Incident; - delete obj.Complaint; - delete obj.RenovationInspection; - delete obj.RenovationAcceptance; - delete obj.Emergency; - delete obj.EquipmentMaintenance; - delete obj.QualityCheck; - return obj; - }; - return ( > {...MyProTableProps.props} @@ -103,15 +43,22 @@ export default function PatrolWorkIndex({ title = '巡更工单' }) { ); }} toolBarRender={(action) => [ - + ), + }} />, ]} columns={[ @@ -170,17 +117,16 @@ export default function PatrolWorkIndex({ title = '巡更工单' }) { title: '工单描述', dataIndex: 'content', search: false, - width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + width: 120, render: (text) => (
{text} @@ -206,37 +152,48 @@ export default function PatrolWorkIndex({ title = '巡更工单' }) { }, MyColumns.CreatedAt(), MyColumns.Option({ - render: (_, item: any, index, action) => ( - - - - {item.assign_status === 'Unassigned' && - item.type !== 'SecurityInspection' && ( - ( + - )} - - {item.status === 'Pending' && ( - - )} - - Apis.WorkOrder.HouseWorkOrders.SoftDelete({ - id: item.id, - }).then(() => action?.reload()) - } - /> - + ), + assign: + item.assign_status === 'Unassigned' && + item.type !== 'SecurityInspection' ? ( + + ) : null, + update: + item.status === 'Pending' ? ( + + ) : null, + delete: ( + + Apis.WorkOrder.HouseWorkOrders.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + ), + }} + path="MyDecorationWorkorder" + /> ), }), ]} -- 2.47.2 From 66ec3a87bbd42132e9f4dda35984776f055081c1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 23 Apr 2026 10:19:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowAttachments.tsx | 2 +- src/pages/bills/house_bills/index.tsx | 23 +++++++++++++++---- src/pages/contract/contracts_bi/styleBi.scss | 6 ++--- .../quality/emergency/modals/TeamCreate.tsx | 2 +- src/pages/quality/emergency/teams/index.tsx | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/components/ShowAttachments.tsx b/src/components/ShowAttachments.tsx index 28e80e4..06c40af 100644 --- a/src/components/ShowAttachments.tsx +++ b/src/components/ShowAttachments.tsx @@ -2,7 +2,7 @@ import { MyBetaModalFormProps } from '@/common'; import { ProCard } from '@ant-design/pro-components'; export default function Attachments(props: MyBetaModalFormProps) { return ( - + {props?.item?.map((item: any) => { const handleDownload = async (e: React.MouseEvent) => { e.preventDefault(); diff --git a/src/pages/bills/house_bills/index.tsx b/src/pages/bills/house_bills/index.tsx index df0166d..149bdec 100644 --- a/src/pages/bills/house_bills/index.tsx +++ b/src/pages/bills/house_bills/index.tsx @@ -15,7 +15,6 @@ import { ApprovalTemplatesTypeEnum, HouseBillsBillStatusEnum, HouseBillsTypeEnum, - RefundsTypeEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { useNavigate } from '@umijs/max'; @@ -86,7 +85,13 @@ export default function Index({ title = '账单明细' }) { download={Apis.Bill.HouseBills} /> ), - add: , + add: ( + + ), }} />, ]} @@ -226,7 +231,9 @@ export default function Index({ title = '账单明细' }) { title="查看" /> ), - qrcode: , + qrcode: ( + + ), pay: ( ), - update: , + update: ( + + ), complete: ( - Apis.Emergency.EmergencyEventCategories.Delete({ + Apis.Emergency.EmergencyEventTeams.Delete({ id: item.id, }).then(() => action?.reload()) } -- 2.47.2