import{r,l as u,P as c,s as d}from"./index.fM6cvGYs.js";import"./elementPlus.CXoFsoPv.js";import{d as m}from"./dictionary.DYQ_oUgW.js";import{a}from"./authFunction.VC7PaOWG.js";const s="/api/system/role/";function P(){return r({url:s+"field_permission/",method:"get"})}function p(t){return r({url:s,method:"get",params:t})}function h(t){return r({url:s,method:"post",data:t})}function i(t){return r({url:s+t.id+"/",method:"put",data:t})}function w(t){return r({url:s+t+"/",method:"delete",data:{id:t}})}const f=function({crudExpose:t,rolePermission:y,handleDrawerOpen:n}){return{crudOptions:{request:{pageRequest:async e=>await p(e),addRequest:async({form:e})=>await h(e),editRequest:async({form:e,row:o})=>(e.id=o.id,await i(e)),delRequest:async({row:e})=>await w(e.id)},pagination:{show:!0},actionbar:{buttons:{add:{show:a("role:Create")}}},rowHandle:{fixed:"right",width:320,buttons:{view:{show:!0},edit:{show:a("role:Update")},remove:{show:a("role:Delete")},permission:{type:"primary",text:"权限配置",show:a("role:Permission"),tooltip:{placement:"top",content:"权限配置"},click:e=>{const{row:o}=e;n(o)}}}},form:{col:{span:24},labelWidth:"100px",wrapper:{is:"el-dialog",width:"600px"}},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},id:{title:"ID",type:"text",column:{show:!1},search:{show:!1},form:{show:!1}},name:{title:"角色名称",type:"text",search:{show:!0},column:{minWidth:120,sortable:"custom"},form:{rules:[{required:!0,message:"角色名称必填"}],component:{placeholder:"请输入角色名称"}}},key:{title:"权限标识",type:"text",search:{show:!1},column:{minWidth:120,sortable:"custom",columnSetDisabled:!0},form:{rules:[{required:!0,message:"权限标识必填"}],component:{placeholder:"输入权限标识"}},valueBuilder(e){const{row:o,key:l}=e;return o[l]}},sort:{title:"排序",search:{show:!1},type:"number",column:{minWidth:90,sortable:"custom"},form:{rules:[{required:!0,message:"排序必填"}],value:1}},status:{title:"状态",search:{show:!0},type:"dict-radio",column:{width:100,component:{name:"fs-dict-switch",activeText:"",inactiveText:"",style:"--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #dcdfe6",onChange:u(e=>()=>{i(e.row).then(o=>{d(o.msg)})})}},dict:c({data:m("button_status_bool")})}}}}},D=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:f},Symbol.toStringTag,{value:"Module"}));export{P as G,D as a,f as c};
