UserForm-44a0d0ac.js 6.2 KB

1
  1. import{d as H,y as J,e as p,Q as K,r as m,P as N,w as $,x as aa,b as ea,k as la,a as t,o as f,A as x,B as e,f as a,c as D,F as E,R as F,E as Q,G as W,a2 as c,ac as ta,a8 as ua,V as da,I as oa,L as sa,as as ra,at as na,W as ma,Z as ia,__tla as _a}from"./index-e8bff8cb.js";import{E as pa,__tla as fa}from"./el-tree-select-d9ced475.js";import{a as j,D as L,__tla as va}from"./dict-4a54e490.js";import{i as ca,j as ba,__tla as Va}from"./index-34824ee9.js";import{g as ya,__tla as ha}from"./index-4bde5d87.js";import{d as Ua}from"./tree-0af4953a.js";import{f as R,__tla as ka}from"./formatTime-4fdd5566.js";import{u as Ia,__tla as xa}from"./useMessage-de42a595.js";import{_ as ga}from"./_plugin-vue_export-helper-1b428a4d.js";let A,wa=Promise.all([(()=>{try{return _a}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return xa}catch{}})()]).then(async()=>{A=ga(H({__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(b,{expose:B,emit:Sa}){const O=J(),P=p(()=>O.getMobile),{t:V}=K(),g=Ia(),C=m(!1),G=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}),y=p(()=>N(d.value.currentQuota)),h=p(()=>N(d.value.highQuotaTotal)),U=b;$(U,r=>{d.value.avatar=r.avatar},{immediate:!0});const X=aa({}),v=m(),S=m([]),k=p(()=>R(d.value.createTime)),I=p(()=>R(d.value.loginDate));B({submitForm:async()=>{if(!v||!await v.value.validate())return;_.value=!0;const r=m(!1);try{const u=d.value;w.value==="create"?g.success(V("common.createSuccess")):(await ba(u),g.success(V("common.updateSuccess"))),r.value=!0}finally{_.value=!1}return r.value}}),ea(()=>{(async(r,u)=>{if(C.value=!0,G.value=V("action."+r),w.value=r,Y(),u){_.value=!0;try{d.value=await ca(u)}finally{_.value=!1}}S.value=await ya()})(U.openType,U.obj.id)});const Y=()=>{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=v.value)==null||r.resetFields()};return(r,u)=>{const n=ua,o=da,s=oa,i=sa,T=ra,M=na,Z=pa,q=ma,z=ia;return la((f(),x(q,{ref_key:"formRef",ref:v,model:t(d),rules:t(X),"label-width":"120px",disabled:b.isDetail,class:ta({view:b.isDetail,"mobile-card":t(P)})},{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(M,{modelValue:t(d).status,"onUpdate:modelValue":u[2]||(u[2]=l=>t(d).status=l)},{default:e(()=>[(f(!0),D(E,null,F(t(j)(t(L).COMMON_STATUS),l=>(f(),x(T,{key:l.value,label:l.value},{default:e(()=>[Q(W(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",disabled:"true"},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(Z,{modelValue:t(d).areaId,"onUpdate:modelValue":u[4]||(u[4]=l=>t(d).areaId=l),data:t(S),props:t(Ua),"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(M,{modelValue:t(d).sex,"onUpdate:modelValue":u[6]||(u[6]=l=>t(d).sex=l)},{default:e(()=>[(f(!0),D(E,null,F(t(j)(t(L).SYSTEM_USER_SEX),l=>(f(),x(T,{key:l.value,label:l.value},{default:e(()=>[Q(W(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(k),"onUpdate:modelValue":u[7]||(u[7]=l=>c(k)?k.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:"\u4F63\u91D1"},{default:e(()=>[a(n,{modelValue:t(y),"onUpdate:modelValue":u[10]||(u[10]=l=>c(y)?y.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(I),"onUpdate:modelValue":u[11]||(u[11]=l=>c(I)?I.value=l:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:24},{default:e(()=>[a(o,{label:"\u5CF0\u503C"},{default:e(()=>[a(n,{modelValue:t(h),"onUpdate:modelValue":u[12]||(u[12]=l=>c(h)?h.value=l:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[z,t(_)]])}}}),[["__scopeId","data-v-84be1a4a"]])});export{wa as __tla,A as default};