UpdateBindUserForm-c28fd485.js 3.4 KB

1
  1. import{d as R,P as T,r as c,x as W,o as _,C as n,A as a,f as r,a as e,D as o,k,E as w,a3 as j,a2 as M,Q as S,J as Z,a9 as G,V as H,W as K,aw as L,Z as N,_ as O,__tla as X}from"./index-286756b9.js";import{_ as Y,__tla as $}from"./Dialog-4c2de357.js";import{E as aa,a as ea,__tla as la}from"./el-descriptions-item-63e151c1.js";import{E as ra,__tla as ta}from"./el-avatar-2aa16c07.js";import{u as sa,a as da,__tla as ua}from"./index-c139cb89.js";import{f as ia,__tla as _a}from"./formatTime-83e416ef.js";import{u as na,__tla as oa}from"./useMessage-084b1e70.js";let I,ca=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return oa}catch{}})()]).then(async()=>{I=O(R({name:"UpdateBindUserForm",__name:"UpdateBindUserForm",emits:["success"],setup(ma,{expose:V,emit:g}){const{t:x}=T(),m=na(),u=c(!1),s=c(!1),l=c(),f=c(),C=W({bindUserId:[{required:!0,message:"\u63A8\u5E7F\u5458\u4EBA\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]});V({open:async d=>{B(),l.value.id=d.id,l.value.bindUserId=d.bindUserId,d.bindUserId&&await y(),u.value=!0}});const E=g,F=async()=>{if(!s.value&&f&&await f.value.validate())if(t.value){s.value=!0;try{await sa(l.value),m.success(x("common.updateSuccess")),u.value=!1,E("success",!0)}finally{s.value=!1}}else m.error("\u8BF7\u5148\u67E5\u8BE2\u5E76\u786E\u8BA4\u63A8\u5E7F\u4EBA")},B=()=>{var d;l.value={id:0,bindUserId:void 0},(d=f.value)==null||d.resetFields(),t.value=void 0},t=c(),y=async()=>{l.value.bindUserId!=l.value.id?(s.value=!0,t.value=await da(l.value.bindUserId),t.value||m.warning("\u63A8\u5E7F\u5458\u4E0D\u5B58\u5728"),s.value=!1):m.error("\u4E0D\u80FD\u7ED1\u5B9A\u81EA\u5DF1\u4E3A\u63A8\u5E7F\u4EBA")};return(d,i)=>{const D=S,b=Z,P=G,z=H,A=K,q=ra,p=aa,U=L,J=ea,Q=Y,h=N;return _(),n(Q,{modelValue:e(u),"onUpdate:modelValue":i[2]||(i[2]=v=>M(u)?u.value=v:null),title:"\u4FEE\u6539\u4E0A\u7EA7\u63A8\u5E7F\u4EBA",width:"500"},{footer:a(()=>[r(b,{disabled:e(s),type:"primary",onClick:F},{default:a(()=>[o("\u786E \u5B9A")]),_:1},8,["disabled"]),r(b,{onClick:i[1]||(i[1]=v=>u.value=!1)},{default:a(()=>[o("\u53D6 \u6D88")]),_:1})]),default:a(()=>[k((_(),n(A,{ref_key:"formRef",ref:f,model:e(l),rules:e(C),"label-width":"80px"},{default:a(()=>[r(z,{label:"\u63A8\u5E7F\u4EBA",prop:"bindUserId"},{default:a(()=>[k((_(),n(P,{modelValue:e(l).bindUserId,"onUpdate:modelValue":i[0]||(i[0]=v=>e(l).bindUserId=v),placeholder:"\u8BF7\u8F93\u5165\u63A8\u5E7F\u5458\u7F16\u53F7"},{append:a(()=>[r(b,{onClick:y},{default:a(()=>[r(D,{icon:"ep:search",class:"mr-5px"})]),_:1})]),_:1},8,["modelValue"])),[[h,e(s)]])]),_:1})]),_:1},8,["model","rules"])),[[h,e(s)]]),e(t)?(_(),n(J,{key:0,column:1,border:""},{default:a(()=>[r(p,{label:"\u5934\u50CF"},{default:a(()=>[r(q,{src:e(t).avatar},null,8,["src"])]),_:1}),r(p,{label:"\u6635\u79F0"},{default:a(()=>[o(w(e(t).nickname),1)]),_:1}),r(p,{label:"\u63A8\u5E7F\u8D44\u683C"},{default:a(()=>[e(t).brokerageEnabled?(_(),n(U,{key:0},{default:a(()=>[o("\u6709")]),_:1})):(_(),n(U,{key:1,type:"info"},{default:a(()=>[o("\u65E0")]),_:1}))]),_:1}),r(p,{label:"\u6210\u4E3A\u63A8\u5E7F\u5458\u7684\u65F6\u95F4"},{default:a(()=>[o(w(e(ia)(e(t).brokerageTime)),1)]),_:1})]),_:1})):j("",!0)]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/trade/brokerage/user/UpdateBindUserForm.vue"]])});export{ca as __tla,I as default};