1 |
- import{ar as m,d as M,A as H,r as _,g as N,o as s,k as d,w as r,i as t,a as e,l as V,C as Q,c as X,F as J,B as W,R as c,Q as Y,X as Z,H as $,D as ee,G as ae,aV as le,ai as oe,aj as re,I as te,q as se,L as ue,__tla as de}from"./index-abaca7e8.js";import{_ as ie,__tla as ce}from"./Dialog-a2f7c92a.js";import{c as ne,D as ge,__tla as me}from"./dict-885a7988.js";import{u as fe,__tla as pe}from"./useMessage-7c79d01b.js";import{_ as _e}from"./_plugin-vue_export-helper-1b428a4d.js";let h,S,F,P,A,C,be=Promise.all([(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return pe}catch{}})()]).then(async()=>{P=g=>m.get({url:"/infra/file-config/page",params:g}),C=g=>m.put({url:"/infra/file-config/update-master?id="+g}),F=g=>m.delete({url:"/infra/file-config/delete?id="+g}),A=g=>m.get({url:"/infra/file-config/test?id="+g}),h=_e(M({name:"InfraFileConfigForm",__name:"FileConfigForm",emits:["success"],setup(g,{expose:I,emit:K}){const{t:y}=H(),k=fe(),f=_(!1),v=_(""),p=_(!1),U=_(""),a=_({id:void 0,name:"",storage:0,remark:"",config:{}}),R=N({name:[{required:!0,message:"\u914D\u7F6E\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],storage:[{required:!0,message:"\u5B58\u50A8\u5668\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],config:{basePath:[{required:!0,message:"\u57FA\u7840\u8DEF\u5F84\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],host:[{required:!0,message:"\u4E3B\u673A\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],port:[{required:!0,message:"\u4E3B\u673A\u7AEF\u53E3\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],username:[{required:!0,message:"\u7528\u6237\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],password:[{required:!0,message:"\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],mode:[{required:!0,message:"\u8FDE\u63A5\u6A21\u5F0F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],endpoint:[{required:!0,message:"\u8282\u70B9\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],bucket:[{required:!0,message:"\u5B58\u50A8 bucket \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accessKey:[{required:!0,message:"accessKey \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accessSecret:[{required:!0,message:"accessSecret \u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],domain:[{required:!0,message:"\u81EA\u5B9A\u4E49\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}}),b=_();I({open:async(n,l)=>{if(f.value=!0,v.value=y("action."+n),U.value=n,j(),l){p.value=!0;try{a.value=await(i=>m.get({url:"/infra/file-config/get?id="+i}))(l)}finally{p.value=!1}}}});const x=K,O=async()=>{if(b&&await b.value.validate()){p.value=!0;try{const n=a.value;U.value==="create"?(await(l=>m.post({url:"/infra/file-config/create",data:l}))(n),k.success(y("common.createSuccess"))):(await(l=>m.put({url:"/infra/file-config/update",data:l}))(n),k.success(y("common.updateSuccess"))),f.value=!1,x("success")}finally{p.value=!1}}},j=()=>{var n;a.value={id:void 0,name:"",storage:void 0,remark:"",config:{}},(n=b.value)==null||n.resetFields()};return(n,l)=>{const i=Z,u=$,D=ee,E=ae,T=le,q=oe,B=re,G=te,w=se,L=ie,z=ue;return s(),d(L,{modelValue:e(f),"onUpdate:modelValue":l[16]||(l[16]=o=>Y(f)?f.value=o:null),title:e(v)},{footer:r(()=>[t(w,{disabled:e(p),type:"primary",onClick:O},{default:r(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),t(w,{onClick:l[15]||(l[15]=o=>f.value=!1)},{default:r(()=>[V("\u53D6 \u6D88")]),_:1})]),default:r(()=>[Q((s(),d(G,{ref_key:"formRef",ref:b,model:e(a),rules:e(R),"label-width":"120px"},{default:r(()=>[t(u,{label:"\u914D\u7F6E\u540D",prop:"name"},{default:r(()=>[t(i,{modelValue:e(a).name,"onUpdate:modelValue":l[0]||(l[0]=o=>e(a).name=o),placeholder:"\u8BF7\u8F93\u5165\u914D\u7F6E\u540D"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[t(i,{modelValue:e(a).remark,"onUpdate:modelValue":l[1]||(l[1]=o=>e(a).remark=o),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u5B58\u50A8\u5668",prop:"storage"},{default:r(()=>[t(E,{modelValue:e(a).storage,"onUpdate:modelValue":l[2]||(l[2]=o=>e(a).storage=o),disabled:e(a).id!==void 0,placeholder:"\u8BF7\u9009\u62E9\u5B58\u50A8\u5668"},{default:r(()=>[(s(!0),X(J,null,W(e(ne)(e(ge).INFRA_FILE_STORAGE),o=>(s(),d(D,{key:o.value,label:o.label,value:parseInt(o.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),e(a).storage>=10&&e(a).storage<=12?(s(),d(u,{key:0,label:"\u57FA\u7840\u8DEF\u5F84",prop:"config.basePath"},{default:r(()=>[t(i,{modelValue:e(a).config.basePath,"onUpdate:modelValue":l[3]||(l[3]=o=>e(a).config.basePath=o),placeholder:"\u8BF7\u8F93\u5165\u57FA\u7840\u8DEF\u5F84"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage>=11&&e(a).storage<=12?(s(),d(u,{key:1,label:"\u4E3B\u673A\u5730\u5740",prop:"config.host"},{default:r(()=>[t(i,{modelValue:e(a).config.host,"onUpdate:modelValue":l[4]||(l[4]=o=>e(a).config.host=o),placeholder:"\u8BF7\u8F93\u5165\u4E3B\u673A\u5730\u5740"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage>=11&&e(a).storage<=12?(s(),d(u,{key:2,label:"\u4E3B\u673A\u7AEF\u53E3",prop:"config.port"},{default:r(()=>[t(T,{modelValue:e(a).config.port,"onUpdate:modelValue":l[5]||(l[5]=o=>e(a).config.port=o),min:0,placeholder:"\u8BF7\u8F93\u5165\u4E3B\u673A\u7AEF\u53E3"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage>=11&&e(a).storage<=12?(s(),d(u,{key:3,label:"\u7528\u6237\u540D",prop:"config.username"},{default:r(()=>[t(i,{modelValue:e(a).config.username,"onUpdate:modelValue":l[6]||(l[6]=o=>e(a).config.username=o),placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage>=11&&e(a).storage<=12?(s(),d(u,{key:4,label:"\u5BC6\u7801",prop:"config.password"},{default:r(()=>[t(i,{modelValue:e(a).config.password,"onUpdate:modelValue":l[7]||(l[7]=o=>e(a).config.password=o),placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage===11?(s(),d(u,{key:5,label:"\u8FDE\u63A5\u6A21\u5F0F",prop:"config.mode"},{default:r(()=>[t(B,{modelValue:e(a).config.mode,"onUpdate:modelValue":l[8]||(l[8]=o=>e(a).config.mode=o)},{default:r(()=>[t(q,{key:"Active",label:"Active"},{default:r(()=>[V("\u4E3B\u52A8\u6A21\u5F0F")]),_:1}),t(q,{key:"Passive",label:"Passive"},{default:r(()=>[V("\u88AB\u52A8\u6A21\u5F0F")]),_:1})]),_:1},8,["modelValue"])]),_:1})):c("",!0),e(a).storage===20?(s(),d(u,{key:6,label:"\u8282\u70B9\u5730\u5740",prop:"config.endpoint"},{default:r(()=>[t(i,{modelValue:e(a).config.endpoint,"onUpdate:modelValue":l[9]||(l[9]=o=>e(a).config.endpoint=o),placeholder:"\u8BF7\u8F93\u5165\u8282\u70B9\u5730\u5740"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage===20?(s(),d(u,{key:7,label:"\u5B58\u50A8 bucket",prop:"config.bucket"},{default:r(()=>[t(i,{modelValue:e(a).config.bucket,"onUpdate:modelValue":l[10]||(l[10]=o=>e(a).config.bucket=o),placeholder:"\u8BF7\u8F93\u5165 bucket"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage===20?(s(),d(u,{key:8,label:"accessKey",prop:"config.accessKey"},{default:r(()=>[t(i,{modelValue:e(a).config.accessKey,"onUpdate:modelValue":l[11]||(l[11]=o=>e(a).config.accessKey=o),"show-password":"",placeholder:"\u8BF7\u8F93\u5165 accessKey"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage===20?(s(),d(u,{key:9,label:"accessSecret",prop:"config.accessSecret"},{default:r(()=>[t(i,{modelValue:e(a).config.accessSecret,"onUpdate:modelValue":l[12]||(l[12]=o=>e(a).config.accessSecret=o),"show-password":"",placeholder:"\u8BF7\u8F93\u5165 accessSecret"},null,8,["modelValue"])]),_:1})):c("",!0),e(a).storage===20?(s(),d(u,{key:10,label:"\u81EA\u5B9A\u4E49\u57DF\u540D"},{default:r(()=>[t(i,{modelValue:e(a).config.domain,"onUpdate:modelValue":l[13]||(l[13]=o=>e(a).config.domain=o),placeholder:"\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u57DF\u540D"},null,8,["modelValue"])]),_:1})):e(a).storage?(s(),d(u,{key:11,label:"\u81EA\u5B9A\u4E49\u57DF\u540D",prop:"config.domain"},{default:r(()=>[t(i,{modelValue:e(a).config.domain,"onUpdate:modelValue":l[14]||(l[14]=o=>e(a).config.domain=o),placeholder:"\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u57DF\u540D"},null,8,["modelValue"])]),_:1})):c("",!0)]),_:1},8,["model","rules"])),[[z,e(p)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-535031fe"]]),S=Object.freeze(Object.defineProperty({__proto__:null,default:h},Symbol.toStringTag,{value:"Module"}))});export{h as F,be as __tla,S as a,F as d,P as g,A as t,C as u};
|