解决文件内文件列表不能删除的问题

This commit is contained in:
weiweiw 2025-02-20 18:06:39 +08:00
parent 7f57a4ede8
commit 39af20ed13
1 changed files with 11 additions and 11 deletions

View File

@ -406,8 +406,8 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
editable=True,
width=50,
wrapHeaderText=True,
cellEditor="agCheckboxCellEditor",
cellRender="agCheckboxCellRenderer",
cellEditor="agTextCellEditor",
cellRender="agTextCellRenderer",
)
# 启用分页
gb.configure_pagination(
@ -428,15 +428,15 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
changed_docs = []
for index, row in edit_docs.data.iterrows():
origin_doc = origin_docs[row["id"]]
if row["page_content"] != origin_doc["page_content"]:
if row["to_del"] not in ["Y", "y", 1]:
changed_docs.append(
{
"page_content": row["page_content"],
"type": row["type"],
"metadata": json.loads(row["metadata"]),
}
)
# if row["page_content"] != origin_doc["page_content"]:
if row["to_del"] not in ["Y", "y", 1]:
changed_docs.append(
{
"page_content": row["page_content"],
"type": row["type"],
"metadata": json.loads(row["metadata"]),
}
)
if changed_docs:
if api.update_kb_docs(