import { MatDialog } from "@angular/material/dialog";
import { openObjectEditDialog, ParseSchema } from "./func-parse";


const EduCollection:ParseSchema = {
    "title":"报送合集",
    "subTitle":"创建报送合集，分配合集管理员，统一管理各地区的教材推荐报送流程和配额。",
    "className": "EduCollection",
    emptyImg:"/img/webhook-empty.png",
    emptyDesc:"请您创建报送合集，分配合集管理员，统一管理各地区的教材推荐报送流程和配额。",
    "fieldsArray": [
        {
            "key":"title",
            "name":"合集名称",
            "type": "String",
            isHeader:true
        },
        {
            "key":"name",
            "name":"合集CODE",
            "type": "String",
            isHeader:true
        },
        {
            "key":"desc",
            "name":"合集描述",
            "type": "String",
            isHeader:true
        },
        {
            "key":"profileSubmitted",
            "name":"合集报送人",
            "type": "Pointer",
            "targetClass":"Profile",
            isHeader:true
        },
        {
            "key":"status",
            "name":"合集状态",
            "type": "String",
            "options":[
                {label:"遴选中",value:"遴选中"},
                {label:"公示中",value:"公示中"},
                {label:"已完成",value:"已完成"}
            ],
            isHeader:true
        },
    ],
    buttons:[
        {
            name:"编辑",
            place:"item",
            show:(options:{object:Parse.Object})=>{
                return true
            },
            handle:(options:{dialog:MatDialog,object:Parse.Object})=>{
                openObjectEditDialog(options?.dialog,EduCollection,options?.object)
            }
        },
    ]
    };
    
    export default EduCollection;