Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
8ded08e5
Commit
8ded08e5
authored
Apr 30, 2025
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(数据库): 数据表展示优化
parent
77caa441
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
database.ts
src/apis/database.ts
+1
-1
personal-db-table.vue
...ws/personal-space/personal-db-table/personal-db-table.vue
+16
-6
No files found.
src/apis/database.ts
View file @
8ded08e5
...
...
@@ -47,7 +47,7 @@ export function handleUpdateDataBase<T>(payload: object) {
* @returns 获取数据库详情
*/
export
function
fetchGetDataBaseDetail
<
T
>
(
id
:
string
)
{
return
request
.
post
<
T
>
(
`/databaseRest/get
Detail
.json?id=
${
id
}
`
)
return
request
.
post
<
T
>
(
`/databaseRest/get.json?id=
${
id
}
`
)
}
/**
...
...
src/views/personal-space/personal-db-table/personal-db-table.vue
View file @
8ded08e5
...
...
@@ -7,19 +7,20 @@ import useTableScrollY from '@/composables/useTableScrollY'
// import CustomPagination from '@/components/custom-pagination/custom-pagination.vue'
import
{
createDatabaseColumn
}
from
'./columns.tsx'
import
{
DBTableItemInterface
}
from
'./type'
import
{
fetchGetD
BTableList
}
from
'@/apis/database.ts'
import
{
fetchGetD
ataBaseDetail
}
from
'@/apis/database.ts'
import
{
useRoute
}
from
'vue-router'
const
{
t
}
=
useI18n
()
const
route
=
useRoute
()
const
{
pageContentWrapRef
,
tableContentY
}
=
useTableScrollY
(
46
+
48
)
const
{
pageContentWrapRef
,
tableContentY
}
=
useTableScrollY
(
46
+
48
+
33
)
// const { paginationData, handlePageNoChange, handlePageSizeChange } = usePagination()
// const searchDBTableInputValue = ref('')
const
isSearchEmptyList
=
ref
(
false
)
const
dbTableList
=
ref
<
DBTableItemInterface
[]
>
([])
const
dbTableListLoading
=
ref
(
true
)
const
dbTitle
=
ref
(
''
)
const
dbTableColumns
=
createDatabaseColumn
({
t
})
...
...
@@ -37,13 +38,16 @@ const emptyTableDataText = computed(() => {
})()
function
getDBTableList
()
{
fetchGetDBTableList
<
{
tableName
:
string
;
tableComment
:
string
;
tableRows
:
number
;
tableColumn
:
number
}[]
>
(
route
.
params
.
id
as
string
,
)
fetchGetDataBaseDetail
<
{
title
:
string
tableInfos
:
{
tableName
:
string
;
tableComment
:
string
;
tableRows
:
number
;
tableColumn
:
number
}[]
}
>
(
route
.
params
.
id
as
string
)
.
then
((
res
)
=>
{
if
(
res
.
code
!==
0
)
return
''
const
tableData
:
DBTableItemInterface
[]
=
res
.
data
.
map
((
dataItem
)
=>
{
dbTitle
.
value
=
res
.
data
.
title
const
tableData
:
DBTableItemInterface
[]
=
res
.
data
.
tableInfos
.
map
((
dataItem
)
=>
{
return
{
name
:
dataItem
.
tableName
,
docs
:
dataItem
.
tableComment
,
...
...
@@ -68,6 +72,12 @@ function getDBTableList() {
</
template
>
</n-input>
</div>
-->
<div
class=
"mb-[12px]"
>
<span
class=
"cursor-pointer select-none text-[14px]"
>
<i
class=
"iconfont icon-left mr-[6px] text-[12px]"
></i>
<span>
{{ dbTitle || '返回数据库列表' }}
</span>
</span>
</div>
<div
class=
"rounded-[10px] bg-white p-[23px]"
>
<n-data-table
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment