etl规则引擎模块

master
czq 2024-05-07 19:30:45 +08:00
parent 7bc96b0b41
commit fdb6f388ce
22 changed files with 2817 additions and 3 deletions

View File

@ -1,8 +1,8 @@
{
"name": "muyu",
"version": "3.6.3",
"description": "若依管理系统",
"author": "若依",
"description": "数据处理系统",
"author": "MuYu",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
@ -37,8 +37,11 @@
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"@vue/compiler-core": "^3.4.26",
"@vue/compiler-ssr": "^3.4.26",
"axios": "0.24.0",
"clipboard": "2.0.8",
"codemirror": "^5.65.16",
"core-js": "3.25.3",
"echarts": "5.4.0",
"element-ui": "2.15.13",
@ -53,6 +56,7 @@
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"vue": "2.6.12",
"vue-codemirror": "^4.0.6",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",

View File

@ -0,0 +1,15 @@
import request from '@/utils/request'
export function getAllUserAndDept(dataType,dataId) {
return request({
url: '/data/permissions/getAllUserAndDept?dataType='+dataType+'&dataId='+dataId,
method: 'get'
})
}
export function insertPermissions(permissionsReq) {
return request({
url: '/data/permissions/insertPermissions?',
method: 'post',
data: permissionsReq
})
}

View File

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function getAssetsModelListByTableIds(ids) {
return request({
url: '/data/assets/getAssetsModelList',
method: 'post',
data: ids
})
}
export function updateAssetsModel(assetsModel) {
return request({
url: '/data/assets/updateAssetsModel',
method: 'post',
data: assetsModel
})
}
export function getAssetsModelByDataTableId(id) {
return request({
url: '/data/assets/getAssetsModelByDataTableId?id='+id,
method: 'get'
})
}

View File

@ -0,0 +1,63 @@
import request from '@/utils/request'
export function getDataSourceList(dataSourceQueryReq) {
return request({
url: '/data/data/list',
method: 'post',
data: dataSourceQueryReq
})
}
export function getAllDataType() {
return request({
url: '/data/dataType/getAllDataType',
method: 'get'
})
}
export function insertDataSource(dataSource) {
return request({
url: '/data/data/insertDataSource',
method: 'post',
data: dataSource
})
}
export function dataSynchronization(dataSourceResp) {
return request({
url: '/data/data/dataSynchronization',
method: 'post',
data: dataSourceResp
})
}
export function testConnect(dataSourceResp) {
return request({
url: '/data/data/testConnect',
method: 'post',
data: dataSourceResp
})
}
export function queryStructure(dataSourceResp) {
return request({
url: '/data/data/queryStructure',
method: 'post',
data: dataSourceResp
})
}
export function queryBigStructure() {
return request({
url: '/data/data/queryBigStructure',
method: 'post'
})
}
export function queryTableStructure(tableStructureQueryReq) {
return request({
url: '/data/data/queryTableStructure',
method: 'post',
data: tableStructureQueryReq
})
}

View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function getShowModel(tableId) {
return request({
url: '/data/dataKvt/getShowModel?tableId='+tableId,
method: 'get'
})
}

View File

@ -0,0 +1,24 @@
import request from '@/utils/request'
export function getDictionaryRespByDataSourceId(id) {
return request({
url: '/data/dict/getDictionaryRespByDataSourceId?dataSourceId='+id,
method: 'get'
})
}
export function insertDictionary(dictionary) {
return request({
url: '/data/dict/insertDictionary',
method: 'post',
data: dictionary
})
}
export function insertDictionaryInfo(dictionaryInfo) {
return request({
url: '/data/dict/insertDictionaryInfo',
method: 'post',
data: dictionaryInfo
})
}

View File

@ -0,0 +1,32 @@
import request from '@/utils/request'
export function getRuleList(ruleListReq) {
return request({
url: '/data/rule/getRuleList',
method: 'post',
data: ruleListReq
})
}
export function insertRuleEngine(ruleEngine) {
return request({
url: '/data/rule/insertRuleEngine',
method: 'post',
data: ruleEngine
})
}
export function getRuleConfigList() {
return request({
url: '/data/ruleConfig/getRuleConfigList',
method: 'get'
})
}
export function testCompile(testWord) {
return request({
url: '/data/test/testCompile',
method: 'post',
data: testWord
})
}

View File

@ -0,0 +1,110 @@
<template>
<div style="height: 800px">
<el-button type="danger" @click="test"></el-button>
<codemirror ref="codeMirror" :value="code" :options="cmOptions" @input="handleCodeMirrorInput" style="height: 200px"/>
</div>
</template>
<script>
import { codemirror } from 'vue-codemirror'
import 'codemirror/mode/clike/clike';
// cm-setting.js
//
import 'codemirror/lib/codemirror.css';
//
import 'codemirror/theme/eclipse.css';
// import 'codemirror/theme/monokai.css';
// html
import 'codemirror/mode/htmlmixed/htmlmixed.js';
//
import 'codemirror/mode/javascript/javascript.js';
import 'codemirror/mode/css/css.js';
import 'codemirror/mode/xml/xml.js';
//
import 'codemirror/addon/fold/foldcode.js';
import 'codemirror/addon/fold/foldgutter.js';
import 'codemirror/addon/fold/foldgutter.css';
import 'codemirror/addon/fold/brace-fold.js';
import {testCompile} from "@/api/ruleEngine/ruleEngine";
export default {
components: {
codemirror,
},
props: {
ruleInfo: {
default: "",
type: String
},
readOnly: {
default: false,
type: Boolean
}
},
watch: {
ruleInfo: {
handler(newVal,oldValue){
console.log("新值",newVal)
console.log("旧址",oldValue)
}
}
},
name: "Encoding",
data() {
return {
codemirror: null,
code: this.ruleInfo,
cmOptions: {
autoRefresh: true, // true
value: '', //
mode: 'text/x-java', //Java
tabSize: 4, // tab
styleActiveLine: true, // true/false
lineNumbers: true, //
theme: 'eclipse', //cobalt/monokai
// json: true,
readOnly: false, // true/false;"nocursor"
lineWrapping: false,
foldGutter: true,
gutters: [
'CodeMirror-lint-markers', //
'CodeMirror-linenumbers',
'CodeMirror-foldgutter', //
],
},
}
},
created() {
},
methods: {
test() {
console.log(this.cmOptions.value)
testCompile(this.ruleInfo).then(
res => {
this.$message.success("编译执行成功!");
}
)
},
handleCodeMirrorInput(newValue) {
// CodeMirror
// newValue
this.ruleInfo = newValue // data
},
}
}
</script>
<style>
.CodeMirror {
font-family: 'JetBrainsMono-Medium', monospace;
height: 800px;
}
.CodeMirror-lines {
line-height: 1.5; /* 这里的1.5是示例表示行间距是字体大小的1.5倍 */
}
</style>

View File

@ -0,0 +1,158 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.dataSource.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.dataSource.fromSystem" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.dataSource.dataSourceDatabaseName" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" v-model="activeName">
<el-tab-pane label="部门授权" name="dept">
<el-table
ref="deptTable"
v-loading="loading"
:data="deptList"
:default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="部门名称" prop="deptName"></el-table-column>
<el-table-column label="部门负责人" prop="leader"></el-table-column>
<el-table-column label="邮箱" prop="email"></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" prop="createTime">
<template slot-scope="scope">
<el-switch
v-model="scope.row.havePermissions"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权"
active-value='Y'
inactive-value='N'
@change="changeStatus($event,scope.row)">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
<el-tab-pane label="用户授权" name="user">
<el-table ref="table" v-loading="loading" :data="userList">
<el-table-column align="center" label="用户名称" prop="userName"/>
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户部门" prop="sysDept.deptName"/>
<el-table-column align="center" label="用户邮箱" prop="email"/>
<el-table-column align="center" label="用户手机号" prop="phonenumber"/>
<el-table-column align="center" label="创建时间" prop="createTime"/>
<el-table-column align="center" label="操作" prop="createTime">
<template slot-scope="scope">
<el-switch
v-model="scope.row.havePermissions"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权"
active-value='Y'
inactive-value='N'
@change="changeStatus($event,scope.row)">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {parseTime} from '@/utils/muyu'
import {insertPermissions} from "@/api/dataSource/Permissions";
export default {
name: "AuthDataSource",
data() {
return {
permissionsReq: {},
//
loading: true,
activeName: "dept",
//
total: 0,
pageNum: 1,
pageSize: 1,
//
baseInfo: {},
//
deptList: [],
//
userList: []
};
},
props: {
userAndDeptDataPermissionsListResp: {
type: Object
}
},
watch: {
userAndDeptDataPermissionsListResp: {
handler(newValue, oldValue) {
this.baseInfo = newValue.dataInfo
this.deptList = this.handleTree(newValue.deptDataPermissionList, "deptId")
console.log("前台deptList:", this.deptList)
this.userList = newValue.userDataPermissionsList
}
}
},
created() {
this.loading = true;
setTimeout(() => this.loading = false, 200)
},
methods: {
parseTime,
changeStatus(data, b) {
this.permissionsReq.newPermissions = data
this.permissionsReq.userOrDeptType = "user"
if (b.deptName){
this.permissionsReq.userOrDeptType = "dept"
}
if (this.permissionsReq.userOrDeptType == "dept"){
this.permissionsReq.userOrDeptId = b.deptId
}else {
this.permissionsReq.userOrDeptId = b.userId
}
this.permissionsReq.dataId = this.baseInfo.dataSource.id
this.permissionsReq.dataType = "dataSource"
console.log("传输到后台的PermissionsReq对象",this.permissionsReq)
insertPermissions(this.permissionsReq).then(
res => {
console.log("权限改变的结果:",res.msg)
}
)
}
}
}
;
</script>

View File

@ -0,0 +1,172 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="name">
<el-input v-model="baseInfo.dataSource.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.dataSource.fromSystem" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.dataSource.dataSourceDatabaseName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表名称" prop="nickName">
<el-input v-model="baseInfo.dataTable.tableName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表中文名" prop="nickName">
<el-input v-model="baseInfo.dataTable.tableAnnotation" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据量" prop="nickName">
<el-input v-model="baseInfo.dataTable.recordCount" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" v-model="activeName">
<el-tab-pane label="部门授权" name="dept">
<el-table
ref="deptTable"
v-loading="loading"
:data="deptList"
:default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="部门名称" prop="deptName" ></el-table-column>
<el-table-column label="部门负责人" prop="leader" ></el-table-column>
<el-table-column label="邮箱" prop="email" ></el-table-column>
<el-table-column align="center" label="创建时间" prop="createTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" prop="createTime" >
<template slot-scope="scope">
<el-switch
v-model="scope.row.havePermissions"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权"
active-value='Y'
inactive-value='N'
@change="changeStatus($event,scope.row)">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
<el-tab-pane label="用户授权" name="user">
<el-table ref="table" v-loading="loading" :data="userList">
<el-table-column align="center" label="用户名称" prop="userName"/>
<el-table-column align="center" label="用户昵称" prop="nickName"/>
<el-table-column align="center" label="用户部门" prop="dept.deptName"/>
<el-table-column align="center" label="用户邮箱" prop="email"/>
<el-table-column align="center" label="用户手机号" prop="phonenumber"/>
<el-table-column align="center" label="创建时间" prop="createTime" />
<el-table-column align="center" label="操作" prop="havePermissions" >
<template slot-scope="scope">
<el-switch
style="display: block"
v-model="scope.row.havePermissions"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="已授权"
inactive-text="未授权"
active-value="Y"
inactive-value="N"
@change="changeStatus($event,scope.row)">
</el-switch>
</template>
</el-table-column>
</el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { parseTime } from '@/utils/muyu'
import {insertPermissions} from "@/api/dataSource/Permissions";
export default {
name: "AuthTable",
data() {
return {
permissionsReq: {},
//
loading: true,
activeName: "dept",
//
total: 0,
pageNum: 1,
pageSize: 1,
//
baseInfo: {},
//
deptList: [],
//
userList: []
};
},
props: {
userAndDeptDataPermissionsListResp: {
type: Object
}
},
watch: {
userAndDeptDataPermissionsListResp: {
handler(newValue,oldValue){
this.baseInfo = newValue.dataInfo
this.deptList = this.handleTree(newValue.deptDataPermissionList,"deptId")
console.log("前台deptList:",this.deptList)
this.userList = newValue.userDataPermissionsList
}
}
},
created() {
this.loading = true;
setTimeout(() => this.loading = false, 200)
},
methods: {
parseTime,
changeStatus(data,b){
this.permissionsReq.newPermissions = data
this.permissionsReq.userOrDeptType = "user"
if (b.deptName){
this.permissionsReq.userOrDeptType = "dept"
}
if (this.permissionsReq.userOrDeptType == "dept"){
this.permissionsReq.userOrDeptId = b.deptId
}else {
this.permissionsReq.userOrDeptId = b.userId
}
this.permissionsReq.dataId = this.baseInfo.dataTable.id
this.permissionsReq.dataType = "dataTable"
console.log("传输到后台的PermissionsReq对象",this.permissionsReq)
insertPermissions(this.permissionsReq).then(
res => {
console.log("权限改变的结果:",res.msg)
}
)
}
},
};
</script>

View File

@ -0,0 +1,116 @@
<template>
<el-container :style="{height: mainHeight + 'px'}">
<el-aside>
<el-tree :data="assetStructureList"
:expand-on-click-node="false"
:load="expandTable"
lazy
@node-click="(data) => showAssets=data.type">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div @click="getDeptAndUser(data,'dataSource',null)" v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div>
<div @click="getDeptAndUser(data,'dataTable',data.dataTable)" v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+')' }}</div>
</div>
</el-tree>
</el-aside>
<el-container>
<el-main>
<auth-data-source :userAndDeptDataPermissionsListResp="userAndDeptDataPermissionsListResp" v-if="showAssets === 'dataSource'"/>
<auth-table :userAndDeptDataPermissionsListResp="userAndDeptDataPermissionsListResp" v-else-if="showAssets === 'dataTable'"/>
</el-main>
</el-container>
</el-container>
</template>
<script>
import AuthDataSource from './auth/AuthDataSource.vue'
import AuthTable from './auth/AuthTable.vue'
import {Table} from "element-ui";
import {queryBigStructure} from "@/api/dataSource/data";
import {getAllUserAndDept} from "@/api/dataSource/Permissions";
export default {
name: 'assetStructure',
computed: {
Table() {
return Table
}
},
components: { AuthDataSource, AuthTable },
data() {
return {
assetsModelList: [],
dataBaseConnectObj: {},
mainHeight: window.innerHeight - 85,
assetStructureList: [],
showAssets: null,
title: null,
dataType: null,
userAndDeptDataPermissionsListResp: {}
}
},
methods: {
getDeptAndUser(dataObject,dataType,dataTable){
console.log(dataObject,dataType)
let id = null;
if (dataType == "dataSource"){
id = dataObject.dataSource.id;
}else if (dataType == "dataTable"){
id = dataObject.dataTable.id
console.log(this.assetStructureList)
console.log(dataTable)
this.assetStructureList.forEach(
assetsStr => {
if ( assetsStr.dataSource.id == dataTable.dataSourceId){
dataObject = assetsStr
}
}
)
dataObject.dataTable = dataTable
}
getAllUserAndDept(dataType,id).then(
res => {
this.userAndDeptDataPermissionsListResp = res.data
this.userAndDeptDataPermissionsListResp.dataInfo = dataObject
console.log("后台响应对象:",this.userAndDeptDataPermissionsListResp)
}
)
},
getBigStructure() {
queryBigStructure().then(
res => {
this.assetStructureList = res.data.dataSourceDecorationList
console.log("BigStructure",this.assetStructureList)
}
)
},
expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList);
if (node.level > 1) return resolve([]);
const {data} = node;
if (data.type === 'dataSource') {
this.title = data.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')'
}
if (data.type === 'dataTable') {
this.title = data.tableName + '('+data.dataTable.tableAnnotation + '-' + data.dataTable.recordCount+')'
}
setTimeout(() => {
resolve(data.dataTableList)
this.showAuth = data.type;
}, 500);
}
},
created() {
this.getBigStructure()
}
}
</script>
<style scoped lang="scss">
.el-aside {
margin: 0;
padding: 0;
width: 400px;
background-color: white;
}
.el-main {
background-color: #f1f1f1;
}
</style>

