UserLevelUpdateForm-0790e43f.js 3.0 KB

1
  1. import{d as D,P as L,r as _,x as P,o as p,C as v,A as o,f as r,a as e,D as f,k as q,a1 as A,a8 as H,U as J,V as M,J as R,Y as S,__tla as Y}from"./index-bdfd1c5a.js";import{_ as j,__tla as z}from"./Dialog-6bd8b7c4.js";import{g as B,u as E,__tla as G}from"./index-195ece42.js";import{_ as K,__tla as N}from"./MemberLevelSelect.vue_vue_type_script_setup_true_lang-0217e745.js";import{u as O,__tla as Q}from"./useMessage-241a9f4d.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as T}from"./el-avatar-b82c7b81.js";import{__tla as W}from"./index-3d62924a.js";let y,X=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return z}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{y=D({__name:"UserLevelUpdateForm",emits:["success"],setup(Z,{expose:V,emit:h}){const{t:b}=L(),k=O(),s=_(!1),d=_(!1),a=_({id:void 0,nickname:void 0,levelId:void 0,reason:void 0}),U=P({reason:[{required:!0,message:"\u4FEE\u6539\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),i=_();V({open:async u=>{if(s.value=!0,g(),u){d.value=!0;try{a.value=await B(u)}finally{d.value=!1}}}});const w=h,x=async()=>{if(i&&await i.value.validate()){d.value=!0;try{await E(a.value),k.success(b("common.updateSuccess")),s.value=!1,w("success")}finally{d.value=!1}}},g=()=>{var u;a.value={id:void 0,nickname:void 0,levelId:void 0,reason:void 0},(u=i.value)==null||u.resetFields()};return(u,l)=>{const m=H,n=J,I=M,c=R,C=j,F=S;return p(),v(C,{title:"\u4FEE\u6539\u7528\u6237\u7B49\u7EA7",modelValue:e(s),"onUpdate:modelValue":l[5]||(l[5]=t=>A(s)?s.value=t:null),width:"600"},{footer:o(()=>[r(c,{onClick:x,type:"primary",disabled:e(d)},{default:o(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),r(c,{onClick:l[4]||(l[4]=t=>s.value=!1)},{default:o(()=>[f("\u53D6 \u6D88")]),_:1})]),default:o(()=>[q((p(),v(I,{ref_key:"formRef",ref:i,model:e(a),rules:e(U),"label-width":"100px"},{default:o(()=>[r(n,{label:"\u7528\u6237\u7F16\u53F7",prop:"id"},{default:o(()=>[r(m,{modelValue:e(a).id,"onUpdate:modelValue":l[0]||(l[0]=t=>e(a).id=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u6635\u79F0",class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1}),r(n,{label:"\u7528\u6237\u6635\u79F0",prop:"nickname"},{default:o(()=>[r(m,{modelValue:e(a).nickname,"onUpdate:modelValue":l[1]||(l[1]=t=>e(a).nickname=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u6635\u79F0",class:"!w-240px",disabled:""},null,8,["modelValue"])]),_:1}),r(n,{label:"\u7528\u6237\u7B49\u7EA7",prop:"levelId"},{default:o(()=>[r(K,{modelValue:e(a).levelId,"onUpdate:modelValue":l[2]||(l[2]=t=>e(a).levelId=t)},null,8,["modelValue"])]),_:1}),r(n,{label:"\u4FEE\u6539\u539F\u56E0",prop:"reason"},{default:o(()=>[r(m,{type:"textarea",modelValue:e(a).reason,"onUpdate:modelValue":l[3]||(l[3]=t=>e(a).reason=t),placeholder:"\u8BF7\u8F93\u5165\u4FEE\u6539\u539F\u56E0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[F,e(d)]])]),_:1},8,["modelValue"])}}})});export{X as __tla,y as default};