Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/api/rule/ruleEdition.js
#	src/views/quest/node/components/node/type/exporFind.vue
#	src/views/rule/rule/version.vue
master^2^2
chentaisen 2024-09-10 09:22:21 +08:00
commit 4bad952be3
12 changed files with 2636 additions and 197 deletions

View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 查询规则维护列表
export function listRuleInfo(data) {
return request({
url: '/engine/ruleInfo/list',
method: 'post',
params: {pageNum:data.pageNum,pageSize:data.pageSize},
data
})
}
// 查询规则维护详细
export function getRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'get'
})
}
// 新增规则维护
export function addRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'post',
data: data
})
}
// 修改规则维护
export function updateRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'put',
data: data
})
}
// 删除规则维护
export function delRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,123 @@
import request from '@/utils/request'
// 查询规则版本列表
export function listRuleVersion(data) {
return request({
url: '/engine/ruleVersion/list',
method: 'post',
params: {pageNum: data.pageNum, pageSize: data.pageSize},
data
})
}
// 查询规则版本详细
export function getRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'get'
})
}
// 新增规则版本
export function addRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'post',
data: data
})
}
// 修改规则版本
export function updateRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'put',
data: data
})
}
// 删除规则版本
export function delRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'delete'
})
}
//存储代码
export function writeFile(data) {
return request({
url: '/engine/ruleVersion/writeFile',
method: 'post',
data
})
}
//查询代码
export function readFile(fileName) {
return request({
url: `/engine/ruleVersion/readFile/${fileName}`,
method: 'post'
})
}
//库表二级联动
export function getTableInfoList() {
return request({
url: '/engine/ruleVersion/dataSource/tableInfo',
method: 'get',
})
}
//库表二级联动
export function getDataAnalysis(id) {
return request({
url: `/engine/ruleVersion/dataSource/table/${id}`,
method: 'get',
})
}
//获取KTLV数据
export function getEtlTableData(data) {
return request({
url: `/engine/ruleVersion/getEtlTableData`,
method: 'post',
data
})
}
//测试值
export function execution(data) {
return request({
url: `/engine/ruleVersion/execution/${data.engineKey}`,
method: 'post',
data
})
}
//测试行
export function lineFile(data) {
return request({
url: `/engine/ruleVersion/lineFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//测试组
export function groupFile(data) {
return request({
url: `/engine/ruleVersion/groupFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//判断类是否已存在
export function isClassExist(val) {
return request({
url: `/engine/ruleVersion/isClassExist/${val}`,
method: 'get',
})
}

View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 查询规则维护列表
export function listRuleInfo(data) {
return request({
url: '/engine/ruleInfo/list',
method: 'post',
params: {pageNum:data.pageNum,pageSize:data.pageSize},
data
})
}
// 查询规则维护详细
export function getRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'get'
})
}
// 新增规则维护
export function addRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'post',
data: data
})
}
// 修改规则维护
export function updateRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'put',
data: data
})
}
// 删除规则维护
export function delRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,123 @@
import request from '@/utils/request'
// 查询规则版本列表
export function listRuleVersion(data) {
return request({
url: '/engine/ruleVersion/list',
method: 'post',
params: {pageNum: data.pageNum, pageSize: data.pageSize},
data
})
}
// 查询规则版本详细
export function getRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'get'
})
}
// 新增规则版本
export function addRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'post',
data: data
})
}
// 修改规则版本
export function updateRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'put',
data: data
})
}
// 删除规则版本
export function delRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'delete'
})
}
//存储代码
export function writeFile(data) {
return request({
url: '/engine/ruleVersion/writeFile',
method: 'post',
data
})
}
//查询代码
export function readFile(fileName) {
return request({
url: `/engine/ruleVersion/readFile/${fileName}`,
method: 'post'
})
}
//库表二级联动
export function getTableInfoList() {
return request({
url: '/engine/ruleVersion/dataSource/tableInfo',
method: 'get',
})
}
//库表二级联动
export function getDataAnalysis(id) {
return request({
url: `/engine/ruleVersion/dataSource/table/${id}`,
method: 'get',
})
}
//获取KTLV数据
export function getEtlTableData(data) {
return request({
url: `/engine/ruleVersion/getEtlTableData`,
method: 'post',
data
})
}
//测试值
export function execution(data) {
return request({
url: `/engine/ruleVersion/execution/${data.engineKey}`,
method: 'post',
data
})
}
//测试行
export function lineFile(data) {
return request({
url: `/engine/ruleVersion/lineFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//测试组
export function groupFile(data) {
return request({
url: `/engine/ruleVersion/groupFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//判断类是否已存在
export function isClassExist(val) {
return request({
url: `/engine/ruleVersion/isClassExist/${val}`,
method: 'get',
})
}

View File

@ -82,7 +82,7 @@ export function findTableIdByParentId(id) {
//表 //表
export function findTableValueByTableName(basicId,tableName) { export function findTableValueByTableName(basicId,tableName) {
return request({ return request({
url: "/source/value/findTableValueByTableName?basicId="+basicId+"&tableName="+tableName, url: `/source/value/findTableValueByTableName?basicId=`+basicId+'&&tableName='+tableName,
method: 'post', method: 'post',
}) })
} }

View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 查询规则维护列表
export function listRuleInfo(data) {
return request({
url: '/engine/ruleInfo/list',
method: 'post',
params: {pageNum:data.pageNum,pageSize:data.pageSize},
data
})
}
// 查询规则维护详细
export function getRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'get'
})
}
// 新增规则维护
export function addRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'post',
data: data
})
}
// 修改规则维护
export function updateRuleInfo(data) {
return request({
url: '/engine/ruleInfo',
method: 'put',
data: data
})
}
// 删除规则维护
export function delRuleInfo(id) {
return request({
url: '/engine/ruleInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,460 @@
<!--<template>-->
<!-- <div id="mountNode"></div>-->
<!--</template>-->
<!--<script>-->
<!--import G6 from '@antv/g6'-->
<!--export default {-->
<!-- data() {-->
<!-- return {-->
<!-- data: {-->
<!-- // -->
<!-- nodes: [-->
<!-- {-->
<!-- id: 'node1', // String-->
<!-- x: 100, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect', // -->
<!-- label: '省生态环境厅', // -->
<!-- // -->
<!-- style: {-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- // -->
<!-- extraText: '[派发]'-->
<!-- },-->
<!-- {-->
<!-- id: 'node2', // String-->
<!-- x: 300, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect',-->
<!-- label: '市生态环境局',-->
<!-- style: {-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- extraText: '[派发]'-->
<!-- },-->
<!-- {-->
<!-- id: 'node3', // String-->
<!-- x: 500, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect',-->
<!-- label: '核查员',-->
<!-- style: {-->
<!-- fill: '#ffc107',-->
<!-- stroke: '#ff9800',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- extraText: '[派发]',-->
<!-- text1: '催办'-->
<!-- },-->
<!-- {-->
<!-- id: 'node4', // String-->
<!-- x: 700, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect',-->
<!-- label: '市生态环境局',-->
<!-- style: {-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- extraText: '[派发]'-->
<!-- },-->
<!-- {-->
<!-- id: 'node5', // String-->
<!-- x: 900, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect',-->
<!-- label: '省生态环境厅',-->
<!-- style: {-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- extraText: '[派发]'-->
<!-- },-->
<!-- {-->
<!-- id: 'node6', // String-->
<!-- x: 1200, // Number x -->
<!-- y: 200, // Number y -->
<!-- type: 'rect',-->
<!-- label: '完成',-->
<!-- style: {-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- // https://antv-g6.gitee.io/zh/docs/manual/middle/elements/nodes/anchorpoint-->
<!-- anchorPoints: [-->
<!-- [0, 0.5],-->
<!-- [0.5, 0.5]-->
<!-- ]-->
<!-- },-->
<!-- {-->
<!-- id: 'node7', // String-->
<!-- x: 1200, // Number x -->
<!-- y: 300, // Number y -->
<!-- type: 'rect',-->
<!-- label: '已完成',-->
<!-- style: {-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- anchorPoints: [-->
<!-- [0, 0.5],-->
<!-- [0.5, 0.5]-->
<!-- ]-->
<!-- },-->
<!-- {-->
<!-- id: 'node8', // String-->
<!-- x: 1200, // Number x -->
<!-- y: 400, // Number y -->
<!-- type: 'rect',-->
<!-- label: '进行中',-->
<!-- style: {-->
<!-- fill: '#ffc107',-->
<!-- stroke: '#ff9800',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- anchorPoints: [-->
<!-- [0, 0.5],-->
<!-- [0.5, 0.5]-->
<!-- ]-->
<!-- },-->
<!-- {-->
<!-- id: 'node9', // String-->
<!-- x: 1200, // Number x -->
<!-- y: 500, // Number y -->
<!-- type: 'rect',-->
<!-- label: '未开始',-->
<!-- style: {-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff',-->
<!-- lineWidth: 2,-->
<!-- radius: 7-->
<!-- },-->
<!-- anchorPoints: [-->
<!-- [0.5, 0.5],-->
<!-- [1, 0.5]-->
<!-- ]-->
<!-- }-->
<!-- ],-->
<!-- // -->
<!-- edges: [-->
<!-- {-->
<!-- source: 'node1', // String id-->
<!-- target: 'node2', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- // endArrow: true,-->
<!-- // startArrow: false,-->
<!-- // -->
<!-- endArrow: {-->
<!-- lineDash: false,-->
<!-- path: G6.Arrow.triangle(10, 10, 2), // 使 0 d -->
<!-- d: 2,-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- // ...-->
<!-- },-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- }-->
<!-- },-->
<!-- {-->
<!-- source: 'node2', // String id-->
<!-- target: 'node3', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- // endArrow: true,-->
<!-- // startArrow: false,-->
<!-- endArrow: {-->
<!-- lineDash: false,-->
<!-- path: G6.Arrow.triangle(10, 10, 2),-->
<!-- d: 2,-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- // ...-->
<!-- },-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- }-->
<!-- },-->
<!-- {-->
<!-- source: 'node3', // String id-->
<!-- target: 'node4', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- // endArrow: true,-->
<!-- // startArrow: false,-->
<!-- endArrow: {-->
<!-- lineDash: false,-->
<!-- path: G6.Arrow.triangle(10, 10, 2),-->
<!-- d: 2,-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- // ...-->
<!-- },-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- }-->
<!-- },-->
<!-- {-->
<!-- source: 'node4', // String id-->
<!-- target: 'node3', // String id-->
<!-- label: '不合格', // -->
<!-- type: 'polyline',-->
<!-- controlPoints: [{ x: 750, y: 250 }, { x: 550, y: 250 }],-->
<!-- style: {-->
<!-- endArrow: {-->
<!-- path: G6.Arrow.triangle(10, 10, 2),-->
<!-- d: 2,-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- }-->
<!-- },-->
<!-- fill: '#18c298ad',-->
<!-- stroke: '#18c298'-->
<!-- },-->
<!-- {-->
<!-- source: 'node4', // String id-->
<!-- target: 'node5', // String id-->
<!-- label: '合格', // -->
<!-- style: {-->
<!-- // endArrow: true,-->
<!-- // startArrow: false,-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff',-->
<!-- endArrow: {-->
<!-- lineDash: false,-->
<!-- path: G6.Arrow.triangle(10, 10, 2),-->
<!-- d: 2,-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff'-->
<!-- // ...-->
<!-- }-->
<!-- }-->
<!-- },-->
<!-- {-->
<!-- source: 'node5', // String id-->
<!-- target: 'node6', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- lineDash: [5, 5, 5],-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ff',-->
<!-- endArrow: {-->
<!-- lineDash: false,-->
<!-- path: G6.Arrow.triangle(10, 10, 2),-->
<!-- d: 2,-->
<!-- fill: '#0063ffb5',-->
<!-- stroke: '#0063ffb5'-->
<!-- }-->
<!-- }-->
<!-- },-->
<!-- {-->
<!-- source: 'node6', // String id-->
<!-- target: 'node7', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- lineDash: [5, 5, 5],-->
<!-- fill: '#ddd',-->
<!-- stroke: '#ddd'-->
<!-- },-->
<!-- type: 'hvh'-->
<!-- },-->
<!-- {-->
<!-- source: 'node7', // String id-->
<!-- target: 'node8', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- lineDash: [5, 5, 5],-->
<!-- fill: '#ddd',-->
<!-- stroke: '#ddd'-->
<!-- },-->
<!-- type: 'hvh'-->
<!-- },-->
<!-- {-->
<!-- source: 'node8', // String id-->
<!-- target: 'node9', // String id-->
<!-- label: '', // -->
<!-- style: {-->
<!-- lineDash: [5, 5, 5],-->
<!-- fill: '#ddd',-->
<!-- stroke: '#ddd'-->
<!-- },-->
<!-- type: 'hvh'-->
<!-- }-->
<!-- ]-->
<!-- }-->
<!-- }-->
<!-- },-->
<!-- mounted() {-->
<!-- this.getView()-->
<!-- },-->
<!-- methods: {-->
<!-- getView() {-->
<!-- const container = document.getElementById('mountNode')-->
<!-- const width = container.scrollWidth-->
<!-- const height = container.scrollHeight-->
<!-- // const width = window.-->
<!-- const graph = new G6.Graph({-->
<!-- modes: {-->
<!-- default: ['drag-canvas', 'zoom-canvas'] // -->
<!-- },-->
<!-- container: 'mountNode', // String | HTMLElement Step 1 id -->
<!-- fitView: true, // -->
<!-- width: width, // Number-->
<!-- height: height, // Number-->
<!-- size: [100, 500]-->
<!-- })-->
<!-- G6.registerNode('diamond', {-->
<!-- options: {-->
<!-- style: {},-->
<!-- stateStyles: {-->
<!-- hover: {},-->
<!-- selected: {}-->
<!-- }-->
<!-- },-->
<!-- /**-->
<!-- * 绘制节点包含文本-->
<!-- * @param {Object} cfg 节点的配置项-->
<!-- * @param {G.Group} group 图形分组节点中图形对象的容器-->
<!-- * @return {G.Shape} 返回一个绘制的图形作为 keyShape通过 node.get('keyShape') 可以获取-->
<!-- * 关于 keyShape 可参考文档 核心概念-节点//Combo-图形 Shape keyShape-->
<!-- */-->
<!-- draw(cfg, group) {},-->
<!-- /**-->
<!-- * 绘制后的附加操作默认没有任何操作-->
<!-- * @param {Object} cfg 节点的配置项-->
<!-- * @param {G.Group} group 图形分组节点中图形对象的容器-->
<!-- */-->
<!-- afterDraw(cfg, group) {},-->
<!-- /**-->
<!-- * 更新节点包含文本-->
<!-- * @override-->
<!-- * @param {Object} cfg 节点的配置项-->
<!-- * @param {Node} node 节点-->
<!-- */-->
<!-- update(cfg, node) {},-->
<!-- /**-->
<!-- * 更新节点后的操作一般同 afterDraw 配合使用-->
<!-- * @override-->
<!-- * @param {Object} cfg 节点的配置项-->
<!-- * @param {Node} node 节点-->
<!-- */-->
<!-- afterUpdate(cfg, node) {},-->
<!-- /**-->
<!-- * 响应节点的状态变化-->
<!-- * 在需要使用动画来响应状态变化时需要被复写其他样式的响应参见下文提及的 [配置状态样式] 文档-->
<!-- * @param {String} name 状态名称-->
<!-- * @param {Object} value 状态值-->
<!-- * @param {Node} node 节点-->
<!-- */-->
<!-- setState(name, value, node) {},-->
<!-- /**-->
<!-- * 获取锚点相关边的连入点-->
<!-- * @param {Object} cfg 节点的配置项-->
<!-- * @return {Array|null} 锚点相关边的连入点的数组,如果为 null则没有控制点-->
<!-- */-->
<!-- getAnchorPoints(cfg) {}-->
<!-- },-->
<!-- // 'single-node' 'circle', 'rect' -->
<!-- // -->
<!-- 'single-node', // single-node -->
<!-- )-->
<!-- // -->
<!-- // graph.node((node) => {-->
<!-- // console.log(node)-->
<!-- // return {-->
<!-- // id: node.id,-->
<!-- // type: 'rect',-->
<!-- // style: {-->
<!-- // fill: 'blue'-->
<!-- // }-->
<!-- // }-->
<!-- // })-->
<!-- graph.data(this.data) // Step 2 -->
<!-- // -->
<!-- graph.on('afterrender', () => {-->
<!-- graph.getNodes().forEach(node => {-->
<!-- const { extraText, text1 } = node.getModel()-->
<!-- const bbox = node.getBBox()-->
<!-- const centerX = bbox.minX + bbox.width / 2-->
<!-- const centerY = bbox.minY + bbox.height / 2-->
<!-- const textGroup = graph.get('group').addGroup()-->
<!-- const texta = textGroup.addShape('text', {-->
<!-- attrs: {-->
<!-- text: text1,-->
<!-- x: centerX,-->
<!-- y: centerY + 45,-->
<!-- textAlign: 'center',-->
<!-- textBaseline: 'middle',-->
<!-- type: 'rect',-->
<!-- fill: '#000',-->
<!-- cursor: 'pointer',-->
<!-- fontSize: 12-->
<!-- }-->
<!-- })-->
<!-- textGroup.addShape('text', {-->
<!-- attrs: {-->
<!-- text: extraText,-->
<!-- x: centerX,-->
<!-- y: centerY + 25,-->
<!-- textAlign: 'center',-->
<!-- textBaseline: 'middle',-->
<!-- fill: '#000',-->
<!-- fontSize: 12-->
<!-- }-->
<!-- })-->
<!-- // -->
<!-- const bbox1 = texta.getBBox()-->
<!-- if (bbox1.height !== 0) {-->
<!-- textGroup.addShape('rect', {-->
<!-- attrs: {-->
<!-- x: bbox1.x - 4,-->
<!-- y: bbox1.y - 4,-->
<!-- width: bbox1.width + 10,-->
<!-- height: bbox1.height + 8,-->
<!-- stroke: '#000',-->
<!-- lineWidth: 2,-->
<!-- cursor: 'pointer',-->
<!-- radius: 7-->
<!-- }-->
<!-- })-->
<!-- }-->
<!-- // -->
<!-- texta.on('click', () => {-->
<!-- // -->
<!-- console.log('Label clicked!')-->
<!-- })-->
<!-- })-->
<!-- })-->
<!-- graph.render() // -->
<!-- }-->
<!-- }-->
<!--}-->
<!--</script>-->
<!--<style>-->
<!--#mountNode{-->
<!-- width: 100%;-->
<!-- height: 500px;-->
<!--}-->
<!--</style>-->

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,346 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="规则名称" prop="ruleName">
<el-input
v-model="queryParams.ruleName"
placeholder="请输入规则名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['engine:ruleInfo:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['engine:ruleInfo:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleTest"
>测试拓扑</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['engine:ruleInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ruleInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="规则名称" align="center" prop="ruleName" />
<el-table-column label="规则编码" align="center" prop="ruleCode" />
<el-table-column label="规则分类" align="center" prop="ruleTypeValue">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.ruleTypeValue"/>
</template>
</el-table-column>
<el-table-column label="规则级别" align="center" prop="ruleLevelId" />
<el-table-column label="是否激活" align="center" prop="isActivation">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.isActivation"/>
</template>
</el-table-column>
<el-table-column label="规则状态" align="center" prop="status" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-s-tools"
@click="openRuleTools(scope.row)"
v-hasPermi="['engine:ruleTools:edit']"
>规则维护</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['engine:ruleInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['engine:ruleInfo:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改规则维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="20">
<el-col :span="24">
<div class="grid-content bg-purple">
<el-form-item label="规则名称" prop="ruleName">
<el-input v-model="form.ruleName" placeholder="请输入规则名称" />
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="规则编码" prop="ruleCode">
<el-input v-model="form.ruleCode" placeholder="请输入规则编码" />
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="规则分类" prop="ruleTypeValue">
<el-select v-model="form.ruleTypeValue" placeholder="请选择规则分类">
<el-option
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="是否激活" prop="isActivation">
<el-radio-group v-model="form.isActivation">
<el-radio
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<el-form-item label="规则状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="规则说明">
<editor v-model="form.ruleExplain" :min-height="192"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRuleInfo, getRuleInfo, delRuleInfo, addRuleInfo, updateRuleInfo } from "/src/api/engine/ruleInfo";
export default {
name: "RuleInfo",
dicts: ['etl_rule_type', 'etl_rule_status','sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
ruleInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
ruleName: null,
ruleTypeValue: null,
isActivation: null,
status: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
handleTest(){
this.$tab.openPage('测试拓扑图', '/engine/rule-test/index/')
},
openRuleTools(row){
this.$tab.openPage('[' + row.ruleName + ']规则版本', '/engine/rule-version/index/' + row.id, row.ruleId)
},
/** 查询规则维护列表 */
getList() {
this.loading = true;
listRuleInfo(this.queryParams).then(response => {
this.ruleInfoList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
ruleName: null,
ruleCode: null,
ruleTypeValue: null,
ruleLevelId: null,
isActivation: 'N',
status: '1',
ruleExplain: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加规则维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getRuleInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改规则维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateRuleInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRuleInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除规则维护编号为"' + ids + '"的数据项?').then(function() {
return delRuleInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('engine/ruleInfo/export', {
...this.queryParams
}, `ruleInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,123 @@
import request from '@/utils/request'
// 查询规则版本列表
export function listRuleVersion(data) {
return request({
url: '/engine/ruleVersion/list',
method: 'post',
params: {pageNum: data.pageNum, pageSize: data.pageSize},
data
})
}
// 查询规则版本详细
export function getRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'get'
})
}
// 新增规则版本
export function addRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'post',
data: data
})
}
// 修改规则版本
export function updateRuleVersion(data) {
return request({
url: '/engine/ruleVersion',
method: 'put',
data: data
})
}
// 删除规则版本
export function delRuleVersion(id) {
return request({
url: '/engine/ruleVersion/' + id,
method: 'delete'
})
}
//存储代码
export function writeFile(data) {
return request({
url: '/engine/ruleVersion/writeFile',
method: 'post',
data
})
}
//查询代码
export function readFile(fileName) {
return request({
url: `/engine/ruleVersion/readFile/${fileName}`,
method: 'post'
})
}
//库表二级联动
export function getTableInfoList() {
return request({
url: '/engine/ruleVersion/dataSource/tableInfo',
method: 'get',
})
}
//库表二级联动
export function getDataAnalysis(id) {
return request({
url: `/engine/ruleVersion/dataSource/table/${id}`,
method: 'get',
})
}
//获取KTLV数据
export function getEtlTableData(data) {
return request({
url: `/engine/ruleVersion/getEtlTableData`,
method: 'post',
data
})
}
//测试值
export function execution(data) {
return request({
url: `/engine/ruleVersion/execution/${data.engineKey}`,
method: 'post',
data
})
}
//测试行
export function lineFile(data) {
return request({
url: `/engine/ruleVersion/lineFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//测试组
export function groupFile(data) {
return request({
url: `/engine/ruleVersion/groupFile/${data.ruleVersionClass}`,
method: 'post',
data: data.data
})
}
//判断类是否已存在
export function isClassExist(val) {
return request({
url: `/engine/ruleVersion/isClassExist/${val}`,
method: 'get',
})
}

View File

@ -3,11 +3,11 @@
<el-form label-position="right" label-width="60px"> <el-form label-position="right" label-width="60px">
<el-form-item label="输入表"> <el-form-item label="输入表">
<span v-for="db in formDb"> <span v-for="db in formDb">
<el-input v-model="db.dbTable" placeholder="无输入表" style="width: 60%;" disabled/> <el-input v-model="db.dbTable" placeholder="无输入表" style="width: 60%;" disabled />
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="输出表"> <el-form-item label="输出表">
<el-input v-model="toDb.dbTable" placeholder="无输出表" style="width: 60%;" disabled/> <el-input v-model="toDb.dbTable" placeholder="无输出表" style="width: 60%;" disabled />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div> <div>
@ -16,15 +16,13 @@
</div> </div>
<div align="center"> <div align="center">
<el-table ref="table" :data="formFields" height="450px"> <el-table ref="table" :data="formFields" height="450px">
<el-table-column :show-overflow-tooltip="true" label="字段名称" prop="fieldName"/> <el-table-column :show-overflow-tooltip="true" label="字段名称" prop="fieldName" />
<el-table-column :show-overflow-tooltip="true" label="字段描述" prop="fieldComment"/> <el-table-column :show-overflow-tooltip="true" label="字段描述" prop="fieldComment" />
<el-table-column :show-overflow-tooltip="true" label="字段类型" prop="fieldType"/> <el-table-column :show-overflow-tooltip="true" label="字段类型" prop="fieldType" />
<el-table-column :show-overflow-tooltip="true" label="字段所属表" prop="tableName"/> <el-table-column :show-overflow-tooltip="true" label="字段所属表" prop="tableName" />
<el-table-column :show-overflow-tooltip="true" label="输出字段"> <el-table-column :show-overflow-tooltip="true" label="输出字段">
<span slot-scope="scope" v-if="fieldsList && fieldsList.get(scope.row.fieldName)"> <span slot-scope="scope" v-if="fieldsList && fieldsList.get(scope.row.fieldName)">
{{ {{ fieldsList.get(scope.row.fieldName).fieldName+ '(' + fieldsList.get(scope.row.fieldName).fieldComment + ')' }}
fieldsList.get(scope.row.fieldName).fieldName + '(' + fieldsList.get(scope.row.fieldName).fieldComment + ')'
}}
</span> </span>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -47,22 +45,22 @@
v-model="queryParams.tableName" v-model="queryParams.tableName"
clearable clearable
@change="handleQuery" @change="handleQuery"
placeholder="请输入表名称"/> placeholder="请输入表名称" />
</el-form-item> </el-form-item>
<el-form-item label="表描述" prop="tableComment"> <el-form-item label="表描述" prop="tableComment">
<el-input <el-input
v-model="queryParams.tableComment" v-model="queryParams.tableComment"
clearable clearable
@change="handleQuery" @change="handleQuery"
placeholder="请输入表描述"/> placeholder="请输入表描述" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"></el-button> <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"></el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table ref="table" :data="tableOptions" height="300px"> <el-table ref="table" :data="tableOptions" height="300px">
<el-table-column :show-overflow-tooltip="true" label="表名称" prop="tableName"/> <el-table-column :show-overflow-tooltip="true" label="表名称" prop="tableName" />
<el-table-column :show-overflow-tooltip="true" label="表描述" prop="tableComment"/> <el-table-column :show-overflow-tooltip="true" label="表描述" prop="tableComment" />
<el-table-column label="操作" width="50px"> <el-table-column label="操作" width="50px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="selectTable(scope.row)"></el-button> <el-button type="text" @click="selectTable(scope.row)"></el-button>
@ -72,10 +70,10 @@
<el-divider content-position="left">选择字段 v</el-divider> <el-divider content-position="left">选择字段 v</el-divider>
<el-table ref="table" :data="fieldsOptions" height="280px" <el-table ref="table" :data="fieldsOptions" height="280px"
@row-click="clickRow" @selection-change="handleSelectionChange"> @row-click="clickRow" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55" />
<el-table-column :show-overflow-tooltip="true" label="字段名称" prop="columnName"/> <el-table-column :show-overflow-tooltip="true" label="字段名称" prop="columnName" />
<el-table-column :show-overflow-tooltip="true" label="字段描述" prop="columnComment"/> <el-table-column :show-overflow-tooltip="true" label="字段描述" prop="columnComment" />
<el-table-column :show-overflow-tooltip="true" label="字段类型" prop="columnType"/> <el-table-column :show-overflow-tooltip="true" label="字段类型" prop="columnType" />
</el-table> </el-table>
<br><br> <br><br>
<div align="center"> <div align="center">
@ -87,15 +85,24 @@
<el-dialog title="选择字段" :visible.sync="checkFieldsMapFlag" width="60%" :modal="false"> <el-dialog title="选择字段" :visible.sync="checkFieldsMapFlag" width="60%" :modal="false">
<div style="padding-left: 10px;padding-right: 10px;"> <div style="padding-left: 10px;padding-right: 10px;">
<el-table ref="table" :data="formFields" height="500px"> <el-table ref="table" :data="formFields" height="500px">
<el-table-column :show-overflow-tooltip="true" label="字段名称" prop="fieldName"/> <el-table-column :show-overflow-tooltip="true" label="字段名称" prop="fieldName" />
<el-table-column :show-overflow-tooltip="true" label="字段描述" prop="fieldComment"/> <el-table-column :show-overflow-tooltip="true" label="字段描述" prop="fieldComment" />
<el-table-column :show-overflow-tooltip="true" label="字段类型" prop="fieldType"/> <el-table-column :show-overflow-tooltip="true" label="字段类型" prop="fieldType" />
<el-table-column :show-overflow-tooltip="true" label="字段所属表" prop="tableName"/> <el-table-column :show-overflow-tooltip="true" label="字段所属表" prop="tableName" />
<el-table-column :show-overflow-tooltip="true" label="清洗规则" prop="ruleId">
<template slot-scope="scope">
<el-cascader :options="ruleOptions.filter(item => item.ruleVersionType === 'field')" :props="props" @change="checkRules" style="width: 60%;">
<template slot-scope="{ node, data }">
<span>{{ data.ruleVersionName }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="目标字段"> <el-table-column :show-overflow-tooltip="true" label="目标字段">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.toFidlesName" placeholder="请选择字段"> <el-select v-model="scope.row.toFidlesName" placeholder="请选择字段">
<el-option v-for="field in toFields" :label="field.fieldName+'('+field.fieldComment+')'" <el-option v-for="field in toFields" :label="field.fieldName+'('+field.fieldComment+')'" :value="field.fieldName"/>
:value="field.fieldName"/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -109,12 +116,12 @@
</div> </div>
</template> </template>
<script> <script>
// jsjsjson, // jsjsjson,
// import from ', // import from ',
import {batchAddUpd, listDisposition} from "../../../../../../api/quest/disposition"; import {batchAddUpd, listDisposition} from "../../../../../../api/quest/disposition";
import {listDbTableAll, selDbNameAll, selectDbTableColumnsByName} from "../../../../../../api/tool/gen"; import {listDbTableAll, selDbNameAll, selectDbTableColumnsByName} from "../../../../../../api/tool/gen";
import {listRuleInfo} from "../../../../../../api/engine/ruleInfo";
export default { export default {
// import使" // import使"
@ -143,6 +150,8 @@ export default {
fieldsList: new Map(), fieldsList: new Map(),
checkFieldsFlag: false, checkFieldsFlag: false,
checkFieldsMapFlag: false, checkFieldsMapFlag: false,
//
ruleOptions: [],
// //
dbNameOptions: [], dbNameOptions: [],
// //
@ -151,7 +160,13 @@ export default {
fieldsOptions: [], fieldsOptions: [],
// //
tableList: [], tableList: [],
queryParams: {} queryParams: {},
//
props: {
label: 'ruleVersionName',
value: 'ruleVersionCode',
children: 'ruleVersionList'
}
} }
}, },
// data", // data",
@ -170,7 +185,7 @@ export default {
// //
/** 1.查询该节点的上一级节点*/ /** 1.查询该节点的上一级节点*/
this.data.lineList.forEach(line => { this.data.lineList.forEach(line => {
if (line.to === this.node.id) { if (line.to === this.node.id){
listDisposition({nodeCode: line.from}).then(res => { listDisposition({nodeCode: line.from}).then(res => {
const data = this.getVueDisp(res.data.rows) const data = this.getVueDisp(res.data.rows)
this.formDb = data.db this.formDb = data.db
@ -190,28 +205,75 @@ export default {
checkFields() { checkFields() {
this.selDbNameList() this.selDbNameList()
this.getListAll() this.getListAll()
this.selRules()
this.checkFieldsFlag = true this.checkFieldsFlag = true
},
//
selRules() {
//
// listRuleInfo({pageNum: 1, pageSize: 100}).then(response => {
// response.data.rows.forEach(item => {
// if(item.ruleVersionList){
// item.ruleVersionList.forEach(rule => this.ruleOptions.push(rule))
// }
// });
// console.log(this.ruleOptions)
// });
this.ruleOptions = [{
ruleVersionName: "非法字符管理",
ruleVersionClass: "CHAR_MANAGE",
ruleVersionCode: "对非法字符进行过滤和筛选",
ruleVersionType: "row",
ruleVersionList: [
{
ruleVersionClass: "BLANK_SPACE_REMOVE",
ruleVersionName: "空格清除",
ruleVersionDescribed: "将空格清除",
ruleVersionType: "row"
},{
ruleVersionClass: "SINGLE_QUOTATION_MARKS_REMOVE",
ruleVersionName: "单引号清除",
ruleVersionDescribed: "将单引号清除",
ruleVersionType: "row"
},{
ruleVersionClass: "ANTIRADICAL_REMOVE",
ruleVersionName: "反根号清除",
ruleVersionDescribed: "将反根号清除",
ruleVersionType: "row"
}
]
},
{
ruleVersionName: "唯一规则",
ruleVersionClass: "UNIQUE_RULE",
ruleVersionCode: "字段唯一性过滤",
ruleVersionType: "fidle",
ruleVersionList: []
}]
},
checkRules() {
}, },
// //
save() { save() {
console.log('formDb', this.formDb) console.log('formDb',this.formDb)
console.log('toDb', this.toDb) console.log('toDb',this.toDb)
console.log('formFields', this.formFields) console.log('formFields',this.formFields)
console.log('toFields', this.toFields) console.log('toFields',this.toFields)
console.log('fieldsList', this.fieldsList) console.log('fieldsList',this.fieldsList)
// //
const field = this.formFields const field = this.formFields
let map = field.map(item => [item.fieldName, item.toFidlesName]); let map = field.map(item => [item.fieldName, item.toFidlesName]);
this.fieldsList = new Map() this.fieldsList = new Map()
map.forEach(item => { map.forEach(item => {
this.toFields.forEach(toField => { this.toFields.forEach(toField => {
if (toField.fieldName === item[1]) { if (toField.fieldName === item[1]){
this.fieldsList.set(item[0], toField) this.fieldsList.set(item[0], toField)
} }
}) })
}) })
// //
let mysqlDisp = this.getMysqlDisp(this.toDb, this.fieldsList); let mysqlDisp = this.getMysqlDisp(this.toDb,this.fieldsList);
// //
batchAddUpd(mysqlDisp, this.disp.nodeCode).then(res => { batchAddUpd(mysqlDisp, this.disp.nodeCode).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
@ -227,7 +289,7 @@ export default {
const params = this.queryParams const params = this.queryParams
if ((table.dbName === params.dbName || !params.dbName) && if ((table.dbName === params.dbName || !params.dbName) &&
(table.tableName.includes(params.tableName) || !params.tableName) && (table.tableName.includes(params.tableName) || !params.tableName) &&
(table.tableComment.includes(params.tableComment) || !params.tableComment)) { (table.tableComment.includes(params.tableComment) || !params.tableComment)){
this.tableOptions.push(table) this.tableOptions.push(table)
} }
}) })
@ -239,7 +301,7 @@ export default {
dbName: row.dbName, dbName: row.dbName,
tableName: row.tableName, tableName: row.tableName,
tableComment: row.tableComment, tableComment: row.tableComment,
dbTable: row.dbName + '.' + row.tableName + '(' + row.tableComment + ')' dbTable: row.dbName+'.'+row.tableName+'('+ row.tableComment +')'
} }
selectDbTableColumnsByName(row.dbName, row.tableName).then(res => { selectDbTableColumnsByName(row.dbName, row.tableName).then(res => {
this.fieldsOptions = res.data this.fieldsOptions = res.data
@ -252,7 +314,7 @@ export default {
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.toFields = selection.map(item => { this.toFields = selection.map(item => {
return { return {
dbTable: this.toDb.dbName + '.' + this.toDb.tableName, dbTable: this.toDb.dbName+'.'+this.toDb.tableName,
fieldName: item.columnName, fieldName: item.columnName,
fieldType: item.columnType, fieldType: item.columnType,
fieldComment: item.columnComment fieldComment: item.columnComment
@ -284,7 +346,7 @@ export default {
dbName: disp.dispDesc, dbName: disp.dispDesc,
tableName: disp.dispValue, tableName: disp.dispValue,
tableComment: disp.dispLabel, tableComment: disp.dispLabel,
dbTable: disp.dispDesc + '.' + disp.dispValue + '(' + disp.dispLabel + ')' dbTable: disp.dispDesc+'.'+disp.dispValue+'('+disp.dispLabel+')'
}) })
} }
if (disp.dispKey === 'fields') { if (disp.dispKey === 'fields') {
@ -296,15 +358,15 @@ export default {
}) })
} }
// //
if (disp.dispKey === 'toDb') { if (disp.dispKey === 'toDb'){
toDb = { toDb = {
dbName: disp.dispDesc, dbName: disp.dispDesc,
tableName: disp.dispValue, tableName: disp.dispValue,
tableComment: disp.dispLabel, tableComment: disp.dispLabel,
dbTable: disp.dispDesc + '.' + disp.dispValue + '(' + disp.dispLabel + ')' dbTable: disp.dispDesc+'.'+disp.dispValue+'('+disp.dispLabel+')'
} }
} }
if (disp.dispKey === 'toFields') { if (disp.dispKey === 'toFields'){
fieldsMap.set(disp.dispDesc, { fieldsMap.set(disp.dispDesc, {
fieldName: disp.dispValue, fieldName: disp.dispValue,
fieldType: disp.dispType, fieldType: disp.dispType,

View File

@ -344,7 +344,7 @@
<span>选择资产结构</span> <span>选择资产结构</span>
</div> </div>
<span> <span>
<el-select v-model="dataOrigin.tableId" placeholder="请选择数据结构" @blur="ch()"> <el-select v-model="dataOrigin.tableId" placeholder="请选择数据结构" @change="ch()">
<el-option v-for="i in tableOrigin" :label="i.tableName" :value="i.id" :key="i.id"></el-option> <el-option v-for="i in tableOrigin" :label="i.tableName" :value="i.id" :key="i.id"></el-option>
</el-select> </el-select>
</span> </span>
@ -356,152 +356,101 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>选择资产集</span> <span>选择资产集</span>
<template> <template>
<el-table <!-- <el-table-->
:data="tableOrigin" <!-- :data="tableOrigin"-->
style="width: 100%"> <!-- style="width: 100%">-->
<el-table-column <!-- <el-table-column-->
label="主键" <!-- label="主键"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.id }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.id }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="数据源ID" <!-- label="数据源ID"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.basicId }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.basicId }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="表名称" <!-- label="表名称"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.tableName }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.tableName }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="表备注" <!-- label="表备注"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.tableRemark }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.tableRemark }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="类型" <!-- label="类型"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.type }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.type }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="数据量" <!-- label="数据量"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.dataNum }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.dataNum }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column <!-- <el-table-column-->
label="是否核心" <!-- label="是否核心"-->
width="180"> <!-- width="180">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span style="margin-left: 10px">{{ scope.row.center }}</span> <!-- <span style="margin-left: 10px">{{ scope.row.center }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEditSelect(scope.row)">选择
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</div>
<span>
<!--tableDa-->
<el-button type="primary" @click="measurements()"> </el-button>
</span>
</el-card>
</el-col>
<span>
<el-col v-show="selectss">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>选择资产集</span>
<template>
<el-table
:data="tableDa"
style="width: 100%">
<el-table-column
label="主键"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column
label="数据源ID"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.basicId }}</span>
</template>
</el-table-column>
<el-table-column
label="表名称"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.tableName }}</span>
</template>
</el-table-column>
<el-table-column
label="表备注"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.tableRemark }}</span>
</template>
</el-table-column>
<el-table-column
label="类型"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.type }}</span>
</template>
</el-table-column>
<el-table-column
label="数据量"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.dataNum }}</span>
</template>
</el-table-column>
<el-table-column
label="是否核心"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.center }}</span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEditSelect(scope.row)">选择
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</div>
<span>
<el-button type="primary" @click="measurements()"> </el-button> <!-- <el-table-column label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- @click="handleEditSelect(scope.row)">选择-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
{{tableDatas}}
<el-table>
<el-table-column
v-for="tableData in tableDatas"
:key="key"
:label="tableData.label"
:prop="tableData.value"
width="180">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEditSelect(scope.row)">选择
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</div>
<span>
<template slot-scope="scope">
<el-button
type="primary"
@click="measurements(scope.row)">测试
</el-button>
</template>
</span> </span>
</el-card> </el-card>
</el-col> </el-col>
</span> </span>
</span>
</el-drawer> </el-drawer>
@ -604,7 +553,7 @@ export default {
// //
dataOrigin: {}, dataOrigin: {},
origins: [], origins: [],
tableDa: [],
tableOrigin: [], tableOrigin: [],
showCode: false, showCode: false,
// //
@ -620,31 +569,25 @@ export default {
this.findById(); this.findById();
this.findList() this.findList()
this.getDataOrigin() this.getDataOrigin()
this.findTableValueByTableName();
}, },
// - 访DOM", // - 访DOM",
mounted() { mounted() {
this.findById(); this.findById();
}, },
methods: { methods: {
//
getDataTable(data) {
getDataTables(data.id).then(res => {
this.tableDa = res.data
})
},
// //
handleEditSelect(data) { handleEditSelect(data) {
alert(data.id)
findTableValueByTableName(data.basicId, data.tableName).then(res => { findTableValueByTableName(data.basicId, data.tableName).then(res => {
console.log(res.data) console.log(res.data)
this.tableDatas = res.data this.tableDatas = res.data
console.log(this.tableDatas) alert(res.data)
this.getDataTable(data);
}) })
}, },
// //
measurements() { measurements(data) {
measurement(this.form).then(res => { this.tableDatas=data
measurement(data).then(res => {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
}) })
}, },
@ -671,7 +614,6 @@ export default {
chanChild() { chanChild() {
findTableIdByParentId(this.dataOrigin.sourceId).then(res => { findTableIdByParentId(this.dataOrigin.sourceId).then(res => {
this.tableOrigin = res.data this.tableOrigin = res.data
console.log(this.tableOrigin)
// console.log(this.tableOrigin) // console.log(this.tableOrigin)
}) })
}, },