import{G as C,H as K,D as P,C as R,F as S}from"./element-plus.fa1aa32c.js";import{b as k,c as v}from"./message.910b3d2c.js";import{P as T}from"./index.082aefea.js";import{f as w}from"./index.0abf9e5c.js";import{d as A,s as c,a0 as U,o as d,c as x,V as u,M as l,a as Y,U as q,L as m,S as i,T as f}from"./@vue.cab01781.js";const N={class:"edit-popup"},h=f("\u5173\u95ED"),G=f("\u5F00\u542F"),O=A({__name:"edit",emits:["success"],setup(H,{expose:E,emit:F}){const p=c(),n=c(),e=U({name:"",alias:"",sign:"",appKey:"",appId:"",secretKey:"",secretId:"",status:0}),g={sign:[{required:!0,message:"\u8BF7\u8F93\u5165\u77ED\u4FE1\u7B7E\u540D",trigger:"blur"}],appId:[{required:!0,message:"\u8BF7\u8F93\u5165APP_ID",trigger:"blur"}],appKey:[{required:!0,message:"\u8BF7\u8F93\u5165APP_KEY",trigger:"blur"}],secretKey:[{required:!0,message:"\u8BF7\u8F93\u5165SECRET_KEY",trigger:"blur"}],secretId:[{required:!0,message:"\u8BF7\u8F93\u5165SECRET_ID",trigger:"blur"}]},V=async()=>{var t,a;await((t=p.value)==null?void 0:t.validate()),await k(e),w.msgSuccess("\u64CD\u4F5C\u6210\u529F"),(a=n.value)==null||a.close(),F("success")},y=async()=>{const t=await v({alias:e.alias});for(const a in t)e[a]=t[a]},B=t=>{var a;e.alias=t,(a=n.value)==null||a.open(),y()},D=()=>{var t;(t=p.value)==null||t.resetFields()};return E({open:B}),(t,a)=>{const s=P,r=R,_=C,b=K,I=S;return d(),x("div",N,[u(T,{ref_key:"popupRef",ref:n,title:"\u8BBE\u7F6E\u5B58\u50A8",async:!0,width:"550px",onConfirm:V,onClose:D},{default:l(()=>[u(I,{ref_key:"formRef",ref:p,model:e,"label-width":"120px",rules:g},{default:l(()=>[u(s,{label:"\u77ED\u4FE1\u6E20\u9053"},{default:l(()=>[Y("div",null,q(e.name),1)]),_:1}),u(s,{label:"\u77ED\u4FE1\u7B7E\u540D",prop:"sign"},{default:l(()=>[u(r,{modelValue:e.sign,"onUpdate:modelValue":a[0]||(a[0]=o=>e.sign=o),placeholder:"\u8BF7\u8F93\u5165\u77ED\u4FE1\u7B7E\u540D"},null,8,["modelValue"])]),_:1}),e.alias=="aliyun"?(d(),m(s,{key:0,label:"APP_KEY",prop:"appKey"},{default:l(()=>[u(r,{modelValue:e.appKey,"onUpdate:modelValue":a[1]||(a[1]=o=>e.appKey=o),placeholder:"\u8BF7\u8F93\u5165APP_KEY"},null,8,["modelValue"])]),_:1})):i("",!0),e.alias=="tencent"?(d(),m(s,{key:1,label:"APP_ID",prop:"appId"},{default:l(()=>[u(r,{modelValue:e.appId,"onUpdate:modelValue":a[2]||(a[2]=o=>e.appId=o),placeholder:"\u8BF7\u8F93\u5165APP_ID"},null,8,["modelValue"])]),_:1})):i("",!0),e.alias=="tencent"?(d(),m(s,{key:2,label:"SECRET_ID",prop:"secretId"},{default:l(()=>[u(r,{modelValue:e.secretId,"onUpdate:modelValue":a[3]||(a[3]=o=>e.secretId=o),placeholder:"\u8BF7\u8F93\u5165SECRET_ID"},null,8,["modelValue"])]),_:1})):i("",!0),u(s,{label:"SECRET_KEY",prop:"secretKey"},{default:l(()=>[u(r,{modelValue:e.secretKey,"onUpdate:modelValue":a[4]||(a[4]=o=>e.secretKey=o),placeholder:"\u8BF7\u8F93\u5165SECRET_KEY"},null,8,["modelValue"])]),_:1}),u(s,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[u(b,{modelValue:e.status,"onUpdate:modelValue":a[5]||(a[5]=o=>e.status=o)},{default:l(()=>[u(_,{label:0},{default:l(()=>[h]),_:1}),u(_,{label:1},{default:l(()=>[G]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},512)])}}});export{O as _};
