mirror of
https://github.com/vastxie/99AI.git
synced 2025-09-19 18:16:39 +08:00
9 lines
3.2 KiB
JavaScript
9 lines
3.2 KiB
JavaScript
|
||
/**
|
||
* 由 Fantastic-admin 提供技术支持
|
||
* Powered by Fantastic-admin
|
||
* https://fantastic-admin.github.io
|
||
*/
|
||
|
||
import{_ as w}from"./index.vue_vue_type_script_setup_true_lang-DKdjIYRj.js";import{a as _}from"./config-BQ9gBCXa.js";import{d as B,m as R,r as p,a as h,n as a,g as v,c as q,b as e,w as l,e as S,h as O,E as g,k as b}from"./index-DEc4xym2.js";const U={class:"flex justify-between"},j=S("b",null,"COS参数设置",-1),E=B({__name:"cos",setup(N){const t=R({cosSecretId:"",cosSecretKey:"",cosBucket:"",cosRegion:""}),y=p({cosSecretKey:[{required:!0,trigger:"blur",message:"请填写SecretKey"}],cosBucket:[{required:!0,trigger:"blur",message:"请填写存储桶名称"}],cosRegion:[{required:!0,trigger:"blur",message:"请填写存储桶所属地域"}],cosSecretId:[{required:!0,trigger:"blur",message:"请填写SecretId"}]}),i=p();async function m(){const r=await _.queryConfig({keys:["cosSecretKey","cosBucket","cosRegion","cosSecretId"]});Object.assign(t,r.data)}function x(){var r;(r=i.value)==null||r.validate(async o=>{if(o){try{await _.setConfig({settings:V(t)}),g.success("变更配置信息成功")}catch{}m()}else g.error("请填写完整信息")})}function V(r){return Object.keys(r).map(o=>({configKey:o,configVal:r[o]}))}return h(()=>{m()}),(r,o)=>{const f=a("el-alert"),k=w,C=a("el-button"),s=a("el-input"),n=a("el-form-item"),u=a("el-col"),d=a("el-row"),I=a("el-form"),K=a("el-card");return v(),q("div",null,[e(k,null,{default:l(()=>[e(f,{closable:!1,"show-icon":"",title:"COS参数说明",description:"当前默认使用腾讯云COS对象存储、如果您有特殊的对接通道、将为您开放API对接!!",type:"success"})]),_:1}),e(K,{style:{margin:"20px"}},{header:l(()=>[S("div",U,[j,e(C,{class:"button",text:"",onClick:x},{default:l(()=>[O(" 保存设置 ")]),_:1})])]),default:l(()=>[e(I,{ref_key:"formRef",ref:i,rules:y.value,model:t,"label-width":"120px"},{default:l(()=>[e(d,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(n,{label:"SecretId",prop:"cosSecretId"},{default:l(()=>[e(s,{modelValue:t.cosSecretId,"onUpdate:modelValue":o[0]||(o[0]=c=>t.cosSecretId=c),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(n,{label:"SecretKey",prop:"cosSecretKey"},{default:l(()=>[e(s,{modelValue:t.cosSecretKey,"onUpdate:modelValue":o[1]||(o[1]=c=>t.cosSecretKey=c),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(n,{label:"存储桶名称",prop:"cosBucket"},{default:l(()=>[e(s,{modelValue:t.cosBucket,"onUpdate:modelValue":o[2]||(o[2]=c=>t.cosBucket=c),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(n,{label:"所属地域",prop:"cosRegion"},{default:l(()=>[e(s,{modelValue:t.cosRegion,"onUpdate:modelValue":o[3]||(o[3]=c=>t.cosRegion=c),placeholder:"请填写所属地域(ap-guangzhou)",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof b=="function"&&b(E);export{E as default};
|