From 29d286319a54657c728540e8bb8e824aaad039c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A3=E4=BA=9B=E8=8A=B1=E5=84=BF?= <1156921458@qq.com> Date: Wed, 30 Apr 2025 10:12:46 +0800 Subject: [PATCH] .. --- .../platform/activity/scoreEnter/index.html | 91 +++++++++++++------ frontend/src/App.vue | 6 +- frontend/src/manifest.json | 8 +- frontend/src/utils/checkAuth.js | 0 frontend/src/utils/routerInterceptor.js | 28 +++++- 5 files changed, 102 insertions(+), 31 deletions(-) create mode 100644 frontend/src/utils/checkAuth.js diff --git a/backend/src/main/resources/views/platform/activity/scoreEnter/index.html b/backend/src/main/resources/views/platform/activity/scoreEnter/index.html index 99d6426..92dff8a 100644 --- a/backend/src/main/resources/views/platform/activity/scoreEnter/index.html +++ b/backend/src/main/resources/views/platform/activity/scoreEnter/index.html @@ -39,20 +39,29 @@ layout("/layouts/platform_1.html"){ - - + + - - + + + + + + - + + 保存 + @@ -76,10 +85,12 @@ layout("/layouts/platform_1.html"){ } }, methods: { + // 格式化名称 formatName(name) { if (!name) return "" return name.match(/.{1,4}/g)?.join("
") || "" }, + // 获取活动 listAct() { $.get("/platform/activity/scoreEnter/list-activity", this.pageForm).then(res => { if (res.code === 0) { @@ -93,36 +104,62 @@ layout("/layouts/platform_1.html"){ } }) }, - listGroup() { - $.get("/platform/activity/scoreEnter/list-group/" + this.pageForm.activityId).then(res => { - if (res.code === 0) { - this.groupOptions = res.data - this.buildTableData() - } else { - this.$message.error(res.msg) - } - }) + // 获取队伍 + async listGroup() { + const { + code, + data, + msg + } = await $.get("/platform/activity/scoreEnter/list-group/" + this.pageForm.activityId) + if (code === 0) { + this.groupOptions = data + } else { + this.$message.error(msg) + } }, - listItem() { - $.get("/platform/activity/scoreEnter/list-item/" + this.pageForm.activityId).then(res => { - if (res.code === 0) { - this.itemOptions = res.data - } else { - this.$message.error(res.msg) - } - }) + // 获取项目 + async listItem() { + const { + code, + data, + msg + } = await $.get("/platform/activity/scoreEnter/list-item/" + this.pageForm.activityId) + if (code === 0) { + this.itemOptions = data + } else { + this.$message.error(msg) + } }, - activityChange() { - this.listGroup() - this.listItem() + // 活动改变 + async activityChange() { + await this.listGroup() + await this.listItem() + this.buildTableData() }, + // 构建表格数据 buildTableData() { this.tableData = this.groupOptions.map((group) => { - return{ + const row = { + groupId: group.id, groupName: group.groupName } + this.itemOptions.forEach((item) => { + row[item.id] = { + totalScore: item.totalScore, + totalRank: item.totalRank + } + }) + return row }) console.log(this.tableData) + }, + // 单元格点击 + cellClick(row, column){ + console.log(row, column) + }, + // 保存成绩 + saveScore(){ + console.log(this.tableData) } }, created() { diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 3d3a8af..59f1c40 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,5 @@