import{r as a,P as i}from"./index.DoJnwA7v.js";import"./elementPlus.CqHltQSO.js";import{a as u}from"./authFunction.DSpD5R8m.js";const n="/api/system/column/";function d(t){return a({url:n,method:"get",params:t})}function c(t){return a({url:n,method:"post",data:t})}function m(t){return a({url:n+t.id+"/",method:"put",data:t})}function p(t){return a({url:n+t+"/",method:"delete",data:{id:t}})}function R(){return a({url:"/api/system/column/get_models/",method:"get"})}const f=function({crudExpose:t,props:h,modelDialog:s,selectOptions:o,allModelData:g}){return{crudOptions:{request:{pageRequest:async e=>{if(o.value.id)return await d({menu:o.value.id})},addRequest:async({form:e})=>(e.menu=o.value.id,await c(e)),editRequest:async({form:e,row:r})=>(e.id=r.id,await m(e)),delRequest:async({row:e})=>await p(e.id)},pagination:{show:!1},actionbar:{buttons:{add:{show:u("column:Create")},auto:{text:"自动匹配",type:"success",show:u("column:Match"),click:()=>s.value=!0}}},rowHandle:{fixed:"right",buttons:{view:{show:!1},edit:{show:u("column:Update")},remove:{show:u("column: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 r=e.index??1,l=t.crudBinding.value.pagination;return((l.currentPage??1)-1)*l.pageSize+r+1}}},model:{title:"model",type:"dict-select",dict:i({url:"/api/system/column/get_models/",label:"title",value:"key"}),column:{sortable:!0},form:{rules:[{required:!0,message:"必填项"}],component:{span:12,showSearch:!0,filterable:!0,filterOption(e,r){return r.label.indexOf(e)>=0||r.value.indexOf(e)>=0}}}},title:{title:"中文名",sortable:"custom",search:{show:!0},type:"text",form:{rules:[{required:!0,message:"必填项"}],component:{span:12,placeholder:"请输入中文名"}}},field_name:{title:"字段名",type:"text",search:{show:!0},column:{sortable:!0},form:{rules:[{required:!0,message:"必填项"}],component:{span:12,placeholder:"请输入字段名"}}}}}}},_=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:f},Symbol.toStringTag,{value:"Module"}));export{_ as a,f as c,R as g};
