import{c as a,r as s,o as e,k as l,l as t,e as o,x as i,q as n,p as c,M as r,y as p,I as d,aY as m,v as u,J as y,A as g,aT as v,aZ as f}from"./base-lib.js?v=1761009159";import{_ as h}from"./index101.js?v=1761009159";import{ab as x,ac as _,ad as k}from"./config.js?v=1761009159";import{M as b,I as j,e as C}from"./utils-lib.js?v=1761009159";import{f as q}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index104.js?v=1761009159";import"./column.js?v=1761009159";const w={class:"storage-location"},I={class:"input-group"},D={class:"cloud-storage-list"},V={class:"cloud-info"},A=["src"],M={class:"operations"},T=C(a({__name:"storage-location",props:{compData:{}},emits:["close"],setup(a,{expose:C,emit:T}){const F=a,H=s(""),J=s([{name:"FTP",type:"ftp",icon:"ftp",config:!1,install:!1},{name:"阿里云",type:"alioss",icon:"alioss",config:!1,install:!1},{name:"腾讯云",type:"txcos",icon:"txcos",config:!1,install:!1},{name:"七牛云",type:"qiniu",icon:"qiniu",config:!1,install:!1}]),P=()=>{q({type:"dir",path:H.value,change:a=>{H.value="/"===a.charAt(a.length-1)?a:a+"/"}})},U=async()=>{if(H.value)try{j({loading:"正在保存...",request:x({sys_backup_path:H.value}),message:!0})}catch(a){console.log(a)}else b.error("请选择本地磁盘目录")},Y=a=>a.install?a.config?[{text:"编辑",type:"primary",handler:B},{type:"divider"},{text:"删除",type:"danger",handler:E}]:[{text:"配置",type:"primary",handler:a=>z(a.type)}]:[{text:"安装",type:"primary",handler:a=>Z(a.type)}],Z=a=>{console.log("安装",a)},z=a=>{console.log("配置",a)},B=a=>{console.log("编辑存储账号",a)},E=a=>{console.log("删除存储账号",a)};return e((()=>{(async()=>{try{const{data:a}=await _(),{data:s}=await k();a.status&&(H.value=a.msg),s.status&&(J.value=J.value.map((a=>{var e,l;return{...a,install:(null==(e=s.msg[a.type])?void 0:e.install)||!1,config:(null==(l=s.msg[a.type])?void 0:l.config)||!1}})))}catch(a){console.log(a)}})()})),C({onCancel:()=>{F.compData.callback&&F.compData.callback()}}),(a,s)=>{const e=h,x=g,_=v,k=f;return l(),t("div",w,[o(_,{class:"mb-[24px]"},{header:i((()=>s[1]||(s[1]=[n("div",{class:"card-header"},[n("span",{class:"title"},"本地磁盘")],-1)]))),default:i((()=>[n("div",I,[s[3]||(s[3]=n("span",{class:"label"},"备份目录：",-1)),o(e,{class:"mr-[12px]",modelValue:c(H),"onUpdate:modelValue":s[0]||(s[0]=a=>r(H)?H.value=a:null),icon:"el-folder-opened",onIconClick:P,width:"30rem"},null,8,["modelValue"]),o(x,{type:"primary",onClick:U},{default:i((()=>s[2]||(s[2]=[p("修改")]))),_:1})])])),_:1}),o(_,null,{header:i((()=>s[4]||(s[4]=[n("div",{class:"card-header"},[n("span",{class:"title"},"第三方存储账号")],-1)]))),default:i((()=>[n("div",D,[(l(!0),t(d,null,m(c(J),((a,s)=>(l(),t("div",{key:s,class:"cloud-item"},[n("div",V,[n("img",{class:"w-[32px] h-[32px] mr-[8px]",src:"/static/img/soft_ico/ico-".concat(a.icon,".png"),alt:""},null,8,A),n("span",null,u(a.name),1)]),n("div",M,[(l(!0),t(d,null,m(Y(a),(s=>(l(),t(d,{key:s.text||s.type},["divider"===s.type?(l(),y(k,{key:0,direction:"vertical"})):(l(),y(x,{key:1,type:s.type,link:"",onClick:e=>{var l;return null==(l=s.handler)?void 0:l.call(s,a)}},{default:i((()=>[p(u(s.text),1)])),_:2},1032,["type","onClick"]))],64)))),128))])])))),128))])])),_:1})])}}}),[["__scopeId","data-v-fcbeb37a"]]);export{T as default};
