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
dd3d61a6
Commit
dd3d61a6
authored
Apr 29, 2025
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(知识库管理): 对接接口&&多语言
parent
abf6965e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
personal-space.vue
src/views/personal-space/personal-space.vue
+23
-3
No files found.
src/views/personal-space/personal-space.vue
View file @
dd3d61a6
...
...
@@ -8,6 +8,8 @@ import CreateKnowledgeModal, {
}
from
'./personal-knowledge/components/create-knowledge-modal.vue'
import
CreateDatabaseModal
from
'./personal-database/components/create-database-modal.vue'
import
{
fetchCreateKnowledge
}
from
'@/apis/knowledge'
import
{
fetchCreateDataBase
}
from
'@/apis/database'
import
{
DatabaseItemInterface
}
from
'./personal-database/type'
const
{
t
}
=
useI18n
()
...
...
@@ -27,7 +29,7 @@ const personalSpaceModuleList = [
},
{
routeName
:
'PersonalSpaceDatabase'
,
label
:
'
数据库
'
,
label
:
'
common_module.database
'
,
},
]
...
...
@@ -44,7 +46,7 @@ const addPersonalSpaceOptions = readonly([
icon
:
()
=>
h
(
NotebookOne
,
{
theme
:
'outline'
,
size
:
16
,
fill
:
'#333'
}),
},
{
label
:
()
=>
h
(
'span'
,
{},
'数据库'
),
label
:
()
=>
h
(
'span'
,
{},
t
(
'common_module.database'
)
),
key
:
'addDatabase'
,
icon
:
()
=>
h
(
DatabaseSetting
,
{
theme
:
'outline'
,
size
:
16
,
fill
:
'#333'
}),
},
...
...
@@ -54,6 +56,7 @@ const showCreateKnowledgeModal = ref(false)
const
createKnowledgeBtnLoading
=
ref
(
false
)
const
showCreateDatabaseModal
=
ref
(
false
)
const
createDatabaseBtnLoading
=
ref
(
false
)
watch
(
()
=>
currentRoute
.
fullPath
,
...
...
@@ -102,6 +105,19 @@ async function handleCreateKnowledgeNextStep(createKnowledgeData: KnowledgeFormD
showCreateKnowledgeModal
.
value
=
false
}
}
async
function
handleCreateDatabase
(
databaseData
:
Omit
<
DatabaseItemInterface
,
'id'
|
'modifiedTime'
>
)
{
createDatabaseBtnLoading
.
value
=
true
const
res
=
await
fetchCreateDataBase
(
databaseData
).
finally
(()
=>
{
createDatabaseBtnLoading
.
value
=
false
})
if
(
res
.
code
===
0
)
{
showCreateDatabaseModal
.
value
=
false
router
.
push
({
name
:
'PersonalSpaceDatabase'
})
}
}
</
script
>
<
template
>
...
...
@@ -154,7 +170,11 @@ async function handleCreateKnowledgeNextStep(createKnowledgeData: KnowledgeFormD
@
confirm=
"handleCreateKnowledgeNextStep"
/>
<CreateDatabaseModal
v-model:show-modal=
"showCreateDatabaseModal"
/>
<CreateDatabaseModal
v-model:show-modal=
"showCreateDatabaseModal"
:btn-loading=
"createDatabaseBtnLoading"
@
confirm=
"handleCreateDatabase"
/>
</div>
</
template
>
...
...
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