View File

@ -0,0 +1,131 @@
<template>
<el-container :style="{height: mainHeight + 'px'}">
<el-aside>
<el-tree :data="assetStructureList"
:expand-on-click-node="false"
:load="expandTable"
lazy
@node-click="(data) => showAssets=data.type">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div>
<div @click="getDeptAndUser(data,'dataTable',data.dataTable)" v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+')' }}</div>
</div>
</el-tree>
</el-aside>
<el-container>
<el-main>
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions border :column="2">
<el-descriptions-item label="表名称">{{tableObject.tableName}}</el-descriptions-item>
<el-descriptions-item label="表备注">{{tableObject.tableAnnotation}}</el-descriptions-item>
<el-descriptions-item label="数据量">{{tableObject.recordCount}}</el-descriptions-item>
<el-descriptions-item label="是否核心">
<el-tag size="small"></el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card" style="margin-top: 20px">
<div slot="header" class="clearfix">
<span>模型数据</span>
</div>
<el-row :gutter="20">
<el-col :span="6" v-for="dataKvt in dataKvtModelList" style="margin-top: 20px">
<el-descriptions :title="dataKvt.fieldsName" direction="vertical" border :column="1">
<el-descriptions-item label="Type">
<el-tag size="small">{{dataKvt.javaType}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="Value">{{dataKvt.dataValue}}</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-card>
</el-main>
</el-container>
</el-container>
</template>
<script>
import {queryBigStructure} from "@/api/dataSource/data";
import {getShowModel} from "@/api/dataSource/dataKvt";
export default {
name: "AssetShow",
data() {
return {
tableObject: {},
mainHeight: window.innerHeight - 85,
defaultProps: {
children: 'childrenList',
label: 'name'
},
showAuth: null,
assetStructureList: [],
childrenList: [],
dataKvtModelList: []
}
},
created() {
this.getBigStructure()
},
methods: {
getDeptAndUser(dataObject,dataType,dataTable){
console.log(dataObject,dataTable)
this.tableObject = dataObject.dataTable
console.log(dataTable.id)
getShowModel(dataTable.id).then(
res => {
console.log("模型:",res.data)
this.dataKvtModelList = res.data
}
)
},
getBigStructure() {
queryBigStructure().then(
res => {
this.assetStructureList = res.data.dataSourceDecorationList
console.log("BigStructure",this.assetStructureList)
}
)
},
expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList);
if (node.level > 1) return resolve([]);
const {data} = node;
if (data.type === 'dataSource') {
this.title = data.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')'
}
if (data.type === 'dataTable') {
this.title = data.tableName + '('+data.dataTable.tableAnnotation + '-' + data.dataTable.recordCount+')'
}
setTimeout(() => {
resolve(data.dataTableList)
this.showAuth = data.type;
}, 500);
}
}
}
</script>
<style scoped>
.el-aside {
margin: 0;
padding: 0;
width: 400px;
background-color: white;
}
.el-main {
background-color: #f1f1f1;
}
.custom-tree-node{
height: 30px;
}
.el-descriptions-row>th{
width: 200px;
}
</style>

