1 |
- import{d as L,y as M,e as N,r as n,x as P,w as Y,b as K,k as Q,a as e,o as i,C as f,A as l,f as a,a2 as X,c as x,Q as S,F as E,ac as $,P as z,a8 as G,U as J,H as O,K as W,R as Z,S as aa,V as ea,Y as la,__tla as ta}from"./index-6e0fa573.js";import{E as sa,__tla as da}from"./el-tree-select-490c6b16.js";import{a as ra,D as ua,__tla as oa}from"./dict-33efee75.js";import{C as F}from"./constants-c811e5ff.js";import{d as ma,h as na}from"./tree-0af4953a.js";import{g as pa,__tla as ia}from"./index-55e76298.js";import{g as _a,__tla as ca}from"./index-bf5f582f.js";import{a as fa,c as va,u as ba,__tla as ya}from"./index-f6f28fe0.js";import{u as Va,__tla as ga}from"./useMessage-7f978edc.js";import{_ as ha}from"./_plugin-vue_export-helper-1b428a4d.js";let D,wa=Promise.all([(()=>{try{return ta}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ya}catch{}})(),(()=>{try{return ga}catch{}})()]).then(async()=>{D=ha(L({name:"SystemUserForm",__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(v,{expose:q,emit:ka}){const A=M(),B=N(()=>A.getMobile),{t:y}=z(),V=Va(),g=n(!1);n("");const _=n(!1),h=n(""),t=n({name:"",nickname:"",deptId:"",mobile:"",email:"",id:void 0,username:"",password:"",sex:void 0,postIds:[],remark:"",status:F.ENABLE,roleIds:[],categoryId:1,avatar:""}),R=P({username:[{required:!0,message:"\u7528\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],nickname:[{required:!0,message:"\u7528\u6237\u6635\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],password:[{required:!0,message:"\u7528\u6237\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],email:[{type:"email",message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1\u5730\u5740",trigger:["blur","change"]}],mobile:[{required:!0,pattern:/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}]}),c=n(),w=n([]),k=n([]),b=v;Y(b,m=>{t.value.avatar=m.avatar},{immediate:!0}),K(()=>{(async(m,d)=>{if(g.value=!0,h.value=m,T(),d){_.value=!0;try{t.value=await fa(d)}finally{_.value=!1}}w.value=na(await _a()),k.value=await pa()})(b.openType,b.obj.id)}),q({submitForm:async m=>{if(!c||!await c.value.validate())return;_.value=!0;const d=n(!1);try{t.value.avatar=m;const r=t.value;h.value==="create"?(await va(r),V.success(y("common.createSuccess"))):(await ba(r),V.success(y("common.updateSuccess"))),g.value=!1,d.value=!0}finally{_.value=!1}return d.value}});const T=()=>{var m;t.value={nickname:"",deptId:"",mobile:"",email:"",id:void 0,username:"",password:"",sex:void 0,postIds:[],remark:"",status:F.ENABLE,roleIds:[],categoryId:1,avatar:""},(m=c.value)==null||m.resetFields()};return(m,d)=>{const r=G,u=J,o=O,j=sa,p=W,I=Z,U=aa,C=ea,H=la;return Q((i(),f(C,{ref_key:"formRef",ref:c,model:e(t),rules:e(R),"label-width":"120px",style:{padding:"10px"},disabled:v.isDetail,class:$({view:v.isDetail,"mobile-card":e(B)})},{default:l(()=>[a(p,null,{default:l(()=>[a(o,{span:12},{default:l(()=>[a(u,{label:"\u7528\u6237\u6635\u79F0",prop:"nickname"},{default:l(()=>[a(r,{modelValue:e(t).nickname,"onUpdate:modelValue":d[0]||(d[0]=s=>e(t).nickname=s),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u6635\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),a(o,{span:12},{default:l(()=>[a(u,{label:"\u5F52\u5C5E\u90E8\u95E8",prop:"deptId"},{default:l(()=>[a(j,{modelValue:e(t).deptId,"onUpdate:modelValue":d[1]||(d[1]=s=>e(t).deptId=s),data:e(w),props:e(ma),"check-strictly":"","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u90E8\u95E8"},null,8,["modelValue","data","props"])]),_:1})]),_:1})]),_:1}),a(p,null,{default:l(()=>[a(o,{span:12},{default:l(()=>[a(u,{label:"\u59D3\u540D",prop:"name"},{default:l(()=>[a(r,{modelValue:e(t).name,"onUpdate:modelValue":d[2]||(d[2]=s=>e(t).name=s),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),a(o,{span:12},{default:l(()=>[a(u,{label:"\u90AE\u7BB1",prop:"email"},{default:l(()=>[a(r,{modelValue:e(t).email,"onUpdate:modelValue":d[3]||(d[3]=s=>e(t).email=s),maxlength:"50",placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(p,null,{default:l(()=>[a(o,{span:12},{default:l(()=>[a(u,{label:"\u7528\u6237\u540D",prop:"username"},{default:l(()=>[a(r,{modelValue:e(t).username,"onUpdate:modelValue":d[4]||(d[4]=s=>e(t).username=s),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),e(t).id===void 0?(i(),f(o,{key:0,span:12},{default:l(()=>[a(u,{label:"\u7528\u6237\u5BC6\u7801",prop:"password"},{default:l(()=>[a(r,{modelValue:e(t).password,"onUpdate:modelValue":d[5]||(d[5]=s=>e(t).password=s),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u5BC6\u7801","show-password":"",type:"password"},null,8,["modelValue"])]),_:1})]),_:1})):X("",!0)]),_:1}),a(p,null,{default:l(()=>[a(o,{span:12},{default:l(()=>[a(u,{label:"\u7528\u6237\u6027\u522B"},{default:l(()=>[a(U,{modelValue:e(t).sex,"onUpdate:modelValue":d[6]||(d[6]=s=>e(t).sex=s),placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),x(E,null,S(e(ra)(e(ua).SYSTEM_USER_SEX),s=>(i(),f(I,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(o,{span:12},{default:l(()=>[a(u,{label:"\u5C97\u4F4D"},{default:l(()=>[a(U,{modelValue:e(t).postIds,"onUpdate:modelValue":d[7]||(d[7]=s=>e(t).postIds=s),multiple:"",placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),x(E,null,S(e(k),s=>(i(),f(I,{key:s.id,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(p,null,{default:l(()=>[a(o,{span:24},{default:l(()=>[a(u,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:l(()=>[a(r,{modelValue:e(t).mobile,"onUpdate:modelValue":d[8]||(d[8]=s=>e(t).mobile=s),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(p,null,{default:l(()=>[a(o,{span:24},{default:l(()=>[a(u,{label:"\u5907\u6CE8"},{default:l(()=>[a(r,{modelValue:e(t).remark,"onUpdate:modelValue":d[9]||(d[9]=s=>e(t).remark=s),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[H,e(_)]])}}}),[["__scopeId","data-v-6882b6fa"]])});export{wa as __tla,D as default};
|