refactor(hero-config): 移除旧的本地导出hexport.ts功能
删除了前后端中与本地导出hexport.ts相关的API、页面按钮和实现代码,不再支持生成本地hexport.ts配置文件。
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<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>
|
||||
<el-button size="small" type="primary" @click="doApply" :disabled="!heroes.length">写入 heroSet.ts</el-button>
|
||||
<el-button size="small" type="danger" @click="doExportCsv" :disabled="!heroes.length">导出英雄设计表.csv</el-button>
|
||||
</div>
|
||||
@@ -375,22 +374,6 @@ async function doSave() {
|
||||
}
|
||||
}
|
||||
|
||||
async function doExport() {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`将写入 ${heroes.value.length} 个英雄到 assets/script/game/common/config/hexport.ts`,
|
||||
'导出确认',
|
||||
{ confirmButtonText: '写入', cancelButtonText: '取消', type: 'warning' }
|
||||
)
|
||||
} catch { return }
|
||||
try {
|
||||
const r = await api.exportHeroes(heroes.value)
|
||||
ElMessage.success(`已写入 ${r.bytes} 字节 → ${r.path}`)
|
||||
} catch (e) {
|
||||
ElMessage.error('导出失败: ' + (e?.response?.data?.error || e.message))
|
||||
}
|
||||
}
|
||||
|
||||
async function doApply() {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
|
||||
@@ -5,8 +5,6 @@ export const api = {
|
||||
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),
|
||||
applyHeroes: (heroes) => axios.post('/api/apply', { heroes }).then((r) => r.data),
|
||||
exportCsv: (heroes) => axios.post('/api/export-csv', { heroes }).then((r) => r.data),
|
||||
fetchExport: () => axios.get('/api/export', { responseType: 'text' }).then((r) => r.data),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user