View File

@ -0,0 +1,292 @@
<template>
<div>
<el-card>
<div slot="header" class="clearfix">
<span>资产模型基本信息</span>
</div>
<el-descriptions border :column="2">
<el-descriptions-item label="表名称">{{ tableInfo.tableName }}</el-descriptions-item>
<el-descriptions-item label="表备注">{{tableInfo.tableAnnotation}}</el-descriptions-item>
<el-descriptions-item label="数据量">{{ tableInfo.recordCount }}</el-descriptions-item>
<el-descriptions-item label="是否核心">
<el-tag size="small"></el-tag>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card style=" margin-top: 20px;">
<div slot="header" class="clearfix">
<span>资产模型详细信息</span>
</div>
<el-table
:data="assetsModelList"
style="width: 100%;">
<el-table-column prop="fieldsName" label="名称" />
<el-table-column prop="fieldsAnnotation" label="注释" />
<el-table-column prop="isDictionary" label="是否主键" >
<template slot-scope="scope">
<el-tag size="small" :type="scope.row.isDictionary === 1 ? 'success' : ''">
{{scope.row.isDictionary}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="baseType" label="类型" />
<el-table-column prop="javaType" label="映射类型" />
<el-table-column prop="fieldsLength" label="长度" />
<el-table-column prop="decimalPlace" label="小数位" />
<el-table-column prop="isEmpty" label="是否为空" >
<template slot-scope="scope">
<el-tag size="small" :type="scope.row.isNull === 1 ? 'success' : 'danger'">
{{scope.row.isEmpty}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="defaultValue" label="默认值" />
<el-table-column prop="isDict" label="是否字典" >
<template slot-scope="scope">
<el-tag v-if="scope.row.isDictionary === 'Y'" size="small" type="success">
{{scope.row.isDictionary}}
</el-tag>
<el-tag v-if="scope.row.isDictionary === 'N'" size="small" type="error">
{{scope.row.isDictionary}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="dictionaryName" label="映射字典" >
<template slot-scope="scope">
<div @mouseenter="getDictionaryInfoList(scope.row)" @mouseout="removeDiv">
<el-tag slot="reference" >{{scope.row.dictionaryName}}</el-tag>
</div>
<el-popover
v-if="flagId == scope.row.id"
placement="left"
v-model="isOpen"
trigger="hover"
width="200">
<el-table :data="tagSelectDictionaryInfoList">
<el-table-column property="dictionaryInfoTag" label="字典标签"/>
<el-table-column property="dictionaryInfoValue" label="字典值"/>
</el-table>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="id" label="操作" >
<template slot-scope="scope">
<el-button type="text" @click="update(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog title="资产结构修改" width="80%" :visible.sync="formStatus">
<el-form :model="form" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="名称">
<el-input v-model="form.fieldsName" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="注释">
<el-input v-model="form.fieldsAnnotation" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否主键">
<el-tag size="small" :type="form.isDictionary === 'Y' ? 'success' : 'danger'">
{{form.isDictionary}}
</el-tag>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据类型">
<el-input v-model="form.baseType" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="数据长度">
<el-input v-model="form.fieldsLength" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="小数位">
<el-input v-model="form.decimalPlace" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否为空">
<el-tag size="small" :type="form.isEmpty === 'Y' ? 'success' : 'danger'">
{{form.isEmpty}}
</el-tag>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认值">
<el-input v-model="form.defaultValue" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="映射字段">
<el-input v-model="form.javaType" readonly autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否字典">
<el-switch
v-model="form.isDictionary"
active-value='Y'
inactive-value='N'
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row v-show="form.isDictionary === 'Y'">
<el-col :span="24">
<el-form-item label="字典">
<el-select v-model="form.dictionaryId" @change="giveSelect">
<el-option v-for="dict in dictList" :key="dict.dictionary.id" :label="dict.dictionary.dictionaryName" :value="dict.dictionary.id">{{dict.dictionary.dictionaryName}}</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item>
<el-table :data="selectedDictionaryInfoList" striped border>
<el-table-column property="dictionaryInfoTag" label="字典标签"/>
<el-table-column property="dictionaryInfoValue" label="字典值"/>
</el-table>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="formStatus = false"> </el-button>
<el-button type="primary" @click="updateAssetsModel()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary";
import {getAssetsModelByDataTableId, updateAssetsModel} from "@/api/dataSource/assets";
export default {
name: 'OverallAssetStructure',
props: {
assetsModelList: {
type: Array
},
tableInfo: {
type: Object
}
},
data() {
return {
isOpen: false,
tagSelectDictionaryInfoList: [],
dictionaryIdAndName: {
dictionaryName: null,
id: null
},
selectedDictionaryInfoList: [],
form: {},
formStatus: false,
dictList: [],
flagId: 0
}
},
watch: {
form:{
// variable
handler(item1){
this.dictList.forEach(dict => {
if (dict.dictionary.id == item1.dictionaryId){
this.$set(this, "selectedDictionaryInfoList", dict.dictionaryInfoList);
this.$set(this, "dictionaryIdAndName", dict.dictionary)
console.log(this.selectedDictionaryInfoList)
}
})
}
}
},
methods: {
removeDiv(){
this.isOpen = false
this.tagSelectDictionaryInfoList = []
},
getDictionaryInfoList(row) {
console.log("鼠标滑过:",row)
this.isOpen = true
this.flagId = row.id
getDictionaryRespByDataSourceId(this.tableInfo.dataSourceId).then(res => {
this.dictList = res.data
this.dictList.forEach(dict => {
if (dict.dictionary.id == row.dictionaryId){
this.$set(this, "tagSelectDictionaryInfoList", dict.dictionaryInfoList);
console.log(this.tagSelectDictionaryInfoList)
}
})
})
},
updateAssetsModel(){
console.log(this.form)
if (this.form.isDictionary == "Y"){
this.form.dictionaryId = this.dictionaryIdAndName.id;
this.form.dictionaryName = this.dictionaryIdAndName.dictionaryName;
}else {
this.form.dictionaryId = null;
this.form.dictionaryName = null;
}
updateAssetsModel(this.form).then(
res => {
this.$message.success(res.msg);
this.formStatus = false
this.form = {}
}
)
this.selectedDictionaryInfoList = []
},
giveSelect() {
console.log("id和名字",this.dictionaryIdAndName)
this.dictList.forEach(dict => {
if (dict.dictionary.id == this.form.dictionaryId){
this.$set(this, "selectedDictionaryInfoList", dict.dictionaryInfoList);
this.$set(this, "dictionaryIdAndName", dict.dictionary)
console.log(this.selectedDictionaryInfoList)
}
})
},
update(row){
console.log("tableInfo",this.tableInfo)
getDictionaryRespByDataSourceId(this.tableInfo.dataSourceId).then(
res => {
console.log("获取的所有当前表字典",res.data)
this.dictList = res.data
console.log("字典:",this.dictList)
this.form = row;
if (this.form.dictionaryId){
this.form.dictionaryId = Number(row.dictionaryId) // Number
}
console.log("form",this.form)
}
)
this.formStatus = true;
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,189 @@
<template>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
整体数据资产结构概述
</div>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon class-name="card-panel-icon" icon-class="database"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据接入
</div>
<count-to :duration="2600" :end-val="dataSourceCount" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon class-name="card-panel-icon" icon-class="table"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
资产模型
</div>
<count-to :duration="3000" :end-val="allTableCount" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :lg="8" :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon class-name="card-panel-icon" icon-class="field"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据模型
</div>
<count-to :duration="3200" :end-val="allDataModelCount" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
props: {
dataSourceCount: {
type :Number
},
allTableCount: {
type :Number
},
allDataModelCount: {
type :Number
}
},
components: {
CountTo
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
}
}
</script>
<style lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3
}
}
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3
}
.card-panel-icon-wrapper {
float: left;
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 48px;
}
.card-panel-description {
float: right;
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width: 550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
.title-header{
text-align: center;
width: 100%;
font-size: 46px;
font-weight: 600;
line-height: 100px;
}
</style>

View File

@ -0,0 +1,333 @@
<template>
<el-row :gutter="40" class="panel-group">
<div class="title-header">
{{dataSourceObj.dataSource.fromSystem}} - 资产结构概述
</div>
<el-col :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon class-name="card-panel-icon" icon-class="table"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
资产模型
</div>
<count-to :duration="3000" :end-val="dataSourceObj.dataSource.tableCount" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :sm="12" :xs="12" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon class-name="card-panel-icon" icon-class="field"/>
</div>
<div class="card-panel-description">
<div class="card-panel-text">
数据模型
</div>
<count-to :duration="3200" :end-val="dataSourceObj.dataSource.dataModelCount" :start-val="0" class="card-panel-num"/>
</div>
</div>
</el-col>
<el-col :span="24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>基础字典</span>
<el-popover
placement="top-start"
title="基础字典"
width="200"
trigger="hover"
content="这个字典是数据资产项目当中的字典内容,而不是本项目当中的字典内容。主要作用为数据清洗过程中数据字典映射作用">
<i class="el-icon-question" slot="reference"></i>
</el-popover>
<el-popover
placement="right"
width="400"
trigger="click">
<el-row :gutter="20">
<el-col :span="18">
<el-input v-model="dictionary.dictionaryName"></el-input>
</el-col>
<el-col :span="6">
<el-button @click="addDict"></el-button>
</el-col>
</el-row>
<el-button style="float: right; padding: 3px 0" type="text" slot="reference">新增字典</el-button>
</el-popover>
</div>
<el-row :gutter="20">
<el-col v-for="dictionaryInfoResp in dictionaryInfoRespList" :md="8" :sm="24" :xs="12">
<el-card class="box-card" style="height: 300px">
<div slot="header" class="clearfix">
<span>{{dictionaryInfoResp.dictionary.dictionaryName}}</span>
<el-button style="float: right; padding: 3px 0"
type="text"
@click="dictionaryInfoResp.dictionaryInfoList.push({dictionaryInfoTag: null, dictionaryInfoValue: null, isEdit: true })"
>新增</el-button>
</div>
<el-table :data="dictionaryInfoResp.dictionaryInfoList" style="width: 100%" height="280px">
<el-table-column label="标签">
<template slot-scope="scope">
<span v-if="!scope.row.isEdit">{{scope.row.dictionaryInfoTag}}</span>
<el-input v-if="scope.row.isEdit" v-model="scope.row.dictionaryInfoTag" size="mini"></el-input>
</template>
</el-table-column>
<el-table-column label="值">
<template slot-scope="scope">
<span v-if="!scope.row.isEdit">{{scope.row.dictionaryInfoValue}}</span>
<el-input v-if="scope.row.isEdit" v-model="scope.row.dictionaryInfoValue" size="mini"></el-input>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
v-if="!scope.row.isEdit"
size="mini"
type="text"
icon="el-icon-edit"
@click="$set(scope.row,'isEdit',true)"
>修改</el-button>
<el-button
v-if="scope.row.isEdit"
@click="editConfirm(scope.row,dictionaryInfoResp.dictionary.id)"
size="mini"
type="text"
icon="el-icon-finished"
>确定</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</el-card>
</el-col>
<el-col :span="24">
<el-tabs v-model="activeName" type="border-card" >
<el-tab-pane :name="assetsModelResp.dataTable.tableName" :label="assetsModelResp.dataTable.tableName" :key="assetsModelResp.dataTable.id" v-for="assetsModelResp in assetsModelRespArrayList">
<overall-asset-structure :tableInfo="assetsModelResp.dataTable" :assetsModelList="assetsModelResp.assetsModelList" />
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
import OverallAssetStructure from './OverallAssetStructure.vue'
import {getDictionaryRespByDataSourceId, insertDictionary, insertDictionaryInfo} from "@/api/dataSource/dictionary";
export default {
watch:{
assetsModelRespArrayList:{
// variable
handler(item1,item2){
this.activeName=item1[0].dataTable.tableName
}
}
},
props: {
assetsModelRespArrayList: {
type: Array
},
dataSourceObj: {
type: Object
},
dictionaryInfoRespList: {
type: Array
}
},
data() {
return {
flagDictionaryId:null,
nowTime: null,
activeName: '',
dictionary: {},
giveObj: []
}
},
components: {
OverallAssetStructure,
CountTo
},
methods: {
editConfirm(row,dictId){
console.log("获得的dictID",dictId)
row.dictionaryId = dictId
console.log("字典信息",row)
if (row.dictionaryInfoTag.length == 0 || row.dictionaryInfoValue.length == 0) {
this.$message.error('字典标签或字典值,不可为空');
return;
}
row.isEdit = false;
insertDictionaryInfo(row).then(
res => {
console.log("添加字典详情:",res.data)
}
)
this.getDictionaryResp()
},
getDictionaryResp() {
getDictionaryRespByDataSourceId(this.dataSourceObj.dataSource.id).then(
res => {
console.log("字典表响应对象:",res.data)
this.giveObj = res.data
this.giveObj.forEach(dictionaryInfoResp => {
dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
this.$set(dictionaryInfo,'isEdit',false)
})
})
this.handleSetLineChartData(this.giveObj)
}
)
},
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
},
addDict(){
if (!this.dictionary.dictionaryName){
this.$message.error('数据字典,不可为空');
return;
}
let dictionaryInfoArrayList = {}
this.dictionary.dataSourceId = this.dataSourceObj.dataSource.id
dictionaryInfoArrayList.dictionary = this.dictionary
dictionaryInfoArrayList.dictionaryInfoList = []
insertDictionary(this.dictionary).then(
res => {
console.log("让我看看",res)
dictionaryInfoArrayList.dictionary.id = res.data
this.dictionaryInfoRespList.push(dictionaryInfoArrayList)
this.dictionary = {}
this.getDictionaryResp()
if (res.code == 200){
this.$message.success("添加成功")
}
}
)
},
}
}
</script>
<style lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3
}
}
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3
}
.card-panel-icon-wrapper {
float: left;
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 48px;
}
.card-panel-description {
float: right;
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width: 550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
.title-header{
text-align: center;
width: 100%;
font-size: 46px;
font-weight: 600;
line-height: 100px;
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<el-container :style="{height: mainHeight + 'px'}">
<el-aside>
<el-tree :data="assetStructureList"
:expand-on-click-node="false"
:load="expandTable"
lazy
@node-click="(data) => showAssets=data.type"
:props="defaultProps">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div @click="getNowDataSource(data)" v-if="data.type === 'dataSource'">{{ data.dataSource.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')' }}</div>
<div @click="getTableStructure(data)" v-if="data.type === 'dataTable'">{{ data.dataTable.tableName + '-'+data.dataTable.tableAnnotation + '(' + data.dataTable.recordCount+')' }}</div>
</div>
</el-tree>
</el-aside>
<el-container>
<el-main>
<OverallAssets :dataSourceCount="dataSourceCount" :allTableCount="allTableCount" :allDataModelCount="allDataModelCount" v-if="showAssets == null"/>
<overall-specific-assets @changeDictionaryInfoRespList="changeDictionaryInfoRespList" :dictionaryInfoRespList="dictionaryInfoRespList" :dataSourceObj="dataSourceObj" :assetsModelRespArrayList="assetsModelRespArrayList" v-if="showAssets === 'dataSource'" :title="title"/>
<overall-asset-structure :tableInfo="tableInfo" :assetsModelList="assetsModelList" v-if="showAssets === 'dataTable'" :title="title"/>
</el-main>
</el-container>
</el-container>
</template>
<script>
import OverallAssets from './dashboard/OverallAssets.vue'
import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue'
import OverallAssetStructure from './dashboard/OverallAssetStructure.vue'
import {queryBigStructure} from "@/api/dataSource/data";
import {getAssetsModelByDataTableId, getAssetsModelListByTableIds} from "@/api/dataSource/assets";
import {getDictionaryRespByDataSourceId} from "@/api/dataSource/dictionary";
export default {
name: 'assetStructure',
components: { OverallAssetStructure, OverallSpecificAssets, OverallAssets },
data() {
return {
dataSourceId: null,
tableInfo: {},
assetsModelList: [],
dataSourceObj: null,
tableCount:0,
dataModelCount:0,
dataSourceCount: 0,
allTableCount: 0,
allDataModelCount: 0,
dataBaseConnectObj: {},
tableData: [],
mainHeight: window.innerHeight - 85,
defaultProps: {
children: 'childrenList',
label: 'name'
},
assetStructureList: [],
childrenList: [],
showAssets: null,
title: null,
tableIds: [],
assetsModelRespArrayList: [],
dictionaryInfoRespList: []
}
},
methods: {
getNowDataSource(data) {
console.log(data)
this.tableIds = data.dataTableList.map(dataTable => dataTable.dataTable.id);
console.log("idList",this.tableIds)
getAssetsModelListByTableIds(this.tableIds).then(
res => {
this.assetsModelRespArrayList = res.data
console.log("this.assetsModelRespArrayList",this.assetsModelRespArrayList)
}
)
getDictionaryRespByDataSourceId(data.dataSource.id).then(
res => {
console.log("字典表响应对象:",res.data)
this.dictionaryInfoRespList = res.data
this.dictionaryInfoRespList.forEach(dictionaryInfoResp => {
dictionaryInfoResp.dictionaryInfoList.forEach(dictionaryInfo => {
this.$set(dictionaryInfo,'isEdit',false)
})
})
}
)
this.dataSourceObj = data
console.log("obj",this.dataSourceObj)
},
changeDictionaryInfoRespList(value){
this.dictionaryInfoRespList = value
},
getTableStructure(data) {
console.log(data.dataTable.id)
getAssetsModelByDataTableId(data.dataTable.id).then(
res => {
console.log("根据表ID",res.data)
this.assetsModelList = res.data.assetsModelList
this.tableInfo = res.data.dataTable
console.log(this.tableInfo)
}
)
},
getBigStructure() {
queryBigStructure().then(
res => {
this.assetStructureList = res.data.dataSourceDecorationList
this.dataSourceCount = this.assetStructureList.length
this.allTableCount = res.data.allTableCount
this.allDataModelCount = res.data.allDataModelCount
console.log("BigStructure",this.assetStructureList)
this.assetsModelList = this.assetStructureList
}
)
},
expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList);
if (node.level > 1) return resolve([]);
const {data} = node;
if (data.type === 'dataSource') {
this.title = data.name + '('+data.dataSource.dataSourceDatabaseName + '-' + data.dataSource.fromSystem+')'
}
if (data.type === 'dataTable') {
this.title = data.tableName + '('+data.dataTable.tableAnnotation + '-' + data.dataTable.recordCount+')'
}
setTimeout(() => {
resolve(data.dataTableList)
this.showAuth = data.type;
}, 500);
}
},
created() {
this.getBigStructure()
}
}
</script>
<style scoped lang="scss">
.el-aside {
margin: 0;
padding: 0;
width: 400px;
background-color: white;
}
.el-main {
background-color: #f1f1f1;
}
</style>

