hunter-mate 0.1.25 → 0.1.26
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/background/{service-worker.20261017183328.js → service-worker.20261019161523.js} +56 -4
- package/dist/assets/extension/background/service-worker.js +56 -4
- package/dist/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/manifest.json +3 -3
- package/dist/assets/server/main.mjs +885 -782
- package/dist/index.js +20 -5
- package/dist/watchdog.js +14 -3
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/chunks/187-f067914dcd1330c2.js +32 -0
- package/dist/web/dist/_next/static/chunks/253-9278ce6c4d446329.js +1 -0
- package/dist/web/dist/_next/static/chunks/{589-f984bff035a1cb85.js → 589-cc56950ae4117cdd.js} +1 -1
- package/dist/web/dist/_next/static/chunks/659-122057f46f941df7.js +1 -0
- package/dist/web/dist/_next/static/chunks/{686-9f419b70feea9470.js → 686-05b99d3674f45bf7.js} +1 -1
- package/dist/web/dist/_next/static/chunks/728-cffab7e836020551.js +12 -0
- package/dist/web/dist/_next/static/chunks/{865-0ed23dd43c0832a2.js → 865-8e1d8c34192526ed.js} +1 -1
- package/dist/web/dist/_next/static/chunks/{935-7be3e60dd8bc29d2.js → 935-efb30b9f6f558e3f.js} +1 -1
- package/dist/web/dist/_next/static/chunks/{a7067448-e416655baf443992.js → a7067448-3f2b194cfadb91fb.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/_not-found/{page-5b7249eb3c9a6cb9.js → page-d939b40bb8878d26.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/admin/data/{page-14698e9c4ddaa6d9.js → page-df1d84c14e85f294.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/auth/verify/{page-05304d5803008d61.js → page-cfeb844e1b72ccaa.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/companies/{page-e8d02fe997579315.js → page-57b1ef0b12134ce0.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/company/admin/{page-c2584183bc4b34d1.js → page-010928306f8df0ed.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/entity/{page-08755f96102f0565.js → page-fa96319650d38e78.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-5ba0bdc881b98d42.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/{layout-af39afc7866e74db.js → layout-bd9a7e5e4474b692.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/logs/{page-be50a4e10b1a0024.js → page-bcdbb3885abda5a2.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/{page-cf445b0cb8c2cb0a.js → page-8aca89db1e666a49.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/{page-c7ff0d79b6a75915.js → page-7086f1b773e57511.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/{page-bd282e1e5f0965f1.js → page-49fe1e8630d2237e.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/parselog/{page-9814e75d6900a743.js → page-fcdfdd41cf1f86f7.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/recordings/{page-441016638b43c4f8.js → page-7ba5d89391c9dace.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/resource-usage/{page-f6fa06bfe21bcd32.js → page-7b939cf673d764e6.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/{page-c9c5042a2d07c0bc.js → page-df87328c52f862f1.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/{page-f54cf2f0058035ca.js → page-7d4d25de2c6704e9.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/talents/{page-0edef6d07b3cf69d.js → page-5a2caa7a503ee041.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/team/insights/{page-8b3934df3e292368.js → page-f097b4b8578a6e5d.js} +1 -1
- package/dist/web/dist/_next/static/css/a8f0a381a2372781.css +3 -0
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +5 -5
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +5 -5
- package/dist/web/dist/companies.html +1 -1
- package/dist/web/dist/companies.txt +5 -5
- package/dist/web/dist/company/admin.html +1 -1
- package/dist/web/dist/company/admin.txt +5 -5
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +5 -5
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +5 -5
- package/dist/web/dist/jobs.html +1 -1
- package/dist/web/dist/jobs.txt +5 -5
- package/dist/web/dist/logs.html +1 -1
- package/dist/web/dist/logs.txt +5 -5
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +5 -5
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +5 -5
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +5 -5
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +5 -5
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +5 -5
- package/dist/web/dist/shared/placeholder.html +1 -1
- package/dist/web/dist/shared/placeholder.txt +5 -5
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +5 -5
- package/dist/web/dist/talents.html +1 -1
- package/dist/web/dist/talents.txt +5 -5
- package/dist/web/dist/team/insights.html +1 -1
- package/dist/web/dist/team/insights.txt +5 -5
- package/package.json +1 -1
- package/dist/web/dist/_next/static/chunks/105-dcd8f6d5867c8995.js +0 -32
- package/dist/web/dist/_next/static/chunks/253-a05d05b94bfbd7a4.js +0 -1
- package/dist/web/dist/_next/static/chunks/555-e2a871b9d2eccb03.js +0 -12
- package/dist/web/dist/_next/static/chunks/852-ad19b97821a4cf9e.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-4827a9ef286b6483.js +0 -1
- package/dist/web/dist/_next/static/css/10ba1fa1d6ce23a7.css +0 -3
- /package/dist/web/dist/_next/static/{5MA8faUttk6FzlxGWnOlM → m0UGHVTGvtvb9mn4-uzJJ}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{5MA8faUttk6FzlxGWnOlM → m0UGHVTGvtvb9mn4-uzJJ}/_ssgManifest.js +0 -0
|
@@ -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]="5e0e9c99-5df9-4eba-8abc-4b813a64404d",e._sentryDebugIdIdentifier="sentry-dbid-5e0e9c99-5df9-4eba-8abc-4b813a64404d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{34256:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return t(46864)}])},46864:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return s}}),t(98422);let i=t(72835);t(60635);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},r={display:"inline-block"},l={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:l,children:"404"}),(0,i.jsx)("div",{style:r,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),e.exports=n.default)}},function(e){e.O(0,[400,935,744],function(){return e(e.s=34256)}),_N_E=e.O()}]);
|
|
@@ -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]="de801641-1319-4d1c-a5b0-7cd3063ba120",e._sentryDebugIdIdentifier="sentry-dbid-de801641-1319-4d1c-a5b0-7cd3063ba120")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[116],{87126:function(e,t,n){Promise.resolve().then(n.bind(n,84042))},84042:function(e,t,n){"use strict";n.d(t,{AdminDataPage:function(){return c}});var l=n(72835),r=n(60635),a=n(65777),s=n(82182),i=n(74431),u=n(8448);let o=[{value:"talent_profiles",label:"人才"},{value:"jobcases",label:"职位"},{value:"company_profiles",label:"公司"},{value:"customers",label:"客户"}];function c(){var e,t,n;let{session:c,utoken:d}=(0,a.nu)(),h=null!==(e=null==c?void 0:c.hmUserId)&&void 0!==e?e:null,[x,f]=(0,r.useState)(""),[y,m]=(0,r.useState)("talent_profiles"),[p,g]=(0,r.useState)("all"),[v,b]=(0,r.useState)(1),[j,N]=(0,r.useState)(null),[w,S]=(0,r.useState)(!1),[E,k]=(0,r.useState)(null),[I,C]=(0,r.useState)(new Set),[_,T]=(0,r.useState)(null),[U,A]=(0,r.useState)(!1),[R,z]=(0,r.useState)(null);(0,r.useEffect)(()=>{null==h||x||f(String(h))},[h,x]);let O=(0,r.useCallback)(async(e,t)=>{let n=new Headers(null==t?void 0:t.headers);return n.set("Content-Type","application/json"),d&&n.set("Authorization","UTOKEN ".concat(d)),await fetch("".concat((0,i.Ox)()).concat(e),{...t,headers:n})},[d]),P=(0,r.useCallback)(async()=>{if(x){S(!0),k(null);try{let n=new URLSearchParams({hmUserId:x,entity:y,softDeleted:p,page:String(v),pageSize:String(50)}),l=await O("/admin/entities?".concat(n));if(403===l.status){var e,t;let n=await l.json().catch(()=>null),r=null!==(t=null==n?void 0:null===(e=n.message)||void 0===e?void 0:e.code)&&void 0!==t?t:null==n?void 0:n.code;k("ADMIN_NOT_CONFIGURED"===r?"管理功能未开启":"你没有管理权限"),N(null);return}if(!l.ok){k("加载失败(HTTP ".concat(l.status,")")),N(null);return}let r=await l.json();N(r),C(e=>{let t=new Set(r.items.map(e=>e.entityRef)),n=new Set(Array.from(e).filter(e=>t.has(e)));return n.size===e.size?e:n})}finally{S(!1)}}},[O,x,y,p,v]);(0,r.useEffect)(()=>{P()},[P]);let H=(0,r.useMemo)(()=>j?Math.max(1,Math.ceil(j.total/50)):1,[j]),D=(0,r.useCallback)(e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),X=(0,r.useCallback)(async()=>{if(!(null==_?void 0:_.length))return;A(!0),z(null);let e=async e=>{let t=await fetch("".concat((0,a.tQ)(),"/admin/purge"),{method:"POST",headers:e,body:JSON.stringify({hmUserId:Number(x),entity:y,entityRefs:_})});if(!t.ok){let e=await t.json().catch(()=>null),n=null==e?void 0:e.message;return z("string"==typeof n?n:"清除失败,请稍后重试"),!1}return z("已清除 ".concat(_.length," 条,所有设备会同步删除")),C(new Set),await P(),!0};try{let n=new Headers({"Content-Type":"application/json"});d&&n.set("Authorization","UTOKEN ".concat(d));let l=await O("/admin/purge",{method:"POST",body:JSON.stringify({hmUserId:Number(x),entity:y,entityRefs:_})});if(!l.ok){if(401===l.status){var t;z("登录已过期,请在弹窗中重新登录;登录后自动继续清除"),(0,s.jr)({message:"登录已过期,请重新登录",oldUserId:null!==(t=null==c?void 0:c.hmUserId)&&void 0!==t?t:null,retry:()=>{var t;let n=new Headers({"Content-Type":"application/json"}),l=null!==(t=(0,a.Xc)())&&void 0!==t?t:d;return l&&n.set("Authorization","UTOKEN ".concat(l)),e(n)}});return}let n=await l.json().catch(()=>null),r=null==n?void 0:n.message;z("string"==typeof r?r:"清除失败,请稍后重试");return}z("已清除 ".concat(_.length," 条,所有设备会同步删除")),C(new Set),await P()}finally{A(!1),T(null)}},[O,_,x,y,P,d,null==c?void 0:c.hmUserId]);return(0,l.jsxs)("div",{className:"flex h-full flex-col bg-white",children:[(0,l.jsxs)("div",{className:"border-b border-gray-200 px-6 py-4",children:[(0,l.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"数据管理"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"查看并清理有问题的数据。彻底删除后无法恢复,所有设备同步清除。"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-b border-gray-100 px-6 py-3",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["用户编号",(0,l.jsx)("input",{type:"number",value:x,onChange:e=>f(e.target.value),className:"w-24 rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["数据类型",(0,l.jsx)("select",{value:y,onChange:e=>{m(e.target.value),b(1)},className:"rounded border border-gray-300 px-2 py-1 text-sm",children:o.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["删除状态",(0,l.jsxs)("select",{value:p,onChange:e=>{g(e.target.value),b(1)},className:"rounded border border-gray-300 px-2 py-1 text-sm",children:[(0,l.jsx)("option",{value:"all",children:"全部"}),(0,l.jsx)("option",{value:"yes",children:"已删除的"}),(0,l.jsx)("option",{value:"no",children:"正常的"})]})]}),(0,l.jsx)("button",{type:"button",onClick:()=>void P(),disabled:w,className:"rounded-lg bg-blue-600 px-4 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:w?"加载中…":"查询"}),I.size>0&&(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsxs)("span",{className:"text-gray-500",children:["已选 ",I.size," 条"]}),(0,l.jsx)("button",{type:"button",onClick:()=>T(Array.from(I)),className:"rounded-lg bg-red-600 px-3 py-1 text-white hover:bg-red-700",children:"彻底删除"})]}),R&&(0,l.jsx)("span",{className:"text-xs text-green-600",children:R}),E&&(0,l.jsx)("span",{className:"text-xs text-red-500",children:E})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto px-6 py-3",children:[E&&!j?(0,l.jsx)("div",{className:"py-12 text-center text-sm text-gray-400",children:E}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-400",children:[(0,l.jsx)("th",{className:"w-8 py-2",children:(0,l.jsx)("input",{type:"checkbox",className:"accent-blue-600",checked:!!(null==j?void 0:j.items.length)&&I.size===j.items.length,onChange:()=>{var e;return C(I.size===(null==j?void 0:j.items.length)?new Set:new Set(null!==(e=null==j?void 0:j.items.map(e=>e.entityRef))&&void 0!==e?e:[]))}})}),(0,l.jsx)("th",{className:"py-2",children:"编号"}),(0,l.jsx)("th",{className:"py-2",children:"数据类型"}),(0,l.jsx)("th",{className:"py-2",children:"状态"}),(0,l.jsx)("th",{className:"py-2",children:"更新时间"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-gray-50",children:(null!==(t=null==j?void 0:j.items)&&void 0!==t?t:[]).map(e=>{var t,n;let r=1===e.deleted,a=!r&&null!=e.softDeleted;return(0,l.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,l.jsx)("td",{className:"py-2",children:(0,l.jsx)("input",{type:"checkbox",className:"accent-blue-600",checked:I.has(e.entityRef),onChange:()=>D(e.entityRef)})}),(0,l.jsx)("td",{className:"py-2 font-mono text-xs text-gray-700",children:e.entityRef}),(0,l.jsx)("td",{className:"py-2 text-gray-600",children:null!==(n=null===(t=o.find(t=>t.value===e.entity))||void 0===t?void 0:t.label)&&void 0!==n?n:e.entity}),(0,l.jsx)("td",{className:"py-2",children:r?(0,l.jsx)("span",{className:"rounded bg-red-100 px-1.5 py-0.5 text-[10px] text-red-600",children:"已清除"}):a?(0,l.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-500",children:"已删除"}):(0,l.jsx)("span",{className:"rounded bg-green-100 px-1.5 py-0.5 text-[10px] text-green-600",children:"正常"})}),(0,l.jsx)("td",{className:"py-2 text-xs text-gray-400",children:(0,u.d3)(e.updatedAt)})]},e.entityRef)})})]}),j&&!j.items.length&&!E&&(0,l.jsx)("div",{className:"py-12 text-center text-sm text-gray-400",children:"没有符合条件的数据"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between border-t border-gray-100 px-6 py-2 text-sm text-gray-500",children:[(0,l.jsxs)("span",{children:["共 ",null!==(n=null==j?void 0:j.total)&&void 0!==n?n:0," 条"]}),(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:v<=1,onClick:()=>b(e=>e-1),className:"rounded border border-gray-300 px-3 py-1 hover:bg-gray-50 disabled:opacity-40",children:"上一页"}),(0,l.jsxs)("span",{children:[v," / ",H]}),(0,l.jsx)("button",{type:"button",disabled:v>=H,onClick:()=>b(e=>e+1),className:"rounded border border-gray-300 px-3 py-1 hover:bg-gray-50 disabled:opacity-40",children:"下一页"})]})]}),_&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:(0,l.jsxs)("div",{className:"w-96 rounded-xl bg-white p-6 shadow-xl",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"彻底删除确认"}),(0,l.jsxs)("p",{className:"mt-3 text-sm text-gray-600",children:["选中的 ",_.length," 条数据会被永久清除,无法恢复,所有设备同步删除。确定继续吗?"]}),(0,l.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:U,onClick:()=>T(null),className:"rounded-lg px-4 py-1.5 text-sm text-gray-600 hover:bg-gray-100",children:"取消"}),(0,l.jsx)("button",{type:"button",disabled:U,onClick:()=>void X(),className:"rounded-lg bg-red-600 px-4 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-50",children:U?"处理中…":"确定删除"})]})]})})]})}},65777:function(e,t,n){"use strict";let l;n.d(t,{Cd:function(){return E},Xc:function(){return I},aG:function(){return w},cp:function(){return S},nu:function(){return N},tQ:function(){return k}});var r=n(60635),a=n(74431),s=n(67002),i=n(60529);let u=null,o=null,c=null,d=new Set;function h(){d.forEach(e=>e())}function x(e){u=u?{...u,refreshing:e}:{...v,refreshing:e},h()}async function f(){try{return await (0,a.aA)("/auth/session")}catch(e){return null}}async function y(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,a.aA)(e,{headers:t})}catch(e){return null}}async function m(){x(!0);try{var e;let[t,n]=await Promise.all([f(),y("/datasync/state")]),r=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,a=null!=n?n:null;!a&&t&&r&&r!==(0,s.Xc)()?((0,s.GK)(r),a=await y("/datasync/state")):(0,s.GK)(r),function(e){if(void 0===l){l=e;return}if(e!==l){l=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let i=!!((null==t?void 0:t.loggedIn)||(null==a?void 0:a.loggedIn));if(!t&&!a){u=u?{...u,loadError:"本地服务无响应"}:{...v,loadError:"本地服务无响应"},h();return}u={session:null!=t?t:{loggedIn:!1},sync:a,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:i?"in":"out",refresh:p},h()}finally{(null==u?void 0:u.refreshing)&&x(!1)}}function p(){return o||(o=m().finally(()=>{o=null}))}function g(e){return d.add(e),1===d.size&&(p(),c=setInterval(()=>void p(),6e4)),()=>{d.delete(e),0===d.size&&c&&(clearInterval(c),c=null)}}let v={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:p};function b(){return null!=u?u:v}function j(){return b()}function N(){return(0,r.useSyncExternalStore)(g,b,j)}function w(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function S(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 E(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 k(){return i.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function I(){return(0,s.Xc)()}},82182:function(e,t,n){"use strict";n.d(t,{H7:function(){return c},jr:function(){return s},mn:function(){return o},nk:function(){return u},qd:function(){return i}});let l=null,r=new Set;function a(){r.forEach(e=>e())}function s(e){l=e,a()}function i(){l&&(l=null,a())}function u(){return l}function o(e){return r.add(e),()=>r.delete(e)}function c(e){if(!e)return null;try{var t,n,l,r,a;let s=e.split(".")[1],i=JSON.parse(decodeURIComponent(escape(atob(s.replace(/-/g,"+").replace(/_/g,"/"))))),u=null!==(a=null!==(r=null!==(l=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t._id)&&void 0!==l?l:null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.id)&&void 0!==r?r:null==i?void 0:i.sub)&&void 0!==a?a:null;return"number"==typeof u?u:null}catch(e){return null}}},8448:function(e,t,n){"use strict";function l(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("zh-CN",{hour12:!1}):""}n.d(t,{d3:function(){return l}})},74431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return a},aA:function(){return u}});var l=n(67002),r=n(60529);function a(){return r.env.HUNTER_MATE_SERVER_URL||""}let s=a();class i extends Error{constructor(e,t,n){super(null!=n?n:"请求失败(".concat(e,")").concat(t?": ".concat(t):"")),this.status=e,this.path=t,this.name="HttpError"}}async function u(e,t){let n;try{n=await fetch("".concat(s).concat(e),{cache:"no-store",...function(e){let t=(0,l.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}(t)})}catch(t){throw new i(0,e,t instanceof Error?t.message:"网络错误")}if(!n.ok)throw new i(n.status,e,"HTTP ".concat(n.status));try{return await n.json()}catch(t){throw new i(n.status,e,t instanceof Error?"响应解析失败: ".concat(t.message):"响应解析失败")}}},67002:function(e,t,n){"use strict";n.d(t,{GK:function(){return s},Lc:function(){return i},Xc:function(){return a}});let l=null,r=new Set;function a(){return l}function s(e){e!==l&&(l=e,r.forEach(e=>e()))}function i(e){return r.add(e),()=>{r.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=87126)}),_N_E=e.O()}]);
|
|
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]="d0657e3e-e074-40f2-a182-64cb65f07078",e._sentryDebugIdIdentifier="sentry-dbid-d0657e3e-e074-40f2-a182-64cb65f07078")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[116],{87126:function(e,t,n){Promise.resolve().then(n.bind(n,84042))},84042:function(e,t,n){"use strict";n.d(t,{AdminDataPage:function(){return c}});var l=n(72835),r=n(60635),a=n(65777),s=n(82182),i=n(74431),u=n(8448);let o=[{value:"talent_profiles",label:"人才"},{value:"jobcases",label:"职位"},{value:"company_profiles",label:"公司"},{value:"customers",label:"客户"}];function c(){var e,t,n;let{session:c,utoken:d}=(0,a.nu)(),f=null!==(e=null==c?void 0:c.hmUserId)&&void 0!==e?e:null,[h,x]=(0,r.useState)(""),[y,m]=(0,r.useState)("talent_profiles"),[p,g]=(0,r.useState)("all"),[v,b]=(0,r.useState)(1),[j,N]=(0,r.useState)(null),[w,S]=(0,r.useState)(!1),[E,k]=(0,r.useState)(null),[I,C]=(0,r.useState)(new Set),[_,T]=(0,r.useState)(null),[U,A]=(0,r.useState)(!1),[R,z]=(0,r.useState)(null);(0,r.useEffect)(()=>{null==f||h||x(String(f))},[f,h]);let O=(0,r.useCallback)(async(e,t)=>{let n=new Headers(null==t?void 0:t.headers);return n.set("Content-Type","application/json"),d&&n.set("Authorization","UTOKEN ".concat(d)),await fetch("".concat((0,i.Ox)()).concat(e),{...t,headers:n})},[d]),P=(0,r.useCallback)(async()=>{if(h){S(!0),k(null);try{let n=new URLSearchParams({hmUserId:h,entity:y,softDeleted:p,page:String(v),pageSize:String(50)}),l=await O("/admin/entities?".concat(n));if(403===l.status){var e,t;let n=await l.json().catch(()=>null),r=null!==(t=null==n?void 0:null===(e=n.message)||void 0===e?void 0:e.code)&&void 0!==t?t:null==n?void 0:n.code;k("ADMIN_NOT_CONFIGURED"===r?"管理功能未开启":"你没有管理权限"),N(null);return}if(!l.ok){k("加载失败(HTTP ".concat(l.status,")")),N(null);return}let r=await l.json();N(r),C(e=>{let t=new Set(r.items.map(e=>e.entityRef)),n=new Set(Array.from(e).filter(e=>t.has(e)));return n.size===e.size?e:n})}finally{S(!1)}}},[O,h,y,p,v]);(0,r.useEffect)(()=>{P()},[P]);let H=(0,r.useMemo)(()=>j?Math.max(1,Math.ceil(j.total/50)):1,[j]),D=(0,r.useCallback)(e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),X=(0,r.useCallback)(async()=>{if(!(null==_?void 0:_.length))return;A(!0),z(null);let e=async e=>{let t=await fetch("".concat((0,a.tQ)(),"/admin/purge"),{method:"POST",headers:e,body:JSON.stringify({hmUserId:Number(h),entity:y,entityRefs:_})});if(!t.ok){let e=await t.json().catch(()=>null),n=null==e?void 0:e.message;return z("string"==typeof n?n:"清除失败,请稍后重试"),!1}return z("已清除 ".concat(_.length," 条,所有设备会同步删除")),C(new Set),await P(),!0};try{let n=new Headers({"Content-Type":"application/json"});d&&n.set("Authorization","UTOKEN ".concat(d));let l=await O("/admin/purge",{method:"POST",body:JSON.stringify({hmUserId:Number(h),entity:y,entityRefs:_})});if(!l.ok){if(401===l.status){var t;z("登录已过期,请在弹窗中重新登录;登录后自动继续清除"),(0,s.jr)({message:"登录已过期,请重新登录",oldUserId:null!==(t=null==c?void 0:c.hmUserId)&&void 0!==t?t:null,retry:()=>{var t;let n=new Headers({"Content-Type":"application/json"}),l=null!==(t=(0,a.Xc)())&&void 0!==t?t:d;return l&&n.set("Authorization","UTOKEN ".concat(l)),e(n)}});return}let n=await l.json().catch(()=>null),r=null==n?void 0:n.message;z("string"==typeof r?r:"清除失败,请稍后重试");return}z("已清除 ".concat(_.length," 条,所有设备会同步删除")),C(new Set),await P()}finally{A(!1),T(null)}},[O,_,h,y,P,d,null==c?void 0:c.hmUserId]);return(0,l.jsxs)("div",{className:"flex h-full flex-col bg-white",children:[(0,l.jsxs)("div",{className:"border-b border-gray-200 px-6 py-4",children:[(0,l.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"数据管理"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"查看并清理有问题的数据。彻底删除后无法恢复,所有设备同步清除。"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-b border-gray-100 px-6 py-3",children:[(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["用户编号",(0,l.jsx)("input",{type:"number",value:h,onChange:e=>x(e.target.value),className:"w-24 rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["数据类型",(0,l.jsx)("select",{value:y,onChange:e=>{m(e.target.value),b(1)},className:"rounded border border-gray-300 px-2 py-1 text-sm",children:o.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 text-sm text-gray-600",children:["删除状态",(0,l.jsxs)("select",{value:p,onChange:e=>{g(e.target.value),b(1)},className:"rounded border border-gray-300 px-2 py-1 text-sm",children:[(0,l.jsx)("option",{value:"all",children:"全部"}),(0,l.jsx)("option",{value:"yes",children:"已删除的"}),(0,l.jsx)("option",{value:"no",children:"正常的"})]})]}),(0,l.jsx)("button",{type:"button",onClick:()=>void P(),disabled:w,className:"rounded-lg bg-blue-600 px-4 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:w?"加载中…":"查询"}),I.size>0&&(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsxs)("span",{className:"text-gray-500",children:["已选 ",I.size," 条"]}),(0,l.jsx)("button",{type:"button",onClick:()=>T(Array.from(I)),className:"rounded-lg bg-red-600 px-3 py-1 text-white hover:bg-red-700",children:"彻底删除"})]}),R&&(0,l.jsx)("span",{className:"text-xs text-green-600",children:R}),E&&(0,l.jsx)("span",{className:"text-xs text-red-500",children:E})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto px-6 py-3",children:[E&&!j?(0,l.jsx)("div",{className:"py-12 text-center text-sm text-gray-400",children:E}):(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-400",children:[(0,l.jsx)("th",{className:"w-8 py-2",children:(0,l.jsx)("input",{type:"checkbox",className:"accent-blue-600",checked:!!(null==j?void 0:j.items.length)&&I.size===j.items.length,onChange:()=>{var e;return C(I.size===(null==j?void 0:j.items.length)?new Set:new Set(null!==(e=null==j?void 0:j.items.map(e=>e.entityRef))&&void 0!==e?e:[]))}})}),(0,l.jsx)("th",{className:"py-2",children:"编号"}),(0,l.jsx)("th",{className:"py-2",children:"数据类型"}),(0,l.jsx)("th",{className:"py-2",children:"状态"}),(0,l.jsx)("th",{className:"py-2",children:"更新时间"})]})}),(0,l.jsx)("tbody",{className:"divide-y divide-gray-50",children:(null!==(t=null==j?void 0:j.items)&&void 0!==t?t:[]).map(e=>{var t,n;let r=1===e.deleted,a=!r&&null!=e.softDeleted;return(0,l.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,l.jsx)("td",{className:"py-2",children:(0,l.jsx)("input",{type:"checkbox",className:"accent-blue-600",checked:I.has(e.entityRef),onChange:()=>D(e.entityRef)})}),(0,l.jsx)("td",{className:"py-2 font-mono text-xs text-gray-700",children:e.entityRef}),(0,l.jsx)("td",{className:"py-2 text-gray-600",children:null!==(n=null===(t=o.find(t=>t.value===e.entity))||void 0===t?void 0:t.label)&&void 0!==n?n:e.entity}),(0,l.jsx)("td",{className:"py-2",children:r?(0,l.jsx)("span",{className:"rounded bg-red-100 px-1.5 py-0.5 text-[10px] text-red-600",children:"已清除"}):a?(0,l.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-500",children:"已删除"}):(0,l.jsx)("span",{className:"rounded bg-green-100 px-1.5 py-0.5 text-[10px] text-green-600",children:"正常"})}),(0,l.jsx)("td",{className:"py-2 text-xs text-gray-400",children:(0,u.d3)(e.updatedAt)})]},e.entityRef)})})]}),j&&!j.items.length&&!E&&(0,l.jsx)("div",{className:"py-12 text-center text-sm text-gray-400",children:"没有符合条件的数据"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between border-t border-gray-100 px-6 py-2 text-sm text-gray-500",children:[(0,l.jsxs)("span",{children:["共 ",null!==(n=null==j?void 0:j.total)&&void 0!==n?n:0," 条"]}),(0,l.jsxs)("span",{className:"flex items-center gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:v<=1,onClick:()=>b(e=>e-1),className:"rounded border border-gray-300 px-3 py-1 hover:bg-gray-50 disabled:opacity-40",children:"上一页"}),(0,l.jsxs)("span",{children:[v," / ",H]}),(0,l.jsx)("button",{type:"button",disabled:v>=H,onClick:()=>b(e=>e+1),className:"rounded border border-gray-300 px-3 py-1 hover:bg-gray-50 disabled:opacity-40",children:"下一页"})]})]}),_&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:(0,l.jsxs)("div",{className:"w-96 rounded-xl bg-white p-6 shadow-xl",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"彻底删除确认"}),(0,l.jsxs)("p",{className:"mt-3 text-sm text-gray-600",children:["选中的 ",_.length," 条数据会被永久清除,无法恢复,所有设备同步删除。确定继续吗?"]}),(0,l.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,l.jsx)("button",{type:"button",disabled:U,onClick:()=>T(null),className:"rounded-lg px-4 py-1.5 text-sm text-gray-600 hover:bg-gray-100",children:"取消"}),(0,l.jsx)("button",{type:"button",disabled:U,onClick:()=>void X(),className:"rounded-lg bg-red-600 px-4 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-50",children:U?"处理中…":"确定删除"})]})]})})]})}},65777:function(e,t,n){"use strict";let l;n.d(t,{Cd:function(){return E},Xc:function(){return I},aG:function(){return w},cp:function(){return S},nu:function(){return N},tQ:function(){return k}});var r=n(60635),a=n(74431),s=n(67002),i=n(60529);let u=null,o=null,c=null,d=new Set;function f(){d.forEach(e=>e())}function h(e){u=u?{...u,refreshing:e}:{...v,refreshing:e},f()}async function x(){try{return await (0,a.aA)("/auth/session")}catch(e){return null}}async function y(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,a.aA)(e,{headers:t})}catch(e){return null}}async function m(){h(!0);try{var e;let[t,n]=await Promise.all([x(),y("/datasync/state")]),r=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,a=null!=n?n:null;!a&&t&&r&&r!==(0,s.Xc)()?((0,s.GK)(r),a=await y("/datasync/state")):(0,s.GK)(r),function(e){if(void 0===l){l=e;return}if(e!==l){l=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let i=!!((null==t?void 0:t.loggedIn)||(null==a?void 0:a.loggedIn));if(!t&&!a){u=u?{...u,loadError:"本地服务无响应"}:{...v,loadError:"本地服务无响应"},f();return}u={session:null!=t?t:{loggedIn:!1},sync:a,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:i?"in":"out",refresh:p},f()}finally{(null==u?void 0:u.refreshing)&&h(!1)}}function p(){return o||(o=m().finally(()=>{o=null}))}function g(e){return d.add(e),1===d.size&&(p(),c=setInterval(()=>void p(),6e4)),()=>{d.delete(e),0===d.size&&c&&(clearInterval(c),c=null)}}let v={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:p};function b(){return null!=u?u:v}function j(){return b()}function N(){return(0,r.useSyncExternalStore)(g,b,j)}function w(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function S(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 E(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 k(){return i.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function I(){return(0,s.Xc)()}},82182:function(e,t,n){"use strict";n.d(t,{H7:function(){return c},jr:function(){return s},mn:function(){return o},nk:function(){return u},qd:function(){return i}});let l=null,r=new Set;function a(){r.forEach(e=>e())}function s(e){l=e,a()}function i(){l&&(l=null,a())}function u(){return l}function o(e){return r.add(e),()=>r.delete(e)}function c(e){if(!e)return null;try{var t,n,l,r,a;let s=e.split(".")[1],i=JSON.parse(decodeURIComponent(escape(atob(s.replace(/-/g,"+").replace(/_/g,"/"))))),u=null!==(a=null!==(r=null!==(l=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t._id)&&void 0!==l?l:null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.id)&&void 0!==r?r:null==i?void 0:i.sub)&&void 0!==a?a:null;return"number"==typeof u?u:null}catch(e){return null}}},8448:function(e,t,n){"use strict";function l(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("zh-CN",{hour12:!1}):""}n.d(t,{d3:function(){return l}})},74431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return a},aA:function(){return u}});var l=n(67002),r=n(60529);function a(){return r.env.HUNTER_MATE_SERVER_URL||""}let s=a();class i extends Error{constructor(e,t,n){super(null!=n?n:"请求失败(".concat(e,")").concat(t?": ".concat(t):"")),this.status=e,this.path=t,this.name="HttpError"}}async function u(e,t){let n;try{n=await fetch("".concat(s).concat(e),{cache:"no-store",...function(e){let t=(0,l.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}(t)})}catch(t){throw new i(0,e,t instanceof Error?t.message:"网络错误")}if(!n.ok)throw new i(n.status,e,"HTTP ".concat(n.status));try{return await n.json()}catch(t){throw new i(n.status,e,t instanceof Error?"响应解析失败: ".concat(t.message):"响应解析失败")}}},67002:function(e,t,n){"use strict";n.d(t,{GK:function(){return s},Lc:function(){return i},Xc:function(){return a}});let l=null,r=new Set;function a(){return l}function s(e){e!==l&&(l=e,r.forEach(e=>e()))}function i(e){return r.add(e),()=>{r.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=87126)}),_N_E=e.O()}]);
|
|
@@ -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]="3ae7f898-684a-4398-baf6-08e6c838f878",e._sentryDebugIdIdentifier="sentry-dbid-3ae7f898-684a-4398-baf6-08e6c838f878")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[937],{14116:function(e,t,n){Promise.resolve().then(n.bind(n,91332))},27473:function(e,t,n){"use strict";var s=n(38321);n.o(s,"useParams")&&n.d(t,{useParams:function(){return s.useParams}}),n.o(s,"usePathname")&&n.d(t,{usePathname:function(){return s.usePathname}}),n.o(s,"useRouter")&&n.d(t,{useRouter:function(){return s.useRouter}}),n.o(s,"useSearchParams")&&n.d(t,{useSearchParams:function(){return s.useSearchParams}}),n.o(s,"useServerInsertedHTML")&&n.d(t,{useServerInsertedHTML:function(){return s.useServerInsertedHTML}})},91332:function(e,t,n){"use strict";n.d(t,{default:function(){return i}});var s=n(72835),a=n(60635),r=n(27473);function i(){let e=(0,r.useSearchParams)().get("user_code")||"",[t,n]=(0,a.useState)(!0),[i,d]=(0,a.useState)({loggedIn:!1}),[o,l]=(0,a.useState)(""),[c,u]=(0,a.useState)(""),[m,h]=(0,a.useState)(0),[f,g]=(0,a.useState)(!1),[x,b]=(0,a.useState)(""),[p,y]=(0,a.useState)(!1),j=(0,a.useRef)();(0,a.useEffect)(()=>(fetch("/auth/session").then(e=>e.ok?e.json():{loggedIn:!1}).then(e=>d((null==e?void 0:e.loggedIn)?e:{loggedIn:!1})).catch(()=>d({loggedIn:!1})).finally(()=>n(!1)),()=>{j.current&&clearInterval(j.current)}),[]);let v=()=>{h(60),j.current=setInterval(()=>{h(e=>(e<=1&&j.current&&clearInterval(j.current),Math.max(0,e-1)))},1e3)},w=async()=>{if(!o.trim()){b("请输入邮箱");return}g(!0),b("");try{let e=await fetch("/auth/email/send-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o.trim()})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.message||t.error||"发送失败,请稍后重试");v()}catch(e){b(e.message)}finally{g(!1)}},N=async t=>{let n=await fetch("/auth/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userCode:e,token:t})}),s=await n.json().catch(()=>({}));if(!n.ok||(null==s?void 0:s.ok)===!1)throw Error((null==s?void 0:s.error)||(null==s?void 0:s.message)||"授权失败");y(!0)},S=async e=>{e.preventDefault(),g(!0),b("");try{let e=await fetch("/auth/email/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o.trim(),code:c.trim()})}),t=await e.json().catch(()=>({}));if(!e.ok||!t.access_token)throw Error(t.message||t.error||"验证码错误");await N(t.access_token)}catch(e){b(e.message)}finally{g(!1)}},k=async()=>{g(!0),b("");try{await N(i.token)}catch(e){d({loggedIn:!1}),b("".concat(e.message,";请用邮箱验证码登录"))}finally{g(!1)}};return t?(0,s.jsx)("main",{className:"flex min-h-screen items-center justify-center p-4",children:(0,s.jsx)("div",{className:"w-full max-w-md rounded-lg bg-white p-8 text-center text-gray-500 shadow",children:"正在检查登录状态..."})}):(0,s.jsx)("main",{className:"flex min-h-screen items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"w-full max-w-md rounded-lg bg-white p-8 shadow",children:[(0,s.jsx)("h1",{className:"mb-2 text-2xl font-bold",children:"HunterMate 设备授权"}),(0,s.jsxs)("p",{className:"mb-6 text-gray-600",children:["用户码:",(0,s.jsx)("span",{className:"font-mono text-lg font-semibold text-indigo-600",children:e})]}),p?(0,s.jsx)("div",{className:"rounded bg-green-50 p-4 text-green-700",children:"授权成功,可以回到应用继续操作。"}):i.loggedIn?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded bg-indigo-50 p-4 text-sm text-indigo-700",children:["当前已登录:",(0,s.jsx)("span",{className:"font-medium",children:i.email}),"(检测到本机已完成邮箱验证码登录)"]}),x&&(0,s.jsx)("div",{className:"rounded bg-red-50 p-3 text-sm text-red-700",children:x}),(0,s.jsx)("button",{onClick:k,disabled:f,className:"w-full rounded bg-indigo-600 px-4 py-2 font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:f?"处理中...":"确认授权"}),(0,s.jsx)("button",{onClick:()=>d({loggedIn:!1}),className:"w-full text-sm text-gray-400 underline",children:"不是本人?改用邮箱验证码登录"})]}):(0,s.jsxs)("form",{onSubmit:S,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-sm font-medium",children:"邮箱"}),(0,s.jsx)("input",{type:"email",value:o,onChange:e=>l(e.target.value),required:!0,className:"w-full rounded border border-gray-300 p-2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1 block text-sm font-medium",children:"验证码"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",inputMode:"numeric",pattern:"\\d{6}",maxLength:6,value:c,onChange:e=>u(e.target.value),required:!0,placeholder:"6 位数字",className:"w-full rounded border border-gray-300 p-2"}),(0,s.jsx)("button",{type:"button",onClick:w,disabled:f||m>0,className:"shrink-0 rounded border border-indigo-600 px-3 py-2 text-sm text-indigo-600 disabled:border-gray-300 disabled:text-gray-400",children:m>0?"".concat(m,"s 后重发"):"发送验证码"})]})]}),x&&(0,s.jsx)("div",{className:"rounded bg-red-50 p-3 text-sm text-red-700",children:x}),(0,s.jsx)("button",{type:"submit",disabled:f,className:"w-full rounded bg-indigo-600 px-4 py-2 font-medium text-white hover:bg-indigo-700 disabled:opacity-50",children:f?"处理中...":"登录并授权"})]})]})})}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=14116)}),_N_E=e.O()}]);
|
|
@@ -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]="0f346d55-1475-4359-b54c-5173944dcde6",e._sentryDebugIdIdentifier="sentry-dbid-0f346d55-1475-4359-b54c-5173944dcde6")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[964],{41937:function(e,t,s){Promise.resolve().then(s.bind(s,30854))},27473:function(e,t,s){"use strict";var a=s(38321);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}}),s.o(a,"useServerInsertedHTML")&&s.d(t,{useServerInsertedHTML:function(){return a.useServerInsertedHTML}})},30854:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return P}});var a=s(72835),l=s(60635),r=s(27473),n=s(74431),c=s(8448),i=s(94518),o=s(63718);function d(e){var t;let{customer:s}=e,i=(0,r.useRouter)(),[o,d]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[m,p]=(0,l.useState)(new Set),[b,h]=(0,l.useState)(s.id),[g,y]=(0,l.useState)(!1),[f,j]=(0,l.useState)("");(0,l.useEffect)(()=>{let e=!0;return d(null),j(""),(async()=>{try{let t=await (0,n.aA)("/customers/".concat(s.id,"/duplicates"));e&&d(t.candidates)}catch(t){e&&d([])}})(),()=>{e=!1}},[s.id]);let v=async()=>{let e=(null!=o?o:[]).filter(e=>!m.has(e.id)).map(e=>e.id);if(b!==s.id&&e.push(s.id),0===e.length){j("未勾选任何候选参与合并");return}y(!0);let t=!0;for(let s of e)try{await (0,n.aA)("/customers/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:b,removeId:s})})}catch(e){t=!1;break}if(y(!1),!t){j("合并失败,请重试");return}i.replace("/companies?id=".concat(b)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let N=b===s.id?{canonicalName:s.canonicalName,aliases:s.aliases}:o.find(e=>e.id===b),k=o.filter(e=>!m.has(e.id)),w=N?((e,t)=>{var s,a;let l=new Set(null!==(s=e.aliases)&&void 0!==s?s:[]);for(let s of t)if(b!==s.id)for(let t of[s.canonicalName,...null!==(a=s.aliases)&&void 0!==a?a:[]])t&&t!==e.canonicalName&&l.add(t);return Array.from(l)})(N,k):[];return(0,a.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的公司记录"]}),(0,a.jsx)("button",{onClick:()=>u(!0),disabled:g,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),f?(0,a.jsx)("span",{className:"text-sm text-red-600",children:f}):null]}),x?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>u(!1),children:(0,a.jsxs)("div",{className:"flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复公司合并工作区"}),(0,a.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",s.id," \xb7 ",s.canonicalName]}),(0,a.jsx)("button",{onClick:()=>u(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[(0,a.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选(勾选=重复,参与合并;合并后其交付职位与备注重指保留行)"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2 ".concat(b===s.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,a.jsx)("input",{type:"radio",name:"company-keep",checked:b===s.id,onChange:()=>h(s.id),title:"保留这一行"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900",children:s.canonicalName}),(0,a.jsx)("span",{className:"ml-2 rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:"当前行"}),(null===(t=s.aliases)||void 0===t?void 0:t.length)?(0,a.jsxs)("span",{className:"block truncate text-xs text-gray-500",children:["别名:",s.aliases.join("、")]}):null]})]}),o.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border p-2 ".concat(b===e.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,a.jsx)("input",{type:"checkbox",checked:!m.has(e.id),disabled:g,onChange:t=>{p(s=>{let a=new Set(s);return t.target.checked?a.delete(e.id):a.add(e.id),a})},title:"勾选=重复公司,参与合并"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-900",children:["#",e.id," ",e.canonicalName]}),(0,a.jsx)("span",{className:"ml-2 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:e.reason}),1===e.isCustomer?(0,a.jsx)("span",{className:"ml-1 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:"客户"}):null,(0,a.jsxs)("span",{className:"block truncate text-xs text-gray-500",children:[e.jobCaseCount," 个职位案件 \xb7 更新于 ",(0,c.d3)(e.updatedAt),(null===(t=e.aliases)||void 0===t?void 0:t.length)?" \xb7 别名:".concat(e.aliases.join("、")):""]})]}),(0,a.jsx)("input",{type:"radio",name:"company-keep",checked:b===e.id,onChange:()=>h(e.id),title:"保留这一行"})]},e.id)})]}),w.length?(0,a.jsxs)("div",{className:"mt-3 rounded-lg border border-gray-200 bg-gray-50 p-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-gray-500",children:"合并后别名(预览)"}),(0,a.jsx)("div",{className:"mt-1 text-sm text-gray-800",children:w.join("、")})]}):null]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void v(),disabled:g,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:["确认合并(保留 #",b,")"]}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"保留行吸收其余行的别名/档案/联系人;被合并行走墓碑外传删除(云端同步删)"}),f?(0,a.jsx)("span",{className:"text-sm text-red-600",children:f}):null]})]})}):null]})}function x(e){var t;let s=(null===(t=e.aliases)||void 0===t?void 0:t.length)?"(别名:".concat(e.aliases.join("、"),")"):"";return"调研公司「".concat(e.canonicalName,"」").concat(s,"(hunter-mate 公司注册表 ID=").concat(e.id,")。")}function u(e,t){return["调研结果写回(每步一个键,键名用下方约定,值为中文正文、关键名词保留英文):","curl -X PATCH ".concat(e.origin,"/customers/").concat(e.id," \\")," -H 'Content-Type: application/json' \\",' -d \'{"profile":{"'.concat(t,'":{"<步骤键>":"<内容>"}}}\''),"只写你实际完成且确有依据的步骤,不确定的标注「待核实」;不要编造。写回后告知用户更新了哪些步骤。"].join("\n")}let m={bd:{title:"BD 档案(竞对分析)",button:"让 agent 调研(BD)",builder:function(e){return[x(e),"按「公司竞争对手分析与BD分步操作SOP V0.1」(bd-competitor-sop)执行调研,覆盖以下步骤:",...["第一步\xb7公司主体:集团/母公司/子公司/品牌/海外法人关系","第二步\xb7业务与竞争关系:主要产品与服务、目标客户、竞争格局","第三步\xb7近12个月海外发展与投资:新市场、建厂、并购、融资动态","第四步\xb7海外招聘信号:在招岗位、地区、规模与趋势","第五步\xb7岗位映射:海外动作对应的组织能力与关键岗位","第六步\xb7内部人才与案例资产:我司已有人才/案例与之的关联","第七步\xb7BD优先级与打法建议:是否值得跟、从哪切入"].map(e=>"- ".concat(e)),"",u(e,"bd")].join("\n")}},op:{title:"OP 档案(职位操作)",button:"让 agent 调研(OP)",builder:function(e){return[x(e),"按「寻访操作SOP V3.1」(rs-sourcing-sop)的公司调研口径执行,产出服务职位推荐与人才寻访:",...["核心业务:产品/服务是什么、卖给谁、应用场景","规模与业绩:营收/人员规模,当地业务规模","海外布局:开展业务的国家、海外团队规模与管理方式","当前招聘需求与背景:在招什么岗、为什么招","未来战略与规划:用于候选人沟通的 marketing 话术素材","对标公司名单:喜欢挖猎的对标公司,不少于 20 家,按梯队分组(给名单即可,梯队用一/二/三)","公司介绍 Hook:一段话介绍该公司(用于 Connect 模板,可编辑)","当地可挖猎公司名单:该岗位 base 地存在该岗位的公司名单,不低于 20 家"].map(e=>"- ".concat(e)),"",u(e,"op")].join("\n")}}};function p(e){return null==e||""===e?"":"string"==typeof e?e:JSON.stringify(e,null,2)}function b(e){let{customer:t,onSaved:s}=e,[r,c]=(0,l.useState)(!1),[i,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(""),[u,b]=(0,l.useState)(null),[h,g]=(0,l.useState)(""),[y,f]=(0,l.useState)(""),[j,v]=(0,l.useState)(""),[N,k]=(0,l.useState)({bd:[],op:[]}),w=async e=>{x("");let s={id:t.id,canonicalName:t.canonicalName,aliases:t.aliases,origin:window.location.origin};try{await navigator.clipboard.writeText(m[e].builder(s)),b(e),setTimeout(()=>b(null),4e3)}catch(e){var a;x("复制失败:".concat(null!==(a=null==e?void 0:e.message)&&void 0!==a?a:e))}},C=(e,t)=>k(s=>({...s,[e]:t})),S=async()=>{o(!0),x("");let e=e=>{let t={};for(let s of e){let e=s.key.trim();e&&(t[e]=function(e){let t=e.trim();if(!t)return"";try{return JSON.parse(t)}catch(t){return e}}(s.text))}return t};try{await (0,n.aA)("/customers/".concat(t.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h.trim()||void 0,aliases:y.split(/[、,,]/).map(e=>e.trim()).filter(Boolean),notes:j,profile:{bd:e(N.bd),op:e(N.op)}})})}catch(e){o(!1),x("保存失败,请重试");return}o(!1),c(!1),s()};return(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:"公司信息"}),r?null:(0,a.jsx)("button",{type:"button",onClick:()=>{var e,s,a,l;g(t.canonicalName),f((null!==(a=t.aliases)&&void 0!==a?a:[]).join("、")),v(null!==(l=t.notes)&&void 0!==l?l:"");let r=e=>Object.entries(null!=e?e:{}).map(e=>{let[t,s]=e;return{key:t,text:p(s)}});k({bd:r(null===(e=t.profile)||void 0===e?void 0:e.bd),op:r(null===(s=t.profile)||void 0===s?void 0:s.op)}),c(!0),x("")},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"编辑"}),d?(0,a.jsx)("span",{className:"text-xs text-red-600",children:d}):null]}),r?(0,a.jsxs)("div",{className:"mb-3 space-y-2 rounded-lg border border-blue-200 bg-blue-50/50 p-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"公司名称(改名后旧名自动入别名)"}),(0,a.jsx)("input",{value:h,onChange:e=>g(e.target.value),className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"别名(顿号/逗号分隔)"}),(0,a.jsx)("input",{value:y,onChange:e=>f(e.target.value),className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"备注"}),(0,a.jsx)("textarea",{value:j,onChange:e=>v(e.target.value),rows:2,className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]})]}):null,(0,a.jsx)("div",{className:"space-y-3",children:["bd","op"].map(e=>{var s,l;let n=m[e],c=r?N[e]:Object.entries(null!==(l=null===(s=t.profile)||void 0===s?void 0:s[e])&&void 0!==l?l:{}).map(e=>{let[t,s]=e;return{key:t,text:p(s)}});return(0,a.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:n.title}),r?null:(0,a.jsx)("button",{type:"button",onClick:()=>void w(e),className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700 hover:bg-blue-100",children:u===e?"已复制 ✓ 请发给 agent":n.button})]}),0===c.length?(0,a.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:r?"暂无条目,可在下方添加":"尚未调研,点上方「".concat(n.button,"」让 agent 调研")}):(0,a.jsxs)("div",{className:r?"space-y-2 p-3":"divide-y divide-gray-50",children:[c.map((t,s)=>r?(0,a.jsxs)("div",{className:"grid grid-cols-[1fr,2fr,auto] items-start gap-2",children:[(0,a.jsx)("input",{value:t.key,placeholder:"条目名(如:核心业务)",onChange:t=>{let a=[...c];a[s]={...a[s],key:t.target.value},C(e,a)},className:"rounded border border-gray-300 px-2 py-1 text-xs"}),(0,a.jsx)("textarea",{value:t.text,placeholder:"内容(纯文本,或合法 JSON)",rows:3,onChange:t=>{let a=[...c];a[s]={...a[s],text:t.target.value},C(e,a)},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}),(0,a.jsx)("button",{type:"button",onClick:()=>C(e,c.filter((e,t)=>t!==s)),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删"})]},s):(0,a.jsxs)("div",{className:"px-3 py-1.5",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-gray-500",children:t.key}),(0,a.jsx)("div",{className:"whitespace-pre-wrap text-sm text-gray-800",children:t.text||"—"})]},t.key)),r?(0,a.jsx)("button",{type:"button",onClick:()=>C(e,[...c,{key:"",text:""}]),className:"rounded border border-dashed border-gray-300 px-2 py-1 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:"+ 添加条目"}):null]})]},e)})}),r?(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void S(),disabled:i,className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:i?"保存中…":"保存"}),(0,a.jsx)("button",{type:"button",onClick:()=>c(!1),disabled:i,className:"rounded border border-gray-300 px-3 py-1 text-sm text-gray-600 hover:bg-gray-50 disabled:opacity-50",children:"取消"})]}):null]})}var h=s(27828),g=s(26119),y=s(65777),f=s(93464);function j(e){let{sources:t}=e,s=[{on:t.customer,cls:"bg-amber-100 text-amber-700",label:"客户"},{on:t.parsed,cls:"bg-blue-100 text-blue-700",label:"解析"},{on:t.resume,cls:"bg-green-100 text-green-700",label:"简历"},{on:t.hmhLocal,cls:"bg-purple-100 text-purple-700",label:"本地"}];return(0,a.jsx)("span",{className:"inline-flex flex-wrap gap-1",children:s.filter(e=>e.on).map(e=>(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(e.cls),children:e.label},e.label))})}let v=[{key:"customer",label:"客户",cls:"bg-amber-100 text-amber-700"},{key:"parsed",label:"解析",cls:"bg-blue-100 text-blue-700"},{key:"resume",label:"简历",cls:"bg-green-100 text-green-700"},{key:"hmhLocal",label:"本地",cls:"bg-purple-100 text-purple-700"}];function N(){var e,t,s,x,u,m;let p=(0,r.useRouter)(),N=(0,r.useSearchParams)(),k=N.get("id")||"",w=N.get("q")||"",C=(null!==(t=N.get("oc"))&&void 0!==t?t:"1")!=="0",[S,P]=(0,l.useState)(null),[T,A]=(0,l.useState)(!1),[L,O]=(0,l.useState)(!1),[I,D]=(0,l.useState)(0),[U,E]=(0,l.useState)(!1),[_,B]=(0,l.useState)(!1),[J,M]=(0,l.useState)(""),[H,R]=(0,l.useState)(!1),[q,V]=(0,l.useState)("profile"),z=N.get("src")||"",F=(0,l.useMemo)(()=>z.split(",").map(e=>e.trim()).filter(Boolean),[z]),[X,Y]=(0,l.useState)({customer:0,parsed:0,resume:0,hmhLocal:0}),[G,K]=(0,l.useState)(0),{session:Q,sync:W}=(0,y.nu)(),Z=null!==(s=null==W?void 0:W.activeTenantId)&&void 0!==s?s:null,$=(0,g.B)({deleteUrl:"/customers",label:"公司",onDeleted:()=>ee.refresh(),currentUserId:null!==(x=null==Q?void 0:Q.hmUserId)&&void 0!==x?x:null}),ee=(0,f.k)({fetchPage:(0,l.useCallback)(async(e,t)=>{var s,a;let l=new URLSearchParams;w&&l.set("query",w),C&&l.set("onlyCustomers","1"),F.length&&l.set("sources",F.join(",")),l.set("limit",String(t)),l.set("offset",String(e));let r=await (0,n.aA)("/customers/unified?".concat(l.toString()));return Y(null!==(s=r.sourceCounts)&&void 0!==s?s:{customer:0,parsed:0,resume:0,hmhLocal:0}),K(null!==(a=r.customerCount)&&void 0!==a?a:0),{items:r.items,total:r.total}},[w,C,F,Z]),pageSize:50,deps:[w,C,F,Z]}),et=ee.items,es=ee.total,ea=ee.loading;(0,l.useEffect)(()=>{$.prune(et.map(e=>String(e.id)))},[et,$]);let el=(0,l.useCallback)(e=>{var t,s,a;let l=new URLSearchParams(N.toString());void 0!==e.id&&(e.id?l.set("id",e.id):l.delete("id"));let r=null!==(t=e.q)&&void 0!==t?t:w;r?l.set("q",r):l.delete("q"),(null!==(s=e.oc)&&void 0!==s?s:C)?l.delete("oc"):l.set("oc","0");let n=null!==(a=e.src)&&void 0!==a?a:F;n.length?l.set("src",n.join(",")):l.delete("src"),p.replace("/companies?".concat(l.toString()))},[p,N,w,C,F]);(0,l.useEffect)(()=>{V("profile")},[k]);let er=(0,l.useCallback)(async()=>{if(k)try{let e=await (0,n.aA)("/customers/".concat(k,"/related"));P(e),O(!1)}catch(e){P(null),O(!0)}},[k]);(0,l.useEffect)(()=>{if(!k){P(null),O(!1);return}A(!0),er().then(()=>A(!1))},[k,er,I]);let en=(0,l.useCallback)(async()=>{let e=null==S?void 0:S.companyProfile;if(null==e?void 0:e.sourceUrl){M("重新适配中…(浏览器编排重跑,稍候)");try{await (0,n.aA)("/extract/adapter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.sourceUrl})}),M("已重新适配并入库 ✓"),await er()}catch(e){M("重新适配失败(需扩展在线且页面可访问),请重试")}setTimeout(()=>M(""),6e3)}},[null==S?void 0:S.companyProfile,er]),ec=(0,l.useCallback)(async()=>{let e=null==S?void 0:S.companyProfile;if(e){M("");try{let t=await fetch("".concat((0,n.Ox)(),"/entities/company/").concat(e.id,"/repair-prompt"));if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json();await navigator.clipboard.writeText(s.prompt),R(!0),setTimeout(()=>R(!1),4e3)}catch(e){var t;M("复制失败:".concat(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:e))}}},[null==S?void 0:S.companyProfile]),ei=(0,l.useCallback)(async(e,t)=>{E(!0),B(!1);try{await (0,n.aA)("/customers/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({isCustomer:t?1:0})})}catch(e){E(!1),B(!0);return}ee.refresh(),await er(),E(!1)},[ee,er]),eo=(0,l.useMemo)(()=>et.map(e=>({id:String(e.id),content:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[$.checkbox(String(e.id)),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.canonicalName}),e.activeJobCount>0?(0,a.jsxs)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:["交付中 ",e.activeJobCount]}):null]}),(0,a.jsx)("div",{className:"mt-0.5",children:(0,a.jsx)(j,{sources:e.sources})}),(0,a.jsxs)("div",{className:"mt-0.5 text-xs text-gray-400",children:[e.jobCaseCount>0?"".concat(e.jobCaseCount," 个职位案件 \xb7 "):"","更新于 ",(0,c.d3)(e.updatedAt)]})]})]})})),[et,$]),ed=k?T?(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):L?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,a.jsx)("button",{type:"button",onClick:()=>D(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):S?(0,a.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:S.customer.canonicalName}),(0,a.jsx)(j,{sources:null!==(u=S.customer.sources)&&void 0!==u?u:{customer:1===S.customer.isCustomer,parsed:!1,resume:!1,hmhLocal:!1}}),(0,a.jsx)("button",{type:"button",disabled:U,onClick:()=>void ei(S.customer.id,1!==S.customer.isCustomer),className:"rounded px-2 py-1 text-xs ".concat(1===S.customer.isCustomer?"bg-amber-100 text-amber-700 hover:bg-amber-200":"bg-gray-100 text-gray-600 hover:bg-gray-200"," disabled:opacity-50"),children:1===S.customer.isCustomer?"✓ 我服务的客户(点击取消)":"标注为我服务的客户"})]}),_?(0,a.jsx)("div",{className:"mb-2 text-xs text-red-500",children:"标注失败,请重试"}):null,(null===(e=S.customer.aliases)||void 0===e?void 0:e.length)?(0,a.jsxs)("div",{className:"mb-2 text-xs text-gray-500",children:["别名:",S.customer.aliases.join("、")]}):null,(0,a.jsxs)("div",{className:"mb-4 text-xs text-gray-400",children:["更新于 ",(0,c.d3)(S.customer.updatedAt)]}),S.customer.notes?(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"mb-1 text-sm font-medium text-gray-800",children:"备注"}),(0,a.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:S.customer.notes})]}):null,(0,a.jsx)(d,{customer:{id:S.customer.id,canonicalName:S.customer.canonicalName,aliases:S.customer.aliases}}),S.companyProfile?(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2",children:[(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["解析档案:(",S.companyProfile.source,") ",null!==(m=S.companyProfile.name)&&void 0!==m?m:""," \xb7 更新于"," ",(0,c.d3)(S.companyProfile.updatedAt)]}),(0,a.jsx)("button",{type:"button",onClick:()=>void en(),className:"rounded border border-gray-300 bg-white px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-100",children:"重新适配"}),(0,a.jsx)("button",{type:"button",onClick:()=>void ec(),className:"rounded border border-gray-300 bg-white px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-100",children:H?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),J?(0,a.jsx)("span",{className:"text-xs text-gray-600",children:J}):null]}):null,(0,a.jsx)("div",{className:"mb-2 flex flex-wrap gap-1 border-b border-gray-200",children:[{key:"profile",label:"公司信息"},{key:"jobCases",label:"关联交付职位(".concat(S.jobCases.length,")")},{key:"jobPostings",label:"招聘网站解析职位(".concat(S.jobPostings.length,")")},{key:"talents",label:"相关简历(".concat(S.talents.length,")")},{key:"parseLogs",label:"录制解析(".concat(S.parseLogs.length,")")}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>V(e.key),className:"rounded-t px-3 py-1.5 text-sm ".concat(q===e.key?"border-b-2 border-blue-500 font-medium text-blue-600":"text-gray-500 hover:text-gray-700"),children:e.label},e.key))}),"profile"===q?(0,a.jsx)(b,{customer:S.customer,onSaved:()=>void er()}):null,"jobCases"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.jobCases.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无交付职位"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.jobCases.map(e=>{var t;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:"/jobs?id=".concat(e.id),className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm hover:border-blue-300",children:(0,a.jsx)(h.dy,{title:function(e){var t,s;let a;let l=(null!==(t=e.folderPath)&&void 0!==t?t:"").split("/").filter(Boolean).filter(e=>!["job","jd","raw"].includes(e));return(a=e.title)&&!["job","jd","raw"].includes(a)?e.title:null!==(s=l.at(-1))&&void 0!==s?s:"案件 #".concat(e.id)}(e),status:e.status,hmhLocal:(null!==(t=e.folderPath)&&void 0!==t?t:"").includes("/local/clients/"),time:e.updatedAt})})},e.id)})})}):null,"jobPostings"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.jobPostings.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无解析职位"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.jobPostings.map(e=>{var t;return(0,a.jsx)("li",{className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm",children:(0,a.jsx)(h.rY,{title:null!==(t=e.title)&&void 0!==t?t:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt})},e.id)})})}):null,"talents"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.talents.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无相关简历"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.talents.map(e=>{var t;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:"/talents?id=".concat(e.id),className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm hover:border-blue-300",children:(0,a.jsx)(h.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(简历 #".concat(e.id,")"),headline:e.headline,updatedAt:e.updatedAt})})},e.id)})})}):null,"parseLogs"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.parseLogs.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无解析记录(该公司尚未从网页解析入库)"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.parseLogs.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm",children:[(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat("ok"===e.status?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-500"),children:e.status}),e.hasSnapshot?(0,a.jsx)("span",{className:"rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有快照"}):null,e.adapterVersion?(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["adapter ",e.adapterVersion]}):null,(0,a.jsxs)("span",{className:"truncate text-xs text-gray-500",title:e.sourceUrl,children:[e.domain," \xb7 session ",e.sessionId]}),(0,a.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"ml-auto shrink-0 text-xs text-blue-500 hover:underline",children:"来源"}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-gray-400",children:(0,c.d3)(e.createdAt)})]},e.id))})}):null]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该公司"}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"请在左侧选择一家公司查看详情(客户、职位与备注)"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.m,{filterBar:(0,a.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,a.jsx)("input",{type:"text",value:w,onChange:e=>el({q:e.target.value}),placeholder:"搜索公司名/别名…",className:"w-full rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-gray-600 hover:text-gray-800",children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>el({oc:e.target.checked}),className:"accent-amber-600"}),"只看我服务的客户",(0,a.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-amber-700",children:G})]}),(0,a.jsx)("span",{className:"text-gray-300",children:"|"}),(0,a.jsx)("span",{className:"text-gray-400",children:"来源:"}),v.map(e=>{let t=F.includes(e.key);return(0,a.jsxs)("button",{type:"button",title:t?"点击取消该来源筛选":"点击按该来源过滤(可多选,同时命中)",onClick:()=>el({src:t?F.filter(t=>t!==e.key):[...F,e.key]}),className:"rounded px-1.5 py-0.5 text-xs transition ".concat(t?"".concat(e.cls," ring-1 ring-current"):"".concat(e.cls," opacity-40 hover:opacity-80")),children:[e.label," ",X[e.key]]},e.key)}),F.length?(0,a.jsx)("button",{type:"button",onClick:()=>el({src:[]}),className:"text-xs text-gray-400 hover:text-gray-600",children:"清除来源筛选"}):null,(0,a.jsxs)("span",{className:"ml-auto text-gray-400",children:["共 ",es," 家"]})]}),$.bar(eo)]}),listPanel:ee.error?(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,a.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,a.jsx)("button",{type:"button",onClick:()=>ee.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,a.jsx)(o.L,{items:eo,selectedId:k,onSelect:e=>el({id:e}),loading:ea,emptyText:C?"暂无符合筛选条件的客户(取消勾选或清除来源筛选可浏览全部)":"暂无公司数据",onLoadMore:ee.loadMore,loadingMore:ee.loadingMore,exhausted:ee.exhausted}),detailPanel:ed}),$.modal()]})}function k(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,a.jsx)(N,{})})}var w=s(49616);function C(){var e,t;let[s,r]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[m,p]=(0,l.useState)([]),[b,h]=(0,l.useState)(0),[g,f]=(0,l.useState)(!1),[j,v]=(0,l.useState)(null),[N,k]=(0,l.useState)(null),[C,S]=(0,l.useState)(null),{sync:P}=(0,y.nu)(),T=null!==(e=null==P?void 0:P.activeTenantId)&&void 0!==e?e:null,A=(0,l.useCallback)(async()=>{f(!0);let e=new URLSearchParams;c&&e.set("q",c),x&&e.set("touched",x),e.set("limit","200");try{let t=await (0,n.aA)("/market/companies?".concat(e.toString()));v(null),p(t.items),h(t.total)}catch(e){v("加载失败")}finally{f(!1)}},[c,x,T]);(0,l.useEffect)(()=>{let e=setTimeout(()=>d(s.trim()),300);return()=>clearTimeout(e)},[s]),(0,l.useEffect)(()=>{A()},[A]),(0,l.useEffect)(()=>{S(null),null!=N&&(0,n.aA)("/market/companies/".concat(N)).then(S).catch(()=>{})},[N,T]);let L=(0,l.useMemo)(()=>m.map(e=>({id:String(e.id),content:(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"truncate font-medium text-gray-900",children:e.name}),e.touched?(0,a.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] text-emerald-700",children:"已操作"}):null]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-0.5",children:[e.platforms.length?e.platforms.map(e=>(0,a.jsx)(w.v,{platform:e},e)):(0,a.jsx)("span",{className:"text-[10px] text-gray-300",children:"无职位发布数据"}),(0,a.jsxs)("span",{className:"ml-1 text-[10px] text-gray-400",children:["在招 ",e.postingsCount," \xb7 ",e.source]})]})]})})),[m]);return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-amber-200 bg-[color:var(--brand-soft)] px-3 py-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-[color:var(--brand-strong)]",children:"\uD83E\uDDED 市场公司(BD 视角:目标/对手公司在各平台的发布与操作痕迹)"}),(0,a.jsx)("span",{className:"ml-auto text-[10px] text-gray-400",children:"下方统一列表 = 客户/解析来源维度"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1",children:(0,a.jsx)(i.m,{filterBar:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-200 bg-white p-3",children:[(0,a.jsx)("input",{type:"text",value:s,onChange:e=>r(e.target.value),placeholder:"搜索公司名…",className:"w-56 rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),["","1","0"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>u(e),className:"rounded px-2 py-1 text-xs ".concat(x===e?"bg-[color:var(--brand-soft)] font-medium text-[color:var(--brand-strong)]":"text-gray-500 hover:bg-gray-100"),children:""===e?"全部":"1"===e?"已操作过":"未操作"},e)),(0,a.jsxs)("span",{className:"ml-auto text-xs text-gray-400",children:["共 ",b," 家"]})]}),listPanel:j?(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,a.jsx)("span",{className:"text-red-500",children:j}),(0,a.jsx)("button",{type:"button",onClick:()=>void A(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,a.jsx)(o.L,{items:L,selectedId:null!=N?String(N):void 0,onSelect:e=>k(Number(e)),loading:g,emptyText:"暂无市场公司数据"}),detailPanel:N?C?(0,a.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,a.jsx)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:null!==(t=C.profile.name)&&void 0!==t?t:"(未命名)"}),(0,a.jsx)("a",{href:C.profile.sourceUrl,target:"_blank",rel:"noreferrer",className:"mb-4 block truncate text-xs text-blue-600 hover:underline",children:C.profile.sourceUrl}),(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:["在招职位(",C.postings.length,")"]}),0===C.postings.length?(0,a.jsx)("div",{className:"text-xs text-gray-400",children:"名下暂无职位发布(解析库 company 字段归一后自动出现)"}):(0,a.jsx)("div",{className:"space-y-1",children:C.postings.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded border border-gray-100 px-2 py-1.5 text-sm",children:[(0,a.jsx)(w.v,{platform:e.source}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:null!==(t=e.title)&&void 0!==t?t:"(无标题)"}),(0,a.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"打开"})]},e.id)})})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:["对手公司(同类型在招,",C.peers.length,")"]}),0===C.peers.length?(0,a.jsx)("div",{className:"text-xs text-gray-400",children:"暂无(需要职位标题数据支撑;解析质量修复后自动点亮)"}):(0,a.jsx)("div",{className:"space-y-1",children:C.peers.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>k(e.id),className:"flex w-full items-center gap-2 rounded border border-gray-100 px-2 py-1.5 text-left text-sm hover:bg-amber-50",children:[(0,a.jsx)("span",{className:"flex-1 truncate",children:e.name}),(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["在招 ",e.postingsCount]})]},e.id))})]})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"选择左侧公司查看发布与对手"})})})]})}var S=s(88801);function P(){return"bd"===(0,S.mJ)()?(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsx)("div",{className:"min-h-0 flex-[2] border-b border-gray-200",children:(0,a.jsx)(C,{})}),(0,a.jsx)("div",{className:"min-h-0 flex-[3] overflow-auto",children:(0,a.jsx)(k,{})})]}):(0,a.jsx)(k,{})}}},function(e){e.O(0,[253,686,400,935,744],function(){return e(e.s=41937)}),_N_E=e.O()}]);
|
|
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]="06b28695-d770-4f29-8822-f0b472a58a5e",e._sentryDebugIdIdentifier="sentry-dbid-06b28695-d770-4f29-8822-f0b472a58a5e")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[964],{41937:function(e,t,s){Promise.resolve().then(s.bind(s,30854))},27473:function(e,t,s){"use strict";var a=s(38321);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}}),s.o(a,"useServerInsertedHTML")&&s.d(t,{useServerInsertedHTML:function(){return a.useServerInsertedHTML}})},30854:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return P}});var a=s(72835),l=s(60635),r=s(27473),n=s(74431),c=s(8448),i=s(94518),o=s(63718);function d(e){var t;let{customer:s}=e,i=(0,r.useRouter)(),[o,d]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[m,p]=(0,l.useState)(new Set),[b,h]=(0,l.useState)(s.id),[g,y]=(0,l.useState)(!1),[f,j]=(0,l.useState)("");(0,l.useEffect)(()=>{let e=!0;return d(null),j(""),(async()=>{try{let t=await (0,n.aA)("/customers/".concat(s.id,"/duplicates"));e&&d(t.candidates)}catch(t){e&&d([])}})(),()=>{e=!1}},[s.id]);let v=async()=>{let e=(null!=o?o:[]).filter(e=>!m.has(e.id)).map(e=>e.id);if(b!==s.id&&e.push(s.id),0===e.length){j("未勾选任何候选参与合并");return}y(!0);let t=!0;for(let s of e)try{await (0,n.aA)("/customers/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:b,removeId:s})})}catch(e){t=!1;break}if(y(!1),!t){j("合并失败,请重试");return}i.replace("/companies?id=".concat(b)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let N=b===s.id?{canonicalName:s.canonicalName,aliases:s.aliases}:o.find(e=>e.id===b),k=o.filter(e=>!m.has(e.id)),w=N?((e,t)=>{var s,a;let l=new Set(null!==(s=e.aliases)&&void 0!==s?s:[]);for(let s of t)if(b!==s.id)for(let t of[s.canonicalName,...null!==(a=s.aliases)&&void 0!==a?a:[]])t&&t!==e.canonicalName&&l.add(t);return Array.from(l)})(N,k):[];return(0,a.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的公司记录"]}),(0,a.jsx)("button",{onClick:()=>u(!0),disabled:g,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),f?(0,a.jsx)("span",{className:"text-sm text-red-600",children:f}):null]}),x?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>u(!1),children:(0,a.jsxs)("div",{className:"flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复公司合并工作区"}),(0,a.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",s.id," \xb7 ",s.canonicalName]}),(0,a.jsx)("button",{onClick:()=>u(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:[(0,a.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选(勾选=重复,参与合并;合并后其交付职位与备注重指保留行)"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-lg border p-2 ".concat(b===s.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,a.jsx)("input",{type:"radio",name:"company-keep",checked:b===s.id,onChange:()=>h(s.id),title:"保留这一行"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900",children:s.canonicalName}),(0,a.jsx)("span",{className:"ml-2 rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:"当前行"}),(null===(t=s.aliases)||void 0===t?void 0:t.length)?(0,a.jsxs)("span",{className:"block truncate text-xs text-gray-500",children:["别名:",s.aliases.join("、")]}):null]})]}),o.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border p-2 ".concat(b===e.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,a.jsx)("input",{type:"checkbox",checked:!m.has(e.id),disabled:g,onChange:t=>{p(s=>{let a=new Set(s);return t.target.checked?a.delete(e.id):a.add(e.id),a})},title:"勾选=重复公司,参与合并"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-900",children:["#",e.id," ",e.canonicalName]}),(0,a.jsx)("span",{className:"ml-2 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:e.reason}),1===e.isCustomer?(0,a.jsx)("span",{className:"ml-1 rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:"客户"}):null,(0,a.jsxs)("span",{className:"block truncate text-xs text-gray-500",children:[e.jobCaseCount," 个职位案件 \xb7 更新于 ",(0,c.d3)(e.updatedAt),(null===(t=e.aliases)||void 0===t?void 0:t.length)?" \xb7 别名:".concat(e.aliases.join("、")):""]})]}),(0,a.jsx)("input",{type:"radio",name:"company-keep",checked:b===e.id,onChange:()=>h(e.id),title:"保留这一行"})]},e.id)})]}),w.length?(0,a.jsxs)("div",{className:"mt-3 rounded-lg border border-gray-200 bg-gray-50 p-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-gray-500",children:"合并后别名(预览)"}),(0,a.jsx)("div",{className:"mt-1 text-sm text-gray-800",children:w.join("、")})]}):null]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void v(),disabled:g,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:["确认合并(保留 #",b,")"]}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"保留行吸收其余行的别名/档案/联系人;被合并行走墓碑外传删除(云端同步删)"}),f?(0,a.jsx)("span",{className:"text-sm text-red-600",children:f}):null]})]})}):null]})}function x(e){var t;let s=(null===(t=e.aliases)||void 0===t?void 0:t.length)?"(别名:".concat(e.aliases.join("、"),")"):"";return"调研公司「".concat(e.canonicalName,"」").concat(s,"(hunter-mate 公司注册表 ID=").concat(e.id,")。")}function u(e,t){return["调研结果写回(每步一个键,键名用下方约定,值为中文正文、关键名词保留英文):","curl -X PATCH ".concat(e.origin,"/customers/").concat(e.id," \\")," -H 'Content-Type: application/json' \\",' -d \'{"profile":{"'.concat(t,'":{"<步骤键>":"<内容>"}}}\''),"只写你实际完成且确有依据的步骤,不确定的标注「待核实」;不要编造。写回后告知用户更新了哪些步骤。"].join("\n")}let m={bd:{title:"BD 档案(竞对分析)",button:"让 agent 调研(BD)",builder:function(e){return[x(e),"按「公司竞争对手分析与BD分步操作SOP V0.1」(bd-competitor-sop)执行调研,覆盖以下步骤:",...["第一步\xb7公司主体:集团/母公司/子公司/品牌/海外法人关系","第二步\xb7业务与竞争关系:主要产品与服务、目标客户、竞争格局","第三步\xb7近12个月海外发展与投资:新市场、建厂、并购、融资动态","第四步\xb7海外招聘信号:在招岗位、地区、规模与趋势","第五步\xb7岗位映射:海外动作对应的组织能力与关键岗位","第六步\xb7内部人才与案例资产:我司已有人才/案例与之的关联","第七步\xb7BD优先级与打法建议:是否值得跟、从哪切入"].map(e=>"- ".concat(e)),"",u(e,"bd")].join("\n")}},op:{title:"OP 档案(职位操作)",button:"让 agent 调研(OP)",builder:function(e){return[x(e),"按「寻访操作SOP V3.1」(rs-sourcing-sop)的公司调研口径执行,产出服务职位推荐与人才寻访:",...["核心业务:产品/服务是什么、卖给谁、应用场景","规模与业绩:营收/人员规模,当地业务规模","海外布局:开展业务的国家、海外团队规模与管理方式","当前招聘需求与背景:在招什么岗、为什么招","未来战略与规划:用于候选人沟通的 marketing 话术素材","对标公司名单:喜欢挖猎的对标公司,不少于 20 家,按梯队分组(给名单即可,梯队用一/二/三)","公司介绍 Hook:一段话介绍该公司(用于 Connect 模板,可编辑)","当地可挖猎公司名单:该岗位 base 地存在该岗位的公司名单,不低于 20 家"].map(e=>"- ".concat(e)),"",u(e,"op")].join("\n")}}};function p(e){return null==e||""===e?"":"string"==typeof e?e:JSON.stringify(e,null,2)}function b(e){let{customer:t,onSaved:s}=e,[r,c]=(0,l.useState)(!1),[i,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(""),[u,b]=(0,l.useState)(null),[h,g]=(0,l.useState)(""),[y,f]=(0,l.useState)(""),[j,v]=(0,l.useState)(""),[N,k]=(0,l.useState)({bd:[],op:[]}),w=async e=>{x("");let s={id:t.id,canonicalName:t.canonicalName,aliases:t.aliases,origin:window.location.origin};try{await navigator.clipboard.writeText(m[e].builder(s)),b(e),setTimeout(()=>b(null),4e3)}catch(e){var a;x("复制失败:".concat(null!==(a=null==e?void 0:e.message)&&void 0!==a?a:e))}},C=(e,t)=>k(s=>({...s,[e]:t})),S=async()=>{o(!0),x("");let e=e=>{let t={};for(let s of e){let e=s.key.trim();e&&(t[e]=function(e){let t=e.trim();if(!t)return"";try{return JSON.parse(t)}catch(t){return e}}(s.text))}return t};try{await (0,n.aA)("/customers/".concat(t.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h.trim()||void 0,aliases:y.split(/[、,,]/).map(e=>e.trim()).filter(Boolean),notes:j,profile:{bd:e(N.bd),op:e(N.op)}})})}catch(e){o(!1),x("保存失败,请重试");return}o(!1),c(!1),s()};return(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:"公司信息"}),r?null:(0,a.jsx)("button",{type:"button",onClick:()=>{var e,s,a,l;g(t.canonicalName),f((null!==(a=t.aliases)&&void 0!==a?a:[]).join("、")),v(null!==(l=t.notes)&&void 0!==l?l:"");let r=e=>Object.entries(null!=e?e:{}).map(e=>{let[t,s]=e;return{key:t,text:p(s)}});k({bd:r(null===(e=t.profile)||void 0===e?void 0:e.bd),op:r(null===(s=t.profile)||void 0===s?void 0:s.op)}),c(!0),x("")},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"编辑"}),d?(0,a.jsx)("span",{className:"text-xs text-red-600",children:d}):null]}),r?(0,a.jsxs)("div",{className:"mb-3 space-y-2 rounded-lg border border-blue-200 bg-blue-50/50 p-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"公司名称(改名后旧名自动入别名)"}),(0,a.jsx)("input",{value:h,onChange:e=>g(e.target.value),className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"别名(顿号/逗号分隔)"}),(0,a.jsx)("input",{value:y,onChange:e=>f(e.target.value),className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"备注"}),(0,a.jsx)("textarea",{value:j,onChange:e=>v(e.target.value),rows:2,className:"mt-0.5 w-full rounded border border-gray-300 px-2 py-1 text-sm"})]})]}):null,(0,a.jsx)("div",{className:"space-y-3",children:["bd","op"].map(e=>{var s,l;let n=m[e],c=r?N[e]:Object.entries(null!==(l=null===(s=t.profile)||void 0===s?void 0:s[e])&&void 0!==l?l:{}).map(e=>{let[t,s]=e;return{key:t,text:p(s)}});return(0,a.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:n.title}),r?null:(0,a.jsx)("button",{type:"button",onClick:()=>void w(e),className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700 hover:bg-blue-100",children:u===e?"已复制 ✓ 请发给 agent":n.button})]}),0===c.length?(0,a.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:r?"暂无条目,可在下方添加":"尚未调研,点上方「".concat(n.button,"」让 agent 调研")}):(0,a.jsxs)("div",{className:r?"space-y-2 p-3":"divide-y divide-gray-50",children:[c.map((t,s)=>r?(0,a.jsxs)("div",{className:"grid grid-cols-[1fr,2fr,auto] items-start gap-2",children:[(0,a.jsx)("input",{value:t.key,placeholder:"条目名(如:核心业务)",onChange:t=>{let a=[...c];a[s]={...a[s],key:t.target.value},C(e,a)},className:"rounded border border-gray-300 px-2 py-1 text-xs"}),(0,a.jsx)("textarea",{value:t.text,placeholder:"内容(纯文本,或合法 JSON)",rows:3,onChange:t=>{let a=[...c];a[s]={...a[s],text:t.target.value},C(e,a)},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}),(0,a.jsx)("button",{type:"button",onClick:()=>C(e,c.filter((e,t)=>t!==s)),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删"})]},s):(0,a.jsxs)("div",{className:"px-3 py-1.5",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-gray-500",children:t.key}),(0,a.jsx)("div",{className:"whitespace-pre-wrap text-sm text-gray-800",children:t.text||"—"})]},t.key)),r?(0,a.jsx)("button",{type:"button",onClick:()=>C(e,[...c,{key:"",text:""}]),className:"rounded border border-dashed border-gray-300 px-2 py-1 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:"+ 添加条目"}):null]})]},e)})}),r?(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void S(),disabled:i,className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:i?"保存中…":"保存"}),(0,a.jsx)("button",{type:"button",onClick:()=>c(!1),disabled:i,className:"rounded border border-gray-300 px-3 py-1 text-sm text-gray-600 hover:bg-gray-50 disabled:opacity-50",children:"取消"})]}):null]})}var h=s(27828),g=s(26119),y=s(65777),f=s(93464);function j(e){let{sources:t}=e,s=[{on:t.customer,cls:"bg-amber-100 text-amber-700",label:"客户"},{on:t.parsed,cls:"bg-blue-100 text-blue-700",label:"解析"},{on:t.resume,cls:"bg-green-100 text-green-700",label:"简历"},{on:t.hmhLocal,cls:"bg-purple-100 text-purple-700",label:"本地"}];return(0,a.jsx)("span",{className:"inline-flex flex-wrap gap-1",children:s.filter(e=>e.on).map(e=>(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(e.cls),children:e.label},e.label))})}let v=[{key:"customer",label:"客户",cls:"bg-amber-100 text-amber-700"},{key:"parsed",label:"解析",cls:"bg-blue-100 text-blue-700"},{key:"resume",label:"简历",cls:"bg-green-100 text-green-700"},{key:"hmhLocal",label:"本地",cls:"bg-purple-100 text-purple-700"}];function N(){var e,t,s,x,u,m;let p=(0,r.useRouter)(),N=(0,r.useSearchParams)(),k=N.get("id")||"",w=N.get("q")||"",C=(null!==(t=N.get("oc"))&&void 0!==t?t:"1")!=="0",[S,P]=(0,l.useState)(null),[T,A]=(0,l.useState)(!1),[L,O]=(0,l.useState)(!1),[I,D]=(0,l.useState)(0),[U,E]=(0,l.useState)(!1),[_,B]=(0,l.useState)(!1),[J,M]=(0,l.useState)(""),[H,R]=(0,l.useState)(!1),[q,V]=(0,l.useState)("profile"),z=N.get("src")||"",F=(0,l.useMemo)(()=>z.split(",").map(e=>e.trim()).filter(Boolean),[z]),[X,Y]=(0,l.useState)({customer:0,parsed:0,resume:0,hmhLocal:0}),[G,K]=(0,l.useState)(0),{session:Q,sync:W}=(0,y.nu)(),Z=null!==(s=null==W?void 0:W.activeTenantId)&&void 0!==s?s:null,$=(0,g.B)({deleteUrl:"/customers",label:"公司",onDeleted:()=>ee.refresh(),currentUserId:null!==(x=null==Q?void 0:Q.hmUserId)&&void 0!==x?x:null}),ee=(0,f.k)({fetchPage:(0,l.useCallback)(async(e,t)=>{var s,a;let l=new URLSearchParams;w&&l.set("query",w),C&&l.set("onlyCustomers","1"),F.length&&l.set("sources",F.join(",")),l.set("limit",String(t)),l.set("offset",String(e));let r=await (0,n.aA)("/customers/unified?".concat(l.toString()));return Y(null!==(s=r.sourceCounts)&&void 0!==s?s:{customer:0,parsed:0,resume:0,hmhLocal:0}),K(null!==(a=r.customerCount)&&void 0!==a?a:0),{items:r.items,total:r.total}},[w,C,F,Z]),pageSize:50,deps:[w,C,F,Z]}),et=ee.items,es=ee.total,ea=ee.loading;(0,l.useEffect)(()=>{$.prune(et.map(e=>String(e.id)))},[et,$]);let el=(0,l.useCallback)(e=>{var t,s,a;let l=new URLSearchParams(N.toString());void 0!==e.id&&(e.id?l.set("id",e.id):l.delete("id"));let r=null!==(t=e.q)&&void 0!==t?t:w;r?l.set("q",r):l.delete("q"),(null!==(s=e.oc)&&void 0!==s?s:C)?l.delete("oc"):l.set("oc","0");let n=null!==(a=e.src)&&void 0!==a?a:F;n.length?l.set("src",n.join(",")):l.delete("src"),p.replace("/companies?".concat(l.toString()))},[p,N,w,C,F]);(0,l.useEffect)(()=>{V("profile")},[k]);let er=(0,l.useCallback)(async()=>{if(k)try{let e=await (0,n.aA)("/customers/".concat(k,"/related"));P(e),O(!1)}catch(e){P(null),O(!0)}},[k]);(0,l.useEffect)(()=>{if(!k){P(null),O(!1);return}A(!0),er().then(()=>A(!1))},[k,er,I]);let en=(0,l.useCallback)(async()=>{let e=null==S?void 0:S.companyProfile;if(null==e?void 0:e.sourceUrl){M("重新适配中…(浏览器编排重跑,稍候)");try{await (0,n.aA)("/extract/adapter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.sourceUrl})}),M("已重新适配并入库 ✓"),await er()}catch(e){M("重新适配失败(需扩展在线且页面可访问),请重试")}setTimeout(()=>M(""),6e3)}},[null==S?void 0:S.companyProfile,er]),ec=(0,l.useCallback)(async()=>{let e=null==S?void 0:S.companyProfile;if(e){M("");try{let t=await fetch("".concat((0,n.Ox)(),"/entities/company/").concat(e.id,"/repair-prompt"));if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json();await navigator.clipboard.writeText(s.prompt),R(!0),setTimeout(()=>R(!1),4e3)}catch(e){var t;M("复制失败:".concat(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:e))}}},[null==S?void 0:S.companyProfile]),ei=(0,l.useCallback)(async(e,t)=>{E(!0),B(!1);try{await (0,n.aA)("/customers/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({isCustomer:t?1:0})})}catch(e){E(!1),B(!0);return}ee.refresh(),await er(),E(!1)},[ee,er]),eo=(0,l.useMemo)(()=>et.map(e=>({id:String(e.id),content:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[$.checkbox(String(e.id)),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.canonicalName}),e.activeJobCount>0?(0,a.jsxs)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:["交付中 ",e.activeJobCount]}):null]}),(0,a.jsx)("div",{className:"mt-0.5",children:(0,a.jsx)(j,{sources:e.sources})}),(0,a.jsxs)("div",{className:"mt-0.5 text-xs text-gray-400",children:[e.jobCaseCount>0?"".concat(e.jobCaseCount," 个职位案件 \xb7 "):"","更新于 ",(0,c.d3)(e.updatedAt)]})]})]})})),[et,$]),ed=k?T?(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):L?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,a.jsx)("button",{type:"button",onClick:()=>D(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):S?(0,a.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:S.customer.canonicalName}),(0,a.jsx)(j,{sources:null!==(u=S.customer.sources)&&void 0!==u?u:{customer:1===S.customer.isCustomer,parsed:!1,resume:!1,hmhLocal:!1}}),(0,a.jsx)("button",{type:"button",disabled:U,onClick:()=>void ei(S.customer.id,1!==S.customer.isCustomer),className:"rounded px-2 py-1 text-xs ".concat(1===S.customer.isCustomer?"bg-amber-100 text-amber-700 hover:bg-amber-200":"bg-gray-100 text-gray-600 hover:bg-gray-200"," disabled:opacity-50"),children:1===S.customer.isCustomer?"✓ 我服务的客户(点击取消)":"标注为我服务的客户"})]}),_?(0,a.jsx)("div",{className:"mb-2 text-xs text-red-500",children:"标注失败,请重试"}):null,(null===(e=S.customer.aliases)||void 0===e?void 0:e.length)?(0,a.jsxs)("div",{className:"mb-2 text-xs text-gray-500",children:["别名:",S.customer.aliases.join("、")]}):null,(0,a.jsxs)("div",{className:"mb-4 text-xs text-gray-400",children:["更新于 ",(0,c.d3)(S.customer.updatedAt)]}),S.customer.notes?(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsx)("h3",{className:"mb-1 text-sm font-medium text-gray-800",children:"备注"}),(0,a.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:S.customer.notes})]}):null,(0,a.jsx)(d,{customer:{id:S.customer.id,canonicalName:S.customer.canonicalName,aliases:S.customer.aliases}}),S.companyProfile?(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2",children:[(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["解析档案:(",S.companyProfile.source,") ",null!==(m=S.companyProfile.name)&&void 0!==m?m:""," \xb7 更新于"," ",(0,c.d3)(S.companyProfile.updatedAt)]}),(0,a.jsx)("button",{type:"button",onClick:()=>void en(),className:"rounded border border-gray-300 bg-white px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-100",children:"重新适配"}),(0,a.jsx)("button",{type:"button",onClick:()=>void ec(),className:"rounded border border-gray-300 bg-white px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-100",children:H?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),J?(0,a.jsx)("span",{className:"text-xs text-gray-600",children:J}):null]}):null,(0,a.jsx)("div",{className:"mb-2 flex flex-wrap gap-1 border-b border-gray-200",children:[{key:"profile",label:"公司信息"},{key:"jobCases",label:"关联交付职位(".concat(S.jobCases.length,")")},{key:"jobPostings",label:"招聘网站解析职位(".concat(S.jobPostings.length,")")},{key:"talents",label:"相关简历(".concat(S.talents.length,")")},{key:"parseLogs",label:"录制解析(".concat(S.parseLogs.length,")")}].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>V(e.key),className:"rounded-t px-3 py-1.5 text-sm ".concat(q===e.key?"border-b-2 border-blue-500 font-medium text-blue-600":"text-gray-500 hover:text-gray-700"),children:e.label},e.key))}),"profile"===q?(0,a.jsx)(b,{customer:S.customer,onSaved:()=>void er()}):null,"jobCases"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.jobCases.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无交付职位"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.jobCases.map(e=>{var t;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:"/jobs?id=".concat(e.id),className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm hover:border-blue-300",children:(0,a.jsx)(h.dy,{title:function(e){var t,s;let a;let l=(null!==(t=e.folderPath)&&void 0!==t?t:"").split("/").filter(Boolean).filter(e=>!["job","jd","raw"].includes(e));return(a=e.title)&&!["job","jd","raw"].includes(a)?e.title:null!==(s=l.at(-1))&&void 0!==s?s:"案件 #".concat(e.id)}(e),status:e.status,hmhLocal:(null!==(t=e.folderPath)&&void 0!==t?t:"").includes("/local/clients/"),time:e.updatedAt})})},e.id)})})}):null,"jobPostings"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.jobPostings.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无解析职位"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.jobPostings.map(e=>{var t;return(0,a.jsx)("li",{className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm",children:(0,a.jsx)(h.rY,{title:null!==(t=e.title)&&void 0!==t?t:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt})},e.id)})})}):null,"talents"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.talents.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无相关简历"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.talents.map(e=>{var t;return(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:"/talents?id=".concat(e.id),className:"flex items-start gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm hover:border-blue-300",children:(0,a.jsx)(h.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(简历 #".concat(e.id,")"),headline:e.headline,updatedAt:e.updatedAt})})},e.id)})})}):null,"parseLogs"===q?(0,a.jsx)("section",{className:"mb-4",children:0===S.parseLogs.length?(0,a.jsx)("div",{className:"text-sm text-gray-400",children:"暂无解析记录(该公司尚未从网页解析入库)"}):(0,a.jsx)("ul",{className:"space-y-1",children:S.parseLogs.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded border border-gray-200 bg-white px-3 py-2 text-sm",children:[(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat("ok"===e.status?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-500"),children:e.status}),e.hasSnapshot?(0,a.jsx)("span",{className:"rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有快照"}):null,e.adapterVersion?(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["adapter ",e.adapterVersion]}):null,(0,a.jsxs)("span",{className:"truncate text-xs text-gray-500",title:e.sourceUrl,children:[e.domain," \xb7 session ",e.sessionId]}),(0,a.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"ml-auto shrink-0 text-xs text-blue-500 hover:underline",children:"来源"}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-gray-400",children:(0,c.d3)(e.createdAt)})]},e.id))})}):null]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该公司"}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"请在左侧选择一家公司查看详情(客户、职位与备注)"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.m,{filterBar:(0,a.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,a.jsx)("input",{type:"text",value:w,onChange:e=>el({q:e.target.value}),placeholder:"搜索公司名/别名…",className:"w-full rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-gray-600 hover:text-gray-800",children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>el({oc:e.target.checked}),className:"accent-amber-600"}),"只看我服务的客户",(0,a.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-amber-700",children:G})]}),(0,a.jsx)("span",{className:"text-gray-300",children:"|"}),(0,a.jsx)("span",{className:"text-gray-400",children:"来源:"}),v.map(e=>{let t=F.includes(e.key);return(0,a.jsxs)("button",{type:"button",title:t?"点击取消该来源筛选":"点击按该来源过滤(可多选,同时命中)",onClick:()=>el({src:t?F.filter(t=>t!==e.key):[...F,e.key]}),className:"rounded px-1.5 py-0.5 text-xs transition ".concat(t?"".concat(e.cls," ring-1 ring-current"):"".concat(e.cls," opacity-40 hover:opacity-80")),children:[e.label," ",X[e.key]]},e.key)}),F.length?(0,a.jsx)("button",{type:"button",onClick:()=>el({src:[]}),className:"text-xs text-gray-400 hover:text-gray-600",children:"清除来源筛选"}):null,(0,a.jsxs)("span",{className:"ml-auto text-gray-400",children:["共 ",es," 家"]})]}),$.bar(eo)]}),listPanel:ee.error?(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,a.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,a.jsx)("button",{type:"button",onClick:()=>ee.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,a.jsx)(o.L,{items:eo,selectedId:k,onSelect:e=>el({id:e}),loading:ea,emptyText:C?"暂无符合筛选条件的客户(取消勾选或清除来源筛选可浏览全部)":"暂无公司数据",onLoadMore:ee.loadMore,loadingMore:ee.loadingMore,exhausted:ee.exhausted}),detailPanel:ed}),$.modal()]})}function k(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,a.jsx)(N,{})})}var w=s(49616);function C(){var e,t;let[s,r]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[m,p]=(0,l.useState)([]),[b,h]=(0,l.useState)(0),[g,f]=(0,l.useState)(!1),[j,v]=(0,l.useState)(null),[N,k]=(0,l.useState)(null),[C,S]=(0,l.useState)(null),{sync:P}=(0,y.nu)(),T=null!==(e=null==P?void 0:P.activeTenantId)&&void 0!==e?e:null,A=(0,l.useCallback)(async()=>{f(!0);let e=new URLSearchParams;c&&e.set("q",c),x&&e.set("touched",x),e.set("limit","200");try{let t=await (0,n.aA)("/market/companies?".concat(e.toString()));v(null),p(t.items),h(t.total)}catch(e){v("加载失败")}finally{f(!1)}},[c,x,T]);(0,l.useEffect)(()=>{let e=setTimeout(()=>d(s.trim()),300);return()=>clearTimeout(e)},[s]),(0,l.useEffect)(()=>{A()},[A]),(0,l.useEffect)(()=>{S(null),null!=N&&(0,n.aA)("/market/companies/".concat(N)).then(S).catch(()=>{})},[N,T]);let L=(0,l.useMemo)(()=>m.map(e=>({id:String(e.id),content:(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"truncate font-medium text-gray-900",children:e.name}),e.touched?(0,a.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] text-emerald-700",children:"已操作"}):null]}),(0,a.jsxs)("div",{className:"mt-0.5 flex items-center gap-0.5",children:[e.platforms.length?e.platforms.map(e=>(0,a.jsx)(w.v,{platform:e},e)):(0,a.jsx)("span",{className:"text-[10px] text-gray-300",children:"无职位发布数据"}),(0,a.jsxs)("span",{className:"ml-1 text-[10px] text-gray-400",children:["在招 ",e.postingsCount," \xb7 ",e.source]})]})]})})),[m]);return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-amber-200 bg-[color:var(--brand-soft)] px-3 py-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-[color:var(--brand-strong)]",children:"\uD83E\uDDED 市场公司(BD 视角:目标/对手公司在各平台的发布与操作痕迹)"}),(0,a.jsx)("span",{className:"ml-auto text-[10px] text-gray-400",children:"下方统一列表 = 客户/解析来源维度"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1",children:(0,a.jsx)(i.m,{filterBar:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-200 bg-white p-3",children:[(0,a.jsx)("input",{type:"text",value:s,onChange:e=>r(e.target.value),placeholder:"搜索公司名…",className:"w-56 rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),["","1","0"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>u(e),className:"rounded px-2 py-1 text-xs ".concat(x===e?"bg-[color:var(--brand-soft)] font-medium text-[color:var(--brand-strong)]":"text-gray-500 hover:bg-gray-100"),children:""===e?"全部":"1"===e?"已操作过":"未操作"},e)),(0,a.jsxs)("span",{className:"ml-auto text-xs text-gray-400",children:["共 ",b," 家"]})]}),listPanel:j?(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,a.jsx)("span",{className:"text-red-500",children:j}),(0,a.jsx)("button",{type:"button",onClick:()=>void A(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,a.jsx)(o.L,{items:L,selectedId:null!=N?String(N):void 0,onSelect:e=>k(Number(e)),loading:g,emptyText:"暂无市场公司数据"}),detailPanel:N?C?(0,a.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,a.jsx)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:null!==(t=C.profile.name)&&void 0!==t?t:"(未命名)"}),(0,a.jsx)("a",{href:C.profile.sourceUrl,target:"_blank",rel:"noreferrer",className:"mb-4 block truncate text-xs text-blue-600 hover:underline",children:C.profile.sourceUrl}),(0,a.jsxs)("section",{className:"mb-4",children:[(0,a.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:["在招职位(",C.postings.length,")"]}),0===C.postings.length?(0,a.jsx)("div",{className:"text-xs text-gray-400",children:"名下暂无职位发布(解析库 company 字段归一后自动出现)"}):(0,a.jsx)("div",{className:"space-y-1",children:C.postings.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded border border-gray-100 px-2 py-1.5 text-sm",children:[(0,a.jsx)(w.v,{platform:e.source}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:null!==(t=e.title)&&void 0!==t?t:"(无标题)"}),(0,a.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"打开"})]},e.id)})})]}),(0,a.jsxs)("section",{children:[(0,a.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:["对手公司(同类型在招,",C.peers.length,")"]}),0===C.peers.length?(0,a.jsx)("div",{className:"text-xs text-gray-400",children:"暂无(需要职位标题数据支撑;解析质量修复后自动点亮)"}):(0,a.jsx)("div",{className:"space-y-1",children:C.peers.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>k(e.id),className:"flex w-full items-center gap-2 rounded border border-gray-100 px-2 py-1.5 text-left text-sm hover:bg-amber-50",children:[(0,a.jsx)("span",{className:"flex-1 truncate",children:e.name}),(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:["在招 ",e.postingsCount]})]},e.id))})]})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"选择左侧公司查看发布与对手"})})})]})}var S=s(88801);function P(){return"bd"===(0,S.mJ)()?(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsx)("div",{className:"min-h-0 flex-[2] border-b border-gray-200",children:(0,a.jsx)(C,{})}),(0,a.jsx)("div",{className:"min-h-0 flex-[3] overflow-auto",children:(0,a.jsx)(k,{})})]}):(0,a.jsx)(k,{})}}},function(e){e.O(0,[253,686,400,935,744],function(){return e(e.s=41937)}),_N_E=e.O()}]);
|
|
@@ -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]="09aaedc4-5bc4-4e16-8522-e8bd8096d3c8",e._sentryDebugIdIdentifier="sentry-dbid-09aaedc4-5bc4-4e16-8522-e8bd8096d3c8")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[290],{44792:function(e,t,n){Promise.resolve().then(n.bind(n,39418))},39418:function(e,t,n){"use strict";n.d(t,{CompanyAdminPage:function(){return i}});var r=n(72835),a=n(60635),l=n(82182),s=n(65777);function i(){var e,t;let{sync:n,session:i,utoken:o,refresh:c}=(0,s.nu)(),d=(0,s.cp)(n),u=(0,s.Cd)(n,d),m=null!==(t=null===(e=(0,s.aG)(n).find(e=>e.tenantId===d))||void 0===e?void 0:e.name)&&void 0!==t?t:"",[x,h]=(0,a.useState)([]),[f,y]=(0,a.useState)([]),[b,g]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),[w,j]=(0,a.useState)(null),[N,I]=(0,a.useState)(null),[E,k]=(0,a.useState)(null),[U,S]=(0,a.useState)(null),T=(0,a.useCallback)((e,t)=>{let n=new Headers(null==t?void 0:t.headers);return n.set("Content-Type","application/json"),o&&n.set("Authorization","UTOKEN ".concat(o)),fetch("".concat((0,s.tQ)()).concat(e),{...t,headers:n})},[o]),C=(0,a.useCallback)(async()=>{if(d){g(!0),v(null);try{var e,t;let[n,r]=await Promise.all([T("/company/".concat(d,"/applications?status=pending")),T("/company/".concat(d,"/members"))]);if(!n.ok||!r.ok){v("加载失败(HTTP ".concat(n.status,"/").concat(r.status,")"));return}h(null!==(e=(await n.json()).items)&&void 0!==e?e:[]),y(null!==(t=(await r.json()).items)&&void 0!==t?t:[])}finally{g(!1)}}},[d,T]);(0,a.useEffect)(()=>{C()},[C]);let _=(0,a.useCallback)(async(e,t,n)=>{let r=await T(e,{method:"POST",body:JSON.stringify(t)}),a=await r.json().catch(()=>null);if(r.ok)return n(),!0;if(401===r.status){var c;return v("登录已过期,请在弹窗中重新登录;登录后自动继续刚才的操作"),(0,l.jr)({message:(null==a?void 0:a.message)||"登录已过期,请重新登录",oldUserId:null!==(c=null==i?void 0:i.hmUserId)&&void 0!==c?c:null,retry:async()=>{var r;let a=new Headers({"Content-Type":"application/json"}),l=null!==(r=(0,s.Xc)())&&void 0!==r?r:o;l&&a.set("Authorization","UTOKEN ".concat(l));let i=await fetch("".concat((0,s.tQ)()).concat(e),{method:"POST",headers:a,body:JSON.stringify(t)}),c=await i.json().catch(()=>null);return i.ok?(n(),!0):(v((null==c?void 0:c.message)||"操作失败(HTTP ".concat(i.status,")")),!1)}}),!1}return v((null==a?void 0:a.message)||"操作失败(HTTP ".concat(r.status,")")),!1},[T,null==i?void 0:i.hmUserId,o]),A=async(e,t)=>{I(e.id),v(null),j(null);try{await _("/company/applications/".concat(e.id,"/decide"),{action:t},()=>{j("approve"===t?"已通过 ".concat(e.email," 的加入申请"):"已拒绝 ".concat(e.email," 的申请"))})&&(await C(),await c())}finally{I(null)}},P=async(e,t)=>{k(e.hmUserId),v(null),j(null);try{await _("/company/".concat(d,"/admins"),{hmUserId:e.hmUserId,isAdmin:t},()=>j(t?"已设 ".concat(e.email," 为管理员"):"已取消 ".concat(e.email," 的管理员")))&&(await C(),await c())}finally{k(null)}},H=async e=>{k(e.hmUserId),v(null),j(null);try{await _("/company/".concat(d,"/transfer-ownership"),{hmUserId:e.hmUserId},()=>j("公司归属已转移给 ".concat(e.email,",你已成为管理员")))&&(await C(),await c())}finally{k(null),S(null)}};return d?"owner"!==u&&"admin"!==u?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:"仅公司归属者/管理员可访问企业管理"}):(0,r.jsxs)("div",{className:"h-full overflow-auto p-6",children:[(0,r.jsxs)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:["企业管理",(0,r.jsx)("span",{className:"ml-2 text-sm font-normal text-gray-400",children:m}),(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-amber-600",children:"owner"===u?"归属者":"管理员"})]}),(0,r.jsx)("p",{className:"mb-5 text-xs text-gray-400",children:"审批加入申请、配置管理员、转移公司归属;创建者默认是归属者(管理员)"}),p&&(0,r.jsx)("div",{className:"mb-3 rounded-md bg-red-50 px-3 py-2 text-xs text-red-600",children:p}),w&&(0,r.jsx)("div",{className:"mb-3 rounded-md bg-green-50 px-3 py-2 text-xs text-green-600",children:w}),(0,r.jsxs)("section",{className:"mb-8",children:[(0,r.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-700",children:["待审批申请",x.length>0&&(0,r.jsx)("span",{className:"ml-2 rounded-full bg-red-100 px-1.5 text-xs text-red-600",children:x.length})]}),b?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-gray-200 px-3 py-6 text-center text-xs text-gray-400",children:"加载中…"}):0===x.length?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-gray-200 px-3 py-6 text-center text-xs text-gray-400",children:"暂无待审批申请"}):(0,r.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-gray-200 bg-white px-4 py-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm text-gray-800",children:e.email}),(0,r.jsxs)("div",{className:"text-xs text-gray-400",children:[new Date(e.createdAt).toLocaleString("zh-CN"),e.message?" \xb7 ".concat(e.message):""]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)("button",{onClick:()=>A(e,"approve"),disabled:N===e.id,className:"rounded-md bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-50",children:N===e.id?"处理中…":"通过"}),(0,r.jsx)("button",{onClick:()=>A(e,"reject"),disabled:N===e.id,className:"rounded-md border border-gray-200 px-3 py-1 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"拒绝"})]})]},e.id))})]}),(0,r.jsxs)("section",{children:[(0,r.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-700",children:["成员(",f.length,")"]}),(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white",children:f.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 ".concat(t>0?"border-t border-gray-100":""),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"truncate text-sm text-gray-800",children:e.email}),(0,r.jsxs)("span",{className:"ml-2 text-xs text-gray-400",children:[new Date(e.joinedAt).toLocaleDateString("zh-CN")," 加入"]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:["owner"===e.role&&(0,r.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:"归属者"}),"admin"===e.role&&(0,r.jsx)("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-xs text-blue-700",children:"管理员"}),"owner"===u&&"owner"!==e.role&&(0,r.jsxs)(r.Fragment,{children:["member"===e.role?(0,r.jsx)("button",{onClick:()=>P(e,!0),disabled:E===e.hmUserId,className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"设为管理员"}):(0,r.jsx)("button",{onClick:()=>P(e,!1),disabled:E===e.hmUserId,className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"取消管理员"}),U===e.hmUserId?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>H(e),disabled:E===e.hmUserId,className:"rounded-md bg-amber-600 px-2 py-0.5 text-xs text-white hover:bg-amber-700 disabled:opacity-50",children:"确认转移给TA"}),(0,r.jsx)("button",{onClick:()=>S(null),className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-400",children:"取消"})]}):(0,r.jsx)("button",{onClick:()=>S(e.hmUserId),className:"rounded-md border border-amber-200 px-2 py-0.5 text-xs text-amber-600 hover:bg-amber-50",children:"转移归属"})]})]})]},e.hmUserId))}),"owner"===u&&(0,r.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"转移归属后你将成为管理员,对方成为归属者(归属权即公司归属,可随时再转)"})]})]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:"尚未选择公司——在左下角切换到公司后再进入企业管理"})}},65777:function(e,t,n){"use strict";let r;n.d(t,{Cd:function(){return E},Xc:function(){return U},aG:function(){return N},cp:function(){return I},nu:function(){return j},tQ:function(){return k}});var a=n(60635),l=n(74431),s=n(67002),i=n(60529);let o=null,c=null,d=null,u=new Set;function m(){u.forEach(e=>e())}function x(e){o=o?{...o,refreshing:e}:{...p,refreshing:e},m()}async function h(){try{return await (0,l.aA)("/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,l.aA)(e,{headers:t})}catch(e){return null}}async function y(){x(!0);try{var e;let[t,n]=await Promise.all([h(),f("/datasync/state")]),a=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,l=null!=n?n:null;!l&&t&&a&&a!==(0,s.Xc)()?((0,s.GK)(a),l=await f("/datasync/state")):(0,s.GK)(a),function(e){if(void 0===r){r=e;return}if(e!==r){r=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let i=!!((null==t?void 0:t.loggedIn)||(null==l?void 0:l.loggedIn));if(!t&&!l){o=o?{...o,loadError:"本地服务无响应"}:{...p,loadError:"本地服务无响应"},m();return}o={session:null!=t?t:{loggedIn:!1},sync:l,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:i?"in":"out",refresh:b},m()}finally{(null==o?void 0:o.refreshing)&&x(!1)}}function b(){return c||(c=y().finally(()=>{c=null}))}function g(e){return u.add(e),1===u.size&&(b(),d=setInterval(()=>void b(),6e4)),()=>{u.delete(e),0===u.size&&d&&(clearInterval(d),d=null)}}let p={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:b};function v(){return null!=o?o:p}function w(){return v()}function j(){return(0,a.useSyncExternalStore)(g,v,w)}function N(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function I(e){var t,n;let r=null!==(t=null==e?void 0:e.activeTenantId)&&void 0!==t?t:null;if(null==r)return null;let a=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===r&&!e.leftAt);return!a||a.isPersonal?null:r}function E(e,t){var n,r;if(!t)return null;let a=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===t&&!e.leftAt&&!e.isPersonal);return null!==(r=null==a?void 0:a.role)&&void 0!==r?r:null}function k(){return i.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function U(){return(0,s.Xc)()}},82182:function(e,t,n){"use strict";n.d(t,{H7:function(){return d},jr:function(){return s},mn:function(){return c},nk:function(){return o},qd:function(){return i}});let r=null,a=new Set;function l(){a.forEach(e=>e())}function s(e){r=e,l()}function i(){r&&(r=null,l())}function o(){return r}function c(e){return a.add(e),()=>a.delete(e)}function d(e){if(!e)return null;try{var t,n,r,a,l;let s=e.split(".")[1],i=JSON.parse(decodeURIComponent(escape(atob(s.replace(/-/g,"+").replace(/_/g,"/"))))),o=null!==(l=null!==(a=null!==(r=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t._id)&&void 0!==r?r:null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.id)&&void 0!==a?a:null==i?void 0:i.sub)&&void 0!==l?l:null;return"number"==typeof o?o:null}catch(e){return null}}},74431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return l},aA:function(){return o}});var r=n(67002),a=n(60529);function l(){return a.env.HUNTER_MATE_SERVER_URL||""}let s=l();class i extends Error{constructor(e,t,n){super(null!=n?n:"请求失败(".concat(e,")").concat(t?": ".concat(t):"")),this.status=e,this.path=t,this.name="HttpError"}}async function o(e,t){let n;try{n=await fetch("".concat(s).concat(e),{cache:"no-store",...function(e){let t=(0,r.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}(t)})}catch(t){throw new i(0,e,t instanceof Error?t.message:"网络错误")}if(!n.ok)throw new i(n.status,e,"HTTP ".concat(n.status));try{return await n.json()}catch(t){throw new i(n.status,e,t instanceof Error?"响应解析失败: ".concat(t.message):"响应解析失败")}}},67002:function(e,t,n){"use strict";n.d(t,{GK:function(){return s},Lc:function(){return i},Xc:function(){return l}});let r=null,a=new Set;function l(){return r}function s(e){e!==r&&(r=e,a.forEach(e=>e()))}function i(e){return a.add(e),()=>{a.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=44792)}),_N_E=e.O()}]);
|
|
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]="453aa4e0-c003-4648-ac93-fe46b433cf04",e._sentryDebugIdIdentifier="sentry-dbid-453aa4e0-c003-4648-ac93-fe46b433cf04")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[290],{44792:function(e,t,n){Promise.resolve().then(n.bind(n,39418))},39418:function(e,t,n){"use strict";n.d(t,{CompanyAdminPage:function(){return i}});var r=n(72835),a=n(60635),l=n(82182),s=n(65777);function i(){var e,t;let{sync:n,session:i,utoken:o,refresh:c}=(0,s.nu)(),d=(0,s.cp)(n),u=(0,s.Cd)(n,d),m=null!==(t=null===(e=(0,s.aG)(n).find(e=>e.tenantId===d))||void 0===e?void 0:e.name)&&void 0!==t?t:"",[x,f]=(0,a.useState)([]),[h,y]=(0,a.useState)([]),[b,g]=(0,a.useState)(!1),[p,v]=(0,a.useState)(null),[w,j]=(0,a.useState)(null),[N,I]=(0,a.useState)(null),[E,k]=(0,a.useState)(null),[U,S]=(0,a.useState)(null),T=(0,a.useCallback)((e,t)=>{let n=new Headers(null==t?void 0:t.headers);return n.set("Content-Type","application/json"),o&&n.set("Authorization","UTOKEN ".concat(o)),fetch("".concat((0,s.tQ)()).concat(e),{...t,headers:n})},[o]),C=(0,a.useCallback)(async()=>{if(d){g(!0),v(null);try{var e,t;let[n,r]=await Promise.all([T("/company/".concat(d,"/applications?status=pending")),T("/company/".concat(d,"/members"))]);if(!n.ok||!r.ok){v("加载失败(HTTP ".concat(n.status,"/").concat(r.status,")"));return}f(null!==(e=(await n.json()).items)&&void 0!==e?e:[]),y(null!==(t=(await r.json()).items)&&void 0!==t?t:[])}finally{g(!1)}}},[d,T]);(0,a.useEffect)(()=>{C()},[C]);let _=(0,a.useCallback)(async(e,t,n)=>{let r=await T(e,{method:"POST",body:JSON.stringify(t)}),a=await r.json().catch(()=>null);if(r.ok)return n(),!0;if(401===r.status){var c;return v("登录已过期,请在弹窗中重新登录;登录后自动继续刚才的操作"),(0,l.jr)({message:(null==a?void 0:a.message)||"登录已过期,请重新登录",oldUserId:null!==(c=null==i?void 0:i.hmUserId)&&void 0!==c?c:null,retry:async()=>{var r;let a=new Headers({"Content-Type":"application/json"}),l=null!==(r=(0,s.Xc)())&&void 0!==r?r:o;l&&a.set("Authorization","UTOKEN ".concat(l));let i=await fetch("".concat((0,s.tQ)()).concat(e),{method:"POST",headers:a,body:JSON.stringify(t)}),c=await i.json().catch(()=>null);return i.ok?(n(),!0):(v((null==c?void 0:c.message)||"操作失败(HTTP ".concat(i.status,")")),!1)}}),!1}return v((null==a?void 0:a.message)||"操作失败(HTTP ".concat(r.status,")")),!1},[T,null==i?void 0:i.hmUserId,o]),A=async(e,t)=>{I(e.id),v(null),j(null);try{await _("/company/applications/".concat(e.id,"/decide"),{action:t},()=>{j("approve"===t?"已通过 ".concat(e.email," 的加入申请"):"已拒绝 ".concat(e.email," 的申请"))})&&(await C(),await c())}finally{I(null)}},P=async(e,t)=>{k(e.hmUserId),v(null),j(null);try{await _("/company/".concat(d,"/admins"),{hmUserId:e.hmUserId,isAdmin:t},()=>j(t?"已设 ".concat(e.email," 为管理员"):"已取消 ".concat(e.email," 的管理员")))&&(await C(),await c())}finally{k(null)}},H=async e=>{k(e.hmUserId),v(null),j(null);try{await _("/company/".concat(d,"/transfer-ownership"),{hmUserId:e.hmUserId},()=>j("公司归属已转移给 ".concat(e.email,",你已成为管理员")))&&(await C(),await c())}finally{k(null),S(null)}};return d?"owner"!==u&&"admin"!==u?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:"仅公司归属者/管理员可访问企业管理"}):(0,r.jsxs)("div",{className:"h-full overflow-auto p-6",children:[(0,r.jsxs)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:["企业管理",(0,r.jsx)("span",{className:"ml-2 text-sm font-normal text-gray-400",children:m}),(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-amber-600",children:"owner"===u?"归属者":"管理员"})]}),(0,r.jsx)("p",{className:"mb-5 text-xs text-gray-400",children:"审批加入申请、配置管理员、转移公司归属;创建者默认是归属者(管理员)"}),p&&(0,r.jsx)("div",{className:"mb-3 rounded-md bg-red-50 px-3 py-2 text-xs text-red-600",children:p}),w&&(0,r.jsx)("div",{className:"mb-3 rounded-md bg-green-50 px-3 py-2 text-xs text-green-600",children:w}),(0,r.jsxs)("section",{className:"mb-8",children:[(0,r.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-700",children:["待审批申请",x.length>0&&(0,r.jsx)("span",{className:"ml-2 rounded-full bg-red-100 px-1.5 text-xs text-red-600",children:x.length})]}),b?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-gray-200 px-3 py-6 text-center text-xs text-gray-400",children:"加载中…"}):0===x.length?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-gray-200 px-3 py-6 text-center text-xs text-gray-400",children:"暂无待审批申请"}):(0,r.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-gray-200 bg-white px-4 py-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"truncate text-sm text-gray-800",children:e.email}),(0,r.jsxs)("div",{className:"text-xs text-gray-400",children:[new Date(e.createdAt).toLocaleString("zh-CN"),e.message?" \xb7 ".concat(e.message):""]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)("button",{onClick:()=>A(e,"approve"),disabled:N===e.id,className:"rounded-md bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-50",children:N===e.id?"处理中…":"通过"}),(0,r.jsx)("button",{onClick:()=>A(e,"reject"),disabled:N===e.id,className:"rounded-md border border-gray-200 px-3 py-1 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"拒绝"})]})]},e.id))})]}),(0,r.jsxs)("section",{children:[(0,r.jsxs)("h3",{className:"mb-2 text-sm font-medium text-gray-700",children:["成员(",h.length,")"]}),(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white",children:h.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 ".concat(t>0?"border-t border-gray-100":""),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"truncate text-sm text-gray-800",children:e.email}),(0,r.jsxs)("span",{className:"ml-2 text-xs text-gray-400",children:[new Date(e.joinedAt).toLocaleDateString("zh-CN")," 加入"]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:["owner"===e.role&&(0,r.jsx)("span",{className:"rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700",children:"归属者"}),"admin"===e.role&&(0,r.jsx)("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-xs text-blue-700",children:"管理员"}),"owner"===u&&"owner"!==e.role&&(0,r.jsxs)(r.Fragment,{children:["member"===e.role?(0,r.jsx)("button",{onClick:()=>P(e,!0),disabled:E===e.hmUserId,className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"设为管理员"}):(0,r.jsx)("button",{onClick:()=>P(e,!1),disabled:E===e.hmUserId,className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:"取消管理员"}),U===e.hmUserId?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>H(e),disabled:E===e.hmUserId,className:"rounded-md bg-amber-600 px-2 py-0.5 text-xs text-white hover:bg-amber-700 disabled:opacity-50",children:"确认转移给TA"}),(0,r.jsx)("button",{onClick:()=>S(null),className:"rounded-md border border-gray-200 px-2 py-0.5 text-xs text-gray-400",children:"取消"})]}):(0,r.jsx)("button",{onClick:()=>S(e.hmUserId),className:"rounded-md border border-amber-200 px-2 py-0.5 text-xs text-amber-600 hover:bg-amber-50",children:"转移归属"})]})]})]},e.hmUserId))}),"owner"===u&&(0,r.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"转移归属后你将成为管理员,对方成为归属者(归属权即公司归属,可随时再转)"})]})]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:"尚未选择公司——在左下角切换到公司后再进入企业管理"})}},65777:function(e,t,n){"use strict";let r;n.d(t,{Cd:function(){return E},Xc:function(){return U},aG:function(){return N},cp:function(){return I},nu:function(){return j},tQ:function(){return k}});var a=n(60635),l=n(74431),s=n(67002),i=n(60529);let o=null,c=null,d=null,u=new Set;function m(){u.forEach(e=>e())}function x(e){o=o?{...o,refreshing:e}:{...p,refreshing:e},m()}async function f(){try{return await (0,l.aA)("/auth/session")}catch(e){return null}}async function h(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,l.aA)(e,{headers:t})}catch(e){return null}}async function y(){x(!0);try{var e;let[t,n]=await Promise.all([f(),h("/datasync/state")]),a=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,l=null!=n?n:null;!l&&t&&a&&a!==(0,s.Xc)()?((0,s.GK)(a),l=await h("/datasync/state")):(0,s.GK)(a),function(e){if(void 0===r){r=e;return}if(e!==r){r=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let i=!!((null==t?void 0:t.loggedIn)||(null==l?void 0:l.loggedIn));if(!t&&!l){o=o?{...o,loadError:"本地服务无响应"}:{...p,loadError:"本地服务无响应"},m();return}o={session:null!=t?t:{loggedIn:!1},sync:l,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:i?"in":"out",refresh:b},m()}finally{(null==o?void 0:o.refreshing)&&x(!1)}}function b(){return c||(c=y().finally(()=>{c=null}))}function g(e){return u.add(e),1===u.size&&(b(),d=setInterval(()=>void b(),6e4)),()=>{u.delete(e),0===u.size&&d&&(clearInterval(d),d=null)}}let p={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:b};function v(){return null!=o?o:p}function w(){return v()}function j(){return(0,a.useSyncExternalStore)(g,v,w)}function N(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function I(e){var t,n;let r=null!==(t=null==e?void 0:e.activeTenantId)&&void 0!==t?t:null;if(null==r)return null;let a=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===r&&!e.leftAt);return!a||a.isPersonal?null:r}function E(e,t){var n,r;if(!t)return null;let a=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===t&&!e.leftAt&&!e.isPersonal);return null!==(r=null==a?void 0:a.role)&&void 0!==r?r:null}function k(){return i.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function U(){return(0,s.Xc)()}},82182:function(e,t,n){"use strict";n.d(t,{H7:function(){return d},jr:function(){return s},mn:function(){return c},nk:function(){return o},qd:function(){return i}});let r=null,a=new Set;function l(){a.forEach(e=>e())}function s(e){r=e,l()}function i(){r&&(r=null,l())}function o(){return r}function c(e){return a.add(e),()=>a.delete(e)}function d(e){if(!e)return null;try{var t,n,r,a,l;let s=e.split(".")[1],i=JSON.parse(decodeURIComponent(escape(atob(s.replace(/-/g,"+").replace(/_/g,"/"))))),o=null!==(l=null!==(a=null!==(r=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t._id)&&void 0!==r?r:null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.id)&&void 0!==a?a:null==i?void 0:i.sub)&&void 0!==l?l:null;return"number"==typeof o?o:null}catch(e){return null}}},74431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return l},aA:function(){return o}});var r=n(67002),a=n(60529);function l(){return a.env.HUNTER_MATE_SERVER_URL||""}let s=l();class i extends Error{constructor(e,t,n){super(null!=n?n:"请求失败(".concat(e,")").concat(t?": ".concat(t):"")),this.status=e,this.path=t,this.name="HttpError"}}async function o(e,t){let n;try{n=await fetch("".concat(s).concat(e),{cache:"no-store",...function(e){let t=(0,r.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}(t)})}catch(t){throw new i(0,e,t instanceof Error?t.message:"网络错误")}if(!n.ok)throw new i(n.status,e,"HTTP ".concat(n.status));try{return await n.json()}catch(t){throw new i(n.status,e,t instanceof Error?"响应解析失败: ".concat(t.message):"响应解析失败")}}},67002:function(e,t,n){"use strict";n.d(t,{GK:function(){return s},Lc:function(){return i},Xc:function(){return l}});let r=null,a=new Set;function l(){return r}function s(e){e!==r&&(r=e,a.forEach(e=>e()))}function i(e){return a.add(e),()=>{a.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=44792)}),_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]="1e48e220-1daf-44d6-b2b6-00b4254a6e55",e._sentryDebugIdIdentifier="sentry-dbid-1e48e220-1daf-44d6-b2b6-00b4254a6e55")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[303],{50778:function(e,n,t){Promise.resolve().then(t.bind(t,3463))},27473:function(e,n,t){"use strict";var r=t(38321);t.o(r,"useParams")&&t.d(n,{useParams:function(){return r.useParams}}),t.o(r,"usePathname")&&t.d(n,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(n,{useRouter:function(){return r.useRouter}}),t.o(r,"useSearchParams")&&t.d(n,{useSearchParams:function(){return r.useSearchParams}}),t.o(r,"useServerInsertedHTML")&&t.d(n,{useServerInsertedHTML:function(){return r.useServerInsertedHTML}})},3463:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return c}});var r=t(72835),s=t(60635),a=t(27473);let u={talent:"/talents",job:"/jobs",company:"/companies"};function o(){let e=(0,a.useSearchParams)();return(0,s.useEffect)(()=>{let n=e.get("type")||"talent",t=e.get("id"),r=u[n]||"/talents",s=t?"?id=".concat(encodeURIComponent(t)):"";window.location.replace("".concat(r).concat(s))},[e]),(0,r.jsx)("div",{className:"p-6 text-gray-500",children:"跳转中…"})}function c(){return(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)("div",{className:"p-6 text-gray-500",children:"跳转中…"}),children:(0,r.jsx)(o,{})})}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=50778)}),_N_E=e.O()}]);
|