1 |
- import{r,n as l,A as c,s as d}from"./index.59c4c6ab.js";import"./elementPlus.8e650391.js";import{d as m}from"./dictionary.a8cda1ac.js";import{a}from"./authFunction.db0b1d3f.js";const s="/api/system/role/";function D(){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 n(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:i}){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 n(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;i(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:u}=e;return o[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:l(e=>()=>{n(e.row).then(o=>{d(o.msg)})})}},dict:c({data:m("button_status_bool")})}}}}},P=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:f},Symbol.toStringTag,{value:"Module"}));export{D as G,P as a,f as c};
|