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' method: 'post'
}) })
} }
//查询所有部门列表
export function selectDept() {
return request({
url: '/kvt/kvt/selectDept',
method: 'post'
})
}

View File

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

View File

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

View File

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

View File

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

View File

@ -16,8 +16,8 @@
<el-container> <el-container>
<el-main> <el-main>
<OverallAssets v-if="showAssets == null"/> <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-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:dataStr="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-main>
</el-container> </el-container>

View File

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

View File

@ -1,36 +1,37 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<h4 class="form-header h4">基本信息</h4> <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-row>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据接入名称" prop="nickName"> <el-form-item label="数据接入名称" prop="nickName">
<el-input v-model="baseInfo.name" disabled/> <el-input v-model="DataSource.name" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="系统名称" prop="userName"> <el-form-item label="系统名称" prop="userName">
<el-input v-model="baseInfo.systemName" disabled/> <el-input v-model="DataSource.systemName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据库名称" prop="nickName"> <el-form-item label="数据库名称" prop="nickName">
<el-input v-model="baseInfo.databaseName" disabled/> <el-input v-model="DataSource.databaseName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="表名称" prop="nickName"> <el-form-item label="表名称" prop="nickName">
<el-input v-model="baseInfo.tableName" disabled/> <el-input v-model="DataSource.tableName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="表中文名" prop="nickName"> <el-form-item label="表中文名" prop="nickName">
<el-input v-model="baseInfo.tableAsName" disabled/> <el-input v-model="DataSource.tableAsName" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :offset="2" :span="8"> <el-col :offset="2" :span="8">
<el-form-item label="数据量" prop="nickName"> <el-form-item label="数据量" prop="nickName">
<el-input v-model="baseInfo.total" disabled/> <el-input v-model="DataSource.total" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -99,9 +100,14 @@
<script> <script>
import { parseTime } from '@/utils/muyu' import { parseTime } from '@/utils/muyu'
import { listDept } from '@/api/system/dept'
import { selectDept } from '@/api/kvt/kvt'
export default { export default {
name: "AuthTable", name: "AuthTable",
props: [
"DataSource"
],
data() { data() {
return { return {
// //
@ -129,7 +135,10 @@ export default {
created() { created() {
this.loading = true; this.loading = true;
setTimeout(() => this.loading = false, 200) setTimeout(() => this.loading = false, 200)
this.init() // this.init()
},
mounted() {
this.selectDept()
}, },
methods: { methods: {
parseTime, parseTime,
@ -138,187 +147,24 @@ export default {
"code": 200, "code": 200,
"msg": "操作成功", "msg": "操作成功",
"data": [ "data": [
{ // {
"createBy": 1, // "createBy": 1,
"createTime": "2023-09-29 11:47:27", // "createTime": "2023-09-29 11:47:27",
"updateBy": null, // "updateBy": null,
"updateTime": null, // "updateTime": null,
"deptId": 100, // "deptId": 100,
"parentId": 0, // "parentId": 0,
"ancestors": "0", // "ancestors": "0",
"deptName": "muyu牧鱼科技", // "deptName": "muyu",
"orderNum": 0, // "orderNum": 0,
"leader": "muyu牧鱼", // "leader": "muyu",
"phone": "15888888888", // "phone": "15888888888",
"email": "ry@qq.com", // "email": "ry@qq.com",
"status": "0", // "status": "0",
"delFlag": "0", // "delFlag": "0",
"parentName": null, // "parentName": null,
"children": [] // "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": []
}
] ]
} }
this.deptList = this.handleTree(response.data, "deptId"); 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 lazy
@node-click="(data) => showAuth=data.type" @node-click="(data) => showAuth=data.type"
:props="defaultProps"> :props="defaultProps">
<div class="custom-tree-node" slot-scope="{ node, data }"> <div class="custom-tree-node" @click="selectDepartmen(data.databaseName)" slot-scope="{ node, data }">
<div v-if="data.type === 'dataSource'">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div> <div v-if="data.type === 1">{{ data.name + '('+data.databaseName + '-' + data.systemName+')' }}</div>
<div v-if="data.type === 'dataTable'">{{ data.name + '-'+data.as + '(' + data.dataTotal+')' }}</div> <div v-if="data.type === 2">{{ data.name + '-'+data.as + '(' + data.dataTotal+')' }}</div>
</div> </div>
</el-tree> </el-tree>
</el-aside> </el-aside>
<el-container> <el-container>
<el-main> <el-main>
<auth-data-source v-if="showAuth === 'dataSource'"/> <auth-data-source v-if="showAuth === 1" v-bind:DataSource="assetStructureList"/>
<auth-table v-else-if="showAuth === 'dataTable'"/> <auth-table v-else-if="showAuth === 2" v-bind:DataSource="assetStructureList"/>
</el-main> </el-main>
</el-container> </el-container>
</el-container> </el-container>
@ -25,6 +25,7 @@
import AuthDataSource from './auth/AuthDataSource.vue' import AuthDataSource from './auth/AuthDataSource.vue'
import AuthTable from './auth/AuthTable.vue' import AuthTable from './auth/AuthTable.vue'
import { selectDataSource, selectDepartmen } from '@/api/kvt/kvt'
export default { export default {
name: 'assetStructure', name: 'assetStructure',
@ -37,58 +38,70 @@ export default {
label: 'name' label: 'name'
}, },
showAuth: null, showAuth: null,
assertChild:[
{
name :"",
//
systemName: "",
//
databaseName: "",
tableName: "",
as:"",
dataTotal: 0
}
],
assetStructureList: [ assetStructureList: [
{ // {
name: "测试1", // name: "1",
systemName: "云计算系统", // systemName: "",
databaseName: "yunjisuan", // databaseName: "yunjisuan",
type: "dataSource" // type: "dataSource"
}, // }
{
name: "测试2",
systemName: "网站系统",
databaseName: "wangzhan",
type: "dataSource"
},
{
name: "测试3",
systemName: "物联网系统",
databaseName: "wulianwang",
type: "dataSource"
},
{
name: "测试4",
systemName: "传媒系统",
databaseName: "chuanmei",
type: "dataSource"
},
], ],
childrenList: [ childrenList: [
{ // {
name: "sys_user", // name: "sys_user",
as: "用户表", // as: "",
dataTotal: 635847, // dataTotal: 635847,
type: "dataTable", // type: "dataTable",
childrenList: [] // childrenList: []
}, // },
{ // {
name: "sys_dept", // name: "sys_dept",
as: "部门表", // as: "",
dataTotal: 362548, // dataTotal: 362548,
type: "dataTable", // type: "dataTable",
childrenList: [] // childrenList: []
}, // },
{ // {
name: "sys_notice", // name: "sys_notice",
as: "通知公告", // as: "",
dataTotal: 6347, // dataTotal: 6347,
type: "dataTable", // type: "dataTable",
childrenList: [] // childrenList: []
} // }
] ]
} }
}, },
created() {
this.selectDataSource()
},
methods: { 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){ expandTable( node, resolve){
if (node.level === 0) return resolve(this.assetStructureList); if (node.level === 0) return resolve(this.assetStructureList);
const {data} = node; const {data} = node;