import{c as e,h as a,r as l,k as s,l as t,e as o,x as r,p as d,C as m,q as u,D as p,F as i,y as n,v as c,N as f,a7 as _,A as v,a4 as b}from"./base-lib.js?v=1761009159";import{I as h,j as g,e as V}from"./utils-lib.js?v=1761009159";import{g as x,bp as y}from"./useStore4.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const w={class:"flex flex-col p-[1.6rem] lib-box"},k=V(e({__name:"add-storage-dialog",emits:["close"],setup(e,{expose:V,emit:k}){const{refs:{isRefreshStorageList:j}}=x(),S=k,U=a({name:"",driver:"local",driver_opts:"",labels:"",remark:""}),q=l(!1),C=l(),F={name:[{required:!0,message:"请输入卷名",trigger:["blur"]}]};return V({onConfirm:async()=>{await C.value.validate();try{h({request:y({data:JSON.stringify(U)}),loading:"正在添加,请稍候...",message:!0,success:({status:e})=>{e&&(j.value=!0,S("close"))}})}catch(e){console.log(e)}}}),(e,a)=>{const l=g,h=_,V=v,x=b;return s(),t("div",w,[o(x,{ref_key:"cmdFormRef",ref:C,model:d(U),rules:F,onSubmit:a[5]||(a[5]=f((()=>{}),["prevent"]))},{default:r((()=>[o(h,{prop:"name",label:"卷名"},{default:r((()=>[o(l,{modelValue:d(U).name,"onUpdate:modelValue":a[0]||(a[0]=e=>d(U).name=e),width:"35rem",placeholder:"请输入卷名"},null,8,["modelValue"])])),_:1}),m(u("div",null,[o(h,{prop:"path",label:"选项"},{default:r((()=>[o(l,{modelValue:d(U).driver_opts,"onUpdate:modelValue":a[1]||(a[1]=e=>d(U).driver_opts=e),type:"textarea",width:"35rem",placeholder:"选项"},null,8,["modelValue"])])),_:1}),o(h,{prop:"path",label:"标签"},{default:r((()=>[o(l,{modelValue:d(U).labels,"onUpdate:modelValue":a[2]||(a[2]=e=>d(U).labels=e),type:"textarea",width:"35rem",placeholder:"存储券标签，一行一个，例：key=value"},null,8,["modelValue"])])),_:1})],512),[[p,d(q)]]),o(h,{prop:"path",label:"备注"},{default:r((()=>[o(l,{modelValue:d(U).remark,"onUpdate:modelValue":a[3]||(a[3]=e=>d(U).remark=e),type:"textarea",width:"35rem",placeholder:"备注"},null,8,["modelValue"])])),_:1}),o(V,{title:"更多设置",type:"text",class:"!mt-[1rem] !ml-[8.6rem]",onClick:a[4]||(a[4]=e=>q.value=!d(q))},{default:r((()=>[u("i",{class:i(d(q)?"svgtofont-el-arrow-up":"svgtofont-el-arrow-down")},null,2),n(" "+c(d(q)?"收起更多设置":"更多设置"),1)])),_:1})])),_:1},8,["model"])])}}}),[["__scopeId","data-v-4ed88817"]]);export{k as default};
