fix: 归档删除改为软删除

This commit is contained in:
2026-07-17 14:13:17 +08:00
parent 3131d2e141
commit f7328d670d
49 changed files with 520 additions and 354 deletions

View File

@@ -25,7 +25,6 @@ import {
InboxOutlined,
SearchOutlined,
ExportOutlined,
DeleteOutlined,
} from '@ant-design/icons';
import api from '../../api';
import { downloadBlob } from '../../utils/download';
@@ -229,9 +228,9 @@ const RoomsPage: React.FC = () => {
const handleDeleteBed = async (id: number) => {
try {
await api.delete(`/rooms/${drawerRoom.id}/beds/${id}`);
message.success('已删除');
message.success('已归档');
fetchBeds(drawerRoom.id);
} catch (e: any) { message.error(e?.message || '删除失败'); }
} catch (e: any) { message.error(e?.message || '归档失败'); }
};
const handleBatchBeds = async (count: number) => {
@@ -263,9 +262,9 @@ const RoomsPage: React.FC = () => {
const handleDeleteLocker = async (id: number) => {
try {
await api.delete(`/rooms/${drawerRoom.id}/lockers/${id}`);
message.success('已删除');
message.success('已归档');
fetchLockers(drawerRoom.id);
} catch (e: any) { message.error(e?.message || '删除失败'); }
} catch (e: any) { message.error(e?.message || '归档失败'); }
};
const handleBatchLockers = async (count: number) => {
@@ -461,7 +460,7 @@ const RoomsPage: React.FC = () => {
<PermissionButton
permission="room:delete"
danger
icon={<DeleteOutlined />}
icon={<InboxOutlined />}
disabled={selectedRowKeys.length === 0}
loading={batchLoading}
>
@@ -701,7 +700,7 @@ const RoomsPage: React.FC = () => {
</PermissionButton>
{r.status !== 'occupied' && (
<Popconfirm title="确定删除" onConfirm={() => handleDeleteBed(r.id)}>
<Popconfirm title="确定归档" onConfirm={() => handleDeleteBed(r.id)}>
<PermissionButton
permission="room:edit"
size="small"
@@ -709,7 +708,7 @@ const RoomsPage: React.FC = () => {
danger
disabled={drawerRoom?.status === 'archived'}
>
</PermissionButton>
</Popconfirm>
)}
@@ -784,7 +783,7 @@ const RoomsPage: React.FC = () => {
</PermissionButton>
{r.status !== 'occupied' && (
<Popconfirm title="确定删除" onConfirm={() => handleDeleteLocker(r.id)}>
<Popconfirm title="确定归档" onConfirm={() => handleDeleteLocker(r.id)}>
<PermissionButton
permission="room:edit"
size="small"
@@ -792,7 +791,7 @@ const RoomsPage: React.FC = () => {
danger
disabled={drawerRoom?.status === 'archived'}
>
</PermissionButton>
</Popconfirm>
)}