Compare commits
No commits in common. "351806d05f37e65038964d95202c8580985a16c5" and "46237d6283a1670afc96553ca2cfd2c0acccd87d" have entirely different histories.
351806d05f
...
46237d6283
250
package-lock.json
generated
250
package-lock.json
generated
@ -8,24 +8,21 @@
|
|||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"element-plus": "^2.7.6",
|
"element-plus": "^2.7.6",
|
||||||
"file-saver": "^2.0.5",
|
"vue": "^3.4.29",
|
||||||
"vue": "^3.4.31",
|
|
||||||
"vue-router": "^4.4.0",
|
"vue-router": "^4.4.0",
|
||||||
"vuex": "^4.1.0",
|
"vuex": "^4.1.0",
|
||||||
"vuex-persistedstate": "^4.1.0",
|
"vuex-persistedstate": "^4.1.0"
|
||||||
"xlsx": "^0.18.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
"vite": "^5.3.3"
|
"vite": "^5.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/parser": {
|
"node_modules/@babel/parser": {
|
||||||
"version": "7.24.7",
|
"version": "7.24.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz",
|
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.7.tgz",
|
||||||
"integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==",
|
"integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"parser": "bin/babel-parser.js"
|
"parser": "bin/babel-parser.js"
|
||||||
@ -44,7 +41,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@element-plus/icons-vue": {
|
"node_modules/@element-plus/icons-vue": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
|
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
|
||||||
"integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
|
"integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "^3.2.0"
|
"vue": "^3.2.0"
|
||||||
@ -442,7 +439,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@jridgewell/sourcemap-codec": {
|
"node_modules/@jridgewell/sourcemap-codec": {
|
||||||
"version": "1.4.15",
|
"version": "1.4.15",
|
||||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
"resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
||||||
},
|
},
|
||||||
"node_modules/@popperjs/core": {
|
"node_modules/@popperjs/core": {
|
||||||
@ -701,36 +698,36 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-core": {
|
"node_modules/@vue/compiler-core": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.30.tgz",
|
||||||
"integrity": "sha512-skOiodXWTV3DxfDhB4rOf3OGalpITLlgCeOwb+Y9GJpfQ8ErigdBUHomBzvG78JoVE8MJoQsb+qhZiHfKeNeEg==",
|
"integrity": "sha512-ZL8y4Xxdh8O6PSwfdZ1IpQ24PjTAieOz3jXb/MDTfDtANcKBMxg1KLm6OX2jofsaQGYfIVzd3BAG22i56/cF1w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/parser": "^7.24.7",
|
"@babel/parser": "^7.24.7",
|
||||||
"@vue/shared": "3.4.31",
|
"@vue/shared": "3.4.30",
|
||||||
"entities": "^4.5.0",
|
"entities": "^4.5.0",
|
||||||
"estree-walker": "^2.0.2",
|
"estree-walker": "^2.0.2",
|
||||||
"source-map-js": "^1.2.0"
|
"source-map-js": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-dom": {
|
"node_modules/@vue/compiler-dom": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.30.tgz",
|
||||||
"integrity": "sha512-wK424WMXsG1IGMyDGyLqB+TbmEBFM78hIsOJ9QwUVLGrcSk0ak6zYty7Pj8ftm7nEtdU/DGQxAXp0/lM/2cEpQ==",
|
"integrity": "sha512-+16Sd8lYr5j/owCbr9dowcNfrHd+pz+w2/b5Lt26Oz/kB90C9yNbxQ3bYOvt7rI2bxk0nqda39hVcwDFw85c2Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-core": "3.4.31",
|
"@vue/compiler-core": "3.4.30",
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-sfc": {
|
"node_modules/@vue/compiler-sfc": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.30.tgz",
|
||||||
"integrity": "sha512-einJxqEw8IIJxzmnxmJBuK2usI+lJonl53foq+9etB2HAzlPjAS/wa7r0uUpXw5ByX3/0uswVSrjNb17vJm1kQ==",
|
"integrity": "sha512-8vElKklHn/UY8+FgUFlQrYAPbtiSB2zcgeRKW7HkpSRn/JjMRmZvuOtwDx036D1aqKNSTtXkWRfqx53Qb+HmMg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/parser": "^7.24.7",
|
"@babel/parser": "^7.24.7",
|
||||||
"@vue/compiler-core": "3.4.31",
|
"@vue/compiler-core": "3.4.30",
|
||||||
"@vue/compiler-dom": "3.4.31",
|
"@vue/compiler-dom": "3.4.30",
|
||||||
"@vue/compiler-ssr": "3.4.31",
|
"@vue/compiler-ssr": "3.4.30",
|
||||||
"@vue/shared": "3.4.31",
|
"@vue/shared": "3.4.30",
|
||||||
"estree-walker": "^2.0.2",
|
"estree-walker": "^2.0.2",
|
||||||
"magic-string": "^0.30.10",
|
"magic-string": "^0.30.10",
|
||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
@ -738,12 +735,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/compiler-ssr": {
|
"node_modules/@vue/compiler-ssr": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.30.tgz",
|
||||||
"integrity": "sha512-RtefmITAje3fJ8FSg1gwgDhdKhZVntIVbwupdyZDSifZTRMiWxWehAOTCc8/KZDnBOcYQ4/9VWxsTbd3wT0hAA==",
|
"integrity": "sha512-ZJ56YZGXJDd6jky4mmM0rNaNP6kIbQu9LTKZDhcpddGe/3QIalB1WHHmZ6iZfFNyj5mSypTa4+qDJa5VIuxMSg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-dom": "3.4.31",
|
"@vue/compiler-dom": "3.4.30",
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/devtools-api": {
|
"node_modules/@vue/devtools-api": {
|
||||||
@ -752,49 +749,49 @@
|
|||||||
"integrity": "sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw=="
|
"integrity": "sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw=="
|
||||||
},
|
},
|
||||||
"node_modules/@vue/reactivity": {
|
"node_modules/@vue/reactivity": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.30.tgz",
|
||||||
"integrity": "sha512-VGkTani8SOoVkZNds1PfJ/T1SlAIOf8E58PGAhIOUDYPC4GAmFA2u/E14TDAFcf3vVDKunc4QqCe/SHr8xC65Q==",
|
"integrity": "sha512-bVJurnCe3LS0JII8PPoAA63Zd2MBzcKrEzwdQl92eHCcxtIbxD2fhNwJpa+KkM3Y/A4T5FUnmdhgKwOf6BfbcA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/runtime-core": {
|
"node_modules/@vue/runtime-core": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.30.tgz",
|
||||||
"integrity": "sha512-LDkztxeUPazxG/p8c5JDDKPfkCDBkkiNLVNf7XZIUnJ+66GVGkP+TIh34+8LtPisZ+HMWl2zqhIw0xN5MwU1cw==",
|
"integrity": "sha512-qaFEbnNpGz+tlnkaualomogzN8vBLkgzK55uuWjYXbYn039eOBZrWxyXWq/7qh9Bz2FPifZqGjVDl/FXiq9L2g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/reactivity": "3.4.31",
|
"@vue/reactivity": "3.4.30",
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/runtime-dom": {
|
"node_modules/@vue/runtime-dom": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.30.tgz",
|
||||||
"integrity": "sha512-2Auws3mB7+lHhTFCg8E9ZWopA6Q6L455EcU7bzcQ4x6Dn4cCPuqj6S2oBZgN2a8vJRS/LSYYxwFFq2Hlx3Fsaw==",
|
"integrity": "sha512-tV6B4YiZRj5QsaJgw2THCy5C1H+2UeywO9tqgWEc21tn85qHEERndHN/CxlyXvSBFrpmlexCIdnqPuR9RM9thw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/reactivity": "3.4.31",
|
"@vue/reactivity": "3.4.30",
|
||||||
"@vue/runtime-core": "3.4.31",
|
"@vue/runtime-core": "3.4.30",
|
||||||
"@vue/shared": "3.4.31",
|
"@vue/shared": "3.4.30",
|
||||||
"csstype": "^3.1.3"
|
"csstype": "^3.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/server-renderer": {
|
"node_modules/@vue/server-renderer": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.30.tgz",
|
||||||
"integrity": "sha512-D5BLbdvrlR9PE3by9GaUp1gQXlCNadIZytMIb8H2h3FMWJd4oUfkUTEH2wAr3qxoRz25uxbTcbqd3WKlm9EHQA==",
|
"integrity": "sha512-TBD3eqR1DeDc0cMrXS/vEs/PWzq1uXxnvjoqQuDGFIEHFIwuDTX/KWAQKIBjyMWLFHEeTDGYVsYci85z2UbTDg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-ssr": "3.4.31",
|
"@vue/compiler-ssr": "3.4.30",
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "3.4.31"
|
"vue": "3.4.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vue/shared": {
|
"node_modules/@vue/shared": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.30.tgz",
|
||||||
"integrity": "sha512-Yp3wtJk//8cO4NItOPpi3QkLExAr/aLBGZMmTtW9WpdwBCJpRM6zj9WgWktXAl8IDIozwNMByT45JP3tO3ACWA=="
|
"integrity": "sha512-CLg+f8RQCHQnKvuHY9adMsMaQOcqclh6Z5V9TaoMgy0ut0tz848joZ7/CYFFyF/yZ5i2yaw7Fn498C+CNZVHIg=="
|
||||||
},
|
},
|
||||||
"node_modules/@vueuse/core": {
|
"node_modules/@vueuse/core": {
|
||||||
"version": "9.13.0",
|
"version": "9.13.0",
|
||||||
@ -879,14 +876,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/adler-32": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/async-validator": {
|
"node_modules/async-validator": {
|
||||||
"version": "4.2.5",
|
"version": "4.2.5",
|
||||||
"resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
|
"resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
|
||||||
@ -907,26 +896,6 @@
|
|||||||
"proxy-from-env": "^1.1.0"
|
"proxy-from-env": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cfb": {
|
|
||||||
"version": "1.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
|
|
||||||
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
|
|
||||||
"dependencies": {
|
|
||||||
"adler-32": "~1.3.0",
|
|
||||||
"crc-32": "~1.2.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/codepage": {
|
|
||||||
"version": "1.15.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
|
|
||||||
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@ -938,20 +907,9 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/crc-32": {
|
|
||||||
"version": "1.2.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
|
|
||||||
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
|
|
||||||
"bin": {
|
|
||||||
"crc32": "bin/crc32.njs"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/csstype": {
|
"node_modules/csstype": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
|
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
|
||||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
|
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
|
||||||
},
|
},
|
||||||
"node_modules/dayjs": {
|
"node_modules/dayjs": {
|
||||||
@ -1002,7 +960,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/entities": {
|
"node_modules/entities": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
"resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
|
||||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12"
|
"node": ">=0.12"
|
||||||
@ -1056,14 +1014,9 @@
|
|||||||
},
|
},
|
||||||
"node_modules/estree-walker": {
|
"node_modules/estree-walker": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||||
},
|
},
|
||||||
"node_modules/file-saver": {
|
|
||||||
"version": "2.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
|
|
||||||
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
|
|
||||||
},
|
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.6",
|
"version": "1.15.6",
|
||||||
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||||
@ -1096,14 +1049,6 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/frac": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fsevents": {
|
"node_modules/fsevents": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
@ -1140,7 +1085,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/magic-string": {
|
"node_modules/magic-string": {
|
||||||
"version": "0.30.10",
|
"version": "0.30.10",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz",
|
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.10.tgz",
|
||||||
"integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==",
|
"integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||||
@ -1172,7 +1117,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.7",
|
"version": "3.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
|
||||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -1194,13 +1139,13 @@
|
|||||||
},
|
},
|
||||||
"node_modules/picocolors": {
|
"node_modules/picocolors": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz",
|
||||||
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
|
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.4.39",
|
"version": "8.4.38",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz",
|
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz",
|
||||||
"integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==",
|
"integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@ -1217,7 +1162,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.7",
|
"nanoid": "^3.3.7",
|
||||||
"picocolors": "^1.0.1",
|
"picocolors": "^1.0.0",
|
||||||
"source-map-js": "^1.2.0"
|
"source-map-js": "^1.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -1272,31 +1217,20 @@
|
|||||||
},
|
},
|
||||||
"node_modules/source-map-js": {
|
"node_modules/source-map-js": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz",
|
||||||
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
|
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ssf": {
|
|
||||||
"version": "0.11.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
|
|
||||||
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
|
|
||||||
"dependencies": {
|
|
||||||
"frac": "~1.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "5.3.3",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz",
|
"resolved": "https://registry.npmmirror.com/vite/-/vite-5.3.1.tgz",
|
||||||
"integrity": "sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==",
|
"integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.21.3",
|
"esbuild": "^0.21.3",
|
||||||
"postcss": "^8.4.39",
|
"postcss": "^8.4.38",
|
||||||
"rollup": "^4.13.0"
|
"rollup": "^4.13.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -1345,15 +1279,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vue": {
|
"node_modules/vue": {
|
||||||
"version": "3.4.31",
|
"version": "3.4.30",
|
||||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.4.31.tgz",
|
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.30.tgz",
|
||||||
"integrity": "sha512-njqRrOy7W3YLAlVqSKpBebtZpDVg21FPoaq1I7f/+qqBThK9ChAIjkRWgeP6Eat+8C+iia4P3OYqpATP21BCoQ==",
|
"integrity": "sha512-NcxtKCwkdf1zPsr7Y8+QlDBCGqxvjLXF2EX+yi76rV5rrz90Y6gK1cq0olIhdWGgrlhs9ElHuhi9t3+W5sG5Xw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-dom": "3.4.31",
|
"@vue/compiler-dom": "3.4.30",
|
||||||
"@vue/compiler-sfc": "3.4.31",
|
"@vue/compiler-sfc": "3.4.30",
|
||||||
"@vue/runtime-dom": "3.4.31",
|
"@vue/runtime-dom": "3.4.30",
|
||||||
"@vue/server-renderer": "3.4.31",
|
"@vue/server-renderer": "3.4.30",
|
||||||
"@vue/shared": "3.4.31"
|
"@vue/shared": "3.4.30"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "*"
|
"typescript": "*"
|
||||||
@ -1401,42 +1335,6 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vuex": "^3.0 || ^4.0.0-rc"
|
"vuex": "^3.0 || ^4.0.0-rc"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"node_modules/wmf": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/word": {
|
|
||||||
"version": "0.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
|
|
||||||
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/xlsx": {
|
|
||||||
"version": "0.18.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
|
|
||||||
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"adler-32": "~1.3.0",
|
|
||||||
"cfb": "~1.2.1",
|
|
||||||
"codepage": "~1.15.0",
|
|
||||||
"crc-32": "~1.2.1",
|
|
||||||
"ssf": "~0.11.2",
|
|
||||||
"wmf": "~1.0.1",
|
|
||||||
"word": "~0.3.0"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"xlsx": "bin/xlsx.njs"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,18 +9,15 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"element-plus": "^2.7.6",
|
"element-plus": "^2.7.6",
|
||||||
"file-saver": "^2.0.5",
|
"vue": "^3.4.29",
|
||||||
"vue": "^3.4.31",
|
|
||||||
"vue-router": "^4.4.0",
|
"vue-router": "^4.4.0",
|
||||||
"vuex": "^4.1.0",
|
"vuex": "^4.1.0",
|
||||||
"vuex-persistedstate": "^4.1.0",
|
"vuex-persistedstate": "^4.1.0"
|
||||||
"xlsx": "^0.18.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
"vite": "^5.3.3"
|
"vite": "^5.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ const count = ref(0);
|
|||||||
<ul>
|
<ul>
|
||||||
<li><router-link to="/login">Login</router-link></li>
|
<li><router-link to="/login">Login</router-link></li>
|
||||||
<li><router-link to="/register">Register</router-link></li>
|
<li><router-link to="/register">Register</router-link></li>
|
||||||
<li><router-link to="/courseList">Courses</router-link></li>
|
<li><router-link to="/courses">Courses</router-link></li>
|
||||||
<li><router-link to="/meetings">Meetings</router-link></li>
|
<li><router-link to="/meetings">Meetings</router-link></li>
|
||||||
<li><router-link to="/news">News</router-link></li>
|
<li><router-link to="/news">News</router-link></li>
|
||||||
<li><router-link to="/organizations">Organizations</router-link></li>
|
<li><router-link to="/organizations">Organizations</router-link></li>
|
||||||
|
|||||||
@ -1,23 +1,9 @@
|
|||||||
import Course from '../views/course-management/Course.vue';
|
// import CourseList from '../views/course-management/CourseList.vue'
|
||||||
import CourseList from '../views/course-management/CourseList.vue';
|
// import CourseDetail from '../views/course-management/CourseDetail.vue'
|
||||||
import BackgroundWrapper from "@views/course-management/BackgroundWrapper.vue";
|
// import CourseEdit from '../views/course-management/CourseEdit.vue'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
// { path: '/courses', component: CourseList },
|
||||||
path: '/course',
|
// { path: '/courses/:id', component: CourseDetail },
|
||||||
name: 'Course',
|
// { path: '/courses/:id/edit', component: CourseEdit }
|
||||||
component: Course
|
]
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/courseList',
|
|
||||||
name: 'CourseList',
|
|
||||||
component: CourseList
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: '/backgroundWrapper',
|
|
||||||
name: 'BackgroundWrapper',
|
|
||||||
component: BackgroundWrapper
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|||||||
@ -18,34 +18,28 @@ const login = async () => {
|
|||||||
const response = await AuthenticationService.login(credentials);
|
const response = await AuthenticationService.login(credentials);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
store.commit('authentication/setUser', { token: response.data.token });
|
store.commit('authentication/setUser', { token: response.data.token });
|
||||||
router.push("/profile");
|
|
||||||
ElMessage.success('登录成功');
|
|
||||||
}
|
}
|
||||||
|
router.push("/profile");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('用户名或密码错误');
|
ElMessage.error('Invalid username or password');
|
||||||
console.error("登录错误:", error);
|
console.error("Login error:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const goToRegister = () => {
|
|
||||||
router.push('/register');
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="login-wrapper">
|
<div class="login-wrapper">
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<h1>用户登录</h1>
|
<h1>Login</h1>
|
||||||
<el-form @submit.prevent="login" label-width="100px">
|
<el-form @submit.prevent="login" label-width="100px">
|
||||||
<el-form-item label="用户名:">
|
<el-form-item label="Username:">
|
||||||
<el-input v-model="credentials.username" id="username" class="short-input"/>
|
<el-input v-model="credentials.username" id="username"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密码:">
|
<el-form-item label="Password:">
|
||||||
<el-input v-model="credentials.password" id="password" type="password" class="short-input"/>
|
<el-input v-model="credentials.password" id="password" type="password"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" native-type="submit">登录</el-button>
|
<el-button type="primary" native-type="submit">Login</el-button>
|
||||||
<el-button type="default" @click="goToRegister">注册</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -65,29 +59,15 @@ const goToRegister = () => {
|
|||||||
.login-container {
|
.login-container {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 30px;
|
padding: 20px;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
border-radius: 10px;
|
border-radius: 4px;
|
||||||
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
background-color: rgba(255, 255, 255, 0.9);
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 30px;
|
|
||||||
font-size: 24px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.short-input {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@ -1,67 +1,63 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="profile-wrapper">
|
<div class="profile-wrapper">
|
||||||
<div class="profile-container">
|
<div class="profile-container">
|
||||||
<el-button type="danger" @click="confirmLogout" class="logout-button">注销</el-button>
|
|
||||||
<el-tabs v-model="activeTab">
|
<el-tabs v-model="activeTab">
|
||||||
<el-tab-pane label="用户信息" name="userInformation"></el-tab-pane>
|
<el-tab-pane label="User Information" name="userInformation"></el-tab-pane>
|
||||||
<el-tab-pane label="信息修改" name="profile"></el-tab-pane>
|
<el-tab-pane label="Profile" name="profile"></el-tab-pane>
|
||||||
<el-tab-pane label="更改密码" name="changePassword"></el-tab-pane>
|
<el-tab-pane label="Change Password" name="changePassword"></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<div v-if="activeTab === 'userInformation'" class="user-information">
|
<div v-if="activeTab === 'userInformation'">
|
||||||
<h2>用户信息</h2>
|
<h2>User Information</h2>
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<div class="user-details">
|
<div class="user-details">
|
||||||
<p>用户名: {{ user.username }}</p>
|
<p>Username: {{ user.username }}</p>
|
||||||
<p>电子邮箱: {{ user.email }}</p>
|
<p>Email: {{ user.email }}</p>
|
||||||
<p>电话号码: {{ user.phoneNumber }}</p>
|
<p>Phone Number: {{ user.phoneNumber }}</p>
|
||||||
<p>所属企业: {{ user.company }}</p>
|
<p>Company: {{ user.company }}</p>
|
||||||
<p>创建日期: {{ user.createdDate }}</p>
|
<p>Created Date: {{ user.createdDate }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-avatar">
|
<div class="user-avatar">
|
||||||
<img src='@assets/avatar.jpg' alt="用户头像" />
|
<img src= '@assets/avatar.jpg' alt="User Avatar" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="activeTab === 'profile'" class="centered-content">
|
<div v-if="activeTab === 'profile'">
|
||||||
<h2>信息修改</h2>
|
<h1>Profile</h1>
|
||||||
<el-form @submit.prevent="updateProfile" label-width="120px" class="centered-form profile-form">
|
<el-form @submit.prevent="updateProfile" label-width="120px" class="profile-form">
|
||||||
<el-form-item label="用户名:">
|
<el-form-item label="Username:">
|
||||||
<el-input v-model="user.username" id="username" class="short-input" disabled />
|
<el-input v-model="user.username" id="username" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="电子邮箱:">
|
<el-form-item label="Email:">
|
||||||
<el-input v-model="user.email" id="email" class="short-input" />
|
<el-input v-model="user.email" id="email" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="电话号码:">
|
<el-form-item label="Phone Number:">
|
||||||
<el-input v-model="user.phoneNumber" id="phoneNumber" class="short-input" />
|
<el-input v-model="user.phoneNumber" id="phoneNumber" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属企业:">
|
<el-form-item label="Company:">
|
||||||
<el-input v-model="user.company" id="company" class="short-input" />
|
<el-input v-model="user.company" id="company" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" native-type="submit">更新</el-button>
|
<el-button type="primary" native-type="submit">Update Profile</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="activeTab === 'changePassword'" class="centered-content">
|
<div v-if="activeTab === 'changePassword'">
|
||||||
<h2>更改密码</h2>
|
<h2>Change Password</h2>
|
||||||
<el-form @submit.prevent="changePassword" label-width="120px" class="centered-form password-form">
|
<el-form @submit.prevent="changePassword" label-width="120px" class="password-form">
|
||||||
<el-form-item label="旧密码:">
|
<el-form-item label="Old Password:">
|
||||||
<el-input v-model="passwords.oldPassword" :type="showOldPassword ? 'text' : 'password'" class="short-password-input" />
|
<el-input v-model="passwords.oldPassword" id="oldPassword" type="password" />
|
||||||
<el-button @click="togglePasswordVisibility('oldPassword')">{{ showOldPassword ? '隐藏' : '显示' }}</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="新密码:">
|
<el-form-item label="New Password:">
|
||||||
<el-input v-model="passwords.newPassword" :type="showNewPassword ? 'text' : 'password'" class="short-password-input" />
|
<el-input v-model="passwords.newPassword" id="newPassword" type="password" />
|
||||||
<el-button @click="togglePasswordVisibility('newPassword')">{{ showNewPassword ? '隐藏' : '显示' }}</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="再次确认:">
|
<el-form-item label="Confirm Password:">
|
||||||
<el-input v-model="passwords.confirmPassword" :type="showConfirmPassword ? 'text' : 'password'" class="short-password-input" />
|
<el-input v-model="passwords.confirmPassword" id="confirmPassword" type="password" />
|
||||||
<el-button @click="togglePasswordVisibility('confirmPassword')">{{ showConfirmPassword ? '隐藏' : '显示' }}</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" native-type="submit">更改</el-button>
|
<el-button type="primary" native-type="submit">Change Password</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -72,12 +68,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { useStore } from 'vuex';
|
import { useStore } from 'vuex';
|
||||||
import { useRouter } from 'vue-router';
|
import { ElMessage } from 'element-plus';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'; // 导入 ElMessageBox
|
|
||||||
import AuthenticationService from '../../services/authenticationService';
|
import AuthenticationService from '../../services/authenticationService';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const router = useRouter();
|
|
||||||
const activeTab = ref('userInformation');
|
const activeTab = ref('userInformation');
|
||||||
|
|
||||||
const user = ref({
|
const user = ref({
|
||||||
@ -95,10 +89,6 @@ const passwords = ref({
|
|||||||
confirmPassword: ''
|
confirmPassword: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
const showOldPassword = ref(false);
|
|
||||||
const showNewPassword = ref(false);
|
|
||||||
const showConfirmPassword = ref(false);
|
|
||||||
|
|
||||||
const token = store.getters['authentication/token'];
|
const token = store.getters['authentication/token'];
|
||||||
|
|
||||||
const fetchUserInfo = async () => {
|
const fetchUserInfo = async () => {
|
||||||
@ -106,24 +96,24 @@ const fetchUserInfo = async () => {
|
|||||||
const response = await AuthenticationService.getUserInfo(token);
|
const response = await AuthenticationService.getUserInfo(token);
|
||||||
user.value = response.data;
|
user.value = response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取用户信息错误:", error);
|
console.error("Error fetching user info:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateProfile = async () => {
|
const updateProfile = async () => {
|
||||||
try {
|
try {
|
||||||
await AuthenticationService.updateUserInfo(user.value);
|
await AuthenticationService.updateUserInfo(user.value);
|
||||||
ElMessage.success('个人信息更新成功');
|
ElMessage.success('Profile updated successfully');
|
||||||
await fetchUserInfo();
|
await fetchUserInfo();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("更新个人信息错误:", error);
|
console.error("Error updating profile:", error);
|
||||||
ElMessage.error('更新个人信息失败');
|
ElMessage.error('Error updating profile');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const changePassword = async () => {
|
const changePassword = async () => {
|
||||||
if (passwords.value.newPassword !== passwords.value.confirmPassword) {
|
if (passwords.value.newPassword !== passwords.value.confirmPassword) {
|
||||||
ElMessage.error('新密码和确认密码不一致');
|
ElMessage.error('New password and confirm password do not match');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -132,36 +122,13 @@ const changePassword = async () => {
|
|||||||
oldPassword: passwords.value.oldPassword,
|
oldPassword: passwords.value.oldPassword,
|
||||||
newPassword: passwords.value.newPassword
|
newPassword: passwords.value.newPassword
|
||||||
});
|
});
|
||||||
ElMessage.success('密码更改成功');
|
ElMessage.success('Password changed successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("更改密码错误:", error);
|
console.error("Error changing password:", error);
|
||||||
ElMessage.error('旧密码错误');
|
ElMessage.error('Old password is incorrect');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const togglePasswordVisibility = (field) => {
|
|
||||||
if (field === 'oldPassword') {
|
|
||||||
showOldPassword.value = !showOldPassword.value;
|
|
||||||
} else if (field === 'newPassword') {
|
|
||||||
showNewPassword.value = !showNewPassword.value;
|
|
||||||
} else if (field === 'confirmPassword') {
|
|
||||||
showConfirmPassword.value = !showConfirmPassword.value;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const confirmLogout = () => {
|
|
||||||
ElMessageBox.confirm('是否确认注销?', '注销确认', {
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}).then(logout).catch(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
const logout = () => {
|
|
||||||
store.commit('authentication/logout');
|
|
||||||
router.push('/login');
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchUserInfo();
|
fetchUserInfo();
|
||||||
});
|
});
|
||||||
@ -169,83 +136,54 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.profile-wrapper {
|
.profile-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-image: url('@public/background2.jpg');
|
background-image: url('@public/background2.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-container {
|
.profile-container {
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
position: relative;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-form, .password-form {
|
.profile-form, .password-form {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
|
||||||
|
|
||||||
.centered-content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centered-form {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-info {
|
.user-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 20px 80px;
|
padding: 20px;
|
||||||
border-top: 1px solid #ebeef5;
|
border-top: 1px solid #ebeef5;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-details {
|
.user-details {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding-right: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-avatar {
|
.user-avatar {
|
||||||
padding-right: 50px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-avatar img {
|
.user-avatar img {
|
||||||
width: 150px;
|
width: 100px;
|
||||||
height: 150px;
|
height: 100px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
|
||||||
|
|
||||||
.short-input {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.short-password-input {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-button {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
right: 10px;
|
|
||||||
z-index: 1000;
|
|
||||||
padding: 10px 20px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,51 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container class="register-container">
|
<div>
|
||||||
<el-main class="register-main">
|
<h2>Register</h2>
|
||||||
<el-card class="register-card">
|
<form @submit.prevent="register">
|
||||||
<el-header>
|
<div>
|
||||||
<h2>注册</h2>
|
<label for="username">Username:</label>
|
||||||
</el-header>
|
<input type="text" v-model="username" required>
|
||||||
<el-form @submit.prevent="register" label-position="top" class="register-form">
|
</div>
|
||||||
<el-form-item label="用户名" required>
|
<div>
|
||||||
<el-input class="form-input" type="text" v-model="username"></el-input>
|
<label for="password">Password:</label>
|
||||||
</el-form-item>
|
<input type="password" v-model="password" required>
|
||||||
<el-form-item label="密码" required>
|
</div>
|
||||||
<el-input class="form-input" type="password" v-model="password"></el-input>
|
<div>
|
||||||
</el-form-item>
|
<label for="email">Email:</label>
|
||||||
<el-form-item label="电子邮箱" required>
|
<input type="email" v-model="email" required>
|
||||||
<el-input class="form-input" type="email" v-model="email"></el-input>
|
</div>
|
||||||
</el-form-item>
|
<div>
|
||||||
<el-form-item label="电话号码" required>
|
<label for="phoneNumber">Phone Number:</label>
|
||||||
<el-input class="form-input" type="text" v-model="phoneNumber"></el-input>
|
<input type="text" v-model="phoneNumber">
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item label="所属企业" required>
|
<div>
|
||||||
<el-input class="form-input" type="text" v-model="company"></el-input>
|
<label for="company">Company:</label>
|
||||||
</el-form-item>
|
<input type="text" v-model="company">
|
||||||
<el-form-item label="选择身份">
|
</div>
|
||||||
<el-select class="form-input" v-model="role" placeholder="选择身份">
|
<div>
|
||||||
<el-option label="租户" value="USER"></el-option>
|
<label for="role">Role:</label>
|
||||||
<el-option label="管理员" value="ADMIN"></el-option>
|
<select v-model="role">
|
||||||
</el-select>
|
<option value="USER">User</option>
|
||||||
</el-form-item>
|
<option value="ADMIN">Admin</option>
|
||||||
<el-form-item label="请输入验证码" required>
|
</select>
|
||||||
<el-input class="form-input" type="text" v-model="verificationCode"></el-input>
|
</div>
|
||||||
<el-button class="verification-button" type="primary" @click="getVerificationCode">获取验证码</el-button>
|
<div>
|
||||||
</el-form-item>
|
<label for="verificationCode">Verification Code:</label>
|
||||||
<el-form-item>
|
<input type="text" v-model="verificationCode" required>
|
||||||
<el-button type="primary" native-type="submit">注册</el-button>
|
<button type="button" @click="getVerificationCode">Get Verification Code</button>
|
||||||
<el-button type="default" @click="goToLogin">返回</el-button>
|
</div>
|
||||||
</el-form-item>
|
<button type="submit">Register</button>
|
||||||
</el-form>
|
</form>
|
||||||
<el-alert v-if="message" type="info" :closable="false">{{ message }}</el-alert>
|
<p v-if="message">{{ message }}</p>
|
||||||
</el-card>
|
</div>
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
import authenticationService from '../../services/authenticationService';
|
import authenticationService from '../../services/authenticationService';
|
||||||
|
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
@ -60,32 +57,12 @@ const router = useRouter();
|
|||||||
|
|
||||||
const getVerificationCode = async () => {
|
const getVerificationCode = async () => {
|
||||||
// 模拟获取验证码
|
// 模拟获取验证码
|
||||||
message.value = '验证码已发送。请检查您的邮箱/短信。';
|
message.value = 'Verification code sent. Please check your phone/email.';
|
||||||
};
|
};
|
||||||
|
|
||||||
const register = async () => {
|
const register = async () => {
|
||||||
if (!username.value) {
|
|
||||||
ElMessage.error('用户名不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!password.value) {
|
|
||||||
ElMessage.error('密码不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!email.value) {
|
|
||||||
ElMessage.error('电子邮箱不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!phoneNumber.value) {
|
|
||||||
ElMessage.error('电话号码不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!company.value) {
|
|
||||||
ElMessage.error('所属企业不能为空!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!verificationCode.value) {
|
if (!verificationCode.value) {
|
||||||
ElMessage.error('验证码不能为空!');
|
message.value = 'Please enter the verification code.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -100,90 +77,8 @@ const register = async () => {
|
|||||||
message.value = response.data.message;
|
message.value = response.data.message;
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("注册失败:", error.response.data.message);
|
console.error("Registration failed:", error.response.data.message);
|
||||||
message.value = error.response.data.message;
|
message.value = error.response.data.message;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
</script>
|
||||||
const goToLogin = () => {
|
|
||||||
router.push('/login');
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.register-container {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
|
||||||
background-image: url('@public/background1.jpg');
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-main {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-card {
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
border-radius: 8px;
|
|
||||||
background-color: white;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 350px; /* 调整卡片的宽度 */
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-form {
|
|
||||||
width: 100%;
|
|
||||||
max-height: 400px;
|
|
||||||
overflow-y: auto; /* 使表单内容可滚动 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 15px; /* 调整表单项之间的间距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-header h2 {
|
|
||||||
text-align: center;
|
|
||||||
margin: 0 0 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-input {
|
|
||||||
width: calc(100% - 12px); /* 调整输入框的宽度,与滚动条保持距离 */
|
|
||||||
padding-right: 12px; /* 增加右侧内边距 */
|
|
||||||
box-sizing: border-box; /* 确保宽度包含内边距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.verification-button {
|
|
||||||
margin-top: 10px; /* 调整验证码按钮上方的间距 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-alert {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 自定义滚动条样式 */
|
|
||||||
.register-form::-webkit-scrollbar {
|
|
||||||
width: 8px; /* 滚动条宽度 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-form::-webkit-scrollbar-track {
|
|
||||||
background: #f1f1f1; /* 滚动条轨道颜色 */
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-form::-webkit-scrollbar-thumb {
|
|
||||||
background: #888; /* 滚动条滑块颜色 */
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-form::-webkit-scrollbar-thumb:hover {
|
|
||||||
background: #555; /* 滚动条滑块在悬停时的颜色 */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="background-wrapper">
|
|
||||||
<slot></slot>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.background-wrapper {
|
|
||||||
background: url('@public/background2.jpg') no-repeat center center fixed;
|
|
||||||
background-size: cover;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,425 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import {onMounted, ref, computed} from 'vue';
|
|
||||||
import {
|
|
||||||
ElButton,
|
|
||||||
ElForm,
|
|
||||||
ElFormItem,
|
|
||||||
ElInput,
|
|
||||||
ElMessage,
|
|
||||||
ElMessageBox,
|
|
||||||
ElUpload
|
|
||||||
} from 'element-plus';
|
|
||||||
|
|
||||||
import {Delete, Plus, Refresh, ZoomIn} from "@element-plus/icons-vue";
|
|
||||||
import {useRoute, useRouter} from "vue-router";
|
|
||||||
import {useStore} from "vuex";
|
|
||||||
import axios from "axios";
|
|
||||||
import BackgroundWrapper from './BackgroundWrapper.vue'; // 导入 BackgroundWrapper
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const store = useStore();
|
|
||||||
const token = ref('')
|
|
||||||
const form = ref({
|
|
||||||
token: '',
|
|
||||||
title: '',
|
|
||||||
description: '',
|
|
||||||
orderNo: '',
|
|
||||||
author: '',
|
|
||||||
videoPath: '',
|
|
||||||
imagePath: ''
|
|
||||||
});
|
|
||||||
const createMode = ref(false);
|
|
||||||
const modeTitle = ref('');
|
|
||||||
|
|
||||||
const videoFileList = ref([]); // 用于存储上传视频文件的列表
|
|
||||||
const imageFileList = ref([]); // 用于存储上传图片文件的列表
|
|
||||||
const basePath = '/api/courses'
|
|
||||||
const videoUploadUrl = basePath + '/upload'; // 上传视频的后端地址
|
|
||||||
const imageUploadUrl = videoUploadUrl; // 上传图片的后端地址
|
|
||||||
const dialogImageUrl = ref('');
|
|
||||||
const dialogVisible = ref(false); // 用于图片放大预览
|
|
||||||
|
|
||||||
//下面是编辑模式需要的一些变量
|
|
||||||
const id = ref('');
|
|
||||||
|
|
||||||
const beforeVideoUpload = (file) => {
|
|
||||||
const isMp4 = file.type === 'video/mp4';
|
|
||||||
if (!isMp4) {
|
|
||||||
ElMessage.error('只能上传 mp4 格式的视频文件!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isLt500M = file.size / 1024 / 1024 < 500;
|
|
||||||
if (!isLt500M) {
|
|
||||||
ElMessage.error('上传视频大小不能超过 500MB!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const beforeImageUpload = (file) => {
|
|
||||||
const isImage = file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/jpeg';
|
|
||||||
if (!isImage) {
|
|
||||||
ElMessage.error('只能上传 png/jpg/jpeg 格式的图片文件!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isLt5M = file.size / 1024 / 1024 < 5;
|
|
||||||
if (!isLt5M) {
|
|
||||||
ElMessage.error('上传文件大小不能超过 5MB!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleVideoSuccess = (response, file, fileList) => {
|
|
||||||
file.url = response.url;
|
|
||||||
form.value.videoPath = response.url; // 确保设置到表单中
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleImageSuccess = (response, file, fileList) => {
|
|
||||||
file.url = response.url;
|
|
||||||
form.value.imagePath = response.url; // 确保设置到表单中
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleVideoError = (error, file, fileList) => {
|
|
||||||
ElMessage.error('视频上传失败,请重试!');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleImageError = (error, file, fileList) => {
|
|
||||||
ElMessage.error('图片上传失败,请重试!');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleVideoChange = (file, fileList) => {
|
|
||||||
if (fileList.length > 1) {
|
|
||||||
fileList.splice(0, fileList.length - 1)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleImageChange = (file, fileList) => {
|
|
||||||
if (fileList.length > 1) {
|
|
||||||
fileList.splice(0, fileList.length - 1)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePictureCardPreview = (file) => {
|
|
||||||
dialogImageUrl.value = file.url
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
const handleRemoveImage = (file) => {
|
|
||||||
imageFileList.value = imageFileList.value.filter((item) => item.uid !== file.uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleRemoveVideo = (file) => {
|
|
||||||
videoFileList.value = videoFileList.value.filter((item) => item.uid !== file.uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleCommit = async () => {
|
|
||||||
if (form.value.title === '' || form.value.description === '' || form.value.orderNo === '' || form.value.author === '') {
|
|
||||||
await ElMessageBox.alert('请填写完整信息!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isNaN(form.value.orderNo)) {
|
|
||||||
await ElMessageBox.alert('排序必须是一个数字!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (imageFileList.value.length === 0 || videoFileList.value.length === 0) {
|
|
||||||
await ElMessageBox.alert('请选择封面图片和课程视频!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
form.value.imagePath = imageFileList.value[0].url;
|
|
||||||
form.value.videoPath = videoFileList.value[0].url;
|
|
||||||
if (createMode.value) {
|
|
||||||
try {
|
|
||||||
const response = await axios.post(basePath, form.value);
|
|
||||||
ElMessage.success('添加成功!');
|
|
||||||
router.push('/courseList');
|
|
||||||
} catch (e) {
|
|
||||||
await ElMessageBox.alert(e.response.data.message);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
const response = await axios.put(`${basePath}/${id.value}`, form.value);
|
|
||||||
ElMessage.success('修改成功!');
|
|
||||||
router.push('/courseList');
|
|
||||||
} catch (e) {
|
|
||||||
await ElMessageBox.alert(e.response.data.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const isLayoutReady = ref(false);
|
|
||||||
|
|
||||||
const fetchCourseDetail = async () => {
|
|
||||||
let params = {
|
|
||||||
token: token.value,
|
|
||||||
}
|
|
||||||
const res = await axios.get(basePath + '/' + id.value, {params});
|
|
||||||
form.value.title = res.data.title;
|
|
||||||
form.value.description = res.data.description;
|
|
||||||
form.value.orderNo = res.data.orderNo;
|
|
||||||
form.value.author = res.data.author;
|
|
||||||
form.value.videoPath = res.data.videoPath;
|
|
||||||
form.value.imagePath = res.data.imagePath;
|
|
||||||
imageFileList.value.push({url: res.data.imagePath});
|
|
||||||
videoFileList.value.push({url: res.data.videoPath});
|
|
||||||
}
|
|
||||||
|
|
||||||
const orderNo = computed({
|
|
||||||
get() {
|
|
||||||
return form.value.orderNo;
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
form.value.orderNo = value.replace(/\D/g, ''); // 只保留数字
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
token.value = store.getters['authentication/token'];
|
|
||||||
form.value.token = token.value;
|
|
||||||
if (route.query.mode === 'create' || route.params.mode === 'create') {
|
|
||||||
createMode.value = true;
|
|
||||||
modeTitle.value = '添加课程';
|
|
||||||
}
|
|
||||||
if (route.query.mode === 'edit' || route.params.mode === 'edit') {
|
|
||||||
id.value = route.params.id === undefined ? route.query.id : route.params.id;
|
|
||||||
createMode.value = false;
|
|
||||||
modeTitle.value = '修改课程';
|
|
||||||
fetchCourseDetail();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<BackgroundWrapper class="background-wrapper">
|
|
||||||
<div class="form-container">
|
|
||||||
<ElForm :model="form" label-width="120px" @submit.prevent="handleCommit">
|
|
||||||
<h2>{{ modeTitle }}</h2>
|
|
||||||
<ElFormItem label="课程名称" required>
|
|
||||||
<ElInput v-model="form.title" placeholder="请输入课程名称" required></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="课程封面" required>
|
|
||||||
<el-upload
|
|
||||||
:action="imageUploadUrl"
|
|
||||||
:limit="2"
|
|
||||||
:before-upload="beforeImageUpload"
|
|
||||||
:on-success="handleImageSuccess"
|
|
||||||
:on-error="handleImageError"
|
|
||||||
:on-change="handleImageChange"
|
|
||||||
:file-list="imageFileList"
|
|
||||||
list-type="picture-card"
|
|
||||||
auto-upload
|
|
||||||
v-model:file-list="imageFileList"
|
|
||||||
>
|
|
||||||
<template #file="{ file }">
|
|
||||||
<div>
|
|
||||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt=""/>
|
|
||||||
<span class="el-upload-list__item-actions">
|
|
||||||
<span
|
|
||||||
class="el-upload-list__item-preview"
|
|
||||||
@click="handlePictureCardPreview(file)"
|
|
||||||
>
|
|
||||||
<el-icon><zoom-in/></el-icon>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
class="el-upload-list__item-delete"
|
|
||||||
@click="handleRemoveImage(file)"
|
|
||||||
>
|
|
||||||
<el-icon><Delete/></el-icon>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-icon v-if="imageFileList.length === 0">
|
|
||||||
<Plus/>
|
|
||||||
</el-icon>
|
|
||||||
<el-icon v-else>
|
|
||||||
<Refresh/>
|
|
||||||
</el-icon>
|
|
||||||
</el-upload>
|
|
||||||
<div class="tip">
|
|
||||||
请上传大小不超过 <span style="color: red;">5MB</span> 格式为 <span style="color: red;">png/jpg/jpeg</span> 的文件
|
|
||||||
</div>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="课程视频" required>
|
|
||||||
<el-upload
|
|
||||||
:action="videoUploadUrl"
|
|
||||||
:limit="2"
|
|
||||||
:before-upload="beforeVideoUpload"
|
|
||||||
:on-success="handleVideoSuccess"
|
|
||||||
:on-error="handleVideoError"
|
|
||||||
:on-change="handleVideoChange"
|
|
||||||
:file-list="videoFileList"
|
|
||||||
list-type="picture-card"
|
|
||||||
auto-upload
|
|
||||||
v-model:file-list="videoFileList"
|
|
||||||
>
|
|
||||||
<template #file="{ file }">
|
|
||||||
<div>
|
|
||||||
<video class="el-upload-list__item-thumbnail" :src="file.url" controls></video>
|
|
||||||
<span class="el-upload-list__item-actions">
|
|
||||||
<span
|
|
||||||
class="el-upload-list__item-delete"
|
|
||||||
@click="handleRemoveVideo(file)"
|
|
||||||
>
|
|
||||||
<el-icon><Delete/></el-icon>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-icon v-if="videoFileList.length === 0">
|
|
||||||
<Plus/>
|
|
||||||
</el-icon>
|
|
||||||
<el-icon v-else>
|
|
||||||
<Refresh/>
|
|
||||||
</el-icon>
|
|
||||||
</el-upload>
|
|
||||||
<div class="tip">
|
|
||||||
请上传大小不超过 <span style="color: red;">500MB</span> 格式为 <span style="color: red;">mp4</span> 的文件
|
|
||||||
</div>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="课程简介" required>
|
|
||||||
<ElInput v-model="form.description" placeholder="请输入课程简介" required></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="课程排序" required>
|
|
||||||
<ElInput v-model="orderNo" placeholder="请输入课程排序(数字)" required></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="作者" required>
|
|
||||||
<ElInput v-model="form.author" placeholder="请输入作者" required></ElInput>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem>
|
|
||||||
<ElButton type="primary" native-type="submit">确定</ElButton>
|
|
||||||
<ElButton @click="router.push('/courseList')">取消</ElButton>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElForm>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-dialog v-model="dialogVisible" class="image-preview">
|
|
||||||
<img w-full :src="dialogImageUrl" alt="Preview Image"/>
|
|
||||||
</el-dialog>
|
|
||||||
</BackgroundWrapper>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.background-wrapper {
|
|
||||||
position: fixed; /* 确保背景覆盖整个视口 */
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto; /* 只在内容溢出时允许滚动 */
|
|
||||||
/* 自定义滚动条样式 */
|
|
||||||
scrollbar-width: thin;
|
|
||||||
scrollbar-color: #007bff #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 针对 Webkit 浏览器的自定义滚动条 */
|
|
||||||
.background-wrapper::-webkit-scrollbar {
|
|
||||||
width: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.background-wrapper::-webkit-scrollbar-track {
|
|
||||||
background: #f0f0f0;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.background-wrapper::-webkit-scrollbar-thumb {
|
|
||||||
background-color: #007bff;
|
|
||||||
border-radius: 10px;
|
|
||||||
border: 3px solid #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto; /* 使容器在内容溢出时出现滚动条 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-preview {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-preview img {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip {
|
|
||||||
margin-top: 8px;
|
|
||||||
color: #727272;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form {
|
|
||||||
background: white;
|
|
||||||
padding: 2rem;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
width: 65%; /* 增加宽度 */
|
|
||||||
max-height: 90vh; /* 确保表单不会超过视口高度 */
|
|
||||||
overflow-y: auto; /* 使表单在内容溢出时出现滚动条 */
|
|
||||||
/* 自定义滚动条样式 */
|
|
||||||
scrollbar-width: thin;
|
|
||||||
scrollbar-color: #007bff #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 针对 Webkit 浏览器的自定义滚动条 */
|
|
||||||
.el-form::-webkit-scrollbar {
|
|
||||||
width: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form::-webkit-scrollbar-track {
|
|
||||||
background: #f0f0f0;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form::-webkit-scrollbar-thumb {
|
|
||||||
background-color: #007bff;
|
|
||||||
border-radius: 10px;
|
|
||||||
border: 3px solid #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-input,
|
|
||||||
.el-select {
|
|
||||||
width: calc(100% - 12px); /* 设置文本框宽度,使其与滚动条保持一定距离 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button--primary {
|
|
||||||
background-color: #007bff;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button--primary:hover {
|
|
||||||
background-color: #0056b3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dynamic-width-select {
|
|
||||||
min-width: 30%;
|
|
||||||
max-width: 100%;
|
|
||||||
width: auto; /* 使宽度根据内容调整 */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,333 +0,0 @@
|
|||||||
<script setup>
|
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import { ElButton, ElForm, ElFormItem, ElInput, ElMessage, ElMessageBox, ElPagination, ElTable, ElTableColumn } from 'element-plus';
|
|
||||||
import axios from "axios";
|
|
||||||
import { useStore } from "vuex";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import Course from "@views/course-management/Course.vue";
|
|
||||||
import BackgroundWrapper from './BackgroundWrapper.vue';
|
|
||||||
import _ from 'lodash';
|
|
||||||
import { write, utils } from 'xlsx';
|
|
||||||
import { saveAs } from 'file-saver';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const store = useStore();
|
|
||||||
const token = store.getters['authentication/token'];
|
|
||||||
|
|
||||||
const searchTitle = ref('');
|
|
||||||
const searchAuthor = ref('');
|
|
||||||
const searchDescription = ref('');
|
|
||||||
const sortOrder = ref('');
|
|
||||||
|
|
||||||
const allCoursesData = ref([]);
|
|
||||||
const coursesData = ref([]);
|
|
||||||
|
|
||||||
const currentPage = ref(1);
|
|
||||||
const pageSize = ref(10);
|
|
||||||
const coursesCount = ref(0);
|
|
||||||
const firstTimeLoad = ref(true);
|
|
||||||
|
|
||||||
const selections = ref([]);
|
|
||||||
|
|
||||||
const loadCourses = async (forceReload = false) => {
|
|
||||||
if (forceReload) {
|
|
||||||
firstTimeLoad.value = true;
|
|
||||||
allCoursesData.value = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (firstTimeLoad.value || allCoursesData.value.length < (currentPage.value * pageSize.value) && (currentPage.value * pageSize.value) <= coursesCount.value) {
|
|
||||||
let params = {
|
|
||||||
token: token,
|
|
||||||
start: allCoursesData.value.length,
|
|
||||||
end: allCoursesData.value.length + pageSize.value * 2
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const response = await axios.get('/api/courses', { params });
|
|
||||||
const data = response.data;
|
|
||||||
coursesCount.value = data.courseCount;
|
|
||||||
allCoursesData.value.push(...data.courseList);
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
firstTimeLoad.value = false;
|
|
||||||
}
|
|
||||||
coursesData.value = allCoursesData.value.slice((currentPage.value - 1) * pageSize.value, currentPage.value * pageSize.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
loadCourses();
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleSearch = async () => {
|
|
||||||
try {
|
|
||||||
const response = await axios.get('/api/courses/search', {
|
|
||||||
params: {
|
|
||||||
token: token,
|
|
||||||
title: searchTitle.value || '',
|
|
||||||
author: searchAuthor.value || '',
|
|
||||||
description: searchDescription.value || '',
|
|
||||||
sortOrder: sortOrder.value || '',
|
|
||||||
start: 0,
|
|
||||||
end: pageSize.value
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const data = response.data;
|
|
||||||
coursesCount.value = data.courseCount;
|
|
||||||
allCoursesData.value = data.courseList;
|
|
||||||
coursesData.value = allCoursesData.value.slice(0, pageSize.value);
|
|
||||||
currentPage.value = 1;
|
|
||||||
firstTimeLoad.value = false;
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleReset = async () => {
|
|
||||||
searchTitle.value = '';
|
|
||||||
searchAuthor.value = '';
|
|
||||||
searchDescription.value = '';
|
|
||||||
sortOrder.value = '';
|
|
||||||
await loadCourses(true); // 强制重新加载课程数据
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSort = async () => {
|
|
||||||
// 将所有课程的排序字段转换成数值
|
|
||||||
const sortedCourses = _.cloneDeep(allCoursesData.value).map(course => ({
|
|
||||||
...course,
|
|
||||||
orderNo: Number(course.orderNo)
|
|
||||||
})).sort((a, b) => a.orderNo - b.orderNo);
|
|
||||||
|
|
||||||
// 更新所有课程的数据
|
|
||||||
allCoursesData.value = sortedCourses;
|
|
||||||
|
|
||||||
// 计算当前分页的数据
|
|
||||||
const start = (currentPage.value - 1) * pageSize.value;
|
|
||||||
const end = start + pageSize.value;
|
|
||||||
coursesData.value = allCoursesData.value.slice(start, end);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleExport = () => {
|
|
||||||
// 创建一个新的工作簿
|
|
||||||
const workbook = utils.book_new();
|
|
||||||
|
|
||||||
// 创建工作表数据,提取 allCoursesData
|
|
||||||
const sheetData = allCoursesData.value.map(course => ({
|
|
||||||
'课程名称': course.title,
|
|
||||||
'作者': course.author,
|
|
||||||
'课程简介': course.description,
|
|
||||||
'排序': course.orderNo
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 将数据放入工作表
|
|
||||||
const worksheet = utils.json_to_sheet(sheetData);
|
|
||||||
|
|
||||||
// 将工作表添加到工作簿中
|
|
||||||
utils.book_append_sheet(workbook, worksheet, 'Courses');
|
|
||||||
|
|
||||||
// 生成 Excel 文件
|
|
||||||
const wbout = write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
||||||
|
|
||||||
// 使用 file-saver 保存文件
|
|
||||||
saveAs(new Blob([wbout], { type: 'application/octet-stream' }), '课程信息.xlsx');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleEditButton = () => {
|
|
||||||
if (selections.value.length === 1) {
|
|
||||||
// 只有一个课程被选中,导航到编辑页面
|
|
||||||
const selectedCourse = selections.value[0];
|
|
||||||
router.push({ name: 'Course', query: { mode: 'edit', id: selectedCourse.id } });
|
|
||||||
} else if (selections.value.length > 1) {
|
|
||||||
// 选中了多个课程,弹出提示
|
|
||||||
ElMessage.warning('无法同时修改多个目标');
|
|
||||||
} else {
|
|
||||||
// 没有选中任何课程,弹出提示
|
|
||||||
ElMessage.warning('请先选择要修改的课程');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteButton = async () => {
|
|
||||||
if (selections.value.length === 0) {
|
|
||||||
ElMessage.warning('请先选择要删除的课程');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'是否确认删除选中的课程?此操作不可撤销。',
|
|
||||||
'确认删除',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(async () => {
|
|
||||||
try {
|
|
||||||
const deletePromises = selections.value.map(selection =>
|
|
||||||
axios.delete(`/api/courses/${selection.id}`, { params: { token: token } })
|
|
||||||
);
|
|
||||||
await Promise.all(deletePromises);
|
|
||||||
ElMessage.success('删除成功');
|
|
||||||
selections.value = []; // 清空选中项
|
|
||||||
await loadCourses(true); // 强制重新加载课程数据
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage.error('删除失败');
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.info('已取消删除操作');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSelectionChange = (newSelections) => {
|
|
||||||
selections.value = newSelections;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleEditInTable = (index) => {
|
|
||||||
router.push({ name: 'Course', query: { mode: 'edit', id: coursesData.value[index].id } });
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteInTable = async (index) => {
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'是否确认删除该课程?此操作不可撤销。',
|
|
||||||
'确认删除',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(async () => {
|
|
||||||
try {
|
|
||||||
await axios.delete(`/api/courses/${coursesData.value[index].id}`, { params: { token: token } });
|
|
||||||
coursesData.value.splice(index, 1);
|
|
||||||
allCoursesData.value.splice(index, 1);
|
|
||||||
coursesCount.value--;
|
|
||||||
await loadCourses(true); // 强制重新加载课程数据
|
|
||||||
} catch (e) {
|
|
||||||
ElMessage.error('删除失败');
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.info('已取消删除操作');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<BackgroundWrapper class="background-wrapper">
|
|
||||||
<div class="center-wrapper">
|
|
||||||
<div class="container">
|
|
||||||
<div class="search-container">
|
|
||||||
<el-form inline>
|
|
||||||
<el-form-item label="课程名称">
|
|
||||||
<el-input v-model="searchTitle" placeholder="请输入课程名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序">
|
|
||||||
<el-input v-model="sortOrder" placeholder="请输入排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="作者">
|
|
||||||
<el-input v-model="searchAuthor" placeholder="请输入作者" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="课程简介">
|
|
||||||
<el-input v-model="searchDescription" placeholder="请输入简介" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button @click="handleReset">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="button-container">
|
|
||||||
<el-button type="success" @click="router.push('/course?mode=create')">新增</el-button>
|
|
||||||
<el-button type="warning" @click="handleEditButton">修改</el-button>
|
|
||||||
<el-button type="danger" @click="handleDeleteButton">删除</el-button>
|
|
||||||
<el-button type="info" @click="handleSort">排序</el-button>
|
|
||||||
<el-button type="primary" @click="handleExport">导出</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-table :data="coursesData" style="width: 100%;" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55"></el-table-column>
|
|
||||||
<el-table-column prop="orderNo" label="排序" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="title" label="课程名称" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="author" label="作者" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="description" label="课程简介" align="center"></el-table-column>
|
|
||||||
<el-table-column label="操作" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button @click="handleEditInTable(scope.$index)" type="text">修改</el-button>
|
|
||||||
<el-button @click="handleDeleteInTable(scope.$index)" type="text">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<div class="pagination-container">
|
|
||||||
<el-pagination
|
|
||||||
@size-change="pageSize = $event; loadCourses(true)"
|
|
||||||
@current-change="currentPage = $event; loadCourses(true)"
|
|
||||||
:current-page="currentPage"
|
|
||||||
:page-size="pageSize"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="coursesCount"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</BackgroundWrapper>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.background-wrapper {
|
|
||||||
position: fixed; /* 确保背景覆盖整个视口 */
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto; /* 只在内容溢出时允许滚动 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.center-wrapper {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
padding: 20px;
|
|
||||||
background: rgba(255, 255, 255, 0.8); /* 为了让内容清晰,可加上一层半透明白色背景 */
|
|
||||||
border-radius: 15px;
|
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
max-width: 800px; /* 控制页面内容宽度 */
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-container {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-container {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-table {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: -10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in New Issue
Block a user