1 |
- import{d as T,Y as N,K as P,r as m,e as Y,L as C,l as K,x as X,a,o as i,v as f,w as l,f as e,P as Z,c as U,q as E,F as S,Z as $,h as G,V as H,A as J,E as O,i as Q,y as W,z as ee,D as ae,I as le,_ as te,__tla as se}from"./index-337b8033.js";import{E as de,__tla as re}from"./el-tree-select-55f12e70.js";import{a as ue,D as oe,__tla as me}from"./dict-44d92263.js";import{C as F}from"./constants-a3c69b57.js";import{d as ne,h as pe}from"./tree-0af4953a.js";import{g as ie,__tla as _e}from"./index-924f627b.js";import{g as ce,__tla as fe}from"./index-d72ffc04.js";import{a as ve,c as be,u as ye,__tla as Ve}from"./index-5c87a086.js";import{u as he,__tla as ge}from"./useMessage-c7cb6480.js";let q,we=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return ge}catch{}})()]).then(async()=>{q=te(T({name:"SystemUserForm",__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(v,{expose:D,emit:ke}){const L=N(),j=P(()=>L.getMobile),{t:y}=G(),V=he(),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:F.ENABLE,roleIds:[],categoryId:1,avatar:""}),z=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;C(b,r=>{s.value.avatar=r.avatar},{immediate:!0}),K(()=>{(async(r,d)=>{if(h.value=!0,g.value=r,A(),d){_.value=!0;try{s.value=await ve(d)}finally{_.value=!1}}w.value=pe(await ce()),k.value=await ie()})(b.openType,b.obj.id)}),D({submitForm:async()=>{if(!c||!await c.value.validate())return;_.value=!0;const r=m(!1);try{const d=s.value;g.value==="create"?(await be(d),V.success(y("common.createSuccess"))):(await ye(d),V.success(y("common.updateSuccess"))),h.value=!1,r.value=!0}finally{_.value=!1}return r.value}});const A=()=>{var r;s.value={nickname:"",deptId:"",mobile:"",email:"",id:void 0,username:"",password:"",sex:void 0,postIds:[],remark:"",status:F.ENABLE,roleIds:[],categoryId:1,avatar:""},(r=c.value)==null||r.resetFields()};return(r,d)=>{const n=H,u=J,o=O,B=de,p=Q,x=W,I=ee,M=ae,R=le;return X((i(),f(M,{ref_key:"formRef",ref:c,model:a(s),rules:a(z),"label-width":"120px",style:{padding:"10px"},disabled:v.isDetail,class:$({view:v.isDetail,"mobile-card":a(j)})},{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(B,{modelValue:a(s).deptId,"onUpdate:modelValue":d[1]||(d[1]=t=>a(s).deptId=t),data:a(w),props:a(ne),"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})):Z("",!0)]),_:1}),e(p,null,{default:l(()=>[e(o,{span:12},{default:l(()=>[e(u,{label:"\u7528\u6237\u6027\u522B"},{default:l(()=>[e(I,{modelValue:a(s).sex,"onUpdate:modelValue":d[6]||(d[6]=t=>a(s).sex=t),placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),U(S,null,E(a(ue)(a(oe).SYSTEM_USER_SEX),t=>(i(),f(x,{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(I,{modelValue:a(s).postIds,"onUpdate:modelValue":d[7]||(d[7]=t=>a(s).postIds=t),multiple:"",placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[(i(!0),U(S,null,E(a(k),t=>(i(),f(x,{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"])),[[R,a(_)]])}}}),[["__scopeId","data-v-04729edc"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/user/UserForm.vue"]])});export{we as __tla,q as default};
|