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