diff --git a/ruoyi-ui/src/views/officialWebsite/Components/header.vue b/ruoyi-ui/src/views/officialWebsite/Components/header.vue index a697e41..8b9c4a5 100644 --- a/ruoyi-ui/src/views/officialWebsite/Components/header.vue +++ b/ruoyi-ui/src/views/officialWebsite/Components/header.vue @@ -77,9 +77,9 @@ 登 录 - +
- + 学生 @@ -142,8 +142,25 @@ - - + + + + +
将文件拖到此处,或点击上传
+
+ 下载模板 +
+
@@ -163,7 +180,7 @@
- + 取 消 注 册 @@ -245,6 +262,20 @@ export default { } }, + upload: { + // 是否显示弹出层(用户导入) + open: false, + // 弹出层标题(用户导入) + title: "", + // 是否禁用上传 + isUploading: false, + // 是否更新已经存在的用户数据 + updateSupport: 0, + // 设置上传的请求头部 + headers: { Authorization: "Bearer " + getToken() }, + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/common/upload" + }, registerRules: { username: [ { required: true, trigger: 'blur', message: '请输入您的账号' }, @@ -316,6 +347,17 @@ export default { }, methods: { + /** 下载模板操作 */ + importTemplate() { + const url = 'https://meevexp.oberyun.com/hgdWebsite/profile/upload/2025/06/04/第七届全国大学生市政环境AI+创新实践能力大赛领队授权模板(1)_20250604120443A157.docx'; + const link = document.createElement('a'); + link.href = url; + link.download = ''; // 设置 download 可以避免打开新窗口 + link.style.display = 'none'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }, //用户信息 loadUserInfo() { @@ -348,6 +390,18 @@ export default { rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) } }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert("
" + response.msg + "
", "导入结果", { dangerouslyUseHTMLString: true }); + this.registerForm.hitRegistrationTeachInfo.file = response.fileName + console.log('上传',response) + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, // 登录 submitLogin() { this.$refs.loginForm.validate(valid => {