
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as C}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as k,Q as v,r as m,x as S,o as q,c as j,e,f as t,a as g,k as D,E as b,h as n,q as y}from"./index-4eef28ae.js";const P={class:"flex justify-between"},B=g("b",null,"百度翻译参数设置",-1),E=k({__name:"baidufanyi",setup(N){const l=v({baiduFanyiAppId:"",baiduFanyiSecret:""}),x=m({baiduFanyiSecret:[{required:!0,trigger:"blur",message:"请填写应用ID"}],baiduFanyiAppId:[{required:!0,trigger:"blur",message:"请填写基础ID"}]}),i=m();async function s(){const o=await f.queryConfig({keys:["baiduFanyiSecret","baiduFanyiAppId"]});Object.assign(l,o.data)}function F(){var o;(o=i.value)==null||o.validate(async a=>{if(a){try{await f.setConfig({settings:I(l)}),b.success("变更配置信息成功")}catch{}s()}else b.error("请填写完整信息")})}function I(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return S(()=>{s()}),(o,a)=>{const u=n("el-alert"),A=C,V=n("el-button"),c=n("el-input"),d=n("el-form-item"),p=n("el-col"),_=n("el-row"),h=n("el-form"),w=n("el-card");return q(),j("div",null,[e(A,null,{default:t(()=>[e(u,{closable:!1,"show-icon":"",title:"百度翻译参数说明",description:"百度翻译为可选项、仅在mj描述词绘画中使用、当开启设置为百度翻译时会使用翻译、反之则使用AI翻译、如您需要、具体申请配置文档地址 https://api.fanyi.baidu.com/ 请开通通用文本翻译、别忘记填写你的服务器白名单才能使用！",type:"success"})]),_:1}),e(w,{style:{margin:"20px"}},{header:t(()=>[g("div",P,[B,e(V,{class:"button",text:"",onClick:F},{default:t(()=>[D(" 保存设置 ")]),_:1})])]),default:t(()=>[e(h,{ref_key:"formRef",ref:i,rules:x.value,model:l,"label-width":"130px"},{default:t(()=>[e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译APPID",prop:"baiduFanyiAppId"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiAppId,"onUpdate:modelValue":a[0]||(a[0]=r=>l.baiduFanyiAppId=r),placeholder:"请填写百度翻译APPID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译秘钥",prop:"baiduFanyiSecret"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiSecret,"onUpdate:modelValue":a[1]||(a[1]=r=>l.baiduFanyiSecret=r),placeholder:"请填写百度翻译秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default};
