feat: 完成英雄配置编辑器全流程功能开发

本次提交实现了完整的英雄配置管理系统:
1.  新增服务器端英雄数据持久化接口,支持读取和保存英雄配置
2.  重构前端英雄编辑器UI,替换侧边栏为下拉选择器适配移动端
3.  统一调整前端页面样式,压缩间距适配更多内容
4.  修复Tooltip组件显示逻辑,优化技能飘字效果
5.  导入CSV英雄配置数据,补全全职业技能配置
6.  调整多个英雄预制体的尺寸和位置参数
7.  生成完整的英雄配置导出文件hexport.ts
This commit is contained in:
pan
2026-09-03 16:47:49 +08:00
parent 6a09ae2954
commit 87f771edd1
16 changed files with 1248 additions and 330 deletions

770
put/server/data/heroes.json Normal file
View File

@@ -0,0 +1,770 @@
{
"heroes": [
{
"uuid": 5001,
"name": "叠甲骑士",
"comment": "CSV导入:自身护盾+全体护盾",
"path": "hk1",
"rarity": 1,
"roleKey": "Tank",
"growKey": "Tank",
"typeKey": "Melee",
"statBase": {
"hp": 20,
"ap": 0,
"def": 10
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6004,
"name": "",
"cd": 1.2,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Slow].cd",
"overrides": {
"ap": 100
},
"desc": "挥剑对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"ap": 120
},
"desc": ""
}
]
},
{
"uuid": 6301,
"name": "魔法盾",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 30,
"summon_count": 1
},
"desc": "{target}获得生命最大值{ap}%的护盾",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 60,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 120,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {},
"atked": {
"6301": [
{
"lv": 4,
"s_lv": 1,
"name": "全体圣盾",
"t_num": 3,
"overrides": {
"TGroup": null,
"ap": 10,
"summon_count": 1
},
"desc": "全队获得本英雄生命最大值{ap}%的护盾"
}
]
},
"fstart": {},
"dead": {},
"field": [],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5002,
"name": "易伤剑仙",
"comment": "CSV导入:击退压场+易伤放大;复刻酒仙",
"path": "hk3",
"rarity": 1,
"roleKey": "Warrior",
"growKey": "Warrior",
"typeKey": "Melee",
"statBase": {
"hp": 5,
"ap": 20,
"def": 5
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6004,
"name": "",
"cd": 1.2,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Slow].cd",
"overrides": {
"ap": 100
},
"desc": "挥拳对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"ap": 120
},
"desc": ""
}
]
},
{
"uuid": 6101,
"name": "气斩",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 150,
"timed_buff_id": 7002,
"summon_count": 1
},
"desc": "斩出气刃,对{target}造成攻击力{ap}%伤害,并使目标易伤(受到伤害加深,持续{dur}秒)",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"buff_value": 20,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 180,
"bck": 60,
"buff_value": 40,
"summon_count": 2
},
"desc": "斩出气刃,对{target}造成攻击力{ap}%伤害,击退{bck},并使目标易伤(持续{dur}秒)"
}
]
}
],
"atking": {
"6004": [
{
"lv": 4,
"s_lv": 1,
"name": "奋力一击",
"t_num": 3,
"overrides": {
"ap": 300
},
"desc": "每三次攻击后立即打击{target},造成攻击力{ap}%伤害"
}
]
},
"atked": {},
"fstart": {},
"dead": {},
"field": [],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5003,
"name": "眩晕暴击哥",
"comment": "CSV导入:高爆发+击晕收割;复刻齐天大圣",
"path": "hk5",
"rarity": 1,
"roleKey": "Warrior",
"growKey": "Warrior",
"typeKey": "Melee",
"statBase": {
"hp": 5,
"ap": 20,
"def": 5
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6004,
"name": "",
"cd": 1.2,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Slow].cd",
"overrides": {
"ap": 100
},
"desc": "挥斧对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"stun": 10
},
"desc": "挥斧对{target}造成攻击力{ap}%伤害,{stun}%概率击晕"
}
]
},
{
"uuid": 6104,
"name": "开山斧",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 300,
"stun": 100,
"summon_count": 1
},
"desc": "劈出开山斧,对{target}造成攻击力{ap}%伤害,必定击晕",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 450,
"stun": 100,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 450,
"stun": 100,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {},
"atked": {},
"fstart": {},
"dead": {},
"field": [
{
"lv": 4,
"uuids": [
{
"uuid": 7005,
"value": 0.25,
"name": "大圣神威"
}
],
"desc": ""
}
],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5004,
"name": "刀刀暴击",
"comment": "CSV导入:暴击/暴伤双光环乘区;复刻剑圣",
"path": "hc1",
"rarity": 1,
"roleKey": "Assassin",
"growKey": "Assassin",
"typeKey": "Mid",
"statBase": {
"hp": 0,
"ap": 30,
"def": 0
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6002,
"name": "",
"cd": 0.9,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Fast].cd",
"overrides": {
"ap": 100
},
"desc": "挥刀对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"crt": 10
},
"desc": "挥刀对{target}造成攻击力{ap}%伤害,{crt}%概率暴击"
}
]
},
{
"uuid": 6100,
"name": "光闪",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 150,
"summon_count": 1
},
"desc": "斩出光闪,对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 250,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 350,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {},
"atked": {},
"fstart": {},
"dead": {},
"field": [
{
"lv": 4,
"uuids": [
{
"uuid": 7004,
"value": 0.12,
"name": "剑刃风暴"
},
{
"uuid": 7005,
"value": 0.2,
"name": "斩魂利刃"
}
],
"desc": ""
}
],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5005,
"name": "出血贼",
"comment": "CSV导入:入场先手+受击格挡;复刻剑豪",
"path": "hc2",
"rarity": 1,
"roleKey": "Assassin",
"growKey": "Assassin",
"typeKey": "Mid",
"statBase": {
"hp": 0,
"ap": 30,
"def": 0
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6002,
"name": "",
"cd": 0.9,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Fast].cd",
"overrides": {
"ap": 100
},
"desc": "挥刀对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"timed_buff_id": 7007,
"buff_value": 30,
"buff_chance": 30
},
"desc": "挥刀对{target}造成攻击力{ap}%伤害,{buff_chance}%概率使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)"
}
]
},
{
"uuid": 6103,
"name": "闪电斩",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 150,
"summon_count": 1
},
"desc": "召唤落雷斩击{target},造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 250,
"timed_buff_id": 7007,
"summon_count": 1
},
"desc": "召唤落雷斩击{target},造成攻击力{ap}%伤害,并使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)"
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 350,
"para": 50,
"timed_buff_id": 7007,
"buff_value": 60,
"summon_count": 2
},
"desc": "召唤落雷斩击{target},造成攻击力{ap}%伤害,{para}%概率麻痹,并使目标出血(每0.5秒受到{buff_value}点伤害,持续{dur}秒)"
}
]
}
],
"atking": {},
"atked": {},
"fstart": {},
"dead": {},
"field": [
{
"lv": 4,
"uuids": [
{
"uuid": 7018,
"value": 1,
"name": "连击光环"
}
],
"desc": ""
}
],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5006,
"name": "冻箭哥",
"comment": "CSV导入:多重单体箭,带冰冻",
"path": "ha1",
"rarity": 1,
"roleKey": "Archer",
"growKey": "Archer",
"typeKey": "Long",
"statBase": {
"hp": 0,
"ap": 30,
"def": 0
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6006,
"name": "",
"cd": 1.05,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Normal].cd",
"overrides": {
"ap": 100
},
"desc": "射出箭矢,对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"bck": 10
},
"desc": "射出箭矢,对{target}造成攻击力{ap}%伤害,击退{bck}"
}
]
},
{
"uuid": 6150,
"name": "万箭齐发·冰",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 150,
"frz": 30,
"summon_count": 1
},
"desc": "万箭齐发,对{target}造成攻击力{ap}%伤害,{frz}%概率冰冻",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 200,
"frz": 50,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 250,
"frz": 70,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {},
"atked": {},
"fstart": {},
"dead": {},
"field": [
{
"lv": 4,
"uuids": [
{
"uuid": 7006,
"value": 0.15,
"name": ""
}
],
"desc": ""
}
],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5007,
"name": "击退火女",
"comment": "CSV导入:群体击退/麻痹压场;复刻深渊女王",
"path": "hm1",
"rarity": 1,
"roleKey": "Mage",
"growKey": "Mage",
"typeKey": "Long",
"statBase": {
"hp": -5,
"ap": 10,
"def": 0
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6010,
"name": "",
"cd": 1.2,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Slow].cd",
"overrides": {
"ap": 100,
"bck": 30
},
"desc": "掷出紫魔球,对{target}造成攻击力{ap}%伤害,击退{bck}",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"bck": 40
},
"desc": ""
}
]
},
{
"uuid": 6200,
"name": "火焰喷射",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 250,
"bck": 100,
"summon_count": 1
},
"desc": "喷出烈焰风暴,对{target}造成攻击力{ap}%伤害,击退{bck}",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 350,
"bck": 100,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 450,
"bck": 100,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {},
"atked": {},
"fstart": {},
"dead": {},
"field": [
{
"lv": 4,
"uuids": [
{
"uuid": 7002,
"value": 0.15,
"name": "深渊威压"
}
],
"desc": ""
}
],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
},
{
"uuid": 5008,
"name": "团疗奶爸",
"comment": "CSV导入:全体治疗续航+自身护盾",
"path": "hh1",
"rarity": 1,
"roleKey": "Support",
"growKey": "Support",
"typeKey": "Long",
"statBase": {
"hp": 10,
"ap": 20,
"def": 0
},
"dis": null,
"speed": null,
"skills": [
{
"uuid": 6011,
"name": "",
"cd": 1.05,
"cdExpr": "AtkSpeedSet[AtkSpeedLv.Normal].cd",
"overrides": {
"ap": 100
},
"desc": "挥杖对{target}造成攻击力{ap}%伤害",
"lv_entries": [
{
"lv": 2,
"s_lv": 2,
"overrides": {
"bck": 10
},
"desc": "挥杖对{target}造成攻击力{ap}%伤害,击退{bck}"
}
]
},
{
"uuid": 6302,
"name": "治疗",
"cd": 8,
"cdExpr": null,
"overrides": {
"ap": 300,
"summon_count": 1
},
"desc": "为{target}回复攻击力{ap}%生命",
"lv_entries": [
{
"lv": 8,
"s_lv": 2,
"overrides": {
"ap": 400,
"summon_count": 1
},
"desc": ""
},
{
"lv": 16,
"s_lv": 3,
"overrides": {
"ap": 450,
"summon_count": 2
},
"desc": ""
}
]
}
],
"atking": {
"6301": [
{
"lv": 4,
"s_lv": 1,
"name": "圣愈之盾",
"t_num": 3,
"overrides": {
"ap": 30,
"summon_count": 1
},
"desc": "{target}获得生命最大值{ap}%的护盾"
}
]
},
"atked": {},
"fstart": {},
"dead": {},
"field": [],
"revive": [],
"ap_bonus": [],
"hp_bonus": [],
"def_bonus": [],
"info": ""
}
]
}

