fix: 处理部分优化问题
This commit is contained in:
@@ -81,6 +81,13 @@ const ID_CARD_IMG_COLUMN: any = {
|
||||
record ? renderIdImages(record.idCardImgList || [], record.idCardImg || '') : <span>--</span>,
|
||||
};
|
||||
|
||||
type ConditionalColumnKey = 'isRequireIdCardNo' | 'isRequireIdCardImg';
|
||||
|
||||
const CONDITIONAL_PLAYER_COLUMNS: { key: ConditionalColumnKey; column: any }[] = [
|
||||
{ key: 'isRequireIdCardNo', column: ID_CARD_COLUMN },
|
||||
{ key: 'isRequireIdCardImg', column: ID_CARD_IMG_COLUMN },
|
||||
];
|
||||
|
||||
export default defineComponent({
|
||||
name: 'EventDetailModal',
|
||||
props: {
|
||||
@@ -94,12 +101,12 @@ export default defineComponent({
|
||||
const [detailLoading, setDetailLoading] = useState(false);
|
||||
|
||||
/** 动态列:根据赛事是否要求证件号/证件图片决定显示 */
|
||||
const playerColumns = computed(() => {
|
||||
const cols = [...BASE_PLAYER_COLUMNS];
|
||||
if (detail.value?.isRequireIdCardNo === '1') cols.push(ID_CARD_COLUMN);
|
||||
if (detail.value?.isRequireIdCardImg === '1') cols.push(ID_CARD_IMG_COLUMN);
|
||||
return cols;
|
||||
});
|
||||
const playerColumns = computed(() => [
|
||||
...BASE_PLAYER_COLUMNS,
|
||||
...CONDITIONAL_PLAYER_COLUMNS.filter(({ key }) => detail.value?.[key] === '1').map(
|
||||
({ column }) => column,
|
||||
),
|
||||
]);
|
||||
|
||||
// ===== 每个组别的选手数据(key = categoryId) =====
|
||||
const categoryPlayers = ref<Record<string, TournamentAdminInfoSignupVO[]>>({});
|
||||
|
||||
@@ -58,11 +58,7 @@ const PLAYER_COLUMNS = [
|
||||
key: 'idCardImg',
|
||||
width: 170,
|
||||
customRender: ({ record }: { record: TournamentAdminOrderInfoPageVO }) => {
|
||||
const urls = record.idCardImgList?.length
|
||||
? record.idCardImgList
|
||||
: record.idCardImg
|
||||
? [record.idCardImg]
|
||||
: [];
|
||||
const urls = record.idCardImgList || [];
|
||||
if (!urls.length) return <span>--</span>;
|
||||
return (
|
||||
<Space>
|
||||
|
||||
@@ -60,15 +60,15 @@ export default defineComponent({
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
props.onSave({
|
||||
paramCode: formData.paramCode,
|
||||
paramValue: formData.paramValue,
|
||||
remark: formData.remark,
|
||||
});
|
||||
props.onSave({
|
||||
paramCode: formData.paramCode,
|
||||
paramValue: formData.paramValue,
|
||||
remark: formData.remark,
|
||||
});
|
||||
} catch {
|
||||
// 校验未通过,Form 已展示错误,无需处理
|
||||
}
|
||||
};
|
||||
|
||||
/** 关闭 */
|
||||
|
||||
Reference in New Issue
Block a user