Commit e20ed67b authored by nick zheng's avatar nick zheng

chore: 问答知识库分片表格列表调整&&删除逻辑调整

parent af4a819c
...@@ -147,6 +147,7 @@ common_module: ...@@ -147,6 +147,7 @@ common_module:
download_fail: 'Download failed' download_fail: 'Download failed'
unfold: 'Unfold' unfold: 'Unfold'
fold: 'Fold' fold: 'Fold'
function: 'Function'
dialogue_module: dialogue_module:
continue_question_message: 'You can keep asking questions' continue_question_message: 'You can keep asking questions'
......
...@@ -146,6 +146,7 @@ common_module: ...@@ -146,6 +146,7 @@ common_module:
download_fail: '下载失败' download_fail: '下载失败'
unfold: '展开' unfold: '展开'
fold: '收起' fold: '收起'
function: '功能'
dialogue_module: dialogue_module:
continue_question_message: '你可以继续提问' continue_question_message: '你可以继续提问'
......
...@@ -146,6 +146,7 @@ common_module: ...@@ -146,6 +146,7 @@ common_module:
download_fail: '下載失敗' download_fail: '下載失敗'
unfold: '展開' unfold: '展開'
fold: '收起' fold: '收起'
function: '功能'
dialogue_module: dialogue_module:
continue_question_message: '你可以繼續提問' continue_question_message: '你可以繼續提問'
......
...@@ -62,14 +62,14 @@ export function createQAKnowledgeChunkColumn( ...@@ -62,14 +62,14 @@ export function createQAKnowledgeChunkColumn(
} }
}), }),
{ {
title: '', title: () => <span class='font-family-medium pl-1.5'>{t('common_module.function')}</span>,
key: 'action', key: 'action',
align: '', align: 'left',
fixed: 'right', fixed: 'right',
width: 0, width: 200,
render(row: QAKnowledgeChunkContentItem) { render(row: QAKnowledgeChunkContentItem) {
return ( return (
<div class='top-4.5 flex-center absolute right-[24px] z-10 gap-[10px]'> <div class='flex-center gap-[10px]'>
<NPopover <NPopover
v-slots={{ v-slots={{
trigger: () => ( trigger: () => (
......
...@@ -73,7 +73,7 @@ const knowledgeChunkColumn = computed(() => { ...@@ -73,7 +73,7 @@ const knowledgeChunkColumn = computed(() => {
}) })
const dataTableScrollX = computed(() => { const dataTableScrollX = computed(() => {
return chunkKeyList.value.length * 246 + 40 + 92 return chunkKeyList.value.length * 246 + 40 + 92 + 200
}) })
const tableContentY = computed(() => { const tableContentY = computed(() => {
...@@ -287,6 +287,11 @@ async function handleDeleteQAKnowledgeChunk(chunkRelationId: string) { ...@@ -287,6 +287,11 @@ async function handleDeleteQAKnowledgeChunk(chunkRelationId: string) {
if (res.code === 0) { if (res.code === 0) {
window.$message.success(t('common_module.delete_success_message')) window.$message.success(t('common_module.delete_success_message'))
if (knowledgeChunkList.value.length <= 1 && paginationData.pageNo === paginationData.totalPages) {
paginationData.pageNo = paginationData.pageNo - 1 || 1
}
await handleQAKnowledgeChunkList() await handleQAKnowledgeChunkList()
} }
}) })
...@@ -329,6 +334,13 @@ function handleBatchDeleteKnowledgeChunk() { ...@@ -329,6 +334,13 @@ function handleBatchDeleteKnowledgeChunk() {
}) })
if (res.code === 0) { if (res.code === 0) {
if (
knowledgeChunkList.value.length <= checkedChunkIdList.value.length &&
paginationData.pageNo === paginationData.totalPages
) {
paginationData.pageNo = paginationData.pageNo - 1 || 1
}
window.$message.success(t('common_module.delete_success_message')) window.$message.success(t('common_module.delete_success_message'))
checkedChunkIdList.value = [] checkedChunkIdList.value = []
await userStore.fetchUpdateEquityInfo() await userStore.fetchUpdateEquityInfo()
...@@ -462,20 +474,7 @@ function handleBatchDeleteKnowledgeChunk() { ...@@ -462,20 +474,7 @@ function handleBatchDeleteKnowledgeChunk() {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.qa-knowledge-chunk-selection.n-data-table-td .n-checkbox) {
margin-top: 46px;
}
:deep(.qa-knowledge-chunk-index.n-data-table-td) {
padding-top: 56px;
}
:deep(.qa-knowledge-chunk-item.n-data-table-td) { :deep(.qa-knowledge-chunk-item.n-data-table-td) {
padding-top: 56px;
vertical-align: top; vertical-align: top;
} }
:deep(.n-data-table-tr) {
position: relative;
}
</style> </style>
...@@ -146,6 +146,7 @@ declare namespace I18n { ...@@ -146,6 +146,7 @@ declare namespace I18n {
download_fail: string download_fail: string
unfold: string unfold: string
fold: string fold: string
function: string
dialogue_module: { dialogue_module: {
continue_question_message: string continue_question_message: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment