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
b358d39e
Commit
b358d39e
authored
Nov 14, 2024
by
tyyin lan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gitlab.gsstcloud.com:10022/poc/poc-fe
parents
5242c5cb
4981f775
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
26 deletions
+49
-26
app-setting.vue
...nal-space/personal-app-setting/components/app-setting.vue
+14
-1
document-detail.vue
...ews/personal-space/personal-knowledge/document-detail.vue
+35
-25
No files found.
src/views/personal-space/personal-app-setting/components/app-setting.vue
View file @
b358d39e
...
@@ -206,6 +206,10 @@ function handleUploadAvatarOversize() {
...
@@ -206,6 +206,10 @@ function handleUploadAvatarOversize() {
}
}
async
function
handleAIGenerateAgentAvatar
()
{
async
function
handleAIGenerateAgentAvatar
()
{
if
(
generateAgentAvatarLoading
.
value
||
!
personalAppConfig
.
value
.
baseInfo
.
agentTitle
)
{
return
}
generateAgentAvatarLoading
.
value
=
true
generateAgentAvatarLoading
.
value
=
true
generateAgentAvatarController
=
new
AbortController
()
generateAgentAvatarController
=
new
AbortController
()
...
@@ -223,6 +227,10 @@ async function handleAIGenerateAgentAvatar() {
...
@@ -223,6 +227,10 @@ async function handleAIGenerateAgentAvatar() {
}
}
async
function
handleAIGeneratePreamble
()
{
async
function
handleAIGeneratePreamble
()
{
if
(
generatePreambleLoading
.
value
)
{
return
}
!
commConfigExpandedNames
.
value
.
includes
(
'preamble'
)
&&
commConfigExpandedNames
.
value
.
push
(
'preamble'
)
!
commConfigExpandedNames
.
value
.
includes
(
'preamble'
)
&&
commConfigExpandedNames
.
value
.
push
(
'preamble'
)
generatePreambleLoading
.
value
=
true
generatePreambleLoading
.
value
=
true
...
@@ -252,6 +260,10 @@ async function handleAIGeneratePreamble() {
...
@@ -252,6 +260,10 @@ async function handleAIGeneratePreamble() {
}
}
async
function
handleAIGenerateFeaturedQuestions
()
{
async
function
handleAIGenerateFeaturedQuestions
()
{
if
(
generateFeaturedQuestionsLoading
.
value
)
{
return
}
!
commConfigExpandedNames
.
value
.
includes
(
'featuredQuestions'
)
&&
!
commConfigExpandedNames
.
value
.
includes
(
'featuredQuestions'
)
&&
commConfigExpandedNames
.
value
.
push
(
'featuredQuestions'
)
commConfigExpandedNames
.
value
.
push
(
'featuredQuestions'
)
...
@@ -278,6 +290,7 @@ async function handleSettingAgent(autoConfigInputValue: string) {
...
@@ -278,6 +290,7 @@ async function handleSettingAgent(autoConfigInputValue: string) {
await
handleCreateAgentTitleAndDesc
(
autoConfigInputValue
)
await
handleCreateAgentTitleAndDesc
(
autoConfigInputValue
)
.
then
(()
=>
{
.
then
(()
=>
{
personalAppFormRef
.
value
?.
validate
()
Promise
.
all
([
Promise
.
all
([
handleAIGenerateAgentAvatar
(),
handleAIGenerateAgentAvatar
(),
handleAIGeneratePreamble
(),
handleAIGeneratePreamble
(),
...
@@ -443,7 +456,7 @@ function handleStopGenerate() {
...
@@ -443,7 +456,7 @@ function handleStopGenerate() {
<div
<div
class=
"text-theme-color mt-3 flex h-[28px] items-center justify-between rounded-md border border-[#d4d6d9] px-2"
class=
"text-theme-color mt-3 flex h-[28px] items-center justify-between rounded-md border border-[#d4d6d9] px-2"
:class=
"
:class=
"
generateAgentAvatarLoading
generateAgentAvatarLoading
|| !personalAppConfig.baseInfo.agentTitle
? 'cursor-not-allowed opacity-50'
? 'cursor-not-allowed opacity-50'
: 'cursor-pointer hover:border-[#d4e5ff] hover:bg-[#e6f0ff]'
: 'cursor-pointer hover:border-[#d4e5ff] hover:bg-[#e6f0ff]'
"
"
...
...
src/views/personal-space/personal-knowledge/document-detail.vue
View file @
b358d39e
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
computed
,
onMounted
,
ref
,
watch
}
from
'vue'
import
{
computed
,
onMounted
,
ref
}
from
'vue'
import
{
useRouter
}
from
'vue-router'
import
{
useRouter
}
from
'vue-router'
import
{
useI18n
}
from
'vue-i18n'
import
{
useI18n
}
from
'vue-i18n'
import
{
ScrollbarInst
}
from
'naive-ui'
import
{
ScrollbarInst
}
from
'naive-ui'
...
@@ -23,7 +23,7 @@ const { t } = useI18n()
...
@@ -23,7 +23,7 @@ const { t } = useI18n()
const
router
=
useRouter
()
const
router
=
useRouter
()
const
{
paginationData
,
handlePageNoChange
,
handlePageSizeChange
}
=
usePagination
()
const
{
paginationData
}
=
usePagination
()
const
currentKdId
=
ref
(
0
)
const
currentKdId
=
ref
(
0
)
const
currentKnowledgeDocumentName
=
ref
(
''
)
const
currentKnowledgeDocumentName
=
ref
(
''
)
...
@@ -61,11 +61,6 @@ const emptyKnowledgeChunkListText = computed(() => {
...
@@ -61,11 +61,6 @@ const emptyKnowledgeChunkListText = computed(() => {
return
isSearchEmptyList
.
value
?
t
(
'common_module.search_empty_data'
)
:
t
(
'common_module.empty_data'
)
return
isSearchEmptyList
.
value
?
t
(
'common_module.search_empty_data'
)
:
t
(
'common_module.empty_data'
)
})
})
watch
([()
=>
paginationData
.
pageNo
,
()
=>
paginationData
.
pageSize
],
async
()
=>
{
await
handleGetKnowledgeChunkList
()
scrollBarRef
.
value
?.
scrollTo
({
top
:
0
})
})
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
if
(
!
router
.
currentRoute
.
value
.
params
.
kdId
)
{
if
(
!
router
.
currentRoute
.
value
.
params
.
kdId
)
{
window
.
$message
.
warning
(
t
(
'personal_space_module.knowledge_module.not_find_knowledge_document_message'
))
window
.
$message
.
warning
(
t
(
'personal_space_module.knowledge_module.not_find_knowledge_document_message'
))
...
@@ -201,6 +196,19 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
...
@@ -201,6 +196,19 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
chunkItem
.
isOpen
=
isOpen
===
'Y'
?
'N'
:
'Y'
chunkItem
.
isOpen
=
isOpen
===
'Y'
?
'N'
:
'Y'
}
}
}
}
async
function
handleGetKnowledgeChunkListUpdatePageNo
(
pageNo
:
number
)
{
paginationData
.
pageNo
=
pageNo
await
handleGetKnowledgeChunkList
()
scrollBarRef
.
value
?.
scrollTo
({
top
:
0
})
}
async
function
handleGetKnowledgeChunkListUpdatePageSize
(
pageSize
:
number
)
{
paginationData
.
pageNo
=
1
paginationData
.
pageSize
=
pageSize
await
handleGetKnowledgeChunkList
()
scrollBarRef
.
value
?.
scrollTo
({
top
:
0
})
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -247,22 +255,24 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
...
@@ -247,22 +255,24 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
</div>
</div>
<n-spin
:show=
"knowledgeChunkListLoading"
class=
"w-full flex-1 overflow-hidden"
content-class=
"flex w-full h-full"
>
<n-spin
:show=
"knowledgeChunkListLoading"
class=
"w-full flex-1 overflow-hidden"
content-class=
"flex w-full h-full"
>
<div
v-if=
"knowledgeChunkList.length && !knowledgeChunkListLoading"
class=
"flex flex-1"
>
<div
v-if=
"knowledgeChunkList.length"
class=
"flex flex-1"
>
<n-scrollbar
ref=
"scrollBarRef"
class=
"grid w-full flex-1 overflow-hidden"
>
<div
v-show=
"!knowledgeChunkListLoading"
class=
"flex flex-1"
>
<div
class=
"grid gap-5"
>
<n-scrollbar
ref=
"scrollBarRef"
class=
"grid w-full flex-1 overflow-hidden"
>
<KnowledgeChuckItem
<div
class=
"grid gap-5"
>
v-for=
"chunkItem in knowledgeChunkList"
<KnowledgeChuckItem
:key=
"chunkItem.chunkRelationId"
v-for=
"chunkItem in knowledgeChunkList"
:chunk-item=
"chunkItem"
:key=
"chunkItem.chunkRelationId"
:total-chunk=
"totalChunk"
:chunk-item=
"chunkItem"
@
edit=
"handleEditKnowledgeChunkModal"
:total-chunk=
"totalChunk"
@
up-add-chunk=
"handleShowUpAddChunkModal"
@
edit=
"handleEditKnowledgeChunkModal"
@
down-add-chunk=
"handleShowDownAddChunkModal"
@
up-add-chunk=
"handleShowUpAddChunkModal"
@
delete=
"handleDeleteKnowledgeChunk"
@
down-add-chunk=
"handleShowDownAddChunkModal"
@
update-open=
"handleUpdateOpenKnowledgeChunk"
@
delete=
"handleDeleteKnowledgeChunk"
/>
@
update-open=
"handleUpdateOpenKnowledgeChunk"
</div>
/>
</n-scrollbar>
</div>
</n-scrollbar>
</div>
</div>
</div>
<div
<div
...
@@ -282,8 +292,8 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
...
@@ -282,8 +292,8 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
<div
class=
"mt-4 flex justify-end"
>
<div
class=
"mt-4 flex justify-end"
>
<CustomPagination
<CustomPagination
:paging-info=
"paginationData"
:paging-info=
"paginationData"
@
update-page-no=
"handle
PageNoChange
"
@
update-page-no=
"handle
GetKnowledgeChunkListUpdatePageNo
"
@
update-page-size=
"handle
PageSizeChang
e"
@
update-page-size=
"handle
GetKnowledgeChunkListUpdatePageSiz
e"
/>
/>
</div>
</div>
...
...
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