AccountForm-cf3c91bc.js 5.2 KB

1
  1. import{d as z,h as j,r as c,e as M,o as k,v as q,w as o,f as e,a as l,n as m,x as O,g as V,O as R,V as P,A as B,j as E,bh as G,D as H,C as J,I as L,_ as N,__tla as Q}from"./index-bd9277a1.js";import{_ as T,__tla as W}from"./Dialog-eba103da.js";import{g as X,c as Y,u as Z,__tla as $}from"./index-ad5ea413.js";import{u as ee,__tla as ae}from"./useMessage-274788d4.js";let I,le=Promise.all([(()=>{try{return Q}catch{}})(),(()=>{try{return W}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})()]).then(async()=>{I=N(z({name:"MpAccountForm",__name:"AccountForm",emits:["success"],setup(te,{expose:S,emit:w}){const{t:_}=j(),y=ee(),d=c(!1),g=c(""),s=c(!1),b=c(""),t=c({id:void 0,name:"",account:"",appId:"",appSecret:"",token:"",aesKey:"",remark:""}),x=M({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],account:[{required:!0,message:"\u516C\u4F17\u53F7\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],appId:[{required:!0,message:"\u516C\u4F17\u53F7 appId \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],appSecret:[{required:!0,message:"\u516C\u4F17\u53F7\u5BC6\u94A5\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],token:[{required:!0,message:"\u516C\u4F17\u53F7 token \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),i=c();S({open:async(u,a)=>{if(d.value=!0,g.value=_("action."+u),b.value=u,K(),a){s.value=!0;try{t.value=await X(a)}finally{s.value=!1}}}});const U=w,A=async()=>{if(i&&await i.value.validate()){s.value=!0;try{const u=t.value;b.value==="create"?(await Y(u),y.success(_("common.createSuccess"))):(await Z(u),y.success(_("common.updateSuccess"))),d.value=!1,U("success")}finally{s.value=!1}}},K=()=>{var u;t.value={id:void 0,name:"",account:"",appId:"",appSecret:"",token:"",aesKey:"",remark:""},(u=i.value)==null||u.resetFields()};return(u,a)=>{const p=P,n=B,f=E,v=G,D=H,h=J,F=T,C=L;return k(),q(F,{modelValue:l(d),"onUpdate:modelValue":a[8]||(a[8]=r=>R(d)?d.value=r:null),title:l(g)},{footer:o(()=>[e(h,{disabled:l(s),type:"primary",onClick:A},{default:o(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),e(h,{onClick:a[7]||(a[7]=r=>d.value=!1)},{default:o(()=>[m("\u53D6 \u6D88")]),_:1})]),default:o(()=>[O((k(),q(D,{ref_key:"formRef",ref:i,model:l(t),rules:l(x),"label-width":"120px"},{default:o(()=>[e(n,{label:"\u540D\u79F0",prop:"name"},{default:o(()=>[e(p,{modelValue:l(t).name,"onUpdate:modelValue":a[0]||(a[0]=r=>l(t).name=r),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u5FAE\u4FE1\u53F7",prop:"account"},{label:o(()=>[V("span",null,[e(v,{content:"\u5728\u5FAE\u4FE1\u516C\u4F17\u5E73\u53F0\uFF08mp.weixin.qq.com\uFF09\u7684\u83DC\u5355 [\u8BBE\u7F6E\u4E0E\u5F00\u53D1 - \u516C\u4F17\u53F7\u8BBE\u7F6E - \u8D26\u53F7\u8BE6\u60C5] \u4E2D\u80FD\u627E\u5230\u300C\u5FAE\u4FE1\u53F7\u300D",placement:"top"},{default:o(()=>[e(f,{icon:"ep:question-filled",style:{"vertical-align":"middle"}})]),_:1}),m(" \u5FAE\u4FE1\u53F7 ")])]),default:o(()=>[e(p,{modelValue:l(t).account,"onUpdate:modelValue":a[1]||(a[1]=r=>l(t).account=r),placeholder:"\u8BF7\u8F93\u5165\u5FAE\u4FE1\u53F7"},null,8,["modelValue"])]),_:1}),e(n,{label:"appId",prop:"appId"},{label:o(()=>[V("span",null,[e(v,{content:"\u5728\u5FAE\u4FE1\u516C\u4F17\u5E73\u53F0\uFF08mp.weixin.qq.com\uFF09\u7684\u83DC\u5355 [\u8BBE\u7F6E\u4E0E\u5F00\u53D1 - \u516C\u4F17\u53F7\u8BBE\u7F6E - \u57FA\u672C\u8BBE\u7F6E] \u4E2D\u80FD\u627E\u5230\u300C\u5F00\u53D1\u8005ID(AppID)\u300D",placement:"top"},{default:o(()=>[e(f,{icon:"ep:question-filled",style:{"vertical-align":"middle"}})]),_:1}),m(" appId ")])]),default:o(()=>[e(p,{modelValue:l(t).appId,"onUpdate:modelValue":a[2]||(a[2]=r=>l(t).appId=r),placeholder:"\u8BF7\u8F93\u5165\u516C\u4F17\u53F7 appId"},null,8,["modelValue"])]),_:1}),e(n,{label:"appSecret",prop:"appSecret"},{label:o(()=>[V("span",null,[e(v,{content:"\u5728\u5FAE\u4FE1\u516C\u4F17\u5E73\u53F0\uFF08mp.weixin.qq.com\uFF09\u7684\u83DC\u5355 [\u8BBE\u7F6E\u4E0E\u5F00\u53D1 - \u516C\u4F17\u53F7\u8BBE\u7F6E - \u57FA\u672C\u8BBE\u7F6E] \u4E2D\u80FD\u627E\u5230\u300C\u5F00\u53D1\u8005\u5BC6\u7801(AppSecret)\u300D",placement:"top"},{default:o(()=>[e(f,{icon:"ep:question-filled",style:{"vertical-align":"middle"}})]),_:1}),m(" appSecret ")])]),default:o(()=>[e(p,{modelValue:l(t).appSecret,"onUpdate:modelValue":a[3]||(a[3]=r=>l(t).appSecret=r),placeholder:"\u8BF7\u8F93\u5165\u516C\u4F17\u53F7 appSecret"},null,8,["modelValue"])]),_:1}),e(n,{label:"token",prop:"token"},{default:o(()=>[e(p,{modelValue:l(t).token,"onUpdate:modelValue":a[4]||(a[4]=r=>l(t).token=r),placeholder:"\u8BF7\u8F93\u5165\u516C\u4F17\u53F7token"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u6D88\u606F\u52A0\u89E3\u5BC6\u5BC6\u94A5",prop:"aesKey"},{default:o(()=>[e(p,{modelValue:l(t).aesKey,"onUpdate:modelValue":a[5]||(a[5]=r=>l(t).aesKey=r),placeholder:"\u8BF7\u8F93\u5165\u6D88\u606F\u52A0\u89E3\u5BC6\u5BC6\u94A5"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u5907\u6CE8",prop:"remark"},{default:o(()=>[e(p,{modelValue:l(t).remark,"onUpdate:modelValue":a[6]||(a[6]=r=>l(t).remark=r),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[C,l(s)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/mp/account/AccountForm.vue"]])});export{le as __tla,I as default};