← Back
Editing: index475.js
import{A as e,c as a,b as t,at as s}from"./utils-lib.js?v=VERSION_NUMBER";import{c as l,r as i,w as r,p as n,a4 as o,G as u,H as c,x as p,q as d,v,y as m,C as f,B as y,e as x,P as _,A as g,D as h}from"./base-lib.js?v=VERSION_NUMBER";import{B as b}from"./index140.js?v=VERSION_NUMBER";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang5.js?v=VERSION_NUMBER";import{saveFileBody as w,getJavaProjectConfigList as k,getFileBody as C}from"./site.js?v=VERSION_NUMBER";import{u as F,S as D}from"./useStore4.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./ace.js?v=VERSION_NUMBER";const S={class:"h-full relative"},H={key:0,class:"bg-[#7F7F7F] flex items-center justify-center h-[72rem]"},V={key:1},q={class:"inline-block text-[#666] items-center flex"},A={class:"max-w-[55rem] truncate leading-[1.3] inline-block"},B={class:"my-12px"},E={key:0,class:"flex"},L={key:2,class:"bg-[#7F7F7F] flex items-center justify-center h-[72rem]"},O={class:"bg-white px-48px py-16px text-[#333] flex items-center"},T=l({__name:"index",props:{compData:{default:()=>({})}},setup(l,{expose:T}){const{siteInfo:U}=F(),{jumpTabEvent:G}=D(),I=t(),M=i(!1),P=i(""),z=i(!1),J=i({}),K=i(""),N=i(!1),Q=i(""),R=async e=>{if(z.value)try{if(e.data)return K.value=e.data;N.value=!0;const{data:a}=await C({path:e.path});K.value=a.data,N.value=!1}catch(a){s(a),K.value=""}finally{N.value=!1}},W=async()=>{let e=I.load("正在保存内容,请稍候...");try{const e=await w({data:K.value,encoding:"utf-8",path:J.value.path});I.msg({dangerouslyUseHTMLString:!0,message:"<div>".concat(e.msg,"</div>"),type:e.status?"success":"error",duration:e.status?2e3:0,showClose:!e.status,customClass:"!max-w-[70rem]"})}catch(a){}finally{e.close()}};r((()=>U.value),(e=>{var a;(null==(a=U.value.project_config)?void 0:a.bind_extranet)&&(z.value=!!U.value.project_config.bind_extranet)}),{immediate:!0});const X=async()=>{let e=U.value.project_type.toLowerCase();Q.value=e,z.value=!0,(async()=>{try{M.value=!0;const{data:e}=await k({project_name:U.value.name});if(!e.status)return void I.error(e.msg);J.value=e.data.find((e=>"伪静态配置文件"===e.name)),J.value&&(P.value=J.value.path,R(J.value))}catch(e){s(e)}finally{M.value=!1}})()};return n(X),T({init:X}),o((()=>{J.value={}})),(t,s)=>{var l,i;const r=b,n=h,o=a,w=u("bt-loading");return c((d(),v("div",S,[(null==(l=p(J))?void 0:l.path)?f("",!0):(d(),v("div",H,s[3]||(s[3]=[m("div",{class:"bg-white px-48px py-16px text-[#333]"},"暂无配置文件",-1)]))),p(z)&&(null==(i=p(J))?void 0:i.path)?(d(),v("div",V,[m("span",q,[s[4]||(s[4]=y(" 文件位置: ")),m("div",A,[x(j,{text:p(J).path},null,8,["text"])]),m("span",{class:"ml-[2rem] svgtofont-el-document-copy cursor-pointer",onClick:s[0]||(s[0]=a=>p(e)({value:p(J).path}))})]),m("div",B,[c(x(r,{class:"!h-[54rem] !w-[64rem] border border-[#DCDFE6] rounded-4px",modelValue:p(K),"onUpdate:modelValue":s[1]||(s[1]=e=>_(K)?K.value=e:null),request:!1,onSave:W,editorOption:{readonly:"spring"===p(J).type}},null,8,["modelValue","editorOption"]),[[w,p(N)]])]),"spring"!==p(J).type?(d(),v("div",E,[x(n,{type:"primary",onClick:W},{default:g((()=>s[5]||(s[5]=[y("保存")]))),_:1})])):f("",!0)])):(d(),v("div",L,[m("div",O,[s[7]||(s[7]=y("请开启 ")),x(o,{onClick:s[2]||(s[2]=e=>p(G)("mapping"))},{default:g((()=>s[6]||(s[6]=[y("外网映射")]))),_:1}),s[8]||(s[8]=y(" 后查看配置信息"))])]))])),[[w,p(M)],[w,"正在加载配置文件,请稍后...","title"]])}}});export{T as default};
Save File
Cancel