import{G as O,D as w,C as N,H as U,F as Y}from"./element-plus.9cae3cb1.js";import{r as E}from"./index.7f83e315.js";import{P as I}from"./index.b375235f.js";import{d as T,s as B,_ as G,b as L,o as F,c as A,V as t,M as s,u as o,a as n,S as _,T as C,L as P,R as b}from"./@vue.96c135a1.js";function te(){return E.get({url:"/setting.storage/lists"})}function H(d){return E.post({url:"/setting.storage/setup",params:d})}function M(d){return E.get({url:"/setting.storage/detail",params:d})}const j={class:"edit-popup"},z={class:"form-tips"},J={key:0},Q={class:"flex-1"},W={class:"flex-1"},X=n("div",{class:"form-tips"}," \u8BF7\u8865\u5168http://\u6216https://\uFF0C\u4F8B\u5982https://static.cloud.com ",-1),oe=T({__name:"edit",emits:["success"],setup(d,{expose:S,emit:y}){const D=y,p=B(),c=B(),u=G({engine:"",bucket:"",access_key:"",secret_key:"",domain:"",region:"",status:0}),k=[{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"}],V={bucket:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B58\u50A8\u7A7A\u95F4\u540D\u79F0",trigger:"blur"}],access_key:[{required:!0,message:"\u8BF7\u8F93\u5165ACCESS_KEY",trigger:"blur"}],secret_key:[{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"}]},f=L(()=>k.find(a=>a.type==u.engine)),v=async()=>{var a,e;await((a=p.value)==null?void 0:a.validate()),await H(u),(e=c.value)==null||e.close(),D("success")},R=async()=>{const a=await M({engine:u.engine});for(const e in a)u[e]=a[e]},h=a=>{var e;u.engine=a,(e=c.value)==null||e.open(),R()},q=()=>{var a;(a=p.value)==null||a.resetFields()};return S({open:h}),(a,e)=>{const m=O,r=w,i=N,x=U,K=Y;return F(),A("div",j,[t(I,{ref_key:"popupRef",ref:c,title:"\u8BBE\u7F6E\u5B58\u50A8",async:!0,width:"550px",onConfirm:v,onClose:q},{default:s(()=>[t(K,{ref_key:"formRef",ref:p,model:o(u),"label-width":"120px",rules:V},{default:s(()=>[t(r,{label:"\u5B58\u50A8\u65B9\u5F0F",prop:"engine"},{default:s(()=>{var l;return[n("div",null,[t(m,{"model-value":""},{default:s(()=>{var g;return[_(C((g=o(f))==null?void 0:g.name),1)]}),_:1}),n("div",z,C((l=o(f))==null?void 0:l.tips),1)])]}),_:1}),o(u).engine!=="local"?(F(),A("div",J,[t(r,{label:" \u5B58\u50A8\u7A7A\u95F4\u540D\u79F0",prop:"bucket"},{default:s(()=>[n("div",Q,[t(i,{modelValue:o(u).bucket,"onUpdate:modelValue":e[0]||(e[0]=l=>o(u).bucket=l),placeholder:"\u8BF7\u8F93\u5165\u5B58\u50A8\u7A7A\u95F4\u540D\u79F0(Bucket)",clearable:""},null,8,["modelValue"])])]),_:1}),t(r,{label:"ACCESS_KEY",prop:"access_key"},{default:s(()=>[t(i,{modelValue:o(u).access_key,"onUpdate:modelValue":e[1]||(e[1]=l=>o(u).access_key=l),placeholder:"\u8BF7\u8F93\u5165ACCESS_KEY(AK)",clearable:""},null,8,["modelValue"])]),_:1}),t(r,{label:"SECRET_KEY",prop:"secret_key"},{default:s(()=>[t(i,{modelValue:o(u).secret_key,"onUpdate:modelValue":e[2]||(e[2]=l=>o(u).secret_key=l),placeholder:"\u8BF7\u8F93\u5165SECRET_KEY(SK)",clearable:""},null,8,["modelValue"])]),_:1}),t(r,{label:"\u7A7A\u95F4\u57DF\u540D",prop:"domain"},{default:s(()=>[n("div",W,[n("div",null,[t(i,{modelValue:o(u).domain,"onUpdate:modelValue":e[3]||(e[3]=l=>o(u).domain=l),placeholder:"\u8BF7\u8F93\u5165\u7A7A\u95F4\u57DF\u540D(Domain)",clearable:""},null,8,["modelValue"])]),X])]),_:1}),o(u).engine=="qcloud"?(F(),P(r,{key:0,label:"REGION",prop:"region"},{default:s(()=>[t(i,{modelValue:o(u).region,"onUpdate:modelValue":e[4]||(e[4]=l=>o(u).region=l),placeholder:"\u8BF7\u8F93\u5165region",clearable:""},null,8,["modelValue"])]),_:1})):b("",!0)])):b("",!0),t(r,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[t(x,{modelValue:o(u).status,"onUpdate:modelValue":e[5]||(e[5]=l=>o(u).status=l)},{default:s(()=>[t(m,{label:0},{default:s(()=>[_("\u5173\u95ED")]),_:1}),t(m,{label:1},{default:s(()=>[_("\u5F00\u542F")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},512)])}}});export{oe as _,te as s};
