1
0
This repository has been archived on 2025-09-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bookstore_old/src/main/resources/static/components/chapter.js

69 lines
1.6 KiB
JavaScript

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}',
},
},
}
}