1
0

feat: 完成基本功能

This commit is contained in:
2024-12-22 01:33:46 +08:00
parent 779cd23b8b
commit 0c979985ed
10 changed files with 803 additions and 96 deletions

View File

@@ -0,0 +1,69 @@
function chapterForm() {
return {
debug: '${debug}',
type: 'form',
...horizontalFormOptions(),
body: [
{
type: 'hidden',
name: 'id',
},
{
type: 'input-number',
name: 'sequence',
label: '章节数',
required: true,
step: 1,
precision: 0,
},
{
type: 'input-text',
name: 'name',
label: '名称',
...formInputClearable(),
},
{
type: 'textarea',
name: 'description',
label: '简介',
...formInputClearable(),
showCounter: true,
trimContents: true,
minRows: 2,
maxRows: 2,
maxLength: 100,
},
],
}
}
function chapterAddDialog() {
return {
type: 'action',
actionType: 'dialog',
dialog: {
title: '新增章节',
size: 'md',
body: {
...chapterForm(),
api: '${base}/chapter/save/${bookId}',
},
},
}
}
function chapterDetailDialog() {
return {
type: 'action',
actionType: 'dialog',
dialog: {
title: '编辑章节',
size: 'md',
body: {
...chapterForm(),
initApi: '${base}/chapter/detail/${chapterId}',
api: '${base}/chapter/save/${bookId}',
},
},
}
}