weaver-work-cli 0.1.76 → 0.1.78
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/README.md +3 -1
- package/dist/chunks/{attachment-content-24RL44SE.js → attachment-content-TFOC3Y3X.js} +3 -3
- package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
- package/dist/chunks/{chunk-SQFKBWTR.js → chunk-5VQ7JHV4.js} +132 -47
- package/dist/chunks/{chunk-KJA7CRES.js → chunk-7SQN5IZR.js} +1 -1
- package/dist/chunks/{chunk-MS7MKBGJ.js → chunk-BP7BONZO.js} +664 -75
- package/dist/chunks/{chunk-L5SCNJKX.js → chunk-DACQKJ6O.js} +1 -1
- package/dist/chunks/{chunk-T7HVQ2WP.js → chunk-E2EY3DMS.js} +2 -2
- package/dist/chunks/{chunk-WJQJ7YEX.js → chunk-FAC4IFGQ.js} +2 -2
- package/dist/chunks/{minute-doc-4BA2R5EA.js → chunk-IBTGXLOT.js} +99 -16
- package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
- package/dist/chunks/{chunk-H6N6U2D6.js → chunk-SWFTWNWL.js} +7 -7
- package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
- package/dist/chunks/{chunk-Q7RXCK2Y.js → chunk-USYFVIUR.js} +22 -7
- package/dist/chunks/{chunk-WHI6YAUE.js → chunk-UZ2E3VNI.js} +1 -1
- package/dist/chunks/{chunk-AZC53XSQ.js → chunk-VNEU7OUN.js} +1 -1
- package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
- package/dist/chunks/{chunk-NZQRW4KL.js → chunk-Z44YFIN6.js} +2 -2
- package/dist/chunks/{chunk-R4PN3OFK.js → chunk-ZOTXXGUM.js} +7 -7
- package/dist/chunks/{cli-DFLV57LO.js → cli-WA7FOQKC.js} +10 -10
- package/dist/chunks/{conflict-72Q6DM4I.js → conflict-D4GVAURN.js} +2 -2
- package/dist/chunks/{contract-IRNRQ5FY.js → contract-GW7US3UF.js} +4399 -3547
- package/dist/chunks/{create-flow-UGTDI7SP.js → create-flow-ERDGW3FZ.js} +10 -6
- package/dist/chunks/{ehr-PHIBBUIG.js → ehr-P6T7OAAV.js} +1 -1
- package/dist/chunks/{entry-mode-5WOXFE67.js → entry-mode-SQU5WTX6.js} +3 -3
- package/dist/chunks/{env-H4ALHESA.js → env-DASBNSEM.js} +2 -2
- package/dist/chunks/{factory-COX6AVK7.js → factory-A3NAKZAA.js} +1 -1
- package/dist/chunks/{group-chat-ZIWQQO4G.js → group-chat-7SEAVAJR.js} +3 -3
- package/dist/chunks/{lazy-dispatch-MZ3EZYDL.js → lazy-dispatch-ZDKLS5MR.js} +3 -3
- package/dist/chunks/{meeting-XE6CTXYA.js → meeting-7AEQGBAT.js} +18 -12
- package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
- package/dist/chunks/{project-XREEXFU2.js → project-6PRGBLO2.js} +38 -14
- package/dist/chunks/{recruit-stage-TSQWOGQD.js → recruit-stage-TLZJUFHD.js} +543 -463
- package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
- package/dist/chunks/{registry-7UDUWYB5.js → registry-UVTI323K.js} +12 -11
- package/dist/chunks/{room-recommend-FO3HLPNB.js → room-recommend-ELEJUYBN.js} +4 -4
- package/dist/chunks/{schedule-DHNNOHVS.js → schedule-XBKY7VEA.js} +4 -4
- package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
- package/dist/chunks/{workflow-MAGCHWYZ.js → workflow-SYCBS5XD.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/internal/update/service.js +9 -8
- package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
- package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
- package/dist/shortcuts/contract/data/report-renderers.js +75 -31
- package/dist/shortcuts/contract/data/report-spec.js +17 -3
- package/dist/shortcuts/contract/manifest.js +20 -3
- package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
- package/dist/shortcuts/contract/operations/collection-node.js +116 -1
- package/dist/shortcuts/contract/operations/compare-report.js +27 -5
- package/dist/shortcuts/contract/operations/credit-page.js +11 -2
- package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
- package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
- package/dist/shortcuts/contract/operations/elements-build.js +162 -30
- package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
- package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
- package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
- package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
- package/dist/shortcuts/contract/operations/ledger.js +88 -16
- package/dist/shortcuts/contract/operations/metrics.js +16 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
- package/dist/shortcuts/contract/operations/page.js +23 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
- package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
- package/dist/shortcuts/contract/operations/review-report.js +11 -3
- package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
- package/dist/shortcuts/contract/operations/triage.js +18 -3
- package/dist/shortcuts/contract/operations/viewlink.js +17 -1
- package/dist/shortcuts/ehr/operations/recruit.js +255 -90
- package/dist/shortcuts/meeting/confirm-gate.js +42 -0
- package/dist/shortcuts/meeting/continuation.js +6 -2
- package/dist/shortcuts/meeting/minute-doc.js +119 -12
- package/dist/shortcuts/meeting/operations/attachment.js +19 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
- package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
- package/dist/shortcuts/meeting/operations/group-share.js +268 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
- package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/project/operations/read.js +40 -15
- package/dist/shortcuts/recruit-stage/context.js +16 -81
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
- package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
- package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
- package/dist/shortcuts/recruit-stage/shared.js +153 -4
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +11 -0
- package/dist/shortcuts/workflow/operations/read.js +24 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
- package/docs/project.md +1 -1
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
- package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
- package/skills/weaver-e10-meeting/SKILL.md +203 -80
- package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
- package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
- package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
- package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +61 -58
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +28 -25
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +20 -14
- package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +71 -25
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +8 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +6 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +2 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +1 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +10 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -1
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +14 -10
- package/skills/weaver-e10-shijingran/SKILL.md +2 -2
- package/skills/weaver-e10-shijingran/references/operations.md +5 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
- package/skills/weaver-e10-workflow/SKILL.md +13 -9
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
- package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
- package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
- package/templates/meeting/minute.docx +0 -0
- package/skills/weaver-e10-yepiaotong.zip +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ehrValidationError,
|
|
6
6
|
isSelfTenant,
|
|
7
7
|
toMenuList
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WNFDR5PC.js";
|
|
9
9
|
import {
|
|
10
10
|
MANIFEST_LIST_COMPACT_PATHS,
|
|
11
11
|
manifestView,
|
|
@@ -303,6 +303,90 @@ import { unlinkSync } from "node:fs";
|
|
|
303
303
|
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
|
|
304
304
|
import { homedir as homedir2 } from "node:os";
|
|
305
305
|
import { join, resolve as resolvePath } from "node:path";
|
|
306
|
+
async function fetchDatasetRows(host, objId, opts = {}) {
|
|
307
|
+
const oid = String(objId || "").trim();
|
|
308
|
+
if (!oid) throw rsFail("\u76F4\u63A5\u8BFB\u8868\u5931\u8D25\uFF1A\u7F3A\u5C11\u8868\u5355 objId");
|
|
309
|
+
const pageSize = Math.min(1e3, Math.max(1, Number(opts.pageSize || 500)));
|
|
310
|
+
const maxRows = Math.min(1e3, Math.max(pageSize, Number(opts.maxRows || 1e3)));
|
|
311
|
+
const filters = opts.filters || {};
|
|
312
|
+
const rows = [];
|
|
313
|
+
let total = null;
|
|
314
|
+
let pageNo = 1;
|
|
315
|
+
let lastFetchedPage = 0;
|
|
316
|
+
let truncated = false;
|
|
317
|
+
while (rows.length < maxRows) {
|
|
318
|
+
lastFetchedPage = pageNo;
|
|
319
|
+
const r = await host.request({
|
|
320
|
+
method: "POST",
|
|
321
|
+
path: "/api/ebuilder/form/dataset/v2/getAllData",
|
|
322
|
+
body: {
|
|
323
|
+
datajson: {
|
|
324
|
+
header: { objId: oid },
|
|
325
|
+
mainTable: filters,
|
|
326
|
+
pageInfo: { pageNo, pageSize },
|
|
327
|
+
operationinfo: { isReturnDetail: "n", fieldNoFindIgnore: "false" }
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
const dj = r?.data?.datajson;
|
|
332
|
+
const datas = dj?.datas;
|
|
333
|
+
if (!Array.isArray(datas)) {
|
|
334
|
+
throw rsFail("\u76F4\u63A5\u8BFB\u8868\u5931\u8D25\uFF1AgetAllData \u672A\u8FD4\u56DE\u6570\u636E\u6570\u7EC4\uFF08objId=" + oid + "\uFF09\uFF1A" + JSON.stringify(r?.data || {}).slice(0, 200));
|
|
335
|
+
}
|
|
336
|
+
if (typeof dj?.totalCount === "number") total = dj.totalCount;
|
|
337
|
+
else if (typeof dj?.total === "number") total = dj.total;
|
|
338
|
+
for (const item of datas) {
|
|
339
|
+
if (rows.length >= maxRows) {
|
|
340
|
+
truncated = true;
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
const mt = item?.mainTable && typeof item.mainTable === "object" ? item.mainTable : {};
|
|
344
|
+
const flat = {};
|
|
345
|
+
for (const [k, v] of Object.entries(mt)) {
|
|
346
|
+
if (v && typeof v === "object") {
|
|
347
|
+
const cell = v;
|
|
348
|
+
flat[k] = cell.fieldValue !== void 0 ? cell.fieldValue : cell.fieldOptionId !== void 0 ? cell.fieldOptionId : cell;
|
|
349
|
+
} else flat[k] = v;
|
|
350
|
+
}
|
|
351
|
+
flat.form_data_id = String(flat.id || item?.id || "");
|
|
352
|
+
rows.push(flat);
|
|
353
|
+
}
|
|
354
|
+
if (!datas.length) break;
|
|
355
|
+
if (total !== null && rows.length >= total) break;
|
|
356
|
+
pageNo += 1;
|
|
357
|
+
}
|
|
358
|
+
if (total !== null && rows.length < total && rows.length >= maxRows) truncated = true;
|
|
359
|
+
if (!truncated && total === null && rows.length >= maxRows && lastFetchedPage > 0) {
|
|
360
|
+
try {
|
|
361
|
+
const probe = await host.request({
|
|
362
|
+
method: "POST",
|
|
363
|
+
path: "/api/ebuilder/form/dataset/v2/getAllData",
|
|
364
|
+
body: {
|
|
365
|
+
datajson: {
|
|
366
|
+
header: { objId: oid },
|
|
367
|
+
mainTable: filters,
|
|
368
|
+
pageInfo: { pageNo: lastFetchedPage + 1, pageSize: 1 },
|
|
369
|
+
operationinfo: { isReturnDetail: "n", fieldNoFindIgnore: "false" }
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
const pd = probe?.data?.datajson?.datas;
|
|
374
|
+
if (Array.isArray(pd) && pd.length > 0) truncated = true;
|
|
375
|
+
} catch {
|
|
376
|
+
truncated = true;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return { rows, total, truncated };
|
|
380
|
+
}
|
|
381
|
+
function detectHiddenFields(rows, expectedKeys) {
|
|
382
|
+
if (!Array.isArray(rows) || !rows.length) return [];
|
|
383
|
+
const seen = /* @__PURE__ */ new Set();
|
|
384
|
+
for (const row of rows) for (const k of Object.keys(row || {})) seen.add(k);
|
|
385
|
+
return expectedKeys.filter((k) => k && !seen.has(k)).slice(0, 8);
|
|
386
|
+
}
|
|
387
|
+
function hiddenFieldsHint(hidden) {
|
|
388
|
+
return "\u4EE5\u4E0B\u5B57\u6BB5\u5728\u672C\u6B21\u8FD4\u56DE\u4E2D\u5B8C\u5168\u672A\u51FA\u73B0\uFF0C\u53EF\u80FD\u88AB\u5B57\u6BB5\u7EA7\u6743\u9650\u9690\u85CF\uFF08\u4E0D\u7B49\u540C\u4E8E\u7A7A\u503C\uFF09\uFF1A" + hidden.join("\u3001") + "\u3002\u5F15\u7528\u8FD9\u4E9B\u5B57\u6BB5\u505A\u300C\u4E0D\u6EE1\u8DB3/\u672A\u586B\u5199\u300D\u5224\u65AD\u524D\uFF0C\u8BF7\u5148\u786E\u8BA4\u5F53\u524D\u8D26\u53F7\u7684\u5B57\u6BB5\u6743\u9650\u3002";
|
|
389
|
+
}
|
|
306
390
|
function randHex32() {
|
|
307
391
|
return randomUUID().replace(/-/g, "");
|
|
308
392
|
}
|
|
@@ -375,15 +459,16 @@ async function getFormButtons(host, objId, layoutId) {
|
|
|
375
459
|
}
|
|
376
460
|
return actions;
|
|
377
461
|
}
|
|
378
|
-
async function probeCreatePermission(host, objId) {
|
|
462
|
+
async function probeCreatePermission(host, objId, dataId = "") {
|
|
379
463
|
try {
|
|
464
|
+
const id = String(dataId || "");
|
|
380
465
|
const r = await host.request({
|
|
381
466
|
path: "/api/ebuilder/form/data/getFormButtons",
|
|
382
467
|
body: {
|
|
383
468
|
layoutType: "formLayout",
|
|
384
469
|
objId,
|
|
385
|
-
dataId:
|
|
386
|
-
formDataId:
|
|
470
|
+
dataId: id,
|
|
471
|
+
formDataId: id,
|
|
387
472
|
type: "1",
|
|
388
473
|
fromRecycle: false,
|
|
389
474
|
otherOperator: "",
|
|
@@ -463,34 +548,6 @@ function buildTalentViewUrl(baseUrl, candidateId) {
|
|
|
463
548
|
function talentLinkExtra(cache) {
|
|
464
549
|
return String(cache && cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
|
|
465
550
|
}
|
|
466
|
-
async function checkUnique(host, opts) {
|
|
467
|
-
const { objId, fieldId, value, dataId } = opts;
|
|
468
|
-
const dataDetail = { content: String(value), formField: { id: String(fieldId) } };
|
|
469
|
-
const customParam = { objId: String(objId) };
|
|
470
|
-
if (dataId) {
|
|
471
|
-
dataDetail.formData = { id: String(dataId) };
|
|
472
|
-
customParam.dataId = String(dataId);
|
|
473
|
-
}
|
|
474
|
-
const r = await host.request({
|
|
475
|
-
path: "/api/ebuilder/form/form/core/checkUnique",
|
|
476
|
-
method: "POST",
|
|
477
|
-
body: { dataDetail, module: "ebuilderform", customParam }
|
|
478
|
-
});
|
|
479
|
-
const d = r?.data;
|
|
480
|
-
if (!d || typeof d !== "object" || typeof d.unique !== "boolean" && !Array.isArray(d.formDataIds)) {
|
|
481
|
-
throw rsFail("checkUnique \u65E0\u6709\u6548\u56DE\u5305\uFF08\u65E0\u6CD5\u786E\u8BA4\u624B\u673A\u53F7\u552F\u4E00\u6027\uFF09\uFF1A" + JSON.stringify(r || {}).slice(0, 200));
|
|
482
|
-
}
|
|
483
|
-
let ids = [];
|
|
484
|
-
const rawList = d.formDataIds;
|
|
485
|
-
if (Array.isArray(rawList)) ids = rawList.map((x) => String(x)).filter((x) => /^\d{10,}$/.test(x));
|
|
486
|
-
if (!ids.length) {
|
|
487
|
-
const text = typeof r?.__raw === "string" ? r.__raw : "";
|
|
488
|
-
const m = text.match(/"formDataIds"\s*:\s*\[([^\]]*)\]/);
|
|
489
|
-
if (m) ids = m[1].match(/\d{10,}/g) || [];
|
|
490
|
-
}
|
|
491
|
-
const unique = typeof d.unique === "boolean" ? d.unique : ids.length === 0;
|
|
492
|
-
return { unique, formDataIds: [...new Set(ids)] };
|
|
493
|
-
}
|
|
494
551
|
async function getTableMapping(host, objId) {
|
|
495
552
|
const r = await host.request({ path: "/api/ebuilder/form/dataset/v1/getTableMapping?objId=" + encodeURIComponent(objId), method: "GET" });
|
|
496
553
|
const d = r?.data;
|
|
@@ -1072,7 +1129,24 @@ function computeRequiredHint(opts) {
|
|
|
1072
1129
|
}
|
|
1073
1130
|
function buildCardUrl(baseUrl, objId, dataId) {
|
|
1074
1131
|
if (!baseUrl || !objId || !dataId) return null;
|
|
1075
|
-
|
|
1132
|
+
const oid = assertLinkId("objId", objId);
|
|
1133
|
+
const did = assertLinkId("dataId", dataId);
|
|
1134
|
+
const url = String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/card/0/" + oid + "/" + did;
|
|
1135
|
+
const seg = url.slice(url.indexOf("/sp/ebdfpage/card/0/") + "/sp/ebdfpage/card/0/".length).split("/");
|
|
1136
|
+
if (seg[0] !== oid || seg[1] !== did) {
|
|
1137
|
+
throw rsFail("\u8BB0\u5F55\u94FE\u63A5\u751F\u6210\u5F02\u5E38\uFF1AURL \u4E2D\u7684 id \u4E0E\u5165\u53C2\u4E0D\u4E00\u81F4\uFF08objId=" + seg[0] + "\uFF0CdataId=" + seg[1] + "\uFF09\uFF0C\u5DF2\u963B\u65AD\uFF0C\u907F\u514D\u7ED9\u51FA\u9519\u5730\u5740");
|
|
1138
|
+
}
|
|
1139
|
+
return url;
|
|
1140
|
+
}
|
|
1141
|
+
function assertLinkId(label, value) {
|
|
1142
|
+
if (typeof value === "number") {
|
|
1143
|
+
throw rsFail(label + " \u4EE5 number \u4F20\u5165\uFF08" + String(value) + "\uFF09\u3002E10 \u8BB0\u5F55 id \u8D85\u51FA JS \u5B89\u5168\u6574\u6570\u8303\u56F4\uFF0C\u6570\u5B57\u5F62\u6001\u5DF2\u4E22\u7CBE\u5EA6\uFF0C\u5FC5\u987B\u6309\u5B57\u7B26\u4E32\u4F20\u9012\uFF0C\u5426\u5219\u4F1A\u751F\u6210\u9519\u5730\u5740\u3002");
|
|
1144
|
+
}
|
|
1145
|
+
const text = String(value ?? "").trim();
|
|
1146
|
+
if (!text || /[\/\\?#\s]/.test(text)) {
|
|
1147
|
+
throw rsFail(label + " \u5F62\u6001\u975E\u6CD5\uFF08" + JSON.stringify(text) + "\uFF09\uFF0C\u65E0\u6CD5\u751F\u6210\u8BB0\u5F55\u94FE\u63A5");
|
|
1148
|
+
}
|
|
1149
|
+
return text;
|
|
1076
1150
|
}
|
|
1077
1151
|
async function resolveTalentListUrl(_host, _cache, baseUrl, fallbackListId) {
|
|
1078
1152
|
return buildListUrl(baseUrl, fallbackListId);
|
|
@@ -1196,7 +1270,6 @@ function refToSubmit(d) {
|
|
|
1196
1270
|
else return null;
|
|
1197
1271
|
return o;
|
|
1198
1272
|
}
|
|
1199
|
-
var WORK_PLACE_NAMES = ["\u529E\u516C\u5730\u70B9", "\u5DE5\u4F5C\u5730\u70B9"];
|
|
1200
1273
|
var allMenusMemo = /* @__PURE__ */ new Map();
|
|
1201
1274
|
async function fetchAllMenusFlat(ctx) {
|
|
1202
1275
|
const key = `${ctx.baseUrl}|${ctx.appId}`;
|
|
@@ -1220,22 +1293,6 @@ async function fetchAllMenusFlat(ctx) {
|
|
|
1220
1293
|
return [];
|
|
1221
1294
|
}
|
|
1222
1295
|
}
|
|
1223
|
-
async function findWorkPlaceMenu(ctx) {
|
|
1224
|
-
const { host, appId, cache } = ctx;
|
|
1225
|
-
const ok = (m) => m && m.listId;
|
|
1226
|
-
const allSearch = (cache.lists || {}).all_search || [];
|
|
1227
|
-
const hit1 = allSearch.find((m) => ok(m) && WORK_PLACE_NAMES.some((n) => String(m.menuName || "").includes(n)));
|
|
1228
|
-
if (hit1) return { listId: String(hit1.listId), cusMenuId: String(hit1.cusMenuId || ""), menuName: String(hit1.menuName || "") };
|
|
1229
|
-
const hit2 = findMenuNode(cache.menus || [], WORK_PLACE_NAMES, (m) => ok(m));
|
|
1230
|
-
if (hit2) return { listId: String(hit2.listId), cusMenuId: String(hit2.cusMenuId || ""), menuName: String(hit2.menuName || "") };
|
|
1231
|
-
try {
|
|
1232
|
-
const flat = await fetchAllMenusFlat(ctx);
|
|
1233
|
-
const hit3 = findMenuNode(flat, WORK_PLACE_NAMES, (m) => ok(m));
|
|
1234
|
-
if (hit3) return { listId: String(hit3.listId), cusMenuId: String(hit3.cusMenuId || ""), menuName: String(hit3.menuName || "") };
|
|
1235
|
-
} catch {
|
|
1236
|
-
}
|
|
1237
|
-
return null;
|
|
1238
|
-
}
|
|
1239
1296
|
var FLOW_MENU_NAMES = ["\u62DB\u8058\u6D41\u7A0B"];
|
|
1240
1297
|
var flowDataMemo = /* @__PURE__ */ new Map();
|
|
1241
1298
|
function isDefaultFlowRow(x) {
|
|
@@ -1327,80 +1384,33 @@ var workPlaceMemo = /* @__PURE__ */ new Map();
|
|
|
1327
1384
|
function stripHtml(s) {
|
|
1328
1385
|
return String(s ?? "").replace(/<[^>]*>/g, "").trim();
|
|
1329
1386
|
}
|
|
1330
|
-
function parseSpans(raw) {
|
|
1331
|
-
try {
|
|
1332
|
-
const v = Array.isArray(raw) ? raw : JSON.parse(String(raw || "[]"));
|
|
1333
|
-
return Array.isArray(v) ? v : [];
|
|
1334
|
-
} catch {
|
|
1335
|
-
return [];
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
1387
|
function isEnabledText(s) {
|
|
1339
1388
|
const t = stripHtml(s);
|
|
1340
1389
|
return t.includes("\u542F\u7528") && !t.includes("\u7981\u7528");
|
|
1341
1390
|
}
|
|
1342
1391
|
async function loadWorkPlaces(ctx) {
|
|
1343
1392
|
const { host, appId } = ctx;
|
|
1344
|
-
const
|
|
1345
|
-
if (!menu) return { rows: [], statusFiltered: false };
|
|
1346
|
-
const key = appId + "|" + menu.listId;
|
|
1393
|
+
const key = appId + "|work_place_table";
|
|
1347
1394
|
const cached = workPlaceMemo.get(key);
|
|
1348
1395
|
if (cached) return cached;
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
const rawRows =
|
|
1356
|
-
const
|
|
1357
|
-
for (let page = 1; page <= 5; page++) {
|
|
1358
|
-
const body = {
|
|
1359
|
-
current: page,
|
|
1360
|
-
pageSize,
|
|
1361
|
-
tableuid: randHex32(),
|
|
1362
|
-
listId: menu.listId,
|
|
1363
|
-
searchParamData: { searchType: "3", type: "and" },
|
|
1364
|
-
terminal: "PC",
|
|
1365
|
-
browser: "Chrome",
|
|
1366
|
-
requiredMatch: 1,
|
|
1367
|
-
mapResult: 1,
|
|
1368
|
-
recheckQuery: 1,
|
|
1369
|
-
isFollow: 0,
|
|
1370
|
-
isShareToMe: 0,
|
|
1371
|
-
filterCondition: {},
|
|
1372
|
-
cusMenuId: menu.cusMenuId,
|
|
1373
|
-
urlPageTitle: menu.menuName,
|
|
1374
|
-
menuName: menu.menuName
|
|
1375
|
-
};
|
|
1376
|
-
const r = await host.request({
|
|
1377
|
-
path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
|
|
1378
|
-
body,
|
|
1379
|
-
headers: { ebBusinessId: menu.listId }
|
|
1380
|
-
});
|
|
1381
|
-
const batch = r?.data?.data || r?.data?.displayData || [];
|
|
1382
|
-
rawRows.push(...batch);
|
|
1383
|
-
dispRows.push(...r?.data?.displayData || []);
|
|
1384
|
-
if (batch.length < pageSize) break;
|
|
1385
|
-
}
|
|
1386
|
-
const enabledStatusIds = /* @__PURE__ */ new Set();
|
|
1387
|
-
const enabledRowIds = /* @__PURE__ */ new Set();
|
|
1388
|
-
for (const d of dispRows) {
|
|
1389
|
-
const rid = String(d?.form_data_id || d?.id || "");
|
|
1390
|
-
if (isEnabledText(d?.place_status) && rid) enabledRowIds.add(rid);
|
|
1391
|
-
for (const s of parseSpans(d?.place_statusSpan)) {
|
|
1392
|
-
if (isEnabledText(s?.name) && s?.id) enabledStatusIds.add(String(s.id));
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
const statusFiltered = enabledRowIds.size > 0 || enabledStatusIds.size > 0;
|
|
1396
|
-
const rows = rawRows.filter((x) => !statusFiltered || enabledRowIds.has(String(x?.form_data_id || x?.id || "")) || enabledStatusIds.has(String(x?.place_status || ""))).map((x) => ({
|
|
1396
|
+
const tag = await host.request({
|
|
1397
|
+
path: `/api/ebuilder/form/obj/getObjsByTag?appId=${appId}&tag=uf_rcrt_work_place`,
|
|
1398
|
+
method: "GET"
|
|
1399
|
+
}).catch(() => null);
|
|
1400
|
+
const objId = Array.isArray(tag?.data) && tag.data[0] ? String(tag.data[0].id || "") : "";
|
|
1401
|
+
if (!objId) return { rows: [], statusFiltered: false };
|
|
1402
|
+
const { rows: rawRows } = await fetchDatasetRows(host, objId, { pageSize: 500, maxRows: 1e3 });
|
|
1403
|
+
const mapped = rawRows.map((x) => ({
|
|
1397
1404
|
id: String(x?.form_data_id || x?.id || ""),
|
|
1398
1405
|
name: String(x?.name || ""),
|
|
1399
1406
|
detail: String(x?.detail_location || ""),
|
|
1400
1407
|
area: String(x?.area_text || ""),
|
|
1401
|
-
city: String(x?.city || "")
|
|
1408
|
+
city: String(x?.city || ""),
|
|
1409
|
+
status: String(x?.place_status || "")
|
|
1402
1410
|
})).filter((x) => !!x.id);
|
|
1403
|
-
const
|
|
1411
|
+
const readableStatus = mapped.some((x) => /启用|禁用/.test(x.status));
|
|
1412
|
+
const rows = readableStatus ? mapped.filter((x) => !x.status || isEnabledText(x.status)) : mapped;
|
|
1413
|
+
const out = { rows, statusFiltered: readableStatus };
|
|
1404
1414
|
workPlaceMemo.set(key, out);
|
|
1405
1415
|
return out;
|
|
1406
1416
|
}
|
|
@@ -1510,30 +1520,35 @@ var REF_TEXT_KEYS = ["position_duty", "work_request"];
|
|
|
1510
1520
|
async function fetchRecentReferences(ctx, jd, keyword) {
|
|
1511
1521
|
const { host, cache } = ctx;
|
|
1512
1522
|
const listParam = cache.lists?.position || null;
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1523
|
+
let rows = [];
|
|
1524
|
+
if (listParam?.listId) {
|
|
1525
|
+
const r = await host.request({
|
|
1526
|
+
path: "/api/ebuilder/form/list/getListDatas?passid=" + jd.objId + "&cid=" + jd.objId,
|
|
1527
|
+
body: {
|
|
1528
|
+
current: 1,
|
|
1529
|
+
pageSize: 30,
|
|
1530
|
+
tableuid: randHex32(),
|
|
1531
|
+
listId: listParam.listId,
|
|
1532
|
+
searchParamData: { searchType: "3", type: "and" },
|
|
1533
|
+
terminal: "PC",
|
|
1534
|
+
browser: "Chrome",
|
|
1535
|
+
requiredMatch: 1,
|
|
1536
|
+
mapResult: 1,
|
|
1537
|
+
recheckQuery: 1,
|
|
1538
|
+
isFollow: 0,
|
|
1539
|
+
isShareToMe: 0,
|
|
1540
|
+
filterCondition: {},
|
|
1541
|
+
cusMenuId: listParam.cusMenuId,
|
|
1542
|
+
urlPageTitle: listParam.menuName,
|
|
1543
|
+
menuName: listParam.menuName
|
|
1544
|
+
},
|
|
1545
|
+
headers: { ebBusinessId: listParam.listId }
|
|
1546
|
+
});
|
|
1547
|
+
rows = r?.data?.displayData || r?.data?.data || [];
|
|
1548
|
+
} else {
|
|
1549
|
+
const ds = await fetchDatasetRows(host, jd.objId, { pageSize: 1e3, maxRows: 1e3 });
|
|
1550
|
+
rows = ds.rows;
|
|
1551
|
+
}
|
|
1537
1552
|
const kw = String(keyword || "").trim();
|
|
1538
1553
|
const tokens = [...new Set(kw.split(/[^A-Za-z0-9\u4e00-\u9fff]+/).concat(kw).map((t) => t.trim()).filter((t) => t.length >= 2))];
|
|
1539
1554
|
const match = (row) => {
|
|
@@ -1846,6 +1861,12 @@ async function buildJd(opts) {
|
|
|
1846
1861
|
}
|
|
1847
1862
|
function setsOf(args) {
|
|
1848
1863
|
const raw = args.sets;
|
|
1864
|
+
if (raw && !Array.isArray(raw)) {
|
|
1865
|
+
throw rsValidationError(
|
|
1866
|
+
"set_invalid_format",
|
|
1867
|
+
'sets \u5FC5\u987B\u662F\u6570\u7EC4 ["\u5B57\u6BB5=\u503C"] \u6216 [{key,value}]\uFF1B\u6536\u5230 object \u5DF2\u5FFD\u7565\uFF0C\u8BF7\u6539\u4E3A\u6570\u7EC4\u5F62\u5F0F'
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1849
1870
|
if (Array.isArray(raw)) {
|
|
1850
1871
|
return raw.map((item) => {
|
|
1851
1872
|
if (typeof item === "string") {
|
|
@@ -3176,43 +3197,6 @@ function buildSubDetails(structured, subs, cache) {
|
|
|
3176
3197
|
});
|
|
3177
3198
|
return { byTable, stats };
|
|
3178
3199
|
}
|
|
3179
|
-
function makeBriefReader(ctx, formId, objId, fields) {
|
|
3180
|
-
const rev = {};
|
|
3181
|
-
for (const [dk, fid] of Object.entries(fields || {})) rev[String(fid)] = dk;
|
|
3182
|
-
return async (dataId) => {
|
|
3183
|
-
try {
|
|
3184
|
-
const r = await ctx.host.request({
|
|
3185
|
-
path: "/api/ebuilder/form/form/core/getFormDataAndLayout",
|
|
3186
|
-
method: "POST",
|
|
3187
|
-
body: {
|
|
3188
|
-
terminalType: "PC",
|
|
3189
|
-
dataId,
|
|
3190
|
-
formId,
|
|
3191
|
-
module: "ebuilderform",
|
|
3192
|
-
newLayout: true,
|
|
3193
|
-
dataCrossLayout: false,
|
|
3194
|
-
permissionId: "",
|
|
3195
|
-
allReadOnly: true,
|
|
3196
|
-
initialDatas: [],
|
|
3197
|
-
dynamicData: false,
|
|
3198
|
-
cost: false,
|
|
3199
|
-
customParam: { objId, dataId }
|
|
3200
|
-
}
|
|
3201
|
-
});
|
|
3202
|
-
const fd = r?.data?.formData;
|
|
3203
|
-
if (!fd) return null;
|
|
3204
|
-
const dets = fd.dataDetails || [];
|
|
3205
|
-
const get = (dk) => {
|
|
3206
|
-
const d = dets.find((x) => rev[String(x.fieldId)] === dk);
|
|
3207
|
-
if (!d) return "";
|
|
3208
|
-
return String(d.content ?? (d.dataText || {}).content ?? (d.dataOptions || []).map((o) => o.content).join(",") ?? "");
|
|
3209
|
-
};
|
|
3210
|
-
return { name: get("candidate_name"), mobile: get("telephone"), email: get("email"), college: get("college") };
|
|
3211
|
-
} catch {
|
|
3212
|
-
return null;
|
|
3213
|
-
}
|
|
3214
|
-
};
|
|
3215
|
-
}
|
|
3216
3200
|
async function resolveTalentCardUrl(ctx, talentId) {
|
|
3217
3201
|
if (talentId) {
|
|
3218
3202
|
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
@@ -3605,7 +3589,7 @@ async function buildImport(ctx, args) {
|
|
|
3605
3589
|
};
|
|
3606
3590
|
}
|
|
3607
3591
|
async function findExistingTalents(ctx, opts) {
|
|
3608
|
-
const {
|
|
3592
|
+
const { mobile } = opts;
|
|
3609
3593
|
const blank = {
|
|
3610
3594
|
checked: true,
|
|
3611
3595
|
unique: true,
|
|
@@ -3619,15 +3603,10 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3619
3603
|
ids: []
|
|
3620
3604
|
};
|
|
3621
3605
|
if (!mobile) return blank;
|
|
3622
|
-
const
|
|
3606
|
+
const phoneRes = await getCandidateByPhone(ctx.host, mobile).then(
|
|
3623
3607
|
(b) => ({ ok: true, b }),
|
|
3624
3608
|
(e) => ({ ok: false, e })
|
|
3625
3609
|
);
|
|
3626
|
-
const uniqueTask = fields.telephone ? checkUnique(ctx.host, { objId, fieldId: fields.telephone, value: mobile }).then(
|
|
3627
|
-
(r) => ({ ok: true, r }),
|
|
3628
|
-
(e) => ({ ok: false, e })
|
|
3629
|
-
) : Promise.resolve({ ok: false, e: new Error("\u4EBA\u624D\u8868\u5355\u7F3A\u5C11 telephone \u5B57\u6BB5\u6620\u5C04") });
|
|
3630
|
-
const [phoneRes, uniqueRes] = await Promise.all([phoneTask, uniqueTask]);
|
|
3631
3610
|
let byPhone = null;
|
|
3632
3611
|
if (phoneRes.ok) {
|
|
3633
3612
|
const b = phoneRes.b;
|
|
@@ -3643,48 +3622,22 @@ async function findExistingTalents(ctx, opts) {
|
|
|
3643
3622
|
} else {
|
|
3644
3623
|
byPhone = { error: phoneRes.e?.message };
|
|
3645
3624
|
}
|
|
3646
|
-
const formConflicts = { existing: [], unreadable: [] };
|
|
3647
|
-
let ids = [];
|
|
3648
|
-
let uniqueFlag = true;
|
|
3649
|
-
if (uniqueRes.ok && uniqueRes.r) {
|
|
3650
|
-
const r = uniqueRes.r;
|
|
3651
|
-
ids = r.formDataIds;
|
|
3652
|
-
uniqueFlag = r.unique !== false;
|
|
3653
|
-
const readBrief = makeBriefReader(ctx, formId, objId, fields);
|
|
3654
|
-
for (const id of ids) {
|
|
3655
|
-
if (byPhone?.talentId === id) continue;
|
|
3656
|
-
const rec = await readBrief(id);
|
|
3657
|
-
if (rec) {
|
|
3658
|
-
formConflicts.existing.push({
|
|
3659
|
-
talentId: id,
|
|
3660
|
-
...rec,
|
|
3661
|
-
talentCardUrl: await resolveTalentCardUrl(ctx, id),
|
|
3662
|
-
talentListLocateUrl: await resolveTalentListLocateUrl(ctx, id),
|
|
3663
|
-
recordCardUrl: buildCardUrl(ctx.baseUrl, objId, id)
|
|
3664
|
-
});
|
|
3665
|
-
} else formConflicts.unreadable.push(id);
|
|
3666
|
-
}
|
|
3667
|
-
}
|
|
3668
3625
|
const phoneChecked = phoneRes.ok;
|
|
3669
|
-
const uniqueChecked = uniqueRes.ok && !!uniqueRes.r;
|
|
3670
3626
|
const checkErrors = [];
|
|
3671
3627
|
if (!phoneChecked) checkErrors.push("getCandidateByPhone \u67E5\u8BE2\u5931\u8D25\uFF1A" + (phoneRes.e?.message || "\u672A\u77E5\u9519\u8BEF"));
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
const checked = phoneChecked && uniqueChecked;
|
|
3675
|
-
const hit = Boolean(byPhone?.candidateId || byPhone?.talentId) || formConflicts.existing.length > 0 || !uniqueFlag;
|
|
3628
|
+
const checked = phoneChecked;
|
|
3629
|
+
const hit = Boolean(byPhone?.candidateId || byPhone?.talentId);
|
|
3676
3630
|
return {
|
|
3677
3631
|
checked,
|
|
3678
|
-
// 只有两级都成功且无命中才是 unique;查重失败一律返回 false,下游必须阻断。
|
|
3679
3632
|
unique: checked ? !hit : false,
|
|
3680
3633
|
applicable: true,
|
|
3681
3634
|
phoneChecked,
|
|
3682
|
-
uniqueChecked,
|
|
3635
|
+
uniqueChecked: phoneChecked,
|
|
3683
3636
|
checkErrors,
|
|
3684
3637
|
byPhone: byPhone && !byPhone.error ? byPhone : null,
|
|
3685
3638
|
byPhoneError: byPhone?.error,
|
|
3686
|
-
formConflicts,
|
|
3687
|
-
ids
|
|
3639
|
+
formConflicts: { existing: [], unreadable: [] },
|
|
3640
|
+
ids: []
|
|
3688
3641
|
};
|
|
3689
3642
|
}
|
|
3690
3643
|
function fingerprint2(value) {
|
|
@@ -3728,8 +3681,11 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3728
3681
|
);
|
|
3729
3682
|
}
|
|
3730
3683
|
if (!opts.skipPermissionProbe) {
|
|
3731
|
-
const
|
|
3732
|
-
|
|
3684
|
+
const updateId = String(args.updateTalentId || "");
|
|
3685
|
+
const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "talent_pool"), updateId);
|
|
3686
|
+
if (perm === "denied") {
|
|
3687
|
+
throw rsFail(updateId ? "\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\uFF08\u6216\u5DF2\u5931\u53BB\uFF09\u8BE5\u4EBA\u624D\u8BB0\u5F55\u7684\u7F16\u8F91\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09\u3002" : "\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
|
|
3688
|
+
}
|
|
3733
3689
|
}
|
|
3734
3690
|
mark("prepare.\u6743\u9650\u63A2\u6D4B");
|
|
3735
3691
|
const argsT = args;
|
|
@@ -3882,7 +3838,7 @@ async function prepare2(args, env, opts = {}) {
|
|
|
3882
3838
|
// 而文档口径是「已存在同手机号人才 → 提示并停住,不重复建档」→ 重试路径被自己的查重挡死。
|
|
3883
3839
|
// 这里不改判定逻辑(查重该拦就拦),只补一个明确出口,避免 Agent 笼统报「已存在」后卡住。
|
|
3884
3840
|
retryHint: !dupInfo.checked ? "\u67E5\u91CD\u672A\u5B8C\u6210\uFF0C\u7981\u6B62 apply \u65B0\u5EFA\uFF1B\u8BF7\u91CD\u8BD5 prepare\uFF0C\u6216\u5148\u5230\u4EBA\u624D\u5E93\u9875\u9762\u4EBA\u5DE5\u786E\u8BA4\u8BE5\u624B\u673A\u53F7" : dupInfo.unique ? void 0 : "\u82E5\u672C\u6B21\u662F\u91CD\u8BD5/\u590D\u8DD1\uFF08\u4E0A\u6B21 apply \u53EF\u80FD\u5DF2\u6210\u529F\uFF09\uFF0C\u8BF7\u6539\u7528 updateTalentId=<\u547D\u4E2D\u7684\u4EBA\u624Did> \u8D70\u66F4\u65B0\u901A\u9053\uFF0C\u4E0D\u8981\u91CD\u590D\u5EFA\u6863",
|
|
3885
|
-
note: !dupInfo.checked ? "\u67E5\u91CD\u672A\u5B8C\u6210\uFF08getCandidateByPhone
|
|
3841
|
+
note: !dupInfo.checked ? "\u67E5\u91CD\u672A\u5B8C\u6210\uFF08getCandidateByPhone \u67E5\u8BE2\u5931\u8D25\uFF09\u2192 \u5DF2\u963B\u65AD\u65B0\u5EFA\uFF0C\u5FC5\u987B\u5148\u89E3\u51B3\u67E5\u91CD\u518D\u63D0\u4EA4" : dupInfo.byPhone ? "\u624B\u673A\u53F7\u5DF2\u7ED1\u5B9A\u4EBA\u624D\uFF08\u9875\u9762\u540C\u6B3E getCandidateByPhone \u547D\u4E2D\uFF09\u2192 \u4E0D\u65B0\u5EFA\uFF0C\u7ED9\u51FA\u4EBA\u624D\u67E5\u770B\u9875\u5730\u5740" : dupInfo.formConflicts.existing.length ? "\u624B\u673A\u53F7\u5728\u4EBA\u624D\u5E93\u5DF2\u5B58\u5728\uFF08\u8868\u5355\u552F\u4E00\u6027\u547D\u4E2D\uFF0C\u4F46\u65E0\u5E94\u8058\u6279\u6B21\uFF09\u2192 \u4E0D\u65B0\u5EFA" : dupInfo.formConflicts.unreadable.length ? "\u624B\u673A\u53F7\u88AB\u5DF2\u5220\u9664\u8BB0\u5F55\u5360\u7528\uFF08\u5E73\u53F0\u4ECD\u4F1A\u62E6\u65B0\u5EFA\uFF09\uFF1A\u9700\u5148\u5728\u56DE\u6536\u7AD9\u6E05\u7406\uFF0C\u6216\u6539\u4E3A\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D" : "\u65E0\u91CD\u590D"
|
|
3886
3842
|
}
|
|
3887
3843
|
};
|
|
3888
3844
|
const willSubmit = { formId: built.formId, objId: built.objId, mainTable: fingerprintMainTable(toDatasetMainTable(built.dataDetails, built.fields)), details: built.detailsPayload };
|
|
@@ -4610,11 +4566,24 @@ async function locateTalent(ctx, opts) {
|
|
|
4610
4566
|
const { host, cache } = ctx;
|
|
4611
4567
|
const listId = cache.lists?.talent?.listId;
|
|
4612
4568
|
const objId = cache.forms?.talent_pool?.objId;
|
|
4613
|
-
if (!
|
|
4569
|
+
if (!objId) throw rsFail("\u73AF\u5883\u7F13\u5B58\u7F3A\u5C11\u4EBA\u624D\u8868\u5355\uFF08forms.talent_pool\uFF09");
|
|
4614
4570
|
const fields = cache.fields[objId] || {};
|
|
4615
4571
|
const nameKey = fields.candidate_name || fields.name;
|
|
4616
4572
|
if (opts.mobile && !fields.telephone) throw rsFail("\u73AF\u5883\u7F13\u5B58\u7F3A\u5C11\u4EBA\u624D\u624B\u673A\u5B57\u6BB5\uFF08telephone\uFF09");
|
|
4617
4573
|
if (!opts.mobile && opts.name && !nameKey) throw rsFail("\u73AF\u5883\u7F13\u5B58\u7F3A\u5C11\u4EBA\u624D\u59D3\u540D\u5B57\u6BB5\uFF08candidate_name/name\uFF09");
|
|
4574
|
+
if (!listId) {
|
|
4575
|
+
const ds = await fetchDatasetRows(host, objId, { pageSize: 200, maxRows: 1e3 });
|
|
4576
|
+
let rows2 = ds.rows;
|
|
4577
|
+
if (opts.mobile) rows2 = rows2.filter((x) => String(x.telephone || "").includes(String(opts.mobile)));
|
|
4578
|
+
else if (opts.name) rows2 = rows2.filter((x) => String(x.candidate_name || x.name || "").includes(String(opts.name)));
|
|
4579
|
+
return rows2.slice(0, 20).map((x) => ({
|
|
4580
|
+
talentId: x.form_data_id || x.id || null,
|
|
4581
|
+
name: x.candidate_name || x.name || null,
|
|
4582
|
+
mobile: x.telephone || null,
|
|
4583
|
+
position: x.position_manage_id || x.position || null,
|
|
4584
|
+
recruitStatus: x.recruit_status || null
|
|
4585
|
+
}));
|
|
4586
|
+
}
|
|
4618
4587
|
const conds = {};
|
|
4619
4588
|
if (opts.mobile) {
|
|
4620
4589
|
const mf = "field_" + fields.telephone;
|
|
@@ -4659,12 +4628,6 @@ async function locateTalent(ctx, opts) {
|
|
|
4659
4628
|
}));
|
|
4660
4629
|
}
|
|
4661
4630
|
var PLAN_NAME_KEYS = ["msfa_name", "digital_name", "plan_name", "scheme_name"];
|
|
4662
|
-
function digitalMenuOf(cache) {
|
|
4663
|
-
const hit = cache.digitalHumanMenu;
|
|
4664
|
-
if (hit?.listId) return hit;
|
|
4665
|
-
const menus = cache.lists?.all_search || cache.menus || [];
|
|
4666
|
-
return menus.find((m) => (m.menuName || "").includes("\u9762\u8BD5\u6570\u5B57\u4EBA")) || menus.find((m) => (m.menuName || "").includes("\u6570\u5B57\u4EBA\u914D\u7F6E")) || null;
|
|
4667
|
-
}
|
|
4668
4631
|
async function digitalObjIdOf(ctx) {
|
|
4669
4632
|
const cached = ctx.cache.forms?.digital_human?.objId;
|
|
4670
4633
|
if (cached) return String(cached);
|
|
@@ -4674,7 +4637,7 @@ async function digitalObjIdOf(ctx) {
|
|
|
4674
4637
|
}
|
|
4675
4638
|
async function listDigitalPlans(opts) {
|
|
4676
4639
|
const { ctx, formId, layoutId, fieldId } = opts;
|
|
4677
|
-
const { host
|
|
4640
|
+
const { host } = ctx;
|
|
4678
4641
|
try {
|
|
4679
4642
|
const body = {
|
|
4680
4643
|
browserMultiple: false,
|
|
@@ -4699,54 +4662,16 @@ async function listDigitalPlans(opts) {
|
|
|
4699
4662
|
}
|
|
4700
4663
|
} catch {
|
|
4701
4664
|
}
|
|
4702
|
-
const
|
|
4703
|
-
if (!menu?.listId) {
|
|
4704
|
-
return { available: false, items: [], reason: "\u5019\u9009\u63A5\u53E3\u4E0D\u53EF\u7528\uFF0C\u4E14\u5F53\u524D\u73AF\u5883\u672A\u914D\u7F6E\u300C\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E\u300D\u5217\u8868\u83DC\u5355" };
|
|
4705
|
-
}
|
|
4706
|
-
let objId = "";
|
|
4707
|
-
try {
|
|
4708
|
-
const liBody = { cusMenuId: menu.cusMenuId, listId: menu.listId, urlPageTitle: menu.menuName };
|
|
4709
|
-
liBody["appId_" + menu.listId] = ctx.appId;
|
|
4710
|
-
const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: liBody });
|
|
4711
|
-
objId = String(li?.data?.objid || "");
|
|
4712
|
-
} catch {
|
|
4713
|
-
}
|
|
4714
|
-
if (!objId) objId = await digitalObjIdOf(ctx).catch(() => "");
|
|
4665
|
+
const objId = await digitalObjIdOf(ctx).catch(() => "");
|
|
4715
4666
|
if (!objId) {
|
|
4716
|
-
return { available: false, items: [], reason: "\u672A\u80FD\u89E3\u6790\u300C\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E\u300D\u5BF9\u8C61 id\
|
|
4667
|
+
return { available: false, items: [], reason: "\u5019\u9009\u63A5\u53E3\u4E0D\u53EF\u7528\uFF0C\u4E14\u672A\u80FD\u89E3\u6790\u300C\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E\u300D\u5BF9\u8C61 id\uFF08\u7F13\u5B58/tag \u5747\u5931\u8D25\uFF09" };
|
|
4717
4668
|
}
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
pageSize: size,
|
|
4725
|
-
tableuid: randHex32(),
|
|
4726
|
-
listId: menu.listId,
|
|
4727
|
-
searchParamData: { searchType: "3", type: "and" },
|
|
4728
|
-
terminal: "PC",
|
|
4729
|
-
browser: "Chrome",
|
|
4730
|
-
requiredMatch: 1,
|
|
4731
|
-
mapResult: 1,
|
|
4732
|
-
recheckQuery: 1,
|
|
4733
|
-
isFollow: 0,
|
|
4734
|
-
isShareToMe: 0,
|
|
4735
|
-
filterCondition: {},
|
|
4736
|
-
cusMenuId: menu.cusMenuId,
|
|
4737
|
-
urlPageTitle: menu.menuName,
|
|
4738
|
-
menuName: menu.menuName
|
|
4739
|
-
};
|
|
4740
|
-
const r = await host.request({
|
|
4741
|
-
path: `/api/ebuilder/form/list/getListDatas?passid=${objId}&cid=${objId}`,
|
|
4742
|
-
body,
|
|
4743
|
-
headers: { ebBusinessId: menu.listId }
|
|
4744
|
-
});
|
|
4745
|
-
const page = r?.data?.data || [];
|
|
4746
|
-
rows.push(...page);
|
|
4747
|
-
if (page.length < size) break;
|
|
4748
|
-
cur++;
|
|
4749
|
-
if (cur > 20) break;
|
|
4669
|
+
let rows = [];
|
|
4670
|
+
try {
|
|
4671
|
+
const ds = await fetchDatasetRows(host, objId, { pageSize: 200, maxRows: 1e3 });
|
|
4672
|
+
rows = ds.rows;
|
|
4673
|
+
} catch (e) {
|
|
4674
|
+
return { available: false, items: [], reason: "\u300C\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E\u300D\u8868\u76F4\u8BFB\u5931\u8D25\uFF1A" + (e?.message || e) };
|
|
4750
4675
|
}
|
|
4751
4676
|
const items = rows.map((x) => {
|
|
4752
4677
|
const nk = PLAN_NAME_KEYS.find((k) => String(x[k] || "").trim());
|
|
@@ -4757,7 +4682,7 @@ async function listDigitalPlans(opts) {
|
|
|
4757
4682
|
desc: String(x.zwjs || "").trim()
|
|
4758
4683
|
};
|
|
4759
4684
|
}).filter((x) => x.id);
|
|
4760
|
-
return { available: true, items, listId:
|
|
4685
|
+
return { available: true, items, listId: "dataset:" + objId, objId, menuName: "\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E", source: "dataset" };
|
|
4761
4686
|
}
|
|
4762
4687
|
function pickDigitalPlan(items, key) {
|
|
4763
4688
|
const k = String(key || "").trim();
|
|
@@ -5097,7 +5022,8 @@ var baseInput3 = {
|
|
|
5097
5022
|
start: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u5F00\u59CB\u65F6\u95F4 YYYY-MM-DD HH:mm\uFF08\u7F3A\u7701=\u5F53\u524D\u65F6\u95F4\uFF09" },
|
|
5098
5023
|
end: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u7ED3\u675F\u65F6\u95F4\uFF08\u7F3A\u7701=AI +7\u5929 / \u5176\u5B83 +1\u5C0F\u65F6\uFF09" },
|
|
5099
5024
|
email: { type: "string", description: "\u5019\u9009\u4EBA\u90AE\u7BB1\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u8865\u5F55\u503C\u4F18\u5148\u4E8E\u4EBA\u624D\u8D44\u6599\uFF09" },
|
|
5100
|
-
aiPlan: { type: "string", description: "AI \u9762\u8BD5\u65B9\u6848\u540D\u6216 id\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u4E0D\u4F20\u5219 prepare \u5217\u51FA\u5019\u9009\uFF09" }
|
|
5025
|
+
aiPlan: { type: "string", description: "AI \u9762\u8BD5\u65B9\u6848\u540D\u6216 id\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u4E0D\u4F20\u5219 prepare \u5217\u51FA\u5019\u9009\uFF09" },
|
|
5026
|
+
allowDuplicate: { type: "boolean", description: "\u9ED8\u8BA4\u5199\u524D\u67E5\u91CD\uFF1A\u540C\u4EBA\u624D+\u540C\u5F00\u59CB\u65F6\u95F4\u5DF2\u6709\u8BB0\u5F55\u4F1A\u963B\u65AD\uFF1B\u786E\u8BA4\u8981\u518D\u5EFA\u4E00\u6761\u65F6\u663E\u5F0F\u7F6E true" }
|
|
5101
5027
|
};
|
|
5102
5028
|
async function prepare3(args, env, opts = {}) {
|
|
5103
5029
|
const ctx = await makeCtx(env);
|
|
@@ -5189,6 +5115,31 @@ async function apply3(args, env) {
|
|
|
5189
5115
|
const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.arrange.apply");
|
|
5190
5116
|
return applyCore2(args, env, payload);
|
|
5191
5117
|
}
|
|
5118
|
+
function matchDuplicateInterview(rows, target) {
|
|
5119
|
+
const minute = (v) => String(v ?? "").trim().replace("T", " ").slice(0, 16);
|
|
5120
|
+
const text = (v) => {
|
|
5121
|
+
if (v && typeof v === "object") {
|
|
5122
|
+
const c = v;
|
|
5123
|
+
return String(c.fieldOptionId ?? c.fieldValue ?? "");
|
|
5124
|
+
}
|
|
5125
|
+
return String(v ?? "");
|
|
5126
|
+
};
|
|
5127
|
+
const wantStart = minute(target.startTime);
|
|
5128
|
+
for (const row of rows) {
|
|
5129
|
+
const s = minute(text(row.start_time));
|
|
5130
|
+
if (!s || s !== wantStart) continue;
|
|
5131
|
+
const t = text(row.talent_id);
|
|
5132
|
+
if (t !== String(target.talentId) && t !== String(target.talentName || "")) continue;
|
|
5133
|
+
const ty = text(row.interview_type);
|
|
5134
|
+
if (target.type && ty && ty !== target.type) continue;
|
|
5135
|
+
return { formDataId: String(row.form_data_id || ""), start: s };
|
|
5136
|
+
}
|
|
5137
|
+
return null;
|
|
5138
|
+
}
|
|
5139
|
+
async function findDuplicateInterview(ctx, objId, talentId, talentName, startTime, type) {
|
|
5140
|
+
const { rows } = await fetchDatasetRows(ctx.host, objId, { pageSize: 1e3, maxRows: 1e3 });
|
|
5141
|
+
return matchDuplicateInterview(rows, { talentId, talentName, startTime, type });
|
|
5142
|
+
}
|
|
5192
5143
|
async function applyCore2(args, env, payload) {
|
|
5193
5144
|
restoreDsOptions(payload.enumMaps);
|
|
5194
5145
|
const ctx = await makeCtx(env);
|
|
@@ -5220,6 +5171,25 @@ async function applyCore2(args, env, payload) {
|
|
|
5220
5171
|
if (payload.fingerprint !== createHash5("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
|
|
5221
5172
|
throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
|
|
5222
5173
|
}
|
|
5174
|
+
let duplicateCheckSkipped = "";
|
|
5175
|
+
if (merged.allowDuplicate !== true) {
|
|
5176
|
+
try {
|
|
5177
|
+
const dup = await findDuplicateInterview(
|
|
5178
|
+
ctx,
|
|
5179
|
+
plan.objId,
|
|
5180
|
+
talentId,
|
|
5181
|
+
String(plan.cand?.name || ""),
|
|
5182
|
+
String(startTime),
|
|
5183
|
+
String(merged.type || DEFAULT_INTERVIEW_TYPE)
|
|
5184
|
+
);
|
|
5185
|
+
if (dup) {
|
|
5186
|
+
throw rsFail("\u5DF2\u5B58\u5728\u540C\u4EBA\u624D\u3001\u540C\u5F00\u59CB\u65F6\u95F4\u7684\u9762\u8BD5\u8BB0\u5F55\uFF08formDataId=" + (dup.formDataId || "\u672A\u77E5") + "\uFF0C\u5F00\u59CB\u65F6\u95F4 " + dup.start + "\uFF09\uFF0C\u672C\u6B21\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\u3002\u5982\u786E\u9700\u518D\u5EFA\u4E00\u6761\uFF08\u5982\u591A\u8F6E\u9762\u8BD5\u540C\u4E00\u65F6\u6BB5\uFF09\uFF0C\u8BF7\u663E\u5F0F\u4F20 allowDuplicate:true \u540E\u91CD\u8BD5\uFF1B\u82E5\u662F\u4E0A\u6B21 apply \u5DF2\u6210\u529F\uFF0C\u8BF7\u76F4\u63A5\u67E5\u770B\u8BE5\u8BB0\u5F55\uFF0C\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u3002", { duplicate: true, formDataId: dup.formDataId });
|
|
5187
|
+
}
|
|
5188
|
+
} catch (e) {
|
|
5189
|
+
if (e?.type || e?.code) throw e;
|
|
5190
|
+
duplicateCheckSkipped = "\u9762\u8BD5\u8BB0\u5F55\u67E5\u91CD\u672A\u6267\u884C\uFF08\u8BFB\u53D6\u9762\u8BD5\u53F0\u8D26\u5931\u8D25\uFF1A" + (e?.message || "\u672A\u77E5\u539F\u56E0") + "\uFF09\uFF0C\u672C\u6B21\u4ECD\u7EE7\u7EED\u5199\u5165";
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5223
5193
|
const formDataId = await saveFormData(ctx.host, {
|
|
5224
5194
|
appId: plan.appId,
|
|
5225
5195
|
formId: plan.formId,
|
|
@@ -5270,7 +5240,11 @@ async function applyCore2(args, env, payload) {
|
|
|
5270
5240
|
aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : void 0,
|
|
5271
5241
|
saveActions: actionsRun.executed,
|
|
5272
5242
|
verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
|
|
5273
|
-
warnings: [
|
|
5243
|
+
warnings: [
|
|
5244
|
+
...actionsRun.warnings || [],
|
|
5245
|
+
...duplicateCheckSkipped ? [duplicateCheckSkipped] : [],
|
|
5246
|
+
...verifyWarnings
|
|
5247
|
+
],
|
|
5274
5248
|
assigned: actionsRun.assigned || {}
|
|
5275
5249
|
});
|
|
5276
5250
|
}
|
|
@@ -5548,9 +5522,16 @@ var R = (v) => String(v ?? "").replace(/^<p>|<\/p>$/g, "").trim();
|
|
|
5548
5522
|
async function locateTalentId2(host, cache, args) {
|
|
5549
5523
|
if (args.talentId) return String(args.talentId);
|
|
5550
5524
|
if (!args.mobile) throw rsValidationError("locate_required", "\u8BF7\u63D0\u4F9B talentId \u6216 mobile");
|
|
5551
|
-
const
|
|
5552
|
-
if (!
|
|
5553
|
-
const
|
|
5525
|
+
const poolObjId = cache.forms?.talent_pool?.objId;
|
|
5526
|
+
if (!poolObjId) throw rsFail("\u73AF\u5883\u7F13\u5B58\u7F3A\u5C11\u4EBA\u624D\u8868\u5355 objId");
|
|
5527
|
+
const listId = cache.lists?.talent?.listId;
|
|
5528
|
+
if (!listId) {
|
|
5529
|
+
const ds = await fetchDatasetRows(host, poolObjId, { pageSize: 200, maxRows: 1e3 });
|
|
5530
|
+
const rows2 = ds.rows.filter((x) => String(x.telephone || "").includes(String(args.mobile)));
|
|
5531
|
+
if (!rows2.length) throw rsFail("\u672A\u627E\u5230\u624B\u673A\u53F7\u4E3A " + args.mobile + " \u7684\u5019\u9009\u4EBA");
|
|
5532
|
+
if (rows2.length > 1) throw rsFail("\u8BE5\u624B\u673A\u53F7\u547D\u4E2D\u591A\u6761\u5019\u9009\u4EBA\uFF0C\u8BF7\u63D0\u4F9B talentId \u7CBE\u786E\u5B9A\u4F4D");
|
|
5533
|
+
return String(rows2[0].talentId || rows2[0].form_data_id || rows2[0].id);
|
|
5534
|
+
}
|
|
5554
5535
|
const r = await host.request({
|
|
5555
5536
|
path: "/api/ebuilder/form/list/getListDatas?passid=" + poolObjId + "&cid=" + poolObjId,
|
|
5556
5537
|
body: {
|
|
@@ -5953,12 +5934,27 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
5953
5934
|
const serverFilterReady = !!(feedbackTodoMode && statusFieldId && pendingOptionId && interviewerFieldId && feedbackUser?.id);
|
|
5954
5935
|
const findByMenu = (names) => (cache.lists?.all_search || []).find((m) => m.listId && names.some((n) => (m.menuName || "").trim() === n)) || (cache.lists?.all_search || []).find((m) => m.listId && names.some((n) => (m.menuName || "").includes(n)));
|
|
5955
5936
|
const listParam = (feedbackTodoMode && !serverFilterReady ? findByMenu(FEEDBACK_TODO_MENU_NAMES) : null) || cache.lists[t.listKey] || findByMenu(t.menuNames);
|
|
5956
|
-
|
|
5957
|
-
|
|
5937
|
+
let directRows = null;
|
|
5938
|
+
let directTotal = null;
|
|
5939
|
+
let directTruncated = false;
|
|
5940
|
+
let listId = "";
|
|
5941
|
+
let cusMenuId = "";
|
|
5942
|
+
let menuName = t.title;
|
|
5943
|
+
if (listParam?.listId) {
|
|
5944
|
+
listId = String(listParam.listId);
|
|
5945
|
+
cusMenuId = String(listParam.cusMenuId || "");
|
|
5946
|
+
menuName = listParam.menuName || t.title;
|
|
5947
|
+
} else {
|
|
5948
|
+
if (!formObjId) {
|
|
5949
|
+
throw rsFail("\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C" + t.title + "\u300D\u8868\u5355\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u6570\u636E");
|
|
5950
|
+
}
|
|
5951
|
+
const ds = await fetchDatasetRows(host, formObjId, { pageSize: Math.max(200, pageSize), maxRows: 1e3 });
|
|
5952
|
+
directRows = ds.rows;
|
|
5953
|
+
directTotal = ds.total;
|
|
5954
|
+
directTruncated = ds.truncated;
|
|
5955
|
+
listId = "dataset:" + formObjId;
|
|
5956
|
+
menuName = t.title;
|
|
5958
5957
|
}
|
|
5959
|
-
const listId = listParam.listId;
|
|
5960
|
-
const cusMenuId = listParam.cusMenuId;
|
|
5961
|
-
const menuName = listParam.menuName || t.title;
|
|
5962
5958
|
const commonSearchFields = {};
|
|
5963
5959
|
const appliedFilters = [];
|
|
5964
5960
|
for (const [argKey, def] of Object.entries(FILTER_ARGS)) {
|
|
@@ -6007,54 +6003,60 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6007
6003
|
let lastGot = 0;
|
|
6008
6004
|
const PAGE_CONCURRENCY = 6;
|
|
6009
6005
|
let countFetched = false;
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
const
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6006
|
+
if (!directRows) {
|
|
6007
|
+
for (let start = 0; start < wantPages; start += PAGE_CONCURRENCY) {
|
|
6008
|
+
const end = Math.min(start + PAGE_CONCURRENCY, wantPages);
|
|
6009
|
+
const idxs = [];
|
|
6010
|
+
for (let i = start; i < end; i++) idxs.push(i);
|
|
6011
|
+
const needCount = !countFetched;
|
|
6012
|
+
if (needCount) countFetched = true;
|
|
6013
|
+
const countPromise = needCount ? (() => {
|
|
6014
|
+
const cntBody = { ...baseBody };
|
|
6015
|
+
delete cntBody.current;
|
|
6016
|
+
delete cntBody.pageSize;
|
|
6017
|
+
return host.request({
|
|
6018
|
+
path: "/api/ebuilder/form/list/getListDataCount?passid=" + formObjId + "&cid=" + formObjId,
|
|
6019
|
+
body: cntBody,
|
|
6020
|
+
headers: extra
|
|
6021
|
+
}).catch(() => null);
|
|
6022
|
+
})() : Promise.resolve(null);
|
|
6023
|
+
const [c, ...pageResps] = await Promise.all([
|
|
6024
|
+
countPromise,
|
|
6025
|
+
...idxs.map((i) => host.request({
|
|
6026
|
+
path: "/api/ebuilder/form/list/getListDatas?passid=" + formObjId + "&cid=" + formObjId,
|
|
6027
|
+
body: { ...baseBody, current: current + i },
|
|
6028
|
+
headers: extra
|
|
6029
|
+
}))
|
|
6030
|
+
]);
|
|
6031
|
+
if (c && typeof c?.data?.total === "number") cntTotal = c.data.total;
|
|
6032
|
+
let stop = false;
|
|
6033
|
+
for (let k = 0; k < idxs.length; k++) {
|
|
6034
|
+
const i = idxs[k];
|
|
6035
|
+
const resp = pageResps[k];
|
|
6036
|
+
const rRaw = resp?.data?.data || [];
|
|
6037
|
+
const rDisp = resp?.data?.displayData;
|
|
6038
|
+
if (Array.isArray(rDisp) && rDisp.length) {
|
|
6039
|
+
hasDisplay = true;
|
|
6040
|
+
dispRows.push(...rDisp);
|
|
6041
|
+
}
|
|
6042
|
+
rawRows.push(...rRaw);
|
|
6043
|
+
const got = Array.isArray(rDisp) && rDisp.length ? rDisp.length : rRaw.length;
|
|
6044
|
+
lastGot = got;
|
|
6045
|
+
if (got < pageSize) {
|
|
6046
|
+
stop = true;
|
|
6047
|
+
break;
|
|
6048
|
+
}
|
|
6049
|
+
if (cntTotal !== null && (current + i) * pageSize >= cntTotal) {
|
|
6050
|
+
stop = true;
|
|
6051
|
+
break;
|
|
6052
|
+
}
|
|
6055
6053
|
}
|
|
6054
|
+
if (stop) break;
|
|
6056
6055
|
}
|
|
6057
|
-
|
|
6056
|
+
} else {
|
|
6057
|
+
rawRows.push(...directRows);
|
|
6058
|
+
cntTotal = directTotal ?? directRows.length;
|
|
6059
|
+
lastGot = directRows.length;
|
|
6058
6060
|
}
|
|
6059
6061
|
const rows = hasDisplay ? dispRows : rawRows;
|
|
6060
6062
|
let workRows = rows;
|
|
@@ -6081,6 +6083,12 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6081
6083
|
return av < bv ? 1 : av > bv ? -1 : 0;
|
|
6082
6084
|
});
|
|
6083
6085
|
}
|
|
6086
|
+
const directFilteredRows = directRows ? workRows : [];
|
|
6087
|
+
const filteredCount = workRows.length;
|
|
6088
|
+
if (directRows && !args.all) {
|
|
6089
|
+
const start = Math.max(0, (current - 1) * pageSize);
|
|
6090
|
+
workRows = workRows.slice(start, start + pageSize);
|
|
6091
|
+
}
|
|
6084
6092
|
const reachedEnd = lastGot < pageSize;
|
|
6085
6093
|
let total;
|
|
6086
6094
|
let totalExact;
|
|
@@ -6100,6 +6108,17 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6100
6108
|
if (args.all && rows.length >= wantPages * pageSize && (cntTotal === null || cntTotal > rows.length)) {
|
|
6101
6109
|
totalNote = `\u5DF2\u53D6\u56DE ${rows.length} \u884C\uFF08\u8FBE maxPages \u4E0A\u9650 ${wantPages} \u9875\uFF09\uFF0C\u53EF\u80FD\u4ECD\u6709\u66F4\u591A\uFF1B\u53EF\u589E\u5927 maxPages \u6216\u52A0\u7CBE\u786E\u7B5B\u9009`;
|
|
6102
6110
|
}
|
|
6111
|
+
if (directRows && !feedbackTodoMode && (clientFilters.length || args.recent)) {
|
|
6112
|
+
if (directTruncated) {
|
|
6113
|
+
total = null;
|
|
6114
|
+
totalExact = false;
|
|
6115
|
+
totalNote = "\u76F4\u8BFB\u8868\u5DF2\u8FBE\u5230 1000 \u884C\u4E0A\u9650\uFF0C\u7B5B\u9009\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF1B\u8BF7\u52A0\u7CBE\u786E\u7B5B\u9009\u540E\u91CD\u67E5";
|
|
6116
|
+
} else {
|
|
6117
|
+
total = filteredCount;
|
|
6118
|
+
totalExact = true;
|
|
6119
|
+
totalNote = "\u76F4\u8BFB\u8868\u6A21\u5F0F\uFF1Atotal \u4E3A\u672C\u5730\u7B5B\u9009\u540E\u7684\u6761\u6570";
|
|
6120
|
+
}
|
|
6121
|
+
}
|
|
6103
6122
|
const dictNameMap = {};
|
|
6104
6123
|
const optionsMap = {};
|
|
6105
6124
|
const dsOptionsCache = {};
|
|
@@ -6195,7 +6214,7 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6195
6214
|
}
|
|
6196
6215
|
}
|
|
6197
6216
|
if (Array.isArray(arr)) {
|
|
6198
|
-
const names = arr.map((x) => x?.name || x?.username || x?.text || x?.title || (typeof x === "string" ? x : null)).filter(Boolean);
|
|
6217
|
+
const names = arr.map((x) => x?.name || x?.fieldOptionName || x?.username || x?.text || x?.title || (typeof x === "string" ? x : null)).filter(Boolean);
|
|
6199
6218
|
if (names.length) {
|
|
6200
6219
|
row[k] = names.join("\u3001");
|
|
6201
6220
|
continue;
|
|
@@ -6231,7 +6250,7 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6231
6250
|
}
|
|
6232
6251
|
}
|
|
6233
6252
|
if (Array.isArray(arr)) {
|
|
6234
|
-
const names = arr.map((x) => x?.name || x?.text || x?.title || (typeof x === "string" ? x : null)).filter(Boolean);
|
|
6253
|
+
const names = arr.map((x) => x?.name || x?.fieldOptionName || x?.text || x?.title || (typeof x === "string" ? x : null)).filter(Boolean);
|
|
6235
6254
|
if (names.length) {
|
|
6236
6255
|
row[k] = names.join("\u3001");
|
|
6237
6256
|
continue;
|
|
@@ -6260,9 +6279,60 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6260
6279
|
}
|
|
6261
6280
|
if (feedbackTodoMode) {
|
|
6262
6281
|
const me = feedbackUser?.name || "";
|
|
6263
|
-
const
|
|
6264
|
-
const
|
|
6265
|
-
|
|
6282
|
+
const myId = feedbackUser?.id ? String(feedbackUser.id) : "";
|
|
6283
|
+
const scalar = (v) => {
|
|
6284
|
+
if (v == null) return "";
|
|
6285
|
+
if (typeof v === "object") return String(v.id ?? v.value ?? v.key ?? v.label ?? "");
|
|
6286
|
+
return String(v);
|
|
6287
|
+
};
|
|
6288
|
+
const tokensOf = (v) => {
|
|
6289
|
+
const out2 = [];
|
|
6290
|
+
const walk2 = (x, depth = 0) => {
|
|
6291
|
+
if (x == null || depth > 4) return;
|
|
6292
|
+
if (Array.isArray(x)) {
|
|
6293
|
+
for (const it of x) walk2(it, depth + 1);
|
|
6294
|
+
return;
|
|
6295
|
+
}
|
|
6296
|
+
if (typeof x === "object") {
|
|
6297
|
+
for (const f of [x.id, x.value, x.employeeId, x.userId, x.name, x.text, x.label]) walk2(f, depth + 1);
|
|
6298
|
+
return;
|
|
6299
|
+
}
|
|
6300
|
+
const s = String(x).trim();
|
|
6301
|
+
if (!s || /^\[object /.test(s)) return;
|
|
6302
|
+
out2.push(s);
|
|
6303
|
+
if ((s.startsWith("[") || s.startsWith("{")) && s.length < 2e3) {
|
|
6304
|
+
try {
|
|
6305
|
+
walk2(JSON.parse(s), depth + 1);
|
|
6306
|
+
} catch {
|
|
6307
|
+
}
|
|
6308
|
+
}
|
|
6309
|
+
};
|
|
6310
|
+
walk2(v);
|
|
6311
|
+
return [...new Set(out2)];
|
|
6312
|
+
};
|
|
6313
|
+
const st = (r) => scalar(r.union_status_key || r.union_status);
|
|
6314
|
+
const tp = (r) => scalar(r.interview_type_key || r.interview_type);
|
|
6315
|
+
const statusLabel = (r) => {
|
|
6316
|
+
const vals = [scalar(r.union_status), scalar(r.union_status_key)];
|
|
6317
|
+
const mapped = vals.map((v) => optionMapOf(statusFieldId)[v]).find(Boolean);
|
|
6318
|
+
return mapped || vals.find((v) => /待反馈/.test(v)) || st(r);
|
|
6319
|
+
};
|
|
6320
|
+
const isPendingRow = (r) => {
|
|
6321
|
+
const vals = [scalar(r.union_status), scalar(r.union_status_key)];
|
|
6322
|
+
if (pendingOptionId && vals.includes(pendingOptionId)) return true;
|
|
6323
|
+
return /待反馈/.test(statusLabel(r));
|
|
6324
|
+
};
|
|
6325
|
+
const isMineRow = (r) => {
|
|
6326
|
+
const tokens = [
|
|
6327
|
+
...tokensOf(r.interviewer),
|
|
6328
|
+
...tokensOf(r.interviewer_name),
|
|
6329
|
+
...tokensOf(r.interviewer_id)
|
|
6330
|
+
];
|
|
6331
|
+
if (!tokens.length) tokens.push(...tokensOf(r.feedbackUser));
|
|
6332
|
+
if (!tokens.length) return false;
|
|
6333
|
+
return tokens.some((t2) => !!me && t2.includes(me) || !!myId && t2.includes(myId));
|
|
6334
|
+
};
|
|
6335
|
+
const iv = (r) => tokensOf(r.interviewer).join(",");
|
|
6266
6336
|
const slim = (r) => ({
|
|
6267
6337
|
form_data_id: r.form_data_id,
|
|
6268
6338
|
candidate_name: r.candidate_name,
|
|
@@ -6279,32 +6349,50 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
6279
6349
|
// 参与方式按面试方式取值(现场=地点 / 视频=链接 / AI=小程序码),不要统一当"地点"
|
|
6280
6350
|
participation: participationOf(r)
|
|
6281
6351
|
});
|
|
6282
|
-
const
|
|
6283
|
-
const
|
|
6352
|
+
const effectiveServerFilter = serverFilterApplied && !directRows;
|
|
6353
|
+
const scopeRows = directRows ? directFilteredRows : outRows;
|
|
6354
|
+
const pendingAll = effectiveServerFilter ? scopeRows : scopeRows.filter(isPendingRow);
|
|
6355
|
+
const mineAllAll = effectiveServerFilter ? scopeRows : me || feedbackUser?.id ? pendingAll.filter(isMineRow) : [];
|
|
6356
|
+
const pending = effectiveServerFilter ? outRows : outRows.filter(isPendingRow);
|
|
6357
|
+
const mineAll = effectiveServerFilter ? outRows : me || feedbackUser?.id ? pending.filter(isMineRow) : [];
|
|
6284
6358
|
const myAi = mineAll.filter((r) => /AI\s*面试/i.test(tp(r)));
|
|
6359
|
+
const myAiAll = mineAllAll.filter((r) => /AI\s*面试/i.test(tp(r)));
|
|
6360
|
+
if (directRows) {
|
|
6361
|
+
total = directTruncated ? null : mineAllAll.length;
|
|
6362
|
+
totalExact = !directTruncated;
|
|
6363
|
+
out.total = total;
|
|
6364
|
+
out.totalExact = totalExact;
|
|
6365
|
+
out.totalNote = directTruncated ? "\u76F4\u8BFB\u8868\u5DF2\u8FBE\u5230 1000 \u884C\u4E0A\u9650\uFF0C\u5F85\u529E\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF1B\u8BF7\u52A0\u7CBE\u786E\u7B5B\u9009\u540E\u91CD\u67E5" : "\u76F4\u8BFB\u8868\u6A21\u5F0F\uFF1Atotal \u4E3A\u300C\u5F85\u53CD\u9988 + \u9762\u8BD5\u5B98=\u5F53\u524D\u7528\u6237\u300D\u672C\u5730\u7B5B\u9009\u540E\u7684\u6761\u6570";
|
|
6366
|
+
}
|
|
6285
6367
|
const notes = [];
|
|
6286
|
-
if (!me) notes.push("\u672A\u80FD\u89E3\u6790\u5F53\u524D\u767B\u5F55\u7528\u6237\uFF0C\u65E0\u6CD5\u6309\u9762\u8BD5\u5B98\u8FC7\u6EE4\uFF08\u7ED3\u679C\u4E3A\u7A7A\uFF09");
|
|
6287
|
-
if (
|
|
6368
|
+
if (!me && !feedbackUser?.id) notes.push("\u672A\u80FD\u89E3\u6790\u5F53\u524D\u767B\u5F55\u7528\u6237\uFF0C\u65E0\u6CD5\u6309\u9762\u8BD5\u5B98\u8FC7\u6EE4\uFF08\u7ED3\u679C\u4E3A\u7A7A\uFF09");
|
|
6369
|
+
if (effectiveServerFilter) {
|
|
6288
6370
|
notes.push("\u670D\u52A1\u7AEF\u5DF2\u6309\u300C\u5F85\u53CD\u9988 + \u5F53\u524D\u767B\u5F55\u4EBA\u4E3A\u9762\u8BD5\u5B98\u300D\u7B5B\u9009\uFF08commonSearchFields + in\uFF09\uFF0Ctotal \u4E3A\u8BE5\u6761\u4EF6\u4E0B\u7684\u7CBE\u786E\u6761\u6570");
|
|
6289
6371
|
if (out.total !== null && outRows.length < out.total) {
|
|
6290
6372
|
notes.push("\u26A0\uFE0F \u4EC5\u53D6\u56DE " + outRows.length + "/" + out.total + " \u6761\u5F85\u529E\uFF08\u7ED3\u679C\u4ECD\u53D7\u7FFB\u9875\u4E0A\u9650\u7EA6\u675F\uFF09\uFF0C\u8BF7\u52A0\u5927 maxPages \u540E\u91CD\u67E5");
|
|
6291
6373
|
}
|
|
6292
6374
|
} else {
|
|
6293
|
-
notes.push("\u6570\u636E\u6E90\u5217\u8868\u300C" + menuName + "\u300D\uFF08total=" + (out.total === null ? "\u4E0D\u53EF\u77E5" : out.total) + "\uFF0C\u5DF2\u626B\u63CF " +
|
|
6294
|
-
if (out.total !== null && outRows.length < out.total) {
|
|
6375
|
+
notes.push("\u6570\u636E\u6E90\u5217\u8868\u300C" + menuName + "\u300D\uFF08total=" + (out.total === null ? "\u4E0D\u53EF\u77E5" : out.total) + "\uFF0C\u5DF2\u626B\u63CF " + scopeRows.length + " \u6761\uFF09\uFF1B\u300C\u6211\u7684\u9762\u8BD5\u300D\u4E3A\u4E0E\u6211\u76F8\u5173\u8303\u56F4\uFF0C\u4ECD\u9700\u6309\u9762\u8BD5\u5B98\u4E8C\u6B21\u7B5B");
|
|
6376
|
+
if (!directRows && out.total !== null && outRows.length < out.total) {
|
|
6295
6377
|
notes.push("\u26A0\uFE0F \u672A\u8986\u76D6\u5168\u90E8\uFF1A\u5DF2\u626B\u63CF " + outRows.length + "/" + out.total + " \u6761\uFF08\u5217\u8868\u9ED8\u8BA4\u987A\u5E8F\uFF09\uFF0C\u6392\u5728\u540E\u9762\u7684\u5F85\u529E\u4F1A\u6F0F\u4E14\u4E0D\u62A5\u9519\uFF1B\u8BF7\u52A0\u5927 maxPages \u6216 pageSize \u540E\u91CD\u67E5");
|
|
6296
6378
|
}
|
|
6379
|
+
if (directRows && directTruncated) {
|
|
6380
|
+
notes.push("\u26A0\uFE0F \u76F4\u8BFB\u8868\u5DF2\u8FBE 1000 \u884C\u4E0A\u9650\uFF0C\u6392\u5728\u540E\u9762\u7684\u5F85\u529E\u53EF\u80FD\u6F0F\u53D6");
|
|
6381
|
+
}
|
|
6382
|
+
if (directRows && (mineAllAll.length > mineAll.length || myAiAll.length > myAi.length)) {
|
|
6383
|
+
notes.push("\u76F4\u8BFB\u8868 current/pageSize \u53EA\u8FD4\u56DE\u5F53\u524D\u9875 " + outRows.length + " \u6761\u660E\u7EC6\uFF1Bcount \u6309\u76F4\u8BFB\u5B8C\u6574\u96C6\u7EDF\u8BA1\uFF0C\u53EF\u7528 all=true \u53D6\u56DE\u5168\u90E8");
|
|
6384
|
+
}
|
|
6297
6385
|
}
|
|
6298
|
-
out.serverFiltered =
|
|
6386
|
+
out.serverFiltered = effectiveServerFilter;
|
|
6299
6387
|
out.currentUserId = feedbackUser?.id || null;
|
|
6300
6388
|
out.feedbackTodo = {
|
|
6301
6389
|
currentUser: me || null,
|
|
6302
|
-
scanned:
|
|
6390
|
+
scanned: scopeRows.length,
|
|
6303
6391
|
total: out.total,
|
|
6304
6392
|
totalExact: out.totalExact,
|
|
6305
|
-
myAiPendingFeedback: { count:
|
|
6393
|
+
myAiPendingFeedback: { count: myAiAll.length, rows: myAi.map(slim) },
|
|
6306
6394
|
myOtherPendingFeedback: {
|
|
6307
|
-
count:
|
|
6395
|
+
count: mineAllAll.length - myAiAll.length,
|
|
6308
6396
|
rows: mineAll.filter((r) => !/AI\s*面试/i.test(tp(r))).map(slim)
|
|
6309
6397
|
},
|
|
6310
6398
|
...notes.length ? { note: notes.join("\uFF1B") } : {}
|
|
@@ -6606,13 +6694,14 @@ async function candidateSearchHandler(args, env) {
|
|
|
6606
6694
|
const talent = cache.lists?.talent;
|
|
6607
6695
|
const listId = talent?.listId;
|
|
6608
6696
|
const objId = cache.forms?.talent_pool?.objId;
|
|
6609
|
-
if (!
|
|
6610
|
-
throw rsFail("\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C\u4EBA\u624D\u5E93\u300D\
|
|
6697
|
+
if (!objId) {
|
|
6698
|
+
throw rsFail("\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\uFF0C\u65E0\u6CD5\u641C\u7D22\u4EBA\u624D\u3002\u8BF7\u786E\u8BA4 CLI \u5DF2\u767B\u5F55\u76EE\u6807\u73AF\u5883\u4E14\u8BE5\u73AF\u5883\u5DF2\u90E8\u7F72\u62DB\u8058\u5E94\u7528\uFF08\u53EF\u8FD0\u884C ehr.recruit.context.resolve \u5BF9\u7167\u68C0\u67E5\uFF09\u3002");
|
|
6611
6699
|
}
|
|
6612
|
-
const
|
|
6613
|
-
const
|
|
6700
|
+
const directMode = !listId;
|
|
6701
|
+
const cusMenuId = talent?.cusMenuId || "";
|
|
6702
|
+
const menuName = talent?.menuName || "\u4EBA\u624D\u7BA1\u7406";
|
|
6614
6703
|
const fields = cache.fields[objId] || {};
|
|
6615
|
-
const ledgerObjId = await resolveLedgerObjId(host, String(listId), String(objId));
|
|
6704
|
+
const ledgerObjId = directMode ? String(objId) : await resolveLedgerObjId(host, String(listId), String(objId));
|
|
6616
6705
|
const nameField = "field_" + (fields.candidate_name || fields.name);
|
|
6617
6706
|
const mobileField = "field_" + fields.telephone;
|
|
6618
6707
|
const name = args.name ? String(args.name) : "";
|
|
@@ -6634,18 +6723,25 @@ async function candidateSearchHandler(args, env) {
|
|
|
6634
6723
|
}
|
|
6635
6724
|
if (keyword && !name && !mobile) {
|
|
6636
6725
|
searchType = "or";
|
|
6637
|
-
const meta = await resolveListSearchMeta(host, String(listId));
|
|
6638
6726
|
const used = [];
|
|
6639
6727
|
const fellBack = [];
|
|
6640
|
-
|
|
6641
|
-
const
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6728
|
+
if (directMode) {
|
|
6729
|
+
for (const dk of KEYWORD_TEXT_FIELDS) {
|
|
6730
|
+
if (!fields[dk]) continue;
|
|
6731
|
+
used.push({ field: dk, label: dk, operator: "contains" });
|
|
6732
|
+
}
|
|
6733
|
+
} else {
|
|
6734
|
+
const meta = await resolveListSearchMeta(host, String(listId));
|
|
6735
|
+
for (const dk of KEYWORD_TEXT_FIELDS) {
|
|
6736
|
+
const fid = fields[dk];
|
|
6737
|
+
if (!fid) continue;
|
|
6738
|
+
const bare = String(fid);
|
|
6739
|
+
const mk = "field_" + bare;
|
|
6740
|
+
const norm = normalizeListOperator(meta.operators[bare]);
|
|
6741
|
+
if (norm.fellBack) fellBack.push(meta.labels[bare] || dk);
|
|
6742
|
+
conds[mk] = [{ [mk]: keyword, [mk + "_condition_type"]: norm.op }];
|
|
6743
|
+
used.push({ field: dk, label: meta.labels[bare] || dk, operator: norm.op, ...norm.fellBack ? { operatorFallback: true } : {} });
|
|
6744
|
+
}
|
|
6649
6745
|
}
|
|
6650
6746
|
searchFields = used;
|
|
6651
6747
|
if (!used.length) {
|
|
@@ -6656,45 +6752,67 @@ async function candidateSearchHandler(args, env) {
|
|
|
6656
6752
|
}
|
|
6657
6753
|
const wantPageSize = clampPageSize(args.pageSize);
|
|
6658
6754
|
const fetchPageSize = createdAfter ? Math.min(200, Math.max(wantPageSize * 5, 50)) : wantPageSize;
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6755
|
+
let rows = [];
|
|
6756
|
+
let total = 0;
|
|
6757
|
+
let directTruncated = false;
|
|
6758
|
+
if (directMode) {
|
|
6759
|
+
const ds = await fetchDatasetRows(host, String(objId), {
|
|
6760
|
+
// 直读没有服务端分页:至少取到当前页所需行数,避免 current>1 时切出空页。
|
|
6761
|
+
pageSize: Math.min(1e3, Math.max(200, fetchPageSize * Math.max(1, Number(args.current || 1)))),
|
|
6762
|
+
maxRows: 1e3
|
|
6763
|
+
});
|
|
6764
|
+
let dsRows = ds.rows;
|
|
6765
|
+
const filtered = !!(name || mobile || keyword);
|
|
6766
|
+
if (name) dsRows = dsRows.filter((r) => String(r.candidate_name || r.name || "").includes(name));
|
|
6767
|
+
else if (mobile) dsRows = dsRows.filter((r) => String(r.telephone || "").includes(mobile));
|
|
6768
|
+
else if (keyword) {
|
|
6769
|
+
const keys = KEYWORD_TEXT_FIELDS.filter((dk) => fields[dk]);
|
|
6770
|
+
if (keys.length) dsRows = dsRows.filter((r) => keys.some((dk) => String(r[dk] ?? "").includes(keyword)));
|
|
6771
|
+
}
|
|
6772
|
+
rows = dsRows;
|
|
6773
|
+
directTruncated = ds.truncated;
|
|
6774
|
+
total = ds.truncated ? null : filtered ? dsRows.length : ds.total !== null ? ds.total : dsRows.length;
|
|
6775
|
+
} else {
|
|
6776
|
+
const baseBody = {
|
|
6777
|
+
current: Number(args.current || 1),
|
|
6778
|
+
pageSize: fetchPageSize,
|
|
6779
|
+
tableuid: randHex32(),
|
|
6780
|
+
listId,
|
|
6781
|
+
searchParamData: { searchType: "3", commonSearchFields: conds, type: searchType },
|
|
6782
|
+
terminal: "PC",
|
|
6783
|
+
browser: "Chrome",
|
|
6784
|
+
requiredMatch: 1,
|
|
6785
|
+
mapResult: 1,
|
|
6786
|
+
recheckQuery: 1,
|
|
6787
|
+
isFollow: 0,
|
|
6788
|
+
isShareToMe: 0,
|
|
6789
|
+
filterCondition: {},
|
|
6790
|
+
cusMenuId,
|
|
6791
|
+
urlPageTitle: "\u4EBA\u624D\u5E93",
|
|
6792
|
+
menuName
|
|
6793
|
+
};
|
|
6794
|
+
const extra = { ebBusinessId: listId };
|
|
6795
|
+
const cntBody = { ...baseBody };
|
|
6796
|
+
delete cntBody.current;
|
|
6797
|
+
delete cntBody.pageSize;
|
|
6798
|
+
const [resp, c] = await Promise.all([
|
|
6799
|
+
host.request({
|
|
6800
|
+
path: "/api/ebuilder/form/list/getListDatas?passid=" + ledgerObjId + "&cid=" + ledgerObjId,
|
|
6801
|
+
body: baseBody,
|
|
6802
|
+
headers: extra
|
|
6803
|
+
}),
|
|
6804
|
+
host.request({
|
|
6805
|
+
path: "/api/ebuilder/form/list/getListDataCount?passid=" + ledgerObjId + "&cid=" + ledgerObjId,
|
|
6806
|
+
body: cntBody,
|
|
6807
|
+
headers: extra
|
|
6808
|
+
}).catch(() => null)
|
|
6809
|
+
]);
|
|
6810
|
+
const rawRows = resp?.data?.data || [];
|
|
6811
|
+
const dispRows = resp?.data?.displayData;
|
|
6812
|
+
rows = Array.isArray(dispRows) && dispRows.length ? dispRows : rawRows;
|
|
6813
|
+
total = rows.length;
|
|
6814
|
+
if (c?.data?.total !== void 0) total = c.data.total;
|
|
6815
|
+
}
|
|
6698
6816
|
const statusMap = cache.options?.recruit_status || {};
|
|
6699
6817
|
const dictNameMap = {};
|
|
6700
6818
|
for (const item of cache.dict?.raw || []) {
|
|
@@ -6709,6 +6827,11 @@ async function candidateSearchHandler(args, env) {
|
|
|
6709
6827
|
...searchFields ? { keyword, searchFields } : {},
|
|
6710
6828
|
...searchNote ? { searchNote } : {},
|
|
6711
6829
|
...keywordIgnored ? { keywordIgnored } : {},
|
|
6830
|
+
...directTruncated ? {
|
|
6831
|
+
truncated: true,
|
|
6832
|
+
directScanLimit: 1e3,
|
|
6833
|
+
note: "\u65E0\u83DC\u5355\u76F4\u8BFB\u6A21\u5F0F\u6700\u591A\u626B\u63CF 1000 \u884C\uFF0C\u5DF2\u89E6\u9876\uFF1B\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF0Ctotal \u4E0D\u53EF\u4F5C\u4E3A\u5168\u5E93\u603B\u6570\u3002\u8BF7\u7F29\u5C0F\u5173\u952E\u8BCD\u8303\u56F4\u6216\u6309\u59D3\u540D/\u624B\u673A\u7CBE\u786E\u67E5\u8BE2"
|
|
6834
|
+
} : {},
|
|
6712
6835
|
rows: []
|
|
6713
6836
|
};
|
|
6714
6837
|
const outRows = out.rows;
|
|
@@ -6771,6 +6894,16 @@ async function candidateSearchHandler(args, env) {
|
|
|
6771
6894
|
};
|
|
6772
6895
|
}
|
|
6773
6896
|
}
|
|
6897
|
+
if (directMode) {
|
|
6898
|
+
const start = Math.max(0, (Number(args.current || 1) - 1) * wantPageSize);
|
|
6899
|
+
out.rows = out.rows.slice(start, start + wantPageSize);
|
|
6900
|
+
out.returned = out.rows.length;
|
|
6901
|
+
}
|
|
6902
|
+
const hiddenFields = detectHiddenFields(out.rows, Object.keys(fields));
|
|
6903
|
+
if (hiddenFields.length) {
|
|
6904
|
+
out.hiddenFields = hiddenFields;
|
|
6905
|
+
out.fieldWarnings = [hiddenFieldsHint(hiddenFields)];
|
|
6906
|
+
}
|
|
6774
6907
|
return rsSuccess("recruit-stage.candidate.search", out);
|
|
6775
6908
|
}
|
|
6776
6909
|
var FALLBACK_TAG_FIELDS = { public: "field_11", private: "field_12" };
|
|
@@ -6909,14 +7042,14 @@ async function handlerSearchByTag(args, env) {
|
|
|
6909
7042
|
const listId = talent?.listId;
|
|
6910
7043
|
const objId = cache.forms?.talent_pool?.objId;
|
|
6911
7044
|
if (!listId || !objId) {
|
|
6912
|
-
throw rsFail("\
|
|
7045
|
+
throw rsFail("\u6309\u6807\u7B7E\u641C\u7D22\u4ECD\u4F9D\u8D56\u4EBA\u624D\u5217\u8868\u89C6\u56FE listId\uFF1B\u5F53\u524D\u8D26\u53F7\u672A\u89E3\u6790\u5230\u8BE5\u5165\u53E3\u3002\u8BF7\u6539\u7528\u59D3\u540D/\u624B\u673A\u53F7/\u5173\u952E\u8BCD\u7684 candidate.search\uFF0C\u6216\u7531\u73AF\u5883\u914D\u7F6E\u4EBA\u624D\u5E93\u5217\u8868\u89C6\u56FE\u3002");
|
|
6913
7046
|
}
|
|
6914
7047
|
const wanted = (Array.isArray(args.tags) ? args.tags : [args.tags]).map((x) => String(x == null ? "" : x).trim()).filter(Boolean);
|
|
6915
7048
|
if (!wanted.length) throw rsFail('\u8BF7\u63D0\u4F9B\u8981\u641C\u7D22\u7684\u6807\u7B7E\u540D\uFF0C\u4F8B\u5982\uFF1A{"tags":["985"]}\u3002');
|
|
6916
7049
|
const match = args.match === "all" ? "all" : "any";
|
|
6917
7050
|
const pageSize = clampInt(args.pageSize, 1, 100, 20);
|
|
6918
7051
|
const current = clampInt(args.current, 1, 1e4, 1);
|
|
6919
|
-
const maxScan = clampInt(args.maxScan, 100,
|
|
7052
|
+
const maxScan = clampInt(args.maxScan, 100, 1e3, 500);
|
|
6920
7053
|
const rt = await resolveTags(host, wanted);
|
|
6921
7054
|
const resolved = rt.resolved || [];
|
|
6922
7055
|
const missing = rt.missing || [];
|
|
@@ -7139,7 +7272,7 @@ var searchOperations = [
|
|
|
7139
7272
|
match: { type: "string", enum: ["any", "all"], description: "\u4EFB\u4E00\u547D\u4E2D\uFF08\u9ED8\u8BA4 any\uFF09/ \u5168\u90E8\u547D\u4E2D\uFF08all\uFF0C\u8D70\u5BA2\u6237\u7AEF\u626B\u63CF\u4FDD\u8BC1\u4EA4\u96C6\u8BED\u4E49\uFF09" },
|
|
7140
7273
|
pageSize: { type: "integer", minimum: 1, maximum: 100, description: "\u8FD4\u56DE\u6BCF\u9875\u6761\u6570\uFF0C\u9ED8\u8BA4 20" },
|
|
7141
7274
|
current: { type: "integer", minimum: 1, description: "\u8FD4\u56DE\u9875\u7801\uFF0C\u9ED8\u8BA4 1" },
|
|
7142
|
-
maxScan: { type: "integer", minimum: 100, maximum:
|
|
7275
|
+
maxScan: { type: "integer", minimum: 100, maximum: 1e3, description: "\u6807\u7B7E\u515C\u5E95\u626B\u63CF\u884C\u6570\u786C\u4E0A\u9650\uFF0C\u9ED8\u8BA4 500\uFF1B\u89E6\u9876 truncated=true\uFF0C\u4E0D\u8C0E\u62A5\u5168\u5E93\u547D\u4E2D\u6570" }
|
|
7143
7276
|
}, { required: ["tags"] }),
|
|
7144
7277
|
handler: handlerSearchByTag
|
|
7145
7278
|
}
|
|
@@ -7781,7 +7914,6 @@ var SELFUSE_DEFAULT_FLOW = {
|
|
|
7781
7914
|
id: "874896524979806209",
|
|
7782
7915
|
name: "\u521D\u7B5B+\u9762\u8BD5+offer\u9636\u6BB5"
|
|
7783
7916
|
};
|
|
7784
|
-
var digitalMenuMemo = /* @__PURE__ */ new Map();
|
|
7785
7917
|
function cacheDirFor(baseUrl) {
|
|
7786
7918
|
const url = new URL(baseUrl);
|
|
7787
7919
|
const host = url.hostname + (url.port ? `_${url.port}` : "");
|
|
@@ -7790,63 +7922,33 @@ function cacheDirFor(baseUrl) {
|
|
|
7790
7922
|
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve4(homedir4(), ".weaver-work-cli");
|
|
7791
7923
|
return join4(home, "env-cache", "recruit-ops", host);
|
|
7792
7924
|
}
|
|
7793
|
-
async function readLegacyCacheExtra(baseUrl) {
|
|
7794
|
-
try {
|
|
7795
|
-
const dir = cacheDirFor(baseUrl);
|
|
7796
|
-
if (!existsSync3(dir)) return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
7797
|
-
const files = await (await import("node:fs/promises")).readdir(dir);
|
|
7798
|
-
const jsonFiles = files.filter((f) => f.endsWith(".json"));
|
|
7799
|
-
let flow = null;
|
|
7800
|
-
let dh = null;
|
|
7801
|
-
for (const f of jsonFiles) {
|
|
7802
|
-
let raw;
|
|
7803
|
-
try {
|
|
7804
|
-
raw = JSON.parse(await readFile3(join4(dir, f), "utf8"));
|
|
7805
|
-
} catch {
|
|
7806
|
-
continue;
|
|
7807
|
-
}
|
|
7808
|
-
if (!flow && raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id) {
|
|
7809
|
-
flow = { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || "") };
|
|
7810
|
-
}
|
|
7811
|
-
if (!dh && raw?.lists?.digital_human?.listId) {
|
|
7812
|
-
dh = {
|
|
7813
|
-
menuName: String(raw.lists.digital_human.menuName || "\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E"),
|
|
7814
|
-
listId: String(raw.lists.digital_human.listId),
|
|
7815
|
-
cusMenuId: String(raw.lists.digital_human.cusMenuId || "")
|
|
7816
|
-
};
|
|
7817
|
-
}
|
|
7818
|
-
if (flow && dh) break;
|
|
7819
|
-
}
|
|
7820
|
-
return { defaultRecruitFlow: flow, digitalHumanMenu: dh };
|
|
7821
|
-
} catch {
|
|
7822
|
-
return { defaultRecruitFlow: null, digitalHumanMenu: null };
|
|
7823
|
-
}
|
|
7824
|
-
}
|
|
7825
7925
|
var FLOW_MISS_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
7826
|
-
function flowMissPath(baseUrl) {
|
|
7926
|
+
function flowMissPath(baseUrl, ownerUserId) {
|
|
7827
7927
|
const hostDir = cacheDirFor(baseUrl);
|
|
7828
7928
|
const hostName = hostDir.split(/[\\/]/).pop() || "unknown";
|
|
7829
|
-
|
|
7929
|
+
const owner = String(ownerUserId || "anon").replace(/[^\w.-]/g, "_");
|
|
7930
|
+
return join4(hostDir, "..", `_recruit-stage`, `flow-miss-${hostName}-${owner}.json`);
|
|
7830
7931
|
}
|
|
7831
|
-
async function readFlowMissAt(baseUrl) {
|
|
7932
|
+
async function readFlowMissAt(baseUrl, ownerUserId) {
|
|
7832
7933
|
if (process.env.E10_RS_NO_FLOW_CACHE === "1") return null;
|
|
7833
7934
|
try {
|
|
7834
|
-
const raw = JSON.parse(await readFile3(flowMissPath(baseUrl), "utf8"));
|
|
7935
|
+
const raw = JSON.parse(await readFile3(flowMissPath(baseUrl, ownerUserId), "utf8"));
|
|
7835
7936
|
if (raw?.baseUrl !== baseUrl || !raw?.missedAt) return null;
|
|
7937
|
+
if (ownerUserId && String(raw.ownerUserId || "") !== ownerUserId) return null;
|
|
7836
7938
|
if (Date.now() - raw.missedAt > FLOW_MISS_TTL_MS) return null;
|
|
7837
7939
|
return raw.missedAt;
|
|
7838
7940
|
} catch {
|
|
7839
7941
|
return null;
|
|
7840
7942
|
}
|
|
7841
7943
|
}
|
|
7842
|
-
async function writeFlowMiss(baseUrl) {
|
|
7944
|
+
async function writeFlowMiss(baseUrl, ownerUserId) {
|
|
7843
7945
|
if (process.env.E10_RS_NO_FLOW_CACHE === "1") return;
|
|
7844
7946
|
try {
|
|
7845
7947
|
const dir = cacheDirFor(baseUrl);
|
|
7846
7948
|
if (!existsSync3(dir)) return;
|
|
7847
|
-
const target = flowMissPath(baseUrl);
|
|
7949
|
+
const target = flowMissPath(baseUrl, ownerUserId);
|
|
7848
7950
|
await mkdir3(dirname3(target), { recursive: true });
|
|
7849
|
-
await writeFile3(target, JSON.stringify({ baseUrl, missedAt: Date.now() }), "utf8");
|
|
7951
|
+
await writeFile3(target, JSON.stringify({ baseUrl, ownerUserId, missedAt: Date.now() }), "utf8");
|
|
7850
7952
|
} catch {
|
|
7851
7953
|
}
|
|
7852
7954
|
}
|
|
@@ -7868,14 +7970,9 @@ function isDefaultFlowRow2(x) {
|
|
|
7868
7970
|
return false;
|
|
7869
7971
|
}
|
|
7870
7972
|
async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
7871
|
-
const memoKey = baseUrl;
|
|
7973
|
+
const memoKey = baseUrl + "|" + String(cache?.ownerUserId || "");
|
|
7872
7974
|
if (flowMemo.has(memoKey)) return flowMemo.get(memoKey) ?? null;
|
|
7873
|
-
const
|
|
7874
|
-
if (legacy.defaultRecruitFlow) {
|
|
7875
|
-
flowMemo.set(memoKey, legacy.defaultRecruitFlow);
|
|
7876
|
-
return legacy.defaultRecruitFlow;
|
|
7877
|
-
}
|
|
7878
|
-
const missFresh = await readFlowMissAt(baseUrl);
|
|
7975
|
+
const missFresh = await readFlowMissAt(baseUrl, String(cache.ownerUserId || ""));
|
|
7879
7976
|
let result = null;
|
|
7880
7977
|
let serverResolved = false;
|
|
7881
7978
|
const menu = missFresh ? null : findFlowMenu(cache);
|
|
@@ -7965,25 +8062,11 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
|
|
|
7965
8062
|
if (serverResolved) {
|
|
7966
8063
|
flowMemo.set(memoKey, result);
|
|
7967
8064
|
} else {
|
|
7968
|
-
if (!missFresh) await writeFlowMiss(baseUrl);
|
|
8065
|
+
if (!missFresh) await writeFlowMiss(baseUrl, String(cache.ownerUserId || ""));
|
|
7969
8066
|
flowMemo.set(memoKey, result);
|
|
7970
8067
|
}
|
|
7971
8068
|
return result;
|
|
7972
8069
|
}
|
|
7973
|
-
async function resolveDigitalHumanMenu(host, baseUrl, cache) {
|
|
7974
|
-
const memoKey = baseUrl;
|
|
7975
|
-
if (digitalMenuMemo.has(memoKey)) return digitalMenuMemo.get(memoKey) ?? null;
|
|
7976
|
-
const legacy = await readLegacyCacheExtra(baseUrl);
|
|
7977
|
-
if (legacy.digitalHumanMenu) {
|
|
7978
|
-
digitalMenuMemo.set(memoKey, legacy.digitalHumanMenu);
|
|
7979
|
-
return legacy.digitalHumanMenu;
|
|
7980
|
-
}
|
|
7981
|
-
const allSearch = cache.lists?.all_search || [];
|
|
7982
|
-
const candidates = allSearch.filter((m) => m.listId);
|
|
7983
|
-
let hit = (candidates.find((m) => (m.menuName || "").includes("\u9762\u8BD5\u6570\u5B57\u4EBA")) || candidates.find((m) => (m.menuName || "").includes("\u6570\u5B57\u4EBA\u914D\u7F6E"))) ?? null;
|
|
7984
|
-
digitalMenuMemo.set(memoKey, hit);
|
|
7985
|
-
return hit;
|
|
7986
|
-
}
|
|
7987
8070
|
var loaders = /* @__PURE__ */ new Map();
|
|
7988
8071
|
function createRecruitStageContext() {
|
|
7989
8072
|
let own = null;
|
|
@@ -7994,11 +8077,8 @@ function createRecruitStageContext() {
|
|
|
7994
8077
|
const cache = await loaders.get(loaderKey).load(host);
|
|
7995
8078
|
own = loaders.get(loaderKey).lastMeta();
|
|
7996
8079
|
const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, "");
|
|
7997
|
-
const
|
|
7998
|
-
|
|
7999
|
-
resolveDigitalHumanMenu(host, baseUrl, cache)
|
|
8000
|
-
]);
|
|
8001
|
-
return { ...cache, defaultRecruitFlow, digitalHumanMenu };
|
|
8080
|
+
const defaultRecruitFlow = await resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache);
|
|
8081
|
+
return { ...cache, defaultRecruitFlow };
|
|
8002
8082
|
});
|
|
8003
8083
|
fn.lastCacheMeta = () => own;
|
|
8004
8084
|
return fn;
|