import{r as a,m as l,g as o}from"./index.lP_uh0LI.js";import"./vue.BxlDVA1H.js";const i=`${l.system}file/`;function s(t){return a({url:i,method:"get",params:t})}function u(t){return a({url:i,method:"post",data:t})}function d(t){return a({url:i+t.id+"/",method:"put",data:t})}function c(t){return a({url:i+t+"/",method:"delete",data:{id:t}})}const g=function({crudExpose:t,context:m}){return{crudOptions:{actionbar:{buttons:{add:{show:!1}}},request:{pageRequest:async e=>await s(e),addRequest:async({form:e})=>await u(e),editRequest:async({form:e,row:n})=>(e.id=n.id,await d(e)),delRequest:async({row:e})=>await c(e.id)},tabs:{show:!1,name:"file_type",type:"",options:[{value:0,label:"图片"},{value:1,label:"视频"},{value:2,label:"音频"},{value:3,label:"其他"}]},rowHandle:{fixed:"right",width:200,show:!1,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"primary",link:!0},remove:{iconRight:"Delete",type:"primary",link:!0}}},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:e=>{let n=e.index??1,r=t.crudBinding.value.pagination;return((r.currentPage??1)-1)*r.pageSize+n+1}}},search:{title:"关键词",column:{show:!1},search:{show:!0,component:{props:{clearable:!0},placeholder:"请输入关键词"}},form:{show:!1,component:{props:{clearable:!0}}}},name:{title:"文件名称",search:{show:!0},type:"input",column:{minWidth:200},form:{component:{placeholder:"请输入文件名称",clearable:!0}}},preview:{title:"预览",column:{minWidth:120,align:"center"},form:{show:!1}},url:{title:"文件地址",type:"file-uploader",search:{disabled:!0},column:{minWidth:360,component:{async buildUrl(e){return o(e)}}}},md5sum:{title:"文件MD5",search:{disabled:!0},column:{minWidth:300},form:{disabled:!1}},mime_type:{title:"文件类型",type:"input",form:{show:!1},column:{minWidth:160}},size:{title:"文件大小",column:{minWidth:120},form:{show:!1}},create_datetime:{title:"创建时间",column:{minWidth:160},form:{show:!1}}}}}};export{g as createCrudOptions};
