crud.DyxCoheR.js 2.7 KB

1
  1. import{r,W as u,n as a,s as l}from"./index.kH9BKUh7.js";import{a as i}from"./authFunction.B70cO79v.js";const o="/api/system/articles/";function c(t){return r({url:o+"by-type/borrow_rules/",method:"get",params:t})}function d(t){return r({url:o,method:"post",data:t})}function n(t){return r({url:o+t.id+"/",method:"put",data:t})}function m(t){return r({url:o+t+"/",method:"delete",data:{id:t}})}function q(){return r({url:o+"by-type/borrow_rules/",method:"get"})}const p=function({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await c(e),addRequest:async({form:e})=>await d(e),editRequest:async({form:e,row:s})=>(e.id=s.id,await n(e)),delRequest:async({row:e})=>await m(e.id)},form:{wrapper:{buttons:{ok:{text:"提交",show:a(e=>e.mode!=="view")}}}},actionbar:{buttons:{add:{show:i("area:Create")}}},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}},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:"内容为必填项"}]}},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=>()=>{n(e.row).then(s=>{l(s.msg)})})}},dict:u({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:"请填写状态"}]}}}}}},_=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:p},Symbol.toStringTag,{value:"Module"}));export{q as G,_ as a,p as c};