From 9ff9e0a3e41256277d5e87c57b192643745226b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=86=99=E6=9C=9D?=
<13694051+wangxizhao123@user.noreply.gitee.com>
Date: Tue, 14 May 2024 22:39:57 +0800
Subject: [PATCH] =?UTF-8?q?feat()=E9=9A=8F=E6=9C=BA=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=98=9F=E5=88=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/test/testData.js | 11 +-
src/views/engine/edition/index.vue | 224 ++++++++++++++++-------------
2 files changed, 135 insertions(+), 100 deletions(-)
diff --git a/src/api/test/testData.js b/src/api/test/testData.js
index e73ed67..8f29a0d 100644
--- a/src/api/test/testData.js
+++ b/src/api/test/testData.js
@@ -1,9 +1,16 @@
import request from '@/utils/request'
// 查询引擎列表
-export function randomField(id,tableName) {
+export function getRabdomData(id,tableName,ruleLevel) {
return request({
- url: '/test/data/randomField?id=' + id + "&tableName=" + tableName,
+ url: '/test/extract/getRabdomData?id=' + id + "&tableName=" + tableName + "&ruleLevel=" + ruleLevel,
+ method: 'get'
+ })
+}
+
+export function getColumn(id,tableName,ruleLevel) {
+ return request({
+ url: '/test/extract/getColumn?id=' + id + "&tableName=" + tableName + "&ruleLevel=" + ruleLevel,
method: 'get'
})
}
diff --git a/src/views/engine/edition/index.vue b/src/views/engine/edition/index.vue
index e6f9908..7f3c5dd 100644
--- a/src/views/engine/edition/index.vue
+++ b/src/views/engine/edition/index.vue
@@ -176,95 +176,81 @@
-
-
- 选择资产结构
-
-
-
-
-
-
-
-
-
- 选择资产模型
-
-
-
- 任务
-
-
-
-
-
- 选择资产模型
-
- 数据集
-
-
-
-
-
-
-
-
-
-
- 选择资产模型
-
- 记录
-
-
-
-
-
-
-
-
-
-
-
- 选择资产模型
-
- 数据字段
-
-
-
-
-
-
-
-
-
- 选择字段
-
- 记录
-
-
-
- 选择字段
-
- 字段
-
-
- {{tab.val}}
-
-
-
+
+
+
+
+ 选择资产结构
+
+
+
+
+
+
+
+
+
+
+ 选择资产模型
+
+
+
+
+
+
+
+
+
+ 任务
+
+
+
+
+ 数据集
+
+
+
+
+
+
+
+ 清空选择
+
+
+
+
+ 记录
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
+
+ 数据字段
+
+
+
+ {{tab.val}}
+
+
+
+
@@ -274,7 +260,7 @@
import { selectRuleEngineOne, updateRuleIsActivate, updateRuleStatus, spliceNameToCode } from "@/api/goods/engine";
import { selectListRuleId, getEdition, delEdition, addEdition, updateEdition } from "@/api/goods/edition";
import { selectFrimary } from "@/api/system/accredit";
-import { randomField } from "@/api/test/testData";
+import { getRabdomData, getColumn } from "@/api/test/testData";
import Encoding from "@/components/Encoding/index.vue";
export default {
@@ -302,7 +288,7 @@ export default {
// 总条数
total: 0,
// 规则引擎版本表格数据
- editionList: [],
+ editionList: null,
// 弹出层标题
title: "",
// 是否显示弹出层
@@ -319,14 +305,19 @@ export default {
//测试表单
ruleEngineTest:{},
primary: [],
+ //数据模型
+ dataModelList: [],
//复选列
columns: [],
//单选列
- columnOne: null,
+ columnOne: [],
+ columnOne2: [],
//复选字段
fields: [],
+ fieldd: [],
//父类列
- primaryId: null,
+ primaryId: [],
+ tableLisrs: null,
// 表单参数
form: {
versionClass: "",
@@ -340,6 +331,14 @@ export default {
}
};
},
+ watch: {
+ // 监控conditionVar变量
+ tableLisrs(newVal, oldVal) {
+ if (newVal !== null && newVal !== oldVal) {
+ this.executeApi(); // 当tableLists不为null且变化时,执行接口请求的方法
+ }
+ },
+},
created() {
this.getList();
},
@@ -357,20 +356,50 @@ export default {
* 随机字段
* @param id
*/
- dield(id,tableName) {
- alert(tableName)
- randomField(id,tableName).then(res => {
+ dield(tableLisrs,ruleLevel) {
+ console.log(tableLisrs)
+ var id = parseInt(tableLisrs.split('')[0]);
+ var tableName = tableLisrs.slice(1)
+ getRabdomData(id,tableName,ruleLevel).then(res => {
this.fields = res.data;
console.log(res.data)
})
},
+ //显示队列
+ executeApi() {
+ var id = parseInt(this.tableLisrs.split('')[0]);
+ var tableName = this.tableLisrs.slice(1)
+ getColumn(id,tableName,this.ruleInfo.ruleLevel).then(res => {
+ this.columnOne = res.data
+ var list = this.columnOne;
+ var list2 = [];
+ list.forEach(function (sublist) {
+ var dict2 = {}
+ sublist.forEach(function (item) {
+ dict2[item["key"]] = item["val"];
+ })
+ list2.push(dict2)
+ })
+ this.columnOne2 = list2;
+ console.log(list2)
+ console.log(res.data)
+ console.log(this.columnOne2)
+ })
+ },
+ toggleSelection() {
+ this.$refs.multipleTable.clearSelection();
+ },
+ //读取队列
+ dataRecordSelect(row) {
+ console.log(row)
+ this.fieldd = row
+ },
/** 查询规则引擎版本列表 */
getList() {
this.form.ruleId = this.ruleId
selectFrimary().then(res => {
this.primary = res.data
})
- this.primaryId = null
selectRuleEngineOne(this.ruleId).then(res => {
this.ruleInfo = res.data;
})
@@ -388,7 +417,6 @@ export default {
saveCoding(row) {
updateEdition(row).then(res => {
this.$message.success(res.data)
-
})
},
// 执行操作