tangweijie 1ebf700cf2 feat(prison): Enhance area and cell management with tree structure and improved forms
- Updated AreaApi to support search parameters in getAreaTree method.
- Modified CellForm and Cell index views to use tree-select for area selection.
- Added areaName to Cell and Prisoner interfaces for better data representation.
- Refactored prisoner forms to remove subAreaId and streamline area selection.
- Improved image path validation in utility functions.
- Enhanced prisoner detail and list views to display area and cell names correctly.
- Added loading functionality for area tree data in relevant components.
2026-01-15 10:57:50 +08:00

55 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/config/axios'
import type { Dayjs } from 'dayjs';
/** 监室信息信息 */
export interface Cell {
id: number; // 监室ID
areaId?: number; // 所属监区ID
areaName?: string; // 所属监区名称
name?: string; // 监室名称
code?: string; // 监室编码
capacity: number; // 床位数量
currentCount: number; // 当前人数
sort: number; // 排序
status?: number; // 状态1-启用 2-禁用
remark: string; // 备注
createTime?: Date; // 创建时间
}
// 监室信息 API
export const CellApi = {
// 查询监室信息分页
getCellPage: async (params: any) => {
return await request.get({ url: `/prison/cell/page`, params })
},
// 查询监室信息详情
getCell: async (id: number) => {
return await request.get({ url: `/prison/cell/get?id=` + id })
},
// 新增监室信息
createCell: async (data: Cell) => {
return await request.post({ url: `/prison/cell/create`, data })
},
// 修改监室信息
updateCell: async (data: Cell) => {
return await request.put({ url: `/prison/cell/update`, data })
},
// 删除监室信息
deleteCell: async (id: number) => {
return await request.delete({ url: `/prison/cell/delete?id=` + id })
},
/** 批量删除监室信息 */
deleteCellList: async (ids: number[]) => {
return await request.delete({ url: `/prison/cell/delete-list?ids=${ids.join(',')}` })
},
// 导出监室信息 Excel
exportCell: async (params) => {
return await request.download({ url: `/prison/cell/export-excel`, params })
}
}