crud.DrQA9ESb.js 3.0 KB

1
  1. import{r,n as o}from"./index.CN0f9AXO.js";import{a as i}from"./authFunction.Z-dZyTH_.js";const s="/api/system/articles/";function l(t){return r({url:s+"device-manuals/",method:"get",params:t})}function n(t){return r({url:s+"add-device-manual/",method:"post",data:t})}function u(t){return r({url:"/api/system/device-manuals/"+t.id+"/",method:"put",data:t})}function d(t){return r({url:s+t+"/",method:"delete",data:{id:t}})}const c=function({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await l(e),addRequest:async({form:e})=>(e.device_id=Number(e.device),e.title=e.article_title,e.content=e.article_content,await n(e)),editRequest:async({form:e,row:a})=>(e.id=a.id,e.device_id=Number(e.device),e.title=e.article_title,e.content=e.article_content,await u(e)),delRequest:async({row:e})=>await d(e.id)},actionbar:{buttons:{add:{show:i("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:{show:!1,type:"index",align:"center",width:"70px",columnSetDisabled:!0}},device:{title:"设备id",search:{show:!1},treeNode:!0,type:"dict-select",column:{show:!1,minWidth:120},dict:o({url:"/api/system/device/",value:"id",label:"name"}),form:{show:!0,component:{placeholder:"请选择设备id"},rules:[{required:!0,message:"请选择设备id"}]}},article:{title:"文章id",search:{show:!1},type:"input",column:{show:!1,minWidth:120},form:{show:!1}},device_code:{title:"设备编码",search:{show:!1},treeNode:!0,type:"input",column:{minWidth:120},form:{show:!1}},article_title:{title:"设备标题",search:{show:!1},treeNode:!0,type:"input",column:{minWidth:120},form:{show:!0,rules:[{required:!0,message:"标题必填项"}],component:{placeholder:"请输入标题"}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},article_content:{title:"内容",type:"textarea",column:{show:!0,minWidth:120},form:{show:!0,col:{span:24},component:{showWordLimit:!0,maxlength:200,placeholder:"请填写内容"},rules:[{required:!0,message:"内容为必填项"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},device_name:{title:"发布人",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填发布人"},rules:[{required:!1,message:"请填写发布人"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},create_datetime:{title:"发布时间",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填写发布时间"},rules:[{required:!1,message:"请填写发布时间"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},is_default:{title:"状态",type:"input",column:{show:!1,minWidth:120},form:{value:!0,show:!1,component:{placeholder:"请填写状态"},rules:[{required:!1,message:"请填写状态"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}}}}}},v=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:c},Symbol.toStringTag,{value:"Module"}));export{l as G,v as a,c};