105 lines
3.1 KiB
TypeScript
105 lines
3.1 KiB
TypeScript
|
|
const schema = {
|
||
|
|
body: [
|
||
|
|
{
|
||
|
|
type: 'crud',
|
||
|
|
messages: {},
|
||
|
|
api: {
|
||
|
|
method: 'get',
|
||
|
|
url: 'rest/projects?select=*&organization_id=eq.${centre_id}&semester_id=eq.${currentSemester}&order=code',
|
||
|
|
data: { page: '$page', perPage: '$perPage' },
|
||
|
|
},
|
||
|
|
headerToolbar: [],
|
||
|
|
syncLocation: false,
|
||
|
|
pageField: 'page',
|
||
|
|
perPageField: 'perPage',
|
||
|
|
name: 'score',
|
||
|
|
footerToolbar: [
|
||
|
|
{ type: 'pagination' },
|
||
|
|
{ type: 'switch-per-page' },
|
||
|
|
{ type: 'statistics' },
|
||
|
|
],
|
||
|
|
mode: 'table',
|
||
|
|
affixHeader: true,
|
||
|
|
perPageAvailable: [10, 20, 30, 40, 50],
|
||
|
|
columns: [
|
||
|
|
{ name: 'code', type: 'text', label: '编号' },
|
||
|
|
{ type: 'text', name: 'name', label: '名称' },
|
||
|
|
{
|
||
|
|
type: 'operation',
|
||
|
|
label: '操作',
|
||
|
|
buttons: [
|
||
|
|
{
|
||
|
|
type: 'button',
|
||
|
|
actionType: 'dialog',
|
||
|
|
dialog: {
|
||
|
|
type: 'dialog',
|
||
|
|
title: '附件管理',
|
||
|
|
body: [
|
||
|
|
{
|
||
|
|
type: 'form',
|
||
|
|
title: '表单',
|
||
|
|
api: {
|
||
|
|
method: 'patch',
|
||
|
|
url: 'rest/projects?id=eq.${id}',
|
||
|
|
data: {
|
||
|
|
files: '${files}',
|
||
|
|
},
|
||
|
|
dataType: 'json',
|
||
|
|
},
|
||
|
|
body: [
|
||
|
|
{
|
||
|
|
type: 'combo',
|
||
|
|
label: '',
|
||
|
|
name: 'files',
|
||
|
|
mode: 'inline',
|
||
|
|
inputClassName: 'm-l-xs',
|
||
|
|
multiple: true,
|
||
|
|
controls: [
|
||
|
|
{
|
||
|
|
type: 'dataset-picker',
|
||
|
|
bucket: 'mooc',
|
||
|
|
name: 'path',
|
||
|
|
required: true,
|
||
|
|
},
|
||
|
|
{ type: 'tpl', tpl: '$path' },
|
||
|
|
],
|
||
|
|
multiLine: false,
|
||
|
|
joinValues: false,
|
||
|
|
draggable: false,
|
||
|
|
strictMode: false,
|
||
|
|
delimiter: ',',
|
||
|
|
scaffold: '',
|
||
|
|
disabled: false,
|
||
|
|
disabledOn: '',
|
||
|
|
removable: true,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
],
|
||
|
|
closeOnEsc: true,
|
||
|
|
showCloseButton: true,
|
||
|
|
size: 'lg',
|
||
|
|
},
|
||
|
|
level: 'link',
|
||
|
|
size: 'md',
|
||
|
|
icon: 'fa fa-cog text-warning',
|
||
|
|
tooltip: '附件管理',
|
||
|
|
tooltipPlacement: 'top',
|
||
|
|
iconClassName: 'pull-left',
|
||
|
|
className: 'm-r-none m-l-none',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
placeholder: '-',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
bodyClassName: '',
|
||
|
|
initApi: '',
|
||
|
|
initFetch: '',
|
||
|
|
label: '名称',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
type: 'page',
|
||
|
|
};
|
||
|
|
|
||
|
|
export { schema };
|