hunter-mate 0.1.32 → 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 +275 -7
- 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.20261027115924.js → service-worker.20261028162720.js} +0 -0
- /package/dist/web/dist/_next/static/{MJuXtJSgMhtSDdWY9q8kk → Rmj7zlgoj2IjJB_RWslV8}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{MJuXtJSgMhtSDdWY9q8kk → Rmj7zlgoj2IjJB_RWslV8}/_ssgManifest.js +0 -0
|
@@ -1 +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]="
|
|
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]="5449ed42-1ff3-4fd6-8a6a-40edf23ba967",e._sentryDebugIdIdentifier="sentry-dbid-5449ed42-1ff3-4fd6-8a6a-40edf23ba967")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[245],{41689:function(e,t,n){Promise.resolve().then(n.bind(n,48517))},48517:function(e,t,n){"use strict";n.d(t,{default:function(){return m}});var l=n(72835),s=n(60635),d=n(74431),i=n(67002),o=n(33447),a=n(21260),r=n(21717);let c={not_found:"分享链接不存在、已失效,或你没有访问权限",expired:"分享链接已过期,请让分享者重新生成",revoked:"分享已被分享者撤销",out_of_scope:"你不在本次分享的范围内,请联系分享者"},u={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"};function m(){var e;let[t,n]=(0,s.useState)({kind:"loading"}),[r,u]=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=window.location.pathname.match(/\/shared\/([^/]+)/);u((null==e?void 0:e[1])?decodeURIComponent(e[1]):"")},[]),(0,s.useEffect)(()=>{if(r)return e(),(0,o.K5)()?(0,a.RB)(()=>void e()):(0,i.Lc)(()=>void e());async function e(){let e=(0,o.K5)()?(0,a.xq)():(0,i.Xc)();if(!e){n({kind:"need-login"});return}let t=await fetch((0,o.K5)()?"".concat((0,o.XJ)(),"/hunter-mate/shares/").concat(encodeURIComponent(r),"/data"):"".concat((0,d.Ox)(),"/shared/").concat(encodeURIComponent(r),"/data"),{headers:{Authorization:"".concat((0,o.K5)()?"HMJWT":"UTOKEN"," ").concat(e)},cache:"no-store"});if(401===t.status){n({kind:"need-login"});return}let l=await t.json().catch(()=>({}));if(!t.ok){var s,c,u;n({kind:"error",code:null!==(c=null!==(s=null==l?void 0:l.errorCode)&&void 0!==s?s:null==l?void 0:l.code)&&void 0!==c?c:"not_found",message:null!==(u=null==l?void 0:l.message)&&void 0!==u?u:""});return}n({kind:"ok",data:l})}},[r]),(0,l.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,l.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,l.jsx)("h1",{className:"mb-1 text-lg font-semibold",children:"同事分享的职位推荐"}),"loading"===t.kind?(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,"need-login"===t.kind?(0,l.jsx)("div",{className:"mt-4 rounded border border-amber-200 bg-amber-50 px-4 py-6 text-center text-sm text-amber-800",children:"请先登录本地 hm(左下角登录),登录后本页会自动加载分享内容。"}):null,"error"===t.kind?(0,l.jsxs)("div",{className:"mt-4 rounded border border-red-200 bg-red-50 px-4 py-6 text-center text-sm text-red-700",children:[null!==(e=c[t.code])&&void 0!==e?e:c.not_found,t.message?(0,l.jsx)("div",{className:"mt-1 text-xs text-red-400",children:t.message}):null]}):null,"ok"===t.kind?(0,l.jsx)(v,{data:t.data}):null]})})}function v(e){var t,n,d,i,o,a,c,m,v,x,h,f,p;let{data:b}=e,g=null!==(c=b.recommendations)&&void 0!==c?c:[],[j,y]=(0,s.useState)(null),N=null!==(m=b.jobCaseRef)&&void 0!==m?m:null,w=null===(t=b.jobCase)||void 0===t?void 0:t.id;return(0,l.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{children:[null!=N||null!=w?(0,l.jsx)("a",{href:null!=N?"/jobs?job=".concat(encodeURIComponent(N)):"/jobs?id=".concat(w),title:"点击打开职位详情",className:"text-base font-medium text-blue-600 hover:underline",children:null!==(v=null===(n=b.jobCase)||void 0===n?void 0:n.title)&&void 0!==v?v:"职位 ".concat(null!=N?N:"#".concat(w))}):(0,l.jsx)("div",{className:"text-base font-medium",children:null!==(x=null===(d=b.jobCase)||void 0===d?void 0:d.title)&&void 0!==x?x:"职位"}),(0,l.jsxs)("div",{className:"mt-0.5 text-xs text-gray-500",children:["分享者:",(null===(i=b.fromUser)||void 0===i?void 0:i.email)||"#".concat(null===(o=b.fromUser)||void 0===o?void 0:o.hmUserId),b.expiresAt?" \xb7 有效期至 ".concat(new Date(b.expiresAt).toLocaleString()):""]})]}),(0,l.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(h=null===(a=b.jobCase)||void 0===a?void 0:a.status)&&void 0!==h?h:""})]}),b.note?(0,l.jsx)("div",{className:"mt-2 rounded bg-blue-50 px-3 py-2 text-sm text-blue-800",children:b.note}):null]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500",children:["共 ",g.length," 位推荐人才(只读快照,实时数据以分享者本地为准)"]}),g.map(e=>{var t,n,s,d,i,o,a,r;let c=null!==(a=null!==(o=null===(t=e.snapshot)||void 0===t?void 0:t.name)&&void 0!==o?o:e.portraitName)&&void 0!==a?a:"推荐 #".concat(e.id.slice(0,8)),m=null!=e.entityId;return(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4".concat(m?" cursor-pointer transition-shadow hover:shadow-md":""),title:m?"点击查看人才详情":void 0,onClick:m?()=>y({entityId:e.entityId,name:c}):void 0,children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("div",{className:"font-medium".concat(m?" text-blue-600":""),children:c}),(0,l.jsx)("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:null!==(r=u[e.stage])&&void 0!==r?r:e.stage})]}),(null===(n=e.snapshot)||void 0===n?void 0:n.headline)?(0,l.jsx)("div",{className:"mt-1 text-xs text-gray-500",children:e.snapshot.headline}):null,"number"==typeof(null===(d=e.scores)||void 0===d?void 0:null===(s=d.dimensions)||void 0===s?void 0:s.overall)?(0,l.jsxs)("div",{className:"mt-1 text-xs text-gray-500",children:["综合匹配分:",e.scores.dimensions.overall]}):null,(null===(i=e.scores)||void 0===i?void 0:i.aiReason)?(0,l.jsx)("pre",{className:"mt-2 whitespace-pre-wrap rounded bg-gray-50 p-2 text-xs text-gray-600",children:e.scores.aiReason}):null]},e.id)}),g.length?null:(0,l.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"该职位暂无推荐人才"}),(0,l.jsx)(r.I,{entityId:null!==(f=null==j?void 0:j.entityId)&&void 0!==f?f:null,name:null!==(p=null==j?void 0:j.name)&&void 0!==p?p:"",open:null!=j,onClose:()=>y(null)})]})}},21717:function(e,t,n){"use strict";n.d(t,{I:function(){return u}});var l=n(72835),s=n(60635),d=n(95909),i=n(86892),o=n(87018),a=n(6443),r=n(74431),c=n(32587);function u(e){var t;let{entityId:n,name:u,open:m,onClose:v}=e,[x,h]=(0,s.useState)(null),[f,p]=(0,s.useState)([]),[b,g]=(0,s.useState)(null),[j,y]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1),[k,I]=(0,s.useState)(!1),[_,C]=(0,s.useState)(0);return(0,s.useEffect)(()=>{if(!m||null==n)return;let e=!0;return w(!0),I(!1),h(null),p([]),g(null),y(null),Promise.all([(0,r.requestJson)("/entities/talent/".concat(n)),(0,r.requestJson)("/entities/talent/".concat(n,"/sources")).catch(()=>null),(0,r.requestJson)("/entities/talent/".concat(n,"/matches")).catch(()=>null)]).then(t=>{var n,l;let[s,d,i]=t;e&&(h(s.entity),p(d?d.items:[]),g(null!==(n=null==i?void 0:i.portraitId)&&void 0!==n?n:null),y(null!==(l=null==i?void 0:i.matches)&&void 0!==l?l:[]))}).catch(()=>{e&&I(!0)}).finally(()=>{e&&w(!1)}),()=>{e=!1}},[m,n,_]),(0,l.jsx)(d.Z,{title:null!==(t=null==x?void 0:x.name)&&void 0!==t?t:u,placement:"right",width:860,open:m,onClose:v,destroyOnHidden:!0,children:N?(0,l.jsx)(i.Z,{active:!0,paragraph:{rows:8}}):k?(0,l.jsx)(o.Z,{type:"error",message:"人才详情加载失败",description:(0,l.jsx)(a.ZP,{size:"small",onClick:()=>C(e=>e+1),children:"重试"})}):x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.n,{entity:x}),(0,l.jsx)(c.z,{entity:x,portraitId:b,matches:j,sources:f})]}):null})}}},function(e){e.O(0,[502,606,882,431,587,400,935,744],function(){return e(e.s=41689)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c0596ae7-8fa9-4829-9190-7746114722a1",e._sentryDebugIdIdentifier="sentry-dbid-c0596ae7-8fa9-4829-9190-7746114722a1")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93],{85539:function(e,n,r){Promise.resolve().then(r.bind(r,59659))},27473:function(e,n,r){"use strict";var u=r(38321);r.o(u,"useParams")&&r.d(n,{useParams:function(){return u.useParams}}),r.o(u,"usePathname")&&r.d(n,{usePathname:function(){return u.usePathname}}),r.o(u,"useRouter")&&r.d(n,{useRouter:function(){return u.useRouter}}),r.o(u,"useSearchParams")&&r.d(n,{useSearchParams:function(){return u.useSearchParams}}),r.o(u,"useServerInsertedHTML")&&r.d(n,{useServerInsertedHTML:function(){return u.useServerInsertedHTML}})}},function(e){e.O(0,[502,606,431,587,987,659,400,935,744],function(){return e(e.s=85539)}),_N_E=e.O()}]);
|
|
@@ -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]="a8323695-0b05-4189-8b5b-7dcf74b8dc1b",e._sentryDebugIdIdentifier="sentry-dbid-a8323695-0b05-4189-8b5b-7dcf74b8dc1b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14],{80812:function(e,t,n){Promise.resolve().then(n.bind(n,21670))},21670:function(e,t,n){"use strict";n.d(t,{default:function(){return g}});var l=n(72835),r=n(60635),a=n(78606),s=n(74431),i=n(67002),o=n(65777);let d=[{key:"today",label:"今天"},{key:"yesterday",label:"昨天"},{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"last7",label:"近 7 天"},{key:"custom",label:"自定义"}],u={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"},c={create:"建档",move:"阶段迁移",form:"保存表单",invite:"记录邀请",invite_approved:"批准邀请",note:"备注",delete:"移出流程"};function m(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function x(e){let{actorType:t}=e;return"agent"===t?(0,l.jsx)("span",{className:"rounded bg-purple-100 px-1.5 py-0.5 text-xs text-purple-700",children:"agent 代操作"}):"human"===t?(0,l.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:"本人操作"}):(0,l.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-500",children:"来源不明"})}function g(){var e,t,n,g,y;let[v,p]=(0,r.useState)(null),[f,b]=(0,r.useState)(null),[j,N]=(0,r.useState)("last7"),[I,S]=(0,r.useState)(""),[w,k]=(0,r.useState)(""),[T,D]=(0,r.useState)(null),[E,O]=(0,r.useState)(!1),[U,_]=(0,r.useState)(null),{sync:C}=(0,o.nu)(),A=null!==(e=null==C?void 0:C.activeTenantId)&&void 0!==e?e:null,q=(0,r.useCallback)(()=>{(0,s.requestJson)("/team/members").then(e=>{let t=Array.isArray(null==e?void 0:e.items)?e.items:[];p(t),b(e=>{var n,l;return null!=e&&t.some(t=>t.hmUserId===e)?e:null!==(l=null===(n=t[0])||void 0===n?void 0:n.hmUserId)&&void 0!==l?l:null})}).catch(()=>{})},[A]);(0,r.useEffect)(()=>(q(),(0,i.Lc)(q)),[q]);let P=(0,r.useCallback)(async()=>{if(null==f)return;O(!0),_(null);let{from:e,to:t}=function(e,t,n){let l=m(new Date);switch(e){case"today":return{from:l.toISOString(),to:new Date(l.getTime()+864e5).toISOString()};case"yesterday":return{from:new Date(l.getTime()-864e5).toISOString(),to:l.toISOString()};case"week":{let e=(l.getDay()+6)%7;return{from:new Date(l.getTime()-864e5*e).toISOString(),to:new Date(l.getTime()+864e5).toISOString()}}case"month":return{from:new Date(l.getFullYear(),l.getMonth(),1).toISOString(),to:new Date(l.getTime()+864e5).toISOString()};case"custom":return{from:t?m(new Date("".concat(t,"T00:00:00"))).toISOString():l.toISOString(),to:n?new Date(m(new Date("".concat(n,"T00:00:00"))).getTime()+864e5).toISOString():new Date(l.getTime()+864e5).toISOString()};default:return{from:new Date(l.getTime()-5184e5).toISOString(),to:new Date(l.getTime()+864e5).toISOString()}}}(j,I,w);try{let n=await (0,s.requestJson)("/team/insights?hmUserId=".concat(f,"&from=").concat(encodeURIComponent(e),"&to=").concat(encodeURIComponent(t)));D(n)}catch(e){_("加载失败:未登录云端账号、与对方不在同一公司租户,或云服务不可达"),D(null)}finally{O(!1)}},[f,j,I,w,A]);(0,r.useEffect)(()=>(P(),(0,i.Lc)(()=>void P())),[P]);let R=null==T?void 0:T.summary,X=(0,r.useMemo)(()=>{var e;return Object.entries(null!==(e=null==R?void 0:R.terminal)&&void 0!==e?e:{})},[R]);return(0,l.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,l.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,l.jsx)("h1",{className:"mb-4 text-lg font-semibold",children:"同事工作统计"}),(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-gray-200 bg-white p-3",children:[(0,l.jsxs)("label",{className:"text-sm text-gray-600",children:["同事:",(0,l.jsx)(a.Z,{size:"small",style:{minWidth:240},placeholder:null===v?"加载中…":"选择同事…",value:null!=f?f:void 0,onChange:e=>b(e),options:(null!=v?v:[]).map(e=>({value:e.hmUserId,label:"".concat(e.name,"(").concat(e.email,")")}))})]}),(0,l.jsx)("div",{className:"flex gap-1",children:d.map(e=>(0,l.jsx)("button",{onClick:()=>N(e.key),className:"rounded px-2.5 py-1 text-xs ".concat(j===e.key?"bg-blue-100 font-medium text-blue-800":"text-gray-500 hover:bg-gray-100"),children:e.label},e.key))}),"custom"===j?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-sm",children:[(0,l.jsx)("input",{type:"date",value:I,onChange:e=>S(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"}),"~",(0,l.jsx)("input",{type:"date",value:w,onChange:e=>k(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"})]}):null]}),U?(0,l.jsx)("div",{className:"mb-4 rounded border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:U}):null,E?(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,!E&&T?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[(0,l.jsx)(h,{label:"区间新建推荐",value:null!==(t=null==R?void 0:R.recsTotal)&&void 0!==t?t:0}),(0,l.jsx)(h,{label:"agent 代操作",value:null!==(n=null==R?void 0:R.recsByAgent)&&void 0!==n?n:0,tone:"purple"}),(0,l.jsx)(h,{label:"本人操作",value:null!==(g=null==R?void 0:R.recsByHuman)&&void 0!==g?g:0,tone:"green"}),(0,l.jsx)(h,{label:"来源不明(存量)",value:null!==(y=null==R?void 0:R.recsUnknown)&&void 0!==y?y:0,tone:"gray"})]}),X.length?(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm",children:[(0,l.jsx)("span",{className:"mr-2 text-xs text-gray-500",children:"终端阶段:"}),X.map(e=>{var t;let[n,r]=e;return(0,l.jsxs)("span",{className:"mr-3",children:[null!==(t=u[n])&&void 0!==t?t:n," ",(0,l.jsx)("b",{children:r})]},n)})]}):null,(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:"分职位产出"}),T.jobs.length?(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"text-left text-xs text-gray-400",children:[(0,l.jsx)("th",{className:"px-4 py-2",children:"职位"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"推荐数"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"agent"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"本人"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"不明"}),(0,l.jsx)("th",{className:"px-4 py-2",children:"阶段分布"})]})}),(0,l.jsx)("tbody",{children:T.jobs.map(e=>(0,l.jsxs)("tr",{className:"border-t border-gray-50",children:[(0,l.jsxs)("td",{className:"px-4 py-2",children:[e.title,e.status?(0,l.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.status,")"]}):null]}),(0,l.jsx)("td",{className:"px-2 py-2 font-medium",children:e.recsTotal}),(0,l.jsx)("td",{className:"px-2 py-2 text-purple-600",children:e.byAgent}),(0,l.jsx)("td",{className:"px-2 py-2 text-emerald-600",children:e.byHuman}),(0,l.jsx)("td",{className:"px-2 py-2 text-gray-400",children:e.byUnknown}),(0,l.jsx)("td",{className:"px-4 py-2 text-xs text-gray-500",children:Object.entries(e.stageDist).map(e=>{var t;let[n,l]=e;return"".concat(null!==(t=u[n])&&void 0!==t?t:n," ").concat(l)}).join(" / ")})]},e.jobCaseId))})]}):(0,l.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无推荐产出"})]}),(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,l.jsxs)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:["操作时间线(区间内 ",T.timeline.length," 条)"]}),T.timeline.length?(0,l.jsx)("ul",{className:"divide-y divide-gray-50",children:T.timeline.map((e,t)=>{var n,r;return(0,l.jsxs)("li",{className:"flex items-center gap-3 px-4 py-2 text-sm",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-xs text-gray-400",children:new Date(e.at).toLocaleString()}),(0,l.jsx)(x,{actorType:e.actorType}),(0,l.jsx)("span",{className:"font-medium",children:e.talentName||"—"}),(0,l.jsxs)("span",{className:"text-xs text-gray-500",children:[null!==(n=c[e.action])&&void 0!==n?n:e.action,e.toStage?" → ".concat(null!==(r=u[e.toStage])&&void 0!==r?r:e.toStage):""]}),(0,l.jsx)("span",{className:"ml-auto truncate text-xs text-gray-400",children:e.jobTitle})]},"".concat(e.at,"-").concat(t))})}):(0,l.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无操作记录"})]})]}):null,E||T||U?null:(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:v&&!v.length?"暂无公司租户同事(加入公司租户后可用)":"选择同事与时间段查看统计"})]})})}function h(e){let{label:t,value:n,tone:r}=e;return(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[(0,l.jsx)("div",{className:"text-xs text-gray-500",children:t}),(0,l.jsx)("div",{className:"mt-1 text-2xl font-semibold ".concat("purple"===r?"text-purple-700":"green"===r?"text-emerald-700":"gray"===r?"text-gray-500":"text-gray-900"),children:n})]})}},65777:function(e,t,n){"use strict";let l;n.d(t,{Cd:function(){return O},Xc:function(){return _},aG:function(){return D},cp:function(){return E},nu:function(){return T},tQ:function(){return U}});var r=n(60635),a=n(74431),s=n(67002),i=n(33447),o=n(21260),d=n(28431),u=n(60529);let c=null,m=null,x=null,g=new Set;function h(){g.forEach(e=>e())}function y(e){c=c?{...c,refreshing:e}:{...S,refreshing:e},h()}function v(e){if(void 0===l){l=e;return}if(e!==l){l=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}async function p(){try{return await (0,a.requestJson)("/auth/session")}catch(e){return null}}async function f(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,a.requestJson)(e,{headers:t})}catch(e){return null}}async function b(){y(!0);try{var e,t,n,l,r,s,i,u,m;let x=(0,o.xq)();if(!x){(0,d.nZ)(),c={...S,session:{loggedIn:!1},refreshing:!1,authStatus:"out"},h();return}let g=await (0,a.requestJson)("/hunter-mate/sync/state?heads=0");(0,d.YZ)(null!==(e=g.activeTenantId)&&void 0!==e?e:null);let y=(0,o.OG)(x);v(null!==(n=null!==(t=g.hmUserId)&&void 0!==t?t:y.hmUserId)&&void 0!==n?n:null),c={session:{loggedIn:!0,email:null!==(l=y.email)&&void 0!==l?l:void 0,hmUserId:null!==(s=null!==(r=g.hmUserId)&&void 0!==r?r:y.hmUserId)&&void 0!==s?s:void 0,token:x},sync:{loggedIn:!0,enabled:!0,activeTenantId:(0,d.MA)(),serverSuggestedTenantId:null!==(i=g.activeTenantId)&&void 0!==i?i:null,memberships:null!==(u=g.memberships)&&void 0!==u?u:[],pendingCounts:null!==(m=g.pendingCounts)&&void 0!==m?m:[]},utoken:x,loadError:null,refreshing:!1,authStatus:"in",refresh:N},h()}catch(e){c=c?{...c,loadError:"云端无响应"}:{...S,loadError:"云端无响应"},h()}finally{(null==c?void 0:c.refreshing)&&y(!1)}}async function j(){if((0,i.K5)())return b();y(!0);try{var e;let[t,n]=await Promise.all([p(),f("/datasync/state")]),l=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,r=null!=n?n:null;!r&&t&&l&&l!==(0,s.Xc)()?((0,s.GK)(l),r=await f("/datasync/state")):(0,s.GK)(l),v((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let a=!!((null==t?void 0:t.loggedIn)||(null==r?void 0:r.loggedIn));if(!t&&!r){c=c?{...c,loadError:"本地服务无响应"}:{...S,loadError:"本地服务无响应"},h();return}c={session:null!=t?t:{loggedIn:!1},sync:r,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:a?"in":"out",refresh:N},h()}finally{(null==c?void 0:c.refreshing)&&y(!1)}}function N(){return m||(m=j().finally(()=>{m=null}))}function I(e){return g.add(e),1===g.size&&(N(),x=setInterval(()=>void N(),6e4)),()=>{g.delete(e),0===g.size&&x&&(clearInterval(x),x=null)}}let S={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:N};function w(){return null!=c?c:S}function k(){return w()}function T(){return(0,r.useSyncExternalStore)(I,w,k)}function D(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function E(e){var t,n;let l=null!==(t=null==e?void 0:e.activeTenantId)&&void 0!==t?t:null;if(null==l)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===l&&!e.leftAt);return!r||r.isPersonal?null:l}function O(e,t){var n,l;if(!t)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===t&&!e.leftAt&&!e.isPersonal);return null!==(l=null==r?void 0:r.role)&&void 0!==l?l:null}function U(){return u.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function _(){return(0,s.Xc)()}}},function(e){e.O(0,[502,606,431,400,935,744],function(){return e(e.s=80812)}),_N_E=e.O()}]);
|