diff --git a/saiadmin-artd/src/locales/langs/en/dice/reward.json b/saiadmin-artd/src/locales/langs/en/dice/reward.json index 4c1fdd9..c494ec6 100644 --- a/saiadmin-artd/src/locales/langs/en/dice/reward.json +++ b/saiadmin-artd/src/locales/langs/en/dice/reward.json @@ -25,8 +25,6 @@ "emptyTier": "No data for this tier", "sumLineDual": "Tier weight sum (clockwise): {cw}; counter-clockwise: {ccw} (each row 1–10000, ratio draw within tier, sum not limited)", "sumLineSingle": "Tier weight sum: {sum} (each row 1–10000, ratio draw within tier, sum not limited)", - "t4t5NoteSingle": "T4 and T5 have a single outcome; no weight configuration.", - "t4t5NoteDual": "T4 and T5 have a single outcome when hit; no weight configuration.", "colEndIndexId": "End Index (id)", "colGridNumber": "Points (grid_number)", "colDicePoints": "Dice Points", @@ -45,11 +43,11 @@ }, "weightEdit": { "title": "Dice Reward (dice_reward) Weight Ratio", - "globalTip": "You are editing weights on dice_reward (DiceReward), split by end_index into clockwise and counter-clockwise; the draw uses the set for the current direction." + "globalTip": "You are editing weights on dice_reward (DiceReward), split by end_index into clockwise and counter-clockwise; the draw uses the set for the current direction. T4/T5 support the same multi-point weight ratio as T1–T3." }, "weightRatio": { "title": "Weight Ratio", - "globalTip": "Configure dice_reward weights: first by direction (clockwise / counter-clockwise), then by tier (T1–T5); each row weight 1–10000, ratio draw within tier.", + "globalTip": "Configure dice_reward weights: first by direction (clockwise / counter-clockwise), then by tier (T1–T5); each row weight 1–10000, ratio draw within tier for dice points (T4/T5 use the same logic as T1–T3 and support multiple point weights).", "tabClockwise": "Clockwise", "tabCounterclockwise": "Counter-clockwise" }, diff --git a/saiadmin-artd/src/locales/langs/en/dice/reward_config.json b/saiadmin-artd/src/locales/langs/en/dice/reward_config.json index 6d8d20c..a50a51e 100644 --- a/saiadmin-artd/src/locales/langs/en/dice/reward_config.json +++ b/saiadmin-artd/src/locales/langs/en/dice/reward_config.json @@ -8,6 +8,17 @@ "tabIndex": "Reward Index", "tabBigwin": "Big Win Weights", "tipIndex": "Dice points must be between 5 and 30 and unique in this table.", + "tierRecommendRules": "[Settlement vs tier] Settlement < 0 → T4; 0 < Settlement < 1 → T3; 1 < Settlement < 2 → T2; Settlement > 2 → T1; T5 “try again” settlement = 0. Set a unified settlement standard per tier below; values are written on generation and can be edited row by row in the table.", + "tierRecommendRealEv": "Recommended settlement", + "tierRecommendAutoMatch": "Auto-match tier when settlement changes", + "tierRecommendApplyAmount": "Fill recommended amount for rows with tier set", + "tierRecommendApplyAmountOk": "Filled recommended settlement for {n} row(s)", + "tierRecommendNoTierRows": "Set tier T1–T5 on table rows first", + "tierRecommendMatchTier": "Match all tiers from settlement", + "tierRecommendMatchTierOk": "Matched tier for {n} row(s) from settlement", + "tierRecommendMatchTierNone": "No rows to match", + "tierRecommendT5UiText": "再来一次", + "tierRecommendT5UiTextEn": "Once again", "tipBigwin": "Left to right: big-win points (read-only), display text, real EV, remark, weight (0~10000). Points 5 and 30 are fixed at 100%. This tab saves big-win weights only.", "colId": "Index (id)", "colDicePoints": "Dice Points", @@ -54,7 +65,7 @@ "infoNoBigwin": "No BIGWIN rows. Set tier to BIGWIN in the Reward Index tab first.", "btnRuleGenerate": "Generate by rules", "ruleGenerateTitle": "Generate reward index by rules", - "ruleGenerateRules": "[Generation logic (same as Create Reward Reference)]\n• 26 cells ordered by id ascending are positions 0–25; each row’s grid_number is 5–30 and unique.\n• Roll D (5–30): start at the cell whose grid_number equals D (start_index); clockwise landing = (start position + D) mod 26; counter-clockwise = start − D (if negative, +26).\n• Each reference row’s “dice points” column is the roll D; tier / real_ev / display text come from the config at the landing id.\n\n[Leopard rolls]\nFor rolls 5, 10, 15, 20, 25, 30, clockwise and counter-clockwise landing tiers must NOT be T4 or T5 (avoid leopard roll + penalty / once again).\n\n[Settlement amount vs tier]\nSettlement < 0 → T4; 0 < Settlement < 100 → T3; 100 < Settlement < 200 → T2; Settlement > 200 → T1; T5 “once again” settlement = 0. You can set a unified settlement standard for each tier below; generated rows write those values into the config, and details can be edited later in the table.\n\n[Inputs in this dialog]\nCount: T1/T4/T5 are fixed; T2 is minimum. Clockwise and counter-clockwise weighted counts (each roll result counts once) must each satisfy the entered values; T1, T4, and T5 are entered separately.\nSettlement standard: all cells in the same tier use the same value. On generation, T1–T4 use ui_text / ui_text_en = settlement real_ev; T5 is fixed to \"再来一次\" / \"Once again\". Remarks still distinguish break-even / small win, etc.", + "ruleGenerateRules": "[Generation logic (same as Create Reward Reference)]\n• 26 cells ordered by id ascending are positions 0–25; each row’s grid_number is 5–30 and unique.\n• Roll D (5–30): start at the cell whose grid_number equals D (start_index); clockwise landing = (start position + D) mod 26; counter-clockwise = start − D (if negative, +26).\n• Each reference row’s “dice points” column is the roll D; tier / real_ev / display text come from the config at the landing id.\n\n[Leopard rolls]\nFor rolls 5, 10, 15, 20, 25, 30, clockwise and counter-clockwise landing tiers must NOT be T4 or T5 (avoid leopard roll + penalty / once again).\n\n[Settlement amount vs tier]\nSettlement < 0 → T4; 0 < Settlement < 1 → T3; 1 < Settlement < 2 → T2; Settlement > 2 → T1; T5 “once again” settlement = 0. You can set a unified settlement standard for each tier below; generated rows write those values into the config, and details can be edited later in the table.\n\n[Inputs in this dialog]\nCount: T1/T4/T5 are fixed; T2 is minimum. Clockwise and counter-clockwise weighted counts (each roll result counts once) must each satisfy the entered values; T1, T4, and T5 are entered separately.\nSettlement standard: all cells in the same tier use the same value. On generation, T1–T4 use ui_text / ui_text_en = settlement real_ev; T5 is fixed to \"再来一次\" / \"Once again\". Remarks still distinguish break-even / small win, etc.", "ruleGenT1Row": "T1 (big prize)", "ruleGenT2Row": "T2 (small win / break-even)", "ruleGenT3RealEvOnly": "T3 (rake)", @@ -64,9 +75,9 @@ "ruleGenFixedCount": "Fixed count (CW & CCW)", "ruleGenRealEvStd": "real_ev standard", "ruleGenRealEvEditHint": "After saving, you can still edit display text, EN, real_ev and remarks per row in the table above.", - "ruleGenInvalidT1RealEv": "T1 settlement amount must satisfy: value > 200", - "ruleGenInvalidT2RealEv": "T2 settlement amount must satisfy: 100 < value < 200", - "ruleGenInvalidT3RealEv": "T3 settlement amount must satisfy: 0 < value < 100", + "ruleGenInvalidT1RealEv": "T1 settlement amount must satisfy: value > 2", + "ruleGenInvalidT2RealEv": "T2 settlement amount must satisfy: 1 < value < 2", + "ruleGenInvalidT3RealEv": "T3 settlement amount must satisfy: 0 < value < 1", "ruleGenInvalidT4RealEv": "T4 settlement amount must satisfy: value < 0", "ruleGenInvalidT5RealEv": "T5 “try again” real_ev must be 0", "ruleGenT1Min": "T1 fixed count (CW & CCW)", diff --git a/saiadmin-artd/src/locales/langs/zh/dice/reward.json b/saiadmin-artd/src/locales/langs/zh/dice/reward.json index 01f1251..8ed53a1 100644 --- a/saiadmin-artd/src/locales/langs/zh/dice/reward.json +++ b/saiadmin-artd/src/locales/langs/zh/dice/reward.json @@ -25,8 +25,6 @@ "emptyTier": "该档位暂无配置数据", "sumLineDual": "当前档位权重合计(顺时针):{cw};逆时针:{ccw}(各条 1-10000,档位内按权重比抽取,和不限制)", "sumLineSingle": "当前档位权重合计:{sum}(各条 1-10000,档位内按权重比抽取,和不限制)", - "t4t5NoteSingle": "T4、T5 仅单一结果,无需配置权重。", - "t4t5NoteDual": "T4、T5 档位抽中时仅有一个结果,无需配置权重。", "colEndIndexId": "结束索引(id)", "colGridNumber": "点数(grid_number)", "colDicePoints": "色子点数", @@ -45,11 +43,11 @@ }, "weightEdit": { "title": "奖励对照表(dice_reward)权重配比", - "globalTip": "编辑的是奖励对照表(dice_reward / DiceReward 模型)的权重,按结束索引(end_index)区分顺时针与逆时针两套权重;抽奖时按当前方向取对应权重。" + "globalTip": "编辑的是奖励对照表(dice_reward / DiceReward 模型)的权重,按结束索引(end_index)区分顺时针与逆时针两套权重;抽奖时按当前方向取对应权重,T4/T5 与 T1-T3 相同支持多点数权重配比。" }, "weightRatio": { "title": "权重配比", - "globalTip": "配置奖励对照表(dice_reward)的权重,一级按方向(顺时针/逆时针),二级按档位(T1-T5);各条权重 1-10000,档位内按权重比抽取。", + "globalTip": "配置奖励对照表(dice_reward)的权重,一级按方向(顺时针/逆时针),二级按档位(T1-T5);各条权重 1-10000,档位内按权重比抽取骰子点数(T4/T5 与 T1-T3 逻辑相同,可配置多个点数的权重配比)。", "tabClockwise": "顺时针", "tabCounterclockwise": "逆时针" }, diff --git a/saiadmin-artd/src/locales/langs/zh/dice/reward_config.json b/saiadmin-artd/src/locales/langs/zh/dice/reward_config.json index fda999f..9fbeac5 100644 --- a/saiadmin-artd/src/locales/langs/zh/dice/reward_config.json +++ b/saiadmin-artd/src/locales/langs/zh/dice/reward_config.json @@ -8,6 +8,17 @@ "tabIndex": "奖励索引", "tabBigwin": "大奖权重", "tipIndex": "色子点数须在 5~30 之间且本表内不重复。", + "tierRecommendRules": "【结算金额与档位】结算金额 < 0 → T4;0 < 结算金额 < 1 → T3;1 < 结算金额 < 2 → T2;2 < 结算金额 → T1;T5「再来一次」结算金额 = 0。下方可为各档位填写统一的结算金额标准,生成时写入配置;细则可稍后在表格中再改。", + "tierRecommendRealEv": "推荐结算金额", + "tierRecommendAutoMatch": "修改结算金额时自动匹配档位", + "tierRecommendApplyAmount": "将推荐金额填入已选档位的行", + "tierRecommendApplyAmountOk": "已为 {n} 行填入推荐结算金额", + "tierRecommendNoTierRows": "请先在表格中为行选择 T1~T5 档位", + "tierRecommendMatchTier": "按结算金额匹配全部档位", + "tierRecommendMatchTierOk": "已根据结算金额为 {n} 行匹配档位", + "tierRecommendMatchTierNone": "没有可匹配档位的行", + "tierRecommendT5UiText": "再来一次", + "tierRecommendT5UiTextEn": "Once again", "tipBigwin": "从左至右:中大奖点数(不可改)、显示信息、实际中奖、备注、权重(0~10000)。点数 5、30 权重固定 100%。本表单独立提交,仅提交大奖权重。", "colId": "索引(id)", "colDicePoints": "色子点数", @@ -54,7 +65,7 @@ "infoNoBigwin": "暂无 BIGWIN 档位配置,请先在「奖励索引」中设置 tier 为 BIGWIN", "btnRuleGenerate": "按规则生成", "ruleGenerateTitle": "按规则生成奖励索引", - "ruleGenerateRules": "【生成逻辑(与创建奖励对照一致)】\n• 盘面 26 格按 id 升序为位置 0~25;每条配置的 grid_number 为 5~30 且不重复。\n• 摇取点数 D(5~30):起点为「grid_number=D」所在格位的 id(即 start_index),顺时针落点位置 = (起点位置 + D) mod 26,逆时针落点 = 起点位置 − D(若小于 0 则 +26)。\n• 对照表每条记录的「色子点数」列为摇取点数 D;档位、真实结算、显示文案取自落点格位对应 id 的配置。\n\n【豹子摇取点数】\n摇取点数为 5、10、15、20、25、30 时,其顺/逆时针落点档位不能为 T4、T5(避免对照表上出现豹子点数 + 惩罚/再来一次)。\n\n【结算金额 与 档位】\n结算金额 < 0 → T4;0 < 结算金额 < 100 → T3;100 < 结算金额 < 200 → T2;200 < 结算金额 → T1;T5「再来一次」结算金额=0。下方可为各档位填写统一的 结算金额 标准,生成时写入配置;细则可稍后在表格中再改。\n\n【本弹窗输入】\n条数:T1/T4/T5「固定」;T2「不少于」——顺时针与逆时针的加权条数(每条摇取结果计一次)须分别满足所填数值;T1、T4 与 T5 分开填写。\n结算金额 标准:同档位各格使用同一数值。生成时 T1~T4 的 显示文本 / 显示文本(英文) = 结算金额;T5 固定为「再来一次」/「Once again」。备注仍区分完美回本/小赚等。", + "ruleGenerateRules": "【生成逻辑(与创建奖励对照一致)】\n• 盘面 26 格按 id 升序为位置 0~25;每条配置的 grid_number 为 5~30 且不重复。\n• 摇取点数 D(5~30):起点为「grid_number=D」所在格位的 id(即 start_index),顺时针落点位置 = (起点位置 + D) mod 26,逆时针落点 = 起点位置 − D(若小于 0 则 +26)。\n• 对照表每条记录的「色子点数」列为摇取点数 D;档位、真实结算、显示文案取自落点格位对应 id 的配置。\n\n【豹子摇取点数】\n摇取点数为 5、10、15、20、25、30 时,其顺/逆时针落点档位不能为 T4、T5(避免对照表上出现豹子点数 + 惩罚/再来一次)。\n\n【结算金额 与 档位】\n结算金额 < 0 → T4;0 < 结算金额 < 1 → T3;1 < 结算金额 < 2 → T2;2 < 结算金额 → T1;T5「再来一次」结算金额=0。下方可为各档位填写统一的 结算金额 标准,生成时写入配置;细则可稍后在表格中再改。\n\n【本弹窗输入】\n条数:T1/T4/T5「固定」;T2「不少于」——顺时针与逆时针的加权条数(每条摇取结果计一次)须分别满足所填数值;T1、T4 与 T5 分开填写。\n结算金额 标准:同档位各格使用同一数值。生成时 T1~T4 的 显示文本 / 显示文本(英文) = 结算金额;T5 固定为「再来一次」/「Once again」。备注仍区分完美回本/小赚等。", "ruleGenT1Row": "T1 大奖", "ruleGenT2Row": "T2 小赚/回本", "ruleGenT3RealEvOnly": "T3 抽水", @@ -64,9 +75,9 @@ "ruleGenFixedCount": "固定条数(顺/逆)", "ruleGenRealEvStd": "结算金额", "ruleGenRealEvEditHint": "生成并保存后,仍可在本页表格中逐条修改显示文案、英文、真实结算与备注。", - "ruleGenInvalidT1RealEv": "T1 的 结算金额 满足:200 < 值", - "ruleGenInvalidT2RealEv": "T2 的 结算金额 满足:100 < 值 < 200", - "ruleGenInvalidT3RealEv": "T3 的 结算金额 满足:0 < 值 < 100", + "ruleGenInvalidT1RealEv": "T1 的 结算金额 满足:2 < 值", + "ruleGenInvalidT2RealEv": "T2 的 结算金额 满足:1 < 值 < 2", + "ruleGenInvalidT3RealEv": "T3 的 结算金额 满足:0 < 值 < 1", "ruleGenInvalidT4RealEv": "T4 的 结算金额 满足:值 < 0", "ruleGenInvalidT5RealEv": "T5「再来一次」的 结算金额 须为 0", "ruleGenT1Min": "T1 固定条数(顺/逆)", diff --git a/saiadmin-artd/src/views/plugin/dice/api/reward_config/index.ts b/saiadmin-artd/src/views/plugin/dice/api/reward_config/index.ts index 4788744..003577c 100644 --- a/saiadmin-artd/src/views/plugin/dice/api/reward_config/index.ts +++ b/saiadmin-artd/src/views/plugin/dice/api/reward_config/index.ts @@ -76,6 +76,27 @@ export default { }) }, + /** + * 按规则生成并保存奖励索引(需 dice:reward_config:index:tierRecommend 权限) + */ + generateIndexByRules( + items: Array<{ + id: number + grid_number?: number + ui_text?: string + ui_text_en?: string + real_ev?: number + tier?: string + remark?: string + }>, + extra?: Record + ) { + return request.post({ + url: '/core/dice/reward_config/DiceRewardConfig/generateIndexByRules', + data: { items, ...(extra || {}) } + }) + }, + /** * T1-T5、BIGWIN 权重配比:按档位分组获取配置列表 */ diff --git a/saiadmin-artd/src/views/plugin/dice/reward/index/modules/weight-edit-dialog.vue b/saiadmin-artd/src/views/plugin/dice/reward/index/modules/weight-edit-dialog.vue index e9d4909..f770839 100644 --- a/saiadmin-artd/src/views/plugin/dice/reward/index/modules/weight-edit-dialog.vue +++ b/saiadmin-artd/src/views/plugin/dice/reward/index/modules/weight-edit-dialog.vue @@ -15,7 +15,7 @@
{{ $t('page.weightShared.emptyTier') }}