所属活动
-
@@ -54,7 +54,7 @@ layout("/layouts/platform_1.html"){
@@ -74,11 +74,22 @@ layout("/layouts/platform_1.html"){
添加报名人员
导出
-
+
+
+
+
+ {{formatRegistrationField(row, field)}}
+
+
+
+
@@ -117,6 +128,14 @@ layout("/layouts/platform_1.html"){
{{row.isSIgnUpUser ? '是':''}}
+
+
+
+
+ 已签到
+ 未签到
+
+
修改
@@ -331,6 +350,7 @@ layout("/layouts/platform_1.html"){
year: new Date().getFullYear() + '',
},
activityList: [],
+ registrationFields: [],
// 修改表单
modifyDialog: false,
modifyForm: {},
@@ -402,9 +422,81 @@ layout("/layouts/platform_1.html"){
},
units: [],
+ unitLoading: false,
}
},
methods: {
+ // 活动切换后同步刷新动态列和列表数据。
+ onActivityChange() {
+ this.loadRegistrationFields(() => {
+ this.doSearch()
+ })
+ },
+ // 获取当前活动启用的报名字段;字典选项用于把保存的code转换成名称。
+ loadRegistrationFields(callback) {
+ if (!this.pageForm.activityId) {
+ this.registrationFields = []
+ if (callback) callback()
+ return
+ }
+ $.post('/platform/activity/user/getRegistrationFields', {
+ activityId: this.pageForm.activityId
+ }).then((res) => {
+ if (res.code === 0) {
+ this.registrationFields = res.data || []
+ } else {
+ this.registrationFields = []
+ this.$message.error(res.msg || '加载报名字段失败')
+ }
+ }).fail(() => {
+ this.registrationFields = []
+ this.$message.error('加载报名字段失败')
+ }).always(() => {
+ if (callback) callback()
+ })
+ },
+ formatRegistrationField(row, field) {
+ // act_user历史表字段为大写开头的ProjectType,原生SQL返回时需兼容其实际列名。
+ const fieldValue = row[field.fieldKey]
+ const value = field.fieldKey === 'projectType' && (fieldValue === null || fieldValue === undefined || fieldValue === '')
+ ? row.ProjectType
+ : fieldValue
+ if (value === null || value === undefined || value === '') {
+ // 项目类型仅适用于运动员;区分正常的不适用状态与运动员漏选,便于管理员核对报名数据。
+ if (field.fieldKey === 'projectType') {
+ return this.isAthleteRegistration(row) ? '未选择' : '无需选择'
+ }
+ return ''
+ }
+ if (field.dictCode) {
+ const optionMap = {}
+ ;(field.options || []).forEach((option) => {
+ optionMap[option.value] = option.label
+ })
+ return String(value).split(',').map((code) => {
+ const dictValue = code.trim()
+ return optionMap[dictValue] || dictValue
+ }).join('、')
+ }
+ if (field.componentType === 'boolean-radio') {
+ const checked = value === true || value === 1 || value === '1'
+ return field.fieldKey === 'isStay' ? (checked ? '住宿' : '不住宿') : (checked ? '是' : '否')
+ }
+ return value
+ },
+ // 人员类型保存的是逗号分隔的字典编码,运动员编码从当前字段配置中动态解析,避免硬编码字典值。
+ isAthleteRegistration(row) {
+ const personTypeField = this.registrationFields.find((item) => item.fieldKey === 'personType')
+ const athleteOption = (personTypeField && personTypeField.options || [])
+ .find((option) => option.label === '运动员')
+ if (!athleteOption || !row.personType) return false
+ return String(row.personType).split(',').map((code) => code.trim()).includes(athleteOption.value)
+ },
+ getRegistrationFieldWidth(field) {
+ if (field.fieldKey === 'unitName') return 180
+ if (field.fieldKey === 'phone' || field.componentType === 'dict-checkbox') return 140
+ return 100
+ },
setFormDataUnit(val) {
if (!val) {
this.formData.unitName = ''
@@ -575,23 +667,41 @@ layout("/layouts/platform_1.html"){
}
})
},
- async getActivityList(){
- const resp = await $.post('/platform/activity/user/getActivityList', {
+ getActivityList(){
+ $.post('/platform/activity/user/getActivityList', {
year: this.pageForm.year
+ }).then((resp) => {
+ if (resp.code === 0 && resp.data && resp.data.length > 0) {
+ this.activityList = resp.data
+ this.$set(this.pageForm, 'activityId', this.activityList[0].id)
+ } else {
+ this.activityList = []
+ this.$set(this.pageForm, 'activityId', '')
+ }
+ this.loadRegistrationFields(() => {
+ this.pageData()
+ })
})
- if (resp.code === 0 && resp.data && resp.data.length > 0) {
- this.activityList = resp.data
- this.$set(this.pageForm, 'activityId', this.activityList[0].id)
- } else {
- this.$set(this.pageForm, 'activityId', '')
- }
- this.pageData()
},
- async getUnits(){
- const resp = await $.post('/open/common/units')
- if (resp.code === 0) {
- this.units = resp.data
- }
+ // 查询面板和代报名弹窗共用启用单位列表,并按单位名称排序,便于快速检索。
+ getUnits(){
+ this.unitLoading = true
+ $.post('/open/common/units').then((resp) => {
+ if (resp.code === 0) {
+ const units = (resp.data || []).slice().sort((left, right) => {
+ return String(left.name || '').localeCompare(String(right.name || ''), 'zh-CN')
+ })
+ this.$set(this, 'units', units)
+ } else {
+ this.$set(this, 'units', [])
+ this.$message.error(resp.msg || '加载单位列表失败')
+ }
+ }).fail(() => {
+ this.$set(this, 'units', [])
+ this.$message.error('加载单位列表失败')
+ }).always(() => {
+ this.unitLoading = false
+ })
}
},
created() {
diff --git a/backend/src/main/resources/views/platform/activity/wonderfulMoment/addOrUpdate.js b/backend/src/main/resources/views/platform/activity/wonderfulMoment/addOrUpdate.js
index a80cd0e..5698618 100644
--- a/backend/src/main/resources/views/platform/activity/wonderfulMoment/addOrUpdate.js
+++ b/backend/src/main/resources/views/platform/activity/wonderfulMoment/addOrUpdate.js
@@ -2,6 +2,16 @@ const addOrUpdate = {
template: /*language=HTML*/ `
+
+
+
+
+
+
@@ -25,6 +35,12 @@ const addOrUpdate = {
`,
+ props: {
+ activityList: {
+ type: Array,
+ default: () => []
+ }
+ },
data() {
return {
title: '',
@@ -33,6 +49,7 @@ const addOrUpdate = {
published: true,
},
rules: {
+ activityId: [{required: true, message: '请选择所属活动', trigger: ['blur', 'change']}],
title: [{required: true, message: '请输入标题', trigger: ['blur', 'change']}],
content: [{required: true, message: '请输入内容', trigger: ['blur', 'change']}],
cover: [{required: true, message: '请上传封面图', trigger: ['blur', 'change']}],
diff --git a/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html b/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html
index 75e09bc..d332425 100644
--- a/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html
+++ b/backend/src/main/resources/views/platform/activity/wonderfulMoment/index.html
@@ -72,7 +72,7 @@ layout("/layouts/platform_1.html"){
-
+
diff --git a/backend/src/test/java/com/budwk/app/Test1.java b/backend/src/test/java/com/budwk/app/Test1.java
index eeb0a5d..5e7a33b 100644
--- a/backend/src/test/java/com/budwk/app/Test1.java
+++ b/backend/src/test/java/com/budwk/app/Test1.java
@@ -6,8 +6,10 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.utils.PwdUtil;
+import com.budwk.app.module.activity.models.ActUser;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -21,6 +23,7 @@ import org.apache.poi.xssf.usermodel.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nutz.boot.test.junit4.NbJUnit4Runner;
+import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -34,6 +37,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
+import java.util.concurrent.ThreadLocalRandom;
@IocBean
@RunWith(NbJUnit4Runner.class)
@@ -379,4 +383,13 @@ public class Test1 {
}
+ @Test
+ public void test0001(){
+ List
query = dao.query(ActUser.class, Cnd.NEW());
+ for (ActUser actUser : query) {
+ int i = ThreadLocalRandom.current().nextInt(0, 201);
+ actUser.setWeight((double) i);
+ }
+ dao.update(query, "weight");
+ }
}
diff --git a/frontend/src/pages.json b/frontend/src/pages.json
index c87547c..dc3e7d6 100644
--- a/frontend/src/pages.json
+++ b/frontend/src/pages.json
@@ -3,7 +3,7 @@
{
"path": "pages/index/index",
"style": {
- "navigationBarTitleText": "趣味运动会"
+ "navigationBarTitleText": "赛事管理"
}
},
{
@@ -101,7 +101,7 @@
],
"globalStyle": {
"navigationBarTextStyle": "#000000",
- "navigationBarTitleText": "趣味运动会",
+ "navigationBarTitleText": "赛事管理",
"navigationBarBackgroundColor": "#ffffff",
"backgroundColor": "#F8F8F8"
},
diff --git a/frontend/src/pages/activity/list/index.vue b/frontend/src/pages/activity/list/index.vue
index 4e165cd..38bbedc 100644
--- a/frontend/src/pages/activity/list/index.vue
+++ b/frontend/src/pages/activity/list/index.vue
@@ -49,10 +49,9 @@
style="flex-shrink:0;width: 120px;height: 90px;border-radius: 5px;" fit="fill"/>
-
+
- {{ moment(item.startTime).format('MM-DD') }}
+ {{ moment(item.startTime).format('YYYY年MM月DD日') }}
@@ -255,6 +254,22 @@ onMounted(() => {
}
}
+.activity-date-tag {
+ align-self: flex-start;
+ display: inline-flex;
+ align-items: center;
+ column-gap: 4px;
+ max-width: 100%;
+ padding: 4px 8px;
+ border-radius: 12px;
+ box-sizing: border-box;
+ color: #f45a5a;
+ background-color: rgba(244, 90, 90, 0.12);
+ font-size: 12px;
+ line-height: 1.2;
+ white-space: nowrap;
+}
+
.loading-container {
padding: 40rpx 0;
text-align: center;
diff --git a/frontend/src/pages/activity/registration-form/index.vue b/frontend/src/pages/activity/registration-form/index.vue
index c261041..fef8e5f 100644
--- a/frontend/src/pages/activity/registration-form/index.vue
+++ b/frontend/src/pages/activity/registration-form/index.vue
@@ -4,13 +4,20 @@