|
@@ -25,9 +25,80 @@ export enum NodeType {
|
|
|
IfElse = 'if-else',
|
|
|
}
|
|
|
|
|
|
-export enum NodeTypeTitle {
|
|
|
- Test = '测试节点',
|
|
|
- Root = '开始',
|
|
|
- Answer = '直接回复',
|
|
|
- IfElse = '条件分支',
|
|
|
+export const NodeTypeObj = {
|
|
|
+ [NodeType.Test]: {
|
|
|
+ type: NodeType.Test,
|
|
|
+ title: '测试节点'
|
|
|
+ },
|
|
|
+ [NodeType.Root]: {
|
|
|
+ type: NodeType.Root,
|
|
|
+ title: '开始'
|
|
|
+ },
|
|
|
+ [NodeType.Answer]: {
|
|
|
+ type: NodeType.Answer,
|
|
|
+ title: '直接回复'
|
|
|
+ },
|
|
|
+ [NodeType.IfElse]: {
|
|
|
+ type: NodeType.IfElse,
|
|
|
+ title: '条件分支'
|
|
|
+ },
|
|
|
+}
|
|
|
+
|
|
|
+export enum ConditionString {
|
|
|
+ Includes = 'includes',
|
|
|
+ NotIncludes = 'not includes',
|
|
|
+ StartWith = 'start with',
|
|
|
+ EndWith = 'end with',
|
|
|
+ Equals = 'equals',
|
|
|
+ NotEquals = 'not equals',
|
|
|
+ Empty = 'empty',
|
|
|
+ NotEmpty = 'not empty',
|
|
|
+}
|
|
|
+
|
|
|
+export enum ConditionNumber {
|
|
|
+ Equals = '=',
|
|
|
+ NotEquals = '≠',
|
|
|
+ Big = '>',
|
|
|
+ Small = '<',
|
|
|
+ BigWith = '≥',
|
|
|
+ SmallWith = '≤',
|
|
|
+ Empty = 'empty',
|
|
|
+ NotEmpty = 'not empty',
|
|
|
+}
|
|
|
+
|
|
|
+export const OptionsConditionString = [
|
|
|
+ {value: ConditionString.Includes, label: '包含'},
|
|
|
+ {value: ConditionString.NotIncludes, label: '不包含'},
|
|
|
+ {value: ConditionString.StartWith, label: '开始是'},
|
|
|
+ {value: ConditionString.EndWith, label: '结束是'},
|
|
|
+ {value: ConditionString.Equals, label: '是'},
|
|
|
+ {value: ConditionString.NotEquals, label: '不是'},
|
|
|
+ {value: ConditionString.Empty, label: '为空'},
|
|
|
+ {value: ConditionString.NotEmpty, label: '不为空'},
|
|
|
+]
|
|
|
+
|
|
|
+export const OptionsConditionNumber = [
|
|
|
+ {value: ConditionNumber.Equals, label: ConditionNumber.Equals},
|
|
|
+ {value: ConditionNumber.NotEquals, label: ConditionNumber.NotEquals},
|
|
|
+ {value: ConditionNumber.Big, label: ConditionNumber.Big},
|
|
|
+ {value: ConditionNumber.Small, label: ConditionNumber.Small},
|
|
|
+ {value: ConditionNumber.BigWith, label: ConditionNumber.BigWith},
|
|
|
+ {value: ConditionNumber.SmallWith, label: ConditionNumber.SmallWith},
|
|
|
+ {value: ConditionNumber.Empty, label: '为空'},
|
|
|
+ {value: ConditionNumber.NotEmpty, label: '不为空'},
|
|
|
+]
|
|
|
+
|
|
|
+export enum ConditionType {
|
|
|
+ Constant = 'constant',
|
|
|
+ Variable = 'variable',
|
|
|
+}
|
|
|
+
|
|
|
+export const OptionsConditionType = [
|
|
|
+ {value: ConditionType.Constant, label: '常量'},
|
|
|
+ {value: ConditionType.Variable, label: '变量'},
|
|
|
+]
|
|
|
+
|
|
|
+export enum ConditionMode {
|
|
|
+ And = 'and',
|
|
|
+ Or = 'or',
|
|
|
}
|