1 |
- import{r,W as a}from"./index.CsNe-70m.js";import{a as s}from"./authFunction.BvfKVxRV.js";const n="/api/system/device/category/";function u(e){return r({url:n,method:"get",params:e})}function i(e){return r({url:n+e+"/",method:"get"})}function l(e){return r({url:n,method:"post",data:e})}function d(e){return r({url:n+e.id+"/",method:"put",data:e})}function c(e){return r({url:n+e+"/",method:"delete",data:{id:e}})}function b(){return r({url:n,method:"get"})}const m=function({crudExpose:e}){return{crudOptions:{request:{pageRequest:async t=>await u(t),addRequest:async({form:t})=>await l(t),editRequest:async({form:t,row:o})=>(t.id=o.id,await d(t)),delRequest:async({row:t})=>await c(t.id),getDetail:async({row:t})=>await i(t.id)},toolbar:{show:!1},rowHandle:{buttons:{remove:{show:!0},edit:{show:!1}}},actionbar:{buttons:{add:{show:s("area:Create")}}},pagination:{show:!1},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},code:{title:"分类编码",type:"input",column:{minWidth:120},form:{show:!1}},name:{title:"名称",search:{show:!0},treeNode:!0,type:"input",column:{minWidth:120},form:{rules:[{required:!0,message:"名称必填项"}],component:{placeholder:"请输入名称"}}},description:{title:"设备描述",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写设备描述"},rules:[{required:!1,message:"请填写设备描述"}]}},parent:{title:"父级",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写设备父级"},rules:[{required:!1,message:"请填写设备父级"}]}},sort:{title:"排序",type:"input",column:{minWidth:120},form:{value:1,show:!1,component:{placeholder:"请填写排序"},rules:[{required:!0,message:"请填写排序"}]}},status:{title:"状态",type:"dict-select",column:{minWidth:120},dict:a({data:[{label:"启用",value:!0},{label:"禁用",value:!1}]}),form:{component:{placeholder:"请填写状态"},rules:[{required:!0,message:"请填写状态"}]}},tenant:{title:"租户",type:"input",value:1,column:{show:!1,minWidth:120},form:{show:!1,component:{placeholder:"请填写租户"},rules:[{required:!1,message:"请填写租户"}]}}}}}},W=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:m},Symbol.toStringTag,{value:"Module"}));export{b as G,W as a,m as c};
|