tangweijie fdc6bf58e0 fix: 代码审查修复 - 前端TypeScript类型和UI优化
前端修复:
- 完善TypeScript类型定义(QuestionnairePageParams, QuestionPageParams等)
- 移除未使用的导入(Dayjs等)
- 日期格式化统一使用dateFormatter替代自定义函数
- 问题类型选项使用字典替代硬编码
- 优化API参数传递方式

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 20:16:10 +08:00

82 lines
2.0 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'
// ========== 监室信息类型定义 ==========
// 监室信息响应 VO用于列表和详情展示
export interface CellVO {
id: number
areaId?: number
areaName?: string
name?: string
code?: string
capacity: number
currentCount: number
sort: number
status?: number
remark?: string
createTime?: Date
}
// 监室信息创建 Request VO
export interface CellCreateReqVO {
areaId: number
name: string
code: string
capacity: number
sort: number
status: number
remark?: string
}
// 监室信息更新 Request VO
export interface CellUpdateReqVO extends CellCreateReqVO {
id: number
}
// 监室信息分页 Request VO
export interface CellPageReqVO {
pageNo: number
pageSize: number
areaId?: number
name?: string
status?: number
}
// ========== 监室信息 API ==========
export const CellApi = {
// 查询监室信息分页
getCellPage: async (params: CellPageReqVO) => {
return await request.get<{ list: CellVO[]; total: number }>({ url: '/prison/cell/page', params })
},
// 查询监室信息详情
getCell: async (id: number) => {
return await request.get<CellVO>({ url: '/prison/cell/get', params: { id } })
},
// 新增监室信息
createCell: async (data: CellCreateReqVO) => {
return await request.post({ url: '/prison/cell/create', data })
},
// 修改监室信息
updateCell: async (data: CellUpdateReqVO) => {
return await request.put({ url: '/prison/cell/update', data })
},
// 删除监室信息
deleteCell: async (id: number) => {
return await request.delete({ url: '/prison/cell/delete', params: { id } })
},
// 批量删除监室信息
deleteCellList: async (ids: number[]) => {
return await request.delete({ url: '/prison/cell/delete-list', params: { ids: ids.join(',') } })
},
// 导出监室信息 Excel
exportCell: async (params: CellPageReqVO) => {
return await request.download({ url: '/prison/cell/export-excel', params })
}
}