weaver-work-cli 0.1.49 → 0.1.52
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 +1 -1
- package/dist/chunks/{attachment-content-MU2LPI5P.js → attachment-content-MBYYSQIX.js} +3 -3
- package/dist/chunks/{chunk-ZKEUGS2U.js → chunk-7UOXOGFL.js} +4 -4
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-3NV2ETZR.js → chunk-D3TDNRFE.js} +8 -8
- package/dist/chunks/{chunk-6GWU63YF.js → chunk-DZOC77ZD.js} +1 -1
- package/dist/chunks/{chunk-K3BT54CU.js → chunk-IRMA3GVP.js} +1 -1
- package/dist/chunks/{chunk-3X7VOSBA.js → chunk-KLZ3ULQQ.js} +1 -1
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-LALWNK6M.js} +167 -44
- package/dist/chunks/{chunk-BRRW7CWA.js → chunk-LM2H7SZI.js} +26 -26
- package/dist/chunks/{chunk-KV5SOWMS.js → chunk-LTRLF6MM.js} +4 -4
- package/dist/chunks/{chunk-D2QRZUW4.js → chunk-RPRFIG6I.js} +35 -28
- package/dist/chunks/{chunk-GEOMANP7.js → chunk-RWFRZSIP.js} +2 -2
- package/dist/chunks/{chunk-EJVA5ZVB.js → chunk-ZRHKGQRQ.js} +2 -2
- package/dist/chunks/{conflict-6347A7YK.js → conflict-D2HYKBMH.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-MFOFMM2J.js} +4284 -254
- package/dist/chunks/{create-flow-7WG7LVX5.js → create-flow-7ZATJVTM.js} +6 -6
- package/dist/chunks/{data-QO7QWOIV.js → data-WK5CQXNF.js} +17 -32
- package/dist/chunks/{env-LHRKSLG6.js → env-5DO4YENS.js} +2 -2
- package/dist/chunks/{factory-2H7Z4RWJ.js → factory-3M7D7WJC.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-EW6PNDDT.js → group-chat-B2HT5NEO.js} +3 -3
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-V7ZTITUO.js} +726 -206
- package/dist/chunks/{meeting-N2FQBHXI.js → meeting-HZOX3CBB.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/{reception-MYOKJULO.js → reception-QGPNTGHG.js} +98 -82
- package/dist/chunks/{recruit-stage-FKWS5UQF.js → recruit-stage-XCMVEQA2.js} +718 -131
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-KYPFFQIH.js} +1 -1
- package/dist/chunks/{registry-CKUVBS53.js → registry-SJHSBO5G.js} +10 -10
- package/dist/chunks/{room-recommend-MBCYENQ2.js → room-recommend-5AHR4YQV.js} +4 -4
- package/dist/chunks/{schedule-5IFMCXME.js → schedule-KZPJUPC2.js} +4 -4
- package/dist/chunks/smart-extract-IXHCZE4R.js +2846 -0
- package/dist/chunks/{workflow-2TRU2ZSP.js → workflow-UHKCZJMY.js} +1 -1
- package/dist/index.js +14 -9
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +204 -0
- package/dist/shortcuts/contract/operations/card-action.js +585 -0
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +315 -0
- package/dist/shortcuts/contract/operations/card-plan.js +327 -0
- package/dist/shortcuts/contract/operations/card-risk-report.js +565 -0
- package/dist/shortcuts/contract/operations/elements-build.js +714 -0
- package/dist/shortcuts/contract/operations/elements-spec.js +216 -0
- package/dist/shortcuts/contract/operations/first-screen.js +563 -0
- package/dist/shortcuts/contract/operations/flow.js +81 -25
- package/dist/shortcuts/contract/operations/modeltext.js +132 -0
- package/dist/shortcuts/contract/operations/op-resolver.js +22 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +410 -22
- package/dist/shortcuts/contract/operations/registry.js +22 -0
- package/dist/shortcuts/contract/operations/review.js +73 -58
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/contract/operations/summary-validate.js +293 -0
- package/dist/shortcuts/contract/operations/summary.js +4 -2
- package/dist/shortcuts/contract/operations/upload.js +48 -7
- package/dist/shortcuts/contract/prewarm-cache.js +90 -0
- package/dist/shortcuts/contract/prewarm.js +88 -0
- package/dist/shortcuts/contract/upload-cache.js +49 -4
- package/dist/shortcuts/data/index.js +1 -6
- package/dist/shortcuts/data/manifest.js +2 -2
- package/dist/shortcuts/data/operations/index.js +1 -1
- package/dist/shortcuts/data/operations/query.js +23 -46
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/index.js +0 -12
- package/dist/shortcuts/invoice/manifest.js +201 -50
- package/dist/shortcuts/invoice/operations/registry.js +4 -2
- package/dist/shortcuts/invoice/operations/reim-relation.js +438 -0
- package/dist/shortcuts/invoice/operations/shared.js +3 -19
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +109 -73
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/reception/constants.js +3 -7
- package/dist/shortcuts/reception/operations/leads.js +30 -6
- package/dist/shortcuts/reception/operations/panels.js +3 -2
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +4 -2
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +6 -2
- package/dist/shortcuts/recruit-stage/operations/list.js +217 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +144 -158
- package/dist/shortcuts/recruit-stage/operations/search.js +348 -0
- package/dist/shortcuts/recruit-stage/shared.js +5 -0
- package/dist/shortcuts/recruit-stage/tag-lookup.js +136 -0
- package/dist/shortcuts/smart-extract/constants.js +79 -0
- package/dist/shortcuts/smart-extract/continuation.js +71 -0
- package/dist/shortcuts/smart-extract/errors.js +68 -0
- package/dist/shortcuts/smart-extract/host.js +191 -0
- package/dist/shortcuts/smart-extract/index.js +105 -0
- package/dist/shortcuts/smart-extract/ledger.js +70 -0
- package/dist/shortcuts/smart-extract/manifest.js +35 -0
- package/dist/shortcuts/smart-extract/operations/attachment.js +212 -0
- package/dist/shortcuts/smart-extract/operations/batch.js +67 -0
- package/dist/shortcuts/smart-extract/operations/config.js +118 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +489 -0
- package/dist/shortcuts/smart-extract/operations/preview.js +174 -0
- package/dist/shortcuts/smart-extract/operations/registry.js +34 -0
- package/dist/shortcuts/smart-extract/operations/save.js +355 -0
- package/dist/shortcuts/smart-extract/operations/shared.js +191 -0
- package/dist/shortcuts/smart-extract/operations/structure.js +401 -0
- package/dist/shortcuts/smart-extract/operations/target.js +167 -0
- package/dist/shortcuts/smart-extract/operations/types.js +22 -0
- package/dist/shortcuts/smart-extract/operations/validate.js +408 -0
- package/dist/shortcuts/workflow/operations/read.js +77 -15
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +4 -1
- package/docs/agent-invoice.md +5 -7
- package/docs/data.md +5 -1
- package/docs/fna.md +24 -4
- package/docs/invoice.md +7 -5
- package/docs/smart-extract.md +156 -0
- package/package.json +1 -1
- package/skill-template/business-info.json +21 -1
- package/skill-template/domains/qiyecheng.md +6 -2
- package/skill-template/domains/smart-extract.md +16 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- package/skills/weaver-e10-data/references/scene-and-misc.md +4 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +159 -11
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +13 -8
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +220 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +68 -33
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +26 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +128 -0
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +90 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +167 -5
- package/skills/weaver-e10-jinchengda/scripts/contract_first_screen.py +200 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_contract_from_quote.py +572 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/quote_screen.py +560 -0
- package/skills/weaver-e10-jinchengda/scripts/triage_contract.py +894 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +93 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +58 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +118 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +42 -3
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +8 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +9 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +13 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/self-hosted-mode.md +239 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +153 -40
- package/skills/weaver-e10-reception-flow/SKILL.md +43 -6
- package/skills/weaver-e10-reception-flow/references/guide.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +62 -4
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +42 -8
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +79 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +11 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +3 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +153 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +7 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +66 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +156 -40
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +122 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +36 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +157 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +35 -0
- package/skills/weaver-e10-smart-extract/SKILL.md +169 -0
- package/skills/weaver-e10-smart-extract/references/api-contract.md +71 -0
- package/skills/weaver-e10-smart-extract/references/result-format.md +102 -0
- package/skills/weaver-e10-smart-extract/references/troubleshooting.md +105 -0
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/references/workflow-query.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +53 -35
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +19 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +8 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +407 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +18 -53
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +97 -39
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +96 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +5 -38
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +14 -14
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +139 -94
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +131 -58
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +110 -43
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/shortcuts/invoice/operations/validate-preview.js +0 -40
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +0 -279
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +0 -450
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +0 -358
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +0 -40
|
@@ -3,6 +3,7 @@ import { flowPageUrl } from './page.js';
|
|
|
3
3
|
import { loadFormContext, inspectUploadField, resolveUploadFieldId } from './form-info.js';
|
|
4
4
|
import { requireNonEmptyString } from './shared.js';
|
|
5
5
|
import { assertContractDocument, uploadFile } from './upload.js';
|
|
6
|
+
import { lookupFileModule } from '../upload-cache.js';
|
|
6
7
|
/**
|
|
7
8
|
* 四个合同流程的固定 workflowId / fieldId。
|
|
8
9
|
* 这些是业务常量(不是环境 ID),但流程页面里的其他 ID 仍需运行时解析。
|
|
@@ -40,6 +41,12 @@ function requestIdOf(value) {
|
|
|
40
41
|
const text = String(candidate).trim();
|
|
41
42
|
return text ? text : undefined;
|
|
42
43
|
}
|
|
44
|
+
function optionalText(value) {
|
|
45
|
+
if (value === undefined || value === null)
|
|
46
|
+
return undefined;
|
|
47
|
+
const text = String(value).trim();
|
|
48
|
+
return text ? text : undefined;
|
|
49
|
+
}
|
|
43
50
|
export const contractFlowOperations = [
|
|
44
51
|
{
|
|
45
52
|
name: 'contract.flow.page',
|
|
@@ -92,34 +99,80 @@ export const contractFlowOperations = [
|
|
|
92
99
|
name: 'contract.flow.launch',
|
|
93
100
|
async execute(input, { host }) {
|
|
94
101
|
const flow = resolveFlow(input.flow);
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
// 入参二选一(2026-11-12 用户定稿):
|
|
103
|
+
// - path:本地上传(最常用)
|
|
104
|
+
// - fileId:复用会话里已有的文件;若它当初不是 workflow 上传的,表单附件挂不住,需要 path 重新上传
|
|
105
|
+
const rawPath = optionalText(input.path);
|
|
106
|
+
const presetFileId = optionalText(input.fileId);
|
|
107
|
+
if (!rawPath && !presetFileId) {
|
|
108
|
+
throw contractValidationError('file_required', '必须提供 path(本地上传)或 fileId(复用会话已有文件)之一');
|
|
109
|
+
}
|
|
110
|
+
if (rawPath)
|
|
111
|
+
assertContractDocument(rawPath);
|
|
97
112
|
// 先解析上传字段(O-3c):宁可多三次只读请求,也不把合同挂到一个可能失效的 fieldId 上。
|
|
98
113
|
const formContext = await loadFormContext(host, flow.workflowId);
|
|
99
114
|
const uploadField = resolveUploadFieldId(formContext.layout, flow.fieldId, flow.label);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
path: '/api/workflow/core/flowPage/loadBaseParam',
|
|
103
|
-
query: { isCreate: 1, workflowId: flow.workflowId },
|
|
104
|
-
body: { workflowId: flow.workflowId, isCreate: 1, isMobile: 0 },
|
|
105
|
-
});
|
|
106
|
-
const requestId = requestIdOf(baseParam);
|
|
107
|
-
if (!requestId) {
|
|
108
|
-
throw contractValidationError('request_id_missing', 'loadBaseParam 未返回 requestInfo.requestId,已停止上传,避免文件挂到错误流程', { workflowId: flow.workflowId });
|
|
109
|
-
}
|
|
110
|
-
const uploaded = await uploadFile(host, {
|
|
111
|
-
path,
|
|
112
|
-
module: 'workflow',
|
|
113
|
-
extraFields: {
|
|
114
|
-
authModule: 'workflow',
|
|
115
|
-
source: 'form',
|
|
116
|
-
fieldId: uploadField.fieldId,
|
|
117
|
-
sourceRefId: requestId,
|
|
118
|
-
refId: requestId,
|
|
119
|
-
folderId: '300',
|
|
120
|
-
},
|
|
121
|
-
});
|
|
115
|
+
// 判断已有 fileId 能否直接复用:只有确认它本就是 workflow 上传的才行。
|
|
116
|
+
// 未知(缓存过期 / 换环境 / 别处传的)一律按"不是 workflow"处理,重新上传。
|
|
122
117
|
const session = await host.getSession();
|
|
118
|
+
let presetModule = null;
|
|
119
|
+
if (presetFileId) {
|
|
120
|
+
presetModule = await lookupFileModule({
|
|
121
|
+
fileId: presetFileId,
|
|
122
|
+
baseUrl: session.baseUrl,
|
|
123
|
+
userId: session.userId ?? '',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const canReuse = presetFileId !== undefined && presetModule === 'workflow';
|
|
127
|
+
let uploaded;
|
|
128
|
+
let fileSource;
|
|
129
|
+
let reuploadReason;
|
|
130
|
+
if (canReuse) {
|
|
131
|
+
uploaded = {
|
|
132
|
+
fileId: presetFileId,
|
|
133
|
+
name: '',
|
|
134
|
+
size: 0,
|
|
135
|
+
md5: '',
|
|
136
|
+
module: 'workflow',
|
|
137
|
+
reused: true,
|
|
138
|
+
prewarmed: true,
|
|
139
|
+
};
|
|
140
|
+
fileSource = 'reused';
|
|
141
|
+
}
|
|
142
|
+
else if (rawPath) {
|
|
143
|
+
// 需要真正上传:先拿 requestId,再把文件挂到流程表单字段上。
|
|
144
|
+
const baseParam = await host.contractRequest({
|
|
145
|
+
method: 'POST',
|
|
146
|
+
path: '/api/workflow/core/flowPage/loadBaseParam',
|
|
147
|
+
query: { isCreate: 1, workflowId: flow.workflowId },
|
|
148
|
+
body: { workflowId: flow.workflowId, isCreate: 1, isMobile: 0 },
|
|
149
|
+
});
|
|
150
|
+
const requestId = requestIdOf(baseParam);
|
|
151
|
+
if (!requestId) {
|
|
152
|
+
throw contractValidationError('request_id_missing', 'loadBaseParam 未返回 requestInfo.requestId,已停止上传,避免文件挂到错误流程', { workflowId: flow.workflowId });
|
|
153
|
+
}
|
|
154
|
+
uploaded = await uploadFile(host, {
|
|
155
|
+
path: rawPath,
|
|
156
|
+
module: 'workflow',
|
|
157
|
+
extraFields: {
|
|
158
|
+
authModule: 'workflow',
|
|
159
|
+
source: 'form',
|
|
160
|
+
fieldId: uploadField.fieldId,
|
|
161
|
+
sourceRefId: requestId,
|
|
162
|
+
refId: requestId,
|
|
163
|
+
folderId: '300',
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
fileSource = presetFileId ? 'reuploaded' : 'uploaded';
|
|
167
|
+
if (presetFileId) {
|
|
168
|
+
reuploadReason = presetModule
|
|
169
|
+
? `已有文件的 module 是 ${presetModule},表单附件必须用 workflow 上传的文件,已重新上传`
|
|
170
|
+
: '已有文件的 module 未知,无法确认能挂到表单附件字段,已重新上传';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
throw contractValidationError('reupload_required', `fileId ${presetFileId} 不是 workflow 上传的文件(或无法确认),表单附件挂不住;请同时提供 path 以便重新上传`, { fileId: presetFileId, module: presetModule });
|
|
175
|
+
}
|
|
123
176
|
return {
|
|
124
177
|
status: 'COMPLETE',
|
|
125
178
|
data: {
|
|
@@ -129,8 +182,11 @@ export const contractFlowOperations = [
|
|
|
129
182
|
fieldId: uploadField.fieldId,
|
|
130
183
|
fieldIdPreset: flow.fieldId,
|
|
131
184
|
fieldIdSource: uploadField.state,
|
|
132
|
-
requestId,
|
|
133
185
|
file: uploaded,
|
|
186
|
+
fileSource,
|
|
187
|
+
presetFileId,
|
|
188
|
+
presetFileModule: presetModule,
|
|
189
|
+
reuploadReason,
|
|
134
190
|
url: flowPageUrl(session.baseUrl, flow.workflowId, uploaded.fileId),
|
|
135
191
|
page: { width: 1000 },
|
|
136
192
|
},
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 范文库(「合同范文管理」EB 表单)查询。
|
|
3
|
+
*
|
|
4
|
+
* 术语约定:今承达技能内「模板」等同于「范文」(模板 == 范文),
|
|
5
|
+
* 因此本文件服务的是**范文库**,与合同模板库(`contract.template.*` → `/api/ebd/contract/tplinfo/**`)
|
|
6
|
+
* 是两个互不相通的对象,取数链路与字段都不同,禁止互相代替。
|
|
7
|
+
*/
|
|
8
|
+
const MODEL_TEXT_OBJ_ID = '1290191829260230657';
|
|
9
|
+
const MODEL_TEXT_LIST_ID = '1290191833571975256';
|
|
10
|
+
const LIST_DATAS_PATH = '/api/ebuilder/form/list/getListDatas';
|
|
11
|
+
function dataOf(value) {
|
|
12
|
+
return value?.data ?? {};
|
|
13
|
+
}
|
|
14
|
+
/** 列表接口在不同环境下会把行放在 data / rows / records / list,按出现顺序取第一个数组。 */
|
|
15
|
+
function rowsOf(value) {
|
|
16
|
+
const data = dataOf(value);
|
|
17
|
+
for (const candidate of [data.data, data.rows, data.records, data.list]) {
|
|
18
|
+
if (Array.isArray(candidate))
|
|
19
|
+
return candidate;
|
|
20
|
+
}
|
|
21
|
+
return Array.isArray(data) ? data : [];
|
|
22
|
+
}
|
|
23
|
+
/** 真实总数:部分接口把总数放在 pagination.mainRecordTotal,total 恒为 0 时以它为准。 */
|
|
24
|
+
function totalOf(value, rows) {
|
|
25
|
+
const data = dataOf(value);
|
|
26
|
+
const candidates = [
|
|
27
|
+
data.total,
|
|
28
|
+
data.count,
|
|
29
|
+
data.pagination?.mainRecordTotal,
|
|
30
|
+
data.pagination?.total,
|
|
31
|
+
];
|
|
32
|
+
for (const candidate of candidates) {
|
|
33
|
+
const parsed = Number(candidate);
|
|
34
|
+
if (Number.isFinite(parsed) && parsed > 0)
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
return rows.length;
|
|
38
|
+
}
|
|
39
|
+
const PERSON_NAME_KEYS = ['name', 'label', 'text', 'showName', 'userName', 'username'];
|
|
40
|
+
/** creator / updater 是 JSON 数组字符串([{id,name}]),偶发是纯名称;只输出姓名,绝不透出人员 ID。 */
|
|
41
|
+
function personName(value) {
|
|
42
|
+
if (typeof value !== 'string' || !value)
|
|
43
|
+
return undefined;
|
|
44
|
+
try {
|
|
45
|
+
const parsed = JSON.parse(value);
|
|
46
|
+
if (Array.isArray(parsed) && parsed.length) {
|
|
47
|
+
const first = parsed[0];
|
|
48
|
+
if (typeof first === 'string' && first && !/^\d+$/.test(first))
|
|
49
|
+
return first;
|
|
50
|
+
if (first && typeof first === 'object') {
|
|
51
|
+
for (const key of PERSON_NAME_KEYS) {
|
|
52
|
+
const candidate = first[key];
|
|
53
|
+
if (typeof candidate === 'string' && candidate && !/^\d+$/.test(candidate))
|
|
54
|
+
return candidate;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// 非 JSON 时按纯名称处理
|
|
61
|
+
}
|
|
62
|
+
return /^\d+$/.test(value) ? undefined : value;
|
|
63
|
+
}
|
|
64
|
+
async function listModelText(host, pageNo, pageSize, tableuid) {
|
|
65
|
+
const value = await host.contractRequest({
|
|
66
|
+
method: 'POST',
|
|
67
|
+
path: LIST_DATAS_PATH,
|
|
68
|
+
// ebbusinessid 与 listId 同值,缺它接口取不到该视图的业务上下文。
|
|
69
|
+
headers: { ebbusinessid: MODEL_TEXT_LIST_ID },
|
|
70
|
+
query: { passid: MODEL_TEXT_OBJ_ID, cid: MODEL_TEXT_OBJ_ID },
|
|
71
|
+
body: {
|
|
72
|
+
current: pageNo,
|
|
73
|
+
requiredMatch: 1,
|
|
74
|
+
tableuid: tableuid ?? '',
|
|
75
|
+
mapResult: '1',
|
|
76
|
+
recheckQuery: '1',
|
|
77
|
+
terminal: 'PC',
|
|
78
|
+
searchParamData: {
|
|
79
|
+
type: 'and',
|
|
80
|
+
searchType: '2',
|
|
81
|
+
commonSearchFields: {},
|
|
82
|
+
groupFields: {},
|
|
83
|
+
},
|
|
84
|
+
listId: MODEL_TEXT_LIST_ID,
|
|
85
|
+
isFollow: 0,
|
|
86
|
+
isShareToMe: 0,
|
|
87
|
+
filterCondition: {},
|
|
88
|
+
browser: 'Chrome',
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
const rows = rowsOf(value);
|
|
92
|
+
return { rows, total: totalOf(value, rows) };
|
|
93
|
+
}
|
|
94
|
+
/** 范文库列表;本技能内「模板」=「范文」,查模板即查范文。 */
|
|
95
|
+
export const contractModelTextListOperation = {
|
|
96
|
+
name: 'contract.modeltext.list',
|
|
97
|
+
async execute(input, { host }) {
|
|
98
|
+
const pageNo = typeof input.pageNo === 'number' && input.pageNo >= 1 ? input.pageNo : 1;
|
|
99
|
+
const pageSize = typeof input.pageSize === 'number' && input.pageSize >= 1
|
|
100
|
+
? Math.min(input.pageSize, 200)
|
|
101
|
+
: 50;
|
|
102
|
+
const tableuid = typeof input.tableuid === 'string' && input.tableuid.trim()
|
|
103
|
+
? input.tableuid.trim()
|
|
104
|
+
: undefined;
|
|
105
|
+
const { rows, total } = await listModelText(host, pageNo, pageSize, tableuid);
|
|
106
|
+
const session = await host.getSession();
|
|
107
|
+
return {
|
|
108
|
+
status: 'COMPLETE',
|
|
109
|
+
data: {
|
|
110
|
+
path: LIST_DATAS_PATH,
|
|
111
|
+
listUrl: `${session.baseUrl}/sp/ebdfpage/list/${MODEL_TEXT_LIST_ID}`,
|
|
112
|
+
total,
|
|
113
|
+
pageNo,
|
|
114
|
+
pageSize,
|
|
115
|
+
returned: rows.length,
|
|
116
|
+
modelTexts: rows.map((row) => ({
|
|
117
|
+
id: row.id ?? row.rowKey ?? row.form_data_id,
|
|
118
|
+
fileName: row.file_name,
|
|
119
|
+
classification: row.classification_id,
|
|
120
|
+
createTime: row.create_time,
|
|
121
|
+
updateTime: row.update_time,
|
|
122
|
+
creator: personName(row.creator),
|
|
123
|
+
updater: personName(row.updater),
|
|
124
|
+
})),
|
|
125
|
+
hint: '本命令读的是范文库(「合同范文管理」);本技能内「模板」== 「范文」,不要与合同模板库 contract.template.list 混用',
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
export const contractModelTextOperations = [
|
|
131
|
+
contractModelTextListOperation,
|
|
132
|
+
];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* operation 解析器中转(避免 registry ↔ 编排层循环依赖)。
|
|
3
|
+
*
|
|
4
|
+
* 背景:编排层需要在**进程内**调用其它 operation(省掉子进程启动开销),
|
|
5
|
+
* 但直接 `import { getContractOperation } from './registry.js'` 会与 registry
|
|
6
|
+
* 形成循环依赖:registry 加载时导入编排层,编排层又反向导入 registry。
|
|
7
|
+
* 虽然函数声明会被提升、实际调用发生在 execute 阶段,但依赖加载顺序在打包
|
|
8
|
+
* 与不同运行时下并不完全等价,属于不该赌的隐性风险。
|
|
9
|
+
*
|
|
10
|
+
* 因此这里只放一个可变引用:registry 完成构建后注入解析器,编排层通过
|
|
11
|
+
* `resolveOperation` 取用。本文件不导入 registry,循环即被切断。
|
|
12
|
+
*/
|
|
13
|
+
let resolver = null;
|
|
14
|
+
export function setOperationResolver(fn) {
|
|
15
|
+
resolver = fn;
|
|
16
|
+
}
|
|
17
|
+
export function resolveOperation(name) {
|
|
18
|
+
if (!resolver) {
|
|
19
|
+
throw new Error(`contract operation resolver 尚未注入:${name}`);
|
|
20
|
+
}
|
|
21
|
+
return resolver(name);
|
|
22
|
+
}
|
|
@@ -11,7 +11,18 @@ import { PERFORMANCE_CATALOG, CONTRACT_SOURCES, } from '../data/performance-cata
|
|
|
11
11
|
import { contractValidationError } from '../errors.js';
|
|
12
12
|
import { requireNonEmptyString } from './shared.js';
|
|
13
13
|
const ORIGIN_PLACEHOLDER = '{baseUrl}';
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 六菜单对应的 ebdf 列表页 pageId(2026-11-10 用户确认)。
|
|
16
|
+
* catalog 的 list_id 与部署环境可能错位(「渠道订单-商务」实测不同),这里以确认值覆盖。
|
|
17
|
+
*/
|
|
18
|
+
const EBDF_LIST_PAGE_IDS = {
|
|
19
|
+
'直销合同': '881124906081886244',
|
|
20
|
+
'直销业绩': '846297265322576586',
|
|
21
|
+
'合同收款': '846297265322576589',
|
|
22
|
+
'项目验收': '846297265322576590',
|
|
23
|
+
'渠道订单': '881210951456350225',
|
|
24
|
+
'渠道订单-商务': '881211329321197671',
|
|
25
|
+
};
|
|
15
26
|
const NULL_OPS = new Set(['isNull', 'isNotNull']);
|
|
16
27
|
function catalog() {
|
|
17
28
|
return PERFORMANCE_CATALOG;
|
|
@@ -187,22 +198,62 @@ function buildQuery(menu, conditions, origin) {
|
|
|
187
198
|
warnings.push(`页面可能默认限制${defaultTime}为当年。请用户核对实际范围;要求全部年份/其他时间口径时,由用户清空默认年月再搜索。`);
|
|
188
199
|
}
|
|
189
200
|
const url = origin + route + '?' + params.map(([k, v]) => `${encodeURIComponent0(k)}=${encodeURIComponent0(v)}`).join('&');
|
|
201
|
+
const listPageId = EBDF_LIST_PAGE_IDS[menu.name] ?? menu.list_id;
|
|
202
|
+
if (!listPageId) {
|
|
203
|
+
throw contractValidationError('list_page_missing', `catalog 未记录「${menu.name}」的 ebdf 列表 pageId,无法组件化打开。`);
|
|
204
|
+
}
|
|
190
205
|
return {
|
|
191
206
|
menu: menu.name,
|
|
192
207
|
url,
|
|
193
208
|
filters,
|
|
194
209
|
needs_ui: needsUi,
|
|
195
210
|
warnings,
|
|
196
|
-
|
|
197
|
-
version: '1.0',
|
|
198
|
-
callId: 'performance-query-1',
|
|
199
|
-
toolId: 'open_web',
|
|
200
|
-
arguments: { url, title: menu.name, activate: true, width: BROWSER_WIDTH },
|
|
201
|
-
},
|
|
211
|
+
card: buildEbdfListCard(menu, origin, listPageId, filters),
|
|
202
212
|
page_verified: false,
|
|
203
213
|
execution: needsUi.length ? 'manual-page-filter' : 'filtered-link',
|
|
204
214
|
};
|
|
205
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* 六菜单统一用 ebdf 列表页组件卡打开(fill_form + e10 + sdkOptions)。
|
|
218
|
+
* 原 open_web 落在宿主工作区视图,拿不到 E10 列表组件,已废弃。
|
|
219
|
+
* comParams 键必须是 field_<字段id>,值必须是字符串;无法序列化的条件留在 needs_ui 交用户补填。
|
|
220
|
+
*/
|
|
221
|
+
function buildEbdfListCard(menu, origin, listPageId, filters) {
|
|
222
|
+
const comParams = {};
|
|
223
|
+
for (const f of filters) {
|
|
224
|
+
const key = typeof f.key === 'string' ? f.key : '';
|
|
225
|
+
const value = f.value;
|
|
226
|
+
if (!/^field_\d+$/u.test(key))
|
|
227
|
+
continue;
|
|
228
|
+
if (typeof value !== 'string' || value === '')
|
|
229
|
+
continue;
|
|
230
|
+
comParams[key] = value;
|
|
231
|
+
}
|
|
232
|
+
const now = new Date();
|
|
233
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
234
|
+
const callId = `ebdf-list-${menu.name}-${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}-01`;
|
|
235
|
+
const path = `/list/${listPageId}`;
|
|
236
|
+
return {
|
|
237
|
+
version: 1,
|
|
238
|
+
callId,
|
|
239
|
+
toolId: 'fill_form',
|
|
240
|
+
arguments: {
|
|
241
|
+
type: 'e10',
|
|
242
|
+
title: menu.name,
|
|
243
|
+
src: `${origin}/sp/ebdfpage/list/${listPageId}`,
|
|
244
|
+
sdkRenderType: 'inline',
|
|
245
|
+
sdkOptions: {
|
|
246
|
+
compName: 'ui.CorsComponent',
|
|
247
|
+
routerType: 'MemoryRouter',
|
|
248
|
+
routerProps_pc: { initialEntries: [path] },
|
|
249
|
+
routerProps_mobile: { initialEntries: [path] },
|
|
250
|
+
params_pc: { app: '@weapp/ebdfpage', compName: 'TableViewList', noMDialog: true },
|
|
251
|
+
params_mobile: { app: '@weapp/ebdfpage', compName: 'MTableViewList', noMDialog: true },
|
|
252
|
+
params: { pageId: listPageId, comParams },
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
}
|
|
206
257
|
function requireOrigin(input) {
|
|
207
258
|
const raw = String(input.origin ?? '').trim();
|
|
208
259
|
if (!raw) {
|