import{t as s,r as d,W as m}from"./index.MZHeOOzU.js";const i="/api/system/app_user/";async function p(o){const a=s({url:i+"?user_type=1",method:"get",params:o});return console.log("ressssss",a),a}function h(o){return s({url:i+o+"/",method:"get"})}function f(o){return s({url:i,method:"post",data:o})}function w(o){return s({url:i+o.id+"/",method:"put",data:o})}function g(o){return s({url:i+o+"/",method:"delete",data:{id:o}})}function F(){return s({url:i,method:"get"})}const y=function({crudExpose:o}){return{crudOptions:{request:{pageRequest:async e=>await p(e),editRequest:async({form:e,row:t})=>(e.id=t.id,await w(e)),delRequest:async({row:e})=>await g(e.id),addRequest:async({form:e})=>await f(e),getDetail:async({row:e})=>await h(e.id)},toolbar:{show:!1},form:{wrapper:{buttons:{ok:{text:"提交",show:d(e=>e.mode!=="view")}}}},actionbar:{buttons:{add:{show:!1}}},pagination:{show:!0},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}},user_code:{title:"工号",type:"input",column:{minWidth:120},form:{component:{placeholder:"请填写工号"},rules:[{required:!0,message:"请填写工号"}]}},username:{title:"用户名",type:"input",column:{show:!1,minWidth:120},form:{component:{placeholder:"请填写用户名"},rules:[{required:!0,message:"请填写用户名"}]},viewForm:{component:{placeholder:""}}},name:{title:"姓名",search:{show:!0},treeNode:!0,type:"input",column:{minWidth:120},form:{rules:[{required:!0,message:"姓名必填项"}],component:{placeholder:"请输入姓名"}}},password:{title:"密码",type:"password",column:{minWidth:120,show:!1},form:{component:{placeholder:"请填写密码"}},addForm:{component:{placeholder:"请填写密码"},rules:[{required:!0,message:"请填写密码"},{validator:(e,t,r)=>{if(!t){r();return}if(t.length<8){r(new Error("密码长度不能少于8位"));return}const n=/[a-zA-Z]/.test(t),l=/[0-9]/.test(t),u=/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?`~]/.test(t);if(!n||!l||!u){r(new Error("密码必须包含字母、数字和特殊符号"));return}r()},trigger:"blur"}]},editForm:{show:!0,component:{placeholder:"留空则不修改密码",type:"password",showPassword:!0},rules:[{validator:(e,t,r)=>{if(!t||t.trim()===""){r();return}const n=8,l=/[a-zA-Z]/.test(t),u=/\d/.test(t),c=/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(t);if(t.length{const r=n=>n!=null&&n!==""&&n!=="nan"&&!Number.isNaN(n);return e.organization_detail&&e.organization_detail.name?e.organization_detail.name:r(t)?t:""}},form:{show:d(e=>e.user_type===1||e.user_type===3),component:{placeholder:"请选择学院"},rules:[{required:!1,message:"请选择学院"}]},viewForm:{component:{placeholder:""}}},sub_organization:{title:"专业",type:"input",column:{show:!1,minWidth:120},form:{show:!1,component:{placeholder:"请填写专业"},rules:[{required:!1,message:"请填写专业"}]},viewForm:{component:{placeholder:""}}},grade_or_level:{title:"年级",type:"input",column:{show:!1,minWidth:120},form:{show:!1,component:{placeholder:"请填写年级"},rules:[{required:!1,message:"请填写年级"}]},viewForm:{component:{placeholder:""}}},class_or_group:{title:"班级",type:"input",column:{show:!1,minWidth:120},form:{show:!1,component:{placeholder:"请填写班级"},rules:[{required:!1,message:"请填写班级"}]},viewForm:{component:{placeholder:""}}}}}}},R=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:y},Symbol.toStringTag,{value:"Module"}));export{F as G,R as a,y as c};