1 |
- import{d as J,X as K,J as h,h as G,r as m,K as L,e as Q,k as Z,v as $,a as l,o as p,q as U,w as e,f as a,c as S,F as M,n as E,m as T,t as F,N as D,Y as aa,U as ea,z as la,E as ta,i as da,ag as ua,ah as oa,C as sa,H as ra,__tla as na}from"./index-2eab2d23.js";import{E as ma,__tla as ia}from"./el-tree-select-4ae7c290.js";import{a as P,D as C,__tla as _a}from"./dict-1ad71b6f.js";import{g as pa,b as ca,__tla as fa}from"./index-6a949eb2.js";import{g as va,__tla as ba}from"./index-44a34f60.js";import{d as Va}from"./tree-fd3a041e.js";import{f as R,__tla as ya}from"./formatTime-41155543.js";import{u as ha,__tla as Ua}from"./useMessage-171aa63e.js";import{_ as ga}from"./_plugin-vue_export-helper-1b428a4d.js";let j,Ia=Promise.all([(()=>{try{return na}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return ya}catch{}})(),(()=>{try{return Ua}catch{}})()]).then(async()=>{j=ga(J({__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(f,{expose:q,emit:ka}){const N=K(),O=h(()=>N.getMobile),{t:v}=G(),g=ha(),W=m(!1),X=m(""),_=m(!1),I=m(""),u=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}),b=f;L(b,r=>{u.value.avatar=r.avatar},{immediate:!0});const Y=Q({name:[{required:!0,message:"\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=m(),k=m([]),V=h(()=>R(u.value.createTime)),y=h(()=>R(u.value.loginDate));q({submitForm:async()=>{if(!c||!await c.value.validate())return;_.value=!0;const r=m(!1);try{const d=u.value;I.value==="create"?g.success(v("common.createSuccess")):(await ca(d),g.success(v("common.updateSuccess"))),r.value=!0}finally{_.value=!1}return r.value}}),Z(()=>{(async(r,d)=>{if(W.value=!0,X.value=v("action."+r),I.value=r,z(),d){_.value=!0;try{u.value=await pa(d)}finally{_.value=!1}}k.value=await va()})(b.openType,b.obj.id)});const z=()=>{var r;u.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,d)=>{const n=ea,o=la,s=ta,i=da,w=ua,x=oa,A=ma,B=sa,H=ra;return $((p(),U(B,{ref_key:"formRef",ref:c,model:l(u),rules:l(Y),"label-width":"120px",disabled:f.isDetail,class:aa({view:f.isDetail,"mobile-card":l(O)})},{default:e(()=>[a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u7528\u6237\u540D",prop:"name"},{default:e(()=>[a(n,{modelValue:l(u).name,"onUpdate:modelValue":d[0]||(d[0]=t=>l(u).name=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u6635\u79F0",prop:"nickname"},{default:e(()=>[a(n,{modelValue:l(u).nickname,"onUpdate:modelValue":d[1]||(d[1]=t=>l(u).nickname=t),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(x,{modelValue:l(u).status,"onUpdate:modelValue":d[2]||(d[2]=t=>l(u).status=t)},{default:e(()=>[(p(!0),S(M,null,E(l(P)(l(C).COMMON_STATUS),t=>(p(),U(w,{key:t.value,label:t.value},{default:e(()=>[T(F(t.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:l(u).mobile,"onUpdate:modelValue":d[3]||(d[3]=t=>l(u).mobile=t),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:l(u).areaId,"onUpdate:modelValue":d[4]||(d[4]=t=>l(u).areaId=t),data:l(k),props:l(Va),"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:l(u).email,"onUpdate:modelValue":d[5]||(d[5]=t=>l(u).email=t),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(x,{modelValue:l(u).sex,"onUpdate:modelValue":d[6]||(d[6]=t=>l(u).sex=t)},{default:e(()=>[(p(!0),S(M,null,E(l(P)(l(C).SYSTEM_USER_SEX),t=>(p(),U(w,{key:t.value,label:t.value},{default:e(()=>[T(F(t.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:l(V),"onUpdate:modelValue":d[7]||(d[7]=t=>D(V)?V.value=t:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(i,null,{default:e(()=>[a(s,{span:12},{default:e(()=>[a(o,{label:"\u76F4\u63A8\u4EBA"},{default:e(()=>[a(n,{modelValue:l(u).recommenderdId,"onUpdate:modelValue":d[8]||(d[8]=t=>l(u).recommenderdId=t),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1}),a(s,{span:12},{default:e(()=>[a(o,{label:"\u8EAB\u4EF7"},{default:e(()=>[a(n,{modelValue:l(u).currentMemberWorthValue,"onUpdate:modelValue":d[9]||(d[9]=t=>l(u).currentMemberWorthValue=t),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:l(u).currentMemberPoints,"onUpdate:modelValue":d[10]||(d[10]=t=>l(u).currentMemberPoints=t),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:l(y),"onUpdate:modelValue":d[11]||(d[11]=t=>D(y)?y.value=t:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[H,l(_)]])}}}),[["__scopeId","data-v-82eda083"]])});export{Ia as __tla,j as default};
|