|
|
@@ -178,7 +178,7 @@
|
|
|
<el-input
|
|
|
v-model="activityModel.activityLimitPeople"
|
|
|
placeholder="请输入活动参与人数,不填默认不限制"
|
|
|
- maxlength="20"
|
|
|
+ maxlength="4"
|
|
|
@input="handlePositiveIntegerInput('activityLimitPeople', $event)"
|
|
|
>
|
|
|
<template #suffix> 人 </template>
|
|
|
@@ -1529,7 +1529,7 @@ onMounted(async () => {
|
|
|
}
|
|
|
// 加载活动限制人数
|
|
|
if (res.data.activityLimitPeople !== undefined && res.data.activityLimitPeople !== null) {
|
|
|
- activityModel.value.activityLimitPeople = String(res.data.activityLimitPeople);
|
|
|
+ activityModel.value.activityLimitPeople = String(res.data.activityLimitPeople).replace(/[^\d]/g, "").slice(0, 4);
|
|
|
} else {
|
|
|
activityModel.value.activityLimitPeople = "";
|
|
|
}
|
|
|
@@ -1647,7 +1647,8 @@ const handlePositiveIntegerInput = (field: string, ev: any) => {
|
|
|
else if (ev?.target?.value !== undefined) val = ev.target.value;
|
|
|
else val = String(activityModel.value[field] ?? "");
|
|
|
|
|
|
- const filteredValue = val.replace(/[^\d]/g, "").slice(0, 20);
|
|
|
+ const maxLen = field === "activityLimitPeople" ? 4 : 20;
|
|
|
+ const filteredValue = val.replace(/[^\d]/g, "").slice(0, maxLen);
|
|
|
if (field === "activityLimitPeople") activityModel.value.activityLimitPeople = filteredValue;
|
|
|
else if (field === "participationLimit") activityModel.value.participationLimit = filteredValue;
|
|
|
else if (field === "voucherQuantity") activityModel.value.voucherQuantity = filteredValue;
|