Files
reader-star/apps/admin/src/typings/api/template.d.ts
rjl 82b1dd7ebe feat(template): 增强答题卡编辑器功能并优化类型定义
- 新增模板详情编辑功能,支持从后端加载并回填数据
- 在画布中增加网格、标尺和坐标显示辅助工具
- 优化模板列表操作按钮布局,新增打印功能
- 扩展响应类型定义,增加 success 字段和 TemplateDetail 接口
- 添加 ESLint 配置排除 Markdown 文件,并完善事件总线类型
- 新增请求工具使用文档,说明错误处理机制
2026-01-29 11:55:18 +08:00

108 lines
2.6 KiB
TypeScript

/**
* Namespace Api
*
* All backend api type
*/
declare namespace Api {
namespace Template {
/** common params of paginating */
interface PaginatingCommonParams {
/** currentPage page number */
currentPage: number
/** page pageSize */
pageSize: number
/** total count */
total?: number
}
interface AddTemplateParams {
/** template id */
id: number | null
/** page number */
pageNo: number | null | string
/** template name */
name: string
/** background url */
backGroundUrl: string
/** width */
width: number
/** height */
height: number
/** template content */
tempContent: string
}
/** template detail */
interface TemplateDetail {
/** template id */
ID: number
/** template name */
Name: string
/** width */
Width: number
/** height */
Height: number
/** background url */
BackGroundUrl: string
/** template content */
TempContent: string
/** competition id */
CompetitionId?: number
}
/** template search params */
interface TemplateSearchParams extends PaginatingCommonParams {
/** competition activity name */
competitionActivityName?: string
/** publish status */
publishStatus?: EnableStatus
/** template name */
templateName?: string
/** competition id */
competitionId?: string
/** size */
size?: string
/** status */
status?: EnableStatus | null
}
/** common params of paginating query list data */
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
records: T[]
}
/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'currentPage' | 'pageSize'>
/**
* enable status
*
* - "1": enabled
* - "2": disabled
*/
type EnableStatus = '1' | '2'
/** question score type */
type QuestionScoreType = '1' | '2' /** 固定分数 | 答题个数 */
/** competition round type */
type CompetitionRoundType = '1' | '2' /** 题包环节 | 加时环节 */
/** common record */
type CommonRecord<T = any> = {
/** record id */
id: number
/** record creator */
createBy: string
/** record create time */
createTime: string
/** record updater */
updateBy: string
/** record update time */
updateTime: string
/** record status */
status: EnableStatus | null
} & T
}
}