From a282da7342b97188806cdf2175632b79f28fe314 Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Wed, 23 Oct 2024 15:14:13 +0800 Subject: [PATCH] update --- erm.frontend/.eslintrc.cjs | 1 + erm.frontend/package.json | 2 +- gradle.properties | 2 +- io.sc.engine.mv.frontend/.eslintrc.cjs | 1 + io.sc.engine.mv.frontend/package.json | 2 +- .../support/processor/ConditionRange.java | 9 +- .../impl/support/processor/ScoreCardItem.java | 9 - .../rule/core/enums/HttpMethodType.java | 2 +- .../sc/engine/rule/core/i18n/enums.properties | 2 +- .../rule/core/i18n/enums_tw_CN.properties | 2 +- .../rule/core/i18n/enums_zh_CN.properties | 2 +- io.sc.engine.rule.frontend/.eslintrc.cjs | 1 + io.sc.engine.rule.frontend/package.json | 4 +- .../src/i18n/messages_zh_CN.json | 6 + .../src/views/lib/ProcessorGrid.vue | 115 +----- .../views/resources/designer/Processor.vue | 26 +- .../src/views/shared/AutoCompletionManager.ts | 4 +- .../src/views/shared/Processor.ts | 24 +- .../src/views/shared/ProcessorManager.ts | 70 ++-- .../src/views/shared/processors/Arithmetic.ts | 18 +- .../views/shared/processors/ConditionRange.ts | 77 ++-- .../views/shared/processors/DecisionTable.ts | 258 ++++++------ .../shared/processors/DecisionTable2c.ts | 166 +++----- .../views/shared/processors/DecisionTree.ts | 11 +- .../views/shared/processors/ExecutionFlow.ts | 11 +- .../views/shared/processors/GroovyScript.ts | 20 +- .../views/shared/processors/HttpRequest.ts | 390 ++++++++++++++++++ .../views/shared/processors/MathFormula.ts | 18 +- .../views/shared/processors/NumberRange.ts | 78 ++-- .../shared/processors/ObjectProperties.ts | 27 +- .../views/shared/processors/OptionValue.ts | 17 +- .../src/views/shared/processors/Pmml.ts | 19 +- .../src/views/shared/processors/Rule.ts | 15 +- .../src/views/shared/processors/ScoreCard.ts | 187 +++++---- .../src/views/shared/processors/SingleRule.ts | 15 +- .../src/views/shared/processors/Sql.ts | 104 ++--- .../src/views/shared/processors/Ternary.ts | 22 +- .../src/views/shared/processors/WhenThen.ts | 22 +- .../src/views/shared/processors/index.ts | 1 + .../ScoreCardParameterProcessorEntity.java | 2 +- io.sc.engine.st.frontend/.eslintrc.cjs | 1 + io.sc.engine.st.frontend/package.json | 2 +- io.sc.platform.core.frontend/.eslintrc.cjs | 1 + io.sc.platform.core.frontend/package.json | 2 +- .../components/code-mirror/WCodeMirror.vue | 2 +- .../components/math/toolbar/Toolbar.vue | 21 +- .../components/math/toolbar/functions/Log.vue | 39 ++ .../toolbar/{math => functions/log}/Lg.vue | 27 +- .../toolbar/{math => functions/log}/Ln.vue | 21 +- .../toolbar/{math => functions/log}/Log.vue | 25 +- .../src/platform/css/q-markup-table.css | 6 + .../src/platform/i18n/messages.json | 8 +- .../src/platform/i18n/messages_tw_CN.json | 10 +- .../src/platform/i18n/messages_zh_CN.json | 10 +- .../src/platform/index.ts | 1 + .../utils-components/MarkupTableUtil.ts | 31 +- .../src/platform/utils/Tools.ts | 135 +++--- .../src/platform/utils/UnitOfMeasure.ts | 33 ++ .../src/platform/utils/index.ts | 1 + .../src/views/testcase/math/MathEditor.vue | 64 ++- .../template-project/.eslintrc.cjs | 1 + .../template-project/package.json | 4 +- .../src/views/testcase/math/MathEditor.vue | 64 ++- .../java/io/sc/platform/core/License.java | 12 +- .../core/service/LicenseManagerService.java | 2 - .../impl/LicenseManagerServiceImpl.java | 7 +- .../io/sc/platform/core/util/NetworkUtil.java | 4 - io.sc.platform.developer.doc/package.json | 2 +- .../.eslintrc.cjs | 1 + .../package.json | 2 +- io.sc.platform.lcdp.frontend/.eslintrc.cjs | 1 + io.sc.platform.lcdp.frontend/package.json | 2 +- .../.eslintrc.cjs | 1 + .../package.json | 2 +- .../src/i18n/messages.json | 3 +- .../src/i18n/messages_tw_CN.json | 3 +- .../src/i18n/messages_zh_CN.json | 3 +- .../src/views/license/KeyGenerator.vue | 22 +- .../LicenseKeyGeneratorWebController.java | 105 ++++- .../impl/LicenseKeyGeneratorServiceImpl.java | 3 +- io.sc.platform.mvc.frontend/.eslintrc.cjs | 1 + io.sc.platform.mvc.frontend/package.json | 2 +- .../.eslintrc.cjs | 1 + .../package.json | 2 +- io.sc.platform.system.frontend/.eslintrc.cjs | 1 + io.sc.platform.system.frontend/package.json | 2 +- .../src/i18n/messages.json | 328 +++++++-------- .../src/i18n/messages_tw_CN.json | 283 ++++++------- .../src/i18n/messages_zh_CN.json | 343 +++++++-------- .../src/views/license/License.vue | 1 + .../src/views/menu/Menu.vue | 4 +- io.sc.standard.frontend/.eslintrc.cjs | 1 + io.sc.standard.frontend/package.json | 2 +- io.sc.website/package.json | 2 +- 94 files changed, 1991 insertions(+), 1428 deletions(-) create mode 100644 io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts create mode 100644 io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/Log.vue rename io.sc.platform.core.frontend/src/platform/components/math/toolbar/{math => functions/log}/Lg.vue (69%) rename io.sc.platform.core.frontend/src/platform/components/math/toolbar/{math => functions/log}/Ln.vue (71%) rename io.sc.platform.core.frontend/src/platform/components/math/toolbar/{math => functions/log}/Log.vue (73%) create mode 100644 io.sc.platform.core.frontend/src/platform/css/q-markup-table.css create mode 100644 io.sc.platform.core.frontend/src/platform/utils/UnitOfMeasure.ts diff --git a/erm.frontend/.eslintrc.cjs b/erm.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/erm.frontend/.eslintrc.cjs +++ b/erm.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/erm.frontend/package.json b/erm.frontend/package.json index aebf7334..4b79997f 100644 --- a/erm.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/gradle.properties b/gradle.properties index 860bed2b..408f233c 100644 --- a/gradle.properties +++ b/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.416 +platform_core_frontend_version=8.1.430 ########################################################### # dependencies version diff --git a/io.sc.engine.mv.frontend/.eslintrc.cjs b/io.sc.engine.mv.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.engine.mv.frontend/.eslintrc.cjs +++ b/io.sc.engine.mv.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.engine.mv.frontend/package.json b/io.sc.engine.mv.frontend/package.json index 8ac39ddb..a0369444 100644 --- a/io.sc.engine.mv.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ConditionRange.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ConditionRange.java index b31d7e29..a5f6db45 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ConditionRange.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ConditionRange.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.core.type.TypeReference; @JsonIgnoreProperties(ignoreUnknown=true) public class ConditionRange { - private String uuid; private String condition; private String value; @@ -111,13 +110,7 @@ public class ConditionRange { } return null; } - - public String getUuid() { - return uuid; - } - public void setUuid(String uuid) { - this.uuid = uuid; - } + public String getCondition() { return condition; } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ScoreCardItem.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ScoreCardItem.java index 5b9e0f97..24bab475 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ScoreCardItem.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/code/impl/support/processor/ScoreCardItem.java @@ -8,7 +8,6 @@ import java.util.List; @JsonIgnoreProperties(ignoreUnknown=true) public class ScoreCardItem { private String code; - private String name; private Double weight; private ProcessorType type; private List conditionRange; @@ -22,14 +21,6 @@ public class ScoreCardItem { this.code = code; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - public Double getWeight() { return weight; } diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpMethodType.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpMethodType.java index e65bf74a..769d3f9e 100644 --- a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpMethodType.java +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/enums/HttpMethodType.java @@ -6,5 +6,5 @@ package io.sc.engine.rule.core.enums; * */ public enum HttpMethodType { - GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE + GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE; } diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties index ebdfa72d..5d740676 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums.properties @@ -73,9 +73,9 @@ io.sc.engine.rule.core.enums.ProcessorType.WHEN_THEN=When-Then io.sc.engine.rule.core.enums.HttpMethodType.GET=GET io.sc.engine.rule.core.enums.HttpMethodType.POST=POST io.sc.engine.rule.core.enums.HttpMethodType.PUT=PUT +io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.DELETE=DELETE io.sc.engine.rule.core.enums.HttpMethodType.HEAD=HEAD -io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.OPTIONS=OPTIONS io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties index d2b17e22..dff65dc0 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_tw_CN.properties @@ -73,9 +73,9 @@ io.sc.engine.rule.core.enums.ProcessorType.WHEN_THEN=When Then \u904B\u7B97 io.sc.engine.rule.core.enums.HttpMethodType.GET=GET io.sc.engine.rule.core.enums.HttpMethodType.POST=POST io.sc.engine.rule.core.enums.HttpMethodType.PUT=PUT +io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.DELETE=DELETE io.sc.engine.rule.core.enums.HttpMethodType.HEAD=HEAD -io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.OPTIONS=OPTIONS io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE diff --git a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties index 8c32a394..6d2844b7 100644 --- a/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties +++ b/io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/i18n/enums_zh_CN.properties @@ -73,9 +73,9 @@ io.sc.engine.rule.core.enums.ProcessorType.WHEN_THEN=When Then \u8FD0\u7B97 io.sc.engine.rule.core.enums.HttpMethodType.GET=GET io.sc.engine.rule.core.enums.HttpMethodType.POST=POST io.sc.engine.rule.core.enums.HttpMethodType.PUT=PUT +io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.DELETE=DELETE io.sc.engine.rule.core.enums.HttpMethodType.HEAD=HEAD -io.sc.engine.rule.core.enums.HttpMethodType.PATCH=PATCH io.sc.engine.rule.core.enums.HttpMethodType.OPTIONS=OPTIONS io.sc.engine.rule.core.enums.HttpMethodType.TRACE=TRACE diff --git a/io.sc.engine.rule.frontend/.eslintrc.cjs b/io.sc.engine.rule.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.engine.rule.frontend/.eslintrc.cjs +++ b/io.sc.engine.rule.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 2d707f45..fdeb2edb 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/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.421", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", @@ -121,4 +121,4 @@ "vue-router": "4.4.5", "xml-formatter": "3.6.3" } -} +} \ No newline at end of file diff --git a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json index 74cbb0b6..1f39f176 100644 --- a/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.engine.rule.frontend/src/i18n/messages_zh_CN.json @@ -102,6 +102,12 @@ "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.rule": "规则", "re.resources.designer.processor.grid.entity.singleRule": "单规则", diff --git a/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue index 795db21c..c393d9b5 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue @@ -26,15 +26,7 @@ return !readOnly; }, }, - objectProperties.getToolbarAction(indicator), - mathFormula.getToolbarAction(indicator), - arithmetic.getToolbarAction(indicator), - ternary.getToolbarAction(indicator), - whenThen.getToolbarAction(indicator), - numberRange.getToolbarAction(indicator), - conditionRange.getToolbarAction(indicator), - groovyScript.getToolbarAction(indicator), - sql.getToolbarAction(indicator), + ...processorManager.getToolbarAction(), ], { extend: 'clone', @@ -76,27 +68,7 @@ label: $t('re.resources.designer.processor.grid.entity.content'), sortable: false, format: (value, row) => { - switch (row.type) { - case 'ARITHMETIC': - return arithmetic.format(row); - case 'CONDITION_RANGE': - return conditionRange.format(row); - case 'GROOVY_SCRIPT': - return groovyScript.format(row); - case 'MATH_FORMULA': - return mathFormula.format(row); - case 'NUMBER_RANGE': - return numberRange.format(row); - case 'OBJECT_PROPERTIES': - return objectProperties.format(row); - case 'SQL': - return sql.format(row); - case 'TERNARY': - return ternary.format(row); - case 'WHEN_THEN': - return whenThen.format(row); - } - return ''; + return processorManager.format(value, row); }, }, ]" @@ -111,16 +83,7 @@ { 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 }, - - ...arithmetic.getEditorFields(), - ...conditionRange.getEditorFields(), - ...groovyScript.getEditorFields(), - ...mathFormula.getEditorFields(), - ...numberRange.getEditorFields(), - ...objectProperties.getEditorFields({ objectPropertiesMatcherDialogRef }), - ...sql.getEditorFields(), - ...ternary.getEditorFields(), - ...whenThen.getEditorFields(), + ...processorManager.getEditorFields(), ], }, }" @@ -134,17 +97,7 @@ { name: 'description', label: $t('description') }, { name: 'enable', label: $t('enable') }, { name: 'type', label: $t('type') }, - - ...arithmetic.getViewerFields(), - ...conditionRange.getViewerFields(), - ...groovyScript.getViewerFields(), - ...mathFormula.getViewerFields(), - ...numberRange.getViewerFields(), - ...objectProperties.getViewerFields(), - ...sql.getViewerFields(), - ...ternary.getViewerFields(), - ...whenThen.getViewerFields(), - + ...processorManager.getViewerFields(), { name: 'dataComeFrom', label: $t('dataComeFrom') }, { name: 'creator', label: $t('creator') }, { name: 'createDate', label: $t('createDate') }, @@ -155,51 +108,12 @@ }" @before-editor-data-submit=" (args) => { - switch (args.data.type) { - case 'ARITHMETIC': - return arithmetic.beforeEditorDataSubmit(args); - case 'CONDITION_RANGE': - return conditionRange.beforeEditorDataSubmit(args); - case 'GROOVY_SCRIPT': - return groovyScript.beforeEditorDataSubmit(args); - case 'MATH_FORMULA': - return mathFormula.beforeEditorDataSubmit(args); - case 'NUMBER_RANGE': - return numberRange.beforeEditorDataSubmit(args); - case 'OBJECT_PROPERTIES': - return objectProperties.beforeEditorDataSubmit(args); - case 'SQL': - return sql.beforeEditorDataSubmit(args); - case 'TERNARY': - return ternary.beforeEditorDataSubmit(args); - case 'WHEN_THEN': - return whenThen.beforeEditorDataSubmit(args); - } + processorManager.beforeEditorDataSubmit(args); } " @after-editor-open=" (args) => { - args.target = indicator; - switch (args.grid.getEditorForm().getFieldValue('type')) { - case 'ARITHMETIC': - return arithmetic.afterEditorOpen(args); - case 'CONDITION_RANGE': - return conditionRange.afterEditorOpen(args); - case 'GROOVY_SCRIPT': - return groovyScript.afterEditorOpen(args); - case 'MATH_FORMULA': - return mathFormula.afterEditorOpen(args); - case 'NUMBER_RANGE': - return numberRange.afterEditorOpen(args); - case 'OBJECT_PROPERTIES': - return objectProperties.afterEditorOpen(args); - case 'SQL': - return sql.afterEditorOpen(args); - case 'TERNARY': - return ternary.afterEditorOpen(args); - case 'WHEN_THEN': - return whenThen.afterEditorOpen(args); - } + processorManager.afterEditorOpen(args); } " > @@ -220,20 +134,10 @@ import 'tailwindcss/utilities.css'; import { ref, onMounted } from 'vue'; import { axios, Environment, Formater } from 'platform-core'; +import { ProcessorManager } from '@/views/shared/ProcessorManager'; import { Processor } from '@/views/shared/Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; import ObjectPropertiesMatcherDialog from '@/views/shared/ObjectPropertiesMatcherDialog.vue'; -import { Arithmetic, ConditionRange, GroovyScript, MathFormula, NumberRange, ObjectProperties, Sql, Ternary, WhenThen } from '@/views/shared/processors'; - -const arithmetic = new Arithmetic(Processor.INDICATOR); -const conditionRange = new ConditionRange(Processor.INDICATOR); -const groovyScript = new GroovyScript(Processor.INDICATOR); -const mathFormula = new MathFormula(Processor.INDICATOR); -const numberRange = new NumberRange(Processor.INDICATOR); -const objectProperties = new ObjectProperties(Processor.INDICATOR); -const sql = new Sql(Processor.INDICATOR); -const ternary = new Ternary(Processor.INDICATOR); -const whenThen = new WhenThen(Processor.INDICATOR); const props = defineProps({ indicator: { type: Object, default: undefined }, @@ -242,6 +146,11 @@ const props = defineProps({ const gridRef = ref(); const objectPropertiesMatcherDialogRef = ref(); +const processorManagerContext = { + target: props.indicator, + objectPropertiesMatcherDialogRef: objectPropertiesMatcherDialogRef, +}; +const processorManager = new ProcessorManager(Processor.INDICATOR, processorManagerContext); const refresh = () => { gridRef?.value?.refresh(); diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue index bd7baa7d..cf3e7a77 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue @@ -27,8 +27,9 @@ }, click: undefined, }, - ...processorManager.getToolbarAction(parameter), + ...processorManager.getToolbarAction(), ], + 'clone', { extend: 'edit', name: 'customEdit', @@ -111,15 +112,15 @@ width: '50%', }, form: { - colsNum: 5, + colsNum: 7, fields: [ - { colSpan: 5, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.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: 5, name: 'description', label: $t('description'), type: 'w-text', showIf: false }, - { colSpan: 5, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, showIf: false }, - ...processorManager.getEditorFields({ objectPropertiesMatcherDialogRef }), + { 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 }, + ...processorManager.getEditorFields(), ], }, }" @@ -149,7 +150,6 @@ " @after-editor-open=" (args) => { - args.target = parameter; processorManager.afterEditorOpen(args); } " @@ -191,7 +191,11 @@ const gridRef = ref(); const decisionTreeDialogRef = ref(); const executionFlowDialogRef = ref(); const objectPropertiesMatcherDialogRef = ref(); -const processorManager = new ProcessorManager(Processor.PARAMETER); +const processorManagerContext = { + target: props.parameter, + objectPropertiesMatcherDialogRef: objectPropertiesMatcherDialogRef, +}; +const processorManager = new ProcessorManager(Processor.PARAMETER, processorManagerContext); const refresh = () => { gridRef.value.refresh(); diff --git a/io.sc.engine.rule.frontend/src/views/shared/AutoCompletionManager.ts b/io.sc.engine.rule.frontend/src/views/shared/AutoCompletionManager.ts index 37a26fa4..a2d4c21f 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/AutoCompletionManager.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/AutoCompletionManager.ts @@ -181,9 +181,9 @@ class AutoCompletionManager { } public autoCompletion(): any { - const This = this; + const THIS = this; return function (context: any) { - return This.doAutoCompletion(context); + return THIS.doAutoCompletion(context); }; } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/Processor.ts b/io.sc.engine.rule.frontend/src/views/shared/Processor.ts index d71052cf..25afc532 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/Processor.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/Processor.ts @@ -9,22 +9,24 @@ abstract class Processor { public static PARAMETER: string = 'parameter'; public static INDICATOR: string = 'indicator'; public static SCORE_CARD: string = 'scoreCard'; + public static FORMAT_TABLE_STYLE: any = { dense: false, bordered: false }; targetType: string; + context: any; autoCompletionManager: any; userDefinedFunctionsManager: any; - constructor(targetType: string) { + constructor(targetType: string, context?: any) { this.targetType = targetType; + this.context = context; this.autoCompletionManager = new AutoCompletionManager(); this.userDefinedFunctionsManager = new UserDefinedFunctionsManager(); } /** * 获取工具栏按钮对象 - * @param target 目标对象 */ - abstract getToolbarAction(target: any): any; + abstract getToolbarAction(): any; /** * 表格字段显示内容 @@ -34,15 +36,13 @@ abstract class Processor { /** * 获取编辑器对话框字段列表 - * @param context 上下文对象 */ - abstract getEditorFields(context?: any): any; + abstract getEditorFields(): any; /** * 获取用于显示查看信息的字段列表 - * @param context 上下文对象 */ - abstract getViewerFields(context?: any): any; + abstract getViewerFields(): any; /** * 表单提交前的操作 @@ -60,11 +60,11 @@ abstract class Processor { * 初始化 code-mirror 代码提示自动完成管理器 * @param args 参数对象 */ - initAutoCompletionManager(args: any) { - if (this.targetType === Processor.PARAMETER) { - this.autoCompletionManager.load(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByParameterId/' + args.target.id)); + initAutoCompletionManager() { + if (this.targetType === Processor.PARAMETER || this.targetType === Processor.SCORE_CARD) { + this.autoCompletionManager.load(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByParameterId/' + this.context.target.id)); } else if (this.targetType === Processor.INDICATOR) { - this.autoCompletionManager.load(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/' + args.target.id)); + this.autoCompletionManager.load(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByIndicatorId/' + this.context.target.id)); } } @@ -72,7 +72,7 @@ abstract class Processor { * 初始化用户自定义函数管理器 * @param args 参数对象 */ - initUserDefinedFunctionsManager(args: any) { + initUserDefinedFunctionsManager() { this.userDefinedFunctionsManager.load(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts b/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts index e63a88d9..447b7833 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/ProcessorManager.ts @@ -1,3 +1,4 @@ +import { toRaw } from 'vue'; import { Processor } from './Processor'; import { Arithmetic, @@ -7,6 +8,7 @@ import { DecisionTree, ExecutionFlow, GroovyScript, + HttpRequest, MathFormula, NumberRange, ObjectProperties, @@ -38,6 +40,7 @@ class ProcessorManager { 'PMML', 'GROOVY_SCRIPT', 'SQL', + 'HTTP_REQUEST', 'RULE', 'SINGLE_RULE', ]; @@ -51,44 +54,46 @@ class ProcessorManager { 'CONDITION_RANGE', 'GROOVY_SCRIPT', 'SQL', + 'HTTP_REQUEST', ]; targetType: string; processors: any; - constructor(targetType: string) { + constructor(targetType: string, context?: any) { this.targetType = targetType; this.processors = {}; - this.processors.ARITHMETIC = new Arithmetic(this.targetType); - this.processors.CONDITION_RANGE = new ConditionRange(this.targetType); - this.processors.DECISION_TABLE = new DecisionTable(this.targetType); - this.processors.DECISION_TABLE_2C = new DecisionTable2C(this.targetType); - this.processors.DECISION_TREE = new DecisionTree(this.targetType); - this.processors.EXECUTION_FLOW = new ExecutionFlow(this.targetType); - this.processors.GROOVY_SCRIPT = new GroovyScript(this.targetType); - this.processors.MATH_FORMULA = new MathFormula(this.targetType); - this.processors.NUMBER_RANGE = new NumberRange(this.targetType); - this.processors.OBJECT_PROPERTIES = new ObjectProperties(this.targetType); - this.processors.OPTION_VALUE = new OptionValue(this.targetType); - this.processors.PMML = new Pmml(this.targetType); - this.processors.RULE = new Rule(this.targetType); - this.processors.SCORE_CARD = new ScoreCard(this.targetType); - this.processors.SINGLE_RULE = new SingleRule(this.targetType); - this.processors.SQL = new Sql(this.targetType); - this.processors.TERNARY = new Ternary(this.targetType); - this.processors.WHEN_THEN = new WhenThen(this.targetType); + this.processors.ARITHMETIC = new Arithmetic(this.targetType, context); + this.processors.CONDITION_RANGE = new ConditionRange(this.targetType, context); + this.processors.DECISION_TABLE = new DecisionTable(this.targetType, context); + this.processors.DECISION_TABLE_2C = new DecisionTable2C(this.targetType, context); + this.processors.DECISION_TREE = new DecisionTree(this.targetType, context); + this.processors.EXECUTION_FLOW = new ExecutionFlow(this.targetType, context); + this.processors.GROOVY_SCRIPT = new GroovyScript(this.targetType, context); + this.processors.MATH_FORMULA = new MathFormula(this.targetType, context); + this.processors.NUMBER_RANGE = new NumberRange(this.targetType, context); + this.processors.OBJECT_PROPERTIES = new ObjectProperties(this.targetType, context); + this.processors.OPTION_VALUE = new OptionValue(this.targetType, context); + this.processors.PMML = new Pmml(this.targetType, context); + this.processors.RULE = new Rule(this.targetType, context); + this.processors.SCORE_CARD = new ScoreCard(this.targetType, context); + this.processors.SINGLE_RULE = new SingleRule(this.targetType, context); + this.processors.SQL = new Sql(this.targetType, context); + this.processors.HTTP_REQUEST = new HttpRequest(this.targetType, context); + this.processors.TERNARY = new Ternary(this.targetType, context); + this.processors.WHEN_THEN = new WhenThen(this.targetType, context); } - public getToolbarAction(target: any): any { + public getToolbarAction(): any { const result: any = []; switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(this.processors[name].getToolbarAction(target)); + result.push(this.processors[name].getToolbarAction()); }); break; case Processor.INDICATOR: ProcessorManager.PROCESSOR_TYPES_INDICATOR.forEach((name) => { - result.push(this.processors[name].getToolbarAction(target)); + result.push(this.processors[name].getToolbarAction()); }); break; } @@ -102,34 +107,34 @@ class ProcessorManager { return value; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { const result: any = []; switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(...this.processors[name].getEditorFields(context)); + result.push(...this.processors[name].getEditorFields()); }); break; case Processor.INDICATOR: ProcessorManager.PROCESSOR_TYPES_INDICATOR.forEach((name) => { - result.push(...this.processors[name].getEditorFields(context)); + result.push(...this.processors[name].getEditorFields()); }); break; } return result; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { const result: any = []; switch (this.targetType) { case Processor.PARAMETER: ProcessorManager.PROCESSOR_TYPES_PARAMETER.forEach((name) => { - result.push(...this.processors[name].getViewerFields(context)); + result.push(...this.processors[name].getViewerFields()); }); break; case Processor.INDICATOR: ProcessorManager.PROCESSOR_TYPES_INDICATOR.forEach((name) => { - result.push(...this.processors[name].getViewerFields(context)); + result.push(...this.processors[name].getViewerFields()); }); break; } @@ -143,9 +148,12 @@ class ProcessorManager { } public afterEditorOpen(args: any): void { - const type = args.grid.getEditorForm().getFieldValue('type'); - if (this.processors[type]) { - this.processors[type].afterEditorOpen(args); + const form = args.grid.getEditorForm(); + if (form) { + const type = form.getFieldValue('type'); + if (this.processors[type]) { + this.processors[type].afterEditorOpen(args); + } } } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts index 3f7e58f0..fc592d81 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Arithmetic.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class Arithmetic extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'arithmetic', label: $t('io.sc.engine.rule.core.enums.ProcessorType.ARITHMETIC'), icon: 'bi-calculator', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'ARITHMETIC'); @@ -31,10 +34,10 @@ class Arithmetic extends Processor { }; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'arithmetic', label: $t('re.resources.designer.processor.grid.entity.arithmetic'), type: 'w-code-mirror', @@ -52,15 +55,16 @@ class Arithmetic extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'arithmetic', label: $t('re.resources.designer.processor.grid.entity.arithmetic') }]; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts index 25e33ebb..bf51133b 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ConditionRange.ts @@ -3,14 +3,17 @@ import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; class ConditionRange extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'conditionRange', label: $t('io.sc.engine.rule.core.enums.ProcessorType.CONDITION_RANGE'), icon: 'bi-card-checklist', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'CONDITION_RANGE'); @@ -25,18 +28,18 @@ class ConditionRange extends Processor { objs.forEach((obj) => { str += ''; str += ' ' + PlaceHolder.replace(obj.condition) + ''; - str += ' ' + ('' + PlaceHolder.replace(obj.value)) + ''; + str += ' ' + ('' + PlaceHolder.replace(obj.value)) + ''; str += ''; }); - return MarkupTableUtil.markupTable('', str, { dense: false }); + return MarkupTableUtil.markupTable('', str, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); } return ''; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'conditionRange', label: $t('re.resources.designer.processor.grid.entity.conditionRange'), showIf: (args: any) => { @@ -44,6 +47,7 @@ class ConditionRange extends Processor { }, type: 'w-grid', height: 300, + localMode: true, dbClickOperation: 'edit', autoFetchData: false, denseBody: true, @@ -55,13 +59,7 @@ class ConditionRange extends Processor { 'add', 'clone', 'edit', - { - extend: 'remove', - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('conditionRange'); - grid.removeLocalData(args.selecteds); - }, - }, + 'remove', 'separator', { name: 'example', @@ -69,19 +67,17 @@ class ConditionRange extends Processor { icon: 'bi-balloon', click: (args: any) => { const sampleData = [ - { uuid: Tools.uuid(), condition: '${变量名}<=0', value: '0' }, - { uuid: Tools.uuid(), condition: '${变量名}>0 && ${变量名}<=50', value: '50' }, - { uuid: Tools.uuid(), condition: '${变量名}>50 && ${变量名}<=80', value: '80' }, - { uuid: Tools.uuid(), condition: '${变量名}>80 && ${变量名}<=100', value: '100' }, - { uuid: Tools.uuid(), condition: '${变量名}>100', value: '60' }, + { condition: '${变量名}<=0', value: '0' }, + { condition: '${变量名}>0 && ${变量名}<=50', value: '50' }, + { condition: '${变量名}>50 && ${变量名}<=80', value: '80' }, + { condition: '${变量名}>80 && ${变量名}<=100', value: '100' }, + { condition: '${变量名}>100', value: '60' }, ]; args.grid.setLocalData(sampleData); }, }, ], - primaryKey: 'uuid', columns: [ - { name: 'uuid', label: 'uuid', hidden: true }, { name: 'condition', label: $t('condition'), @@ -107,7 +103,6 @@ class ConditionRange extends Processor { form: { colsNum: 1, fields: [ - { name: 'uuid', label: 'uuid', showIf: false }, { name: 'condition', label: $t('condition'), @@ -135,33 +130,22 @@ class ConditionRange extends Processor { ], }, }, - onBeforeEditorDataSubmit: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('conditionRange'); - const form = grid.getEditorForm(); - if ('add' == form.getStatus() || 'clone' == form.getStatus()) { - args.data.uuid = Tools.uuid(); - grid.addLocalData(args.data); - args.callback(false); - } else if ('edit' == form.getStatus()) { - grid.updateLocalData(args.data); - args.callback(false); - } - }, + onBeforeEditorDataSubmit: (args: any) => {}, }, ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'conditionRange', label: $t('re.resources.designer.processor.grid.entity.conditionRange') }]; } public beforeEditorDataSubmit(args: any): void { + // 将编辑对话框中的具体分段表格组件转换成 json 字符串 const grid = args.grid.getEditorForm().getFieldComponent('conditionRange'); const localData: any[] = grid.getRows(); const ranges: any[] = []; localData.forEach((item) => { ranges.push({ - uuid: item.uuid, condition: item.condition, value: item.value, }); @@ -170,12 +154,27 @@ class ConditionRange extends Processor { } public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + // 初始化代码编辑器的自动完成提示管理器 + this.initAutoCompletionManager(); + // 初始化代码编辑器的用户自定义函数管理器 + this.initUserDefinedFunctionsManager(); + //获取条件分段编辑对话框中的编辑表单 + const form = args.grid.getEditorForm(); + //获取编辑表单中的具体分段表格组件 const grid = args.grid.getEditorForm().getFieldComponent('conditionRange'); - const data = Tools.json2Object(args.data.conditionRange); - grid.setLocalData(data); + + switch (form.getStatus()) { + case 'add': // 新增时清空表格内容 + grid.setLocalData([]); + break; + case 'edit': // 编辑/复制时填充表格内容 + case 'clone': + const data = Tools.json2Object(args.data.conditionRange); + grid.setLocalData(data); + break; + } } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts index 53611c98..ac00e49d 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable.ts @@ -3,17 +3,19 @@ import { $t, Tools, MarkupTableUtil } from 'platform-core'; import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; -const columnsRef = ref([]); - class DecisionTable extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 1024; + protected columnsRef = ref([]); + + public getToolbarAction(): any { return { extend: 'add', name: 'decisionTable', label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TABLE'), icon: 'bi-grid-3x3', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'DECISION_TABLE'); @@ -32,7 +34,7 @@ class DecisionTable extends Processor { if (obj[key] === 'condition') { str += ' ' + $t(obj[key]) + ''; } else { - str += ' ' + $t(obj[key]) + ''; + str += ' ' + $t(obj[key]) + ''; } } else if (key.startsWith('C')) { str += ' ' + PlaceHolder.replace(obj[key]) + ''; @@ -40,15 +42,15 @@ class DecisionTable extends Processor { }); str += ''; }); - return MarkupTableUtil.markupTable('', str); + return MarkupTableUtil.markupTable('', str, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); } return ''; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'decisionTable', label: $t('re.resources.designer.processor.grid.entity.decisionTable'), showIf: (args: any) => { @@ -56,8 +58,9 @@ class DecisionTable extends Processor { }, type: 'w-grid', height: 300, - dbClickOperation: 'edit', - selectedMode: 'cell', + localMode: true, + selectMode: 'cell', + dbClickOperation: 'cellEdit', autoFetchData: false, denseBody: true, dndMode: 'local', @@ -80,7 +83,7 @@ class DecisionTable extends Processor { return false; }, click: (args: any) => { - addCol(args.grid, args.selectedColName, /C[\d]/, 'left'); + this.addCol(args.grid, args.selectedColName, /C[\d]/, 'left'); }, }, { @@ -93,7 +96,7 @@ class DecisionTable extends Processor { return false; }, click: (args: any) => { - addCol(args.grid, args.selectedColName, /C[\d]/, 'right'); + this.addCol(args.grid, args.selectedColName, /C[\d]/, 'right'); }, }, 'separator', @@ -101,34 +104,24 @@ class DecisionTable extends Processor { name: 'addConditionRow', label: $t('re.resources.designer.processor.decisionTable.toolbar.addConditionRow'), click: (args: any) => { + let rowNum = 0; const rows = args.grid.getRows(); - const propertyNames = Tools.extractAllPropertyNames(rows, /C[\d]/); - propertyNames.sort(); - const row: any = { - uuid: Tools.uuid(), - type: 'condition', - }; - propertyNames.forEach((name) => { - row[name] = ''; - }); - args.grid.addLocalData(row); + if (rows && rows.length > 0) { + for (let i = 0; i < rows.length; i++) { + if (rows[i].type === 'result') { + rowNum = i; + break; + } + } + } + args.grid.addLocalData({ type: 'condition' }, rowNum); }, }, { name: 'addResultRow', label: $t('re.resources.designer.processor.decisionTable.toolbar.addResultRow'), click: (args: any) => { - const rows = args.grid.getRows(); - const propertyNames = Tools.extractAllPropertyNames(rows, /C[\d]/); - propertyNames.sort(); - const row: any = { - uuid: Tools.uuid(), - type: 'result', - }; - propertyNames.forEach((name) => { - row[name] = ''; - }); - args.grid.addLocalData(row); + args.grid.addLocalData({ type: 'result' }); }, }, ], @@ -147,7 +140,7 @@ class DecisionTable extends Processor { return false; }, click: (args: any) => { - removeCol(args.grid, args.selectedColName, /C[\d]/); + this.removeCol(args.grid, args.selectedColName, /C[\d]/); }, }, { @@ -160,12 +153,12 @@ class DecisionTable extends Processor { return false; }, click: (args: any) => { - args.grid.removeLocalData(args.selected); + args.grid.removeLocalData(args.selecteds); }, }, ], 'separator', - 'edit', + 'cellEdit', 'separator', { name: 'example', @@ -173,31 +166,33 @@ class DecisionTable extends Processor { icon: 'bi-balloon', click: (args: any) => { const sampleData = [ - { uuid: Tools.uuid(), type: 'condition', C0: '${客户类型}="普通客户"', C1: 'Y', C2: 'Y', C3: null, C4: null }, - { uuid: Tools.uuid(), type: 'condition', C0: '${评分结果}>=60', C1: 'Y', C2: null, C3: 'Y', C4: null }, - { uuid: Tools.uuid(), type: 'result', C0: '${风险等级}', C1: 'A', C2: 'B', C3: 'B', C4: 'C' }, - { uuid: Tools.uuid(), type: 'result', C0: '${决策结果}', C1: '直接通过', C2: '人工审查', C3: '人工审查', C4: '直接拒绝' }, + { type: 'condition', C0: '${客户类型}="普通客户"', C1: 'Y', C2: 'Y', C3: null, C4: null }, + { type: 'condition', C0: '${评分结果}>=60', C1: 'Y', C2: null, C3: 'Y', C4: null }, + { type: 'result', C0: '${风险等级}', C1: 'A', C2: 'B', C3: 'B', C4: 'C' }, + { type: 'result', C0: '${决策结果}', C1: '直接通过', C2: '人工审查', C3: '人工审查', C4: '直接拒绝' }, ]; + const propertyNames: any[] = Tools.extractAllPropertyNames(sampleData, /C[\d]/); + propertyNames.sort(); + this.buildColumsRef(propertyNames); args.grid.setLocalData(sampleData); }, }, ], - primaryKey: 'uuid', - columns: columnsRef, + columns: this.columnsRef, editor: { dialog: { width: '600px', }, form: { colsNum: 1, - fields: columnsRef, + fields: this.columnsRef, }, }, }, ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'decisionTable', label: $t('re.resources.designer.processor.grid.entity.decisionTable') }]; } @@ -206,7 +201,6 @@ class DecisionTable extends Processor { const grid = form.getFieldComponent('decisionTable'); const localData: any[] = grid.getRows(); const fieldNames: any[] = []; - fieldNames.push('uuid'); fieldNames.push('type'); const propertyNames: any[] = Tools.extractAllPropertyNames(localData, /C[\d]/); propertyNames.sort(); @@ -225,114 +219,102 @@ class DecisionTable extends Processor { } public afterEditorOpen(args: any): void { + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + const form = args.grid.getEditorForm(); - const row = args.data; - // 构建表格的头 + const row = args.data || []; + const rows = Tools.json2Object(row.decisionTable); const fieldNames = Tools.extractAllPropertyNames(rows, /C[\d]/); fieldNames.sort(); - const fields: any = []; - addFixedFields(fields); - fieldNames.forEach((name) => { - fields.push({ - name: name, - label: $t(name), - sortable: false, - type: 'w-code-mirror', - attrs: { - toolbar: false, - rows: 1, - }, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }); - }); - columnsRef.value = fields; - // 设置表格数据 + this.buildColumsRef(fieldNames); + const grid = form.getFieldComponent('decisionTable'); - grid.setLocalData(rows); + switch (form.getStatus()) { + case 'add': + grid.setLocalData([]); + break; + case 'edit': + case 'clone': + grid.setLocalData(rows); + break; + } } -} -const addCol = (grid: any, currentSelectedColName: string, colNamePattern: any, mode: string) => { - //更新表数据 - const rows: any[] = grid.getRows(); - const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); - propertyNames.sort(); - const selectedColIndex = propertyNames.indexOf(currentSelectedColName) + (mode === 'left' ? 0 : 1); + protected addCol(grid: any, currentSelectedColName: string, colNamePattern: any, mode: string) { + //更新表数据 + const rows: any[] = grid.getRows(); + const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); + propertyNames.sort(); + const selectedColIndex = propertyNames.indexOf(currentSelectedColName) + (mode === 'left' ? 0 : 1); + rows.forEach((row) => { + let i = 0; + for (i = propertyNames.length; i > selectedColIndex; i--) { + row['C' + i] = row['C' + (i - 1)]; + } + row['C' + selectedColIndex] = ''; + }); + this.buildColumsRef(Tools.extractAllPropertyNames(rows, colNamePattern)); + grid.setLocalData(rows); + } - rows.forEach((row) => { - let i = 0; - for (i = propertyNames.length; i > selectedColIndex; i--) { - row['C' + i] = row['C' + (i - 1)]; - } - row['C' + selectedColIndex] = ''; - }); + protected removeCol(grid: any, currentSelectedColName: string, colNamePattern: any) { + const rows: any[] = grid.getRows(); + const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); + propertyNames.sort(); + const selectedColIndex = propertyNames.indexOf(currentSelectedColName); + rows.forEach((row) => { + let i = 0; + for (i = selectedColIndex; i < propertyNames.length; i++) { + row['C' + i] = row['C' + (i + 1)]; + } + delete row['C' + (propertyNames.length - 1)]; + }); + this.buildColumsRef(Tools.extractAllPropertyNames(rows, colNamePattern)); + grid.setLocalData(rows); + } - // 更新表头 - const fields: any[] = []; - addFixedFields(fields); - let i = 0; - for (i = 0; i <= propertyNames.length; i++) { - fields.push({ - name: 'C' + i, - label: $t('C' + i), - sortable: false, + protected buildColumsRef(propertyNames: string[]) { + const columns: any[] = []; + // 添加"类型"列 + columns.push({ + name: 'type', + label: $t('type'), format: (value: any) => { - return PlaceHolder.replace(value); + if (value === 'result') { + return '' + $t(value) + ''; + } + return $t(value); }, }); - } - columnsRef.value = fields; - grid.setLocalData(rows); -}; - -const removeCol = (grid: any, currentSelectedColName: string, colNamePattern: any) => { - //更新表数据 - const rows: any[] = grid.getRows(); - const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); - propertyNames.sort(); - const selectedColIndex = propertyNames.indexOf(currentSelectedColName); - rows.forEach((row) => { + // 添加其他列 let i = 0; - for (i = selectedColIndex; i < propertyNames.length; i++) { - row['C' + i] = row['C' + (i + 1)]; + for (i = 0; i < propertyNames.length; i++) { + columns.push({ + name: 'C' + i, + label: $t('C' + i), + sortable: false, + format: (value: any) => { + return PlaceHolder.replace(value); + }, + type: 'w-code-mirror', + attrs: { + toolbar: false, + lang: 'java', + rows: 4, + lineWrap: true, + lineBreak: false, + placeholder: true, + autoCompletion: this.autoCompletionManager.autoCompletion(), + userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), + }, + }); } - delete row['C' + (propertyNames.length - 1)]; - }); - - // 更新表头 - const fields: any[] = []; - addFixedFields(fields); - let i = 0; - for (i = 0; i < propertyNames.length - 1; i++) { - fields.push({ - name: 'C' + i, - label: $t('C' + i), - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }); + this.columnsRef.value = columns; } - columnsRef.value = fields; - grid.setLocalData(rows); -}; - -const addFixedFields = (fields: any[]) => { - fields.push({ name: 'uuid', label: 'uuid', hidden: true }); - fields.push({ - name: 'type', - label: $t('type'), - format: (value: any) => { - if (value === 'result') { - return '' + $t(value) + ''; - } - return $t(value); - }, - }); -}; +} export { DecisionTable }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts index 266d3382..fa15f0ee 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTable2c.ts @@ -1,19 +1,21 @@ import { ref } from 'vue'; import { $t, Tools, MarkupTableUtil } from 'platform-core'; import { Processor } from '../Processor'; +import { DecisionTable } from './DecisionTable'; import { PlaceHolder } from '@/utils/PlaceHolder'; -const columnsRef = ref([]); +class DecisionTable2C extends DecisionTable { + #editorDialogWidth: number = 1024; -class DecisionTable2C extends Processor { - public getToolbarAction(target: any): any { + public getToolbarAction(): any { return { extend: 'add', name: 'decisionTable2C', label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TABLE_2C'), icon: 'bi-grid-3x2', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + 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'); @@ -28,31 +30,31 @@ class DecisionTable2C extends Processor { objs.forEach((obj) => { str += ''; Object.keys(obj).forEach((key) => { - if (key !== 'uuid' && typeof obj[key] === 'string') { + if (typeof obj[key] === 'string') { str += ' ' + PlaceHolder.replace(obj[key]) + ''; } }); str += ''; }); - return MarkupTableUtil.markupTable('', str); + return MarkupTableUtil.markupTable('', str, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); } return ''; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'decisionTable2C', label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'), showIf: (args: any) => { return 'DECISION_TABLE_2C' === args.form.getFieldValue('type'); }, type: 'w-grid', - localMode: true, height: 300, - dbClickOperation: 'edit', - selectedMode: 'cell', + localMode: true, + selectMode: 'cell', + dbClickOperation: 'cellEdit', autoFetchData: false, denseBody: true, dndMode: 'local', @@ -75,7 +77,7 @@ class DecisionTable2C extends Processor { return false; }, click: (args: any) => { - addCol(args.grid, args.selectedColName, /C[\d]/, 'left'); + this.addCol(args.grid, args.selectedColName, /C[\d]/, 'left'); }, }, { @@ -88,7 +90,7 @@ class DecisionTable2C extends Processor { return false; }, click: (args: any) => { - addCol(args.grid, args.selectedColName, /C[\d]/, 'right'); + this.addCol(args.grid, args.selectedColName, /C[\d]/, 'right'); }, }, 'separator', @@ -96,16 +98,7 @@ class DecisionTable2C extends Processor { name: 'addRow', label: $t('re.resources.designer.processor.decisionTable.toolbar.addRow'), click: (args: any) => { - const rows = args.grid.getRows(); - const propertyNames = Tools.extractAllPropertyNames(rows, /C[\d]/); - propertyNames.sort(); - const row: any = { - uuid: Tools.uuid(), - }; - propertyNames.forEach((name) => { - row[name] = ''; - }); - args.grid.addLocalData(row); + args.grid.addLocalData({}); }, }, ], @@ -124,7 +117,7 @@ class DecisionTable2C extends Processor { return false; }, click: (args: any) => { - removeCol(args.grid, args.selectedColName, /C[\d]/); + this.removeCol(args.grid, args.selectedColName, /C[\d]/); }, }, { @@ -137,12 +130,12 @@ class DecisionTable2C extends Processor { return false; }, click: (args: any) => { - args.grid.removeLocalData(args.selected); + args.grid.removeLocalData(args.selecteds); }, }, ], 'separator', - 'edit', + 'cellEdit', 'separator', { name: 'example', @@ -150,30 +143,32 @@ class DecisionTable2C extends Processor { icon: 'bi-balloon', click: (args: any) => { const sampleData = [ - { uuid: Tools.uuid(), C0: '', C1: "${客户类型}=='普通客户'", C2: "${客户类型}=='VIP客户'", C3: "${客户类型}=='临时客户'" }, - { uuid: Tools.uuid(), C0: '${评分结果}<60', C1: '1', C2: '3', C3: '5' }, - { uuid: Tools.uuid(), C0: '${评分结果}>=60', C1: '2', C2: '4', C3: '6' }, + { C0: '', C1: "${客户类型}=='普通客户'", C2: "${客户类型}=='VIP客户'", C3: "${客户类型}=='临时客户'" }, + { C0: '${评分结果}<60', C1: '1', C2: '3', C3: '5' }, + { C0: '${评分结果}>=60', C1: '2', C2: '4', C3: '6' }, ]; + const propertyNames: any[] = Tools.extractAllPropertyNames(sampleData, /C[\d]/); + propertyNames.sort(); + this.buildColumsRef(propertyNames); args.grid.setLocalData(sampleData); }, }, ], - primaryKey: 'uuid', - columns: columnsRef, + columns: this.columnsRef, editor: { dialog: { width: '600px', }, form: { colsNum: 1, - fields: columnsRef, + fields: this.columnsRef, }, }, }, ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'decisionTable2C', label: $t('re.resources.designer.processor.grid.entity.decisionTable2C') }]; } @@ -182,7 +177,6 @@ class DecisionTable2C extends Processor { const grid = form.getFieldComponent('decisionTable2C'); const localData: any[] = grid.getRows(); const fieldNames: any[] = Tools.extractAllPropertyNames(localData, /C[\d]/); - fieldNames.push('uuid'); fieldNames.sort(); const data: any = []; localData.forEach((row) => { @@ -196,100 +190,34 @@ class DecisionTable2C extends Processor { } public afterEditorOpen(args: any): void { + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + const form = args.grid.getEditorForm(); const row = args.data; - // 构建表格的头 + const rows = Tools.json2Object(row.decisionTable2C); const fieldNames = Tools.extractAllPropertyNames(rows, /C[\d]/); fieldNames.sort(); - const fields: any = []; - fields.push({ name: 'uuid', label: 'uuid', hidden: true }); - fieldNames.forEach((name) => { - fields.push({ - name: name, - label: $t(name), - sortable: false, - type: 'w-code-mirror', - attrs: { - toolbar: false, - rows: 1, - }, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }); - }); - columnsRef.value = fields; - // 设置表格数据 - const grid = form.getFieldComponent('decisionTable2C'); - grid.setLocalData(rows); - } -} + this.buildColumsRef(fieldNames); -const addCol = (grid: any, currentSelectedColName: string, colNamePattern: any, mode: string) => { - //更新表数据 - const rows: any[] = grid.getRows(); - const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); - propertyNames.sort(); - const selectedColIndex = propertyNames.indexOf(currentSelectedColName) + (mode === 'left' ? 0 : 1); - - rows.forEach((row) => { - let i = 0; - for (i = propertyNames.length; i > selectedColIndex; i--) { - row['C' + i] = row['C' + (i - 1)]; + const grid = form.getFieldComponent('decisionTable2C'); + switch (form.getStatus()) { + case 'add': + grid.setLocalData([]); + break; + case 'edit': + case 'clone': + grid.setLocalData(rows); + break; } - row['C' + selectedColIndex] = ''; - }); - - // 更新表头 - const fields: any[] = []; - fields.push({ name: 'uuid', label: 'uuid', hidden: true }); - let i = 0; - for (i = 0; i <= propertyNames.length; i++) { - fields.push({ - name: 'C' + i, - label: $t('C' + i), - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }); } - columnsRef.value = fields; - grid.setLocalData(rows); -}; - -const removeCol = (grid: any, currentSelectedColName: string, colNamePattern: any) => { - //更新表数据 - const rows: any[] = grid.getRows(); - const propertyNames: string[] = Tools.extractAllPropertyNames(rows, colNamePattern); - propertyNames.sort(); - const selectedColIndex = propertyNames.indexOf(currentSelectedColName); - rows.forEach((row) => { - let i = 0; - for (i = selectedColIndex; i < propertyNames.length; i++) { - row['C' + i] = row['C' + (i + 1)]; - } - delete row['C' + (propertyNames.length - 1)]; - }); - - // 更新表头 - const fields: any[] = []; - fields.push({ name: 'uuid', label: 'uuid', hidden: true }); - let i = 0; - for (i = 0; i < propertyNames.length - 1; i++) { - fields.push({ - name: 'C' + i, - label: $t('C' + i), - sortable: false, - format: (value: any) => { - return PlaceHolder.replace(value); - }, - }); + protected buildColumsRef(propertyNames: string[]) { + super.buildColumsRef(propertyNames); + this.columnsRef.value.splice(0, 1); } - columnsRef.value = fields; - grid.setLocalData(rows); -}; +} export { DecisionTable2C }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts index b6f19b57..1d977008 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/DecisionTree.ts @@ -2,14 +2,15 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class DecisionTree extends Processor { - public getToolbarAction(target: any): any { + public getToolbarAction(): any { return { extend: 'add', name: 'decisionTree', label: $t('io.sc.engine.rule.core.enums.ProcessorType.DECISION_TREE'), icon: 'bi-tree', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'DECISION_TREE'); @@ -25,10 +26,10 @@ class DecisionTree extends Processor { return result; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'decisionTree', label: $t('re.resources.designer.processor.grid.entity.decisionTree'), type: 'w-code-mirror', @@ -42,7 +43,7 @@ class DecisionTree extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return []; } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts index 53508255..509e3553 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ExecutionFlow.ts @@ -2,14 +2,15 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class ExecutionFlow extends Processor { - public getToolbarAction(target: any): any { + public getToolbarAction(): any { return { extend: 'add', name: 'executionFlow', label: $t('io.sc.engine.rule.core.enums.ProcessorType.EXECUTION_FLOW'), icon: 'bi-bounding-box-circles', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'EXECUTION_FLOW'); @@ -25,10 +26,10 @@ class ExecutionFlow extends Processor { return result; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'executionFlow', label: $t('re.resources.designer.processor.grid.entity.executionFlow'), type: 'w-code-mirror', @@ -42,7 +43,7 @@ class ExecutionFlow extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return []; } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts index 99500d5c..c3d01fae 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/GroovyScript.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class GroovyScript extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'groovyScript', label: $t('io.sc.engine.rule.core.enums.ProcessorType.GROOVY_SCRIPT'), icon: 'bi-code', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'GROOVY_SCRIPT'); @@ -24,10 +27,10 @@ class GroovyScript extends Processor { return result; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'groovyScript', label: $t('re.resources.designer.processor.grid.entity.groovyScript'), type: 'w-code-mirror', @@ -39,22 +42,23 @@ class GroovyScript extends Processor { placeholder: true, autoCompletion: this.autoCompletionManager.autoCompletion(), userDefinedFunctions: this.userDefinedFunctionsManager.userDefinedFunctions(), - showIf: (args) => { + showIf: (args: any) => { return 'GROOVY_SCRIPT' === args.form.getFieldValue('type'); }, }, ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'groovyScript', label: $t('re.resources.designer.processor.grid.entity.groovyScript') }]; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts new file mode 100644 index 00000000..8970c1d2 --- /dev/null +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/HttpRequest.ts @@ -0,0 +1,390 @@ +import { ref, computed } from 'vue'; +import { axios, Environment, $t, Tools, EnumTools, Options } from 'platform-core'; +import { Processor } from '../Processor'; +import { PlaceHolder } from '@/utils/PlaceHolder'; + +class HttpRequest extends Processor { + #editorDialogWidth: number = 1280; + #HttpMethodTypeEnum: any; + #httpMethodTypeOptionsRef = ref([]); + #parameterOptionsRef = ref([]); + #sqlQueryResultFieldsRef = ref([]); + #editorForm: any; + + constructor(targetType: string, context?: any) { + super(targetType, context); + EnumTools.fetch(['io.sc.engine.rule.core.enums.HttpMethodType']).then((value) => { + this.#HttpMethodTypeEnum = value.HttpMethodType; + this.#httpMethodTypeOptionsRef = Options.enum(this.#HttpMethodTypeEnum); + }); + 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'), + 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'); + }, + }; + } + + public format(row: any): any { + return { + componentType: 'w-code-mirror', + attrs: { + lang: 'sql', + rows: 4, + editable: false, + modelValue: row.sql, + placeholder: true, + }, + }; + } + + public getEditorFields(): any { + return [ + { + colSpan: 2, + 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'); + }, + }, + { + colSpan: 5, + name: 'sql', + label: $t('re.resources.designer.processor.grid.entity.httpUrl'), + type: 'w-text', + showIf: (args: any) => { + return 'HTTP_REQUEST' === args.form.getFieldValue('type'); + }, + }, + { + colSpan: 3, + name: 'sqlParameterValues', + label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'), + 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', + }, + ], + }, + }, + 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, + name: 'sqlQueryResult', + label: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'), + showIf: (args: any) => { + return 'SQL' === args.form.getFieldValue('type'); + }, + 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'), + showIf: (args: any) => { + return 'SQL' === args.form.getFieldValue('type'); + }, + 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, + }, + ], + }, + }, + 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); + } + }, + }, + ]; + } + + 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') }, + ]; + } + + 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 afterEditorOpen(args: any): void { + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + 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); + } +} + +export { HttpRequest }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts index 7be5bf78..4404e0e1 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/MathFormula.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class MathFormula extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'mathFormula', label: $t('io.sc.engine.rule.core.enums.ProcessorType.MATH_FORMULA'), icon: 'bi-superscript', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'MATH_FORMULA'); @@ -28,10 +31,10 @@ class MathFormula extends Processor { }; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'mathFormula', label: $t('re.resources.designer.processor.grid.entity.mathFormula'), type: 'w-math', @@ -44,15 +47,16 @@ class MathFormula extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return []; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts index 5defdcfa..2b8af28d 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/NumberRange.ts @@ -3,14 +3,17 @@ import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; class NumberRange extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'numberRange', label: $t('io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE'), icon: 'bi-justify', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'NUMBER_RANGE'); @@ -25,22 +28,22 @@ class NumberRange extends Processor { objs.forEach((obj, index) => { str += ''; if (index == 0 && this.targetType !== Processor.SCORE_CARD) { - str += ' ' + PlaceHolder.replace(row.numberRangeVar) + ''; + str += ' ' + PlaceHolder.replace(row.numberRangeVar) + ''; } str += ' ' + Tools.generateIntervalRange(obj.minIncluded, obj.min, obj.max, obj.maxIncluded) + ''; - str += ' ' + ('' + PlaceHolder.replace('' + obj.value)) + ''; + str += ' ' + ('' + PlaceHolder.replace('' + obj.value)) + ''; str += ''; }); - return MarkupTableUtil.markupTable('', str); + return MarkupTableUtil.markupTable('', str, Tools.mergeObject({}, Processor.FORMAT_TABLE_STYLE)); } return ''; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { const result: any[] = []; if (this.targetType !== Processor.SCORE_CARD) { result.push({ - colSpan: 5, + colSpan: 7, name: 'numberRangeVar', label: $t('re.resources.designer.processor.grid.entity.numberRangeVar'), showIf: (args: any) => { @@ -57,7 +60,7 @@ class NumberRange extends Processor { }); } result.push({ - colSpan: 5, + colSpan: 7, name: 'numberRange', label: $t('re.resources.designer.processor.grid.entity.numberRange'), showIf: (args: any) => { @@ -65,6 +68,7 @@ class NumberRange extends Processor { }, type: 'w-grid', height: 300, + localMode: true, dbClickOperation: 'edit', autoFetchData: false, denseBody: true, @@ -76,13 +80,7 @@ class NumberRange extends Processor { 'add', 'clone', 'edit', - { - extend: 'remove', - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('numberRange'); - grid.removeLocalData(args.selecteds); - }, - }, + 'remove', 'separator', { name: 'example', @@ -90,20 +88,18 @@ class NumberRange extends Processor { icon: 'bi-balloon', click: (args: any) => { const sampleData = [ - { uuid: Tools.uuid(), minIncluded: false, min: null, max: 0, maxIncluded: false, value: 1 }, - { uuid: Tools.uuid(), minIncluded: true, min: 0, max: 1, maxIncluded: false, value: 2 }, - { uuid: Tools.uuid(), minIncluded: true, min: 1, max: 2, maxIncluded: false, value: 3 }, - { uuid: Tools.uuid(), minIncluded: true, min: 2, max: 3, maxIncluded: false, value: 4 }, - { uuid: Tools.uuid(), minIncluded: true, min: 3, max: null, maxIncluded: false, value: 5 }, - { uuid: Tools.uuid(), minIncluded: false, min: null, max: null, maxIncluded: false, value: 0 }, + { minIncluded: false, min: null, max: 0, maxIncluded: false, value: 1 }, + { minIncluded: true, min: 0, max: 1, maxIncluded: false, value: 2 }, + { minIncluded: true, min: 1, max: 2, maxIncluded: false, value: 3 }, + { minIncluded: true, min: 2, max: 3, maxIncluded: false, value: 4 }, + { minIncluded: true, min: 3, max: null, maxIncluded: false, value: 5 }, + { minIncluded: false, min: null, max: null, maxIncluded: false, value: 0 }, ]; args.grid.setLocalData(sampleData); }, }, ], - primaryKey: 'uuid', columns: [ - { width: 200, name: 'uuid', label: 'uuid', hidden: true }, { width: 60, name: 'minIncluded', @@ -143,7 +139,6 @@ class NumberRange extends Processor { form: { colsNum: 4, fields: [ - { name: 'uuid', label: 'uuid', showIf: false, colSpan: 4 }, { name: 'min', label: $t('minValue'), type: 'w-text', colSpan: 3 }, { name: 'minIncluded', label: $t('include'), type: 'w-checkbox' }, { name: 'max', label: $t('maxValue'), type: 'w-text', colSpan: 3 }, @@ -152,34 +147,21 @@ class NumberRange extends Processor { ], }, }, - onBeforeEditorDataSubmit: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('numberRange'); - const form = grid.getEditorForm(); - if ('add' == form.getStatus() || 'clone' == form.getStatus()) { - args.data.uuid = Tools.uuid(); - grid.addLocalData(args.data); - args.callback(false); - } else if ('edit' == form.getStatus()) { - grid.updateLocalData(args.data); - args.callback(false); - } - }, + onBeforeEditorDataSubmit: (args: any) => {}, }); return result; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'numberRange', label: $t('re.resources.designer.processor.grid.entity.numberRange') }]; } public beforeEditorDataSubmit(args: any): void { - const form = args.grid.getEditorForm(); - const grid = form.getFieldComponent('numberRange'); + const grid = args.grid.getEditorForm().getFieldComponent('numberRange'); const localData: any[] = grid.getRows(); const ranges: any[] = []; localData.forEach((item) => { ranges.push({ - uuid: item.uuid, minIncluded: item.minIncluded, min: item.min, max: item.max, @@ -191,14 +173,18 @@ class NumberRange extends Processor { } public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); const form = args.grid.getEditorForm(); - const row = args.data; - const grid = form.getFieldComponent('numberRange'); - const rows = Tools.json2Object(row.numberRange); - grid.setLocalData(rows); + const grid = args.grid.getEditorForm().getFieldComponent('numberRange'); + if ('add' == form.getStatus()) { + grid.setLocalData([]); + } else if ('edit' == form.getStatus() || 'clone' == form.getStatus()) { + const data = Tools.json2Object(args.data.numberRange); + grid.setLocalData(data); + } } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts index fafe3006..dd80db61 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ObjectProperties.ts @@ -4,14 +4,16 @@ import { PlaceHolder } from '@/utils/PlaceHolder'; import { ValueTypeUtil } from '@/utils/ValueTypeUtil'; class ObjectProperties extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'objectProperties', label: $t('io.sc.engine.rule.core.enums.ProcessorType.OBJECT_PROPERTIES'), icon: 'bi-list-task', enableIf: (args: any) => { - return !ValueTypeUtil.isBase(target.valueType); + return !ValueTypeUtil.isBase(this.context.target.valueType); }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'OBJECT_PROPERTIES'); @@ -33,15 +35,15 @@ class ObjectProperties extends Processor { body += ` ` + ('' + PlaceHolder.replace(obj.expression)) + ''; body += ''; }); - str += MarkupTableUtil.markupTable('', body, { 'max-height': '200px' }); + str += MarkupTableUtil.markupTable('', body, Tools.mergeObject({ 'max-height': '150px' }, Processor.FORMAT_TABLE_STYLE)); } return str; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'objectCondition', label: $t('re.resources.designer.processor.grid.entity.objectCondition'), type: 'w-code-mirror', @@ -56,7 +58,7 @@ class ObjectProperties extends Processor { }, }, { - colSpan: 5, + colSpan: 7, name: 'objectProperties', label: $t('re.resources.designer.processor.grid.entity.objectProperties'), showIf: (args: any) => { @@ -88,7 +90,7 @@ class ObjectProperties extends Processor { expression: item.expression, }); }); - context.objectPropertiesMatcherDialogRef.open(objectProperties); + this.context.objectPropertiesMatcherDialogRef.value.open(objectProperties); }, }, 'edit', @@ -183,7 +185,7 @@ class ObjectProperties extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return []; } @@ -203,17 +205,18 @@ class ObjectProperties extends Processor { } public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); const form = args.grid.getEditorForm(); const row = args.data; if ('add' == form.getStatus()) { let listObejctPropertiesUrl = ''; if (this.targetType === Processor.PARAMETER) { - listObejctPropertiesUrl = '/api/re/model/parameter/listObejctPropertiesByParameterId/' + args.target.id; + listObejctPropertiesUrl = '/api/re/model/parameter/listObejctPropertiesByParameterId/' + this.context.target.id; } else if (this.targetType === Processor.INDICATOR) { - listObejctPropertiesUrl = '/api/re/indicator/listObejctPropertiesByIndicatorId/' + args.target.id; + listObejctPropertiesUrl = '/api/re/indicator/listObejctPropertiesByIndicatorId/' + this.context.target.id; } axios.get(Environment.apiContextPath(listObejctPropertiesUrl)).then((response) => { const properties = response.data; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts index 57d5d198..4be4ace3 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/OptionValue.ts @@ -5,14 +5,17 @@ import { Processor } from '../Processor'; const optionOptionsRef = ref([]); class OptionValue extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 400; + + public getToolbarAction(): any { return { extend: 'add', name: 'optionValue', label: $t('io.sc.engine.rule.core.enums.ProcessorType.OPTION_VALUE'), icon: 'bi-card-list', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'OPTION_VALUE'); @@ -24,10 +27,10 @@ class OptionValue extends Processor { return row.optionCode; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'optionCode', label: $t('re.resources.designer.processor.grid.entity.optionCode'), type: 'w-select', @@ -39,16 +42,16 @@ class OptionValue extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'optionCode', label: $t('re.resources.designer.processor.grid.entity.optionCode') }]; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - args.grid.getEditorDialog().setWidth('40%'); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); // 获取选项输入参数列表 - axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + args.target.id)).then((response) => { + axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + this.context.target.id)).then((response) => { const parameters: any[] = response.data; const options: any[] = []; parameters.forEach((item) => { diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts index 68c12026..f5352f8c 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Pmml.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class Pmml extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 1024; + + public getToolbarAction(): any { return { extend: 'add', name: 'pmml', label: $t('io.sc.engine.rule.core.enums.ProcessorType.PMML'), icon: 'bi-filetype-xml', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'PMML'); @@ -25,14 +28,15 @@ class Pmml extends Processor { return result; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'pmml', label: $t('re.resources.designer.processor.grid.entity.pmml'), type: 'w-code-mirror', rows: 20, + tabSize: 2, lineNumber: true, toolbar: false, lang: 'xml', @@ -45,15 +49,16 @@ class Pmml extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return []; } public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts index afdedac7..8bbb9fe2 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Rule.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class Rule extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'rule', label: $t('io.sc.engine.rule.core.enums.ProcessorType.RULE'), icon: 'bi-shadows', enableIf: (args: any) => { - return target.type === 'RULE_RESULT' || target.type === 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'RULE'); @@ -21,17 +24,19 @@ class Rule extends Processor { return row.rule; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return []; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'rule', label: $t('re.resources.designer.processor.grid.entity.rule') }]; } public beforeEditorDataSubmit(args: any): void {} - public afterEditorOpen(args: any): void {} + public afterEditorOpen(args: any): void { + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + } } export { Rule }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts index 0e64618f..e305f6c3 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/ScoreCard.ts @@ -1,23 +1,38 @@ -import { ref, toRaw } from 'vue'; -import { $t, axios, Environment, Tools } from 'platform-core'; +import { ref } from 'vue'; +import { $t, axios, Environment, MarkupTableUtil, Tools } from 'platform-core'; import { Processor } from '../Processor'; import { ConditionRange } from './ConditionRange'; import { NumberRange } from './NumberRange'; -const parameterOptionsRef = ref([]); -const varProcessorTypeOptionsRef = ref([]); -const conditionRange = new ConditionRange(Processor.SCORE_CARD); -const numberRange = new NumberRange(Processor.SCORE_CARD); - class ScoreCard extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 1024; + #conditionRange: any; + #numberRange: any; + #parameterOptionsRef = ref([]); + + #scoreCard: any; //评分卡因素列表 + + constructor(targetType: string, context?: any) { + super(targetType, context); + this.#conditionRange = new ConditionRange(Processor.SCORE_CARD, context); + this.#numberRange = new NumberRange(Processor.SCORE_CARD, context); + + 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: 'scoreCard', label: $t('io.sc.engine.rule.core.enums.ProcessorType.SCORE_CARD'), icon: 'bi-credit-card-2-front', enableIf: (args) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'SCORE_CARD'); @@ -28,36 +43,34 @@ class ScoreCard extends Processor { public format(row: any): any { const objs = Tools.json2Object(row.scoreCard); if (objs) { - let str = `
`; - str += ``; + let str = ''; objs.forEach((obj: any) => { str += ''; str += ' '; - str += ' '; + str += ' '; if (obj.type === 'CONDITION_RANGE') { - str += ' '; + str += ' '; } else if (obj.type === 'NUMBER_RANGE') { - str += ' '; + str += ' '; } str += ''; }); - str += '
' + $t('io.sc.engine.rule.core.enums.ProcessorType.' + obj.type) + '' + obj.name + '' + this.getParameterNameByCode(obj.code) + '' + conditionRange.format({ conditionRange: Tools.object2Json(obj.conditionRange) }) + '' + this.#conditionRange.format({ conditionRange: Tools.object2Json(obj.conditionRange) }) + '' + numberRange.format({ numberRange: Tools.object2Json(obj.numberRange) }) + '' + this.#numberRange.format({ numberRange: Tools.object2Json(obj.numberRange) }) + '
'; - str += `
`; - return str; + return MarkupTableUtil.markupTable('', str, Tools.mergeObject({ maxHeight: 100 }, Processor.FORMAT_TABLE_STYLE)); } return ''; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'scoreCard', label: $t('re.resources.designer.processor.grid.entity.scoreCard'), type: 'w-grid', showIf: (args: any) => { return 'SCORE_CARD' === args.form.getFieldValue('type'); }, + localMode: true, height: 600, dbClickOperation: 'edit', autoFetchData: false, @@ -72,33 +85,29 @@ class ScoreCard extends Processor { extend: 'add', click: undefined, }, - conditionRange.getToolbarAction({}), - numberRange.getToolbarAction({}), + this.#conditionRange.getToolbarAction({}), + this.#numberRange.getToolbarAction({}), ], 'clone', 'edit', - { - extend: 'remove', - click: (args: any) => { - const grid = args.grid.getEditorForm().getFieldComponent('scoreCard'); - grid.removeLocalData(args.selecteds); - }, - }, + 'remove', ], - primaryKey: 'uuid', columns: [ - { width: 200, name: 'uuid', label: 'uuid', hidden: true }, { width: 120, name: 'code', label: $t('code'), sortable: false, + hidden: true, }, { width: 120, name: 'name', label: $t('name'), sortable: false, + format: (value: any, row: any) => { + return this.getParameterNameByCode(row.code); + }, }, { width: 80, @@ -120,15 +129,16 @@ class ScoreCard extends Processor { name: 'content', label: $t('content'), sortable: false, + title: () => {}, format: (value, row: any) => { - const data = JSON.parse(JSON.stringify(row)); + const data = Tools.deepClone(row); data.conditionRange = Tools.object2Json(data.conditionRange); data.numberRange = Tools.object2Json(data.numberRange); switch (data.type) { case 'CONDITION_RANGE': - return conditionRange.format(data); + return this.#conditionRange.format(data); case 'NUMBER_RANGE': - return numberRange.format(data); + return this.#numberRange.format(data); } return ''; }, @@ -139,91 +149,100 @@ class ScoreCard extends Processor { width: '800px', }, form: { - colsNum: 5, + colsNum: 7, fields: [ - { name: 'uuid', label: 'uuid', showIf: false, colSpan: 4 }, - { colSpan: 3, name: 'name', label: $t('name'), type: 'w-select', options: parameterOptionsRef.value }, - { colSpan: 2, name: 'weight', label: $t('weight'), type: 'w-number', precision: 6 }, + { 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 }, - ...conditionRange.getEditorFields(), - ...numberRange.getEditorFields(), + ...this.#conditionRange.getEditorFields(), + ...this.#numberRange.getEditorFields(), ], }, }, // 评分卡变量对话框 onBeforeEditorDataSubmit: (args: any) => { + const newArgs: any = {}; + newArgs.grid = args.grid; + newArgs.callback = args.callback; + newArgs.data = Tools.deepClone(args.data); + switch (args.data.type) { case 'CONDITION_RANGE': - // args.data.conditionRange = Tools.object2Json(args.data.conditionRange); - return conditionRange.beforeEditorDataSubmit(data); + newArgs.data.conditionRange = Tools.object2Json(newArgs.data.conditionRange); + this.#conditionRange.beforeEditorDataSubmit(newArgs); + args.data.conditionRange = Tools.json2Object(newArgs.data.conditionRange); + break; case 'NUMBER_RANGE': - //args.data.numberRange = Tools.object2Json(args.data.numberRange); - return numberRange.beforeEditorDataSubmit(data); + newArgs.data.numberRange = Tools.object2Json(newArgs.data.numberRange); + this.#numberRange.beforeEditorDataSubmit(newArgs); + args.data.numberRange = Tools.json2Object(newArgs.data.numberRange); + break; } + this.#scoreCard = args.grid.getRows(); + //args.grid.setLocalData(this.#scoreCard); }, onAfterEditorOpen: (args: any) => { - // const args: any = {}; - // args.grid = _args.grid; - // args.data = Tools.deepClone(toValue(_args.data)); - // args.data.conditionRange = Tools.object2Json(args.data.conditionRange); - // args.data.numberRange = Tools.object2Json(args.data.numberRange); - - // const data = Tools.deepClone(toValue(args.data)); - // data.conditionRange = Tools.object2Json(data.conditionRange); - // data.numberRange = Tools.object2Json(data.numberRange); - // args.data = data; const newArgs: any = {}; newArgs.grid = args.grid; - newArgs.data = { - conditionRange: Tools.object2Json(JSON.parse(JSON.stringify(args.data.conditionRange))), - numberRange: Tools.object2Json(JSON.parse(JSON.stringify(args.data.numberRange))), - }; + newArgs.callback = args.callback; + switch (args.grid.getEditorForm().getStatus()) { + case 'add': + newArgs.data = { + conditionRange: '[]', + numberRange: '[]', + }; + break; + case 'edit': + case 'clone': + newArgs.data = { + conditionRange: Tools.object2Json(Tools.deepClone(args.data.conditionRange)), + numberRange: Tools.object2Json(Tools.deepClone(args.data.numberRange)), + }; + break; + } switch (args.grid.getEditorForm().getFieldValue('type')) { case 'CONDITION_RANGE': - //args.data.conditionRange = Tools.object2Json(JSON.parse(JSON.stringify(args.data.conditionRange))); - return conditionRange.afterEditorOpen(newArgs); + return this.#conditionRange.afterEditorOpen(newArgs); case 'NUMBER_RANGE': - //args.data.numberRange = Tools.object2Json(JSON.parse(JSON.stringify(args.data.numberRange))); - return numberRange.afterEditorOpen(newArgs); + return this.#numberRange.afterEditorOpen(newArgs); } }, }, ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'scoreCard', label: $t('re.resources.designer.processor.grid.entity.scoreCard') }]; } public beforeEditorDataSubmit(args: any): void { - console.log(args); + args.data.scoreCard = Tools.object2Json(this.#scoreCard); } public afterEditorOpen(args: any): void { - varProcessorTypeOptionsRef.value = [ - { label: $t('io.sc.engine.rule.core.enums.ProcessorType.CONDITION_RANGE'), value: 'CONDITION_RANGE' }, - { label: $t('io.sc.engine.rule.core.enums.ProcessorType.NUMBER_RANGE'), value: 'NUMBER_RANGE' }, - ]; + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.#scoreCard = Tools.json2Object(args.data.scoreCard); + const form = args.grid.getEditorForm(); + const scoreCardGrid = form.getFieldComponent('scoreCard'); + switch (args.grid.getEditorForm().getStatus()) { + case 'add': + scoreCardGrid.setLocalData([]); + break; + case 'edit': + case 'clone': + scoreCardGrid.setLocalData(Tools.json2Object(args.data.scoreCard)); + break; + } + } - axios.get(Environment.apiContextPath('/api/re/model/parameter/listParemtersByParameterId/' + args.target.id)).then((response) => { - const data: any[] = response.data; - const options: any[] = []; - if (data && data.length > 0) { - data.forEach((item) => { - options.push({ - label: item.name, - value: item.code, - }); - }); + private getParameterNameByCode(code: string): string { + for (const option of this.#parameterOptionsRef.value) { + if (option.value === code) { + return option.label; } - parameterOptionsRef.value = options; - }); - - const grid = args.grid.getEditorForm().getFieldComponent('scoreCard'); - const row = args.data; - const rows = Tools.json2Object(row.scoreCard); - grid.setLocalData(rows); + } + return code; } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts index 30a622a0..22dc81d5 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/SingleRule.ts @@ -2,14 +2,17 @@ import { $t } from 'platform-core'; import { Processor } from '../Processor'; class SingleRule extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'singleRule', label: $t('io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE'), icon: 'bi-noise-reduction', enableIf: (args: any) => { - return target.type === 'RULE_RESULT' || target.type === 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'SINGLE_RULE'); @@ -21,17 +24,19 @@ class SingleRule extends Processor { return row.singleRule; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return []; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [{ name: 'singleRule', label: $t('re.resources.designer.processor.grid.entity.singleRule') }]; } public beforeEditorDataSubmit(args: any): void {} - public afterEditorOpen(args: any): void {} + public afterEditorOpen(args: any): void { + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + } } export { SingleRule }; diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts index e7b98af3..4632fa93 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Sql.ts @@ -3,19 +3,22 @@ import { axios, Environment, $t, Tools } from 'platform-core'; import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; -const dsOptionsRef = ref([]); -const parameterOptionsRef = ref([]); -const sqlQueryResultFieldsRef = ref([]); - class Sql extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 1280; + #dsOptionsRef = ref([]); + #parameterOptionsRef = ref([]); + #sqlQueryResultFieldsRef = ref([]); + #editorForm: any; + + public getToolbarAction(): any { return { extend: 'add', name: 'sql', label: $t('io.sc.engine.rule.core.enums.ProcessorType.SQL'), icon: 'bi-filetype-sql', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'SQL'); @@ -36,22 +39,22 @@ class Sql extends Processor { }; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'sqlDatasourceName', label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName'), type: 'w-select', clearable: true, - options: dsOptionsRef, + options: this.#dsOptionsRef, rows: 1, showIf: (args: any) => { return 'SQL' === args.form.getFieldValue('type'); }, }, { - colSpan: 3, + colSpan: 4, name: 'sql', label: $t('re.resources.designer.processor.grid.entity.sql'), type: 'w-code-mirror', @@ -65,7 +68,7 @@ class Sql extends Processor { }, }, { - colSpan: 2, + colSpan: 3, name: 'sqlParameterValues', label: $t('re.resources.designer.processor.grid.entity.sqlParameterValues'), showIf: (args: any) => { @@ -92,7 +95,7 @@ class Sql extends Processor { const array: any[] = sql.match(regex); const rows: any[] = []; array.forEach((item) => { - rows.push({ uuid: Tools.uuid(), name: item, value: '' }); + rows.push({ name: item, value: '' }); }); const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); grid.setLocalData(rows); @@ -120,9 +123,7 @@ class Sql extends Processor { }, ], ], - primaryKey: 'uuid', columns: [ - { name: 'uuid', label: 'uuid', hidden: true }, { width: '50%', name: 'name', @@ -147,7 +148,6 @@ class Sql extends Processor { form: { colsNum: 1, fields: [ - { name: 'uuid', label: 'uuid', showIf: false }, { name: 'name', label: $t('name'), @@ -170,7 +170,6 @@ class Sql extends Processor { const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); const form = grid.getEditorForm(); if ('add' == form.getStatus() || 'clone' == form.getStatus()) { - args.data.uuid = Tools.uuid(); grid.addLocalData(args.data); args.callback(false); } else if ('edit' == form.getStatus()) { @@ -180,7 +179,7 @@ class Sql extends Processor { }, }, { - colSpan: 3, + colSpan: 4, name: 'sqlQueryResult', label: $t('re.resources.designer.processor.grid.entity.sqlQueryResult'), showIf: (args: any) => { @@ -202,8 +201,8 @@ class Sql extends Processor { label: $t('execute'), icon: 'bi-caret-right', click: (args: any) => { - const sql = args.grid.getEditorForm().getFieldValue('sql'); - const grid = args.grid.getEditorForm().getFieldComponent('sqlParameterValues'); + 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'), { @@ -217,19 +216,19 @@ class Sql extends Processor { field.label = field.name; }); const data = response.data.data; - const grid = args.grid.getEditorForm().getFieldComponent('sqlQueryResult'); - sqlQueryResultFieldsRef.value = fieldMetaDatas; + const grid = this.#editorForm.getFieldComponent('sqlQueryResult'); + this.#sqlQueryResultFieldsRef.value = fieldMetaDatas; grid.setLocalData(data); }); }, }, ], columns: computed(() => { - return sqlQueryResultFieldsRef.value; + return this.#sqlQueryResultFieldsRef.value; }), }, { - colSpan: 2, + colSpan: 3, name: 'sqlFieldMapping', label: $t('re.resources.designer.processor.grid.entity.sqlFieldMapping'), showIf: (args: any) => { @@ -268,9 +267,7 @@ class Sql extends Processor { }, ], ], - primaryKey: 'uuid', columns: [ - { name: 'uuid', label: 'uuid', hidden: true }, { width: '50%', name: 'parameter', @@ -295,18 +292,17 @@ class Sql extends Processor { form: { colsNum: 1, fields: [ - { name: 'uuid', label: 'uuid', showIf: false }, { name: 'parameter', label: $t('parameterName'), type: 'w-select', - options: parameterOptionsRef.value, + options: this.#parameterOptionsRef.value, }, { name: 'field', label: $t('fieldName'), type: 'w-select', - options: sqlQueryResultFieldsRef.value, + options: this.#sqlQueryResultFieldsRef.value, }, ], }, @@ -315,7 +311,6 @@ class Sql extends Processor { const grid = args.grid.getEditorForm().getFieldComponent('sqlFieldMapping'); const form = grid.getEditorForm(); if ('add' == form.getStatus() || 'clone' == form.getStatus()) { - args.data.uuid = Tools.uuid(); grid.addLocalData(args.data); args.callback(false); } else if ('edit' == form.getStatus()) { @@ -327,7 +322,7 @@ class Sql extends Processor { ]; } - public getViewerFields(context?: any): any { + 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') }, @@ -337,24 +332,12 @@ class Sql extends Processor { } public beforeEditorDataSubmit(args: any): void { - axios.get(Environment.apiContextPath('/api/system/datasource')).then((response) => { - const items: any[] = response.data?.content; - if (items) { - const options: any[] = []; - items.forEach((item) => { - options.push({ label: item.name, value: item.name }); - }); - dsOptionsRef.value = options; - } - }); - const form = args.grid.getEditorForm(); const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); const sqlParameterValuesLocalData: any[] = sqlParameterValuesGrid.getRows(); const sqlParameterValues: any[] = []; sqlParameterValuesLocalData.forEach((item) => { sqlParameterValues.push({ - uuid: item.uuid, name: item.name, value: item.value, }); @@ -363,43 +346,30 @@ class Sql extends Processor { const sqlFieldMappingGrid = form.getFieldComponent('sqlFieldMapping'); const sqlFieldMappingLocalData: any[] = sqlFieldMappingGrid.getRows(); - const sqlFieldMapping: any[] = []; - sqlFieldMappingLocalData.forEach((item) => { - sqlFieldMapping.push({ - uuid: item.uuid, - field: item.field, - parameter: item.parameter, - }); - }); + const sqlFieldMapping: any[] = Tools.objects2Objects(sqlFieldMappingLocalData, { field: 'field', parameter: 'parameter' }); args.data.sqlFieldMapping = Tools.object2Json(sqlFieldMapping); } public afterEditorOpen(args: any): void { - args.editorDialogWidthRef.value = '80%'; - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); + this.#editorForm = args.grid.getEditorForm(); const form = args.grid.getEditorForm(); const row = args.data; axios.get(Environment.apiContextPath('/api/system/datasource')).then((response) => { - const items: any[] = response.data?.content; - if (items) { - const options: any[] = []; - items.forEach((item) => { - options.push({ label: item.name, value: item.name }); - }); - dsOptionsRef.value = options; - } + this.#dsOptionsRef.value = Tools.objects2Options(response.data?.content, 'name', 'name'); }); - axios.get(Environment.apiContextPath('api/re/model/parameter/findParametersByParameterId?parameterId=' + args.parameter.id)).then((response) => { - const options: any[] = []; - const data: any[] = response.data; - data.forEach((parameter) => { - options.push({ label: parameter.name, value: '${' + parameter.name + '}' }); + 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 + '}'; + }, }); - parameterOptionsRef.value = options; }); const sqlParameterValuesGrid = form.getFieldComponent('sqlParameterValues'); diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts index 2ddaa207..137042d3 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/Ternary.ts @@ -3,14 +3,17 @@ import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; class Ternary extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'ternary', label: $t('io.sc.engine.rule.core.enums.ProcessorType.TERNARY'), icon: 'bi-question', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'TERNARY'); @@ -28,10 +31,10 @@ class Ternary extends Processor { ); } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'ternaryCondition', label: $t('re.resources.designer.processor.grid.entity.ternaryCondition'), type: 'w-code-mirror', @@ -47,7 +50,7 @@ class Ternary extends Processor { }, }, { - colSpan: 5, + colSpan: 7, name: 'ternaryTrue', label: $t('re.resources.designer.processor.grid.entity.ternaryTrue'), type: 'w-code-mirror', @@ -63,7 +66,7 @@ class Ternary extends Processor { }, }, { - colSpan: 5, + colSpan: 7, name: 'ternaryFalse', label: $t('re.resources.designer.processor.grid.entity.ternaryFalse'), type: 'w-code-mirror', @@ -81,7 +84,7 @@ class Ternary extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [ { name: 'ternaryCondition', label: $t('re.resources.designer.processor.grid.entity.ternaryCondition') }, { name: 'ternaryTrue', label: $t('re.resources.designer.processor.grid.entity.ternaryTrue') }, @@ -92,8 +95,9 @@ class Ternary extends Processor { public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts index e2b56b3f..374c29a1 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/WhenThen.ts @@ -3,14 +3,17 @@ import { Processor } from '../Processor'; import { PlaceHolder } from '@/utils/PlaceHolder'; class WhenThen extends Processor { - public getToolbarAction(target: any): any { + #editorDialogWidth: number = 800; + + public getToolbarAction(): any { return { extend: 'add', name: 'whenThen', label: $t('io.sc.engine.rule.core.enums.ProcessorType.WHEN_THEN'), icon: 'bi-sliders', enableIf: (args: any) => { - return target.type !== 'RULE_RESULT' && target.type !== 'SINGLE_RULE_RESULT'; + const type = this.context.target.type; + return type !== 'RULE_RESULT' && type !== 'SINGLE_RULE_RESULT'; }, afterClick: (args: any) => { args.grid.getEditorForm().setFieldValue('type', 'WHEN_THEN'); @@ -32,10 +35,10 @@ class WhenThen extends Processor { return str; } - public getEditorFields(context?: any): any { + public getEditorFields(): any { return [ { - colSpan: 5, + colSpan: 7, name: 'when', label: $t('re.resources.designer.processor.grid.entity.when'), type: 'w-code-mirror', @@ -51,7 +54,7 @@ class WhenThen extends Processor { }, }, { - colSpan: 5, + colSpan: 7, name: 'then', label: $t('re.resources.designer.processor.grid.entity.then'), type: 'w-code-mirror', @@ -67,7 +70,7 @@ class WhenThen extends Processor { }, }, { - colSpan: 5, + colSpan: 7, name: 'isWhenThenShorted', label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted'), type: 'w-checkbox', @@ -78,7 +81,7 @@ class WhenThen extends Processor { ]; } - public getViewerFields(context?: any): any { + public getViewerFields(): any { return [ { name: 'when', label: $t('re.resources.designer.processor.grid.entity.when') }, { name: 'then', label: $t('re.resources.designer.processor.grid.entity.then') }, @@ -89,8 +92,9 @@ class WhenThen extends Processor { public beforeEditorDataSubmit(args: any): void {} public afterEditorOpen(args: any): void { - this.initAutoCompletionManager(args); - this.initUserDefinedFunctionsManager(args); + args.grid.getEditorDialog().setWidth(this.#editorDialogWidth); + this.initAutoCompletionManager(); + this.initUserDefinedFunctionsManager(); } } diff --git a/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts b/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts index 9ea99220..b8a0c8ff 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts +++ b/io.sc.engine.rule.frontend/src/views/shared/processors/index.ts @@ -5,6 +5,7 @@ export { DecisionTable2C } from './DecisionTable2C'; export { DecisionTree } from './DecisionTree'; export { ExecutionFlow } from './ExecutionFlow'; export { GroovyScript } from './GroovyScript'; +export { HttpRequest } from './HttpRequest'; export { MathFormula } from './MathFormula'; export { NumberRange } from './NumberRange'; export { ObjectProperties } from './ObjectProperties'; diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java index 647b8a7f..0a02b5a1 100644 --- a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ScoreCardParameterProcessorEntity.java @@ -64,7 +64,7 @@ public class ScoreCardParameterProcessorEntity extends ParameterProcessorEntity } if(scoreCardItems!=null && !scoreCardItems.isEmpty()){ for(ScoreCardItem scoreCardItem : scoreCardItems){ - scoreCardItem.setName(ExpressionReplacer.replace(scoreCardItem.getCode(), mapping)); + //scoreCardItem.setName(ExpressionReplacer.replace(scoreCardItem.getCode(), mapping)); List conditionRanges =scoreCardItem.getConditionRange(); if(conditionRanges!=null && !conditionRanges.isEmpty()){ for(ConditionRange conditionRange : conditionRanges){ diff --git a/io.sc.engine.st.frontend/.eslintrc.cjs b/io.sc.engine.st.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.engine.st.frontend/.eslintrc.cjs +++ b/io.sc.engine.st.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.engine.st.frontend/package.json b/io.sc.engine.st.frontend/package.json index cf81def7..9b635e8d 100644 --- a/io.sc.engine.st.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.core.frontend/.eslintrc.cjs b/io.sc.platform.core.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.core.frontend/.eslintrc.cjs +++ b/io.sc.platform.core.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index b0e065a8..bb267463 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.421", + "version": "8.1.430", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue b/io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue index 3a27a34f..b81f2d13 100644 --- a/io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue +++ b/io.sc.platform.core.frontend/src/platform/components/code-mirror/WCodeMirror.vue @@ -111,7 +111,7 @@ const props = withDefaults(defineProps(), { toolbar: true, editable: true, lineWrap: false, - tabSize: 4, + tabSize: 2, lineNumber: false, lineBreak: true, placeholder: false, diff --git a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/Toolbar.vue b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/Toolbar.vue index f0bd9379..cbc009bb 100644 --- a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/Toolbar.vue +++ b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/Toolbar.vue @@ -53,16 +53,6 @@ - - - - - - - - - - @@ -70,7 +60,7 @@ - + @@ -83,6 +73,9 @@ + + + @@ -107,7 +100,7 @@ icon-right="arrow_drop_down" > - + + + + {{ $t('math.toolbar.functions.log') }} + + + + + + + + + + + + + + + + + + + + diff --git a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Lg.vue b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Lg.vue similarity index 69% rename from io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Lg.vue rename to io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Lg.vue index c179bb11..e4f6f4fd 100644 --- a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Lg.vue +++ b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Lg.vue @@ -1,16 +1,14 @@ diff --git a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Ln.vue b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Ln.vue similarity index 71% rename from io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Ln.vue rename to io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Ln.vue index e9743b27..f5193da4 100644 --- a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Ln.vue +++ b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Ln.vue @@ -1,12 +1,10 @@ diff --git a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Log.vue b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Log.vue similarity index 73% rename from io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Log.vue rename to io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Log.vue index a579c972..777db597 100644 --- a/io.sc.platform.core.frontend/src/platform/components/math/toolbar/math/Log.vue +++ b/io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/log/Log.vue @@ -1,15 +1,13 @@ diff --git a/io.sc.platform.core.frontend/src/platform/css/q-markup-table.css b/io.sc.platform.core.frontend/src/platform/css/q-markup-table.css new file mode 100644 index 00000000..33e2356a --- /dev/null +++ b/io.sc.platform.core.frontend/src/platform/css/q-markup-table.css @@ -0,0 +1,6 @@ +.q-markup-table.q-table--horizontal-separator thead tr:last-child > th, +.q-markup-table.q-table--horizontal-separator tbody tr:last-child > td, +.q-markup-table.q-table--cell-separator thead tr:last-child > th, +.q-markup-table.q-table--cell-separator tbody tr:last-child > td { + border-bottom-width: 0px !important; +} diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages.json b/io.sc.platform.core.frontend/src/platform/i18n/messages.json index b77270c7..64d9f317 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages.json @@ -142,7 +142,6 @@ "action.export": "Export", "action.export.failed": "Export Failed", "action.submit": "Submit", - "action.confirm": "Confirm", "action.expandAll": "Expand All", "action.collapseAll": "Collapse All", @@ -187,9 +186,6 @@ "math.toolbar.math.exp": "e raised to the power of x", "math.toolbar.math.sqrt": "square root of x", "math.toolbar.math.root": "y root of x", - "math.toolbar.math.lg": "base 10 logarithm of x", - "math.toolbar.math.ln": "base e logarithm of x", - "math.toolbar.math.log": "base y logarithm of x", "math.toolbar.math.pi": "PI", "math.toolbar.math.e": "E", @@ -226,6 +222,10 @@ "math.toolbar.functions.string.endsWith": "x end with y", "math.toolbar.functions.date": "Date", "math.toolbar.functions.date.now": "Now", + "math.toolbar.functions.date.log": "Logarithm", + "math.toolbar.functions.date.log.lg": "base 10 logarithm of x", + "math.toolbar.functions.date.log.ln": "base e logarithm of x", + "math.toolbar.functions.date.log.log": "base y logarithm of x", "math.toolbar.functions.trigonometric": "Trigonometric", "math.toolbar.functions.trigonometric.degrees": "degrees of x", "math.toolbar.functions.trigonometric.radians": "radians of x", diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json index 98666918..b9e5b767 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json @@ -142,7 +142,6 @@ "action.export": "導出", "action.export.failed": "導出失敗", "action.submit": "提交", - "action.confirm": "确定", "action.expandAll": "全部展开", "action.collapseAll": "全部收起", @@ -181,15 +180,12 @@ "math.toolbar.base.comma": ",", - "math.toolbar.math": "數學符號", + "math.toolbar.math": "符號", "math.toolbar.math.power": "x 的 y 次方", "math.toolbar.math.power2": "x 的平方", "math.toolbar.math.exp": "自然對數 e 的 x 次方", "math.toolbar.math.sqrt": "x 的開平方", "math.toolbar.math.root": "x 開 y 次方", - "math.toolbar.math.lg": "以 10 為底的對數", - "math.toolbar.math.ln": "以自然對數 e 為底的對數", - "math.toolbar.math.log": "以 y 為底的對數", "math.toolbar.math.pi": "圓周率", "math.toolbar.math.e": "自然對數", @@ -226,6 +222,10 @@ "math.toolbar.functions.string.endsWith": "x 是否以 y 結尾", "math.toolbar.functions.date": "日期函數", "math.toolbar.functions.date.now": "當前日期", + "math.toolbar.functions.log": "對數", + "math.toolbar.functions.log.lg": "以 10 為底的對數", + "math.toolbar.functions.log.ln": "以自然對數 e 為底的對數", + "math.toolbar.functions.log.log": "以 y 為底的對數", "math.toolbar.functions.trigonometric": "三角函數", "math.toolbar.functions.trigonometric.degrees": "x 的角度值", "math.toolbar.functions.trigonometric.radians": "x 的弧度值", diff --git a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json index a1574405..96a44567 100644 --- a/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json +++ b/io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json @@ -142,7 +142,6 @@ "action.export": "导出", "action.export.failed": "导出失败", "action.submit": "提交", - "action.confirm": "确定", "action.expandAll": "全部展开", "action.collapseAll": "全部收起", @@ -181,15 +180,12 @@ "math.toolbar.base.comma": ",", - "math.toolbar.math": "数学符号", + "math.toolbar.math": "符号", "math.toolbar.math.power": "x 的 y 次方", "math.toolbar.math.power2": "x 的平方", "math.toolbar.math.exp": "自然对数 e 的 x 次方", "math.toolbar.math.sqrt": "x 的开平方", "math.toolbar.math.root": "x 开 y 次方", - "math.toolbar.math.lg": "以 10 为底的对数", - "math.toolbar.math.ln": "以自然对数 e 为底的对数", - "math.toolbar.math.log": "以 y 为底的对数", "math.toolbar.math.pi": "圆周率", "math.toolbar.math.e": "自然常数", @@ -226,6 +222,10 @@ "math.toolbar.functions.string.endsWith": "x 是否以 y 结尾", "math.toolbar.functions.date": "日期函数", "math.toolbar.functions.date.now": "当前日期", + "math.toolbar.functions.log": "对数函数", + "math.toolbar.functions.log.lg": "以 10 为底的对数", + "math.toolbar.functions.log.ln": "以自然对数 e 为底的对数", + "math.toolbar.functions.log.log": "以 y 为底的对数", "math.toolbar.functions.trigonometric": "三角函数", "math.toolbar.functions.trigonometric.degrees": "x 的角度值", "math.toolbar.functions.trigonometric.radians": "x 的弧度值", diff --git a/io.sc.platform.core.frontend/src/platform/index.ts b/io.sc.platform.core.frontend/src/platform/index.ts index 5e7994d3..3a60941e 100644 --- a/io.sc.platform.core.frontend/src/platform/index.ts +++ b/io.sc.platform.core.frontend/src/platform/index.ts @@ -116,6 +116,7 @@ export { KeyCode } from './utils'; export { Tools } from './utils'; export { TreeBuilder } from './utils'; export { UndoManager } from './utils'; +export { UnitOfMeasure } from './utils'; export { VueTools } from './utils'; /** diff --git a/io.sc.platform.core.frontend/src/platform/utils-components/MarkupTableUtil.ts b/io.sc.platform.core.frontend/src/platform/utils-components/MarkupTableUtil.ts index 9e30a7d0..c67e026f 100644 --- a/io.sc.platform.core.frontend/src/platform/utils-components/MarkupTableUtil.ts +++ b/io.sc.platform.core.frontend/src/platform/utils-components/MarkupTableUtil.ts @@ -1,4 +1,5 @@ -import { Tools } from '@/platform'; +import { Tools, UnitOfMeasure } from '@/platform'; +import '@/platform/css/q-markup-table.css'; class MarkupTableUtil { public static sample(props: any): string { @@ -23,32 +24,32 @@ class MarkupTableUtil { public static markupTable(tableHeader: string, tableBody: string, props: any): string { props = props || {}; - props['separator'] = !Tools.isUndefinedOrNull(props['separator']) ? props['separator'] : 'cell'; - props['wrap-cells'] = !Tools.isUndefinedOrNull(props['wrap-cells']) ? props['wrap-cells'] : true; - props['dense'] = !Tools.isUndefinedOrNull(props['dense']) ? props['dense'] : false; - props['dark'] = !Tools.isUndefinedOrNull(props['dark']) ? props['dark'] : false; - props['flat'] = !Tools.isUndefinedOrNull(props['flat']) ? props['flat'] : true; - props['bordered'] = !Tools.isUndefinedOrNull(props['bordered']) ? props['bordered'] : true; - props['square'] = !Tools.isUndefinedOrNull(props['square']) ? props['square'] : false; + props['separator'] = Tools.initialize(props['separator'], 'cell'); + props['wrap-cells'] = Tools.initialize(props['wrap-cells'], true); + props['dense'] = Tools.initialize(props['dense'], false); + props['dark'] = Tools.initialize(props['dark'], false); + props['flat'] = Tools.initialize(props['flat'], true); + props['bordered'] = Tools.initialize(props['bordered'], true); + props['square'] = Tools.initialize(props['square'], false); let tableContainerStyle = ''; - if (!Tools.isUndefinedOrNull(props['width'])) { - tableContainerStyle += 'width:' + props['width'] + ';'; + if (!Tools.isNill(props['width'])) { + tableContainerStyle += 'width:' + UnitOfMeasure.width(props['width']) + ';'; } if (!Tools.isUndefinedOrNull(props['height'])) { - tableContainerStyle += 'height:' + props['height'] + ';'; + tableContainerStyle += 'height:' + UnitOfMeasure.height(props['height']) + ';'; } if (!Tools.isUndefinedOrNull(props['maxWidth'])) { - tableContainerStyle += 'max-width:' + props['maxWidth'] + ';'; + tableContainerStyle += 'max-width:' + UnitOfMeasure.width(props['maxWidth']) + ';'; } if (!Tools.isUndefinedOrNull(props['maxHeight'])) { - tableContainerStyle += 'max-height:' + props['maxHeight'] + ';'; + tableContainerStyle += 'max-height:' + UnitOfMeasure.height(props['maxHeight']) + ';'; } if (!Tools.isUndefinedOrNull(props['max-width'])) { - tableContainerStyle += 'max-width:' + props['max-width'] + ';'; + tableContainerStyle += 'max-width:' + UnitOfMeasure.width(props['max-width']) + ';'; } if (!Tools.isUndefinedOrNull(props['max-height'])) { - tableContainerStyle += 'max-height:' + props['max-height'] + ';'; + tableContainerStyle += 'max-height:' + UnitOfMeasure.height(props['max-height']) + ';'; } let html = ''; diff --git a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts index 58a7814a..b2785425 100644 --- a/io.sc.platform.core.frontend/src/platform/utils/Tools.ts +++ b/io.sc.platform.core.frontend/src/platform/utils/Tools.ts @@ -1,6 +1,16 @@ import xmlFormat from 'xml-formatter'; class Tools { + /** + * 初始化值 + * @param value 值 + * @param defaultValue 默认值 + * @returns 如果值不为空返回值,如果为空返回默认值 + */ + public static initialize(value: any, defaultValue: any): any { + return value === null || typeof value === 'undefined' ? defaultValue : value; + } + /** * 判断两个字符串是否相同 * undefined === undeinfed === null === '' @@ -30,6 +40,16 @@ class Tools { return obj === null || typeof obj === 'undefined'; } + /** + * 判断一个对象是否为 null 或者 undefined + * 同 isUndefinedOrNull + * @param obj 对象 + * @returns 对象是否为 null 或者 undefined + */ + public static isNill(obj: any): boolean { + return obj === null || typeof obj === 'undefined'; + } + /** * 判断一个对象是否为 null 或者 undefined 或者空字符串 * @param obj 对象 @@ -75,6 +95,15 @@ class Tools { return !Tools.isEmpty(obj) && Array.isArray(obj); } + /** + * 判断一个对象是否是函数 + * @param obj 对象 + * @returns 对象是否是函数 + */ + public static isFunction(obj: any): boolean { + return typeof obj === 'function'; + } + /** * 判断给定的日期是否是当前日期 * @param date 日期 @@ -425,66 +454,10 @@ class Tools { * @returns 克隆后的对象 */ public static deepClone(target: any): any { - const map = new WeakMap(); - - function isObject(target: any) { - return (typeof target === 'object' && target) || typeof target === 'function'; - } - - function clone(data: any) { - if (!isObject(data)) { - return data; - } - if ([Date, RegExp].includes(data.constructor)) { - return new data.constructor(data); - } - if (typeof data === 'function') { - return new Function('return ' + data.toString())(); - } - const exist = map.get(data); - if (exist) { - return exist; - } - if (data instanceof Map) { - const result = new Map(); - map.set(data, result); - data.forEach((val, key) => { - if (isObject(val)) { - result.set(key, clone(val)); - } else { - result.set(key, val); - } - }); - return result; - } - if (data instanceof Set) { - const result = new Set(); - map.set(data, result); - data.forEach((val) => { - if (isObject(val)) { - result.add(clone(val)); - } else { - result.add(val); - } - }); - return result; - } - const keys = Reflect.ownKeys(data); - const allDesc = Object.getOwnPropertyDescriptors(data); - const result = Object.create(Object.getPrototypeOf(data), allDesc); - map.set(data, result); - keys.forEach((key) => { - const val = data[key]; - if (isObject(val)) { - result[key] = clone(val); - } else { - result[key] = val; - } - }); - return result; + if (Tools.isNill(target)) { + return null; } - - return clone(target); + return JSON.parse(JSON.stringify(target)); } /** @@ -976,7 +949,7 @@ class Tools { } } - public static extractAllPropertyNames(objects: any[], propertyNamePattern) { + public static extractAllPropertyNames(objects: any[], propertyNamePattern: any) { if (objects && Tools.isArray(objects)) { //必须是数组 const allPropertyNames = []; @@ -985,7 +958,7 @@ class Tools { const object = objects[i]; if (Tools.isObject(object)) { //数组元素必须是对象 - const propertyNames = Object.keys(object); //获取所有对象的属性 + const propertyNames: string[] = Object.keys(object); //获取所有对象的属性 for (let j = 0; j < propertyNames.length; j++) { if (propertyNamePattern) { if (propertyNamePattern.test(propertyNames[j])) { @@ -1007,6 +980,46 @@ class Tools { } return []; } + + /** + * 将对象数组转换成选项数组 + * @param objects 对象数据 + * @param label 选项, 可以是对象的属性名,也可以是一个函数,函数接收一个对象参数 + * @param value 值, 可以是对象的属性名,也可以是一个函数,函数接收一个对象参数 + * @returns 选项数组 + */ + public static objects2Options(objects: object[], labelPropertyName: string, valuePropertyName: string): any[] { + return Tools.objects2Objects(objects, { label: labelPropertyName, value: valuePropertyName }); + } + + /** + * 对象数组转对象数组 + * @param objects 对象数组 + * @param mapping 转换逻辑配置 + * { + * label:'label', // 返回的对象的 label 属性的值为转换前对象的 label 属性 + * value: (obj) => {return obj.value; } //返回的对象的 value 属性的值为一个函数 + * } + * @returns 对象数组 + */ + public static objects2Objects(objects: object[], mapping: object): any[] { + const result: any[] = []; + if (objects && Tools.isArray(objects) && objects.length > 0 && !Tools.isNill(mapping)) { + objects.forEach((obj) => { + const item = {}; + for (const propertyName in mapping) { + const property = mapping[propertyName]; + if (Tools.isString(property)) { + item[propertyName] = obj[property]; + } else if (Tools.isFunction(property)) { + item[propertyName] = property(obj); + } + } + result.push(item); + }); + } + return result; + } } export { Tools }; diff --git a/io.sc.platform.core.frontend/src/platform/utils/UnitOfMeasure.ts b/io.sc.platform.core.frontend/src/platform/utils/UnitOfMeasure.ts new file mode 100644 index 00000000..8011fa50 --- /dev/null +++ b/io.sc.platform.core.frontend/src/platform/utils/UnitOfMeasure.ts @@ -0,0 +1,33 @@ +import { Tools } from './Tools'; + +/** + * 度量单位 + */ +class UnitOfMeasure { + /** + * 宽度 + * @param width 宽度(纯数字或带单位的数字,示例: 100, '50%', '100px') + * @returns 宽度 + */ + public static width(width: number | string): string { + return UnitOfMeasure.distance(width); + } + + /** + * 高度 + * @param width 高度(纯数字或带单位的数字,示例: 100, '50%', '100px') + * @returns 高度 + */ + public static height(height: number | string): string { + return UnitOfMeasure.distance(height); + } + + private static distance(width: number | string): string { + if (Tools.isNumber(width)) { + return width + 'px'; + } + return width as string; + } +} + +export { UnitOfMeasure }; diff --git a/io.sc.platform.core.frontend/src/platform/utils/index.ts b/io.sc.platform.core.frontend/src/platform/utils/index.ts index 35ab2c6b..8f1a9038 100644 --- a/io.sc.platform.core.frontend/src/platform/utils/index.ts +++ b/io.sc.platform.core.frontend/src/platform/utils/index.ts @@ -9,4 +9,5 @@ export { QuasarTools } from './QuasarTools'; export { Tools } from './Tools'; export { TreeBuilder } from './TreeBuilder'; export { UndoManager } from './UndoManager'; +export { UnitOfMeasure } from './UnitOfMeasure'; export { VueTools } from './VueTools'; diff --git a/io.sc.platform.core.frontend/src/views/testcase/math/MathEditor.vue b/io.sc.platform.core.frontend/src/views/testcase/math/MathEditor.vue index 3bf33819..4c1ffa3d 100644 --- a/io.sc.platform.core.frontend/src/views/testcase/math/MathEditor.vue +++ b/io.sc.platform.core.frontend/src/views/testcase/math/MathEditor.vue @@ -2,14 +2,69 @@

-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
H1H2
D1D2
D1D2
D1D2
D1D2
+

我是一个段落。

+

我非常非常喜欢!

+
我不是一个段落。
+

+
+ 11111 +
+
+
+ 2222 +
+
4444
+
+

+ diff --git a/io.sc.platform.core.frontend/template-project/.eslintrc.cjs b/io.sc.platform.core.frontend/template-project/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.core.frontend/template-project/.eslintrc.cjs +++ b/io.sc.platform.core.frontend/template-project/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 823c80c3..8983c7f7 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.421", + "version": "8.1.430", "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.421", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "vue": "3.5.10", diff --git a/io.sc.platform.core.frontend/template-project/src/views/testcase/math/MathEditor.vue b/io.sc.platform.core.frontend/template-project/src/views/testcase/math/MathEditor.vue index 3bf33819..4c1ffa3d 100644 --- a/io.sc.platform.core.frontend/template-project/src/views/testcase/math/MathEditor.vue +++ b/io.sc.platform.core.frontend/template-project/src/views/testcase/math/MathEditor.vue @@ -2,14 +2,69 @@

-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
H1H2
D1D2
D1D2
D1D2
D1D2
+

我是一个段落。

+

我非常非常喜欢!

+
我不是一个段落。
+

+
+ 11111 +
+
+
+ 2222 +
+
4444
+
+

+ diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java index 54268c70..e8b91c71 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/License.java @@ -17,7 +17,8 @@ public class License { private Date startDate; //开始日期 private Date expiredDate; //结束日期 private Integer term; //期限(天数) - private String macAddresses; //mac地址 + private String macAddresses; //mac 地址 + private String serverMacAddresses; //服务器 mac 地址 /** * 获取免费试用许可证 @@ -116,6 +117,14 @@ public class License { this.macAddresses = macAddresses; } + public String getServerMacAddresses() { + return serverMacAddresses; + } + + public void setServerMacAddresses(String serverMacAddresses) { + this.serverMacAddresses = serverMacAddresses; + } + @Override public String toString() { try { @@ -131,6 +140,7 @@ public class License { + " startDate=" + startDate + ",\n" + " expiredDate=" + expiredDate + ",\n" + " macAddresses=" + macAddresses + "\n" + + " serverMacAddresses=" + serverMacAddresses + "\n" + "]"; } } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/service/LicenseManagerService.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/service/LicenseManagerService.java index 4e193037..2a526d21 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/service/LicenseManagerService.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/service/LicenseManagerService.java @@ -3,8 +3,6 @@ package io.sc.platform.core.service; import io.sc.platform.core.License; import io.sc.platform.core.exception.LicenseInvalidatedException; -import java.io.IOException; - public interface LicenseManagerService { public License getLicense(); public void load(); diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/LicenseManagerServiceImpl.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/LicenseManagerServiceImpl.java index 09575d8e..77199650 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/LicenseManagerServiceImpl.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/service/impl/LicenseManagerServiceImpl.java @@ -5,10 +5,7 @@ import io.sc.platform.core.License; import io.sc.platform.core.enums.LicenseStatus; import io.sc.platform.core.exception.LicenseInvalidatedException; import io.sc.platform.core.service.LicenseManagerService; -import io.sc.platform.core.util.FileUtil; -import io.sc.platform.core.util.NetworkUtil; -import io.sc.platform.core.util.ObjectMapper4Json; -import io.sc.platform.core.util.RSAUtil; +import io.sc.platform.core.util.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -46,11 +43,13 @@ public class LicenseManagerServiceImpl implements LicenseManagerService { byte[] encrypted = RSAUtil.decryptByPublicKey(Base64.getMimeDecoder().decode(licenseString), publicKey); String json = new String(encrypted, StandardCharsets.UTF_8); this.license =ObjectMapper4Json.getMapper().readValue(json, License.class); + this.license.setServerMacAddresses(StringUtil.combine(",",NetworkUtil.getMacAddress())); this.license.setStatus(LicenseStatus.OK); verify(this.license); } catch (Exception e) { log.error("", e); this.license =new License(); + this.license.setServerMacAddresses(StringUtil.combine(",",NetworkUtil.getMacAddress())); this.license.setStatus(LicenseStatus.INVALIDATED); } } diff --git a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/NetworkUtil.java b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/NetworkUtil.java index e3c909f1..9d269db2 100644 --- a/io.sc.platform.core/src/main/java/io/sc/platform/core/util/NetworkUtil.java +++ b/io.sc.platform.core/src/main/java/io/sc/platform/core/util/NetworkUtil.java @@ -27,10 +27,6 @@ public class NetworkUtil { result.add(sb.toString()); } } - for (String s : result) { - System.out.println(s); - } - }catch (SocketException e){ log.error("",e); } diff --git a/io.sc.platform.developer.doc/package.json b/io.sc.platform.developer.doc/package.json index 7288d261..a4d6bb1a 100644 --- a/io.sc.platform.developer.doc/package.json +++ b/io.sc.platform.developer.doc/package.json @@ -28,7 +28,7 @@ "vuepress": "2.0.0-rc.15" }, "dependencies": { - "platform-core": "8.1.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "vue": "3.5.10", "vue-i18n": "10.0.3" diff --git a/io.sc.platform.developer.frontend/.eslintrc.cjs b/io.sc.platform.developer.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.developer.frontend/.eslintrc.cjs +++ b/io.sc.platform.developer.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index 27ed8176..50f87ec8 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.lcdp.frontend/.eslintrc.cjs b/io.sc.platform.lcdp.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.lcdp.frontend/.eslintrc.cjs +++ b/io.sc.platform.lcdp.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.lcdp.frontend/package.json b/io.sc.platform.lcdp.frontend/package.json index f7620ecb..631be41f 100644 --- a/io.sc.platform.lcdp.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.license.keygen.frontend/.eslintrc.cjs b/io.sc.platform.license.keygen.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.license.keygen.frontend/.eslintrc.cjs +++ b/io.sc.platform.license.keygen.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.license.keygen.frontend/package.json b/io.sc.platform.license.keygen.frontend/package.json index c1535f06..23de6014 100644 --- a/io.sc.platform.license.keygen.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.license.keygen.frontend/src/i18n/messages.json b/io.sc.platform.license.keygen.frontend/src/i18n/messages.json index db818218..07859bea 100644 --- a/io.sc.platform.license.keygen.frontend/src/i18n/messages.json +++ b/io.sc.platform.license.keygen.frontend/src/i18n/messages.json @@ -11,5 +11,6 @@ "license.keygen.grid.entity.issuedDate": "Issued Date", "license.keygen.grid.entity.startDate": "Start Date", "license.keygen.grid.entity.expiredDate": "Expired Date", - "license.keygen.grid.entity.macAddresses": "Mac Addresses(split by commons)" + "license.keygen.grid.entity.macAddresses": "Mac Addresses(split by commons)", + "license.keygen.grid.entity.macAddressesOnly": "MAC Addresses" } diff --git a/io.sc.platform.license.keygen.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.license.keygen.frontend/src/i18n/messages_tw_CN.json index 7bae3415..0076db27 100644 --- a/io.sc.platform.license.keygen.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.license.keygen.frontend/src/i18n/messages_tw_CN.json @@ -11,5 +11,6 @@ "license.keygen.grid.entity.issuedDate": "許可證發行日期", "license.keygen.grid.entity.startDate": "有效期開始日期", "license.keygen.grid.entity.expiredDate": "有效期結束日期", - "license.keygen.grid.entity.macAddresses": "Mac 地址(多個採用逗號分隔)" + "license.keygen.grid.entity.macAddresses": "Mac 地址(多個採用逗號分隔)", + "license.keygen.grid.entity.macAddressesOnly": "MAC 地址" } diff --git a/io.sc.platform.license.keygen.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.license.keygen.frontend/src/i18n/messages_zh_CN.json index cdc994cc..dd42d22f 100644 --- a/io.sc.platform.license.keygen.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.license.keygen.frontend/src/i18n/messages_zh_CN.json @@ -11,5 +11,6 @@ "license.keygen.grid.entity.issuedDate": "许可证发行日期", "license.keygen.grid.entity.startDate": "有效期开始日期", "license.keygen.grid.entity.expiredDate": "有效期结束日期", - "license.keygen.grid.entity.macAddresses": "Mac 地址(多个采用逗号分隔)" + "license.keygen.grid.entity.macAddresses": "MAC 地址(多个采用逗号分隔)", + "license.keygen.grid.entity.macAddressesOnly": "MAC 地址" } diff --git a/io.sc.platform.license.keygen.frontend/src/views/license/KeyGenerator.vue b/io.sc.platform.license.keygen.frontend/src/views/license/KeyGenerator.vue index b50c3f15..553ba3d8 100644 --- a/io.sc.platform.license.keygen.frontend/src/views/license/KeyGenerator.vue +++ b/io.sc.platform.license.keygen.frontend/src/views/license/KeyGenerator.vue @@ -38,13 +38,33 @@ :columns="[ { width: 150, name: 'productName', label: $t('license.keygen.grid.entity.productName') }, { width: '*', name: 'consumerName', label: $t('license.keygen.grid.entity.consumerName') }, + { + width: 140, + name: 'macAddresses', + label: $t('license.keygen.grid.entity.macAddressesOnly'), + format: (value, row) => { + if (value) { + let str = ''; + const splits: string[] = value.split(','); + splits.forEach((split, index) => { + if (index === splits.length) { + str += split; + } else { + str += split + '
'; + } + }); + return str; + } + return value; + }, + }, { width: 100, name: 'type', label: $t('license.keygen.grid.entity.type'), format: Formater.enum(LicenseTypeEnum), }, - { width: 100, name: 'term', label: $t('license.keygen.grid.entity.term') }, + { width: 80, name: 'term', label: $t('license.keygen.grid.entity.term'), align: 'right' }, { width: 140, name: 'issuedDate', label: $t('license.keygen.grid.entity.issuedDate') }, { width: 140, name: 'startDate', label: $t('license.keygen.grid.entity.startDate') }, { width: 140, name: 'expiredDate', label: $t('license.keygen.grid.entity.expiredDate') }, diff --git a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/controller/LicenseKeyGeneratorWebController.java b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/controller/LicenseKeyGeneratorWebController.java index 43ac1027..55991ae1 100644 --- a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/controller/LicenseKeyGeneratorWebController.java +++ b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/controller/LicenseKeyGeneratorWebController.java @@ -1,39 +1,118 @@ package io.sc.platform.license.keygen.controller; import io.sc.platform.core.License; +import io.sc.platform.core.annotation.AuditLog; import io.sc.platform.core.annotation.IgnoreResponseBodyAdvice; +import io.sc.platform.core.annotation.LicenseVerify; +import io.sc.platform.core.enums.AuditLogAction; +import io.sc.platform.core.response.ValidateException; +import io.sc.platform.core.util.ValidatorUtil; import io.sc.platform.license.keygen.jpa.entity.LicenseEntity; import io.sc.platform.license.keygen.jpa.repository.LicenseRepository; import io.sc.platform.license.keygen.jpa.vo.LicenseVo; import io.sc.platform.license.keygen.service.LicenseKeyGeneratorService; import io.sc.platform.license.keygen.service.LicenseService; import io.sc.platform.mvc.controller.support.RestCrudController; +import io.sc.platform.orm.entity.BaseEntity; +import io.sc.platform.orm.service.support.QueryParameter; +import io.sc.platform.orm.service.support.QueryResult; +import io.sc.platform.orm.service.support.criteria.Criteria; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.ArrayList; import java.util.Date; +import java.util.List; @RestController @RequestMapping("api/license/keygen") -public class LicenseKeyGeneratorWebController extends RestCrudController { +public class LicenseKeyGeneratorWebController { @Autowired private LicenseKeyGeneratorService licenseKeyGeneratorService; + @Autowired private LicenseService licenseService; - @Override - protected LicenseVo add(HttpServletRequest request, HttpServletResponse response, LicenseEntity entity) throws Exception { - format(entity); - return super.add(request,response,entity); + @AuditLog(action= AuditLogAction.ADD) + @PostMapping("") + @ResponseBody + public LicenseVo add(HttpServletRequest request, HttpServletResponse response, @RequestBody @Valid LicenseEntity entity, BindingResult bindingResult) throws Exception{ + ValidateException result = ValidatorUtil.validate(bindingResult); + if(result!=null){ + throw result; + } + LicenseEntity addedEntity =licenseService.add(entity); + if(addedEntity instanceof BaseEntity){ + return ((BaseEntity)addedEntity).toVo(); + } + return null; + } + + @AuditLog(action=AuditLogAction.UPDATE) + @PutMapping("{id}") + @ResponseBody + public LicenseVo update(HttpServletRequest request,HttpServletResponse response,@PathVariable(name="id")String id,@RequestBody @Valid LicenseEntity entity,BindingResult bindingResult) throws Exception{ + ValidateException result =ValidatorUtil.validate(bindingResult); + if(result!=null){ + throw result; + } + LicenseEntity updatedEntity =licenseService.update(id,entity); + if(updatedEntity instanceof BaseEntity){ + return ((BaseEntity)updatedEntity).toVo(); + } + return null; + } + + @AuditLog(action=AuditLogAction.REMOVE) + @DeleteMapping("{id}") + @ResponseBody + public String remove(HttpServletRequest request,HttpServletResponse response,@PathVariable(name="id")String id) throws Exception{ + return licenseService.remove(id); } - @Override - protected LicenseVo update(HttpServletRequest request, HttpServletResponse response, String id, LicenseEntity entity) throws Exception { - format(entity); - return super.update(request, response, id, entity); + @AuditLog(action=AuditLogAction.REMOVE) + @DeleteMapping("") + @ResponseBody + @LicenseVerify + public List removes(HttpServletRequest request, HttpServletResponse response, @RequestBody List ids) throws Exception{ + return licenseService.remove(ids); + } + + @AuditLog(action=AuditLogAction.FIND_ONE) + @GetMapping("{id}") + @ResponseBody + public LicenseVo findById(HttpServletRequest request,HttpServletResponse response,@PathVariable(name="id")String id) throws Exception{ + LicenseEntity foundEntity =licenseService.findById(id); + if(foundEntity instanceof BaseEntity){ + return ((BaseEntity)foundEntity).toVo(); + } + return null; + } + + @AuditLog(action=AuditLogAction.QUERY) + @GetMapping("") + @ResponseBody + public Page _query(HttpServletRequest request, HttpServletResponse response, LicenseEntity entity, QueryParameter queryParameter) throws Exception{ + List criterias =licenseService.buildCriteriaFromEntity(request.getParameterNames(),entity); + if(criterias!=null && !criterias.isEmpty()){ + queryParameter.addCriterias(criterias); + } + Page page =licenseService.query(queryParameter); + if(page==null){ + return QueryResult.emptyPage(); + } + List entities =page.getContent(); + List vos =new ArrayList<>(entities.size()); + for(LicenseEntity e : entities){ + if(e instanceof BaseEntity){ + vos.add(((BaseEntity)e).toVo()); + } + } + return new PageImpl<>(vos,page.getPageable(),page.getTotalElements()); } @GetMapping(value="generateLicenseFile/{id}") diff --git a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java index afc5f79f..e7ea460f 100644 --- a/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java +++ b/io.sc.platform.license.keygen/src/main/java/io/sc/platform/license/keygen/service/impl/LicenseKeyGeneratorServiceImpl.java @@ -16,7 +16,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import java.security.PrivateKey; import java.util.Base64; @Service("io.sc.platform.license.keygen.service.impl.LicenseKeyGeneratorServiceImpl") @@ -37,7 +36,7 @@ public class LicenseKeyGeneratorServiceImpl implements LicenseKeyGeneratorServic license.setStartDate(entity.getStartDate()); license.setExpiredDate(entity.getExpiredDate()); license.setTerm(entity.getTerm()); - license.setMacAddresses(entity.getMacAddresses()); + license.setMacAddresses(entity.getMacAddresses().replace("-",":")); String json =ObjectMapper4Json.getMapper().writeValueAsString(license); String privateKey =RSAUtil.loadPrivateKeyBase64String("classpath:/license.privateKey.txt"); diff --git a/io.sc.platform.mvc.frontend/.eslintrc.cjs b/io.sc.platform.mvc.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.mvc.frontend/.eslintrc.cjs +++ b/io.sc.platform.mvc.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.mvc.frontend/package.json b/io.sc.platform.mvc.frontend/package.json index f66591ba..8805d340 100644 --- a/io.sc.platform.mvc.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.scheduler.manager.frontend/.eslintrc.cjs b/io.sc.platform.scheduler.manager.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.scheduler.manager.frontend/.eslintrc.cjs +++ b/io.sc.platform.scheduler.manager.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.scheduler.manager.frontend/package.json b/io.sc.platform.scheduler.manager.frontend/package.json index 6737e1fa..13749722 100644 --- a/io.sc.platform.scheduler.manager.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.system.frontend/.eslintrc.cjs b/io.sc.platform.system.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.platform.system.frontend/.eslintrc.cjs +++ b/io.sc.platform.system.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.platform.system.frontend/package.json b/io.sc.platform.system.frontend/package.json index ec541863..1e609efb 100644 --- a/io.sc.platform.system.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "vue": "3.5.10", diff --git a/io.sc.platform.system.frontend/src/i18n/messages.json b/io.sc.platform.system.frontend/src/i18n/messages.json index 8cfa5757..4cafc1e2 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages.json +++ b/io.sc.platform.system.frontend/src/i18n/messages.json @@ -1,64 +1,63 @@ { - "menu.system" : "System Manager", - "menu.system.license" : "License", - "menu.system.application" : "Application", - "menu.system.corporation" : "Corporation", - "menu.system.user" : "User", - "menu.system.role" : "Role", - "menu.system.org" : "Organization", - "menu.system.department" : "Department", - "menu.system.menu" : "Menu", - "menu.system.announcementManager" : "Announcement Manager", - "menu.system.notificationManager" : "Notification Manager", - "menu.system.parameter" : "Parameter", - "menu.system.dictionary" : "Dictionary", - "menu.system.desensitizer" : "Desensitizer", - "menu.system.i18n" : "I18n Messages", + "menu.system": "System Manager", + "menu.system.license": "License", + "menu.system.application": "Application", + "menu.system.corporation": "Corporation", + "menu.system.user": "User", + "menu.system.role": "Role", + "menu.system.org": "Organization", + "menu.system.department": "Department", + "menu.system.menu": "Menu", + "menu.system.announcementManager": "Announcement Manager", + "menu.system.notificationManager": "Notification Manager", + "menu.system.parameter": "Parameter", + "menu.system.dictionary": "Dictionary", + "menu.system.desensitizer": "Desensitizer", + "menu.system.i18n": "I18n Messages", "menu.system.datasource": "DataSource", - "menu.system.monitor" : "Monitor", - "menu.system.monitor.auditlog" : "Audit Log", - "menu.system.monitor.log" : "Log", - "menu.system.monitor.serverInfo" : "Server Information", + "menu.system.monitor": "Monitor", + "menu.system.monitor.auditlog": "Audit Log", + "menu.system.monitor.log": "Log", + "menu.system.monitor.serverInfo": "Server Information", "system.shared.selectUser.grid.title": "Included User List", - "system.shared.selectUser.grid.toolbar.selectIn":"Select In", - "system.shared.selectUser.grid.toolbar.selectOut":"Select Out", - "system.shared.selectUser.grid.toolbar.selectOut.tip":"Are you sure to select out the users?", - "system.shared.selectUser.grid.toolbar.selectAllIn":"Select All In", - "system.shared.selectUser.grid.toolbar.selectAllIn.tip":"Are you sure to select in ALL users?", - "system.shared.selectUser.grid.toolbar.selectAllOut":"Select All Out", - "system.shared.selectUser.grid.toolbar.selectAllOut.tip":"Are you sure to select out ALL users?", + "system.shared.selectUser.grid.toolbar.selectIn": "Select In", + "system.shared.selectUser.grid.toolbar.selectOut": "Select Out", + "system.shared.selectUser.grid.toolbar.selectOut.tip": "Are you sure to select out the users?", + "system.shared.selectUser.grid.toolbar.selectAllIn": "Select All In", + "system.shared.selectUser.grid.toolbar.selectAllIn.tip": "Are you sure to select in ALL users?", + "system.shared.selectUser.grid.toolbar.selectAllOut": "Select All Out", + "system.shared.selectUser.grid.toolbar.selectAllOut.tip": "Are you sure to select out ALL users?", "system.shared.selectUser.dialog.title": "Select Users", "system.shared.selectUser.dialog.grid.title": "Available User List", "system.shared.selectRole.grid.title": "Included Role List", - "system.shared.selectRole.grid.toolbar.selectIn":"Select In", - "system.shared.selectRole.grid.toolbar.selectOut":"Select Out", - "system.shared.selectRole.grid.toolbar.selectOut.tip":"Are you sure to select out the roles?", - "system.shared.selectRole.grid.toolbar.selectAllIn":"Select All In", - "system.shared.selectRole.grid.toolbar.selectAllIn.tip":"Are you sure to select in ALL roles?", - "system.shared.selectRole.grid.toolbar.selectAllOut":"Select All Out", - "system.shared.selectRole.grid.toolbar.selectAllOut.tip":"Are you sure to select out ALL roles?", + "system.shared.selectRole.grid.toolbar.selectIn": "Select In", + "system.shared.selectRole.grid.toolbar.selectOut": "Select Out", + "system.shared.selectRole.grid.toolbar.selectOut.tip": "Are you sure to select out the roles?", + "system.shared.selectRole.grid.toolbar.selectAllIn": "Select All In", + "system.shared.selectRole.grid.toolbar.selectAllIn.tip": "Are you sure to select in ALL roles?", + "system.shared.selectRole.grid.toolbar.selectAllOut": "Select All Out", + "system.shared.selectRole.grid.toolbar.selectAllOut.tip": "Are you sure to select out ALL roles?", "system.shared.selectRole.dialog.title": "Select Roles", "system.shared.selectRole.dialog.grid.title": "Available Role List", "system.shared.selectOrg.grid.title": "Organization Tree", - "system.shared.selectOrg.grid.toolbar.save.tip":"Are you sure to update organizations?", - + "system.shared.selectOrg.grid.toolbar.save.tip": "Are you sure to update organizations?", "system.shared.selectApplication.grid.title": "Included Application List", - "system.shared.selectApplication.grid.toolbar.selectIn":"Select In", - "system.shared.selectApplication.grid.toolbar.selectOut":"Select Out", - "system.shared.selectApplication.grid.toolbar.selectOut.tip":"Are you sure to select out the applications?", - "system.shared.selectApplication.grid.toolbar.selectAllIn":"Select All In", - "system.shared.selectApplication.grid.toolbar.selectAllIn.tip":"Are you sure to select in ALL applications?", - "system.shared.selectApplication.grid.toolbar.selectAllOut":"Select All Out", - "system.shared.selectApplication.grid.toolbar.selectAllOut.tip":"Are you sure to select out ALL applications?", + "system.shared.selectApplication.grid.toolbar.selectIn": "Select In", + "system.shared.selectApplication.grid.toolbar.selectOut": "Select Out", + "system.shared.selectApplication.grid.toolbar.selectOut.tip": "Are you sure to select out the applications?", + "system.shared.selectApplication.grid.toolbar.selectAllIn": "Select All In", + "system.shared.selectApplication.grid.toolbar.selectAllIn.tip": "Are you sure to select in ALL applications?", + "system.shared.selectApplication.grid.toolbar.selectAllOut": "Select All Out", + "system.shared.selectApplication.grid.toolbar.selectAllOut.tip": "Are you sure to select out ALL applications?", "system.shared.selectApplication.dialog.title": "Select Applications", "system.shared.selectApplication.dialog.grid.title": "Available Application List", "system.shared.selectMenu.grid.title": "Menu Tree", - "system.shared.selectMenu.grid.toolbar.save.tip":"Are you sure to update menus?", + "system.shared.selectMenu.grid.toolbar.save.tip": "Are you sure to update menus?", "system.shared.importMenuPlugin.dialog.title": "Import Menus", @@ -74,129 +73,130 @@ "system.license.entity.expiredDate": "Expired Date", "system.license.entity.term": "Term(day)", "system.license.entity.macAddresses": "MAC Addresses", + "system.license.entity.serverMacAddresses": "Active MAC Addresses of Server", "system.license.updateDialog.title": "Update License", - "system.application.grid.title":"Application List", - - "system.corporation.grid.title":"Corporation Tree", - "system.corporation.grid.toolbar.addTop":"Add Top Corporation", - "system.corporation.grid.toolbar.addChild":"Add Child Corporation", - - "system.user.grid.title":"User List", - "system.user.grid.toolbar.setPassword":"Set Password", - "system.user.grid.toolbar.setAllPassword":"Set All Password", - "system.user.grid.toolbar.resetPassword":"Reset Password", - "system.user.grid.toolbar.resetPassword.tip":"Are you sure to reset the user's password?", - "system.user.grid.toolbar.resetAllPassword":"Reset All Password", - "system.user.grid.toolbar.resetAllPassword.tip":"Are you sure to reset ALL user's password?", - - "system.role.grid.title":"Role List", - - "system.org.grid.title":"Organization Tree", - "system.org.grid.toolbar.addTop":"Add Top Organization", - "system.org.grid.toolbar.addChild":"Add Child Organization", - - "system.department.grid.title":"Department Tree", - "system.department.grid.toolbar.addTop":"Add Top Department", - "system.department.grid.toolbar.addChild":"Add Child Department", - - "system.menu.grid.title":"Menu Tree", - "system.menu.grid.toolbar.addTop":"Add Top Menu", - "system.menu.grid.toolbar.addChild":"Add Child Menu", - "system.menu.grid.entity.titleI18nKey":"Title i18n Key", - "system.menu.grid.entity.asRoot":"Is show as root", - "system.menu.grid.entity.javaScript":"JavaScript", - "system.menu.grid.entity.routeName":"Route Name", - "system.menu.grid.entity.routeQuery":"Route Query", - "system.menu.grid.entity.url":"URL", - "system.menu.grid.entity.urlOpenType":"URL Open Type", - - "system.announcementManager.grid.title":"Announcement List", - - "system.notification.grid.title":"Messages List", - "system.notification.grid.entity.sender":"Sender", - "system.notification.grid.entity.sendDate":"Send Date", - "system.notification.grid.entity.receiver":"Receiver", - "system.notification.grid.entity.receiveDate":"Receive Date", - - "system.parameter.grid.title":"Parameters", - - "system.dictionary.grid.title":"Dictionaries List", - - "system.desensitizer.grid.title":"Desensitizeable Field List", - - "system.i18n.grid.title":"I18n Messages List", - "system.i18n.grid.toolbar.removeAll.tip":"Are you sure to remove ALL i18n messages?", - "system.i18n.grid.toolbar.importAll.tip":"Are you sure to import ALL i18n messages?", - - "system.datasource.grid.title":"Datasource List", - "system.datasource.grid.toolbar.connectionProperties":"Connection Properties", - "system.datasource.grid.entity.jndiName":"JNDI Name", - "system.datasource.grid.entity.databaseType":"Database Type", - "system.datasource.grid.entity.jdbcDriver":"JDBC Driver", - "system.datasource.grid.entity.jdbcUrl":"JDBC URL", - "system.datasource.hikari.autoCommit":"Auto Commit(default:true)", - "system.datasource.hikari.connectionTimeout":"Connection Timeout (millisecond,default:30000,minimal:250)", - "system.datasource.hikari.idleTimeout":"Idle Timeout (millisecond,default:600000,minimal:10000)", - "system.datasource.hikari.maxLifetime":"Max Life Time(millisecond,default:1800000)", - "system.datasource.hikari.connectionTestQuery":"Connection Test Query Sql(JDBC4 Not needed)", - "system.datasource.hikari.minimumIdle":"Minimum Idle(default:equals maximumPoolSize)", - "system.datasource.hikari.maximumPoolSize":"Maximum Pool Size(default:10)", - "system.datasource.hikari.metricRegistry":"Metric Registry", - "system.datasource.hikari.healthCheckRegistry":"Health Check Registry", - "system.datasource.hikari.poolName":"Pool Name", - "system.datasource.hikari.initializationFailTimeout":"Initialization Fail Timeout", - "system.datasource.hikari.isolateInternalQueries":"Internal Query Isolate(default:false)", - "system.datasource.hikari.allowPoolSuspension":"Allow Pool Suspension(default:false)", - "system.datasource.hikari.readOnly":"Read Only(default:false)", - "system.datasource.hikari.registerMbeans":"Register Mbeans(default:false)", - "system.datasource.hikari.catalog":"Catalog", - "system.datasource.hikari.connectionInitSql":"Connection init Sql", - "system.datasource.hikari.driverClassName":"JDBC Driver Class Name", - "system.datasource.hikari.transactionIsolation":"Transaction Isolation", - "system.datasource.hikari.validationTimeout":"Validation Timeout(millisecond,default:5000,minimal:250)", - "system.datasource.hikari.leakDetectionThreshold":"Leak Detection Threshold(default:0-not check,minimal:2000)", - "system.datasource.hikari.schema":"Schema", - - "system.monitor.auditlog.grid.title":"Audit Logs List", - - "system.monitor.log.tab.view":"Log View", - "system.monitor.log.tab.download":"Log Download", - "system.monitor.log.tab.level":"Log Level", - "system.monitor.log.viewer.logRows":"The Last Row Count of Log File", - "system.monitor.log.viewer.autoRefresh":"Auto Refresh(1 / 2 sec, stop after 300 times auto refreshed)", - "system.monitor.log.viewer.action.refreshNow":"Refresh", - "system.monitor.log.download.grid.title":"Log File List", - "system.monitor.log.level.grid.title":"Log Level List", - "system.monitor.log.level.entity.configuredLevel":"Configured", - "system.monitor.log.level.entity.effectiveLevel":"Effective", - - "system.monitor.serverInfo.os":"Operating System", - "system.monitor.serverInfo.os.name":"Name", - "system.monitor.serverInfo.os.version":"Version", - "system.monitor.serverInfo.os.arch":"Architecture", - "system.monitor.serverInfo.os.manufacturer":"Manufacturer", - "system.monitor.serverInfo.os.bootTime":"Boot Time", - "system.monitor.serverInfo.os.upTime":"Up Time", - - "system.monitor.serverInfo.jvm":"Java Virtual Machine", - "system.monitor.serverInfo.jvm.total":"Total Memory Used", - "system.monitor.serverInfo.jvm.max":"Max Memory Available", - "system.monitor.serverInfo.jvm.free":"Free Memory", - "system.monitor.serverInfo.jvm.version":"JDK Version", - "system.monitor.serverInfo.jvm.home":"JDK Path", - - "system.monitor.serverInfo.cpu":"CPU", - "system.monitor.serverInfo.cpu.system":"System", - "system.monitor.serverInfo.cpu.user":"User", - - "system.monitor.serverInfo.memory":"Memory", - - "system.monitor.serverInfo.disk":"Disk", - "system.monitor.serverInfo.disk.used":"Used", - "system.monitor.serverInfo.disk.free":"Free", - - "system.monitor.serverInfo.online":"Online", + "system.application.grid.title": "Application List", + + "system.corporation.grid.title": "Corporation Tree", + "system.corporation.grid.toolbar.addTop": "Add Top Corporation", + "system.corporation.grid.toolbar.addChild": "Add Child Corporation", + + "system.user.grid.title": "User List", + "system.user.grid.toolbar.setPassword": "Set Password", + "system.user.grid.toolbar.setAllPassword": "Set All Password", + "system.user.grid.toolbar.resetPassword": "Reset Password", + "system.user.grid.toolbar.resetPassword.tip": "Are you sure to reset the user's password?", + "system.user.grid.toolbar.resetAllPassword": "Reset All Password", + "system.user.grid.toolbar.resetAllPassword.tip": "Are you sure to reset ALL user's password?", + + "system.role.grid.title": "Role List", + + "system.org.grid.title": "Organization Tree", + "system.org.grid.toolbar.addTop": "Add Top Organization", + "system.org.grid.toolbar.addChild": "Add Child Organization", + + "system.department.grid.title": "Department Tree", + "system.department.grid.toolbar.addTop": "Add Top Department", + "system.department.grid.toolbar.addChild": "Add Child Department", + + "system.menu.grid.title": "Menu Tree", + "system.menu.grid.toolbar.addTop": "Add Top Menu", + "system.menu.grid.toolbar.addChild": "Add Child Menu", + "system.menu.grid.entity.titleI18nKey": "Title i18n Key", + "system.menu.grid.entity.asRoot": "Is show as root", + "system.menu.grid.entity.javaScript": "JavaScript", + "system.menu.grid.entity.routeName": "Route Name", + "system.menu.grid.entity.routeQuery": "Route Query", + "system.menu.grid.entity.url": "URL", + "system.menu.grid.entity.urlOpenType": "URL Open Type", + + "system.announcementManager.grid.title": "Announcement List", + + "system.notification.grid.title": "Messages List", + "system.notification.grid.entity.sender": "Sender", + "system.notification.grid.entity.sendDate": "Send Date", + "system.notification.grid.entity.receiver": "Receiver", + "system.notification.grid.entity.receiveDate": "Receive Date", + + "system.parameter.grid.title": "Parameters", + + "system.dictionary.grid.title": "Dictionaries List", + + "system.desensitizer.grid.title": "Desensitizeable Field List", + + "system.i18n.grid.title": "I18n Messages List", + "system.i18n.grid.toolbar.removeAll.tip": "Are you sure to remove ALL i18n messages?", + "system.i18n.grid.toolbar.importAll.tip": "Are you sure to import ALL i18n messages?", + + "system.datasource.grid.title": "Datasource List", + "system.datasource.grid.toolbar.connectionProperties": "Connection Properties", + "system.datasource.grid.entity.jndiName": "JNDI Name", + "system.datasource.grid.entity.databaseType": "Database Type", + "system.datasource.grid.entity.jdbcDriver": "JDBC Driver", + "system.datasource.grid.entity.jdbcUrl": "JDBC URL", + "system.datasource.hikari.autoCommit": "Auto Commit(default:true)", + "system.datasource.hikari.connectionTimeout": "Connection Timeout (millisecond,default:30000,minimal:250)", + "system.datasource.hikari.idleTimeout": "Idle Timeout (millisecond,default:600000,minimal:10000)", + "system.datasource.hikari.maxLifetime": "Max Life Time(millisecond,default:1800000)", + "system.datasource.hikari.connectionTestQuery": "Connection Test Query Sql(JDBC4 Not needed)", + "system.datasource.hikari.minimumIdle": "Minimum Idle(default:equals maximumPoolSize)", + "system.datasource.hikari.maximumPoolSize": "Maximum Pool Size(default:10)", + "system.datasource.hikari.metricRegistry": "Metric Registry", + "system.datasource.hikari.healthCheckRegistry": "Health Check Registry", + "system.datasource.hikari.poolName": "Pool Name", + "system.datasource.hikari.initializationFailTimeout": "Initialization Fail Timeout", + "system.datasource.hikari.isolateInternalQueries": "Internal Query Isolate(default:false)", + "system.datasource.hikari.allowPoolSuspension": "Allow Pool Suspension(default:false)", + "system.datasource.hikari.readOnly": "Read Only(default:false)", + "system.datasource.hikari.registerMbeans": "Register Mbeans(default:false)", + "system.datasource.hikari.catalog": "Catalog", + "system.datasource.hikari.connectionInitSql": "Connection init Sql", + "system.datasource.hikari.driverClassName": "JDBC Driver Class Name", + "system.datasource.hikari.transactionIsolation": "Transaction Isolation", + "system.datasource.hikari.validationTimeout": "Validation Timeout(millisecond,default:5000,minimal:250)", + "system.datasource.hikari.leakDetectionThreshold": "Leak Detection Threshold(default:0-not check,minimal:2000)", + "system.datasource.hikari.schema": "Schema", + + "system.monitor.auditlog.grid.title": "Audit Logs List", + + "system.monitor.log.tab.view": "Log View", + "system.monitor.log.tab.download": "Log Download", + "system.monitor.log.tab.level": "Log Level", + "system.monitor.log.viewer.logRows": "The Last Row Count of Log File", + "system.monitor.log.viewer.autoRefresh": "Auto Refresh(1 / 2 sec, stop after 300 times auto refreshed)", + "system.monitor.log.viewer.action.refreshNow": "Refresh", + "system.monitor.log.download.grid.title": "Log File List", + "system.monitor.log.level.grid.title": "Log Level List", + "system.monitor.log.level.entity.configuredLevel": "Configured", + "system.monitor.log.level.entity.effectiveLevel": "Effective", + + "system.monitor.serverInfo.os": "Operating System", + "system.monitor.serverInfo.os.name": "Name", + "system.monitor.serverInfo.os.version": "Version", + "system.monitor.serverInfo.os.arch": "Architecture", + "system.monitor.serverInfo.os.manufacturer": "Manufacturer", + "system.monitor.serverInfo.os.bootTime": "Boot Time", + "system.monitor.serverInfo.os.upTime": "Up Time", + + "system.monitor.serverInfo.jvm": "Java Virtual Machine", + "system.monitor.serverInfo.jvm.total": "Total Memory Used", + "system.monitor.serverInfo.jvm.max": "Max Memory Available", + "system.monitor.serverInfo.jvm.free": "Free Memory", + "system.monitor.serverInfo.jvm.version": "JDK Version", + "system.monitor.serverInfo.jvm.home": "JDK Path", + + "system.monitor.serverInfo.cpu": "CPU", + "system.monitor.serverInfo.cpu.system": "System", + "system.monitor.serverInfo.cpu.user": "User", + + "system.monitor.serverInfo.memory": "Memory", + + "system.monitor.serverInfo.disk": "Disk", + "system.monitor.serverInfo.disk.used": "Used", + "system.monitor.serverInfo.disk.free": "Free", + + "system.monitor.serverInfo.online": "Online", "system.monitor.serverInfo.serviceRequest": "Service Request" } diff --git a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json index ab75907e..02a66096 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json @@ -1,63 +1,63 @@ { - "menu.system" : "系統管理", - "menu.system.license" : "許可證管理", - "menu.system.application" : "應用管理", - "menu.system.corporation" : "法人管理", - "menu.system.user" : "用戶管理", - "menu.system.role" : "角色管理", - "menu.system.org" : "機構管理", - "menu.system.department" : "部門管理", - "menu.system.menu" : "菜單管理", - "menu.system.announcementManager" : "公告管理", - "menu.system.notificationManager" : "消息管理", - "menu.system.parameter" : "參數管理", - "menu.system.dictionary" : "數據字典", - "menu.system.desensitizer" : "數據脫敏", - "menu.system.i18n" : "國際化多語言", + "menu.system": "系統管理", + "menu.system.license": "許可證管理", + "menu.system.application": "應用管理", + "menu.system.corporation": "法人管理", + "menu.system.user": "用戶管理", + "menu.system.role": "角色管理", + "menu.system.org": "機構管理", + "menu.system.department": "部門管理", + "menu.system.menu": "菜單管理", + "menu.system.announcementManager": "公告管理", + "menu.system.notificationManager": "消息管理", + "menu.system.parameter": "參數管理", + "menu.system.dictionary": "數據字典", + "menu.system.desensitizer": "數據脫敏", + "menu.system.i18n": "國際化多語言", "menu.system.datasource": "數據源管理", - "menu.system.monitor" : "系統監控", - "menu.system.monitor.auditlog" : "審計日誌", - "menu.system.monitor.log" : "系統日誌", - "menu.system.monitor.serverInfo" : "服務器信息", + "menu.system.monitor": "系統監控", + "menu.system.monitor.auditlog": "審計日誌", + "menu.system.monitor.log": "系統日誌", + "menu.system.monitor.serverInfo": "服務器信息", "system.shared.selectUser.grid.title": "已包含用戶列表", - "system.shared.selectUser.grid.toolbar.selectIn":"選入", - "system.shared.selectUser.grid.toolbar.selectOut":"選出", - "system.shared.selectUser.grid.toolbar.selectOut.tip":"您確定要選出用戶嗎?", - "system.shared.selectUser.grid.toolbar.selectAllIn":"選入所有用戶", - "system.shared.selectUser.grid.toolbar.selectAllIn.tip":"您確定要選入全部用戶嗎?", - "system.shared.selectUser.grid.toolbar.selectAllOut":"選出所有用戶", - "system.shared.selectUser.grid.toolbar.selectAllOut.tip":"您確定要選出全部用戶嗎?", + "system.shared.selectUser.grid.toolbar.selectIn": "選入", + "system.shared.selectUser.grid.toolbar.selectOut": "選出", + "system.shared.selectUser.grid.toolbar.selectOut.tip": "您確定要選出用戶嗎?", + "system.shared.selectUser.grid.toolbar.selectAllIn": "選入所有用戶", + "system.shared.selectUser.grid.toolbar.selectAllIn.tip": "您確定要選入全部用戶嗎?", + "system.shared.selectUser.grid.toolbar.selectAllOut": "選出所有用戶", + "system.shared.selectUser.grid.toolbar.selectAllOut.tip": "您確定要選出全部用戶嗎?", "system.shared.selectUser.dialog.title": "選擇用戶", "system.shared.selectUser.dialog.grid.title": "可選用戶列表", "system.shared.selectRole.grid.title": "已包含角色列表", - "system.shared.selectRole.grid.toolbar.selectIn":"選入", - "system.shared.selectRole.grid.toolbar.selectOut":"選出", - "system.shared.selectRole.grid.toolbar.selectOut.tip":"您確定要選出角色嗎?", - "system.shared.selectRole.grid.toolbar.selectAllIn":"選入所有角色", - "system.shared.selectRole.grid.toolbar.selectAllIn.tip":"您確定要選入全部角色嗎?", - "system.shared.selectRole.grid.toolbar.selectAllOut":"選出所有角色", - "system.shared.selectRole.grid.toolbar.selectAllOut.tip":"您確定要選出全部角色嗎?", + "system.shared.selectRole.grid.toolbar.selectIn": "選入", + "system.shared.selectRole.grid.toolbar.selectOut": "選出", + "system.shared.selectRole.grid.toolbar.selectOut.tip": "您確定要選出角色嗎?", + "system.shared.selectRole.grid.toolbar.selectAllIn": "選入所有角色", + "system.shared.selectRole.grid.toolbar.selectAllIn.tip": "您確定要選入全部角色嗎?", + "system.shared.selectRole.grid.toolbar.selectAllOut": "選出所有角色", + "system.shared.selectRole.grid.toolbar.selectAllOut.tip": "您確定要選出全部角色嗎?", "system.shared.selectRole.dialog.title": "選擇角色", "system.shared.selectRole.dialog.grid.title": "可選角色列表", "system.shared.selectOrg.grid.title": "機構樹", - "system.shared.selectOrg.grid.toolbar.save.tip":"您确定要更新機構吗?", + "system.shared.selectOrg.grid.toolbar.save.tip": "您确定要更新機構吗?", "system.shared.selectApplication.grid.title": "已包含應用列表", - "system.shared.selectApplication.grid.toolbar.selectIn":"選入", - "system.shared.selectApplication.grid.toolbar.selectOut":"選出", - "system.shared.selectApplication.grid.toolbar.selectOut.tip":"您確定要選出應用嗎?", - "system.shared.selectApplication.grid.toolbar.selectAllIn":"選入所有應用", - "system.shared.selectApplication.grid.toolbar.selectAllIn.tip":"您確定要選入全部應用嗎?", - "system.shared.selectApplication.grid.toolbar.selectAllOut":"選出所有應用", - "system.shared.selectApplication.grid.toolbar.selectAllOut.tip":"您確定要選出全部應用嗎?", + "system.shared.selectApplication.grid.toolbar.selectIn": "選入", + "system.shared.selectApplication.grid.toolbar.selectOut": "選出", + "system.shared.selectApplication.grid.toolbar.selectOut.tip": "您確定要選出應用嗎?", + "system.shared.selectApplication.grid.toolbar.selectAllIn": "選入所有應用", + "system.shared.selectApplication.grid.toolbar.selectAllIn.tip": "您確定要選入全部應用嗎?", + "system.shared.selectApplication.grid.toolbar.selectAllOut": "選出所有應用", + "system.shared.selectApplication.grid.toolbar.selectAllOut.tip": "您確定要選出全部應用嗎?", "system.shared.selectApplication.dialog.title": "選擇應用", "system.shared.selectApplication.dialog.grid.title": "可選應用列表", "system.shared.selectMenu.grid.title": "菜單树", - "system.shared.selectMenu.grid.toolbar.save.tip":"您确定要更新菜單吗?", + "system.shared.selectMenu.grid.toolbar.save.tip": "您确定要更新菜單吗?", "system.shared.importMenuPlugin.dialog.title": "導入菜單", @@ -73,107 +73,108 @@ "system.license.entity.expiredDate": "有效期結束日期", "system.license.entity.term": "期限(天)", "system.license.entity.macAddresses": "MAC 地址", + "system.license.entity.serverMacAddresses": "當前服務器活動網卡 MAC 地址", "system.license.updateDialog.title": "更新許可證", - "system.application.grid.title":"應用列表", - - "system.corporation.grid.title":"法人樹", - "system.corporation.grid.toolbar.addTop":"新增頂級法人", - "system.corporation.grid.toolbar.addChild":"新增子法人", - - "system.user.grid.title":"用戶列表", - "system.user.grid.toolbar.setPassword":"設置密碼", - "system.user.grid.toolbar.setAllPassword":"設置所有密碼", - "system.user.grid.toolbar.resetPassword":"重置密碼", - "system.user.grid.toolbar.resetPassword.tip":"您确定要重置用戶密碼嗎?", - "system.user.grid.toolbar.resetAllPassword":"重置所有密碼", - "system.user.grid.toolbar.resetAllPassword.tip":"您确定要重置所有用戶密碼嗎?", - - "system.role.grid.title":"角色列表", - - "system.org.grid.title":"機構樹", - "system.org.grid.toolbar.addTop":"新增頂級機構", - "system.org.grid.toolbar.addChild":"新增子機構", - - "system.department.grid.title":"部門樹", - "system.department.grid.toolbar.addTop":"新增頂級部門", - "system.department.grid.toolbar.addChild":"新增子部門", - - "system.menu.grid.title":"菜單樹", - "system.menu.grid.toolbar.addTop":"新增頂級菜單", - "system.menu.grid.toolbar.addChild":"新增子菜單", - "system.menu.grid.entity.titleI18nKey":"標題多語言消息鍵", - "system.menu.grid.entity.asRoot":"是否作為根菜單顯示", - "system.menu.grid.entity.javaScript":"JavaScript", - "system.menu.grid.entity.routeName":"路由名稱", - "system.menu.grid.entity.routeQuery":"路由查詢參數", - "system.menu.grid.entity.url":"URL", - "system.menu.grid.entity.urlOpenType":"URL 打開方式", - - "system.announcementManager.gridTitle":"公告列表", - - "system.notification.grid.title":"消息列表", - "system.notification.grid.entity.sender":"發送者", - "system.notification.grid.entity.sendDate":"發送日期", - "system.notification.grid.entity.receiver":"接收者", - "system.notification.grid.entity.receiveDate":"接收日期", - - "system.parameter.grid.title":"系統參數", - - "system.dictionary.grid.title":"可脫敏數據字段列表", - - "system.desensitizer.grid.title":"Desensitizer List", - - "system.i18n.grid.title":"多语言消息列表", - "system.i18n.grid.toolbar.removeAll.tip":"您確定要刪除所有多語言消息嗎?", - "system.i18n.grid.toolbar.importAll.tip":"您確定要所導入所有多語言消息嗎?", - - "system.datasource.grid.title":"數據源列表", - "system.datasource.grid.toolbar.connectionProperties":"連接屬性", - "system.datasource.grid.entity.jndiName":"JNDI 名稱", - "system.datasource.grid.entity.databaseType":"數據庫類型", - "system.datasource.grid.entity.jdbcDriver":"JDBC 驅動程序", - "system.datasource.grid.entity.jdbcUrl":"JDBC URL", - - "system.monitor.auditlog.grid.title":"審計日誌列表", - - "system.monitor.log.tab.view":"日誌查看", - "system.monitor.log.tab.download":"日誌下載", - "system.monitor.log.tab.level":"日誌級別", - "system.monitor.log.viewer.logRows":"顯示日誌文件最後行數", - "system.monitor.log.viewer.autoRefresh":"自動刷新(頻率:1次/2秒,超過 300 次后停止自動刷新)", - "system.monitor.log.viewer.action.refreshNow":"刷新", - "system.monitor.log.download.grid.title":"日誌文件列表", - "system.monitor.log.level.grid.title":"日誌級別列表", - "system.monitor.log.level.entity.configuredLevel":"配置級別", - "system.monitor.log.level.entity.effectiveLevel":"生效級別", - - "system.monitor.serverInfo.os":"操作系統", - "system.monitor.serverInfo.os.name":"名稱", - "system.monitor.serverInfo.os.version":"版本", - "system.monitor.serverInfo.os.arch":"架構", - "system.monitor.serverInfo.os.manufacturer":"生產商", - "system.monitor.serverInfo.os.bootTime":"上次啟動日期", - "system.monitor.serverInfo.os.upTime":"持續運行天數", - - "system.monitor.serverInfo.jvm":"Java 虛擬機", - "system.monitor.serverInfo.jvm.total":"當前佔用的內存總數", - "system.monitor.serverInfo.jvm.max":"最大可用內存總數", - "system.monitor.serverInfo.jvm.free":"空閒內存", - "system.monitor.serverInfo.jvm.version":"JDK 版本", - "system.monitor.serverInfo.jvm.home":"JDK 路徑", - - "system.monitor.serverInfo.cpu":"CPU", - "system.monitor.serverInfo.cpu.system":"系統", - "system.monitor.serverInfo.cpu.user":"用戶", - - "system.monitor.serverInfo.memory":"內存", - - "system.monitor.serverInfo.disk":"存儲", - "system.monitor.serverInfo.disk.used":"已用", - "system.monitor.serverInfo.disk.free":"空閒", - - "system.monitor.serverInfo.online":"在線用戶", + "system.application.grid.title": "應用列表", + + "system.corporation.grid.title": "法人樹", + "system.corporation.grid.toolbar.addTop": "新增頂級法人", + "system.corporation.grid.toolbar.addChild": "新增子法人", + + "system.user.grid.title": "用戶列表", + "system.user.grid.toolbar.setPassword": "設置密碼", + "system.user.grid.toolbar.setAllPassword": "設置所有密碼", + "system.user.grid.toolbar.resetPassword": "重置密碼", + "system.user.grid.toolbar.resetPassword.tip": "您确定要重置用戶密碼嗎?", + "system.user.grid.toolbar.resetAllPassword": "重置所有密碼", + "system.user.grid.toolbar.resetAllPassword.tip": "您确定要重置所有用戶密碼嗎?", + + "system.role.grid.title": "角色列表", + + "system.org.grid.title": "機構樹", + "system.org.grid.toolbar.addTop": "新增頂級機構", + "system.org.grid.toolbar.addChild": "新增子機構", + + "system.department.grid.title": "部門樹", + "system.department.grid.toolbar.addTop": "新增頂級部門", + "system.department.grid.toolbar.addChild": "新增子部門", + + "system.menu.grid.title": "菜單樹", + "system.menu.grid.toolbar.addTop": "新增頂級菜單", + "system.menu.grid.toolbar.addChild": "新增子菜單", + "system.menu.grid.entity.titleI18nKey": "標題多語言消息鍵", + "system.menu.grid.entity.asRoot": "是否作為根菜單顯示", + "system.menu.grid.entity.javaScript": "JavaScript", + "system.menu.grid.entity.routeName": "路由名稱", + "system.menu.grid.entity.routeQuery": "路由查詢參數", + "system.menu.grid.entity.url": "URL", + "system.menu.grid.entity.urlOpenType": "URL 打開方式", + + "system.announcementManager.gridTitle": "公告列表", + + "system.notification.grid.title": "消息列表", + "system.notification.grid.entity.sender": "發送者", + "system.notification.grid.entity.sendDate": "發送日期", + "system.notification.grid.entity.receiver": "接收者", + "system.notification.grid.entity.receiveDate": "接收日期", + + "system.parameter.grid.title": "系統參數", + + "system.dictionary.grid.title": "可脫敏數據字段列表", + + "system.desensitizer.grid.title": "Desensitizer List", + + "system.i18n.grid.title": "多语言消息列表", + "system.i18n.grid.toolbar.removeAll.tip": "您確定要刪除所有多語言消息嗎?", + "system.i18n.grid.toolbar.importAll.tip": "您確定要所導入所有多語言消息嗎?", + + "system.datasource.grid.title": "數據源列表", + "system.datasource.grid.toolbar.connectionProperties": "連接屬性", + "system.datasource.grid.entity.jndiName": "JNDI 名稱", + "system.datasource.grid.entity.databaseType": "數據庫類型", + "system.datasource.grid.entity.jdbcDriver": "JDBC 驅動程序", + "system.datasource.grid.entity.jdbcUrl": "JDBC URL", + + "system.monitor.auditlog.grid.title": "審計日誌列表", + + "system.monitor.log.tab.view": "日誌查看", + "system.monitor.log.tab.download": "日誌下載", + "system.monitor.log.tab.level": "日誌級別", + "system.monitor.log.viewer.logRows": "顯示日誌文件最後行數", + "system.monitor.log.viewer.autoRefresh": "自動刷新(頻率:1次/2秒,超過 300 次后停止自動刷新)", + "system.monitor.log.viewer.action.refreshNow": "刷新", + "system.monitor.log.download.grid.title": "日誌文件列表", + "system.monitor.log.level.grid.title": "日誌級別列表", + "system.monitor.log.level.entity.configuredLevel": "配置級別", + "system.monitor.log.level.entity.effectiveLevel": "生效級別", + + "system.monitor.serverInfo.os": "操作系統", + "system.monitor.serverInfo.os.name": "名稱", + "system.monitor.serverInfo.os.version": "版本", + "system.monitor.serverInfo.os.arch": "架構", + "system.monitor.serverInfo.os.manufacturer": "生產商", + "system.monitor.serverInfo.os.bootTime": "上次啟動日期", + "system.monitor.serverInfo.os.upTime": "持續運行天數", + + "system.monitor.serverInfo.jvm": "Java 虛擬機", + "system.monitor.serverInfo.jvm.total": "當前佔用的內存總數", + "system.monitor.serverInfo.jvm.max": "最大可用內存總數", + "system.monitor.serverInfo.jvm.free": "空閒內存", + "system.monitor.serverInfo.jvm.version": "JDK 版本", + "system.monitor.serverInfo.jvm.home": "JDK 路徑", + + "system.monitor.serverInfo.cpu": "CPU", + "system.monitor.serverInfo.cpu.system": "系統", + "system.monitor.serverInfo.cpu.user": "用戶", + + "system.monitor.serverInfo.memory": "內存", + + "system.monitor.serverInfo.disk": "存儲", + "system.monitor.serverInfo.disk.used": "已用", + "system.monitor.serverInfo.disk.free": "空閒", + + "system.monitor.serverInfo.online": "在線用戶", "system.monitor.serverInfo.serviceRequest": "服務請求" } diff --git a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json index 017bb598..38bf9c38 100644 --- a/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json +++ b/io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json @@ -1,63 +1,63 @@ { - "menu.system" : "系统管理", - "menu.system.license" : "许可证管理", - "menu.system.application" : "应用管理", - "menu.system.corporation" : "法人管理", - "menu.system.user" : "用户管理", - "menu.system.role" : "角色管理", - "menu.system.org" : "机构管理", - "menu.system.department" : "部门管理", - "menu.system.menu" : "菜单管理", - "menu.system.announcementManager" : "公告管理", - "menu.system.notificationManager" : "消息管理", - "menu.system.parameter" : "参数管理", - "menu.system.dictionary" : "数据字典", - "menu.system.desensitizer" : "数据脱敏", - "menu.system.i18n" : "国际化多语言", + "menu.system": "系统管理", + "menu.system.license": "许可证管理", + "menu.system.application": "应用管理", + "menu.system.corporation": "法人管理", + "menu.system.user": "用户管理", + "menu.system.role": "角色管理", + "menu.system.org": "机构管理", + "menu.system.department": "部门管理", + "menu.system.menu": "菜单管理", + "menu.system.announcementManager": "公告管理", + "menu.system.notificationManager": "消息管理", + "menu.system.parameter": "参数管理", + "menu.system.dictionary": "数据字典", + "menu.system.desensitizer": "数据脱敏", + "menu.system.i18n": "国际化多语言", "menu.system.datasource": "数据源管理", - "menu.system.monitor" : "系统监控", - "menu.system.monitor.auditlog" : "审计日志", - "menu.system.monitor.log" : "系统日志", - "menu.system.monitor.serverInfo" : "服务器信息", + "menu.system.monitor": "系统监控", + "menu.system.monitor.auditlog": "审计日志", + "menu.system.monitor.log": "系统日志", + "menu.system.monitor.serverInfo": "服务器信息", "system.shared.selectUser.grid.title": "已包含用户列表", - "system.shared.selectUser.grid.toolbar.selectIn":"选入", - "system.shared.selectUser.grid.toolbar.selectOut":"选出", - "system.shared.selectUser.grid.toolbar.selectOut.tip":"您确定要选出用户吗?", - "system.shared.selectUser.grid.toolbar.selectAllIn":"选入所有用户", - "system.shared.selectUser.grid.toolbar.selectAllIn.tip":"您确定要选入全部用户吗?", - "system.shared.selectUser.grid.toolbar.selectAllOut":"选出所有用户", - "system.shared.selectUser.grid.toolbar.selectAllOut.tip":"您确定要选出全部用户吗?", + "system.shared.selectUser.grid.toolbar.selectIn": "选入", + "system.shared.selectUser.grid.toolbar.selectOut": "选出", + "system.shared.selectUser.grid.toolbar.selectOut.tip": "您确定要选出用户吗?", + "system.shared.selectUser.grid.toolbar.selectAllIn": "选入所有用户", + "system.shared.selectUser.grid.toolbar.selectAllIn.tip": "您确定要选入全部用户吗?", + "system.shared.selectUser.grid.toolbar.selectAllOut": "选出所有用户", + "system.shared.selectUser.grid.toolbar.selectAllOut.tip": "您确定要选出全部用户吗?", "system.shared.selectUser.dialog.title": "选择用户", "system.shared.selectUser.dialog.grid.title": "可选用户列表", "system.shared.selectRole.grid.title": "已包含角色列表", - "system.shared.selectRole.grid.toolbar.selectIn":"选入", - "system.shared.selectRole.grid.toolbar.selectOut":"选出", - "system.shared.selectRole.grid.toolbar.selectOut.tip":"您确定要选出角色吗?", - "system.shared.selectRole.grid.toolbar.selectAllIn":"选入所有角色", - "system.shared.selectRole.grid.toolbar.selectAllIn.tip":"您确定要选入全部角色吗?", - "system.shared.selectRole.grid.toolbar.selectAllOut":"选出所有角色", - "system.shared.selectRole.grid.toolbar.selectAllOut.tip":"您确定要选出全部角色吗?", + "system.shared.selectRole.grid.toolbar.selectIn": "选入", + "system.shared.selectRole.grid.toolbar.selectOut": "选出", + "system.shared.selectRole.grid.toolbar.selectOut.tip": "您确定要选出角色吗?", + "system.shared.selectRole.grid.toolbar.selectAllIn": "选入所有角色", + "system.shared.selectRole.grid.toolbar.selectAllIn.tip": "您确定要选入全部角色吗?", + "system.shared.selectRole.grid.toolbar.selectAllOut": "选出所有角色", + "system.shared.selectRole.grid.toolbar.selectAllOut.tip": "您确定要选出全部角色吗?", "system.shared.selectRole.dialog.title": "选择角色", "system.shared.selectRole.dialog.grid.title": "可选角色列表", "system.shared.selectOrg.grid.title": "机构树", - "system.shared.selectOrg.grid.toolbar.save.tip":"您确定要更新机构吗?", + "system.shared.selectOrg.grid.toolbar.save.tip": "您确定要更新机构吗?", "system.shared.selectApplication.grid.title": "已包含应用列表", - "system.shared.selectApplication.grid.toolbar.selectIn":"选入", - "system.shared.selectApplication.grid.toolbar.selectOut":"选出", - "system.shared.selectApplication.grid.toolbar.selectOut.tip":"您确定要选出应用吗?", - "system.shared.selectApplication.grid.toolbar.selectAllIn":"选入所有应用", - "system.shared.selectApplication.grid.toolbar.selectAllIn.tip":"您确定要选入全部应用吗?", - "system.shared.selectApplication.grid.toolbar.selectAllOut":"选出所有应用", - "system.shared.selectApplication.grid.toolbar.selectAllOut.tip":"您确定要选出全部应用吗?", + "system.shared.selectApplication.grid.toolbar.selectIn": "选入", + "system.shared.selectApplication.grid.toolbar.selectOut": "选出", + "system.shared.selectApplication.grid.toolbar.selectOut.tip": "您确定要选出应用吗?", + "system.shared.selectApplication.grid.toolbar.selectAllIn": "选入所有应用", + "system.shared.selectApplication.grid.toolbar.selectAllIn.tip": "您确定要选入全部应用吗?", + "system.shared.selectApplication.grid.toolbar.selectAllOut": "选出所有应用", + "system.shared.selectApplication.grid.toolbar.selectAllOut.tip": "您确定要选出全部应用吗?", "system.shared.selectApplication.dialog.title": "选择应用", "system.shared.selectApplication.dialog.grid.title": "可选应用列表", "system.shared.selectMenu.grid.title": "菜单树", - "system.shared.selectMenu.grid.toolbar.save.tip":"您确定要更新菜单吗?", + "system.shared.selectMenu.grid.toolbar.save.tip": "您确定要更新菜单吗?", "system.shared.importMenuPlugin.dialog.title": "导入菜单", @@ -73,137 +73,138 @@ "system.license.entity.expiredDate": "有效期结束日期", "system.license.entity.term": "期限(天)", "system.license.entity.macAddresses": "MAC 地址", + "system.license.entity.serverMacAddresses": "当前服务器活动网卡 MAC 地址", "system.license.updateDialog.title": "更新许可证", - "system.application.grid.title":"应用列表", - - "system.corporation.grid.title":"法人树", - "system.corporation.grid.toolbar.addTop":"新增顶级法人", - "system.corporation.grid.toolbar.addChild":"新增子法人", - - "system.user.grid.title":"用户列表", - "system.user.grid.toolbar.setPassword":"设置密码", - "system.user.grid.toolbar.setAllPassword":"设置所有密码", - "system.user.grid.toolbar.resetPassword":"重置密码", - "system.user.grid.toolbar.resetPassword.tip":"您确定要重置用户密码吗?", - "system.user.grid.toolbar.resetAllPassword":"重置所有密码", - "system.user.grid.toolbar.resetAllPassword.tip":"您确定要重置所有用户密码吗?", - - "system.role.grid.title":"角色列表", - - "system.org.grid.title":"机构树", - "system.org.grid.toolbar.addTop":"新增顶级机构", - "system.org.grid.toolbar.addChild":"新增子机构", - - "system.department.grid.title":"部门树", - "system.department.grid.toolbar.addTop":"新增顶级部门", - "system.department.grid.toolbar.addChild":"新增子部门", - - "system.menu.grid.title":"菜单树", - "system.menu.grid.toolbar.addTop":"新增顶级菜单", - "system.menu.grid.toolbar.addChild":"新增子菜单", - "system.menu.grid.entity.titleI18nKey":"标题多语言消息键", - "system.menu.grid.entity.asRoot":"是否作为根菜单显示", - "system.menu.grid.entity.javaScript":"JavaScript", - "system.menu.grid.entity.routeName":"路由名称", - "system.menu.grid.entity.routeQuery":"路由查询参数", - "system.menu.grid.entity.url":"URL", - "system.menu.grid.entity.urlOpenType":"URL 打开方式", - - "system.announcementManager.grid.title":"公告列表", - - "system.notification.grid.title":"消息列表", - "system.notification.grid.entity.sender":"发送者", - "system.notification.grid.entity.sendDate":"发送日期", - "system.notification.grid.entity.receiver":"接收者", - "system.notification.grid.entity.receiveDate":"接收日期", - - "system.parameter.grid.title":"系统参数", - - "system.dictionary.grid.title":"数据字典列表", - - "system.desensitizer.grid.title":"可脱敏数据字段列表", - - "system.i18n.grid.title":"多语言消息列表", - "system.i18n.grid.toolbar.removeAll.tip":"您确定要删除所有多语言消息吗?", - "system.i18n.grid.toolbar.importAll.tip":"您确定要导入所有多语言消息吗?", - - "system.datasource.grid.title":"数据源列表", - "system.datasource.grid.toolbar.connectionProperties":"连接属性", - "system.datasource.grid.entity.jndiName":"JNDI 名称", - "system.datasource.grid.entity.databaseType":"数据库类型", - "system.datasource.grid.entity.jdbcDriver":"JDBC 驱动程序", - "system.datasource.grid.entity.jdbcUrl":"JDBC URL", - "system.datasource.hikari.autoCommit":"是否自动提交(默认值:true)", - "system.datasource.hikari.connectionTimeout":"连接超时(单位:毫秒,默认值:30000,最小值:250)", - "system.datasource.hikari.idleTimeout":"空闲超时(单位:毫秒,默认值:600000,最小值:10000)", - "system.datasource.hikari.maxLifetime":"最大活动时间(单位:毫秒,默认值:1800000)", - "system.datasource.hikari.connectionTestQuery":"连接测试查询(JDBC4 无需填写)", - "system.datasource.hikari.minimumIdle":"最小空闲,默认值:池最大尺寸", - "system.datasource.hikari.maximumPoolSize":"池最大尺寸,默认值:10", - "system.datasource.hikari.metricRegistry":"监控指标注册器", - "system.datasource.hikari.healthCheckRegistry":"健康检查注册器", - "system.datasource.hikari.poolName":"连接池名称", - "system.datasource.hikari.initializationFailTimeout":"初始化失败超时", - "system.datasource.hikari.isolateInternalQueries":"内部查询是否要被隔离,默认值:false", - "system.datasource.hikari.allowPoolSuspension":"是否允许池暂停,默认值:false", - "system.datasource.hikari.readOnly":"是否只读,默认值:false", - "system.datasource.hikari.registerMbeans":"是否注册为 MBean,默认值:false", - "system.datasource.hikari.catalog":"目录", - "system.datasource.hikari.connectionInitSql":"连接初始化 sql", - "system.datasource.hikari.driverClassName":"JDBC 驱动类名称", - "system.datasource.hikari.transactionIsolation":"事务隔离度", - "system.datasource.hikari.validationTimeout":"验证超时(单位:毫秒,默认值:5000)", - "system.datasource.hikari.leakDetectionThreshold":"泄漏检测阈值(单位:毫秒,默认值:0-不进行泄漏检查,最小值:2000)", - "system.datasource.hikari.schema":"方案", - - "system.monitor.auditlog.grid.title":"审计日志列表", - - "system.monitor.log.tab.view":"日志查看", - "system.monitor.log.tab.download":"日志下载", - "system.monitor.log.tab.level":"日志级别", - "system.monitor.log.viewer.logRows":"显示日志文件最后行数", - "system.monitor.log.viewer.autoRefresh":"自动刷新(频率:1次/2秒,超过 300 次后停止自动刷新)", - "system.monitor.log.viewer.action.refreshNow":"刷新", - "system.monitor.log.download.grid.title":"日志文件列表", - "system.monitor.log.level.grid.title":"日志级别列表", - "system.monitor.log.level.entity.configuredLevel":"配置级别", - "system.monitor.log.level.entity.effectiveLevel":"生效级别", - - "system.monitor.serverInfo.hardware":"硬件", - "system.monitor.serverInfo.hardware.manufacturer":"生产商", - "system.monitor.serverInfo.hardware.model":"型号", - "system.monitor.serverInfo.hardware.serialNumber":"序列号", - "system.monitor.serverInfo.hardware.physicalProcessorCount":"物理处理器个数", - "system.monitor.serverInfo.hardware.logicalProcessorCount":"逻辑处理器个数", - "system.monitor.serverInfo.hardware.physicalMemory":"物理内存", - - "system.monitor.serverInfo.os":"操作系统", - "system.monitor.serverInfo.os.name":"名称", - "system.monitor.serverInfo.os.version":"版本", - "system.monitor.serverInfo.os.arch":"架构", - "system.monitor.serverInfo.os.manufacturer":"生产商", - "system.monitor.serverInfo.os.bootTime":"上次启动日期", - "system.monitor.serverInfo.os.upTime":"持续运行天数", - - "system.monitor.serverInfo.jvm":"Java 虚拟机", - "system.monitor.serverInfo.jvm.total":"当前占用的内存总数", - "system.monitor.serverInfo.jvm.max":"最大可用内存总数", - "system.monitor.serverInfo.jvm.free":"空闲内存", - "system.monitor.serverInfo.jvm.version":"JDK 版本", - "system.monitor.serverInfo.jvm.home":"JDK 路径", - - "system.monitor.serverInfo.cpu":"CPU", - "system.monitor.serverInfo.cpu.system":"系统", - "system.monitor.serverInfo.cpu.user":"用户", - - "system.monitor.serverInfo.memory":"内存", - - "system.monitor.serverInfo.disk":"存储", - "system.monitor.serverInfo.disk.used":"已用", - "system.monitor.serverInfo.disk.free":"空闲", - - "system.monitor.serverInfo.online":"在线用户", + "system.application.grid.title": "应用列表", + + "system.corporation.grid.title": "法人树", + "system.corporation.grid.toolbar.addTop": "新增顶级法人", + "system.corporation.grid.toolbar.addChild": "新增子法人", + + "system.user.grid.title": "用户列表", + "system.user.grid.toolbar.setPassword": "设置密码", + "system.user.grid.toolbar.setAllPassword": "设置所有密码", + "system.user.grid.toolbar.resetPassword": "重置密码", + "system.user.grid.toolbar.resetPassword.tip": "您确定要重置用户密码吗?", + "system.user.grid.toolbar.resetAllPassword": "重置所有密码", + "system.user.grid.toolbar.resetAllPassword.tip": "您确定要重置所有用户密码吗?", + + "system.role.grid.title": "角色列表", + + "system.org.grid.title": "机构树", + "system.org.grid.toolbar.addTop": "新增顶级机构", + "system.org.grid.toolbar.addChild": "新增子机构", + + "system.department.grid.title": "部门树", + "system.department.grid.toolbar.addTop": "新增顶级部门", + "system.department.grid.toolbar.addChild": "新增子部门", + + "system.menu.grid.title": "菜单树", + "system.menu.grid.toolbar.addTop": "新增顶级菜单", + "system.menu.grid.toolbar.addChild": "新增子菜单", + "system.menu.grid.entity.titleI18nKey": "标题多语言消息键", + "system.menu.grid.entity.asRoot": "是否作为根菜单显示", + "system.menu.grid.entity.javaScript": "JavaScript", + "system.menu.grid.entity.routeName": "路由名称", + "system.menu.grid.entity.routeQuery": "路由查询参数", + "system.menu.grid.entity.url": "URL", + "system.menu.grid.entity.urlOpenType": "URL 打开方式", + + "system.announcementManager.grid.title": "公告列表", + + "system.notification.grid.title": "消息列表", + "system.notification.grid.entity.sender": "发送者", + "system.notification.grid.entity.sendDate": "发送日期", + "system.notification.grid.entity.receiver": "接收者", + "system.notification.grid.entity.receiveDate": "接收日期", + + "system.parameter.grid.title": "系统参数", + + "system.dictionary.grid.title": "数据字典列表", + + "system.desensitizer.grid.title": "可脱敏数据字段列表", + + "system.i18n.grid.title": "多语言消息列表", + "system.i18n.grid.toolbar.removeAll.tip": "您确定要删除所有多语言消息吗?", + "system.i18n.grid.toolbar.importAll.tip": "您确定要导入所有多语言消息吗?", + + "system.datasource.grid.title": "数据源列表", + "system.datasource.grid.toolbar.connectionProperties": "连接属性", + "system.datasource.grid.entity.jndiName": "JNDI 名称", + "system.datasource.grid.entity.databaseType": "数据库类型", + "system.datasource.grid.entity.jdbcDriver": "JDBC 驱动程序", + "system.datasource.grid.entity.jdbcUrl": "JDBC URL", + "system.datasource.hikari.autoCommit": "是否自动提交(默认值:true)", + "system.datasource.hikari.connectionTimeout": "连接超时(单位:毫秒,默认值:30000,最小值:250)", + "system.datasource.hikari.idleTimeout": "空闲超时(单位:毫秒,默认值:600000,最小值:10000)", + "system.datasource.hikari.maxLifetime": "最大活动时间(单位:毫秒,默认值:1800000)", + "system.datasource.hikari.connectionTestQuery": "连接测试查询(JDBC4 无需填写)", + "system.datasource.hikari.minimumIdle": "最小空闲,默认值:池最大尺寸", + "system.datasource.hikari.maximumPoolSize": "池最大尺寸,默认值:10", + "system.datasource.hikari.metricRegistry": "监控指标注册器", + "system.datasource.hikari.healthCheckRegistry": "健康检查注册器", + "system.datasource.hikari.poolName": "连接池名称", + "system.datasource.hikari.initializationFailTimeout": "初始化失败超时", + "system.datasource.hikari.isolateInternalQueries": "内部查询是否要被隔离,默认值:false", + "system.datasource.hikari.allowPoolSuspension": "是否允许池暂停,默认值:false", + "system.datasource.hikari.readOnly": "是否只读,默认值:false", + "system.datasource.hikari.registerMbeans": "是否注册为 MBean,默认值:false", + "system.datasource.hikari.catalog": "目录", + "system.datasource.hikari.connectionInitSql": "连接初始化 sql", + "system.datasource.hikari.driverClassName": "JDBC 驱动类名称", + "system.datasource.hikari.transactionIsolation": "事务隔离度", + "system.datasource.hikari.validationTimeout": "验证超时(单位:毫秒,默认值:5000)", + "system.datasource.hikari.leakDetectionThreshold": "泄漏检测阈值(单位:毫秒,默认值:0-不进行泄漏检查,最小值:2000)", + "system.datasource.hikari.schema": "方案", + + "system.monitor.auditlog.grid.title": "审计日志列表", + + "system.monitor.log.tab.view": "日志查看", + "system.monitor.log.tab.download": "日志下载", + "system.monitor.log.tab.level": "日志级别", + "system.monitor.log.viewer.logRows": "显示日志文件最后行数", + "system.monitor.log.viewer.autoRefresh": "自动刷新(频率:1次/2秒,超过 300 次后停止自动刷新)", + "system.monitor.log.viewer.action.refreshNow": "刷新", + "system.monitor.log.download.grid.title": "日志文件列表", + "system.monitor.log.level.grid.title": "日志级别列表", + "system.monitor.log.level.entity.configuredLevel": "配置级别", + "system.monitor.log.level.entity.effectiveLevel": "生效级别", + + "system.monitor.serverInfo.hardware": "硬件", + "system.monitor.serverInfo.hardware.manufacturer": "生产商", + "system.monitor.serverInfo.hardware.model": "型号", + "system.monitor.serverInfo.hardware.serialNumber": "序列号", + "system.monitor.serverInfo.hardware.physicalProcessorCount": "物理处理器个数", + "system.monitor.serverInfo.hardware.logicalProcessorCount": "逻辑处理器个数", + "system.monitor.serverInfo.hardware.physicalMemory": "物理内存", + + "system.monitor.serverInfo.os": "操作系统", + "system.monitor.serverInfo.os.name": "名称", + "system.monitor.serverInfo.os.version": "版本", + "system.monitor.serverInfo.os.arch": "架构", + "system.monitor.serverInfo.os.manufacturer": "生产商", + "system.monitor.serverInfo.os.bootTime": "上次启动日期", + "system.monitor.serverInfo.os.upTime": "持续运行天数", + + "system.monitor.serverInfo.jvm": "Java 虚拟机", + "system.monitor.serverInfo.jvm.total": "当前占用的内存总数", + "system.monitor.serverInfo.jvm.max": "最大可用内存总数", + "system.monitor.serverInfo.jvm.free": "空闲内存", + "system.monitor.serverInfo.jvm.version": "JDK 版本", + "system.monitor.serverInfo.jvm.home": "JDK 路径", + + "system.monitor.serverInfo.cpu": "CPU", + "system.monitor.serverInfo.cpu.system": "系统", + "system.monitor.serverInfo.cpu.user": "用户", + + "system.monitor.serverInfo.memory": "内存", + + "system.monitor.serverInfo.disk": "存储", + "system.monitor.serverInfo.disk.used": "已用", + "system.monitor.serverInfo.disk.free": "空闲", + + "system.monitor.serverInfo.online": "在线用户", "system.monitor.serverInfo.serviceRequest": "服务请求" } diff --git a/io.sc.platform.system.frontend/src/views/license/License.vue b/io.sc.platform.system.frontend/src/views/license/License.vue index f0e1bec5..cd796535 100644 --- a/io.sc.platform.system.frontend/src/views/license/License.vue +++ b/io.sc.platform.system.frontend/src/views/license/License.vue @@ -24,6 +24,7 @@
{{ $t('system.license.entity.expiredDate') }} : {{ licenseRef?.expiredDate }}
{{ $t('system.license.entity.term') }} : {{ licenseRef?.term }}
{{ $t('system.license.entity.macAddresses') }} : {{ licenseRef?.macAddresses }}
+
{{ $t('system.license.entity.serverMacAddresses') }} : {{ licenseRef?.serverMacAddresses }}
diff --git a/io.sc.platform.system.frontend/src/views/menu/Menu.vue b/io.sc.platform.system.frontend/src/views/menu/Menu.vue index 2123a7fb..e90708c5 100644 --- a/io.sc.platform.system.frontend/src/views/menu/Menu.vue +++ b/io.sc.platform.system.frontend/src/views/menu/Menu.vue @@ -9,7 +9,7 @@ selection="multiple" :checkbox-selection="true" :tree="true" - dndMode="server" + dnd-mode="server" :tree-icon=" (row) => { if (row.type === 'SEPARATOR') { @@ -80,7 +80,7 @@ form: { colsNum: 1, fields: [ - { name: 'parent', label: $t('parent'), type: 'w-text', hidden: true }, + { name: 'parent', label: $t('parent'), type: 'w-text', showIf: false }, { name: 'type', label: $t('type'), diff --git a/io.sc.standard.frontend/.eslintrc.cjs b/io.sc.standard.frontend/.eslintrc.cjs index b8726ddf..90511fd3 100644 --- a/io.sc.standard.frontend/.eslintrc.cjs +++ b/io.sc.standard.frontend/.eslintrc.cjs @@ -65,5 +65,6 @@ module.exports = { 'no-prototype-builtins': 'off', 'prefer-rest-params': 'off', 'no-control-regex': 'off', + 'no-case-declarations': 'off', }, }; diff --git a/io.sc.standard.frontend/package.json b/io.sc.standard.frontend/package.json index 49ea2457..ca683e9f 100644 --- a/io.sc.standard.frontend/package.json +++ b/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.416", + "platform-core": "8.1.430", "quasar": "2.17.0", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.website/package.json b/io.sc.website/package.json index 8261851f..99617d22 100644 --- a/io.sc.website/package.json +++ b/io.sc.website/package.json @@ -28,6 +28,6 @@ }, "dependencies": { "vue": "3.5.10", - "platform-core": "8.1.416" + "platform-core": "8.1.430" } } \ No newline at end of file