优化一键测试权重
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
1-10000,档位内按权重比抽取。
|
||||
</div>
|
||||
<div v-loading="loading" class="dialog-body">
|
||||
<!-- 一级:方向;二级档位放在各方向 pane 内,切换方向时二级能正常显示 -->
|
||||
<el-tabs v-model="activeDirection" type="card" class="direction-tabs">
|
||||
<!-- 一级:方向(懒加载避免逆时针柱状图在隐藏容器内初始化导致不显示);二级档位 -->
|
||||
<el-tabs v-model="activeDirection" type="card" class="direction-tabs" :lazy="true">
|
||||
<el-tab-pane label="顺时针" name="0">
|
||||
<el-tabs v-model="activeTier" type="card" class="tier-tabs">
|
||||
<el-tab-pane v-for="t in tierKeys" :key="'cw-' + t" :label="t" :name="t">
|
||||
@@ -21,6 +21,7 @@
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<ArtBarChart
|
||||
:key="'cw-' + activeDirection + '-' + t"
|
||||
x-axis-name="点数"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartDataForCurrentDirection(t)"
|
||||
@@ -162,6 +163,7 @@
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<ArtBarChart
|
||||
:key="'ccw-' + activeDirection + '-' + t"
|
||||
x-axis-name="点数"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartDataForCurrentDirection(t)"
|
||||
@@ -470,9 +472,9 @@
|
||||
})
|
||||
}
|
||||
|
||||
/** 按 DiceReward 主键 id 收集:每条记录一条 { id, weight },直接用于后端按 id 更新 */
|
||||
function collectItems(): Array<{ id: number; weight: number }> {
|
||||
const items: Array<{ id: number; weight: number }> = []
|
||||
/** 按 DiceReward 主键 id 收集:每条记录一条 { id, reward_id, weight },后端按 id 更新(reward_id 作回退) */
|
||||
function collectItems(): Array<{ id: number; reward_id: number; weight: number }> {
|
||||
const items: Array<{ id: number; reward_id: number; weight: number }> = []
|
||||
for (const t of TIER_KEYS) {
|
||||
const tierData = grouped.value[t]
|
||||
if (!tierData) continue
|
||||
@@ -482,7 +484,7 @@
|
||||
const rid = row.reward_id != null ? Number(row.reward_id) : 0
|
||||
if (rid <= 0) continue
|
||||
const w = isWeightDisabled(row, t) ? 10000 : toWeightPrecision(row.weight ?? 1)
|
||||
items.push({ id: rid, weight: w })
|
||||
items.push({ id: rid, reward_id: rid, weight: w })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -536,6 +538,7 @@
|
||||
}
|
||||
.chart-wrap {
|
||||
margin-bottom: 12px;
|
||||
min-height: 200px;
|
||||
}
|
||||
.weight-sum {
|
||||
margin-bottom: 12px;
|
||||
|
||||
Reference in New Issue
Block a user