crud.4tuvkPcs.js 2.7 KB

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