weaver-work-cli 0.1.52 → 0.1.54
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/{attachment-content-MBYYSQIX.js → attachment-content-2EPEI4HV.js} +3 -3
- package/dist/chunks/{chunk-DZOC77ZD.js → chunk-6LGLI46Q.js} +1 -1
- package/dist/chunks/{chunk-RWFRZSIP.js → chunk-7KKI5KDY.js} +2 -2
- package/dist/chunks/{chunk-KLZ3ULQQ.js → chunk-CNVZETM5.js} +1 -1
- package/dist/chunks/{chunk-RPRFIG6I.js → chunk-FE3CQAAM.js} +23 -23
- package/dist/chunks/{chunk-ZRHKGQRQ.js → chunk-JJRIT2ZN.js} +2 -2
- package/dist/chunks/{chunk-LTRLF6MM.js → chunk-LYOFRYC4.js} +4 -4
- package/dist/chunks/{chunk-7UOXOGFL.js → chunk-O6RIBG5E.js} +4 -4
- package/dist/chunks/{chunk-LM2H7SZI.js → chunk-QUDHSMG3.js} +37 -25
- package/dist/chunks/{chunk-IRMA3GVP.js → chunk-XHMJBRLZ.js} +1 -1
- package/dist/chunks/{chunk-LALWNK6M.js → chunk-XPQN4E5O.js} +41 -19
- package/dist/chunks/{chunk-D3TDNRFE.js → chunk-Z7B7QSR2.js} +7 -7
- package/dist/chunks/{conflict-D2HYKBMH.js → conflict-K2IAKKFR.js} +2 -2
- package/dist/chunks/{contract-MFOFMM2J.js → contract-LJRAXVZU.js} +5448 -1857
- package/dist/chunks/{create-flow-7ZATJVTM.js → create-flow-UL37MZGP.js} +6 -6
- package/dist/chunks/{env-5DO4YENS.js → env-BZDB5OVZ.js} +2 -2
- package/dist/chunks/{factory-3M7D7WJC.js → factory-VD3YI6N7.js} +1 -1
- package/dist/chunks/{group-chat-B2HT5NEO.js → group-chat-DHNVO76L.js} +3 -3
- package/dist/chunks/{meeting-HZOX3CBB.js → meeting-OWG4O2XH.js} +10 -10
- package/dist/chunks/{registry-SJHSBO5G.js → registry-ASYCWF2U.js} +10 -10
- package/dist/chunks/{registry-KYPFFQIH.js → registry-CJOVECZD.js} +1 -1
- package/dist/chunks/{room-recommend-5AHR4YQV.js → room-recommend-LSVAMGKV.js} +4 -4
- package/dist/chunks/{schedule-KZPJUPC2.js → schedule-7QOPRUU4.js} +4 -4
- package/dist/chunks/{smart-extract-IXHCZE4R.js → smart-extract-FOUYNIG3.js} +44 -8
- package/dist/chunks/{workflow-UHKCZJMY.js → workflow-YHXFIU63.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/shortcuts/contract/manifest.js +105 -5
- package/dist/shortcuts/contract/ooxml/docx-table.js +233 -0
- package/dist/shortcuts/contract/operations/card-action.js +597 -17
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +258 -2
- package/dist/shortcuts/contract/operations/card.js +6 -5
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +532 -0
- package/dist/shortcuts/contract/operations/docx-verify.js +258 -0
- package/dist/shortcuts/contract/operations/elements-build.js +47 -0
- package/dist/shortcuts/contract/operations/first-screen.js +28 -3
- package/dist/shortcuts/contract/operations/ledger.js +438 -0
- package/dist/shortcuts/contract/operations/performance.js +104 -3
- package/dist/shortcuts/contract/operations/quotescreen.js +529 -0
- package/dist/shortcuts/contract/operations/registry.js +10 -0
- package/dist/shortcuts/contract/operations/triage.js +1100 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +21 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +10 -7
- package/dist/shortcuts/smart-extract/operations/validate.js +49 -3
- package/dist/shortcuts/workflow/operations/form.js +68 -33
- package/docs/smart-extract.md +5 -5
- package/package.json +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +139 -99
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +43 -482
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +7 -8
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +32 -16
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +478 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +39 -61
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +13 -9
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +263 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +525 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +36 -0
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +3 -6
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +80 -54
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +53 -76
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +19 -21
- package/skills/weaver-e10-jinchengda/references/orchestration.md +12 -12
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +1 -6
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +2 -1
- package/skills/weaver-e10-meeting/SKILL.md +2 -1
- package/skills/weaver-e10-smart-extract/SKILL.md +15 -4
- package/skills/weaver-e10-smart-extract/references/result-format.md +2 -2
- package/skills/weaver-e10-smart-extract/references/troubleshooting.md +2 -1
- package/skills/weaver-e10-workflow/references/workflow-create.md +6 -5
- package/skills/weaver-e10-workflow/references/workflow-edit.md +1 -1
- package/skills/weaver-e10-jinchengda/scripts/contract_first_screen.py +0 -200
- package/skills/weaver-e10-jinchengda/scripts/fill_contract_from_quote.py +0 -572
- package/skills/weaver-e10-jinchengda/scripts/quote_screen.py +0 -560
- package/skills/weaver-e10-jinchengda/scripts/triage_contract.py +0 -894
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +0 -598
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +0 -118
|
@@ -44,6 +44,70 @@ const ALIASES = new Map([
|
|
|
44
44
|
['商务渠道订单', '渠道订单-商务'],
|
|
45
45
|
['渠道订单商务', '渠道订单-商务'],
|
|
46
46
|
]);
|
|
47
|
+
/**
|
|
48
|
+
* 菜单 → 台账页(`@weapp/contract` 的 LedgerPage)默认标签 viewKey(2026-11-13 用户确认)。
|
|
49
|
+
*
|
|
50
|
+
* 台账页只有 5 个标签:e-cology 合同 / 直销合同业绩 / e-office 渠道协议 /
|
|
51
|
+
* e-office 渠道订单 / e-teams 渠道订单。「合同收款」「项目验收」在台账页没有对应标签,
|
|
52
|
+
* 不在本表内,继续用 ebdf 列表卡打开。渠道订单同时含 e-office 与 e-teams 产品数据,
|
|
53
|
+
* 默认落 e-teams 标签(用户确认),用户可在页面自行切换。
|
|
54
|
+
*/
|
|
55
|
+
const LEDGER_VIEW_KEYS = new Map([
|
|
56
|
+
['直销合同', 'ecology'],
|
|
57
|
+
['直销业绩', 'directPerf'],
|
|
58
|
+
['渠道订单', 'etOrder'],
|
|
59
|
+
['渠道订单-商务', 'agree'],
|
|
60
|
+
]);
|
|
61
|
+
/** 台账页 filters 可用键与值类型(来源:组件说明「默认筛选」)。 */
|
|
62
|
+
const LEDGER_FILTER_KINDS = {
|
|
63
|
+
ecology: {
|
|
64
|
+
khmc: 'text',
|
|
65
|
+
hth: 'text',
|
|
66
|
+
htmc: 'text',
|
|
67
|
+
qdrq: 'dateRange',
|
|
68
|
+
htzje: 'amountRange',
|
|
69
|
+
xslx: 'text',
|
|
70
|
+
xsjl2: 'text',
|
|
71
|
+
qy2: 'text',
|
|
72
|
+
hsjg: 'text',
|
|
73
|
+
},
|
|
74
|
+
directPerf: {
|
|
75
|
+
hth: 'text',
|
|
76
|
+
khmc: 'text',
|
|
77
|
+
yjny: 'text',
|
|
78
|
+
xsjl: 'text',
|
|
79
|
+
tdfzr: 'text',
|
|
80
|
+
jgfzr: 'text',
|
|
81
|
+
},
|
|
82
|
+
agree: {
|
|
83
|
+
dls: 'text',
|
|
84
|
+
xyh: 'text',
|
|
85
|
+
qdrq: 'dateRange',
|
|
86
|
+
htzje: 'amountRange',
|
|
87
|
+
sqjsrq: 'date',
|
|
88
|
+
},
|
|
89
|
+
eoOrder: {
|
|
90
|
+
khmc: 'text',
|
|
91
|
+
qy3: 'text',
|
|
92
|
+
qdrq: 'dateRange',
|
|
93
|
+
htzje: 'amountRange',
|
|
94
|
+
htzl: 'text',
|
|
95
|
+
syhhr: 'text',
|
|
96
|
+
ejsyhhr: 'text',
|
|
97
|
+
},
|
|
98
|
+
etOrder: {
|
|
99
|
+
khmc: 'text',
|
|
100
|
+
htzl: 'text',
|
|
101
|
+
qy3: 'text',
|
|
102
|
+
qdrq: 'dateRange',
|
|
103
|
+
htzje: 'amountRange',
|
|
104
|
+
syhhr: 'text',
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
/** 台账页路由(组件说明:src 为 <origin>/sp/contract/ledger)。 */
|
|
108
|
+
const LEDGER_ROUTE = '/sp/contract/ledger';
|
|
109
|
+
const DATE_TEXT = /^\d{4}-\d{2}-\d{2}$/u;
|
|
110
|
+
const AMOUNT_TEXT = /^-?\d+(\.\d+)?$/u;
|
|
47
111
|
const FIELD_KEY = /^field_\d+$/u;
|
|
48
112
|
const PAGE_ID = /^\d{6,}$/u;
|
|
49
113
|
const ORIGIN = /^https?:\/\/[^/]+$/u;
|
|
@@ -198,6 +262,167 @@ function buildCard(pageId, origin, title, callId, comParams) {
|
|
|
198
262
|
},
|
|
199
263
|
};
|
|
200
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* 解析台账页 filters(来源:组件说明「默认筛选」)。
|
|
267
|
+
*
|
|
268
|
+
* 键是台账键(如 khmc / qdrq / htzje),不是 `field_<字段id>`;
|
|
269
|
+
* 日期区间与金额区间写两元素数组,只限一端时另一端传空串。
|
|
270
|
+
*/
|
|
271
|
+
function parseLedgerFilters(pairs, rawJson, viewKey) {
|
|
272
|
+
const allowed = LEDGER_FILTER_KINDS[viewKey] ?? {};
|
|
273
|
+
const pairList = Array.isArray(pairs) ? pairs : [];
|
|
274
|
+
const jsonText = typeof rawJson === 'string' && rawJson.trim() ? rawJson : '';
|
|
275
|
+
if (pairList.length && jsonText) {
|
|
276
|
+
throw contractValidationError('com_params_conflict', 'comParamPairs 与 comParamsJson 只能二选一');
|
|
277
|
+
}
|
|
278
|
+
const merged = {};
|
|
279
|
+
if (jsonText) {
|
|
280
|
+
let parsed;
|
|
281
|
+
try {
|
|
282
|
+
parsed = JSON.parse(jsonText);
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
286
|
+
throw contractValidationError('com_params_invalid', `comParamsJson 不是合法 JSON:${message}`);
|
|
287
|
+
}
|
|
288
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
289
|
+
throw contractValidationError('com_params_invalid', 'comParamsJson 必须是对象');
|
|
290
|
+
}
|
|
291
|
+
Object.assign(merged, parsed);
|
|
292
|
+
}
|
|
293
|
+
for (const item of pairList) {
|
|
294
|
+
const text = typeof item === 'string' ? item : pyStr(item);
|
|
295
|
+
const index = text.indexOf('=');
|
|
296
|
+
if (index < 0) {
|
|
297
|
+
throw contractValidationError('com_param_invalid', `comParamPairs 需要 key=value,收到 ${pyReprText(item)}`);
|
|
298
|
+
}
|
|
299
|
+
merged[text.slice(0, index).trim()] = text.slice(index + 1);
|
|
300
|
+
}
|
|
301
|
+
const out = {};
|
|
302
|
+
for (const [key, raw] of Object.entries(merged)) {
|
|
303
|
+
const kind = allowed[key];
|
|
304
|
+
if (!kind) {
|
|
305
|
+
throw contractValidationError('ledger_filter_key_invalid', `台账标签 ${viewKey} 没有筛选键 ${pyReprText(key)},可用:${Object.keys(allowed).join('、')}`);
|
|
306
|
+
}
|
|
307
|
+
if (kind === 'dateRange' || kind === 'amountRange') {
|
|
308
|
+
if (!Array.isArray(raw) || raw.length !== 2) {
|
|
309
|
+
throw contractValidationError('ledger_filter_range_invalid', `${key} 需要 [起点, 终点] 两元素数组;只限一端时另一端传空串。`);
|
|
310
|
+
}
|
|
311
|
+
const bounds = raw.map((item) => (typeof item === 'string' ? item.trim() : pyStr(item)));
|
|
312
|
+
for (const bound of bounds) {
|
|
313
|
+
if (!bound)
|
|
314
|
+
continue;
|
|
315
|
+
if (kind === 'dateRange' && !DATE_TEXT.test(bound)) {
|
|
316
|
+
throw contractValidationError('ledger_filter_date_invalid', `${key} 的日期应为 YYYY-MM-DD,收到 ${bound}`);
|
|
317
|
+
}
|
|
318
|
+
if (kind === 'amountRange' && !AMOUNT_TEXT.test(bound)) {
|
|
319
|
+
throw contractValidationError('ledger_filter_amount_invalid', `${key} 的金额应以元为单位的纯数字,收到 ${bound}`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
out[key] = bounds;
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (Array.isArray(raw) || (raw !== null && typeof raw === 'object')) {
|
|
326
|
+
throw contractValidationError('ledger_filter_value_invalid', `${key} 需要一个字符串值。`);
|
|
327
|
+
}
|
|
328
|
+
const text = raw === null || raw === undefined ? '' : typeof raw === 'string' ? raw.trim() : pyStr(raw);
|
|
329
|
+
if (kind === 'date' && text && !DATE_TEXT.test(text)) {
|
|
330
|
+
throw contractValidationError('ledger_filter_date_invalid', `${key} 的日期应为 YYYY-MM-DD,收到 ${text}`);
|
|
331
|
+
}
|
|
332
|
+
out[key] = text;
|
|
333
|
+
}
|
|
334
|
+
return out;
|
|
335
|
+
}
|
|
336
|
+
/** 台账页组件卡:fill_form + e10 + @weapp/contract 的 LedgerPage,viewKey 决定默认标签。 */
|
|
337
|
+
function buildLedgerCard(viewKey, origin, title, callId, filters) {
|
|
338
|
+
return {
|
|
339
|
+
version: 1,
|
|
340
|
+
callId,
|
|
341
|
+
toolId: 'fill_form',
|
|
342
|
+
arguments: {
|
|
343
|
+
type: 'e10',
|
|
344
|
+
title,
|
|
345
|
+
src: `${origin}${LEDGER_ROUTE}`,
|
|
346
|
+
width: 1300,
|
|
347
|
+
sdkRenderType: 'inline',
|
|
348
|
+
sdkOptions: {
|
|
349
|
+
compName: 'ui.CorsComponent',
|
|
350
|
+
routerType: 'MemoryRouter',
|
|
351
|
+
routerProps_pc: { initialEntries: [LEDGER_ROUTE] },
|
|
352
|
+
params_pc: {
|
|
353
|
+
app: '@weapp/contract',
|
|
354
|
+
compName: 'LedgerPage',
|
|
355
|
+
},
|
|
356
|
+
params: {
|
|
357
|
+
viewKey,
|
|
358
|
+
filters: { [viewKey]: filters },
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
/** 台账页卡的逐项自检;空数组即通过。 */
|
|
365
|
+
function selfCheckLedger(card, viewKey) {
|
|
366
|
+
const bad = [];
|
|
367
|
+
const args = card.arguments ?? {};
|
|
368
|
+
const options = args.sdkOptions ?? {};
|
|
369
|
+
const pc = options.params_pc ?? {};
|
|
370
|
+
const params = options.params ?? {};
|
|
371
|
+
const routerPc = options.routerProps_pc ?? {};
|
|
372
|
+
if (card.version !== 1)
|
|
373
|
+
bad.push('version != 1');
|
|
374
|
+
if (card.toolId !== 'fill_form')
|
|
375
|
+
bad.push('toolId != fill_form');
|
|
376
|
+
if (!card.callId)
|
|
377
|
+
bad.push('callId 为空');
|
|
378
|
+
if (args.type !== 'e10')
|
|
379
|
+
bad.push('arguments.type != e10');
|
|
380
|
+
if (args.sdkRenderType !== 'inline')
|
|
381
|
+
bad.push('sdkRenderType != inline');
|
|
382
|
+
if (!String(args.src ?? '').endsWith(LEDGER_ROUTE))
|
|
383
|
+
bad.push('src 与台账路由不一致');
|
|
384
|
+
if (args.width !== 1300)
|
|
385
|
+
bad.push('width 应为 1300');
|
|
386
|
+
if (options.compName !== 'ui.CorsComponent')
|
|
387
|
+
bad.push('sdkOptions.compName != ui.CorsComponent');
|
|
388
|
+
if (options.routerType !== 'MemoryRouter')
|
|
389
|
+
bad.push('routerType != MemoryRouter');
|
|
390
|
+
if (!Array.isArray(routerPc.initialEntries) || routerPc.initialEntries[0] !== LEDGER_ROUTE) {
|
|
391
|
+
bad.push('initialEntries 不是台账路由');
|
|
392
|
+
}
|
|
393
|
+
if (pc.app !== '@weapp/contract' || pc.compName !== 'LedgerPage')
|
|
394
|
+
bad.push('params_pc 不是 @weapp/contract LedgerPage');
|
|
395
|
+
if (params.viewKey !== viewKey)
|
|
396
|
+
bad.push('params.viewKey 与菜单映射不一致');
|
|
397
|
+
const filters = params.filters;
|
|
398
|
+
if (!filters || typeof filters !== 'object' || Array.isArray(filters)) {
|
|
399
|
+
bad.push('params.filters 不是对象');
|
|
400
|
+
return bad;
|
|
401
|
+
}
|
|
402
|
+
const outerKeys = Object.keys(filters);
|
|
403
|
+
if (outerKeys.length !== 1 || outerKeys[0] !== viewKey)
|
|
404
|
+
bad.push('filters 第一层 key 必须是 viewKey');
|
|
405
|
+
const inner = filters[viewKey];
|
|
406
|
+
if (!inner || typeof inner !== 'object' || Array.isArray(inner)) {
|
|
407
|
+
bad.push('filters[viewKey] 不是对象');
|
|
408
|
+
return bad;
|
|
409
|
+
}
|
|
410
|
+
const allowed = LEDGER_FILTER_KINDS[viewKey] ?? {};
|
|
411
|
+
for (const [key, value] of Object.entries(inner)) {
|
|
412
|
+
const kind = allowed[key];
|
|
413
|
+
if (!kind)
|
|
414
|
+
bad.push(`filters 键不在 ${viewKey} 白名单:${key}`);
|
|
415
|
+
if (kind === 'dateRange' || kind === 'amountRange') {
|
|
416
|
+
if (!Array.isArray(value) || value.length !== 2 || value.some((item) => typeof item !== 'string')) {
|
|
417
|
+
bad.push(`filters 区间不是两段字符串:${key}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else if (typeof value !== 'string') {
|
|
421
|
+
bad.push(`filters 值不是字符串:${key}`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return bad;
|
|
425
|
+
}
|
|
201
426
|
/** 按 validate 的 ebdf 分支逐项核对,返回问题列表(空数组即通过)。 */
|
|
202
427
|
function selfCheck(card, pageId) {
|
|
203
428
|
const bad = [];
|
|
@@ -279,13 +504,44 @@ export const contractCardEbdfListOperation = {
|
|
|
279
504
|
pageId = resolved.pageId;
|
|
280
505
|
}
|
|
281
506
|
const origin = cleanOrigin(input.origin);
|
|
282
|
-
const
|
|
507
|
+
const viewKey = LEDGER_VIEW_KEYS.get(menu);
|
|
283
508
|
const titleInput = stripOrEmpty(input.title);
|
|
284
509
|
const title = titleInput || menu;
|
|
285
510
|
if (!title)
|
|
286
511
|
throw contractValidationError('title_required', 'title 不能为空');
|
|
287
512
|
const callIdInput = stripOrEmpty(input.callId);
|
|
288
|
-
const callId = callIdInput
|
|
513
|
+
const callId = callIdInput
|
|
514
|
+
|| `${viewKey ? 'ledger' : 'ebdf-list'}-${menu}-${stampNow()}-01`;
|
|
515
|
+
if (viewKey) {
|
|
516
|
+
const filters = parseLedgerFilters(input.comParamPairs, input.comParamsJson, viewKey);
|
|
517
|
+
const card = buildLedgerCard(viewKey, origin, title, callId, filters);
|
|
518
|
+
const problems = selfCheckLedger(card, viewKey);
|
|
519
|
+
if (problems.length) {
|
|
520
|
+
throw contractValidationError('self_check_failed', `台账页卡自检未通过:${problems.join(';')}`);
|
|
521
|
+
}
|
|
522
|
+
let output;
|
|
523
|
+
if (typeof input.out === 'string' && input.out.trim()) {
|
|
524
|
+
output = resolve(input.out.trim());
|
|
525
|
+
mkdirSync(dirname(output), { recursive: true });
|
|
526
|
+
writeFileSync(output, `${JSON.stringify(card, null, 2)}\n`, 'utf8');
|
|
527
|
+
}
|
|
528
|
+
return {
|
|
529
|
+
status: 'COMPLETE',
|
|
530
|
+
data: {
|
|
531
|
+
menu,
|
|
532
|
+
pageId,
|
|
533
|
+
variant: 'ledger',
|
|
534
|
+
viewKey,
|
|
535
|
+
callId,
|
|
536
|
+
filters,
|
|
537
|
+
card,
|
|
538
|
+
selfCheck: problems,
|
|
539
|
+
...(output ? { output } : {}),
|
|
540
|
+
note: '台账页卡:viewKey 决定默认标签,filters 第一层 key 就是 viewKey;渠道订单默认 e-teams(etOrder)',
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
const comParams = parseComParams(input.comParamPairs, input.comParamsJson);
|
|
289
545
|
const card = buildCard(pageId, origin, title, callId, comParams);
|
|
290
546
|
const problems = selfCheck(card, pageId);
|
|
291
547
|
if (problems.length) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { basename, resolve } from 'node:path';
|
|
3
3
|
import { contractValidationError } from '../errors.js';
|
|
4
|
+
import { CARD_PANEL_WIDTH } from './card-action.js';
|
|
4
5
|
import { requireNonEmptyString } from './shared.js';
|
|
5
6
|
import { renderSummaryHtml } from './summary.js';
|
|
6
7
|
/**
|
|
@@ -36,7 +37,7 @@ try{cards=JSON.parse(cb?cb.value:'[]');}catch(e){cards=[];}
|
|
|
36
37
|
var ICON={send:'📧',shield:'🛡',search:'🔍',doc:'📋',compare:'🔄',calc:'📊',link:'🔗'};
|
|
37
38
|
function run(c){
|
|
38
39
|
var a=c.action||{};
|
|
39
|
-
if(a.type
|
|
40
|
+
if('sendQuestion'.indexOf(a.type)>-1){
|
|
40
41
|
var ps=plug();
|
|
41
42
|
if(!ps||!ps.session||typeof ps.session.sendQuestion!=='function'){say('当前环境不支持发送会话消息');return;}
|
|
42
43
|
try{ps.session.sendQuestion({question:a.question||c.title||'',files:[]});say('已发送,正在处理');}
|
|
@@ -46,14 +47,14 @@ function run(c){
|
|
|
46
47
|
var p=plug();
|
|
47
48
|
if(!p||!p.rightPanel||typeof p.rightPanel.open!=='function'){say('当前环境没有小e右侧面板');return;}
|
|
48
49
|
var cfg={};
|
|
49
|
-
if(a.type
|
|
50
|
+
if('e10Sdk'.indexOf(a.type)>-1){
|
|
50
51
|
var prm={app:a.app,compName:a.comp};
|
|
51
52
|
if(a.companyName){prm.companyName=a.companyName;}
|
|
52
53
|
if(a.customParams){prm.customParams=a.customParams;}
|
|
53
54
|
cfg.type='e10Sdk';
|
|
54
|
-
cfg.width=a.width
|
|
55
|
+
cfg.width=a.width||${CARD_PANEL_WIDTH};
|
|
55
56
|
cfg.contentProps={src:a.src,sdkOptions:{compName:'ui.CorsComponent',routerType:'MemoryRouter',routerProps:{initialEntries:a.entries},params:prm}};
|
|
56
|
-
}else if(a.type
|
|
57
|
+
}else if('artifact'.indexOf(a.type)>-1){
|
|
57
58
|
var sb=root.querySelector('[data-summary]');
|
|
58
59
|
var h=sb?sb.value:'';
|
|
59
60
|
if(!h){say('摘要内容为空');return;}
|
|
@@ -168,7 +169,7 @@ export const contractCardOperations = [
|
|
|
168
169
|
const uid = typeof data.id === 'string' && data.id.trim() ? data.id.trim() : makeUid();
|
|
169
170
|
const hint = typeof data.hint === 'string' ? data.hint.trim() : '';
|
|
170
171
|
const title = typeof data.title === 'string' && data.title.trim() ? data.title.trim() : '可执行操作';
|
|
171
|
-
const width = typeof data.width === 'number' && data.width > 0 ? data.width :
|
|
172
|
+
const width = typeof data.width === 'number' && data.width > 0 ? data.width : CARD_PANEL_WIDTH;
|
|
172
173
|
const cardsJson = JSON.stringify(cards);
|
|
173
174
|
const script = CARD_SCRIPT.replace(/__UID__/gu, uid);
|
|
174
175
|
const parts = [];
|