import{r}from"./index.BKEMpsLA.js";import{a as n}from"./authFunction.DqglRaEG.js";const o="/api/system/announcements/";function a(e){return r({url:o,method:"get",params:e})}function u(e){return r({url:o,method:"post",data:e})}function i(e){return r({url:o+e.id+"/",method:"put",data:e})}function l(e){return r({url:o+e+"/",method:"delete",data:{id:e}})}function q(){return r({url:o,method:"get"})}const d=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await a(t),addRequest:async({form:t})=>await u(t),editRequest:async({form:t,row:s})=>(t.id=s.id,await i(t)),delRequest:async({row:t})=>await l(t.id)},actionbar:{buttons:{add:{show:n("area:Create")}}},form:{wrapper:{buttons:{ok:{text:"提交"}}}},toolbar:{show:!1},rowHandle:{buttons:{remove:{show:!0},edit:{show:!0}}},pagination:{show:!1},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},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{q as G,g as a,d as c};
