export default {
    "$schema": "http://amis.baidu.com/v2/schemas/page.json",
    "title": "标准管理",
    "remark": "这里是提示",
    "toolbar": [
        {
            "type": "button",
            "actionType": "dialog",
            "label": "新增",
            "icon": "fa fa-plus pull-left",
            "primary": true,
            "dialog": {
                "title": "新增",
                "body": {
                    "type": "form",
                    "name": "sample-edit-form",
                    "api": "post:/api/sample",
                    "controls": [
                        {
                            "type": "text",
                            "name": "engine",
                            "label": "Engine",
                            "required": true
                        },
                        {
                            "type": "divider"
                        },
                        {
                            "type": "text",
                            "name": "browser",
                            "label": "Browser",
                            "required": true
                        },
                        {
                            "type": "divider"
                        },
                        {
                            "type": "text",
                            "name": "platform",
                            "label": "Platform(s)",
                            "required": true
                        },
                        {
                            "type": "divider"
                        },
                        {
                            "type": "text",
                            "name": "version",
                            "label": "Engine version"
                        },
                        {
                            "type": "divider"
                        },
                        {
                            "type": "text",
                            "name": "grade",
                            "label": "CSS grade"
                        }
                    ]
                }
            }
        }
    ],
    "body": {
        "type": "crud",
        "draggable": true,
        "api": "/api/sample?waitSeconds=1",
        "keepItemSelectionOnPageChange": true,
        "labelTpl": "${id} ${engine}",
        "filter": {
            "title": "条件搜索",
            "submitText": "",
            "controls": [
                {
                    "type": "text",
                    "name": "keywords",
                    "placeholder": "通过关键字搜索",
                    "addOn": {
                        "label": "搜索",
                        "type": "submit"
                    }
                },
                {
                    "type": "plain",
                    "text": "这里的表单项可以配置多个"
                }
            ]
        },
        "bulkActions": [
            {
                "label": "批量删除",
                "actionType": "ajax",
                "api": "delete:/api/sample/${ids|raw}",
                "confirmText": "确定要批量删除?"
            },
            {
                "label": "批量修改",
                "actionType": "dialog",
                "dialog": {
                    "title": "批量编辑",
                    "name": "sample-bulk-edit",
                    "body": {
                        "type": "form",
                        "api": "/api/sample/bulkUpdate2",
                        "controls": [
                            {
                                "type": "hidden",
                                "name": "ids"
                            },
                            {
                                "type": "text",
                                "name": "engine",
                                "label": "Engine"
                            }
                        ]
                    }
                }
            }
        ],
        "quickSaveApi": "/api/sample/bulkUpdate",
        "quickSaveItemApi": "/api/sample/$id",
        "filterTogglable": true,
        "headerToolbar": [
            "filter-toggler",
            "bulkActions",
            {
                "type": "tpl",
                "tpl": "定制内容示例：当前有 ${count} 条数据。",
                "className": "v-middle"
            },
            {
                "type": "columns-toggler",
                "align": "right"
            },
            {
                "type": "drag-toggler",
                "align": "right"
            },
            {
                "type": "pagination",
                "align": "right"
            }
        ],
        "footerToolbar": [
            "statistics",
            "switch-per-page",
            "pagination"
        ],
        "columns": [
            {
                "name": "id",
                "label": "ID",
                "width": 20,
                "sortable": true,
                "type": "text",
                "toggled": true,
                "remark": "Bla bla Bla"
            },
            {
                "name": "standard_name",
                "label": "标准名称",
                "quickEdit": true,
                "sortable": true,
                "searchable": true,
                "type": "text",
                "toggled": true
            },
            {
                "name": "standard_items",
                "label": "标准项",
                "type": "form",
                "controls": [
                    {
                        "type": "table",
                        "editable": true,
                        "addable": true,
                        "columns": [
                            {
                                "name": "item_name",
                                "type": "text",
                                "label": "标准描述"
                            },
                            {
                                "name": "item_type",
                                "type": "text",
                                "label": "标准类型"
                            },
                            {
                                "name": "item_exp",
                                "type": "text",
                                "label": "标准预期"
                            },
                            {
                                "type": "operation",
                                "label": "操作"
                            }
                        ],
                        "affixHeader": true,
                        "placeholder": "暂无数据",
                        "tableClassName": "table-db table-striped",
                        "headerClassName": "crud-table-header",
                        "footerClassName": "crud-table-footer",
                        "toolbarClassName": "crud-table-toolbar",
                        "innerClassName": "panel-default",
                        "source": ""
                    }
                ]
            },
            {
                "name": "",
                "label": "标准阶段",
                "quickEdit": {
                    "mode": "inline",
                    "type": "select",
                    "inputClassName": "w-xs",
                    "options": [
                        "开发准入",
                        "提测准入",
                        "交付准入",
                        "交付完成"
                    ],
                    "saveImmediately": true
                },
                "type": "text",
                "toggled": true
            }
        ]
    },
    "type": "page",
    "messages": {},
    "subTitle": "这里是副标题"
};
