fix: 数据资产

master
rouchen 2024-04-24 18:53:58 +08:00
parent 9bf782448a
commit 053b05b38f
11 changed files with 215 additions and 471 deletions

2
src/api/buss.js 100644
View File

@ -0,0 +1,2 @@
import Vue from 'vue';
export default new Vue;

View File

@ -121,3 +121,10 @@ export function selectChildAll() {
method: 'post'
})
}
//查询所有部门列表
export function selectDept() {
return request({
url: '/kvt/kvt/selectDept',
method: 'post'
})
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询部门列表
// 查询
export function listDept(query) {
return request({
url: '/system/dept/list',

View File

@ -1,7 +1,6 @@
import Vue from 'vue'
import Cookies from 'js-cookie'
Vue.prototype.$EventBus = new Vue();
import Element from 'element-ui'
import './assets/styles/element-variables.scss'

View File

@ -6,6 +6,7 @@
{{selectAll}}
</div>
{{childrenMess}}
<el-descriptions border :column="2" >
<el-descriptions-item label="表名称">{{childrenMess.name}}</el-descriptions-item>
<el-descriptions-item label="表备注">{{childrenMess.as}}</el-descriptions-item>
@ -17,10 +18,10 @@
</el-card>
<el-card style=" margin-top: 20px;">
<div slot="header" class="clearfix">
<span>资产模型详细信息</span>
<span> {{selectData}}资产模型详细信息</span>
</div>
<el-table
:data="dataStr"
:data="selectData"
style="width: 100%;">
<el-table-column prop="name" label="名称" />
<el-table-column prop="comment" label="注释" />
@ -177,17 +178,17 @@
<script>
import bus from '@/api/bus'
import busss from '@/api/busss'
import buss from '@/api/buss'
import bues from '@/api/bues'
export default {
name: 'OverallAssetStructure',
props: [
'dataStr',
'selectData',
'childrenMess',
'selectAll'
],
data() {
return {
selectData:[],
tableData: [
// {
// id: 1,
@ -273,19 +274,24 @@ export default {
}
}
},
mounted() {
busss.$on('sendSe',data => {
console.log("senddddd",data)
this.selectData = data
this.dataStr= this.selectData
console.log("aaaaaaaaaa", this.dataStr)
})
created() {
this.ENEN()
},
methods: {
sendSelectAll(){
bus.$emit("sendSelecr", this. selectAll)
},
ENEN(){
buss.$on('send',data => {
this.childrenMess = data
console.log("childrenMess",this.childrenMess )
})
bues.$on('大头小头',(data) =>{
console.log("大头小头",data)
this.selectData = data
console.log("senddddd",this.selectData)
})
},
update(row) {
this.form = row;
this.formStatus = true;

View File

@ -85,10 +85,10 @@
</el-row>
</el-card>
{{selectAll}}
{{selectData}}
</el-col>
<el-col :span="24" style="margin-top: 20px">
<pre>{{ selectAll }}</pre>
<pre>{{selectData}}</pre>
</el-col>
<el-col :span="24" style="margin-top: 20px" >
@ -110,17 +110,14 @@
import CountTo from 'vue-count-to'
import OverallAssetStructure from './OverallAssetStructure.vue'
import bus from '@/api/bus'
import busss from '@/api/busss'
import { selectDataStur } from '@/api/kvt/kvt'
import bues from '@/api/bues'
import buss from '@/api/buss'
import { selectChild, selectDataStur } from '@/api/kvt/kvt'
export default {
props: {
title: {
type: String,
default: "-"
},
selectAll:[]
},
props: [
'selectAll'
],
// watch:{
// activeTab(newVal,oldVal){
// this.selectDataStur(newVal)
@ -140,7 +137,8 @@ export default {
{ label: '否', val: '0', isEdit: false }
],
},
selectData: []
selectData: [],
chirien: []
}
},
components: {
@ -159,18 +157,22 @@ export default {
console.log("awdesfgrd",this.selectedItem)
selectDataStur(this.selectedItem.name).then(res => {
this.selectData = res.data
console.log("qqqqqqqq",this.selectData)
busss.$emit("sendSe", this.selectData)
})
selectChild(this.selectedItem.name).then(res => {
this.chirien = res.data
buss.$emit("send",this.chirien)
console.log("wwwwwww",this.selectData)
bues.$emit("大头小头",this.selectData)
})
},
sendSen(){
},
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
},
beforeDestroy(){
this.selectDataStur(tab)
}
}
</script>

View File

@ -16,8 +16,8 @@
<el-container>
<el-main>
<OverallAssets v-if="showAssets == null"/>
<overall-specific-assets v-if="showAssets == 1" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:dataStr="dataStructure" :title="title"/>
<overall-asset-structure v-if="showAssets == 2" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:dataStr="dataStructure" :title="title"/>
<overall-specific-assets v-if="showAssets == 1" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
<overall-asset-structure v-if="showAssets == 2" v-bind:selectAll="chir" v-bind:childrenMess="childr" v-bind:selectData="dataStructure" :title="title"/>
</el-main>
</el-container>

View File

@ -1,21 +1,22 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
{{DataSource}}
<el-form ref="form" :model="DataSource" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/>
<el-input v-model="form.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/>
<el-input v-model="form.systemName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/>
<el-input v-model="form.databaseName" disabled/>
</el-form-item>
</el-col>
</el-row>
@ -84,9 +85,13 @@
<script>
import { parseTime } from '@/utils/muyu'
import { listDept } from '@/api/system/dept'
export default {
name: "AuthDataSource",
props: [
"DataSource"
],
data() {
return {
//
@ -98,9 +103,6 @@ export default {
pageSize: 1,
//
baseInfo: {
name: "测试1",
systemName: "云计算系统",
databaseName: "yunjisuan",
},
//
deptList: [],
@ -116,193 +118,53 @@ export default {
methods: {
parseTime,
init(){
let response = {
"code": 200,
"msg": "操作成功",
"data": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 100,
"parentId": 0,
"ancestors": "0",
"deptName": "muyu牧鱼科技",
"orderNum": 0,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 101,
"parentId": 100,
"ancestors": "0,100",
"deptName": "深圳总公司",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 102,
"parentId": 100,
"ancestors": "0,100",
"deptName": "长沙分公司",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 103,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "研发部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 104,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "市场部门",
"isAuth": true,
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 105,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "测试部门",
"orderNum": 3,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 106,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "财务部门",
"orderNum": 4,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 107,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "运维部门",
"orderNum": 5,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 108,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "市场部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 109,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "财务部门",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
}
]
}
let response = [];
listDept().then(res => {
console.log(res)
this.deptList = res.date
})
// "code": 200,
// "msg": "",
// "data": [
// {
// "createBy": 1,
// "createTime": "2023-09-29 11:47:27",
// "updateBy": null,
// "updateTime": null,
// "deptId": 100,
// "parentId": 0,
// "ancestors": "0",
// "deptName": "muyu",
// "orderNum": 0,
// "leader": "muyu",
// "phone": "15888888888",
// "email": "ry@qq.com",
// "status": "0",
// "delFlag": "0",
// "parentName": null,
// "children": []
// },
// {
// "createBy": 1,
// "createTime": "2023-09-29 11:47:27",
// "updateBy": null,
// "updateTime": null,
// "deptId": 103,
// "parentId": 101,
// "ancestors": "0,100,101",
// "deptName": "",
// "orderNum": 1,
// "leader": "muyu",
// "phone": "15888888888",
// "email": "ry@qq.com",
// "status": "0",
// "delFlag": "0",
// "parentName": null,
// "children": []
// },
// ]
this.deptList = this.handleTree(response.data, "deptId");
this.userList = [
{
@ -341,5 +203,6 @@ export default {
]
}
},
};
</script>

View File

@ -1,36 +1,37 @@
<template>
<div class="app-container">
<h4 class="form-header h4">基本信息</h4>
<el-form ref="form" :model="baseInfo" label-width="120px">
{{DataSource}}
<el-form ref="form" :model="DataSource" label-width="120px">
<el-row>
<el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/>
<el-input v-model="DataSource.name" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/>
<el-input v-model="DataSource.systemName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/>
<el-input v-model="DataSource.databaseName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表名称" prop="nickName">
<el-input v-model="baseInfo.tableName" disabled/>
<el-input v-model="DataSource.tableName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="表中文名" prop="nickName">
<el-input v-model="baseInfo.tableAsName" disabled/>
<el-input v-model="DataSource.tableAsName" disabled/>
</el-form-item>
</el-col>
<el-col :offset="2" :span="8">
<el-form-item label="数据量" prop="nickName">
<el-input v-model="baseInfo.total" disabled/>
<el-input v-model="DataSource.total" disabled/>
</el-form-item>
</el-col>
</el-row>
@ -99,9 +100,14 @@
<script>
import { parseTime } from '@/utils/muyu'
import { listDept } from '@/api/system/dept'
import { selectDept } from '@/api/kvt/kvt'
export default {
name: "AuthTable",
props: [
"DataSource"
],
data() {
return {
//
@ -129,7 +135,10 @@ export default {
created() {
this.loading = true;
setTimeout(() => this.loading = false, 200)
this.init()
// this.init()
},
mounted() {
this.selectDept()
},
methods: {
parseTime,
@ -138,187 +147,24 @@ export default {
"code": 200,
"msg": "操作成功",
"data": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 100,
"parentId": 0,
"ancestors": "0",
"deptName": "muyu牧鱼科技",
"orderNum": 0,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 101,
"parentId": 100,
"ancestors": "0,100",
"deptName": "深圳总公司",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 102,
"parentId": 100,
"ancestors": "0,100",
"deptName": "长沙分公司",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 103,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "研发部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 104,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "市场部门",
"isAuth": true,
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 105,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "测试部门",
"orderNum": 3,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 106,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "财务部门",
"orderNum": 4,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 107,
"parentId": 101,
"ancestors": "0,100,101",
"deptName": "运维部门",
"orderNum": 5,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 108,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "市场部门",
"orderNum": 1,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"deptId": 109,
"parentId": 102,
"ancestors": "0,100,102",
"deptName": "财务部门",
"orderNum": 2,
"leader": "muyu牧鱼",
"phone": "15888888888",
"email": "ry@qq.com",
"status": "0",
"delFlag": "0",
"parentName": null,
"children": []
}
// {
// "createBy": 1,
// "createTime": "2023-09-29 11:47:27",
// "updateBy": null,
// "updateTime": null,
// "deptId": 100,
// "parentId": 0,
// "ancestors": "0",
// "deptName": "muyu",
// "orderNum": 0,
// "leader": "muyu",
// "phone": "15888888888",
// "email": "ry@qq.com",
// "status": "0",
// "delFlag": "0",
// "parentName": null,
// "children": []
// }
]
}
this.deptList = this.handleTree(response.data, "deptId");
@ -357,6 +203,12 @@ export default {
}
}
]
},
selectDept(){
listDept().then(res => {
console.log(res)
this.deptList = res.date
})
}
},
};

View File

@ -7,16 +7,16 @@
lazy
@node-click="(data) => showAuth=data.type"
:props="defaultProps">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+')' }}</div>
<div class="custom-tree-node" @click="selectDepartmen(data.databaseName)" slot-scope="{ node, data }">
<div v-if="data.type === 1">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
<div v-if="data.type === 2">{{ data.name + '-'+data.as + '(' + data.dataTotal+')' }}</div>
</div>
</el-tree>
</el-aside>
<el-container>
<el-main>
<auth-data-source v-if="showAuth === 'dataSource'"/>
<auth-table v-else-if="showAuth === 'dataTable'"/>
<auth-data-source v-if="showAuth === 1" v-bind:DataSource="assetStructureList"/>
<auth-table v-else-if="showAuth === 2" v-bind:DataSource="assetStructureList"/>
</el-main>
</el-container>
</el-container>
@ -25,6 +25,7 @@
import AuthDataSource from './auth/AuthDataSource.vue'
import AuthTable from './auth/AuthTable.vue'
import { selectDataSource, selectDepartmen } from '@/api/kvt/kvt'
export default {
name: 'assetStructure',
@ -37,58 +38,70 @@ export default {
label: 'name'
},
showAuth: null,
assertChild:[
{
name :"",
//
systemName: "",
//
databaseName: "",
tableName: "",
as:"",
dataTotal: 0
}
],
assetStructureList: [
{
name: "测试1",
systemName: "云计算系统",
databaseName: "yunjisuan",
type: "dataSource"
},
{
name: "测试2",
systemName: "网站系统",
databaseName: "wangzhan",
type: "dataSource"
},
{
name: "测试3",
systemName: "物联网系统",
databaseName: "wulianwang",
type: "dataSource"
},
{
name: "测试4",
systemName: "传媒系统",
databaseName: "chuanmei",
type: "dataSource"
},
// {
// name: "1",
// 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: []
}
// {
// 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: []
// }
]
}
},
created() {
this.selectDataSource()
},
methods: {
//
selectDepartmen(databaseName){
selectDepartmen(databaseName).then(res => {
console.log(res)
this.childrenList = res.data
console.log("res",this.assertChild)
})
},
//
selectDataSource(){
selectDataSource().then(res => {
this.assetStructureList = res.data
})
},
expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList);
const {data} = node;