import{r as u,H as d}from"./index.ad3efb29.js";import"./elementPlus.4833989a.js";import{U as o,ai as n}from"./vue.adf17aba.js";import"./echarts.72dc8373.js";const r="/api/system/menu_button/";function p(e){return u({url:r,method:"get",params:e})}function m(e){return u({url:r,method:"post",data:e})}function h(e){return u({url:r+e.id+"/",method:"put",data:e})}function f(e){return u({url:r+e+"/",method:"delete",data:{id:e}})}const v=function({crudExpose:e,context:a}){return{crudOptions:{search:{container:{action:{col:{span:8}}}},rowHandle:{fixed:"right",width:200,buttons:{view:{show:!1},edit:{icon:"",type:"primary"},remove:{icon:"",type:"primary"}}},request:{pageRequest:async()=>{if(a.selectOptions.value.id)return await p({menu:a.selectOptions.value.id})},addRequest:async({form:t})=>await m({...t,menu:a.selectOptions.value.id}),editRequest:async({form:t,row:l})=>await h({...t,menu:l.menu}),delRequest:async({row:t})=>await f(t.id)},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}},search:{title:"关键词",column:{show:!1},type:"text",search:{show:!0},form:{show:!1,component:{placeholder:"输入关键词搜索"}}},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:!0},form:{rules:[{required:!0,message:"权限名称必填"}],component:{placeholder:"输入权限名称搜索",props:{clearable:!0,allowCreate:!0,filterable:!0}},helper:{render(){return o(n("el-alert"),{title:"手动输入",type:"warning",description:"页面中按钮的名称或者自定义一个名称"},null)}}}},value:{title:"权限值",type:"text",search:{show:!1},column:{width:120,sortable:!0},form:{rules:[{required:!0,message:"权限标识必填"}],placeholder:"输入权限标识",helper:{render(){return o(n("el-alert"),{title:"唯一值",type:"warning",description:"用于判断前端按钮权限或接口权限"},null)}}}},method:{title:"请求方式",search:{show:!1},type:"dict-select",column:{width:120,sortable:!0},dict:d({data:[{label:"GET",value:0},{label:"POST",value:1,color:"success"},{label:"PUT",value:2,color:"warning"},{label:"DELETE",value:3,color:"danger"}]}),form:{rules:[{required:!0,message:"必填项"}]}},api:{title:"接口地址",search:{show:!1},type:"dict-select",dict:d({getData(){return u({url:"/swagger.json"}).then(t=>{const l=Object.keys(t.paths),i=[];for(const c of l){const s={};s.label=c,s.value=c,i.push(s)}return i})}}),column:{minWidth:250,sortable:!0},form:{rules:[{required:!0,message:"必填项"}],component:{props:{allowCreate:!0,filterable:!0,clearable:!0}},helper:{render(){return o(n("el-alert"),{title:"请正确填写，以免请求时被拦截。匹配单例使用正则,例如:/api/xx/.*?/",type:"warning"},null)}}}}}}}};export{v as createCrudOptions};
