import{D as s,U as r,A as a,G as d}from"./api.C-LlHP5V.js";import{D as o}from"./index.BKEMpsLA.js";import"./vue.YrNK8sx4.js";const f=function({crudExpose:n}){return{crudOptions:{request:{pageRequest:async t=>{try{const e=await d(t);return{...e,records:e.data,total:e.total}}catch{return{code:2e3,msg:"success",records:[],total:0}}},addRequest:async({form:t})=>await a(t),editRequest:async({form:t,row:e})=>(t.id=e.id,await r(e.id,t)),delRequest:async({row:t})=>await s(t.id)},actionbar:{buttons:{add:{show:!1,text:"新建审批流程",click:()=>{window.dispatchEvent(new CustomEvent("workflow-add"))}}}},search:{show:!0},toolbar:{show:!1},rowHandle:{fixed:"right",width:220,buttons:{view:{show:!0,click:({row:t})=>{window.dispatchEvent(new CustomEvent("workflow-view",{detail:t}))}},edit:{show:!0,click:({row:t})=>{window.dispatchEvent(new CustomEvent("workflow-edit",{detail:t}))}},remove:{show:!0}}},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:t=>{let e=t.index??1,i=n.crudBinding.value.pagination;return((i.currentPage??1)-1)*i.pageSize+e+1}}},name:{title:"流程名称",type:"input",column:{minWidth:140},search:{show:!0},form:{component:{placeholder:""}}},workflow_type:{title:"流程类型id",type:"input",column:{show:!1,minWidth:140},search:{show:!1},form:{component:{placeholder:""}}},"trigger_conditions.team_type":{title:"流程类型id",column:{show:!1,minWidth:140},search:{show:!1}},"trigger_conditions.user_types":{title:"流程类型id",column:{show:!1,minWidth:140},search:{show:!1}},"trigger_conditions.borrow_types":{title:"流程类型id",column:{show:!1,minWidth:140},search:{show:!1}},"trigger_conditions.equipment_categories":{title:"流程类型id",column:{show:!1,minWidth:140},search:{show:!1}},workflow_type_label:{title:"流程类型",column:{minWidth:120}},description:{title:"流程描述",column:{minWidth:200}},step_count:{title:"步骤数",column:{minWidth:80,align:"center"}},is_active:{title:"状态",column:{minWidth:80,formatter:({value:t})=>t?"启用":"停用"}},create_datetime:{title:"创建时间",column:{minWidth:160,formatter:({value:t})=>t?o(t).format("YYYY-MM-DD HH:mm:ss"):""}},update_datetime:{title:"更新时间",column:{minWidth:160,formatter:({value:t})=>t?o(t).format("YYYY-MM-DD HH:mm:ss"):""}}}}}};export{f as createCrudOptions};
