文字数チェック属性名変更
This commit is contained in:
@@ -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= {
|
||||||
|
|||||||
Reference in New Issue
Block a user