UserForm-7bc11683.js 5.8 KB

1
  1. import{d as N,B as P,r as s,g as X,o as i,k as c,w as o,i as r,a,l as v,D as G,c as U,F as x,C as w,t as S,R as H,Y as K,I as L,aj as Z,ak as Q,q as W,J as $,s as aa,M as ea,_ as la,__tla as ta}from"./index-66208f93.js";import{_ as ra,__tla as oa}from"./Dialog-948825d3.js";import{E as da,__tla as ua}from"./el-tree-select-18149140.js";import{_ as sa,__tla as ma}from"./UploadImg-866c0e44.js";import{a as C,D as F,__tla as _a}from"./dict-6d253095.js";import{g as ia,u as na,__tla as pa}from"./index-a3eaeede.js";import{g as ca,__tla as va}from"./index-fb33f45b.js";import{d as fa}from"./tree-0af4953a.js";import Va,{__tla as ba}from"./MemberTagSelect-0112ff29.js";import ya,{__tla as ha}from"./MemberGroupSelect-0e4c9930.js";import{u as ga,__tla as ka}from"./useMessage-798a77de.js";import{__tla as Ia}from"./index-4eee12bb.js";import{__tla as Ua}from"./el-image-viewer-3d1b9860.js";import{__tla as xa}from"./TagForm-b4713e8a.js";import{__tla as wa}from"./index-9878b80e.js";let E,Sa=Promise.all([(()=>{try{return ta}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return pa}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return Ia}catch{}})(),(()=>{try{return Ua}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return wa}catch{}})()]).then(async()=>{E=la(N({__name:"UserForm",emits:["success"],setup(Ca,{expose:M,emit:R}){const{t:f}=P(),V=ga(),m=s(!1),b=s(""),_=s(!1),y=s(""),t=s({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}),T=X({mobile:[{required:!0,message:"\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=s(),h=s([]);M({open:async(u,l)=>{if(m.value=!0,b.value=f("action."+u),y.value=u,D(),l){_.value=!0;try{t.value=await ia(l)}finally{_.value=!1}}h.value=await ca()}});const q=R,z=async()=>{if(n&&await n.value.validate()){_.value=!0;try{const u=t.value;y.value==="create"?V.success(f("common.createSuccess")):(await na(u),V.success(f("common.updateSuccess"))),m.value=!1,q("success")}finally{_.value=!1}}},D=()=>{var u;t.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},(u=n.value)==null||u.resetFields()};return(u,l)=>{const p=K,d=L,g=Z,k=Q,O=sa,Y=W,J=da,j=$,I=aa,A=ra,B=ea;return i(),c(A,{title:a(b),modelValue:a(m),"onUpdate:modelValue":l[12]||(l[12]=e=>H(m)?m.value=e:null)},{footer:o(()=>[r(I,{onClick:z,type:"primary",disabled:a(_)},{default:o(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),r(I,{onClick:l[11]||(l[11]=e=>m.value=!1)},{default:o(()=>[v("\u53D6 \u6D88")]),_:1})]),default:o(()=>[G((i(),c(j,{ref_key:"formRef",ref:n,model:a(t),rules:a(T),"label-width":"100px"},{default:o(()=>[r(d,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:o(()=>[r(p,{modelValue:a(t).mobile,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).mobile=e),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1}),r(d,{label:"\u72B6\u6001",prop:"status"},{default:o(()=>[r(k,{modelValue:a(t).status,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).status=e)},{default:o(()=>[(i(!0),U(x,null,w(a(C)(a(F).COMMON_STATUS),e=>(i(),c(g,{key:e.value,label:e.value},{default:o(()=>[v(S(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(d,{label:"\u7528\u6237\u6635\u79F0",prop:"nickname"},{default:o(()=>[r(p,{modelValue:a(t).nickname,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).nickname=e),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u6635\u79F0"},null,8,["modelValue"])]),_:1}),r(d,{label:"\u5934\u50CF",prop:"avatar"},{default:o(()=>[r(O,{modelValue:a(t).avatar,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).avatar=e),limit:1,"is-show-tip":!1},null,8,["modelValue"])]),_:1}),r(d,{label:"\u771F\u5B9E\u540D\u5B57",prop:"name"},{default:o(()=>[r(p,{modelValue:a(t).name,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u540D\u5B57"},null,8,["modelValue"])]),_:1}),r(d,{label:"\u7528\u6237\u6027\u522B",prop:"sex"},{default:o(()=>[r(k,{modelValue:a(t).sex,"onUpdate:modelValue":l[5]||(l[5]=e=>a(t).sex=e)},{default:o(()=>[(i(!0),U(x,null,w(a(C)(a(F).SYSTEM_USER_SEX),e=>(i(),c(g,{key:e.value,label:e.value},{default:o(()=>[v(S(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(d,{label:"\u51FA\u751F\u65E5\u671F",prop:"birthday"},{default:o(()=>[r(Y,{modelValue:a(t).birthday,"onUpdate:modelValue":l[6]||(l[6]=e=>a(t).birthday=e),type:"date","value-format":"x",placeholder:"\u9009\u62E9\u51FA\u751F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),r(d,{label:"\u6240\u5728\u5730",prop:"areaId"},{default:o(()=>[r(J,{modelValue:a(t).areaId,"onUpdate:modelValue":l[7]||(l[7]=e=>a(t).areaId=e),data:a(h),props:a(fa),"render-after-expand":!0},null,8,["modelValue","data","props"])]),_:1}),r(d,{label:"\u7528\u6237\u6807\u7B7E",prop:"tagIds"},{default:o(()=>[r(Va,{modelValue:a(t).tagIds,"onUpdate:modelValue":l[8]||(l[8]=e=>a(t).tagIds=e),"show-add":""},null,8,["modelValue"])]),_:1}),r(d,{label:"\u7528\u6237\u5206\u7EC4",prop:"groupId"},{default:o(()=>[r(ya,{modelValue:a(t).groupId,"onUpdate:modelValue":l[9]||(l[9]=e=>a(t).groupId=e)},null,8,["modelValue"])]),_:1}),r(d,{label:"\u4F1A\u5458\u5907\u6CE8",prop:"mark"},{default:o(()=>[r(p,{type:"textarea",modelValue:a(t).mark,"onUpdate:modelValue":l[10]||(l[10]=e=>a(t).mark=e),placeholder:"\u8BF7\u8F93\u5165\u4F1A\u5458\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[B,a(_)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/member/user/UserForm.vue"]])});export{Sa as __tla,E as default};