crud.B5Dv0AGP.js 5.0 KB

1
  1. import{x as r,W as l,s as h}from"./index.04sjABT1.js";import{a as f}from"./authFunction.CRSyvN34.js";import{r as g}from"./vue.YrNK8sx4.js";const a="/api/system/app_user/";function _(t){return r({url:a,method:"get",params:t})}function w(t){return r({url:a+t+"/",method:"get"})}function y(t){return r({url:a,method:"post",data:t})}function b(t){return r({url:a+t.id+"/",method:"put",data:t})}function v(t){return r({url:a+t+"/",method:"delete",data:{id:t}})}function x(){return r({url:a,method:"get"})}const z=function({crudExpose:t}){const s=async e=>await _(e),u=async({row:e})=>await w(e.id),c=async({form:e,row:o})=>(e.id=o.id,await b(e)),m=async({row:e})=>await v(e.id),d=async({form:e})=>await y(e),i=g([]),p=e=>{console.log("selection",e),i.value=e.map(o=>o.id)};return t.selectedIds=i,{crudOptions:{request:{pageRequest:s,editRequest:c,delRequest:m,addRequest:d,getDetail:u},actionbar:{buttons:{add:{show:f("area:Create")}}},form:{wrapper:{buttons:{ok:{text:"提交",show:h(e=>e.mode!=="view")}}}},pagination:{show:!0},table:{rowSelection:{show:!0,multiple:!0},onSelectionChange:p},columns:{$checked:{title:"选择",form:{show:!1},column:{type:"selection",align:"center",width:"55px",columnSetDisabled:!0,selectable(e,o){return e.id}}},_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:"请填写学号"}]},viewForm:{component:{placeholder:""}}},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:"input",column:{minWidth:120,show:!1},form:{component:{placeholder:"请填写密码"}},addForm:{component:{placeholder:"请填写密码"},rules:[{required:!0,message:"请填写密码"}]},editForm:{show:!0},viewForm:{show:!1}},email:{title:"邮箱",type:"input",column:{show:!1,minWidth:120},form:{component:{placeholder:"请填写邮箱"},rules:[{required:!1,message:"请填写邮箱"}]},viewForm:{component:{placeholder:""}}},mobile:{title:"手机号",type:"input",column:{show:!1,minWidth:120},form:{component:{placeholder:"请填写手机号"},rules:[{required:!0,message:"请填写手机号"}]},viewForm:{component:{placeholder:""}}},gender:{title:"性别",type:"dict-select",column:{show:!1,minWidth:120},dict:l({data:[{label:"男",value:1},{label:"女",value:2}]}),form:{component:{placeholder:"请选择性别"},rules:[{required:!0,message:"请选择性别"}]}},user_type:{title:"用户类型",type:"dict-select",search:{show:!1},column:{minWidth:120},dict:l({data:[{label:"学生",value:0},{label:"教师",value:1},{label:"校外团体",value:2},{label:"学院领导",value:3}]}),form:{component:{placeholder:"请填写租户"},rules:[{required:!1,message:"请填写租户"}]}},organization:{title:"学院",type:"input",column:{show:!0,minWidth:200,formatter:({row:e,value:o})=>{if(e.organization_detail&&e.organization_detail.parent_chain&&e.organization_detail.parent_chain.length>=2){const n=e.organization_detail.parent_chain[0];return n.name||n.code||""}return o||e.sub_organization}},form:{component:{placeholder:"请填写学院"},rules:[{required:!1,message:"请填写学院"}]},viewForm:{component:{placeholder:""}}},sub_organization:{title:"专业",type:"input",column:{show:!0,minWidth:120,formatter:({row:e,value:o})=>{if(e.organization_detail&&e.organization_detail.parent_chain&&e.organization_detail.parent_chain.length>=2){const n=e.organization_detail.parent_chain[1];return n.name||n.code||""}return o||e.sub_organization}},form:{component:{placeholder:"请填写专业"},rules:[{required:!1,message:"请填写专业"}]},viewForm:{component:{placeholder:""}}},grade_or_level:{title:"年级",type:"input",column:{show:!0,minWidth:120,formatter:({row:e,value:o})=>{if(e.organization_detail&&e.organization_detail.parent_chain&&e.organization_detail.parent_chain.length>=2){const n=e.organization_detail.parent_chain[2];return n.name||n.code||""}return o||e.grade_or_level}},form:{component:{placeholder:"请填写年级"},rules:[{required:!1,message:"请填写年级"}]},viewForm:{component:{placeholder:""}}},class_or_group:{title:"班级",type:"input",column:{show:!0,minWidth:120,formatter:({row:e,value:o})=>e.organization_detail&&e.organization_detail.name?e.organization_detail.name:o||e.class_or_group},form:{component:{placeholder:"请填写班级"},rules:[{required:!1,message:"请填写班级"}]},viewForm:{component:{placeholder:""}}}}}}},j=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:z},Symbol.toStringTag,{value:"Module"}));export{x as G,j as a,z as c};