import{r as i,m as u,v as n,x as d,s as c}from"./index.lP_uh0LI.js";import{a as s}from"./authFunction.z5AMEiSQ.js";import{d as p}from"./dictionary.D0i47SYU.js";import"./vue.BxlDVA1H.js";const r=`${u.system}api_white_list/`;function m(t){return i({url:r,method:"get",params:t})}function h(t){return i({url:r,method:"post",data:t})}function l(t){return i({url:r+t.id+"/",method:"put",data:t})}function w(t){return i({url:r+t+"/",method:"delete",data:{id:t}})}const R=function({crudExpose:t}){return{crudOptions:{request:{pageRequest:async e=>await m(e),addRequest:async({form:e})=>await h(e),editRequest:async({form:e,row:a})=>(e.id=a.id,await l(e)),delRequest:async({row:e})=>await w(e.id)},actionbar:{buttons:{add:{show:s("api_white_list:Create")}}},rowHandle:{fixed:"right",width:150,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"primary",link:!0,show:s("api_white_list:Update")},remove:{iconRight:"Delete",type:"primary",link:!0,show:s("api_white_list:Delete")}}},form:{col:{span:24},labelWidth:"110px",wrapper:{is:"el-dialog",width:"600px"}},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:e=>{let a=e.index??1,o=t.crudBinding.value.pagination;return((o.currentPage??1)-1)*o.pageSize+a+1}}},search:{title:"关键词",column:{show:!1},search:{show:!0,component:{props:{clearable:!0},placeholder:"请输入关键词"}},form:{show:!1,component:{props:{clearable:!0}}}},method:{title:"请求方式",sortable:"custom",search:{disabled:!1},type:"dict-select",dict:n({data:[{label:"GET",value:0},{label:"POST",value:1},{label:"PUT",value:2},{label:"DELETE",value:3},{label:"PATCH",value:4}]}),column:{minWidth:120},form:{rules:[{required:!0,message:"必填项"}],component:{span:12},itemProps:{class:{yxtInput:!0}}}},enable_datasource:{title:"数据权限认证",search:{disabled:!1},type:"dict-radio",column:{minWidth:120,component:{name:"fs-dict-switch",activeText:"",inactiveText:"",style:"--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #dcdfe6",onChange:d(e=>()=>{l(e.row).then(a=>{c(a.msg)})})}},dict:n({data:p("button_status_bool")})}}}}};export{R as createCrudOptions};