1import{_ as X}from"./BJTEyGXZ.js";import{u as q}from"./DNrzG-v7.js";import{j as G,X as I,a8 as J,m as f,v as O,c as y,b as c,w as i,Q as Y,z as a,F as Z,o as v,a as s,d as C,y as M,t as m,k as r}from"./uFDkvQYg.js";import{B as tt}from"./DmQ18DKW.js";import{u as et}from"./DyyRly7j.js";import{u as K}from"./b6ViHlRN.js";import{_ as st}from"./C7D4Yxaf.js";import{_ as at}from"./DJ_Du4Gg.js";import{_ as rt}from"./DuO8yFtB.js";import{_ as ot}from"./C-w676Cb.js";import{_ as nt}from"./CEohRsgj.js";import{_ as lt}from"./BHLrQuO1.js";import"./N1XPsObs.js";import"./MAO50vTp.js";import"./Bg2q9czS.js";import"./-Z4v4f2d.js";import"./C4_87J3m.js";import"./C1M_u5oB.js";import"./BDzxcyuu.js";import"./pzaSYWqZ.js";import"./C3A78MaX.js";import"./Cn6QtGMs.js";import"./kzhFGQur.js";import"./Fu93detO.js";import"./Bd9nnZAm.js";import"./B-p6aW7q.js";import"./C5Ksf8W7.js";import"./B6ogAhZp.js";import"./vQDfeAUr.js";import"./BwFJHD2U.js";import"./Yjx57Vvz.js";import"./Bg5MxGJ9.js";import"./Cq3EPEuc.js";import"./Bk_rJcZu.js";import"./nn5TKa0w.js";import"./BhAqolrP.js";import"./CBfZ--BA.js";const it={class:"flex justify-between items-center"},dt={class:"flex gap-2"},ut={class:"relative"},ct={key:0,class:"flex h-full items-center justify-center py-8"},pt={key:1,class:"text-center py-8"},mt={key:2,class:"flex flex-col h-full overflow-auto"},xt={class:"p-4"},gt={class:"flex justify-center"},ft={key:0,class:"space-y-4"},yt={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},vt={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},_t={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},kt={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},ht={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},bt={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},wt={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},zt={key:0},Ct={class:"mt-1 text-sm text-gray-900 dark:text-gray-100"},ue=G({__name:"reports",setup(Rt){q({title:"举æ¥ç®¡ç - 管çåå°",meta:[{name:"description",content:"管çç¨æ·æäº¤çèµæºä¸¾æ¥ä¿¡æ¯"}]}),et();const b=I();K();const{resourceApi:R}=J(),k=f(!1),g=f([]),h=f(!1),n=f(null),l=f({page:1,pageSize:50,total:0}),d=f({status:"",resourceKey:""}),N=[{title:"ID",key:"id",width:30,render:e=>r("span",{class:"font-medium"},e.id)},{title:"èµæº",key:"resource_key",width:200,render:e=>{const t=A(e);return r("div",{class:"space-y-1"},[r("div",{class:"font-medium text-sm truncate max-w-[200px]",style:{maxWidth:"200px"},title:t.title},t.title),r("div",{class:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]",style:{maxWidth:"200px"},title:t.description},t.description),r("div",{class:"flex items-center gap-1"},[r("i",{class:`fas fa-${L(t.category)} text-blue-500 text-xs`,title:t.resources.length>0?`龿¥å°å: ${t.resources[0].save_url||t.resources[0].url}`:`èµæºé¾æ¥å°å: ${e.resource_key}`}),r("span",{class:"text-xs text-gray-400"},`龿¥æ°: ${t.resources.length}`)])])}},{title:"举æ¥åå ",key:"reason",width:100,render:e=>r("div",{class:"space-y-1"},[r("div",{class:"flex items-center gap-1 truncate max-w-[80px]",style:{maxWidth:"80px"}},[r("span",null,$(e.reason)),r("i",{class:"fas fa-info-circle text-blue-400 cursor-pointer text-xs ml-1",title:e.description})]),r("div",{class:"text-xs text-gray-400 truncate max-w-[80px]",style:{maxWidth:"80px"}},`ä¸¾æ¥æ¶é´: ${j(e.created_at)}`),r("div",{class:"text-xs text-gray-500 dark:text-gray-400 truncate max-w-[80px]",style:{maxWidth:"80px"}},`èç³»æ¹å¼: ${e.contact||"æªæä¾"}`)])},{title:"ç¶æ",key:"status",width:50,render:e=>{const t=W(e.status);return r("n-tag",{type:t,size:"small",bordered:!1},{default:()=>P(e.status)})}},{title:"æä½",key:"actions",width:180,render:e=>{const t=[r("button",{class:"px-2 py-1 text-xs bg-blue-100 hover:bg-blue-200 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400 rounded transition-colors mr-1",onClick:()=>U(e)},[r("i",{class:"fas fa-eye mr-1 text-xs"}),"æ¥ç"])];return e.status==="pending"&&t.push(r("button",{class:"px-2 py-1 text-xs bg-green-100 hover:bg-green-200 text-green-700 dark:bg-green-900/20 dark:text-green-400 rounded transition-colors mr-1",onClick:()=>
1S(e,"approved")},[r("i",{class:"fas fa-check mr-1 text-xs"}),"æ¹å"]),r("button",{class:"px-2 py-1 text-xs bg-red-100 hover:bg-red-200 text-red-700 dark:bg-red-900/20 dark:text-red-400 rounded transition-colors",onClick:()=>S(e,"rejected")},[r("i",{class:"fas fa-times mr-1 text-xs"}),"æç»"])),r("div",{class:"flex items-center gap-1"},t)}}];let w=null;const T=()=>{w&&clearTimeout(w),w=setTimeout(()=>{l.value.page=1,x()},300)},x=async()=>{k.value=!0;try{const e={page:l.value.page,page_size:l.value.pageSize};d.value.status&&(e.status=d.value.status),d.value.resourceKey&&(e.resource_key=d.value.resourceKey);const t=await R.getReportsRaw(e);console.log(t),t&&t.data&&t.data.list!==void 0?(g.value=t.data.list||[],l.value.total=t.data.total||0):(g.value=t||[],l.value.total=t.length||0)}catch(e){console.error("è·å举æ¥å表失败:",e),b.error({content:"è·å举æ¥å表失败",duration:3e3})}finally{k.value=!1}},D=()=>{d.value={status:"",resourceKey:""},l.value.page=1,x()},B=e=>{l.value.pageSize=e,l.value.page=1,x()},U=e=>{n.value=e,h.value=!0},S=async(e,t)=>{try{let o="";if(t==="rejected"&&(o=await V(),o===null))return;const p=await R.updateReport(e.id,{status:t,note:o}),_=g.value.findIndex(z=>z.id===e.id);_!==-1&&(g.value[_]=p),n.value&&n.value.id===e.id&&(n.value=p),b.success({content:"ç¶ææ´æ°æå",duration:3e3})}catch(o){console.error("æ´æ°ä¸¾æ¥ç¶æå¤±è´¥:",o),b.error({content:"ç¶ææ´æ°å¤±è´¥",duration:3e3})}},V=()=>new Promise(e=>{const{dialog:t}=K();let o="";t.warning({title:"è¾å
¥æç»åå ",content:()=>r(nInput,{value:o,onUpdateValue:p=>o=p,placeholder:"请è¾å
¥æç»çåå ...",type:"textarea",rows:4}),positiveText:"ç¡®å®",negativeText:"åæ¶",onPositiveClick:()=>{if(!o.trim()){const{message:p}=I();return p.warning("请è¾å
¥æç»åå "),!1}e(o)},onNegativeClick:()=>{e(null)}})}),W=e=>{switch(e){case"pending":return"warning";case"approved":return"success";case"rejected":return"error";default:return"default"}},P=e=>{switch(e){case"pending":return"å¾
å¤ç";case"approved":return"å·²æ¹å";case"rejected":return"å·²æç»";default:return e}},$=e=>({link_invalid:"龿¥å·²å¤±æ",download_failed:"èµæºæ æ³ä¸è½½",content_mismatch:"èµæºå
容ä¸ç¬¦",malicious:"å
嫿¶æè½¯ä»¶",copyright:"çæé®é¢",other:"å
¶ä»é®é¢"})[e]||e,j=e=>e?new Date(e).toLocaleString("zh-CN"):"-",L=e=>e&&{ææ¡£:"file-alt",ææ¡£èµæ:"file-alt",å缩å
:"file-archive",å¾ç:"images",è§é¢:"film",é³ä¹:"music",çµå书:"book",软件:"cogs",åºç¨:"mobile-alt",游æ:"gamepad",èµæ:"folder",å
¶ä»:"file",folder:"folder",file:"file"}[e]||"folder",A=e=>{const t=e.resources||[];if(t.length>0){const o=t[0];return{title:o.title||`èµæº: ${e.resource_key}`,description:o.description||`èµæºè¯¦æ
: ${e.resource_key}`,category:o.category||"folder",resources:t}}else return{title:`èµæº: ${e.resource_key}`,description:`èµæºè¯¦æ
: ${e.resource_key}`,category:"folder",resources:[]}};return O(()=>{x()}),(e,t)=>{const o=nt,p=lt,_=tt,z=rt,F=ot,E=at,H=X,Q=st;return v(),y(Z,null,[c(H,null,{"page-header":i(()=>t[5]||(t[5]=[s("div",null,[s("h1",{class:"text-2xl font-bold text-gray-900 dark:text-white flex items-center"},[s("i",{class:"fas fa-flag text-red-500 mr-2"}),C(" 举æ¥ç®¡ç ")]),s("p",{class:"text-gray-600 dark:text-gray-400"},"管çç¨æ·æäº¤çèµæºä¸¾æ¥ä¿¡æ¯")],-1)])),"filter-bar":i(()=>[s("div",it,[t[11]||(t[11]=s("div",{class:"flex gap-2"},null,-1)),s("div",dt,[s("div",ut,[c(o,{value:a(d).resourceKey,"onUpdate:value":t[0]||(t[0]=u=>a(d).resourceKey=u),onInput:T,type:"text",placeholder:"æç´¢èµæºKey...",clearable:""},{prefix:i(()=>t[6]||(t[6]=[s("i",{class:"fas fa-search text-gray-400 text-sm"},null,-1)])),_:1},8,["value"])]),c(p,{value:a(d).status,"onUpdate:value":[t[1]||(t[1]=u=>a(d).status=u),x],options:[{label:"å
¨é¨ç¶æ",value:""},{label:"å¾
å¤ç",value:"pending"},{label:"å·²æ¹å",value:"approved"},{label:"å·²æç»",value:"rejected"}],placeholder:"ç¶æ",clearable:"",style:{width:"150px"}},null,8,["value"]),c(_,{onClick:D,type:"tertiary"},{icon:i(()=>t[7]||(t[7]=[s("i",{class:"fas fa-redo"},null,-1)])),default:i(()=>[t[8]||(t[8]=C(" éç½® ",-1))]),_:1,__:[8]}),c(_,{onClick:x,type:"tertiary"},{icon:i(()=>t[9]||(t[9]=[s("i",{class:"fas fa-refresh"},null,-1)])),default:i(()=>[t[10]||(t[10]=C(" å·æ° ",-1))]),_:1,__:[10]})])])]),content:i(()=>[a(k)?(v(),y("div",ct,[c(z,{size:"large"})])):a(g).length===0?(v(),y("div",pt,t[12]||(t[12]=[s("svg",{class:"w-16 h-16 text-gray-300 dark:text-gray-600 mb-4 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 48 48"},[s("circle",{cx:"24",cy:"24",r:"20","stroke-width":"3","stroke-dasharray":"6 6"}),s("path",{d:"M16 24h16M24 16v16","stroke-width":"3","stroke-linecap":"round"})],-1),s("div",{class:"text-lg font-semibold text-gray-400 dark:text-gray-500 mb-2"},"ææ ä¸¾æ¥è®°å½",-1),s("div",{class:"text-sm text-gray-400 dark:text-gray-600 mb-4"},"ç®å没æç¨æ·æäº¤ç举æ¥ä¿¡æ¯",-1)]))):(v(),y("div",mt,[c(F,{columns:N,data:a(g),pagination:!1,bordered:!1,"single-line":!1,loading:a(k),"scroll-x":1200,class:"h-full"},null,8,["data","loading"])]))]),"content-footer":i(()=>[s("div",xt,[s("div",gt,[c(E,{page:a(l).page,"onUpdate:page":[t[2]||(t[2]=u=>a(l).page=u),x],"page-size":a(l).pageSize,"onUpdate:pageSize":[t[3]||(t[3]=u=>a(l).pageSize=u),B],"item-count":a(l).total,"page-sizes":[50,100,200,500],"show-size-picker":""},null,8,["page","page-size","item-count"])])])]),_:1}),c(Q,{show:a(h),"onUpdate:show":t[4]||(t[4]=u=>
1Y(h)?h.value=u:null),"mask-closable":!1,preset:"card",style:{maxWidth:"600px",width:"90%"},title:"举æ¥è¯¦æ
"},{default:i(()=>[a(n)?(v(),y("div",ft,[s("div",null,[t[13]||(t[13]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"举æ¥ID",-1)),s("p",yt,m(a(n).id),1)]),s("div",null,[t[14]||(t[14]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"èµæºKey",-1)),s("p",vt,m(a(n).resource_key),1)]),s("div",null,[t[15]||(t[15]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"举æ¥åå ",-1)),s("p",_t,m($(a(n).reason)),1)]),s("div",null,[t[16]||(t[16]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"è¯¦ç»æè¿°",-1)),s("p",kt,m(a(n).description),1)]),s("div",null,[t[17]||(t[17]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"èç³»æ¹å¼",-1)),s("p",ht,m(a(n).contact||"æªæä¾"),1)]),s("div",null,[t[18]||(t[18]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"æäº¤æ¶é´",-1)),s("p",bt,m(j(a(n).created_at)),1)]),s("div",null,[t[19]||(t[19]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"IPå°å",-1)),s("p",wt,m(a(n).ip_address||"æªç¥"),1)]),a(n).note?(v(),y("div",zt,[t[20]||(t[20]=s("h3",{class:"text-sm font-medium text-gray-500 dark:text-gray-400"},"å¤ç夿³¨",-1)),s("p",Ct,m(a(n).note),1)])):M("",!0)])):M("",!0)]),_:1},8,["show"])],64)}}});export{ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.