- 新增模板详情页面,支持上传PDF/图片作为底稿,并生成可拖拽调整的区域 - 新增模板类型定义、上传钩子及画布组件,支持批量生成区域、旋转、对齐参考线等功能 - 更新模板列表页,适配新的API接口并增加删除功能 - 更新OSS工具函数,修复上传凭证处理逻辑 - 更新公共类型定义,调整分页查询返回结构 - 移除旧的书籍相关API文件,替换为模板API - 更新依赖项,添加pdfjs-dist、vue3-draggable-resizable等库 - 隐藏页面底部,优化界面显示
90 lines
2.2 KiB
TypeScript
90 lines
2.2 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 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
|
|
}
|
|
}
|