hunter-mate 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/manifest.json +3 -3
- package/dist/assets/server/main.mjs +57 -4
- package/dist/index.js +1 -1
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/chunks/502-4776504e89a09b68.js +32 -0
- package/dist/web/dist/_next/static/chunks/587-a93e5177e3d3ccaf.js +1 -0
- package/dist/web/dist/_next/static/chunks/606-9bac5cf9187e9901.js +1 -0
- package/dist/web/dist/_next/static/chunks/659-bf056de14f6162b6.js +1 -0
- package/dist/web/dist/_next/static/chunks/706-babd57b15a93f415.js +12 -0
- package/dist/web/dist/_next/static/chunks/865-422919f47ebce4d3.js +1 -0
- package/dist/web/dist/_next/static/chunks/882-5952b675dc02794a.js +1 -0
- package/dist/web/dist/_next/static/chunks/{935-0ec6bca7ef6e2dfc.js → 935-79d8aba674c09f7b.js} +2 -2
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-31aa598c712a211d.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/jobs/page-0a0ee2f8b389a147.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/layout-56e9f652ec460661.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/memory/page-9b20447ec495bc36.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/parselog/page-a9321ca64f1272d1.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/recordings/page-959163edef1ef99e.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/resource-usage/page-f32cf255cec94d08.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/{page-7189e27de66ecb09.js → page-7666e080dadae190.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/talents/{page-426470ca404838cb.js → page-42a62dae374c5354.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/team/insights/page-4ec3304e214e7c20.js +1 -0
- package/dist/web/dist/_next/static/chunks/{main-8b470f167e9bfe73.js → main-69905dba7a812e36.js} +1 -1
- package/dist/web/dist/_next/static/chunks/{main-app-ee5c87be3671889b.js → main-app-e02edafef1318e75.js} +1 -1
- package/dist/web/dist/_next/static/chunks/pages/{_app-20aa9e4f679a6d47.js → _app-6b02259ee4822d36.js} +3 -3
- package/dist/web/dist/_next/static/css/03e3fa723e374884.css +3 -0
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +3 -3
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +2 -2
- package/dist/web/dist/companies.html +1 -1
- package/dist/web/dist/companies.txt +2 -2
- package/dist/web/dist/company/admin.html +1 -1
- package/dist/web/dist/company/admin.txt +2 -2
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +2 -2
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +2 -2
- package/dist/web/dist/jobs.html +1 -1
- package/dist/web/dist/jobs.txt +3 -3
- package/dist/web/dist/login.html +2 -2
- package/dist/web/dist/login.txt +2 -2
- package/dist/web/dist/logs.html +1 -1
- package/dist/web/dist/logs.txt +2 -2
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +2 -2
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +2 -2
- package/dist/web/dist/memory.html +1 -0
- package/dist/web/dist/memory.txt +7 -0
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +3 -3
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +3 -3
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +3 -3
- package/dist/web/dist/shared/placeholder.html +1 -1
- package/dist/web/dist/shared/placeholder.txt +3 -3
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +2 -2
- package/dist/web/dist/talents.html +1 -1
- package/dist/web/dist/talents.txt +3 -3
- package/dist/web/dist/team/insights.html +1 -1
- package/dist/web/dist/team/insights.txt +3 -3
- package/package.json +1 -1
- package/dist/web/dist/_next/static/chunks/187-48dc1acca97c62ba.js +0 -1
- package/dist/web/dist/_next/static/chunks/353-845111f2789c5a03.js +0 -12
- package/dist/web/dist/_next/static/chunks/587-a1defe5c7e3e1e1b.js +0 -1
- package/dist/web/dist/_next/static/chunks/603-0878bd28159f4fe7.js +0 -32
- package/dist/web/dist/_next/static/chunks/659-85c4e54826b8bd18.js +0 -1
- package/dist/web/dist/_next/static/chunks/865-8e1d8c34192526ed.js +0 -1
- package/dist/web/dist/_next/static/chunks/882-1bcdfd2499403efd.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-efbbb1ea584df5a4.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-af06cb0c0686ebdd.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/layout-e93c294bf845144d.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/parselog/page-d11c8ce5545a86af.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/recordings/page-4a11e105b956cd72.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/resource-usage/page-9591bf89800bebb6.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/team/insights/page-db663ad28356ff73.js +0 -1
- package/dist/web/dist/_next/static/css/ad396c8df7280fac.css +0 -3
- /package/dist/assets/extension/background/{service-worker.20261027190827.js → service-worker.20261028162720.js} +0 -0
- /package/dist/web/dist/_next/static/{Xbbm3V5e7MiF1bug4CUOt → Rmj7zlgoj2IjJB_RWslV8}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{Xbbm3V5e7MiF1bug4CUOt → Rmj7zlgoj2IjJB_RWslV8}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="036d6036-7733-4363-ac88-fc8f1e376da3",e._sentryDebugIdIdentifier="sentry-dbid-036d6036-7733-4363-ac88-fc8f1e376da3")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[659],{59659:function(e,t,l){l.d(t,{EntityListPage:function(){return _}});var r=l(72835),a=l(60635),s=l(27473),n=l(74431),i=l(33447),d=l(37202),o=l(94518),c=l(63718),u=l(19036),x=l(78606),m=l(8448),h=l(86777);let b=["workExperiences","projects","education"],p={intent:["position","salary","city","industries"]},g={name:"姓名",headline:"头衔",currentPosition:"现职位",currentCompany:"现公司",city:"城市",degree:"学历",workYears:"工作年限",age:"年龄",gender:"性别",resId:"resId",statusTag:"状态标签",contactTime:"方便联系时间",phone:"电话",email:"邮箱",profileUrl:"主页 URL",sourceUrl:"来源 URL",selfEvaluation:"自我评价",statement:"平台声明","intent.position":"期望职位","intent.salary":"期望薪资","intent.city":"期望城市","intent.industries":"期望行业",updatedAt:"更新时间"},y={workExperiences:"工作经历",projects:"项目经历",education:"教育经历"},f={company:"公司",position:"职位",period:"时间段",start:"开始",end:"结束",department:"部门",location:"地点",reportsTo:"汇报对象",school:"学校",major:"专业",degree:"学历",name:"名称",role:"角色",description:"描述",duties:"职责",industry:"行业"};function v(e){return null==e||""===e?"—":Array.isArray(e)?e.length?e.map(e=>v(e)).filter(e=>"—"!==e).join("、"):"—":"object"==typeof e?JSON.stringify(e):"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T/.test(e)?(0,m.d3)(e):String(e)}function j(e){var t;let{entity:l}=e,i=(0,s.useRouter)(),d=l.id,[o,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)({}),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)(new Set),[C,U]=(0,a.useState)({}),[q,I]=(0,a.useState)({}),[E,T]=(0,a.useState)(!1),[A,O]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=!0;return c(null),O(""),(async()=>{try{let t=await (0,n.requestJson)("/entities/talent/".concat(d,"/duplicates"));e&&c(t.candidates)}catch(t){e&&c([])}})(),()=>{e=!1}},[d]);let _=(0,a.useMemo)(()=>{var e;return null!==(e=l.extracted)&&void 0!==e?e:{}},[l.extracted]),J=async e=>{if(h[e])return h[e];try{let t=await (0,n.requestJson)("/entities/talent/".concat(e));if(!t.entity)return null;return j(l=>({...l,[e]:t.entity})),t.entity}catch(e){return null}},P=async()=>{var e,t,l,r,a,s,n;T(!0),O("");let i=[d,...(null!=o?o:[]).map(e=>e.talent.id)],c=await Promise.all(i.map(e=>J(e)));if(T(!1),c.some(e=>!e)){O("全量简历拉取失败,请重试");return}let u=c[0],m=null!==(t=u.extracted)&&void 0!==t?t:{},h={name:u.name,headline:u.headline},g={};for(let e of Object.keys(m))if(b.includes(e))g[e]=Array.isArray(m[e])?[...m[e]]:[];else if(p[e]){let t=null!==(r=m[e])&&void 0!==r?r:{};for(let l of p[e])h["".concat(e,".").concat(l)]=null!==(a=t[l])&&void 0!==a?a:"industries"===l?[]:""}else(null==(n=m[e])||["string","number","boolean"].includes(typeof n))&&!e.startsWith("_")&&(h[e]=null!==(l=m[e])&&void 0!==l?l:"");U(h),I(g),w(null!==(s=null==o?void 0:null===(e=o[0])||void 0===e?void 0:e.talent.id)&&void 0!==s?s:null),x(!0)},L=e=>{var t;let r=[],a=t=>{var l,r,a,s;if(t){if("name"===e)return t.name;if("headline"===e)return t.headline;if(e.startsWith("intent.")){let l=e.slice(7),s=null===(a=t.extracted)||void 0===a?void 0:null===(r=a.intent)||void 0===r?void 0:r[l];return"industries"===l?Array.isArray(s)?s:[]:null!=s?s:""}return null!==(s=null===(l=t.extracted)||void 0===l?void 0:l[e])&&void 0!==s?s:""}},s=a(null!==(t=h[d])&&void 0!==t?t:l);for(let e of(r.push({id:0,label:"当前",value:s}),null!=o?o:[])){let t=h[e.talent.id];if(!t)continue;let l=a(t);void 0!==l&&"—"!==v(l)&&r.push({id:e.talent.id,label:"#".concat(e.talent.id),value:l})}return r},R=(e,t)=>U(l=>({...l,[e]:t})),M=async e=>{T(!0);try{await (0,n.requestJson)("/entities/talent/".concat(d,"/duplicates/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otherId:e})}),c(t=>(null!=t?t:[]).filter(t=>t.talent.id!==e)),N===e&&w(null)}catch(e){O("标注失败,请重试")}finally{T(!1)}},z=async()=>{var e,t,l,r;let a={..._};for(let[t,l]of Object.entries(C))if("name"!==t&&"headline"!==t){if(t.startsWith("intent.")){let r=t.slice(7);a.intent={...null!==(e=a.intent)&&void 0!==e?e:{},[r]:l}}else a[t]="number"!=typeof(r=_[t])||"string"!=typeof l||""===l.trim()||Number.isNaN(Number(l))?"boolean"==typeof r&&"string"==typeof l?"true"===l:l:Number(l)}for(let e of b)q[e]&&(a[e]=q[e]);let s=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===s.length){O("未勾选任何候选参与合并");return}T(!0);let c=!1;for(let e of s)try{await (0,n.requestJson)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:e,extracted:a,name:null!==(t=C.name)&&void 0!==t?t:null,headline:null!==(l=C.headline)&&void 0!==l?l:null})})}catch(e){c=!0;break}if(T(!1),c){O("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()},W=async()=>{let e=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===e.length){O("未勾选任何候选参与合并");return}T(!0);let t=!0;for(let l of e)try{await (0,n.requestJson)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:l})})}catch(e){t=!1;break}if(T(!1),!t){O("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let F=null!==(t=o.find(e=>e.talent.id===N))&&void 0!==t?t:null,D=null!=N?h[N]:null,Y=e=>(0,r.jsx)("span",{className:"flex flex-wrap items-center gap-1",children:L(e).map(t=>(0,r.jsx)("button",{type:"button",title:"采纳:".concat(v(t.value)),onClick:()=>R(e,t.value),className:"rounded border border-gray-200 px-1.5 py-0.5 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:t.label},t.id))});return(0,r.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的人才记录"]}),(0,r.jsx)("button",{onClick:()=>void P(),disabled:E,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),(0,r.jsx)("button",{onClick:()=>void M(o[0].talent.id),disabled:E,className:"rounded border border-amber-400 px-3 py-1 text-sm text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:"与最高分条目非重复"}),A?(0,r.jsx)("span",{className:"text-sm text-red-600",children:A}):null]}),u?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>x(!1),children:(0,r.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-6xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复简历合并工作区"}),(0,r.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",d,l.name?" \xb7 ".concat(l.name):""," — ",o.length," 条候选"]}),(0,r.jsx)("button",{onClick:()=>x(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,r.jsxs)("div",{className:"grid flex-1 gap-0 overflow-hidden md:grid-cols-[250px,1fr]",children:[(0,r.jsxs)("div",{className:"overflow-y-auto border-b border-gray-200 p-3 md:border-b-0 md:border-r",children:[(0,r.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选简历(逐条处理)"}),(0,r.jsx)("div",{className:"space-y-2",children:o.map(e=>{var t;return(0,r.jsxs)("div",{className:"rounded-lg border p-2 ".concat(N===e.talent.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:!k.has(e.talent.id),disabled:E,onChange:t=>{S(l=>{let r=new Set(l);return t.target.checked?r.delete(e.talent.id):r.add(e.talent.id),r})},title:"勾选=同一人,参与本次合并"}),(0,r.jsx)("span",{className:"text-sm font-medium text-gray-900",children:null!==(t=e.talent.name)&&void 0!==t?t:"(未命名)"}),(0,r.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:["相似度 ",e.score]})]}),(0,r.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",title:e.talent.sourceUrl,children:[e.talent.source," \xb7 ",(0,m.d3)(e.talent.updatedAt)]}),(0,r.jsxs)("div",{className:"mt-1.5 flex gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>w(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50",children:"选中对比"}),(0,r.jsx)("button",{type:"button",disabled:E,onClick:()=>void M(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"非同一人"})]})]},e.talent.id)})})]}),(0,r.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"最终采用简历(可编辑)"}),(0,r.jsx)("button",{type:"button",onClick:()=>{P()},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"重置为当前简历"})]}),(0,r.jsx)("div",{className:"divide-y divide-gray-100",children:Object.keys(C).map(e=>{var t,a;return(0,r.jsxs)("div",{className:"grid grid-cols-[90px,1fr,auto] items-center gap-2 px-3 py-1.5",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500",children:null!==(t=g[e])&&void 0!==t?t:e}),"sourceUrl"===e?(0,r.jsx)("a",{href:String(null!==(a=C[e])&&void 0!==a?a:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"truncate text-sm text-blue-600 hover:underline",children:"—"===v(C[e])?l.sourceUrl:v(C[e])}):"selfEvaluation"===e||"statement"===e?(0,r.jsx)("textarea",{value:"—"===v(C[e])?"":String(C[e]),onChange:t=>R(e,t.target.value),rows:2,className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}):(0,r.jsx)("input",{value:"—"===v(C[e])?"":String(C[e]),onChange:t=>R(e,t.target.value),className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}),Y(e)]},e)})})]}),b.map(e=>{var t,l,a;let s=null!==(t=q[e])&&void 0!==t?t:[],n=[];for(let t of null!=o?o:[]){let r=h[t.talent.id],a=null==r?void 0:null===(l=r.extracted)||void 0===l?void 0:l[e];Array.isArray(a)&&a.forEach(e=>n.push({id:t.talent.id,item:e}))}return(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,r.jsx)("div",{className:"flex items-center justify-between border-b border-gray-100 px-3 py-2",children:(0,r.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:[null!==(a=y[e])&&void 0!==a?a:e,"(",s.length,")"]})}),0===s.length&&0===n.length?(0,r.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:"两侧均无数据"}):(0,r.jsxs)("div",{className:"space-y-2 p-3",children:[s.map((t,l)=>(0,r.jsxs)("div",{className:"rounded border border-gray-200 p-2",children:[(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:Object.keys(null!=t?t:{}).filter(e=>!e.startsWith("_")).map(a=>{var n;return(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:null!==(n=f[a])&&void 0!==n?n:a}),"string"==typeof t[a]&&t[a].length>40?(0,r.jsx)("textarea",{value:t[a],rows:2,onChange:t=>{let r=[...s];r[l]={...r[l],[a]:t.target.value},I(t=>({...t,[e]:r}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}):(0,r.jsx)("input",{value:"—"===v(t[a])?"":String(t[a]),onChange:t=>{let r=[...s];r[l]={...r[l],[a]:t.target.value},I(t=>({...t,[e]:r}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"})]},a)})}),(0,r.jsx)("div",{className:"mt-1.5 flex items-center gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>I(t=>({...t,[e]:s.filter((e,t)=>t!==l)})),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删除此条"})})]},l)),n.length?(0,r.jsxs)("div",{className:"rounded border border-dashed border-gray-300 p-2",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"候选条目(选择合入或更新)"}),(0,r.jsx)("div",{className:"space-y-1.5",children:n.map((t,l)=>{var a,n,i,d,o,c,u,x,m;let h=s.findIndex(e=>(function(e,t){let l=e=>{var t,l,r;return String(null!==(r=null!==(l=null!==(t=null==e?void 0:e.company)&&void 0!==t?t:null==e?void 0:e.school)&&void 0!==l?l:null==e?void 0:e.name)&&void 0!==r?r:"")},r=e=>{var t,l,r;return String(null!==(r=null==e?void 0:e.period)&&void 0!==r?r:"".concat(null!==(t=null==e?void 0:e.start)&&void 0!==t?t:"","-").concat(null!==(l=null==e?void 0:e.end)&&void 0!==l?l:""))},a=l(e),s=l(t),n=r(e),i=r(t);return!!a&&!!s&&a===s||!!n&&!!i&&n===i&&(!a||!s||a===s)})(e,t.item));return(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,r.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-gray-500",children:["#",t.id]}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate text-gray-700",children:[v(null!==(i=null!==(n=null!==(a=t.item.company)&&void 0!==a?a:t.item.school)&&void 0!==n?n:t.item.name)&&void 0!==i?i:"")," \xb7 ",v(null!==(c=null!==(o=null!==(d=t.item.position)&&void 0!==d?d:t.item.major)&&void 0!==o?o:t.item.role)&&void 0!==c?c:"")," \xb7 ",v(null!==(m=t.item.period)&&void 0!==m?m:"".concat(null!==(u=t.item.start)&&void 0!==u?u:"","-").concat(null!==(x=t.item.end)&&void 0!==x?x:""))]}),h>=0?(0,r.jsxs)("button",{type:"button",onClick:()=>{let l=[...s];l[h]={...t.item},I(t=>({...t,[e]:l}))},className:"shrink-0 rounded border border-blue-300 px-2 py-0.5 text-blue-600 hover:bg-blue-50",children:["更新条目",h+1]}):(0,r.jsx)("button",{type:"button",onClick:()=>I(l=>({...l,[e]:[...s,{...t.item}]})),className:"shrink-0 rounded border border-green-300 px-2 py-0.5 text-green-700 hover:bg-green-50",children:"合入"})]},l)})})]}):null]})]},e)}),F&&D?(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,r.jsx)("div",{className:"border-b border-gray-100 px-3 py-2",children:(0,r.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:["与候选 #",F.talent.id," 对比",F.reasons.length?(0,r.jsx)("span",{className:"ml-2 space-x-1",children:F.reasons.map(e=>(0,r.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs font-normal text-gray-600",children:e},e))}):null]})}),(0,r.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-500",children:[(0,r.jsx)("th",{className:"py-1.5 pl-3 pr-2 font-medium",children:"字段"}),(0,r.jsxs)("th",{className:"py-1.5 pr-2 font-medium",children:["当前 #",d]}),(0,r.jsxs)("th",{className:"py-1.5 pr-3 font-medium",children:["候选 #",F.talent.id]})]})}),(0,r.jsx)("tbody",{children:Object.keys(C).map(e=>{var t,a,s,n;let i=v(null===(t=L(e)[0])||void 0===t?void 0:t.value),d=v((()=>{var t,l,r,a;let s=h[F.talent.id];if(s){if("name"===e)return s.name;if("headline"===e)return s.headline;if(e.startsWith("intent.")){let t=e.slice(7),a=null===(r=s.extracted)||void 0===r?void 0:null===(l=r.intent)||void 0===l?void 0:l[t];return"industries"===t?Array.isArray(a)?a:[]:null!=a?a:""}return null!==(a=null===(t=s.extracted)||void 0===t?void 0:t[e])&&void 0!==a?a:""}})()),o=i!==d&&"—"!==i&&"—"!==d;return(0,r.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,r.jsx)("td",{className:"py-1 pl-3 pr-2 text-xs text-gray-500",children:null!==(s=g[e])&&void 0!==s?s:e}),(0,r.jsx)("td",{className:"py-1 pr-2 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,r.jsx)("a",{href:String(null!==(n=null===(a=L(e)[0])||void 0===a?void 0:a.value)&&void 0!==n?n:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:i}):(0,r.jsx)("span",{className:"break-all",children:i})}),(0,r.jsx)("td",{className:"py-1 pr-3 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,r.jsx)("a",{href:String((()=>{var e;let t=h[F.talent.id];return null!==(e=null==t?void 0:t.sourceUrl)&&void 0!==e?e:""})()),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:d}):(0,r.jsx)("span",{className:"break-all",children:d})})]},e)})})]})]}):null]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void z(),disabled:E,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:"提交合并(采用上方编辑值)"}),(0,r.jsx)("button",{type:"button",onClick:()=>void W(),disabled:E,title:"传统语义:保留字段更全的一侧,另一侧补空合并",className:"rounded border border-gray-300 px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"快捷:整行补空合并"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"被合并的候选会进入回收站(可恢复)"}),A?(0,r.jsx)("span",{className:"text-sm text-red-600",children:A}):null]})]})]})]})}):null]})}var N=l(12789),w=l(65777);function k(e){var t,l;let{entityId:s,name:i}=e,[d,o]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[m,h]=(0,a.useState)([]),[b,p]=(0,a.useState)(""),[g,y]=(0,a.useState)("pending_invite"),[f,v]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),{sync:C}=(0,w.nu)(),U=null!==(t=null==C?void 0:C.activeTenantId)&&void 0!==t?t:null;(0,a.useEffect)(()=>{d&&((async()=>{try{u(await (0,n.requestJson)("/recommendations/meta"))}catch(e){}})(),(async()=>{try{let e=await (0,n.requestJson)("/job-cases?limit=200");h(e.items)}catch(e){}})())},[d,U]);let q=async()=>{if(""!==b){v(!0),S(null);try{await (0,n.requestJson)("/recommendations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobCaseId:b,entityId:s,stage:g})}),N({jobCaseId:Number(b)})}catch(e){S("写入失败(服务未启动或无权限)")}finally{v(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{o(!0),N(null),S(null)},className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"加入推荐流程"}),d?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",children:(0,r.jsx)("div",{className:"w-96 rounded-lg bg-white p-4 shadow-xl",children:j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"mb-3 text-sm text-gray-800",children:["已把 ",(0,r.jsx)("span",{className:"font-medium",children:i})," 加入推荐流程。"]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"关闭"}),(0,r.jsx)("a",{href:"/jobs?id=".concat(j.jobCaseId),className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700",children:"去职位推荐流程 →"})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:["把 ",i," 加入推荐流程"]}),(0,r.jsxs)("label",{className:"mb-2 block text-xs text-gray-500",children:["目标职位",(0,r.jsx)(x.Z,{allowClear:!0,placeholder:"选择职位…",className:"mt-1",style:{width:"100%"},value:""===b?void 0:b,onChange:e=>p(null!=e?e:""),options:m.map(e=>({value:e.id,label:e.title||e.externalId}))})]}),(0,r.jsxs)("label",{className:"mb-3 block text-xs text-gray-500",children:["推荐阶段(默认待邀请)",(0,r.jsx)(x.Z,{placeholder:"推荐阶段(默认待邀请)",className:"mt-1",style:{width:"100%"},value:g,onChange:e=>y(e),options:(null!==(l=null==c?void 0:c.stages)&&void 0!==l?l:[{key:"pending_invite",label:"待邀请"}]).map(e=>({value:e.key,label:e.label}))})]}),k?(0,r.jsx)("p",{className:"mb-2 text-xs text-red-600",children:k}):null,(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)("button",{onClick:()=>o(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"取消"}),(0,r.jsx)("button",{onClick:()=>void q(),disabled:""===b||f,className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:f?"写入中…":"确认加入"})]})]})})}):null]})}var S=l(32587);let C={talent:"人才",job:"职位",company:"公司"},U={talent:"bg-blue-50 text-blue-700",job:"bg-yellow-50 text-yellow-700",company:"bg-green-50 text-green-700"};function q(e){var t,l,s,d,o,c;let{type:u,entity:b,sources:p}=e,[g,y]=(0,a.useState)(p.length?String(p[0].id):""),[f,v]=(0,a.useState)(!1),[w,q]=(0,a.useState)(null),[I,E]=(0,a.useState)(null),[T,A]=(0,a.useState)(null);async function O(){q(null);try{let e=await fetch("".concat((0,n.Ox)(),"/entities/").concat(u,"/").concat(b.id,"/repair-prompt"));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),v(!0),setTimeout(()=>v(!1),4e3)}catch(e){q(e.message)}}(0,a.useEffect)(()=>{if("talent"!==u)return;let e=!0;return(async()=>{try{var t,l;let r=await fetch("".concat((0,n.Ox)(),"/entities/talent/").concat(b.id,"/matches"));if(!r.ok)return;let a=await r.json();if(!e)return;E(null!==(t=null==a?void 0:a.portraitId)&&void 0!==t?t:null),A(null!==(l=null==a?void 0:a.matches)&&void 0!==l?l:[])}catch(e){}})(),()=>{e=!1}},[u,b.id]);let _="talent"===u?null!==(t=b.name)&&void 0!==t?t:"(未命名)":"job"===u?null!==(l=b.title)&&void 0!==l?l:"(未命名职位)":null!==(s=b.name)&&void 0!==s?s:"(未命名)",J="talent"===u?b.headline:"job"===u?b.company:"",P=p.find(e=>String(e.id)===g)||p[0];return(0,r.jsxs)("div",{className:"w-full",children:["talent"===u?(0,i.K5)()?(0,r.jsx)(N.X,{feature:"人才查重合并",localPath:"/entity/talent/".concat(b.id)}):(0,r.jsx)(j,{entity:b}):null,(0,r.jsxs)("header",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:_}),(0,r.jsx)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(d=U[u])&&void 0!==d?d:"bg-gray-100 text-gray-600"),children:null!==(o=C[u])&&void 0!==o?o:u}),(0,r.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:b.source}),b.sourceUrl?(0,r.jsx)("a",{href:b.sourceUrl,target:"_blank",rel:"noreferrer",title:b.sourceUrl,className:"max-w-xl truncate text-sm text-blue-600 hover:underline",children:b.sourceUrl}):null]}),J?(0,r.jsx)("p",{className:"mt-1 text-gray-600",children:J}):null,b.sessionId?(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:O,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700",children:f?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"按录制重解析、修解析 bug、提 issue"}),w?(0,r.jsx)("span",{className:"text-xs text-red-600",children:w}):null]}):null,"talent"===u?(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,r.jsx)(k,{entityId:b.id,name:_}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"加入某职位推荐流水线,默认待邀请"})]}):null]}),"talent"===u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.n,{entity:b}),(0,r.jsx)(S.z,{entity:b,portraitId:I,matches:T,sources:p.map(e=>({id:e.id,sourceUrl:e.sourceUrl,domain:e.domain,createdAt:e.createdAt}))})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),P?(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm text-gray-500",children:"当前来源页面"}),(0,r.jsx)("a",{href:P.sourceUrl,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:P.sourceUrl}),P.hasSnapshot?(0,r.jsx)("span",{className:"ml-2 rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有录制快照"}):null]}),p.length>1?(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)("label",{className:"text-sm text-gray-600",children:"历史来源:"}),(0,r.jsx)(x.Z,{size:"small",style:{minWidth:220},value:g,onChange:e=>y(e),options:p.map(e=>({value:String(e.id),label:"".concat(e.domain," \xb7 ").concat((0,m.d3)(e.createdAt))}))}),(0,r.jsx)("a",{href:P.sourceUrl,target:"_blank",rel:"noreferrer",className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"打开该来源页面"})]}):null]}):(0,r.jsx)("div",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]}),(0,r.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"原始数据"}),(0,r.jsx)(h.Y,{data:null!==(c=b.extracted)&&void 0!==c?c:b.raw})]})]})]})}var I=l(27828),E=l(26119),T=l(93464);function A(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[l,r]=e;r&&t.set(l,r)});let l=t.toString();return l?"?".concat(l):""}function O(e){var t,l;let{type:x,label:h,batchDelete:b}=e,p=(0,s.useRouter)(),g=(0,s.usePathname)(),y=(0,s.useSearchParams)(),f=y.get("id")||"",v=(0,a.useMemo)(()=>({q:y.get("q")||"",status:"",from:y.get("from")||"",to:y.get("to")||""}),[y]),[j,N]=(0,a.useState)(null),[k,S]=(0,a.useState)(!1),[C,U]=(0,a.useState)(!1),[O,_]=(0,a.useState)(0),J=(0,a.useCallback)(e=>{var t,l;let r=null!==(t=e.filters)&&void 0!==t?t:v,a=A({id:null!==(l=e.id)&&void 0!==l?l:f,q:r.q,from:r.from,to:r.to});p.replace("".concat(g).concat(a))},[v,f,g,p]),{session:P,sync:L}=(0,w.nu)(),R=null!==(t=null==L?void 0:L.activeTenantId)&&void 0!==t?t:null,M=(0,E.B)({deleteUrl:"/entities/".concat(x),label:h,onDeleted:()=>z.refresh(),currentUserId:null!==(l=null==P?void 0:P.hmUserId)&&void 0!==l?l:null}),z=(0,T.k)({fetchPage:(0,a.useCallback)(async(e,t)=>{let l=A({q:v.q,from:v.from,to:v.to}),r=await (0,n.requestJson)("/entities?type=".concat(x,"&limit=").concat(t,"&offset=").concat(e).concat(l.replace("?","&")));return{items:r.items,total:r.total,nextOffset:r.nextOffset}},[x,v.q,v.from,v.to,R]),pageSize:50,deps:[x,v.q,v.from,v.to,R]}),W=z.items;(0,a.useEffect)(()=>{M.prune(W.map(e=>String(e.id)))},[W,M]);let F=(0,a.useCallback)(()=>{if(W.length)return W[0].updatedAt},[W]);(0,a.useEffect)(()=>{if(!f){N(null),U(!1);return}S(!0),U(!1),Promise.all([(0,n.requestJson)("/entities/".concat(x,"/").concat(f)),(0,n.requestJson)("/entities/".concat(x,"/").concat(f,"/sources")).catch(()=>null)]).then(e=>{let[t,l]=e;N({entity:t.entity,sources:l?l.items:[]})}).catch(()=>{N(null),U(!0)}).finally(()=>{S(!1)})},[x,f,R,O]);let D=(0,a.useMemo)(()=>W.map(e=>{var t,l,a;let s=String(e.id),n="talent"===x?(0,r.jsx)(I.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(未命名)",headline:e.headline,source:e.source,updatedAt:e.updatedAt}):"job"===x?(0,r.jsx)(I.rY,{title:null!==(l=e.title)&&void 0!==l?l:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt}):(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"font-medium text-gray-900",children:null!==(a=e.name)&&void 0!==a?a:"(未命名)"}),(0,r.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[(0,r.jsx)("span",{children:e.source}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsx)("span",{children:(0,m.d3)(e.updatedAt)})]})]});return{id:s,content:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[b&&!(0,i.K5)()&&M.checkbox(s),n]})}}),[W,x,b,M]),Y=f?k?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):C?(0,r.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,r.jsx)("button",{type:"button",onClick:()=>_(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):j?(0,r.jsx)(q,{type:x,entity:j.entity,sources:j.sources}):(0,r.jsxs)("div",{className:"flex h-full items-center justify-center text-red-500",children:["未找到该",h]}):(0,r.jsxs)("div",{className:"flex h-full items-center justify-center text-gray-400",children:["请在左侧选择一条",h,"查看详情"]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.m,{filterBar:(0,r.jsxs)("div",{className:"border-b border-gray-200 bg-white",children:[(0,r.jsx)(d.f,{value:v,onChange:e=>J({filters:e})}),(0,r.jsx)(u.Y,{pollUrl:"/entities/count?type=".concat(x),getLatestTimestamp:F,onRefresh:()=>z.refresh(),label:h}),b&&!(0,i.K5)()&&M.bar(D)]}),listPanel:z.error?(0,r.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,r.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,r.jsx)("button",{type:"button",onClick:()=>z.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,r.jsx)(c.L,{items:D,selectedId:f,onSelect:e=>J({id:e}),loading:z.loading,emptyText:"暂无".concat(h,"数据"),onLoadMore:z.loadMore,loadingMore:z.loadingMore,exhausted:z.exhausted}),detailPanel:Y}),M.modal()]})}function _(e){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,r.jsx)(O,{...e})})}},37202:function(e,t,l){l.d(t,{f:function(){return n}});var r=l(72835),a=l(60635),s=l(78606);function n(e){let{value:t,showStatus:l,statusOptions:n,onChange:i}=e,[d,o]=(0,a.useState)(t);return(0,a.useEffect)(()=>{o(t)},[t.q,t.status,t.from,t.to]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{(d.q!==t.q||d.status!==t.status||d.from!==t.from||d.to!==t.to)&&i(d)},300);return()=>clearTimeout(e)},[d.q,d.status,d.from,d.to]),(0,r.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",value:d.q,onChange:e=>o(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,r.jsx)("button",{type:"button",onClick:()=>i({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!d.q&&!d.status&&!d.from&&!d.to,children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),l?(0,r.jsx)(s.Z,{size:"small",allowClear:!0,placeholder:"全部状态",style:{minWidth:130},value:d.status||void 0,onChange:e=>o(t=>({...t,status:null!=e?e:""})),options:(n||[]).map(e=>({value:e.value,label:e.label}))}):null]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"date",value:d.from,onChange:e=>o(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,r.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,r.jsx)("input",{type:"date",value:d.to,onChange:e=>o(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},19036:function(e,t,l){l.d(t,{Y:function(){return n}});var r=l(72835),a=l(60635),s=l(74431);function n(e){let{pollUrl:t,intervalMs:l=5e3,onRefresh:n,getLatestTimestamp:i,label:d="新数据"}=e,[o,c]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),m=(0,a.useRef)(void 0);return((0,a.useEffect)(()=>{let e=()=>x(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,a.useEffect)(()=>{m.current=i(),c(0)},[i]),(0,a.useEffect)(()=>{if(u)return;let e=async()=>{let e=m.current;if(!e)return;let l=t.includes("?")?"&":"?",r=0;try{var a;let n=await (0,s.requestJson)("".concat(t).concat(l,"since=").concat(encodeURIComponent(e)));r=null!==(a=n.count)&&void 0!==a?a:0}catch(e){}c(e=>Math.max(e,r))};e();let r=setInterval(e,l);return()=>clearInterval(r)},[t,l,u]),o<=0)?null:(0,r.jsxs)("button",{type:"button",onClick:()=>{c(0),n()},className:"w-full bg-blue-50 px-3 py-2 text-center text-sm text-blue-700 hover:bg-blue-100 active:bg-blue-200",children:["有 ",o," 条",d,",点击刷新"]})}}}]);
|