1 |
- import{r as a,n as r}from"./index.DXluV3p1.js";import{a as l}from"./authFunction.BnyTXm3L.js";const s="/api/system/articles/";function n(t){return a({url:s+"device-manuals/",method:"get",params:t})}function o(t){return a({url:s+"add-device-manual/",method:"post",data:t})}function u(t){return a({url:"/api/system/device-manuals/"+t.article+"/",method:"put",data:t})}function c(t){return a({url:s+t+"/",method:"delete",data:{id:t}})}const d=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 o(e)),editRequest:async({form:e,row:i})=>(e.id=i.id,e.device_id=Number(e.device),e.title=e.article_title,e.content=e.article_content,await u(e)),delRequest:async({row:e})=>(console.log("delform:::",e),await c(e.article))},actionbar:{buttons:{add:{show:l("area:Create")}}},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:r({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:"请输入标题"}}},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:"内容为必填项"}]}},device_name:{title:"发布人",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填发布人"},rules:[{required:!1,message:"请填写发布人"}]}},create_datetime:{title:"发布时间",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填写发布时间"},rules:[{required:!1,message:"请填写发布时间"}]}},is_default:{title:"状态",type:"input",column:{show:!1,minWidth:120},form:{value:!0,show:!1,component:{placeholder:"请填写状态"},rules:[{required:!1,message:"请填写状态"}]}}}}}},_=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:d},Symbol.toStringTag,{value:"Module"}));export{n as G,_ as a,d as c};
|