dsh-weekly-report-lau 1.1.3 → 1.2.1
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 +2 -2
- package/package.json +5 -5
- package/plugin.json +11 -4
- package/service/paths.cjs +9 -2
- package/service/public/app.js +152 -7
- package/service/public/index.html +26 -5
- package/service/public/style.css +10 -3
- package/service/server.cjs +80 -0
- package/smoke.mjs +28 -0
- package//346/223/215/344/275/234/344/275/277/347/224/250/346/211/213/345/206/214.html +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 周报工作台 · dsh-weekly-report
|
|
1
|
+
# 周报工作台 · dsh-weekly-report v1.2.1
|
|
2
2
|
|
|
3
3
|
**装上即用的 DSH 完整插件**:双击即装,自动注册 bundle、自动常驻面板服务、自动打开面板,全程不用敲命令。API Key、输出目录、绩效表与模板由使用者按需提供,插件负责识别并据此生成、输出。
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
| 功能级 / 行为变化 | 第二位 | `1.0.x` → `1.1.0` |
|
|
13
13
|
| 不兼容的大改版 | 第一位 | `1.x` → `2.0.0` |
|
|
14
14
|
|
|
15
|
-
当前 **1.1.3
|
|
15
|
+
当前 **1.2.1**:修复历史页「复制全文」在旧版 WebView 内核里因 Clipboard API 被禁用而失败(新增 execCommand 降级 + 自动选中兜底);手动复制强制只写纯文本,粘贴不再带字体/底色/行号,历史页 Ctrl+A 只选中周报正文。1.2.0 新增「定时生成」模块(设置页配置每周生成时间,插件内置调度器到点自动生成并同步绩效表,默认周六 12:00、默认关闭;左下角实时展示定时安排)。1.1.3 面板服务与面板页显示的版本号都直接读 `package.json`,不会再出现「包是新的、界面还是旧号」。1.1.3 概览「周报格式」预览改为通用脱敏示例值(不含真实学校、链接或工单号),并移除「看真实数据」入口。1.1.2 面板样式全面改用 flex 布局(兼容不支持 CSS Grid 的旧内核 WebView)、开关改为「滑块 / 文案 / 已开启已关闭徽标」单行 flex 结构、按钮与说明文字分层更清晰。1.1.1 修复开关滑块与文字重叠、开关增加「已开启/已关闭」状态徽标、结构检测结果不再贴顶。
|
|
16
16
|
|
|
17
17
|
## 双击即装(零命令)
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-weekly-report-lau",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "周报工作台 · 装上即用的 DSH 完整插件:一键安装、自动常驻、面板零手工启动,按使用者提供的 API Key 与路径模板生成周报与绩效表。",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"lib",
|
|
16
16
|
"service",
|
|
17
|
+
"!service/engine/.cache",
|
|
18
|
+
"!service/engine/.cache/**",
|
|
19
|
+
"!service/**/.cache/**",
|
|
17
20
|
"locale",
|
|
18
21
|
"icon.svg",
|
|
19
22
|
"cordis.patch.yml",
|
|
@@ -25,10 +28,7 @@
|
|
|
25
28
|
"一键安装.vbs",
|
|
26
29
|
"一键安装.cmd",
|
|
27
30
|
"一键安装.command",
|
|
28
|
-
"install.sh"
|
|
29
|
-
"!service/engine/.cache",
|
|
30
|
-
"!service/engine/.cache/**",
|
|
31
|
-
"!service/**/.cache/**"
|
|
31
|
+
"install.sh"
|
|
32
32
|
],
|
|
33
33
|
"comment:distribution": "完整分发包请保留 node_modules/(内含 exceljs,绩效表功能零网络可用);精简包可由 install.mjs 或设置页自动补装。",
|
|
34
34
|
"dsh": {
|
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-weekly-report-lau",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"displayName": {
|
|
5
5
|
"zh": "周报工作台",
|
|
6
6
|
"en": "Weekly Report Studio"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"hostBootstrap": "从 DSH 插件页直装时,Host 半身也会自举数据目录、面板服务与绩效表组件",
|
|
43
43
|
"verified": {
|
|
44
44
|
"installChecks": "9/9",
|
|
45
|
-
"smoke": "
|
|
46
|
-
"hostRevive": "12s 内拉起 v1.1
|
|
45
|
+
"smoke": "84/84",
|
|
46
|
+
"hostRevive": "12s 内拉起 v1.2.1",
|
|
47
47
|
"installDeps": "ok / mode=bundled",
|
|
48
48
|
"reportRepair": "1 处补全,其余 5 份历史文件未重写",
|
|
49
49
|
"perfWrite": "就地写入 2 个单元格,结构指纹前后一致"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"repairTool": "service/engine/repair-report.mjs(npm run repair / 历史页「检查格式」)",
|
|
54
54
|
"openDir": "WINDIR 绝对路径 explorer.exe,/select 选中文件,错误不再被吞,前端 toast 反馈"
|
|
55
55
|
},
|
|
56
|
-
"version": "1.1
|
|
56
|
+
"version": "1.2.1",
|
|
57
57
|
"versionRule": {
|
|
58
58
|
"minor": "最后一位",
|
|
59
59
|
"feature": "第二位",
|
|
@@ -106,8 +106,15 @@
|
|
|
106
106
|
"progress"
|
|
107
107
|
],
|
|
108
108
|
"scheduleHint": "每周六 12:00",
|
|
109
|
+
"scheduledRun": {
|
|
110
|
+
"enabled": "默认关闭,设置页开启",
|
|
111
|
+
"default": "周六 12:00 + 同步绩效表",
|
|
112
|
+
"engine": "服务内置调度器(setInterval 20s tick + 分钟槽持久化去重),无需外部计划任务",
|
|
113
|
+
"ui": "设置页「定时生成」卡片配置;面板左下角实时展示定时安排与下次运行时间"
|
|
114
|
+
},
|
|
109
115
|
"timeRule": "已完成=开始~完成;未完成=开始~本周周日;任何一条结束时间不越过本周周日"
|
|
110
116
|
},
|
|
117
|
+
"schedule": "每周(周几 + 时:分)自动生成本周周报,默认周六 12:00、默认关闭;由服务内置调度器触发(每 20s 检查、分钟槽持久化去重),不依赖系统计划任务;到点触发复用手动生成的全部校验与日志",
|
|
111
118
|
"performanceRules": {
|
|
112
119
|
"content": "本月全部周报内容填入绩效表,时间一致",
|
|
113
120
|
"keepFormat": true,
|
package/service/paths.cjs
CHANGED
|
@@ -28,7 +28,7 @@ function pickDataDir() {
|
|
|
28
28
|
process.env.WEEKLY_DATA_DIR,
|
|
29
29
|
path.join(home, '.dsh', 'weekly-report'),
|
|
30
30
|
path.join(os.homedir(), '.dsh', 'weekly-report'),
|
|
31
|
-
path.join(os.tmpdir(), 'dsh-weekly-report
|
|
31
|
+
path.join(os.tmpdir(), 'dsh-weekly-report'),
|
|
32
32
|
].filter(Boolean);
|
|
33
33
|
for (const dir of candidates) {
|
|
34
34
|
try {
|
|
@@ -37,7 +37,7 @@ function pickDataDir() {
|
|
|
37
37
|
return path.resolve(dir);
|
|
38
38
|
} catch { /* 换下一个 */ }
|
|
39
39
|
}
|
|
40
|
-
return path.join(os.tmpdir(), 'dsh-weekly-report
|
|
40
|
+
return path.join(os.tmpdir(), 'dsh-weekly-report');
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const DATA_DIR = pickDataDir();
|
|
@@ -88,6 +88,13 @@ function defaultConfig() {
|
|
|
88
88
|
handler: '',
|
|
89
89
|
threshold: 0.85,
|
|
90
90
|
mcp_url: 'https://yanfa.scedu.tech/api/mcp',
|
|
91
|
+
schedule: {
|
|
92
|
+
enabled: false, // 定时生成默认关闭,由使用者在「设置」页开启
|
|
93
|
+
weekday: 6, // 0=周日 … 6=周六(Date#getDay 口径),默认每周六
|
|
94
|
+
hour: 12,
|
|
95
|
+
minute: 0,
|
|
96
|
+
perfAuto: true, // 定时生成时同步写入绩效表(提供目录才写)
|
|
97
|
+
},
|
|
91
98
|
confirm: { send_mail: false, imap_host: '', imap_port: 993, lookback_days: 14, subject_keyword: '周报' },
|
|
92
99
|
notify: {
|
|
93
100
|
enabled: false,
|
package/service/public/app.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
const S = {
|
|
13
13
|
state: null, view: 'overview', period: 'current', reports: [],
|
|
14
|
-
selected: '', fsTarget: '', fsPath: '', runTimer: 0, tplText: '',
|
|
14
|
+
selected: '', fsTarget: '', fsPath: '', runTimer: 0, tplText: '', reportText: '',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
async function api(url, options) {
|
|
@@ -43,11 +43,57 @@
|
|
|
43
43
|
if (r.ok) toast(`已打开${label}:${r.path}`);
|
|
44
44
|
else {
|
|
45
45
|
toast(`打开失败:${r.error || '未知原因'}`, 'err');
|
|
46
|
-
|
|
46
|
+
if (await copyText(p)) toast('路径已复制,可粘贴到资源管理器');
|
|
47
47
|
}
|
|
48
48
|
} catch (e) { toast('请求失败:' + (e.message || e), 'err'); }
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
// ---------------------------------------------------------------- 剪贴板
|
|
52
|
+
/**
|
|
53
|
+
* 纯文本复制(兼容 DSH 的旧 WebView 内核)。
|
|
54
|
+
* 老内核常因权限策略禁用或拒绝 navigator.clipboard,必须降级到 execCommand('copy');
|
|
55
|
+
* 只写 text/plain、绝不写 text/html —— 粘贴后不会带上字体、底色、行号等富文本。
|
|
56
|
+
* @returns {Promise<boolean>} 是否成功写入剪贴板
|
|
57
|
+
*/
|
|
58
|
+
async function copyText(text) {
|
|
59
|
+
const value = String(text == null ? '' : text);
|
|
60
|
+
if (!value) return false;
|
|
61
|
+
// ① 现代 Clipboard API(127.0.0.1 属安全上下文,但仍可能被 WebView 权限拦下)
|
|
62
|
+
try {
|
|
63
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
64
|
+
await navigator.clipboard.writeText(value);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
} catch { /* 权限被拒 / API 存在但不可用,继续降级 */ }
|
|
68
|
+
// ② 旧内核兜底:临时 textarea + execCommand('copy')
|
|
69
|
+
let ta = null;
|
|
70
|
+
try {
|
|
71
|
+
ta = document.createElement('textarea');
|
|
72
|
+
ta.value = value;
|
|
73
|
+
ta.setAttribute('readonly', '');
|
|
74
|
+
ta.style.cssText = 'position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:0;opacity:0;z-index:9999;';
|
|
75
|
+
document.body.appendChild(ta);
|
|
76
|
+
ta.focus();
|
|
77
|
+
ta.select();
|
|
78
|
+
ta.setSelectionRange(0, value.length);
|
|
79
|
+
return Boolean(document.execCommand('copy'));
|
|
80
|
+
} catch { return false; }
|
|
81
|
+
finally { if (ta && ta.parentNode) ta.parentNode.removeChild(ta); }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** 精确选中某个元素的全部内容,用于 Ctrl+A 拦截与复制失败兜底。 */
|
|
85
|
+
function selectAllIn(el) {
|
|
86
|
+
if (!el) return;
|
|
87
|
+
try {
|
|
88
|
+
el.focus();
|
|
89
|
+
const range = document.createRange();
|
|
90
|
+
range.selectNodeContents(el);
|
|
91
|
+
const sel = window.getSelection();
|
|
92
|
+
sel.removeAllRanges();
|
|
93
|
+
sel.addRange(range);
|
|
94
|
+
} catch { /* 老内核不支持 Range 时忽略,用户仍可手动拖选 */ }
|
|
95
|
+
}
|
|
96
|
+
|
|
51
97
|
function fmtTime(ms) {
|
|
52
98
|
if (!ms) return '';
|
|
53
99
|
const d = new Date(ms);
|
|
@@ -68,6 +114,14 @@
|
|
|
68
114
|
document.addEventListener('change', (e) => {
|
|
69
115
|
const input = e.target;
|
|
70
116
|
if (input && input.matches && input.matches('.ws-switch input[type="checkbox"]')) syncSwitchStates();
|
|
117
|
+
// 定时开关切换后立即让「生成日 / 时间 / 同步绩效表」跟着可用或禁用,不用等保存
|
|
118
|
+
if (input && input.id === 'f-schedule-enabled') {
|
|
119
|
+
const on = input.checked;
|
|
120
|
+
$('#schedule-box').querySelectorAll('select, input').forEach((el) => { el.disabled = !on; });
|
|
121
|
+
$('#f-schedule-perf').disabled = !on;
|
|
122
|
+
$('#schedule-perf-row').classList.toggle('is-disabled', !on);
|
|
123
|
+
$('#schedule-next-hint').textContent = on ? '保存后生效' : '未开启';
|
|
124
|
+
}
|
|
71
125
|
});
|
|
72
126
|
syncSwitchStates();
|
|
73
127
|
|
|
@@ -157,6 +211,12 @@
|
|
|
157
211
|
$('#f-perf-template').value = c.perf_template || '';
|
|
158
212
|
$('#f-perf-insert').checked = Boolean(c.perf_allow_insert);
|
|
159
213
|
$('#f-threshold').value = c.threshold ?? 0.85;
|
|
214
|
+
const sc = c.schedule || {};
|
|
215
|
+
$('#f-schedule-enabled').checked = Boolean(sc.enabled);
|
|
216
|
+
$('#f-schedule-day').value = String(sc.weekday ?? 6);
|
|
217
|
+
$('#f-schedule-time').value = `${String(sc.hour ?? 12).padStart(2, '0')}:${String(sc.minute ?? 0).padStart(2, '0')}`;
|
|
218
|
+
$('#f-schedule-perf').checked = sc.perfAuto !== false;
|
|
219
|
+
renderSchedule(st);
|
|
160
220
|
$('#f-notify').checked = Boolean(c.notify && c.notify.enabled);
|
|
161
221
|
$('#smtp-box').hidden = !$('#f-notify').checked;
|
|
162
222
|
$('#notify-badge').textContent = $('#f-notify').checked ? '已开启' : '默认关闭';
|
|
@@ -188,6 +248,42 @@
|
|
|
188
248
|
$('#btn-run').disabled = !(st.key && st.key.present);
|
|
189
249
|
}
|
|
190
250
|
|
|
251
|
+
// ---------------------------------------------------------------- 定时生成
|
|
252
|
+
const WEEKDAYS = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
253
|
+
|
|
254
|
+
function fmtDateTime(iso) {
|
|
255
|
+
try {
|
|
256
|
+
const d = new Date(iso);
|
|
257
|
+
return `${d.getMonth() + 1}月${d.getDate()}日 ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
|
258
|
+
} catch { return ''; }
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** 左下角与设置卡片:展示跟随定时配置(开启显示安排与下次运行,关闭显示未开启)。 */
|
|
262
|
+
function renderSchedule(st) {
|
|
263
|
+
const sc = (st.config && st.config.schedule) || {};
|
|
264
|
+
const sch = st.schedule || {};
|
|
265
|
+
const on = Boolean(sc.enabled);
|
|
266
|
+
const day = WEEKDAYS[Number(sc.weekday ?? 6)] || '周六';
|
|
267
|
+
const hm = `${String(sc.hour ?? 12).padStart(2, '0')}:${String(sc.minute ?? 0).padStart(2, '0')}`;
|
|
268
|
+
// 左下角脚注
|
|
269
|
+
const nav = $('#nav-schedule-hint');
|
|
270
|
+
if (on) {
|
|
271
|
+
const next = sch.nextRunAt ? fmtDateTime(sch.nextRunAt) : '待计算';
|
|
272
|
+
nav.innerHTML = `定时:每周${day} ${hm}<br>下次 ${esc(next)}`;
|
|
273
|
+
nav.classList.add('is-on');
|
|
274
|
+
} else {
|
|
275
|
+
nav.textContent = '定时生成未开启';
|
|
276
|
+
nav.classList.remove('is-on');
|
|
277
|
+
}
|
|
278
|
+
// 设置卡片:下次运行 + 控件可用性
|
|
279
|
+
$('#schedule-next-hint').textContent = on
|
|
280
|
+
? (sch.nextRunAt ? `下次:${fmtDateTime(sch.nextRunAt)}` : '已开启(时间待确认)')
|
|
281
|
+
: '未开启';
|
|
282
|
+
$('#schedule-box').querySelectorAll('select, input').forEach((el) => { el.disabled = !on; });
|
|
283
|
+
$('#f-schedule-perf').disabled = !on;
|
|
284
|
+
$('#schedule-perf-row').classList.toggle('is-disabled', !on);
|
|
285
|
+
}
|
|
286
|
+
|
|
191
287
|
// ---------------------------------------------------------------- 模板
|
|
192
288
|
/** 概览预览用的通用示例数据:全部为脱敏占位值,不含任何真实学校、链接或工单编号;
|
|
193
289
|
* 实际生成时这些字段全部由本周工单/任务数据替换。 */
|
|
@@ -226,6 +322,13 @@
|
|
|
226
322
|
perf_template: $('#f-perf-template').value.trim(),
|
|
227
323
|
perf_allow_insert: $('#f-perf-insert').checked,
|
|
228
324
|
threshold: Number($('#f-threshold').value) || 0.85,
|
|
325
|
+
schedule: {
|
|
326
|
+
enabled: $('#f-schedule-enabled').checked,
|
|
327
|
+
weekday: Number($('#f-schedule-day').value),
|
|
328
|
+
hour: Number(($('#f-schedule-time').value || '12:00').split(':')[0]),
|
|
329
|
+
minute: Number(($('#f-schedule-time').value || '12:00').split(':')[1]),
|
|
330
|
+
perfAuto: $('#f-schedule-perf').checked,
|
|
331
|
+
},
|
|
229
332
|
notify: {
|
|
230
333
|
enabled: $('#f-notify').checked,
|
|
231
334
|
smtp: {
|
|
@@ -300,8 +403,9 @@
|
|
|
300
403
|
}
|
|
301
404
|
bindCollapse($('#btn-deps-collapse'), $('#deps-log'), ['展开输出', '收起输出']);
|
|
302
405
|
$('#btn-copy-command').addEventListener('click', async () => {
|
|
303
|
-
|
|
304
|
-
|
|
406
|
+
const el = $('#deps-command');
|
|
407
|
+
if (await copyText(el.textContent)) toast('已复制命令(纯文本)');
|
|
408
|
+
else { selectAllIn(el); toast('已选中命令,请按 Ctrl+C 复制', 'warn'); }
|
|
305
409
|
});
|
|
306
410
|
|
|
307
411
|
$('#btn-install-deps').addEventListener('click', async () => {
|
|
@@ -525,7 +629,9 @@
|
|
|
525
629
|
$('#report-empty').hidden = true;
|
|
526
630
|
$('#report-detail').hidden = false;
|
|
527
631
|
$('#report-meta').textContent = r.path;
|
|
528
|
-
|
|
632
|
+
// 保存服务端原文:复制一律用它,不受 DOM 渲染 / 视觉折行 / 页面其它元素影响
|
|
633
|
+
S.reportText = r.text || '';
|
|
634
|
+
$('#report-text').textContent = S.reportText;
|
|
529
635
|
$('#report-text').scrollTop = 0;
|
|
530
636
|
setReportExpanded(true);
|
|
531
637
|
renderReports();
|
|
@@ -547,8 +653,47 @@
|
|
|
547
653
|
});
|
|
548
654
|
$('#btn-open-report-dir').addEventListener('click', () => void openPath(S.selected, '周报文件'));
|
|
549
655
|
$('#btn-copy-report').addEventListener('click', async () => {
|
|
550
|
-
|
|
551
|
-
|
|
656
|
+
const text = S.reportText || $('#report-text').textContent || '';
|
|
657
|
+
if (!text) { toast('请先选择一份周报', 'warn'); return; }
|
|
658
|
+
if (await copyText(text)) toast('已复制全文(纯文本,无格式)');
|
|
659
|
+
else {
|
|
660
|
+
// 两级降级都失败:至少帮用户精确选中正文,避免手动全选连界面一起复制
|
|
661
|
+
selectAllIn($('#report-text'));
|
|
662
|
+
toast('已选中全文,请按 Ctrl+C 复制', 'warn');
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* 手动复制:强制只写 text/plain。
|
|
668
|
+
* 浏览器默认会把选区同时写成 text/html(带 pre 的字体、底色、缩进),
|
|
669
|
+
* 全选整页时还会把列表项、按钮文字一起带进去,粘贴后就像多了格式和「行号」。
|
|
670
|
+
* 这里覆盖剪贴板数据,尊重部分选区,只输出纯文本。
|
|
671
|
+
*/
|
|
672
|
+
$('#report-text').addEventListener('copy', (e) => {
|
|
673
|
+
if (!e.clipboardData) return;
|
|
674
|
+
const sel = window.getSelection();
|
|
675
|
+
const partial = sel && !sel.isCollapsed ? sel.toString() : '';
|
|
676
|
+
e.clipboardData.setData('text/plain', partial || S.reportText || $('#report-text').textContent);
|
|
677
|
+
// 刻意不写 HTML 格式的剪贴板数据:粘贴到 Word / 微信 / 笔记只会得到纯文本
|
|
678
|
+
e.preventDefault();
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
/** 正文内 Ctrl+A 只选中正文,不会把整个面板的 UI 一起选上。 */
|
|
682
|
+
$('#report-text').addEventListener('keydown', (e) => {
|
|
683
|
+
if ((e.ctrlKey || e.metaKey) && String(e.key).toLowerCase() === 'a') {
|
|
684
|
+
e.preventDefault();
|
|
685
|
+
selectAllIn($('#report-text'));
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
/** 全局兜底:历史页里即使焦点不在正文,Ctrl+A 也只选正文(输入框内保留默认行为)。 */
|
|
690
|
+
document.addEventListener('keydown', (e) => {
|
|
691
|
+
if (!(e.ctrlKey || e.metaKey) || String(e.key).toLowerCase() !== 'a') return;
|
|
692
|
+
const t = e.target;
|
|
693
|
+
if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;
|
|
694
|
+
if (S.view !== 'history' || $('#report-detail').hidden || !S.reportText) return;
|
|
695
|
+
e.preventDefault();
|
|
696
|
+
selectAllIn($('#report-text'));
|
|
552
697
|
});
|
|
553
698
|
|
|
554
699
|
// ---------------------------------------------------------------- 其它入口
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>周报工作台</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/icon.svg">
|
|
8
|
-
<link rel="stylesheet" href="/style.css?v=1.1
|
|
8
|
+
<link rel="stylesheet" href="/style.css?v=1.2.1">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div class="ws-app">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<button class="ws-nav__item" data-view="settings" type="button"><span class="ws-nav__ico">⚙</span>设置</button>
|
|
34
34
|
<button class="ws-nav__item" data-view="history" type="button"><span class="ws-nav__ico">≡</span>历史</button>
|
|
35
35
|
<div class="ws-nav__foot">
|
|
36
|
-
<div class="ws-nav__hint"
|
|
36
|
+
<div class="ws-nav__hint" id="nav-schedule-hint">定时生成未开启<br>可到「设置」里配置</div>
|
|
37
37
|
</div>
|
|
38
38
|
</nav>
|
|
39
39
|
|
|
@@ -211,6 +211,26 @@
|
|
|
211
211
|
<div class="ws-chips" id="tpl-chips"></div>
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
|
+
<div class="ws-card">
|
|
215
|
+
<div class="ws-card__head"><h2>定时生成</h2><span class="ws-card__hint" id="schedule-next-hint">未开启</span></div>
|
|
216
|
+
<label class="ws-switch"><input type="checkbox" id="f-schedule-enabled"><span class="ws-switch__track"></span><span class="ws-switch__label"><b>定时自动生成</b><small>插件内置定时器到点自动生成本周周报,不依赖系统计划任务;面板后台常驻即生效</small></span><em class="ws-switch__state"></em></label>
|
|
217
|
+
<div class="ws-field ws-field--2" id="schedule-box">
|
|
218
|
+
<div><label for="f-schedule-day">生成日(每周)</label>
|
|
219
|
+
<select id="f-schedule-day">
|
|
220
|
+
<option value="0">周日</option>
|
|
221
|
+
<option value="1">周一</option>
|
|
222
|
+
<option value="2">周二</option>
|
|
223
|
+
<option value="3">周三</option>
|
|
224
|
+
<option value="4">周四</option>
|
|
225
|
+
<option value="5">周五</option>
|
|
226
|
+
<option value="6" selected>周六</option>
|
|
227
|
+
</select></div>
|
|
228
|
+
<div><label for="f-schedule-time">生成时间</label><input type="time" id="f-schedule-time" value="12:00"></div>
|
|
229
|
+
</div>
|
|
230
|
+
<label class="ws-switch" id="schedule-perf-row"><input type="checkbox" id="f-schedule-perf"><span class="ws-switch__track"></span><span class="ws-switch__label"><b>定时生成时同步绩效表</b><small>与手动生成一致:本月全部周报内容逐格写入,表格格式保持不变(需提供绩效表目录)</small></span><em class="ws-switch__state"></em></label>
|
|
231
|
+
<p class="ws-card__desc">开启后,左下角会显示定时安排与下次运行时间;到点自动生成,结果可在「生成」页日志与「历史」页查看。服务重启后同一分钟不会重复生成。</p>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
214
234
|
<div class="ws-card">
|
|
215
235
|
<div class="ws-card__head"><h2>邮件通知</h2><span class="ws-badge" id="notify-badge">默认关闭</span></div>
|
|
216
236
|
<label class="ws-switch"><input type="checkbox" id="f-notify"><span class="ws-switch__track"></span><span class="ws-switch__label"><b>生成后发送邮件</b><small>默认关闭;需要时再填写 SMTP,插件不预置任何凭据</small></span><em class="ws-switch__state"></em></label>
|
|
@@ -278,10 +298,11 @@
|
|
|
278
298
|
<div class="ws-history__meta" id="report-meta"></div>
|
|
279
299
|
<button class="ws-link" id="btn-toggle-report" type="button" aria-expanded="true">收起内容</button>
|
|
280
300
|
</div>
|
|
281
|
-
<pre class="ws-report ws-scroll" id="report-text"></pre>
|
|
301
|
+
<pre class="ws-report ws-scroll" id="report-text" tabindex="0" title="点击正文后按 Ctrl+A 可只选中周报正文;复制结果为纯文本"></pre>
|
|
282
302
|
<div class="ws-history__actions" id="report-actions">
|
|
283
303
|
<button class="ws-btn ws-btn--ghost" id="btn-open-report-dir" type="button">打开目录</button>
|
|
284
|
-
<button class="ws-btn ws-btn--ghost" id="btn-copy-report" type="button">复制全文</button>
|
|
304
|
+
<button class="ws-btn ws-btn--ghost" id="btn-copy-report" type="button" title="复制为纯文本,不带字体、底色或行号">复制全文</button>
|
|
305
|
+
<div class="ws-card__hint ws-report__hint">正文可选中;Ctrl+A 只选正文,复制结果为纯文本,不会带上格式或行号。若浏览器限制剪贴板,点「复制全文」会自动选中全文,按 Ctrl+C 即可。</div>
|
|
285
306
|
</div>
|
|
286
307
|
</div>
|
|
287
308
|
</div>
|
|
@@ -310,6 +331,6 @@
|
|
|
310
331
|
</div>
|
|
311
332
|
|
|
312
333
|
<div class="ws-toast" id="toast" hidden></div>
|
|
313
|
-
<script src="/app.js?v=1.1
|
|
334
|
+
<script src="/app.js?v=1.2.1"></script>
|
|
314
335
|
</body>
|
|
315
336
|
</html>
|
package/service/public/style.css
CHANGED
|
@@ -94,6 +94,8 @@ button { cursor: pointer; }
|
|
|
94
94
|
.ws-nav__ico { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
|
|
95
95
|
.ws-nav__foot { margin-top: auto; padding: 16px 14px 0; border-top: 1px solid var(--line); flex: 0 0 auto; }
|
|
96
96
|
.ws-nav__hint { font-size: 11px; line-height: 1.8; color: var(--text-3); }
|
|
97
|
+
.ws-nav__hint.is-on { color: var(--accent-strong); font-weight: 600; }
|
|
98
|
+
.ws-switch.is-disabled { opacity: .55; pointer-events: none; }
|
|
97
99
|
|
|
98
100
|
.ws-main { flex: 1; min-width: 0; min-height: 0; max-width: 1040px; padding: 26px 32px 32px; overflow-y: auto; }
|
|
99
101
|
.ws-view { display: none; animation: ws-in .25s ease both; }
|
|
@@ -205,13 +207,16 @@ button { cursor: pointer; }
|
|
|
205
207
|
.ws-field--2 > div { flex: 1 1 200px; min-width: 0; }
|
|
206
208
|
.ws-field__note { font-size: 11.5px; color: var(--text-3); margin-top: 7px; line-height: 1.6; }
|
|
207
209
|
.ws-optional { font-weight: 400; color: var(--text-3); font-size: 11px; margin-left: 4px; }
|
|
208
|
-
input[type=text], input[type=password], input[type=date], input[type=month], input[type=number], input:not([type]), textarea {
|
|
210
|
+
input[type=text], input[type=password], input[type=date], input[type=month], input[type=number], input[type=time], input:not([type]), textarea, select {
|
|
209
211
|
width: 100%; padding: 9px 12px;
|
|
210
212
|
background: var(--surface); color: var(--text);
|
|
211
213
|
border: 1px solid var(--line-strong); border-radius: 9px;
|
|
212
214
|
outline: none; transition: border-color .15s, box-shadow .15s;
|
|
215
|
+
font-size: 13px;
|
|
213
216
|
}
|
|
214
|
-
|
|
217
|
+
select { cursor: pointer; appearance: auto; }
|
|
218
|
+
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
|
|
219
|
+
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-soft); }
|
|
215
220
|
input::placeholder, textarea::placeholder { color: #b3bac7; }
|
|
216
221
|
.ws-textarea { font: 12.5px/1.8 var(--mono); resize: vertical; min-height: clamp(110px, 22dvh, 180px); }
|
|
217
222
|
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
|
|
@@ -306,8 +311,10 @@ input::placeholder, textarea::placeholder { color: #b3bac7; }
|
|
|
306
311
|
.ws-history__detail.is-collapsed { flex: 0 0 auto; }
|
|
307
312
|
.ws-history__bar { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
|
308
313
|
.ws-history__meta { font: 11.5px/1.6 var(--mono); color: var(--text-2); word-break: break-all; }
|
|
309
|
-
.ws-report { flex: 1; min-height: 0; max-height: none; overflow: auto; margin: 12px 0 0; padding: 16px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px; font: 12.5px/1.9 var(--mono); white-space: pre-wrap; word-break: break-word; }
|
|
314
|
+
.ws-report { flex: 1; min-height: 0; max-height: none; overflow: auto; margin: 12px 0 0; padding: 16px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px; font: 12.5px/1.9 var(--mono); white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; outline: none; }
|
|
315
|
+
.ws-report:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
|
|
310
316
|
.ws-history__actions { flex: 0 0 auto; display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
|
|
317
|
+
.ws-report__hint { flex: 0 0 100%; line-height: 1.7; }
|
|
311
318
|
|
|
312
319
|
/* ------------------------------------------------------------------ 弹窗 / toast */
|
|
313
320
|
.ws-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
|
package/service/server.cjs
CHANGED
|
@@ -42,6 +42,79 @@ let run = {
|
|
|
42
42
|
artifacts: { reports: [], perf: [], weeks: [] },
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
// ---------------------------------------------------------------- 定时生成
|
|
46
|
+
/**
|
|
47
|
+
* 内置调度器:不依赖系统计划任务 / 外部 cron,面板服务常驻即生效。
|
|
48
|
+
* - 每 20 秒 tick 一次,命中「周几 + 时 + 分」且未触发过该分钟槽才触发;
|
|
49
|
+
* - 触发动作完全复用 startRun(API Key / 绩效表目录 / 组件等校验、运行日志全部一致);
|
|
50
|
+
* - 已触发的分钟槽持久化到数据目录,服务被心跳拉起重启后不会在同一分钟内重复生成。
|
|
51
|
+
*/
|
|
52
|
+
const SCHEDULE_TICK_MS = 20000;
|
|
53
|
+
const SCHEDULE_STATE_FILE = () => path.join(P.DATA_DIR, 'schedule-state.json');
|
|
54
|
+
let sched = { lastSlot: '', lastRunAt: null, lastResult: null, timer: null };
|
|
55
|
+
|
|
56
|
+
function pad2(n) { return String(n).padStart(2, '0'); }
|
|
57
|
+
|
|
58
|
+
/** 计算下一次运行时刻;未开启或配置非法返回 null。 */
|
|
59
|
+
function computeNextRun(sc, now) {
|
|
60
|
+
if (!sc || !sc.enabled) return null;
|
|
61
|
+
const wd = Number(sc.weekday); const hh = Number(sc.hour); const mm = Number(sc.minute);
|
|
62
|
+
if (!Number.isInteger(wd) || wd < 0 || wd > 6) return null;
|
|
63
|
+
if (!Number.isInteger(hh) || hh < 0 || hh > 23) return null;
|
|
64
|
+
if (!Number.isInteger(mm) || mm < 0 || mm > 59) return null;
|
|
65
|
+
const base = now || new Date();
|
|
66
|
+
for (let i = 0; i < 8; i += 1) {
|
|
67
|
+
const d = new Date(base.getFullYear(), base.getMonth(), base.getDate() + i, hh, mm, 0, 0);
|
|
68
|
+
if (d.getDay() === wd && d.getTime() > base.getTime()) return d;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function readSchedState() {
|
|
74
|
+
try { return JSON.parse(fs.readFileSync(SCHEDULE_STATE_FILE(), 'utf8')) || {}; } catch { return {}; }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function writeSchedState(patch) {
|
|
78
|
+
try { P.atomicWrite(SCHEDULE_STATE_FILE(), JSON.stringify({ ...readSchedState(), ...patch }, null, 2) + '\n'); } catch { /* ignore */ }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** 到点触发:复用 startRun 的全部校验与日志,并在运行日志里标注来源。 */
|
|
82
|
+
function scheduledFire(now) {
|
|
83
|
+
const slot = `${now.getFullYear()}${pad2(now.getMonth() + 1)}${pad2(now.getDate())}-${pad2(now.getHours())}${pad2(now.getMinutes())}`;
|
|
84
|
+
if (sched.lastSlot === slot || readSchedState().lastSlot === slot) return; // 本分钟已触发过
|
|
85
|
+
sched.lastSlot = slot;
|
|
86
|
+
writeSchedState({ lastSlot: slot });
|
|
87
|
+
const sc = P.loadConfig().config.schedule || {};
|
|
88
|
+
P.log(`schedule: fire ${slot} weekday=${sc.weekday} perfAuto=${sc.perfAuto ? 1 : 0}`);
|
|
89
|
+
const r = startRun({ period: 'current', perfAuto: Boolean(sc.perfAuto), scheduled: true });
|
|
90
|
+
sched.lastRunAt = new Date().toISOString();
|
|
91
|
+
sched.lastResult = r.ok ? 'started' : String(r.error || 'failed');
|
|
92
|
+
if (!r.ok) P.log(`schedule: trigger rejected: ${r.error || '未知原因'}`);
|
|
93
|
+
else pushLine(`[scheduled] 定时任务已触发(${slot})`);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function scheduleTick() {
|
|
97
|
+
try {
|
|
98
|
+
const sc = P.loadConfig().config.schedule;
|
|
99
|
+
if (!sc || !sc.enabled) return;
|
|
100
|
+
const now = new Date();
|
|
101
|
+
if (now.getDay() !== Number(sc.weekday)) return;
|
|
102
|
+
if (now.getHours() !== Number(sc.hour) || now.getMinutes() !== Number(sc.minute)) return;
|
|
103
|
+
if (run.running) return; // 有手动任务在跑就不抢,下个周期再触发
|
|
104
|
+
scheduledFire(now);
|
|
105
|
+
} catch (e) { P.log(`schedule tick error: ${(e && e.message) || e}`); }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function startScheduler() {
|
|
109
|
+
if (sched.timer) clearInterval(sched.timer);
|
|
110
|
+
const st = readSchedState();
|
|
111
|
+
sched.lastSlot = String(st.lastSlot || '');
|
|
112
|
+
if (typeof st.lastRunAt === 'string') sched.lastRunAt = st.lastRunAt;
|
|
113
|
+
if (typeof st.lastResult === 'string') sched.lastResult = st.lastResult;
|
|
114
|
+
sched.timer = setInterval(scheduleTick, SCHEDULE_TICK_MS);
|
|
115
|
+
if (sched.timer && typeof sched.timer.unref === 'function') sched.timer.unref();
|
|
116
|
+
}
|
|
117
|
+
|
|
45
118
|
function json(res, code, body) {
|
|
46
119
|
const text = JSON.stringify(body);
|
|
47
120
|
res.writeHead(code, {
|
|
@@ -221,6 +294,12 @@ function collectState() {
|
|
|
221
294
|
},
|
|
222
295
|
config: P.maskConfig(cfg), configError: loaded.error,
|
|
223
296
|
key: P.keyInfo(), excelAvailable: excelAvailable(),
|
|
297
|
+
schedule: {
|
|
298
|
+
config: cfg.schedule || null,
|
|
299
|
+
nextRunAt: (() => { const d = computeNextRun(cfg.schedule, new Date()); return d ? d.toISOString() : null; })(),
|
|
300
|
+
lastRunAt: sched.lastRunAt, lastResult: sched.lastResult,
|
|
301
|
+
running: run.running,
|
|
302
|
+
},
|
|
224
303
|
checks: extra.checks, probe: extra.probe,
|
|
225
304
|
reports: reports.slice(0, 12), reportCount: reports.length,
|
|
226
305
|
run: publicRun(), serverTime: new Date().toISOString(),
|
|
@@ -587,6 +666,7 @@ server.on('error', (e) => {
|
|
|
587
666
|
server.listen(PORT, HOST, () => {
|
|
588
667
|
P.ensureDirs();
|
|
589
668
|
P.loadConfig();
|
|
669
|
+
startScheduler();
|
|
590
670
|
P.log(`weekly studio v${VERSION} on http://${HOST}:${PORT} · data=${P.DATA_DIR} · node=${process.version}`);
|
|
591
671
|
console.log(`weekly studio v${VERSION} on http://${HOST}:${PORT} · data=${P.DATA_DIR}`);
|
|
592
672
|
});
|
package/smoke.mjs
CHANGED
|
@@ -230,6 +230,34 @@ try {
|
|
|
230
230
|
ok('结构识别结果有可读表格样式', /\.ws-kv/.test(cssText), '');
|
|
231
231
|
ok('版本号取自 package.json', /readFileSync\(path\.join\(__dirname, '\.\.', 'package\.json'\)/.test(fs.readFileSync(path.join(HERE, 'service', 'server.cjs'), 'utf8')), '');
|
|
232
232
|
|
|
233
|
+
// 定时生成模块:配置默认值、服务端调度器、UI 三层都要在
|
|
234
|
+
const pathsText = fs.readFileSync(path.join(HERE, 'service', 'paths.cjs'), 'utf8');
|
|
235
|
+
const srvText = fs.readFileSync(path.join(HERE, 'service', 'server.cjs'), 'utf8');
|
|
236
|
+
ok('定时生成有内置默认配置', /schedule:\s*\{[\s\S]*?enabled:\s*false[\s\S]*?weekday:\s*6[\s\S]*?hour:\s*12/.test(pathsText), '默认周六 12:00,关闭');
|
|
237
|
+
ok('服务端内置调度器', /function scheduleTick/.test(srvText) && /setInterval\(scheduleTick/.test(srvText) && /startScheduler\(\)/.test(srvText), '不依赖外部计划任务');
|
|
238
|
+
ok('定时触发的分钟槽会持久化去重', /SCHEDULE_STATE_FILE/.test(srvText) && /writeSchedState/.test(srvText), '');
|
|
239
|
+
ok('定时触发复用 startRun 校验', /startRun\(\{\s*period:\s*'current',\s*perfAuto:\s*Boolean\(sc\.perfAuto\),\s*scheduled:\s*true\s*\}\)/.test(srvText), '');
|
|
240
|
+
ok('state 接口返回下次运行时间', /nextRunAt/.test(srvText) && /computeNextRun/.test(srvText), '');
|
|
241
|
+
ok('设置页有定时生成卡片', ['f-schedule-enabled', 'f-schedule-day', 'f-schedule-time', 'f-schedule-perf', 'schedule-next-hint'].every((id) => htmlText.includes(`id="${id}"`)), '');
|
|
242
|
+
ok('左下角展示跟随定时配置', htmlText.includes('id="nav-schedule-hint"') && /renderSchedule/.test(jsText) && /定时:每周/.test(jsText), '');
|
|
243
|
+
ok('保存设置会写入 schedule 配置', /schedule:\s*\{[\s\S]*?weekday:\s*Number\(\$\('#f-schedule-day'\)\.value\)/.test(jsText), '');
|
|
244
|
+
ok('定时开关切换即时联动控件', /f-schedule-enabled'/.test(jsText) && /is-disabled/.test(cssText), '');
|
|
245
|
+
|
|
246
|
+
// 历史页复制:旧 WebView 禁用 Clipboard API 时也能复制,且粘贴结果必须是纯文本
|
|
247
|
+
ok('复制有 Clipboard API → execCommand 降级', /async function copyText/.test(jsText)
|
|
248
|
+
&& /navigator\.clipboard\.writeText/.test(jsText) && /document\.execCommand\('copy'\)/.test(jsText), '');
|
|
249
|
+
ok('所有复制入口统一走 copyText', (jsText.match(/await navigator\.clipboard\.writeText/g) || []).length === 1
|
|
250
|
+
&& (jsText.match(/await copyText\(/g) || []).length >= 3, '无裸调用,权限失败不直接报错');
|
|
251
|
+
ok('复制全文使用服务端原文', /S\.reportText = r\.text \|\| ''/.test(jsText)
|
|
252
|
+
&& /copyText\(text\)/.test(jsText) && /S\.reportText \|\| \$\('#report-text'\)\.textContent/.test(jsText), '');
|
|
253
|
+
ok('手动复制强制只写纯文本', /\$\('#report-text'\)\.addEventListener\('copy'/.test(jsText)
|
|
254
|
+
&& /setData\('text\/plain'/.test(jsText) && !/setData\('text\/html'/.test(jsText), '不带富文本格式 / 行号');
|
|
255
|
+
ok('历史页 Ctrl+A 只选正文', /addEventListener\('keydown'[\s\S]*?selectAllIn\(\$\('#report-text'\)\)/.test(jsText)
|
|
256
|
+
&& /S\.view !== 'history'/.test(jsText), '不会全选整个面板 UI');
|
|
257
|
+
ok('复制失败自动选中全文兜底', /selectAllIn\(\$\('#report-text'\)\);\s*\n\s*toast\('已选中全文/.test(jsText), '');
|
|
258
|
+
ok('周报正文可选中可聚焦', htmlText.includes('id="report-text" tabindex="0"')
|
|
259
|
+
&& /\.ws-report \{[^}]*user-select: text/.test(cssText), '');
|
|
260
|
+
|
|
233
261
|
const plugin = JSON.parse(fs.readFileSync(path.join(HERE, 'plugin.json'), 'utf8'));
|
|
234
262
|
ok('plugin.json 声明装上即用', plugin.automatic.autoRegisterBundle === true && plugin.automatic.autoStartService === true, '');
|
|
235
263
|
ok('声明会话数据仅作参考', plugin.dataSource.sessionData === 'design-reference-only', '');
|
|
@@ -72,7 +72,7 @@ footer{text-align:center;color:var(--text3);font-size:11.5px;padding:20px 0 40px
|
|
|
72
72
|
<h1>装上,就能用</h1>
|
|
73
73
|
<p>一条命令完成安装与启动,不用重启 DSH、不用手工拉服务。API Key、输出目录、绩效表与模板由你按需提供,插件负责识别并据此生成、输出。</p>
|
|
74
74
|
<div class="stat">
|
|
75
|
-
<div><b>v1.1
|
|
75
|
+
<div><b>v1.2.1</b><small>版本号取自 package.json</small></div>
|
|
76
76
|
<div><b>0 预置凭据</b><small>邮件默认关闭</small></div>
|
|
77
77
|
<div><b>4 个页面</b><small>概览 / 生成 / 设置 / 历史</small></div>
|
|
78
78
|
</div>
|
|
@@ -145,10 +145,10 @@ footer{text-align:center;color:var(--text3);font-size:11.5px;padding:20px 0 40px
|
|
|
145
145
|
<section id="s6" data-t="周报格式 模板 占位符 category school time subject work note progress"><h2>6 · 周报格式与模板</h2>
|
|
146
146
|
<p>沿用你在历史会话里约定的块格式,输出与之前的样例逐字一致:</p>
|
|
147
147
|
<pre><button class="copy">复制</button>【项目运维】
|
|
148
|
-
|
|
148
|
+
×× 学校(示例)
|
|
149
149
|
时间: 2026年11月9日
|
|
150
|
-
事项:
|
|
151
|
-
工作内容:https://
|
|
150
|
+
事项: 某系统例行巡检(示例事项)
|
|
151
|
+
工作内容:https://example.com/ticket/0000(示例链接)
|
|
152
152
|
重要说明:无
|
|
153
153
|
进度:100%</pre>
|
|
154
154
|
<table><tr><th>占位符</th><th>含义</th></tr>
|