import{d as v,h as V,Y as K,r as d,o as m,f as p,w as a,b as t,H as i,a2 as k,l as g,E as U}from"./index.e3896b23.js";import{u as N,a as q}from"./sms.f04d455c.js";const S=g("\u53D6\u6D88"),w=g("\u786E\u5B9A"),$=v({__name:"add-or-update",emits:["refreshDataList"],setup(x,{expose:E,emit:b}){const n=V(!1),f=V(),e=K({id:"",platform:0,signName:"",templateId:"",appId:"",senderId:"",url:"",accessKey:"",secretKey:"",status:0,version:"",createTime:""}),y=s=>{n.value=!0,e.id="",f.value&&f.value.resetFields(),s&&D(s)},D=s=>{N(s).then(u=>{Object.assign(e,u.data)})},_=V({platform:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],appId:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],signName:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],templateId:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],url:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accessKey:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],secretKey:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),A=()=>{f.value.validate(s=>{if(!s)return!1;q(e).then(()=>{U.success({message:"\u64CD\u4F5C\u6210\u529F",duration:500,onClose:()=>{n.value=!1,b("refreshDataList")}})})})};return E({init:y}),(s,u)=>{const c=d("fast-select"),o=d("el-form-item"),r=d("el-input"),B=d("fast-radio-group"),C=d("el-form"),F=d("el-button"),I=d("el-dialog");return m(),p(I,{modelValue:n.value,"onUpdate:modelValue":u[13]||(u[13]=l=>n.value=l),title:e.id?"\u4FEE\u6539":"\u65B0\u589E","close-on-click-modal":!1},{footer:a(()=>[t(F,{onClick:u[11]||(u[11]=l=>n.value=!1)},{default:a(()=>[S]),_:1}),t(F,{type:"primary",onClick:u[12]||(u[12]=l=>A())},{default:a(()=>[w]),_:1})]),default:a(()=>[t(C,{ref_key:"dataFormRef",ref:f,model:e,rules:_.value,"label-width":"100px",onKeyup:u[10]||(u[10]=k(l=>A(),["enter"]))},{default:a(()=>[t(o,{label:"\u5E73\u53F0\u7C7B\u578B",prop:"platform"},{default:a(()=>[t(c,{modelValue:e.platform,"onUpdate:modelValue":u[0]||(u[0]=l=>e.platform=l),"dict-type":"sms_platform",placeholder:"\u5E73\u53F0\u7C7B\u578B",style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.platform==3?(m(),p(o,{key:0,label:"\u63A5\u5165\u5730\u5740",prop:"url"},{default:a(()=>[t(r,{modelValue:e.url,"onUpdate:modelValue":u[1]||(u[1]=l=>e.url=l),placeholder:"APP\u63A5\u5165\u5730\u5740"},null,8,["modelValue"])]),_:1})):i("",!0),e.platform==1?(m(),p(o,{key:1,label:"AppId",prop:"appId"},{default:a(()=>[t(r,{modelValue:e.appId,"onUpdate:modelValue":u[2]||(u[2]=l=>e.appId=l),placeholder:"AppId"},null,8,["modelValue"])]),_:1})):i("",!0),e.platform!=2?(m(),p(o,{key:2,label:"\u77ED\u4FE1\u7B7E\u540D",prop:"signName"},{default:a(()=>[t(r,{modelValue:e.signName,"onUpdate:modelValue":u[3]||(u[3]=l=>e.signName=l),placeholder:"\u77ED\u4FE1\u7B7E\u540D"},null,8,["modelValue"])]),_:1})):i("",!0),t(o,{label:"\u77ED\u4FE1\u6A21\u677F",prop:"templateId"},{default:a(()=>[t(r,{modelValue:e.templateId,"onUpdate:modelValue":u[4]||(u[4]=l=>e.templateId=l),placeholder:"\u77ED\u4FE1\u6A21\u677F"},null,8,["modelValue"])]),_:1}),t(o,{label:"AccessKey",prop:"accessKey"},{default:a(()=>[t(r,{modelValue:e.accessKey,"onUpdate:modelValue":u[5]||(u[5]=l=>e.accessKey=l),placeholder:"AccessKey"},null,8,["modelValue"])]),_:1}),t(o,{label:"SecretKey",prop:"secretKey"},{default:a(()=>[t(r,{modelValue:e.secretKey,"onUpdate:modelValue":u[6]||(u[6]=l=>e.secretKey=l),placeholder:"SecretKey"},null,8,["modelValue"])]),_:1}),e.platform==1?(m(),p(o,{key:3,label:"SenderId",prop:"senderId"},{default:a(()=>[t(r,{modelValue:e.senderId,"onUpdate:modelValue":u[7]||(u[7]=l=>e.senderId=l),placeholder:"\u56FD\u9645\u77ED\u4FE1\u5FC5\u586B"},null,8,["modelValue"])]),_:1})):i("",!0),e.platform==3?(m(),p(o,{key:4,label:"\u901A\u9053\u53F7",prop:"senderId"},{default:a(()=>[t(r,{modelValue:e.senderId,"onUpdate:modelValue":u[8]||(u[8]=l=>e.senderId=l),placeholder:"\u901A\u9053\u53F7\u5FC5\u586B"},null,8,["modelValue"])]),_:1})):i("",!0),t(o,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[t(B,{modelValue:e.status,"onUpdate:modelValue":u[9]||(u[9]=l=>e.status=l),"dict-type":"enable_disable"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{$ as _};
