diff --git a/src/api/rule/ruleEdition.js b/src/api/rule/ruleEdition.js
index d5798e0..cc3f1bd 100644
--- a/src/api/rule/ruleEdition.js
+++ b/src/api/rule/ruleEdition.js
@@ -79,6 +79,14 @@ export function findTableIdByParentId(id) {
method: 'post',
})
}
+//表
+export function findTableValueByTableName(basicId,tableName) {
+ return request({
+ url: `/source/value/findTableValueByTableName?basicId=`+basicId+'&&tableName='+tableName,
+ method: 'post',
+ })
+}
+
//保存代码
export function updateRuleEngine(data) {
@@ -88,3 +96,11 @@ export function updateRuleEngine(data) {
data: data
})
}
+//规则测试
+export function measurement(data) {
+ return request({
+ url: '/rule/ruleEdition/measurement',
+ method: 'post',
+ data: data
+ })
+}
diff --git a/src/views/rule/rule/version.vue b/src/views/rule/rule/version.vue
index 2c9482f..4be85e2 100644
--- a/src/views/rule/rule/version.vue
+++ b/src/views/rule/rule/version.vue
@@ -118,6 +118,7 @@
+
@@ -260,9 +261,8 @@
- 保存代码
-
+
@@ -312,13 +312,15 @@
-
-
+
+
@@ -342,7 +344,7 @@
选择资产结构
-
+
@@ -353,31 +355,104 @@
选择资产集
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{tableDatas}}
+
+
+
+
+
-
- {{ scope.row.date }}
+ 选择
+
-
-
-
+
-
+
+
+
+ 测试
+
+
-
+
@@ -390,8 +465,8 @@ import {
disable,
enable, findTableIdByParentId,
getEditionList,
- getFindByEditionId, selectById,
- updateRule, updateRuleEngine
+ getFindByEditionId, selectById, measurement,
+ updateRule, updateRuleEngine, findTableValueByTableName
} from "@/api/rule/ruleEdition";
@@ -419,7 +494,8 @@ export default {
theme: "ambiance",
lint: true, // 开启语法检查
},
-
+ tableData: [],
+ tableDatas: [],
ruleAndEditionList: [],
//版本
ruleAndEdition: {},
@@ -486,8 +562,6 @@ export default {
{required: true, message: "是否激活;是否激活不能为空", trigger: "blur"}
],
}
-
-
};
},
created() {
@@ -495,30 +569,52 @@ export default {
this.findById();
this.findList()
this.getDataOrigin()
+ this.findTableValueByTableName();
},
//生命周期 - 挂载完成(可以访问DOM元素)",
mounted() {
this.findById();
},
methods: {
- //保存代码
- preserve() {
- updateRuleEngine(this.form).then(res => {
- this.$modal.msgSuccess("修改成功");
+ //表数据
+ handleEditSelect(data) {
+ findTableValueByTableName(data.basicId, data.tableName).then(res => {
+ console.log(res.data)
+ this.tableDatas = res.data
+ alert(res.data)
})
},
+ //规则测试
+ measurements(data) {
+ this.tableDatas=data
+ measurement(data).then(res => {
+ this.$modal.msgSuccess("操作成功");
+ })
+ },
+ //保存代码
+ preserve() {
+ this.$refs["form"].validate(valid => {
+ updateRuleEngine(this.form).then(response => {
+ alert(this.form.ruleEngine)
+ // console.log(this.form)
+ this.$modal.msgSuccess("修改成功");
+ });
+ });
+ },
+
+
//数据接入源
getDataOrigin() {
selectById(this.dataOrigin).then(res => {
this.origins = res.data
- console.log("origins", this.origins)
+ // console.log("origins", this.origins)
})
},
chanChild() {
findTableIdByParentId(this.dataOrigin.sourceId).then(res => {
this.tableOrigin = res.data
- console.log("tableOrigin", this.tableOrigin)
+ // console.log(this.tableOrigin)
})
},
//禁用
@@ -556,8 +652,9 @@ export default {
addGenerate(this.form).then(res => {
this.form.ruleKind = res.data.ruleKind
this.form.ruleEngine = res.data.ruleEngine
- alert(this.form.ruleKind)
+ alert(this.form.ruleEngine)
this.showCode = true
+ this.findList()
debugger
})
},
diff --git a/src/views/source/index.vue b/src/views/source/index.vue
index 9e2cc7a..52907eb 100644
--- a/src/views/source/index.vue
+++ b/src/views/source/index.vue
@@ -178,14 +178,12 @@
+
+
+
-
是
否
-
-
-
-
@@ -285,6 +283,7 @@ export default {
maxNum: null,
maxWaitTime: null,
maxWaitSize: null,
+ driverName: null,
createBy: null,
createTime: null,
updateBy: null,