修改配置
parent
c9475e35ec
commit
c3563651ff
|
@ -50,10 +50,18 @@ export function updateMaintenance(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
export function updIsActivate(isActivate) {
|
||||
//修改规则引擎激活状态
|
||||
export function updIsActivate(id,isActivate) {
|
||||
return request({
|
||||
url: '/engine/updIsActivate?isActivate='+isActivate,
|
||||
method: 'put'
|
||||
url: '/engine/maintenance/updIsActivate?id='+id +'&isActivate='+isActivate,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
//修改状态
|
||||
export function updStatus(id,status) {
|
||||
return request({
|
||||
url: '/engine/maintenance/updStatus?id='+id +'&status='+status,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 删除【请填写功能名称】
|
||||
|
|
|
@ -42,10 +42,3 @@ export function delData(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function delById(id) {
|
||||
return request({
|
||||
url: '/etl/data/delById?id=' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询数据源列表
|
||||
export function listDatasource(query) {
|
||||
return request({
|
||||
url: '/etl/source/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数据源详细
|
||||
export function getDatasource(id) {
|
||||
return request({
|
||||
url: '/etl/source/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 新增数据源
|
||||
export function addDatasource(data) {
|
||||
return request({
|
||||
url: '/etl/source',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数据源
|
||||
export function updateDatasource(data) {
|
||||
return request({
|
||||
url: '/etl/source',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数据源
|
||||
export function delDatasource(id) {
|
||||
return request({
|
||||
url: '/etl/source/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function test(data) {
|
||||
return request({
|
||||
url: '/etl/source/test',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function assetsList(data) {
|
||||
return request({
|
||||
url: '/etl/source/assetsList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function structureList(data) {
|
||||
return request({
|
||||
url: '/etl/source/structureList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function selectDept() {
|
||||
return request({
|
||||
url: '/etl/source/selectDept',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function synchronization(data) {
|
||||
return request({
|
||||
url: '/etl/source/synchronization',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function dataAssetList(data) {
|
||||
return request({
|
||||
url: '/etl/source/dataAssetList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function assetModelList(data) {
|
||||
return request({
|
||||
url: '/etl/source/assetModelList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function assetList(data) {
|
||||
return request({
|
||||
url: '/etl/model/list',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function statisticsInfo(data) {
|
||||
return request({
|
||||
url: '/etl/source/statisticsInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function UpdateAssetModel(data) {
|
||||
return request({
|
||||
url: '/etl/model/UpdateAssetModel',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ export function deleteDictionary(id) {
|
|||
// 新增【请填写功能名称】
|
||||
export function addDictionary(data) {
|
||||
return request({
|
||||
url: '/etl/dictionary/dictionary',
|
||||
url: '/etl/dictionary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -57,10 +57,3 @@ export function getDictionaryList(id) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delDict(id) {
|
||||
return request({
|
||||
url: '/etl/dictionary/delDict?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listSource(query) {
|
||||
export function listSource(data) {
|
||||
return request({
|
||||
url: '/etl/source/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function statisticsInfo(){
|
||||
return request({
|
||||
url: '/etl/source/Statistics',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -84,6 +91,15 @@ export function updateSource(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改字段数据
|
||||
export function updateAssetModel(data) {
|
||||
return request({
|
||||
url: '/etl/model/UpdateAssetModel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delSource(id) {
|
||||
return request({
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listMaintenance(query) {
|
||||
export function listMaintenance(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
url: '/engine/maintenance/list',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getMaintenance(id) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance/' + id,
|
||||
url: '/engine/maintenance/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export function getMaintenance(id) {
|
|||
// 新增【请填写功能名称】
|
||||
export function addMaintenance(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance',
|
||||
url: '/engine/maintenance',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -29,7 +29,7 @@ export function addMaintenance(data) {
|
|||
// 初始化
|
||||
export function initializeRuleEngine(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance/InitializeRuleEngine',
|
||||
url: '/engine/maintenance/InitializeRuleEngine',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -37,7 +37,7 @@ export function initializeRuleEngine(data) {
|
|||
//测试方法
|
||||
export function testMethod(code) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance/TestMethod?code='+code,
|
||||
url: '/engine/maintenance/TestMethod?code='+code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export function testMethod(code) {
|
|||
// 修改【请填写功能名称】
|
||||
export function updateMaintenance(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance',
|
||||
url: '/engine/maintenance',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
@ -54,7 +54,7 @@ export function updateMaintenance(data) {
|
|||
// 删除【请填写功能名称】
|
||||
export function delMaintenance(id) {
|
||||
return request({
|
||||
url: '/ruleEngine/maintenance/' + id,
|
||||
url: '/engine/maintenance/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listVersion(query) {
|
||||
return request({
|
||||
url: '/ruleEngine/version/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getVersion(id) {
|
||||
return request({
|
||||
url: '/ruleEngine/version/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增【请填写功能名称】
|
||||
export function addVersion(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/version',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改【请填写功能名称】
|
||||
export function updateVersion(data) {
|
||||
return request({
|
||||
url: '/ruleEngine/version',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delVersion(id) {
|
||||
return request({
|
||||
url: '/ruleEngine/version/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -2,808 +2,22 @@ import Vue from 'vue'
|
|||
import store from '@/store'
|
||||
import DataDict from '@/utils/dict'
|
||||
import {getDicts as getDicts} from '@/api/system/dict/data'
|
||||
let dictDataMap =
|
||||
{
|
||||
// 系统开关
|
||||
"sys_normal_disable": [
|
||||
{
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-04-23 16:13:26",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"remark": "正常状态",
|
||||
"dictCode": 6,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "正常",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_normal_disable",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-04-23 16:13:26",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"remark": "停用状态",
|
||||
"dictCode": 7,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "停用",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_normal_disable",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"default": false
|
||||
}
|
||||
],
|
||||
// 用户性别
|
||||
"sys_user_sex": [
|
||||
{
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-04-23 16:13:24",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"remark": "性别男",
|
||||
"dictCode": 1,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "男",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_user_sex",
|
||||
"cssClass": "",
|
||||
"listClass": "",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-04-23 16:13:24",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"remark": "性别女",
|
||||
"dictCode": 2,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "女",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_user_sex",
|
||||
"cssClass": "",
|
||||
"listClass": "",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"createBy": "admin",
|
||||
"createTime": "2023-04-23 16:13:25",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"remark": "性别未知",
|
||||
"dictCode": 3,
|
||||
"dictSort": 3,
|
||||
"dictLabel": "未知",
|
||||
"dictValue": "2",
|
||||
"dictType": "sys_user_sex",
|
||||
"cssClass": "",
|
||||
"listClass": "",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"default": false
|
||||
}
|
||||
],
|
||||
// 是否展示
|
||||
"sys_show_hide": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 4,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "显示",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_show_hide",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "显示菜单"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 5,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "隐藏",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_show_hide",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "隐藏菜单"
|
||||
}
|
||||
],
|
||||
// 系统是否
|
||||
"sys_yes_no": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 12,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "是",
|
||||
"dictValue": "Y",
|
||||
"dictType": "sys_yes_no",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "系统默认是"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 13,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "否",
|
||||
"dictValue": "N",
|
||||
"dictType": "sys_yes_no",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "系统默认否"
|
||||
}
|
||||
],
|
||||
// 公告类型
|
||||
"sys_notice_type": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 14,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "通知",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_notice_type",
|
||||
"cssClass": "",
|
||||
"listClass": "warning",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "通知"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 15,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "公告",
|
||||
"dictValue": "2",
|
||||
"dictType": "sys_notice_type",
|
||||
"cssClass": "",
|
||||
"listClass": "success",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "公告"
|
||||
}
|
||||
],
|
||||
// 通知状态
|
||||
"sys_notice_status": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 16,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "正常",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_notice_status",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "正常状态"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 17,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "关闭",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_notice_status",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "关闭状态"
|
||||
}
|
||||
],
|
||||
// 系统状态
|
||||
"sys_common_status": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 28,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "成功",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_common_status",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "正常状态"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 29,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "失败",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_common_status",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "停用状态"
|
||||
}
|
||||
],
|
||||
// 定时任务组
|
||||
"sys_job_group": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 10,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "默认",
|
||||
"dictValue": "DEFAULT",
|
||||
"dictType": "sys_job_group",
|
||||
"cssClass": "",
|
||||
"listClass": "",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "默认分组"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 11,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "系统",
|
||||
"dictValue": "SYSTEM",
|
||||
"dictType": "sys_job_group",
|
||||
"cssClass": "",
|
||||
"listClass": "",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "系统分组"
|
||||
}
|
||||
],
|
||||
// 定时任务状态
|
||||
"sys_job_status": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 8,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "正常",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_job_status",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "Y",
|
||||
"status": "0",
|
||||
"remark": "正常状态"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 9,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "暂停",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_job_status",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "停用状态"
|
||||
}
|
||||
],
|
||||
// 操作类型
|
||||
"sys_oper_type": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 19,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "新增",
|
||||
"dictValue": "1",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "info",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "新增操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 20,
|
||||
"dictSort": 2,
|
||||
"dictLabel": "修改",
|
||||
"dictValue": "2",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "info",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "修改操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 21,
|
||||
"dictSort": 3,
|
||||
"dictLabel": "删除",
|
||||
"dictValue": "3",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "删除操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 22,
|
||||
"dictSort": 4,
|
||||
"dictLabel": "授权",
|
||||
"dictValue": "4",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "授权操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 23,
|
||||
"dictSort": 5,
|
||||
"dictLabel": "导出",
|
||||
"dictValue": "5",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "warning",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "导出操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 24,
|
||||
"dictSort": 6,
|
||||
"dictLabel": "导入",
|
||||
"dictValue": "6",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "warning",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "导入操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 25,
|
||||
"dictSort": 7,
|
||||
"dictLabel": "强退",
|
||||
"dictValue": "7",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "强退操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 26,
|
||||
"dictSort": 8,
|
||||
"dictLabel": "生成代码",
|
||||
"dictValue": "8",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "warning",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "生成操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 27,
|
||||
"dictSort": 9,
|
||||
"dictLabel": "清空数据",
|
||||
"dictValue": "9",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "清空操作"
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2023-09-29 11:47:28",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"params": {
|
||||
"@type": "java.util.HashMap"
|
||||
},
|
||||
"dictCode": 18,
|
||||
"dictSort": 99,
|
||||
"dictLabel": "其他",
|
||||
"dictValue": "0",
|
||||
"dictType": "sys_oper_type",
|
||||
"cssClass": "",
|
||||
"listClass": "info",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": "其他操作"
|
||||
}
|
||||
],
|
||||
// 规则类型
|
||||
"rule_engine_type": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:40:51",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 30,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "规则模板",
|
||||
"dictValue": "rule-template",
|
||||
"dictType": "rule_engine_type",
|
||||
"cssClass": null,
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:41:25",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 31,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "自定义规则",
|
||||
"dictValue": "rule-custom",
|
||||
"dictType": "rule_engine_type",
|
||||
"cssClass": null,
|
||||
"listClass": "success",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
}
|
||||
],
|
||||
// 规则作用域
|
||||
"rule_engine_level": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:40:51",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 30,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "数据集",
|
||||
"dictValue": "data-set",
|
||||
"dictType": "rule_engine_level",
|
||||
"cssClass": null,
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:41:25",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 31,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "记录",
|
||||
"dictValue": "data-record",
|
||||
"dictType": "rule_engine_level",
|
||||
"cssClass": null,
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:41:25",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 31,
|
||||
"dictSort": 1,
|
||||
"dictLabel": "数据字段",
|
||||
"dictValue": "data-field",
|
||||
"dictType": "rule_engine_level",
|
||||
"cssClass": null,
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
}
|
||||
],
|
||||
// 规则引擎激活状态
|
||||
"rule_engine_activate_status": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:07",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 32,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "未激活",
|
||||
"dictValue": "no-activate",
|
||||
"dictType": "rule_engine_activate_status",
|
||||
"cssClass": null,
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:32",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 33,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "已激活",
|
||||
"dictValue": "activated",
|
||||
"dictType": "rule_engine_activate_status",
|
||||
"cssClass": null,
|
||||
"listClass": "success",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
}
|
||||
],
|
||||
// 规则引擎版本状态
|
||||
"rule_engine_version_status": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:07",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 32,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "初始化",
|
||||
"dictValue": "0",
|
||||
"dictType": "rule_engine_version_status",
|
||||
"cssClass": null,
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:32",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 33,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "待发布",
|
||||
"dictValue": "1",
|
||||
"dictType": "rule_engine_version_status",
|
||||
"cssClass": null,
|
||||
"listClass": "primary",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:32",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 33,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "已发布",
|
||||
"dictValue": "2",
|
||||
"dictType": "rule_engine_version_status",
|
||||
"cssClass": null,
|
||||
"listClass": "success",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
}
|
||||
],
|
||||
|
||||
// 规则引擎激活状态
|
||||
"rule_engine_activate_is_test": [
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:07",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 32,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "未测试",
|
||||
"dictValue": "0",
|
||||
"dictType": "rule_engine_activate_is_test",
|
||||
"cssClass": null,
|
||||
"listClass": "warning",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:32",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 33,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "测试通过",
|
||||
"dictValue": "1",
|
||||
"dictType": "rule_engine_activate_is_test",
|
||||
"cssClass": null,
|
||||
"listClass": "success",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
},
|
||||
{
|
||||
"createBy": 1,
|
||||
"createTime": "2024-04-23 09:45:32",
|
||||
"updateBy": null,
|
||||
"updateTime": null,
|
||||
"dictCode": 33,
|
||||
"dictSort": 0,
|
||||
"dictLabel": "测试未通过",
|
||||
"dictValue": "2",
|
||||
"dictType": "rule_engine_activate_is_test",
|
||||
"cssClass": null,
|
||||
"listClass": "danger",
|
||||
"isDefault": "N",
|
||||
"status": "0",
|
||||
"remark": null
|
||||
}
|
||||
],
|
||||
function searchDictByKey(dict, key) {
|
||||
if (key == null && key == "") {
|
||||
return null
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
try {
|
||||
for (let i = 0; i < dict.length; i++) {
|
||||
if (dict[i].key == key) {
|
||||
return dict[i].value
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
function install() {
|
||||
Vue.use(DataDict, {
|
||||
metas: {
|
||||
|
@ -811,10 +25,10 @@ function install() {
|
|||
labelField: 'dictLabel',
|
||||
valueField: 'dictValue',
|
||||
request(dictMeta) {
|
||||
let dictData = dictDataMap[dictMeta.type];
|
||||
if (dictData) {
|
||||
const storeDict = searchDictByKey(store.getters.dict, dictMeta.type)
|
||||
if (storeDict) {
|
||||
return new Promise(resolve => {
|
||||
resolve(dictData)
|
||||
resolve(storeDict)
|
||||
})
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<codemirror ref="codeMirror" :value="code" :options="cmOptions"/>
|
||||
<div style="height: 800px">
|
||||
<codemirror ref="codeMirror" v-model="code" :value="code" :options="cmOptions" style="height: 800px"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -26,10 +26,23 @@ 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 {updateMaintenance} from "@/api/ruleEngine/maintenance";
|
||||
export default {
|
||||
components: {
|
||||
codemirror,
|
||||
},
|
||||
watch:{
|
||||
'value':{
|
||||
handler(val) {
|
||||
this.code = val;
|
||||
},
|
||||
},
|
||||
'code':{
|
||||
handler(val) {
|
||||
this.$emit('input', val);
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
default: "",
|
||||
|
@ -75,7 +88,7 @@ export default {
|
|||
|
||||
.CodeMirror {
|
||||
font-family: 'JetBrainsMono-Medium', monospace;
|
||||
height: 600px;
|
||||
height: 800px;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
|
|
|
@ -85,44 +85,44 @@
|
|||
<script>
|
||||
|
||||
import { parseTime } from '@/utils/muyu'
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {
|
||||
addAccredit,
|
||||
addSourceAccredit,
|
||||
deleteSourceAccreditBySourceIds,
|
||||
getSourceAccreditByDataSourceId
|
||||
} from "@/api/etl/sourceAccredit";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {listDept} from "@/api/system/dept";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'title':{
|
||||
handler(val){
|
||||
console.log(val)
|
||||
handler(val) {
|
||||
this.getSourceAccreditByDataSourceId()
|
||||
},
|
||||
immediate:true
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
props:{
|
||||
title:{}
|
||||
},
|
||||
name: "AuthDataSource",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
activeName: "dept",
|
||||
userQueryParams:{
|
||||
pageNum : 1,
|
||||
pageSize:10,
|
||||
total:0
|
||||
// 用户查询参数
|
||||
userQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
},
|
||||
sourceAccreditReq:{
|
||||
deptIds: null,
|
||||
userId: null,
|
||||
dataSourceId: null
|
||||
},
|
||||
// 分页信息
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
// 基本信息
|
||||
baseInfo: {
|
||||
},
|
||||
|
@ -130,16 +130,13 @@ export default {
|
|||
deptList: [],
|
||||
// 用户列表
|
||||
userList: [],
|
||||
userAccreditIds:[],
|
||||
deptAccreditIds:[]
|
||||
userAccreditIds: [],
|
||||
deptAccreditIds: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loading = true;
|
||||
setTimeout(() => this.loading = false, 200)
|
||||
},
|
||||
props:{
|
||||
title:{}
|
||||
// this.loading = true;
|
||||
// setTimeout(() => this.loading = false, 200)
|
||||
},
|
||||
methods: {
|
||||
recursion(deptInfo){
|
||||
|
@ -156,6 +153,7 @@ export default {
|
|||
return ids
|
||||
},
|
||||
authChange(row) {
|
||||
this.loading = true
|
||||
this.sourceAccreditReq={
|
||||
deptIds:null,
|
||||
userId: null,
|
||||
|
@ -179,17 +177,16 @@ export default {
|
|||
this.getSourceAccreditByDataSourceId()
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
parseTime,
|
||||
getSourceAccreditByDataSourceId(){
|
||||
if (this.title.id != undefined){
|
||||
getSourceAccreditByDataSourceId(this.title.id).then(response => {
|
||||
console.log(response,"少时诵诗书")
|
||||
this.deptAccreditIds = response.data.deptAccreditModelIds
|
||||
this.userAccreditIds = response.data.userAccreditModelIds
|
||||
setTimeout(() => this.getList(), 50)
|
||||
setTimeout(() => this.getUserList(), 50)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -210,10 +207,9 @@ export default {
|
|||
listDept(this.queryParams).then(response => {
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
this.deptList.forEach(dept => {
|
||||
// dept.isAuth = this.deptAccreditIds.indexOf(dept.deptId) > -1
|
||||
this.recursionAuth(dept)
|
||||
})
|
||||
console.log(this.deptList)
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
|
@ -227,8 +223,6 @@ export default {
|
|||
}
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
{{deptAccreditIds}}
|
||||
<h4 class="form-header h4">基本信息</h4>
|
||||
<el-form ref="form" :model="title" label-width="120px">
|
||||
<el-row>
|
||||
|
@ -40,7 +39,6 @@
|
|||
<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"
|
||||
|
@ -48,14 +46,15 @@
|
|||
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="orderNum" ></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" >
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
style="display: block"
|
||||
|
@ -100,21 +99,24 @@
|
|||
|
||||
<script>
|
||||
|
||||
import { parseTime } from '@/utils/muyu';
|
||||
import { parseTime } from '@/utils/muyu'
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {addAccredit, deleteSourceAccreditBySourceIds, getSourceAccreditByDataSourceId} from "@/api/etl/sourceAccredit";
|
||||
import {addAssetAccredit, deleteAssetAccreditByAssetIds, getAssetAccreditByDataAssetId} from "@/api/etl/assetAccredit";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'title':{
|
||||
handler(val){
|
||||
console.log("啦啦啦",val)
|
||||
handler(val) {
|
||||
this.getAssetAccreditByDataAssetId()
|
||||
},
|
||||
immediate:true
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
props:{
|
||||
title:{}
|
||||
},
|
||||
name: "AuthTable",
|
||||
data() {
|
||||
return {
|
||||
|
@ -142,15 +144,24 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
props:{
|
||||
title:{}
|
||||
},
|
||||
created() {
|
||||
this.loading = true;
|
||||
setTimeout(() => this.loading = false, 200)
|
||||
},
|
||||
methods: {
|
||||
authChange(row){
|
||||
recursion(deptInfo){
|
||||
let ids =[]
|
||||
ids.push(deptInfo.deptId)
|
||||
if (deptInfo.children){
|
||||
deptInfo.children.forEach(item => {
|
||||
ids.push(item.deptId)
|
||||
if (item.children){
|
||||
ids.push(...this.recursion(item))
|
||||
}
|
||||
})
|
||||
}
|
||||
return ids
|
||||
},
|
||||
authChange(row) {
|
||||
this.loading = true
|
||||
this.AssetAccreditReq={
|
||||
deptIds:null,
|
||||
userId: null,
|
||||
|
@ -174,35 +185,12 @@ export default {
|
|||
this.getAssetAccreditByDataAssetId()
|
||||
})
|
||||
}
|
||||
},
|
||||
getAssetAccreditByDataAssetId(){
|
||||
getAssetAccreditByDataAssetId(this.title.id).then(res =>{
|
||||
console.log(res)
|
||||
this.deptAccreditIds=res.data.daptAccreditModelIds
|
||||
this.userAccreditIds=res.data.userAccreditModelIds
|
||||
setTimeout(() => this.getDeptList(),50)
|
||||
setTimeout(() => this.getUserList,50)
|
||||
})
|
||||
},
|
||||
|
||||
recursion(deptInfo){
|
||||
let ids = []
|
||||
ids.push(deptInfo.deptId)
|
||||
if (deptInfo.children){
|
||||
deptInfo.children.forEach(item=>{
|
||||
ids.push(item.deptId)
|
||||
if (item.children){
|
||||
ids.push(...this.recursion(item))
|
||||
}
|
||||
})
|
||||
}
|
||||
return ids
|
||||
},
|
||||
recursionAuth(deptInfo){
|
||||
console.log("列表出不来啊:",deptInfo)
|
||||
deptInfo.isAuth = this.deptAccreditIds.indexOf(deptInfo.deptId) > -1
|
||||
if (deptInfo.children){
|
||||
deptInfo.children.forEach(item =>{
|
||||
deptInfo.children.forEach(item => {
|
||||
item.isAuth = this.deptAccreditIds.indexOf(item.deptId) > -1
|
||||
if (item.children){
|
||||
this.recursionAuth(item)
|
||||
|
@ -210,22 +198,29 @@ export default {
|
|||
})
|
||||
}
|
||||
},
|
||||
getAssetAccreditByDataAssetId() {
|
||||
if (this.title.id != undefined) {
|
||||
getAssetAccreditByDataAssetId(this.title.id).then(response => {
|
||||
this.deptAccreditIds = response.data.deptAccreditModelIds
|
||||
this.userAccreditIds = response.data.userAccreditModelIds
|
||||
setTimeout(() => this.getList(), 50)
|
||||
setTimeout(() => this.getUserList(), 50)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询部门列表 */
|
||||
getDeptList() {
|
||||
this.loading = true;
|
||||
getList() {
|
||||
listDept(this.queryParams).then(response => {
|
||||
console.log("部门",response)
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
this.deptList.forEach(dept => {
|
||||
this.recursionAuth(dept)
|
||||
})
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getUserList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||
this.userList = response.data.rows;
|
||||
this.userList.forEach(user => {
|
||||
user.isAuth = this.userAccreditIds.indexOf(user.userId) > -1
|
||||
|
@ -234,8 +229,8 @@ export default {
|
|||
}
|
||||
);
|
||||
},
|
||||
|
||||
parseTime,
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<template>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside>
|
||||
<el-menu :default-openeds="['1','3']">
|
||||
<el-tree :data="sourceList"
|
||||
@node-click="handleNodeClick"
|
||||
:props="defaultProps">
|
||||
</el-tree>
|
||||
<el-menu :default-openeds="['1', '3']">
|
||||
<el-tree :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
|
@ -20,52 +17,27 @@
|
|||
|
||||
import AuthDataSource from './auth/AuthDataSource.vue'
|
||||
import AuthTable from './auth/AuthTable.vue'
|
||||
import {dataAssetList, listDatasource} from "@/api/etl/datasource";
|
||||
import {dataAssetList, listSource} from "@/api/etl/source";
|
||||
|
||||
export default {
|
||||
name: 'assetStructure',
|
||||
components: { AuthTable, AuthDataSource },
|
||||
data() {
|
||||
return {
|
||||
title:{},
|
||||
title: {},
|
||||
sourceList: [],
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'tableList',
|
||||
label: 'label'
|
||||
},
|
||||
showAuth: null,
|
||||
sourceList: []
|
||||
|
||||
showAuth: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
this.assetsCompute ={
|
||||
assetsModuleSum: 0,
|
||||
dataModuleSum: 0,
|
||||
dataSourceSum: 0
|
||||
}
|
||||
listDatasource(this.queryParams).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.sourceList.forEach(source => {
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
|
||||
source.dataType = 'dataSource'
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table => {
|
||||
table.label = table.tableName +'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||
table.dataType = 'dataTable'
|
||||
})
|
||||
}
|
||||
})
|
||||
this.total = response.data.total;
|
||||
})
|
||||
},
|
||||
handleNodeClick(data){
|
||||
handleNodeClick(data) {
|
||||
if (data.dataType === 'dataSource'){
|
||||
dataAssetList(data).then(res=>{
|
||||
dataAssetList(data).then(res => {
|
||||
res.data.forEach(table => {
|
||||
table.dataType = "dataTable"
|
||||
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||
|
@ -74,11 +46,12 @@ export default {
|
|||
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||
this.title = data
|
||||
})
|
||||
|
||||
}else{
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.tableList !=null){
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table => {
|
||||
if (table.tableName === data.dataSourceName){
|
||||
if (table.tableName === data.tableName){
|
||||
data.dataSourceName = source.dataSourceName
|
||||
data.systemName = source.systemName
|
||||
data.databaseName = source.databaseName
|
||||
|
@ -86,7 +59,7 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
this.title = data
|
||||
this.title= data
|
||||
}
|
||||
this.showAuth = data.dataType
|
||||
},
|
||||
|
@ -100,7 +73,31 @@ export default {
|
|||
resolve(this.childrenList)
|
||||
}, 500);
|
||||
},
|
||||
}
|
||||
getList() {
|
||||
this.assetsCompute={
|
||||
assetsModuleSum: 0,
|
||||
dataModuleSum: 0,
|
||||
dataSourceSum: 0
|
||||
}
|
||||
listSource(this.queryParams).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.sourceList.forEach(source => {
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||
source.dataType = 'dataSource'
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table => {
|
||||
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||
table.dataType = 'dataTable'
|
||||
})
|
||||
}
|
||||
})
|
||||
this.total = response.data.total;
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside>
|
||||
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
<el-main>
|
||||
<data-source-show v-if="showAssets === 'dataSource'" :source="source"></data-source-show>
|
||||
<data-asset-show v-if="showAssets === 'dataTable'" :asset="asset" :source="source"></data-asset-show>
|
||||
<!-- <el-card>-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>资产模型基本信息</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-descriptions border :column="2">-->
|
||||
<!-- <el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="数据量">{{asset.tableCount}}</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 v-if="kvtList.length > 0" :gutter="20">-->
|
||||
<!-- <el-col :span="6" v-for="(kvt,index) in kvtList[0]" style="margin-top: 20px">-->
|
||||
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||
<!-- <el-descriptions-item label="Type">-->
|
||||
<!-- <el-tag size="small">{{kvt.type}}</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="Value">{{kvt.value=='' ? 'null':kvt.value}}</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- <el-row v-if="kvtList.length == 0" :gutter="20">-->
|
||||
<!-- <el-col :span="6" v-for="(value,index) in structure" style="margin-top: 20px">-->
|
||||
<!-- <el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">-->
|
||||
<!-- <el-descriptions-item label="Type">-->
|
||||
<!-- <el-tag size="small">{{value}}</el-tag>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="Value">null</el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<!-- </el-card>-->
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {dataAssetList, listSource, structureList} from "@/api/etl/source";
|
||||
import DataSourceShow from "@/views/etl/assetShow/modules/dataSourceShow.vue";
|
||||
import DataAssetShow from "@/views/etl/assetShow/modules/dataAssetShow.vue";
|
||||
|
||||
export default {
|
||||
name: "AssetShow",
|
||||
components: {DataAssetShow, DataSourceShow},
|
||||
data() {
|
||||
return {
|
||||
showAssets: '',
|
||||
source: {},
|
||||
asset: {},
|
||||
sourceList: [],
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'tableList',
|
||||
label: 'label'
|
||||
},
|
||||
showAuth: null,
|
||||
assetShowList: [
|
||||
{key: "测试.sys_user.id", type: "String", value: 1},
|
||||
{key: "测试.sys_user.name", type: "String", value: "张三"},
|
||||
{key: "测试.sys_user.age", type: "Integer", value: 18},
|
||||
{key: "测试.sys_user.email", type: "String", value: "123@136.com"},
|
||||
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
||||
],
|
||||
kvtList: [],
|
||||
structure: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
listSource({}).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.type=='PostGreSql'){
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
|
||||
}else{
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||
}
|
||||
|
||||
source.dataType = 'dataSource'
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table => {
|
||||
table.label = table.tableName+'-'+table.tableComment+'('+table.tableCount+'条)'
|
||||
table.dataType = 'dataTable'
|
||||
})
|
||||
}
|
||||
})
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// structureList(){
|
||||
// structureList(this.source).then(res => {
|
||||
// console.log(res)
|
||||
// this.kvtList = res.data.kvtList
|
||||
// this.structure = res.data.structure
|
||||
// })
|
||||
// },
|
||||
handleNodeClick(data) {
|
||||
if (data.dataType === 'dataSource'){
|
||||
this.source = data
|
||||
dataAssetList(data).then(res => {
|
||||
res.data.forEach(table => {
|
||||
table.dataType = "dataTable"
|
||||
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||
})
|
||||
data.tableList = res.data
|
||||
this.sourceList[this.sourceList.indexOf(data)].tableList = res.data
|
||||
this.title = data
|
||||
})
|
||||
|
||||
}else{
|
||||
this.asset= data
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.tableList!=null){
|
||||
source.tableList.forEach(table => {
|
||||
if (table.tableName === data.tableName){
|
||||
this.source = source
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// console.log(this.source)
|
||||
// this.source.sql = 'select * from '+(data.modeName == null ? '' : data.modeName+'.')+data.tableName +' limit 1'
|
||||
// setTimeout(() => {
|
||||
// this.structureList()
|
||||
// }, 50);
|
||||
|
||||
}
|
||||
this.showAssets = data.dataType
|
||||
},
|
||||
expandTable( node, resolve){
|
||||
if (node.level === 0) return resolve(this.assetStructureList);
|
||||
const {data} = node;
|
||||
if (data.type === 'dataTable') {
|
||||
return resolve([])
|
||||
}
|
||||
setTimeout(() => {
|
||||
resolve(this.childrenList)
|
||||
}, 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>
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>资产模型基本信息</span>
|
||||
</div>
|
||||
<el-descriptions border :column="2">
|
||||
<el-descriptions-item label="表名称">{{asset.tableName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="表备注">{{asset.tableComment}}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据量">{{asset.tableCount}}</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 v-if="kvtList.length > 0" :gutter="20">
|
||||
<el-col :span="6" v-for="(kvt,index) in kvtList[0]" style="margin-top: 20px">
|
||||
<el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">
|
||||
<el-descriptions-item label="Type">
|
||||
<el-tag size="small">{{kvt.type}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="Value">{{kvt.value=='' ? 'null':kvt.value}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="kvtList.length == 0" :gutter="20">
|
||||
<el-col :span="6" v-for="(value,index) in structure" style="margin-top: 20px">
|
||||
<el-descriptions :title="source.dataSourceName+'.'+asset.tableName+'.'+index" direction="vertical" border :column="1">
|
||||
<el-descriptions-item label="Type">
|
||||
<el-tag size="small">{{value}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="Value">null</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {dataAssetList, listSource, structureList} from "@/api/etl/source";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'asset':{
|
||||
handler(val){
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
'source':{
|
||||
handler(val){
|
||||
this.structureList()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
props:{
|
||||
asset:{},
|
||||
source: {}
|
||||
},
|
||||
name: "dataAssetShow",
|
||||
data() {
|
||||
return {
|
||||
sourceList: [],
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'tableList',
|
||||
label: 'label'
|
||||
},
|
||||
showAuth: null,
|
||||
assetShowList: [
|
||||
{key: "测试.sys_user.id", type: "String", value: 1},
|
||||
{key: "测试.sys_user.name", type: "String", value: "张三"},
|
||||
{key: "测试.sys_user.age", type: "Integer", value: 18},
|
||||
{key: "测试.sys_user.email", type: "String", value: "123@136.com"},
|
||||
{key: "测试.sys_user.sex", type: "String", value: "Y"},
|
||||
],
|
||||
kvtList: [],
|
||||
structure: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
structureList(){
|
||||
this.source.sql = 'select * from '+(this.source.modeName == null ? '' : this.source.modeName+'.')+this.asset.tableName +' limit 1'
|
||||
structureList(this.source).then(res => {
|
||||
console.log(res)
|
||||
this.kvtList = res.data.kvtList
|
||||
this.structure = res.data.structure
|
||||
})
|
||||
},
|
||||
expandTable( node, resolve){
|
||||
if (node.level === 0) return resolve(this.assetStructureList);
|
||||
const {data} = node;
|
||||
if (data.type === 'dataTable') {
|
||||
return resolve([])
|
||||
}
|
||||
setTimeout(() => {
|
||||
resolve(this.childrenList)
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-row :gutter="40" class="panel-group">
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane v-for="tableAsset in source.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||
<data-asset-show v-if="activeName == tableAsset.tableName" :asset="tableAsset" :source="source"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataAssetShow from "./dataAssetShow.vue";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'source':{
|
||||
handler(val){
|
||||
setTimeout(() => this.inio(), 200)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
props:{
|
||||
source:{}
|
||||
},
|
||||
name: "dataSourceShow",
|
||||
components: {DataAssetShow},
|
||||
data() {
|
||||
return {
|
||||
activeName: ''
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
inio(){
|
||||
this.activeName = this.source.tableList[0].tableName
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
|
@ -1,110 +0,0 @@
|
|||
<template>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside>
|
||||
<el-tree :data="assetStructureList" :load="expandTable" lazy :props="defaultProps">
|
||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<div v-if="data.type === 'dataSource'">{{ data.name }}</div>
|
||||
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+'条)' }}</div>
|
||||
</div>
|
||||
</el-tree>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
<el-main>
|
||||
<OverallAssets v-if="showAssets == null"/>
|
||||
<overall-specific-assets v-if="showAssets === 'dataSource'" :title="title"/>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import OverallAssets from '../assets/dashboard/OverallAssets.vue'
|
||||
import OverallSpecificAssets from '../assets/dashboard/OverallSpecificAssets.vue'
|
||||
import {assetsList, structureList} from "@/api/etl/datasource";
|
||||
|
||||
export default {
|
||||
name: 'assetStructure',
|
||||
components: { OverallSpecificAssets, OverallAssets },
|
||||
data() {
|
||||
return {
|
||||
mainHeight: window.innerHeight - 85,
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
label: 'name'
|
||||
},
|
||||
sourceList:[],
|
||||
assetsList:[],
|
||||
structureList:[],
|
||||
dataSource:{
|
||||
sql:""
|
||||
},
|
||||
assetStructureList: [
|
||||
{
|
||||
name: "本地",
|
||||
systemName: "云计算系统",
|
||||
databaseName: "yunjisuan",
|
||||
type: "dataSource"
|
||||
},
|
||||
|
||||
],
|
||||
childrenList: [
|
||||
{
|
||||
name: "sys_user",
|
||||
as: "用户表",
|
||||
dataTotal: 635847,
|
||||
type: "dataTable",
|
||||
childrenList: []
|
||||
},
|
||||
{
|
||||
name: "sys_dept",
|
||||
as: "部门表",
|
||||
dataTotal: 362548,
|
||||
type: "dataTable",
|
||||
childrenList: []
|
||||
},
|
||||
{
|
||||
name: "sys_notice",
|
||||
as: "通知公告",
|
||||
dataTotal: 6347,
|
||||
type: "dataTable",
|
||||
childrenList: []
|
||||
}
|
||||
],
|
||||
showAssets: null,
|
||||
title: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTableList();
|
||||
},
|
||||
methods: {
|
||||
getTableList(){
|
||||
assetsList(this.dataSource).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
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.databaseName + '-' + data.systemName+')'
|
||||
}
|
||||
setTimeout(() => {
|
||||
resolve(this.childrenList)
|
||||
this.showAssets = data.type;
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.el-aside {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 400px;
|
||||
background-color: white;
|
||||
}
|
||||
.el-main {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
|
@ -42,7 +42,6 @@
|
|||
</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.isDict === 'Y'" size="small" type="success">
|
||||
{{scope.row.isDict}}
|
||||
|
@ -56,9 +55,9 @@
|
|||
placement="left"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<el-table :data="dictList">
|
||||
<el-table-column prop="label" label="字典标签"/>
|
||||
<el-table-column prop="val" label="字典值"/>
|
||||
<el-table :data="scope.row.dictionaryDatas">
|
||||
<el-table-column property="label" label="字典标签"/>
|
||||
<el-table-column property="val" label="字典值"/>
|
||||
</el-table>
|
||||
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
||||
</el-popover>
|
||||
|
@ -147,7 +146,7 @@
|
|||
<el-col :span="24">
|
||||
<el-form-item label="字典">
|
||||
<el-select v-model="form.dictKey">
|
||||
<el-option v-for="dict in dictMap" :label="dict.dictionaryName+'('+dict.dictionaryKey+')'" :value="dict.dictionaryKey"></el-option>
|
||||
<el-option v-for="dict in dictMap" :key="dict.id" :label="dict.dictionaryName+'('+dict.dictionaryKey+')'" :value="dict.dictionaryKey"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -169,81 +168,69 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {assetModelList, UpdateAssetModel} from "@/api/etl/datasource";
|
||||
import {getDictionaryList, listDictionary} from "@/api/etl/dictionary";
|
||||
import {listData} from "@/api/etl/data";
|
||||
import {assetModelList, updateAssetModel, updateSource} from "@/api/etl/source";
|
||||
import {getDictionaryList} from "@/api/etl/dictionary";
|
||||
|
||||
export default {
|
||||
name: 'OverallAssetStructure',
|
||||
watch:{
|
||||
'title':{
|
||||
handler(val){
|
||||
'title': {
|
||||
handler(val) {
|
||||
this.getDictionaryList()
|
||||
assetModelList(val).then(res=>{
|
||||
console.log("zuida",res)
|
||||
this.tableData = res.data
|
||||
})
|
||||
this.assetModelList()
|
||||
},
|
||||
immediate:true
|
||||
immediate: true
|
||||
},
|
||||
'form.dictKey':{
|
||||
handler(val){
|
||||
this.dictMap.forEach(dict=>{
|
||||
handler(val) {
|
||||
this.dictMap.forEach(dict => {
|
||||
if (dict.dictionaryKey === val){
|
||||
this.dictionaryDataList = dict.dictionaryDataList
|
||||
this.form.dictionaryId = dict.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
props:{
|
||||
title:{
|
||||
|
||||
props: {
|
||||
title: {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dictList:[{
|
||||
label:null,
|
||||
val:null,
|
||||
dataSourceId:null,
|
||||
}],
|
||||
dictionaryDataList:[],
|
||||
tableData: [],
|
||||
form: {},
|
||||
form:{},
|
||||
formStatus: false,
|
||||
tableData: [],
|
||||
dictMap: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listDictionary()
|
||||
},
|
||||
methods: {
|
||||
listDictionary(){
|
||||
console.log("这是什么",this.title.id)
|
||||
listData(this.title.id).then(res=>{
|
||||
console.log("这是字典",res)
|
||||
this.dictList = res.data.rows
|
||||
})
|
||||
},
|
||||
getDictionaryList(){
|
||||
getDictionaryList(this.title.dataSourceId).then(res=>{
|
||||
this.dictMap = res.data
|
||||
})
|
||||
},
|
||||
assetModelList(){
|
||||
assetModelList(this.title).then(res=>{
|
||||
assetModelList(this.title).then(res => {
|
||||
this.tableData = res.data
|
||||
this.formStatus = false
|
||||
console.log(this.tableData)
|
||||
})
|
||||
},
|
||||
updDict(){
|
||||
UpdateAssetModel(this.form).then(res=>{
|
||||
this.assetModelList();
|
||||
console.log(this.form)
|
||||
updateAssetModel(this.form).then(res => {
|
||||
this.assetModelList()
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getDictionaryList() {
|
||||
getDictionaryList(this.title.dataSourceId).then(res => {
|
||||
this.dictMap = res.data
|
||||
console.log(this.dictMap)
|
||||
})
|
||||
},
|
||||
async update(row) {
|
||||
await this.getDictionaryList()
|
||||
this.getDictionaryList()
|
||||
this.form = row;
|
||||
this.formStatus = true;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<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"/>
|
||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
|
@ -32,7 +32,7 @@
|
|||
<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"/>
|
||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
|
@ -47,34 +47,32 @@
|
|||
|
||||
<script>
|
||||
import CountTo from 'vue-count-to'
|
||||
import {statisticsInfo} from "@/api/etl/datasource";
|
||||
import {statisticsInfo} from "@/api/etl/source";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
statisticsInfo:{}
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
CountTo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statisticsInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
},
|
||||
getStatisticsInfo() {
|
||||
statisticsInfo().then(response => {
|
||||
console.log(response)
|
||||
this.statisticsInfo = response.data
|
||||
statistics(){
|
||||
statisticsInfo().then(res => {
|
||||
this.statisticsInfo = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getStatisticsInfo()
|
||||
this.statistics()
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-row :gutter="40" class="panel-group">
|
||||
<div class="title-header">
|
||||
{{title.dataSourceName + '('+title.databaseName + '-' + title.systemName+')'}} - 资产结构概述
|
||||
{{title.dataSourceName+'('+title.databaseName+'-'+title.systemName+')'}} - 资产结构概述
|
||||
</div>
|
||||
<el-col :sm="12" :xs="12" class="card-panel-col">
|
||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
||||
|
@ -19,7 +19,7 @@
|
|||
<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"/>
|
||||
<svg-icon class-name="card-panel-icon" icon-class="table"/>
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">
|
||||
|
@ -29,250 +29,209 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<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-form :inline="true" :model="dictInfo" class="demo-form-inline">
|
||||
<el-form-item label="字典名称">
|
||||
<el-input v-model="dictInfo.dictionaryName" style="width: 150px "> </el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="值值">
|
||||
<el-input v-model="dictInfo.dictionaryKey" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="addDict">确定</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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="dict in dictMap" :md="8" :sm="24" :xs="12">
|
||||
<el-card class="box-card" style="height: 300px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{dict.dictionaryName+'('+dict.dictionaryKey+')'}}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="delDict(dict.id)">删除</el-button>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="dict.dictionaryDataList.push({ label: null, val: null, isEdit: true})">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="dict.dictionaryDataList" style="width: 100%" height="280px">
|
||||
<el-table-column prop="label" label="标签">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.label}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.label" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="值">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.isEdit">{{scope.row.val}}</span>
|
||||
<el-input v-if="scope.row.isEdit" v-model="scope.row.val" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="!scope.row.isEdit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="upda(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-if="!scope.row.isEdit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete-solid"
|
||||
@click="deleteDictionary(scope.row.id)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isEdit"
|
||||
@click="editConfirm(dict,scope.row)"
|
||||
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 :span="24">
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||
<overall-asset-structure v-if="activeName == tableAsset.tableName" :title="tableAsset"></overall-asset-structure>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<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="200px"
|
||||
trigger="click">
|
||||
|
||||
<el-form :inline="true" :model="dictInfo" class="demo-form-inline">
|
||||
<el-form-item label="字典名称:">
|
||||
<el-input v-model="dictInfo.dictionaryName" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典Key:">
|
||||
<el-input v-model="dictInfo.dictionaryKey" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="addDict">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<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="dict in dictMap" :md="8" :sm="24" :xs="12">
|
||||
<el-card class="box-card" style="height: 300px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{dict.dictionaryName+'('+dict.dictionaryKey+')'}}</span>
|
||||
<el-button style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
@click="deleteDictionary(dict.id)"
|
||||
>删除</el-button>
|
||||
<el-button style="float: right; padding: 3px 0;margin-right: 8px"
|
||||
type="text"
|
||||
@click="dict.dictionaryDataList.push({ label: null, val: null, edit: true })"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<el-table :data="dict.dictionaryDataList" style="width: 100%" height="280px">
|
||||
<el-table-column prop="label" label="标签">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.edit">{{scope.row.label}}</span>
|
||||
<el-input v-if="scope.row.edit" v-model="scope.row.label" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="值">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.edit">{{scope.row.val}}</span>
|
||||
<el-input v-if="scope.row.edit" v-model="scope.row.val" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="!scope.row.edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="scope.row.edit = true"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.edit"
|
||||
@click="editConfirm(dict,scope.row)"
|
||||
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 v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||
<overall-asset-structure ref="assetStru" v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CountTo from 'vue-count-to'
|
||||
import OverallAssetStructure from './OverallAssetStructure.vue'
|
||||
import {addDictionary, delDict, deleteDictionary, getDictionaryList} from "@/api/etl/dictionary";
|
||||
import {addData, delById, updateData} from "@/api/etl/data";
|
||||
import {addDictionary, deleteDictionary, getDictionaryList} from "@/api/etl/dictionary";
|
||||
import {addData, updateData} from "@/api/etl/data";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'title':{
|
||||
handler(val){
|
||||
this.getDictionaryList()
|
||||
if (val.tableList.length > 0){
|
||||
this.activeName = val.tableList[0].tableName
|
||||
this.assetModel = 0
|
||||
this.dataModel = 0
|
||||
val.tableList.forEach(t =>{
|
||||
if (t.tableCount !=null){
|
||||
this.dataModel = parseInt(this.dataModel) + parseInt(t.tableCount)
|
||||
}
|
||||
if (t.fields != null){
|
||||
this.assetModel = this.assetModel + t.fields
|
||||
}
|
||||
})
|
||||
}else{
|
||||
console.error('数据模型为空')
|
||||
}
|
||||
this.activeName = val.tableList[0].tableName
|
||||
this.assetModel = 0
|
||||
this.dataModel = 0
|
||||
val.tableList.forEach(table => {
|
||||
if (table.tableCount!=null){
|
||||
this.dataModel = parseInt(this.dataModel) + parseInt(table.tableCount);
|
||||
}
|
||||
if (table.fields!=null){
|
||||
this.assetModel = parseInt(this.assetModel) + parseInt(table.fields);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
}
|
||||
title:{}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dictInfo:{
|
||||
dictionaryName:null,
|
||||
dictionaryKey:null,
|
||||
dataSourceId:null
|
||||
dictInfo: {
|
||||
dictionaryName: null,
|
||||
dictionaryKey: null,
|
||||
dataSourceId: null
|
||||
},
|
||||
assetModel:0,
|
||||
dataModel:0,
|
||||
dictMap: {},
|
||||
activeName: '',
|
||||
|
||||
dictMap: {
|
||||
},
|
||||
|
||||
assetModel: 0,
|
||||
dataModel: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
OverallAssetStructure,
|
||||
CountTo
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
deleteDictionary(id){
|
||||
console.log("删除的Id",id)
|
||||
delById(id).then(res=>{
|
||||
if (res.code==200){
|
||||
this.$message.success('删除成功')
|
||||
this.getDictionaryList()
|
||||
}else{
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
upda(row){
|
||||
console.log(row)
|
||||
console.log(this.dictMap)
|
||||
this.dictMap.forEach(dict=>{
|
||||
if (dict.dictionaryDataList.indexOf(row)>-1){
|
||||
dict.dictionaryDataList.forEach(dictData=>{
|
||||
if (dictData.id === row.id){
|
||||
dictData.isEdit = true
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
delDict(id){
|
||||
delDict(id).then(res=>{
|
||||
deleteDictionary(id) {
|
||||
deleteDictionary(id).then(res => {
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
|
||||
},
|
||||
getDictionaryList(){
|
||||
console.log(this.title)
|
||||
getDictionaryList(this.title.id).then(res=>{
|
||||
console.log("这个也是字典",res)
|
||||
getDictionaryList() {
|
||||
getDictionaryList(this.title.id).then(res => {
|
||||
this.dictMap = res.data
|
||||
console.log("一样一样一月又一月呀呀呀呀呀",this.dictMap)
|
||||
})
|
||||
},
|
||||
editConfirm(dict,row){
|
||||
console.log(row)
|
||||
if (!row.label || !row.val) {
|
||||
this.$message.error('字典标签或字典值,不可为空');
|
||||
return;
|
||||
}
|
||||
if (row.id){
|
||||
updateData(row).then(res=>{
|
||||
this.dictMap.forEach(dict=>{
|
||||
if (dict.dictionaryDataList.indexOf(row)>-1){
|
||||
dict.dictionaryDataList.forEach(dictData=>{
|
||||
if (dictData.id === row.id){
|
||||
dictData.isEdit = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(row)
|
||||
if (row.id) {
|
||||
console.log('修改')
|
||||
updateData(row).then(res => {
|
||||
row.edit = false;
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
}else{
|
||||
row.dictionaryId =dict.id
|
||||
addData(row).then(res=>{
|
||||
this.dictMap.forEach(dict=>{
|
||||
if (dict.dictionaryDataList.indexOf(row)>-1){
|
||||
dict.dictionaryDataList.forEach(dictData=>{
|
||||
if (dictData.id === row.id){
|
||||
dictData.isEdit = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log('添加')
|
||||
row.dictionaryId=dict.id
|
||||
addData(row).then(res => {
|
||||
row.edit = false;
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
addDict(){
|
||||
if (!this.dictInfo.dictionaryName){
|
||||
this.$message.error('数据字典,不可为空');
|
||||
this.$message.error('字典名称,不可为空');
|
||||
return;
|
||||
}
|
||||
if (!this.dictInfo.dictionaryKey){
|
||||
this.$message("数据值,不能为空")
|
||||
this.$message.error('字典Key,不可为空');
|
||||
return;
|
||||
}
|
||||
this.dictInfo.dataSourceId = this.title.id
|
||||
addDictionary(this.dictInfo).then(res=>{
|
||||
console.log("这是什么值",res)
|
||||
if (res.code == 200){
|
||||
this.$message.success("添加成功")
|
||||
this.getDictionaryList()
|
||||
}else{
|
||||
this.$message.error("添加失败")
|
||||
addDictionary(this.dictInfo).then(res => {
|
||||
this.dictInfo = {
|
||||
dictionaryName: null,
|
||||
dictionaryKey: null,
|
||||
dataSourceId: null
|
||||
}
|
||||
this.getDictionaryList()
|
||||
})
|
||||
this.dictInfo={
|
||||
dictionaryName:null,
|
||||
dictionaryKey: null,
|
||||
dataSourceId: null
|
||||
}
|
||||
this.getDictionaryList()
|
||||
|
||||
},
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-container style="height: 80%; border: 1px solid #eee">
|
||||
<el-aside width="300px" style="background-color: rgb(238, 241, 246)">
|
||||
<el-tree :data="sourceList"
|
||||
@node-click="handleNodeClick"
|
||||
:props="defaultProps">
|
||||
</el-tree>
|
||||
<el-container :style="{height: mainHeight + 'px'}">
|
||||
<el-aside width="400px" style="background-color: rgb(238, 241, 246);height: 80%">
|
||||
<el-tree style="background-color: white" :data="sourceList" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</el-aside>
|
||||
|
||||
<el-container>
|
||||
|
||||
<el-main>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="资产结构" name="structure">
|
||||
|
@ -44,20 +43,34 @@
|
|||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
|
||||
<!-- <el-dialog title="数据结构" :visible.sync="dialogTableVisible">-->
|
||||
<!-- <el-table :data="tableAssets">-->
|
||||
<!-- <el-table-column property="field" label="字段名" width="150"></el-table-column>-->
|
||||
<!-- <el-table-column property="type" label="类型" width="150"></el-table-column>-->
|
||||
<!-- <el-table-column property="null" label="是否为空" width="150"></el-table-column>-->
|
||||
<!-- <el-table-column property="key" label="键" width="150"></el-table-column>-->
|
||||
<!-- <el-table-column property="default" label="默认值" width="150"></el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button @click="dialogTableVisible = false">取 消</el-button>-->
|
||||
<!-- <el-button type="primary" @click="dialogTableVisible = false">确 定</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||
//例如:import 《组件名称》 from '《组件路径》,
|
||||
import {dataAssetList, listDatasource, structureList} from "@/api/etl/datasource";
|
||||
import OverallSpecificAssets from "@/views/etl/assets/dashboard/OverallSpecificAssets.vue";
|
||||
import {assetModelList, assetsList, dataAssetList, listSource, statisticsInfo, structureList} from "@/api/etl/source";
|
||||
import OverallAssets from "@/views/etl/assets/dashboard/OverallAssets.vue";
|
||||
import OverallSpecificAssets from "@/views/etl/assets/dashboard/OverallSpecificAssets.vue";
|
||||
import OverallAssetStructure from "@/views/etl/assets/dashboard/OverallAssetStructure.vue";
|
||||
export default {
|
||||
components: { OverallSpecificAssets, OverallAssets,OverallAssetStructure},
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用"
|
||||
components: {OverallAssetStructure, OverallSpecificAssets, OverallAssets},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
|
@ -79,9 +92,6 @@ export default {
|
|||
// 总条数
|
||||
total: 0,
|
||||
// 【请填写功能名称】表格数据
|
||||
datasourceList:[
|
||||
|
||||
],
|
||||
sourceList: [],
|
||||
assetsList:[],
|
||||
structureList:[],
|
||||
|
@ -91,8 +101,8 @@ export default {
|
|||
label: 'label'
|
||||
},
|
||||
sourceData:{},
|
||||
source:{
|
||||
sql:''
|
||||
source: {
|
||||
sql: ''
|
||||
},
|
||||
statisticsInfo:{}
|
||||
};
|
||||
|
@ -104,14 +114,12 @@ export default {
|
|||
//方法集合",
|
||||
methods: {
|
||||
test(data){
|
||||
console.log("红红火火恍恍惚惚哈哈哈哈",data)
|
||||
this.sourceData = data
|
||||
},
|
||||
|
||||
handleNodeClick(data) {
|
||||
this.source = data
|
||||
if (data.dataType === 'dataSource'){
|
||||
dataAssetList(data).then(res => {
|
||||
console.log(res)
|
||||
res.data.forEach(table => {
|
||||
table.dataType = "dataTable"
|
||||
table.label=table.tableName+"-"+table.tableComment+"("+table.tableCount+"条)"
|
||||
|
@ -128,15 +136,15 @@ export default {
|
|||
},
|
||||
sql(){
|
||||
structureList(this.source).then(res => {
|
||||
console.log(res)
|
||||
this.structureList = res.data.kvtList
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
listDatasource(this.queryParams).then(response => {
|
||||
listSource({}).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
console.log(this.sourceList)
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.type=='PostGre'){
|
||||
if (source.type=='PostGreSql'){
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.modeName+'-'+source.systemName+')'
|
||||
}else{
|
||||
source.label=source.dataSourceName+'('+source.databaseName+'-'+source.systemName+')'
|
||||
|
@ -164,13 +172,16 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-header {
|
||||
background-color: #B3C0D1;
|
||||
color: #333;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.el-aside {
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 400px;
|
||||
background-color: white;
|
||||
}
|
||||
.el-main {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.custom-tree-node{
|
||||
height: 30px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -34,17 +34,6 @@
|
|||
v-hasPermi="['system:source: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:source:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
|
@ -69,48 +58,44 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="datasourceList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="sourceList" @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="port" />
|
||||
<el-table-column label="用户名" align="center" prop="username" />
|
||||
<el-table-column label="密码" align="center" prop="password" />
|
||||
<el-table-column label="连接地址" align="center" prop="linkAddress" />
|
||||
<el-table-column label="编号" align="center" prop="id" />
|
||||
<el-table-column label="数据源名称" align="center" prop="dataSourceName" />
|
||||
<el-table-column label="数据库名" align="center" prop="databaseName" />
|
||||
<el-table-column label="数据库类型" align="center" prop="type" />
|
||||
<el-table-column label="是否初始化" align="center" prop="isInit">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isInit"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据源连接地址" align="center" prop="linkAddress" />
|
||||
<el-table-column label="数据源连接端口" align="center" prop="port" />
|
||||
<el-table-column label="数据库名称" align="center" prop="databaseName" />
|
||||
<el-table-column label="连接用户名" align="center" prop="username" />
|
||||
<el-table-column label="连接密码" align="center" prop="password" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="模式名称" align="center" prop="modeName" />
|
||||
<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-link"
|
||||
@click="test(scope.row)"
|
||||
icon="el-icon-edit"
|
||||
@click="testConnection(scope.row)"
|
||||
>测试连接</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-open"
|
||||
@click="synchronization(scope.row)"
|
||||
>同步资产结构</el-button>
|
||||
icon="el-icon-edit"
|
||||
@click="synchronousData(scope.row)"
|
||||
>同步资产</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['etl:datasource:edit']"
|
||||
v-hasPermi="['system:source:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['etl:datasource:remove']"
|
||||
v-hasPermi="['system:source:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -160,7 +145,7 @@
|
|||
<el-form-item label="数据接入类型" prop="type">
|
||||
<el-select style="width: 100%" v-model="form.type">
|
||||
<el-option label="MySql" value="MySql">MySql</el-option>
|
||||
<el-option label="Postgres" value="Oracle">Postgres</el-option>
|
||||
<el-option label="PostGreSql" value="PostGreSql">PostGreSql</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -170,6 +155,13 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show="form.type === 'PostGreSql'">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="模式名称" prop="modeName">
|
||||
<el-input v-model="form.modeName" placeholder="模式名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="连接用户名" prop="username">
|
||||
|
@ -269,20 +261,28 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
listDatasource,
|
||||
getDatasource,
|
||||
addDatasource,
|
||||
updateDatasource,
|
||||
delDatasource,
|
||||
test,
|
||||
synchronization
|
||||
} from "@/api/etl/datasource";
|
||||
listSource,
|
||||
getSource,
|
||||
delSource,
|
||||
addSource,
|
||||
updateSource,
|
||||
testConnection,
|
||||
synchronousData
|
||||
} from "@/api/etl/source";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
'form.type':{
|
||||
handler(val) {
|
||||
if(val != 'PostGre'){
|
||||
this.form.modeName = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
name: "Source",
|
||||
data() {
|
||||
return {
|
||||
datasourceList:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -301,7 +301,6 @@ export default {
|
|||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
datasource:{},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
|
@ -312,114 +311,112 @@ export default {
|
|||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
dataSourceName: [
|
||||
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
||||
],
|
||||
systemName: [
|
||||
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
|
||||
],
|
||||
type: [
|
||||
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
||||
],
|
||||
linkAddress: [
|
||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||
],
|
||||
port: [
|
||||
{required: true, message: "端口不能为空", trigger: "blur"}
|
||||
],
|
||||
databaseName: [
|
||||
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
||||
],
|
||||
connectionParam: [
|
||||
{required: true, message: "数据连接参数不能为空", trigger: "blur"}
|
||||
],
|
||||
initNum: [
|
||||
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxNum: [
|
||||
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxWaitTime: [
|
||||
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
|
||||
],
|
||||
maxWaitSize: [
|
||||
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
||||
],
|
||||
modeName:[
|
||||
{required: true, message: "数据源模式不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
dataSourceName: [
|
||||
{required: true, message: "接入源名称不能为空", trigger: "blur"}
|
||||
],
|
||||
systemName: [
|
||||
{required: true, message: "数据来源系统名称不能为空", trigger: "blur"}
|
||||
],
|
||||
type: [
|
||||
{required: true, message: "数据接入类型不能为空", trigger: "blur"}
|
||||
],
|
||||
host: [
|
||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||
],
|
||||
port: [
|
||||
{required: true, message: "主机地址不能为空", trigger: "blur"}
|
||||
],
|
||||
databaseName: [
|
||||
{required: true, message: "数据库名称不能为空", trigger: "blur"}
|
||||
],
|
||||
initNum: [
|
||||
{required: true, message: "初始连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxNum: [
|
||||
{required: true, message: "最大连接数量不能为空", trigger: "blur"}
|
||||
],
|
||||
maxWaitTime: [
|
||||
{required: true, message: "最大等待时间不能为空", trigger: "blur"}
|
||||
],
|
||||
maxWaitSize: [
|
||||
{required: true, message: "最大等待次数不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
dataSourceParamList: [
|
||||
{
|
||||
name: null,
|
||||
val: null
|
||||
}
|
||||
],
|
||||
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
synchronization(data){
|
||||
synchronization(data).then(res=>{
|
||||
console.log(res)
|
||||
if (res.code == 200){
|
||||
synchronousData(data) {
|
||||
synchronousData(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message:("成功")
|
||||
})
|
||||
}else{
|
||||
message: "同步成功",
|
||||
type: "success"
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message:("失败")
|
||||
})
|
||||
message: "同步失败",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加参数
|
||||
addParam(){
|
||||
this.dataSourceParamList.push({
|
||||
name:null,
|
||||
val:null
|
||||
name: null,
|
||||
val: null
|
||||
})
|
||||
},
|
||||
deleteParam(){
|
||||
if (index!=null){
|
||||
this.dataSourceParamList.splice(index,1)
|
||||
}else{
|
||||
// 删除参数
|
||||
deleteParam(index){
|
||||
if (index != null){
|
||||
this.dataSourceParamList.splice(index, 1);
|
||||
}else {
|
||||
this.dataSourceParamList = []
|
||||
}
|
||||
this.processParam()
|
||||
this.processParam();
|
||||
},
|
||||
// 处理参数
|
||||
processParam(){
|
||||
this.form.connectionParam= this.dataSourceParamList
|
||||
.filter(item=>item.name !=null || item .val!=null)
|
||||
.map(ite =>{
|
||||
return ite.name + "=" + ite.val
|
||||
}).join("&")
|
||||
this.form.connectionParam = this.dataSourceParamList
|
||||
.filter(item => item.name != null || item.val != null)
|
||||
.map(item => {
|
||||
return item.name + "=" + item.val;
|
||||
}).join("&")
|
||||
console.log(this.form.connectionParam)
|
||||
},
|
||||
//测试
|
||||
test(datasource){
|
||||
test(datasource).then(res=>{
|
||||
if (res.code == 200){
|
||||
/** 测试连接 */
|
||||
testConnection(row) {
|
||||
testConnection(row).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message({
|
||||
message:("成功")
|
||||
})
|
||||
}else{
|
||||
message: "连接成功",
|
||||
type: "success"
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message:("失败")
|
||||
})
|
||||
message: "连接失败",
|
||||
type: "error"
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询数据源列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDatasource(this.queryParams).then(response => {
|
||||
console.log(response)
|
||||
this.datasourceList = response.data.rows;
|
||||
listSource(this.queryParams).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
@ -432,12 +429,25 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
port: null,
|
||||
dataSourceName: null,
|
||||
type: null,
|
||||
systemName: null,
|
||||
username: null,
|
||||
password: null,
|
||||
linkAddress: null,
|
||||
dataSourceName: null,
|
||||
databaseName: null
|
||||
port: null,
|
||||
databaseName: null,
|
||||
connectionParam: null,
|
||||
initNum: null,
|
||||
maxNum: null,
|
||||
maxWaitTime: null,
|
||||
maxWaitSize: null,
|
||||
modeName: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
@ -461,30 +471,42 @@ export default {
|
|||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加数据源";
|
||||
this.dataSourceParamList = [];
|
||||
this.title = "添加数据接入";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getDatasource(id).then(response => {
|
||||
this.form = response.data;
|
||||
getSource(row.id).then(res => {
|
||||
console.log(res)
|
||||
this.form = res.data;
|
||||
console.log(this.form)
|
||||
this.dataSourceParamList = [];
|
||||
if (this.form.connectionParam){
|
||||
this.form.connectionParam.split("&").forEach(param => {
|
||||
let paramArr = param.split("=");
|
||||
this.dataSourceParamList.push({
|
||||
name: paramArr[0],
|
||||
val: paramArr[1]
|
||||
})
|
||||
})
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改数据源";
|
||||
});
|
||||
this.title = "修改数据接入";
|
||||
})
|
||||
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDatasource(this.form).then(response => {
|
||||
updateSource(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addDatasource(this.form).then(response => {
|
||||
addSource(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -496,8 +518,8 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除数据源编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delDatasource(ids);
|
||||
this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delSource(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
@ -505,9 +527,9 @@ export default {
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('etl/datasource/export', {
|
||||
this.download('system/source/export', {
|
||||
...this.queryParams
|
||||
}, `datasource_${new Date().getTime()}.xlsx`)
|
||||
}, `source_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
|
@ -6,46 +6,13 @@
|
|||
</div>
|
||||
<el-form ref="form" :model="ruleEngineCommonConfig" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规则基础目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.packageName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自定义基础目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.customName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="模板基础目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.templateName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="win源码目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.sourceWin" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="win编译目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.targetWin" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="liunx源码目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.sourceLiunx" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="liunx编译目录">
|
||||
<el-input v-model="ruleEngineCommonConfig.targetLiunx" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -57,7 +24,7 @@
|
|||
</div>
|
||||
<el-tabs type="border-card" v-model="codeCardStatus">
|
||||
<el-tab-pane v-for="scope in scopeList" :label="scope.type" :name="scope.value">
|
||||
<encoding v-if="codeCardStatus === scope.value" style="height: 600px" v-model="scope.code" :read-only="true"></encoding>
|
||||
<encoding v-if="codeCardStatus === scope.value" style="height: 800px" v-model="scope.code" :read-only="true"></encoding>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
@ -77,12 +44,6 @@ export default {
|
|||
codeCardStatus: "taskContext",
|
||||
ruleEngineCommonConfig: {
|
||||
packageName: "com.muyu.rule.engine",
|
||||
customName: "custom",
|
||||
templateName: "template",
|
||||
sourceWin: "D:\\config\\engine\\source",
|
||||
targetWin: "D:\\config\\engine\\target",
|
||||
sourceLiunx: "/home/config/source",
|
||||
targetLiunx: "/home/config/target",
|
||||
},
|
||||
scopeList: [
|
||||
{ type: "任务", value: "taskContext", "code":
|
||||
|
|
|
@ -106,18 +106,6 @@
|
|||
</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="initializeRuleEngine(scope.row)"
|
||||
>初始化</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-takeaway-box"
|
||||
@click="testMethod(scope.row)"
|
||||
>调用测试</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -317,51 +305,6 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
testMethod(row){
|
||||
testMethod(row.code).then(res => {
|
||||
if (res.code === 200){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '测试成功!'
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '测试失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
testMethods(row){
|
||||
testMethod(row.code).then(res => {
|
||||
if(res.code === 200){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '测试成功'
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '测试失败'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
initializeRuleEngine(row){
|
||||
initializeRuleEngine(row).then(res => {
|
||||
if (res.code === 200){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '初始化成功!'
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '初始化失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
toEngineVersion(row){
|
||||
this.$router.push({ path: `/ruleEngine/engineVersion/${row.id}`});
|
||||
},
|
||||
|
|
|
@ -1,36 +1,16 @@
|
|||
<template>
|
||||
<div>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
||||
<span>这是一段信息</span>
|
||||
<el-card style="height: 90%">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ruleEngineInfo.name}}</span>
|
||||
<el-button @click="updEngine" style="float: right" type="primary">保存</el-button>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<encoding ref="encoding" :modification="modification" :value="ruleEngineInfo.codeText"></encoding>
|
||||
</div>
|
||||
</el-card>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<div class="app-container">
|
||||
<el-descriptions class="margin-top" :title="ruleEngineInfo.name" :column="3" border>
|
||||
<template slot="extra">
|
||||
<el-button @click="dialogVisible= true">编辑代码</el-button>
|
||||
<el-dropdown split-button type="primary" @command="handleClick">
|
||||
更多操作
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="add" @click="addVersionStatus = true">版本添加</el-dropdown-item>
|
||||
<el-dropdown-item command="activate">{{(ruleEngineInfo.isActivate === '2' ? "激活": "禁用")+'引擎'}}</el-dropdown-item>
|
||||
<el-dropdown-item command="add">版本添加</el-dropdown-item>
|
||||
<el-dropdown-item command="activate">{{(ruleEngineInfo.isActivate === 'no-activate' ? "激活": "禁用")+'引擎'}}</el-dropdown-item>
|
||||
<el-dropdown-item command="status">{{(ruleEngineInfo.status === '0' ? "关闭": "开启")+'引擎'}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
</template>
|
||||
<el-descriptions-item label="规则名称"> {{ruleEngineInfo.name}} </el-descriptions-item>
|
||||
<el-descriptions-item label="规则类型">
|
||||
|
@ -48,36 +28,47 @@
|
|||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<editor style="margin-top: 20px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>规则引擎版本</span>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.versionList">
|
||||
<el-col :span="12" v-for="ruleEngineVersion in ruleEngineInfo.engineVersionList">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ruleEngineVersion.name + "-" + ruleEngineVersion.code}}</span>
|
||||
<el-dropdown style="float: right; padding: 3px 0">
|
||||
<el-dropdown style="float: right; padding: 3px 0" @command="checkRuleEngineVersion">
|
||||
<span class="el-dropdown-link">
|
||||
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="info">规则详情</el-dropdown-item>
|
||||
<el-dropdown-item command="test" >测试规则</el-dropdown-item>
|
||||
<el-dropdown-item command="status">禁用规则</el-dropdown-item>
|
||||
<el-dropdown-item :command="{event: 'info',ruleEngineVersion: ruleEngineVersion}">规则详情</el-dropdown-item>
|
||||
<el-dropdown-item :command="{event:'test',ruleEngineVersion: ruleEngineVersion}"
|
||||
:disabled="ruleEngineVersion.status === '0'"
|
||||
>测试规则</el-dropdown-item>
|
||||
<el-dropdown-item :command="{event: 'status',ruleEngineVersion: ruleEngineVersion}" :disabled="ruleEngineVersion.status !=='2'">
|
||||
{{ruleEngineVersion.isActivate !== 'no-activate' ? '禁用':'激活'}}规则
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{event: 'publish',ruleEngineVersion: ruleEngineVersion}"
|
||||
v-if="ruleEngineVersion.status ==='1' && ruleEngineVersion.isTest ==='1'">
|
||||
发布规则
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<el-descriptions class="margin-top" :column="2" border>
|
||||
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineInfo.engineCode+"_"+ruleEngineVersion.code}} </el-descriptions-item>
|
||||
<el-descriptions-item label="版本类" :span="2"> {{ruleEngineVersion.versionCode}} </el-descriptions-item>
|
||||
<el-descriptions-item label="版本名称"> {{ruleEngineVersion.name}} </el-descriptions-item>
|
||||
<el-descriptions-item label="版本CODE"> {{ruleEngineVersion.code}} </el-descriptions-item>
|
||||
<el-descriptions-item label="是否激活">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersion.isActivate"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本状态">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="ruleEngineVersion.status"/>
|
||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersion.status"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否测试">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersion.isTest"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<editor style="margin-top: 10px" :read-only="true" v-model="ruleEngineInfo.description"></editor>
|
||||
|
@ -93,7 +84,7 @@
|
|||
<span>基本信息</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="genEngineVersion">生成引擎版本类</el-button>
|
||||
</div>
|
||||
<el-form :label-position="engineVersionForm" label-width="80px" :model="engineVersionForm">
|
||||
<el-form label-width="80px" :model="engineVersionForm">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="版本类">
|
||||
|
@ -116,8 +107,7 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="engineVersionForm.status"/>
|
||||
|
||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="engineVersionForm.status"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -129,71 +119,221 @@
|
|||
</el-form>
|
||||
<editor v-model="engineVersionForm.description" :min-height="150"/>
|
||||
</el-card>
|
||||
<el-card class="box-card" v-if="engineVersionForm.codeIng != null">
|
||||
|
||||
<el-card class="box-card" v-if="engineVersionForm.codeIng != null && engineVersionForm.codeIng!=''">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>引擎编码</span>
|
||||
</div>
|
||||
<encoding style="height: 800px" v-model="engineVersionForm.codeIng"></encoding>
|
||||
</el-card>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addVersionCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="addVersionSubmission">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-drawer
|
||||
title="规则版本详情" size="80%" :before-close="ruleEngineVersionInfoStatusClose"
|
||||
:visible.sync="ruleEngineVersionInfoStatus"
|
||||
:direction="'rtl'">
|
||||
<div class="app-container">
|
||||
<el-descriptions v-if="ruleEngineVersionInfoAndTest != null" class="margin-top" :cloumn="2" border>
|
||||
<el-descriptions-item label="版本类" :span="2">{{ruleEngineVersionInfoAndTest.versionCode}}</el-descriptions-item>
|
||||
<el-descriptions-item label="版本名称">{{ruleEngineVersionInfoAndTest.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="版本CODE">{{ruleEngineVersionInfoAndTest.code}}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否激活">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersionInfoAndTest.isActivate"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本状态">
|
||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersionInfoAndTest.status"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否测试">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersionInfoAndTest.isTest"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<editor style="margin-top: 10px" :read-only="true" :min-height="100" v-model="ruleEngineVersionInfoAndTest.description"></editor>
|
||||
<el-row style="margin-top: 10px">
|
||||
<el-button @click="saveCoding">保存代码</el-button>
|
||||
</el-row>
|
||||
<encoding style="height: 800px; margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng"></encoding>
|
||||
</div>
|
||||
|
||||
</el-drawer>
|
||||
<el-drawer
|
||||
title="规则版本测试" size="80%" :before-close="ruleEngineVersionInfoStatusClose"
|
||||
:visible.sync="ruleEngineVersionTestStatus"
|
||||
:direction="'rtl'">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-descriptions v-if="ruleEngineVersionInfoAndTest != null" class="margin-top" :column="2">
|
||||
<el-descriptions-item label="版本类" :span="2">{{ruleEngineVersionInfoAndTest.versionCode}}</el-descriptions-item>
|
||||
<el-descriptions-item label="版本名称">{{ruleEngineVersionInfoAndTest.name}}</el-descriptions-item>
|
||||
<el-descriptions-item label="版本CODE">{{ruleEngineVersionInfoAndTest.code}}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否激活">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_status" :value="ruleEngineVersionInfoAndTest.isActivate"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本状态">
|
||||
<dict-tag :options="dict.type.rule_engine_version_status" :value="ruleEngineVersionInfoAndTest.status"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否测试">
|
||||
<dict-tag :options="dict.type.rule_engine_activate_is_test" :value="ruleEngineVersionInfoAndTest.isTest"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<editor style="margin-top: 10px" :read-only="true" :min-height="105" v-model="ruleEngineVersionInfoAndTest.description"></editor>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<encoding style="margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng" :read-only="true"></encoding>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="assetStructure == null ? 24: 12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择数据接入</span>
|
||||
</div>
|
||||
<el-select v-model="assetStructure" style="width: 100%">
|
||||
<el-option v-for="_asserStructure in assetStructureList"
|
||||
:key="_asserStructure.dataSourceName"
|
||||
:value="_asserStructure.dataSourceName"
|
||||
:label="_asserStructure.dataSourceName+'('+_asserStructure.systemName+')'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="assetStructure != null">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择资产结构</span>
|
||||
</div>
|
||||
<el-select v-model="assets" style="width: 100%">
|
||||
<el-option v-for="_assets in assetsList"
|
||||
:key="_assets.tableName"
|
||||
:value="_assets.tableName"
|
||||
:label="_assets.tableName+'('+_assets.tableComment+')'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-card class="box-card" v-if="assets != null">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择资产模型</span>
|
||||
</div>
|
||||
<el-descriptions direction="vertical" :column="3" border>
|
||||
<el-descriptions-item v-for="_dataModel in dataModelList"
|
||||
:label="_dataModel.name+'('+_dataModel.comment+')'">
|
||||
<el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">{{dataModeMap[_dataModel.name]}}</el-radio>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="24" style="margin-top: 10px" v-if="dataMode != null">
|
||||
<el-button>测试</el-button>
|
||||
<el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试"></el-input>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMaintenance, updateMaintenance} from "@/api/ruleEngine/maintenance";
|
||||
import Encoding from "@/components/Encoding/index.vue";
|
||||
import {getMaintenance} from "@/api/engine/maintenance";
|
||||
|
||||
import {addVersion, updateVersion} from "@/api/ruleEngine/version";
|
||||
import {dataAssetList, listSource} from "@/api/etl/source";
|
||||
export default {
|
||||
name: "EngineVersion",
|
||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level'],
|
||||
components: {Encoding},
|
||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level', 'rule_engine_version_status','rule_engine_activate_is_test'],
|
||||
watch: {
|
||||
'assetStructure': {
|
||||
handler(val) {
|
||||
if (val != null) {
|
||||
let assetStructureData;
|
||||
this.assetStructureList.forEach(_assetStructure => {
|
||||
if (_assetStructure.dataSourceName === val) {
|
||||
assetStructureData = _assetStructure
|
||||
}
|
||||
})
|
||||
dataAssetList(assetStructureData).then(res => {
|
||||
this.assetsList = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addVersionStatus:false,
|
||||
//详情抽屉状态
|
||||
ruleEngineVersionInfoStatus: false,
|
||||
//测试抽屉状态
|
||||
ruleEngineVersionTestStatus: false,
|
||||
//弹框抽屉
|
||||
ruleEngineVersionInfoAndTest: {},
|
||||
//数据接入集合
|
||||
assetStructureList: [],
|
||||
//数据接入选择
|
||||
assetStructure: null,
|
||||
//数据资产集合
|
||||
assetsList:[],
|
||||
//数据资产选择
|
||||
assets: null,
|
||||
//数据模型集合
|
||||
dataModelList: [],
|
||||
//数据模型选择
|
||||
dataMode: null,
|
||||
//数据示例
|
||||
dataModeMap:{},
|
||||
testResult: "",
|
||||
ruleEngineId: this.$route.params && this.$route.params.ruleEngineId,
|
||||
ruleEngineInfo: {},
|
||||
// 新增版本
|
||||
addVersionStatus: false,
|
||||
engineVersionForm: {
|
||||
"name": "", "code": "", "status": "0",
|
||||
"engineMaintenanceId": this.ruleEngineId,
|
||||
"name": null,
|
||||
"code": null,
|
||||
"status": "0",
|
||||
"versionCode": "",
|
||||
"isActivate": "no-activate",
|
||||
"description": "",
|
||||
"codeIng": null
|
||||
},
|
||||
dialogVisible :false,
|
||||
ruleEngineInfo: {
|
||||
versionList:[]
|
||||
|
||||
},
|
||||
ruleEngineInfoList:{
|
||||
|
||||
},
|
||||
modification:null,
|
||||
ruleEngineId: this.$route.params.ruleEngineId,
|
||||
|
||||
"codeIng": ""
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
// this.initRuleEngine()
|
||||
this.initRuleEngine();
|
||||
},
|
||||
methods: {
|
||||
saveCoding() {
|
||||
this.$message.success('编码保存成功');
|
||||
//获取数据接入集合
|
||||
getAssetStructureList(){
|
||||
listSource({}).then(response => {
|
||||
this.assetStructureList = response.data.rows;
|
||||
})
|
||||
},
|
||||
saveCoding(){
|
||||
updateVersion({id: this.ruleEngineVersionInfoAndTest.id, codeIng: this.ruleEngineVersionInfoAndTest.codeIng,status: '1'})
|
||||
.then(res => {
|
||||
if (res.code == 200) {
|
||||
this.ruleEngineVersionInfoStatus = false;
|
||||
this.$message.success('编码保存成功');
|
||||
this.initRuleEngine();
|
||||
}
|
||||
})
|
||||
},
|
||||
ruleEngineVersionInfoStatusClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
this.ruleEngineVersionInfoAndTest = {};
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
.catch(_ => {})
|
||||
},
|
||||
ruleEngineVersionTestStatusClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
this.ruleEngineVersionInfoAndTest = {};
|
||||
done();
|
||||
|
@ -208,27 +348,19 @@ export default {
|
|||
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||
break;
|
||||
case "test"://测试
|
||||
this.ruleEngineVersionInfoStatus = true;
|
||||
this.ruleEngineVersionTestStatus = true;
|
||||
this.ruleEngineVersionInfoAndTest = command.ruleEngineVersion;
|
||||
this.getAssetStructureList();
|
||||
break;
|
||||
case "status"://激活状态
|
||||
case "status"://激活状态
|
||||
command.ruleEngineVersion.isActivate = 'no-activate' === command.ruleEngineVersion.isActivate ? 'activated' : 'no-activate'
|
||||
break;
|
||||
case "publish"://发布
|
||||
command.ruleEngineVersion.status = '2'
|
||||
break;
|
||||
}
|
||||
console.log(command.event);
|
||||
console.log(command.ruleEngineVersion);
|
||||
},
|
||||
// 确定新增
|
||||
addVersionSubmission(){
|
||||
this.addVersionStatus =false
|
||||
},
|
||||
// 取消新增
|
||||
addVersionCancel(){
|
||||
this.addVersionStatus= false
|
||||
},
|
||||
// 生成规则版本
|
||||
genEngineVersion(){
|
||||
if (this.engineVersionForm.name == null || this.engineVersionForm.name === "") {
|
||||
this.$message.error('规则名称不可为空');
|
||||
|
@ -241,41 +373,134 @@ export default {
|
|||
this.engineVersionForm.versionCode = this.ruleEngineInfo.engineCode + "_" + this.engineVersionForm.code
|
||||
this.engineVersionForm.codeIng = this.getCodeIng()
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
// 确定新增
|
||||
addVersionSubmission(){
|
||||
addVersion(this.engineVersionForm).then(res => {
|
||||
if (res.code === 200){
|
||||
this.$modal.msgSuccess("新增版本成功");
|
||||
this.addVersionStatus = false;
|
||||
this.initRuleEngine();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消新增
|
||||
addVersionCancel(){
|
||||
this.engineVersionForm = {
|
||||
"engineMaintenanceId": this.ruleEngineId,
|
||||
"name": "",
|
||||
"code": "",
|
||||
"status": "0",
|
||||
"versionCode": "",
|
||||
"isActivate": "no-activate",
|
||||
"description": "",
|
||||
"codeIng": ""
|
||||
}
|
||||
this.addVersionStatus = false;
|
||||
},
|
||||
handleClick(clickType){
|
||||
if (clickType === "add"){
|
||||
this.engineVersionForm = {
|
||||
"engineMaintenanceId": this.ruleEngineId,
|
||||
"name": "",
|
||||
"code": "",
|
||||
"status": "0",
|
||||
"versionCode": "",
|
||||
"isActivate": "no-activate",
|
||||
"description": "",
|
||||
"codeIng": ""
|
||||
}
|
||||
this.addVersionStatus = true;
|
||||
}else if(clickType === "activate"){
|
||||
this.ruleEngineInfo.isActivate = '2' === this.ruleEngineInfo.isActivate ? '1' : '2'
|
||||
this.$modal.msgSuccess("引擎激活状态修改成功");
|
||||
this.ruleEngineInfo.isActivate = 'no-activate' === this.ruleEngineInfo.isActivate ? 'activated' : 'no-activate'
|
||||
updateMaintenance({id: this.ruleEngineInfo.id, isActivate: this.ruleEngineInfo.isActivate}).then(res => {
|
||||
if (res.code === 200){
|
||||
this.$modal.msgSuccess("引擎激活状态修改成功");
|
||||
}
|
||||
})
|
||||
}else if(clickType === "status"){
|
||||
this.ruleEngineInfo.status = '0' === this.ruleEngineInfo.status ? '1' : '0'
|
||||
this.$modal.msgSuccess("引擎状态操作成功");
|
||||
updateMaintenance({id: this.ruleEngineInfo.id, status: this.ruleEngineInfo.status}).then(res => {
|
||||
if (res.code === 200){
|
||||
this.$modal.msgSuccess("引擎状态操作成功");
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
updEngine(){
|
||||
this.modification = parseInt(this.ruleEngineId)
|
||||
setTimeout(()=>{
|
||||
this.modification =null
|
||||
this.dialogVisible = false
|
||||
},50)
|
||||
},
|
||||
getInfo(){
|
||||
getMaintenance(this.$route.params.ruleEngineId).then(res=>{
|
||||
console.log("res",res)
|
||||
this.ruleEngineInfo = res.data
|
||||
initRuleEngine(){
|
||||
getMaintenance(this.ruleEngineId).then(res => {
|
||||
if (res.code === 200){
|
||||
this.ruleEngineInfo = res.data;
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
//获取当前时间
|
||||
now() {
|
||||
let time = new Date()
|
||||
const year = time.getFullYear();
|
||||
const month = String(time.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(time.getDate()).padStart(2, '0');
|
||||
let date = `${year}/${month}/${day}`;
|
||||
return date;
|
||||
},
|
||||
// 获取代码模板
|
||||
getCodeIng(){
|
||||
|
||||
let packageName = "com.muyu.rule.rule.engine";
|
||||
let customName = "custom";
|
||||
let templateName = "template";
|
||||
let parentClass = null;
|
||||
switch (this.ruleEngineInfo.level) {
|
||||
case "data-field":
|
||||
parentClass = "DataModelEngine";
|
||||
break;
|
||||
case "data-record":
|
||||
parentClass = "RecordEngine";
|
||||
break;
|
||||
case "data-set":
|
||||
parentClass = "DataSetEngine";
|
||||
break;
|
||||
}
|
||||
let date = this.now();
|
||||
let codeIng = `package ${packageName}.${customName};
|
||||
import com.muyu.rule.engine.action.ActionDiscard;
|
||||
import com.muyu.rule.engine.scope.${parentClass};
|
||||
|
||||
/**
|
||||
* @Author: YaoXin
|
||||
* @date: ${date}
|
||||
* @Description: ${this.engineVersionForm.name}-${this.engineVersionForm.code}
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
|
||||
@Override
|
||||
public void execution () {
|
||||
Object value = getValue();
|
||||
|
||||
if (value == null || "".equals(value) || "null".equals(value)) {
|
||||
throw new ActionDiscard();
|
||||
}
|
||||
}
|
||||
}`;
|
||||
return codeIng;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.box-card{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
}
|
||||
.el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
.CodeMirror {
|
||||
height: 600px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue