文字数チェック属性名変更

This commit is contained in:
wtl
2024-05-30 15:28:55 +09:00
parent 371ec3a133
commit b97888fca9

View File

@@ -6,7 +6,7 @@ import { IAction,IActionResult, IActionNode, IActionProperty, IField} from "../
interface IStrCountCheckProps{ interface IStrCountCheckProps{
field:IField;//チェックするフィールドの対象 field:IField;//チェックするフィールドの対象
message:string;//エラーメッセージ message:string;//エラーメッセージ
strExpression:string;// maxLength:number;//
} }
/** /**
* 正規表現チェックアクション * 正規表現チェックアクション
@@ -21,7 +21,7 @@ export class StrCountCheckAciton implements IAction{
this.props={ this.props={
field:{code:''}, field:{code:''},
message:'', message:'',
strExpression:'' maxLength:0
} }
//アクションを登録する //アクションを登録する
this.register(); this.register();
@@ -48,10 +48,10 @@ export class StrCountCheckAciton implements IAction{
//条件式の計算結果を取得 //条件式の計算結果を取得
const record = event.record; const record = event.record;
const value = record[this.props.field.code].value; const value = record[this.props.field.code].value;
const strCheck = this.props.strExpression; const maxLength = this.props.maxLength;
if(value === undefined || value === '' ){ if(value === undefined || value === '' ){
return result; return result;
}else if(strCheck < value.length){ }else if(maxLength < value.length){
record[this.props.field.code].error = this.props.message; record[this.props.field.code].error = this.props.message;
}else{ }else{
result= { result= {