import{r as e,k as l,V as t,W as o,X as a,O as s,a3 as n,j as r,Z as c,Y as i,H as u,ao as p,ap as f,w as m,o as d,J as v,a1 as h,l as x,v as w,n as g}from"./base-lib.js?v=20260328163632";import{l as H,M as y,A as S,_ as b}from"./utils-lib.js?v=20260328163632";import{B as _}from"./naive-ui.js?v=20260328163632";const k=e(""),B={class:"mb-10px"},D={class:"flex-1"},L=l({__name:"full-screen",props:{compData:{default:()=>({isHtml:!1,autoScroll:!0,onLoad:()=>({}),onRefresh:()=>({})})}},setup(l){const p=l,f=e(window.innerHeight-44),m=e(window.innerHeight-124),d=()=>{var e;(null==(e=p.compData)?void 0:e.onLoad)&&p.compData.onLoad()};window.onresize=()=>{f.value=window.innerHeight-44,m.value=window.innerHeight-124};const v=async()=>{await p.compData.onRefresh(),y.success(H("刷新成功"))};return(e,l)=>{const p=_;return t(),o("div",{class:"w-full flex flex-col p-20px",style:u({height:i(f)+"px !important"})},[a("div",B,[s(p,{onClick:v},{default:n((()=>[r(c(i(H)("刷新日志")),1)])),_:1})]),a("div",D,[s(j,{style:u({height:i(m)+"px"}),content:i(k),"is-html":e.compData.isHtml,"auto-scroll":e.compData.autoScroll,onLoad:d},null,8,["style","content","is-html","auto-scroll"])])],4)}}}),M=["innerHTML"],R={key:1,class:"flex-1 w-full p-0 bg-none whitespace-pre-line text-i text-[var(--text-color-31)]"},j=b(l({__name:"index",props:p({isHtml:{type:Boolean,default:!1},autoScroll:{type:Boolean,default:!0},fullScreen:{type:[Object,Boolean],default:!1}},{content:{default:""},contentModifiers:{}}),emits:p(["load"],["update:content"]),setup(l,{expose:u,emit:p}){const y=l,b=f(l,"content"),B=p,D=e(null),j=e(!1),T=()=>{g((()=>{const e=D.value,{scrollHeight:l}=e;e.scrollTop=l}))},C=e=>{const{scrollTop:l,scrollHeight:t,clientHeight:o}=e.target;l+o>=t-1&&B("load")};m((()=>b.value),(()=>{k.value=b.value,y.autoScroll&&T()}),{immediate:!0});const O=e=>{y.fullScreen&&(j.value=e)},z=()=>{S({title:y.fullScreen.title,area:"100%",showFooter:!1,closeBtn:2,customClass:"full-screen-dialog",component:L,compData:{isHtml:y.isHtml,autoScroll:y.autoScroll,onLoad:()=>B("load"),onRefresh:y.fullScreen.onRefresh}})};return d((()=>{y.autoScroll&&T()})),v((()=>{k.value=""})),u({preRef:D,setScrollBottom:T}),(e,l)=>{const u=_;return t(),o("div",{class:"w-full h-full relative",onMouseover:l[0]||(l[0]=e=>O(!0)),onMouseleave:l[1]||(l[1]=e=>O(!1))},[a("pre",{ref_key:"preRef",ref:D,style:{height:"100%"},onScroll:C,class:"w-full flex items-start py-[10px] px-4 overflow-y-auto bg-[var(--bg-black-10)] log-box"},[l[2]||(l[2]=r("\t\t\t")),e.isHtml?(t(),o("code",{key:0,class:"flex-1 w-full p-0 bg-none whitespace-pre-line text-i text-[var(--text-color-31)]",innerHTML:b.value||i(H)("暂无日志")},null,8,M)):h("",!0),l[3]||(l[3]=r("\n    \t")),e.isHtml?h("",!0):(t(),o("code",R,c(b.value||i(H)("暂无日志")),1)),l[4]||(l[4]=r("\n\t\t"))],544),x(s(u,{type:"primary",class:"absolute",style:{top:"10px",right:"15px"},onClick:z},{default:n((()=>[r(c(i(H)("全屏展示")),1)])),_:1},512),[[w,i(j)]])],32)}}}),[["__scopeId","data-v-fa250728"]]);export{j as B};
