メールチェックインターフェース更新
This commit is contained in:
@@ -6,6 +6,7 @@ import { IAction, IActionResult, IActionNode, IActionProperty, IField } from "..
|
|||||||
interface IMailCheckProps {
|
interface IMailCheckProps {
|
||||||
field: IField;//チェックするフィールドの対象
|
field: IField;//チェックするフィールドの対象
|
||||||
message: string;//エラーメッセージ
|
message: string;//エラーメッセージ
|
||||||
|
emailCheck:string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* メールアドレスチェックアクション
|
* メールアドレスチェックアクション
|
||||||
@@ -20,7 +21,7 @@ export class MailCheckAction implements IAction {
|
|||||||
this.props = {
|
this.props = {
|
||||||
field: { code: '' },
|
field: { code: '' },
|
||||||
message: '',
|
message: '',
|
||||||
|
emailCheck:''
|
||||||
}
|
}
|
||||||
//アクションを登録する
|
//アクションを登録する
|
||||||
this.register();
|
this.register();
|
||||||
@@ -37,14 +38,11 @@ export class MailCheckAction implements IAction {
|
|||||||
result: false
|
result: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//属性設定を取得する
|
//属性設定を取得する
|
||||||
this.actionProps = actionNode.actionProps;
|
this.actionProps = actionNode.actionProps;
|
||||||
|
|
||||||
const emailAction = this.actionProps.find(obj => obj.props.name === 'emailcheck')
|
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !('emailCheck' in actionNode.ActionValue)) {
|
||||||
|
|
||||||
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !!!emailAction) {
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
this.props = actionNode.ActionValue as IMailCheckProps;
|
this.props = actionNode.ActionValue as IMailCheckProps;
|
||||||
@@ -52,11 +50,11 @@ export class MailCheckAction 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;
|
||||||
|
|
||||||
if (emailAction?.props.modelValue === '厳格') {
|
if (this.props.emailCheck === '厳格') {
|
||||||
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)) {
|
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)) {
|
||||||
record[this.props.field.code].error = this.props.message;
|
record[this.props.field.code].error = this.props.message;
|
||||||
}
|
}
|
||||||
} else if (emailAction?.props.modelValue === 'ゆるめ') {
|
} else if (this.props.emailCheck === 'ゆるめ') {
|
||||||
if (!/^[^@]+@[^@]+$/.test(value)) {
|
if (!/^[^@]+@[^@]+$/.test(value)) {
|
||||||
record[this.props.field.code].error = this.props.message;
|
record[this.props.field.code].error = this.props.message;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user