View File

@ -0,0 +1,551 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item label="接入源名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入接入源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据来源系统名称" prop="fromSystem">
<el-input
v-model="queryParams.fromSystem"
placeholder="请输入数据来源系统名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据库名称" prop="dataSourceDatabaseName">
<el-input
v-model="queryParams.dataSourceDatabaseName"
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="['system:access:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:access:edit']"
>修改</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="['system:access:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:access:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="accessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="接入源名称" align="center" prop="name" />
<el-table-column label="数据来源系统名称" align="center" prop="fromSystem" />
<el-table-column label="主机地址" align="center" prop="dataSourceIp" />
<el-table-column label="端口号" align="center" prop="dataSourcePort" />
<el-table-column label="数据接入类型" align="center" prop="dataType" />
<el-table-column label="数据库名称" align="center" prop="dataSourceDatabaseName" />
<el-table-column label="备注" align="center" prop="remark" />
<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-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:access:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:access:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="testConnect(scope.row)"
v-hasPermi="['system:access:remove']"
>测试连接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="dataSynchronization(scope.row)"
v-hasPermi="['system:access: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="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-card>
<div slot="header" class="clearfix">
<span>基础配置信息</span>
</div>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="接入源名称" prop="name">
<el-input v-model="form.name" placeholder="请输入接入源名称" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="数据来源系统名称" prop="systemName">
<el-input v-model="form.fromSystem" placeholder="请输入数据来源系统名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="主机地址" prop="host">
<el-input v-model="form.dataSourceIp" placeholder="请输入主机地址" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="端口号" prop="port">
<el-input v-model="form.dataSourcePort" placeholder="请输入主机地址" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="用户名" prop="dataSourceUsername">
<el-input v-model="form.dataSourceUsername" placeholder="请输入用户名" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="密码" prop="dataSourcePassword">
<el-input v-model="form.dataSourcePassword" placeholder="请输入密码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="数据接入类型" prop="type">
<el-select style="width: 100%" v-model="form.typeId">
<el-option v-for="type in typeList" :label="type.dataType" :value="type.id" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="数据库名称" prop="databaseName">
<el-input v-model="form.dataSourceDatabaseName" placeholder="请输入数据库名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-card>
<div slot="header" class="clearfix">
<span>数据连接参数</span>
</div>
<el-col :sm="24">
<el-form-item label="数据连接参数" prop="additionalConfiguration">
<el-input v-model="form.additionalConfiguration" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-row :gutter="10" style="margin: 10px 0">
<el-col :span="2">
<el-button type="primary" @click="addParam()"></el-button>
</el-col>
<el-col :span="2">
<el-button type="danger" @click="deleteParam(null)"></el-button>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :md="8" :xs="12" style="margin: 10px 0" v-for="(dataSourceParam, dataSourceParamIndex) in dataSourceParamList">
<el-col :span="10">
<el-input v-model="dataSourceParam.name" placeholder="请输入参数键" @keyup.native="processParam"/>
</el-col>
<el-col :span="1"><span style="font-size: 28px; margin: 0 3px 0 0;">:</span></el-col>
<el-col :span="10">
<el-input v-model="dataSourceParam.val" placeholder="请输入参数值" @keyup.native="processParam"/>
</el-col>
<el-col :span="3">
<el-button type="danger" @click="deleteParam(dataSourceParamIndex)"></el-button>
</el-col>
</el-col>
</el-row>
</el-card>
</el-row>
</el-card>
<el-card style="margin-top: 20px">
<div slot="header" class="clearfix">
<span>连接池配置</span>
</div>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="初始连接数量" prop="initialNumberOfConnections">
<el-input v-model="form.initialNumberOfConnections" placeholder="请输入初始连接数量" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="最大连接数量" prop="maximumNumberOfConnections">
<el-input v-model="form.maximumNumberOfConnections" placeholder="请输入最大连接数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="最大等待时间" prop="maximumWaitingTime">
<el-input v-model="form.maximumWaitingTime" placeholder="请输入最大等待时间" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="最大等待次数" prop="maximumWaitingTimes">
<el-input v-model="form.maximumWaitingTimes" placeholder="请输入最大等待次数" />
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card style="margin-top: 20px">
<div slot="header" class="clearfix">
<span>其他信息</span>
</div>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-card>
</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 {
dataSynchronization,
getAllDataType,
getDataSourceList,
insertDataSource,
queryStructure,
testConnect
} from "@/api/dataSource/data";
export default {
name: "Access",
data() {
return {
selectTableName: "",
tableList:[],
dialogTableVisible: false,
dataSourceQueryReq: {
typeId: null,
name: "",
dataSourceDatabaseName: ""
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
accessList: [],
//
typeList: [],
//
title: "",
//
open: false,
//
queryParams: {
name: null,
fromSystem: null,
dataSourceDatabaseName: null
},
//
form: {},
//
rules: {
name: [
{required: true, message: "接入源名称不能为空", trigger: "blur"}
],
fromSystem: [
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
],
typeId: [
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
],
dataSourceIp: [
{required: true, message: "主机地址不能为空", trigger: "blur"}
],
dataSourcePort: [
{required: true, message: "主机地址不能为空", trigger: "blur"}
],
dataSourceDatabaseName: [
{required: true, message: "数据库名称不能为空", trigger: "blur"}
],
additionalConfiguration: [
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
],
initialNumberOfConnections: [
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
],
maximumNumberOfConnections: [
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
],
maximumWaitingTime: [
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
],
maximumWaitingTimes: [
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
]
},
//
dataSourceParamList: [
{
name: null,
val: null
}
]
};
},
created() {
this.getList();
this.getDataTypeList()
},
methods: {
//
addParam(){
this.dataSourceParamList.push({
name: null,
val: null
})
},
//
deleteParam(index){
if (index != null){
this.dataSourceParamList.splice(index, 1);
}else {
this.dataSourceParamList = []
}
this.processParam();
},
//
processParam(){
this.form.additionalConfiguration = this.dataSourceParamList
.filter(item => item.name != null || item.val != null)
.map(item => {
return item.name + "=" + item.val;
}).join("&")
console.log(this.form.additionalConfiguration)
},
/** 查询数据接入列表 */
getList() {
this.loading = true;
getDataSourceList(this.queryParams).then(res => {
this.accessList = res.data;
console.log(res.data)
})
this.loading = false;
},
getDataTypeList() {
getAllDataType().then(
res => {
this.typeList = res.data
console.log("typeList:",this.typeList)
}
)
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
typeId: null,
fromSystem: null,
dataSourceIp: null,
dataSourcePort: null,
dataSourceDatabaseName: null,
additionalConfiguration: null,
initialNumberOfConnections: null,
maximumNumberOfConnections: null,
maximumWaitingTime: null,
maximumWaitingTimes: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
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.dataSourceParamList = []
this.reset();
this.open = true;
this.title = "添加数据接入";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = row;
this.dataSourceParamList = [];
if (this.form.additionalConfiguration!=undefined){
this.form.additionalConfiguration.split("&").forEach(param => {
let paramArr = param.split("=");
this.dataSourceParamList.push({
name: paramArr[0],
val: paramArr[1]
})
})
}
this.open = true;
this.title = "修改数据接入";
},
/**
* 查询表结构
*/
queryTableStructure(){
},
/** 提交按钮 */
submitForm() {
console.log('from:',this.form)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.$modal.msgSuccess("修改成功");
this.open = false;
} else {
insertDataSource(this.form).then(
res => {
this.$modal.msgSuccess("新增成功");
this.open = false;
}
)
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除数据接入编号为"' + ids + '"的数据项?').then(() => {
this.$modal.msgSuccess("删除成功");
});
},
queryDataBase(row) {
queryStructure(row).then(
res => {
console.log(res.data)
this.tableList = res.data
this.dialogTableVisible = true
}
)
},
dataSynchronization(row) {
dataSynchronization(row).then(
res => {
if (res.code ===200){
this.$message.success(res.msg)
}else {
this.$message.error(res.msg)
}
}
)
},
testConnect(row) {
testConnect(row).then(
res => {
if (res.code ===200){
this.$message.success(res.msg)
}else {
this.$message.error(res.msg)
}
}
)
console.log("test:",row)
},
/** 导出按钮操作 */
handleExport() {
this.$modal.msgSuccess("导出成功");
}
}
};
</script>

