Browse Source

update

main
wangshaoping 4 months ago
parent
commit
be5aceafdd
  1. 2
      erm.frontend/package.json
  2. 2
      gradle.properties
  3. 2
      io.sc.engine.mv.frontend/package.json
  4. 40
      io.sc.engine.rule.core/build.gradle
  5. 2
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/classes/Rule.java
  6. 25
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/classes/SingleRuleResult.java
  7. 11
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/Rule.java
  8. 11
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/SingleRule.java
  9. 10
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java
  10. 10
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java
  11. 13
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/FolderResource.java
  12. 24
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/ModelResource.java
  13. 74
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/ReleasableResource.java
  14. 66
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/Resource.java
  15. 70
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/testcase/TestCase.java
  16. 71
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/testcase/TestCaseParameter.java
  17. 2
      io.sc.engine.rule.frontend/package.json
  18. 47
      io.sc.engine.rule.frontend/src/i18n/messages.json
  19. 47
      io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json
  20. 51
      io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json
  21. 7
      io.sc.engine.rule.frontend/src/views/dictionary/dictionary.vue
  22. 5
      io.sc.engine.rule.frontend/src/views/function/Function.vue
  23. 2
      io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue
  24. 2
      io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue
  25. 12
      io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue
  26. 4
      io.sc.engine.rule.frontend/src/views/lib/TestCase.vue
  27. 2
      io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue
  28. 2
      io.sc.engine.rule.frontend/src/views/resources/AttachmentDialog.vue
  29. 1
      io.sc.engine.rule.frontend/src/views/resources/Resources.vue
  30. 2
      io.sc.engine.rule.frontend/src/views/resources/designer/Model.vue
  31. 2
      io.sc.engine.rule.frontend/src/views/resources/designer/Option.vue
  32. 2
      io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue
  33. 14
      io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue
  34. 4
      io.sc.engine.rule.frontend/src/views/resources/designer/Testcase.vue
  35. 2
      io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue
  36. 2
      io.sc.engine.rule.frontend/src/views/shared/Processor.ts
  37. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts
  38. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts
  39. 17
      io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts
  40. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts
  41. 13
      io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts
  42. 13
      io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts
  43. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts
  44. 423
      io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts
  45. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts
  46. 20
      io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts
  47. 22
      io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts
  48. 24
      io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts
  49. 16
      io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts
  50. 227
      io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts
  51. 28
      io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts
  52. 12
      io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts
  53. 67
      io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts
  54. 24
      io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts
  55. 24
      io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts
  56. 4
      io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue
  57. 2
      io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue
  58. 2
      io.sc.engine.rule.sample/src/main/resources/io/sc/engine/rule/sample/app/warning/pingan/平安租赁-租后预警规则.json
  59. 318
      io.sc.engine.rule.sample/src/main/resources/io/sc/engine/rule/sample/app/warning/pingan/平安租赁-财报分析预警.json
  60. 4
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java
  61. 63
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java
  62. 59
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java
  63. 4
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java
  64. 18
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java
  65. 1
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java
  66. 34
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java
  67. 8
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ModelResourceEntity.java
  68. 2
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ReleasableResourceEntity.java
  69. 16
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java
  70. 30
      io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java
  71. 8
      io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎内置示例.json
  72. 8
      io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例.json
  73. 4
      io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml
  74. 2
      io.sc.engine.st.frontend/package.json
  75. 2
      io.sc.platform.core.frontend/package.json
  76. 2
      io.sc.platform.core.frontend/src/views/testcase/maxgraph/maxgraph.vue
  77. 4
      io.sc.platform.core.frontend/template-project/package.json
  78. 2
      io.sc.platform.core.frontend/template-project/src/views/testcase/maxgraph/Maxgraph.vue
  79. 19
      io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java
  80. 4
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties
  81. 4
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties
  82. 4
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties
  83. 2
      io.sc.platform.developer.doc/package.json
  84. 2
      io.sc.platform.developer.frontend/package.json
  85. 2
      io.sc.platform.lcdp.frontend/package.json
  86. 2
      io.sc.platform.license.keygen.frontend/package.json
  87. 2
      io.sc.platform.mvc.frontend/package.json
  88. 2
      io.sc.platform.scheduler.manager.frontend/package.json
  89. 2
      io.sc.platform.scheduler.manager.frontend/src/views/executor/Executor.vue
  90. 2
      io.sc.platform.system.frontend/package.json
  91. 13
      io.sc.platform.system.frontend/src/views/i18n/I18n.vue
  92. 5
      io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/controller/I18nWebController.java
  93. 2
      io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/service/I18nService.java
  94. 7
      io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/service/impl/I18nServiceImpl.java
  95. 2
      io.sc.standard.frontend/package.json
  96. 2
      io.sc.website/package.json

2
erm.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
gradle.properties

@ -38,7 +38,7 @@ application_version=1.0.0
platform_group=io.sc
platform_version=8.1.50
platform_plugin_version=8.1.50
platform_core_frontend_version=8.1.430
platform_core_frontend_version=8.1.433
###########################################################
# dependencies version

2
io.sc.engine.mv.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

40
io.sc.engine.rule.core/build.gradle

@ -1,26 +1,28 @@
dependencies {
api(
"org.springframework:spring-core",
"jakarta.xml.bind:jakarta.xml.bind-api",
"com.fasterxml.jackson.core:jackson-annotations",
"com.fasterxml.jackson.core:jackson-core",
"com.fasterxml.jackson.core:jackson-databind",
"org.slf4j:slf4j-api",
"org.freemarker:freemarker",
project(":io.sc.platform.orm.api"),
"org.codehaus.groovy:groovy",
"org.codehaus.groovy:groovy-jsr223",
"org.codehaus.groovy:groovy-datetime",
"org.codehaus.groovy:groovy-dateutil",
"org.codehaus.groovy:groovy-json",
"org.codehaus.groovy:groovy-sql",
"org.codehaus.groovy:groovy-xml",
"org.apache.commons:commons-math3:${commons_math3_version}",
"org.springframework:spring-core",
"jakarta.xml.bind:jakarta.xml.bind-api",
"com.fasterxml.jackson.core:jackson-annotations",
"com.fasterxml.jackson.core:jackson-core",
"com.fasterxml.jackson.core:jackson-databind",
"org.slf4j:slf4j-api",
"org.freemarker:freemarker",
"org.nasdanika.core:mxgraph:${mxgraph_version}",
"org.codehaus.groovy:groovy",
"org.codehaus.groovy:groovy-jsr223",
"org.codehaus.groovy:groovy-datetime",
"org.codehaus.groovy:groovy-dateutil",
"org.codehaus.groovy:groovy-json",
"org.codehaus.groovy:groovy-sql",
"org.codehaus.groovy:groovy-xml",
"org.apache.commons:commons-math3:${commons_math3_version}",
"org.jpmml:pmml-evaluator:${jpmml_version}",
"org.jpmml:pmml-evaluator-extension:${jpmml_version}",
"com.belerweb:pinyin4j:${pinyin4j_version}",
"org.nasdanika.core:mxgraph:${mxgraph_version}",
"org.jpmml:pmml-evaluator:${jpmml_version}",
"org.jpmml:pmml-evaluator-extension:${jpmml_version}",
"com.belerweb:pinyin4j:${pinyin4j_version}",
)
}

2
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/classes/Rule.java

