import{r as o,D as l,W as a}from"./index.BKEMpsLA.js";import{a as n}from"./authFunction.DqglRaEG.js";const s="/api/system/maintenance/plan/";function u(r){return o({url:s,method:"get",params:r})}function i(r){return o({url:s,method:"post",data:r})}function d(r){return o({url:s+r.id+"/",method:"put",data:r})}function m(r){return o({url:s+r+"/",method:"delete",data:{id:r}})}function y(){return o({url:s,method:"get"})}const c=function({crudExpose:r}){return{crudOptions:{request:{pageRequest:async e=>await u(e),addRequest:async({form:e})=>await i(e),editRequest:async({form:e,row:t})=>(e.id=t.id,await d(e)),delRequest:async({row:e})=>await m(e.id)},form:{wrapper:{buttons:{ok:{text:"提交"}}}},actionbar:{buttons:{add:{show:n("area:Create")}}},toolbar:{show:!1},rowHandle:{fixed:"right",width:220,buttons:{view:{show:!0},remove:{show:!0},edit:{show:!0}}},pagination:{show:!1},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},plan_code:{title:"计划编码",search:{show:!1},treeNode:!0,type:"input",column:{minWidth:120},form:{show:!1,rules:[{required:!0,message:"名称必填项"}],component:{placeholder:"请输入名称"}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},plan_name:{title:"计划名称",search:{show:!0},treeNode:!0,type:"input",column:{minWidth:120},form:{rules:[{required:!0,message:"名称必填项"}],component:{placeholder:"请输入计划名称"}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},description:{title:"计划描述",type:"input",column:{show:!0,minWidth:120},form:{component:{placeholder:"请填写计划描述"},rules:[{required:!1,message:"请填写计划描述"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},device:{title:"设备id",type:"dict-select",column:{minWidth:120},dict:a({url:"/api/system/device/",value:"id",label:"name"}),form:{show:!0,component:{placeholder:"请选择设备id"},rules:[{required:!0,message:"请选择设备id"}]},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:""}]}},device_code:{title:"设备编码",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填写设备编码"},rules:[{required:!1,message:"请填写设备编码"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},cycle_type:{title:"维护类型",type:"dict-select",column:{show:!1,minWidth:120},dict:a({data:[{label:"每季度",value:3}]}),form:{show:!0,component:{placeholder:"请选择维护类型"},rules:[{required:!0,message:"请选择维护类型"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},cycle_type_display:{title:"维护类型",type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请填写排序"},rules:[{required:!1,message:"请填写排序"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},maintenance_content:{title:"维护内容",type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请填写维护内容"},rules:[{required:!0,message:"请填写维护内容"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},maintenance_person:{title:"维护人",type:"input",column:{minWidth:120},form:{show:!0,component:{placeholder:"请填写维护人"},rules:[{required:!0,message:"请填写维护人"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},start_date:{title:"维护开始时间",type:"date",column:{minWidth:120},form:{show:!0,component:{placeholder:"请填写维护开始时间"},rules:[{required:!0,message:"请填写维护开始时间"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]},valueResolve({form:e,value:t}){e.start_date=t?l(t).format("YYYY-MM-DD"):null},valueBuilder({form:e,value:t}){e.start_date=t}},next_maintenance_date:{title:"下次维护开始时间",type:"date",column:{minWidth:120,formatter:({value:e})=>e?l(e).format("YYYY-MM-DD"):""},form:{show:!1,component:{placeholder:"请填写维护开始时间"},rules:[{required:!1,message:"请填写维护开始时间"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]},valueResolve({form:e,value:t}){e.purchase_date=t?l(t).format("YYYY-MM-DD"):null},valueBuilder({form:e,value:t}){e.purchase_date=t}},status_display:{title:"维护状态",type:"input",column:{minWidth:120},form:{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{y as G,v as a,c};
