UserForm-ab5ecd67.js 6.0 KB

1
  1. import{d as G,b as H,e as h,B as K,r as m,O as L,g as Q,z as Z,D as $,a as l,o as p,k as U,w as e,i as a,c as S,F as M,C as D,l as F,t as T,R as E,a1 as aa,Y as ea,I as la,E as ta,p as da,aj as ua,ak as oa,J as sa,M as ra,_ as na,__tla as ma}from"./index-66208f93.js";import{E as ia,__tla as _a}from"./el-tree-select-18149140.js";import{a as z,D as O,__tla as pa}from"./dict-6d253095.js";import{g as ca,u as fa,__tla as va}from"./index-a3eaeede.js";import{g as ba,__tla as Va}from"./index-fb33f45b.js";import{d as ya}from"./tree-0af4953a.js";import{f as j,__tla as ha}from"./formatTime-54a7e363.js";import{u as Ua,__tla as ga}from"./useMessage-798a77de.js";let C,Ia=Promise.all([(()=>{try{return ma}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ga}catch{}})()]).then(async()=>{C=na(G({__name:"UserForm",props:{isDetail:{type:Boolean,default:!1},obj:{default:{}},openType:{default:"create"},avatar:{type:String,default:""}},emits:["success"],setup(f,{expose:P,emit:ka}){const R=H(),B=h(()=>R.getMobile),{t:v}=K(),g=Ua(),W=m(!1),Y=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 q=Q({name:[{required:!0,message:"\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=m(),k=m([]),V=h(()=>j(u.value.createTime)),y=h(()=>j(u.value.loginDate));P({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 fa(d),g.success(v("common.updateSuccess"))),r.value=!0}finally{_.value=!1}return r.value}}),Z(()=>{(async(r,d)=>{if(W.value=!0,Y.value=v("action."+r),I.value=r,A(),d){_.value=!0;try{u.value=await ca(d)}finally{_.value=!1}}k.value=await ba()})(b.openType,b.obj.id)});const A=()=>{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,J=ia,N=sa,X=ra;return $((p(),U(N,{ref_key:"formRef",ref:c,model:l(u),rules:l(q),"label-width":"120px",disabled:f.isDetail,class:aa({view:f.isDetail,"mobile-card":l(B)})},{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,D(l(z)(l(O).COMMON_STATUS),t=>(p(),U(w,{key:t.value,label:t.value},{default:e(()=>[F(T(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(J,{modelValue:l(u).areaId,"onUpdate:modelValue":d[4]||(d[4]=t=>l(u).areaId=t),data:l(k),props:l(ya),"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,D(l(z)(l(O).SYSTEM_USER_SEX),t=>(p(),U(w,{key:t.value,label:t.value},{default:e(()=>[F(T(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=>E(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=>E(y)?y.value=t:null),disabled:"true"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled","class"])),[[X,l(_)]])}}}),[["__scopeId","data-v-77675d5e"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/member/user/components/UserForm.vue"]])});export{Ia as __tla,C as default};