weaver-work-cli 0.1.48 → 0.1.49
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/chunks/{archive-oa-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-MU2LPI5P.js} +3 -3
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-3NV2ETZR.js} +6 -6
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-3X7VOSBA.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-6GWU63YF.js} +1 -1
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-BRRW7CWA.js} +25 -25
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-D2QRZUW4.js} +209 -25
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-EJVA5ZVB.js} +2 -2
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-GEOMANP7.js} +3 -3
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-NK74RE5F.js → chunk-K3BT54CU.js} +3 -3
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-KV5SOWMS.js} +4 -4
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-ZKEUGS2U.js} +5 -5
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-6347A7YK.js} +2 -2
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-7WG7LVX5.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-B6GKA2J3.js → env-LHRKSLG6.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-2H7Z4RWJ.js} +1 -1
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-EW6PNDDT.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-N2FQBHXI.js} +10 -10
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-MYOKJULO.js} +429 -94
- package/dist/chunks/{recruit-stage-ERZD3ZNB.js → recruit-stage-FKWS5UQF.js} +66 -13
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-22O6UG4I.js → registry-CKUVBS53.js} +10 -10
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-MBCYENQ2.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-5IFMCXME.js} +4 -4
- package/dist/index.js +12 -7
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/registry.js +4 -1
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +11 -0
- package/dist/shortcuts/reception/index.js +3 -1
- package/dist/shortcuts/reception/manifest.js +3 -2
- package/dist/shortcuts/reception/operations/ask.js +20 -2
- package/dist/shortcuts/reception/operations/compose.js +11 -0
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +1 -1
- package/dist/shortcuts/reception/operations/panels.js +84 -21
- package/dist/shortcuts/reception/operations/render.js +40 -0
- package/dist/shortcuts/reception/operations/restaurant.js +17 -4
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +57 -0
- package/docs/SKILL.md +1 -0
- package/docs/_catalog.md +3 -0
- package/docs/data.md +149 -0
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +23 -0
- package/skill-template/domains/data.md +15 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +7 -6
- package/skills/weaver-e10-archive-oa/references/contract-search.md +83 -14
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +35 -11
- package/skills/weaver-e10-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-reception-flow/SKILL.md +30 -16
- package/skills/weaver-e10-reception-flow/references/guide.md +4 -3
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-2TRU2ZSP.js} +3 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { needArg } from '../host.js';
|
|
2
|
+
import { dataValidationError } from '../errors.js';
|
|
3
|
+
import { readJsonArg, renderTable } from './shared.js';
|
|
4
|
+
/** `executeQueryDsl` 的 4 个 URL query 参数——**恒定发送**,值允许为空。 */
|
|
5
|
+
const QUERY_PARAM_ALIASES = [
|
|
6
|
+
['dimension', 'dimension'],
|
|
7
|
+
['confGroup', 'conf-group'],
|
|
8
|
+
['username', 'username'],
|
|
9
|
+
['startDate', 'start-date'],
|
|
10
|
+
];
|
|
11
|
+
function argStr(input, key) {
|
|
12
|
+
const value = input[key];
|
|
13
|
+
// 裸开关(只写 --username 不给值)与未传都归一为空值
|
|
14
|
+
if (value === undefined || value === null || value === true)
|
|
15
|
+
return '';
|
|
16
|
+
return String(value).trim();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 拼 4 个恒定 query。
|
|
20
|
+
*
|
|
21
|
+
* 后端签名为 `executeQueryDsl(@RequestBody DslQueryVo, @RequestParam confKey,
|
|
22
|
+
* @RequestParam confGroup, @RequestParam username, @RequestParam startDate, Employee)`,
|
|
23
|
+
* `@RequestParam` 的 required 校验看「键是否存在」而非「值是否非空」——缺键即失败、空值合法。
|
|
24
|
+
* 早前「空串就不带」会把最常见的情况(问句里没有人名/日期)直接打成 400/500。
|
|
25
|
+
*/
|
|
26
|
+
function buildQueryString(input) {
|
|
27
|
+
return '?' + QUERY_PARAM_ALIASES
|
|
28
|
+
.map(([name, flag]) => {
|
|
29
|
+
const snake = flag.replace(/-/g, '_');
|
|
30
|
+
const raw = argStr(input, name) || argStr(input, snake) || argStr(input, flag);
|
|
31
|
+
return `${encodeURIComponent(name)}=${encodeURIComponent(raw)}`;
|
|
32
|
+
})
|
|
33
|
+
.join('&');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* DSL 直查:`POST /api/dw/dsl/executeQueryDsl`。
|
|
37
|
+
*
|
|
38
|
+
* 这是整条问数链路的底层入口,`ds list/chart/stat/count` 都是它的封装。技能里有 9 条现成调用,
|
|
39
|
+
* 参数形式(`--conn/--model/--schema/--dsl`)必须逐字保留。
|
|
40
|
+
*/
|
|
41
|
+
export async function executeQuery(input, host) {
|
|
42
|
+
const conn = needArg(input, 'conn');
|
|
43
|
+
const model = needArg(input, 'model');
|
|
44
|
+
const schema = needArg(input, 'schema');
|
|
45
|
+
const dslRaw = needArg(input, 'dsl');
|
|
46
|
+
const dslQuery = readJsonArg(dslRaw, '--dsl');
|
|
47
|
+
const body = {
|
|
48
|
+
connId: conn,
|
|
49
|
+
model,
|
|
50
|
+
schema,
|
|
51
|
+
tableId: input.table_id || input.tableId || '',
|
|
52
|
+
dslQuery,
|
|
53
|
+
};
|
|
54
|
+
if (input.debug !== undefined && input.debug !== null && input.debug !== '') {
|
|
55
|
+
const flag = String(input.debug).toLowerCase();
|
|
56
|
+
if (flag === 'true' || flag === '1')
|
|
57
|
+
body.debug = true;
|
|
58
|
+
else if (flag === 'false' || flag === '0')
|
|
59
|
+
body.debug = false;
|
|
60
|
+
else
|
|
61
|
+
throw dataValidationError('debug_invalid', `--debug 值必须为 true 或 false(当前: ${input.debug})`);
|
|
62
|
+
}
|
|
63
|
+
const response = await host.request({
|
|
64
|
+
method: 'POST',
|
|
65
|
+
path: `/api/dw/dsl/executeQueryDsl${buildQueryString(input)}`,
|
|
66
|
+
body,
|
|
67
|
+
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
|
68
|
+
});
|
|
69
|
+
const code = response?.code;
|
|
70
|
+
if (code !== undefined && String(code) !== '200' && String(code) !== '0') {
|
|
71
|
+
const message = String(response?.msg || '');
|
|
72
|
+
if (/没有权限|无权限|权限不足|未授权|无权访问|无查询权限/i.test(message)) {
|
|
73
|
+
throw dataValidationError('permission_denied', '当前用户对该数据无查询权限,请检查登录态是否有效或联系管理员开通', 4);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const payload = response?.data;
|
|
77
|
+
const rows = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.records) ? payload.records : []);
|
|
78
|
+
const lines = [];
|
|
79
|
+
if (payload && !Array.isArray(payload) && payload.sql)
|
|
80
|
+
lines.push(`SQL: ${payload.sql}`);
|
|
81
|
+
if (String(code) !== '200' && code !== undefined)
|
|
82
|
+
lines.push(`code=${code} msg=${response?.msg || ''}`);
|
|
83
|
+
lines.push(rows.length ? renderTable(`结果 ${rows.length} 行`, rows) : '(空:0 行)');
|
|
84
|
+
return { data: response, text: lines.join('\n') };
|
|
85
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { needArg } from '../host.js';
|
|
2
|
+
import { dataApiError, dataValidationError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* 场景定位元数据(`getSceneGroups`)。
|
|
5
|
+
*
|
|
6
|
+
* 这是**元数据定位**接口,不取业务数据 —— 技能「禁手工 HTTP」的明确例外项。
|
|
7
|
+
* 取数仍必须走 module call / query / ds / hrm,不得用本命令替代取数。
|
|
8
|
+
*
|
|
9
|
+
* 形状口径:默认输出**顶层一律为数组**(groups = 分组数组;items = 分组数组,元素内含 datasets);
|
|
10
|
+
* `--json` 为接口原样返回(同为数组)⇒ 默认与 --json 的差异仅在于字段是否裁剪,顶层形状不翻转。
|
|
11
|
+
*/
|
|
12
|
+
const SCENE_PATH = '/api/dw/newetl/chatBi/getSceneGroups';
|
|
13
|
+
const SCENE_CLIENTS = ['agent', 'all', 'connector'];
|
|
14
|
+
function sceneClient(input) {
|
|
15
|
+
const client = input.client === undefined ? 'agent' : String(input.client).trim();
|
|
16
|
+
if (!SCENE_CLIENTS.includes(client)) {
|
|
17
|
+
throw dataValidationError('client_invalid', `--client 值必须为 ${SCENE_CLIENTS.join('|')}(当前: ${input.client})`);
|
|
18
|
+
}
|
|
19
|
+
return client;
|
|
20
|
+
}
|
|
21
|
+
/** 发一次 scene 元数据请求,返回解包后的 data。 */
|
|
22
|
+
async function sceneRequest(host, params) {
|
|
23
|
+
const response = await host.request({ method: 'GET', path: SCENE_PATH, query: params, operation: 'scene' });
|
|
24
|
+
// 业务错误校验:E10 常见形态 { code:401|-1, msg },HTTP 仍为 200
|
|
25
|
+
if (response && typeof response === 'object' && !Array.isArray(response)) {
|
|
26
|
+
const bad = (response.code !== undefined && Number(response.code) !== 0) || response.fail === true;
|
|
27
|
+
if (bad) {
|
|
28
|
+
throw dataApiError('scene_business_error', `getSceneGroups 返回业务错误:code=${response.code} msg=${response.msg || response.message || '(无 msg)'}`
|
|
29
|
+
+ '(常见:401「暂无权限!」= 该接口在当前环境未开放或账号无权限;-1「token为空或失效」= 登录态失效,请重新登录)', { code: response.code });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// 兼容 ResultBean 包装({ code, data })与裸数组
|
|
33
|
+
return response && typeof response === 'object' && !Array.isArray(response) && 'data' in response ? response.data : response;
|
|
34
|
+
}
|
|
35
|
+
function asArray(data) {
|
|
36
|
+
return Array.isArray(data) ? data : (data == null ? [] : [data]);
|
|
37
|
+
}
|
|
38
|
+
function slimItem(dataset) {
|
|
39
|
+
const item = {
|
|
40
|
+
id: String(dataset.id ?? ''),
|
|
41
|
+
datasetName: dataset.datasetName ?? '',
|
|
42
|
+
datasetType: dataset.datasetType ?? '',
|
|
43
|
+
sourceId: dataset.sourceId ?? '',
|
|
44
|
+
};
|
|
45
|
+
// 取数通道参数(接口已下发时带出)
|
|
46
|
+
if (dataset.moduleName)
|
|
47
|
+
item.moduleName = dataset.moduleName;
|
|
48
|
+
if (dataset.sourceType)
|
|
49
|
+
item.sourceType = dataset.sourceType;
|
|
50
|
+
if (dataset.sourceGroupId)
|
|
51
|
+
item.sourceGroupId = dataset.sourceGroupId;
|
|
52
|
+
if (dataset.appId)
|
|
53
|
+
item.appId = dataset.appId;
|
|
54
|
+
item.datasetDesc = dataset.datasetDesc ?? '';
|
|
55
|
+
// 前向兼容:后端一旦下发 datasetLogic,自动带出
|
|
56
|
+
if (dataset.datasetLogic !== undefined)
|
|
57
|
+
item.datasetLogic = dataset.datasetLogic;
|
|
58
|
+
return item;
|
|
59
|
+
}
|
|
60
|
+
export async function sceneGroups(input, host) {
|
|
61
|
+
const data = await sceneRequest(host, { datasetClient: sceneClient(input) });
|
|
62
|
+
const arr = asArray(data);
|
|
63
|
+
if (data != null && !Array.isArray(data)) {
|
|
64
|
+
process.stderr.write(`# 注意:接口返回非数组形态(${typeof data}),已按单元素数组处理\n`);
|
|
65
|
+
}
|
|
66
|
+
process.stderr.write(`# 分组 ${arr.length} 个\n`);
|
|
67
|
+
const out = arr.map((group) => ({
|
|
68
|
+
groupId: String(group.groupId ?? ''),
|
|
69
|
+
groupName: group.groupName ?? '',
|
|
70
|
+
itemCount: Number(group.itemCount ?? 0),
|
|
71
|
+
groupDesc: group.groupDesc ?? '',
|
|
72
|
+
}));
|
|
73
|
+
return { data: out, text: JSON.stringify(out, null, 1) };
|
|
74
|
+
}
|
|
75
|
+
export async function sceneItems(input, host) {
|
|
76
|
+
const group = input.group || input.group_id;
|
|
77
|
+
if (!group)
|
|
78
|
+
throw dataValidationError('missing_argument', '缺少必填参数 --group <groupId>');
|
|
79
|
+
const data = await sceneRequest(host, { datasetClient: sceneClient(input), groupId: String(group) });
|
|
80
|
+
const arr = asArray(data);
|
|
81
|
+
const out = arr.map((entry) => {
|
|
82
|
+
const datasets = (entry.datasets || []).map(slimItem);
|
|
83
|
+
return {
|
|
84
|
+
groupId: String(entry.groupId ?? group),
|
|
85
|
+
groupName: entry.groupName ?? '',
|
|
86
|
+
itemCount: Number(entry.itemCount ?? datasets.length),
|
|
87
|
+
datasets,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const total = out.reduce((sum, entry) => sum + entry.datasets.length, 0);
|
|
91
|
+
if (!out.length) {
|
|
92
|
+
process.stderr.write('# 未找到该分组\n');
|
|
93
|
+
return { data: [], text: '[]' };
|
|
94
|
+
}
|
|
95
|
+
process.stderr.write(`# 条目 ${total} 条\n`);
|
|
96
|
+
return { data: out, text: JSON.stringify(out, null, 1) };
|
|
97
|
+
}
|
|
98
|
+
function keywordsOf(raw) {
|
|
99
|
+
return String(raw ?? '')
|
|
100
|
+
.split(/[,,、;;\s]+/)
|
|
101
|
+
.map((item) => item.trim())
|
|
102
|
+
.filter(Boolean);
|
|
103
|
+
}
|
|
104
|
+
function hitScore(text, keywords) {
|
|
105
|
+
const hay = String(text ?? '').toLowerCase();
|
|
106
|
+
if (!hay)
|
|
107
|
+
return 0;
|
|
108
|
+
let score = 0;
|
|
109
|
+
for (const keyword of keywords)
|
|
110
|
+
if (hay.includes(keyword.toLowerCase()))
|
|
111
|
+
score += 1;
|
|
112
|
+
return score;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 关键词候选召回:**后端 keyword 过滤优先,本地打分兜底**。
|
|
116
|
+
*
|
|
117
|
+
* 后端支持 `keyword`(单数)query 参数:① 分组级命中 → 返回该分组及其全部条目;
|
|
118
|
+
* ② 仅条目级命中 → 只返回命中条目 + 父分组;③ 全不命中 → 空数组。
|
|
119
|
+
* 因此正确姿势是把关键词交给后端,只有未命中/老服务端不支持时才回退本地打分。
|
|
120
|
+
*/
|
|
121
|
+
export async function sceneSearch(input, host) {
|
|
122
|
+
const client = sceneClient(input);
|
|
123
|
+
const keywords = keywordsOf(input.keywords ?? input.keyword);
|
|
124
|
+
if (!keywords.length)
|
|
125
|
+
throw dataValidationError('missing_argument', '缺少必填参数 --keywords <词1,词2>(也可用空格 / 、 分隔)');
|
|
126
|
+
const maxGroups = Math.max(1, Number(input.max_groups ?? 3) || 3);
|
|
127
|
+
const maxItems = Math.max(1, Number(input.max_items ?? 12) || 12);
|
|
128
|
+
const scope = input.scope_group_id == null ? '' : String(input.scope_group_id).trim();
|
|
129
|
+
const serverFilter = String(input.server_filter ?? 'auto').trim().toLowerCase();
|
|
130
|
+
if (!['auto', 'on', 'off'].includes(serverFilter)) {
|
|
131
|
+
throw dataValidationError('server_filter_invalid', `--server-filter 值必须为 auto|on|off(当前: ${input.server_filter})`);
|
|
132
|
+
}
|
|
133
|
+
const inScope = (group) => !scope || String(group.groupId) === scope;
|
|
134
|
+
const keywordJoined = keywords.join(',');
|
|
135
|
+
let pool = [];
|
|
136
|
+
let requests = 0;
|
|
137
|
+
let usedServer = false;
|
|
138
|
+
// ① 优先把关键词交给后端过滤
|
|
139
|
+
if (serverFilter !== 'off') {
|
|
140
|
+
try {
|
|
141
|
+
const raw = await sceneRequest(host, { datasetClient: client, keyword: keywordJoined });
|
|
142
|
+
requests += 1;
|
|
143
|
+
const hit = asArray(raw).filter((group) => group && group.groupId !== undefined && inScope(group));
|
|
144
|
+
if (hit.length) {
|
|
145
|
+
pool = hit;
|
|
146
|
+
usedServer = true;
|
|
147
|
+
}
|
|
148
|
+
else if (serverFilter === 'auto') {
|
|
149
|
+
process.stderr.write(`# 后端 keyword 未命中,回退本地打分(keyword=${keywordJoined})\n`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
if (serverFilter === 'on')
|
|
154
|
+
throw error;
|
|
155
|
+
process.stderr.write(`# [warn] 带 keyword 的召回失败,回退本地打分:${error?.message || error}\n`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// ② 决定候选分组
|
|
159
|
+
let scored;
|
|
160
|
+
if (usedServer) {
|
|
161
|
+
scored = pool
|
|
162
|
+
.map((group) => ({
|
|
163
|
+
group,
|
|
164
|
+
score: hitScore(group.groupName, keywords) * 3 + hitScore(group.groupDesc, keywords),
|
|
165
|
+
items: Array.isArray(group.datasets) ? group.datasets : null,
|
|
166
|
+
}))
|
|
167
|
+
.sort((a, b) => (b.score - a.score) || ((b.items || []).length - (a.items || []).length))
|
|
168
|
+
.slice(0, maxGroups);
|
|
169
|
+
}
|
|
170
|
+
else if (serverFilter === 'on') {
|
|
171
|
+
scored = [];
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
// 回退本地打分:必须拿到完整分组骨架(后端未命中时 pool 为空,不能复用)
|
|
175
|
+
if (!pool.length) {
|
|
176
|
+
const raw = await sceneRequest(host, { datasetClient: client });
|
|
177
|
+
requests += 1;
|
|
178
|
+
pool = asArray(raw).filter((group) => group && group.groupId !== undefined && inScope(group));
|
|
179
|
+
}
|
|
180
|
+
scored = pool
|
|
181
|
+
.map((group) => ({
|
|
182
|
+
group,
|
|
183
|
+
score: hitScore(group.groupName, keywords) * 3 + hitScore(group.groupDesc, keywords),
|
|
184
|
+
items: null,
|
|
185
|
+
}))
|
|
186
|
+
.filter((candidate) => candidate.score > 0)
|
|
187
|
+
.sort((a, b) => b.score - a.score)
|
|
188
|
+
.slice(0, maxGroups);
|
|
189
|
+
}
|
|
190
|
+
const out = [];
|
|
191
|
+
for (const candidate of scored) {
|
|
192
|
+
const group = candidate.group;
|
|
193
|
+
let items = candidate.items ?? [];
|
|
194
|
+
if (!candidate.items) {
|
|
195
|
+
const one = await sceneRequest(host, { datasetClient: client, groupId: String(group.groupId) });
|
|
196
|
+
requests += 1;
|
|
197
|
+
const arr = asArray(one);
|
|
198
|
+
const hit = arr.find((entry) => entry && String(entry.groupId) === String(group.groupId)) || arr[0] || {};
|
|
199
|
+
items = Array.isArray(hit.datasets) ? hit.datasets : [];
|
|
200
|
+
}
|
|
201
|
+
const ranked = items
|
|
202
|
+
.map((dataset) => ({ dataset, score: hitScore(dataset.datasetName, keywords) * 3 + hitScore(dataset.datasetDesc, keywords) }))
|
|
203
|
+
.sort((a, b) => b.score - a.score);
|
|
204
|
+
// 后端过滤过 ⇒ 条目是「后端给的」,本地只排序不筛(分组级命中时未命中关键词的条目同样可能相关,
|
|
205
|
+
// 按字面分剔除会造成「57 条只剩 20 条」的丢量)。只有本地打分路径才需要 score>0 过滤。
|
|
206
|
+
const ordered = usedServer
|
|
207
|
+
? ranked
|
|
208
|
+
: (() => {
|
|
209
|
+
const matched = ranked.filter((entry) => entry.score > 0);
|
|
210
|
+
return matched.length ? matched : ranked;
|
|
211
|
+
})();
|
|
212
|
+
const serverPartial = usedServer && Number(group.itemCount ?? items.length) > items.length;
|
|
213
|
+
const keep = usedServer && serverPartial ? ordered : ordered.slice(0, maxItems);
|
|
214
|
+
const entry = {
|
|
215
|
+
groupId: String(group.groupId),
|
|
216
|
+
groupName: group.groupName ?? '',
|
|
217
|
+
groupDesc: group.groupDesc ?? '',
|
|
218
|
+
itemCount: Number(group.itemCount ?? items.length),
|
|
219
|
+
datasets: keep.map((item) => slimItem(item.dataset)),
|
|
220
|
+
};
|
|
221
|
+
// 前向兼容:后端下发 groupLogic 时自动带出
|
|
222
|
+
if (group.groupLogic !== undefined)
|
|
223
|
+
entry.groupLogic = group.groupLogic;
|
|
224
|
+
out.push(entry);
|
|
225
|
+
}
|
|
226
|
+
const itemTotal = out.reduce((sum, group) => sum + group.datasets.length, 0);
|
|
227
|
+
const filterMode = usedServer ? '后端 keyword' : (serverFilter === 'on' ? '后端 keyword(无命中)' : '本地打分');
|
|
228
|
+
if (!out.length) {
|
|
229
|
+
process.stderr.write(`# 未命中任何分组(关键词:${keywords.join(',')};`
|
|
230
|
+
+ `${serverFilter === 'on' ? '后端 keyword 无命中,已按 --server-filter on 不回退' : `候选池 ${pool.length} 组`})\n`);
|
|
231
|
+
}
|
|
232
|
+
process.stderr.write(`# 关键词 ${keywords.join(',')} | 候选分组 ${out.length} 个 | 条目 ${itemTotal} 条 | 请求 ${requests} 次 | 过滤方式 ${filterMode}\n`);
|
|
233
|
+
return { data: out, text: JSON.stringify(out, null, 1) };
|
|
234
|
+
}
|
|
235
|
+
export { needArg };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dataValidationError } from '../errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* 把 JSON 文本里的长整数(≥16 位)预置为字符串。
|
|
5
|
+
*
|
|
6
|
+
* E10 的雪花 ID 是 19 位,超出 `Number.MAX_SAFE_INTEGER`(2^53-1);`JSON.parse` 直接解析会
|
|
7
|
+
* 把末几位归零(`1060565684758507544` → `1060565684758507500`),再原样下发就查不到任何数据、
|
|
8
|
+
* 且后端不报错。e10-data 用同样的「先引号化再解析」策略,这里保持口径一致。
|
|
9
|
+
*/
|
|
10
|
+
function quoteLongInts(raw) {
|
|
11
|
+
return raw.replace(/([:[,]\s*)(-?\d{16,})(?=\s*[,}\]])/g, '$1"$2"');
|
|
12
|
+
}
|
|
13
|
+
export function parseJsonSafe(raw) {
|
|
14
|
+
return JSON.parse(quoteLongInts(String(raw).replace(/^\uFEFF+/, '')));
|
|
15
|
+
}
|
|
16
|
+
/** `@file` 读文件,其余按内联 JSON 解析。 */
|
|
17
|
+
export function readJsonArg(value, label) {
|
|
18
|
+
if (value === undefined || value === null || value === true)
|
|
19
|
+
return undefined;
|
|
20
|
+
const raw = String(value);
|
|
21
|
+
const text = raw.startsWith('@') ? readFileSync(raw.slice(1), 'utf-8') : raw;
|
|
22
|
+
try {
|
|
23
|
+
return parseJsonSafe(text);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw dataValidationError('json_invalid', `${label} 不是合法 JSON:${error.message}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** `@file` 读文件,其余按逗号分隔的列表。 */
|
|
30
|
+
export function readListArg(value) {
|
|
31
|
+
if (value === undefined || value === null || value === true)
|
|
32
|
+
return '';
|
|
33
|
+
const raw = String(value);
|
|
34
|
+
return raw.startsWith('@') ? readFileSync(raw.slice(1), 'utf-8').trim() : raw;
|
|
35
|
+
}
|
|
36
|
+
export function splitList(value) {
|
|
37
|
+
const raw = readListArg(value);
|
|
38
|
+
if (!raw)
|
|
39
|
+
return [];
|
|
40
|
+
return raw.split(',').map((item) => item.trim()).filter(Boolean);
|
|
41
|
+
}
|
|
42
|
+
export function dynamicParams(session) {
|
|
43
|
+
return {
|
|
44
|
+
eteamsId: session.eteamsId,
|
|
45
|
+
userId: session.userId || '',
|
|
46
|
+
tenantKey: session.tenantKey || '',
|
|
47
|
+
langId: 7,
|
|
48
|
+
formatDate: 'yyyy-MM-dd HH:mm:ss',
|
|
49
|
+
isPublic: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function baseDto(session, tableId, groupId, pageNo, pageSize, queryType) {
|
|
53
|
+
return {
|
|
54
|
+
tableId: String(tableId),
|
|
55
|
+
groupId,
|
|
56
|
+
pageNo,
|
|
57
|
+
pageSize,
|
|
58
|
+
queryType,
|
|
59
|
+
containDetailTable: false,
|
|
60
|
+
needFormat: true,
|
|
61
|
+
dynamicParams: dynamicParams(session),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** appId 只认显式传入(v0.1.14 起不自动解析、不做缺失拦截)。 */
|
|
65
|
+
export function applyAppId(dto, appId) {
|
|
66
|
+
if (typeof appId === 'string' && appId !== '' && appId !== 'auto')
|
|
67
|
+
dto.appId = appId;
|
|
68
|
+
return dto;
|
|
69
|
+
}
|
|
70
|
+
// ---------------------------------------------------------------- 条件树
|
|
71
|
+
function normRelationship(value) {
|
|
72
|
+
return value === '0' || value === 0 || value === false ? '0' : '1';
|
|
73
|
+
}
|
|
74
|
+
function isConditionGroup(node) {
|
|
75
|
+
return !!node && Array.isArray(node.conditionList) && node.conditionList.length > 0;
|
|
76
|
+
}
|
|
77
|
+
function buildConditionNode(node, key, parentKey) {
|
|
78
|
+
if (isConditionGroup(node)) {
|
|
79
|
+
return {
|
|
80
|
+
key,
|
|
81
|
+
relationship: normRelationship(node.relationship),
|
|
82
|
+
isParent: true,
|
|
83
|
+
parentNode: parentKey,
|
|
84
|
+
mainField: node.mainField !== false,
|
|
85
|
+
conditionList: node.conditionList.map((child, index) => buildConditionNode(child, `${key}_${index}`, key)),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const fieldId = (node && (node.fieldId || node.conditionId)) || '';
|
|
89
|
+
if (!fieldId) {
|
|
90
|
+
throw dataValidationError('where_invalid', '--where 条件缺少字段:叶子须提供 fieldId(或 conditionId),条件组须提供非空 conditionList');
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
key,
|
|
94
|
+
relationship: '1',
|
|
95
|
+
isParent: false,
|
|
96
|
+
parentNode: parentKey,
|
|
97
|
+
objId: node.objId || '',
|
|
98
|
+
conditionId: fieldId,
|
|
99
|
+
fieldName: node.fieldName || fieldId,
|
|
100
|
+
conditionType: node.conditionType || '',
|
|
101
|
+
compareType: node.compareType,
|
|
102
|
+
conditionValue: node.conditionValue ?? '',
|
|
103
|
+
fieldValue: node.fieldValue || '',
|
|
104
|
+
mainField: node.mainField !== false,
|
|
105
|
+
ignoreCaseMark: node.ignoreCaseMark || false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/** `--where`:数组 = AND 根(元素可为叶子或内嵌条件组),对象 = 完整条件树。 */
|
|
109
|
+
export function parseWhere(value) {
|
|
110
|
+
if (value === undefined || value === null || value === '' || value === true)
|
|
111
|
+
return null;
|
|
112
|
+
const raw = readJsonArg(value, '--where');
|
|
113
|
+
if (!raw)
|
|
114
|
+
return null;
|
|
115
|
+
const rootKey = `root_${Date.now()}`;
|
|
116
|
+
if (Array.isArray(raw)) {
|
|
117
|
+
const children = [];
|
|
118
|
+
raw.forEach((node, index) => {
|
|
119
|
+
if (node && typeof node === 'object')
|
|
120
|
+
children.push(buildConditionNode(node, `${rootKey}_${index}`, rootKey));
|
|
121
|
+
});
|
|
122
|
+
if (!children.length)
|
|
123
|
+
return null;
|
|
124
|
+
return { key: rootKey, relationship: '1', isParent: true, parentNode: '', mainField: true, conditionList: children };
|
|
125
|
+
}
|
|
126
|
+
if (typeof raw !== 'object')
|
|
127
|
+
throw dataValidationError('where_invalid', '--where 须为条件数组或条件树对象');
|
|
128
|
+
if (!Array.isArray(raw.conditionList) || !raw.conditionList.length)
|
|
129
|
+
return null;
|
|
130
|
+
return buildConditionNode(raw, rootKey, '');
|
|
131
|
+
}
|
|
132
|
+
/** `--stat`:单个对象或数组;聚合键走 aggregator(大写枚举)。 */
|
|
133
|
+
export function parseStat(value) {
|
|
134
|
+
const raw = readJsonArg(value, '--stat');
|
|
135
|
+
const list = Array.isArray(raw) ? raw : [raw];
|
|
136
|
+
return list.map((item) => ({
|
|
137
|
+
fieldId: item.fieldId,
|
|
138
|
+
fieldName: item.fieldId,
|
|
139
|
+
objId: '',
|
|
140
|
+
mainField: true,
|
|
141
|
+
aggregator: item.aggregator || 'SUM',
|
|
142
|
+
...(item.fieldAlias ? { fieldAlias: item.fieldAlias } : {}),
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
/** `--order`:`field asc, field2 desc`。 */
|
|
146
|
+
export function parseOrder(value) {
|
|
147
|
+
const raw = readListArg(value);
|
|
148
|
+
if (!raw)
|
|
149
|
+
return [];
|
|
150
|
+
return raw.split(',').filter((item) => item.trim()).map((item) => {
|
|
151
|
+
const [field, direction] = item.trim().split(/\s+/);
|
|
152
|
+
return {
|
|
153
|
+
fieldId: field,
|
|
154
|
+
fieldName: field,
|
|
155
|
+
objId: '',
|
|
156
|
+
isAsc: (direction || 'asc').toLowerCase() !== 'desc',
|
|
157
|
+
mainField: true,
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const TIP_FLAG_KEYS = {
|
|
162
|
+
tipTimeout: ['tipTimeout'],
|
|
163
|
+
tipTimelimit: ['tipTimelimit', 'tipTimeLimit'],
|
|
164
|
+
};
|
|
165
|
+
const TIP_MSG_KEYS = {
|
|
166
|
+
tipTimeoutMsg: ['tipTimeoutMsg', 'tipTimeoutMessage'],
|
|
167
|
+
tipTimelimitMsg: ['tipTimelimitMsg', 'tipTimeLimitMsg', 'tipTimelimitMessage', 'tipTimeLimitMessage'],
|
|
168
|
+
};
|
|
169
|
+
const TIP_SCAN_MAX_DEPTH = 4;
|
|
170
|
+
const TIP_SCAN_MAX_ITEMS = 20;
|
|
171
|
+
function tipTruthy(value) {
|
|
172
|
+
if (value === true)
|
|
173
|
+
return true;
|
|
174
|
+
if (typeof value === 'number')
|
|
175
|
+
return value === 1;
|
|
176
|
+
if (typeof value === 'string')
|
|
177
|
+
return ['true', '1', 'yes', 'y'].includes(value.trim().toLowerCase());
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 递归扫描响应体,取出四个平台范围提示字段。
|
|
182
|
+
*
|
|
183
|
+
* 平台在「查询范围被收窄」或「范围过大不予查询」时只把标记塞在响应内层
|
|
184
|
+
* (`data.tipTimelimit` / `data.data.tipTimeout`),层级随通道不同而不同。不提出来的话,
|
|
185
|
+
* 下游会把局部数据当全区间结论、把 tipTimeout 误读成「0 行」。原样透出、不翻译不改写。
|
|
186
|
+
*/
|
|
187
|
+
export function scanTips(node, depth = 0, acc = {}) {
|
|
188
|
+
if (!node || typeof node !== 'object' || depth > TIP_SCAN_MAX_DEPTH)
|
|
189
|
+
return acc;
|
|
190
|
+
if (Array.isArray(node)) {
|
|
191
|
+
for (const item of node.slice(0, TIP_SCAN_MAX_ITEMS))
|
|
192
|
+
scanTips(item, depth + 1, acc);
|
|
193
|
+
return acc;
|
|
194
|
+
}
|
|
195
|
+
for (const [key, aliases] of Object.entries(TIP_FLAG_KEYS)) {
|
|
196
|
+
if (acc[key] !== undefined)
|
|
197
|
+
continue;
|
|
198
|
+
for (const alias of aliases) {
|
|
199
|
+
if (tipTruthy(node[alias])) {
|
|
200
|
+
acc[key] = true;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
for (const [key, aliases] of Object.entries(TIP_MSG_KEYS)) {
|
|
206
|
+
if (acc[key] !== undefined)
|
|
207
|
+
continue;
|
|
208
|
+
for (const alias of aliases) {
|
|
209
|
+
const value = node[alias];
|
|
210
|
+
if (value !== undefined && value !== null && String(value).trim() !== '') {
|
|
211
|
+
acc[key] = String(value).trim();
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
let seen = 0;
|
|
217
|
+
for (const value of Object.values(node)) {
|
|
218
|
+
if (seen++ >= TIP_SCAN_MAX_ITEMS)
|
|
219
|
+
break;
|
|
220
|
+
if (value && typeof value === 'object')
|
|
221
|
+
scanTips(value, depth + 1, acc);
|
|
222
|
+
}
|
|
223
|
+
return acc;
|
|
224
|
+
}
|
|
225
|
+
/** 只保留四个规范字段(存在才带,顺序固定),供 JSON 输出顶层透出。 */
|
|
226
|
+
export function tipFields(tips) {
|
|
227
|
+
const out = {};
|
|
228
|
+
if (tips.tipTimeout)
|
|
229
|
+
out.tipTimeout = true;
|
|
230
|
+
if (tips.tipTimeoutMsg)
|
|
231
|
+
out.tipTimeoutMsg = tips.tipTimeoutMsg;
|
|
232
|
+
if (tips.tipTimelimit)
|
|
233
|
+
out.tipTimelimit = true;
|
|
234
|
+
if (tips.tipTimelimitMsg)
|
|
235
|
+
out.tipTimelimitMsg = tips.tipTimelimitMsg;
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
/** 人读模式:命中时打 `[!]` 行(与 module call 的 flags 同形态;文案逐字照抄平台原文)。 */
|
|
239
|
+
export function tipsLines(tips) {
|
|
240
|
+
const lines = [];
|
|
241
|
+
if (tips.tipTimeout) {
|
|
242
|
+
lines.push(`[!] tipTimeout=true|平台提示(数据范围过大,不是 0 行,count 记 null):${tips.tipTimeoutMsg || '(平台未给出文案)'}`);
|
|
243
|
+
}
|
|
244
|
+
if (tips.tipTimelimit) {
|
|
245
|
+
lines.push(`[!] tipTimelimit=true|平台提示(数据已返回,但实际查询范围被收窄):${tips.tipTimelimitMsg || '(平台未给出文案)'}`);
|
|
246
|
+
}
|
|
247
|
+
return lines;
|
|
248
|
+
}
|
|
249
|
+
// ---------------------------------------------------------------- 人读渲染
|
|
250
|
+
export function cell(value) {
|
|
251
|
+
if (value === null || value === undefined)
|
|
252
|
+
return '';
|
|
253
|
+
if (typeof value === 'object') {
|
|
254
|
+
const text = JSON.stringify(value);
|
|
255
|
+
return text.length > 80 ? `${text.slice(0, 80)}…` : text;
|
|
256
|
+
}
|
|
257
|
+
return String(value);
|
|
258
|
+
}
|
|
259
|
+
/** 表格式人读输出(`== title ==` + 制表符分隔列)。 */
|
|
260
|
+
export function renderTable(title, rows, columns) {
|
|
261
|
+
const lines = [];
|
|
262
|
+
if (title)
|
|
263
|
+
lines.push(`== ${title} ==`);
|
|
264
|
+
if (!rows || !rows.length) {
|
|
265
|
+
lines.push('(空)');
|
|
266
|
+
return lines.join('\n');
|
|
267
|
+
}
|
|
268
|
+
if (columns) {
|
|
269
|
+
lines.push(columns.join('\t'));
|
|
270
|
+
for (const row of rows)
|
|
271
|
+
lines.push(columns.map((column) => cell(row?.[column])).join('\t'));
|
|
272
|
+
return lines.join('\n');
|
|
273
|
+
}
|
|
274
|
+
for (const row of rows.slice(0, 100))
|
|
275
|
+
lines.push(JSON.stringify(row));
|
|
276
|
+
if (rows.length > 100)
|
|
277
|
+
lines.push(`... 共 ${rows.length} 行(--json 取全量)`);
|
|
278
|
+
return lines.join('\n');
|
|
279
|
+
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { randomUUID } from 'node:crypto';
|
|
23
23
|
import { rsSuccess, schemaOf } from './types.js';
|
|
24
24
|
import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
|
|
25
|
-
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl,
|
|
25
|
+
import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, talentUiCardUrl, resolveInterviewListUrlOrNative, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
|
|
26
26
|
// 面试计划表单字段 dataKey(缓存 fields 里取)。
|
|
27
27
|
// 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
|
|
28
28
|
// 放进来会让未部署数字人的环境连非 AI 面试都建不了(单独按需校验)。
|
|
@@ -512,8 +512,14 @@ async function resolveRequiredHint(plan, ctx) {
|
|
|
512
512
|
dataDetails: plan.dataDetails,
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
// 人才卡片详情 URL
|
|
516
|
-
|
|
515
|
+
// 人才卡片详情 URL:装了人才库 ecode 页面就用新卡片页,否则回退 EB 详情页
|
|
516
|
+
// {baseUrl}/sp/ebdpage/view/{ebdDetailPageId}?talentId={id}(2026-11-10 用户要求改指向新页面)
|
|
517
|
+
async function resolveTalentCardUrl(ctx, talentId) {
|
|
518
|
+
if (talentId) {
|
|
519
|
+
const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
|
|
520
|
+
if (ui)
|
|
521
|
+
return ui;
|
|
522
|
+
}
|
|
517
523
|
const pid = ctx.cache.ebdDetailPageId;
|
|
518
524
|
if (!pid || !talentId) {
|
|
519
525
|
// 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
|
|
@@ -758,7 +764,8 @@ async function applyCore(args, env, payload) {
|
|
|
758
764
|
const verifyWarnings = verification.mismatches.map((m) => '落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual + '(该字段可能未写入)');
|
|
759
765
|
const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
|
|
760
766
|
// 列表链接只打开列表;详情单页由 viewLink 单独给出,不再用「列表+滑出详情」组合地址。
|
|
761
|
-
|
|
767
|
+
// 2026-11-10 用户定稿:装了人才库 ecode 页面就指向新的「面试进展」页,否则回退原生面试台账列表。
|
|
768
|
+
const listLocateUrl = await resolveInterviewListUrlOrNative(ctx.host, ctx.cache, ctx.baseUrl, (ctx.cache.lists?.interview?.listId) || '');
|
|
762
769
|
return rsSuccess('ehr.recruit.stage.interview.arrange.apply', {
|
|
763
770
|
mode: 'apply', result: verification.mismatches.length ? 'partial' : 'success', interviewFormId: formDataId,
|
|
764
771
|
interviewCardUrl: detailUrl,
|
|
@@ -799,7 +806,7 @@ async function prefill(args, env) {
|
|
|
799
806
|
}
|
|
800
807
|
throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
|
|
801
808
|
}
|
|
802
|
-
const cardUrl = resolveTalentCardUrl(ctx, talentId);
|
|
809
|
+
const cardUrl = await resolveTalentCardUrl(ctx, talentId);
|
|
803
810
|
const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
|
|
804
811
|
const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}');`
|
|
805
812
|
+ ` if (!i) return 'no-form-instance(请先在人才卡片点「安排面试」打开面试安排表单)';`
|