fix(ui): 修复表格组件中对本地图片的显示问题 (#2047)
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled

- 在 ImageCell 中添加对 Path 类型的支持,并在验证器中处理路径解析
- 优化 ShopManage 和 SignManage 类中的代码,使用新的 ImageCell 构造方式
- 更新 TableData 类中的注释,提高代码可读性
This commit is contained in:
molanp
2025-09-09 15:01:45 +08:00
committed by GitHub
parent 6940c2f37b
commit fb0a9813e1
3 changed files with 37 additions and 24 deletions
+7 -7
View File
@@ -132,7 +132,7 @@ async def gold_rank(session: Uninfo, group_id: str | None, num: int) -> bytes |
else TextCell(content=""),
TextCell(content=uid2name.get(user[0]) or user[0]),
TextCell(content=str(user[1]), bold=True),
ImageCell(src=platform_path.resolve().as_uri())
ImageCell(src=platform_path)
if (platform_path := PLATFORM_PATH.get(platform))
else TextCell(content=""),
]
@@ -532,15 +532,15 @@ class ShopManage:
icon = ""
if prop.icon:
icon_path = ICON_PATH / prop.icon
icon = (icon_path, 33, 33) if icon_path.exists() else ""
icon = icon_path if icon_path.exists() else ""
table_rows.append(
[
icon,
i,
prop.goods_name,
user.props[prop_uuid],
prop.goods_description,
ImageCell(src=icon, height=33, width=33),
TextCell(content=i),
TextCell(content=prop.goods_name),
TextCell(content=user.props[prop_uuid]),
TextCell(content=prop.goods_description),
]
)
@@ -91,7 +91,7 @@ class SignManage:
TextCell(content=uid2name.get(user[0]) or user[0]),
TextCell(content=str(user[1]), bold=True),
TextCell(content=str(user[2])),
ImageCell(src=platform_path.resolve().as_uri())
ImageCell(src=platform_path)
if (platform_path := PLATFORM_PATH.get(platform))
else TextCell(content=""),
]