From 87ae7b11e029650252b4c3bf4429e67ca09ef44b Mon Sep 17 00:00:00 2001 From: wangxiangwen <1906413238@qq.com> Date: Thu, 24 Jul 2025 17:13:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B4=BB=E5=8A=A8=E4=B8=AD=E8=83=BD=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/zhongchou/activity/index.vue | 28 +++++++++- .../src/views/zhongchou/gift/importuser/index.vue | 63 ++++++++++++++++------ 2 files changed, 72 insertions(+), 19 deletions(-) diff --git a/activitylink/src/views/zhongchou/activity/index.vue b/activitylink/src/views/zhongchou/activity/index.vue index 1f6c9be..ae875d1 100644 --- a/activitylink/src/views/zhongchou/activity/index.vue +++ b/activitylink/src/views/zhongchou/activity/index.vue @@ -79,7 +79,11 @@ > - + @@ -243,6 +247,19 @@ const addActivity = async () => { return; } + // 验证活动名称是否包含空格(双重保险) + if (!activity.value.activityName || activity.value.activityName.trim() === '') { + ElMessage.error('活动名称不能为空'); + return; + } + + // 确保活动名称中没有空格 + const cleanedActivityName = activity.value.activityName.replace(/\s/g, ''); + if (cleanedActivityName !== activity.value.activityName) { + ElMessage.error('活动名称中不能包含空格'); + return; + } + // 表单验证通过,继续提交逻辑 const activityData = { activityName: activity.value.activityName, @@ -317,6 +334,7 @@ const activity = ref({ const rules = { activityName: [ { required: true, message: '请输入活动名称', trigger: 'blur' } + // 移除了自定义验证器,因为清理逻辑在提交时处理 ], marketOne: [ { required: true, message: '请选择市场一', trigger: 'change' } @@ -334,7 +352,6 @@ const rules = { { required: true, message: '请选择结束时间', trigger: 'change' } ] } - // 分页配置 const currentPage = ref(1); const pageSize = ref(10); // 每页显示 10 条 @@ -346,6 +363,13 @@ const currentPageData = computed(() => { return tableData.value.slice(start, end); }); +// 处理活动名称输入,自动清除所有空格 +const handleActivityNameInput = (value) => { + // 清除所有空格 + const cleanedValue = value.replace(/\s/g, ''); + activity.value.activityName = cleanedValue; +}; + // 分页事件处理 const handleSizeChange = (val) => { pageSize.value = val; diff --git a/activitylink/src/views/zhongchou/gift/importuser/index.vue b/activitylink/src/views/zhongchou/gift/importuser/index.vue index 1b84a53..a6d17be 100644 --- a/activitylink/src/views/zhongchou/gift/importuser/index.vue +++ b/activitylink/src/views/zhongchou/gift/importuser/index.vue @@ -3,7 +3,7 @@ 返回 导入抽奖用户 - +
姓名: @@ -18,22 +18,24 @@
- - - - - - - - - - - +
+ + + + + + + + + + + +
批量删除 @@ -256,4 +258,31 @@ onMounted(() => { .el-pagination { margin: 0; } + +.table-container { + height: 650px; /* 设置固定高度 */ + overflow-y: auto; /* 启用垂直滚动条 */ + overflow-x: hidden; /* 隐藏水平滚动条(如果不需要的话) */ + border: 1px solid #ebeef5; /* 可选:添加边框 */ + border-radius: 4px; /* 可选:添加圆角 */ +} + +/* 可选:自定义滚动条样式 */ +.table-container::-webkit-scrollbar { + width: 8px; +} + +.table-container::-webkit-scrollbar-track { + background: #f1f1f1; + border-radius: 4px; +} + +.table-container::-webkit-scrollbar-thumb { + background: #c1c1c1; + border-radius: 4px; +} + +.table-container::-webkit-scrollbar-thumb:hover { + background: #a8a8a8; +} \ No newline at end of file From da3c102e0a47b5fe755bdf270c192b9714656381 Mon Sep 17 00:00:00 2001 From: wangxiangwen <1906413238@qq.com> Date: Thu, 24 Jul 2025 17:32:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8D=E8=83=BD=E6=9C=89=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/zhongchou/activity/index.vue | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/activitylink/src/views/zhongchou/activity/index.vue b/activitylink/src/views/zhongchou/activity/index.vue index 1f6c9be..ae875d1 100644 --- a/activitylink/src/views/zhongchou/activity/index.vue +++ b/activitylink/src/views/zhongchou/activity/index.vue @@ -79,7 +79,11 @@ > - + @@ -243,6 +247,19 @@ const addActivity = async () => { return; } + // 验证活动名称是否包含空格(双重保险) + if (!activity.value.activityName || activity.value.activityName.trim() === '') { + ElMessage.error('活动名称不能为空'); + return; + } + + // 确保活动名称中没有空格 + const cleanedActivityName = activity.value.activityName.replace(/\s/g, ''); + if (cleanedActivityName !== activity.value.activityName) { + ElMessage.error('活动名称中不能包含空格'); + return; + } + // 表单验证通过,继续提交逻辑 const activityData = { activityName: activity.value.activityName, @@ -317,6 +334,7 @@ const activity = ref({ const rules = { activityName: [ { required: true, message: '请输入活动名称', trigger: 'blur' } + // 移除了自定义验证器,因为清理逻辑在提交时处理 ], marketOne: [ { required: true, message: '请选择市场一', trigger: 'change' } @@ -334,7 +352,6 @@ const rules = { { required: true, message: '请选择结束时间', trigger: 'change' } ] } - // 分页配置 const currentPage = ref(1); const pageSize = ref(10); // 每页显示 10 条 @@ -346,6 +363,13 @@ const currentPageData = computed(() => { return tableData.value.slice(start, end); }); +// 处理活动名称输入,自动清除所有空格 +const handleActivityNameInput = (value) => { + // 清除所有空格 + const cleanedValue = value.replace(/\s/g, ''); + activity.value.activityName = cleanedValue; +}; + // 分页事件处理 const handleSizeChange = (val) => { pageSize.value = val; From d96e658496a2551d448f4d27dc6f21cdd8c50b44 Mon Sep 17 00:00:00 2001 From: wangxiangwen <1906413238@qq.com> Date: Thu, 24 Jul 2025 17:48:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=98=B2=E6=8A=96+=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/zhongchou/activity/index.vue | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/activitylink/src/views/zhongchou/activity/index.vue b/activitylink/src/views/zhongchou/activity/index.vue index ae875d1..65c9de8 100644 --- a/activitylink/src/views/zhongchou/activity/index.vue +++ b/activitylink/src/views/zhongchou/activity/index.vue @@ -14,7 +14,7 @@
- + @@ -204,9 +204,9 @@ const fetchMarketList = async () => { } catch (error) { console.error('请求市场列表失败:', error) } -} - +}// 防抖标志 +const isSubmitting = ref(false); // 取消添加 const cancel = () => { centerDialogVisible.value = false; @@ -232,7 +232,15 @@ const addActivityShow = () => { const addForm = ref(); // 定义 addForm ref const addActivity = async () => { + // 防抖检查 + if (isSubmitting.value) { + ElMessage.warning('操作过于频繁,请稍后再试'); + return; + } + try { + isSubmitting.value = true; // 设置提交标志 + const valid = await new Promise((resolve, reject) => { addForm.value.validate(valid => { if (valid) { @@ -244,12 +252,14 @@ const addActivity = async () => { }); if (!valid) { + isSubmitting.value = false; // 重置提交标志 return; } // 验证活动名称是否包含空格(双重保险) if (!activity.value.activityName || activity.value.activityName.trim() === '') { ElMessage.error('活动名称不能为空'); + isSubmitting.value = false; // 重置提交标志 return; } @@ -257,6 +267,7 @@ const addActivity = async () => { const cleanedActivityName = activity.value.activityName.replace(/\s/g, ''); if (cleanedActivityName !== activity.value.activityName) { ElMessage.error('活动名称中不能包含空格'); + isSubmitting.value = false; // 重置提交标志 return; } @@ -283,6 +294,11 @@ const addActivity = async () => { } catch (error) { console.error('添加活动失败:', error); ElMessage.error('请求失败,请重试'); + } finally { + // 3秒后重置提交标志 + setTimeout(() => { + isSubmitting.value = false; + }, 3000); } };