import{d as H,n as O,r as c,f as T,o as i,l as _,w as u,i as r,a,j as v,C as B,c as h,F as U,k,t as j,y as z,U as G,H as J,D as X,G as Y,ag as Q,ah as W,K as Z,J as $,N as ee,_ as ae,__tla as le}from"./index-8c6726e5.js";import{_ as te,__tla as re}from"./Dialog-336bccec.js";import{e as ue,D as S,a as se,__tla as oe}from"./dict-1c98488d.js";import{g as de,c as me,u as ce,__tla as ie}from"./index-929ac7e3.js";import{C}from"./constants-a1da293a.js";import{u as ne,__tla as pe}from"./useMessage-9f6930df.js";let A,_e=Promise.all([(()=>{try{return le}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return pe}catch{}})()]).then(async()=>{A=ae(H({name:"SystemSmsChannelForm",__name:"SmsChannelForm",emits:["success"],setup(fe,{expose:w,emit:K}){const{t:f}=O(),b=ne(),d=c(!1),y=c(""),m=c(!1),V=c(""),t=c({id:void 0,signature:"",code:"",status:C.ENABLE,remark:"",apiKey:"",apiSecret:"",callbackUrl:""}),E=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"}]}),p=c();w({open:async(s,l)=>{if(d.value=!0,y.value=f("action."+s),V.value=s,I(),l){m.value=!0;try{t.value=await de(l),console.log(t)}finally{m.value=!1}}}});const N=K,F=async()=>{if(p&&await p.value.validate()){m.value=!0;try{const s=t.value;V.value==="create"?(await me(s),b.success(f("common.createSuccess"))):(await ce(s),b.success(f("common.updateSuccess"))),d.value=!1,N("success")}finally{m.value=!1}}},I=()=>{var s;t.value={id:void 0,signature:"",code:"",status:C.ENABLE,remark:"",apiKey:"",apiSecret:"",callbackUrl:""},(s=p.value)==null||s.resetFields()};return(s,l)=>{const n=G,o=J,L=X,P=Y,x=Q,D=W,q=Z,g=$,M=te,R=ee;return i(),_(M,{modelValue:a(d),"onUpdate:modelValue":l[8]||(l[8]=e=>z(d)?d.value=e:null),title:a(y)},{footer:u(()=>[r(g,{disabled:a(m),type:"primary",onClick:F},{default:u(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),r(g,{onClick:l[7]||(l[7]=e=>d.value=!1)},{default:u(()=>[v("\u53D6 \u6D88")]),_:1})]),default:u(()=>[B((i(),_(q,{ref_key:"formRef",ref:p,model:a(t),rules:a(E),"label-width":"130px"},{default:u(()=>[r(o,{label:"\u77ED\u4FE1\u7B7E\u540D",prop:"signature"},{default:u(()=>[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:u(()=>[r(P,{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:u(()=>[(i(!0),h(U,null,k(a(ue)(a(S).SYSTEM_SMS_CHANNEL_CODE),e=>(i(),_(L,{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:u(()=>[r(D,{modelValue:a(t).status,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).status=e)},{default:u(()=>[(i(!0),h(U,null,k(a(se)(a(S).COMMON_STATUS),e=>(i(),_(x,{key:e.value,label:e.value},{default:u(()=>[v(j(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(o,{label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[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:u(()=>[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:u(()=>[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:u(()=>[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"])),[[R,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/sms/channel/SmsChannelForm.vue"]])});export{_e as __tla,A as default};
