import { MatDialog } from "@angular/material/dialog";
import { Router } from "@angular/router";
import Parse from "parse";
import { ParseSchema } from "./func-parse";

export const EduProcess:ParseSchema = {
    title:"报送流程",
    className:"EduProcess",
    emptyImg:"/img/webhook-empty.png",
    include:["eduCollection"],
    buttons:[
        {
            name:"编辑",
            place:"item",
            show:(options:{object:Parse.Object})=>{
                if(location?.pathname=='/nav-author/manage/space'){
                    return true
                }
                return false
            },
            handle:(options:{dialog:MatDialog,object:Parse.Object,router?:Router})=>{
                options.router?.navigate(['/nav-author/manage/apply',{id:options.object.id}])
            }
        }
    ],
    fieldsArray:[
        {key:"eduCollection",name:"所属合集",type:"Pointer",targetClass:"EduCollection",isHeader:true,showName:"${name}"},
        {key:"name",name:"流程名称",type:"String",isHeader:true},
    ]
}