赛事报名类型文案调整
This commit is contained in:
parent
d8f54c1b30
commit
518e7d33a3
@ -54,7 +54,7 @@
|
|||||||
<el-radio-group v-model="localFormData.registrationType" :disabled="readonly">
|
<el-radio-group v-model="localFormData.registrationType" :disabled="readonly">
|
||||||
<el-radio :label="0">个人报名</el-radio>
|
<el-radio :label="0">个人报名</el-radio>
|
||||||
<el-radio :label="1">团队报名</el-radio>
|
<el-radio :label="1">团队报名</el-radio>
|
||||||
<el-radio :label="2">个人\团队报名</el-radio>
|
<el-radio :label="2">个人/团队报名</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|||||||
@ -118,9 +118,9 @@ const columns = reactive([
|
|||||||
prop: 'registrationType',
|
prop: 'registrationType',
|
||||||
label: '报名方式',
|
label: '报名方式',
|
||||||
enum: [
|
enum: [
|
||||||
{ label: '只允许个人报名', value: 0 },
|
{ label: '个人报名', value: 0 },
|
||||||
{ label: '只允许团队报名', value: 1 },
|
{ label: '团队报名', value: 1 },
|
||||||
{ label: '两者都有', value: 2 },
|
{ label: '个人/团队报名', value: 2 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -456,7 +456,9 @@ const openDialog = async (id) => {
|
|||||||
const res2 = await eventarrangementListGet(id);
|
const res2 = await eventarrangementListGet(id);
|
||||||
eventlist.value = filterProjectsWithParticipants(res2.data).map((item, idx) => ({
|
eventlist.value = filterProjectsWithParticipants(res2.data).map((item, idx) => ({
|
||||||
...item,
|
...item,
|
||||||
_tempId: item.id || `temp-${idx}-${Date.now()}`
|
_tempId: item.id || `temp-${idx}-${Date.now()}`,
|
||||||
|
// 确保 durationSeconds 是数字类型
|
||||||
|
durationSeconds: typeof item.durationSeconds === 'number' ? item.durationSeconds : 0
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
@ -667,7 +669,8 @@ const previewArrangement = async () => {
|
|||||||
|
|
||||||
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
||||||
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
||||||
...item,
|
ProjectId: item.projectId || item.id,
|
||||||
|
VenueCount: item.venueCount,
|
||||||
SortIndex: index + 1 // 从 1 开始排序
|
SortIndex: index + 1 // 从 1 开始排序
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -728,7 +731,8 @@ const getTimeRowspan = (index) => {
|
|||||||
const onSave = async () => {
|
const onSave = async () => {
|
||||||
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
||||||
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
||||||
...item,
|
ProjectId: item.projectId || item.id,
|
||||||
|
VenueCount: item.venueCount,
|
||||||
SortIndex: index + 1 // 从 1 开始排序
|
SortIndex: index + 1 // 从 1 开始排序
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -765,7 +769,8 @@ const getArr = async () => {
|
|||||||
|
|
||||||
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
// 为每个项目设置正确的 SortIndex(根据当前在数组中的位置)
|
||||||
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
const settingsWithSortIndex = eventlist.value.map((item, index) => ({
|
||||||
...item,
|
ProjectId: item.projectId || item.id,
|
||||||
|
VenueCount: item.venueCount,
|
||||||
SortIndex: index + 1 // 从 1 开始排序
|
SortIndex: index + 1 // 从 1 开始排序
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -1396,6 +1401,9 @@ const validateVenueCount = () => {
|
|||||||
return { valid: true };
|
return { valid: true };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 保存原始项目时长,用于计算
|
||||||
|
const originalDurations = ref({});
|
||||||
|
|
||||||
// 监听 eventlist 变化,实时计算总时长(不显示错误提示)
|
// 监听 eventlist 变化,实时计算总时长(不显示错误提示)
|
||||||
watch(
|
watch(
|
||||||
eventlist,
|
eventlist,
|
||||||
@ -1405,13 +1413,17 @@ watch(
|
|||||||
|
|
||||||
if (newList && newList.length > 0) {
|
if (newList && newList.length > 0) {
|
||||||
newList.forEach((item) => {
|
newList.forEach((item) => {
|
||||||
|
// 确保 durationSeconds 是数字类型
|
||||||
|
if (typeof item.durationSeconds !== 'number' || isNaN(item.durationSeconds)) {
|
||||||
|
item.durationSeconds = 0;
|
||||||
|
}
|
||||||
const result = calculateProjectDuration(item);
|
const result = calculateProjectDuration(item);
|
||||||
item.totalDurationMinutes = result.totalMinutes;
|
item.totalDurationMinutes = result.totalMinutes;
|
||||||
item.totalDurationSeconds = result.totalSeconds;
|
item.totalDurationSeconds = result.totalSeconds;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
// 暴露变量
|
// 暴露变量
|
||||||
|
|||||||
@ -538,13 +538,13 @@ const registrationTypeText = (row) => {
|
|||||||
switch (v) {
|
switch (v) {
|
||||||
case 'OnlyIndividual':
|
case 'OnlyIndividual':
|
||||||
case 0:
|
case 0:
|
||||||
return '只允许个人报名';
|
return '个人报名';
|
||||||
case 'OnlyTeam':
|
case 'OnlyTeam':
|
||||||
case 1:
|
case 1:
|
||||||
return '只允许团队报名';
|
return '团队报名';
|
||||||
case 'Both':
|
case 'Both':
|
||||||
case 2:
|
case 2:
|
||||||
return '两者都有';
|
return '个人/团队报名';
|
||||||
default:
|
default:
|
||||||
return v ?? '-';
|
return v ?? '-';
|
||||||
}
|
}
|
||||||
@ -1051,7 +1051,7 @@ const openRegistrationDialog = async (row) => {
|
|||||||
|
|
||||||
// 检查报名类型,如果是只允许个人报名,则显示提示并阻止继续
|
// 检查报名类型,如果是只允许个人报名,则显示提示并阻止继续
|
||||||
const registrationType = data?.registrationType;
|
const registrationType = data?.registrationType;
|
||||||
if (registrationType === 'OnlyIndividual') {
|
if (registrationType === 'OnlyIndividual' || registrationType === 0) {
|
||||||
ElMessageBox.alert(
|
ElMessageBox.alert(
|
||||||
'当前赛事只允许个人报名,请到移动端进行个人报名',
|
'当前赛事只允许个人报名,请到移动端进行个人报名',
|
||||||
'提示',
|
'提示',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user