Kintone plugin 実装

This commit is contained in:
2023-10-24 09:08:45 +09:00
parent 25f05ab018
commit f6d677b51f
27 changed files with 1477 additions and 20251 deletions

View File

@@ -0,0 +1,53 @@
import { actionAddins } from ".";
import { IAction,IActionResult, IActionNode, IActionProperty } from "../types/ActionTypes";
interface IMustInputProps{
field:string;
message:string;
}
export class MustInputAction implements IAction{
name: string;
actionProps: IActionProperty[];
props:IMustInputProps;
constructor(){
this.name="必須チェック";
this.actionProps=[];
this.register();
this.props={
field:'',
message:''
}
this.register();
}
process(actionNode:IActionNode,event:any):IActionResult {
let result={
canNext:true,
result:false
};
this.actionProps=actionNode.actionProps;
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue)) {
return result
}
this.props = actionNode.ActionValue as IMustInputProps;
const record = event.record;
const value = record[this.props.field]?.value;
if(value===undefined || value===''){
record[this.props.field].error=this.props.message;
return result;
}
result= {
canNext:true,
result:true
}
return result;
}
register(): void {
actionAddins[this.name]=this;
}
}
new MustInputAction();