From 3897ad5b5382c82cf2f3e470bdc3c65438bda91e Mon Sep 17 00:00:00 2001 From: sunshine7058 <2564255161@qq.com> Date: Wed, 24 Apr 2024 22:24:35 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E6=A0=91=E7=BA=A7=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/source.js | 17 +- .../dashboard/OverallAssetStructure.vue | 150 +++++++----------- .../dashboard/OverallSpecificAssets.vue | 72 ++++++--- src/views/data/assetStructure/index.vue | 63 +++++--- src/views/data/source/index.vue | 18 +-- 5 files changed, 166 insertions(+), 154 deletions(-) diff --git a/src/api/data/source.js b/src/api/data/source.js index 3d5e29e..333427c 100644 --- a/src/api/data/source.js +++ b/src/api/data/source.js @@ -54,7 +54,7 @@ export function getConnect(data) { // 查询数据源 export function getAssetList() { return request({ - url: '/source/data/getAssetList', + url: '/data/source/getAssetList', method: 'get' }) } @@ -62,7 +62,7 @@ export function getAssetList() { // 查询数据库下的表 export function getChildrenList(data) { return request({ - url: '/source/data/getChildrenList', + url: '/data/source/getChildrenList', method: 'post', data: data }) @@ -71,7 +71,7 @@ export function getChildrenList(data) { // 添加表结构 export function addTableData(data) { return request({ - url: '/source/data/addTableData', + url: '/data/source/addTableData', method: 'post', data: data }) @@ -80,7 +80,7 @@ export function addTableData(data) { // 查询表结构 export function selectTableList() { return request({ - url: '/source/data/selectTableList', + url: '/data/source/selectTableList', method: 'get' }) } @@ -88,7 +88,14 @@ export function selectTableList() { // 查询表数据总数 export function selectTableDataCount() { return request({ - url: '/source/data/selectTableDataCount', + url: '/data/source/selectTableDataCount', + method: 'get' + }) +} +// 根据childrenId查询表结构 +export function selectTableData(id) { + return request({ + url: '/data/source/selectTableData/' + id, method: 'get' }) } diff --git a/src/views/data/assetStructure/dashboard/OverallAssetStructure.vue b/src/views/data/assetStructure/dashboard/OverallAssetStructure.vue index 164c218..d0b3b25 100644 --- a/src/views/data/assetStructure/dashboard/OverallAssetStructure.vue +++ b/src/views/data/assetStructure/dashboard/OverallAssetStructure.vue @@ -1,13 +1,13 @@ @@ -279,7 +302,8 @@ export default { } } } -.title-header{ + +.title-header { text-align: center; width: 100%; font-size: 46px; diff --git a/src/views/data/assetStructure/index.vue b/src/views/data/assetStructure/index.vue index 6c24c96..1902f33 100644 --- a/src/views/data/assetStructure/index.vue +++ b/src/views/data/assetStructure/index.vue @@ -12,15 +12,20 @@ data.name + '(' + data.databaseName + '-' + data.systemName + ')' }} -
{{ data.name + '-' + data.as + '(' + data.dataTotal + '条)' }}
+
{{ + data.name + '-' + data.annotation + '(' + data.dataTotal + '条)' + }} +
- - + + @@ -29,7 +34,13 @@ import OverallAssets from './dashboard/OverallAssets.vue' import OverallSpecificAssets from './dashboard/OverallSpecificAssets.vue' import OverallAssetStructure from './dashboard/OverallAssetStructure.vue' -import {addTableData, getAssetList, getChildrenList, selectTableDataCount, selectTableList} from "@/api/data/source"; +import { + addTableData, + getAssetList, + getChildrenList, getTableDataCount, + selectTableData, + selectTableDataCount +} from "@/api/data/source"; export default { name: 'assetStructure', @@ -44,6 +55,7 @@ export default { assetStructureList: [], childrenList: [], tableDataList: [], + childrenParams: null, showAssets: null, title: null, showTable: { @@ -63,25 +75,32 @@ export default { console.log(resolve) if (node.level === 0) return resolve(this.assetStructureList); const {data} = node; - getChildrenList(data).then(res => { - console.log(res) - this.childrenList = res.data - resolve(this.childrenList) - this.childrenList.forEach(children => { - this.showTable.assetStructure = data - this.showTable.tableName = children.name - addTableData(this.showTable).then(res => { - // console.log(res) + if (data.type === 'dataSource') { + getTableDataCount(data.id).then(res => { + this.count.assetStructureCount = res.data.assetStructureCount + this.count.assetStructureTableCount = res.data.assetStructureTableCount + this.count.assetStructureTableDataCount = res.data.assetStructureTableDataCount + }) + getChildrenList(data).then(res => { + console.log(res) + this.childrenList = res.data + resolve(this.childrenList) + this.childrenList.forEach(children => { + this.showTable.assetStructure = data + this.showTable.tableName = children.name + addTableData(this.showTable).then(res => { + // console.log(res) + }) }) }) - selectTableList().then(res => { - this.tableDataList = res.data - console.log(this.tableDataList) - }) - }) - this.showAssets = data.type; + } + // this.showAssets = data.type; if (data.type === 'dataTable') { console.log(data) + selectTableData(data.id).then(res => { + this.tableDataList = res.data + }) + this.childrenParams = data return resolve([]) } setTimeout(() => { @@ -91,6 +110,12 @@ export default { showAssetsFun(data) { this.title = data.name + '(' + data.databaseName + '-' + data.systemName + ')' this.showAssets = data.type; + if (data.type === "dataTable") { + this.childrenParams = data + selectTableData(data.id).then(res => { + this.tableDataList = res.data + }) + } }, getAssetStructureList() { getAssetList().then(res => { diff --git a/src/views/data/source/index.vue b/src/views/data/source/index.vue index e5fc1cf..61e8798 100644 --- a/src/views/data/source/index.vue +++ b/src/views/data/source/index.vue @@ -83,7 +83,7 @@ - + @@ -183,12 +183,12 @@ - + + v-for="dataType in databaseTypeList" + :key="dataType.databaseId" + :label="dataType.databaseName" + :value=" dataType.databaseName"> @@ -349,8 +349,8 @@ export default { }, //连接 handleconnect(row){ - const id = row.databaseType - getConnect(id).then(response=>{ + + getConnect(row).then(response=>{ console.log(response) if (response.data){ this.$message.success("测试成功") @@ -405,7 +405,7 @@ getDataBaseType() { name: null, systemName: null, databaseName: null, - databaseType: null, + dataType: null, host: null, port: null, user: null,