Files
senmesh-zc/deployment/iw/web/assets/file-record-xAA0hSRQ.js

1 line
10 KiB
JavaScript
Raw Normal View History

import{t as e}from"./useQuery-dxbdhNvu.js";import{t}from"./date-range-picker-CAdUnH9W.js";import{a as n,i as r,n as i,o as a,t as o}from"./select-stsOu5jD.js";import{t as s}from"./file-COj1kCUn.js";import{t as c}from"./folder-Dl7FxCLT.js";import{n as l,t as u}from"./search-BGsuWyQ1.js";import{At as d,M as f,N as p,Qt as m,V as h,Vn as g,Zt as _,_t as v,ct as y,kt as b,ln as x,n as S,qn as C,tn as w,ut as T,yn as E,zn as D}from"./index-BaTxSAlR.js";import{n as O,r as k,t as A}from"./data-table-CEq6a930.js";import{t as j}from"./pagination-Bragnnjj.js";import{a as M,n as N,o as P,r as F,s as I,t as L}from"./dialog-CnxDxMp1.js";import{t as R}from"./use-security-enabled-CyVC7otU.js";import{t as z}from"./textarea-Dyx6I5ZN.js";var B=C(g(),1);const V=()=>{let{mutateAsync:e,isPending:t}=E({mutationFn:d}),{mutateAsync:n,isPending:r}=E({mutationFn:e=>b(e)});return{reviewFileSecurityMutate:e,reviewIsPending:t,rescanMutate:n,rescanIsPending:r}};var H=C(D(),1);function U({open:e,setOpen:t,data:l,refetch:u}){let[d,f]=(0,B.useState)(`pass`),[p,h]=(0,B.useState)(``),{reviewFileSecurityMutate:g,reviewIsPending:v}=V();return(0,B.useEffect)(()=>{e&&(f(`pass`),h(``))},[e]),(0,H.jsx)(L,{open:e,onOpenChange:t,children:(0,H.jsxs)(F,{className:`w-[460px]`,children:[(0,H.jsxs)(P,{children:[(0,H.jsx)(I,{children:`安全检测复核`}),(0,H.jsxs)(`div`,{className:`mt-1 flex items-center gap-1 text-sm p-2 rounded-md bg-gray-50`,children:[(l==null?void 0:l.fileType)===y.FILE?(0,H.jsx)(s,{size:16,className:`text-primary flex-none`}):(0,H.jsx)(c,{size:16,className:`text-amber-500 flex-none`}),(0,H.jsx)(`span`,{className:`break-all`,children:l==null?void 0:l.fileName})]}),(l==null?void 0:l.securityReason)&&(0,H.jsxs)(`div`,{className:`text-xs text-black/50 break-all`,children:[`最近检测结论:`,l.securityReason]})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-sm`,children:`复核结论`}),(0,H.jsxs)(o,{value:d,onValueChange:f,children:[(0,H.jsx)(n,{className:`w-full`,children:(0,H.jsx)(a,{placeholder:`请选择复核结论`})}),(0,H.jsxs)(i,{children:[(0,H.jsx)(r,{value:`pass`,children:`通过(允许分享/传输)`}),(0,H.jsx)(r,{value:`reject`,children:`不通过(禁止分享/传输)`})]})]})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-sm`,children:`复核说明(必填)`}),(0,H.jsx)(z,{placeholder:`请填写复核说明,例如:经人工查验为误报`,value:p,onChange:e=>h(e.target.value),rows:3})]})]}),(0,H.jsxs)(M,{children:[(0,H.jsx)(N,{asChild:!0,children:(0,H.jsx)(m,{variant:`outline`,children:`取消`})}),(0,H.jsxs)(m,{type:`submit`,disabled:v,onClick:()=>{if(!p.trim()){x.error(`请填写复核说明`);return}g({fileCode:l==null?void 0:l.fileCode,decision:d,comment:p.trim()}).then(()=>{x.success(`复核结果已保存`),u==null||u(),t(!1)})},children:[v&&(0,H.jsx)(_,{}),`确定`]})]})]})})}const W=(t,...n)=>{var r,i,a;let[o,s]=(0,B.useState)({pageIndex:0,pageSize:10}),[c,l]=(0,B.useState)({}),u=e({queryKey:[`userFileRecordList`,o,c],queryFn:()=>v({...c,pageSize:o.pageSize,pageNo:o.pageIndex+1}).then(e=>e.data),enabled:!!c.phone,refetchInterval:e=>{var t;return((e==null||(t=e.state)==null||(t=t.data)==null?void 0:t.entityList)||[]).some(e=>e.securityStatus===T.SCANNING)?2e3:!1}}),d=(e={})=>{let t={};Object.entries(e||{}).forEach(([e,n])=>{n!==``&&n!=null&&(t[e]=n)}),l(t),s(e=>({...e,pageIndex:0}))},f=t(...n);return{pagination:o,table:O({data:(u==null||(r=u.data)==null?void 0:r.entityList)||[],columns:f,getCoreRowModel:k(),manualPagination:!1,rowCount:(u==null||(i=u.data)==null?void 0:i.totalCount)||0,pageCount:(u==null||(a=u.data)==null?void 0:a.pageCount)||0,onPaginationChange:s,autoResetPageIndex:!1,state:{pagination:o}}),query:u,search:d,params:c}};var G={1:{text:`上传记录`,color:`bg-blue-500/10 text-blue-500`},2:{text:`发送记录`,color:`bg-amber-500/10 text-amber-500`},3:{text:`接收记录`,color:`bg-emerald-500/10 text-emerald-500`}},K={1:{text:`重度`,color:`bg-red-500/10 text-re