fix(培训课程):优化培训课程
This commit is contained in:
1 parent
e378e8b7fd
commit
aae041a0b4
19 files changed
+777
-188
No files matched your search
Generated
+317
@@ -28,6 +28,7 @@
|
||||
"papaparse": "^5.5.3",
|
||||
"pdfjs-dist": "^6.3.289",
|
||||
"pinia": "^3.0.4",
|
||||
"qrcode": "^1.5.4",
|
||||
"swiper": "^12.1.4",
|
||||
"tdesign-icons-vue-next": "0.4.4",
|
||||
"tdesign-vue-next": "^1.19.2",
|
||||
@@ -42,6 +43,7 @@
|
||||
"devDependencies": {
|
||||
"@tsconfig/node22": "^22.0.5",
|
||||
"@types/node": "^22.14.0",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@vitejs/plugin-vue": "6.0.6",
|
||||
"@vitejs/plugin-vue-jsx": "5.1.5",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
@@ -2113,6 +2115,16 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/qrcode": {
|
||||
"version": "1.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz",
|
||||
"integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/sortablejs": {
|
||||
"version": "1.15.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.8.tgz",
|
||||
@@ -2701,6 +2713,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
|
||||
@@ -2802,6 +2823,15 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/camelcase": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001774",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz",
|
||||
@@ -2830,6 +2860,35 @@
|
||||
"node": ">=6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cliui": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
|
||||
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"wrap-ansi": "^6.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
@@ -3448,6 +3507,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/delaunator": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz",
|
||||
@@ -3466,6 +3534,12 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dijkstrajs": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
|
||||
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/docx-preview": {
|
||||
"version": "0.3.7",
|
||||
"resolved": "https://registry.npmjs.org/docx-preview/-/docx-preview-0.3.7.tgz",
|
||||
@@ -3503,6 +3577,12 @@
|
||||
"integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.21.3",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.3.tgz",
|
||||
@@ -3744,6 +3824,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||
@@ -3813,6 +3906,15 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
@@ -3985,6 +4087,15 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-what": {
|
||||
"version": "4.1.16",
|
||||
"resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.16.tgz",
|
||||
@@ -4197,6 +4308,18 @@
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-locate": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash-es": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",
|
||||
@@ -4479,6 +4602,42 @@
|
||||
"npm": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-try": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-limit": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/p-try": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/package-manager-detector": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.6.0.tgz",
|
||||
@@ -4538,6 +4697,15 @@
|
||||
"integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||
@@ -4643,6 +4811,15 @@
|
||||
"pathe": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/pngjs": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
|
||||
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/points-on-curve": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
|
||||
@@ -4709,6 +4886,23 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/qrcode": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
|
||||
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dijkstrajs": "^1.0.1",
|
||||
"pngjs": "^5.0.0",
|
||||
"yargs": "^15.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"qrcode": "bin/qrcode"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/read-package-json-fast": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-4.0.0.tgz",
|
||||
@@ -4743,6 +4937,15 @@
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-from-string": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
||||
@@ -4752,6 +4955,12 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-main-filename": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/rfdc": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
|
||||
@@ -4869,6 +5078,12 @@
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/setimmediate": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
||||
@@ -4965,6 +5180,32 @@
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/stylis": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz",
|
||||
@@ -5563,6 +5804,41 @@
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which-module": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
|
||||
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi/node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx": {
|
||||
"version": "0.20.2",
|
||||
"resolved": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
||||
@@ -5575,12 +5851,53 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
|
||||
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "15.4.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
|
||||
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cliui": "^6.0.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"find-up": "^4.1.0",
|
||||
"get-caller-file": "^2.0.1",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^2.0.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^4.2.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^18.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "18.1.3",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
|
||||
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"camelcase": "^5.0.0",
|
||||
"decamelize": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
"papaparse": "^5.5.3",
|
||||
"pdfjs-dist": "^6.3.289",
|
||||
"pinia": "^3.0.4",
|
||||
"qrcode": "^1.5.4",
|
||||
"swiper": "^12.1.4",
|
||||
"tdesign-icons-vue-next": "0.4.4",
|
||||
"tdesign-vue-next": "^1.19.2",
|
||||
@@ -50,6 +51,7 @@
|
||||
"devDependencies": {
|
||||
"@tsconfig/node22": "^22.0.5",
|
||||
"@types/node": "^22.14.0",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@vitejs/plugin-vue": "6.0.6",
|
||||
"@vitejs/plugin-vue-jsx": "5.1.5",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
|
||||
@@ -100,6 +100,17 @@ export interface OrgImportEmployee {
|
||||
export const importEmployees = (employees: OrgImportEmployee[]) =>
|
||||
post<{ success: boolean; data: { imported: number } }>(`${base}/employees/import`, { employees })
|
||||
|
||||
export interface OrgUpdateEmployee {
|
||||
dept_id: string
|
||||
post?: string
|
||||
/** 留空表示不变更 */
|
||||
status?: string
|
||||
}
|
||||
|
||||
/** 修改员工档案(部门必填;姓名/工号随平台账号,不在可编辑范围)。 */
|
||||
export const updateEmployee = (id: string, payload: OrgUpdateEmployee) =>
|
||||
put<{ success: boolean; data: OrgEmployee }>(`${base}/employees/${enc(id)}`, payload)
|
||||
|
||||
// ---- 模块角色绑定 ----
|
||||
|
||||
export const listModuleMembers = (moduleKey: OrgModuleKey) =>
|
||||
|
||||
@@ -635,7 +635,7 @@ const TRAINING_TABS: { key: string; title: string }[] = [
|
||||
{ key: 'dashboard', title: '工作台' },
|
||||
{ key: 'plan', title: '培训计划' },
|
||||
{ key: 'course', title: '培训课程' },
|
||||
{ key: 'sign', title: '课堂签到' },
|
||||
{ key: 'sign', title: '培训签到' },
|
||||
{ key: 'study', title: '学习考试' },
|
||||
{ key: 'members', title: '职称角色' },
|
||||
];
|
||||
|
||||
@@ -156,7 +156,7 @@ const router = createRouter({
|
||||
meta: { requiresInit: true, requiresAuth: true }
|
||||
},
|
||||
{
|
||||
// 企业培训:子页(工作台/培训计划/培训课程/课堂签到/题库与考试/学习与错题/职称角色/配置中心)
|
||||
// 企业培训:子页(工作台/培训计划/培训课程/培训签到/学习考试/职称角色/配置中心)
|
||||
// 收纳为侧栏「企业培训」分组的子项,tab 取自路径参数,缺省重定向到工作台。
|
||||
path: "training",
|
||||
name: "training",
|
||||
@@ -176,6 +176,13 @@ const router = createRouter({
|
||||
component: () => import("../views/training/CourseDetail.vue"),
|
||||
meta: { requiresInit: true, requiresAuth: true }
|
||||
},
|
||||
{
|
||||
// 学员扫码签到页:培训签到页二维码落地页,携 token 自动定位并签到(需登录态)。
|
||||
path: "training/checkin/:token",
|
||||
name: "trainingCheckin",
|
||||
component: () => import("../views/training/CheckinPage.vue"),
|
||||
meta: { requiresInit: true, requiresAuth: true }
|
||||
},
|
||||
{
|
||||
// 组织架构:租户级共享组织架构(部门 + 员工档案),
|
||||
// 业务模块(企业培训等)按需引用,部门岗位只维护一份。
|
||||
|
||||
@@ -48,8 +48,14 @@
|
||||
<template #dept_name="{ row }">{{ row.dept_name || '-' }}</template>
|
||||
<template #status="{ row }">
|
||||
<t-tag v-if="row.status === 'active'" theme="success" variant="light" size="small">在职</t-tag>
|
||||
<t-tag v-else-if="row.status === 'inactive'" theme="danger" variant="light" size="small">离职</t-tag>
|
||||
<t-tag v-else theme="default" variant="light" size="small">{{ row.status || '-' }}</t-tag>
|
||||
</template>
|
||||
<template #op="{ row }">
|
||||
<div class="op-group">
|
||||
<t-button variant="text" theme="primary" size="small" @click="onEditEmployee(row)">修改</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -114,6 +120,36 @@
|
||||
<t-button theme="primary" :loading="saving" :disabled="!pickerUserIds.length || !pickerDeptId" @click="onPickImport">添加到名册</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
|
||||
<!-- 修改员工档案:部门/岗位/状态可编辑;姓名与工号随平台账号只读展示 -->
|
||||
<t-dialog v-model:visible="employeeFormVisible" header="修改员工档案" width="460">
|
||||
<t-form label-width="80">
|
||||
<t-form-item label="姓名">
|
||||
<t-input :value="employeeForm.user_name || '-'" readonly />
|
||||
</t-form-item>
|
||||
<t-form-item label="工号">
|
||||
<t-input :value="employeeForm.employee_no || '-'" readonly />
|
||||
</t-form-item>
|
||||
<t-form-item label="部门" required>
|
||||
<t-select v-model="employeeForm.dept_id" filterable placeholder="必选,请从左侧部门中选择" style="width: 100%">
|
||||
<t-option v-for="d in depts" :key="d.id" :value="d.id" :label="d.name" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
<t-form-item label="岗位">
|
||||
<t-input v-model="employeeForm.post" placeholder="如 设备技师" />
|
||||
</t-form-item>
|
||||
<t-form-item label="状态">
|
||||
<t-select v-model="employeeForm.status" style="width: 100%">
|
||||
<t-option value="active" label="在职" />
|
||||
<t-option value="inactive" label="离职" />
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<div class="form-hint">姓名与工号随平台账号维护,不在修改范围。</div>
|
||||
<template #footer>
|
||||
<t-button theme="primary" :loading="saving" @click="onSaveEmployee">保存</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -127,6 +163,7 @@ import {
|
||||
listEmployees,
|
||||
listPlatformUsers,
|
||||
saveDept,
|
||||
updateEmployee,
|
||||
type OrgDept,
|
||||
type OrgEmployee,
|
||||
type OrgPlatformUser,
|
||||
@@ -152,18 +189,25 @@ const pickerUserIds = ref<string[]>([])
|
||||
const pickerDeptId = ref('')
|
||||
const pickerPost = ref('')
|
||||
|
||||
// 员工档案修改(姓名/工号随平台账号,只读;部门/岗位/状态可编辑)
|
||||
const employeeFormVisible = ref(false)
|
||||
const employeeForm = ref({ id: '', user_name: '', employee_no: '', dept_id: '', post: '', status: 'active' })
|
||||
|
||||
const deptColumns = [
|
||||
{ colKey: 'name', title: '部门名称' },
|
||||
{ colKey: 'code', title: '编码', width: 140 },
|
||||
{ colKey: 'op', title: '操作', width: 140 },
|
||||
// 窄屏下列宽超出面板时操作列随滚动固定在右侧,保证可见可点
|
||||
{ colKey: 'op', title: '操作', width: 140, fixed: 'right' },
|
||||
]
|
||||
|
||||
const employeeColumns = [
|
||||
{ colKey: 'employee_no', title: '工号', width: 100 },
|
||||
{ colKey: 'employee_no', title: '工号', width: 90 },
|
||||
{ colKey: 'user_name', title: '姓名' },
|
||||
{ colKey: 'dept_name', title: '部门', width: 120 },
|
||||
{ colKey: 'post', title: '岗位', width: 150 },
|
||||
{ colKey: 'status', title: '状态', width: 80 },
|
||||
{ colKey: 'dept_name', title: '部门', width: 110 },
|
||||
{ colKey: 'post', title: '岗位', width: 140 },
|
||||
{ colKey: 'status', title: '状态', width: 76 },
|
||||
// 列总宽超出面板宽度时固定在右侧,避免"修改"按钮被横向滚动挤出可视区
|
||||
{ colKey: 'op', title: '操作', width: 84, fixed: 'right' },
|
||||
]
|
||||
|
||||
// 姓名 = 真实姓名(来自 OIDC displayName claim):优先取后端联查的 user_name,
|
||||
@@ -283,6 +327,42 @@ const onPickImport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改员工档案:回填当前行(姓名经 employeeName 联查兜底)。
|
||||
const onEditEmployee = (row: OrgEmployee) => {
|
||||
employeeForm.value = {
|
||||
id: row.id,
|
||||
user_name: employeeName(row),
|
||||
employee_no: row.employee_no || '',
|
||||
dept_id: row.dept_id || '',
|
||||
post: row.post || '',
|
||||
status: row.status || 'active',
|
||||
}
|
||||
employeeFormVisible.value = true
|
||||
}
|
||||
|
||||
const onSaveEmployee = async () => {
|
||||
// 部门必填,且必须命中左侧部门(与导入同规)。
|
||||
if (!employeeForm.value.dept_id) {
|
||||
MessagePlugin.warning('请选择部门')
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
try {
|
||||
await updateEmployee(employeeForm.value.id, {
|
||||
dept_id: employeeForm.value.dept_id,
|
||||
post: employeeForm.value.post.trim(),
|
||||
status: employeeForm.value.status,
|
||||
})
|
||||
MessagePlugin.success('员工档案已更新')
|
||||
employeeFormVisible.value = false
|
||||
loadAll()
|
||||
} catch {
|
||||
MessagePlugin.error('保存失败')
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 按名称/编码/ID 把导入行里的部门解析成部门列表的 dept id。
|
||||
const resolveDeptId = (raw?: string) => {
|
||||
const key = (raw || '').trim()
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<!-- 学员扫码签到落地页:培训签到页二维码 → 企微/相机扫码直达,自动定位并提交签到 -->
|
||||
<div class="checkin-page">
|
||||
<div class="checkin-card">
|
||||
<div class="checkin-card__icon" :class="`is-${state}`">
|
||||
<!-- 定位中/提交中 -->
|
||||
<svg v-if="state === 'pending'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="3.2" />
|
||||
<path d="M12 2v3M12 19v3M2 12h3M19 12h3" />
|
||||
</svg>
|
||||
<!-- 成功 -->
|
||||
<svg v-else-if="state === 'success'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<path d="m8.5 12.2 2.4 2.4 4.8-4.9" />
|
||||
</svg>
|
||||
<!-- 失败 -->
|
||||
<svg v-else viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<path d="M12 7.5V13" />
|
||||
<path d="M12 16.4h.01" />
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<h2 class="checkin-card__title">{{ title }}</h2>
|
||||
<p class="checkin-card__hint">{{ hint }}</p>
|
||||
|
||||
<t-tag v-if="record" :theme="record.status === 'normal' ? 'success' : 'warning'" variant="light" size="medium">
|
||||
{{ record.status === 'normal' ? '签到成功' : record.status === 'late' ? '迟到签到' : '已提交,待复核' }}
|
||||
</t-tag>
|
||||
|
||||
<div class="checkin-card__actions">
|
||||
<t-button v-if="state === 'error'" theme="primary" @click="submit">重新签到</t-button>
|
||||
<t-button variant="outline" @click="goTraining">前往企业培训</t-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import { checkin, unwrap, type TrainingSignRecord } from '@/api/training'
|
||||
import { fmtBeijingTime } from '@/utils/datetime'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
type CheckinState = 'pending' | 'success' | 'error'
|
||||
const state = ref<CheckinState>('pending')
|
||||
const record = ref<TrainingSignRecord | null>(null)
|
||||
const errorMsg = ref('')
|
||||
// 定位坐标:拒绝授权/不可用时以 0,0 提交,由后端 sign_policy(强制定位)决定是否放行
|
||||
const geo = ref({ lat: 0, lng: 0 })
|
||||
|
||||
const title = computed(() => {
|
||||
if (state.value === 'pending') return '正在签到…'
|
||||
if (state.value === 'success') return '签到完成'
|
||||
return '签到失败'
|
||||
})
|
||||
const hint = computed(() => {
|
||||
if (state.value === 'pending') return '正在获取定位并提交签到,请保持页面打开'
|
||||
if (state.value === 'success') return `签到时间:${fmtBeijingTime(record.value?.signed_at || null) || '—'}`
|
||||
return errorMsg.value || '签到码无效或已过期,请联系讲师刷新签到码'
|
||||
})
|
||||
|
||||
// 取定位:最多等 6 秒,失败不阻塞签到(是否强制定位由后端规则决定)
|
||||
const locate = () =>
|
||||
new Promise<void>((resolve) => {
|
||||
if (!navigator.geolocation) return resolve()
|
||||
const timer = window.setTimeout(resolve, 6000)
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(pos) => {
|
||||
window.clearTimeout(timer)
|
||||
geo.value = { lat: pos.coords.latitude, lng: pos.coords.longitude }
|
||||
resolve()
|
||||
},
|
||||
() => {
|
||||
window.clearTimeout(timer)
|
||||
MessagePlugin.warning('未获取到定位,如课程开启定位校验将无法签到')
|
||||
resolve()
|
||||
},
|
||||
{ timeout: 5500, maximumAge: 30000 },
|
||||
)
|
||||
})
|
||||
|
||||
const submit = async () => {
|
||||
state.value = 'pending'
|
||||
const token = String(route.params.token || '')
|
||||
if (!token) {
|
||||
state.value = 'error'
|
||||
errorMsg.value = '签到链接不完整'
|
||||
return
|
||||
}
|
||||
await locate()
|
||||
try {
|
||||
const res = await checkin(token, geo.value.lat, geo.value.lng, 'wecom_scan')
|
||||
record.value = (unwrap(res) as TrainingSignRecord | undefined) || null
|
||||
state.value = 'success'
|
||||
} catch (e: any) {
|
||||
state.value = 'error'
|
||||
errorMsg.value = e?.response?.data?.message || '签到码无效或已过期,请联系讲师刷新签到码'
|
||||
}
|
||||
}
|
||||
|
||||
const goTraining = () => {
|
||||
router.push('/platform/training/dashboard')
|
||||
}
|
||||
|
||||
onMounted(submit)
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.checkin-page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 60vh;
|
||||
padding: var(--app-space-4);
|
||||
}
|
||||
|
||||
.checkin-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: min(420px, 100%);
|
||||
padding: 40px 32px;
|
||||
background: var(--td-bg-color-container);
|
||||
border: 1px solid var(--td-component-stroke);
|
||||
border-radius: var(--app-radius-lg, 12px);
|
||||
text-align: center;
|
||||
|
||||
&__icon {
|
||||
display: inline-flex;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
|
||||
svg {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
&.is-pending {
|
||||
color: var(--td-brand-color);
|
||||
background: var(--td-brand-color-1, rgba(0, 82, 217, 0.08));
|
||||
animation: checkin-breath 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
&.is-success {
|
||||
color: var(--td-success-color);
|
||||
background: var(--td-success-color-1, rgba(0, 168, 112, 0.08));
|
||||
}
|
||||
|
||||
&.is-error {
|
||||
color: var(--td-error-color);
|
||||
background: var(--td-error-color-1, rgba(227, 77, 89, 0.08));
|
||||
}
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin: 4px 0 0;
|
||||
font-size: var(--app-text-xl, 20px);
|
||||
}
|
||||
|
||||
&__hint {
|
||||
margin: 0;
|
||||
color: var(--td-text-color-secondary);
|
||||
font-size: var(--app-text-md);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes checkin-breath {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.55; }
|
||||
}
|
||||
</style>
|
||||
@@ -377,6 +377,8 @@ const loadAll = async () => {
|
||||
const exam = r && unwrap<{ record: TrainingExamRecord | null; passed: boolean }>(r)
|
||||
examRecord.value = exam?.record || null
|
||||
examPassed.value = !!exam?.passed
|
||||
// [2026-11 需求] 进入有课件的课程默认打开第一个课件,免手动从左侧选择
|
||||
if (materials.value.length) void openMaterial(materials.value[0])
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</template>
|
||||
<template v-else-if="activeTab === 'sign'">
|
||||
<SignPanel v-if="canManageTabs" :roles="myRoles" :admin="isAdmin" />
|
||||
<t-empty v-else class="training-empty" description="课堂签到仅课长/经理/人事/讲师可见" />
|
||||
<t-empty v-else class="training-empty" description="培训签到仅课长/经理/人事/讲师可见" />
|
||||
</template>
|
||||
<StudyPanel v-else-if="activeTab === 'study'" :roles="myRoles" :admin="isAdmin" />
|
||||
<template v-else-if="activeTab === 'members'">
|
||||
@@ -83,7 +83,7 @@ const TRAINING_TABS_META: Record<string, { title: string; desc: string }> = {
|
||||
dashboard: { title: '工作台', desc: '培训运营总览、待办与达成率一览' },
|
||||
plan: { title: '培训计划', desc: '年度培训需求收集与汇总(可切换年度)' },
|
||||
course: { title: '培训课程', desc: '课程资产库、场次安排与学员名单;课件自动同步知识库' },
|
||||
sign: { title: '课堂签到', desc: '签到码生成、签到明细复核与佐证导出' },
|
||||
sign: { title: '培训签到', desc: '签到码生成、签到明细复核与佐证导出' },
|
||||
study: { title: '学习考试', desc: '我的课程学习、课程学习情况、课程考试情况与 AI 课程分析' },
|
||||
members: { title: '职称角色', desc: '名册来自「组织架构」,此处维护员工职称角色' },
|
||||
rules: { title: '配置中心', desc: '培训业务规则在线配置,改配置不改代码' },
|
||||
@@ -111,7 +111,7 @@ const isAdmin = computed(() =>
|
||||
myRoles.value.some((r) => r === 'hr') ||
|
||||
authStore.hasRole('admin'))
|
||||
|
||||
// 培训管理页签(培训计划/培训课程/课堂签到)门槛:课长/经理/人事/讲师
|
||||
// 培训管理页签(培训计划/培训课程/培训签到)门槛:课长/经理/人事/讲师
|
||||
// (myRoles 已按权限组展开,自定义角色继承系统角色后自动生效)。
|
||||
const canManageTabs = computed(() =>
|
||||
isAdmin.value ||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<p class="ai-hint">
|
||||
汇总{{ scopeHint }}的课程学习、考试成绩、课堂签到与错题情况,由大模型生成本次分析报告与指导建议。
|
||||
汇总{{ scopeHint }}的课程学习、考试成绩、培训签到与错题情况,由大模型生成本次分析报告与指导建议。
|
||||
分析约需数十秒,请耐心等待。
|
||||
</p>
|
||||
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
</div>
|
||||
|
||||
<!-- 汇总行:与设计稿一致(共 N 门 · 线上 / 线下 / 本月新增或课件数)。
|
||||
待维护 = 我任讲师且未发布(草稿/待审)、或已发布但未上传课件的课程数
|
||||
(2026-11 需求:>0 时用与「草稿」一致的橙色提醒,不再用红色)。 -->
|
||||
待维护 = 我主讲且「草稿」状态的课程数(2026-11 需求;>0 时用与「草稿」一致的橙色提醒)。
|
||||
待开始 = 已排期且开课时间未到的课程数(按「我的课程」口径:我主讲/我参加,2026-11 需求)。 -->
|
||||
<div class="catalog-stats">
|
||||
{{ statsText }}
|
||||
<span class="catalog-stats__maintain" :class="{ 'is-alert': maintainCount > 0 }">待维护 {{ maintainCount }} 门</span>
|
||||
<span class="catalog-stats__pending" :class="{ 'is-info': pendingStartCount > 0 }">待开始 {{ pendingStartCount }} 门</span>
|
||||
</div>
|
||||
|
||||
<!-- 课程卡片网格 -->
|
||||
@@ -181,10 +182,19 @@ const myTeachingCourses = computed<TrainingCourse[]>(() => {
|
||||
return [...map.values()]
|
||||
})
|
||||
|
||||
// 待维护 = 我任讲师且未发布(草稿/待审)、或已发布但未上传课件的课程
|
||||
// (线上课发布强制有课件,实际命中的多为线下课:学员通知在课件上传前不会推送)
|
||||
// 「我的课程」数据源:我相关的已发布课 + 我任讲师的课(含未发布,按 id 去重);
|
||||
// 页签列表与「待开始」统计共用同一口径。
|
||||
const myCoursesSource = computed<TrainingCourse[]>(() => {
|
||||
const minePublished = publishedCourses.value.filter(isMyCourse)
|
||||
const mineIds = new Set(minePublished.map((c) => c.id))
|
||||
return [...minePublished, ...myTeachingCourses.value.filter((c) => !mineIds.has(c.id))]
|
||||
})
|
||||
|
||||
// 待维护 = 我主讲且「草稿」状态的课程(2026-11 需求:待审/已发布缺课件不再计入统计)
|
||||
const maintainCount = computed(() => myTeachingCourses.value.filter((c) => c.status === 'draft').length)
|
||||
|
||||
// 置顶排序/维护按钮仍关注未发布(草稿/待审)或已发布但未上传课件的课程
|
||||
const needsMaintain = (c: TrainingCourse) => c.status !== 'published' || !c.material_ids?.length
|
||||
const maintainCount = computed(() => myTeachingCourses.value.filter(needsMaintain).length)
|
||||
|
||||
// 线下课排期索引:取最近一场排期/已完成场次汇总
|
||||
const sessionByCourse = computed(() => {
|
||||
@@ -197,6 +207,13 @@ const sessionByCourse = computed(() => {
|
||||
return map
|
||||
})
|
||||
|
||||
// [2026-11 需求] 待开始 = 已排期且开课时间还没到的课程(按「我的课程」口径统计)
|
||||
const hasUpcomingSession = (c: TrainingCourse) =>
|
||||
(sessionByCourse.value.get(c.id) || []).some(
|
||||
(s) => s.status === 'scheduled' && !!s.start_at && new Date(s.start_at).getTime() > Date.now(),
|
||||
)
|
||||
const pendingStartCount = computed(() => myCoursesSource.value.filter(hasUpcomingSession).length)
|
||||
|
||||
const typeText = (c: TrainingCourse) => (c.type === 'elective' ? '选修' : '必修')
|
||||
const fmtMonthDay = (raw: string | null) => {
|
||||
if (!raw) return ''
|
||||
@@ -247,11 +264,7 @@ const visibleCards = computed<CatalogCard[]>(() => {
|
||||
const kw = keyword.value.trim().toLowerCase()
|
||||
// 数据源:全部/线上/线下 = 已发布目录;我的课程 = 我相关的已发布课 + 我任讲师的课(含未发布,已发布的按 id 去重)
|
||||
let source = publishedCourses.value
|
||||
if (filter.value === 'mine') {
|
||||
const minePublished = publishedCourses.value.filter(isMyCourse)
|
||||
const mineIds = new Set(minePublished.map((c) => c.id))
|
||||
source = [...minePublished, ...myTeachingCourses.value.filter((c) => !mineIds.has(c.id))]
|
||||
}
|
||||
if (filter.value === 'mine') source = myCoursesSource.value
|
||||
let list = source.filter((c) => {
|
||||
if (filter.value === 'online' && c.mode !== 'online') return false
|
||||
if (filter.value === 'offline' && c.mode !== 'offline') return false
|
||||
@@ -259,7 +272,7 @@ const visibleCards = computed<CatalogCard[]>(() => {
|
||||
if (kw && !(c.name.toLowerCase().includes(kw) || (c.tags || []).some((t) => String(t).toLowerCase().includes(kw)))) return false
|
||||
return true
|
||||
})
|
||||
// [2026-11 需求] 「我的课程」排序:待维护(我主讲未发布/缺课件)置顶,
|
||||
// [2026-11 需求] 「我的课程」排序:需关注的课程(我主讲未发布/缺课件)置顶,
|
||||
// 其余按与当前时间的邻近度升序(临近开课/结课的在前,无时间锚点的排最后)
|
||||
if (filter.value === 'mine') {
|
||||
const now = Date.now()
|
||||
@@ -440,6 +453,16 @@ onMounted(loadAll)
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
// 待开始统计:与「已排期」状态同色(品牌色)
|
||||
&__pending {
|
||||
margin-left: 6px;
|
||||
|
||||
&.is-info {
|
||||
color: var(--td-brand-color);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.catalog-grid-wrap {
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
</div>
|
||||
|
||||
<t-table :data="filteredCourses" :columns="courseColumns" row-key="id" size="small" :loading="loading">
|
||||
<template #name="{ row }"><span class="clamp-2">{{ row.name }}</span></template>
|
||||
<template #name="{ row }">
|
||||
<span class="course-name-link clamp-2" title="点击前往培训签到" @click="goSignTab(row)">{{ row.name }}</span>
|
||||
</template>
|
||||
<template #mode="{ row }">
|
||||
<t-tag :theme="row.mode === 'online' ? 'primary' : 'default'" variant="light" size="small" :class="{ 'course-tag-offline': row.mode !== 'online' }">
|
||||
{{ row.mode === 'online' ? '线上' : '线下' }}
|
||||
@@ -536,6 +538,11 @@ const goStudyStatus = (row: TrainingCourse, section: 'learning' | 'exam') => {
|
||||
router.push({ path: '/platform/training/study', query: { section, courseId: row.id } })
|
||||
}
|
||||
|
||||
// 课程名称点击 → 培训签到页,携带 courseId 自动选中该课程的场次
|
||||
const goSignTab = (row: TrainingCourse) => {
|
||||
router.push({ path: '/platform/training/sign', query: { courseId: row.id } })
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const courses = ref<TrainingCourse[]>([])
|
||||
@@ -1766,15 +1773,17 @@ watch(() => route.query.courseId, openDetailFromRoute)
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
// 列表单元格内容垂直居中:用行内级 -webkit-inline-box 承接两行截断,
|
||||
// 配合下方 .t-table__cell 的 vertical-align: middle,单行/双行内容均随行居中
|
||||
.clamp-2 {
|
||||
display: -webkit-box;
|
||||
display: -webkit-inline-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
line-height: 1.5;
|
||||
min-height: 3em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// 学习/考试状态 tag 可点击跳转学习考试页
|
||||
@@ -1786,6 +1795,16 @@ watch(() => route.query.courseId, openDetailFromRoute)
|
||||
}
|
||||
}
|
||||
|
||||
// 课程名称可点击 → 培训签到页(与状态 tag 同款可点击观感,品牌色区分)
|
||||
.course-name-link {
|
||||
cursor: pointer;
|
||||
color: var(--td-brand-color);
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.course-panel :deep(.t-table .t-table__cell) {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -88,67 +88,6 @@
|
||||
</t-table>
|
||||
</div>
|
||||
|
||||
<!-- 月度培训计划与审批:经理/人事审批决策(通过/调整/驳回),课长可见本部门计划 -->
|
||||
<div class="panel-box">
|
||||
<div class="panel-box__header">
|
||||
<span class="panel-box__title plan-title-row">
|
||||
月度培训计划与审批({{ monthPlansYear }})
|
||||
<t-select
|
||||
v-model="monthPlansYear"
|
||||
class="year-select"
|
||||
:options="yearOptions"
|
||||
@change="loadMonthPlans"
|
||||
/>
|
||||
</span>
|
||||
<div class="panel-box__actions">
|
||||
<t-button v-if="isHr" variant="outline" :loading="rolling" @click="onRollMonthPlans">月底滚动未完成计划</t-button>
|
||||
<t-button variant="outline" @click="loadMonthPlans">刷新</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-table
|
||||
:data="monthPlans"
|
||||
:columns="monthPlanColumns"
|
||||
row-key="id"
|
||||
size="small"
|
||||
:loading="monthPlansLoading"
|
||||
>
|
||||
<template #dept_id="{ row }">{{ deptMap[row.dept_id] || row.dept_id || '-' }}</template>
|
||||
<template #start_at="{ row }">{{ fmtStartAt(row.start_at) }}</template>
|
||||
<template #status="{ row }">
|
||||
<t-tag v-if="row.status === 'approved'" theme="success" variant="light" size="small">已通过</t-tag>
|
||||
<t-tag v-else-if="row.status === 'rejected'" theme="danger" variant="light" size="small">已驳回</t-tag>
|
||||
<t-tag v-else-if="row.status === 'submitted'" theme="warning" variant="light" size="small">待审批</t-tag>
|
||||
<t-tag v-else-if="row.status === 'rolled'" theme="primary" variant="light" size="small">已滚动</t-tag>
|
||||
<t-tag v-else theme="default" variant="light" size="small">草稿</t-tag>
|
||||
</template>
|
||||
<template #reject_reason="{ row }">{{ row.reject_reason || '-' }}</template>
|
||||
<template #op="{ row }">
|
||||
<template v-if="canApprove && (row.status === 'submitted' || row.status === 'draft')">
|
||||
<t-button variant="text" theme="success" size="small" @click="onApprove(row, 'pass')">通过</t-button>
|
||||
<t-button variant="text" theme="warning" size="small" @click="onApprove(row, 'adjust')">调整</t-button>
|
||||
<t-button variant="text" theme="danger" size="small" @click="onApprove(row, 'reject')">驳回</t-button>
|
||||
</template>
|
||||
</template>
|
||||
</t-table>
|
||||
</div>
|
||||
|
||||
<!-- 审批意见弹窗(调整/驳回需填审批意见) -->
|
||||
<t-dialog v-model:visible="approveVisible" :header="approveTitle" width="420">
|
||||
<t-textarea
|
||||
v-model="approveReason"
|
||||
:autosize="{ minRows: 3 }"
|
||||
placeholder="请输入审批意见(调整/驳回建议注明原因)"
|
||||
/>
|
||||
<template #footer>
|
||||
<t-button variant="outline" @click="approveVisible = false">取消</t-button>
|
||||
<t-button
|
||||
:theme="approveAction === 'reject' ? 'danger' : 'primary'"
|
||||
:loading="approving"
|
||||
@click="onConfirmApprove"
|
||||
>确认</t-button>
|
||||
</template>
|
||||
</t-dialog>
|
||||
|
||||
<!-- 提报需求弹窗(编辑态复用:部门按提报人自动获取) -->
|
||||
<t-dialog v-model:visible="demandFormVisible" :header="demandDialogTitle" width="560">
|
||||
<t-form :data="demandForm" label-width="90" @submit="onSaveDemand">
|
||||
@@ -264,7 +203,6 @@ import * as XLSX from 'xlsx'
|
||||
import { DEMAND_TEMPLATE_KEY, downloadTrainingTemplate } from '../trainingTemplates'
|
||||
import { apiErrorMessage } from '@/utils/request'
|
||||
import {
|
||||
approveMonthPlan,
|
||||
broadcastTrainingNotification,
|
||||
confirmDemand,
|
||||
deleteDemand,
|
||||
@@ -274,12 +212,9 @@ import {
|
||||
listDepts,
|
||||
listLecturers,
|
||||
listMembers,
|
||||
listMonthPlans,
|
||||
rollMonthPlans,
|
||||
saveDemand,
|
||||
type TrainingDept,
|
||||
type TrainingDemand,
|
||||
type TrainingMonthPlan,
|
||||
type TrainingLecturerOption,
|
||||
type TrainingMember,
|
||||
unwrap,
|
||||
@@ -289,10 +224,6 @@ const props = defineProps<{ roles: string[]; admin?: boolean }>()
|
||||
|
||||
// 计划管理(录入/推送/排课):人事/课长(roles 已按权限组展开,经理自动命中课长)
|
||||
const canManage = computed(() => props.admin || props.roles.some((r) => r === 'hr' || r === 'supervisor'))
|
||||
// 审批决策:经理(exec)/人事 — 与后端 ApproveMonthPlan 的 requireRoles 口径一致
|
||||
const canApprove = computed(() => props.admin || props.roles.some((r) => r === 'hr' || r === 'exec'))
|
||||
// 月底滚动等运营动作仅人事
|
||||
const isHr = computed(() => props.admin || props.roles.includes('hr'))
|
||||
|
||||
const now = new Date()
|
||||
const currentYear = now.getFullYear()
|
||||
@@ -468,98 +399,12 @@ const loadFormOptions = async () => {
|
||||
const loadAll = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
await Promise.all([loadDemands(), loadMonthPlans()])
|
||||
await loadDemands()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 月度培训计划与审批 ----
|
||||
|
||||
const monthPlans = ref<TrainingMonthPlan[]>([])
|
||||
const monthPlansLoading = ref(false)
|
||||
const monthPlansYear = ref(currentYear)
|
||||
|
||||
const monthPlanColumns = [
|
||||
{ colKey: 'title', title: '计划主题' },
|
||||
{ colKey: 'month', title: '月份', width: 64 },
|
||||
{ colKey: 'dept_id', title: '部门', width: 110 },
|
||||
{ colKey: 'start_at', title: '开始时间', width: 130 },
|
||||
{ colKey: 'location', title: '地点', width: 100 },
|
||||
{ colKey: 'status', title: '状态', width: 84 },
|
||||
{ colKey: 'reject_reason', title: '审批意见', width: 150 },
|
||||
{ colKey: 'op', title: '操作', width: 170 },
|
||||
]
|
||||
|
||||
const fmtStartAt = (v: string | null) => (v ? String(v).slice(0, 16).replace('T', ' ') : '-')
|
||||
|
||||
const loadMonthPlans = async () => {
|
||||
monthPlansLoading.value = true
|
||||
try {
|
||||
const res = await listMonthPlans({ year: monthPlansYear.value, page_size: 200 })
|
||||
monthPlans.value = unwrap(res) || []
|
||||
} catch (e: any) {
|
||||
MessagePlugin.error(apiErrorMessage(e, '月度计划加载失败'))
|
||||
} finally {
|
||||
monthPlansLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 审批决策:通过直达;调整/驳回弹窗填审批意见
|
||||
const approveVisible = ref(false)
|
||||
const approving = ref(false)
|
||||
const approveAction = ref<'pass' | 'adjust' | 'reject'>('pass')
|
||||
const approveRow = ref<TrainingMonthPlan | null>(null)
|
||||
const approveReason = ref('')
|
||||
const approveTitle = computed(() => {
|
||||
const name = approveRow.value?.title || ''
|
||||
if (approveAction.value === 'reject') return `驳回计划:${name}`
|
||||
if (approveAction.value === 'adjust') return `调整意见:${name}`
|
||||
return `通过计划:${name}`
|
||||
})
|
||||
|
||||
const onConfirmApprove = async () => {
|
||||
const row = approveRow.value
|
||||
if (!row) return
|
||||
approving.value = true
|
||||
try {
|
||||
await approveMonthPlan(row.id, approveAction.value, approveReason.value.trim())
|
||||
MessagePlugin.success(approveAction.value === 'pass' ? '已通过该月度计划' : '审批意见已提交')
|
||||
approveVisible.value = false
|
||||
loadMonthPlans()
|
||||
} catch (e: any) {
|
||||
MessagePlugin.error(apiErrorMessage(e, '审批失败,请稍后重试'))
|
||||
} finally {
|
||||
approving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const onApprove = (row: TrainingMonthPlan, action: 'pass' | 'adjust' | 'reject') => {
|
||||
approveRow.value = row
|
||||
approveAction.value = action
|
||||
approveReason.value = ''
|
||||
if (action === 'pass') {
|
||||
onConfirmApprove()
|
||||
return
|
||||
}
|
||||
approveVisible.value = true
|
||||
}
|
||||
|
||||
// 月底滚动(人事):未完成计划滚动生成下月计划
|
||||
const rolling = ref(false)
|
||||
const onRollMonthPlans = async () => {
|
||||
rolling.value = true
|
||||
try {
|
||||
const res = await rollMonthPlans(monthPlansYear.value, new Date().getMonth() + 1)
|
||||
MessagePlugin.success(`已滚动 ${unwrap(res)?.rolled ?? 0} 条未完成计划到下月`)
|
||||
loadMonthPlans()
|
||||
} catch (e: any) {
|
||||
MessagePlugin.error(apiErrorMessage(e, '滚动失败,请稍后重试'))
|
||||
} finally {
|
||||
rolling.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const onOpenDemandForm = () => {
|
||||
demandForm.value = {
|
||||
id: '',
|
||||
|
||||
@@ -404,7 +404,7 @@ const RULE_SCHEMAS: RuleSchemaDesc[] = [
|
||||
{
|
||||
key: 'sign_policy',
|
||||
title: '签到策略',
|
||||
desc: '课堂签到的迟到判定与定位校验',
|
||||
desc: '培训签到的迟到判定与定位校验',
|
||||
fields: [
|
||||
{ key: 'late_after_min', label: '迟到阈值', type: 'number', min: 1, max: 120, unit: '分钟后算迟到' },
|
||||
{ key: 'geo_radius_m', label: '定位有效半径', type: 'number', min: 50, max: 5000, unit: '米' },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="sign-panel">
|
||||
<div class="panel-box">
|
||||
<div class="panel-box__header">
|
||||
<span class="panel-box__title">课堂签到与佐证</span>
|
||||
<span class="panel-box__title">培训签到与佐证</span>
|
||||
<t-select
|
||||
v-model="selectedSessionId"
|
||||
filterable
|
||||
@@ -23,7 +23,9 @@
|
||||
<!-- 签到码 + 统计卡片 -->
|
||||
<div class="sign-top">
|
||||
<div class="sign-code-box">
|
||||
<div class="sign-code-box__title">课堂签到码</div>
|
||||
<div class="sign-code-box__title">培训签到码</div>
|
||||
<!-- 签到二维码:学员企微扫码直达签到页;本地生成,不依赖外网二维码服务 -->
|
||||
<img v-if="signQrUrl" :src="signQrUrl" class="sign-code-box__qr" alt="培训签到二维码" />
|
||||
<div class="sign-code-box__token">{{ signCode?.token || '尚未生成' }}</div>
|
||||
<div class="sign-code-box__meta" v-if="signCode">
|
||||
有效期至 {{ fmtTime(signCode.expire_at) }}
|
||||
@@ -148,8 +150,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import QRCode from 'qrcode'
|
||||
import {
|
||||
checkin,
|
||||
createSignCode,
|
||||
@@ -177,6 +181,7 @@ import {
|
||||
import { fmtBeijingTime } from '@/utils/datetime'
|
||||
|
||||
const props = defineProps<{ roles: string[]; admin?: boolean }>()
|
||||
const route = useRoute()
|
||||
// 签到复核/代签:人事/课长(roles 已按权限组展开,经理自动命中)
|
||||
const canReview = computed(() => props.admin || props.roles.some((r) => r === 'hr' || r === 'supervisor'))
|
||||
// 佐证上传/删除:人事/课长/讲师(与课件上传同口径)
|
||||
@@ -213,6 +218,24 @@ const statusTheme = (s: string) => ({
|
||||
normal: 'success', late: 'warning', abnormal: 'danger', outside: 'danger', duplicate: 'danger', missing: 'default',
|
||||
}[s] || 'default')
|
||||
|
||||
// 签到二维码:内容为学员扫码签到页链接(携带 token),本地生成不依赖外网服务;
|
||||
// 签到码刷新/切换场次后自动重绘。
|
||||
const signQrUrl = ref('')
|
||||
const buildSignQr = async () => {
|
||||
const token = signCode.value?.token
|
||||
if (!token) {
|
||||
signQrUrl.value = ''
|
||||
return
|
||||
}
|
||||
const url = `${window.location.origin}/platform/training/checkin/${token}`
|
||||
try {
|
||||
signQrUrl.value = await QRCode.toDataURL(url, { width: 320, margin: 1 })
|
||||
} catch {
|
||||
signQrUrl.value = ''
|
||||
}
|
||||
}
|
||||
watch(signCode, buildSignQr, { immediate: true })
|
||||
|
||||
const flagText = (f: string) => ({ late: '迟到', outside: '定位异常', not_in_roster: '名单外' }[f] || f)
|
||||
|
||||
const courseName = (courseId: string) => courses.value.find((c) => c.id === courseId)?.name || '课程'
|
||||
@@ -416,7 +439,32 @@ const onExport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(loadAll)
|
||||
// 培训课程页课程名称跳转:携带 courseId 查询参数直达本页,并自动选中该课程的
|
||||
// 最相关场次(进行中 > 最近待开课 > 最近一场),完成「按课程筛选」的直接打开。
|
||||
const applyRouteCourse = () => {
|
||||
const courseId = String(route.query.courseId || '')
|
||||
if (!courseId) return
|
||||
const now = Date.now()
|
||||
const ts = (s: TrainingCourseSession) => (s.start_at ? new Date(s.start_at).getTime() : 0)
|
||||
const ofCourse = sessions.value.filter((s) => s.course_id === courseId && s.status !== 'cancelled')
|
||||
if (!ofCourse.length) {
|
||||
MessagePlugin.warning('该课程暂无课程场次')
|
||||
return
|
||||
}
|
||||
const ongoing = ofCourse.find((s) => s.status === 'ongoing')
|
||||
const upcoming = ofCourse
|
||||
.filter((s) => s.status === 'scheduled' && ts(s) >= now)
|
||||
.sort((a, b) => ts(a) - ts(b))[0]
|
||||
const latest = [...ofCourse].sort((a, b) => ts(b) - ts(a))[0]
|
||||
selectedSessionId.value = (ongoing || upcoming || latest).id
|
||||
loadSessionData()
|
||||
}
|
||||
watch(() => route.query.courseId, applyRouteCourse)
|
||||
|
||||
onMounted(async () => {
|
||||
await loadAll()
|
||||
applyRouteCourse()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -449,6 +497,17 @@ onMounted(loadAll)
|
||||
text-align: center;
|
||||
|
||||
&__title { font-weight: 600; }
|
||||
// 二维码白底留边,保证企微/相机扫码识别率
|
||||
&__qr {
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: 10px auto 4px;
|
||||
padding: 6px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--td-component-stroke);
|
||||
border-radius: var(--app-radius-sm);
|
||||
}
|
||||
&__token {
|
||||
margin: 10px 0;
|
||||
font-family: monospace;
|
||||
|
||||
@@ -598,7 +598,7 @@ func aiRuleSummary(scope, courseName string, stats *types.TrainingAIStats) strin
|
||||
b.WriteString(fmt.Sprintf("4. 对薄弱知识点「%s」安排集中补训。\n", stats.WrongQuestions[0].KnowledgePoint))
|
||||
}
|
||||
if stats.Sign.Absent > 0 || stats.Sign.Late > 0 {
|
||||
b.WriteString("5. 强化课堂签到纪律,缺席/迟到情况同步部门主管。\n")
|
||||
b.WriteString("5. 强化培训签到纪律,缺席/迟到情况同步部门主管。\n")
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 培训佐证文件(签到照/培训视频):线下课按场次归档,文件走 fileSvc 原始
|
||||
// 存取(不入知识库解析链路),供课堂签到页上传、在线预览与请款佐证。
|
||||
// 存取(不入知识库解析链路),供培训签到页上传、在线预览与请款佐证。
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// validEvidenceKinds 佐证文件类型白名单。
|
||||
|
||||
@@ -153,6 +153,42 @@ func (h *Handler) ImportEmployees(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": gin.H{"imported": count}})
|
||||
}
|
||||
|
||||
// updateEmployeeRequest is the body of PUT /org/employees/:id.
|
||||
// 姓名/工号随平台账号维护,不在可编辑范围;部门必填(与导入同规)。
|
||||
type updateEmployeeRequest struct {
|
||||
DeptID string `json:"dept_id" binding:"required"`
|
||||
Post string `json:"post"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
// UpdateEmployee PUT /org/employees/:id — 修改员工档案。
|
||||
// Read-modify-write:先取现有档案再覆盖可编辑字段,wecom_userid/lecturer_rate
|
||||
// 等由 OA 同步/业务模块维护的字段保持不动;状态留空表示不变更。
|
||||
func (h *Handler) UpdateEmployee(c *gin.Context) {
|
||||
ctx := c.Request.Context()
|
||||
var req updateEmployeeRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
_ = c.Error(errors.NewBadRequestError("请求参数不合法").WithDetails(err.Error()))
|
||||
return
|
||||
}
|
||||
employee, err := h.svc.GetEmployee(ctx, callerTenantID(c), c.Param("id"))
|
||||
if err != nil {
|
||||
_ = c.Error(err)
|
||||
return
|
||||
}
|
||||
employee.DeptID = req.DeptID
|
||||
employee.Post = req.Post
|
||||
if req.Status != "" {
|
||||
employee.Status = req.Status
|
||||
}
|
||||
updated, err := h.svc.UpdateEmployee(ctx, callerTenantID(c), employee)
|
||||
if err != nil {
|
||||
_ = c.Error(err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "data": updated})
|
||||
}
|
||||
|
||||
// ListPlatformUsers GET /org/platform-users — 员工导入的用户选择器数据源。
|
||||
func (h *Handler) ListPlatformUsers(c *gin.Context) {
|
||||
users, err := h.svc.ListTenantUsers(c.Request.Context(), callerTenantID(c))
|
||||
|
||||
@@ -24,6 +24,7 @@ func RegisterOrgRoutes(r *gin.RouterGroup, h *orgcenter.Handler, g *rbacGuards)
|
||||
|
||||
// ---- 员工档案 ----
|
||||
orgGroup.GET("/employees", h.ListEmployees)
|
||||
orgGroup.PUT("/employees/:id", g.Contributor(), h.UpdateEmployee)
|
||||
orgGroup.GET("/platform-users", g.Contributor(), h.ListPlatformUsers)
|
||||
orgGroup.POST("/employees/import", g.Contributor(), h.ImportEmployees)
|
||||
|
||||
|
||||
Reference in new issue
Block a user