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