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
d65bcde3
Commit
d65bcde3
authored
Mar 12, 2025
by
nick zheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beta' into 'master'
chore: 问答知识库分片增加字数检验 See merge request
!180
parents
eb631fd0
77c8748e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
11 deletions
+47
-11
en.yaml
src/locales/langs/en.yaml
+2
-1
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+3
-2
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+3
-2
add-qa-knowledge-chunk-modal.vue
.../qa-knowledge/components/add-qa-knowledge-chunk-modal.vue
+21
-3
edit-qa-knowledge-chunk-modal.vue
...qa-knowledge/components/edit-qa-knowledge-chunk-modal.vue
+17
-3
locales.d.ts
types/locales.d.ts
+1
-0
No files found.
src/locales/langs/en.yaml
View file @
d65bcde3
...
...
@@ -521,7 +521,8 @@ personal_space_module:
add_QA
:
'
Add
Q&A'
add_QA_data
:
'
Add
Q&A
data'
edit_QA_data
:
'
Edit
Q&A
data'
limit_max_chunk_content_length
:
'
The
number
of
words
in
a
single
cell
cannot
exceed
300
words.
Excess
words
will
be
automatically
cleared'
limit_max_chunk_content_length
:
'
Each
item
should
be
no
more
than
850
words,
and
the
total
number
of
words
should
not
exceed
3000
words.
(Current
word
count:
{count})'
exceed_max_chunk_content_length
:
'
The
total
number
of
words
could
not
exceed
3000
words,
please
shorten
the
content
to
less
than
3000
words'
setting_index_desc
:
'
The
index
is
an
important
key
field
of
the
knowledge
base
search
slice.
Select
at
least
one
field
as
the
index.'
select_at_least_one_field_as_the_index
:
'
Select
at
least
one
field
as
the
index'
setting_index
:
'
Setting
Index'
...
...
src/locales/langs/zh-cn.yaml
View file @
d65bcde3
...
...
@@ -144,7 +144,7 @@ common_module:
download
:
'
下载'
download_success
:
'
下载成功'
download_fail
:
'
下载失败'
unfold
:
'
展开'
unfold
:
'
展开'
fold
:
'
收起'
dialogue_module
:
...
...
@@ -519,7 +519,8 @@ personal_space_module:
add_QA
:
'
新建问答'
add_QA_data
:
'
添加问答数据'
edit_QA_data
:
'
编辑问答数据'
limit_max_chunk_content_length
:
'
单个单元格字数不可超300字,多余字数将自动清除'
limit_max_chunk_content_length
:
'
每项内容请控制在850字以内,且所有内容总字数不超过3000字。(当前字数:{count}字)'
exceed_max_chunk_content_length
:
'
总字数不可超过3000字,请将内容缩短至3000字以内'
setting_index_desc
:
'
索引是知识库检索切片的重要关键字段,至少选择1个字段作为索引'
select_at_least_one_field_as_the_index
:
'
至少选择1个字段作为索引'
setting_index
:
'
设置索引'
...
...
src/locales/langs/zh-hk.yaml
View file @
d65bcde3
...
...
@@ -144,7 +144,7 @@ common_module:
download
:
'
下載'
download_success
:
'
下載成功'
download_fail
:
'
下載失敗'
unfold
:
'
展開'
unfold
:
'
展開'
fold
:
'
收起'
dialogue_module
:
...
...
@@ -519,7 +519,8 @@ personal_space_module:
add_QA
:
'
新建問答'
add_QA_data
:
'
添加問答數據'
edit_QA_data
:
'
編輯問答數據'
limit_max_chunk_content_length
:
'
單個單元格字數不可超300字,多餘字數將自動清除'
limit_max_chunk_content_length
:
'
每項內容請控制在850字以內,且所有內容總字數不超過3000字。(當前字數:{count}字)'
exceed_max_chunk_content_length
:
'
總字數不可超過3000字,請將內容縮短至3000字以內'
setting_index_desc
:
'
索引是知識庫檢索切片的重要關鍵字段,至少選擇1個字段作為索引'
select_at_least_one_field_as_the_index
:
'
至少選擇1個字段作為索引'
setting_index
:
'
設置索引'
...
...
src/views/personal-space/personal-knowledge/knowledge-detail/qa-knowledge/components/add-qa-knowledge-chunk-modal.vue
View file @
d65bcde3
...
...
@@ -37,6 +37,16 @@ const dataTableScrollX = computed(() => {
return
props
.
knowledgeChunkKeyList
.
length
*
215
})
const
currentWordCount
=
computed
(()
=>
{
return
chunkStructList
.
value
.
reduce
((
acc
,
cur
)
=>
{
return
acc
+
cur
.
content
.
length
},
0
)
})
const
isExceedWordCount
=
computed
(()
=>
{
return
currentWordCount
.
value
>
3000
})
watch
(
()
=>
isShow
.
value
,
(
newVal
)
=>
{
...
...
@@ -49,6 +59,10 @@ watch(
)
function
handleAddKnowledgeChunk
()
{
if
(
isExceedWordCount
.
value
)
{
return
}
knowledgeChunkFormRef
.
value
?.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
const
newChunkStructInfo
=
chunkStructList
.
value
.
map
((
chunkItem
)
=>
{
...
...
@@ -73,6 +87,10 @@ function handleAddKnowledgeChunk() {
@
confirm=
"handleAddKnowledgeChunk"
>
<template
#
content
>
<p
class=
"text-gray-font-color mb-2.5"
>
{{
t
(
'personal_space_module.knowledge_module.limit_max_chunk_content_length'
,
{
count
:
currentWordCount
}
)
}}
<
/p
>
<
n
-
scrollbar
x
-
scrollable
>
<
n
-
form
ref
=
"knowledgeChunkFormRef"
...
...
@@ -115,15 +133,15 @@ function handleAddKnowledgeChunk() {
minRows: 4,
maxRows: 4,
}
"
:maxlength=
"
30
0"
:
maxlength
=
"
85
0"
/>
<
/div
>
<
/n-form-item
>
<
/n-form
>
<
/n-scrollbar
>
<p
class=
"text-gray-font-color mt-2
"
>
{{ t('personal_space_module.knowledge_module.
limit
_max_chunk_content_length') }}
<
p
v
-
show
=
"isExceedWordCount"
class
=
"mt-2 text-[#D03050]
"
>
{{
t
(
'personal_space_module.knowledge_module.
exceed
_max_chunk_content_length'
)
}}
<
/p
>
<
/template
>
<
/CustomModal
>
...
...
src/views/personal-space/personal-knowledge/knowledge-detail/qa-knowledge/components/edit-qa-knowledge-chunk-modal.vue
View file @
d65bcde3
...
...
@@ -38,6 +38,16 @@ const dataTableScrollX = computed(() => {
return
props
.
knowledgeChunkKeyList
.
length
*
215
})
const
currentWordCount
=
computed
(()
=>
{
return
chunkStructList
.
value
.
reduce
((
acc
,
cur
)
=>
{
return
acc
+
cur
.
content
.
length
},
0
)
})
const
isExceedWordCount
=
computed
(()
=>
{
return
currentWordCount
.
value
>
3000
})
watch
(
()
=>
isShow
.
value
,
(
newVal
)
=>
{
...
...
@@ -79,6 +89,10 @@ function handleAddKnowledgeChunk() {
@
confirm=
"handleAddKnowledgeChunk"
>
<template
#
content
>
<p
class=
"text-gray-font-color mb-2.5"
>
{{
t
(
'personal_space_module.knowledge_module.limit_max_chunk_content_length'
,
{
count
:
currentWordCount
}
)
}}
<
/p
>
<
n
-
scrollbar
x
-
scrollable
>
<
n
-
form
ref
=
"knowledgeChunkFormRef"
...
...
@@ -121,15 +135,15 @@ function handleAddKnowledgeChunk() {
minRows: 4,
maxRows: 4,
}
"
:maxlength=
"
30
0"
:
maxlength
=
"
85
0"
/>
<
/div
>
<
/n-form-item
>
<
/n-form
>
<
/n-scrollbar
>
<p
class=
"text-gray-font-color mt-2
"
>
{{ t('personal_space_module.knowledge_module.
limit
_max_chunk_content_length') }}
<
p
v
-
show
=
"isExceedWordCount"
class
=
"mt-2 text-[#D03050]
"
>
{{
t
(
'personal_space_module.knowledge_module.
exceed
_max_chunk_content_length'
)
}}
<
/p
>
<
/template
>
<
/CustomModal
>
...
...
types/locales.d.ts
View file @
d65bcde3
...
...
@@ -527,6 +527,7 @@ declare namespace I18n {
add_QA_data
:
string
edit_QA_data
:
string
limit_max_chunk_content_length
:
string
exceed_max_chunk_content_length
:
string
setting_index_desc
:
string
select_at_least_one_field_as_the_index
:
string
setting_index
:
string
...
...
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