import{t as o,r as n}from"./index.Df8UJ10K.js";const r="/api/system/announcements/";function u(e){return o({url:r,method:"get",params:e})}function a(e){return o({url:r,method:"post",data:e})}function l(e){return o({url:r+e.id+"/",method:"put",data:e})}function i(e){return o({url:r+e+"/",method:"delete",data:{id:e}})}function w(){return o({url:r,method:"get"})}const d=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await u(t),addRequest:async({form:t})=>await a(t),editRequest:async({form:t,row:s})=>(t.id=s.id,await l(t)),delRequest:async({row:t})=>await i(t.id)},actionbar:{buttons:{add:{show:!0}}},form:{wrapper:{buttons:{ok:{text:"提交",show:n(t=>t.mode!=="view")}}}},toolbar:{show:!1},rowHandle:{buttons:{remove:{show:!0},edit:{show:!0}}},pagination:{show:!0},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},search:{title:"关键字搜索",search:{show:!0,type:"input"},type:"input",form:{component:{placeholder:"请输入"},show:!1},column:{show:!1}},title:{title:"公告标题",search:{show:!0},treeNode:!0,type:"input",column:{minWidth:120},form:{rules:[{required:!0,message:"公告标题必填项"}],component:{placeholder:"请输入公告标题"}}},content:{title:"公告内容",type:"textarea",column:{show:!0,minWidth:120},form:{col:{span:24},component:{showWordLimit:!0,maxlength:200,placeholder:"请填写公告内容"},rules:[{required:!0,message:"内容为必填项"}]}},publisher_name:{title:"发布人",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填发布人"},rules:[{required:!1,message:"请填写发布人"}]}},publish_time:{title:"发布时间",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填写发布时间"},rules:[{required:!1,message:"请填写发布时间"}]}},is_top:{title:"是否在顶部",type:"input",column:{show:!1,minWidth:120},form:{value:!0,show:!1,component:{placeholder:"请填写是否在顶部"},rules:[{required:!1,message:"请填写是否在顶部"}]}},status:{title:"状态",type:"input",column:{show:!1,minWidth:120},form:{value:1,show:!1,component:{placeholder:"请填写状态"},rules:[{required:!1,message:"请填写状态"}]}}}}}},g=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:d},Symbol.toStringTag,{value:"Module"}));export{w as G,g as a,d as c};
