import{d as O,h as R,r as m,e as T,o as i,v as p,w as s,f as r,a,n as v,x as B,c as h,F as S,q as U,t as j,P as H,W as J,A as Q,y as W,z as Y,ai as G,aj as X,D as Z,C as $,I as ee,_ as ae,__tla as le}from"./index-04f8d540.js";import{_ as te,__tla as re}from"./Dialog-9afb5ba5.js";import{e as se,D as k,a as ue,__tla as oe}from"./dict-ef06f7f7.js";import{g as de,c as ce,u as me,__tla as ie}from"./index-ba3b4126.js";import{C as A}from"./constants-40f13f5e.js";import{u as ne,__tla as _e}from"./useMessage-9c37e840.js";let C,pe=Promise.all([(()=>{try{return le}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return _e}catch{}})()]).then(async()=>{C=ae(O({name:"SystemSmsChannelForm",__name:"SmsChannelForm",emits:["success"],setup(fe,{expose:w,emit:E}){const{t:f}=R(),b=ne(),d=m(!1),y=m(""),c=m(!1),V=m(""),t=m({id:void 0,signature:"",code:"",status:A.ENABLE,remark:"",apiKey:"",apiSecret:"",callbackUrl:""}),P=T({signature:[{required:!0,message:"\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u6E20\u9053\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u542F\u7528\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],apiKey:[{required:!0,message:"\u77ED\u4FE1 API \u7684\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),_=m();w({open:async(u,l)=>{if(d.value=!0,y.value=f("action."+u),V.value=u,q(),l){c.value=!0;try{t.value=await de(l),console.log(t)}finally{c.value=!1}}}});const I=E,K=async()=>{if(_&&await _.value.validate()){c.value=!0;try{const u=t.value;V.value==="create"?(await ce(u),b.success(f("common.createSuccess"))):(await me(u),b.success(f("common.updateSuccess"))),d.value=!1,I("success")}finally{c.value=!1}}},q=()=>{var u;t.value={id:void 0,signature:"",code:"",status:A.ENABLE,remark:"",apiKey:"",apiSecret:"",callbackUrl:""},(u=_.value)==null||u.resetFields()};return(u,l)=>{const n=J,o=Q,x=W,F=Y,D=G,L=X,N=Z,g=$,M=te,z=ee;return i(),p(M,{modelValue:a(d),"onUpdate:modelValue":l[8]||(l[8]=e=>H(d)?d.value=e:null),title:a(y)},{footer:s(()=>[r(g,{disabled:a(c),type:"primary",onClick:K},{default:s(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),r(g,{onClick:l[7]||(l[7]=e=>d.value=!1)},{default:s(()=>[v("\u53D6 \u6D88")]),_:1})]),default:s(()=>[B((i(),p(N,{ref_key:"formRef",ref:_,model:a(t),rules:a(P),"label-width":"130px"},{default:s(()=>[r(o,{label:"\u77ED\u4FE1\u7B7E\u540D",prop:"signature"},{default:s(()=>[r(n,{modelValue:a(t).signature,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).signature=e),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1\u7B7E\u540D"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u6E20\u9053\u7F16\u7801",prop:"code"},{default:s(()=>[r(F,{modelValue:a(t).code,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).code=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u6E20\u9053\u7F16\u7801"},{default:s(()=>[(i(!0),h(S,null,U(a(se)(a(k).SYSTEM_SMS_CHANNEL_CODE),e=>(i(),p(x,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(o,{label:"\u542F\u7528\u72B6\u6001"},{default:s(()=>[r(L,{modelValue:a(t).status,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).status=e)},{default:s(()=>[(i(!0),h(S,null,U(a(ue)(a(k).COMMON_STATUS),e=>(i(),p(D,{key:e.value,label:e.value},{default:s(()=>[v(j(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(o,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[r(n,{modelValue:a(t).remark,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).remark=e),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u77ED\u4FE1 API \u7684\u8D26\u53F7",prop:"apiKey"},{default:s(()=>[r(n,{modelValue:a(t).apiKey,"onUpdate:modelValue":l[4]||(l[4]=e=>a(t).apiKey=e),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1 API \u7684\u8D26\u53F7"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u77ED\u4FE1 API \u7684\u5BC6\u94A5",prop:"apiSecret"},{default:s(()=>[r(n,{modelValue:a(t).apiSecret,"onUpdate:modelValue":l[5]||(l[5]=e=>a(t).apiSecret=e),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1 API \u7684\u5BC6\u94A5"},null,8,["modelValue"])]),_:1}),r(o,{label:"\u77ED\u4FE1\u53D1\u9001\u56DE\u8C03 URL",prop:"callbackUrl"},{default:s(()=>[r(n,{modelValue:a(t).callbackUrl,"onUpdate:modelValue":l[6]||(l[6]=e=>a(t).callbackUrl=e),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1\u53D1\u9001\u56DE\u8C03 URL"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,a(c)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/sms/channel/SmsChannelForm.vue"]])});export{pe as __tla,C as default};
