diff --git a/.env b/.env index d4c765d..aa76c75 100644 --- a/.env +++ b/.env @@ -8,4 +8,4 @@ VITE_OPEN = true VITE_OPEN_CDN = false # public path 配置线上环境路径(打包)、本地通过 http-server 访问时,请置空即可 -VITE_PUBLIC_PATH = 'https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/event_web/202604011515/' \ No newline at end of file +VITE_PUBLIC_PATH = 'https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/event_web/202604090912/' \ No newline at end of file diff --git a/src/views/match/manage/Steps/Step1BasicInfo.vue b/src/views/match/manage/Steps/Step1BasicInfo.vue index b29e783..10e0ea5 100644 --- a/src/views/match/manage/Steps/Step1BasicInfo.vue +++ b/src/views/match/manage/Steps/Step1BasicInfo.vue @@ -66,7 +66,7 @@ - @@ -79,12 +79,12 @@ - - @@ -120,7 +120,7 @@ import { Plus } from '@element-plus/icons-vue'; import { pointsrulePageGet } from '/@/api/match/pointsrule'; import { regionProvincesGet, regionCitiesbyprovinceGet, regionDistrictsbycityGet } from '/@/api/match/area'; import PreviewImage from '/@/components/PreviewImage/index.vue'; - +import 'dayjs/locale/zh-cn' const props = defineProps({ modelValue: { type: Object, required: true }, readonly: { type: Boolean, default: false } diff --git a/src/views/match/manage/Steps/Step3ProjectConfig.vue b/src/views/match/manage/Steps/Step3ProjectConfig.vue index ce1c0c0..9c2b72f 100644 --- a/src/views/match/manage/Steps/Step3ProjectConfig.vue +++ b/src/views/match/manage/Steps/Step3ProjectConfig.vue @@ -31,7 +31,7 @@ {{ group.birthDateStart }} ~ {{ group.birthDateEnd }} - + diff --git a/src/views/match/project/index.vue b/src/views/match/project/index.vue index 343762b..52c5299 100644 --- a/src/views/match/project/index.vue +++ b/src/views/match/project/index.vue @@ -91,7 +91,7 @@ - + @@ -379,6 +379,7 @@ const onSubmit = () => { try { let res; + formData.value.completionCount = Number(formData.value.completionCount); if (formData.value.id) { res = await projectEditPut(formData.value); } else { diff --git a/src/views/user/registration/index.vue b/src/views/user/registration/index.vue index b61354b..d9d65e1 100644 --- a/src/views/user/registration/index.vue +++ b/src/views/user/registration/index.vue @@ -28,8 +28,8 @@ @@ -469,7 +469,13 @@ const columns = ref([ { prop: 'type', label: '赛事类型', align: 'center', width: 120 }, { prop: 'registrationType', label: '报名方式', align: 'center', width: 120 }, { prop: 'chargeMode', label: '收费模式', align: 'center', width: 120 }, - { prop: 'status', label: '赛事状态', align: 'center', width: 120 }, + { prop: 'status', label: '赛事状态', align: 'center', width: 120 , enum: [ + { label: '未开始', value: 0 }, + { label: '报名中', value: 1 }, + { label: '报名结束', value: 2 }, + { label: '比赛中', value: 3 }, + { label: '已结束', value: 4 }, + ],}, { prop: 'registrationStartTime', label: '报名起止时间', align: 'center', minWidth: 320 }, { prop: 'matchStartTime', label: '比赛起止时间', align: 'center', minWidth: 320 }, { prop: 'action', label: '操作', align: 'center', fixed: 'right', width: 210 }, @@ -548,36 +554,25 @@ const chargeModeText = (row) => { } }; -const eventStatusText = (status) => { - if (!status && status !== 0) return '-'; - // 兼容:string 枚举 + 数字枚举 - const s = status; - switch (s) { - case 'Enrolling': - case 'enrolling': - case 0: - return '报名中'; - case 'Ongoing': - case 'ongoing': - case 1: - return '比赛中'; - case 'Ended': - case 'ended': - case 2: - return '已结束'; - default: - return safeString(status); - } + +// 赛事状态映射 +const eventStatusMap = { + 'NotStarted': { type: 'info', text: '未开始' }, + 'Enrolling': { type: 'success', text: '报名中' }, + 'RegistrationEnded': { type: 'warning', text: '报名结束' }, + 'Ongoing': { type: 'primary', text: '比赛中' }, + 'Ended': { type: 'danger', text: '已结束' }, }; -const eventStatusTagType = (status) => { - const text = eventStatusText(status); - if (text === '报名中') return 'warning'; - if (text === '比赛中') return 'primary'; - if (text === '已结束') return 'info'; - return 'info'; +const getEventStatusTagType = (status) => { + return eventStatusMap[status]?.type ?? 'info'; }; +const getEventStatusText = (status) => { + return eventStatusMap[status]?.text ?? (status ?? '-'); +}; + + const isEventEnrolling = (row) => { // 用户端"去报名"只对报名中开放,同时需要用户通过商户认证 const s = row?.status ?? row?.eventStatus;