1 |
- import{r,n as a}from"./index.CN0f9AXO.js";import{a as l}from"./authFunction.Z-dZyTH_.js";const o="/api/system/device-damage-records/";function n(e){return r({url:o,method:"get",params:e})}function u(e){return r({url:o,method:"post",data:e})}function i(e){return r({url:o+e.id+"/",method:"put",data:e})}function d(e){return r({url:o+e+"/",method:"delete",data:{id:e}})}function q(){return r({url:o,method:"get"})}const m=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await n(t),addRequest:async({form:t})=>await u(t),editRequest:async({form:t,row:s})=>(t.id=s.id,await i(t)),delRequest:async({row:t})=>await d(t.id)},form:{wrapper:{buttons:{ok:{text:"提交"}}}},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:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},damage_no:{title:"编号",search:{show:!0},treeNode:!0,type:"input",column:{minWidth:120},form:{show:!1,component:{placeholder:"请输入编号"}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},device:{title:"设备id",type:"dict-select",column:{show:!1,minWidth:120},dict:a({url:"/api/system/device/",value:"id",label:"name"}),form:{component:{placeholder:"请填写设备id"},rules:[{required:!0,message:"请填写设备id"}]},editForm:{component:{disabled:!0}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},device_code:{title:"设备编码",type:"input",column:{show:!1,minWidth:120},form:{show:!1,component:{placeholder:"请填写设备编码"},rules:[{required:!0,message:"请填写设备编码"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},device_name:{title:"设备名称",type:"input",column:{show:!0,minWidth:120},form:{show:!1,component:{placeholder:"请填写设备名称"},rules:[{required:!0,message:"请填写设备名称"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},quantity:{title:"库存数量",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写库存数量"},rules:[{required:!1,message:"请填写库存数量"}]},editForm:{component:{disabled:!0}},valueResolve({form:t,value:s}){t.quantity=Number(s)},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},damage_type:{title:"维修类型",type:"dict-select",dict:a({data:[{label:"报废",value:0},{label:"维修",value:1}]}),column:{minWidth:120},form:{value:1,show:!0,component:{placeholder:"请填写排序"},rules:[{required:!1,message:"请填写排序"}]},editForm:{component:{disabled:!0}},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},damage_reason:{title:"报损原因",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写报损原因"},rules:[{required:!1,message:"请填写报损原因"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},estimated_loss:{title:"预估维修费用",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写预估维修费用"},rules:[{required:!1,message:"请填写预估维修费用"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},responsible_person:{title:"负责人",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写负责人"},rules:[{required:!1,message:"请填写负责人"}]},viewForm:{component:{placeholder:""},rules:[{required:!0,message:""}]}},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:m},Symbol.toStringTag,{value:"Module"}));export{q as G,v as a,m as c};
|