优化一键测试权重
This commit is contained in:
@@ -99,6 +99,7 @@
|
||||
"eslint-plugin-vue": "^9.27.0",
|
||||
"globals": "^15.9.0",
|
||||
"husky": "^9.1.5",
|
||||
"iconv-lite": "^0.7.2",
|
||||
"lint-staged": "^15.5.2",
|
||||
"prettier": "^3.5.3",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
|
||||
11
saiadmin-artd/pnpm-lock.yaml
generated
11
saiadmin-artd/pnpm-lock.yaml
generated
@@ -144,6 +144,9 @@ importers:
|
||||
husky:
|
||||
specifier: ^9.1.5
|
||||
version: 9.1.7
|
||||
iconv-lite:
|
||||
specifier: ^0.7.2
|
||||
version: 0.7.2
|
||||
lint-staged:
|
||||
specifier: ^15.5.2
|
||||
version: 15.5.2
|
||||
@@ -2549,6 +2552,10 @@ packages:
|
||||
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
iconv-lite@0.7.2:
|
||||
resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
ieee754@1.2.1:
|
||||
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||
|
||||
@@ -6767,6 +6774,10 @@ snapshots:
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
|
||||
iconv-lite@0.7.2:
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
|
||||
ieee754@1.2.1: {}
|
||||
|
||||
ignore@5.3.2: {}
|
||||
|
||||
@@ -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