From 7c0f164e9f70d72d8a52691cec1786d312a223a9 Mon Sep 17 00:00:00 2001
From: rouchen <3133657697@qq.com>
Date: Thu, 9 May 2024 09:40:07 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=84=E5=88=99=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=20=E4=BF=9D=E5=AD=98=E4=BB=A3=E7=A0=81(?=
=?UTF-8?q?=E5=8F=AF=E4=BF=AE=E6=94=B9)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Encoding/index.vue | 12 +-
src/views/kvt/kvt/index.vue | 4 +
src/views/ruleEngine/engineVersion/index.vue | 202 ++++++++++++++++++-
3 files changed, 209 insertions(+), 9 deletions(-)
diff --git a/src/components/Encoding/index.vue b/src/components/Encoding/index.vue
index c99fb08..6972320 100644
--- a/src/components/Encoding/index.vue
+++ b/src/components/Encoding/index.vue
@@ -1,6 +1,6 @@
根据邮箱规则进行数据校验,内包含所有邮箱校验规则
", + "remark": "-", + "code": "email", + "level": "data-field" + }, + ], // "id": 1, // "name": "邮箱规则", // "type": "rule-custom", @@ -414,7 +455,65 @@ export default { price: "653.69", create_time: "2024-5-7 16:37:16", }, - testResult: "" + testResult: "", + // 数据实例集合 + dataModeMapList : [ + { + id: 1, + name: "张三", + sex: 1, + price: "264.69", + create_time: "2024-5-7 16:37:16", + }, + { + id: 2, + name: "李四", + sex: 2, + price: "362.69", + create_time: "2023-1-7 41:22:08", + }, + { + id: 3, + name: "王五", + sex: 0, + price: "485.69", + create_time: "1996-4-7 02:14:36", + }, + { + id: 4, + name: "赵六", + sex: 0, + price: "485.69", + create_time: "2004-4-7 02:14:36", + }, + { + id: 5, + name: "猪八戒", + sex: 0, + price: "485.69", + create_time: "1969-4-7 02:14:36", + }, + { + id: 6, + name: "孙悟空", + sex: 1, + price: "485.44", + create_time: "2015-4-7 02:14:36", + }, + { + id: 7, + name: "唐三", + sex: 0, + price: "635.69", + create_time: "2003-5-7 16:37:16", + }, + ], + dataModeMapIndex: 0, + dataRecordSelectData: null, + // 条记录选中key集合 + dataRecordSelectKeyList: [], + // 选择行记录List + changeDataList: [], } }, created() { @@ -439,11 +538,36 @@ export default { }); }, methods: { + // 测试 + dataTest(){ + let number = Math.floor(Math.random()*3); + if (number === 0){ + this.testResult = "测试正常,无异常数据返回"; + }else if (number === 1){ + this.testResult = "测试失败:触发*****异常条例,数据发生动作【移除/忽略/记录】"; + }else if (number === 2){ + this.testResult = "程序异常:*******异常"; + } + }, + // 选择数据行 + changeDataRow(val){ + this.changeDataList = val; + }, + // 记录选中 + dataRecordSelect(row){ + this.dataRecordSelectKeyList = []; + this.dataRecordSelectData = row; + }, + // 单条随机数据 + dataModelRandom(){ + this.dataModeMapIndex = Math.floor(Math.random()*this.dataModeMapList.length); + }, saveCoding(){ updataEngineVersionStatus(this.ruleEngineVersionInfoAndTest).then(res => { - this.$message.success(res) + this.$message.success(res.data) }) - + this.ruleEngineVersionInfoStatus = false + this.initRuleEngine(this.ruleEngine); }, ruleEngineVersionInfoStatusClose(done) { this.$confirm('确认关闭?') @@ -578,6 +702,69 @@ export default { // ] // } // } + // this.ruleEngineInfo = this.ruleEngineInfoList.findLast(ruleInfo => ruleInfo.id == this.ruleEngineId) + // this.ruleEngineInfo.ruleEngineVersionList = [ + // { + // "name": "163剔除", "code": "IAW3S02", "status": "0", "isTest": "0", + // "versionCode": "engine_custom_email_IAW3S02", "isActivate": "no-activate", + // "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": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
","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", + // "versionCode": "engine_custom_email_DJ8S9EA", "isActivate": "no-activate", + // "description": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
" + // }, + // { + // "name": "邮箱默认值操作", "code": "XJS9E0S", "status": "1", "isTest": "0", + // "versionCode": "engine_custom_email_XJS9E0S", "isActivate": "no-activate", + // "description": "根据邮箱规则进行数据校验,内包含所有邮箱校验规则
" + // } + // ] selectRuleEngineVersion(ruleEngine).then(res => { console.log("ressss",res) this.ruleEngineInfo = res.data; @@ -585,7 +772,6 @@ export default { }, // 获取代码模板 getCodeIng(){ - let packageName = "com.muyu.engine"; let customName = "custom"; let templateName = "template";