Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/src/views/VIEW_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ Action 仍通过上层 `action-dropdown/index.ts` 导出,弹窗仅在目录内
查询使用 `DocumentApi.getDocumentTags`,搜索使用单一 `MkSearchInput`,通过 `change` 将关键词作为 `name` 请求接口,清空时省略该参数;
查询前清除勾选,直接展示接口返回的分组,不再本地过滤。选择列和标签名单元格合并;
通过 `MkTable selection-group-key="key"` 联动组内标签值,已选数量按标签值行数统计;标签值列复用 `border-l!` 展示与合并标签列之间的分隔线。
删除调用 `putDeleteDocumentTags`,仅移除当前文档关联,不调用知识库标签删除接口。
单项及批量删除均直接调用 `putDeleteDocumentTags`,不弹二次确认;仅移除当前文档关联,不调用知识库标签删除接口。
`AddTagDialog.vue` 为标签列、抽屉与批量操作栏共用的下拉式添加弹窗,接收完整 Document API 和知识库 ID。
三个入口分别由 `DocumentTags`、`DocumentTagsDrawer`、`BatchDocumentTagsAction` 管理弹窗实例,不通过页面 Ref 打开。
候选项使用 `tagsApi.getKnowledgeTags`,按返回顺序截取前 100 个标签组,然后由 `el-select filterable` 本地搜索;
Expand Down Expand Up @@ -1010,7 +1010,7 @@ library 通过 `useKnowledgeLibraryContext` 装配现有文档、标签 API;Sy
对接口返回结果先按标签组分页,再展开各组标签值,分页总数为返回的标签组数。
`MkTable` 合并选择列和标签名,通过 `selection-group-key="key"` 联动当前页同组标签值;
批量底栏按实际选中标签值行数/当前页标签值总行数统计,不按标签组计数。
删除提交全部选中标签值 ID,确认框同时说明标签值数量、标签组数量及整组删除的影响。
删除提交全部选中标签值 ID,批量确认数量与底栏已选行数一致;标签、标签值及批量删除统一提示关联资源上的标签也会删除。
标签名旁提供新增值、编辑标签、删除标签;行末提供编辑值和删除值,
数量链接打开同目录 `TagDocumentDrawer.vue`。

Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/knowledge-detail/external-retrieval/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ onMounted(() => {
</div>
</Teleport>

<div v-loading="loading" class="w-full max-w-200 space-y-6 pb-6">
<div v-loading="loading" class="w-full max-w-200 space-y-4">
<div>
<div class="mb-2">
<span>身份认证</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { computed, nextTick, ref } from 'vue'
import type { TableColumnCtx } from 'element-plus'
import type DocumentApi from '@/api/admin/workspace/knowledge/document'
import type { KnowledgeTagGroup } from '@/api/types'
import { MsgConfirm, MsgSuccess } from '@/utils/message'
import { MsgSuccess } from '@/utils/message'
import AddTagDialog from './AddTagDialog.vue'

defineOptions({ name: 'DocumentTagsDrawer' })
Expand Down Expand Up @@ -31,7 +31,6 @@ const selectedTags = ref<DocumentTagRow[]>([])
const tagTableRef = ref<{ clearSelection: () => void }>()
const addTagRef = ref<InstanceType<typeof AddTagDialog>>()
const addTagMounted = ref(false)
const confirming = ref(false)

// 按接口返回的分组展开,勾选与删除始终按标签值 ID 处理。
const tagRows = computed<DocumentTagRow[]>(() =>
Expand Down Expand Up @@ -87,27 +86,17 @@ function handleTagsChanged() {
}

function handleDeleteTags(tags: DocumentTagRow[]) {
if (loading.value || operationLoading.value || !tags.length) return
const tagIds = tags.map(({ id }) => id)
const title = tags.length === 1 ? `是否移除标签:${tags[0]!.key}—${tags[0]!.value}?` : `是否移除选中的 ${tagIds.length} 个标签?`
confirming.value = true
return MsgConfirm(title, '删除后,使用该标签的资源将会删除该标签,请谨慎操作!')
.then(
() => {
operationLoading.value = true
return props.api
.putDeleteDocumentTags(targetKnowledgeId.value, targetDocumentId.value, tagIds)
.then(() => {
MsgSuccess('移除成功')
return handleTagsChanged()
})
.finally(() => {
operationLoading.value = false
})
},
() => {},
)
operationLoading.value = true
return props.api
.putDeleteDocumentTags(targetKnowledgeId.value, targetDocumentId.value, tagIds)
.then(() => {
MsgSuccess('移除成功')
return handleTagsChanged()
})
.finally(() => {
confirming.value = false
operationLoading.value = false
})
}

Expand Down
3 changes: 1 addition & 2 deletions ui/src/views/knowledge-detail/library/tags/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ function handleDeleteTag(row: TagTableRow, type: 'key' | 'one') {
const requestApi = requestSettingApi.value?.tags
if (!requestApi || loading.value || operationLoading.value) return
const tagName = type === 'key' ? row.key : `${row.key}—${row.value}`
const tip = type === 'key' ? '删除后使用该标签的资源将会删除该标签,请谨慎操作!' : '删除后使用该标签的资源将会删除该标签,请谨慎操作!'
return MsgConfirm(`是否删除标签:${tagName}?`, tip).then(
return MsgConfirm(`是否删除标签:${tagName}?`, '删除后,使用该标签的资源将会删除该标签,请谨慎操作!').then(
() => {
operationLoading.value = true
return requestApi
Expand Down
Loading