import{K as x,A as O,y as w,L as U,B as N}from"./element-plus.33d6376e.js";import{r as F}from"./index.80c2a703.js";import{P as Y}from"./index.4107e0ad.js";import{d as I,s as B,$ as T,e as G,o as m,c as g,U as t,L as a,a as r,S as E,T as A,u as C,K as L,R as S}from"./@vue.230e89ba.js";function ou(){return F.get({url:"/setting/storage/list"})}function P(i){return F.post({url:"/setting/storage/edit",params:i})}function M(i){return F.get({url:"/setting/storage/detail",params:i})}const $={class:"edit-popup"},j={class:"form-tips"},z={key:0},H={class:"flex-1"},J={class:"flex-1"},Q=r("div",{class:"form-tips"}," \u8BF7\u8865\u5168http://\u6216https://\uFF0C\u4F8B\u5982https://static.cloud.com ",-1),W=E("\u5173\u95ED"),X=E("\u5F00\u542F"),lu=I({__name:"edit",emits:["success"],setup(i,{expose:y,emit:D}){const d=B(),p=B(),e=T({alias:"",bucket:"",accessKey:"",secretKey:"",domain:"",region:"",status:0}),V=[{name:"\u672C\u5730\u5B58\u50A8",type:"local",tips:"\u672C\u5730\u5B58\u50A8\u65B9\u5F0F\u4E0D\u9700\u8981\u914D\u7F6E\u5176\u4ED6\u53C2\u6570"},{name:"\u4E03\u725B\u4E91\u5B58\u50A8",type:"qiniu",tips:"\u5207\u6362\u4E03\u725B\u4E91\u5B58\u50A8\u540E\uFF0C\u7D20\u6750\u5E93\u9700\u8981\u91CD\u65B0\u4E0A\u4F20\u81F3\u4E03\u725B\u4E91"},{name:"\u963F\u91CC\u4E91OSS",type:"aliyun",tips:"\u5207\u6362\u963F\u91CC\u4E91OSS\u540E\uFF0C\u7D20\u6750\u5E93\u9700\u8981\u91CD\u65B0\u4E0A\u4F20\u81F3\u963F\u91CC\u4E91OSS"},{name:"\u817E\u8BAF\u4E91OSS",type:"qcloud",tips:"\u5207\u6362\u817E\u8BAF\u4E91OSS\u540E\uFF0C\u7D20\u6750\u5E93\u9700\u8981\u91CD\u65B0\u4E0A\u4F20\u81F3\u817E\u8BAF\u4E91OSS"}],b={bucket:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B58\u50A8\u7A7A\u95F4\u540D\u79F0",trigger:"blur"}],accessKey:[{required:!0,message:"\u8BF7\u8F93\u5165ACCESS_KEY",trigger:"blur"}],secretKey:[{required:!0,message:"\u8BF7\u8F93\u5165SECRET_KEY",trigger:"blur"}],domain:[{required:!0,message:"\u8BF7\u8F93\u5165\u7A7A\u95F4\u57DF\u540D",trigger:"blur"}],region:[{required:!0,message:"\u8BF7\u8F93\u5165REGION",trigger:"blur"}]},_=G(()=>V.find(l=>l.type==e.alias)),K=async()=>{var l,u;await((l=d.value)==null?void 0:l.validate()),await P(e),(u=p.value)==null||u.close(),D("success")},k=async()=>{const l=await M({alias:e.alias});for(const u in l)e[u]=l[u]},v=l=>{var u;e.alias=l,(u=p.value)==null||u.open(),k()},R=()=>{var l;(l=d.value)==null||l.resetFields()};return y({open:v}),(l,u)=>{const c=x,s=O,n=w,h=U,q=N;return m(),g("div",$,[t(Y,{ref_key:"popupRef",ref:p,title:"\u8BBE\u7F6E\u5B58\u50A8",async:!0,width:"550px",clickModalClose:!0,onConfirm:K,onClose:R},{default:a(()=>[t(q,{ref_key:"formRef",ref:d,model:e,"label-width":"120px",rules:b},{default:a(()=>[t(s,{label:"\u5B58\u50A8\u65B9\u5F0F",prop:"alias"},{default:a(()=>{var o;return[r("div",null,[t(c,{"model-value":""},{default:a(()=>{var f;return[E(A((f=C(_))==null?void 0:f.name),1)]}),_:1}),r("div",j,A((o=C(_))==null?void 0:o.tips),1)])]}),_:1}),e.alias!=="local"?(m(),g("div",z,[t(s,{label:" \u5B58\u50A8\u7A7A\u95F4\u540D\u79F0",prop:"bucket"},{default:a(()=>[r("div",H,[t(n,{modelValue:e.bucket,"onUpdate:modelValue":u[0]||(u[0]=o=>e.bucket=o),placeholder:"\u8BF7\u8F93\u5165\u5B58\u50A8\u7A7A\u95F4\u540D\u79F0(Bucket)"},null,8,["modelValue"])])]),_:1}),t(s,{label:"ACCESS_KEY",prop:"accessKey"},{default:a(()=>[t(n,{modelValue:e.accessKey,"onUpdate:modelValue":u[1]||(u[1]=o=>e.accessKey=o),placeholder:"\u8BF7\u8F93\u5165ACCESS_KEY(AK)"},null,8,["modelValue"])]),_:1}),t(s,{label:"SECRET_KEY",prop:"secretKey"},{default:a(()=>[t(n,{modelValue:e.secretKey,"onUpdate:modelValue":u[2]||(u[2]=o=>e.secretKey=o),placeholder:"\u8BF7\u8F93\u5165SECRET_KEY(SK)"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u7A7A\u95F4\u57DF\u540D",prop:"domain"},{default:a(()=>[r("div",J,[r("div",null,[t(n,{modelValue:e.domain,"onUpdate:modelValue":u[3]||(u[3]=o=>e.domain=o),placeholder:"\u8BF7\u8F93\u5165\u7A7A\u95F4\u57DF\u540D(Domain)"},null,8,["modelValue"])]),Q])]),_:1}),e.alias=="qcloud"?(m(),L(s,{key:0,label:"REGION",prop:"region"},{default:a(()=>[t(n,{modelValue:e.region,"onUpdate:modelValue":u[4]||(u[4]=o=>e.region=o),placeholder:"\u8BF7\u8F93\u5165region"},null,8,["modelValue"])]),_:1})):S("",!0)])):S("",!0),t(s,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[t(h,{modelValue:e.status,"onUpdate:modelValue":u[5]||(u[5]=o=>e.status=o)},{default:a(()=>[t(c,{label:0},{default:a(()=>[W]),_:1}),t(c,{label:1},{default:a(()=>[X]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},512)])}}});export{lu as _,ou as s};
