
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as h}from"./index-7911c6db.js";import{a as g}from"./config-b4a9e7c0.js";import{d as I,Q as K,r as R,B as U,x as A,o as D,c as q,e,f as l,a as V,k as N,b as i,E as b,h as a,q as S}from"./index-4eef28ae.js";const O={class:"flex justify-between"},j=V("b",null,"腾讯云COS参数设置",-1),E=I({__name:"tencent",setup(M){const o=K({tencentCosStatus:"",cosSecretId:"",cosSecretKey:"",cosBucket:"",cosRegion:"",tencentCosAcceleratedDomain:""}),f=R();async function p(){const s=await g.queryConfig({keys:["cosSecretKey","cosBucket","cosRegion","cosSecretId","tencentCosStatus","tencentCosAcceleratedDomain"]});Object.assign(o,s.data)}function x(){var s;(s=f.value)==null||s.validate(async t=>{if(t){try{await g.setConfig({settings:C(o)}),b.success("变更配置信息成功")}catch{}p()}else b.error("请填写完整信息")})}function C(s){return Object.keys(s).map(t=>({configKey:t,configVal:s[t]}))}const m=U(()=>[{required:Number(o.tencentCosStatus)===1,message:"开启配置后请填写此项",trigger:"change"}]);return A(()=>{p()}),(s,t)=>{const _=a("el-alert"),y=h,k=a("el-button"),v=a("el-switch"),c=a("el-form-item"),u=a("el-col"),r=a("el-row"),d=a("el-input"),w=a("el-form"),B=a("el-card");return D(),q("div",null,[e(y,null,{default:l(()=>[e(_,{closable:!1,"show-icon":"",title:"腾讯云COS参数设置",description:"前往腾讯云申请对象存储服务、更多配置详见文档、申请服务前往 https://console.cloud.tencent.com/cos ！！",type:"success"})]),_:1}),e(B,{style:{margin:"20px"}},{header:l(()=>[V("div",O,[j,e(k,{class:"button",text:"",onClick:x},{default:l(()=>[N(" 保存设置 ")]),_:1})])]),default:l(()=>[e(w,{ref_key:"formRef",ref:f,model:o,"label-width":"120px"},{default:l(()=>[e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"启用状态",prop:"tencentCosStatus"},{default:l(()=>[e(v,{modelValue:o.tencentCosStatus,"onUpdate:modelValue":t[0]||(t[0]=n=>o.tencentCosStatus=n),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"SecretId",prop:"cosSecretId",rules:i(m)},{default:l(()=>[e(d,{modelValue:o.cosSecretId,"onUpdate:modelValue":t[1]||(t[1]=n=>o.cosSecretId=n),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"SecretKey",prop:"cosSecretKey",rules:i(m)},{default:l(()=>[e(d,{modelValue:o.cosSecretKey,"onUpdate:modelValue":t[2]||(t[2]=n=>o.cosSecretKey=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"存储桶名称",prop:"cosBucket",rules:i(m)},{default:l(()=>[e(d,{modelValue:o.cosBucket,"onUpdate:modelValue":t[3]||(t[3]=n=>o.cosBucket=n),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"所属地域",prop:"cosRegion",rules:i(m)},{default:l(()=>[e(d,{modelValue:o.cosRegion,"onUpdate:modelValue":t[4]||(t[4]=n=>o.cosRegion=n),placeholder:"请填写所属地域(ap-guangzhou)",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"全球加速域名",prop:"tencentCosAcceleratedDomain"},{default:l(()=>[e(d,{modelValue:o.tencentCosAcceleratedDomain,"onUpdate:modelValue":t[5]||(t[5]=n=>o.tencentCosAcceleratedDomain=n),placeholder:"如您是国外服务器可开启全球加速域名得到更快响应速度、同理也会更高计费！",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}});typeof S=="function"&&S(E);export{E as default};
