From 44e2f6881319104671314c3f48103025d7c1f2d0 Mon Sep 17 00:00:00 2001
From: DongZeLiang <2746733890@qq.com>
Date: Tue, 7 May 2024 16:49:50 +0800
Subject: [PATCH] =?UTF-8?q?feat():=20=E8=A7=84=E5=88=99=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=EF=BC=9A=E6=95=85=E9=9A=9C=E5=BC=95=E6=93=8E=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Encoding/index.vue | 6 +-
src/views/ruleEngine/engineVersion/index.vue | 313 ++++++++++++++++++-
2 files changed, 307 insertions(+), 12 deletions(-)
diff --git a/src/components/Encoding/index.vue b/src/components/Encoding/index.vue
index 31344f8..b0b395d 100644
--- a/src/components/Encoding/index.vue
+++ b/src/components/Encoding/index.vue
@@ -1,6 +1,6 @@
-
-
+
+
@@ -75,7 +75,7 @@ export default {
.CodeMirror {
font-family: 'JetBrainsMono-Medium', monospace;
- height: 800px;
+ height: 500px;
}
.CodeMirror-lines {
diff --git a/src/views/ruleEngine/engineVersion/index.vue b/src/views/ruleEngine/engineVersion/index.vue
index 56bb878..9e27d21 100644
--- a/src/views/ruleEngine/engineVersion/index.vue
+++ b/src/views/ruleEngine/engineVersion/index.vue
@@ -43,7 +43,9 @@
规则详情
- 测试规则
+ 测试规则
{{ruleEngineVersion.isActivate !== 'no-activate' ? "禁用" : "激活"}}规则
@@ -130,16 +132,109 @@
+
+
+ {{ruleEngineVersionInfoAndTest.versionCode}}
+ {{ruleEngineVersionInfoAndTest.name}}
+ {{ruleEngineVersionInfoAndTest.code}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存代码
+
+
+
-
+
+
+
+ {{ruleEngineVersionInfoAndTest.versionCode}}
+ {{ruleEngineVersionInfoAndTest.name}}
+ {{ruleEngineVersionInfoAndTest.code}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择数据接入
+
+
+
+
+
+
+
+
+
+ 选择资产结构
+
+
+
+
+
+
+
+
+
+ 选择资产模型
+
+
+
+ {{dataModeMap[_dataModel.name]}}
+
+
+
+
+
+ 测试
+
+
+
+
@@ -181,21 +276,178 @@ export default {
ruleEngineVersionInfoStatus: false,
// 测试抽屉状态
ruleEngineVersionTestStatus: false,
-
+ // 弹框抽屉
+ ruleEngineVersionInfoAndTest: {},
+ // 数据接入集合
+ assetStructureList: [
+ {
+ name: "测试1",
+ systemName: "云计算系统",
+ databaseName: "yunjisuan",
+ type: "dataSource"
+ },
+ {
+ name: "测试2",
+ systemName: "网站系统",
+ databaseName: "wangzhan",
+ type: "dataSource"
+ },
+ {
+ name: "测试3",
+ systemName: "物联网系统",
+ databaseName: "wulianwang",
+ type: "dataSource"
+ },
+ {
+ name: "测试4",
+ systemName: "传媒系统",
+ databaseName: "chuanmei",
+ type: "dataSource"
+ },
+ ],
+ // 数据接入集合选择
+ assetStructure: null,
+ // 数据资产
+ assetsList: [
+ {
+ name: "sys_user",
+ as: "用户表",
+ dataTotal: 635847,
+ type: "dataTable",
+ childrenList: []
+ },
+ {
+ name: "sys_dept",
+ as: "部门表",
+ dataTotal: 362548,
+ type: "dataTable",
+ childrenList: []
+ },
+ {
+ name: "sys_notice",
+ as: "通知公告",
+ dataTotal: 6347,
+ type: "dataTable",
+ childrenList: []
+ }
+ ],
+ // 数据资产选择
+ assets: null,
+ // 数据模型
+ dataModelList: [
+ {
+ id: 1,
+ name: "id",
+ comment: "主键",
+ isPrimaryKey: "Y",
+ type: "bigint",
+ mappingType: "Long",
+ length: "-",
+ decimalPlaces: "-",
+ isNull: "N",
+ defaultValue: "-",
+ isDict: "N",
+ dictKey: "-",
+ }, {
+ id: 2,
+ name: "name",
+ comment: "姓名",
+ isPrimaryKey: "N",
+ type: "varchar",
+ mappingType: "String",
+ length: "64",
+ decimalPlaces: "-",
+ isNull: "N",
+ defaultValue: "-",
+ isDict: "N",
+ dictKey: "-",
+ }, {
+ id: 3,
+ name: "sex",
+ comment: "性别",
+ isPrimaryKey: "N",
+ type: "char",
+ mappingType: "String",
+ length: "1",
+ decimalPlaces: "-",
+ isNull: "N",
+ defaultValue: "-",
+ isDict: "Y",
+ dictKey: "system_sex",
+ }, {
+ id: 4,
+ name: "price",
+ comment: "金额",
+ isPrimaryKey: "N",
+ type: "double",
+ mappingType: "BigDecimal",
+ length: "10",
+ decimalPlaces: "2",
+ isNull: "N",
+ defaultValue: "0.00",
+ isDict: "N",
+ dictKey: "-",
+ }, {
+ id: 5,
+ name: "create_time",
+ comment: "创建时间",
+ isPrimaryKey: "N",
+ type: "datetime",
+ mappingType: "Date",
+ length: "-",
+ decimalPlaces: "-",
+ isNull: "Y",
+ defaultValue: "-",
+ isDict: "N",
+ dictKey: "-",
+ }, ],
+ // 数据模型选择
+ dataMode: null,
+ // 数据示例
+ dataModeMap: {
+ id: 1,
+ name: "张三",
+ sex: 1,
+ price: "653.69",
+ create_time: "2024-5-7 16:37:16",
+ },
+ testResult: ""
}
},
created() {
this.initRuleEngine();
},
methods: {
+
+ saveCoding(){
+ this.$message.success('编码保存成功');
+ },
+ ruleEngineVersionInfoStatusClose(done) {
+ this.$confirm('确认关闭?')
+ .then(_ => {
+ this.ruleEngineVersionInfoAndTest = {};
+ done();
+ })
+ .catch(_ => {});
+ },
+ ruleEngineVersionTestStatusClose(done) {
+ this.$confirm('确认关闭?')
+ .then(_ => {
+ this.ruleEngineVersionInfoAndTest = {};
+ done();
+ })
+ .catch(_ => {});
+ },
// 点击规则事件
checkRuleEngineVersion(command) {
switch (command.event) {
case "info"://详情
- this.ruleEngineVersionInfoStatus = true
+ this.ruleEngineVersionInfoStatus = true;
+ this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
break;
case "test"://测试
- this.ruleEngineVersionTestStatus = true
+ this.ruleEngineVersionTestStatus = true;
+ this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
break;
case "status"://激活状态
command.ruleEngineVersion.isActivate = 'no-activate' === command.ruleEngineVersion.isActivate ? 'activated' : 'no-activate'
@@ -270,12 +522,52 @@ export default {
{
"name": "163剔除", "code": "IAW3S02", "status": "0", "isTest": "0",
"versionCode": "engine_custom_email_IAW3S02", "isActivate": "no-activate",
- "description": "
根据邮箱规则进行数据校验,内包含所有邮箱校验规则
"
+ "description": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
","codeIng": "package com.muyu.rule.engine.custom;\n" +
+ "\n" +
+ "import com.muyu.engine.action.ActionDiscard;\n" +
+ "import com.muyu.engine.scope.DataModelEngine;\n" +
+ "\n" +
+ "/**\n" +
+ " * @Author: DongZeLiang\n" +
+ " * @date: 2024/5/6\n" +
+ " * @Description: ce-IAW3S02\n" +
+ " * @Version: 1.0\n" +
+ " */\n" +
+ "public class engine_custom_email_IAW3S02 extends DataModelEngine {\n" +
+ " @Override\n" +
+ " public void execution () {\n" +
+ " Object value = getValue();\n" +
+ "\n" +
+ " if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
+ " throw new ActionDiscard();\n" +
+ " }\n" +
+ " }\n" +
+ "}"
},
{
"name": "筛选不合规邮箱", "code": "JISID8S", "status": "2", "isTest": "1",
"versionCode": "engine_custom_email_JISID8S", "isActivate": "activated",
- "description": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
"
+ "description": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
","codeIng": "package com.muyu.rule.engine.custom;\n" +
+ "\n" +
+ "import com.muyu.engine.action.ActionDiscard;\n" +
+ "import com.muyu.engine.scope.DataModelEngine;\n" +
+ "\n" +
+ "/**\n" +
+ " * @Author: DongZeLiang\n" +
+ " * @date: 2024/5/6\n" +
+ " * @Description: ce-JISID8S\n" +
+ " * @Version: 1.0\n" +
+ " */\n" +
+ "public class engine_custom_email_JISID8S extends DataModelEngine {\n" +
+ " @Override\n" +
+ " public void execution () {\n" +
+ " Object value = getValue();\n" +
+ "\n" +
+ " if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
+ " throw new ActionDiscard();\n" +
+ " }\n" +
+ " }\n" +
+ "}"
},
{
"name": "剔除自定义邮箱", "code": "DJ8S9EA", "status": "2", "isTest": "2",
@@ -338,4 +630,7 @@ public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
.el-icon-arrow-down {
font-size: 12px;
}
+.CodeMirror {
+ height: 600px;
+}