@skillre/dsh-plugin-work-dashboard 0.12.0 → 0.14.0
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.en.md +3 -3
- package/README.md +8 -15
- package/docs/POC-3.2-/350/277/233/345/261/225/345/245/221/347/272/246.md +21 -0
- package/docs/Super-Agent-3.2-/350/201/224/350/260/203/346/211/213/345/206/214.md +38 -0
- package/lib/client/css/detail.d.ts +1 -1
- package/lib/client/css/detail.js +4 -0
- package/lib/client/text.js +9 -13
- package/lib/client.js +89 -48
- package/lib/form.js +118 -35
- package/lib/gap.d.ts +2 -2
- package/lib/gap.js +21 -14
- package/lib/index.js +26 -13
- package/lib/progress.d.ts +8 -0
- package/lib/progress.js +20 -0
- package/lib/report-contract.d.ts +315 -0
- package/lib/report-contract.js +119 -0
- package/lib/report-form.d.ts +25 -0
- package/lib/report-form.js +90 -0
- package/lib/report-import.d.ts +9 -0
- package/lib/report-import.js +118 -0
- package/lib/report-page.d.ts +60 -0
- package/lib/report-page.js +3217 -0
- package/lib/report-style.d.ts +18 -0
- package/lib/report-style.js +412 -0
- package/lib/store.js +8 -4
- package/lib/timeline.js +7 -6
- package/lib/types.d.ts +58 -9
- package/package.json +1 -1
- package/skills/poc-export/SKILL.md +10 -125
- package/skills/poc-export/scripts/export-form.mjs +34 -69
- package/skills/poc-ledger/SKILL.md +14 -25
- package/skills/poc-submit/SKILL.md +13 -278
- package/skills/poc-submit/prepare-return.mjs +48 -0
package/lib/client.js
CHANGED
|
@@ -250,7 +250,7 @@ window.__ModuleLoader__.load({
|
|
|
250
250
|
// Milestone 3: export form
|
|
251
251
|
exportNav: "\u5BFC\u51FA\u8868\u5355",
|
|
252
252
|
exportTitle: "\u5BFC\u51FA\u7ED9\u7EC4\u5458\u586B\u5199\u7684\u8868\u5355",
|
|
253
|
-
exportSubtitle: "\u52FE\u9009\u9879\u76EE\uFF0C\u751F\u6210\u4E00\u4E2A\u81EA\u5305\u542B HTML \u6587\u4EF6\uFF1A\u53CC\u51FB\u5373\u53EF\u586B\u5199\uFF0C\u81EA\u52A8\u4FDD\u5B58\uFF0C\u5B9E\u65F6\u6821\u9A8C\u3002\u7EC4\u5458\u586B\u5B8C\u70B9\
|
|
253
|
+
exportSubtitle: "\u52FE\u9009\u9879\u76EE\uFF0C\u6BCF\u4E2A\u9879\u76EE\u751F\u6210\u4E00\u4E2A\u81EA\u5305\u542B HTML \u6587\u4EF6\uFF1A\u53CC\u51FB\u5373\u53EF\u586B\u5199\uFF0C\u81EA\u52A8\u4FDD\u5B58\uFF0C\u5B9E\u65F6\u6821\u9A8C\u3002\u7EC4\u5458\u586B\u5B8C\u70B9\u300C\u4FDD\u5B58\u300D\uFF08\u5185\u5BB9\u5199\u56DE\u8BE5\u6587\u4EF6\uFF09\uFF0C\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u56DE\u5373\u53EF\u3002",
|
|
254
254
|
exportSelectAll: "\u5168\u9009",
|
|
255
255
|
exportSelectNone: "\u6E05\u7A7A",
|
|
256
256
|
exportSelected: "\u5DF2\u9009 {count} \u4E2A\u9879\u76EE",
|
|
@@ -261,16 +261,14 @@ window.__ModuleLoader__.load({
|
|
|
261
261
|
exportIntentLabel: "\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48",
|
|
262
262
|
exportIntentNew: "\u65B0\u5EFA\u9879\u76EE",
|
|
263
263
|
exportIntentNewHint: "\u7ACB\u9879\u767B\u8BB0\uFF1A\u8EAB\u4EFD + G0 \u4E94\u5FC5\u586B",
|
|
264
|
-
exportIntentSupplement: "\u8865\u5145\u4FE1\u606F",
|
|
265
|
-
exportIntentSupplementHint: "\u53EA\u586B\u5F53\u524D\u9636\u6BB5\u8BE5\u586B\u7684\uFF0C\u5176\u4F59\u53EA\u8BFB",
|
|
266
264
|
exportIntentProgress: "\u8BB0\u5F55\u8FDB\u5C55",
|
|
267
|
-
exportIntentProgressHint: "\
|
|
268
|
-
exportNewHint: "\
|
|
265
|
+
exportIntentProgressHint: "\u5BF9\u7167\u4E0A\u8F6E\u8BA1\u5212\uFF0C\u586B\u5199\u672C\u8F6E\u8FDB\u5C55\u4E0E\u4E0B\u8F6E\u5B89\u6392",
|
|
266
|
+
exportNewHint: "\u53EA\u9700\u7ACB\u9879\u57FA\u672C\u4FE1\u606F\u548C G0 \u4E94\u9879\u4E8B\u5B9E\u3002\u5DF2\u6709\u8FDB\u5C55\u6216\u4E0B\u4E00\u6B65\u8BA1\u5212\uFF0C\u53EF\u4EE5\u9009\u586B\u3002",
|
|
269
267
|
exportStageFilterLabel: "\u6309\u9636\u6BB5\u7B5B\u9009",
|
|
270
268
|
exportStageAll: "\u5168\u90E8\u9636\u6BB5",
|
|
271
269
|
exportStageEmpty: "\u8FD9\u4E2A\u9636\u6BB5\u4E0B\u6CA1\u6709\u9879\u76EE\u3002",
|
|
272
|
-
exportHint: "\u8868\u5355\u5B8C\u5168\u79BB\u7EBF\u53EF\u7528\uFF1A\u6CA1\u6709 CDN\u3001\u6CA1\u6709\u5916\u90E8\u5B57\u4F53\u3001\u6CA1\u6709\u670D\u52A1\u5668\u3002\
|
|
273
|
-
exportGenerate: "\u751F\u6210\
|
|
270
|
+
exportHint: "\u8868\u5355\u5B8C\u5168\u79BB\u7EBF\u53EF\u7528\uFF1A\u6CA1\u6709 CDN\u3001\u6CA1\u6709\u5916\u90E8\u5B57\u4F53\u3001\u6CA1\u6709\u670D\u52A1\u5668\u3002\u6BCF\u4E2A\u9879\u76EE\u4E00\u4E2A\u6587\u4EF6\uFF1B\u7EC4\u5458\u70B9\u300C\u4FDD\u5B58\u300D\u628A\u5185\u5BB9\u5199\u56DE\u8868\u5355\u6587\u4EF6\uFF0C\u518D\u7528\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u56DE\u3002DSH \u6821\u9A8C\u540E\u51C6\u5907\u5F85\u5BA1\u53D8\u66F4\uFF0C\u4E0D\u76F4\u63A5\u5199\u53F0\u8D26\u3002",
|
|
271
|
+
exportGenerate: "\u751F\u6210\u8868\u5355\u6587\u4EF6",
|
|
274
272
|
exportGenerating: "\u6B63\u5728\u751F\u6210\u2026",
|
|
275
273
|
exportDone: "\u5DF2\u4E0B\u8F7D {name}",
|
|
276
274
|
exportSize: "{kb} KB",
|
|
@@ -846,16 +844,14 @@ window.__ModuleLoader__.load({
|
|
|
846
844
|
exportIntentLabel: "What is this for",
|
|
847
845
|
exportIntentNew: "New project",
|
|
848
846
|
exportIntentNewHint: "Registration: identity + the five G0 requirements",
|
|
849
|
-
exportIntentSupplement: "Fill in a stage",
|
|
850
|
-
exportIntentSupplementHint: "Only the current stage is editable",
|
|
851
847
|
exportIntentProgress: "Record progress",
|
|
852
|
-
exportIntentProgressHint: "
|
|
853
|
-
exportNewHint: "
|
|
848
|
+
exportIntentProgressHint: "Review the last plan and set the next one",
|
|
849
|
+
exportNewHint: "Add the project basics and five Gate 0 facts. The first progress round or action plan is optional.",
|
|
854
850
|
exportStageFilterLabel: "Filter by stage",
|
|
855
851
|
exportStageAll: "All stages",
|
|
856
852
|
exportStageEmpty: "No projects at this stage.",
|
|
857
|
-
exportHint: "The form works fully offline: no CDN, no external fonts, no server.
|
|
858
|
-
exportGenerate: "Generate
|
|
853
|
+
exportHint: "The form works fully offline: no CDN, no external fonts, no server. One file per project: the colleague saves answers back into the same form file and sends it back. DSH validates it and prepares a change for review.",
|
|
854
|
+
exportGenerate: "Generate form files",
|
|
859
855
|
exportGenerating: "Generating\u2026",
|
|
860
856
|
exportDone: "Downloaded {name}",
|
|
861
857
|
exportSize: "{kb} KB",
|
|
@@ -1417,6 +1413,27 @@ window.__ModuleLoader__.load({
|
|
|
1417
1413
|
return project.stage ?? "unknown";
|
|
1418
1414
|
}
|
|
1419
1415
|
|
|
1416
|
+
// src/progress.ts
|
|
1417
|
+
var clean = (value) => typeof value === "string" ? value.trim() : "";
|
|
1418
|
+
function canReportProgress(stage, status) {
|
|
1419
|
+
return clean(stage).toLowerCase() !== "closed" && !["\u5DF2\u5173\u95ED", "\u5DF2\u53D6\u6D88"].includes(clean(status));
|
|
1420
|
+
}
|
|
1421
|
+
function scenarioRoundViews(view, scenarioId) {
|
|
1422
|
+
if (!view.lines) return view.scenarioIds.includes(scenarioId) ? [view] : [];
|
|
1423
|
+
return view.lines.filter((line) => line.scenario_ids?.includes(scenarioId)).map((line) => ({
|
|
1424
|
+
...view,
|
|
1425
|
+
goal: clean(line.title),
|
|
1426
|
+
actual: clean(line.actual),
|
|
1427
|
+
completion: clean(line.completion),
|
|
1428
|
+
scenarioIds: line.scenario_ids ?? [],
|
|
1429
|
+
criteriaIds: line.criteria_ids ?? [],
|
|
1430
|
+
evidence: (line.evidence ?? []).map((item) => ({ title: clean(item.title), link: clean(item.link), type: clean(item.type) })),
|
|
1431
|
+
customer: { syncedWith: clean(line.customer?.synced_with), feedback: clean(line.customer?.feedback), recognition: clean(line.review?.recognition) },
|
|
1432
|
+
gate3_1: clean(line.review?.gate3_1),
|
|
1433
|
+
gate3_2: clean(line.review?.gate3_2)
|
|
1434
|
+
}));
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1420
1437
|
// src/client/detail.tsx
|
|
1421
1438
|
var import_react2 = require("react");
|
|
1422
1439
|
|
|
@@ -4236,7 +4253,29 @@ window.__ModuleLoader__.load({
|
|
|
4236
4253
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "prog-meter-value", children: entry.completion })
|
|
4237
4254
|
] })
|
|
4238
4255
|
] }),
|
|
4239
|
-
entry.
|
|
4256
|
+
entry.lines === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "prog-actual-line", "data-empty": entry.actual === "", children: entry.actual || t("emptyField") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
4257
|
+
entry.lines.map((line, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dt-round-line", children: [
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: line.title }),
|
|
4259
|
+
" \xB7 ",
|
|
4260
|
+
line.status,
|
|
4261
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "prose", children: line.actual }),
|
|
4262
|
+
line.customer?.feedback ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "prose", children: [
|
|
4263
|
+
t("dtScenarioCustomer"),
|
|
4264
|
+
"\uFF1A",
|
|
4265
|
+
line.customer.feedback
|
|
4266
|
+
] }) : null,
|
|
4267
|
+
line.evidence?.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "prose", children: [
|
|
4268
|
+
t("dtScenarioEvidence"),
|
|
4269
|
+
"\uFF1A",
|
|
4270
|
+
line.evidence.map((e) => e.title).filter(Boolean).join(" \xB7 ")
|
|
4271
|
+
] }) : null
|
|
4272
|
+
] }, line.plan_id ?? itemIndex)),
|
|
4273
|
+
entry.stageNotes?.map((note) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "dt-round-line prose", children: [
|
|
4274
|
+
note.stage,
|
|
4275
|
+
" \xB7 ",
|
|
4276
|
+
note.text
|
|
4277
|
+
] }, note.stage))
|
|
4278
|
+
] }),
|
|
4240
4279
|
entry.scenarioIds.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "chip-row prog-scope-row", children: entry.scenarioIds.map((id, itemIndex) => {
|
|
4241
4280
|
const linked = scenarioNameOf(detail, id);
|
|
4242
4281
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "chip", children: linked === "" ? id : linked }, `${id}:${itemIndex}`);
|
|
@@ -4300,7 +4339,7 @@ window.__ModuleLoader__.load({
|
|
|
4300
4339
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Section, { title: t("dtScenarioTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Blank, { text: t("dtScenarioNotFound") }) });
|
|
4301
4340
|
}
|
|
4302
4341
|
const tone = scenarioTone(scenario.status);
|
|
4303
|
-
const entries = detail.progress.
|
|
4342
|
+
const entries = detail.progress.flatMap((entry) => scenarioRoundViews(entry, scenarioId)).sort((left, right) => right.date === left.date ? (right.seq ?? 0) - (left.seq ?? 0) : right.date.localeCompare(left.date));
|
|
4304
4343
|
const evidence = entries.flatMap((entry) => entry.evidence.map((item) => ({ ...item, date: entry.date })));
|
|
4305
4344
|
const latestWithCustomer = entries.find((entry) => entry.customer.syncedWith !== "" || entry.customer.feedback !== "" || entry.customer.recognition !== "");
|
|
4306
4345
|
const latest = entries[0];
|
|
@@ -4326,7 +4365,7 @@ window.__ModuleLoader__.load({
|
|
|
4326
4365
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-evidence-type", children: item.type === "" ? t("dtUnset") : item.type }),
|
|
4327
4366
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-evidence-title", children: item.title === "" ? t("emptyField") : item.title }),
|
|
4328
4367
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-evidence-date", children: item.date }),
|
|
4329
|
-
item.link
|
|
4368
|
+
!/^(https?):\/\//i.test(item.link) ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { className: "sd-evidence-link", href: item.link, target: "_blank", rel: "noreferrer noopener", children: t("dtPlanScenarioDetail") })
|
|
4330
4369
|
] }, `${item.title}:${index}`)) })
|
|
4331
4370
|
] }),
|
|
4332
4371
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "plan-block", children: [
|
|
@@ -4366,7 +4405,7 @@ window.__ModuleLoader__.load({
|
|
|
4366
4405
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { className: "plan-block-title", children: t("dtScenarioLinked") }),
|
|
4367
4406
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "plan-block-note", children: format(t("dtProgressCountLabel"), { count: entries.length }) })
|
|
4368
4407
|
] }),
|
|
4369
|
-
entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Blank, { text: t("dtScenarioLinkedNone") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "sd-linked", children: entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { className: "sd-linked-row", children: [
|
|
4408
|
+
entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Blank, { text: t("dtScenarioLinkedNone") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "sd-linked", children: entries.map((entry, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { className: "sd-linked-row", children: [
|
|
4370
4409
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-linked-date", children: entry.date }),
|
|
4371
4410
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "sd-linked-seq", children: [
|
|
4372
4411
|
"#",
|
|
@@ -4374,7 +4413,7 @@ window.__ModuleLoader__.load({
|
|
|
4374
4413
|
] }),
|
|
4375
4414
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-linked-change", children: entry.change === "" ? t("dtUnset") : entry.change }),
|
|
4376
4415
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sd-linked-actual", children: entry.actual === "" ? t("emptyField") : entry.actual })
|
|
4377
|
-
] }, entry.seq ?? entry.date)) })
|
|
4416
|
+
] }, `${entry.seq ?? entry.date}:${itemIndex}`)) })
|
|
4378
4417
|
] })
|
|
4379
4418
|
] });
|
|
4380
4419
|
}
|
|
@@ -4533,7 +4572,8 @@ window.__ModuleLoader__.load({
|
|
|
4533
4572
|
}
|
|
4534
4573
|
function NextActionsPanel({ detail, t }) {
|
|
4535
4574
|
const outcome = detail.outcome;
|
|
4536
|
-
const
|
|
4575
|
+
const latest = detail.progress.at(-1);
|
|
4576
|
+
const plans = latest?.nextPlans ?? (latest && (latest.next.goal || latest.next.owner || latest.next.deadline) ? [latest.next] : []);
|
|
4537
4577
|
const rows = [];
|
|
4538
4578
|
if (outcome.milestone !== "" || outcome.businessOwner !== "" || outcome.businessDeadline !== "") {
|
|
4539
4579
|
rows.push({
|
|
@@ -4544,15 +4584,7 @@ window.__ModuleLoader__.load({
|
|
|
4544
4584
|
tone: outcome.businessStatus === "\u5DF2\u8FDB\u5165\u4E0B\u4E00\u91CC\u7A0B\u7891" ? "green" : outcome.businessStatus === "" ? "slate" : "amber"
|
|
4545
4585
|
});
|
|
4546
4586
|
}
|
|
4547
|
-
|
|
4548
|
-
rows.push({
|
|
4549
|
-
goal: newestNext.next.goal,
|
|
4550
|
-
owner: newestNext.next.owner,
|
|
4551
|
-
deadline: newestNext.next.deadline,
|
|
4552
|
-
status: t("dtStatusNotStarted"),
|
|
4553
|
-
tone: "slate"
|
|
4554
|
-
});
|
|
4555
|
-
}
|
|
4587
|
+
for (const plan of plans) rows.push({ ...plan, status: t("dtStatusNotStarted"), tone: "slate" });
|
|
4556
4588
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Section, { title: t("dtNextActionsTitle"), kicker: t("dtNextActionsKicker"), children: rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Blank, { text: t("dtNextActionsNone") }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("table", { className: "next-table", children: [
|
|
4557
4589
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { children: [
|
|
4558
4590
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { children: t("dtNextGoal") }),
|
|
@@ -4611,27 +4643,27 @@ window.__ModuleLoader__.load({
|
|
|
4611
4643
|
{ key: "G1", label: "G1" },
|
|
4612
4644
|
{ key: "G2", label: "G2" },
|
|
4613
4645
|
{ key: "G3", label: "G3" },
|
|
4614
|
-
{ key: "G4", label: "G4" }
|
|
4615
|
-
{ key: "closed", label: "\u5DF2\u7ED3\u675F" }
|
|
4646
|
+
{ key: "G4", label: "G4" }
|
|
4616
4647
|
];
|
|
4617
4648
|
function ExportFormDialog({ api, projects, t, onClose, onError }) {
|
|
4618
4649
|
const rows = (0, import_react3.useMemo)(
|
|
4619
|
-
() => projects.map((project) => ({
|
|
4650
|
+
() => projects.filter((project) => !project.closed && canReportProgress(project.stageLabel, project.status)).map((project) => ({
|
|
4620
4651
|
pocId: project.pocId,
|
|
4621
4652
|
name: project.name,
|
|
4622
4653
|
company: project.company,
|
|
4623
4654
|
stage: project.stageLabel,
|
|
4624
|
-
stageKey: project.
|
|
4655
|
+
stageKey: project.stage ?? "unknown"
|
|
4625
4656
|
})),
|
|
4626
4657
|
[projects]
|
|
4627
4658
|
);
|
|
4628
|
-
const [intent, setIntent] = (0, import_react3.useState)("
|
|
4659
|
+
const [intent, setIntent] = (0, import_react3.useState)("progress");
|
|
4629
4660
|
const [stageFilter, setStageFilter] = (0, import_react3.useState)(null);
|
|
4630
4661
|
const visibleRows = (0, import_react3.useMemo)(
|
|
4631
4662
|
() => stageFilter === null ? rows : rows.filter((row) => row.stageKey === stageFilter),
|
|
4632
4663
|
[rows, stageFilter]
|
|
4633
4664
|
);
|
|
4634
|
-
const [selected, setSelected] = (0, import_react3.useState)(() => new Set(rows.
|
|
4665
|
+
const [selected, setSelected] = (0, import_react3.useState)(() => new Set(rows.length === 1 ? [rows[0].pocId] : []));
|
|
4666
|
+
const selectedIds = visibleRows.filter((row) => selected.has(row.pocId)).map((row) => row.pocId);
|
|
4635
4667
|
const [busy, setBusy] = (0, import_react3.useState)(false);
|
|
4636
4668
|
const toggle = (pocId) => {
|
|
4637
4669
|
setSelected((current) => {
|
|
@@ -4644,19 +4676,25 @@ window.__ModuleLoader__.load({
|
|
|
4644
4676
|
const selectAll = () => setSelected(new Set(visibleRows.map((row) => row.pocId)));
|
|
4645
4677
|
const selectNone = () => setSelected(/* @__PURE__ */ new Set());
|
|
4646
4678
|
const generate = async () => {
|
|
4679
|
+
if (intent === "progress" && selectedIds.length === 0) return;
|
|
4647
4680
|
setBusy(true);
|
|
4648
4681
|
try {
|
|
4649
4682
|
const mode = intent === "new" ? "blank" : "fill";
|
|
4650
|
-
const result = await api.exportForm(mode, mode === "blank" ? [] :
|
|
4651
|
-
const
|
|
4652
|
-
|
|
4653
|
-
const
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4683
|
+
const result = await api.exportForm(mode, mode === "blank" ? [] : selectedIds, intent);
|
|
4684
|
+
const files = Array.isArray(result.files) ? result.files : [];
|
|
4685
|
+
if (files.length === 0) throw new Error(t("exportFailed"));
|
|
4686
|
+
for (const [index, file] of files.entries()) {
|
|
4687
|
+
if (index > 0) await new Promise((resolve) => setTimeout(resolve, 350));
|
|
4688
|
+
const blob = new Blob([file.html], { type: "text/html;charset=utf-8" });
|
|
4689
|
+
const url = URL.createObjectURL(blob);
|
|
4690
|
+
const anchor = document.createElement("a");
|
|
4691
|
+
anchor.href = url;
|
|
4692
|
+
anchor.download = file.fileName;
|
|
4693
|
+
document.body.appendChild(anchor);
|
|
4694
|
+
anchor.click();
|
|
4695
|
+
anchor.remove();
|
|
4696
|
+
setTimeout(() => URL.revokeObjectURL(url), 4e3);
|
|
4697
|
+
}
|
|
4660
4698
|
onClose();
|
|
4661
4699
|
} catch (error) {
|
|
4662
4700
|
onError(error instanceof Error ? error.message : t("exportFailed"));
|
|
@@ -4688,7 +4726,6 @@ window.__ModuleLoader__.load({
|
|
|
4688
4726
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportSubtitle") }),
|
|
4689
4727
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "export-intent", role: "group", "aria-label": t("exportIntentLabel"), children: [
|
|
4690
4728
|
{ key: "new", label: t("exportIntentNew"), hint: t("exportIntentNewHint") },
|
|
4691
|
-
{ key: "supplement", label: t("exportIntentSupplement"), hint: t("exportIntentSupplementHint") },
|
|
4692
4729
|
{ key: "progress", label: t("exportIntentProgress"), hint: t("exportIntentProgressHint") }
|
|
4693
4730
|
].map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4694
4731
|
"button",
|
|
@@ -4742,7 +4779,7 @@ window.__ModuleLoader__.load({
|
|
|
4742
4779
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "export-toolbar", children: [
|
|
4743
4780
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "btn btn-small", onClick: selectAll, disabled: busy, children: t("exportSelectAll") }),
|
|
4744
4781
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "btn btn-small", onClick: selectNone, disabled: busy, children: t("exportSelectNone") }),
|
|
4745
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-count", children: format(t("exportSelected"), { count:
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-count", children: format(t("exportSelected"), { count: selectedIds.length }) })
|
|
4746
4783
|
] })
|
|
4747
4784
|
] }),
|
|
4748
4785
|
intent !== "new" && (rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportNoProjects") }) : visibleRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportStageEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "export-list", children: visibleRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "export-row", "data-selected": selected.has(row.pocId), children: [
|
|
@@ -4764,7 +4801,7 @@ window.__ModuleLoader__.load({
|
|
|
4764
4801
|
] })
|
|
4765
4802
|
] })
|
|
4766
4803
|
] }) }, row.pocId)) })),
|
|
4767
|
-
intent === "new" ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "helper-box", children:
|
|
4804
|
+
intent === "new" ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "helper-box", children: selectedIds.length === 0 ? t("exportBlankHint") : t("exportHint") })
|
|
4768
4805
|
] }),
|
|
4769
4806
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "modal-footer", children: [
|
|
4770
4807
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "spacer" }),
|
|
@@ -4777,7 +4814,7 @@ window.__ModuleLoader__.load({
|
|
|
4777
4814
|
onClick: () => {
|
|
4778
4815
|
void generate();
|
|
4779
4816
|
},
|
|
4780
|
-
disabled: busy || intent !== "new" &&
|
|
4817
|
+
disabled: busy || intent !== "new" && selectedIds.length === 0,
|
|
4781
4818
|
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
4782
4819
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "spinner" }),
|
|
4783
4820
|
" ",
|
|
@@ -6659,6 +6696,10 @@ window.__ModuleLoader__.load({
|
|
|
6659
6696
|
}
|
|
6660
6697
|
.wd-shell .dt-body { display: flex; flex-direction: column; gap: 18px; }
|
|
6661
6698
|
|
|
6699
|
+
/* ---------- structured round items ---------- */
|
|
6700
|
+
.wd-shell .dt-round-line { margin: 8px 0; padding: 6px 0; border-top: 1px solid var(--wd-hairline); overflow-wrap: anywhere; }
|
|
6701
|
+
.wd-shell .dt-round-line .prose { margin: 4px 0 0; }
|
|
6702
|
+
|
|
6662
6703
|
/* ---------- banner ---------- */
|
|
6663
6704
|
.wd-shell .dt-header {
|
|
6664
6705
|
display: grid;
|
package/lib/form.js
CHANGED
|
@@ -269,7 +269,11 @@ export function blankProgress(existingCount) {
|
|
|
269
269
|
criteriaIds: [],
|
|
270
270
|
actual: '',
|
|
271
271
|
completion: '',
|
|
272
|
-
evidence
|
|
272
|
+
// One empty row, so the required evidence field has an obvious place to type
|
|
273
|
+
// instead of presenting only a "+ 加一条证据" button. `progressIsEmpty` still
|
|
274
|
+
// treats an all-blank list as "the colleague recorded nothing", so this does
|
|
275
|
+
// not by itself make a round look filled in.
|
|
276
|
+
evidence: [{ title: '', link: '', type: '' }],
|
|
273
277
|
customer: { synced_with: '', feedback: '', recognition: '' },
|
|
274
278
|
gate3_1: '',
|
|
275
279
|
gate3_2: '',
|
|
@@ -471,7 +475,10 @@ function orNull(value) {
|
|
|
471
475
|
* them from.
|
|
472
476
|
*/
|
|
473
477
|
const CHANGE_SCOPE = {
|
|
474
|
-
new
|
|
478
|
+
// `progress` is listed for `new` because the new-project form offers an
|
|
479
|
+
// OPTIONAL first round. Optional means "sent only if the colleague filled it",
|
|
480
|
+
// which `progressIsEmpty` already enforces; it is not a required field.
|
|
481
|
+
new: ['identity', 'gate0', 'progress'],
|
|
475
482
|
// `supplement` resolves per project against its stage, so the union is allowed
|
|
476
483
|
// here and narrowed by `resolveSections` at emit time.
|
|
477
484
|
supplement: ['identity', 'gate0', 'plan', 'gate12', 'progress', 'outcome'],
|
|
@@ -1147,6 +1154,15 @@ body{
|
|
|
1147
1154
|
border-radius:8px;background:var(--surface);border:1px solid var(--border);
|
|
1148
1155
|
}
|
|
1149
1156
|
.row-card-head{display:flex;align-items:center;gap:8px}
|
|
1157
|
+
/* An evidence row is [title][link][delete] on one line. On a phone that leaves
|
|
1158
|
+
* the title input about 60px wide, which truncates the placeholder mid-word, so
|
|
1159
|
+
* the row stacks and the delete button moves to its own shorter line. */
|
|
1160
|
+
@media(max-width:560px){
|
|
1161
|
+
.row-card-head{flex-wrap:wrap}
|
|
1162
|
+
.row-card-head>.input:first-child{flex:1 1 100%}
|
|
1163
|
+
.row-card-head>.input{flex:1 1 calc(100% - 64px)}
|
|
1164
|
+
.row-card-head>.btn-remove{margin-left:auto}
|
|
1165
|
+
}
|
|
1150
1166
|
.row-card-id{
|
|
1151
1167
|
flex:none;font-family:var(--mono);font-size:9px;line-height:13px;
|
|
1152
1168
|
color:var(--text-3);background:var(--inset);border:1px solid var(--border);
|
|
@@ -1174,6 +1190,18 @@ body{
|
|
|
1174
1190
|
.textarea{min-height:60px;resize:vertical}
|
|
1175
1191
|
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
|
|
1176
1192
|
@media(max-width:720px){.grid-2{grid-template-columns:minmax(0,1fr)}}
|
|
1193
|
+
/* Three-up row for the round's three compulsory facts: date, type, what moved.
|
|
1194
|
+
* They belong on one line so the progress receipt reads as one screen. */
|
|
1195
|
+
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}
|
|
1196
|
+
@media(max-width:900px){.grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
|
1197
|
+
@media(max-width:560px){.grid-3{grid-template-columns:minmax(0,1fr)}}
|
|
1198
|
+
/* An optional block: collapsed by default, visually lighter than a subject
|
|
1199
|
+
* section, so it cannot be mistaken for something that must be filled. */
|
|
1200
|
+
.optional-block{margin-top:14px}
|
|
1201
|
+
.optional-block>summary{font-weight:650;color:var(--text-2)}
|
|
1202
|
+
.extras{margin-top:12px}
|
|
1203
|
+
.extras>summary{font-size:10.5px}
|
|
1204
|
+
.extras[open]>summary{margin-bottom:8px}
|
|
1177
1205
|
.field.has-error .input,.field.has-error .textarea,.field.has-error .select{border-color:var(--red)}
|
|
1178
1206
|
.field-error{color:var(--red);font-size:10px;display:none}
|
|
1179
1207
|
.field.has-error .field-error{display:block}
|
|
@@ -1567,7 +1595,17 @@ const FORM_SCRIPT = `
|
|
|
1567
1595
|
input = '<textarea class="textarea' + (locked ? ' is-locked' : '') + '"' + pathAttr + lockAttr + '>' + escapeHtml(value) + '</textarea>';
|
|
1568
1596
|
} else if (opts.enum) {
|
|
1569
1597
|
input = '<select class="select' + (locked ? ' is-locked' : '') + '"' + pathAttr + lockAttr + '>';
|
|
1570
|
-
|
|
1598
|
+
// ALWAYS offer an explicit "not answered" choice on an EDITABLE select.
|
|
1599
|
+
//
|
|
1600
|
+
// This line once read 'if (locked && value === '')', which meant no
|
|
1601
|
+
// editable enum had an empty option. The browser then selects option[0]
|
|
1602
|
+
// by default, so a colleague who touched nothing still submitted
|
|
1603
|
+
// type=内部Review, change=阶段推进, completion=0%, recognition=认可,
|
|
1604
|
+
// gate3_1=可证明, gate3_2=已确认 — and, on the new-project form,
|
|
1605
|
+
// gate0 评审结论=通过. Those are audit verdicts; the form was signing
|
|
1606
|
+
// them for the colleague. A locked field is different: its value comes
|
|
1607
|
+
// from the ledger, so it must show that value rather than an empty one.
|
|
1608
|
+
if (!locked || value === '') input += '<option value="">— 未填 —</option>';
|
|
1571
1609
|
for (var i = 0; i < opts.enum.length; i += 1) {
|
|
1572
1610
|
var option = opts.enum[i];
|
|
1573
1611
|
input += '<option value="' + escapeHtml(option) + '"' + (option === value ? ' selected' : '') + '>' + escapeHtml(option) + '</option>';
|
|
@@ -1625,16 +1663,18 @@ const FORM_SCRIPT = `
|
|
|
1625
1663
|
'</div>';
|
|
1626
1664
|
|
|
1627
1665
|
var tone = present === 5 ? 'badge-ok' : present === 0 ? 'badge-warn' : 'badge-info';
|
|
1666
|
+
// 评审结论 / 评审人 / 评审日期 are NOT here on purpose. They are the G0
|
|
1667
|
+
// review's output, and the form once offered them to the colleague being
|
|
1668
|
+
// asked to supply facts — so a form could arrive claiming "评审通过, 评审人 X"
|
|
1669
|
+
// written by the person under review. The review is recorded through DSH,
|
|
1670
|
+
// not through this file.
|
|
1628
1671
|
return '<section class="sec">' +
|
|
1629
1672
|
'<header class="sec-head"><h2 class="sec-title">Gate 0 · 值不值得做</h2>' +
|
|
1630
1673
|
'<span class="sec-kicker">五必填 <span class="badge ' + tone + '">' + present + ' / 5</span></span></header>' +
|
|
1631
|
-
'<p class="sec-hint">这五项齐了,G0
|
|
1674
|
+
'<p class="sec-hint">这五项齐了,G0 评审才有意义。评审结论不在这里填。</p>' +
|
|
1632
1675
|
'<div class="g0-grid">' + cards + '</div>' +
|
|
1633
1676
|
'<div class="grid-2">' +
|
|
1634
1677
|
field('主要竞争对手', 'gate0.competitor', project.gate0.competitor, {}) +
|
|
1635
|
-
field('G0 评审结论', 'gate0.conclusion', project.gate0.conclusion, { enum: DATA.enums.g0Conclusion }) +
|
|
1636
|
-
field('G0 评审人', 'gate0.reviewer', project.gate0.reviewer, {}) +
|
|
1637
|
-
field('评审日期', 'gate0.reviewed_at', project.gate0.reviewed_at, { date: true }) +
|
|
1638
1678
|
'</div></section>';
|
|
1639
1679
|
}
|
|
1640
1680
|
|
|
@@ -1784,7 +1824,7 @@ const FORM_SCRIPT = `
|
|
|
1784
1824
|
// A G0 project has no plan yet by design, so this is normal, not a gap.
|
|
1785
1825
|
return '<div class="field"><label class="field-label">' + escapeHtml(label) + '</label>' +
|
|
1786
1826
|
'<p class="field-help">' + escapeHtml(hint) + '</p>' +
|
|
1787
|
-
'<p class="pick-empty"
|
|
1827
|
+
'<p class="pick-empty">这个项目还没有可选的内容(方案里还没填),先跳过这一项。</p></div>';
|
|
1788
1828
|
}
|
|
1789
1829
|
var chosen = {};
|
|
1790
1830
|
for (var i = 0; i < selected.length; i += 1) chosen[text(selected[i])] = true;
|
|
@@ -1803,6 +1843,27 @@ const FORM_SCRIPT = `
|
|
|
1803
1843
|
'<div class="pick-list">' + boxes + '</div></div>';
|
|
1804
1844
|
}
|
|
1805
1845
|
|
|
1846
|
+
/**
|
|
1847
|
+
* One round of progress — the form's primary job.
|
|
1848
|
+
*
|
|
1849
|
+
* ## Fact-only, deliberately
|
|
1850
|
+
*
|
|
1851
|
+
* A round used to also ask for 客户认可度, G3-1 and G3-2. Those are not facts a
|
|
1852
|
+
* colleague observes; they are the ledger's verdicts, and 'tools/derive.mjs'
|
|
1853
|
+
* consumes them to work out scenario and criterion status. Letting the person
|
|
1854
|
+
* filling the form set them meant self-certification: every round could arrive
|
|
1855
|
+
* already marked 可证明 + 已确认 without anyone having confirmed anything.
|
|
1856
|
+
*
|
|
1857
|
+
* They are removed from the form. DSH derives them on merge (see the
|
|
1858
|
+
* poc-submit skill) from what IS collected here: evidence, the customer's own
|
|
1859
|
+
* words, and what was actually done. Super Agent audits afterwards.
|
|
1860
|
+
*
|
|
1861
|
+
* ## Why this is short
|
|
1862
|
+
*
|
|
1863
|
+
* The intended use is "one round, one screen". So the required facts come
|
|
1864
|
+
* first, and the optional ones live in a collapsed block — a colleague filing
|
|
1865
|
+
* a weekly update should not have to scroll past fields they rarely touch.
|
|
1866
|
+
*/
|
|
1806
1867
|
function progressCard(project) {
|
|
1807
1868
|
var entry = project.progress;
|
|
1808
1869
|
var evidenceRows = '';
|
|
@@ -1814,34 +1875,41 @@ const FORM_SCRIPT = `
|
|
|
1814
1875
|
'</div></div>';
|
|
1815
1876
|
}
|
|
1816
1877
|
var countBadge = project.existingProgressCount > 0
|
|
1817
|
-
? '<span class="badge badge-info"
|
|
1818
|
-
: '<span class="badge badge-warn"
|
|
1878
|
+
? '<span class="badge badge-info">第 ' + (project.existingProgressCount + 1) + ' 条</span>'
|
|
1879
|
+
: '<span class="badge badge-warn">第一条</span>';
|
|
1880
|
+
|
|
1881
|
+
// Optional extras are collapsed by default: they exist, but they must not
|
|
1882
|
+
// stand between the colleague and the three fields that actually matter.
|
|
1883
|
+
var extras =
|
|
1884
|
+
'<details class="read-context extras"><summary>可选:完成度 / 目标 / 关联场景与指标</summary>' +
|
|
1885
|
+
'<div class="grid-2">' +
|
|
1886
|
+
field('完成度', 'progress.completion', entry.completion, { enum: DATA.enums.completion }) +
|
|
1887
|
+
field('这一轮的目标', 'progress.goal', entry.goal, {}) +
|
|
1888
|
+
'</div>' +
|
|
1889
|
+
idPicker('推进了哪些场景', 'progress.scenarioIds', null, project.plan.scenarios, entry.scenarioIds,
|
|
1890
|
+
'勾选这一轮实际验证过的场景。') +
|
|
1891
|
+
idPicker('验证了哪些指标', 'progress.criteriaIds', null, project.plan.criteria, entry.criteriaIds,
|
|
1892
|
+
'与场景相互独立:一条指标可以被验证而没有推进任何场景。') +
|
|
1893
|
+
'</details>';
|
|
1894
|
+
|
|
1819
1895
|
return '<section class="sec">' +
|
|
1820
1896
|
'<header class="sec-head"><h2 class="sec-title">这一轮进展</h2>' +
|
|
1821
1897
|
'<span class="sec-kicker">' + countBadge + '</span></header>' +
|
|
1822
|
-
'<p class="sec-hint"
|
|
1823
|
-
'<div class="grid-
|
|
1898
|
+
'<p class="sec-hint">只填这次真正发生的事。追加式,不会覆盖历史。</p>' +
|
|
1899
|
+
'<div class="grid-3">' +
|
|
1824
1900
|
field('日期', 'progress.date', entry.date, { date: true, required: true }) +
|
|
1825
1901
|
field('类型', 'progress.type', entry.type, { enum: DATA.enums.progressType, required: true }) +
|
|
1826
|
-
field('这一次什么变了', 'progress.change', entry.change, { enum: DATA.enums.progressChange, required: true, help: '
|
|
1827
|
-
field('完成度', 'progress.completion', entry.completion, { enum: DATA.enums.completion }) +
|
|
1902
|
+
field('这一次什么变了', 'progress.change', entry.change, { enum: DATA.enums.progressChange, required: true, help: '「无实质进展」也是正当答案。' }) +
|
|
1828
1903
|
'</div>' +
|
|
1829
|
-
field('
|
|
1830
|
-
field('实际结果', 'progress.actual', entry.actual, { multiline: true, required: true, help: '做了什么、结果如何。没有证据的结果会被缺口规则点名。' }) +
|
|
1831
|
-
idPicker('这一轮推进了哪些场景', 'progress.scenarioIds', null, project.plan.scenarios, entry.scenarioIds,
|
|
1832
|
-
'勾选这一轮实际验证过的场景。场景状态(已证明 / 待客户确认 / 无证据)由这里的勾选加上证据推导出来。') +
|
|
1833
|
-
idPicker('这一轮验证了哪些指标', 'progress.criteriaIds', null, project.plan.criteria, entry.criteriaIds,
|
|
1834
|
-
'与场景相互独立:一条指标可以被验证而没有推进任何场景。') +
|
|
1904
|
+
field('实际结果', 'progress.actual', entry.actual, { multiline: true, required: true, help: '做了什么、结果如何。' }) +
|
|
1835
1905
|
'<div class="field"><label class="field-label">证据<span class="req">*</span></label>' +
|
|
1836
|
-
'<p class="field-help"
|
|
1906
|
+
'<p class="field-help">没有证据的结果会被缺口规则点名。</p>' + evidenceRows +
|
|
1837
1907
|
'<button type="button" class="btn btn-sm" data-add="evidence">+ 加一条证据</button></div>' +
|
|
1838
1908
|
'<div class="grid-2">' +
|
|
1839
1909
|
field('同步对象', 'progress.customer.synced_with', entry.customer.synced_with, {}) +
|
|
1840
|
-
field('
|
|
1841
|
-
field('G3-1', 'progress.gate3_1', entry.gate3_1, { enum: DATA.enums.gate3_1 }) +
|
|
1842
|
-
field('G3-2', 'progress.gate3_2', entry.gate3_2, { enum: DATA.enums.gate3_2 }) +
|
|
1910
|
+
field('客户原话 / 反馈', 'progress.customer.feedback', entry.customer.feedback, { multiline: true, help: '照原样记,不要替他判断认可不认可。' }) +
|
|
1843
1911
|
'</div>' +
|
|
1844
|
-
|
|
1912
|
+
extras +
|
|
1845
1913
|
'</section>';
|
|
1846
1914
|
}
|
|
1847
1915
|
|
|
@@ -1850,7 +1918,7 @@ const FORM_SCRIPT = `
|
|
|
1850
1918
|
var next = project.progress.next;
|
|
1851
1919
|
return '<section class="sec">' +
|
|
1852
1920
|
'<header class="sec-head"><h2 class="sec-title">下一步工作目标及计划</h2>' +
|
|
1853
|
-
'
|
|
1921
|
+
'</header>' +
|
|
1854
1922
|
'<div class="grid-2">' +
|
|
1855
1923
|
field('下一步目标', 'progress.next.goal', next.goal, { multiline: true, required: true }) +
|
|
1856
1924
|
field('负责人', 'progress.next.owner', next.owner, {}) +
|
|
@@ -1862,7 +1930,7 @@ const FORM_SCRIPT = `
|
|
|
1862
1930
|
function identityCard(project) {
|
|
1863
1931
|
return '<section class="sec">' +
|
|
1864
1932
|
'<header class="sec-head"><h2 class="sec-title">基本信息</h2></header>' +
|
|
1865
|
-
'<p class="sec-hint"
|
|
1933
|
+
'<p class="sec-hint">编号、阶段、状态由台账维护,这里只读。</p>' +
|
|
1866
1934
|
'<div class="grid-2">' +
|
|
1867
1935
|
field('项目编号', 'pocId', project.pocId, { required: DATA.mode === 'blank', readonly: DATA.mode !== 'blank', help: DATA.mode === 'blank' ? '新建时必填,格式 POC-XXX。' : '台账主键,不可改。' }) +
|
|
1868
1936
|
field('项目名称', 'name', project.name, { required: true }) +
|
|
@@ -2040,19 +2108,20 @@ const FORM_SCRIPT = `
|
|
|
2040
2108
|
var canEdit = {};
|
|
2041
2109
|
for (var e = 0; e < plan_.editable.length; e += 1) canEdit[plan_.editable[e]] = true;
|
|
2042
2110
|
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
//
|
|
2046
|
-
//
|
|
2047
|
-
//
|
|
2111
|
+
// 'progress' intent is the one-screen case: what has already been reported,
|
|
2112
|
+
// then this round. Deliberately NO snapshot strip and no "what is missing"
|
|
2113
|
+
// banner here — on a single-round receipt, five fact cells and a "Gate 0 还缺
|
|
2114
|
+
// 2 项" nag are noise that push the actual fields down the page. The banner
|
|
2115
|
+
// above already carries stage, status and owner.
|
|
2048
2116
|
if (DATA.intent === 'progress') {
|
|
2049
|
-
|
|
2050
|
-
byId('formBody').innerHTML = body;
|
|
2117
|
+
byId('formBody').innerHTML = banner + historyCard(project) + progressCard(project) + nextCard(project);
|
|
2051
2118
|
bindSwitch();
|
|
2052
2119
|
markFooter();
|
|
2053
2120
|
return;
|
|
2054
2121
|
}
|
|
2055
2122
|
|
|
2123
|
+
var body = banner + snapshotCard(project) + missingCard(project, canEdit);
|
|
2124
|
+
|
|
2056
2125
|
var left = '';
|
|
2057
2126
|
if (canEdit.gate0) left += g0Card(project); else left += contextGate0(project);
|
|
2058
2127
|
|
|
@@ -2083,7 +2152,17 @@ const FORM_SCRIPT = `
|
|
|
2083
2152
|
// History sits immediately above the new round: read what happened, then say
|
|
2084
2153
|
// what changed. A new project has no history, so the block is simply absent.
|
|
2085
2154
|
body += historyCard(project);
|
|
2086
|
-
|
|
2155
|
+
// On a NEW project the round is optional. A project that has just been
|
|
2156
|
+
// registered may have nothing to report yet, and making this block required
|
|
2157
|
+
// was what pushed the new-project form to roughly 2000px. Collapsed, so it
|
|
2158
|
+
// cannot read as another mandatory section.
|
|
2159
|
+
if (canEdit.progress) {
|
|
2160
|
+
body += progressCard(project) + nextCard(project);
|
|
2161
|
+
} else if (DATA.intent === 'new') {
|
|
2162
|
+
body += '<details class="read-context optional-block">' +
|
|
2163
|
+
'<summary>可选:如果已经有客户动作,顺便登记第一条进展(不填也能提交)</summary>' +
|
|
2164
|
+
progressCard(project) + nextCard(project) + '</details>';
|
|
2165
|
+
}
|
|
2087
2166
|
|
|
2088
2167
|
byId('formBody').innerHTML = body;
|
|
2089
2168
|
bindSwitch();
|
|
@@ -2532,6 +2611,10 @@ const FORM_SCRIPT = `
|
|
|
2532
2611
|
var scope = {};
|
|
2533
2612
|
for (var s = 0; s < plan_.editable.length; s += 1) scope[plan_.editable[s]] = true;
|
|
2534
2613
|
if (scope.plan) scope.gate12 = true;
|
|
2614
|
+
// The new-project form offers an OPTIONAL first round. It is not in the
|
|
2615
|
+
// Host's editable list — so it is never required — but it must still be
|
|
2616
|
+
// emitted when the colleague filled it in.
|
|
2617
|
+
if (DATA.intent === 'new') scope.progress = true;
|
|
2535
2618
|
function inScope(section) { return scope[section] === true; }
|
|
2536
2619
|
|
|
2537
2620
|
// The seed snapshot: what these fields held when the form was generated.
|
package/lib/gap.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* the only writer of those fields, and a second implementation here would
|
|
22
22
|
* eventually disagree with CI.
|
|
23
23
|
*/
|
|
24
|
-
import type { GapItem, GapLevel, PocRecord, StageId } from './types.js';
|
|
24
|
+
import type { GapItem, GapLevel, PocRecord, ProgressRecord, StageId } from './types.js';
|
|
25
25
|
import { type RulesBundle } from './rules.js';
|
|
26
26
|
/** Normalize the free-form `stage` string onto a stage id. */
|
|
27
27
|
export declare function normalizeStage(raw: unknown): {
|
|
@@ -63,7 +63,7 @@ export declare function readDimensions(poc: PocRecord): {
|
|
|
63
63
|
nextMilestone: boolean;
|
|
64
64
|
};
|
|
65
65
|
/** The newest progress entry, or `null`. */
|
|
66
|
-
export declare function latestProgress(poc: PocRecord):
|
|
66
|
+
export declare function latestProgress(poc: PocRecord): ProgressRecord | null;
|
|
67
67
|
/** The newest progress date, or `null`. */
|
|
68
68
|
export declare function lastProgressDate(poc: PocRecord): string | null;
|
|
69
69
|
/** Whole days between a `YYYY-MM-DD` date and the scan clock. */
|