import{r as o,W as l,z as d,s as c}from"./index.D93ign_E.js";import{d as m}from"./dictionary.D3oPLwQH.js";import{a as s}from"./authFunction.BLxX_QUS.js";import"./vue.D1BjjNmv.js";const a="/api/system/role/";function h(t){return o({url:a,method:"get",params:t})}function p(t){return o({url:a,method:"post",data:t})}function n(t){return o({url:a+t.id+"/",method:"put",data:t})}function w(t){return o({url:a+t+"/",method:"delete",data:{id:t}})}const D=function({crudExpose:t,context:i}){return{crudOptions:{request:{pageRequest:async e=>await h(e),addRequest:async({form:e})=>await p(e),editRequest:async({form:e,row:r})=>(e.id=r.id,await n(e)),delRequest:async({row:e})=>await w(e.id)},pagination:{show:!0},actionbar:{buttons:{add:{show:s("role:Create")}}},rowHandle:{fixed:"right",width:320,buttons:{view:{show:!0},edit:{show:s("role:Update")},remove:{show:s("role:Delete")},permission:{type:"primary",text:"权限配置",show:s("role:Permission"),click:e=>{const{row:r}=e;i.RoleDrawer.handleDrawerOpen(r),i.RoleMenuBtn.setState([]),i.RoleMenuField.setState([])}}}},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",column:{show:!1},search:{show:!1},form:{show:!1}},name:{title:"角色名称",search:{show:!0},column:{minWidth:120,sortable:"custom"},form:{rules:[{required:!0,message:"角色名称必填"}],component:{placeholder:"请输入角色名称"}}},key:{title:"权限标识",search:{show:!1},column:{minWidth:120,sortable:"custom",columnSetDisabled:!0},form:{rules:[{required:!0,message:"权限标识必填"}],component:{placeholder:"输入权限标识"}},valueBuilder(e){const{row:r,key:u}=e;return r[u]}},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:d(e=>()=>{n(e.row).then(r=>{c(r.msg)})})}},dict:l({value:m("button_status_bool")})}}}}};export{D as createCrudOptions};
