import { MatDialog } from "@angular/material/dialog";
import Parse from "parse";

export const EduTextbook = {
    className:"EduTextbook",
    include:["owner"],
    buttons:[
        // 行内操作
        {
            name:"绑定",
            place:"item",
            show:(options:{object:Parse.Object})=>{
                if(options?.object?.get("type")=="unit") {return true} else return false
            },
            handle:(options:{dialog:MatDialog,object:Parse.Object,callback:any})=>{
                // options?.clusterServ?.openMinerDialog(options?.dialog,options?.object)
                console.log(options?.object.toJSON())
                console.log(options)
                if(options?.callback){
                    options?.callback(options?.object)
                }
            }
        },
    ],
    fieldsArray:[
        {key:"title",name:"教材名称",type:"String",isHeader:true},
        {key:"desc",name:"教材描述",type:"String"},
        {key:"user",name:"创建人",type:"Pointer",className:"_User",isHeader:true,showName:"${name}"},
    ]
}