mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: optimize image Excel ID extraction logic in common_handle.py
--bug=1064254 --user=刘瑞斌 【github#4430】Excel里带图片的数据超过5行上传后不显示图片 https://www.tapd.cn/62980211/s/1807666
This commit is contained in:
parent
31f230629b
commit
e1a12c8684
|
|
@ -105,9 +105,17 @@ def xlsx_embed_cells_images(buffer) -> {}:
|
|||
cell_images_xml[cnv] = cell_images_rel.get(embed)
|
||||
result = {}
|
||||
for key, img in cell_images_xml.items():
|
||||
image_excel_id_list = [_xl for _xl in
|
||||
reduce(lambda x, y: [*x, *y], [sheet for sheet_id, sheet in sheet_list.items()], []) if
|
||||
key in _xl]
|
||||
all_cells = [
|
||||
cell
|
||||
for _sheet_id, sheet in sheet_list.items()
|
||||
if sheet is not None
|
||||
for cell in sheet or []
|
||||
]
|
||||
|
||||
image_excel_id_list = [
|
||||
cell for cell in all_cells
|
||||
if isinstance(cell, str) and key in cell
|
||||
]
|
||||
# print(key, img)
|
||||
if img is None:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in New Issue