FileConfigForm-e9565bc2.js 8.2 KB

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