From a0e554f7a9d1a43911bde68f2ebb53022659c4f6 Mon Sep 17 00:00:00 2001 From: lijing Date: Tue, 3 Dec 2024 02:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=A3=80=E9=AA=8C=20?= =?UTF-8?q?=E6=B5=8B=E9=87=8F=E8=BF=BD=E5=A2=9E=E5=8A=A0=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login/index.vue | 2 +- .../quality/Materialinspection/index.vue | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index d7f59b3..37ec69f 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -142,7 +142,7 @@ export default class LoginPage extends BasePage { // console.log('Version////', this.Version); } ///********版本号修改区域********** - version = '0.0.152'; //正式版本号 + version = '0.0.153'; //正式版本号 //version = '0.0.14'; //测试版本号 //***************标志修改区域:是否是测试标志: false 正式版本; true 测试版本**************** //isTest = true; diff --git a/src/pages/quality/Materialinspection/index.vue b/src/pages/quality/Materialinspection/index.vue index 3a7f5a8..19d5e8d 100644 --- a/src/pages/quality/Materialinspection/index.vue +++ b/src/pages/quality/Materialinspection/index.vue @@ -389,7 +389,7 @@
-
+
@@ -694,6 +694,14 @@ export default class PurchaseWHSRM extends BasePage { }); return; } + const regex = /^[a-zA-Z0-9.]+$/; // 仅允许英文、数字和小数点 + const inputValue = this.tagsvalue; // 获取输入值 + if (!regex.test(inputValue)) { + // 替换所有非法字符 + this.tagsvalue = inputValue.replace(/[^a-zA-Z0-9.]/g, ''); + } else { + this.tagsvalue = inputValue; // 输入合法,直接赋值 + } console.log(this.tagslist, 'sadasdww'); let a: any = {}; a.value = this.tagsvalue; @@ -2153,6 +2161,18 @@ export default class PurchaseWHSRM extends BasePage { changeInputtags(event) { this.tagsvalue = event; } + //正则匹配 + validateInputtags(event) { + console.log(event); + const regex = /^[a-zA-Z0-9.]+$/; // 仅允许英文、数字和小数点 + const inputValue = event; // 获取输入值 + if (!regex.test(inputValue)) { + // 替换所有非法字符 + this.tagsvalue = inputValue.replace(/[^a-zA-Z0-9.]/g, ''); + } else { + this.tagsvalue = inputValue; // 输入合法,直接赋值 + } + } // 清除定时器 clickevent() { this.keyboardHideInterval.forEach((id) => clearInterval(id)); // 清除所有定时器