import{u as o,D as l,U as n,A as u,G as i}from"./api.DLjJ2FSX.js";import{W as m,n as c,E as a}from"./index.Df8UJ10K.js";import{aH as p}from"./vue.D1BjjNmv.js";const x=function({crudExpose:r}){return p(),{crudOptions:{toolbar:{buttons:{search:{show:!1},refresh:{show:!1},compact:{show:!1},export:{text:"导出",type:"primary",size:"small",icon:"upload",circle:!1,display:!0,show:!1},columns:{show:!1}}},request:{pageRequest:async e=>await i(e),addRequest:async({form:e})=>await u(e),editRequest:async({form:e,row:t})=>(e.id=t.id,await n(e)),delRequest:async({row:e})=>await l(e.id)},search:{col:{span:3},show:!0,autoSearch:!1,buttons:{search:{size:"small"},reset:{size:"small"}}},actionbar:{buttons:{add:{size:"small",show:!0}}},rowHandle:{fixed:"right",width:260,buttons:{view:{size:"small",text:"详细信息",type:"primary",show:!0},edit:{show:!1},remove:{show:!1},changeStatus:{size:"small",text:"修改状态",iconRight:"Edit",show:!0,click:async({row:e})=>{const t={0:"试用",1:"正式",2:"暂停",3:"过期",4:"禁用"},{value:s}=await c.prompt(`请选择状态：
0: 试用
1: 正式
2: 暂停
3: 过期
4: 禁用`,"修改状态",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^[0-4]$/,inputErrorMessage:"请输入有效的状态值（0-4）"});if(s!==void 0)try{await o(e.id,parseInt(s)),a.success(`状态已更新为：${t[s]}`),r.doRefresh()}catch{a.error("状态更新失败")}}}}},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},search:{title:"关键字搜索",search:{show:!0,type:"input"},type:"input",form:{component:{placeholder:"请输入"},show:!1},column:{show:!1}},schema_name:{title:"商户标识",type:"input",search:{show:!0},form:{rules:[{required:!0,message:"商户标识必填"}],component:{placeholder:"请输入商户标识"}},column:{minWidth:120}},name:{title:"商户名称",search:{show:!0},type:"input",form:{rules:[{required:!0,message:"商户名称必填"}],component:{placeholder:"请输入商户名称"}},column:{minWidth:120}},contact_name:{title:"联系人",type:"input",search:{show:!0},form:{rules:[{required:!0,message:"联系人必填"}],component:{placeholder:"请输入联系人姓名"}},column:{minWidth:100}},contact_phone:{title:"联系电话",type:"input",search:{show:!0},form:{rules:[{required:!0,message:"联系电话必填"},{pattern:/^1[3-9]\d{9}$/,message:"请输入正确的手机号码"}],component:{placeholder:"请输入联系电话"}},column:{minWidth:120}},contact_email:{title:"联系邮箱",type:"input",search:{show:!0},form:{rules:[{required:!0,message:"联系邮箱必填"},{type:"email",message:"请输入正确的邮箱地址"}],component:{placeholder:"请输入联系邮箱"}},column:{minWidth:150}},admin_user:{title:"管理员信息",type:"group",form:{group:!0},column:{show:!1},children:{"admin_user.username":{title:"管理员账号",type:"input",form:{rules:[{required:!0,message:"管理员账号必填"}],component:{placeholder:"请输入管理员账号"}}},"admin_user.password":{title:"管理员密码",type:"password",form:{show:!1,rules:[{required:!0,message:"管理员密码必填"},{min:6,message:"密码长度不能小于6位"}],component:{placeholder:"请输入管理员密码",showPassword:!0}}},"admin_user.name":{title:"管理员姓名",type:"input",form:{rules:[{required:!0,message:"管理员姓名必填"}],component:{placeholder:"请输入管理员姓名"}}},"admin_user.email":{title:"管理员邮箱",type:"input",form:{rules:[{required:!0,message:"管理员邮箱必填"},{type:"email",message:"请输入正确的邮箱地址"}],component:{placeholder:"请输入管理员邮箱"}}}}},status:{title:"状态",search:{show:!0},type:"dict-select",form:{component:{placeholder:"请选择状态"}},column:{minWidth:120},dict:m({data:[{value:"1",label:"正式"},{value:"2",label:"暂停"},{value:"0",label:"试用中"},{value:3,label:"已停用"},{value:4,label:"禁用"}]})},update_datetime:{title:"数据更新时间",type:"datetime",column:{minWidth:150},form:{show:!1}},description:{title:"商户描述",type:"textarea",form:{component:{placeholder:"请输入商户描述",rows:3}},column:{minWidth:180}}}}}};export{x as createCrudOptions};