View File

@ -0,0 +1,72 @@
<template>
<el-col :span="22" :offset="1">
<el-card>
<div slot="header" class="clearfix">
<span>公共配置</span>
</div>
<el-form ref="form" :model="ruleEngineCommonConfig" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="规则基础目录">
<el-input v-model="ruleEngineCommonConfig.packageName" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</el-form>
</el-card>
<el-col>
<el-card>
<div slot="header" class="clearfix">
<span>作用域</span>
</div>
<el-tabs type="border-card" v-model="codeCardStatus">
<el-tab-pane v-for="scope in ruleConfigList" :label="scope.ruleScopeName" :name="scope.scopeCode">
<encoding v-if="codeCardStatus === scope.scopeCode" style="height: 800px" :rule-info="scope.ruleInfo" :read-only="true"></encoding>
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-col>
</template>
<script>
import Encoding from "@/components/Encoding/index.vue";
import {getRuleConfigList} from "@/api/ruleEngine/ruleEngine";
export default {
name: "EngineConfig",
components: {Encoding},
data() {
return {
codeCardStatus: "任务",
ruleEngineCommonConfig: {
packageName: "com.muyu.rule.engine",
},
ruleConfigList: []
}
},
created() {
this.getRuleConfigList()
},
methods: {
getRuleConfigList(){
getRuleConfigList().then(
res => {
console.log(res.data)
this.ruleConfigList = res.data
}
)
}
}
}
</script>
<style>
.el-col {
margin-top: 20px;
}
</style>

