UserForm-2b100035.js 5.9 KB

1
  1. import{d as J,X as K,J as f,h as P,r as m,e8 as G,K as Z,e as $,k as aa,v as ea,a as t,o as p,q as k,w as e,f as a,c as M,F as N,n as T,m as D,t as F,N as I,Y as la,U as ta,z as ua,E as da,i as oa,ag as sa,ah as ra,C as na,H as ma,__tla as ia}from"./index-73e02845.js";import{E as _a,__tla as pa}from"./el-tree-select-a05a2d94.js";import{a as Q,D as R,__tla as ca}from"./dict-0fdd6c74.js";import{f as fa,h as va,__tla as ba}from"./index-01901863.js";import{g as Va,__tla as ya}from"./index-ab952ec2.js";import{d as ha}from"./tree-fd3a041e.js";import{f as j,__tla as Ua}from"./formatTime-5f7a2be1.js";import{u as ka,__tla as Ia}from"./useMessage-1490ad82.js";import{_ as ga}from"./_plugin-vue_export-helper-1b428a4d.js";let C,wa=Promise.all([(()=>{try{return ia}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return ya}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return Ia}catch{}})()]).then(async()=>{C=ga(J({__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(v,{expose:L,emit:xa}){const O=K(),W=f(()=>O.getMobile),{t:b}=P(),g=ka(),X=m(!1),Y=m(""),_=m(!1),w=m(""),d=m({id:void 0,mobile:void 0,password:void 0,status:void 0,nickname:void 0,avatar:void 0,name:void 0,sex:void 0,areaId:void 0,birthday:void 0,mark:void 0,tagIds:[],groupId:void 0,currentQuota:0}),V=f(()=>G(d.value.currentQuota)),y=v;Z(y,r=>{d.value.avatar=r.avatar},{immediate:!0});const q=$({}),c=m(),x=m([]),h=f(()=>j(d.value.createTime)),U=f(()=>j(d.value.loginDate));L({submitForm:async()=>{if(!c||!await c.value.validate())return;_.value=!0;const r=m(!1);try{const u=d.value;w.value==="create"?g.success(b("common.createSuccess")):(await va(u),g.success(b("common.updateSuccess"))),r.value=!0}finally{_.value=!1}return r.value}}),aa(()=>{(async(r,u)=>{if(X.value=!0,Y.value=b("action."+r),w.value=r,z(),u){_.value=!0;try{d.value=await fa(u)}finally{_.value=!1}}x.value=await Va()})(y.openType,y.obj.id)});const z=()=>{var r;d.value={id:void 0,mobile:void 0,password:void 0,status:void 0,nickname:void 0,avatar:void 0,name:void 0,sex:void 0,areaId:void 0,birthday:void 0,mark:void 0,tagIds:[],groupId:void 0},(r=c.value)==null||r.resetFields()};return(r,u)=>{const n=ta,o=ua,s=da,i=oa,S=sa,E=ra,A=_a,B=na,H=ma;return ea((p(),k(B,{ref_key:"formRef",ref:c,model:t(d),rules:t(q),"label-width":"120px",disabled:v.isDetail,class:la({view:v.isDetail,"mobile-card":t(W)})},{default:e(()=>[a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u59D3\u540D",prop:"name"},{default:e(()=>[a(n,{modelValue:t(d).name,"onUpdate:modelValue":u[0]||(u[0]=l=>t(d).name=l),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u6635\u79F0",prop:"nickname"},{default:e(()=>[a(n,{modelValue:t(d).nickname,"onUpdate:modelValue":u[1]||(u[1]=l=>t(d).nickname=l),placeholder:"\u8BF7\u8F93\u5165\u6635\u79F0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u72B6\u6001",prop:"status"},{default:e(()=>[a(E,{modelValue:t(d).status,"onUpdate:modelValue":u[2]||(u[2]=l=>t(d).status=l)},{default:e(()=>[(p(!0),M(N,null,T(t(Q)(t(R).COMMON_STATUS),l=>(p(),k(S,{key:l.value,label:l.value},{default:e(()=>[D(F(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:e(()=>[a(n,{modelValue:t(d).mobile,"onUpdate:modelValue":u[3]||(u[3]=l=>t(d).mobile=l),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u6240\u5728\u5730",prop:"areaId"},{default:e(()=>[a(A,{modelValue:t(d).areaId,"onUpdate:modelValue":u[4]||(u[4]=l=>t(d).areaId=l),data:t(x),props:t(ha),"render-after-expand":!0},null,8,["modelValue","data","props"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u90AE\u7BB1",prop:"email"},{default:e(()=>[a(n,{modelValue:t(d).email,"onUpdate:modelValue":u[5]||(u[5]=l=>t(d).email=l),placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u6027\u522B",prop:"sex"},{default:e(()=>[a(E,{modelValue:t(d).sex,"onUpdate:modelValue":u[6]||(u[6]=l=>t(d).sex=l)},{default:e(()=>[(p(!0),M(N,null,T(t(Q)(t(R).SYSTEM_USER_SEX),l=>(p(),k(S,{key:l.value,label:l.value},{default:e(()=>[D(F(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u521B\u5EFA\u65F6\u95F4"},{default:e(()=>[a(n,{modelValue:t(h),"onUpdate:modelValue":u[7]||(u[7]=l=>I(h)?h.value=l:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u63A8\u8350\u4EBA"},{default:e(()=>[a(n,{modelValue:t(d).ancNickName,"onUpdate:modelValue":u[8]||(u[8]=l=>t(d).ancNickName=l),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u8EAB\u4EF7"},{default:e(()=>[a(n,{modelValue:t(d).currentMemberWorthLevel,"onUpdate:modelValue":u[9]||(u[9]=l=>t(d).currentMemberWorthLevel=l),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u79EF\u5206"},{default:e(()=>[a(n,{modelValue:t(V),"onUpdate:modelValue":u[10]||(u[10]=l=>I(V)?V.value=l:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u6700\u540E\u767B\u9646\u65F6\u95F4"},{default:e(()=>[a(n,{modelValue:t(U),"onUpdate:modelValue":u[11]||(u[11]=l=>I(U)?U.value=l:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[H,t(_)]])}}}),[["__scopeId","data-v-4c955915"]])});export{wa as __tla,C as default};