hunter-mate 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/manifest.json +3 -3
- package/dist/assets/server/main.mjs +31 -2
- package/dist/index.js +30 -4
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/chunks/187-48dc1acca97c62ba.js +1 -0
- package/dist/web/dist/_next/static/chunks/{253-f4ac7af6647e4dba.js → 327-6b8f348b06e7977f.js} +1 -1
- package/dist/web/dist/_next/static/chunks/353-845111f2789c5a03.js +12 -0
- package/dist/web/dist/_next/static/chunks/587-e449469e56a2bfff.js +1 -0
- package/dist/web/dist/_next/static/chunks/603-765c4fa1ed757ca5.js +32 -0
- package/dist/web/dist/_next/static/chunks/659-3db6e9c90ee9d238.js +1 -0
- package/dist/web/dist/_next/static/chunks/882-1bcdfd2499403efd.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/companies/{page-390d5e3073ec151d.js → page-e1e730e2dc5ad84c.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-a32a17c5a6384358.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/{layout-15c4c2ba595b2a92.js → layout-1e492ed8c639edf5.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-6741cd1b0a4aca2e.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/talents/{page-5a2caa7a503ee041.js → page-4b00d69580f49f97.js} +1 -1
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +4 -4
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +4 -4
- 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 +4 -4
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +4 -4
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +4 -4
- 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 +4 -4
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +4 -4
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +4 -4
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +4 -4
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +4 -4
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +4 -4
- 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 +4 -4
- 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 +4 -4
- package/package.json +3 -3
- package/dist/web/dist/_next/static/chunks/187-f067914dcd1330c2.js +0 -32
- package/dist/web/dist/_next/static/chunks/659-b23050764c004f5f.js +0 -1
- package/dist/web/dist/_next/static/chunks/728-cffab7e836020551.js +0 -12
- package/dist/web/dist/_next/static/chunks/app/jobs/page-fa83ce1b6c3b345d.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-fe2b986867d317c0.js +0 -1
- /package/dist/assets/extension/background/{service-worker.20261020181646.js → service-worker.20261023013927.js} +0 -0
- /package/dist/web/dist/_next/static/{tYFZz41gyWi4-BhxuxlGU → cC7rsTCys5_15wJ8BiPDm}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{tYFZz41gyWi4-BhxuxlGU → cC7rsTCys5_15wJ8BiPDm}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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]="0785fd8c-f656-4365-a17e-5878af8a01b7",e._sentryDebugIdIdentifier="sentry-dbid-0785fd8c-f656-4365-a17e-5878af8a01b7")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[109],{74843:function(e,t,s){Promise.resolve().then(s.bind(s,96041))},96041:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return es}});var l=s(72835),a=s(59659),n=s(60635),r=s(27473),i=s(74431),d=s(8448),c=s(94518),o=s(63718),u=s(86777),m=s(27828),x=s(26119),h=s(93464),p=s(65777),b=s(58574),g=s(38119),y=s(27485),v=s(6443),j=s(33365),f=s(78606),N=s(59998),k=s(31595),w=s(74435),S=s(67002),C=s(95909),I=s(86892),A=s(87018),O=s(32587);function T(e){var t;let{entityId:s,name:a,open:r,onClose:d}=e,[c,o]=(0,n.useState)(null),[u,m]=(0,n.useState)([]),[x,h]=(0,n.useState)(null),[p,b]=(0,n.useState)(null),[g,y]=(0,n.useState)(!1),[j,f]=(0,n.useState)(!1),[N,k]=(0,n.useState)(0);return(0,n.useEffect)(()=>{if(!r||null==s)return;let e=!0;return y(!0),f(!1),o(null),m([]),h(null),b(null),Promise.all([(0,i.aA)("/entities/talent/".concat(s)),(0,i.aA)("/entities/talent/".concat(s,"/sources")).catch(()=>null),(0,i.aA)("/entities/talent/".concat(s,"/matches")).catch(()=>null)]).then(t=>{var s,l;let[a,n,r]=t;e&&(o(a.entity),m(n?n.items:[]),h(null!==(s=null==r?void 0:r.portraitId)&&void 0!==s?s:null),b(null!==(l=null==r?void 0:r.matches)&&void 0!==l?l:[]))}).catch(()=>{e&&f(!0)}).finally(()=>{e&&y(!1)}),()=>{e=!1}},[r,s,N]),(0,l.jsx)(C.Z,{title:null!==(t=null==c?void 0:c.name)&&void 0!==t?t:a,placement:"right",width:860,open:r,onClose:d,destroyOnHidden:!0,children:g?(0,l.jsx)(I.Z,{active:!0,paragraph:{rows:8}}):j?(0,l.jsx)(A.Z,{type:"error",message:"人才详情加载失败",description:(0,l.jsx)(v.ZP,{size:"small",onClick:()=>k(e=>e+1),children:"重试"})}):c?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O.n,{entity:c}),(0,l.jsx)(O.z,{entity:c,portraitId:x,matches:p,sources:u})]}):null})}let P=[{hours:24,label:"1 天"},{hours:72,label:"3 天"},{hours:168,label:"7 天"},{hours:720,label:"30 天"}];function z(e){var t;let s,{jobCaseId:a,onClose:r}=e,[d,c]=(0,n.useState)(null),[o,u]=(0,n.useState)("tenant"),[m,x]=(0,n.useState)(new Set),[h,p]=(0,n.useState)(168),[b,g]=(0,n.useState)(""),[y,v]=(0,n.useState)(!1),[j,f]=(0,n.useState)(null),[N,k]=(0,n.useState)(null),[w,C]=(0,n.useState)(!1);async function I(){v(!0),f(null);try{let e=await (0,i.aA)("/shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobCaseId:a,scope:"users"===o?{type:"users",hmUserIds:Array.from(m)}:{type:"tenant"},ttlHours:h,note:b.trim()||void 0})});if(!(null==e?void 0:e.token)){f("创建失败:未登录云端账号 / 云服务不可达 / 该职位未同步上云");return}k(e)}catch(e){f("创建失败:未登录云端账号 / 云服务不可达 / 该职位未同步上云")}finally{v(!1)}}(0,n.useEffect)(()=>{let e=()=>{(async()=>{try{let e=await (0,i.aA)("/team/members");c(Array.isArray(e.items)?e.items:[])}catch(e){c([])}})()};return e(),(0,S.Lc)(e)},[]);let A=N?(t=N.urlPath,"".concat(window.location.origin).concat(t)):null;return s=null===d?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"加载同事目录…(未登录云端账号时为空)"}):d.length?d.map(e=>(0,l.jsxs)("label",{className:"flex items-center gap-2 py-1 text-sm",children:[(0,l.jsx)("input",{type:"checkbox",checked:m.has(e.hmUserId),onChange:t=>{let s=new Set(m);t.target.checked?s.add(e.hmUserId):s.delete(e.hmUserId),x(s)}}),(0,l.jsx)("span",{children:e.name}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:e.email})]},e.hmUserId)):(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"暂无公司租户同事"}),(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:r,children:(0,l.jsxs)("div",{className:"w-[520px] max-w-[92vw] rounded-lg bg-white p-5 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,l.jsxs)("h3",{className:"text-base font-semibold",children:["分享职位推荐(职位 #",a,")"]}),(0,l.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),N?(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-2 rounded bg-emerald-50 px-3 py-2 text-sm text-emerald-800",children:["分享已创建,有效期至 ",new Date(N.expiresAt).toLocaleString()]}),(0,l.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"把链接发给同事(对方在自己本地 hm 打开):"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("input",{readOnly:!0,value:null!=A?A:"",className:"flex-1 rounded border border-gray-300 px-2 py-1.5 font-mono text-xs",onFocus:e=>e.target.select()}),(0,l.jsx)("button",{onClick:()=>{A&&navigator.clipboard.writeText(A).then(()=>{C(!0),setTimeout(()=>C(!1),2500)})},className:"rounded bg-blue-600 px-3 py-1.5 text-xs text-white hover:bg-blue-700",children:w?"已复制 ✓":"复制"})]}),(0,l.jsx)("div",{className:"mt-4 text-right",children:(0,l.jsx)("button",{onClick:r,className:"rounded border border-gray-300 px-4 py-1.5 text-sm hover:bg-gray-50",children:"完成"})})]}):(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-1 text-xs font-medium text-gray-600",children:"分享范围"}),(0,l.jsxs)("label",{className:"mr-4 text-sm",children:[(0,l.jsx)("input",{type:"radio",checked:"tenant"===o,onChange:()=>u("tenant")})," 租户内所有同事"]}),(0,l.jsxs)("label",{className:"text-sm",children:[(0,l.jsx)("input",{type:"radio",checked:"users"===o,onChange:()=>u("users")})," 指定同事"]}),"users"===o?(0,l.jsx)("div",{className:"mt-2 max-h-36 overflow-auto rounded border border-gray-200 p-2",children:s}):null]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-1 text-xs font-medium text-gray-600",children:"有效期"}),(0,l.jsx)("select",{value:h,onChange:e=>p(Number(e.target.value)),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:P.map(e=>(0,l.jsx)("option",{value:e.hours,children:e.label},e.hours))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-1 text-xs font-medium text-gray-600",children:"备注(可选,给查看者的说明)"}),(0,l.jsx)("input",{value:b,onChange:e=>g(e.target.value),maxLength:200,placeholder:"例如:这 10 位是本周重点推荐,请 op 优先跟进",className:"w-full rounded border border-gray-300 px-2 py-1.5 text-sm"})]}),j?(0,l.jsx)("div",{className:"text-xs text-red-600",children:j}):null,(0,l.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,l.jsx)("button",{onClick:r,className:"rounded border border-gray-300 px-4 py-1.5 text-sm hover:bg-gray-50",children:"取消"}),(0,l.jsx)("button",{onClick:()=>void I(),disabled:y||"users"===o&&!m.size,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-40",children:y?"创建中…":"生成分享链接"})]})]})]})})}let E=null;function Z(e,t,s){return(0,i.aA)(e,{method:t,headers:{"Content-Type":"application/json"},body:null!=s?JSON.stringify(s):void 0})}let U={create:"建档",move:"阶段迁移",form:"保存表单",invite:"记录邀请",invite_approved:"批准邀请",note:"备注",delete:"移出流程"};function D(e){return(0,l.jsx)(b.Z,{children:(0,l.jsx)(L,{...e})})}function L(e){var t,s,a,r,c;let{jobCaseId:o,canOperate:u=!0}=e,{message:x}=b.Z.useApp(),[h,p]=(0,n.useState)(E),[C,I]=(0,n.useState)("recommended"),[A,O]=(0,n.useState)([]),[P,D]=(0,n.useState)({}),[L,_]=(0,n.useState)(null),[F,M]=(0,n.useState)({}),[B,J]=(0,n.useState)(!1),[R,q]=(0,n.useState)(new Set),[H,W]=(0,n.useState)(new Set),[K,Y]=(0,n.useState)(null),[G,Q]=(0,n.useState)(!1),[V,X]=(0,n.useState)([]),[$,ee]=(0,n.useState)(o),[et,es]=(0,n.useState)(""),[el,ea]=(0,n.useState)(!1),[en,er]=(0,n.useState)(null),[ei,ed]=function(){let[e,t]=(0,n.useState)(null);return[e,(0,n.useCallback)((e,s)=>{navigator.clipboard.writeText(s).then(()=>{t(e),setTimeout(()=>t(t=>t===e?null:t),2500)})},[])]}(),[ec,eo]=(0,n.useState)(!1),[eu]=g.Z.useForm(),[em,ex]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(E)return;let e=!0,t=()=>{E||(0,i.aA)("/recommendations/meta").then(t=>{t&&e&&(E=t,p(t))}).catch(()=>{})};t();let s=(0,S.Lc)(t);return()=>{e=!1,s()}},[h]);let eh=(0,n.useMemo)(()=>{var e;return null!==(e=null==h?void 0:h.stages.map(e=>e.key))&&void 0!==e?e:[]},[h]),ep=(0,n.useCallback)(async()=>{J(!0);try{var e;let t=await (0,i.aA)("/job-cases/".concat(o,"/recommendations"));O(t.items),D(null!==(e=t.counts)&&void 0!==e?e:{}),q(new Set)}catch(e){x.error("列表刷新失败,请手动刷新页面")}finally{J(!1)}},[o,x]);(0,n.useEffect)(()=>{I("recommended"),Y(null),_(null),ep()},[ep]),(0,n.useEffect)(()=>{"matched"===C&&null===L&&(async()=>{var e,t;let[s,l]=await Promise.all([(0,i.aA)("/matching/jobs/".concat(o,"/talents")).catch(()=>[]),(0,i.aA)("/talent-portraits").catch(()=>[])]);_(s);let a={};for(let s of l)a[s.id]=null!==(t=null===(e=s.identity)||void 0===e?void 0:e.displayName)&&void 0!==t?t:"(未命名)";M(a)})()},[C,L,o]);let eb=(0,n.useCallback)(async(e,t)=>{try{let s=await t();(null==s?void 0:s.prompt)&&ed(e,s.prompt)}catch(e){}},[ed]),eg=(e,t,s)=>{let l=new Set(e);l.has(t)?l.delete(t):l.add(t),s(l)},ey=e=>{var t;return e&&h?null!==(t=h.stageLabels[e])&&void 0!==t?t:e:""},ev=async()=>{var e;if(!et||!h)return;let t=null!==(e=h.formTemplates[et])&&void 0!==e?e:[],s={};if(t.length)try{s=await eu.validateFields()}catch(e){return}let l={};for(let e of t){let t="string"==typeof s[e.key]?s[e.key].trim():s[e.key];null!=t&&""!==t&&(l[e.key]=t)}let a=R.size;ea(!0),er(null);try{await Z("/recommendations/batch-move","POST",{ids:Array.from(R),stage:et,jobCaseId:$,formData:Object.keys(l).length?l:void 0})}catch(e){ea(!1),x.error("移动失败,请重试");return}ea(!1),Q(!1),eu.resetFields(),x.success("已移动 ".concat(a," 人到「").concat(ey(et),"」")),await ep()},ej=async()=>{ea(!0),er(null);let e=Array.from(H),t=(await Promise.all(e.map(e=>Z("/recommendations/adopt","POST",{matchId:e}).then(()=>!0,()=>!1)))).filter(e=>!e).length;ea(!1),W(new Set),await ep(),t&&x.warning("".concat(t," 个采纳失败,请重试"))},ef=async()=>{ee(o),es(""),eu.resetFields(),Q(!0);try{var e;let t=await (0,i.aA)("/job-cases?limit=200");X(null!==(e=t.items)&&void 0!==e?e:[])}catch(e){}};if(!h)return(0,l.jsx)("div",{className:"p-4 text-sm text-gray-400",children:"加载推荐流水线定义…"});let eN=[...h.stages.map(e=>{var t;return{key:e.key,label:"".concat(e.label,"(").concat(null!==(t=P[e.key])&&void 0!==t?t:0,")")}})];eN.splice(1,0,{key:"matched",label:"匹配人才(".concat(null!==(s=null==L?void 0:L.length)&&void 0!==s?s:"…",")")});let ek="matched"===C?[]:A.filter(e=>e.stage===C),ew=et&&null!==(a=h.formTemplates[et])&&void 0!==a?a:[];return(0,l.jsxs)("div",{children:[(0,l.jsx)(y.Z,{size:"small",activeKey:C,onChange:e=>{I(e),Y(null)},items:eN.map(e=>({key:e.key,label:e.label}))}),u?(0,l.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:["recommended"===C?(0,l.jsx)(v.ZP,{size:"small",color:"gold",variant:"solid",onClick:()=>void eb("recommend",()=>(0,i.aA)("/job-cases/".concat(o,"/recommend-prompt"))),children:"recommend"===ei?"已复制 ✓ 请发给 agent":"再推荐(复制 prompt)"}):null,"matched"===C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.ZP,{size:"small",color:"gold",variant:"solid",onClick:()=>void eb("match",()=>(0,i.aA)("/job-cases/".concat(o,"/match-prompt"))),children:"match"===ei?"已复制 ✓ 请发给 agent":"打分分析推荐(复制 prompt)"}),(0,l.jsxs)(v.ZP,{size:"small",color:"green",variant:"solid",disabled:!H.size||el,onClick:()=>void ej(),children:["采纳为推荐(",H.size,")"]})]}):null,"pending_invite"===C&&R.size?(0,l.jsx)(v.ZP,{size:"small",color:"blue",variant:"solid",onClick:()=>void eb("invite",()=>Z("/recommendations/invite-prompt","POST",{ids:Array.from(R)})),children:"invite"===ei?"已复制 ✓ 请发给 agent":"发送邀请(".concat(R.size,")")}):null,"invited"===C&&R.size?(0,l.jsx)(v.ZP,{size:"small",color:"blue",variant:"solid",onClick:()=>void eb("reply",()=>Z("/recommendations/reply-check-prompt","POST",{ids:Array.from(R)})),children:"reply"===ei?"已复制 ✓ 请发给 agent":"检查回复(".concat(R.size,")")}):null,"matched"!==C&&R.size?(0,l.jsxs)(v.ZP,{size:"small",onClick:()=>void ef(),children:["移动到…(",R.size,")"]}):null,R.size||H.size?(0,l.jsx)(v.ZP,{size:"small",type:"text",onClick:()=>{q(new Set),W(new Set)},children:"清除选择"}):null,(0,l.jsx)(v.ZP,{size:"small",color:"purple",variant:"solid",className:"ml-auto",onClick:()=>eo(!0),children:"分享给同事"})]}):(0,l.jsx)("div",{className:"mb-3 rounded border border-amber-100 bg-amber-50 px-2 py-1 text-xs text-amber-600",children:"仅该职位的 op/rs 可操作推荐流程,你可查看"}),ec?(0,l.jsx)(z,{jobCaseId:o,onClose:()=>eo(!1)}):null,en?(0,l.jsx)("div",{className:"mb-2 text-xs text-red-500",children:en}):null,B?(0,l.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"加载中…"}):"matched"===C?(0,l.jsx)(function(e){return null===e.matches?(0,l.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"计算匹配中…"}):e.matches.length?(0,l.jsx)("div",{className:"space-y-2",children:e.matches.map(t=>{var s,a,n,r,i,d;return(0,l.jsxs)("div",{className:"rounded border border-gray-200 bg-white p-2",children:[(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[e.canOperate?(0,l.jsx)(k.Z,{checked:e.selected.has(t.id),onChange:()=>e.onToggle(t.id),className:"mt-1"}):null,(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"font-medium text-gray-900",children:null!==(r=e.names[t.portraitId])&&void 0!==r?r:t.portraitId}),(0,l.jsxs)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:[null!==(i=null===(s=t.scores)||void 0===s?void 0:s.overall)&&void 0!==i?i:"?","分"]}),t.humanFeedback?(0,l.jsx)("span",{className:"rounded bg-purple-100 px-1.5 py-0.5 text-xs text-purple-700",children:t.humanFeedback.isRecommended?"已采纳":"已排除"}):null]}),(0,l.jsx)("button",{onClick:()=>e.onExpand(t.id),className:"mt-0.5 text-xs text-blue-500 hover:underline",children:e.expanded===t.id?"收起":"AI 推荐理由"})]})]}),e.expanded===t.id?(0,l.jsxs)("div",{className:"mt-2 border-t border-gray-100 pt-2 text-xs text-gray-600",children:[null!==(d=null===(a=t.recommendation)||void 0===a?void 0:a.aiReason)&&void 0!==d?d:"(无推荐理由)",(null===(n=t.humanFeedback)||void 0===n?void 0:n.reason)?(0,l.jsxs)("div",{className:"mt-1 text-purple-600",children:["人工反馈:",t.humanFeedback.reason]}):null]}):null]},t.id)})}):(0,l.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"暂无人岗匹配数据"})},{matches:L,names:F,selected:H,onToggle:e=>eg(H,e,W),expanded:K,onExpand:e=>Y(K===e?null:e),canOperate:u}):0===ek.length?(0,l.jsxs)("div",{className:"py-8 text-center text-sm text-gray-400",children:["本阶段暂无人选","recommended"===C?",点上方「再推荐」让 agent 寻访":"","pending_invite"===C?",可在人才详情「加入推荐流程」":""]}):(0,l.jsx)("div",{className:"space-y-2",children:ek.map(e=>(0,l.jsx)(eS,{row:e,meta:h,checked:R.has(e.id),onToggle:()=>eg(R,e.id,q),expanded:K===e.id,onExpand:()=>Y(K===e.id?null:e.id),onChanged:ep,canOperate:u,stageLabelOf:ey,onOpenDrawer:()=>ex(e)},e.id))}),(0,l.jsx)(T,{entityId:null!==(r=null==em?void 0:em.entityId)&&void 0!==r?r:null,name:null!==(c=null==em?void 0:null===(t=em.snapshot)||void 0===t?void 0:t.name)&&void 0!==c?c:"(未命名)",open:null!==em,onClose:()=>ex(null)}),(0,l.jsx)(j.Z,{title:"批量移动(".concat(R.size," 人)"),open:G,onCancel:()=>Q(!1),onOk:()=>void ev(),okText:el?"移动中…":"确认移动",cancelText:"取消",confirmLoading:el,okButtonProps:{disabled:!et},destroyOnHidden:!0,width:480,children:(0,l.jsxs)(g.Z,{form:eu,layout:"vertical",preserve:!1,children:[(0,l.jsx)(g.Z.Item,{label:"目标职位",className:"mb-3",children:(0,l.jsx)(f.Z,{size:"small",value:$,onChange:e=>{ee(e),es("")},options:(()=>{let e=V.map(e=>({value:e.id,label:e.title||e.externalId}));return V.find(e=>e.id===o)||e.unshift({value:o,label:"当前职位"}),e})()})}),(0,l.jsx)(g.Z.Item,{label:"目标阶段(当前职位的当前阶段不可选)",className:"mb-3",children:(0,l.jsx)(f.Z,{size:"small",placeholder:"选择阶段…",value:et||void 0,onChange:e=>es(e),options:eh.filter(e=>!($===o&&e===C)).map(e=>({value:e,label:ey(e)}))})}),et?ew.length?(0,l.jsxs)("div",{className:"rounded border border-gray-100 bg-gray-50 p-3",children:[(0,l.jsxs)("div",{className:"mb-2 text-xs font-medium text-gray-600",children:["阶段表单\xb7",ey(et),"(将写入全部 ",R.size," 人)"]}),ew.map(e=>(0,l.jsx)(g.Z.Item,{name:e.key,label:e.label,className:"mb-2",rules:e.required?[{required:!0,message:"请填写".concat(e.label)}]:void 0,children:(0,l.jsx)(N.Z.TextArea,{rows:2,size:"small",placeholder:e.required?"必填":"选填"})},e.key))]}):(0,l.jsx)("div",{className:"rounded border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-400",children:"该阶段无需填写表单信息"}):null]},et||"no-stage")})]});function eS(e){var t,s,a,r,i,c,o,u,x,h,p,b,g,y,j,f,S,C;let I=e.row,A=null!==(x=e.meta.formTemplates[I.stage])&&void 0!==x?x:[],[O,T]=(0,n.useState)(!1),[P,z]=(0,n.useState)({}),E=async()=>{var t;let s={},l=null!==(t=I.formData)&&void 0!==t?t:{};for(let[e,t]of Object.entries(P)){let a="string"==typeof t?t.trim():t;""===a||void 0===a?e in l&&(s[e]=null):l[e]!==a&&(s[e]=a)}for(let e of Object.keys(l))e in P||(s[e]=null);try{await Z("/recommendations/".concat(I.id),"PATCH",Object.keys(s).length?{formData:s}:{})}catch(e){er("保存表单失败,请重试");return}T(!1),await e.onChanged()},D=async()=>{try{await Z("/recommendations/".concat(I.id),"DELETE")}catch(e){er("移出流程失败,请重试");return}await e.onChanged()};return(0,l.jsxs)("div",{className:"rounded border border-gray-200 bg-white p-2",children:[(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[e.canOperate?(0,l.jsx)(k.Z,{checked:e.checked,onChange:e.onToggle,className:"mt-1"}):null,(0,l.jsx)("button",{className:"min-w-0 flex-1 text-left",onClick:e.onExpand,children:(0,l.jsx)(m.h5,{name:null!==(h=null===(t=I.snapshot)||void 0===t?void 0:t.name)&&void 0!==h?h:"(未命名)",headline:null===(s=I.snapshot)||void 0===s?void 0:s.headline,aiReason:null!==(p=null===(a=I.scores)||void 0===a?void 0:a.aiReason)&&void 0!==p?p:null,overall:null!==(b=null===(i=I.scores)||void 0===i?void 0:null===(r=i.dimensions)||void 0===r?void 0:r.overall)&&void 0!==b?b:null,invitationChannel:null!==(g=null===(c=I.invitation)||void 0===c?void 0:c.channel)&&void 0!==g?g:null,stageLabel:e.stageLabelOf(I.stage),updatedAt:I.updatedAt,onNameClick:I.entityId?e.onOpenDrawer:void 0})}),e.canOperate?(0,l.jsx)(w.Z,{title:"把 ".concat(null!==(y=null===(o=I.snapshot)||void 0===o?void 0:o.name)&&void 0!==y?y:"(未命名)"," 移出推荐流程?"),description:"删除后不可恢复",okText:"确认移出",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>void D(),children:(0,l.jsx)("button",{className:"mt-1 text-xs text-gray-300 hover:text-red-500",title:"移出流程",children:"\xd7"})}):null]}),e.expanded?(0,l.jsxs)("div",{className:"mt-2 space-y-3 border-t border-gray-100 pt-2",children:[(0,l.jsxs)("section",{children:[(0,l.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,l.jsxs)("h4",{className:"text-xs font-medium text-gray-700",children:[e.stageLabelOf(I.stage),"\xb7阶段表单"]}),O?(0,l.jsxs)("span",{className:"flex gap-2",children:[(0,l.jsx)(v.ZP,{size:"small",type:"primary",onClick:()=>void E(),children:"保存"}),(0,l.jsx)(v.ZP,{size:"small",onClick:()=>T(!1),children:"取消"})]}):e.canOperate?(0,l.jsx)(v.ZP,{size:"small",type:"link",onClick:()=>{var e;let t={...null!==(e=I.formData)&&void 0!==e?e:{}};for(let e of A)e.key in t||(t[e.key]="");z(t),T(!0)},children:"编辑表单"}):null]}),O?(0,l.jsxs)("div",{className:"space-y-1.5",children:[Object.entries(P).map(e=>{var t,s;let[a,n]=e,r=null!==(s=null===(t=A.find(e=>e.key===a))||void 0===t?void 0:t.label)&&void 0!==s?s:a;return(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"w-40 shrink-0 truncate text-gray-500",title:r,children:r}),(0,l.jsx)(N.Z,{size:"small",value:String(null!=n?n:""),onChange:e=>z({...P,[a]:e.target.value}),className:"min-w-0 flex-1"}),(0,l.jsx)("button",{onClick:()=>{let e={...P};delete e[a],z(e)},className:"text-gray-300 hover:text-red-500",children:"\xd7"})]},a)}),(0,l.jsx)(eC,{onAdd:(e,t)=>z({...P,[e]:t}),existing:Object.keys(P)})]}):(0,l.jsxs)("dl",{className:"space-y-1 text-xs",children:[Object.entries(null!==(j=I.formData)&&void 0!==j?j:{}).length?Object.entries(null!==(f=I.formData)&&void 0!==f?f:{}).map(e=>{var t,s;let[a,n]=e;return(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("dt",{className:"w-40 shrink-0 truncate text-gray-500",children:null!==(s=null===(t=A.find(e=>e.key===a))||void 0===t?void 0:t.label)&&void 0!==s?s:a}),(0,l.jsx)("dd",{className:"min-w-0 flex-1 whitespace-pre-wrap text-gray-800",children:String(n)})]},a)}):(0,l.jsx)("div",{className:"text-gray-400",children:"(表单为空)"}),(null===(u=I.invitation)||void 0===u?void 0:u.sentAt)?(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("dt",{className:"w-40 shrink-0 text-gray-500",children:"邀请发送时间"}),(0,l.jsx)("dd",{className:"text-gray-800",children:(0,d.d3)(I.invitation.sentAt)})]}):null]})]}),(0,l.jsxs)("section",{children:[(0,l.jsx)("h4",{className:"mb-1 text-xs font-medium text-gray-700",children:"操作历史"}),(0,l.jsxs)("ol",{className:"space-y-1 text-xs text-gray-500",children:[[...null!==(S=I.history)&&void 0!==S?S:[]].reverse().map((t,s)=>{var a;return(0,l.jsxs)("li",{className:"flex flex-wrap gap-x-2",children:[(0,l.jsx)("span",{className:"text-gray-400",children:(0,d.d3)(t.at)}),(0,l.jsx)("span",{className:"text-gray-700",children:null!==(a=U[t.action])&&void 0!==a?a:t.action}),t.fromStage?(0,l.jsxs)("span",{children:[e.stageLabelOf(t.fromStage)," → ",e.stageLabelOf(t.toStage)]}):null,t.note?(0,l.jsxs)("span",{className:"text-gray-500",children:["\xb7 ",t.note]}):null,(0,l.jsxs)("span",{className:"text-gray-300",children:["by ",t.by]})]},s)}),(null!==(C=I.history)&&void 0!==C?C:[]).length?null:(0,l.jsx)("li",{className:"text-gray-400",children:"(暂无)"})]})]})]}):null]})}function eC(e){let{onAdd:t,existing:s}=e,[a,r]=(0,n.useState)(""),[i,d]=(0,n.useState)("");return(0,l.jsxs)("div",{className:"flex items-center gap-2 border-t border-dashed border-gray-200 pt-1.5 text-xs",children:[(0,l.jsx)(N.Z,{size:"small",value:a,onChange:e=>r(e.target.value),placeholder:"新字段名",className:"w-32"}),(0,l.jsx)(N.Z,{size:"small",value:i,onChange:e=>d(e.target.value),placeholder:"内容",className:"min-w-0 flex-1"}),(0,l.jsx)(v.ZP,{size:"small",onClick:()=>{let e=a.trim();!e||s.includes(e)||(t(e,i),r(""),d(""))},children:"加一行"})]})}}var _=s(49616);let F=[{key:"active",label:"启动中",cls:"bg-emerald-100 text-emerald-700"},{key:"closed",label:"结束",cls:"bg-gray-300 text-gray-700"}],M=[{key:"op",label:"我是 op",cls:"bg-blue-100 text-blue-700"},{key:"rs",label:"我是 rs",cls:"bg-cyan-100 text-cyan-700"}],B=[{key:"recommended",label:"有推荐"},{key:"invite",label:"邀约中"},{key:"replied",label:"已回复"},{key:"to_client",label:"已推客户"},{key:"interview",label:"面试"},{key:"offer",label:"offer"},{key:"onboarding",label:"入职"}],J=["liepin","linkedin","lagou","zhaopin","51job","boss"];function R(e){var t,s;let l;let a=(null!==(t=e.folderPath)&&void 0!==t?t:"").split("/").filter(Boolean).filter(e=>!["job","jd","raw"].includes(e));return(l=e.title)&&!["job","jd","raw"].includes(l)?e.title:null!==(s=a.at(-1))&&void 0!==s?s:"职位 #".concat(e.id)}function q(e){let t=e.requirements;if(!t)return;let s=[t.company,t.location,t.salary].map(e=>"string"==typeof e?e.trim():"").filter(Boolean);return s.length?s.join(" \xb7 "):void 0}function H(){var e,t;let s=(0,r.useRouter)(),a=(0,r.useSearchParams)(),d=a.get("id"),[u,b]=(0,n.useState)({}),[g,y]=(0,n.useState)(new Set),[v,j]=(0,n.useState)(""),[k,w]=(0,n.useState)(""),[S,C]=(0,n.useState)(null),[I,A]=(0,n.useState)(!1),[O,T]=(0,n.useState)(!1),[P,z]=(0,n.useState)(0),{session:E,sync:Z}=(0,p.nu)(),U=null!==(e=null==E?void 0:E.hmUserId)&&void 0!==e?e:null,D=null!==(t=null==Z?void 0:Z.activeTenantId)&&void 0!==t?t:null,L=a.get("st")||"",_=a.get("rel")||"",H=a.get("cust")||"",K=a.get("stage")||"",Y=a.get("ch")||"",G=(0,n.useMemo)(()=>L.split(",").map(e=>e.trim()).filter(Boolean),[L]),Q=(0,n.useMemo)(()=>K?K.split(",").map(e=>e.trim()).filter(Boolean):[],[K]),V=(0,n.useMemo)(()=>Y?Y.split(",").map(e=>e.trim()).filter(Boolean):[],[Y]),X=!!(L||_||H||K||Y),$=(0,n.useMemo)(()=>_?_.split(",").map(e=>e.trim()).filter(Boolean):X?[]:["op","rs"],[_,X]),[ee,et]=(0,n.useState)(!1),[es,el]=(0,n.useState)(!1),ea=(0,n.useMemo)(()=>X||es||!ee?$:[],[X,es,ee,$]),[en,er]=(0,n.useState)({active:0,closed:0}),[ei,ed]=(0,n.useState)({}),[ec,eo]=(0,n.useState)({}),[eu,em]=(0,n.useState)({}),[ex,eh]=(0,n.useState)(!1),[ep,eb]=(0,n.useState)(""),[eg,ey]=(0,n.useState)(!1),[ev,ej]=(0,n.useState)(null),ef=(0,x.B)({deleteUrl:"/job-cases",label:"职位",onDeleted:()=>ek.refresh(),currentUserId:U}),eN=(0,n.useMemo)(()=>Array.from(ef.selectedIds),[ef.selectedIds]),ek=(0,h.k)({fetchPage:(0,n.useCallback)(async(e,t)=>{var s;let l=new URLSearchParams;l.set("q",k),l.set("limit",String(t)),l.set("offset",String(e)),G.length&&l.set("status",G.join(",")),ea.length&&l.set("relation",ea.join(",")),H&&l.set("customerId",H),K&&l.set("stage",K),Y&&l.set("channel",Y);let a=await (0,i.aA)("/job-cases?".concat(l.toString()));er(null!==(s=a.statusCounts)&&void 0!==s?s:{active:0,closed:0});let n=a.items.map(e=>e.id);return n.length&&((0,i.aA)("/recommendations/summary?ids=".concat(n.join(","))).then(e=>{ed(t=>({...t,...e}))}).catch(()=>{}),(0,i.aA)("/job-case-postings?ids=".concat(n.join(","))).then(e=>{eo(t=>({...t,...e}))}).catch(()=>{})),{items:a.items,total:a.total}},[k,G,ea,H,K,Y,D]),pageSize:50,deps:[k,G,ea,H,K,Y,D]});(0,n.useEffect)(()=>{X||ee||es||ek.loading||ek.error||0!==ek.total||et(!0)},[X,ee,es,ek.loading,ek.error,ek.total]),(0,n.useEffect)(()=>{et(!1),el(!1)},[D]),(0,n.useEffect)(()=>{let e=setTimeout(()=>w(v.trim()),300);return()=>clearTimeout(e)},[v]),(0,n.useEffect)(()=>{(0,i.aA)("/customers").then(e=>{let t={},s=new Set;for(let a of e){var l;t[a.id]=a.canonicalName,(null===(l=a.dedupKey)||void 0===l?void 0:l.startsWith("placeholder:"))&&s.add(a.id)}b(t),y(s)}).catch(()=>{b({}),y(new Set)})},[D]),(0,n.useEffect)(()=>{(0,i.aA)("/job-cases/tenant-members").then(e=>{var t;let s={};for(let l of null!==(t=e.items)&&void 0!==t?t:[])s[l.hmUserId]=l;em(s)}).catch(()=>{em({})})},[D]);let ew=(0,n.useCallback)(e=>{var t,s;return null==e?void 0:null!==(s=null===(t=eu[e])||void 0===t?void 0:t.label)&&void 0!==s?s:e===U?"我":"用户 #".concat(e)},[eu,U]);(0,n.useEffect)(()=>{ef.prune(ek.items.map(e=>String(e.id)))},[ek.items,ef]),(0,n.useEffect)(()=>{if(!d){C(null),T(!1);return}A(!0),T(!1),(0,i.aA)("/job-cases/".concat(d)).then(e=>{C(e)}).catch(()=>{C(null),T(!0)}).finally(()=>{A(!1)})},[d,D,P]);let eS=(0,n.useCallback)(e=>{let t=new URLSearchParams(a.toString());e.id?t.set("id",e.id):null===e.id&&t.delete("id"),void 0!==e.st&&(e.st.length?t.set("st",e.st.join(",")):t.delete("st")),void 0!==e.rel&&(e.rel.length?t.set("rel",e.rel.join(",")):t.delete("rel")),void 0!==e.cust&&(e.cust?t.set("cust",e.cust):t.delete("cust")),void 0!==e.stage&&(e.stage.length?t.set("stage",e.stage.join(",")):t.delete("stage")),void 0!==e.ch&&(e.ch.length?t.set("ch",e.ch.join(",")):t.delete("ch")),s.replace("/jobs?".concat(t.toString()))},[s,a]),eC=(0,n.useCallback)(e=>{var t;return null==U?null:e.ownerId===U?"op":(null!==(t=e.rsUserIds)&&void 0!==t?t:[]).includes(U)?"rs":null},[U]),eI=(0,n.useMemo)(()=>ek.items.map(e=>{var t,s,a,n,r;return{id:String(e.id),content:(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[ef.checkbox(String(e.id)),(0,l.jsx)(m.dy,{title:null!==(t=R(e))&&void 0!==t?t:"(职位 #".concat(e.id,")"),status:e.status,hmhLocal:(null!==(s=e.folderPath)&&void 0!==s?s:"").includes("/local/clients/"),subtitle:q(e),customerName:null!==(n=e.customerName)&&void 0!==n?n:e.customerId?null!==(a=u[e.customerId])&&void 0!==a?a:"客户 #".concat(e.customerId):"未关联客户",opName:null!=e.ownerId?ew(e.ownerId):void 0,rsNames:(null!==(r=e.rsUserIds)&&void 0!==r?r:[]).map(e=>{var t;return null!==(t=ew(e))&&void 0!==t?t:"用户 #".concat(e)}),updatedAt:e.updatedAt,createdAt:e.createdAt,stages:ei[e.id],platforms:ec[e.id],myRole:eC(e)})]})}}),[ek.items,u,ef,ei,ec,eC,ew]),eA=(0,n.useMemo)(()=>{let e=new Set;for(let t of Object.values(ec))for(let s of t)e.add(s);for(let t of J)e.add(t);return Array.from(e)},[ec]),eO=async()=>{let e;let t=Number(ep),s=eN.map(Number).filter(e=>e!==t);if(!t||!s.length)return;ey(!0);try{e=await (0,i.aA)("/job-cases/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetId:t,sourceIds:s})})}catch(e){ey(!1),eh(!1),ej("合并失败(服务无响应),请重试");return}ey(!1),eh(!1);let l=Object.values(e.moved).reduce((e,t)=>e+t,0);ej("已合并 ".concat(e.sourceIds.length," 个职位 → #").concat(e.targetId,",迁移 ").concat(l," 条关联")+(e.matchConflicts?",匹配冲突按高分保留 ".concat(e.matchConflicts," 处"):"")),ef.clear(),ek.refresh(),setTimeout(()=>ej(null),8e3)},eT=d?I?(0,l.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):O?(0,l.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,l.jsx)("button",{type:"button",onClick:()=>z(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):S?(0,l.jsx)(W,{detail:S,customers:u,placeholderCusts:g,myUserId:U}):(0,l.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该职位"}):(0,l.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"请在左侧选择一个职位查看详情"}),eP=G.length>0||$.length>0||H||K||Y||ee;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.m,{filterBar:(0,l.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,l.jsx)(N.Z,{allowClear:!0,size:"small",value:v,onChange:e=>j(e.target.value),placeholder:"搜索职位/客户/路径…"}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"w-12 shrink-0 text-gray-400",children:"状态:"}),F.map(e=>{let t=G.includes(e.key);return(0,l.jsxs)("button",{type:"button",title:t?"点击取消该状态筛选":"点击按该状态过滤(可多选)",onClick:()=>eS({st:t?G.filter(t=>t!==e.key):[...G,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," ",en[e.key]]},e.key)}),(0,l.jsx)("span",{className:"mx-1 text-gray-300",children:"|"}),(0,l.jsx)("span",{className:"text-gray-400",children:"关系:"}),M.map(e=>{let t=$.includes(e.key);return(0,l.jsx)("button",{type:"button",title:t?"点击取消该关系筛选":"点击按该关系过滤(op∨rs=我操作的)",onClick:()=>eS({rel:t?$.filter(t=>t!==e.key):[...$,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},e.key)}),(0,l.jsx)("span",{className:"mx-1 text-gray-300",children:"|"}),(0,l.jsx)("button",{type:"button",title:"unlinked"===H?"点击取消未关联客户筛选":"只显示未关联客户的职位",onClick:()=>eS({cust:"unlinked"===H?"":"unlinked"}),className:"rounded bg-amber-100 px-1.5 py-0.5 text-xs text-amber-700 transition ".concat("unlinked"===H?"ring-1 ring-current":"opacity-40 hover:opacity-80"),children:"未关联客户"}),(0,l.jsxs)("span",{className:"ml-auto text-gray-400",children:["共 ",ek.total," 个"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"w-12 shrink-0 text-gray-400",children:"客户:"}),(0,l.jsx)(f.Z,{size:"small",showSearch:!0,allowClear:!0,placeholder:"全部客户",style:{minWidth:220},value:H&&"unlinked"!==H?Number(H):void 0,onChange:e=>eS({cust:e?String(e):""}),options:Object.entries(u).sort((e,t)=>e[1].localeCompare(t[1],"zh")).map(e=>{let[t,s]=e;return{value:Number(t),label:s}})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"w-12 shrink-0 text-gray-400",children:"招聘状态:"}),(0,l.jsx)(f.Z,{mode:"multiple",size:"small",allowClear:!0,maxTagCount:"responsive",placeholder:"全部",style:{minWidth:260},value:Q,onChange:e=>eS({stage:e}),options:B.map(e=>({value:e.key,label:e.label}))})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,l.jsx)("span",{className:"w-12 shrink-0 text-gray-400",children:"渠道:"}),(0,l.jsx)(f.Z,{mode:"multiple",size:"small",allowClear:!0,maxTagCount:"responsive",placeholder:"全部",style:{minWidth:220},value:V,onChange:e=>eS({ch:e}),options:eA.map(e=>({value:e,label:e}))})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[eP&&(0,l.jsx)("button",{type:"button",onClick:()=>{et(!1),el(!1),eS({st:[],rel:[],cust:"",stage:[],ch:[]})},className:"text-xs text-gray-400 hover:text-gray-600",children:"清除筛选"}),!ee||es||X?null:(0,l.jsx)("button",{type:"button",title:"无我操作的职位,已显示全部;点击恢复只看自己参与的",onClick:()=>el(!0),className:"rounded bg-indigo-50 px-1.5 py-0.5 text-xs text-indigo-600 hover:bg-indigo-100",children:"已显示全部(无我操作的)→ 只看我的"})]}),ef.bar(eI),eN.length>=2?(0,l.jsxs)("button",{type:"button",onClick:()=>{eb(eN[0]),eh(!0)},className:"mt-1 rounded bg-indigo-600 px-2.5 py-1 text-xs text-white hover:bg-indigo-700",children:["合并所选职位(",eN.length,")"]}):null,ev?(0,l.jsx)("div",{className:"mt-1 text-xs text-emerald-600",children:ev}):null]}),listPanel:ek.error?(0,l.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,l.jsx)("span",{className:"text-red-500",children:"加载失败"}),(0,l.jsx)("button",{type:"button",onClick:()=>ek.refresh(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,l.jsx)(o.L,{items:eI,selectedId:null!=d?d:void 0,onSelect:e=>eS({id:e}),loading:ek.loading,emptyText:"暂无职位",onLoadMore:ek.loadMore,loadingMore:ek.loadingMore,exhausted:ek.exhausted}),detailPanel:eT}),ef.modal(),ex?(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",children:(0,l.jsxs)("div",{className:"w-96 rounded-lg bg-white p-4 shadow-xl",children:[(0,l.jsxs)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:["合并职位(保留目标,其余 ",eN.length-1," 个结束)"]}),(0,l.jsx)("p",{className:"mb-3 text-xs text-gray-500",children:"源职位的推荐流水/发布/简历/画像/评估/沟通记录全部迁到目标职位;同人才匹配冲突保留高分。"}),(0,l.jsx)("div",{className:"mb-3 max-h-48 space-y-1 overflow-auto",children:eN.map(e=>{var t;let s=ek.items.find(t=>String(t.id)===e);return(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,l.jsx)("input",{type:"radio",name:"merge-target",checked:ep===e,onChange:()=>eb(e)}),(0,l.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:["#",e," ",s?R(s):"",s?(0,l.jsxs)("span",{className:"text-xs text-gray-400",children:[" ",null!==(t=q(s))&&void 0!==t?t:""]}):null]})]},e)})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>eh(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"取消"}),(0,l.jsx)("button",{type:"button",onClick:()=>void eO(),disabled:!ep||eg,className:"rounded bg-indigo-600 px-3 py-1 text-xs text-white hover:bg-indigo-700 disabled:opacity-40",children:eg?"合并中…":"确认合并"})]})]})}):null]})}function W(e){var t,s,a;let{detail:r,customers:i,placeholderCusts:c,myUserId:o}=e,[u,m]=(0,n.useState)("info"),x=null!=o&&(r.ownerId===o||(null!==(t=r.rsUserIds)&&void 0!==t?t:[]).includes(o));return(0,l.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,l.jsx)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:null!==(s=r.title)&&void 0!==s?s:"职位 #".concat(r.id)}),(0,l.jsxs)("div",{className:"mb-3 text-xs text-gray-400",children:["externalId: ",r.externalId," \xb7 更新于 ",(0,d.d3)(r.updatedAt)]}),(0,l.jsx)("div",{className:"mb-4 flex gap-1 border-b border-gray-200",children:[{key:"info",label:"职位信息"},{key:"members",label:"成员"},{key:"criteria",label:"找人条件"},{key:"history",label:"历史"},{key:"pipeline",label:"推荐流程"},{key:"publish",label:"发布管理"}].map(e=>(0,l.jsx)("button",{onClick:()=>m(e.key),className:"rounded-t px-3 py-1.5 text-sm ".concat(u===e.key?"bg-gray-100 font-medium text-gray-900":"text-gray-500 hover:text-gray-700"),children:e.label},e.key))}),"info"===u?(0,l.jsx)(K,{detail:r,customers:i,placeholderCusts:c,myUserId:o}):"members"===u?(0,l.jsx)(Y,{detail:r,myUserId:o},"".concat(r.id,"-").concat(null!=o?o:"anon")):"criteria"===u?(0,l.jsx)(G,{detail:r,myUserId:o},"".concat(r.id,"-").concat(null!=o?o:"anon")):"history"===u?(0,l.jsx)(X,{jobCaseId:r.id},r.id):"pipeline"===u?(0,l.jsx)(D,{jobCaseId:r.id,canOperate:x},r.id):(0,l.jsx)(_.I,{jobCaseId:r.id,caseTitle:null!==(a=r.title)&&void 0!==a?a:"职位 #".concat(r.id),canOperate:x},r.id)]})}function K(e){var t,s,a;let{detail:d,customers:c,placeholderCusts:o,myUserId:m}=e,x=(0,r.useRouter)(),[h,p]=(0,n.useState)(!1),[b,g]=(0,n.useState)(null),[y,v]=(0,n.useState)(!1),[j,f]=(0,n.useState)(null!==(t=d.title)&&void 0!==t?t:""),[N,k]=(0,n.useState)(d.customerId?String(d.customerId):""),[w,S]=(0,n.useState)(!1),C=null!=m&&d.ownerId===m,I=null==d.customerId||o.has(d.customerId),A=async(e,t)=>{let s;p(!0),g(null);try{s=await (0,i.aA)("/job-cases/".concat(d.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){return p(!1),g(t),null}return p(!1),x.refresh(),location.reload(),s},O=async()=>{S(!0),g(null);try{await (0,i.aA)("/job-cases/".concat(d.id,"/op/claim"),{method:"POST"})}catch(e){S(!1),g("申请 op 失败:该职位可能已有 op,或服务无响应");return}S(!1),location.reload()};return(0,l.jsxs)("div",{children:[I&&C?(0,l.jsxs)("div",{className:"mb-4 rounded border border-amber-300 bg-amber-50 p-3",children:[(0,l.jsx)("div",{className:"mb-2 text-sm font-medium text-amber-800",children:"该职位尚未关联客户,请先选择客户公司(客户不能为空)"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"rounded border border-amber-300 px-2 py-1.5 text-sm",children:[(0,l.jsx)("option",{value:"",children:"选择客户…"}),Object.entries(c).sort((e,t)=>e[1].localeCompare(t[1],"zh")).map(e=>{let[t,s]=e;return(0,l.jsx)("option",{value:t,children:s},t)})]}),(0,l.jsx)("button",{type:"button",disabled:!N||h,onClick:()=>void A({customerId:Number(N)},"关联客户失败,请重试"),className:"rounded bg-amber-600 px-3 py-1.5 text-xs text-white hover:bg-amber-700 disabled:opacity-40",children:h?"保存中…":"确认关联"})]})]}):null,I&&!C?(0,l.jsx)("div",{className:"mb-4 rounded border border-gray-200 bg-gray-50 p-3 text-sm text-gray-500",children:"该职位尚未关联客户,请联系 op 选择客户公司"}):null,(0,l.jsxs)("div",{className:"mb-4 rounded border border-gray-200 bg-gray-50 p-2",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,l.jsx)("span",{className:"text-gray-500",children:"状态:"}),(0,l.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat("active"===d.status?"bg-emerald-100 text-emerald-700":"bg-gray-300 text-gray-700"),children:"active"===d.status?"启动中":"结束"}),null==d.ownerId?(0,l.jsx)("button",{type:"button",disabled:w,onClick:()=>void O(),className:"rounded bg-blue-600 px-2.5 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:w?"申请中…":"申请做 op(无人管理,直接生效)"}):null,C&&!I?"active"===d.status?(0,l.jsx)("button",{type:"button",disabled:h,onClick:()=>void A({status:"closed"},"状态更新失败(仅 op 可操作)"),className:"rounded border border-gray-300 px-2.5 py-1 text-xs text-gray-600 hover:bg-gray-100",children:"结束职位"}):(0,l.jsx)("button",{type:"button",disabled:h,onClick:()=>void A({status:"active"},"状态更新失败(仅 op 可操作)"),className:"rounded bg-emerald-600 px-2.5 py-1 text-xs text-white hover:bg-emerald-700",children:"重新启动"}):null,C||null==d.ownerId?null:(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"仅 op 可切换状态"})]}),b?(0,l.jsx)("div",{className:"mt-1 text-xs text-red-500",children:b}):null]}),d.customerId?(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[(0,l.jsxs)("a",{href:"/companies?id=".concat(d.customerId),className:"inline-flex items-center gap-2 rounded border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800 hover:border-amber-400",children:[(0,l.jsx)("span",{className:"text-gray-500",children:"客户公司:"}),(0,l.jsx)("span",{className:"font-medium",children:null!==(s=c[d.customerId])&&void 0!==s?s:"#".concat(d.customerId)}),(0,l.jsx)("span",{className:"text-xs text-amber-500",children:"查看公司详情 →"})]}),C?(0,l.jsx)("select",{value:String(d.customerId),onChange:e=>{e.target.value&&Number(e.target.value)!==d.customerId&&A({customerId:Number(e.target.value)},"更换客户失败:同客户下可能已有同名职位")},className:"rounded border border-gray-300 px-2 py-1.5 text-xs text-gray-600",children:Object.entries(c).sort((e,t)=>e[1].localeCompare(t[1],"zh")).map(e=>{let[t,s]=e;return(0,l.jsx)("option",{value:t,children:s},t)})}):null]}):null,(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:"职位名"}),C&&!y?(0,l.jsx)("button",{type:"button",onClick:()=>{var e;f(null!==(e=d.title)&&void 0!==e?e:""),v(!0)},className:"text-xs text-blue-600 hover:underline",children:"修改"}):null]}),y?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:j,onChange:e=>f(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"}),(0,l.jsx)("button",{type:"button",disabled:!j.trim()||h,onClick:()=>{A({title:j.trim()},"改名失败:同客户下可能已有同名职位").then(e=>{e&&v(!1)})},className:"rounded bg-blue-600 px-2.5 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:"保存"}),(0,l.jsx)("button",{type:"button",onClick:()=>v(!1),className:"rounded border border-gray-300 px-2.5 py-1 text-xs text-gray-600",children:"取消"})]}):(0,l.jsx)("div",{className:"text-sm text-gray-700",children:null!==(a=d.title)&&void 0!==a?a:"—"})]}),d.folderPath?(0,l.jsxs)("div",{className:"mb-4 break-all text-xs text-gray-500",children:["文件夹:",d.folderPath]}):null,d.requirements&&Object.keys(d.requirements).length>0?(0,l.jsxs)("section",{className:"mb-4",children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"职位要求(requirements)"}),(0,l.jsx)(u.Y,{data:d.requirements})]}):null,d.rawFiles&&Object.keys(d.rawFiles).length>0?(0,l.jsxs)("section",{children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"原始文件(rawFiles)"}),(0,l.jsx)(u.Y,{data:d.rawFiles})]}):null]})}function Y(e){let{detail:t,myUserId:s}=e,[a,r]=(0,n.useState)({op:null,rs:[]}),[d,c]=(0,n.useState)([]),[o,u]=(0,n.useState)(null),[m,x]=(0,n.useState)(!1),[h,p]=(0,n.useState)(""),[b,g]=(0,n.useState)(""),y=(0,n.useCallback)(()=>{(async()=>{try{let e=await (0,i.aA)("/job-cases/".concat(t.id,"/members"));r(e)}catch(e){}})()},[t.id]);(0,n.useEffect)(()=>{y(),(async()=>{try{let e=await (0,i.aA)("/job-cases/tenant-members");c(e.items)}catch(e){}})()},[y]);let v=e=>{var t,l;return null!==(l=null===(t=d.find(t=>t.hmUserId===e))||void 0===t?void 0:t.label)&&void 0!==l?l:e===s?"我":"用户 #".concat(e)},j=null!=s&&a.op===s,f=async function(e,s){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"操作失败(仅 op 可操作)";x(!0),u(null);try{await (0,i.aA)("/job-cases/".concat(t.id).concat(e),{method:e.startsWith("/rs/")?"DELETE":"POST",headers:{"Content-Type":"application/json"},body:null!=s?JSON.stringify(s):void 0})}catch(e){x(!1),u(l);return}x(!1),y()},N=d.filter(e=>e.hmUserId!==a.op&&!a.rs.includes(e.hmUserId));return(0,l.jsxs)("div",{children:[(0,l.jsxs)("section",{className:"mb-4",children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"op(职位管理者,唯一)"}),null!=a.op?(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,l.jsxs)("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-blue-700",children:[v(a.op),a.op===s?"(我)":""]}),j?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs",children:[(0,l.jsxs)("select",{value:h,onChange:e=>p(e.target.value),className:"rounded border border-gray-300 px-1.5 py-0.5",children:[(0,l.jsx)("option",{value:"",children:"转移给…"}),d.filter(e=>e.hmUserId!==a.op).map(e=>{var t;return(0,l.jsx)("option",{value:e.hmUserId,children:null!==(t=e.label)&&void 0!==t?t:"用户 #".concat(e.hmUserId)},e.hmUserId)})]}),(0,l.jsx)("button",{type:"button",disabled:!h||m,onClick:()=>void f("/op/transfer",{userId:Number(h)},"转移失败,请重试").then(()=>p("")),className:"rounded border border-blue-300 px-2 py-0.5 text-blue-600 hover:bg-blue-50 disabled:opacity-40",children:"确认转移"}),(0,l.jsx)("span",{className:"text-gray-400",children:"直接生效,无需对方确认"})]}):null]}):(0,l.jsx)("div",{className:"text-sm text-gray-500",children:"当前无 op——到「职位信息」tab 点「申请做 op」即可直接接管(无需审批)"})]}),(0,l.jsxs)("section",{className:"mb-4",children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"rs(协作成员,可多个)"}),a.rs.length?(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.rs.map(e=>(0,l.jsxs)("span",{className:"flex items-center gap-1 rounded bg-cyan-100 px-2 py-0.5 text-cyan-700",children:[v(e),e===s?"(我)":"",j?(0,l.jsx)("button",{type:"button",disabled:m,onClick:()=>void(0,i.aA)("/job-cases/".concat(t.id,"/rs/").concat(e),{method:"DELETE"}).then(()=>y()).catch(()=>u("移除失败(仅 op 可操作)")),className:"text-cyan-500 hover:text-red-500",title:"移除该 rs",children:"\xd7"}):null]},e))}):(0,l.jsx)("div",{className:"text-sm text-gray-400",children:"暂无 rs"}),j?(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-xs",children:[(0,l.jsxs)("select",{value:b,onChange:e=>g(e.target.value),className:"rounded border border-gray-300 px-1.5 py-0.5",children:[(0,l.jsx)("option",{value:"",children:"添加 rs(限同租户成员)…"}),N.map(e=>{var t;return(0,l.jsx)("option",{value:e.hmUserId,children:null!==(t=e.label)&&void 0!==t?t:"用户 #".concat(e.hmUserId)},e.hmUserId)})]}),(0,l.jsx)("button",{type:"button",disabled:!b||m,onClick:()=>void f("/rs",{userId:Number(b)},"添加失败:目标须为同租户在租成员").then(()=>g("")),className:"rounded bg-cyan-600 px-2 py-0.5 text-white hover:bg-cyan-700 disabled:opacity-40",children:"添加"})]}):null]}),o?(0,l.jsx)("div",{className:"text-xs text-red-500",children:o}):null]})}function G(e){var t;let{detail:s,myUserId:a}=e,[r,d]=(0,n.useState)([]),[c,o]=(0,n.useState)(null),[u,m]=(0,n.useState)(null),[x,h]=(0,n.useState)(!1),[p,b]=(0,n.useState)(!1),[g,y]=(0,n.useState)([]),v=(0,n.useCallback)(()=>{(async()=>{try{let e=await (0,i.aA)("/job-cases/".concat(s.id,"/criteria"));d(e.items)}catch(e){}})()},[s.id]);(0,n.useEffect)(()=>{v()},[v]);let j=r.find(e=>e.userId===(null!=a?a:0));r.find(e=>{var t;return e.userId===(null!==(t=s.ownerId)&&void 0!==t?t:-1)});let f=null!=a&&(s.ownerId===a||(null!==(t=s.rsUserIds)&&void 0!==t?t:[]).includes(a)),N=()=>{var e;y((null!==(e=null==j?void 0:j.criteria)&&void 0!==e?e:[]).map(e=>{var t;return{dimension:e.dimension,value:"string"==typeof e.value?e.value:JSON.stringify(e.value),weight:String(null!==(t=e.weight)&&void 0!==t?t:1)}})),b(!0),o(null)},k=async()=>{let e;let t=g.filter(e=>e.dimension.trim()&&e.value.trim()).map(e=>{let t=e.value.trim();try{t=JSON.parse(e.value)}catch(e){}return{dimension:e.dimension.trim(),value:t,weight:Number(e.weight)||1}});if(!t.length){o("至少保留一条条件(dimension + value)");return}h(!0),o(null);try{e=await (0,i.aA)("/job-cases/".concat(s.id,"/criteria"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:t})})}catch(e){h(!1),o("保存失败,请重试");return}h(!1),d(e.items),b(!1)},w=async e=>{let t;h(!0),o(null),m(null);try{t=await (0,i.aA)("/job-cases/".concat(s.id,"/criteria/merge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fromUserId:e,mode:"apply"})})}catch(e){h(!1),o("叠加失败,请重试");return}h(!1),m("已叠加 ".concat(t.applied," 条新条件到我的条件")),v()},S=e=>(0,l.jsx)("ul",{className:"space-y-1",children:e.map((e,t)=>(0,l.jsxs)("li",{className:"text-xs text-gray-600",children:[(0,l.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-gray-500",children:e.dimension})," ","string"==typeof e.value?e.value:JSON.stringify(e.value),1!==e.weight?(0,l.jsxs)("span",{className:"text-gray-400",children:["(权重 ",e.weight,")"]}):null]},t))});return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("p",{className:"text-xs text-gray-400",children:"招人条件按人维护:op 一份(=职位共享规则),每个 rs 一份。agent 找人默认按「op 条件 + 自己那份」;可叠加他人条件后选择是否更新自己那份。"}),null==a?(0,l.jsx)("div",{className:"rounded border border-gray-200 bg-gray-50 p-2 text-xs text-gray-500",children:"未登录同步用户,展示全部条件(本机工具视角)"}):null,null==a||f?null:(0,l.jsx)("div",{className:"rounded border border-amber-100 bg-amber-50 p-2 text-xs text-amber-600",children:"仅该职位的 op/rs 可维护找人条件,你可查看"}),0!==r.length||p?r.map(e=>{let t=null!=a&&e.userId===a,n=null!=s.ownerId&&e.userId===s.ownerId,r=t?"我的条件":n?"op 的条件(职位共享,#".concat(e.userId,")"):"用户 #".concat(e.userId," 的条件");return(0,l.jsxs)("section",{className:"rounded border border-gray-200 p-3",children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:r}),t&&null!=a&&!p&&f?(0,l.jsx)("button",{type:"button",onClick:N,className:"text-xs text-blue-600 hover:underline",children:"编辑我的条件"}):null,t||null==a||p||!f?null:(0,l.jsx)("button",{type:"button",disabled:x,onClick:()=>void w(e.userId),className:"text-xs text-indigo-600 hover:underline disabled:opacity-40",children:"叠加到我的条件"})]}),t&&p?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"(正在下方编辑我的条件)"}):e.criteria.length?S(e.criteria):(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"(空)"})]},e.userId)}):(0,l.jsx)("div",{className:"text-sm text-gray-400",children:"暂无找人条件"}),null!=a&&p&&f?(0,l.jsxs)("section",{className:"rounded border border-gray-200 p-3",children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"我的条件(编辑中)"}),(0,l.jsxs)("div",{className:"space-y-2",children:[g.map((e,t)=>(0,l.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,l.jsx)("input",{type:"text",value:e.dimension,placeholder:"维度,如 city/skill/school",onChange:e=>y(g.map((s,l)=>l===t?{...s,dimension:e.target.value}:s)),className:"w-36 rounded border border-gray-300 px-1.5 py-0.5"}),(0,l.jsx)("input",{type:"text",value:e.value,placeholder:"值(字符串或 JSON)",onChange:e=>y(g.map((s,l)=>l===t?{...s,value:e.target.value}:s)),className:"w-56 rounded border border-gray-300 px-1.5 py-0.5"}),(0,l.jsx)("input",{type:"text",value:e.weight,placeholder:"权重",onChange:e=>y(g.map((s,l)=>l===t?{...s,weight:e.target.value}:s)),className:"w-14 rounded border border-gray-300 px-1.5 py-0.5"}),(0,l.jsx)("button",{type:"button",onClick:()=>y(g.filter((e,s)=>s!==t)),className:"text-gray-400 hover:text-red-500",children:"\xd7"})]},t)),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>y([...g,{dimension:"",value:"",weight:"1"}]),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600",children:"+ 加一条"}),(0,l.jsx)("button",{type:"button",disabled:x,onClick:()=>void k(),className:"rounded bg-blue-600 px-2.5 py-0.5 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:x?"保存中…":"保存(整体替换我的条件)"}),(0,l.jsx)("button",{type:"button",onClick:()=>b(!1),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600",children:"取消"})]})]})]}):null,null==a||j||p||!f?null:(0,l.jsx)("button",{type:"button",onClick:N,className:"rounded bg-blue-600 px-2.5 py-1 text-xs text-white hover:bg-blue-700",children:"添加我的条件"}),u?(0,l.jsx)("div",{className:"text-xs text-emerald-600",children:u}):null,c?(0,l.jsx)("div",{className:"text-xs text-red-500",children:c}):null,(0,l.jsx)(Q,{externalId:s.externalId})]})}function Q(e){let{externalId:t}=e,[s,a]=(0,n.useState)(null),[r,c]=(0,n.useState)(!1),[o,u]=(0,n.useState)("");(0,n.useEffect)(()=>{let e=!0;return(async()=>{try{var s;let l=await (0,i.aA)("/searchlog?jobCaseExternalId=".concat(encodeURIComponent(t),"&limit=100"));e&&a(null!==(s=l.items)&&void 0!==s?s:[])}catch(t){e&&(a([]),c(!0))}})(),()=>{e=!1}},[t]);let m=Array.from(new Set((null!=s?s:[]).map(e=>e.actorEmail).filter(Boolean))),x=(null!=s?s:[]).filter(e=>!o||e.actorEmail===o),h=e=>{let t="string"==typeof e?e:JSON.stringify(e);return t&&t.length>160?"".concat(t.slice(0,160),"…"):null!=t?t:""};return(0,l.jsxs)("section",{className:"rounded border border-gray-200 p-3",children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:"agent 找人历史"}),m.length>1?(0,l.jsxs)("label",{className:"flex items-center gap-1 text-xs text-gray-500",children:["按用户:",(0,l.jsxs)("select",{value:o,onChange:e=>u(e.target.value),className:"rounded border border-gray-300 px-1.5 py-0.5 text-xs",children:[(0,l.jsx)("option",{value:"",children:"全部"}),m.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})]}):null]}),null===s?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:"加载中…"}):0===x.length?(0,l.jsx)("div",{className:"text-xs text-gray-400",children:r?"历史服务不可用(需 hm 0.1.23+ 且已登录),不影响找人条件":"暂无搜索历史——agent 每轮搜索后会自动登记"}):(0,l.jsx)("ul",{className:"space-y-2",children:x.map(e=>{var t;return(0,l.jsxs)("li",{className:"rounded border border-gray-100 bg-gray-50 p-2 text-xs text-gray-600",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-gray-500",children:[(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"rounded bg-blue-50 px-1.5 py-0.5 text-blue-600",children:e.platform})," ",null!==(t=e.actorEmail)&&void 0!==t?t:"#".concat(e.actorHmUserId),e.model&&"unknown"!==e.model?(0,l.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.model]}):null]}),(0,l.jsx)("span",{children:(0,d.d3)(e.createdAt)})]}),(0,l.jsxs)("div",{className:"mt-1",children:[(0,l.jsx)("span",{className:"text-gray-400",children:"条件:"})," ",h(e.conditions)]}),(0,l.jsxs)("div",{className:"mt-0.5",children:[(0,l.jsx)("span",{className:"text-gray-400",children:"结果:"})," ",h(e.stats)]}),e.note?(0,l.jsxs)("div",{className:"mt-0.5",children:[(0,l.jsx)("span",{className:"text-gray-400",children:"备注:"})," ",e.note]}):null]},e.id)})})]})}let V={created:"创建职位",status_change:"状态切换",op_claim:"申请成为 op",op_transfer:"转移 op",op_cleared:"退租清空 op",rs_add:"添加 rs",rs_remove:"移除 rs",customer_change:"客户变更",info_update:"信息更新"};function X(e){let{jobCaseId:t}=e,[s,a]=(0,n.useState)([]);return((0,n.useEffect)(()=>{let e=!0;return(async()=>{try{let s=await (0,i.aA)("/job-cases/".concat(t,"/history?limit=100"));e&&a(s.items)}catch(e){}})(),()=>{e=!1}},[t]),s.length)?(0,l.jsx)("ol",{className:"relative ml-2 space-y-3 border-l border-gray-200 pl-4",children:s.map(e=>{var t;return(0,l.jsxs)("li",{className:"relative",children:[(0,l.jsx)("span",{className:"absolute -left-[21px] top-1 h-2.5 w-2.5 rounded-full bg-blue-300"}),(0,l.jsx)("div",{className:"text-xs text-gray-400",children:(0,d.d3)(e.createdAt)}),(0,l.jsxs)("div",{className:"text-sm text-gray-800",children:[null!==(t=V[e.action])&&void 0!==t?t:e.action,null!=e.actorId?(0,l.jsxs)("span",{className:"text-gray-400",children:[" \xb7 操作人 #",e.actorId]}):null]}),e.detail&&Object.keys(e.detail).length?(0,l.jsx)("div",{className:"mt-0.5 text-xs text-gray-500",children:JSON.stringify(e.detail)}):null]},e.id)})}):(0,l.jsx)("div",{className:"text-sm text-gray-400",children:"暂无历史记录"})}function $(){return(0,l.jsx)(n.Suspense,{fallback:(0,l.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,l.jsx)(H,{})})}function ee(){var e;let[t,s]=(0,n.useState)(""),[a,r]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),[m,x]=(0,n.useState)([]),[h,b]=(0,n.useState)(0),[g,y]=(0,n.useState)(!1),[v,j]=(0,n.useState)(null),[f,N]=(0,n.useState)(null),{sync:k}=(0,p.nu)(),w=null!==(e=null==k?void 0:k.activeTenantId)&&void 0!==e?e:null,S=(0,n.useCallback)(async()=>{y(!0);let e=new URLSearchParams;a&&e.set("q",a),d&&e.set("touched",d),e.set("limit","200");try{let t=await (0,i.aA)("/market/jobs?".concat(e.toString()));j(null),x(t.items),b(t.total)}catch(e){j("加载失败")}finally{y(!1)}},[a,d,w]);(0,n.useEffect)(()=>{let e=setTimeout(()=>r(t.trim()),300);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>{S()},[S]);let C=(0,n.useMemo)(()=>{var e;return null!==(e=m.find(e=>e.key===f))&&void 0!==e?e:null},[m,f]),I=(0,n.useMemo)(()=>m.map(e=>({id:e.key,content:(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("span",{className:"truncate font-medium text-gray-900",children:e.title}),e.touched?(0,l.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-[10px] text-emerald-700",children:"已操作"}):null]}),e.company?(0,l.jsx)("div",{className:"truncate text-xs text-gray-500",children:e.company}):null,(0,l.jsxs)("div",{className:"mt-0.5 flex items-center gap-0.5",children:[e.sources.map(e=>(0,l.jsx)(_.v,{platform:e},e)),(0,l.jsxs)("span",{className:"ml-1 text-[10px] text-gray-400",children:[e.postings.length," 个发布"]})]})]})})),[m]);return(0,l.jsx)(c.m,{filterBar:(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-200 bg-white p-3",children:[(0,l.jsx)("input",{type:"text",value:t,onChange:e=>s(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,l.jsx)("button",{type:"button",onClick:()=>u(e),className:"rounded px-2 py-1 text-xs ".concat(d===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,l.jsxs)("span",{className:"ml-auto text-xs text-gray-400",children:["共 ",h," 组(BD 市场视角)"]})]}),listPanel:v?(0,l.jsxs)("div",{className:"flex-1 overflow-auto p-4 text-center text-sm",children:[(0,l.jsx)("span",{className:"text-red-500",children:v}),(0,l.jsx)("button",{type:"button",onClick:()=>void S(),className:"ml-2 text-blue-500 hover:underline",children:"重试"})]}):(0,l.jsx)(o.L,{items:I,selectedId:null!=f?f:void 0,onSelect:N,loading:g,emptyText:"暂无市场职位(解析库暂无数据)"}),detailPanel:C?(0,l.jsxs)("div",{className:"h-full overflow-y-auto p-4",children:[(0,l.jsx)("h2",{className:"mb-1 text-lg font-semibold text-gray-900",children:C.title}),(0,l.jsxs)("div",{className:"mb-4 text-xs text-gray-400",children:[C.company?"".concat(C.company," \xb7 "):"",C.touched?"本租户已操作过":"本租户未操作"," \xb7 ",C.postings.length," 个平台发布"]}),C.jobCaseIds.length>0?(0,l.jsxs)("div",{className:"mb-4 rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-sm",children:[(0,l.jsx)("span",{className:"text-emerald-800",children:"我们交付中的案件:"}),C.jobCaseIds.map(e=>(0,l.jsxs)("a",{href:"/jobs?id=".concat(e),className:"ml-2 font-medium text-emerald-700 underline",children:["案件 #",e]},e))]}):null,(0,l.jsxs)("section",{children:[(0,l.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-800",children:"平台发布"}),(0,l.jsx)("div",{className:"space-y-1",children:C.postings.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 rounded border border-gray-100 px-2 py-1.5 text-sm",children:[(0,l.jsx)(_.v,{platform:e.source}),(0,l.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"min-w-0 flex-1 truncate text-blue-600 hover:underline",children:e.sourceUrl}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:e.updatedAt.slice(0,10)})]},e.id))})]})]}):(0,l.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"选择左侧职位查看各平台发布"})})}var et=s(88801);function es(){let e=(0,et.mJ)();return"1"===new URLSearchParams(window.location.search).get("entities")?(0,l.jsx)("div",{className:"flex h-full flex-col",children:(0,l.jsx)("div",{className:"min-h-0 flex-1",children:(0,l.jsx)(a.EntityListPage,{type:"job",label:"职位",batchDelete:!0})})}):(0,l.jsxs)("div",{className:"flex h-full flex-col",children:["bd"===e?(0,l.jsx)("div",{className:"flex border-b border-gray-200 bg-white px-3 py-1.5",children:(0,l.jsx)("span",{className:"ml-auto rounded bg-[color:var(--brand-soft)] px-2 py-0.5 text-xs text-[color:var(--brand-strong)]",children:"\uD83E\uDDED BD 市场视角"})}):null,(0,l.jsx)("div",{className:"min-h-0 flex-1",children:"bd"===e?(0,l.jsx)(ee,{}):(0,l.jsx)($,{})})]})}}},function(e){e.O(0,[187,728,253,659,686,400,935,744],function(){return e(e.s=74843)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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]="176df8b1-e728-4928-9a52-b472210dc954",e._sentryDebugIdIdentifier="sentry-dbid-176df8b1-e728-4928-9a52-b472210dc954")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[245],{41689:function(e,t,n){Promise.resolve().then(n.bind(n,48517))},48517:function(e,t,n){"use strict";n.d(t,{default:function(){return l}});var s=n(72835),r=n(60635),o=n(74431),d=n(67002);let i={not_found:"分享链接不存在、已失效,或你没有访问权限",expired:"分享链接已过期,请让分享者重新生成",revoked:"分享已被分享者撤销",out_of_scope:"你不在本次分享的范围内,请联系分享者"},a={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"};function l(){var e;let[t,n]=(0,r.useState)({kind:"loading"}),[a,l]=(0,r.useState)("");return(0,r.useEffect)(()=>{let e=window.location.pathname.match(/^\/shared\/([^/]+)/);l((null==e?void 0:e[1])?decodeURIComponent(e[1]):"")},[]),(0,r.useEffect)(()=>{if(a)return e(),(0,d.Lc)(()=>void e());async function e(){let e=(0,d.Xc)();if(!e){n({kind:"need-login"});return}let t=await fetch("".concat((0,o.Ox)(),"/shared/").concat(encodeURIComponent(a),"/data"),{headers:{Authorization:"UTOKEN ".concat(e)},cache:"no-store"});if(401===t.status){n({kind:"need-login"});return}let s=await t.json().catch(()=>({}));if(!t.ok){var r,i,l;n({kind:"error",code:null!==(i=null!==(r=null==s?void 0:s.errorCode)&&void 0!==r?r:null==s?void 0:s.code)&&void 0!==i?i:"not_found",message:null!==(l=null==s?void 0:s.message)&&void 0!==l?l:""});return}n({kind:"ok",data:s})}},[a]),(0,s.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,s.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,s.jsx)("h1",{className:"mb-1 text-lg font-semibold",children:"同事分享的职位推荐"}),"loading"===t.kind?(0,s.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,"need-login"===t.kind?(0,s.jsx)("div",{className:"mt-4 rounded border border-amber-200 bg-amber-50 px-4 py-6 text-center text-sm text-amber-800",children:"请先登录本地 hm(左下角登录),登录后本页会自动加载分享内容。"}):null,"error"===t.kind?(0,s.jsxs)("div",{className:"mt-4 rounded border border-red-200 bg-red-50 px-4 py-6 text-center text-sm text-red-700",children:[null!==(e=i[t.code])&&void 0!==e?e:i.not_found,t.message?(0,s.jsx)("div",{className:"mt-1 text-xs text-red-400",children:t.message}):null]}):null,"ok"===t.kind?(0,s.jsx)(c,{data:t.data}):null]})})}function c(e){var t,n,r,o,d,i,l,c,u;let{data:x}=e,m=null!==(i=x.recommendations)&&void 0!==i?i:[];return(0,s.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-medium",children:null!==(c=null===(t=x.jobCase)||void 0===t?void 0:t.title)&&void 0!==c?c:"职位 #".concat(null!==(l=null===(n=x.jobCase)||void 0===n?void 0:n.id)&&void 0!==l?l:"")}),(0,s.jsxs)("div",{className:"mt-0.5 text-xs text-gray-500",children:["分享者:",(null===(r=x.fromUser)||void 0===r?void 0:r.email)||"#".concat(null===(o=x.fromUser)||void 0===o?void 0:o.hmUserId),x.expiresAt?" \xb7 有效期至 ".concat(new Date(x.expiresAt).toLocaleString()):""]})]}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(u=null===(d=x.jobCase)||void 0===d?void 0:d.status)&&void 0!==u?u:""})]}),x.note?(0,s.jsx)("div",{className:"mt-2 rounded bg-blue-50 px-3 py-2 text-sm text-blue-800",children:x.note}):null]}),(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:["共 ",m.length," 位推荐人才(只读快照,实时数据以分享者本地为准)"]}),m.map(e=>{var t,n,r,o,d,i,l,c;return(0,s.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"font-medium",children:null!==(l=null!==(i=null===(t=e.snapshot)||void 0===t?void 0:t.name)&&void 0!==i?i:e.portraitName)&&void 0!==l?l:"推荐 #".concat(e.id.slice(0,8))}),(0,s.jsx)("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:null!==(c=a[e.stage])&&void 0!==c?c:e.stage})]}),(null===(n=e.snapshot)||void 0===n?void 0:n.headline)?(0,s.jsx)("div",{className:"mt-1 text-xs text-gray-500",children:e.snapshot.headline}):null,"number"==typeof(null===(o=e.scores)||void 0===o?void 0:null===(r=o.dimensions)||void 0===r?void 0:r.overall)?(0,s.jsxs)("div",{className:"mt-1 text-xs text-gray-500",children:["综合匹配分:",e.scores.dimensions.overall]}):null,(null===(d=e.scores)||void 0===d?void 0:d.aiReason)?(0,s.jsx)("pre",{className:"mt-2 whitespace-pre-wrap rounded bg-gray-50 p-2 text-xs text-gray-600",children:e.scores.aiReason}):null]},e.id)}),m.length?null:(0,s.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"该职位暂无推荐人才"})]})}},74431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return o},aA:function(){return a}});var s=n(67002),r=n(60529);function o(){return r.env.HUNTER_MATE_SERVER_URL||""}let d=o();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 a(e,t){let n;try{n=await fetch("".concat(d).concat(e),{cache:"no-store",...function(e){let t=(0,s.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 d},Lc:function(){return i},Xc:function(){return o}});let s=null,r=new Set;function o(){return s}function d(e){e!==s&&(s=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=41689)}),_N_E=e.O()}]);
|
|
File without changes
|
|
File without changes
|
/package/dist/web/dist/_next/static/{tYFZz41gyWi4-BhxuxlGU → cC7rsTCys5_15wJ8BiPDm}/_ssgManifest.js
RENAMED
|
File without changes
|