feat(editor): 新增枚举型覆写编辑器与优化技能描述
1. 新增TGroup枚举覆写类型到常量配置,添加对应下拉编辑组件 2. 重构覆写解析逻辑,统一处理枚举与对象类型覆写 3. 批量更新全英雄技能的描述文本与覆写参数,修正技能效果描述 4. 优化技能详情展示逻辑,复用覆写解析函数减少重复代码
This commit is contained in:
@@ -17,6 +17,16 @@
|
||||
>
|
||||
<el-option v-for="opt in SKILL_ICON_OPTIONS" :key="opt" :label="opt" :value="opt" />
|
||||
</el-select>
|
||||
<!-- 枚举型覆写(buff_target/TGroup):下拉选枚举值 -->
|
||||
<el-select
|
||||
v-else-if="isEnumKey(item.key)"
|
||||
v-model="item.value"
|
||||
placeholder="枚举值"
|
||||
size="small"
|
||||
style="width: 220px"
|
||||
>
|
||||
<el-option v-for="opt in enumOptions(item.key)" :key="String(opt.value)" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
<!-- 对象型覆写(proc_skill):命中后概率触发额外技能,结构化编辑 s_uuid/chance/overrides -->
|
||||
<template v-else-if="isObjectKey(item.key)">
|
||||
<div class="proc-skill-editor">
|
||||
@@ -111,12 +121,25 @@ function isObjectKey(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.type === 'object'
|
||||
}
|
||||
|
||||
// 该覆写字段是否为枚举型(buff_target/TGroup 等)
|
||||
function isEnumKey(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.type === 'enum'
|
||||
}
|
||||
|
||||
// 枚举型覆写的候选值列表
|
||||
function enumOptions(key) {
|
||||
return OVERRIDE_KEYS.find((k) => k.key === key)?.options || []
|
||||
}
|
||||
|
||||
// 对象型覆写行选中时初始化默认结构,避免 v-model 绑定到 undefined 子字段
|
||||
function onKeyChange(item) {
|
||||
if (isObjectKey(item.key)) {
|
||||
item.value = { s_uuid: undefined, chance: 100, overrides: {} }
|
||||
} else if (isStringKey(item.key)) {
|
||||
item.value = ''
|
||||
} else if (isEnumKey(item.key)) {
|
||||
// 枚举默认取首个候选值
|
||||
item.value = enumOptions(item.key)[0]?.value
|
||||
} else {
|
||||
item.value = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user