import{t as r,W as n,r as a,s as u}from"./index.Df8UJ10K.js";const o="/api/system/articles/";function i(t){return r({url:o+"by-type/borrow_rules/",method:"get",params:t})}function c(t){return r({url:o,method:"post",data:t})}function l(t){return r({url:o+t.id+"/",method:"put",data:t})}function d(t){return r({url:o+t+"/",method:"delete",data:{id:t}})}function b(){return r({url:o+"by-type/borrow_rules/",method:"get"})}const m=function({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await i(e),addRequest:async({form:e})=>await c(e),editRequest:async({form:e,row:s})=>(e.id=s.id,await l(e)),delRequest:async({row:e})=>await d(e.id)},form:{wrapper:{buttons:{ok:{text:"提交",show:a(e=>e.mode!=="view")}}}},actionbar:{buttons:{add:{show:!0}}},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:!1,minWidth:120},form:{col:{span:24},component:{showWordLimit:!0,maxlength:200,placeholder:"请填写内容"},rules:[{required:!0,message:"内容为必填项"}]}},is_top:{title:"是否置顶",type:"dict-switch",column:{show:!0,minWidth:120,component:{name:"fs-dict-switch",activeText:"",inactiveText:"",style:"--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #dcdfe6",onChange:a(e=>()=>{l(e.row).then(s=>{u(s.msg)})})}},dict:n({data:[{value:!0,label:"置顶"},{value:!1,label:"取消"}]}),form:{value:!0,show:!0,component:{placeholder:"请选择是否置顶"},rules:[{required:!1,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:"请填写发布时间"}]}},article_type:{title:"文章类型",type:"input",column:{show:!1,minWidth:120},form:{value:"borrow_rules",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:m},Symbol.toStringTag,{value:"Module"}));export{b as G,g as a,m as c};