View File

@@ -9,6 +9,8 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
const PROJECT_ROOT = path.resolve(__dirname, '..', '..')
const CONFIG_DIR = path.join(PROJECT_ROOT, 'assets/script/game/common/config')
const EXPORT_PATH = path.join(CONFIG_DIR, 'hexport.ts')
const DATA_DIR = path.join(__dirname, 'data')
const HEROES_PATH = path.join(DATA_DIR, 'heroes.json')
const app = express()
app.use(cors())
@@ -73,6 +75,36 @@ app.post('/api/refresh', async (_req, res) => {
}
})
/** 英雄数据持久化:GET 读取(无文件时返回空列表) */
app.get('/api/heroes', (_req, res) => {
try {
if (!fs.existsSync(HEROES_PATH)) return res.json({ heroes: [] })
res.json(JSON.parse(fs.readFileSync(HEROES_PATH, 'utf8')))
} catch (e) {
res.status(500).json({ error: String(e?.message || e) })
}
})
/** 英雄数据持久化:POST 全量覆盖保存 */
app.post('/api/heroes', (req, res) => {
const heroes = req.body?.heroes
if (!Array.isArray(heroes)) {
return res.status(400).json({ error: 'heroes 必须为数组' })
}
try {
fs.mkdirSync(DATA_DIR, { recursive: true })
fs.writeFileSync(HEROES_PATH, JSON.stringify({ heroes }, null, 2), 'utf8')
res.json({ ok: true, path: HEROES_PATH, count: heroes.length })
} catch (e) {
res.status(500).json({ error: String(e?.message || e) })
}
})
/** 序列化 overrides:TGroup 以字符串存储(如 "Team"),导出时还原为枚举表达式 TGroup.Team */
function serializeOverrides(o) {
return JSON.stringify(o).replace(/"TGroup":\s*"(\w+)"/g, '"TGroup": TGroup.$1')
}
/** 生成 hexport.ts 内容 */
function renderHeroTs(heroes) {
const nl = '\n'
@@ -84,6 +116,7 @@ function renderHeroTs(heroes) {
out += ` */${nl}`
out += `import { v3 } from "cc"${nl}`
out += `import { FacSet } from "./GameSet"${nl}`
out += `import { TGroup } from "./SkillSet"${nl}`
out += `import { SkillLv, HType, HGrowType, HRole, HERO_ROLE_BASE, AtkSpeedSet, AtkSpeedLv, heroInfo } from "./heroSet"${nl}`
out += nl
out += `export const HexportHeroInfo: Record<number, heroInfo> = {${nl}`
@@ -120,7 +153,7 @@ function renderSingleHero(h) {
parts.push(`lv: 1`)
parts.push(`cd: ${sk.cdExpr || sk.cd}`)
parts.push(`ccd: 0`)
if (sk.overrides && Object.keys(sk.overrides).length) parts.push(`overrides: ${JSON.stringify(sk.overrides)}`)
if (sk.overrides && Object.keys(sk.overrides).length) parts.push(`overrides: ${serializeOverrides(sk.overrides)}`)
if (sk.desc) parts.push(`desc: ${JSON.stringify(sk.desc)}`)
if (sk.lv_entries?.length) {
push(` ${sk.uuid}: { ${parts.join(', ')},`)
@@ -128,7 +161,7 @@ function renderSingleHero(h) {
for (const e of sk.lv_entries) {
const eparts = [`lv: ${e.lv}`]
if (e.s_lv) eparts.push(`s_lv: SkillLv.Lv${e.s_lv}`)
if (e.overrides && Object.keys(e.overrides).length) eparts.push(`overrides: ${JSON.stringify(e.overrides)}`)
if (e.overrides && Object.keys(e.overrides).length) eparts.push(`overrides: ${serializeOverrides(e.overrides)}`)
if (e.desc) eparts.push(`desc: ${JSON.stringify(e.desc)}`)
push(` { ${eparts.join(', ')} },`)
}
@@ -153,7 +186,7 @@ function renderSingleHero(h) {
if (e.s_lv) eparts.push(`s_lv: SkillLv.Lv${e.s_lv}`)
if (e.name) eparts.push(`name: ${JSON.stringify(e.name)}`)
eparts.push(`t_num: ${e.t_num}`)
if (e.overrides && Object.keys(e.overrides).length) eparts.push(`overrides: ${JSON.stringify(e.overrides)}`)
if (e.overrides && Object.keys(e.overrides).length) eparts.push(`overrides: ${serializeOverrides(e.overrides)}`)
if (e.desc) eparts.push(`desc: ${JSON.stringify(e.desc)}`)
push(` { ${eparts.join(', ')} },`)
}

View File

@@ -4,32 +4,28 @@
<h1>英雄配置编辑器</h1>
<div class="actions">
<el-button size="small" @click="refreshMeta" :loading="loadingMeta">刷新配置数据</el-button>
<el-button size="small" type="success" @click="doSave" :disabled="!heroes.length">保存到服务器</el-button>
<el-button size="small" type="warning" @click="doExport" :disabled="!heroes.length">导出 hexport.ts</el-button>
</div>
</header>
<div class="hero-main">
<aside class="hero-sidebar">
<div class="side-head">
<span>英雄列表 ({{ heroes.length }})</span>
<el-button size="small" type="primary" text @click="addHero">+ 新增</el-button>
</div>
<div class="hero-list">
<div
v-for="(h, i) in heroes"
:key="i"
class="hero-item"
:class="{ active: i === activeIdx }"
@click="activeIdx = i"
>
<div>
<div>{{ h.uuid }} {{ h.name || '(未命名)' }}</div>
<div class="meta">{{ roleLabel(h.roleKey) }} · {{ typeLabel(h.typeKey) }} · ★{{ h.rarity }}</div>
</div>
<el-button type="danger" size="small" text @click.stop="removeHero(i)">删</el-button>
</div>
<div v-if="!heroes.length" class="empty">点击右上角"新增"创建英雄</div>
</div>
</aside>
<!-- 英雄选择工具栏:下拉选择,适配手机竖屏 -->
<div class="hero-toolbar">
<el-select
v-model="activeIdx"
class="hero-select"
:placeholder="`选择英雄(共 ${heroes.length} 个)`"
filterable
:disabled="!heroes.length"
>
<el-option v-for="(h, i) in heroes" :key="i" :label="`${h.uuid} ${h.name || '(未命名)'}`" :value="i">
<span>{{ h.uuid }} {{ h.name || '(未命名)' }}</span>
<span class="hero-option-meta">{{ roleLabel(h.roleKey) }} · {{ typeLabel(h.typeKey) }} · ★{{ h.rarity }}</span>
</el-option>
</el-select>
<el-button type="primary" @click="addHero">+ 新增</el-button>
<el-button type="danger" plain :disabled="activeIdx < 0" @click="removeHero(activeIdx)">删当前</el-button>
</div>
<section class="hero-editor" v-if="current">
<!-- 基础属性 -->
<div class="panel">
@@ -256,6 +252,27 @@ function addUltSkill() {
current.value.skills[1] = sk
}
async function loadHeroes() {
try {
const r = await api.fetchHeroes()
if (Array.isArray(r.heroes) && r.heroes.length) {
heroes.value = r.heroes
activeIdx.value = 0
}
} catch (e) {
ElMessage.error('加载英雄数据失败: ' + (e?.response?.data?.error || e.message))
}
}
async function doSave() {
try {
const r = await api.saveHeroes(heroes.value)
ElMessage.success(`已保存 ${r.count} 个英雄 → ${r.path}`)
} catch (e) {
ElMessage.error('保存失败: ' + (e?.response?.data?.error || e.message))
}
}
async function doExport() {
try {
await ElMessageBox.confirm(
@@ -272,5 +289,8 @@ async function doExport() {
}
}
onMounted(loadMeta)
onMounted(() => {
loadMeta()
loadHeroes()
})
</script>

View File

@@ -3,6 +3,8 @@ import axios from 'axios'
export const api = {
meta: () => axios.get('/api/meta').then((r) => r.data),
refresh: () => axios.post('/api/refresh').then((r) => r.data),
fetchHeroes: () => axios.get('/api/heroes').then((r) => r.data),
saveHeroes: (heroes) => axios.post('/api/heroes', { heroes }).then((r) => r.data),
exportHeroes: (heroes) => axios.post('/api/export', { heroes }).then((r) => r.data),
fetchExport: () => axios.get('/api/export', { responseType: 'text' }).then((r) => r.data),
}

View File

@@ -35,10 +35,10 @@ export const ATK_SPEEDS = [
export const ROLE_ATK_SKILL = {
Tank: [6004],
Warrior: [6004],
Assassin: [6001, 6002, 6003],
Archer: [6006, 6007, 6008],
Assassin: [6001, 6002, 6003, 6004],
Archer: [6004, 6006, 6007, 6008],
Mage: [6009, 6010, 6011, 6012],
Support: [6009, 6010, 6011, 6012],
Support: [6004, 6009, 6010, 6011, 6012],
}
// 按职业映射大招底座

View File

@@ -14,8 +14,27 @@ body {
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
background: var(--bg);
color: var(--text);
/* 编辑页全局缩小字号,同屏容纳更多字段 */
font-size: 12px;
}
/* Element Plus 表单控件整体缩小一档(默认 14px → 12px) */
.hero-app .el-input__wrapper,
.hero-app .el-select__wrapper,
.hero-app .el-textarea__inner,
.hero-app .el-form-item__label {
font-size: 12px;
}
/* 行间距压缩:表单项下边距 + 行高收紧 */
.hero-app .el-form-item { margin-bottom: 8px; line-height: 1.2; }
.hero-app .el-form-item__label { line-height: 1.2; padding-bottom: 2px; }
.hero-app .el-button { font-size: 12px; height: 26px; padding: 8px 10px; }
.hero-app .el-button--small { height: 22px; padding: 5px 8px; }
.hero-app .el-input__inner { --el-input-height: 26px; }
.hero-app .el-tabs__item { font-size: 12px; height: 30px; }
.hero-app .el-tabs__header { margin-bottom: 8px; }
.hero-app .el-tabs__nav-wrap::after { height: 1px; }
.hero-app {
height: 100%;
display: flex;
@@ -31,49 +50,32 @@ body {
justify-content: space-between;
box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}
.hero-header h1 { font-size: 18px; margin: 0; font-weight: 600; }
.hero-header h1 { font-size: 15px; margin: 0; font-weight: 600; }
.hero-header .actions { display: flex; gap: 8px; }
.hero-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.hero-sidebar {
width: 260px;
/* 英雄选择工具栏:下拉选择替代侧边栏列表,适配手机竖屏 */
.hero-toolbar {
display: flex;
gap: 8px;
align-items: center;
padding: 10px 14px;
background: var(--panel);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
}
.hero-sidebar .side-head {
padding: 12px 14px;
font-weight: 600;
color: var(--text);
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
}
.hero-list {
flex: 1;
overflow-y: auto;
padding: 6px;
.hero-toolbar .hero-select { flex: 1; min-width: 0; }
.hero-option-meta {
float: right;
font-size: 11px;
color: var(--text-light);
}
.hero-item {
padding: 10px 12px;
border-radius: 6px;
cursor: pointer;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
align-items: center;
transition: background 0.15s;
}
.hero-item:hover { background: #eef5ff; }
.hero-item.active { background: #d6e8ff; color: var(--brand); font-weight: 600; }
.hero-item .meta { font-size: 12px; color: var(--text-light); }
.hero-editor {
flex: 1;
@@ -84,14 +86,14 @@ body {
.panel {
background: var(--panel);
border-radius: 8px;
padding: 16px;
margin-bottom: 14px;
padding: 10px 12px;
margin-bottom: 10px;
border: 1px solid var(--border);
box-shadow: 0 1px 3px rgba(46, 91, 160, 0.05);
}
.panel h3 {
margin: 0 0 12px;
font-size: 14px;
margin: 0 0 8px;
font-size: 13px;
color: var(--brand);
border-left: 3px solid var(--brand);
padding-left: 8px;
@@ -100,7 +102,7 @@ body {
.form-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 10px 18px;
gap: 4px 14px;
}
.muted { color: var(--text-light); font-size: 12px; }
@@ -132,6 +134,17 @@ body {
padding: 60px 0;
}
@media (max-width: 900px) {
.hero-sidebar { width: 200px; }
/* 手机竖屏适配:头部按钮换行、表单单列、编辑区全宽滚动 */
@media (max-width: 600px) {
.hero-header {
flex-wrap: wrap;
gap: 8px;
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; }
.form-grid { grid-template-columns: 1fr; }
.override-grid { grid-template-columns: 1fr; }
}