1 |
- import{d as L,X as R,J as X,r as m,e as Y,K as z,k as H,v as J,a,o as i,q as f,w as l,f as e,O as K,c as x,n as E,F as S,Y as O,h as P,U as $,z as G,E as Q,i as W,x as Z,y as ee,C as ae,H as le,__tla as te}from"./index-73e02845.js";import{E as se,__tla as de}from"./el-tree-select-a05a2d94.js";import{a as re,D as ue,__tla as oe}from"./dict-0fdd6c74.js";import{C as q}from"./constants-a3c69b57.js";import{d as me,h as ne}from"./tree-fd3a041e.js";import{g as pe,__tla as ie}from"./index-6cfa5791.js";import{g as _e,__tla as ce}from"./index-88439839.js";import{a as fe,c as ve,u as be,__tla as ye}from"./index-95424779.js";import{u as Ve,__tla as he}from"./useMessage-1490ad82.js";import{_ as ge}from"./_plugin-vue_export-helper-1b428a4d.js";let D,we=Promise.all([(()=>{try{return te}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return he}catch{}})()]).then(async()=>{D=ge(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:F,emit:ke}){const B=R(),M=X(()=>B.getMobile),{t:y}=P(),V=Ve(),h=m(!1);m("");const _=m(!1),g=m(""),s=m({name:"",nickname:"",deptId:"",mobile:"",email:"",id:void 0,username:"",password:"",sex:void 0,postIds:[],remark:"",status:q.ENABLE,roleIds:[],categoryId:1,avatar:""}),N=Y({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=m(),w=m([]),k=m([]),b=v;z(b,r=>{s.value.avatar=r.avatar},{immediate:!0}),H(()=>{(async(r,d)=>{if(h.value=!0,g.value=r,T(),d){_.value=!0;try{s.value=await fe(d)}finally{_.value=!1}}w.value=ne(await _e()),k.value=await pe()})(b.openType,b.obj.id)}),F({submitForm:async()=>{if(!c||!await c.value.validate())return;_.value=!0;const r=m(!1);try{const d=s.value;g.value==="create"?(await ve(d),V.success(y("common.createSuccess"))):(await be(d),V.success(y("common.updateSuccess"))),h.value=!1,r.value=!0}finally{_.value=!1}return r.value}});const T=()=>{var r;s.value={nickname:"",deptId:"",mobile:"",email:"",id:void 0,username:"",password:"",sex:void 0,postIds:[],remark:"",status:q.ENABLE,roleIds:[],categoryId:1,avatar:""},(r=c.value)==null||r.resetFields()};return(r,d)=>{const n=$,u=G,o=Q,j=se,p=W,I=Z,U=ee,A=ae,C=le;return J((i(),f(A,{ref_key:"formRef",ref:c,model:a(s),rules:a(N),"label-width":"120px",style:{padding:"10px"},disabled:v.isDetail,class:O({view:v.isDetail,"mobile-card":a(M)})},{default:l(()=>[e(p,null,{default:l(()=>[e(o,{span:12},{default:l(()=>[e(u,{label:"\u7528\u6237\u6635\u79F0",prop:"nickname"},{default:l(()=>[e(n,{modelValue:a(s).nickname,"onUpdate:modelValue":d[0]||(d[0]=t=>a(s).nickname=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u6635\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:l(()=>[e(u,{label:"\u5F52\u5C5E\u90E8\u95E8",prop:"deptId"},{default:l(()=>[e(j,{modelValue:a(s).deptId,"onUpdate:modelValue":d[1]||(d[1]=t=>a(s).deptId=t),data:a(w),props:a(me),"check-strictly":"","node-key":"id",placeholder:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u90E8\u95E8"},null,8,["modelValue","data","props"])]),_:1})]),_:1})]),_:1}),e(p,null,{default:l(()=>[e(o,{span:12},{default:l(()=>[e(u,{label:"\u59D3\u540D",prop:"name"},{default:l(()=>[e(n,{modelValue:a(s).name,"onUpdate:modelValue":d[2]||(d[2]=t=>a(s).name=t),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:l(()=>[e(u,{label:"\u90AE\u7BB1",prop:"email"},{default:l(()=>[e(n,{modelValue:a(s).email,"onUpdate:modelValue":d[3]||(d[3]=t=>a(s).email=t),maxlength:"50",placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(p,null,{default:l(()=>[e(o,{span:12},{default:l(()=>[e(u,{label:"\u7528\u6237\u540D",prop:"username"},{default:l(()=>[e(n,{modelValue:a(s).username,"onUpdate:modelValue":d[4]||(d[4]=t=>a(s).username=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),a(s).id===void 0?(i(),f(o,{key:0,span:12},{default:l(()=>[e(u,{label:"\u7528\u6237\u5BC6\u7801",prop:"password"},{default:l(()=>[e(n,{modelValue:a(s).password,"onUpdate:modelValue":d[5]||(d[5]=t=>a(s).password=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u5BC6\u7801","show-password":"",type:"password"},null,8,["modelValue"])]),_:1})]),_:1})):K("",!0)]),_:1}),e(p,null,{default:l(()=>[e(o,{span:12},{default:l(()=>[e(u,{label:"\u7528\u6237\u6027\u522B"},{default:l(()=>[e(U,{modelValue:a(s).sex,"onUpdate:modelValue":d[6]||(d[6]=t=>a(s).sex=t),placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),x(S,null,E(a(re)(a(ue).SYSTEM_USER_SEX),t=>(i(),f(I,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(o,{span:12},{default:l(()=>[e(u,{label:"\u5C97\u4F4D"},{default:l(()=>[e(U,{modelValue:a(s).postIds,"onUpdate:modelValue":d[7]||(d[7]=t=>a(s).postIds=t),multiple:"",placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),x(S,null,E(a(k),t=>(i(),f(I,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(p,null,{default:l(()=>[e(o,{span:24},{default:l(()=>[e(u,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:l(()=>[e(n,{modelValue:a(s).mobile,"onUpdate:modelValue":d[8]||(d[8]=t=>a(s).mobile=t),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(p,null,{default:l(()=>[e(o,{span:24},{default:l(()=>[e(u,{label:"\u5907\u6CE8"},{default:l(()=>[e(n,{modelValue:a(s).remark,"onUpdate:modelValue":d[9]||(d[9]=t=>a(s).remark=t),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[C,a(_)]])}}}),[["__scopeId","data-v-790dac1d"]])});export{we as __tla,D as default};
|