View File

@ -0,0 +1,351 @@
<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="name">
<el-input
v-model="queryParams.ruleName"
placeholder="请输入规则名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规则类型" prop="type">
<el-select v-model="queryParams.ruleLevelId" placeholder="请选择规则类型" clearable>
<el-option
v-for="ruleLevel in ruleLevelList"
:key="ruleLevel.id"
:label="ruleLevel.ruleLevel"
:value="ruleLevel.id"
/>
</el-select>
</el-form-item>
<el-form-item label="规则状态" prop="status">
<el-select v-model="queryParams.ruleStatus" placeholder="请选择规则状态" clearable>
<el-option value="1">正常</el-option>
<el-option value="2">停用</el-option>
</el-select>
</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="['system:engine: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="['system:engine:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:engine:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="engineList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="规则名称" align="center" prop="ruleName" />
<el-table-column label="规则类型" align="center" prop="type">
<template slot-scope="scope">
<el-tag v-if="scope.row.ruleTypeId == 1"></el-tag>
<el-tag v-if="scope.row.ruleTypeId != 1" >模版规则</el-tag>
</template>
</el-table-column>
<el-table-column label="规则作用域" align="center" prop="level">
<template slot-scope="scope">
<el-tag v-if="scope.row.ruleLevelId==1"></el-tag>
<el-tag v-if="scope.row.ruleLevelId==2"></el-tag>
<el-tag v-if="scope.row.ruleLevelId==3"></el-tag>
</template>
</el-table-column>
<el-table-column label="引擎编码" align="center" prop="ruleCode" />
<el-table-column label="规则状态" align="center" prop="status">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 1"></el-tag>
<el-tag v-if="scope.row.status != 1"></el-tag>
</template>
</el-table-column>
<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-takeaway-box"
@click="toEngineVersion(scope.row)"
v-hasPermi="['system:engine:edit']"
>规则维护</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:engine:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:engine: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="80%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="规则名称" prop="name">
<el-input v-model="form.ruleName" placeholder="请输入规则名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规则编码" prop="code">
<el-input v-model="form.ruleCode" placeholder="请输入规则编码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="规则类型" prop="type">
<el-select v-model="form.ruleTypeId" placeholder="请选择规则类型" style="width: 100%">
<el-option value="1" >自定义规则</el-option>
<el-option value="2" >模版规则</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规则级别" prop="level">
<el-select v-model="form.ruleLevelId" placeholder="请选择规则级别" style="width: 100%">
<el-option
v-for="ruleLevel in ruleLevelList"
:key="ruleLevel.id"
:label="ruleLevel.ruleLevel"
:value="ruleLevel.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="规则状态" prop="status">
<el-radio-group v-model="form.ruleStatus">
<el-radio :label="1">正常</el-radio>
<el-radio :label="2">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="规则描述">
<editor v-model="form.ruleDesc" :min-height="192"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</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 {getRuleList, insertRuleEngine} from "@/api/ruleEngine/ruleEngine";
export default {
name: "EngineMaintenance",
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
engineList: [],
//
title: "",
//
open: false,
//
queryParams: {
ruleName: null,
ruleLevelId: null,
ruleStatus: null
},
ruleLevelList: [],
//
form: {},
//
rules: {
ruleName: [
{ required: true, message: "规则名称不能为空", trigger: "blur" }
],
ruleTypeId: [
{ required: true, message: "规则类型不能为空", trigger: "change" }
],
ruleCode: [
{ required: true, message: "规则编码不能为空", trigger: "blur" }
],
ruleLevelId: [
{ required: true, message: "规则级别不能为空", trigger: "change" }
],
ruleStatus: [
{ required: true, message: "规则状态不能为空", trigger: "change" }
],
}
};
},
created() {
this.getList();
},
methods: {
toEngineVersion(row){
this.$message.success(row)
console.log("行对象",row)
let number = Number.parseInt(row.id);
this.$router.push({ path: `/rule-engine/rule-engine/engine-version/${number}`});
},
/** 查询规则引擎列表 */
getList() {
getRuleList(this.queryParams).then(
response => {
this.loading = true;
this.engineList = response.data.ruleEngineList;
this.ruleLevelList = response.data.ruleLevelList
this.loading = false
}
)
;
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
type: null,
isActivate: "no-activate",
status: "0",
description: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
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();
this.form = row;
this.open = true;
this.title = "修改规则引擎";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
console.log(JSON.stringify(this.form))
if (valid) {
insertRuleEngine(this.form).then(
res => {
if (this.form==null){
this.$message.success("添加成功")
}else {
this.$message.success("修改成功")
}
this.open = false
this.getList()
}
)
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除规则引擎编号为"' + ids + '"的数据项?').then(() => {
this.$modal.msgSuccess("删除成功");
});
},
/** 导出按钮操作 */
handleExport() {
this.$modal.msgSuccess("导出成功");
}
}
};
</script>

View File

@ -0,0 +1,24 @@
<template>
<div>
{{ruleEngineId}}
呼呼哈嘿
</div>
</template>
<script>
export default {
name: "EngineVersion",
data() {
return {
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
}
},
created() {
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://127.0.0.1:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''