import{r,y as a,n as i}from"./index.Ib81wAC-.js";import{a as l}from"./authFunction.BuAksgtG.js";const o="/api/system/articles/";function n(t){return r({url:o+"device-manuals/",method:"get",params:t})}function u(t){return r({url:o+"add-device-manual/",method:"post",data:t})}function d(t){return r({url:"/api/system/device-manuals/"+t.id+"/",method:"put",data:t})}function c(t){return r({url:o+t+"/",method:"delete",data:{id:t}})}const{compute:m}=a(),p=function({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await n(e),addRequest:async({form:e})=>(e.device_id=Number(e.device),e.title=e.article_title,e.content=e.article_content,await u(e)),editRequest:async({form:e,row:s})=>(e.id=s.id,e.device_id=Number(e.device),e.title=e.article_title,e.content=e.article_content,await d(e)),delRequest:async({row:e})=>await c(e.id)},actionbar:{buttons:{add:{show:l("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:i({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:!0},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:"editor-wang5",column:{show:!0,minWidth:120},form:{show:!0,col:{span:24},rules:[{required:!0,message:"内容为必填项"}],component:{disabled:!1,id:"1",editorConfig:{readOnly:m(e=>{const{mode:s}=e;return s!=="add"})},uploader:{type:"form",buildUrl(e){return console.log("res::::",e),e.url}}}},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:p},Symbol.toStringTag,{value:"Module"}));export{n as G,v as a,p as c};