质量检验 测量追增加正则校验

master
lijing 7 months ago
parent c9c284ef2d
commit a0e554f7a9

@ -142,7 +142,7 @@ export default class LoginPage extends BasePage {
// console.log('Version////', this.Version); // console.log('Version////', this.Version);
} }
///****************** ///******************
version = '0.0.152'; // version = '0.0.153'; //
//version = '0.0.14'; // //version = '0.0.14'; //
//*************** false true **************** //*************** false true ****************
//isTest = true; //isTest = true;

@ -389,7 +389,7 @@
<div class="upload-name"> <div class="upload-name">
<div style="display: flex"> <div style="display: flex">
<div><u-input :border="true" disabled :value="tagslist.length + 1" :focus="isfocus" style="background-color: #eee; width: 80rpx; margin-right: 10rpx" @blur="changeInputtags($event)" /></div> <div><u-input :border="true" disabled :value="tagslist.length + 1" :focus="isfocus" style="background-color: #eee; width: 80rpx; margin-right: 10rpx" @blur="changeInputtags($event)" /></div>
<div><u-input :border="true" :value="tagsvalue" :focus="isfocus" style="overflow: hidden" @blur="changeInputtags($event)" /></div> <div><u-input :border="true" :value="tagsvalue" :focus="isfocus" @input="validateInputtags($event)" style="overflow: hidden" @blur="changeInputtags($event)" /></div>
</div> </div>
</div> </div>
<div> <div>
@ -694,6 +694,14 @@ export default class PurchaseWHSRM extends BasePage {
}); });
return; 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'); console.log(this.tagslist, 'sadasdww');
let a: any = {}; let a: any = {};
a.value = this.tagsvalue; a.value = this.tagsvalue;
@ -2153,6 +2161,18 @@ export default class PurchaseWHSRM extends BasePage {
changeInputtags(event) { changeInputtags(event) {
this.tagsvalue = 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() { clickevent() {
this.keyboardHideInterval.forEach((id) => clearInterval(id)); // this.keyboardHideInterval.forEach((id) => clearInterval(id)); //

Loading…
Cancel
Save