import{u as t,dg as e,aA as s,gn as a,bF as n,V as r,n as i,Q as o}from"./utils-lib.js?v=1761009159";import{_ as l}from"./index105.js?v=1761009159";import{getSingleSiteRisk as p,getRisk as m}from"./site.js?v=1761009159";import{c as d,r as _,v as c,N as u,B as b,e as g,y as h,K as f,C as k}from"./base-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const j=d({__name:"detect-history",props:{compData:{default:()=>({isPopup:!1,name:""})}},setup(d){const j=d,{mainHeight:w}=t(),x=_(j.compData.isPopup);j.compData;const D=t=>{i({title:"风险详情",area:[70,55],component:()=>o(()=>import("./risk-detail.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:t})},P=e({request:async t=>{const e=x.value?p({site_name:j.compData.name,...t}):m({...t}),{data:a}=await e;return{data:a.data||[],total:a.page?s(a.page):0}},columns:[{label:"网站列表",prop:"site_name",width:120},{label:"扫描URL总数",prop:"scans",width:100},{label:"扫描耗时",prop:"time",render:t=>[t.end_time<=1||t.end_time-t.start_time<=0?g("span",null,[k("0秒")]):g("span",null,[a(t.end_time-t.start_time)])]},{label:"风险次数",prop:"risks",render:t=>[0==t.risks?g("span",null,[k("无风险")]):g("span",{class:"bt-link !text-danger",onClick:()=>D(t)},[t.risks])]},{label:"状态",prop:"status",render:t=>[0===t.is_status&&0===t.end_time||1===t.end_time?g("span",{class:"text-red"},[k("扫描未完成")]):1===t.is_status&&0===t.end_time?g("span",{class:"text-warning"},[k("扫描中")]):g("span",null,[k("扫描完成")])]},{label:"扫描时间",prop:"start_time",width:200,render:t=>{const e=n(t.start_time,"number",0);return g("span",null,[r(e)])}},{label:"操作",align:"right",render:t=>[0===t.is_status&&0===t.end_time||1===t.end_time||1===t.is_status&&0===t.end_time?g("span",{class:"text-disabled cursor-not-allowed"},[k("扫描未完成")]):g("span",{class:"bt-link",onClick:()=>(t=>{window.open("/project/content/report/html?id="+t.testing_id,"_blank","noopener,noreferrer")})(t)},[k("查看报告")])]}]}),{BtTable:y,refresh:B}=P,C=P.BtPage;return(t,e)=>{const s=l;return c(),u(s,{class:f({"p-[2rem]":h(x)})},{content:b(()=>[g(h(y),{"max-height":h(x)?500:h(w)-240,description:"检测历史列表为空"},null,8,["max-height"])]),"footer-right":b(()=>[g(h(C))]),popup:b(()=>e[0]||(e[0]=[])),_:1},8,["class"])}}});export{j as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
