refactor(web): 重构英雄管理页面布局与交互

1. 将原侧边栏选择改为卡片列表首页视图,新增顶部计数和新建按钮
2. 重新设计英雄列表项,展示基础信息、属性、技能和触发效果
3. 重构编辑弹窗布局,适配移动端并优化交互流程
4. 新增多项数据展示辅助函数,优化页面信息展示
This commit is contained in:
pan
2026-09-04 11:01:18 +08:00
parent bf154a5bfd
commit 4e0ef5bccc
3 changed files with 330 additions and 140 deletions

View File

@@ -60,27 +60,105 @@ body {
overflow: hidden;
}
/* 英雄选择工具栏:下拉选择替代侧边栏列表,适配手机竖屏 */
.hero-toolbar {
/* 首页工具栏:计数 + 新建入口 */
.home-toolbar {
display: flex;
gap: 8px;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
background: var(--panel);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.hero-toolbar .hero-select { flex: 1; min-width: 0; }
.hero-option-meta {
float: right;
font-size: 11px;
color: var(--text-light);
}
.hero-editor {
/* 首页:一行一个英雄的列表布局 */
.hero-rows {
flex: 1;
overflow-y: auto;
padding: 16px 20px 40px;
padding: 12px 16px 40px;
display: flex;
flex-direction: column;
gap: 8px;
}
.hero-row {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 12px;
cursor: pointer;
transition: box-shadow 0.15s;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px 14px;
font-size: 12px;
}
.hero-row:hover { box-shadow: 0 3px 12px rgba(46, 91, 160, 0.15); }
/* 行首:uuid + 名称 + 星级 */
.row-main { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.row-uuid { font-family: Menlo, Consolas, monospace; color: var(--text-light); }
.row-name { font-size: 13px; font-weight: 600; }
.card-rarity { color: #f5a623; font-size: 11px; }
/* 三维徽章 */
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.stat {
background: #f0f7ef;
color: #4a7c3f;
border-radius: 4px;
padding: 0 6px;
font-size: 11px;
line-height: 18px;
}
/* 技能段:普攻/大招两行 */
.row-skills { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.skill-detail { color: var(--text-light); font-size: 11px; margin-left: 4px; }
/* 触发/光环/加成:chip 流式排布 */
.row-triggers { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1; min-width: 160px; }
.trigger-chip {
background: #eef4fc;
color: var(--brand);
border-radius: 4px;
padding: 0 6px;
font-size: 11px;
line-height: 18px;
}
.trigger-chip.aura { background: #f4f0fa; color: #7c5cbf; }
.row-comment {
width: 100%;
color: var(--text-light);
font-size: 11px;
border-top: 1px dashed var(--border);
padding-top: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tag {
display: inline-block;
background: #eef4fc;
color: var(--brand);
border-radius: 4px;
padding: 0 5px;
margin-right: 6px;
font-size: 11px;
line-height: 18px;
}
/* 行尾操作按钮 */
.row-actions { display: flex; gap: 6px; margin-left: auto; }
/* 编辑弹窗:内容区内部滚动 */
.editor-dialog .el-dialog__body { max-height: 78vh; overflow-y: auto; padding: 8px 16px; }
.hero-editor {
padding: 4px 0 16px;
}
.panel {
@@ -134,7 +212,7 @@ body {
padding: 60px 0;
}
/* 手机竖屏适配:头部按钮换行、表单单列、编辑区全宽滚动 */
/* 手机竖屏适配:头部按钮换行、行内信息自动折行、弹窗全宽 */
@media (max-width: 600px) {
.hero-header {
flex-wrap: wrap;
@@ -142,9 +220,16 @@ body {
padding: 10px 12px;
}
.hero-header .actions { flex-wrap: wrap; }
.hero-editor { padding: 12px 12px 40px; }
.hero-toolbar { padding: 8px 10px; }
.hero-toolbar .el-button { margin-left: 0; }
.hero-editor { padding: 4px 0 16px; }
.home-toolbar { padding: 8px 10px; }
.home-toolbar .el-button { margin-left: 0; }
.hero-rows { padding: 8px 10px 40px; }
.hero-row { gap: 4px 10px; }
.row-main { min-width: 0; }
.row-skills { min-width: 100%; }
.row-actions { margin-left: 0; }
.editor-dialog { width: 98% !important; }
.editor-dialog .el-dialog__body { max-height: 76vh; padding: 6px 10px; }
.form-grid { grid-template-columns: 1fr; }
.override-grid { grid-template-columns: 1fr; }
}