mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-28 16:20:56 +08:00
🐛 style(shop): 修复道具仓库表格布局与样式 (#2100)
Co-authored-by: webjoin111 <455457521@qq.com>
This commit is contained in:
@@ -534,12 +534,16 @@ class ShopManage:
|
|||||||
icon = None
|
icon = None
|
||||||
if prop.icon:
|
if prop.icon:
|
||||||
icon_path = ICON_PATH / prop.icon
|
icon_path = ICON_PATH / prop.icon
|
||||||
icon = icon_path if icon_path.exists() else None
|
icon = (
|
||||||
|
ImageCell(src=icon_path.absolute().as_uri(), width=45, height=45)
|
||||||
|
if icon_path.exists()
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
|
||||||
table_rows.append(
|
table_rows.append(
|
||||||
[
|
[
|
||||||
icon,
|
icon,
|
||||||
i,
|
TextCell(content=str(i)),
|
||||||
prop.goods_name,
|
prop.goods_name,
|
||||||
user.props[prop_uuid],
|
user.props[prop_uuid],
|
||||||
prop.goods_description,
|
prop.goods_description,
|
||||||
@@ -553,6 +557,8 @@ class ShopManage:
|
|||||||
|
|
||||||
table = ui.table(f"{name}的道具仓库", "通过 使用道具[ID/名称] 令道具生效")
|
table = ui.table(f"{name}的道具仓库", "通过 使用道具[ID/名称] 令道具生效")
|
||||||
table.set_headers(column_name).add_rows(table_rows)
|
table.set_headers(column_name).add_rows(table_rows)
|
||||||
|
table.set_column_widths([70, 80, 150, 80, "auto"])
|
||||||
|
table.set_column_alignments(["center", "center", "left", "center", "left"])
|
||||||
return await ui.render(table)
|
return await ui.render(table)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from .models.components import (
|
|||||||
from .models.core import (
|
from .models.core import (
|
||||||
CardData,
|
CardData,
|
||||||
DetailsData,
|
DetailsData,
|
||||||
|
ImageCell,
|
||||||
LayoutData,
|
LayoutData,
|
||||||
ListData,
|
ListData,
|
||||||
MarkdownData,
|
MarkdownData,
|
||||||
@@ -29,6 +30,7 @@ from .models.core import (
|
|||||||
RenderableComponent,
|
RenderableComponent,
|
||||||
TableData,
|
TableData,
|
||||||
TemplateComponent,
|
TemplateComponent,
|
||||||
|
TextCell,
|
||||||
TextData,
|
TextData,
|
||||||
)
|
)
|
||||||
from .registry import component, create
|
from .registry import component, create
|
||||||
@@ -420,7 +422,9 @@ async def render_full_result(
|
|||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"DetailsData",
|
"DetailsData",
|
||||||
|
"ImageCell",
|
||||||
"ListData",
|
"ListData",
|
||||||
|
"TextCell",
|
||||||
"alert",
|
"alert",
|
||||||
"avatar",
|
"avatar",
|
||||||
"avatar_group",
|
"avatar_group",
|
||||||
|
|||||||
Reference in New Issue
Block a user