@ -7,10 +7,10 @@ package io.sc.engine.rule.core.classes;
*/
public class Rule {
private boolean isTriggered; //是否触发
private String category; //分类
private Integer level; //等级
private String code; //代码
private String name; //名称
private String category; //分类
private String value; //值
private String message; //触发时消息

25
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/classes/SingleRuleResult.java

@ -11,8 +11,8 @@ import com.fasterxml.jackson.core.JsonProcessingException;
*/
public class SingleRuleResult {
private boolean triggered; //是否触发
private Integer level; //等级
private String category; //分类
private Integer level; //等级
private String value; //值
private String message; //触发时消息
@ -20,8 +20,8 @@ public class SingleRuleResult {
public SingleRuleResult(boolean isTriggered,Integer level,String category,String value,String message) {
this.triggered =isTriggered;
this.level =level;
this.category =category;
this.level =level;
this.value =value;
this.message =message;
}
@ -32,18 +32,18 @@ public class SingleRuleResult {
public void setTriggered(boolean isTriggered) {
this.triggered = isTriggered;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getValue() {
return value;
}
@ -63,8 +63,13 @@ public class SingleRuleResult {
String result =JacksonObjectMapper.getDefaultObjectMapper().writeValueAsString(this);
return result;
} catch (JsonProcessingException e) {
return "SingleRuleResult [triggered=" + triggered + ", level=" + level + ", category=" + category
+ ", value=" + value + ", message=" + message + "]";
return "SingleRuleResult{" +
"triggered=" + triggered +
", category='" + category + '\'' +
", level=" + level +
", value='" + value + '\'' +
", message='" + message + '\'' +
'}';
}
}
}

11
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/Rule.java

@ -14,11 +14,10 @@ import com.fasterxml.jackson.core.type.TypeReference;
@JsonIgnoreProperties(ignoreUnknown=true)
public class Rule {
private String uuid;
private String category;
private Integer level;
private String code;
private String name;
private String category;
private String condition;
private String value;
private String message;
@ -89,14 +88,6 @@ public class Rule {
return null;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public Integer getLevel() {
return level;
}

11
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/SingleRule.java

@ -14,9 +14,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
@JsonIgnoreProperties(ignoreUnknown=true)
public class SingleRule {
private String uuid;
private Integer level;
private String category;
private Integer level;
private String condition;
private String value;
private String message;
@ -77,14 +76,6 @@ public class SingleRule {
return null;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public Integer getLevel() {
return level;
}

10
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/HttpRequestIndicatorProcessor.java

@ -26,7 +26,7 @@ public class HttpRequestIndicatorProcessor extends IndicatorProcessor {
private String httpAuthBasicPassword;
private String httpAuthBearerToken;
private String httpParams;
private String httpBody;
private String httpRequestBody;
private String httpResponseMapping;
@Override
@ -94,11 +94,11 @@ public class HttpRequestIndicatorProcessor extends IndicatorProcessor {
public void setHttpParams(String httpParams) {
this.httpParams = httpParams;
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;

10
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/HttpRequestParameterProcessor.java

@ -26,7 +26,7 @@ public class HttpRequestParameterProcessor extends ParameterProcessor {
private String httpAuthBasicPassword;
private String httpAuthBearerToken;
private String httpParams;
private String httpBody;
private String httpRequestBody;
private String httpResponseMapping;
@Override
@ -94,11 +94,11 @@ public class HttpRequestParameterProcessor extends ParameterProcessor {
public void setHttpParams(String httpParams) {
this.httpParams = httpParams;
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;

13
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/FolderResource.java

@ -0,0 +1,13 @@
package io.sc.engine.rule.core.vo.resource;
import io.sc.engine.rule.core.enums.ResourceType;
/**
* 文件夹资源实体类
*/
public class FolderResource extends Resource {
@Override
public ResourceType getType() {
return ResourceType.FOLDER;
}
}

24
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/ModelResource.java

@ -0,0 +1,24 @@
package io.sc.engine.rule.core.vo.resource;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.sc.engine.rule.core.enums.ResourceType;
/**
* 模型资源实体类
*/
public class ModelResource extends ReleasableResource {
@JsonIgnore
private String model;//模型
@Override
public ResourceType getType() {
return ResourceType.MODEL;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
}

74
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/ReleasableResource.java

@ -0,0 +1,74 @@
package io.sc.engine.rule.core.vo.resource;
import io.sc.engine.rule.core.enums.DeployStatus;
import java.util.Date;
/**
* 可版本化资源
*/
public abstract class ReleasableResource extends Resource {
protected DeployStatus status;//状态
protected Integer version;//版本
protected Date effectiveDate;//生效日期
protected String imports;//引入外部包
protected int attachmentCount;//附件个数
protected String taskName;//审批任务节点名称
protected String taskAssignee;//审批任务节点处理人
public DeployStatus getStatus() {
return status;
}
public void setStatus(DeployStatus status) {
this.status = status;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
public String getImports() {
return imports;
}
public void setImports(String imports) {
this.imports = imports;
}
public int getAttachmentCount() {
return attachmentCount;
}
public void setAttachmentCount(int attachmentCount) {
this.attachmentCount = attachmentCount;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getTaskAssignee() {
return taskAssignee;
}
public void setTaskAssignee(String taskAssignee) {
this.taskAssignee = taskAssignee;
}
}

66
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/resource/Resource.java

@ -0,0 +1,66 @@
package io.sc.engine.rule.core.vo.resource;
import io.sc.engine.rule.core.enums.ResourceType;
import io.sc.engine.rule.core.po.testcase.ResourceTestCase;
import io.sc.platform.orm.api.vo.AuditorVo;
import java.util.ArrayList;
import java.util.List;
/**
* 资源
*/
public abstract class Resource extends AuditorVo {
protected ResourceType type;//类型(用于区分子类)
protected String id;//ID,主键
protected String code;//代码
protected String name;//名称
protected String description;//描述
protected Integer order;//排序
protected String parent;//父
private List<Resource> children =new ArrayList<Resource>();//孩子集合
protected List<ResourceTestCase> testCases =new ArrayList<ResourceTestCase>();//测试用例
public ResourceType getType() {
return type;
}
public void setType(ResourceType type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
}

70
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/testcase/TestCase.java

@ -0,0 +1,70 @@
package io.sc.engine.rule.core.vo.testcase;
import io.sc.engine.rule.core.enums.TestCaseOwnerType;
import io.sc.engine.rule.core.enums.TestResult;
import io.sc.platform.orm.api.vo.AuditorVo;
import java.util.Date;
/**
* 测试用例
*/
public class TestCase extends AuditorVo {
protected TestCaseOwnerType ownerType;//类型(用于区分子类)
protected String ownerId;//所有者ID
protected String id;//ID,主键
protected String name;//名称
protected String description;//描述
protected Integer order;//排序
protected Date lastTestDate;//最近一次执行测试用例的日期
protected TestResult testResult;//最近一次执行测试用例的结果
public TestCaseOwnerType getOwnerType() {
return ownerType;
}
public void setOwnerType(TestCaseOwnerType ownerType) {
this.ownerType = ownerType;
}
public String getOwnerId() {
return ownerId;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public Date getLastTestDate() {
return lastTestDate;
}
public void setLastTestDate(Date lastTestDate) {
this.lastTestDate = lastTestDate;
}
public TestResult getTestResult() {
return testResult;
}
public void setTestResult(TestResult testResult) {
this.testResult = testResult;
}
}

71
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/vo/testcase/TestCaseParameter.java

@ -0,0 +1,71 @@
package io.sc.engine.rule.core.vo.testcase;
import io.sc.engine.rule.core.enums.TestResult;
import io.sc.platform.orm.api.vo.AuditorVo;
/**
* 测试用例参数
*/
public class TestCaseParameter extends AuditorVo {
protected String id;//ID,主键
protected String code;//对应的参数代码
protected Boolean skipCheck;//是否跳过检查
protected String inputValue;//参数输入值
protected String expectValue;//参数期望值
protected String resultValue;//参数实际执行结果值
protected TestResult testResult;//最近一次执行测试用例的结果
protected String testCase;//所属测试用例
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Boolean getSkipCheck() {
return skipCheck;
}
public void setSkipCheck(Boolean skipCheck) {
this.skipCheck = skipCheck;
}
public String getInputValue() {
return inputValue;
}
public void setInputValue(String inputValue) {
this.inputValue = inputValue;
}
public String getExpectValue() {
return expectValue;
}
public void setExpectValue(String expectValue) {
this.expectValue = expectValue;
}
public String getResultValue() {
return resultValue;
}
public void setResultValue(String resultValue) {
this.resultValue = resultValue;
}
public TestResult getTestResult() {
return testResult;
}
public void setTestResult(TestResult testResult) {
this.testResult = testResult;
}
public String getTestCase() {
return testCase;
}
public void setTestCase(String testCase) {
this.testCase = testCase;
}
public void clearTestResult() {
this.setTestResult(null);
}
}

2
io.sc.engine.rule.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

47
io.sc.engine.rule.frontend/src/i18n/messages.json

@ -79,31 +79,46 @@
"re.resources.designer.processor.grid.title": "Processor",
"re.resources.designer.processor.grid.entity.content": "Content",
"re.resources.designer.processor.grid.entity.arithmetic": "Arithmetic",
"re.resources.designer.processor.grid.entity.conditionRangeVar": "Condition Range Variable",
"re.resources.designer.processor.grid.entity.conditionRange": "Condition Range",
"re.resources.designer.processor.grid.entity.decisionTable": "Decision Table",
"re.resources.designer.processor.grid.entity.decisionTable2C": "Simple Decision Table",
"re.resources.designer.processor.grid.entity.decisionTree": "Decision Tree",
"re.resources.designer.processor.grid.entity.executionFlow": "Execution Flow",
"re.resources.designer.processor.grid.entity.groovyScript": "Script",
"re.resources.designer.processor.grid.entity.httpMethod": "Http Method",
"re.resources.designer.processor.grid.entity.httpUrl": "URL",
"re.resources.designer.processor.grid.entity.httpAuthType": "Authorization Type",
"re.resources.designer.processor.grid.entity.httpAuthApikey": "API Key",
"re.resources.designer.processor.grid.entity.httpAuthApiValue": "API Value",
"re.resources.designer.processor.grid.entity.httpAuthBasicUsername": "User Name",
"re.resources.designer.processor.grid.entity.httpAuthBasicPassword": "Password",
"re.resources.designer.processor.grid.entity.httpAuthBearerToken": "Bearer Token",
"re.resources.designer.processor.grid.entity.httpRequestBody": "Request Body",
"re.resources.designer.processor.grid.entity.httpResponseBody": "Response Body",
"re.resources.designer.processor.grid.entity.httpResponseMapping": "Response Mapping",
"re.resources.designer.processor.grid.entity.mathFormula": "Math Formula",
"re.resources.designer.processor.grid.entity.numberRangeVar": "Number Range Variable",
"re.resources.designer.processor.grid.entity.numberRange": "Number Range",
"re.resources.designer.processor.grid.entity.objectCondition": "Condition",
"re.resources.designer.processor.grid.entity.objectProperties": "Object Properties",
"re.resources.designer.processor.grid.entity.optionCode": "Option",
"re.resources.designer.processor.grid.entity.arithmetic": "Arithmetic",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.rule": "Rule",
"re.resources.designer.processor.grid.entity.scoreCard": "Score Card",
"re.resources.designer.processor.grid.entity.singleRule": "Single Rule",
"re.resources.designer.processor.grid.entity.sqlDatasourceName": "Datasource Name",
"re.resources.designer.processor.grid.entity.sql": "SQL",
"re.resources.designer.processor.grid.entity.sqlParameterValues": "Parameter Values",
"re.resources.designer.processor.grid.entity.sqlQueryResult": "Query Result",
"re.resources.designer.processor.grid.entity.sqlFieldMapping": "Result Mapping",
"re.resources.designer.processor.grid.entity.ternaryCondition": "Ternary Condition",
"re.resources.designer.processor.grid.entity.ternaryTrue": "Ternary True",
"re.resources.designer.processor.grid.entity.ternaryFalse": "Ternary False",
"re.resources.designer.processor.grid.entity.when": "When Expression",
"re.resources.designer.processor.grid.entity.then": "Then Expression",
"re.resources.designer.processor.grid.entity.isWhenThenShorted": "Shorted",
"re.resources.designer.processor.grid.entity.numberRangeVar": "Number Range Expression",
"re.resources.designer.processor.grid.entity.numberRange": "Number Range",
"re.resources.designer.processor.grid.entity.conditionRangeVar": "Condition Range",
"re.resources.designer.processor.grid.entity.conditionRange": "Condition Range",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.decisionTable2C": "Simple Decision Table",
"re.resources.designer.processor.grid.entity.decisionTable": "Decision Table",
"re.resources.designer.processor.grid.entity.groovyScript": "Script",
"re.resources.designer.processor.grid.entity.sqlDatasourceName": "Datasource Name",
"re.resources.designer.processor.grid.entity.sql": "SQL",
"re.resources.designer.processor.grid.entity.sqlParameterValues": "Parameter Values",
"re.resources.designer.processor.grid.entity.sqlQueryResult": "Result",
"re.resources.designer.processor.grid.entity.sqlFieldMapping": "Result Mapping",
"re.resources.designer.processor.grid.entity.rule": "Rule",
"re.resources.designer.processor.grid.entity.singleRule": "Single Rule",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Left": "Add Column at Left",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Right": "Add Column at Right",

47
io.sc.engine.rule.frontend/src/i18n/messages_tw_CN.json

@ -79,31 +79,46 @@
"re.resources.designer.processor.grid.title": "處理邏輯",
"re.resources.designer.processor.grid.entity.content": "內容",
"re.resources.designer.processor.grid.entity.objectCondition": "條件",
"re.resources.designer.processor.grid.entity.objectProperties": "對象屬性",
"re.resources.designer.processor.grid.entity.optionCode": "選項",
"re.resources.designer.processor.grid.entity.arithmetic": "算數表達式",
"re.resources.designer.processor.grid.entity.ternaryCondition": "條件",
"re.resources.designer.processor.grid.entity.ternaryTrue": "條件滿足時",
"re.resources.designer.processor.grid.entity.ternaryFalse": "條件不滿足時",
"re.resources.designer.processor.grid.entity.when": "When 表達式",
"re.resources.designer.processor.grid.entity.then": "Then 表達式",
"re.resources.designer.processor.grid.entity.isWhenThenShorted": "跳過後續操作",
"re.resources.designer.processor.grid.entity.numberRangeVar": "數值分段表達式",
"re.resources.designer.processor.grid.entity.numberRange": "數值分段",
"re.resources.designer.processor.grid.entity.conditionRangeVar": "條件分段",
"re.resources.designer.processor.grid.entity.conditionRangeVar": "条件分段",
"re.resources.designer.processor.grid.entity.conditionRange": "條件分段",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.decisionTable2C": "簡單決策表",
"re.resources.designer.processor.grid.entity.decisionTable": "決策表",
"re.resources.designer.processor.grid.entity.decisionTable2C": "簡單決策表",
"re.resources.designer.processor.grid.entity.decisionTree": "決策樹",
"re.resources.designer.processor.grid.entity.executionFlow": "執行流",
"re.resources.designer.processor.grid.entity.groovyScript": "腳本代碼",
"re.resources.designer.processor.grid.entity.httpMethod": "請求方法",
"re.resources.designer.processor.grid.entity.httpUrl": "URL",
"re.resources.designer.processor.grid.entity.httpAuthType": "認證類型",
"re.resources.designer.processor.grid.entity.httpAuthApikey": "API Key",
"re.resources.designer.processor.grid.entity.httpAuthApiValue": "API Value",
"re.resources.designer.processor.grid.entity.httpAuthBasicUsername": "用戶名",
"re.resources.designer.processor.grid.entity.httpAuthBasicPassword": "密碼",
"re.resources.designer.processor.grid.entity.httpAuthBearerToken": "Bearer Token",
"re.resources.designer.processor.grid.entity.httpRequestBody": "請求體",
"re.resources.designer.processor.grid.entity.httpResponseBody": "響應體",
"re.resources.designer.processor.grid.entity.httpResponseMapping": "響應映射",
"re.resources.designer.processor.grid.entity.mathFormula": "數學公式",
"re.resources.designer.processor.grid.entity.numberRangeVar": "數值分段表達式",
"re.resources.designer.processor.grid.entity.numberRange": "數值分段",
"re.resources.designer.processor.grid.entity.objectCondition": "條件",
"re.resources.designer.processor.grid.entity.objectProperties": "對象屬性",
"re.resources.designer.processor.grid.entity.optionCode": "選項",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.rule": "規則",
"re.resources.designer.processor.grid.entity.scoreCard": "評分卡",
"re.resources.designer.processor.grid.entity.singleRule": "單規則",
"re.resources.designer.processor.grid.entity.sqlDatasourceName": "數據源名稱",
"re.resources.designer.processor.grid.entity.sql": "SQL 語句",
"re.resources.designer.processor.grid.entity.sqlParameterValues": "參數值",
"re.resources.designer.processor.grid.entity.sqlQueryResult": "執行結果",
"re.resources.designer.processor.grid.entity.sqlFieldMapping": "結果映射",
"re.resources.designer.processor.grid.entity.rule": "規則",
"re.resources.designer.processor.grid.entity.singleRule": "單規則",
"re.resources.designer.processor.grid.entity.ternaryCondition": "條件",
"re.resources.designer.processor.grid.entity.ternaryTrue": "條件滿足時",
"re.resources.designer.processor.grid.entity.ternaryFalse": "條件不滿足時",
"re.resources.designer.processor.grid.entity.when": "When 表達式",
"re.resources.designer.processor.grid.entity.then": "Then 表達式",
"re.resources.designer.processor.grid.entity.isWhenThenShorted": "跳過後續操作",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Left": "在左邊新增列",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Right": "在右邊新增列",

51
io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json

@ -79,37 +79,46 @@
"re.resources.designer.processor.grid.title": "处理逻辑",
"re.resources.designer.processor.grid.entity.content": "内容",
"re.resources.designer.processor.grid.entity.objectCondition": "条件",
"re.resources.designer.processor.grid.entity.objectProperties": "对象属性",
"re.resources.designer.processor.grid.entity.optionCode": "选项",
"re.resources.designer.processor.grid.entity.arithmetic": "算数表达式",
"re.resources.designer.processor.grid.entity.ternaryCondition": "条件",
"re.resources.designer.processor.grid.entity.ternaryTrue": "条件满足时",
"re.resources.designer.processor.grid.entity.ternaryFalse": "条件不满足时",
"re.resources.designer.processor.grid.entity.when": "When 表达式",
"re.resources.designer.processor.grid.entity.then": "Then 表达式",
"re.resources.designer.processor.grid.entity.isWhenThenShorted": "跳过后续操作",
"re.resources.designer.processor.grid.entity.numberRangeVar": "数值分段表达式",
"re.resources.designer.processor.grid.entity.numberRange": "数值分段",
"re.resources.designer.processor.grid.entity.conditionRangeVar": "条件分段",
"re.resources.designer.processor.grid.entity.conditionRange": "条件分段",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.decisionTable2C": "简单决策表",
"re.resources.designer.processor.grid.entity.decisionTable": "决策表",
"re.resources.designer.processor.grid.entity.decisionTable2C": "简单决策表",
"re.resources.designer.processor.grid.entity.decisionTree": "决策树",
"re.resources.designer.processor.grid.entity.executionFlow": "执行流",
"re.resources.designer.processor.grid.entity.groovyScript": "脚本代码",
"re.resources.designer.processor.grid.entity.sqlDatasourceName": "数据源名称",
"re.resources.designer.processor.grid.entity.sql": "SQL 语句",
"re.resources.designer.processor.grid.entity.sqlParameterValues": "参数值",
"re.resources.designer.processor.grid.entity.sqlQueryResult": "执行结果",
"re.resources.designer.processor.grid.entity.sqlFieldMapping": "结果映射",
"re.resources.designer.processor.grid.entity.httpMethod": "请求方法",
"re.resources.designer.processor.grid.entity.httpUrl": "URL",
"re.resources.designer.processor.grid.entity.httpAuthType": "认证类型",
"re.resources.designer.processor.grid.entity.httpMethod": "请求方法",
"re.resources.designer.processor.grid.entity.httpMethod": "请求方法",
"re.resources.designer.processor.grid.entity.httpAuthApikey": "API Key",
"re.resources.designer.processor.grid.entity.httpAuthApiValue": "API Value",
"re.resources.designer.processor.grid.entity.httpAuthBasicUsername": "用户名",
"re.resources.designer.processor.grid.entity.httpAuthBasicPassword": "密码",
"re.resources.designer.processor.grid.entity.httpAuthBearerToken": "Bearer Token",
"re.resources.designer.processor.grid.entity.httpRequestBody": "请求体",
"re.resources.designer.processor.grid.entity.httpResponseBody": "响应体",
"re.resources.designer.processor.grid.entity.httpResponseMapping": "响应映射",
"re.resources.designer.processor.grid.entity.mathFormula": "数学公式",
"re.resources.designer.processor.grid.entity.numberRangeVar": "数值分段表达式",
"re.resources.designer.processor.grid.entity.numberRange": "数值分段",
"re.resources.designer.processor.grid.entity.objectCondition": "条件",
"re.resources.designer.processor.grid.entity.objectProperties": "对象属性",
"re.resources.designer.processor.grid.entity.optionCode": "选项",
"re.resources.designer.processor.grid.entity.pmml": "PMML",
"re.resources.designer.processor.grid.entity.rule": "规则",
"re.resources.designer.processor.grid.entity.scoreCard": "评分卡",
"re.resources.designer.processor.grid.entity.singleRule": "单规则",
"re.resources.designer.processor.grid.entity.sqlDatasourceName": "数据源名称",
"re.resources.designer.processor.grid.entity.sql": "SQL 语句",
"re.resources.designer.processor.grid.entity.sqlParameterValues": "参数值",
"re.resources.designer.processor.grid.entity.sqlQueryResult": "执行结果",
"re.resources.designer.processor.grid.entity.sqlFieldMapping": "结果映射",
"re.resources.designer.processor.grid.entity.ternaryCondition": "条件",
"re.resources.designer.processor.grid.entity.ternaryTrue": "条件满足时",
"re.resources.designer.processor.grid.entity.ternaryFalse": "条件不满足时",
"re.resources.designer.processor.grid.entity.when": "When 表达式",
"re.resources.designer.processor.grid.entity.then": "Then 表达式",
"re.resources.designer.processor.grid.entity.isWhenThenShorted": "跳过后续操作",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Left": "在左边新增列",
"re.resources.designer.processor.decisionTable.toolbar.addCol2Right": "在右边新增列",

7
io.sc.engine.rule.frontend/src/views/dictionary/dictionary.vue

@ -5,7 +5,7 @@
<w-grid
ref="treeGridRef"
:title="$t('re.dictionary.grid.title')"
draggable="server"
dnd-mode="server"
hide-bottom
dense-body
db-click-operation="edit"
@ -343,6 +343,7 @@
<w-grid
ref="fieldGridRef"
:title="$t('re.dictionary.field.grid.title')"
dnd-mode="server"
dense-body
hide-bottom
:config-button="true"
@ -545,8 +546,8 @@
form: {
colsNum: 1,
fields: [
{ name: 'dictionary', label: $t('dictionary'), type: 'w-text', hidden: false, defaultValue: currentSelectedDictionaryIdRef },
{ name: 'value', label: $t('value'), type: 'w-text', hidden: false },
{ name: 'dictionary', label: $t('dictionary'), type: 'w-text', defaultValue: currentSelectedDictionaryIdRef },
{ name: 'value', label: $t('value'), type: 'w-text' },
{
name: 'title',
label: $t('title'),

5
io.sc.engine.rule.frontend/src/views/function/Function.vue

@ -12,6 +12,7 @@
:sort-by="['-lastModifyDate']"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[
'query',
'refresh',
'separator',
'add',
@ -35,6 +36,10 @@
},
},
]"
:query-form-fields="[
{ name: 'name', label: $t('name'), type: 'w-text', clearable: true },
{ colSpan: 2, name: 'description', label: $t('description'), type: 'w-text', clearable: true },
]"
:columns="[
{ width: 70, name: 'enable', label: $t('enable'), format: Formater.enableTag(), align: 'center', sortable: false },
{ width: 120, name: 'name', label: $t('name') },

2
io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue

@ -3,7 +3,7 @@
<w-grid
ref="gridRef"
:title="$t('re.indicator.grid.title')"
draggable="server"
dnd-mode="server"
dense
hide-bottom
db-click-operation="edit"

2
io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue

@ -3,7 +3,7 @@
<w-grid
ref="treeGridRef"
:title="$t('re.lib.grid.title')"
draggable="server"
dnd-mode="server"
dense-body
hide-bottom
db-click-operation="edit"

12
io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue

@ -3,7 +3,7 @@
<w-grid
ref="gridRef"
:title="$t('re.resources.designer.processor.grid.title')"
draggable="server"
dnd-mode="server"
dense
hide-bottom
db-click-operation="edit"
@ -77,12 +77,12 @@
width: '80%',
},
form: {
colsNum: 5,
colsNum: 12,
fields: [
{ colSpan: 5, name: 'indicator', label: 'indicator', type: 'w-text', defaultValue: indicator.id, showIf: false },
{ colSpan: 5, name: 'id', label: $t('id'), type: 'w-text', showIf: false },
{ colSpan: 5, name: 'order', label: $t('order'), type: 'w-number', showIf: false },
{ colSpan: 5, name: 'type', label: $t('type'), type: 'w-text', showIf: false },
{ colSpan: 12, name: 'indicator', label: 'indicator', type: 'w-text', defaultValue: indicator.id, showIf: false },
{ colSpan: 12, name: 'id', label: $t('id'), type: 'w-text', showIf: false },
{ colSpan: 12, name: 'order', label: $t('order'), type: 'w-number', showIf: false },
{ colSpan: 12, name: 'type', label: $t('type'), type: 'w-text', showIf: false },
...processorManager.getEditorFields(),
],
},

4
io.sc.engine.rule.frontend/src/views/lib/TestCase.vue

@ -58,8 +58,8 @@
'export',
]"
:columns="[
{ width: 50, name: 'order', label: $t('order'), hidden: true },
{ width: 100, name: 'id', label: $t('id'), hidden: true },
{ width: 50, name: 'order', label: $t('order'), showIf: false },
{ width: 100, name: 'id', label: $t('id'), showIf: false },
{
width: 80,
name: 'testResult',

2
io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue

@ -123,7 +123,7 @@
label: $t('re.resources.designer.validator.grid.entity.tip'),
type: 'w-text',
},
{ name: 'order', label: $t('order'), type: 'w-number', hidden: false },
{ name: 'order', label: $t('order'), type: 'w-number' },
],
},
}"

2
io.sc.engine.rule.frontend/src/views/resources/AttachmentDialog.vue

@ -37,7 +37,7 @@
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:data-url="dataUrl"
:columns="[
{ width: 120, name: 'id', label: $t('id'), hidden: true },
{ width: 120, name: 'id', label: $t('id'), showIf: false },
{
width: '100%',
name: 'name',

1
io.sc.engine.rule.frontend/src/views/resources/Resources.vue

@ -5,6 +5,7 @@
:title="$t('re.resources.grid.title')"
dense-body
hide-bottom
dnd-mode="server"
:config-button="true"
selection="multiple"
:checkbox-selection="false"

2
io.sc.engine.rule.frontend/src/views/resources/designer/Model.vue

@ -3,7 +3,7 @@
<w-grid
ref="treeGridRef"
:title="$t('re.resources.designer.model.grid.title')"
draggable="server"
dnd-mode="server"
dense-body
class="px-1"
hide-bottom

2
io.sc.engine.rule.frontend/src/views/resources/designer/Option.vue

@ -82,7 +82,7 @@
label: $t('description'),
type: 'w-text',
},
{ name: 'order', label: $t('order'), type: 'w-number', hidden: false },
{ name: 'order', label: $t('order'), type: 'w-number' },
],
},
}"

2
io.sc.engine.rule.frontend/src/views/resources/designer/Parameter.vue

@ -3,7 +3,7 @@
<w-grid
ref="gridRef"
:title="$t('re.resources.designer.parameter.grid.title')"
draggable="server"
dnd-mode="server"
dense-body
class="px-1"
hide-bottom

14
io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue

@ -112,14 +112,14 @@
width: '50%',
},
form: {
colsNum: 7,
colsNum: 12,
fields: [
{ colSpan: 7, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, showIf: false },
{ colSpan: 7, name: 'id', label: $t('id'), type: 'w-text', showIf: false },
{ colSpan: 7, name: 'order', label: $t('order'), type: 'w-number', showIf: false },
{ colSpan: 7, name: 'type', label: $t('type'), type: 'w-text', showIf: false },
{ colSpan: 7, name: 'description', label: $t('description'), type: 'w-text', showIf: false },
{ colSpan: 7, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, showIf: false },
{ colSpan: 12, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, showIf: false },
{ colSpan: 12, name: 'id', label: $t('id'), type: 'w-text', showIf: false },
{ colSpan: 12, name: 'order', label: $t('order'), type: 'w-number', showIf: false },
{ colSpan: 12, name: 'type', label: $t('type'), type: 'w-text', showIf: false },
{ colSpan: 12, name: 'description', label: $t('description'), type: 'w-text', showIf: false },
{ colSpan: 12, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, showIf: false },
...processorManager.getEditorFields(),
],
},

4
io.sc.engine.rule.frontend/src/views/resources/designer/Testcase.vue

@ -82,8 +82,8 @@
'export',
]"
:columns="[
{ width: 60, name: 'order', label: $t('order'), align: 'right', hidden: true },
{ width: 100, name: 'id', label: $t('id'), hidden: true },
{ width: 60, name: 'order', label: $t('order'), align: 'right', showIf: false },
{ width: 100, name: 'id', label: $t('id'), showIf: false },
{
width: 60,
name: 'testResult',

2
io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue

@ -142,7 +142,7 @@
label: $t('re.resources.designer.validator.grid.entity.tip'),
type: 'w-text',
},
{ name: 'order', label: $t('order'), type: 'w-number', hidden: false },
{ name: 'order', label: $t('order'), type: 'w-number' },
],
},
}"

2
io.sc.engine.rule.frontend/src/views/shared/Processor.ts

@ -11,6 +11,8 @@ abstract class Processor {
public static SCORE_CARD: string = 'scoreCard';
public static FORMAT_TABLE_STYLE: any = { dense: false, bordered: false };
PROCESSOR_TYPE: string = '';
EDITOR_DIALOG_WIDTH: number = 800;
targetType: string;
context: any;
autoCompletionManager: any;

16
io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts

@ -2,20 +2,24 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class Arithmetic extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'ARITHMETIC';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'arithmetic',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.ARITHMETIC'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-calculator',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'ARITHMETIC');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -37,7 +41,7 @@ class Arithmetic extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'arithmetic',
label: $t('re.resources.designer.processor.grid.entity.arithmetic'),
type: 'w-code-mirror',
@ -49,7 +53,7 @@ class Arithmetic extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'ARITHMETIC' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -62,7 +66,7 @@ class Arithmetic extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

16
io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts

@ -3,20 +3,24 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class ConditionRange extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'CONDITION_RANGE';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'conditionRange',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.CONDITION_RANGE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-card-checklist',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'CONDITION_RANGE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -39,11 +43,11 @@ class ConditionRange extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'conditionRange',
label: $t('re.resources.designer.processor.grid.entity.conditionRange'),
showIf: (args: any) => {
return 'CONDITION_RANGE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 300,
@ -154,7 +158,7 @@ class ConditionRange extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
// 初始化代码编辑器的自动完成提示管理器
this.initAutoCompletionManager();
// 初始化代码编辑器的用户自定义函数管理器

17
io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts

@ -4,21 +4,26 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class DecisionTable extends Processor {
#editorDialogWidth: number = 1024;
protected columnsRef = ref(<any>[]);
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'DECISION_TABLE';
this.EDITOR_DIALOG_WIDTH = 1024;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'decisionTable',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TABLE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-grid-3x3',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'DECISION_TABLE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -50,11 +55,11 @@ class DecisionTable extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'decisionTable',
label: $t('re.resources.designer.processor.grid.entity.decisionTable'),
showIf: (args: any) => {
return 'DECISION_TABLE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 300,
@ -219,7 +224,7 @@ class DecisionTable extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();

16
io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts

@ -5,20 +5,24 @@ import { DecisionTable } from './DecisionTable';
import { PlaceHolder } from '@/utils/PlaceHolder';
class DecisionTable2C extends DecisionTable {
#editorDialogWidth: number = 1024;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'DECISION_TABLE_2C';
this.EDITOR_DIALOG_WIDTH = 1024;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'decisionTable2C',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TABLE_2C'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-grid-3x2',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'DECISION_TABLE_2C');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -44,11 +48,11 @@ class DecisionTable2C extends DecisionTable {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'decisionTable2C',
label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'),
showIf: (args: any) => {
return 'DECISION_TABLE_2C' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 300,
@ -190,7 +194,7 @@ class DecisionTable2C extends DecisionTable {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();

13
io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts

@ -2,18 +2,23 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class DecisionTree extends Processor {
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'DECISION_TREE';
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'decisionTree',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TREE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-tree',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'DECISION_TREE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -29,7 +34,7 @@ class DecisionTree extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'decisionTree',
label: $t('re.resources.designer.processor.grid.entity.decisionTree'),
type: 'w-code-mirror',
@ -37,7 +42,7 @@ class DecisionTree extends Processor {
lineNumber: true,
toolbar: false,
showIf: (args: any) => {
return 'DECISION_TREE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];

13
io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts

@ -2,18 +2,23 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class ExecutionFlow extends Processor {
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'EXECUTION_FLOW';
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'executionFlow',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.EXECUTION_FLOW'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-bounding-box-circles',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'EXECUTION_FLOW');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -29,7 +34,7 @@ class ExecutionFlow extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'executionFlow',
label: $t('re.resources.designer.processor.grid.entity.executionFlow'),
type: 'w-code-mirror',
@ -37,7 +42,7 @@ class ExecutionFlow extends Processor {
lineNumber: true,
toolbar: false,
showIf: (args: any) => {
return 'EXECUTION_FLOW' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];

16
io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts

@ -2,20 +2,24 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class GroovyScript extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'GROOVY_SCRIPT';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'groovyScript',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.GROOVY_SCRIPT'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-code',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'GROOVY_SCRIPT');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -30,7 +34,7 @@ class GroovyScript extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'groovyScript',
label: $t('re.resources.designer.processor.grid.entity.groovyScript'),
type: 'w-code-mirror',
@ -43,7 +47,7 @@ class GroovyScript extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'GROOVY_SCRIPT' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -56,7 +60,7 @@ class GroovyScript extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

423
io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts

@ -4,386 +4,195 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class HttpRequest extends Processor {
#editorDialogWidth: number = 1280;
#HttpMethodTypeEnum: any;
#httpMethodTypeOptionsRef = ref(<any>[]);
#parameterOptionsRef = ref(<any>[]);
#sqlQueryResultFieldsRef = ref(<any>[]);
#editorForm: any;
#HttpAuthorizationTypeEnum: any;
#httpAuthorizationTypeOptionsRef = ref(<any>[]);
constructor(targetType: string, context?: any) {
super(targetType, context);
EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType']).then((value) => {
this.PROCESSOR_TYPE = 'HTTP_REQUEST';
this.EDITOR_DIALOG_WIDTH = 1024;
EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType', 'io.sc.engine.rule.core.enums.HttpAuthorizationType']).then((value) => {
this.#HttpMethodTypeEnum = value.HttpMethodType;
this.#httpMethodTypeOptionsRef = Options.enum(this.#HttpMethodTypeEnum);
this.#HttpAuthorizationTypeEnum = value.HttpAuthorizationType;
this.#httpAuthorizationTypeOptionsRef = Options.enum(this.#HttpAuthorizationTypeEnum);
});
if (this.targetType === Processor.PARAMETER) {
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + this.context.target.id)).then((response) => {
this.#parameterOptionsRef.value = Tools.objects2Options(response.data, 'name', 'code');
});
}
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'http',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.HTTP_REQUEST'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'sync_alt',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'HTTP_REQUEST');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
public format(row: any): any {
return {
componentType: 'w-code-mirror',
attrs: {
lang: 'sql',
rows: 4,
editable: false,
modelValue: row.sql,
placeholder: true,
},
};
return row.httpMethod + ', ' + PlaceHolder.replace(row.httpUrl);
}
public getEditorFields(): any {
return [
{
colSpan: 2,
colSpan: 3,
name: 'httpMethod',
label: $t('re.resources.designer.processor.grid.entity.httpMethod'),
type: 'w-select',
clearable: true,
options: this.#httpMethodTypeOptionsRef,
rows: 1,
showIf: (args: any) => {
return 'HTTP_REQUEST' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 5,
name: 'sql',
colSpan: 9,
name: 'httpUrl',
label: $t('re.resources.designer.processor.grid.entity.httpUrl'),
type: 'w-text',
showIf: (args: any) => {
return 'HTTP_REQUEST' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 3,
name: 'sqlParameterValues',
label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'),
name: 'httpAuthType',
label: $t('re.resources.designer.processor.grid.entity.httpAuthType'),
type: 'w-select',
options: this.#httpAuthorizationTypeOptionsRef,
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
},
type: 'w-grid',
height: 150,
title: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'),
autoFetchData: false,
dense: true,
dbClickOperation: 'edit',
dndMode: 'local',
pageable: false,
configButton: false,
toolbarConfigure: { noIcon: false },
toolbarActions: [
{
name: 'analyze',
label: $t('analyze'),
icon: 'bi-tag',
click: (args: any) => {
const sql = args.grid.getEditorForm().getFieldValue('sql');
const regex = /\$\{[\u0000-\uFFFF]+?\}/g;
const array: any[] = sql.match(regex);
const rows: any[] = [];
array.forEach((item) => {
rows.push({ name: item, value: '' });
});
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues');
grid.setLocalData(rows);
},
},
'separator',
'add',
'edit',
[
{
extend: 'remove',
click: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues');
grid.removeRows(args.selecteds);
},
},
{
extend: 'remove',
name: 'removeAll',
label: $t('deleteAll'),
click: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues');
grid.setLocalData([]);
},
},
],
],
columns: [
{
width: '50%',
name: 'name',
label: $t('name'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
width: '100%',
name: 'value',
label: $t('value'),
sortable: false,
},
],
editor: {
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{
name: 'name',
label: $t('name'),
type: 'w-code-mirror',
toolbar: false,
lang: 'java',
rows: 1,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
},
{
name: 'value',
label: $t('value'),
type: 'w-text',
},
],
},
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
onBeforeEditorDataSubmit: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues');
const form = grid.getEditorForm();
if ('add' == form.getStatus() || 'clone' == form.getStatus()) {
grid.addLocalData(args.data);
args.callback(false);
} else if ('edit' == form.getStatus()) {
grid.updateLocalData(args.data);
args.callback(false);
}
},
{
colSpan: 3,
name: 'httpAuthApikey',
label: $t('re.resources.designer.processor.grid.entity.httpAuthApikey'),
type: 'w-text',
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY';
},
},
{
colSpan: 4,
name: 'sqlQueryResult',
label: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'),
colSpan: 6,
name: 'httpAuthApiValue',
label: $t('re.resources.designer.processor.grid.entity.httpAuthApiValue'),
type: 'w-text',
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'API_KEY';
},
type: 'w-grid',
height: 250,
autoFetchData: false,
title: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'),
dense: true,
dndMode: 'local',
pageable: false,
checkboxSelection: false,
configButton: false,
toolbarConfigure: { noIcon: false },
toolbarActions: [
{
name: 'execute',
label: $t('execute'),
icon: 'bi-caret-right',
click: (args: any) => {
const sql = this.#editorForm.getFieldValue('sql');
const grid = this.#editorForm.getFieldComponent('sqlParameterValues');
const sqlParameterValues = grid?.getRows();
axios
.post(Environment.apiContextPath('/api/re/model/parameter/processor/executeSql'), {
sql: sql,
sqlParameterValues: sqlParameterValues,
})
.then((response) => {
const fieldMetaDatas: any[] = response.data.fieldMetaDatas;
fieldMetaDatas.forEach((field) => {
field.value = field.name;
field.label = field.name;
});
const data = response.data.data;
const grid = this.#editorForm.getFieldComponent('sqlQueryResult');
this.#sqlQueryResultFieldsRef.value = fieldMetaDatas;
grid.setLocalData(data);
});
},
},
],
columns: computed(() => {
return this.#sqlQueryResultFieldsRef.value;
}),
},
{
colSpan: 3,
name: 'sqlFieldMapping',
label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'),
name: 'httpAuthBasicUsername',
label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicUsername'),
type: 'w-text',
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH';
},
type: 'w-grid',
height: 250,
width: '100%',
autoFetchData: false,
title: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'),
dense: true,
dbClickOperation: 'edit',
dndMode: 'local',
pageable: false,
configButton: false,
toolbarConfigure: { noIcon: false },
toolbarActions: [
'add',
'edit',
[
{
extend: 'remove',
click: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping');
grid.removeLocalData(args.selecteds);
},
},
{
extend: 'remove',
name: 'removeAll',
label: $t('deleteAll'),
click: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping');
grid.setLocalData([]);
},
},
],
],
columns: [
{
width: '50%',
name: 'parameter',
label: $t('parameterName'),
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
width: '50%',
name: 'field',
label: $t('fieldName'),
align: 'left',
sortable: false,
},
],
editor: {
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{
name: 'parameter',
label: $t('parameterName'),
type: 'w-select',
options: this.#parameterOptionsRef.value,
},
{
name: 'field',
label: $t('fieldName'),
type: 'w-select',
options: this.#sqlQueryResultFieldsRef.value,
},
],
},
},
{
colSpan: 6,
name: 'httpAuthBasicPassword',
label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicPassword'),
type: 'w-text',
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BASIC_AUTH';
},
onBeforeEditorDataSubmit: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping');
const form = grid.getEditorForm();
if ('add' == form.getStatus() || 'clone' == form.getStatus()) {
grid.addLocalData(args.data);
args.callback(false);
} else if ('edit' == form.getStatus()) {
grid.updateLocalData(args.data);
args.callback(false);
}
},
{
colSpan: 9,
name: 'httpAuthBearerToken',
label: $t('re.resources.designer.processor.grid.entity.httpAuthBearerToken'),
type: 'w-text',
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE && args.form.getFieldValue('httpAuthType') === 'BEARER';
},
},
{
colSpan: 12,
name: 'httpRequestBody',
label: $t('re.resources.designer.processor.grid.entity.httpRequestBody'),
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-code-mirror',
rows: 4,
toolbar: false,
lineNumber: false,
lang: 'json',
lineWrap: false,
lineBreak: true,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
},
{
colSpan: 12,
name: 'httpResponseBody',
label: $t('re.resources.designer.processor.grid.entity.httpResponseBody'),
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-code-mirror',
lang: 'json',
rows: 5,
toolbar: false,
lineNumber: false,
lineWrap: false,
lineBreak: true,
},
{
colSpan: 12,
name: 'httpResponseMapping',
label: $t('re.resources.designer.processor.grid.entity.httpResponseMapping'),
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-code-mirror',
rows: 8,
toolbar: false,
lineNumber: false,
lang: 'json',
lineWrap: false,
lineBreak: true,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
},
];
}
public getViewerFields(): any {
return [
{ name: 'sqlDatasourceName', label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName') },
{ name: 'sql', label: $t('re.resources.designer.processor.grid.entity.sql') },
{ name: 'sqlParameterValues', label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues') },
{ name: 'sqlFieldMapping', label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping') },
{ name: 'httpMethod', label: $t('re.resources.designer.processor.grid.entity.httpMethod') },
{ name: 'httpUrl', label: $t('re.resources.designer.processor.grid.entity.httpUrl') },
{ name: 'httpAuthType', label: $t('re.resources.designer.processor.grid.entity.httpAuthType') },
{ name: 'httpAuthApikey', label: $t('re.resources.designer.processor.grid.entity.httpAuthApikey') },
{ name: 'httpAuthApiValue', label: $t('re.resources.designer.processor.grid.entity.httpAuthApiValue') },
{ name: 'httpAuthBasicUsername', label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicUsername') },
{ name: 'httpAuthBasicPassword', label: $t('re.resources.designer.processor.grid.entity.httpAuthBasicPassword') },
{ name: 'httpAuthBearerToken', label: $t('re.resources.designer.processor.grid.entity.httpAuthBearerToken') },
{ name: 'httpRequestBody', label: $t('re.resources.designer.processor.grid.entity.httpRequestBody') },
{ name: 'httpResponseMapping', label: $t('re.resources.designer.processor.grid.entity.httpResponseMapping') },
];
}
public beforeEditorDataSubmit(args: any): void {
const form = args.grid.getEditorForm();
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues');
const sqlParameterValuesLocalData: any[] = sqlParameterValuesGrid.getRows();
const sqlParameterValues: any[] = [];
sqlParameterValuesLocalData.forEach((item) => {
sqlParameterValues.push({
name: item.name,
value: item.value,
});
});
args.data.sqlParameterValues = Tools.object2Json(sqlParameterValues);
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping');
const sqlFieldMappingLocalData: any[] = sqlFieldMappingGrid.getRows();
const sqlFieldMapping: any[] = Tools.objects2Objects(sqlFieldMappingLocalData, { field: 'field', parameter: 'parameter' });
args.data.sqlFieldMapping = Tools.object2Json(sqlFieldMapping);
}
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
this.#editorForm = args.grid.getEditorForm();
const form = args.grid.getEditorForm();
const row = args.data;
axios.get(Environment.apiContextPath('api/re/model/parameter/findParametersByParameterId?parameterId=' + this.context.target.id)).then((response) => {
this.#parameterOptionsRef.value = Tools.objects2Objects(response.data, {
label: 'name',
value: (parameter: any) => {
return '${' + parameter.name + '}';
},
});
});
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues');
const sqlParameterValuesRows = Tools.json2Object(row.sqlParameterValues);
sqlParameterValuesGrid.setLocalData(sqlParameterValuesRows);
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping');
const sqlFieldMappingRows = Tools.json2Object(row.sqlFieldMapping);
sqlFieldMappingGrid.setLocalData(sqlFieldMappingRows);
}
}

16
io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts

@ -2,20 +2,24 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class MathFormula extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'MATH_FORMULA';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'mathFormula',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.MATH_FORMULA'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-superscript',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'MATH_FORMULA');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -34,14 +38,14 @@ class MathFormula extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'mathFormula',
label: $t('re.resources.designer.processor.grid.entity.mathFormula'),
type: 'w-math',
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'MATH_FORMULA' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -54,7 +58,7 @@ class MathFormula extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

20
io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts

@ -3,20 +3,24 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class NumberRange extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'NUMBER_RANGE';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'numberRange',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-justify',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'NUMBER_RANGE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -43,11 +47,11 @@ class NumberRange extends Processor {
const result: any[] = [];
if (this.targetType !== Processor.SCORE_CARD) {
result.push({
colSpan: 7,
colSpan: 12,
name: 'numberRangeVar',
label: $t('re.resources.designer.processor.grid.entity.numberRangeVar'),
showIf: (args: any) => {
return 'NUMBER_RANGE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-code-mirror',
lang: 'java',
@ -60,11 +64,11 @@ class NumberRange extends Processor {
});
}
result.push({
colSpan: 7,
colSpan: 12,
name: 'numberRange',
label: $t('re.resources.designer.processor.grid.entity.numberRange'),
showIf: (args: any) => {
return 'NUMBER_RANGE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 300,
@ -173,7 +177,7 @@ class NumberRange extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();

22
io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts

@ -4,19 +4,23 @@ import { PlaceHolder } from '@/utils/PlaceHolder';
import { ValueTypeUtil } from '@/utils/ValueTypeUtil';
class ObjectProperties extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'OBJECT_PROPERTIES';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'objectProperties',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.OBJECT_PROPERTIES'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-list-task',
enableIf: (args: any) => {
return !ValueTypeUtil.isBase(this.context.target.valueType);
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'OBJECT_PROPERTIES');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -43,7 +47,7 @@ class ObjectProperties extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'objectCondition',
label: $t('re.resources.designer.processor.grid.entity.objectCondition'),
type: 'w-code-mirror',
@ -54,15 +58,15 @@ class ObjectProperties extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'OBJECT_PROPERTIES' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 7,
colSpan: 12,
name: 'objectProperties',
label: $t('re.resources.designer.processor.grid.entity.objectProperties'),
showIf: (args: any) => {
return 'OBJECT_PROPERTIES' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
title: $t('re.resources.designer.processor.grid.entity.objectProperties'),
@ -124,7 +128,7 @@ class ObjectProperties extends Processor {
],
primaryKey: 'code',
columns: [
{ name: 'code', label: 'code', hidden: true },
{ name: 'code', label: 'code', showIf: false },
{
width: 300,
name: 'name',
@ -205,7 +209,7 @@ class ObjectProperties extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();

24
io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts

@ -2,23 +2,27 @@ import { ref } from 'vue';
import { $t, axios, Environment } from 'platform-core';
import { Processor } from '../Processor';
const optionOptionsRef = ref(<any>[]);
class OptionValue extends Processor {
#editorDialogWidth: number = 400;
optionOptionsRef = ref(<any>[]);
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'OPTION_VALUE';
this.EDITOR_DIALOG_WIDTH = 400;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'optionValue',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.OPTION_VALUE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-card-list',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'OPTION_VALUE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -30,13 +34,13 @@ class OptionValue extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'optionCode',
label: $t('re.resources.designer.processor.grid.entity.optionCode'),
type: 'w-select',
options: optionOptionsRef,
options: this.optionOptionsRef,
showIf: (args: any) => {
return 'OPTION_VALUE' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -49,7 +53,7 @@ class OptionValue extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
// 获取选项输入参数列表
axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + this.context.target.id)).then((response) => {
const parameters: any[] = response.data;
@ -59,7 +63,7 @@ class OptionValue extends Processor {
options.push({ label: item.name, value: item.code });
}
});
optionOptionsRef.value = options;
this.optionOptionsRef.value = options;
});
}
}

16
io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts

@ -2,20 +2,24 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class Pmml extends Processor {
#editorDialogWidth: number = 1024;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'PMML';
this.EDITOR_DIALOG_WIDTH = 1024;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'pmml',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.PMML'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-filetype-xml',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'PMML');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -31,7 +35,7 @@ class Pmml extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'pmml',
label: $t('re.resources.designer.processor.grid.entity.pmml'),
type: 'w-code-mirror',
@ -43,7 +47,7 @@ class Pmml extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'PMML' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -56,7 +60,7 @@ class Pmml extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

227
io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts

@ -1,41 +1,254 @@
import { $t } from 'platform-core';
import { $t, Tools, MarkupTableUtil } from 'platform-core';
import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class Rule extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'RULE';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'rule',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.RULE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-shadows',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'RULE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
public format(row: any): any {
const objs: any[] = Tools.json2Object(row.rule);
if (objs && Tools.isArray(objs) && objs.length > 0) {
let header: string = '';
header += '<tr>';
header += ' <th>' + $t('category') + '</th>';
header += ' <th>' + $t('level') + '</th>';
header += ' <th>' + $t('code') + '</th>';
header += ' <th>' + $t('name') + '</th>';
header += ' <th>' + $t('condition') + '</th>';
header += ' <th>' + $t('value') + '</th>';
header += ' <th>' + $t('message') + '</th>';
header += '</tr>';
let body: string = '';
objs.forEach((obj) => {
body += '<tr>';
body += ' <td>' + $t(obj.category) + '</td>';
body += ' <td>' + $t(obj.level) + '</td>';
body += ' <td>' + $t(obj.code) + '</td>';
body += ' <td>' + $t(obj.name) + '</td>';
body += ' <td>' + $t(obj.condition) + '</td>';
body += ' <td>' + $t(obj.value) + '</td>';
body += ' <td>' + $t(obj.message) + '</td>';
body += '</tr>';
});
return MarkupTableUtil.markupTable(header, body, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE));
}
return row.rule;
}
public getEditorFields(): any {
return [];
return [
{
colSpan: 12,
name: 'rule',
label: $t('re.resources.designer.processor.grid.entity.rule'),
showIf: (args: any) => {
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 300,
localMode: true,
dbClickOperation: 'edit',
autoFetchData: false,
denseBody: true,
dndMode: 'local',
pageable: false,
configButton: false,
toolbarConfigure: { noIcon: false },
toolbarActions: ['add', 'clone', 'edit', 'remove'],
columns: [
{
name: 'category',
label: $t('category'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'level',
label: $t('level'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'code',
label: $t('code'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'name',
label: $t('name'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'condition',
label: $t('condition'),
align: 'left',
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'value',
label: $t('value'),
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
{
name: 'message',
label: $t('message'),
sortable: false,
format: (value: any) => {
return PlaceHolder.replace(value);
},
},
],
editor: {
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
{
name: 'category',
label: $t('category'),
type: 'w-text',
},
{
name: 'level',
label: $t('level'),
type: 'w-integer',
},
{
name: 'code',
label: $t('code'),
type: 'w-text',
},
{
name: 'name',
label: $t('name'),
type: 'w-text',
},
{
name: 'condition',
label: $t('condition'),
type: 'w-code-mirror',
lang: 'java',
rows: 4,
lineWrap: true,
lineBreak: false,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
},
{
name: 'value',
label: $t('value'),
type: 'w-code-mirror',
lang: 'java',
rows: 4,
lineWrap: true,
lineBreak: false,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
},
{
name: 'message',
label: $t('message'),
type: 'w-code-mirror',
lang: 'java',
rows: 4,
lineWrap: true,
lineBreak: false,
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
},
],
},
},
onBeforeEditorDataSubmit: (args: any) => {},
},
];
}
public getViewerFields(): any {
return [{ name: 'rule', label: $t('re.resources.designer.processor.grid.entity.rule') }];
}
public beforeEditorDataSubmit(args: any): void {}
public beforeEditorDataSubmit(args: any): void {
const grid = args.grid.getEditorForm().getFieldComponent('rule');
const localData: any[] = grid.getRows();
const rules: any[] = [];
localData.forEach((item) => {
rules.push({
category: item.category,
level: item.level,
code: item.code,
name: item.name,
condition: item.condition,
value: item.value,
message: item.message,
});
});
args.data.rule = Tools.object2Json(rules);
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
const form = args.grid.getEditorForm();
const grid = args.grid.getEditorForm().getFieldComponent('rule');
switch (form.getStatus()) {
case 'add': // 新增时清空表格内容
grid.setLocalData([]);
break;
case 'edit': // 编辑/复制时填充表格内容
case 'clone':
const data = Tools.json2Object(args.data.rule);
grid.setLocalData(data);
break;
}
}
}

28
io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts

@ -5,7 +5,6 @@ import { ConditionRange } from './ConditionRange';
import { NumberRange } from './NumberRange';
class ScoreCard extends Processor {
#editorDialogWidth: number = 1024;
#conditionRange: any;
#numberRange: any;
#parameterOptionsRef = ref(<any>[]);
@ -14,6 +13,9 @@ class ScoreCard extends Processor {
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'SCORE_CARD';
this.EDITOR_DIALOG_WIDTH = 1024;
this.#conditionRange = new ConditionRange(Processor.SCORE_CARD, context);
this.#numberRange = new NumberRange(Processor.SCORE_CARD, context);
@ -28,21 +30,21 @@ class ScoreCard extends Processor {
return {
extend: 'add',
name: 'scoreCard',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.SCORE_CARD'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-credit-card-2-front',
enableIf: (args) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'SCORE_CARD');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
public format(row: any): any {
const objs = Tools.json2Object(row.scoreCard);
if (objs) {
if (objs && Tools.isArray(objs) && objs.length > 0) {
let str = '';
objs.forEach((obj: any) => {
str += '<tr>';
@ -63,12 +65,12 @@ class ScoreCard extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'scoreCard',
label: $t('re.resources.designer.processor.grid.entity.scoreCard'),
type: 'w-grid',
showIf: (args: any) => {
return 'SCORE_CARD' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
localMode: true,
height: 600,
@ -98,7 +100,7 @@ class ScoreCard extends Processor {
name: 'code',
label: $t('code'),
sortable: false,
hidden: true,
showIf: false,
},
{
width: 120,
@ -149,11 +151,11 @@ class ScoreCard extends Processor {
width: '800px',
},
form: {
colsNum: 7,
colsNum: 12,
fields: [
{ colSpan: 4, name: 'code', label: $t('name'), type: 'w-select', options: this.#parameterOptionsRef.value },
{ colSpan: 3, name: 'weight', label: $t('weight'), type: 'w-number', precision: 6 },
{ name: 'type', label: $t('type'), type: 'w-text', showIf: false },
{ colSpan: 7, name: 'code', label: $t('name'), type: 'w-select', options: this.#parameterOptionsRef.value },
{ colSpan: 5, name: 'weight', label: $t('weight'), type: 'w-number', precision: 6 },
...this.#conditionRange.getEditorFields(),
...this.#numberRange.getEditorFields(),
],
@ -179,7 +181,6 @@ class ScoreCard extends Processor {
break;
}
this.#scoreCard = args.grid.getRows();
//args.grid.setLocalData(this.#scoreCard);
},
onAfterEditorOpen: (args: any) => {
const newArgs: any = {};
@ -208,6 +209,9 @@ class ScoreCard extends Processor {
return this.#numberRange.afterEditorOpen(newArgs);
}
},
onAfterDragAndDrop: (args: any) => {
this.#scoreCard = args.grid.getRows();
},
},
];
}
@ -221,7 +225,7 @@ class ScoreCard extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.#scoreCard = Tools.json2Object(args.data.scoreCard);
const form = args.grid.getEditorForm();
const scoreCardGrid = form.getFieldComponent('scoreCard');

12
io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts

@ -2,20 +2,24 @@ import { $t } from 'platform-core';
import { Processor } from '../Processor';
class SingleRule extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'SINGLE_RULE';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'singleRule',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-noise-reduction',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'SINGLE_RULE');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -35,7 +39,7 @@ class SingleRule extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
}
}

67
io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts

@ -4,24 +4,31 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class Sql extends Processor {
#editorDialogWidth: number = 1280;
#dsOptionsRef = ref(<any>[]);
#parameterOptionsRef = ref(<any>[]);
#sqlQueryResultFieldsRef = ref(<any>[]);
#editorForm: any;
#sqlParameterValuesGrid: any;
#sqlFieldMappingGrid: any;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'SQL';
this.EDITOR_DIALOG_WIDTH = 1280;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'sql',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.SQL'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-filetype-sql',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'SQL');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -42,7 +49,7 @@ class Sql extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'sqlDatasourceName',
label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName'),
type: 'w-select',
@ -50,11 +57,11 @@ class Sql extends Processor {
options: this.#dsOptionsRef,
rows: 1,
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 4,
colSpan: 7,
name: 'sql',
label: $t('re.resources.designer.processor.grid.entity.sql'),
type: 'w-code-mirror',
@ -64,19 +71,20 @@ class Sql extends Processor {
placeholder: true,
autoCompletion: this.autoCompletionManager.autoCompletion(),
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 3,
colSpan: 5,
name: 'sqlParameterValues',
label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'),
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 150,
title: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'),
localMode: true,
autoFetchData: false,
dense: true,
dbClickOperation: 'edit',
@ -166,24 +174,13 @@ class Sql extends Processor {
],
},
},
onBeforeEditorDataSubmit: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues');
const form = grid.getEditorForm();
if ('add' == form.getStatus() || 'clone' == form.getStatus()) {
grid.addLocalData(args.data);
args.callback(false);
} else if ('edit' == form.getStatus()) {
grid.updateLocalData(args.data);
args.callback(false);
}
},
},
{
colSpan: 4,
colSpan: 7,
name: 'sqlQueryResult',
label: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'),
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 250,
@ -228,15 +225,16 @@ class Sql extends Processor {
}),
},
{
colSpan: 3,
colSpan: 5,
name: 'sqlFieldMapping',
label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'),
showIf: (args: any) => {
return 'SQL' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
type: 'w-grid',
height: 250,
width: '100%',
localMode: true,
autoFetchData: false,
title: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'),
dense: true,
@ -307,17 +305,6 @@ class Sql extends Processor {
],
},
},
onBeforeEditorDataSubmit: (args: any) => {
const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping');
const form = grid.getEditorForm();
if ('add' == form.getStatus() || 'clone' == form.getStatus()) {
grid.addLocalData(args.data);
args.callback(false);
} else if ('edit' == form.getStatus()) {
grid.updateLocalData(args.data);
args.callback(false);
}
},
},
];
}
@ -351,7 +338,7 @@ class Sql extends Processor {
}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
@ -372,13 +359,13 @@ class Sql extends Processor {
});
});
const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues');
this.#sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues');
const sqlParameterValuesRows = Tools.json2Object(row.sqlParameterValues);
sqlParameterValuesGrid.setLocalData(sqlParameterValuesRows);
this.#sqlParameterValuesGrid.setLocalData(sqlParameterValuesRows);
const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping');
this.#sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping');
const sqlFieldMappingRows = Tools.json2Object(row.sqlFieldMapping);
sqlFieldMappingGrid.setLocalData(sqlFieldMappingRows);
this.#sqlFieldMappingGrid.setLocalData(sqlFieldMappingRows);
}
}

24
io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts

@ -3,20 +3,24 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class Ternary extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'TERNARY';
this.EDITOR_DIALOG_WIDTH = 1280;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'ternary',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.TERNARY'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-question',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'TERNARY');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -34,7 +38,7 @@ class Ternary extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'ternaryCondition',
label: $t('re.resources.designer.processor.grid.entity.ternaryCondition'),
type: 'w-code-mirror',
@ -46,11 +50,11 @@ class Ternary extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'TERNARY' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 7,
colSpan: 12,
name: 'ternaryTrue',
label: $t('re.resources.designer.processor.grid.entity.ternaryTrue'),
type: 'w-code-mirror',
@ -62,11 +66,11 @@ class Ternary extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'TERNARY' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 7,
colSpan: 12,
name: 'ternaryFalse',
label: $t('re.resources.designer.processor.grid.entity.ternaryFalse'),
type: 'w-code-mirror',
@ -78,7 +82,7 @@ class Ternary extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'TERNARY' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -95,7 +99,7 @@ class Ternary extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

24
io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts

@ -3,20 +3,24 @@ import { Processor } from '../Processor';
import { PlaceHolder } from '@/utils/PlaceHolder';
class WhenThen extends Processor {
#editorDialogWidth: number = 800;
constructor(targetType: string, context?: any) {
super(targetType, context);
this.PROCESSOR_TYPE = 'WHEN_THEN';
this.EDITOR_DIALOG_WIDTH = 800;
}
public getToolbarAction(): any {
return {
extend: 'add',
name: 'whenThen',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.WHEN_THEN'),
label: $t('io.sc.engine.rule.core.enums.ProcessorType.' + this.PROCESSOR_TYPE),
icon: 'bi-sliders',
enableIf: (args: any) => {
const type = this.context.target.type;
return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'WHEN_THEN');
args.grid.getEditorForm().setFieldValue('type', this.PROCESSOR_TYPE);
},
};
}
@ -38,7 +42,7 @@ class WhenThen extends Processor {
public getEditorFields(): any {
return [
{
colSpan: 7,
colSpan: 12,
name: 'when',
label: $t('re.resources.designer.processor.grid.entity.when'),
type: 'w-code-mirror',
@ -50,11 +54,11 @@ class WhenThen extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'WHEN_THEN' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 7,
colSpan: 12,
name: 'then',
label: $t('re.resources.designer.processor.grid.entity.then'),
type: 'w-code-mirror',
@ -66,16 +70,16 @@ class WhenThen extends Processor {
autoCompletion: this.autoCompletionManager.autoCompletion(),
userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(),
showIf: (args: any) => {
return 'WHEN_THEN' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
{
colSpan: 7,
colSpan: 12,
name: 'isWhenThenShorted',
label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted'),
type: 'w-checkbox',
showIf: (args: any) => {
return 'WHEN_THEN' === args.form.getFieldValue('type');
return args.form.getFieldValue('type') === this.PROCESSOR_TYPE;
},
},
];
@ -92,7 +96,7 @@ class WhenThen extends Processor {
public beforeEditorDataSubmit(args: any): void {}
public afterEditorOpen(args: any): void {
args.grid.getEditorDialog().setWidth(this.#editorDialogWidth);
args.grid.getEditorDialog().setWidth(this.EDITOR_DIALOG_WIDTH);
this.initAutoCompletionManager();
this.initUserDefinedFunctionsManager();
}

4
io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue

@ -62,8 +62,8 @@
'export',
]"
:columns="[
{ width: 50, name: 'order', label: $t('order'), hidden: true },
{ width: 100, name: 'id', label: $t('id'), hidden: true },
{ width: 50, name: 'order', label: $t('order'), showIf: false },
{ width: 100, name: 'id', label: $t('id'), showIf: false },
{
width: 60,
name: 'testResult',

2
io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue

@ -129,7 +129,7 @@
'export',
]"
:columns="[
{ width: 150, name: 'resourceCode', label: $t('code'), hidden: true },
{ width: 150, name: 'resourceCode', label: $t('code'), showIf: false },
{ width: '100%', name: 'resourceName', label: $t('name') },
{ width: 100, name: 'resourceType', label: $t('type'), format: Formater.enum(Enums.ResourceType) },
{ width: 100, name: 'resourceVersion', label: $t('version') },

2
io.sc.engine.rule.sample/src/main/resources/io/sc/engine/rule/sample/app/warning/pingan/平安租赁-租后预警规则.json

@ -17,7 +17,7 @@
"status" : "SKETCH",
"version" : 1,
"effectiveDate" : null,
"imports" : "import org.wsp.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"imports" : "import io.sc.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"model" : {
"id" : "550530de-3bdc-4323-9e2c-afe740fe0aa8",
"code" : "AFTER_RULE",

318
io.sc.engine.rule.sample/src/main/resources/io/sc/engine/rule/sample/app/warning/pingan/平安租赁-财报分析预警.json

File diff suppressed because it is too large

4
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/converter/IndicatorProcessorEntityConverter.java

@ -91,7 +91,7 @@ public class IndicatorProcessorEntityConverter {
_po.setHttpAuthBasicPassword(_entity.getHttpAuthBasicPassword());
_po.setHttpAuthBearerToken(_entity.getHttpAuthBearerToken());
_po.setHttpParams(_entity.getHttpParams());
_po.setHttpBody(_entity.getHttpBody());
_po.setHttpRequestBody(_entity.getHttpRequestBody());
_po.setHttpResponseMapping(_entity.getHttpResponseMapping());
po =_po;
}else {
@ -199,7 +199,7 @@ public class IndicatorProcessorEntityConverter {
_entity.setHttpAuthBasicPassword(_po.getHttpAuthBasicPassword());
_entity.setHttpAuthBearerToken(_po.getHttpAuthBearerToken());
_entity.setHttpParams(_po.getHttpParams());
_entity.setHttpBody(_po.getHttpBody());
_entity.setHttpRequestBody(_po.getHttpRequestBody());
_entity.setHttpResponseMapping(_po.getHttpResponseMapping());
entity =_entity;
}else {

63
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/HttpRequestIndicatorProcessorEntity.java

@ -56,8 +56,8 @@ public class HttpRequestIndicatorProcessorEntity extends IndicatorProcessorEntit
@Column(name="HTTP_PARAMS_")
private String httpParams;
@Column(name="HTTP_BODY_")
private String httpBody;
@Column(name="HTTP_REQUEST_BODY_")
private String httpRequestBody;
@Column(name="HTTP_RESPONSE_MAPPING_")
private String httpResponseMapping;
@ -78,7 +78,7 @@ public class HttpRequestIndicatorProcessorEntity extends IndicatorProcessorEntit
vo.setHttpAuthBasicPassword(this.getHttpAuthBasicPassword());
vo.setHttpAuthBearerToken(this.getHttpAuthBearerToken());
vo.setHttpParams(this.getHttpParams());
vo.setHttpBody(this.getHttpBody());
vo.setHttpRequestBody(this.getHttpRequestBody());
vo.setHttpResponseMapping(this.getHttpResponseMapping());
return vo;
}
@ -86,128 +86,79 @@ public class HttpRequestIndicatorProcessorEntity extends IndicatorProcessorEntit
public ProcessorType getType() {
return ProcessorType.HTTP_REQUEST;
}
public HttpMethodType getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(HttpMethodType httpMethod) {
this.httpMethod = httpMethod;
}
public String getHttpUrl() {
return httpUrl;
}
public void setHttpUrl(String httpUrl) {
this.httpUrl = httpUrl;
}
public HttpAuthorizationType getHttpAuthType() {
return httpAuthType;
}
public void setHttpAuthType(HttpAuthorizationType httpAuthType) {
this.httpAuthType = httpAuthType;
}
public String getHttpAuthApikey() {
return httpAuthApikey;
}
public void setHttpAuthApikey(String httpAuthApikey) {
this.httpAuthApikey = httpAuthApikey;
}
public String getHttpAuthApiValue() {
return httpAuthApiValue;
}
public void setHttpAuthApiValue(String httpAuthApiValue) {
this.httpAuthApiValue = httpAuthApiValue;
}
public String getHttpAuthApiAddTo() {
return httpAuthApiAddTo;
}
public void setHttpAuthApiAddTo(String httpAuthApiAddTo) {
this.httpAuthApiAddTo = httpAuthApiAddTo;
}
public String getHttpAuthBasicUsername() {
return httpAuthBasicUsername;
}
public void setHttpAuthBasicUsername(String httpAuthBasicUsername) {
this.httpAuthBasicUsername = httpAuthBasicUsername;
}
public String getHttpAuthBasicPassword() {
return httpAuthBasicPassword;
}
public void setHttpAuthBasicPassword(String httpAuthBasicPassword) {
this.httpAuthBasicPassword = httpAuthBasicPassword;
}
public String getHttpAuthBearerToken() {
return httpAuthBearerToken;
}
public void setHttpAuthBearerToken(String httpAuthBearerToken) {
this.httpAuthBearerToken = httpAuthBearerToken;
}
public String getHttpParams() {
return httpParams;
}
public void setHttpParams(String httpParams) {
this.httpParams = httpParams;
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;
}
public void setHttpResponseMapping(String httpResponseMapping) {
this.httpResponseMapping = httpResponseMapping;
}
@Override
public boolean replace(Map<String, String> mapping) {
String replaced =ExpressionReplacer.replace(this.httpParams, mapping);

59
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/HttpRequestIndicatorProcessorVo.java

@ -35,7 +35,7 @@ public class HttpRequestIndicatorProcessorVo extends IndicatorProcessorVo {
private String httpParams;
private String httpBody;
private String httpRequestBody;
private String httpResponseMapping;
@ -43,125 +43,76 @@ public class HttpRequestIndicatorProcessorVo extends IndicatorProcessorVo {
public ProcessorType getType() {
return ProcessorType.HTTP_REQUEST;
}
public HttpMethodType getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(HttpMethodType httpMethod) {
this.httpMethod = httpMethod;
}
public String getHttpUrl() {
return httpUrl;
}
public void setHttpUrl(String httpUrl) {
this.httpUrl = httpUrl;
}
public HttpAuthorizationType getHttpAuthType() {
return httpAuthType;
}
public void setHttpAuthType(HttpAuthorizationType httpAuthType) {
this.httpAuthType = httpAuthType;
}
public String getHttpAuthApikey() {
return httpAuthApikey;
}
public void setHttpAuthApikey(String httpAuthApikey) {
this.httpAuthApikey = httpAuthApikey;
}
public String getHttpAuthApiValue() {
return httpAuthApiValue;
}
public void setHttpAuthApiValue(String httpAuthApiValue) {
this.httpAuthApiValue = httpAuthApiValue;
}
public String getHttpAuthApiAddTo() {
return httpAuthApiAddTo;
}
public void setHttpAuthApiAddTo(String httpAuthApiAddTo) {
this.httpAuthApiAddTo = httpAuthApiAddTo;
}
public String getHttpAuthBasicUsername() {
return httpAuthBasicUsername;
}
public void setHttpAuthBasicUsername(String httpAuthBasicUsername) {
this.httpAuthBasicUsername = httpAuthBasicUsername;
}
public String getHttpAuthBasicPassword() {
return httpAuthBasicPassword;
}
public void setHttpAuthBasicPassword(String httpAuthBasicPassword) {
this.httpAuthBasicPassword = httpAuthBasicPassword;
}
public String getHttpAuthBearerToken() {
return httpAuthBearerToken;
}
public void setHttpAuthBearerToken(String httpAuthBearerToken) {
this.httpAuthBearerToken = httpAuthBearerToken;
}
public String getHttpParams() {
return httpParams;
}
public void setHttpParams(String httpParams) {
this.httpParams = httpParams;
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;
}
public void setHttpResponseMapping(String httpResponseMapping) {
this.httpResponseMapping = httpResponseMapping;
}
}

4
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/converter/ParameterProcessorEntityConverter.java

@ -68,7 +68,7 @@ public class ParameterProcessorEntityConverter {
_po.setHttpAuthBasicPassword(_entity.getHttpAuthBasicPassword());
_po.setHttpAuthBearerToken(_entity.getHttpAuthBearerToken());
_po.setHttpParams(_entity.getHttpParams());
_po.setHttpBody(_entity.getHttpBody());
_po.setHttpRequestBody(_entity.getHttpRequestBody());
_po.setHttpResponseMapping(_entity.getHttpResponseMapping());
po =_po;
}else if(entity instanceof MathFormulaParameterProcessorEntity) {
@ -221,7 +221,7 @@ public class ParameterProcessorEntityConverter {
_entity.setHttpAuthBasicPassword(_po.getHttpAuthBasicPassword());
_entity.setHttpAuthBearerToken(_po.getHttpAuthBearerToken());
_entity.setHttpParams(_po.getHttpParams());
_entity.setHttpBody(_po.getHttpBody());
_entity.setHttpRequestBody(_po.getHttpRequestBody());
_entity.setHttpResponseMapping(_po.getHttpResponseMapping());
entity =_entity;
}else if(po instanceof MathFormulaParameterProcessor) {

18
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/HttpRequestParameterProcessorEntity.java

@ -55,9 +55,8 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit
@Column(name="HTTP_PARAMS_")
private String httpParams;
@Column(name="HTTP_BODY_")
private String httpBody;
@Column(name="HTTP_REQUEST_BODY_")
private String httpRequestBody;
@Column(name="HTTP_RESPONSE_MAPPING_")
private String httpResponseMapping;
@ -66,6 +65,7 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit
public HttpRequestParameterProcessorVo toVo() {
HttpRequestParameterProcessorVo vo =new HttpRequestParameterProcessorVo();
super.toVo(vo);
vo.setHttpMethod(this.getHttpMethod());
vo.setHttpUrl(this.getHttpUrl());
vo.setHttpAuthType(this.getHttpAuthType());
vo.setHttpAuthApikey(this.getHttpAuthApikey());
@ -75,7 +75,7 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit
vo.setHttpAuthBasicPassword(this.getHttpAuthBasicPassword());
vo.setHttpAuthBearerToken(this.getHttpAuthBearerToken());
vo.setHttpParams(this.getHttpParams());
vo.setHttpBody(this.getHttpBody());
vo.setHttpRequestBody(this.getHttpRequestBody());
vo.setHttpResponseMapping(this.getHttpResponseMapping());
return vo;
}
@ -186,16 +186,14 @@ public class HttpRequestParameterProcessorEntity extends ParameterProcessorEntit
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;
}

1
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/service/impl/ParameterProcessorServiceImpl.java

@ -328,7 +328,6 @@ public class ParameterProcessorServiceImpl
String message =split.get(6);//预警详情
Rule rule =new Rule();
rule.setUuid(UUID.randomUUID().toString());
rule.setLevel(level);
rule.setCode(code);
rule.setName(name);

34
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/HttpRequestParameterProcessorVo.java

@ -35,7 +35,7 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo {
private String httpParams;
private String httpBody;
private String httpRequestBody;
private String httpResponseMapping;
@ -43,123 +43,99 @@ public class HttpRequestParameterProcessorVo extends ParameterProcessorVo {
public ProcessorType getType() {
return ProcessorType.HTTP_REQUEST;
}
public HttpMethodType getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(HttpMethodType httpMethod) {
this.httpMethod = httpMethod;
}
public String getHttpUrl() {
return httpUrl;
}
public void setHttpUrl(String httpUrl) {
this.httpUrl = httpUrl;
}
public HttpAuthorizationType getHttpAuthType() {
return httpAuthType;
}
public void setHttpAuthType(HttpAuthorizationType httpAuthType) {
this.httpAuthType = httpAuthType;
}
public String getHttpAuthApikey() {
return httpAuthApikey;
}
public void setHttpAuthApikey(String httpAuthApikey) {
this.httpAuthApikey = httpAuthApikey;
}
public String getHttpAuthApiValue() {
return httpAuthApiValue;
}
public void setHttpAuthApiValue(String httpAuthApiValue) {
this.httpAuthApiValue = httpAuthApiValue;
}
public String getHttpAuthApiAddTo() {
return httpAuthApiAddTo;
}
public void setHttpAuthApiAddTo(String httpAuthApiAddTo) {
this.httpAuthApiAddTo = httpAuthApiAddTo;
}
public String getHttpAuthBasicUsername() {
return httpAuthBasicUsername;
}
public void setHttpAuthBasicUsername(String httpAuthBasicUsername) {
this.httpAuthBasicUsername = httpAuthBasicUsername;
}
public String getHttpAuthBasicPassword() {
return httpAuthBasicPassword;
}
public void setHttpAuthBasicPassword(String httpAuthBasicPassword) {
this.httpAuthBasicPassword = httpAuthBasicPassword;
}
public String getHttpAuthBearerToken() {
return httpAuthBearerToken;
}
public void setHttpAuthBearerToken(String httpAuthBearerToken) {
this.httpAuthBearerToken = httpAuthBearerToken;
}
public String getHttpParams() {
return httpParams;
}
public void setHttpParams(String httpParams) {
this.httpParams = httpParams;
}
public String getHttpBody() {
return httpBody;
public String getHttpRequestBody() {
return httpRequestBody;
}
public void setHttpBody(String httpBody) {
this.httpBody = httpBody;
public void setHttpRequestBody(String httpRequestBody) {
this.httpRequestBody = httpRequestBody;
}
public String getHttpResponseMapping() {
return httpResponseMapping;
}
public void setHttpResponseMapping(String httpResponseMapping) {
this.httpResponseMapping = httpResponseMapping;
}

8
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ModelResourceEntity.java

@ -5,6 +5,7 @@ import io.sc.engine.rule.core.enums.ResourceType;
import io.sc.engine.rule.server.model.entity.ModelEntity;
import io.sc.engine.rule.server.resource.vo.ModelResourceVo;
import io.sc.engine.rule.server.testcase.entity.ResourceTestCaseEntity;
import io.sc.platform.core.util.CollectionUtil;
import org.springframework.beans.BeanUtils;
import javax.persistence.*;
@ -77,7 +78,7 @@ public class ModelResourceEntity extends ReleasableResourceEntity {
BeanUtils.copyProperties(this, entity, "children","testCases","model","roles");
//children
List<ResourceEntity> children =this.getChildren();
if(children!=null && children.size()>0) {
if(CollectionUtil.hasElements(children)){
for(ResourceEntity child : children) {
ResourceEntity clone =(ResourceEntity)child.deepClone();
clone.setParent(entity);
@ -86,7 +87,7 @@ public class ModelResourceEntity extends ReleasableResourceEntity {
}
//testCases
List<ResourceTestCaseEntity> testCases =this.getTestCases();
if(testCases!=null && testCases.size()>0) {
if(CollectionUtil.hasElements(testCases)){
for(ResourceTestCaseEntity testCase : testCases) {
ResourceTestCaseEntity clone =(ResourceTestCaseEntity)testCase.deepClone();
clone.setOwner(entity);
@ -100,6 +101,9 @@ public class ModelResourceEntity extends ReleasableResourceEntity {
clone.setResource(entity);
entity.setModel(clone);
}
//roles
entity.setRoles(this.getRoles());
return entity;
}

2
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ReleasableResourceEntity.java

@ -12,7 +12,7 @@ import java.util.Date;
* 可版本化资源实体类
*/
@Entity
public abstract class ReleasableResourceEntity extends ResourceEntity implements DeepClone, IdClearable {
public abstract class ReleasableResourceEntity extends ResourceEntity {
//状态
@Column(name="STATUS_", length=10)
@Enumerated(EnumType.STRING)

16
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/entity/ResourceEntity.java

@ -28,6 +28,7 @@ import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.sc.engine.rule.server.resource.vo.ResourceVo;
import io.sc.platform.core.util.CollectionUtil;
import io.sc.platform.orm.DeepClone;
import io.sc.platform.orm.IdClearable;
import io.sc.platform.orm.api.vo.AuditorVo;
@ -225,7 +226,7 @@ public class ResourceEntity extends AuditorEntity<ResourceVo> implements DeepClo
* @param children
*/
public void addChildren(ResourceEntity... children){
if(children!=null && children.length>0){
if(CollectionUtil.hasElements(children)){
for(ResourceEntity child : children){
child.resetParent(this);
}
@ -237,7 +238,7 @@ public class ResourceEntity extends AuditorEntity<ResourceVo> implements DeepClo
* @param children
*/
public void removeChildren(ResourceEntity... children){
if(children!=null && children.length>0){
if(CollectionUtil.hasElements(children)){
for(ResourceEntity child : children){
if(this.children!=null && this.children.contains(child)){
this.children.remove(child);
@ -253,7 +254,7 @@ public class ResourceEntity extends AuditorEntity<ResourceVo> implements DeepClo
BeanUtils.copyProperties(this, entity, "children","testCases","roles");
//children
List<ResourceEntity> children =this.getChildren();
if(children!=null && children.size()>0) {
if(CollectionUtil.hasElements(children)){
for(ResourceEntity child : children) {
ResourceEntity clone =(ResourceEntity)child.deepClone();
clone.setParent(entity);
@ -262,13 +263,16 @@ public class ResourceEntity extends AuditorEntity<ResourceVo> implements DeepClo
}
//testCases
List<ResourceTestCaseEntity> testCases =this.getTestCases();
if(testCases!=null && testCases.size()>0) {
if(CollectionUtil.hasElements(testCases)){
for(ResourceTestCaseEntity testCase : testCases) {
ResourceTestCaseEntity clone =(ResourceTestCaseEntity)testCase.deepClone();
clone.setOwner(entity);
entity.getTestCases().add(clone);
}
}
// roles
entity.setRoles(roles);
return entity;
}
@ -277,14 +281,14 @@ public class ResourceEntity extends AuditorEntity<ResourceVo> implements DeepClo
this.setId(null);
//children
List<ResourceEntity> children =this.getChildren();
if(children!=null && children.size()>0) {
if(CollectionUtil.hasElements(children)){
for(ResourceEntity child : children) {
child.clearId();
}
}
//testCases
List<ResourceTestCaseEntity> testCases =this.getTestCases();
if(testCases!=null && testCases.size()>0) {
if(CollectionUtil.hasElements(testCases)){
for(ResourceTestCaseEntity testCase : testCases) {
testCase.clearId();
}

30
io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/resource/repository/ResourceRepository.java

@ -21,24 +21,24 @@ public interface ResourceRepository extends DaoRepository<ResourceEntity,String>
@Query("select entity from ResourceEntity entity where entity.parent.id is null")
public List<ResourceEntity> findRootResources();
@Query("select entity from ResourceEntity entity where entity.code=:code and entity.name=:name")
public List<ResourceEntity> findResourceByCodeAndName(@Param("code")String code,@Param("name")String name);
// @Query("select entity from ResourceEntity entity where entity.code=:code and entity.name=:name")
// public List<ResourceEntity> findResourceByCodeAndName(@Param("code")String code,@Param("name")String name);
@Query("select max(entity.order)+1 from ResourceEntity entity where entity.parent.id=:parentId")
public Integer getNextOrder(@Param("parentId") String parentId);
// @Query("select max(entity.order)+1 from ResourceEntity entity where entity.parent.id=:parentId")
// public Integer getNextOrder(@Param("parentId") String parentId);
@Query("select max(entity.order)+1 from ResourceEntity entity where entity.parent.id is null")
public Integer getNextOrder();
// @Query("select max(entity.order)+1 from ResourceEntity entity where entity.parent.id is null")
// public Integer getNextOrder();
//====================================================================================
// ResourceEntity <-- FolderResourceEntity
//====================================================================================
@Query("select entity from FolderResourceEntity entity where entity.id=:id")
public FolderResourceEntity findFolderById(@Param("id") String id);
// @Query("select entity from FolderResourceEntity entity where entity.id=:id")
// public FolderResourceEntity findFolderById(@Param("id") String id);
@Query("select entity from FolderResourceEntity entity where entity.parent.id=:parentId and entity.name=:name")
public List<FolderResourceEntity> findFolderByNameWithParentId(@Param("name") String name,@Param("parentId") String parentId);
@Query("select entity from FolderResourceEntity entity where entity.parent.id is null and entity.name=:name")
public List<FolderResourceEntity> findFolderByNameWithNullParentId(@Param("name") String name);
@ -57,8 +57,8 @@ public interface ResourceRepository extends DaoRepository<ResourceEntity,String>
@Query("select entity from ReleasableResourceEntity entity where entity.id=:id")
public ReleasableResourceEntity findReleasableResourceById(@Param("id") String id);
@Query("select entity from ReleasableResourceEntity entity where entity.code=:code and entity.name=:name")
public List<ReleasableResourceEntity> findReleasableResourceByCodeAndName(@Param("code")String code,@Param("name")String name);
// @Query("select entity from ReleasableResourceEntity entity where entity.code=:code and entity.name=:name")
// public List<ReleasableResourceEntity> findReleasableResourceByCodeAndName(@Param("code")String code,@Param("name")String name);
@Query("select entity from ReleasableResourceEntity entity where entity.code=:code or entity.name=:name")
public List<ReleasableResourceEntity> findReleasableResourceByCodeOrName(@Param("code")String code,@Param("name")String name);
@ -69,11 +69,11 @@ public interface ResourceRepository extends DaoRepository<ResourceEntity,String>
@Query("select entity from ReleasableResourceEntity entity where entity.code=:code and entity.version=:version")
public ReleasableResourceEntity findReleasableResourceByCodeAndVersion(@Param("code")String code,@Param("version")Integer version);
@Query("select entity from ReleasableResourceEntity entity where entity.code=:code order by entity.version")
public List<ReleasableResourceEntity> findReleasableResourceByCodeOrderByVersion(@Param("code")String code);
// @Query("select entity from ReleasableResourceEntity entity where entity.code=:code order by entity.version")
// public List<ReleasableResourceEntity> findReleasableResourceByCodeOrderByVersion(@Param("code")String code);
@Query("select entity from ReleasableResourceEntity entity order by entity.version")
public List<ReleasableResourceEntity> findReleasableResourceByOrderByVersion();
// @Query("select entity from ReleasableResourceEntity entity order by entity.version")
// public List<ReleasableResourceEntity> findReleasableResourceByOrderByVersion();
@Query("select max(entity.version)+1 from ReleasableResourceEntity entity where entity.code=:code")
public Integer getReleasableResourceNextVersion(@Param("code") String code);

8
io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎内置示例.json

@ -2887,7 +2887,7 @@
"code" : "P847413598333565",
"name" : "模型摘要结果值",
"description" : null,
"valueType" : "org.wsp.engine.rule.core.classes.ResourceAbstract",
"valueType" : "io.sc.engine.rule.core.classes.ResourceAbstract",
"valueTypeVersion" : null,
"valueScale" : null,
"valueRoundingMode" : null,
@ -5050,7 +5050,7 @@
"code" : "P1581063447080",
"name" : "收入增长较小",
"description" : null,
"valueType" : "org.wsp.engine.rule.core.classes.SingleRuleResult",
"valueType" : "io.sc.engine.rule.core.classes.SingleRuleResult",
"valueTypeVersion" : null,
"valueScale" : null,
"valueRoundingMode" : null,
@ -5089,7 +5089,7 @@
"status" : "SKETCH",
"version" : 1,
"effectiveDate" : null,
"imports" : "import org.wsp.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"imports" : "import io.sc.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"model" : {
"id" : "e3381037-c488-4286-99f8-24512ee822ae",
"code" : "M16304379203093",
@ -5216,7 +5216,7 @@
"status" : "SKETCH",
"version" : 1,
"effectiveDate" : null,
"imports" : "import org.wsp.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"imports" : "import io.sc.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"model" : {
"id" : "edbe80ee-b07c-4271-b16e-ead3fdce1eee",
"code" : "M192312120849566",

8
io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例.json

@ -1739,7 +1739,7 @@
"code" : "P847413598333565",
"name" : "模型摘要结果值",
"description" : null,
"valueType" : "org.wsp.engine.rule.core.classes.ResourceAbstract",
"valueType" : "io.sc.engine.rule.core.classes.ResourceAbstract",
"valueTypeVersion" : null,
"valueScale" : null,
"valueRoundingMode" : null,
@ -4623,7 +4623,7 @@
"status" : "SKETCH",
"version" : 1,
"effectiveDate" : null,
"imports" : "import org.wsp.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"imports" : "import io.sc.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"model" : {
"id" : "610ae3ba-ca52-4ad4-ab03-9433842a59b9",
"code" : "M192312120849566",
@ -5278,7 +5278,7 @@
"code" : "P1581063447080",
"name" : "收入增长较小",
"description" : null,
"valueType" : "org.wsp.engine.rule.core.classes.SingleRuleResult",
"valueType" : "io.sc.engine.rule.core.classes.SingleRuleResult",
"valueTypeVersion" : null,
"valueScale" : null,
"valueRoundingMode" : null,
@ -5413,7 +5413,7 @@
"status" : "SKETCH",
"version" : 1,
"effectiveDate" : null,
"imports" : "import org.wsp.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"imports" : "import io.sc.engine.rule.client.spring.util.EngineSpringApplicationContextUtil;",
"model" : {
"id" : "5adf7297-6901-4813-b85a-a003af768716",
"code" : "M16304379203093",

4
io.sc.engine.rule.server/src/main/resources/liquibase/RE_1.0.0_20220515__Rule Engine Database Schema DDL.xml

@ -239,7 +239,7 @@
<column name="HTTP_AUTH_BASIC_PASSWORD_" type="NVARCHAR(255)" remarks="HTTP认证(BASIC AUTH)-密码"/>
<column name="HTTP_AUTH_BEARER_TOKEN_" type="NVARCHAR(1024)" remarks="HTTP认证(Bear Token)-令牌"/>
<column name="HTTP_PARAMS_" type="NVARCHAR(2048)" remarks="HTTP请求参数"/>
<column name="HTTP_BODY_" type="CLOB" remarks="HTTP请求体"/>
<column name="HTTP_REQUEST_BODY_" type="CLOB" remarks="HTTP请求体"/>
<column name="HTTP_RESPONSE_MAPPING_" type="CLOB" remarks="HTTP响应映射"/>
<column name="MATH_FORMULA_" type="CLOB" remarks="数学公式"/>
<column name="NUMBER_RANGE_VAR_" type="CLOB" remarks="数值分段函数变量表达式"/>
@ -517,7 +517,7 @@
<column name="HTTP_AUTH_BASIC_PASSWORD_" type="NVARCHAR(255)" remarks="HTTP认证(BASIC AUTH)-密码"/>
<column name="HTTP_AUTH_BEARER_TOKEN_" type="NVARCHAR(1024)" remarks="HTTP认证(Bear Token)-令牌"/>
<column name="HTTP_PARAMS_" type="NVARCHAR(2048)" remarks="HTTP请求参数"/>
<column name="HTTP_BODY_" type="CLOB" remarks="HTTP请求体"/>
<column name="HTTP_REQUEST_BODY_" type="CLOB" remarks="HTTP请求体"/>
<column name="HTTP_RESPONSE_MAPPING_" type="CLOB" remarks="HTTP响应映射"/>
<column name="MATH_FORMULA_" type="CLOB" remarks="数学公式"/>
<column name="NUMBER_RANGE_VAR_" type="CLOB" remarks="数值分段函数变量表达式"/>

2
io.sc.engine.st.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.1.430",
"version": "8.1.433",
"description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件",
"main": "dist/platform-core.js",

2
io.sc.platform.core.frontend/src/views/testcase/maxgraph/maxgraph.vue

@ -504,7 +504,7 @@ const findResourceAbstractById = (id) => {
const findResourceAbstractByCodeAndVersion = (code, version) => {
for (const item of resourceAbstractsRef.value) {
if (item.code === code && item.version.toString() === version) {
if (item.code === code && item.version?.toString() === version) {
return item;
}
}

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.1.430",
"version": "8.1.433",
"description": "前端核心包,用于快速构建前端的脚手架",
"private": false,
"keywords": [],
@ -110,7 +110,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"vue": "3.5.10",

2
io.sc.platform.core.frontend/template-project/src/views/testcase/maxgraph/Maxgraph.vue

@ -504,7 +504,7 @@ const findResourceAbstractById = (id) => {
const findResourceAbstractByCodeAndVersion = (code, version) => {
for (const item of resourceAbstractsRef.value) {
if (item.code === code && item.version.toString() === version) {
if (item.code === code && item.version?.toString() === version) {
return item;
}
}

19
io.sc.platform.core/src/main/java/io/sc/platform/core/util/CollectionUtil.java

@ -16,6 +16,25 @@ import java.util.*;
*/
public class CollectionUtil {
private CollectionUtil(){}
/**
* 监测集合是否为空,当集合对象为 null 或者不包含任何元素时返回 false,否则返回 true
* @param collection 集合
* @return 是否为空
*/
public static boolean hasElements(Collection collection){
return collection!=null && !collection.isEmpty();
}
/**
* 监测数组是否为空,当数组对象为 null 或者不包含任何元素时返回 false,否则返回 true
* @param arrays 集合
* @return 是否为空
*/
public static boolean hasElements(Object[] arrays){
return arrays!=null && arrays.length>0;
}
/**
* 将对象列表转换成 Map
* class User {

4
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties

@ -240,4 +240,6 @@ autoMatch=Auto Match
convert=Convert
upload=Upload
result=Result
weight=Weight
weight=Weight
message=Message
reload=Reload

4
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties

@ -240,4 +240,6 @@ autoMatch=\u81EA\u52D5\u5339\u914D
convert=\u8F49\u63DB
upload=\u4E0A\u50B3
result=\u7D50\u679C
weight=\u6B0A\u91CD
weight=\u6B0A\u91CD
message=\u6D88\u606F
reload=\u91CD\u65B0\u52A0\u8F09

4
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties

@ -240,4 +240,6 @@ autoMatch=\u81EA\u52A8\u5339\u914D
convert=\u8F6C\u6362
upload=\u4E0A\u4F20
result=\u7ED3\u679C
weight=\u6743\u91CD
weight=\u6743\u91CD
message=\u6D88\u606F
reload=\u91CD\u65B0\u52A0\u8F7D

2
io.sc.platform.developer.doc/package.json

@ -28,7 +28,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"vue": "3.5.10",
"vue-i18n": "10.0.3"

2
io.sc.platform.developer.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.lcdp.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.license.keygen.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.mvc.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.scheduler.manager.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.platform.scheduler.manager.frontend/src/views/executor/Executor.vue

@ -31,7 +31,7 @@
'export',
]"
:columns="[
{ width: 100, name: 'id', label: $t('id'), hidden: true },
{ width: 100, name: 'id', label: $t('id'), showIf: false },
{ width: 220, name: 'applicationName', label: $t('lcdp.scheduler.executor.grid.entity.applicationName') },
{ width: 150, name: 'name', label: $t('lcdp.scheduler.executor.grid.entity.name') },
{ width: 200, name: 'description', label: $t('description') },

2
io.sc.platform.system.frontend/package.json

@ -110,7 +110,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"vue": "3.5.10",

13
io.sc.platform.system.frontend/src/views/i18n/I18n.vue

@ -26,7 +26,7 @@
icon: 'bi-trash3',
click: () => {
DialogManager.confirm($t('system.i18n.grid.toolbar.removeAll.tip'), () => {
axios.post(Environment.apiContextPath('/api/system/i18n/removeMessages')).then(() => {
axios.post(Environment.apiContextPath('/api/system/i18n/removeMessages'), {}, { loading: true }).then(() => {
NotifyManager.info($t('operationSuccess'));
i18nGridRef.refresh();
});
@ -48,6 +48,17 @@
},
},
'separator',
{
name: 'reload',
label: $t('reload'),
icon: 'bi-arrow-repeat',
click: (args) => {
axios.post(Environment.apiContextPath('/api/system/i18n/reload')).then(() => {
NotifyManager.info($t('operationSuccess'));
});
},
},
'separator',
'view',
'separator',
'export',

5
io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/controller/I18nWebController.java

@ -14,6 +14,11 @@ import org.springframework.web.bind.annotation.*;
public class I18nWebController extends RestCrudController<I18nVo, I18nEntity,String, I18nRepository, I18nService> {
@Autowired private MessageSourceService messageSourceService;
@PostMapping("reload")
public void reload() throws Exception{
service.reload();
}
@PostMapping("importMessages")
public void importMessages() throws Exception{
service.importMessages(true);

2
io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/service/I18nService.java

@ -5,6 +5,8 @@ import io.sc.platform.system.i18n.jpa.entity.I18nEntity;
import io.sc.platform.system.i18n.jpa.repository.I18nRepository;
public interface I18nService extends DaoService<I18nEntity, String, I18nRepository> {
public void reload();
/**
* 从资源包属性文件中获取多语言消息并导入到数据库中
* @param overwrite 是否覆盖数据库中已经存在的多语言消息

7
io.sc.platform.system/src/main/java/io/sc/platform/system/i18n/service/impl/I18nServiceImpl.java

@ -22,6 +22,11 @@ public class I18nServiceImpl extends DaoServiceImpl<I18nEntity, String, I18nRepo
@Autowired private CompositeMessageSource compositeMessageSource;
@Override
public void reload() {
compositeMessageSource.reload();
}
@Override
public void importMessages(boolean overwrite) {
List<MessageSource> messageSources =compositeMessageSource.getMessageSources();
@ -52,6 +57,7 @@ public class I18nServiceImpl extends DaoServiceImpl<I18nEntity, String, I18nRepo
}
}
}
compositeMessageSource.reload();
}
@Override
@ -74,5 +80,6 @@ public class I18nServiceImpl extends DaoServiceImpl<I18nEntity, String, I18nRepo
}
}
}
compositeMessageSource.reload();
}
}

2
io.sc.standard.frontend/package.json

@ -111,7 +111,7 @@
"node-sql-parser": "5.3.2",
"pinia": "2.2.2",
"pinia-undo": "0.2.4",
"platform-core": "8.1.430",
"platform-core": "8.1.433",
"quasar": "2.17.0",
"svg-path-commander": "2.0.10",
"tailwindcss": "3.4.10",

2
io.sc.website/package.json

@ -28,6 +28,6 @@
},
"dependencies": {
"vue": "3.5.10",
"platform-core": "8.1.430"
"platform-core": "8.1.433"
}
}
Loading…
Cancel
Save