48 lines
1.9 KiB
HTML
48 lines
1.9 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>SAP / TM 接口调用清单(第 9 章)</title>
|
|
<style id="print-overrides">
|
|
body { margin: 0; padding: 24px; color: #17212b; background: #fff; font: 14px/1.65 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
|
|
.loading { color: #5e6b78; }
|
|
@media print {
|
|
@page { size: A4; margin: 12mm; }
|
|
body { padding: 0; font-size: 9pt; }
|
|
section { border: 0 !important; padding: 0 !important; margin: 0 !important; }
|
|
table { font-size: 7.2pt !important; }
|
|
th, td { padding: 5px 6px !important; }
|
|
.operation-grid { grid-template-columns: 1fr !important; }
|
|
.operation-card { break-inside: avoid; }
|
|
.operation-card img { max-height: 105mm; object-fit: contain; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<p class="loading">正在生成第 9 章打印内容...</p>
|
|
<script>
|
|
(async () => {
|
|
const source = await fetch('./SAP接口调用说明.html').then(response => response.text());
|
|
const parsed = new DOMParser().parseFromString(source, 'text/html');
|
|
const sourceStyle = parsed.querySelector('style');
|
|
const chapter = parsed.querySelector('#pagecalls');
|
|
|
|
if (!sourceStyle || !chapter) {
|
|
throw new Error('未找到 SAP / TM 接口调用清单章节。');
|
|
}
|
|
|
|
const style = document.createElement('style');
|
|
style.textContent = sourceStyle.textContent;
|
|
document.head.appendChild(style);
|
|
document.head.appendChild(document.querySelector('#print-overrides'));
|
|
document.body.innerHTML = '<main>' + chapter.outerHTML + '</main>';
|
|
document.body.dataset.ready = 'true';
|
|
})().catch(error => {
|
|
document.body.innerHTML = '<p>生成失败:' + error.message + '</p>';
|
|
document.body.dataset.ready = 'error';
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|