fix(training): 安全培训支持导出PDF报告!
This commit is contained in:
1 parent
375e4e371d
commit
c96051de19
9 files changed
+559
-1
No files matched your search
Generated
+244
@@ -15,6 +15,7 @@
|
||||
"@vue-office/pdf": "^1.6.5",
|
||||
"cron-parser": "^5.5.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"html2pdf.js": "^0.14.0",
|
||||
"lucide-vue-next": "^0.575.0",
|
||||
"marked": "^17.0.3",
|
||||
"pdfjs-dist": "^5.6.205",
|
||||
@@ -136,6 +137,15 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
|
||||
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.7.tgz",
|
||||
@@ -1153,6 +1163,12 @@
|
||||
"undici-types": "~7.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pako": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz",
|
||||
"integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/pdfjs-dist": {
|
||||
"version": "2.10.377",
|
||||
"resolved": "https://registry.npmjs.org/@types/pdfjs-dist/-/pdfjs-dist-2.10.377.tgz",
|
||||
@@ -1163,6 +1179,20 @@
|
||||
"pdfjs-dist": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/raf": {
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz",
|
||||
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@types/trusted-types": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
||||
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@vitejs/plugin-vue": {
|
||||
"version": "6.0.8",
|
||||
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-6.0.8.tgz",
|
||||
@@ -1706,6 +1736,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/base64-arraybuffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
|
||||
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.0.tgz",
|
||||
@@ -1836,6 +1875,26 @@
|
||||
],
|
||||
"license": "CC-BY-4.0"
|
||||
},
|
||||
"node_modules/canvg": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz",
|
||||
"integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@types/raf": "^3.4.0",
|
||||
"core-js": "^3.8.3",
|
||||
"raf": "^3.4.1",
|
||||
"regenerator-runtime": "^0.13.7",
|
||||
"rgbcolor": "^1.0.1",
|
||||
"stackblur-canvas": "^2.0.0",
|
||||
"svg-pathdata": "^6.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cfb": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz",
|
||||
@@ -1966,6 +2025,21 @@
|
||||
"url": "https://github.com/sponsors/mesqueeb"
|
||||
}
|
||||
},
|
||||
"node_modules/core-js": {
|
||||
"version": "3.50.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.50.0.tgz",
|
||||
"integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/core-js"
|
||||
}
|
||||
},
|
||||
"node_modules/crc-32": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz",
|
||||
@@ -2005,6 +2079,15 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/css-line-break": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
|
||||
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"utrie": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/css-tree": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
|
||||
@@ -2080,6 +2163,15 @@
|
||||
"integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dompurify": {
|
||||
"version": "3.4.13",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.13.tgz",
|
||||
"integrity": "sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ==",
|
||||
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||
"optionalDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/eastasianwidth": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||
@@ -2216,6 +2308,17 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-png": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz",
|
||||
"integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/pako": "^2.0.3",
|
||||
"iobuffer": "^5.3.2",
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
"version": "1.20.1",
|
||||
"resolved": "https://registry.npmmirror.com/fastq/-/fastq-1.20.1.tgz",
|
||||
@@ -2242,6 +2345,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fflate": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz",
|
||||
"integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz",
|
||||
@@ -2391,6 +2500,30 @@
|
||||
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/html2canvas": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
|
||||
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"css-line-break": "^2.1.0",
|
||||
"text-segmentation": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/html2pdf.js": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/html2pdf.js/-/html2pdf.js-0.14.0.tgz",
|
||||
"integrity": "sha512-yvNJgE/8yru2UeGflkPdjW8YEY+nDH5X7/2WG4uiuSCwYiCp8PZ8EKNiTAa6HxJ1NjC51fZSIEq6xld5CADKBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dompurify": "^3.3.1",
|
||||
"html2canvas": "^1.0.0",
|
||||
"jspdf": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ini": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
|
||||
@@ -2398,6 +2531,12 @@
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/iobuffer": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz",
|
||||
"integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-binary-path": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||
@@ -2586,6 +2725,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/jspdf": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/jspdf/-/jspdf-4.2.1.tgz",
|
||||
"integrity": "sha512-YyAXyvnmjTbR4bHQRLzex3CuINCDlQnBqoSYyjJwTP2x9jDLuKDzy7aKUl0hgx3uhcl7xzg32agn5vlie6HIlQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.28.6",
|
||||
"fast-png": "^6.2.0",
|
||||
"fflate": "^0.8.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"canvg": "^3.0.11",
|
||||
"core-js": "^3.6.0",
|
||||
"dompurify": "^3.3.1",
|
||||
"html2canvas": "^1.0.0-rc.5"
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss": {
|
||||
"version": "1.33.0",
|
||||
"resolved": "https://registry.npmmirror.com/lightningcss/-/lightningcss-1.33.0.tgz",
|
||||
@@ -3113,6 +3269,22 @@
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0"
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-2.2.0.tgz",
|
||||
"integrity": "sha512-zJq6RP/5q+TO2OpFV3FHzlPnFjmkb7Nc99a5SNjJE+uu/PkpChs+NIZSSzbBoD+6kjiISXjfYdwj1ZRQ81dz/w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "(MIT AND Zlib)"
|
||||
},
|
||||
"node_modules/parse5": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz",
|
||||
@@ -3212,6 +3384,13 @@
|
||||
"integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/performance-now": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",
|
||||
@@ -3480,6 +3659,16 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/raf": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
|
||||
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"performance-now": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/read-cache": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/read-cache/-/read-cache-1.0.0.tgz",
|
||||
@@ -3513,6 +3702,13 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.13.11",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
@@ -3560,6 +3756,16 @@
|
||||
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/rgbcolor": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
||||
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
|
||||
"license": "MIT OR SEE LICENSE IN FEEL-FREE.md",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">= 0.8.15"
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmmirror.com/rolldown/-/rolldown-1.1.5.tgz",
|
||||
@@ -3723,6 +3929,16 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/stackblur-canvas": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
|
||||
"integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.1.14"
|
||||
}
|
||||
},
|
||||
"node_modules/std-env": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/std-env/-/std-env-4.2.0.tgz",
|
||||
@@ -3880,6 +4096,16 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/svg-pathdata": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
|
||||
"integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/symbol-tree": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
|
||||
@@ -3937,6 +4163,15 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/text-segmentation": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
|
||||
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"utrie": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/thenify": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/thenify/-/thenify-3.3.1.tgz",
|
||||
@@ -4141,6 +4376,15 @@
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/utrie": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
|
||||
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"base64-arraybuffer": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.1.5",
|
||||
"resolved": "https://registry.npmmirror.com/vite/-/vite-8.1.5.tgz",
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"@vue-office/pdf": "^1.6.5",
|
||||
"cron-parser": "^5.5.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"html2pdf.js": "^0.14.0",
|
||||
"lucide-vue-next": "^0.575.0",
|
||||
"marked": "^17.0.3",
|
||||
"pdfjs-dist": "^5.6.205",
|
||||
|
||||
@@ -205,6 +205,7 @@ function mapTrainingRecord(data: TrainingRecordApi): TrainingRecord {
|
||||
score: progress.score,
|
||||
attempts: progress.attempts,
|
||||
status: progress.status,
|
||||
answerDetails: progress.answerDetails,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ import {
|
||||
ChevronUp,
|
||||
ClipboardCheck,
|
||||
Download,
|
||||
FileText,
|
||||
PlayCircle,
|
||||
RefreshCcw,
|
||||
ShieldCheck,
|
||||
Target,
|
||||
User,
|
||||
FileText,
|
||||
Video,
|
||||
Lock,
|
||||
XCircle,
|
||||
@@ -30,6 +30,9 @@ import { useTrainingWorkspace } from '@/features/chat/composables/useTrainingWor
|
||||
import FilePreviewModal from '@/shared/components/FilePreviewModal.vue';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { resolveTrainingExamPdfGuide, type TrainingGuideLike } from '@/features/chat/training/trainingWorkspace.utils';
|
||||
import { getMyTrainingConfig } from '@/features/chat/api/training.api';
|
||||
import type { TrainingRecord } from '@/features/chat/training/training.types';
|
||||
import html2pdf from 'html2pdf.js';
|
||||
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
@@ -98,6 +101,74 @@ const handleVideoEnded = () => {
|
||||
workspace.stopMaterialTimer();
|
||||
};
|
||||
|
||||
const reportModalVisible = ref(false);
|
||||
const currentReportRecord = ref<TrainingRecord | null>(null);
|
||||
const reportQuestions = ref<Record<string, any>>({});
|
||||
const reportLoading = ref(false);
|
||||
|
||||
const openReport = async (record: TrainingRecord) => {
|
||||
currentReportRecord.value = record;
|
||||
reportModalVisible.value = true;
|
||||
reportLoading.value = true;
|
||||
try {
|
||||
const config = await getMyTrainingConfig(record.trainingType || 'onboarding');
|
||||
const qMap: Record<string, any> = {};
|
||||
if (config?.resources) {
|
||||
config.resources.forEach(r => {
|
||||
if (Array.isArray(r.inlineQuestions)) {
|
||||
r.inlineQuestions.forEach((q: any) => {
|
||||
qMap[q.id] = q;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
reportQuestions.value = qMap;
|
||||
} catch (err) {
|
||||
console.error('Failed to load config for report', err);
|
||||
} finally {
|
||||
reportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const closeReport = () => {
|
||||
reportModalVisible.value = false;
|
||||
currentReportRecord.value = null;
|
||||
};
|
||||
|
||||
const printReport = async () => {
|
||||
const element = document.getElementById('report-modal-content');
|
||||
const report = currentReportRecord.value;
|
||||
if (!element || !report) return;
|
||||
const fileName = `${report.name}_${report.trainingType === 'onboarding' ? t('chat.training.hr.filters.typeOnboarding') : report.trainingType === 'safety' ? t('chat.training.hr.filters.typeSafety') : report.trainingType}_考试报告.pdf`;
|
||||
|
||||
const opt = {
|
||||
margin: [15, 15, 15, 15] as [number, number, number, number],
|
||||
filename: fileName,
|
||||
image: { type: 'jpeg' as const, quality: 0.98 },
|
||||
html2canvas: {
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
letterRendering: true,
|
||||
windowWidth: 794,
|
||||
scrollX: 0,
|
||||
scrollY: 0,
|
||||
},
|
||||
pagebreak: {
|
||||
mode: ['css', 'legacy'] as const,
|
||||
avoid: ['.report-question', '.report-header-info', '.report-option'] as string[],
|
||||
},
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' as const }
|
||||
};
|
||||
|
||||
try {
|
||||
await html2pdf().set(opt).from(element).save();
|
||||
msg.success(t('chat.training.hr.report.downloadSuccess') || 'PDF 下载成功');
|
||||
} catch (error) {
|
||||
console.error('Failed to generate PDF:', error);
|
||||
msg.error(t('chat.training.hr.report.downloadFailed') || 'PDF 生成失败');
|
||||
}
|
||||
};
|
||||
|
||||
const reportVideoDebugEvent = (event: Event) => {
|
||||
const video = event.target as HTMLVideoElement;
|
||||
// #region debug-point A-E:ios-video-runtime
|
||||
@@ -1296,11 +1367,13 @@ const currentSafetyStageText = computed(() => {
|
||||
<tr>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.joinDate') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.completionDate') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.trainingType') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.department') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.name') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.employeeId') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.score') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.attempts') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.trainingReport') }}</th>
|
||||
<th class="border-b border-default px-3 py-2.5 text-left font-semibold text-primary">{{ $t('chat.training.hr.columns.status') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -1308,11 +1381,18 @@ const currentSafetyStageText = computed(() => {
|
||||
<tr v-for="record in workspace.filteredRecords" :key="record.id" class="odd:bg-white even:bg-surface-soft/30">
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.joinDate }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.completionDate || '--' }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.trainingType === 'onboarding' ? $t('chat.training.hr.filters.typeOnboarding') : record.trainingType === 'safety' ? $t('chat.training.hr.filters.typeSafety') : (record.trainingType || '--') }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.department }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 font-medium text-primary">{{ record.name }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.employeeId }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.score ?? '--' }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">{{ record.attempts }}</td>
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">
|
||||
<button v-if="record.status === 'passed' || record.status === 'failed'" @click="openReport(record)" class="text-brand-600 hover:text-brand-700 transition" :title="$t('chat.training.hr.report.title')">
|
||||
<FileText class="w-5 h-5" />
|
||||
</button>
|
||||
<span v-else class="text-muted">--</span>
|
||||
</td>
|
||||
<td class="border-b border-default px-3 py-2.5">
|
||||
<span
|
||||
class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold"
|
||||
@@ -1381,5 +1461,196 @@ const currentSafetyStageText = computed(() => {
|
||||
:required-duration="workspace.currentViewingMaterialRequiredDuration"
|
||||
@update:modelValue="handlePreviewClose"
|
||||
/>
|
||||
|
||||
<div v-if="reportModalVisible" class="fixed inset-0 z-[100] flex items-center justify-center bg-slate-950/80 p-4 backdrop-blur-sm" @click.self="closeReport">
|
||||
<div class="relative w-full max-w-4xl max-h-[90vh] flex flex-col overflow-hidden rounded-3xl bg-white shadow-2xl">
|
||||
<div class="flex items-center justify-between border-b border-default px-6 py-4">
|
||||
<h3 class="text-lg font-semibold text-primary">{{ $t('chat.training.hr.report.title') }}</h3>
|
||||
<div class="flex items-center gap-3">
|
||||
<button @click="printReport" class="flex items-center gap-2 rounded-xl bg-brand-50 px-4 py-2 text-sm font-medium text-brand-600 transition hover:bg-brand-100">
|
||||
<Download class="w-4 h-4" />
|
||||
{{ $t('chat.training.hr.report.download') }}
|
||||
</button>
|
||||
<button @click="closeReport" class="flex h-8 w-8 items-center justify-center rounded-full bg-surface-soft text-secondary hover:bg-surface hover:text-primary transition">
|
||||
<XCircle class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 overflow-y-auto p-6 report-print-container" id="report-modal-content">
|
||||
<div class="report-pdf-page">
|
||||
<div v-if="reportLoading" class="flex h-full items-center justify-center">
|
||||
<div class="h-8 w-8 animate-spin rounded-full border-4 border-brand-200 border-t-brand-600"></div>
|
||||
</div>
|
||||
<div v-else-if="currentReportRecord">
|
||||
<!-- Header Info -->
|
||||
<div class="report-header-info mb-8 rounded-2xl bg-surface-soft p-6">
|
||||
<h2 class="mb-4 text-center text-2xl font-bold text-primary">{{ currentReportRecord.trainingType === 'onboarding' ? $t('chat.training.hr.filters.typeOnboarding') : currentReportRecord.trainingType === 'safety' ? $t('chat.training.hr.filters.typeSafety') : currentReportRecord.trainingType }} {{ $t('chat.training.hr.report.title') }}</h2>
|
||||
<div class="grid grid-cols-2 gap-4 sm:grid-cols-4">
|
||||
<div>
|
||||
<div class="text-xs text-secondary">{{ $t('chat.training.hr.columns.name') }}</div>
|
||||
<div class="font-medium text-primary">{{ currentReportRecord.name }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-secondary">{{ $t('chat.training.hr.columns.department') }}</div>
|
||||
<div class="font-medium text-primary">{{ currentReportRecord.department }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-secondary">{{ $t('chat.training.hr.columns.employeeId') }}</div>
|
||||
<div class="font-medium text-primary">{{ currentReportRecord.employeeId }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-xs text-secondary">{{ $t('chat.training.hr.columns.score') }}</div>
|
||||
<div class="font-medium" :class="currentReportRecord.status === 'passed' ? 'text-emerald-600' : 'text-rose-600'">
|
||||
{{ currentReportRecord.score ?? '--' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Exam Details -->
|
||||
<div class="space-y-6">
|
||||
<div v-for="(answer, idx) in currentReportRecord.answerDetails || []" :key="answer.questionId" class="report-question rounded-xl border border-default p-4">
|
||||
<div class="report-question-header mb-3">
|
||||
<div class="report-question-title font-medium text-primary">
|
||||
<span class="mr-2 text-secondary">{{ idx + 1 }}.</span>
|
||||
{{ reportQuestions[answer.questionId]?.prompt || `[ID: ${answer.questionId}]` }}
|
||||
</div>
|
||||
<div class="report-question-result">
|
||||
<span v-if="answer.correct" class="inline-flex rounded-full bg-emerald-50 px-2 py-1 text-xs font-semibold text-emerald-700">正确</span>
|
||||
<span v-else class="inline-flex rounded-full bg-rose-50 px-2 py-1 text-xs font-semibold text-rose-700">错误</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="report-options pl-6">
|
||||
<div v-for="(opt, optIdx) in reportQuestions[answer.questionId]?.options || []" :key="opt.id"
|
||||
class="report-option text-sm"
|
||||
:class="{
|
||||
'font-semibold text-emerald-600': opt.id === reportQuestions[answer.questionId]?.answer,
|
||||
'text-rose-600': !answer.correct && opt.id === answer.selectedOptionId,
|
||||
'text-secondary': opt.id !== reportQuestions[answer.questionId]?.answer && opt.id !== answer.selectedOptionId
|
||||
}"
|
||||
>
|
||||
<span class="report-option-marker"
|
||||
:class="{
|
||||
'border-emerald-200 bg-emerald-50 text-emerald-600': opt.id === reportQuestions[answer.questionId]?.answer,
|
||||
'border-rose-200 bg-rose-50 text-rose-600': !answer.correct && opt.id === answer.selectedOptionId,
|
||||
'border-default': opt.id !== reportQuestions[answer.questionId]?.answer && opt.id !== answer.selectedOptionId
|
||||
}"
|
||||
> {{ String.fromCharCode(65 + Number(optIdx)) }}</span>
|
||||
<span class="report-option-text">{{ opt.label }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="!reportQuestions[answer.questionId]" class="text-sm text-secondary">
|
||||
<div class="mb-1">Selected Option: {{ answer.selectedOptionId }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!currentReportRecord.answerDetails?.length" class="text-center text-sm text-secondary py-8">
|
||||
{{ $t('chat.training.hr.report.noReport') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.report-pdf-page {
|
||||
width: 100%;
|
||||
max-width: 794px;
|
||||
min-height: 1123px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.report-question-header {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: start;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.report-question-title {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.report-question-result {
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.report-options {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.report-header-info,
|
||||
.report-question,
|
||||
.report-option {
|
||||
break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.report-question {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.report-option {
|
||||
display: grid;
|
||||
grid-template-columns: 1.25rem minmax(0, 1fr);
|
||||
align-items: start;
|
||||
column-gap: 0.5rem;
|
||||
min-width: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.report-option-marker {
|
||||
display: inline-flex;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
border-width: 1px;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.report-option-text {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body > *:not(.report-print-container) {
|
||||
display: none !important;
|
||||
}
|
||||
.report-print-container {
|
||||
position: absolute !important;
|
||||
left: 0 !important;
|
||||
top: 0 !important;
|
||||
width: 794px !important;
|
||||
max-width: none !important;
|
||||
min-height: 1123px !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: visible !important;
|
||||
background: white !important;
|
||||
}
|
||||
.report-pdf-page {
|
||||
width: 794px !important;
|
||||
max-width: none !important;
|
||||
min-height: 1123px !important;
|
||||
margin: 0 !important;
|
||||
padding: 32px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -102,6 +102,7 @@ export interface TrainingRecord {
|
||||
score: number | null;
|
||||
attempts: number;
|
||||
status: TrainingRecordStatus;
|
||||
answerDetails?: TrainingAnswerRecord[];
|
||||
}
|
||||
|
||||
export interface TrainingProgressRecord extends TrainingRecord {
|
||||
|
||||
@@ -1128,13 +1128,23 @@
|
||||
"columns": {
|
||||
"joinDate": "Join date",
|
||||
"completionDate": "Completion date",
|
||||
"trainingType": "Training Type",
|
||||
"department": "Department",
|
||||
"name": "Name",
|
||||
"employeeId": "Employee ID",
|
||||
"score": "Score",
|
||||
"attempts": "Attempts",
|
||||
"trainingReport": "Training Report",
|
||||
"status": "Status"
|
||||
},
|
||||
"report": {
|
||||
"title": "Exam Report",
|
||||
"download": "Download PDF",
|
||||
"noReport": "No Report",
|
||||
"downloading": "Generating PDF, please wait...",
|
||||
"downloadSuccess": "PDF downloaded successfully",
|
||||
"downloadFailed": "Failed to generate PDF"
|
||||
},
|
||||
"status": {
|
||||
"passed": "Passed",
|
||||
"failed": "Failed",
|
||||
|
||||
@@ -1128,13 +1128,23 @@
|
||||
"columns": {
|
||||
"joinDate": "วันที่เริ่มงาน",
|
||||
"completionDate": "วันที่เสร็จสิ้น",
|
||||
"trainingType": "ประเภทการฝึกอบรม",
|
||||
"department": "แผนก",
|
||||
"name": "ชื่อ",
|
||||
"employeeId": "รหัสพนักงาน",
|
||||
"score": "คะแนน",
|
||||
"attempts": "จำนวนครั้ง",
|
||||
"trainingReport": "รายงานการฝึกอบรม",
|
||||
"status": "สถานะ"
|
||||
},
|
||||
"report": {
|
||||
"title": "รายงานการสอบ",
|
||||
"download": "ดาวน์โหลด PDF",
|
||||
"noReport": "ไม่มีรายงาน",
|
||||
"downloading": "กำลังสร้าง PDF กรุณารอสักครู่...",
|
||||
"downloadSuccess": "ดาวน์โหลด PDF สำเร็จ",
|
||||
"downloadFailed": "สร้าง PDF ไม่สำเร็จ"
|
||||
},
|
||||
"status": {
|
||||
"passed": "ผ่านแล้ว",
|
||||
"failed": "ไม่ผ่าน",
|
||||
|
||||
@@ -1235,13 +1235,23 @@
|
||||
"columns": {
|
||||
"joinDate": "入职日期",
|
||||
"completionDate": "完成日期",
|
||||
"trainingType": "培训类型",
|
||||
"department": "部门",
|
||||
"name": "姓名",
|
||||
"employeeId": "工号",
|
||||
"score": "分数",
|
||||
"attempts": "考试次数",
|
||||
"trainingReport": "培训报告",
|
||||
"status": "状态"
|
||||
},
|
||||
"report": {
|
||||
"title": "考试报告",
|
||||
"download": "下载 PDF",
|
||||
"noReport": "暂无报告",
|
||||
"downloading": "正在生成 PDF,请稍候...",
|
||||
"downloadSuccess": "PDF 下载成功",
|
||||
"downloadFailed": "PDF 生成失败"
|
||||
},
|
||||
"status": {
|
||||
"passed": "已通过",
|
||||
"failed": "未通过",
|
||||
|
||||
@@ -1128,13 +1128,23 @@
|
||||
"columns": {
|
||||
"joinDate": "入職日期",
|
||||
"completionDate": "完成日期",
|
||||
"trainingType": "培訓類型",
|
||||
"department": "部門",
|
||||
"name": "姓名",
|
||||
"employeeId": "工號",
|
||||
"score": "分數",
|
||||
"attempts": "考試次數",
|
||||
"trainingReport": "培訓報告",
|
||||
"status": "狀態"
|
||||
},
|
||||
"report": {
|
||||
"title": "考試報告",
|
||||
"download": "下載 PDF",
|
||||
"noReport": "暫無報告",
|
||||
"downloading": "正在生成 PDF,請稍候...",
|
||||
"downloadSuccess": "PDF 下載成功",
|
||||
"downloadFailed": "PDF 生成失敗"
|
||||
},
|
||||
"status": {
|
||||
"passed": "已通過",
|
||||
"failed": "未通過",
|
||||
|
||||
Reference in new issue
Block a user