feat 236,284

全半角の改修コミット
This commit is contained in:
kanarutsuda
2024-06-13 14:51:28 +09:00
parent 1d248bde43
commit 55bbf50656
2 changed files with 3 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ export class FullWidthAction implements IAction{
containsFullWidthChars(text: string): boolean {
//半角英数字カナ記号を除外
const checkRegex="[^\x01-\x7E\uFF61-\uFF9F]";
const checkRegex="^[^\x01-\x7E\uFF61-\uFF9F]+$";
//正規表現オブジェクト生成
const fullWidthRegex = new RegExp(checkRegex);

View File

@@ -18,7 +18,6 @@ export class HalfWidthAction implements IAction{
this.name="半角チェック"; /* pgadminのnameと同様 */
this.actionProps=[];
this.props={
//checkOption:[],
field:{code:''}
}
//アクションを登録する
@@ -51,7 +50,7 @@ export class HalfWidthAction implements IAction{
return result;
}
//全角が含まれていた場合保存処理中止(エラー処理)
if(this.containsHalfWidthChars(value)){
if(!this.containsHalfWidthChars(value)){
//エラー時に出力される文字設定
record[this.props.field.code].error="全角が含まれています";
//次の処理を中止する値設定
@@ -76,7 +75,7 @@ export class HalfWidthAction implements IAction{
//全て全角の文字列の場合はtrue、そうでない場合はfalse
containsHalfWidthChars(text: string): boolean {
const checkRegex="[^\x01-\x7E\uFF61-\uFF9F]";
const checkRegex="^[\x01-\x7E\uFF61-\uFF9F]+$";
//正規表現オブジェクト生成
const halfWidthRegex = new RegExp(checkRegex);