update:性别&赛事状态&时间选择
This commit is contained in:
parent
04ca5df481
commit
7fc91710a0
2
.env
2
.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/'
|
||||
VITE_PUBLIC_PATH = 'https://yuedong-wechatapplet.oss-cn-shanghai.aliyuncs.com/static/event_web/202604090912/'
|
||||
@ -66,7 +66,7 @@
|
||||
|
||||
<!-- 报名起止时间 -->
|
||||
<el-form-item label="报名起止时间" prop="registrationTime">
|
||||
<el-date-picker v-model="localFormData.registrationTime" type="datetimerange" range-separator="至"
|
||||
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="localFormData.registrationTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始" end-placeholder="结束" :disabled="readonly" />
|
||||
</el-form-item>
|
||||
|
||||
@ -79,12 +79,12 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="上传素材起止时间" prop="materialUploadTime" v-if="localFormData.isNeedMaterial" required>
|
||||
<el-date-picker v-model="localFormData.materialUploadTime" type="datetimerange" range-separator="至"
|
||||
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="localFormData.materialUploadTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始" end-placeholder="结束" :disabled="readonly" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="比赛起止时间" prop="matchTime">
|
||||
<el-date-picker v-model="localFormData.matchTime" type="datetimerange" range-separator="至"
|
||||
<el-date-picker value-format="YYYY-MM-DD HH:mm:ss" v-model="localFormData.matchTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始" end-placeholder="结束" :disabled="readonly" />
|
||||
</el-form-item>
|
||||
|
||||
@ -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 }
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
<span v-else class="group-row__range">{{ group.birthDateStart }} ~ {{ group.birthDateEnd }}</span>
|
||||
|
||||
<el-select v-if="!readonly" v-model="group.gender" class="group-row__gender" placeholder="性别" :disabled="readonly">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="全部" :value="3" />
|
||||
<el-option label="男" :value="0" />
|
||||
<el-option label="女" :value="1" />
|
||||
</el-select>
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
<el-select v-model="group.gender" placeholder="性别" style="width: 100px">
|
||||
<el-option label="男" value="0"></el-option>
|
||||
<el-option label="女" value="1"></el-option>
|
||||
<el-option label="不限" value="2"></el-option>
|
||||
<el-option label="不限" value="3"></el-option>
|
||||
</el-select>
|
||||
<el-button circle @click="removeGroup(index)" style="margin-left: 30px" size="small"
|
||||
icon="Minus" v-if="index == (formData.groups || []).length - 1 && index != 0"></el-button>
|
||||
@ -380,6 +380,7 @@ const onSubmit = () => {
|
||||
|
||||
try {
|
||||
let res;
|
||||
formData.value.completionCount = Number(formData.value.completionCount);
|
||||
if (formData.value.id) {
|
||||
res = await projectEditPut(formData.value);
|
||||
} else {
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
</template>
|
||||
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row.status === 0 || scope.row.status === 'Enrolling' || scope.row.status === 'enrolling' ? 'success' : scope.row.status === 1 || scope.row.status === 'Ongoing' || scope.row.status === 'ongoing' ? 'warning' : 'danger'">
|
||||
{{ scope.row.status === 0 || scope.row.status === 'Enrolling' || scope.row.status === 'enrolling' ? '报名中' : scope.row.status === 1 || scope.row.status === 'Ongoing' || scope.row.status === 'ongoing' ? '比赛中' : '已结束' }}
|
||||
<el-tag :type="getEventStatusTagType(scope.row.status)">
|
||||
{{ getEventStatusText(scope.row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user