Compare commits
11 Commits
f63616e735
...
master-v2
| Author | SHA1 | Date | |
|---|---|---|---|
| 68092759d3 | |||
| 8702cb0571 | |||
| ca620eb536 | |||
| 8684fdc9f0 | |||
| d72868eb76 | |||
| 6ff65afcb5 | |||
| b689a40595 | |||
| f9f8a1e169 | |||
| 3dbd68829a | |||
| 333e85f7d9 | |||
| db0e420a8f |
@@ -117,7 +117,8 @@
|
||||
right: 0,
|
||||
left: 0,
|
||||
bottom: 0, // 增加底部间距
|
||||
containLabel: true
|
||||
outerBoundsMode: 'same' as const,
|
||||
outerBoundsContain: 'axisLabel' as const
|
||||
}
|
||||
|
||||
const options: EChartsOption = {
|
||||
|
||||
@@ -75,7 +75,8 @@
|
||||
right: 20,
|
||||
bottom: props.showDataZoom ? 80 : 20,
|
||||
left: 20,
|
||||
containLabel: true
|
||||
outerBoundsMode: 'same',
|
||||
outerBoundsContain: 'axisLabel'
|
||||
},
|
||||
tooltip: getTooltipStyle('axis', {
|
||||
axisPointer: {
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left: 20,
|
||||
containLabel: true
|
||||
outerBoundsMode: 'same',
|
||||
outerBoundsContain: 'axisLabel'
|
||||
},
|
||||
tooltip: props.showTooltip
|
||||
? getTooltipStyle('item', {
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({ name: 'SaCheckbox', inheritAttrs: false })
|
||||
|
||||
@@ -69,6 +70,7 @@
|
||||
const modelValue = defineModel<(string | number)[]>()
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const { t, te, locale } = useI18n()
|
||||
|
||||
const canConvertToNumberStrict = (value: any) => {
|
||||
if (value == null) return false
|
||||
@@ -81,9 +83,20 @@
|
||||
}
|
||||
|
||||
const options = computed(() => {
|
||||
// 让字典选项在切换语言时可响应更新
|
||||
locale.value
|
||||
|
||||
const list = dictStore.getByCode(props.dict) || []
|
||||
|
||||
if (!props.valueType) return list
|
||||
if (!props.valueType) {
|
||||
return list.map((item) => {
|
||||
const key = `dict.${props.dict}.${item.value}`
|
||||
return {
|
||||
...item,
|
||||
label: te(key) ? t(key) : item.label
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return list.map((item) => {
|
||||
let newValue = item.value
|
||||
@@ -101,7 +114,11 @@
|
||||
|
||||
return {
|
||||
...item,
|
||||
value: newValue
|
||||
value: newValue,
|
||||
label: (() => {
|
||||
const key = `dict.${props.dict}.${newValue}`
|
||||
return te(key) ? t(key) : item.label
|
||||
})()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
:round="round"
|
||||
class="mr-1 last:mr-0"
|
||||
>
|
||||
{{ getData(item)?.label || item }}
|
||||
{{ getDisplayLabel(item) }}
|
||||
</ElTag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span v-for="(item, index) in normalizedValues" :key="index">
|
||||
{{ getData(item)?.label || item }}{{ index < normalizedValues.length - 1 ? '、' : '' }}
|
||||
{{ getDisplayLabel(item) }}{{ index < normalizedValues.length - 1 ? '、' : '' }}
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({ name: 'SaDict' })
|
||||
|
||||
@@ -50,6 +51,7 @@
|
||||
})
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const { t, te, locale } = useI18n()
|
||||
|
||||
// 统一处理 value,转换为数组格式
|
||||
const normalizedValues = computed(() => {
|
||||
@@ -64,6 +66,16 @@
|
||||
// 根据值获取字典数据
|
||||
const getData = (value: string) => dictStore.getDataByValue(props.dict, value)
|
||||
|
||||
const getDisplayLabel = (value: string) => {
|
||||
// 让显示在切换语言时可响应更新
|
||||
locale.value
|
||||
|
||||
const key = `dict.${props.dict}.${value}`
|
||||
if (te(key)) return t(key)
|
||||
|
||||
return getData(value)?.label || value
|
||||
}
|
||||
|
||||
const getColor = (color: string | undefined, type: 'bg' | 'border' | 'text') => {
|
||||
// 如果没有指定颜色,使用默认主色调
|
||||
if (!color) {
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({ name: 'SaRadio', inheritAttrs: false })
|
||||
|
||||
@@ -82,6 +83,7 @@
|
||||
const modelValue = defineModel<string | number | undefined>()
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const { t, te, locale } = useI18n()
|
||||
|
||||
// 判断能否转成数字
|
||||
const canConvertToNumberStrict = (value: any) => {
|
||||
@@ -97,10 +99,21 @@
|
||||
|
||||
// 核心逻辑:在 computed 中处理数据类型转换
|
||||
const options = computed(() => {
|
||||
// 让字典选项在切换语言时可响应更新
|
||||
locale.value
|
||||
|
||||
const list = dictStore.getByCode(props.dict) || []
|
||||
|
||||
// 如果没有指定 valueType,直接返回原始字典
|
||||
if (!props.valueType) return list
|
||||
if (!props.valueType) {
|
||||
return list.map((item) => {
|
||||
const key = `dict.${props.dict}.${item.value}`
|
||||
return {
|
||||
...item,
|
||||
label: te(key) ? t(key) : item.label
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 如果指定了类型,进行映射转换
|
||||
return list.map((item) => {
|
||||
@@ -119,7 +132,11 @@
|
||||
|
||||
return {
|
||||
...item,
|
||||
value: newValue
|
||||
value: newValue,
|
||||
label: (() => {
|
||||
const key = `dict.${props.dict}.${newValue}`
|
||||
return te(key) ? t(key) : item.label
|
||||
})()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({ name: 'SaSelect', inheritAttrs: false })
|
||||
|
||||
@@ -75,6 +76,7 @@
|
||||
const modelValue = defineModel<string | number | Array<string | number>>()
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const { t, te, locale } = useI18n()
|
||||
|
||||
// 判断能否转成数字
|
||||
const canConvertToNumberStrict = (value: any) => {
|
||||
@@ -90,10 +92,21 @@
|
||||
|
||||
// 计算属性:获取字典数据并处理类型转换
|
||||
const options = computed(() => {
|
||||
// 让字典选项在切换语言时可响应更新
|
||||
locale.value
|
||||
|
||||
const list = dictStore.getByCode(props.dict) || []
|
||||
|
||||
// 1. 如果没有指定 valueType,直接返回
|
||||
if (!props.valueType) return list
|
||||
if (!props.valueType) {
|
||||
return list.map((item) => {
|
||||
const key = `dict.${props.dict}.${item.value}`
|
||||
return {
|
||||
...item,
|
||||
label: te(key) ? t(key) : item.label
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 2. 如果指定了类型,进行映射转换
|
||||
return list.map((item) => {
|
||||
@@ -111,7 +124,11 @@
|
||||
|
||||
return {
|
||||
...item,
|
||||
value: newValue
|
||||
value: newValue,
|
||||
label: (() => {
|
||||
const key = `dict.${props.dict}.${newValue}`
|
||||
return te(key) ? t(key) : item.label
|
||||
})()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -345,7 +345,9 @@ export function useChart(options: UseChartOptions = {}) {
|
||||
right: 15,
|
||||
bottom: 8,
|
||||
left: 0,
|
||||
containLabel: true,
|
||||
// ECharts 6:替代已弃用的 containLabel(需配合 outerBounds 布局,避免控制台告警)
|
||||
outerBoundsMode: 'same' as const,
|
||||
outerBoundsContain: 'axisLabel' as const,
|
||||
...baseGrid
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,17 @@
|
||||
"labelName": "Name",
|
||||
"close": "Close"
|
||||
},
|
||||
"dict": {
|
||||
"data_status": {
|
||||
"1": "Normal",
|
||||
"2": "Disabled"
|
||||
},
|
||||
"gender": {
|
||||
"1": "Male",
|
||||
"2": "Female",
|
||||
"3": "Unknown"
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Search page",
|
||||
"historyTitle": "Search history",
|
||||
|
||||
@@ -31,7 +31,13 @@
|
||||
"rollNumber": "Roll Sum",
|
||||
"placeholderRollNumber": "Sum of 5 dice (5–30)",
|
||||
"rewardConfig": "Reward Config",
|
||||
"placeholderRewardConfig": "Select reward config (by UI text)"
|
||||
"placeholderRewardConfig": "Select reward config (by UI text)",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully",
|
||||
"validateFailed": "Validation failed, please check required fields and format"
|
||||
},
|
||||
"toolbar": {
|
||||
"platformTotalProfit": "Platform Total Profit"
|
||||
},
|
||||
"search": {
|
||||
"player": "Player",
|
||||
|
||||
@@ -33,5 +33,34 @@
|
||||
"rollNumber": "Roll Number",
|
||||
"rewardConfig": "Reward Config",
|
||||
"createTime": "Create Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Player Draw Record (Test)",
|
||||
"titleEdit": "Edit Player Draw Record (Test)",
|
||||
"labelLotteryConfigId": "Lottery Config ID",
|
||||
"placeholderLotteryConfigId": "Please enter lottery config id",
|
||||
"placeholderWinCoin": "Win coin",
|
||||
"placeholderRewardTier": "Please select tier (will auto fill reward config id)",
|
||||
"rewardConfigId": "Reward Config ID",
|
||||
"placeholderRewardConfigId": "Auto fill by tier or enter manually",
|
||||
"placeholderStartIndex": "Please enter start index",
|
||||
"labelTargetIndex": "Target Index",
|
||||
"placeholderTargetIndex": "Please enter target index",
|
||||
"placeholderRollNumber": "Please enter roll number",
|
||||
"labelRollArray": "Roll Array [1,2,3,4,5,6]",
|
||||
"placeholderRollArray": "Please enter roll array [1,2,3,4,5,6]",
|
||||
"labelStatus": "Status (0=fail, 1=success)",
|
||||
"placeholderSuperWinCoin": "Please enter super win coin",
|
||||
"placeholderRewardWinCoin": "Please enter reward win coin",
|
||||
"labelAdminId": "Admin ID",
|
||||
"placeholderAdminId": "Please enter admin id",
|
||||
"ruleLotteryConfigIdRequired": "Lottery config id is required",
|
||||
"ruleDrawTypeRequired": "Draw type is required",
|
||||
"ruleIsBigWinRequired": "Is big win is required",
|
||||
"ruleDirectionRequired": "Direction is required",
|
||||
"ruleRewardConfigIdRequired": "Reward config id is required",
|
||||
"ruleStatusRequired": "Status is required",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"t5Weight": "T5 Pool Weight (%)",
|
||||
"weightsSumHint": "Total pool weights: ",
|
||||
"weightsSumUnit": "% / 100% (must equal 100%)",
|
||||
"ruleWeightsSumMustBe100": "Total pool weights must equal 100%",
|
||||
"walletTitle": "Player Wallet Operation",
|
||||
"walletPlayer": "Player",
|
||||
"walletBalance": "Balance",
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
"placeholderFreeDrawCount": "Please enter free draw count",
|
||||
"totalDrawCount": "Total Draw Count",
|
||||
"placeholderTotalDrawCount": "Auto sum",
|
||||
"placeholderRemark": "Remark (required)"
|
||||
"placeholderRemark": "Remark (required)",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
},
|
||||
"search": {
|
||||
"player": "Player",
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
"placeholderWalletBefore": "Auto from selected user",
|
||||
"walletAfter": "After",
|
||||
"placeholderWalletAfter": "Auto calculated",
|
||||
"placeholderRemark": "Optional"
|
||||
"placeholderRemark": "Optional",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
},
|
||||
"search": {
|
||||
"type": "Type",
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"toolbar": {
|
||||
"weightRatio": "Weight Ratio",
|
||||
"weightTest": "Test Weight"
|
||||
"weightTest": "Test Weights"
|
||||
},
|
||||
"search": {
|
||||
"tier": "Tier",
|
||||
"clockwise": "Clockwise",
|
||||
"anticlockwise": "Anticlockwise"
|
||||
"anticlockwise": "Counter-clockwise",
|
||||
"optionBigwin": "BIGWIN"
|
||||
},
|
||||
"table": {
|
||||
"startIndex": "Start Index",
|
||||
@@ -17,5 +18,67 @@
|
||||
"realEv": "Real EV",
|
||||
"remark": "Remark",
|
||||
"weight": "Weight"
|
||||
},
|
||||
"weightShared": {
|
||||
"xAxisEndIndex": "End Index",
|
||||
"xAxisGridNumber": "Points",
|
||||
"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",
|
||||
"colRealEv": "Real EV",
|
||||
"colUiText": "Display Text",
|
||||
"colRemark": "Remark",
|
||||
"colWeightCwDir": "Clockwise weight (direction=0)",
|
||||
"colWeightCcwDir": "Counter-clockwise weight (direction=1)",
|
||||
"weightColSuffix": "Weight (1-10000)",
|
||||
"fetchFail": "Failed to load weight data",
|
||||
"nothingToSubmit": "Nothing to submit",
|
||||
"submitFail": "Save failed",
|
||||
"btnCancel": "Cancel",
|
||||
"btnSubmit": "Submit",
|
||||
"saveSuccess": "Saved successfully"
|
||||
},
|
||||
"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."
|
||||
},
|
||||
"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.",
|
||||
"tabClockwise": "Clockwise",
|
||||
"tabCounterclockwise": "Counter-clockwise"
|
||||
},
|
||||
"weightTest": {
|
||||
"title": "One-Click Weight Test",
|
||||
"alertTitle": "Bonus pool logic",
|
||||
"alertBody": "Same as playStart draw: uses name=default safety line and kill switch; when profit is below the line, paid tickets use player tier weights (custom below), free tickets use killScore; when profit reaches the line and kill is on, both use killScore.",
|
||||
"stepPaid": "Paid ticket",
|
||||
"stepFree": "Free ticket",
|
||||
"labelLotteryTypePaid": "Test pool type",
|
||||
"labelLotteryTypeFree": "Test pool type",
|
||||
"placeholderPaidPool": "Leave empty for custom tier odds below (default: default)",
|
||||
"placeholderFreePool": "Leave empty for custom tier odds below (default: killScore)",
|
||||
"tierProbHint": "Custom tier odds (T1–T5), each 0–100%, sum of five must not exceed 100%",
|
||||
"tierFieldLabel": "Tier {tier} (%)",
|
||||
"tierSumError": "Current sum of five tiers is {sum}%, cannot exceed 100%",
|
||||
"labelCwCount": "Clockwise spins",
|
||||
"labelCcwCount": "Counter-clockwise spins",
|
||||
"placeholderSelect": "Please select",
|
||||
"btnPrev": "Back",
|
||||
"btnNext": "Next",
|
||||
"btnStart": "Start test",
|
||||
"btnCancel": "Cancel",
|
||||
"warnTotalSpins": "At least one of paid/free direction spin counts must be greater than 0",
|
||||
"warnPaidTierSumPositive": "When no paid pool is selected, T1–T5 odds sum must be greater than 0",
|
||||
"warnPaidTierSumMax": "Paid T1–T5 odds sum cannot exceed 100%",
|
||||
"warnFreeTierSumPositive": "When no free pool is selected, T1–T5 odds sum must be greater than 0",
|
||||
"warnFreeTierSumMax": "Free T1–T5 odds sum cannot exceed 100%",
|
||||
"successCreated": "Test job created and will run in background. Check player draw records (test data) for results.",
|
||||
"failCreate": "Failed to create test job"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,74 @@
|
||||
{
|
||||
"toolbar": {
|
||||
"gameRewardConfig": "Game Reward Config",
|
||||
"createRewardRef": "Create Reward Reference"
|
||||
"createRewardRef": "Create Reward Reference",
|
||||
"createRewardRefTitle": "Rule: start_index=config(grid_number).id; clockwise end_index=(start_index+grid_number)%26; counter-clockwise end_index=start_index-grid_number>=0?start_index-grid_number:26+start_index-grid_number"
|
||||
},
|
||||
"configPage": {
|
||||
"tabIndex": "Reward Index",
|
||||
"tabBigwin": "Big Win Weights",
|
||||
"tipIndex": "Dice points must be between 5 and 30 and unique in this table.",
|
||||
"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",
|
||||
"colDisplayText": "Display Text",
|
||||
"colDisplayTextEn": "Display Text (EN)",
|
||||
"colRealEv": "Real Settlement",
|
||||
"colTier": "Tier",
|
||||
"colRemark": "Remark",
|
||||
"placeholderTierSelect": "Tier",
|
||||
"placeholderDisplayZh": "Display text (Chinese)",
|
||||
"placeholderDisplayEn": "Display text (English)",
|
||||
"placeholderRemark": "Remark",
|
||||
"btnSave": "Save",
|
||||
"btnReset": "Reset",
|
||||
"colBigwinPoints": "Big-Win Points",
|
||||
"colDisplayInfo": "Display Info",
|
||||
"colDisplayInfoEn": "Display Info (EN)",
|
||||
"colRealPrize": "Real Prize",
|
||||
"colWeightRange": "Weight (0-10000)",
|
||||
"placeholderDisplayInfoZh": "Display info (Chinese)",
|
||||
"placeholderDisplayInfoEn": "Display info (English)",
|
||||
"weightFixedTip": "Points 5 and 30 are fixed at 100%",
|
||||
"emptyBigwin": "No BIGWIN tier rows. Set tier to BIGWIN in the Reward Index tab first.",
|
||||
"confirmCreateRefTitle": "Create Reward Reference",
|
||||
"confirmCreateRefMsg": "Create reward reference by rule: start_index is the id of the cell for grid_number in reward config; clockwise end_index=(start_index+roll)%26; counter-clockwise end_index=start_index-roll if >=0 else 26+start_index-roll. Existing data will be cleared, then 26 points (5–30) for both directions will be generated. Continue?",
|
||||
"confirmCreateRefOk": "Create",
|
||||
"confirmCreateRefCancel": "Cancel",
|
||||
"createRefSuccess": "Created for 26 dice points (5–30), clockwise + counter-clockwise: clockwise added {cwNew}, counter-clockwise added {ccwNew}; clockwise updated {cwUp}, counter-clockwise updated {ccwUp}{skippedPart}",
|
||||
"createRefSuccessSkipped": "; {n} point(s) used fallback start index",
|
||||
"createRefSuccessSimple": "Created successfully",
|
||||
"createRefFail": "Failed to create reward reference",
|
||||
"loadIndexFail": "Failed to load reward index config",
|
||||
"saveSuccess": "Saved successfully",
|
||||
"saveFail": "Save failed",
|
||||
"resetIndexReloaded": "Reward index reloaded from server",
|
||||
"resetBigwinReloaded": "Big win weights reloaded from server",
|
||||
"warnNoIndexToSave": "No reward index rows to save",
|
||||
"warnGridRange": "Dice points must be between {min} and {max}",
|
||||
"dupJoiner": ", ",
|
||||
"warnDupGrid": "Duplicate dice points in this table: {list}",
|
||||
"warnNoBigwinToSave": "No BIGWIN rows to save",
|
||||
"warnBigwinDupGrid": "Duplicate big-win points in this table: {list}",
|
||||
"infoNoBigwin": "No BIGWIN rows. Set tier to BIGWIN in the Reward Index tab first."
|
||||
},
|
||||
"weightRatio": {
|
||||
"title": "T1–T5 Weight Ratio (Clockwise / Counter-clockwise)",
|
||||
"globalTip": "Weights come from dice_reward, split by end index (DiceRewardConfig.id) into clockwise and counter-clockwise; draw uses the weight set for the current direction.",
|
||||
"xAxisEndIndex": "End Index",
|
||||
"emptyTier": "No data for this tier",
|
||||
"sumLine": "Tier weight sum (clockwise): {cw}; counter-clockwise: {ccw} (each row 1–10000, ratio draw within tier, sum not limited)",
|
||||
"t4t5Note": "T4 and T5 have a single outcome; no weight configuration.",
|
||||
"colEndIndexId": "End Index (id)",
|
||||
"colDicePoints": "Dice Points",
|
||||
"colRealEv": "Real EV",
|
||||
"colUiText": "Display Text",
|
||||
"colWeightCw": "Clockwise weight (1-10000)",
|
||||
"colWeightCcw": "Counter-clockwise weight (1-10000)",
|
||||
"fetchFail": "Failed to load weight ratio data",
|
||||
"nothingToSubmit": "Nothing to submit",
|
||||
"submitFail": "Save failed",
|
||||
"saveSuccess": "Saved successfully"
|
||||
},
|
||||
"search": {
|
||||
"dicePoints": "Dice Points",
|
||||
@@ -19,5 +86,34 @@
|
||||
"realEv": "Real EV",
|
||||
"remark": "Remark",
|
||||
"weight": "Weight"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Reward Config",
|
||||
"titleEdit": "Edit Reward Config",
|
||||
"labelDicePoints": "Dice Points",
|
||||
"placeholderDicePoints": "Please enter dice points",
|
||||
"labelUiText": "Display Text",
|
||||
"placeholderUiText": "Please enter display text (Chinese)",
|
||||
"labelUiTextEn": "Display Text (EN)",
|
||||
"placeholderUiTextEn": "Please enter display text (English)",
|
||||
"labelRealEv": "Real EV",
|
||||
"placeholderRealEv": "Please enter real EV",
|
||||
"labelTier": "Tier",
|
||||
"placeholderTier": "Please select tier",
|
||||
"tierBigWin": "BIGWIN (Super Prize)",
|
||||
"labelBigWinWeight": "Big Win Weight",
|
||||
"placeholderBigWinWeight": "0~10000, 10000=100% win",
|
||||
"bigWinWeightDisabledTip": "For points 5 and 30, big win is guaranteed. Weight is fixed to 10000.",
|
||||
"bigWinWeightTip": "10000=100% win, 0=0% win; only effective for points 10/15/20/25",
|
||||
"labelRemark": "Remark",
|
||||
"placeholderRemark": "Please enter remark",
|
||||
"ruleDicePointsRequired": "Dice points is required",
|
||||
"ruleUiTextRequired": "Display text is required",
|
||||
"ruleUiTextEnMax": "Display text (EN) must be less than 255 characters",
|
||||
"ruleRealEvRequired": "Real EV is required",
|
||||
"ruleTierRequired": "Tier is required",
|
||||
"ruleBigWinWeightRange": "Big win weight must be between 0 and 10000",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
},
|
||||
"table": {
|
||||
"id": "ID",
|
||||
"clockwiseAbbr": "CW",
|
||||
"counterclockwiseAbbr": "CCW",
|
||||
"status": "Status",
|
||||
"paidDraw": "Paid Draw",
|
||||
"freeDraw": "Free Draw",
|
||||
@@ -14,5 +16,64 @@
|
||||
"statusFail": "Failed",
|
||||
"statusDone": "Done",
|
||||
"statusTesting": "Testing"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Reward Config Weight Test Record",
|
||||
"titleEdit": "Edit Reward Config Weight Test Record",
|
||||
"labelTestCount": "Test Count: 100/500/1000",
|
||||
"placeholderTestCount": "Please enter test count: 100/500/1000",
|
||||
"labelWeightSnapshot": "Weight Snapshot: save id,grid_number,tier,weight by tier",
|
||||
"placeholderWeightSnapshot": "Please enter weight snapshot: id,grid_number,tier,weight by tier",
|
||||
"labelResultCounts": "Result Counts: grid_number => count",
|
||||
"placeholderResultCounts": "Please enter result counts: grid_number => count",
|
||||
"ruleTestCountRequired": "Test count is required",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
},
|
||||
"detail": {
|
||||
"title": "Test Record Detail",
|
||||
"sectionBasic": "Basic Info",
|
||||
"recordId": "Record ID",
|
||||
"testCount": "Test count",
|
||||
"testCountSuffix": " runs",
|
||||
"createTime": "Created at",
|
||||
"admin": "Operator",
|
||||
"paidPoolId": "Paid lottery pool config ID",
|
||||
"freePoolId": "Free lottery pool config ID",
|
||||
"bigwinSnapshot": "BIGWIN weight snapshot",
|
||||
"sectionPaidTier": "Paid draw tier odds (T1–T5, used in test)",
|
||||
"sectionFreeTier": "Free draw tier odds (T1–T5, used in test)",
|
||||
"colTier": "Tier",
|
||||
"colWeight": "Weight",
|
||||
"colPercent": "Share",
|
||||
"emptyPaidTier": "No paid tier data (legacy records may only have tier_weights_snapshot)",
|
||||
"emptyFreeTier": "No free tier data",
|
||||
"sectionSnapshot": "Weight snapshot (T1–T5 / BIGWIN used in test)",
|
||||
"subCw": "Clockwise (non-BIGWIN)",
|
||||
"subCcw": "Counter-clockwise (non-BIGWIN)",
|
||||
"colGridNumber": "Dice points",
|
||||
"emptyCw": "No clockwise data",
|
||||
"emptyCcw": "No counter-clockwise data",
|
||||
"subBigwin": "BIGWIN (DiceRewardConfig snapshot)",
|
||||
"emptyBigwinTable": "No BIGWIN data",
|
||||
"sectionResult": "Landing stats (count per grid_number)",
|
||||
"chartXAxis": "Dice points (grid_number)",
|
||||
"emptyResult": "No landing data",
|
||||
"resultTotal": "Total landings: {n}",
|
||||
"btnImport": "Import to current config",
|
||||
"importTitle": "Import to production config",
|
||||
"importDesc": "Import this test record into DiceReward (cell weights), DiceRewardConfig (BIGWIN weight), and DiceLotteryPoolConfig (paid/free T1–T5 odds). Select target pools.",
|
||||
"importPaidLabel": "Import paid tier odds to pool",
|
||||
"importPaidPlaceholder": "Select a pool (paid pool recommended)",
|
||||
"importPaidTip": "If empty, uses paid pool ID saved on this record",
|
||||
"importFreeLabel": "Import free tier odds to pool",
|
||||
"importFreePlaceholder": "Select a pool (free pool recommended)",
|
||||
"importFreeTip": "If empty, uses free pool ID saved on this record",
|
||||
"btnConfirmImport": "Confirm import",
|
||||
"importSuccess": "Imported. DiceReward, DiceRewardConfig (BIGWIN), and pool config refreshed.",
|
||||
"importFail": "Import failed",
|
||||
"dash": "—",
|
||||
"dirCw": "Clockwise",
|
||||
"dirCcw": "Counter-clockwise"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,13 @@
|
||||
"fileType": "File Type",
|
||||
"fileSize": "File Size",
|
||||
"uploadTime": "Upload Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add File",
|
||||
"titleEdit": "Edit File",
|
||||
"labelFileName": "File Name",
|
||||
"placeholderFileName": "Please enter file name",
|
||||
"ruleFileNameRequired": "Please enter file name",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"search": {
|
||||
"deptName": "Dept Name",
|
||||
"deptName": "channel(Department) Name",
|
||||
"deptCode": "Dept Code",
|
||||
"status": "Status",
|
||||
"placeholderDeptName": "Please enter dept name",
|
||||
@@ -8,11 +8,32 @@
|
||||
"searchSelectPlaceholder": "Please select"
|
||||
},
|
||||
"table": {
|
||||
"deptName": "Dept Name",
|
||||
"deptName": "channel(Department) Name",
|
||||
"deptCode": "Dept Code",
|
||||
"leader": "Leader",
|
||||
"sort": "Sort",
|
||||
"status": "Status",
|
||||
"createTime": "Create Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Department",
|
||||
"titleEdit": "Edit Department",
|
||||
"labelParentDept": "Parent Department",
|
||||
"labelDeptName": "Dept Name",
|
||||
"labelDeptCode": "Dept Code",
|
||||
"labelLeader": "Leader",
|
||||
"labelRemark": "Description",
|
||||
"labelSort": "Sort",
|
||||
"labelStatus": "Enabled",
|
||||
"placeholderDeptName": "Please enter dept name",
|
||||
"placeholderDeptCode": "Please enter dept code",
|
||||
"placeholderRemark": "Please enter description",
|
||||
"placeholderSort": "Please enter sort",
|
||||
"noParentDept": "No parent department",
|
||||
"ruleParentDeptRequired": "Please select parent department",
|
||||
"ruleDeptNameRequired": "Please enter dept name",
|
||||
"ruleDeptCodeRequired": "Please enter dept code",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,49 @@
|
||||
"sort": "Sort",
|
||||
"status": "Status",
|
||||
"createTime": "Create Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Menu",
|
||||
"titleEdit": "Edit Menu",
|
||||
"labelMenuType": "Menu Type",
|
||||
"labelParentMenu": "Parent Menu",
|
||||
"labelMenuName": "Menu Name",
|
||||
"labelRoutePath": "Route Path",
|
||||
"labelRoutePathTip": "Top-level: absolute path starting with / (e.g. /dashboard). Sub-level: relative path (e.g. console, user).",
|
||||
"placeholderRoutePath": "e.g. /dashboard or console",
|
||||
"labelComponentName": "Component Name",
|
||||
"placeholderComponentName": "e.g. User",
|
||||
"labelComponentPath": "Component Path",
|
||||
"labelComponentPathTip": "Fill component path under views. For directory menu, leave empty.",
|
||||
"placeholderComponentPath": "e.g. /system/user or leave empty",
|
||||
"labelMenuIcon": "Menu Icon",
|
||||
"labelPermSlug": "Permission Slug",
|
||||
"placeholderPermSlug": "Please enter permission slug",
|
||||
"labelLinkUrl": "External Link",
|
||||
"placeholderLinkUrl": "e.g. https://saithink.top",
|
||||
"labelSort": "Sort",
|
||||
"labelSortTip": "Larger number comes first",
|
||||
"placeholderSort": "Please enter sort",
|
||||
"labelStatus": "Status",
|
||||
"labelStatusTip": "After disabled, this menu item will be unavailable",
|
||||
"labelIsIframe": "Embedded",
|
||||
"labelIsIframeTip": "Only effective in external link mode",
|
||||
"labelIsKeepAlive": "Keep Alive",
|
||||
"labelIsKeepAliveTip": "Switching tabs won't refresh",
|
||||
"labelIsHidden": "Hidden",
|
||||
"labelIsHiddenTip": "Hidden in menu but accessible via route",
|
||||
"labelIsFixedTab": "Fixed Tab",
|
||||
"labelIsFixedTabTip": "Fixed in tabs bar",
|
||||
"labelIsFullPage": "Full Page",
|
||||
"labelIsFullPageTip": "Do not inherit side menu and top bar",
|
||||
"noParentMenu": "No parent menu",
|
||||
"ruleParentMenuRequired": "Please select parent menu",
|
||||
"ruleMenuNameRequired": "Please enter menu name",
|
||||
"ruleRoutePathRequired": "Please enter route path",
|
||||
"ruleComponentNameRequired": "Please enter component name",
|
||||
"rulePermSlugRequired": "Please enter permission slug",
|
||||
"ruleLinkUrlRequired": "Please enter external link",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,5 +13,22 @@
|
||||
"sort": "Sort",
|
||||
"status": "Status",
|
||||
"createTime": "Create Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Post",
|
||||
"titleEdit": "Edit Post",
|
||||
"labelName": "Post Name",
|
||||
"labelCode": "Post Code",
|
||||
"labelRemark": "Description",
|
||||
"labelSort": "Sort",
|
||||
"labelStatus": "Enabled",
|
||||
"placeholderName": "Please enter post name",
|
||||
"placeholderCode": "Please enter post code",
|
||||
"placeholderRemark": "Please enter description",
|
||||
"placeholderSort": "Please enter sort",
|
||||
"ruleNameRequired": "Please enter post name",
|
||||
"ruleCodeRequired": "Please enter post code",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,25 @@
|
||||
"roleRemark": "Role Description",
|
||||
"status": "Status",
|
||||
"createTime": "Create Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Role",
|
||||
"titleEdit": "Edit Role",
|
||||
"labelName": "Role Name",
|
||||
"labelCode": "Role Code",
|
||||
"labelLevel": "Role Level",
|
||||
"levelTip": "Controls role permission level, cannot operate roles with higher level than your own",
|
||||
"labelRemark": "Description",
|
||||
"labelSort": "Sort",
|
||||
"labelStatus": "Enabled",
|
||||
"placeholderName": "Please enter role name",
|
||||
"placeholderCode": "Please enter role code",
|
||||
"placeholderRemark": "Please enter role description",
|
||||
"placeholderSort": "Please enter sort",
|
||||
"ruleNameRequired": "Please enter role name",
|
||||
"ruleCodeRequired": "Please enter role code",
|
||||
"ruleLevelRequired": "Please enter role level",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,35 @@
|
||||
"status": "Status",
|
||||
"createTime": "Create Time",
|
||||
"updateTime": "Update Time"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add User",
|
||||
"titleEdit": "Edit User",
|
||||
"labelAvatar": "Avatar",
|
||||
"labelUsername": "Username",
|
||||
"labelRealname": "Real Name",
|
||||
"labelPassword": "Password",
|
||||
"labelPasswordConfirm": "Confirm Password",
|
||||
"labelEmail": "Email",
|
||||
"labelPhone": "Phone",
|
||||
"labelDept": "Department",
|
||||
"labelRole": "Role",
|
||||
"labelPost": "Post",
|
||||
"labelGender": "Gender",
|
||||
"labelStatus": "Status",
|
||||
"labelRemark": "Remark",
|
||||
"placeholderEmail": "Please enter email",
|
||||
"placeholderPhone": "Please enter phone",
|
||||
"placeholderRemark": "Please enter remark",
|
||||
"rulePasswordNotMatch": "Passwords do not match",
|
||||
"ruleUsernameRequired": "Please enter username",
|
||||
"ruleUsernameLength": "Length must be between 2 and 20 characters",
|
||||
"rulePasswordRequired": "Please enter password",
|
||||
"rulePasswordLength": "Length must be between 6 and 20 characters",
|
||||
"rulePasswordConfirmRequired": "Please enter confirm password",
|
||||
"ruleDeptRequired": "Please select department",
|
||||
"ruleRoleRequired": "Please select role",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,46 @@
|
||||
"executeTime": "Execute Time",
|
||||
"parameter": "Parameter",
|
||||
"executeStatus": "Status"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "Add Scheduled Task",
|
||||
"titleEdit": "Edit Scheduled Task",
|
||||
"labelName": "Task Name",
|
||||
"labelType": "Task Type",
|
||||
"labelTaskStyle": "Schedule Rule",
|
||||
"labelTarget": "Target",
|
||||
"labelParams": "Parameters",
|
||||
"labelStatus": "Status",
|
||||
"labelRemark": "Remark",
|
||||
"placeholderName": "Please enter task name",
|
||||
"placeholderTarget": "Please enter target",
|
||||
"placeholderParams": "Please enter parameters",
|
||||
"placeholderRemark": "Please enter remark",
|
||||
"taskStyleEveryDay": "Every day",
|
||||
"taskStyleEveryHour": "Every hour",
|
||||
"taskStyleNHours": "N hours",
|
||||
"taskStyleNMinutes": "N minutes",
|
||||
"taskStyleNSeconds": "N seconds",
|
||||
"taskStyleEveryWeek": "Every week",
|
||||
"taskStyleEveryMonth": "Every month",
|
||||
"taskStyleEveryYear": "Every year",
|
||||
"weekMon": "Mon",
|
||||
"weekTue": "Tue",
|
||||
"weekWed": "Wed",
|
||||
"weekThu": "Thu",
|
||||
"weekFri": "Fri",
|
||||
"weekSat": "Sat",
|
||||
"weekSun": "Sun",
|
||||
"unitMonth": "Month",
|
||||
"unitDay": "Day",
|
||||
"unitHour": "Hour",
|
||||
"unitMinute": "Minute",
|
||||
"unitSecond": "Second",
|
||||
"ruleNameRequired": "Task name is required",
|
||||
"ruleTypeRequired": "Task type is required",
|
||||
"ruleTaskStyleRequired": "Schedule rule is required",
|
||||
"ruleTargetRequired": "Target is required",
|
||||
"addSuccess": "Added successfully",
|
||||
"editSuccess": "Updated successfully"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,17 @@
|
||||
"labelName": "名称",
|
||||
"close": "关闭"
|
||||
},
|
||||
"dict": {
|
||||
"data_status": {
|
||||
"1": "正常",
|
||||
"2": "停用"
|
||||
},
|
||||
"gender": {
|
||||
"1": "男",
|
||||
"2": "女",
|
||||
"3": "未知"
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "搜索页面",
|
||||
"historyTitle": "搜索历史",
|
||||
@@ -323,7 +334,7 @@
|
||||
"role": "角色管理",
|
||||
"userCenter": "个人中心",
|
||||
"menu": "菜单管理",
|
||||
"dept": "部门管理",
|
||||
"dept": "渠道(部门)管理",
|
||||
"post": "岗位管理",
|
||||
"config": "系统配置"
|
||||
},
|
||||
|
||||
@@ -31,7 +31,13 @@
|
||||
"rollNumber": "摇取点数和",
|
||||
"placeholderRollNumber": "5 个色子点数之和(5~30)",
|
||||
"rewardConfig": "奖励配置",
|
||||
"placeholderRewardConfig": "请选择奖励配置(显示前端文本)"
|
||||
"placeholderRewardConfig": "请选择奖励配置(显示前端文本)",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功",
|
||||
"validateFailed": "表单验证失败,请检查必填项与格式"
|
||||
},
|
||||
"toolbar": {
|
||||
"platformTotalProfit": "平台总盈利"
|
||||
},
|
||||
"search": {
|
||||
"player": "玩家",
|
||||
|
||||
@@ -33,5 +33,34 @@
|
||||
"rollNumber": "摇取点数和",
|
||||
"rewardConfig": "奖励配置",
|
||||
"createTime": "创建时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增玩家抽奖记录(测试数据)",
|
||||
"titleEdit": "编辑玩家抽奖记录(测试数据)",
|
||||
"labelLotteryConfigId": "彩金池配置id",
|
||||
"placeholderLotteryConfigId": "请输入彩金池配置id",
|
||||
"placeholderWinCoin": "赢取平台币",
|
||||
"placeholderRewardTier": "请选择档位(选后自动带出奖励配置ID)",
|
||||
"rewardConfigId": "奖励配置id",
|
||||
"placeholderRewardConfigId": "可选中奖档位自动带出或手动输入",
|
||||
"placeholderStartIndex": "请输入起始索引",
|
||||
"labelTargetIndex": "结束索引",
|
||||
"placeholderTargetIndex": "请输入结束索引",
|
||||
"placeholderRollNumber": "请输入摇取点数和",
|
||||
"labelRollArray": "摇取点数:[1,2,3,4,5,6]",
|
||||
"placeholderRollArray": "请输入摇取点数:[1,2,3,4,5,6]",
|
||||
"labelStatus": "状态:0=失败,1=成功",
|
||||
"placeholderSuperWinCoin": "请输入中大奖平台币",
|
||||
"placeholderRewardWinCoin": "请输入摇色子中奖平台币",
|
||||
"labelAdminId": "所属管理员",
|
||||
"placeholderAdminId": "请输入所属管理员",
|
||||
"ruleLotteryConfigIdRequired": "彩金池配置id必需填写",
|
||||
"ruleDrawTypeRequired": "抽奖类型必需填写",
|
||||
"ruleIsBigWinRequired": "是否中大奖必需填写",
|
||||
"ruleDirectionRequired": "方向必需填写",
|
||||
"ruleRewardConfigIdRequired": "奖励配置id必需填写",
|
||||
"ruleStatusRequired": "状态必需填写",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"t5Weight": "T5池权重(%)",
|
||||
"weightsSumHint": "五个池权重总和:",
|
||||
"weightsSumUnit": "% / 100%(必须为100%)",
|
||||
"ruleWeightsSumMustBe100": "五个池权重总和必须为100%",
|
||||
"walletTitle": "玩家钱包操作",
|
||||
"walletPlayer": "玩家",
|
||||
"walletBalance": "钱包余额",
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
"placeholderFreeDrawCount": "请输入赠送抽奖次数",
|
||||
"totalDrawCount": "总抽奖次数",
|
||||
"placeholderTotalDrawCount": "自动求和",
|
||||
"placeholderRemark": "请输入备注(必填)"
|
||||
"placeholderRemark": "请输入备注(必填)",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
},
|
||||
"search": {
|
||||
"player": "玩家",
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
"placeholderWalletBefore": "选择用户后自动带出当前平台币",
|
||||
"walletAfter": "钱包操作后",
|
||||
"placeholderWalletAfter": "根据平台币变化自动计算",
|
||||
"placeholderRemark": "选填"
|
||||
"placeholderRemark": "选填",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
},
|
||||
"search": {
|
||||
"type": "类型",
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"search": {
|
||||
"tier": "档位",
|
||||
"clockwise": "顺时针",
|
||||
"anticlockwise": "逆时针"
|
||||
"anticlockwise": "逆时针",
|
||||
"optionBigwin": "BIGWIN"
|
||||
},
|
||||
"table": {
|
||||
"startIndex": "起始索引",
|
||||
@@ -17,5 +18,67 @@
|
||||
"realEv": "实际中奖金额",
|
||||
"remark": "备注",
|
||||
"weight": "权重(1-10000)"
|
||||
},
|
||||
"weightShared": {
|
||||
"xAxisEndIndex": "结束索引",
|
||||
"xAxisGridNumber": "点数",
|
||||
"emptyTier": "该档位暂无配置数据",
|
||||
"sumLineDual": "当前档位权重合计(顺时针):{cw};逆时针:{ccw}(各条 1-10000,档位内按权重比抽取,和不限制)",
|
||||
"sumLineSingle": "当前档位权重合计:{sum}(各条 1-10000,档位内按权重比抽取,和不限制)",
|
||||
"t4t5NoteSingle": "T4、T5 仅单一结果,无需配置权重。",
|
||||
"t4t5NoteDual": "T4、T5 档位抽中时仅有一个结果,无需配置权重。",
|
||||
"colEndIndexId": "结束索引(id)",
|
||||
"colGridNumber": "点数(grid_number)",
|
||||
"colDicePoints": "色子点数",
|
||||
"colRealEv": "实际中奖金额",
|
||||
"colUiText": "显示文本",
|
||||
"colRemark": "备注",
|
||||
"colWeightCwDir": "顺时针权重(direction=0)",
|
||||
"colWeightCcwDir": "逆时针权重(direction=1)",
|
||||
"weightColSuffix": "权重(1-10000)",
|
||||
"fetchFail": "获取权重数据失败",
|
||||
"nothingToSubmit": "没有可提交的配置",
|
||||
"submitFail": "保存失败",
|
||||
"btnCancel": "取消",
|
||||
"btnSubmit": "提交",
|
||||
"saveSuccess": "保存成功"
|
||||
},
|
||||
"weightEdit": {
|
||||
"title": "奖励对照表(dice_reward)权重配比",
|
||||
"globalTip": "编辑的是奖励对照表(dice_reward / DiceReward 模型)的权重,按结束索引(end_index)区分顺时针与逆时针两套权重;抽奖时按当前方向取对应权重。"
|
||||
},
|
||||
"weightRatio": {
|
||||
"title": "权重配比",
|
||||
"globalTip": "配置奖励对照表(dice_reward)的权重,一级按方向(顺时针/逆时针),二级按档位(T1-T5);各条权重 1-10000,档位内按权重比抽取。",
|
||||
"tabClockwise": "顺时针",
|
||||
"tabCounterclockwise": "逆时针"
|
||||
},
|
||||
"weightTest": {
|
||||
"title": "一键测试权重",
|
||||
"alertTitle": "彩金池逻辑说明",
|
||||
"alertBody": "与 playStart 抽奖逻辑一致:使用 name=default 的安全线、杀分开关;盈利未达安全线时,付费抽奖券使用玩家自身权重(下方自定义档位),免费抽奖券使用 killScore 配置;盈利达到安全线且杀分开启时,付费/免费均使用 killScore 配置。",
|
||||
"stepPaid": "付费抽奖券",
|
||||
"stepFree": "免费抽奖券",
|
||||
"labelLotteryTypePaid": "测试数据档位类型",
|
||||
"labelLotteryTypeFree": "测试数据档位类型",
|
||||
"placeholderPaidPool": "不选则下方自定义档位概率(默认 default)",
|
||||
"placeholderFreePool": "不选则下方自定义档位概率(默认 killScore)",
|
||||
"tierProbHint": "自定义档位概率(T1~T5),每档 0-100%,五档之和不能超过 100%",
|
||||
"tierFieldLabel": "档位 {tier}(%)",
|
||||
"tierSumError": "当前五档之和为 {sum}%,不能超过 100%",
|
||||
"labelCwCount": "顺时针次数",
|
||||
"labelCcwCount": "逆时针次数",
|
||||
"placeholderSelect": "请选择",
|
||||
"btnPrev": "上一步",
|
||||
"btnNext": "下一步",
|
||||
"btnStart": "开始测试",
|
||||
"btnCancel": "取消",
|
||||
"warnTotalSpins": "付费或免费至少一种方向次数之和大于 0",
|
||||
"warnPaidTierSumPositive": "付费未选奖池时,T1~T5 档位概率之和需大于 0",
|
||||
"warnPaidTierSumMax": "付费档位概率 T1~T5 之和不能超过 100%",
|
||||
"warnFreeTierSumPositive": "免费未选奖池时,T1~T5 档位概率之和需大于 0",
|
||||
"warnFreeTierSumMax": "免费档位概率 T1~T5 之和不能超过 100%",
|
||||
"successCreated": "测试任务已创建,后台将自动执行。请在【玩家抽奖记录(测试数据)】中查看生成的测试数据",
|
||||
"failCreate": "创建测试任务失败"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,74 @@
|
||||
{
|
||||
"toolbar": {
|
||||
"gameRewardConfig": "游戏奖励配置",
|
||||
"createRewardRef": "创建奖励对照"
|
||||
"createRewardRef": "创建奖励对照",
|
||||
"createRewardRefTitle": "按规则:start_index=config(grid_number).id;顺时针 end_index=(start_index+grid_number)%26;逆时针 end_index=start_index-grid_number≥0?start_index-grid_number:26+start_index-grid_number"
|
||||
},
|
||||
"configPage": {
|
||||
"tabIndex": "奖励索引",
|
||||
"tabBigwin": "大奖权重",
|
||||
"tipIndex": "色子点数须在 5~30 之间且本表内不重复。",
|
||||
"tipBigwin": "从左至右:中大奖点数(不可改)、显示信息、实际中奖、备注、权重(0~10000)。点数 5、30 权重固定 100%。本表单独立提交,仅提交大奖权重。",
|
||||
"colId": "索引(id)",
|
||||
"colDicePoints": "色子点数",
|
||||
"colDisplayText": "显示文本",
|
||||
"colDisplayTextEn": "显示文本(英文)",
|
||||
"colRealEv": "真实结算",
|
||||
"colTier": "所属档位",
|
||||
"colRemark": "备注",
|
||||
"placeholderTierSelect": "档位",
|
||||
"placeholderDisplayZh": "显示文本(中文)",
|
||||
"placeholderDisplayEn": "显示文本(英文)",
|
||||
"placeholderRemark": "备注",
|
||||
"btnSave": "保存",
|
||||
"btnReset": "重置",
|
||||
"colBigwinPoints": "中大奖点数",
|
||||
"colDisplayInfo": "显示信息",
|
||||
"colDisplayInfoEn": "显示信息(英文)",
|
||||
"colRealPrize": "实际中奖",
|
||||
"colWeightRange": "权重(0-10000)",
|
||||
"placeholderDisplayInfoZh": "显示信息(中文)",
|
||||
"placeholderDisplayInfoEn": "显示信息(英文)",
|
||||
"weightFixedTip": "点数 5、30 固定 100%",
|
||||
"emptyBigwin": "暂无 BIGWIN 档位配置,请在「奖励索引」中设置 tier 为 BIGWIN。",
|
||||
"confirmCreateRefTitle": "创建奖励对照",
|
||||
"confirmCreateRefMsg": "按规则创建奖励对照:起始索引 start_index=奖励配置中 grid_number 对应格位的 id;顺时针 end_index=(start_index+摇取点数)%26;逆时针 end_index=start_index-摇取点数≥0 则取该值,否则 26+start_index-摇取点数。先清空现有数据再为 5-30 共 26 个点数、顺/逆时针分别生成。是否继续?",
|
||||
"confirmCreateRefOk": "确定创建",
|
||||
"confirmCreateRefCancel": "取消",
|
||||
"createRefSuccess": "已按 5-30 共 26 个点数、顺时针+逆时针创建:顺时针新增 {cwNew} 条、逆时针新增 {ccwNew} 条;顺时针更新 {cwUp} 条、逆时针更新 {ccwUp} 条{skippedPart}",
|
||||
"createRefSuccessSkipped": ";{n} 个点数使用兜底起始索引",
|
||||
"createRefSuccessSimple": "创建成功",
|
||||
"createRefFail": "创建奖励对照失败",
|
||||
"loadIndexFail": "获取奖励索引配置失败",
|
||||
"saveSuccess": "保存成功",
|
||||
"saveFail": "保存失败",
|
||||
"resetIndexReloaded": "已重新加载奖励索引,恢复为服务器最新数据",
|
||||
"resetBigwinReloaded": "已重新加载,大奖权重恢复为服务器最新数据",
|
||||
"warnNoIndexToSave": "暂无奖励索引数据可保存",
|
||||
"warnGridRange": "色子点数必须在 {min}~{max} 之间",
|
||||
"dupJoiner": "、",
|
||||
"warnDupGrid": "色子点数在本表内不能重复,重复的点数为:{list}",
|
||||
"warnNoBigwinToSave": "暂无 BIGWIN 档位配置可保存",
|
||||
"warnBigwinDupGrid": "大奖权重本表内点数不能重复,重复的点数为:{list}",
|
||||
"infoNoBigwin": "暂无 BIGWIN 档位配置,请先在「奖励索引」中设置 tier 为 BIGWIN"
|
||||
},
|
||||
"weightRatio": {
|
||||
"title": "T1-T5 权重配比(顺时针/逆时针)",
|
||||
"globalTip": "权重来自奖励对照表(dice_reward),按结束索引(DiceRewardConfig.id)区分顺时针与逆时针两套权重;抽奖时按当前方向取对应权重。",
|
||||
"xAxisEndIndex": "结束索引",
|
||||
"emptyTier": "该档位暂无配置数据",
|
||||
"sumLine": "当前档位权重合计(顺时针):{cw};逆时针:{ccw}(各条 1-10000,档位内按权重比抽取,和不限制)",
|
||||
"t4t5Note": "T4、T5 档位抽中时仅有一个结果,无需配置权重。",
|
||||
"colEndIndexId": "结束索引(id)",
|
||||
"colDicePoints": "色子点数",
|
||||
"colRealEv": "实际中奖金额",
|
||||
"colUiText": "显示文本",
|
||||
"colWeightCw": "顺时针权重(1-10000)",
|
||||
"colWeightCcw": "逆时针权重(1-10000)",
|
||||
"fetchFail": "获取权重配比数据失败",
|
||||
"nothingToSubmit": "没有可提交的配置",
|
||||
"submitFail": "保存失败",
|
||||
"saveSuccess": "保存成功"
|
||||
},
|
||||
"search": {
|
||||
"dicePoints": "色子点数(摇取5-30)",
|
||||
@@ -19,5 +86,34 @@
|
||||
"realEv": "实际中奖金额",
|
||||
"remark": "备注",
|
||||
"weight": "权重(1-10000)"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增奖励配置",
|
||||
"titleEdit": "编辑奖励配置",
|
||||
"labelDicePoints": "色子点数",
|
||||
"placeholderDicePoints": "请输入色子点数",
|
||||
"labelUiText": "前端显示文本",
|
||||
"placeholderUiText": "请输入前端显示文本(中文)",
|
||||
"labelUiTextEn": "前端显示文本(英文)",
|
||||
"placeholderUiTextEn": "请输入前端显示文本(英文)",
|
||||
"labelRealEv": "真实资金结算",
|
||||
"placeholderRealEv": "请输入真实资金结算",
|
||||
"labelTier": "所属档位",
|
||||
"placeholderTier": "请选择所属档位",
|
||||
"tierBigWin": "BIGWIN(超级大奖)",
|
||||
"labelBigWinWeight": "大奖权重",
|
||||
"placeholderBigWinWeight": "0~10000,10000=100%中奖",
|
||||
"bigWinWeightDisabledTip": "点数 5、30 摇到必中大奖,权重固定 10000",
|
||||
"bigWinWeightTip": "10000=100% 中奖,0=0% 中奖;仅对点数 10/15/20/25 生效",
|
||||
"labelRemark": "备注",
|
||||
"placeholderRemark": "请输入备注",
|
||||
"ruleDicePointsRequired": "色子点数必需填写",
|
||||
"ruleUiTextRequired": "前端显示文本必需填写",
|
||||
"ruleUiTextEnMax": "前端显示文本(英文)长度需小于 255 字符",
|
||||
"ruleRealEvRequired": "真实资金结算必需填写",
|
||||
"ruleTierRequired": "所属档位必需填写",
|
||||
"ruleBigWinWeightRange": "大奖权重 0~10000",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
},
|
||||
"table": {
|
||||
"id": "ID",
|
||||
"clockwiseAbbr": "顺",
|
||||
"counterclockwiseAbbr": "逆",
|
||||
"status": "状态",
|
||||
"paidDraw": "付费抽取",
|
||||
"freeDraw": "免费抽取",
|
||||
@@ -14,5 +16,64 @@
|
||||
"statusFail": "失败",
|
||||
"statusDone": "完成",
|
||||
"statusTesting": "测试中"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增奖励配置权重测试记录",
|
||||
"titleEdit": "编辑奖励配置权重测试记录",
|
||||
"labelTestCount": "测试次数:100/500/1000",
|
||||
"placeholderTestCount": "请输入测试次数:100/500/1000",
|
||||
"labelWeightSnapshot": "测试时权重配比快照:按档位保存 id,grid_number,tier,weight",
|
||||
"placeholderWeightSnapshot": "请输入测试时权重配比快照:按档位保存 id,grid_number,tier,weight",
|
||||
"labelResultCounts": "落点统计:grid_number=>出现次数",
|
||||
"placeholderResultCounts": "请输入落点统计:grid_number=>出现次数",
|
||||
"ruleTestCountRequired": "测试次数:100/500/1000必需填写",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
},
|
||||
"detail": {
|
||||
"title": "测试记录详情",
|
||||
"sectionBasic": "基本信息",
|
||||
"recordId": "记录ID",
|
||||
"testCount": "测试次数",
|
||||
"testCountSuffix": "次",
|
||||
"createTime": "创建时间",
|
||||
"admin": "执行管理员",
|
||||
"paidPoolId": "付费奖池配置ID",
|
||||
"freePoolId": "免费奖池配置ID",
|
||||
"bigwinSnapshot": "BIGWIN 权重快照",
|
||||
"sectionPaidTier": "付费抽奖档位概率(T1-T5,测试时使用)",
|
||||
"sectionFreeTier": "免费抽奖档位概率(T1-T5,测试时使用)",
|
||||
"colTier": "档位",
|
||||
"colWeight": "权重",
|
||||
"colPercent": "占比",
|
||||
"emptyPaidTier": "暂无付费档位数据(旧记录可能仅保存 tier_weights_snapshot)",
|
||||
"emptyFreeTier": "暂无免费档位数据",
|
||||
"sectionSnapshot": "权重配比快照(测试时使用的 T1-T5/BIGWIN 配置)",
|
||||
"subCw": "顺时针(非 BIGWIN)",
|
||||
"subCcw": "逆时针(非 BIGWIN)",
|
||||
"colGridNumber": "色子点数",
|
||||
"emptyCw": "暂无顺时针数据",
|
||||
"emptyCcw": "暂无逆时针数据",
|
||||
"subBigwin": "BIGWIN(按 DiceRewardConfig 配置快照)",
|
||||
"emptyBigwinTable": "暂无 BIGWIN 数据",
|
||||
"sectionResult": "落点统计(各 grid_number 出现次数)",
|
||||
"chartXAxis": "色子点数 (grid_number)",
|
||||
"emptyResult": "暂无落点数据",
|
||||
"resultTotal": "总落点次数:{n}",
|
||||
"btnImport": "导入到当前配置",
|
||||
"importTitle": "导入到正式配置",
|
||||
"importDesc": "将本测试记录导入:DiceReward(格子权重)、DiceRewardConfig(BIGWIN weight)、DiceLotteryPoolConfig(付费/免费 T1-T5 档位概率)。请选择要写入的奖池。",
|
||||
"importPaidLabel": "导入付费档位概率到奖池",
|
||||
"importPaidPlaceholder": "选择任意奖池(建议付费池)",
|
||||
"importPaidTip": "不选则使用本记录保存时的付费奖池配置 ID",
|
||||
"importFreeLabel": "导入免费档位概率到奖池",
|
||||
"importFreePlaceholder": "选择任意奖池(建议免费池)",
|
||||
"importFreeTip": "不选则使用本记录保存时的免费奖池配置 ID",
|
||||
"btnConfirmImport": "确认导入",
|
||||
"importSuccess": "导入成功,已刷新 DiceReward、DiceRewardConfig(BIGWIN)、奖池配置",
|
||||
"importFail": "导入失败",
|
||||
"dash": "—",
|
||||
"dirCw": "顺时针",
|
||||
"dirCcw": "逆时针"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,13 @@
|
||||
"fileType": "文件类型",
|
||||
"fileSize": "文件大小",
|
||||
"uploadTime": "上传时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增文件",
|
||||
"titleEdit": "编辑文件",
|
||||
"labelFileName": "文件名称",
|
||||
"placeholderFileName": "请输入文件名称",
|
||||
"ruleFileNameRequired": "请输入文件名称",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"search": {
|
||||
"deptName": "部门名称",
|
||||
"deptName": "渠道(部门)名称",
|
||||
"deptCode": "部门编码",
|
||||
"status": "状态",
|
||||
"placeholderDeptName": "请输入部门名称",
|
||||
@@ -8,11 +8,32 @@
|
||||
"searchSelectPlaceholder": "请选择"
|
||||
},
|
||||
"table": {
|
||||
"deptName": "部门名称",
|
||||
"deptName": "渠道(部门)名称",
|
||||
"deptCode": "部门编码",
|
||||
"leader": "部门领导",
|
||||
"sort": "排序",
|
||||
"status": "状态",
|
||||
"createTime": "创建时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增部门",
|
||||
"titleEdit": "编辑部门",
|
||||
"labelParentDept": "上级部门",
|
||||
"labelDeptName": "部门名称",
|
||||
"labelDeptCode": "部门编码",
|
||||
"labelLeader": "部门领导",
|
||||
"labelRemark": "描述",
|
||||
"labelSort": "排序",
|
||||
"labelStatus": "启用",
|
||||
"placeholderDeptName": "请输入部门名称",
|
||||
"placeholderDeptCode": "请输入部门编码",
|
||||
"placeholderRemark": "请输入部门描述",
|
||||
"placeholderSort": "请输入排序",
|
||||
"noParentDept": "无上级部门",
|
||||
"ruleParentDeptRequired": "请选择上级部门",
|
||||
"ruleDeptNameRequired": "请输入部门名称",
|
||||
"ruleDeptCodeRequired": "请输入部门编码",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,49 @@
|
||||
"sort": "排序",
|
||||
"status": "状态",
|
||||
"createTime": "创建时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增菜单",
|
||||
"titleEdit": "编辑菜单",
|
||||
"labelMenuType": "菜单类型",
|
||||
"labelParentMenu": "上级菜单",
|
||||
"labelMenuName": "菜单名称",
|
||||
"labelRoutePath": "路由地址",
|
||||
"labelRoutePathTip": "一级菜单:以 / 开头的绝对路径(如 /dashboard) 二级及以下:相对路径(如 console、user)",
|
||||
"placeholderRoutePath": "如:/dashboard 或 console",
|
||||
"labelComponentName": "组件名称",
|
||||
"placeholderComponentName": "如: User",
|
||||
"labelComponentPath": "组件路径",
|
||||
"labelComponentPathTip": "填写组件路径(views目录下) 目录菜单:留空",
|
||||
"placeholderComponentPath": "如:/system/user 或留空",
|
||||
"labelMenuIcon": "菜单图标",
|
||||
"labelPermSlug": "权限标识",
|
||||
"placeholderPermSlug": "请输入权限标识",
|
||||
"labelLinkUrl": "外链地址",
|
||||
"placeholderLinkUrl": "如:https://saithink.top",
|
||||
"labelSort": "排序",
|
||||
"labelSortTip": "数字越大越靠前",
|
||||
"placeholderSort": "请输入排序",
|
||||
"labelStatus": "状态",
|
||||
"labelStatusTip": "禁用后,该菜单项将不可用",
|
||||
"labelIsIframe": "是否内嵌",
|
||||
"labelIsIframeTip": "外链模式下有效",
|
||||
"labelIsKeepAlive": "是否缓存",
|
||||
"labelIsKeepAliveTip": "切换tabs不刷新",
|
||||
"labelIsHidden": "是否隐藏",
|
||||
"labelIsHiddenTip": "不在菜单栏显示,但是可以通过路由访问",
|
||||
"labelIsFixedTab": "是否固定",
|
||||
"labelIsFixedTabTip": "固定在tabs导航栏",
|
||||
"labelIsFullPage": "是否全屏",
|
||||
"labelIsFullPageTip": "不继承左侧菜单和顶部导航栏",
|
||||
"noParentMenu": "无上级菜单",
|
||||
"ruleParentMenuRequired": "请选择上级菜单",
|
||||
"ruleMenuNameRequired": "请输入菜单名称",
|
||||
"ruleRoutePathRequired": "请输入路由地址",
|
||||
"ruleComponentNameRequired": "请输入组件名称",
|
||||
"rulePermSlugRequired": "请输入权限标识",
|
||||
"ruleLinkUrlRequired": "请输入外链地址",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,5 +13,22 @@
|
||||
"sort": "排序",
|
||||
"status": "状态",
|
||||
"createTime": "创建时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增岗位",
|
||||
"titleEdit": "编辑岗位",
|
||||
"labelName": "岗位名称",
|
||||
"labelCode": "岗位编码",
|
||||
"labelRemark": "描述",
|
||||
"labelSort": "排序",
|
||||
"labelStatus": "启用",
|
||||
"placeholderName": "请输入岗位名称",
|
||||
"placeholderCode": "请输入岗位编码",
|
||||
"placeholderRemark": "请输入岗位描述",
|
||||
"placeholderSort": "请输入排序",
|
||||
"ruleNameRequired": "请输入岗位名称",
|
||||
"ruleCodeRequired": "请输入岗位编码",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,25 @@
|
||||
"roleRemark": "角色描述",
|
||||
"status": "状态",
|
||||
"createTime": "创建时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增角色",
|
||||
"titleEdit": "编辑角色",
|
||||
"labelName": "角色名称",
|
||||
"labelCode": "角色标识",
|
||||
"labelLevel": "角色级别",
|
||||
"levelTip": "控制角色的权限层级, 不能操作职级高于自己的角色",
|
||||
"labelRemark": "描述",
|
||||
"labelSort": "排序",
|
||||
"labelStatus": "启用",
|
||||
"placeholderName": "请输入角色名称",
|
||||
"placeholderCode": "请输入角色编码",
|
||||
"placeholderRemark": "请输入角色描述",
|
||||
"placeholderSort": "请输入排序",
|
||||
"ruleNameRequired": "请输入角色名称",
|
||||
"ruleCodeRequired": "请输入角色编码",
|
||||
"ruleLevelRequired": "请输入角色级别",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,35 @@
|
||||
"status": "状态",
|
||||
"createTime": "创建时间",
|
||||
"updateTime": "更新时间"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增用户",
|
||||
"titleEdit": "编辑用户",
|
||||
"labelAvatar": "头像",
|
||||
"labelUsername": "用户名",
|
||||
"labelRealname": "真实姓名",
|
||||
"labelPassword": "密码",
|
||||
"labelPasswordConfirm": "确认密码",
|
||||
"labelEmail": "邮箱",
|
||||
"labelPhone": "手机号",
|
||||
"labelDept": "部门",
|
||||
"labelRole": "角色",
|
||||
"labelPost": "岗位",
|
||||
"labelGender": "性别",
|
||||
"labelStatus": "状态",
|
||||
"labelRemark": "备注",
|
||||
"placeholderEmail": "请输入邮箱",
|
||||
"placeholderPhone": "请输入手机号",
|
||||
"placeholderRemark": "请输入备注",
|
||||
"rulePasswordNotMatch": "两次输入的密码不一致",
|
||||
"ruleUsernameRequired": "请输入用户名",
|
||||
"ruleUsernameLength": "长度在 2 到 20 个字符",
|
||||
"rulePasswordRequired": "请输入密码",
|
||||
"rulePasswordLength": "长度在 6 到 20 个字符",
|
||||
"rulePasswordConfirmRequired": "请输入确认密码",
|
||||
"ruleDeptRequired": "请选择部门",
|
||||
"ruleRoleRequired": "请选择角色",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,46 @@
|
||||
"executeTime": "执行时间",
|
||||
"parameter": "任务参数",
|
||||
"executeStatus": "执行状态"
|
||||
},
|
||||
"form": {
|
||||
"titleAdd": "新增定时任务",
|
||||
"titleEdit": "编辑定时任务",
|
||||
"labelName": "任务名称",
|
||||
"labelType": "任务类型",
|
||||
"labelTaskStyle": "定时规则",
|
||||
"labelTarget": "调用目标",
|
||||
"labelParams": "任务参数",
|
||||
"labelStatus": "状态",
|
||||
"labelRemark": "备注",
|
||||
"placeholderName": "请输入任务名称",
|
||||
"placeholderTarget": "请输入调用目标",
|
||||
"placeholderParams": "请输入任务参数",
|
||||
"placeholderRemark": "请输入备注",
|
||||
"taskStyleEveryDay": "每天",
|
||||
"taskStyleEveryHour": "每小时",
|
||||
"taskStyleNHours": "N小时",
|
||||
"taskStyleNMinutes": "N分钟",
|
||||
"taskStyleNSeconds": "N秒",
|
||||
"taskStyleEveryWeek": "每周",
|
||||
"taskStyleEveryMonth": "每月",
|
||||
"taskStyleEveryYear": "每年",
|
||||
"weekMon": "周一",
|
||||
"weekTue": "周二",
|
||||
"weekWed": "周三",
|
||||
"weekThu": "周四",
|
||||
"weekFri": "周五",
|
||||
"weekSat": "周六",
|
||||
"weekSun": "周日",
|
||||
"unitMonth": "月",
|
||||
"unitDay": "日",
|
||||
"unitHour": "时",
|
||||
"unitMinute": "分",
|
||||
"unitSecond": "秒",
|
||||
"ruleNameRequired": "任务名称不能为空",
|
||||
"ruleTypeRequired": "任务类型不能为空",
|
||||
"ruleTaskStyleRequired": "定时规则不能为空",
|
||||
"ruleTargetRequired": "调用目标不能为空",
|
||||
"addSuccess": "新增成功",
|
||||
"editSuccess": "修改成功"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,14 +43,33 @@ export async function loadPageLocale(routePath: string): Promise<void> {
|
||||
return
|
||||
}
|
||||
const locale = getCurrentLocale()
|
||||
const key = getModuleKey(locale, path)
|
||||
const modules = locale === LanguageEnum.EN ? enModules : zhModules
|
||||
const loader = modules[key]
|
||||
|
||||
const tryPaths: string[] = [path]
|
||||
// 兼容别名路由:例如 /user 实际页面为 /system/user
|
||||
if (!path.includes('/')) {
|
||||
tryPaths.push(`system/${path}`)
|
||||
}
|
||||
if (path === 'user') {
|
||||
tryPaths.push('system/user')
|
||||
}
|
||||
|
||||
let matchedPath: string | null = null
|
||||
let loader: (() => Promise<PageLocaleModule>) | undefined
|
||||
for (const p of tryPaths) {
|
||||
const key = getModuleKey(locale, p)
|
||||
const l = modules[key]
|
||||
if (l) {
|
||||
matchedPath = p
|
||||
loader = l
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!loader) {
|
||||
clearPageLocale()
|
||||
return
|
||||
}
|
||||
if (lastLoadedPath === path && lastLoadedLocale === locale) {
|
||||
if (lastLoadedPath === matchedPath && lastLoadedLocale === locale) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
@@ -58,7 +77,7 @@ export async function loadPageLocale(routePath: string): Promise<void> {
|
||||
const message = mod?.default
|
||||
if (message && typeof message === 'object') {
|
||||
i18n.global.mergeLocaleMessage(locale, { page: message })
|
||||
lastLoadedPath = path
|
||||
lastLoadedPath = matchedPath
|
||||
lastLoadedLocale = locale
|
||||
}
|
||||
} catch {
|
||||
|
||||
@@ -209,8 +209,23 @@ function handleLoginStatus(
|
||||
userStore: ReturnType<typeof useUserStore>,
|
||||
next: NavigationGuardNext
|
||||
): boolean {
|
||||
// 已登录或访问登录页或静态路由,直接放行
|
||||
if (userStore.isLogin || to.path === RoutesAlias.Login || isStaticRoute(to.path)) {
|
||||
// 已登录或访问登录页,直接放行
|
||||
if (userStore.isLogin || to.path === RoutesAlias.Login) {
|
||||
return true
|
||||
}
|
||||
|
||||
// 未登录时访问根路径(首页),重定向到登录页
|
||||
if (to.path === '/') {
|
||||
userStore.logOut()
|
||||
next({
|
||||
name: 'Login',
|
||||
query: { redirect: to.fullPath }
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 其他静态路由(注册、忘记密码、错误页等)放行
|
||||
if (isStaticRoute(to.path)) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<!-- 表格头部 -->
|
||||
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
||||
<template #left>
|
||||
<span v-if="totalWinCoin !== null" class="table-summary-inline">
|
||||
{{ $t('page.toolbar.platformTotalProfit') }}:<strong>{{ totalWinCoin }}</strong>
|
||||
</span>
|
||||
<!-- <ElSpace wrap>-->
|
||||
<!-- <ElButton-->
|
||||
<!-- v-permission="'dice:play_record:index:save'"-->
|
||||
@@ -126,6 +129,15 @@
|
||||
direction: undefined
|
||||
})
|
||||
|
||||
/** 当前筛选下平台总盈利(付费抽奖次数×100 - 玩家总收益) */
|
||||
const totalWinCoin = ref<number | null>(null)
|
||||
|
||||
const listApi = async (params: Record<string, any>) => {
|
||||
const res = await api.list(params)
|
||||
totalWinCoin.value = (res as any)?.total_win_coin ?? null
|
||||
return res
|
||||
}
|
||||
|
||||
// 搜索处理
|
||||
const handleSearch = (params: Record<string, any>) => {
|
||||
Object.assign(searchParams, params)
|
||||
@@ -170,7 +182,8 @@
|
||||
refreshData
|
||||
} = useTable({
|
||||
core: {
|
||||
apiFn: api.list,
|
||||
apiFn: listApi,
|
||||
apiParams: { limit: 100 },
|
||||
columnsFactory: () => [
|
||||
// { type: 'selection' },
|
||||
{ prop: 'id', label: 'page.table.id', width: 80 },
|
||||
@@ -219,3 +232,15 @@
|
||||
// selectedRows
|
||||
} = useSaiAdmin()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-summary-inline {
|
||||
margin-right: 12px;
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-regular);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.table-summary-inline strong {
|
||||
color: var(--el-color-danger);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -184,9 +184,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '../../../api/play_record/index'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
dialogType: string
|
||||
@@ -399,15 +402,15 @@
|
||||
if (props.dialogType === 'add') {
|
||||
delete payload.id
|
||||
await api.save(payload)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(payload)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
} catch (error: any) {
|
||||
let msg = '表单验证失败,请检查必填项与格式'
|
||||
let msg = t('page.form.validateFailed')
|
||||
if (error?.message) {
|
||||
msg = error.message
|
||||
} else if (typeof error === 'string') {
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增玩家抽奖记录(测试数据)' : '编辑玩家抽奖记录(测试数据)'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="彩金池配置id" prop="lottery_config_id">
|
||||
<el-input v-model="formData.lottery_config_id" placeholder="请输入彩金池配置id" />
|
||||
<el-form-item :label="$t('page.form.labelLotteryConfigId')" prop="lottery_config_id">
|
||||
<el-input v-model="formData.lottery_config_id" :placeholder="$t('page.form.placeholderLotteryConfigId')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抽奖类型" prop="lottery_type">
|
||||
<el-form-item :label="$t('page.form.drawType')" prop="lottery_type">
|
||||
<el-select
|
||||
v-model="formData.lottery_type"
|
||||
placeholder="请选择"
|
||||
:placeholder="$t('form.placeholderSelect')"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="付费" :value="0" />
|
||||
<el-option label="赠送" :value="1" />
|
||||
<el-option :label="$t('page.search.paid')" :value="0" />
|
||||
<el-option :label="$t('page.search.free')" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="方向" prop="direction">
|
||||
<el-select v-model="formData.direction" placeholder="请选择" clearable style="width: 100%">
|
||||
<el-option label="顺时针" :value="0" />
|
||||
<el-option label="逆时针" :value="1" />
|
||||
<el-form-item :label="$t('page.search.direction')" prop="direction">
|
||||
<el-select v-model="formData.direction" :placeholder="$t('form.placeholderSelect')" clearable style="width: 100%">
|
||||
<el-option :label="$t('page.search.clockwise')" :value="0" />
|
||||
<el-option :label="$t('page.search.anticlockwise')" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否中大奖" prop="is_win">
|
||||
<el-select v-model="formData.is_win" placeholder="请选择" clearable style="width: 100%">
|
||||
<el-option label="无" :value="0" />
|
||||
<el-option label="中大奖" :value="1" />
|
||||
<el-form-item :label="$t('page.search.isBigWin')" prop="is_win">
|
||||
<el-select v-model="formData.is_win" :placeholder="$t('form.placeholderSelect')" clearable style="width: 100%">
|
||||
<el-option :label="$t('page.search.noBigWin')" :value="0" />
|
||||
<el-option :label="$t('page.search.bigWin')" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="赢取平台币" prop="win_coin">
|
||||
<el-form-item :label="$t('page.search.winCoin')" prop="win_coin">
|
||||
<el-input-number
|
||||
v-model="formData.win_coin"
|
||||
placeholder="赢取平台币"
|
||||
:placeholder="$t('page.form.placeholderWinCoin')"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中奖档位" prop="reward_tier">
|
||||
<el-form-item :label="$t('page.search.rewardTier')" prop="reward_tier">
|
||||
<el-select
|
||||
v-model="formData.reward_tier"
|
||||
placeholder="请选择档位(选后自动带出奖励配置ID)"
|
||||
:placeholder="$t('page.form.placeholderRewardTier')"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="onRewardTierChange"
|
||||
@@ -58,40 +58,40 @@
|
||||
<el-option label="T5" value="T5" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="奖励配置id" prop="reward_config_id">
|
||||
<el-form-item :label="$t('page.form.rewardConfigId')" prop="reward_config_id">
|
||||
<el-input
|
||||
v-model="formData.reward_config_id"
|
||||
placeholder="可选中奖档位自动带出或手动输入"
|
||||
:placeholder="$t('page.form.placeholderRewardConfigId')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始索引" prop="start_index">
|
||||
<el-input v-model="formData.start_index" placeholder="请输入起始索引" />
|
||||
<el-form-item :label="$t('page.table.startIndex')" prop="start_index">
|
||||
<el-input v-model="formData.start_index" :placeholder="$t('page.form.placeholderStartIndex')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束索引" prop="target_index">
|
||||
<el-input v-model="formData.target_index" placeholder="请输入结束索引" />
|
||||
<el-form-item :label="$t('page.form.labelTargetIndex')" prop="target_index">
|
||||
<el-input v-model="formData.target_index" :placeholder="$t('page.form.placeholderTargetIndex')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="摇取点数和" prop="roll_number">
|
||||
<el-input v-model="formData.roll_number" placeholder="请输入摇取点数和" />
|
||||
<el-form-item :label="$t('page.search.rollNumber')" prop="roll_number">
|
||||
<el-input v-model="formData.roll_number" :placeholder="$t('page.form.placeholderRollNumber')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="摇取点数:[1,2,3,4,5,6]" prop="roll_array">
|
||||
<el-input v-model="formData.roll_array" placeholder="请输入摇取点数:[1,2,3,4,5,6]" />
|
||||
<el-form-item :label="$t('page.form.labelRollArray')" prop="roll_array">
|
||||
<el-input v-model="formData.roll_array" :placeholder="$t('page.form.placeholderRollArray')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:0=失败,1=成功" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
<el-form-item label="中大奖平台币" prop="super_win_coin">
|
||||
<el-input v-model="formData.super_win_coin" placeholder="请输入中大奖平台币" />
|
||||
<el-form-item :label="$t('page.table.superWinCoin')" prop="super_win_coin">
|
||||
<el-input v-model="formData.super_win_coin" :placeholder="$t('page.form.placeholderSuperWinCoin')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="摇色子中奖平台币" prop="reward_win_coin">
|
||||
<el-input v-model="formData.reward_win_coin" placeholder="请输入摇色子中奖平台币" />
|
||||
<el-form-item :label="$t('page.table.rewardWinCoin')" prop="reward_win_coin">
|
||||
<el-input v-model="formData.reward_win_coin" :placeholder="$t('page.form.placeholderRewardWinCoin')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属管理员" prop="admin_id">
|
||||
<el-input v-model="formData.admin_id" placeholder="请输入所属管理员" />
|
||||
<el-form-item :label="$t('page.form.labelAdminId')" prop="admin_id">
|
||||
<el-input v-model="formData.admin_id" :placeholder="$t('page.form.placeholderAdminId')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -101,6 +101,7 @@
|
||||
import rewardConfigApi from '../../../api/reward_config/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -120,6 +121,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -134,14 +136,14 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
lottery_config_id: [{ required: true, message: '彩金池配置id必需填写', trigger: 'blur' }],
|
||||
lottery_type: [{ required: true, message: '抽奖类型:0=付费,1=赠送必需填写', trigger: 'blur' }],
|
||||
is_win: [{ required: true, message: '中大奖:0=无,1=中奖必需填写', trigger: 'blur' }],
|
||||
direction: [{ required: true, message: '方向:0=顺时针,1=逆时针必需填写', trigger: 'blur' }],
|
||||
reward_config_id: [{ required: true, message: '奖励配置id必需填写', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '状态:0=失败,1=成功必需填写', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
lottery_config_id: [{ required: true, message: t('page.form.ruleLotteryConfigIdRequired'), trigger: 'blur' }],
|
||||
lottery_type: [{ required: true, message: t('page.form.ruleDrawTypeRequired'), trigger: 'blur' }],
|
||||
is_win: [{ required: true, message: t('page.form.ruleIsBigWinRequired'), trigger: 'blur' }],
|
||||
direction: [{ required: true, message: t('page.form.ruleDirectionRequired'), trigger: 'blur' }],
|
||||
reward_config_id: [{ required: true, message: t('page.form.ruleRewardConfigIdRequired'), trigger: 'blur' }],
|
||||
status: [{ required: true, message: t('page.form.ruleStatusRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -256,10 +258,10 @@
|
||||
delete (payload as Record<string, unknown>).reward_tier
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(payload)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(payload)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -171,9 +171,11 @@
|
||||
<script setup lang="ts">
|
||||
import api from '../../../api/player/index'
|
||||
import lotteryConfigApi from '../../../api/lottery_pool_config/index'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
const { t } = useI18n()
|
||||
const WEIGHT_FIELDS = ['t1_weight', 't2_weight', 't3_weight', 't4_weight', 't5_weight'] as const
|
||||
|
||||
interface Props {
|
||||
@@ -416,7 +418,7 @@
|
||||
await formRef.value.validate()
|
||||
const useCustomWeights = isLotteryConfigEmpty()
|
||||
if (useCustomWeights && Math.abs(weightsSum.value - 100) > 0.01) {
|
||||
ElMessage.warning('五个池权重总和必须为100%')
|
||||
ElMessage.warning(t('page.form.ruleWeightsSumMustBe100'))
|
||||
return
|
||||
}
|
||||
const payload = { ...formData }
|
||||
@@ -428,10 +430,10 @@
|
||||
}
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(payload)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(payload)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
} = useTable({
|
||||
core: {
|
||||
apiFn: api.list,
|
||||
apiParams: { limit: 100 },
|
||||
columnsFactory: () => {
|
||||
const usernameFormatter = (row: Record<string, any>) =>
|
||||
row?.dicePlayer?.username ?? row?.player_id ?? '-'
|
||||
|
||||
@@ -81,9 +81,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '../../../api/player_ticket_record/index'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
dialogType: string
|
||||
@@ -230,10 +233,10 @@
|
||||
const rest = { ...formData } as Record<string, unknown>
|
||||
delete rest.id
|
||||
await api.save(rest)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
} = useTable({
|
||||
core: {
|
||||
apiFn: api.list,
|
||||
apiParams: { limit: 100 },
|
||||
columnsFactory: () => [
|
||||
{ type: 'selection', align: 'center' },
|
||||
{ prop: 'id', label: 'page.table.id', width: 80, align: 'center' },
|
||||
|
||||
@@ -90,9 +90,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '../../../api/player_wallet_record/index'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
dialogType: string
|
||||
@@ -225,10 +228,10 @@
|
||||
const payload = { ...formData }
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(payload)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(payload)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<el-option label="T3" value="T3" />
|
||||
<el-option label="T4" value="T4" />
|
||||
<el-option label="T5" value="T5" />
|
||||
<el-option label="BIGWIN" value="BIGWIN" />
|
||||
<el-option :label="$t('page.search.optionBigwin')" value="BIGWIN" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -1,32 +1,30 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="奖励对照表(dice_reward)权重配比"
|
||||
:title="$t('page.weightEdit.title')"
|
||||
width="900px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="global-tip">
|
||||
编辑的是<strong>奖励对照表(dice_reward / DiceReward 模型)</strong
|
||||
>的权重,按<strong>结束索引(end_index)</strong>区分
|
||||
<strong>顺时针</strong>与<strong>逆时针</strong>两套权重;抽奖时按当前方向取对应权重。
|
||||
{{ $t('page.weightEdit.globalTip') }}
|
||||
</div>
|
||||
<div v-loading="loading" class="dialog-body">
|
||||
<el-tabs v-model="activeTier" type="card">
|
||||
<el-tab-pane v-for="t in tierKeys" :key="t" :label="t" :name="t">
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">该档位暂无配置数据</div>
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">{{ $t('page.weightShared.emptyTier') }}</div>
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<div class="chart-row">
|
||||
<ArtBarChart
|
||||
x-axis-name="结束索引"
|
||||
:x-axis-name="$t('page.weightShared.xAxisEndIndex')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartData(t, 'clockwise')"
|
||||
height="180px"
|
||||
/>
|
||||
<ArtBarChart
|
||||
x-axis-name="结束索引"
|
||||
:x-axis-name="$t('page.weightShared.xAxisEndIndex')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartData(t, 'counterclockwise')"
|
||||
height="180px"
|
||||
@@ -34,42 +32,50 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="weight-sum" v-if="t !== 'T4' && t !== 'T5'">
|
||||
当前档位权重合计(顺时针):<strong>{{ getTierSum(t, 'clockwise') }}</strong>
|
||||
;逆时针:<strong>{{ getTierSum(t, 'counterclockwise') }}</strong>
|
||||
(各条 1-10000,和不限制)
|
||||
{{
|
||||
$t('page.weightShared.sumLineDual', {
|
||||
cw: getTierSum(t, 'clockwise'),
|
||||
ccw: getTierSum(t, 'counterclockwise')
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else>T4、T5 仅单一结果,无需配置权重。</div>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else>{{ $t('page.weightShared.t4t5NoteSingle') }}</div>
|
||||
<el-table :data="getTierItems(t)" border size="small" class="weight-table">
|
||||
<el-table-column
|
||||
label="结束索引(id)"
|
||||
:label="$t('page.weightShared.colEndIndexId')"
|
||||
prop="id"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="色子点数" prop="grid_number" width="80" align="center" />
|
||||
<el-table-column
|
||||
label="实际中奖金额"
|
||||
:label="$t('page.weightShared.colDicePoints')"
|
||||
prop="grid_number"
|
||||
width="80"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('page.weightShared.colRealEv')"
|
||||
prop="real_ev"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="显示文本"
|
||||
:label="$t('page.weightShared.colUiText')"
|
||||
prop="ui_text"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
:label="$t('page.weightShared.colRemark')"
|
||||
prop="remark"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="顺时针权重(direction=0)" min-width="160" align="center">
|
||||
<el-table-column :label="$t('page.weightShared.colWeightCwDir')" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="weight-cell-vertical">
|
||||
<div class="weight-slider-wrap">
|
||||
@@ -146,7 +152,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="逆时针权重(direction=1)" min-width="160" align="center">
|
||||
<el-table-column :label="$t('page.weightShared.colWeightCcwDir')" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="weight-cell-vertical">
|
||||
<div class="weight-slider-wrap">
|
||||
@@ -232,8 +238,10 @@
|
||||
</el-tabs>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('page.weightShared.btnCancel') }}</el-button>
|
||||
<el-button type="primary" :loading="submitting" @click="handleSubmit">{{
|
||||
$t('page.weightShared.btnSubmit')
|
||||
}}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -242,6 +250,9 @@
|
||||
import api from '../../../api/reward/index'
|
||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const TIER_KEYS = ['T1', 'T2', 'T3', 'T4', 'T5'] as const
|
||||
/** 供模板 v-for 使用 */
|
||||
@@ -430,7 +441,7 @@
|
||||
grouped.value = parsePayload(res)
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error('获取权重数据失败')
|
||||
ElMessage.error(t('page.weightShared.fetchFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
@@ -456,19 +467,19 @@
|
||||
function handleSubmit() {
|
||||
const items = collectItems()
|
||||
if (items.length === 0) {
|
||||
ElMessage.info('没有可提交的配置')
|
||||
ElMessage.info(t('page.weightShared.nothingToSubmit'))
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
api
|
||||
.batchUpdateWeights(items)
|
||||
.then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
ElMessage.success(t('page.weightShared.saveSuccess'))
|
||||
emit('success')
|
||||
handleClose()
|
||||
})
|
||||
.catch((e: { message?: string }) => {
|
||||
ElMessage.error(e?.message ?? '保存失败')
|
||||
ElMessage.error(e?.message ?? t('page.weightShared.submitFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
submitting.value = false
|
||||
|
||||
@@ -1,78 +1,76 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="权重配比"
|
||||
:title="$t('page.weightRatio.title')"
|
||||
width="900px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="global-tip">
|
||||
配置<strong>奖励对照表(dice_reward)</strong>的权重,一级按<strong>方向</strong>(顺时针/逆时针),二级按<strong>档位</strong>(T1-T5);各条权重
|
||||
1-10000,档位内按权重比抽取。
|
||||
{{ $t('page.weightRatio.globalTip') }}
|
||||
</div>
|
||||
<div v-loading="loading" class="dialog-body">
|
||||
<!-- 一级:方向(懒加载避免逆时针柱状图在隐藏容器内初始化导致不显示);二级档位 -->
|
||||
<el-tabs v-model="activeDirection" type="card" class="direction-tabs" :lazy="true">
|
||||
<el-tab-pane label="顺时针" name="0">
|
||||
<el-tab-pane :label="$t('page.weightRatio.tabClockwise')" 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">
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">该档位暂无配置数据</div>
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">{{ $t('page.weightShared.emptyTier') }}</div>
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<ArtBarChart
|
||||
:key="'cw-' + activeDirection + '-' + t"
|
||||
x-axis-name="点数"
|
||||
:x-axis-name="$t('page.weightShared.xAxisGridNumber')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartDataForCurrentDirection(t)"
|
||||
height="180px"
|
||||
/>
|
||||
</div>
|
||||
<div class="weight-sum" v-if="t !== 'T4' && t !== 'T5'">
|
||||
当前档位权重合计:<strong>{{ getTierSumForCurrentDirection(t) }}</strong>
|
||||
(各条 1-10000,档位内按权重比抽取,和不限制)
|
||||
{{
|
||||
$t('page.weightShared.sumLineSingle', { sum: getTierSumForCurrentDirection(t) })
|
||||
}}
|
||||
</div>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else
|
||||
>T4、T5 仅单一结果,无需配置权重。</div
|
||||
>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else>{{ $t('page.weightShared.t4t5NoteSingle') }}</div>
|
||||
<el-table :data="getTierItems(t)" border size="small" class="weight-table">
|
||||
<el-table-column
|
||||
label="点数(grid_number)"
|
||||
:label="$t('page.weightShared.colGridNumber')"
|
||||
prop="grid_number"
|
||||
width="110"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="结束索引(id)"
|
||||
:label="$t('page.weightShared.colEndIndexId')"
|
||||
prop="id"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="实际中奖金额"
|
||||
:label="$t('page.weightShared.colRealEv')"
|
||||
prop="real_ev"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="显示文本"
|
||||
:label="$t('page.weightShared.colUiText')"
|
||||
prop="ui_text"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
:label="$t('page.weightShared.colRemark')"
|
||||
prop="remark"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
:label="currentDirectionLabel + ' 权重(1-10000)'"
|
||||
:label="currentWeightColumnLabel"
|
||||
min-width="200"
|
||||
align="center"
|
||||
>
|
||||
@@ -156,65 +154,64 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="逆时针" name="1">
|
||||
<el-tab-pane :label="$t('page.weightRatio.tabCounterclockwise')" name="1">
|
||||
<el-tabs v-model="activeTier" type="card" class="tier-tabs">
|
||||
<el-tab-pane v-for="t in tierKeys" :key="'ccw-' + t" :label="t" :name="t">
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">该档位暂无配置数据</div>
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">{{ $t('page.weightShared.emptyTier') }}</div>
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<ArtBarChart
|
||||
:key="'ccw-' + activeDirection + '-' + t"
|
||||
x-axis-name="点数"
|
||||
:x-axis-name="$t('page.weightShared.xAxisGridNumber')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartDataForCurrentDirection(t)"
|
||||
height="180px"
|
||||
/>
|
||||
</div>
|
||||
<div class="weight-sum" v-if="t !== 'T4' && t !== 'T5'">
|
||||
当前档位权重合计:<strong>{{ getTierSumForCurrentDirection(t) }}</strong>
|
||||
(各条 1-10000,档位内按权重比抽取,和不限制)
|
||||
{{
|
||||
$t('page.weightShared.sumLineSingle', { sum: getTierSumForCurrentDirection(t) })
|
||||
}}
|
||||
</div>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else
|
||||
>T4、T5 仅单一结果,无需配置权重。</div
|
||||
>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else>{{ $t('page.weightShared.t4t5NoteSingle') }}</div>
|
||||
<el-table :data="getTierItems(t)" border size="small" class="weight-table">
|
||||
<el-table-column
|
||||
label="点数(grid_number)"
|
||||
:label="$t('page.weightShared.colGridNumber')"
|
||||
prop="grid_number"
|
||||
width="110"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="结束索引(id)"
|
||||
:label="$t('page.weightShared.colEndIndexId')"
|
||||
prop="id"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="实际中奖金额"
|
||||
:label="$t('page.weightShared.colRealEv')"
|
||||
prop="real_ev"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="显示文本"
|
||||
:label="$t('page.weightShared.colUiText')"
|
||||
prop="ui_text"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
:label="$t('page.weightShared.colRemark')"
|
||||
prop="remark"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
:label="currentDirectionLabel + ' 权重(1-10000)'"
|
||||
:label="currentWeightColumnLabel"
|
||||
min-width="200"
|
||||
align="center"
|
||||
>
|
||||
@@ -301,13 +298,14 @@
|
||||
</el-tabs>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button @click="handleClose">{{ $t('page.weightShared.btnCancel') }}</el-button>
|
||||
<el-button
|
||||
v-permission="'dice:reward:index:batchUpdateWeights'"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
@click="handleSubmit"
|
||||
>提交</el-button>
|
||||
>{{ $t('page.weightShared.btnSubmit') }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -316,6 +314,9 @@
|
||||
import api from '../../../api/reward/index'
|
||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
const TIER_KEYS = ['T1', 'T2', 'T3', 'T4', 'T5'] as const
|
||||
type DirectionKey = 'clockwise' | 'counterclockwise'
|
||||
@@ -366,9 +367,14 @@
|
||||
T5: { '0': [], '1': [] }
|
||||
})
|
||||
|
||||
const currentDirectionLabel = computed(() =>
|
||||
activeDirection.value === '0' ? '顺时针' : '逆时针'
|
||||
)
|
||||
const currentWeightColumnLabel = computed(() => {
|
||||
locale.value
|
||||
const dirLabel =
|
||||
activeDirection.value === '0'
|
||||
? t('page.weightRatio.tabClockwise')
|
||||
: t('page.weightRatio.tabCounterclockwise')
|
||||
return `${dirLabel} ${t('page.weightShared.weightColSuffix')}`
|
||||
})
|
||||
|
||||
const tierKeys = TIER_KEYS
|
||||
|
||||
@@ -470,7 +476,7 @@
|
||||
grouped.value = parsePayload(res)
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error('获取权重数据失败')
|
||||
ElMessage.error(t('page.weightShared.fetchFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
@@ -499,19 +505,19 @@
|
||||
function handleSubmit() {
|
||||
const items = collectItems()
|
||||
if (items.length === 0) {
|
||||
ElMessage.info('没有可提交的配置')
|
||||
ElMessage.info(t('page.weightShared.nothingToSubmit'))
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
api
|
||||
.batchUpdateWeights(items)
|
||||
.then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
ElMessage.success(t('page.weightShared.saveSuccess'))
|
||||
emit('success')
|
||||
handleClose()
|
||||
})
|
||||
.catch((e: { message?: string }) => {
|
||||
ElMessage.error(e?.message ?? '保存失败')
|
||||
ElMessage.error(e?.message ?? t('page.weightShared.submitFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
submitting.value = false
|
||||
|
||||
@@ -1,33 +1,31 @@
|
||||
<template>
|
||||
<ElDialog
|
||||
v-model="visible"
|
||||
title="一键测试权重"
|
||||
:title="$t('page.weightTest.title')"
|
||||
width="560px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@close="onClose"
|
||||
>
|
||||
<ElAlert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="weight-test-tip"
|
||||
>
|
||||
<template #title>彩金池逻辑说明</template>
|
||||
与 playStart 抽奖逻辑一致:使用 name=default 的安全线、杀分开关;盈利未达安全线时,付费抽奖券使用玩家自身权重(下方自定义档位),免费抽奖券使用 killScore 配置;盈利达到安全线且杀分开启时,付费/免费均使用 killScore 配置。
|
||||
<ElAlert type="info" :closable="false" show-icon class="weight-test-tip">
|
||||
<template #title>{{ $t('page.weightTest.alertTitle') }}</template>
|
||||
{{ $t('page.weightTest.alertBody') }}
|
||||
</ElAlert>
|
||||
<ElForm ref="formRef" :model="form" label-width="140px">
|
||||
<ElSteps :active="currentStep" finish-status="success" simple class="steps-wrap">
|
||||
<ElStep title="付费抽奖券" />
|
||||
<ElStep title="免费抽奖券" />
|
||||
<ElStep :title="$t('page.weightTest.stepPaid')" />
|
||||
<ElStep :title="$t('page.weightTest.stepFree')" />
|
||||
</ElSteps>
|
||||
|
||||
<!-- 第一页:付费抽奖券 -->
|
||||
<div v-show="currentStep === 0" class="step-panel">
|
||||
<ElFormItem label="测试数据档位类型" prop="paid_lottery_config_id">
|
||||
<ElFormItem
|
||||
:label="$t('page.weightTest.labelLotteryTypePaid')"
|
||||
prop="paid_lottery_config_id"
|
||||
>
|
||||
<ElSelect
|
||||
v-model="form.paid_lottery_config_id"
|
||||
placeholder="不选则下方自定义档位概率(默认 default)"
|
||||
:placeholder="$t('page.weightTest.placeholderPaidPool')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@@ -41,11 +39,13 @@
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<template v-if="form.paid_lottery_config_id == null">
|
||||
<div class="tier-label">自定义档位概率(T1~T5),每档 0-100%,五档之和不能超过 100%</div>
|
||||
<div class="tier-label">{{ $t('page.weightTest.tierProbHint') }}</div>
|
||||
<ElRow :gutter="12" class="tier-row">
|
||||
<ElCol v-for="t in tierKeys" :key="'paid-' + t" :span="8">
|
||||
<div class="tier-field">
|
||||
<label class="tier-field-label">档位 {{ t }}(%)</label>
|
||||
<label class="tier-field-label">{{
|
||||
$t('page.weightTest.tierFieldLabel', { tier: t })
|
||||
}}</label>
|
||||
<input
|
||||
type="number"
|
||||
:value="getPaidTier(t)"
|
||||
@@ -58,17 +58,25 @@
|
||||
</div>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
<div v-if="paidTierSum > 100" class="tier-error"
|
||||
>当前五档之和为 {{ paidTierSum }}%,不能超过 100%</div
|
||||
>
|
||||
<div v-if="paidTierSum > 100" class="tier-error">{{
|
||||
$t('page.weightTest.tierSumError', { sum: paidTierSum })
|
||||
}}</div>
|
||||
</template>
|
||||
<ElFormItem label="顺时针次数" prop="paid_s_count" required>
|
||||
<ElSelect v-model="form.paid_s_count" placeholder="请选择" style="width: 100%">
|
||||
<ElFormItem :label="$t('page.weightTest.labelCwCount')" prop="paid_s_count" required>
|
||||
<ElSelect
|
||||
v-model="form.paid_s_count"
|
||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="逆时针次数" prop="paid_n_count" required>
|
||||
<ElSelect v-model="form.paid_n_count" placeholder="请选择" style="width: 100%">
|
||||
<ElFormItem :label="$t('page.weightTest.labelCcwCount')" prop="paid_n_count" required>
|
||||
<ElSelect
|
||||
v-model="form.paid_n_count"
|
||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
@@ -76,10 +84,13 @@
|
||||
|
||||
<!-- 第二页:免费抽奖券 -->
|
||||
<div v-show="currentStep === 1" class="step-panel">
|
||||
<ElFormItem label="测试数据档位类型" prop="free_lottery_config_id">
|
||||
<ElFormItem
|
||||
:label="$t('page.weightTest.labelLotteryTypeFree')"
|
||||
prop="free_lottery_config_id"
|
||||
>
|
||||
<ElSelect
|
||||
v-model="form.free_lottery_config_id"
|
||||
placeholder="不选则下方自定义档位概率(默认 killScore)"
|
||||
:placeholder="$t('page.weightTest.placeholderFreePool')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@@ -93,11 +104,13 @@
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<template v-if="form.free_lottery_config_id == null">
|
||||
<div class="tier-label">自定义档位概率(T1~T5),每档 0-100%,五档之和不能超过 100%</div>
|
||||
<div class="tier-label">{{ $t('page.weightTest.tierProbHint') }}</div>
|
||||
<ElRow :gutter="12" class="tier-row">
|
||||
<ElCol v-for="t in tierKeys" :key="'free-' + t" :span="8">
|
||||
<div class="tier-field">
|
||||
<label class="tier-field-label">档位 {{ t }}(%)</label>
|
||||
<label class="tier-field-label">{{
|
||||
$t('page.weightTest.tierFieldLabel', { tier: t })
|
||||
}}</label>
|
||||
<input
|
||||
type="number"
|
||||
:value="getFreeTier(t)"
|
||||
@@ -110,17 +123,25 @@
|
||||
</div>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
<div v-if="freeTierSum > 100" class="tier-error"
|
||||
>当前五档之和为 {{ freeTierSum }}%,不能超过 100%</div
|
||||
>
|
||||
<div v-if="freeTierSum > 100" class="tier-error">{{
|
||||
$t('page.weightTest.tierSumError', { sum: freeTierSum })
|
||||
}}</div>
|
||||
</template>
|
||||
<ElFormItem label="顺时针次数" prop="free_s_count" required>
|
||||
<ElSelect v-model="form.free_s_count" placeholder="请选择" style="width: 100%">
|
||||
<ElFormItem :label="$t('page.weightTest.labelCwCount')" prop="free_s_count" required>
|
||||
<ElSelect
|
||||
v-model="form.free_s_count"
|
||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="逆时针次数" prop="free_n_count" required>
|
||||
<ElSelect v-model="form.free_n_count" placeholder="请选择" style="width: 100%">
|
||||
<ElFormItem :label="$t('page.weightTest.labelCcwCount')" prop="free_n_count" required>
|
||||
<ElSelect
|
||||
v-model="form.free_n_count"
|
||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
||||
style="width: 100%"
|
||||
>
|
||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
@@ -128,19 +149,23 @@
|
||||
</ElForm>
|
||||
|
||||
<template #footer>
|
||||
<ElButton v-if="currentStep > 0" :disabled="running" @click="currentStep--">上一步</ElButton>
|
||||
<ElButton v-if="currentStep < 1" type="primary" :disabled="running" @click="currentStep++"
|
||||
>下一步</ElButton
|
||||
>
|
||||
<ElButton v-if="currentStep > 0" :disabled="running" @click="currentStep--">{{
|
||||
$t('page.weightTest.btnPrev')
|
||||
}}</ElButton>
|
||||
<ElButton v-if="currentStep < 1" type="primary" :disabled="running" @click="currentStep++">{{
|
||||
$t('page.weightTest.btnNext')
|
||||
}}</ElButton>
|
||||
<ElButton
|
||||
v-if="currentStep === 1"
|
||||
v-permission="'dice:reward:index:startWeightTest'"
|
||||
type="primary"
|
||||
:loading="running"
|
||||
@click="handleStart"
|
||||
>开始测试</ElButton
|
||||
>{{ $t('page.weightTest.btnStart') }}</ElButton
|
||||
>
|
||||
<ElButton :disabled="running" @click="visible = false">取消</ElButton>
|
||||
<ElButton :disabled="running" @click="visible = false">{{
|
||||
$t('page.weightTest.btnCancel')
|
||||
}}</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
@@ -148,6 +173,10 @@
|
||||
<script setup lang="ts">
|
||||
import api from '../../../api/reward/index'
|
||||
import lotteryPoolApi from '../../../api/lottery_pool_config/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const countOptions = [0, 100, 500, 1000, 5000]
|
||||
const tierKeys = ['T1', 'T2', 'T3', 'T4', 'T5'] as const
|
||||
@@ -169,7 +198,9 @@
|
||||
})
|
||||
const lotteryOptions = ref<Array<{ id: number; name: string }>>([])
|
||||
/** 付费抽奖券可选档位:name=default */
|
||||
const paidLotteryOptions = computed(() => lotteryOptions.value.filter((r) => r.name === 'default'))
|
||||
const paidLotteryOptions = computed(() =>
|
||||
lotteryOptions.value.filter((r) => r.name === 'default')
|
||||
)
|
||||
/** 免费抽奖券可选档位:优先 name=killScore,若无则显示全部以便下拉有选项 */
|
||||
const freeLotteryOptions = computed(() => {
|
||||
const list = lotteryOptions.value.filter((r) => r.name === 'killScore')
|
||||
@@ -216,7 +247,10 @@
|
||||
async function loadLotteryOptions() {
|
||||
try {
|
||||
const list = await lotteryPoolApi.getOptions()
|
||||
lotteryOptions.value = list.map((r: { id: number; name: string }) => ({ id: r.id, name: r.name }))
|
||||
lotteryOptions.value = list.map((r: { id: number; name: string }) => ({
|
||||
id: r.id,
|
||||
name: r.name
|
||||
}))
|
||||
// 付费抽奖券默认使用 name=default
|
||||
const normal = list.find((r: { name?: string }) => r.name === 'default')
|
||||
if (normal) {
|
||||
@@ -229,7 +263,7 @@
|
||||
} else if (list.length > 0) {
|
||||
form.free_lottery_config_id = list[0].id
|
||||
}
|
||||
} catch (_) {
|
||||
} catch {
|
||||
lotteryOptions.value = []
|
||||
}
|
||||
}
|
||||
@@ -256,7 +290,7 @@
|
||||
|
||||
function validateForm(): boolean {
|
||||
if (form.paid_s_count + form.paid_n_count + form.free_s_count + form.free_n_count <= 0) {
|
||||
ElMessage.warning('付费或免费至少一种方向次数之和大于 0')
|
||||
ElMessage.warning(t('page.weightTest.warnTotalSpins'))
|
||||
return false
|
||||
}
|
||||
const needPaidTier = form.paid_lottery_config_id == null
|
||||
@@ -264,22 +298,22 @@
|
||||
if (needPaidTier) {
|
||||
const sum = paidTierSum.value
|
||||
if (sum <= 0) {
|
||||
ElMessage.warning('付费未选奖池时,T1~T5 档位概率之和需大于 0')
|
||||
ElMessage.warning(t('page.weightTest.warnPaidTierSumPositive'))
|
||||
return false
|
||||
}
|
||||
if (sum > 100) {
|
||||
ElMessage.warning('付费档位概率 T1~T5 之和不能超过 100%')
|
||||
ElMessage.warning(t('page.weightTest.warnPaidTierSumMax'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (needFreeTier) {
|
||||
const sum = freeTierSum.value
|
||||
if (sum <= 0) {
|
||||
ElMessage.warning('免费未选奖池时,T1~T5 档位概率之和需大于 0')
|
||||
ElMessage.warning(t('page.weightTest.warnFreeTierSumPositive'))
|
||||
return false
|
||||
}
|
||||
if (sum > 100) {
|
||||
ElMessage.warning('免费档位概率 T1~T5 之和不能超过 100%')
|
||||
ElMessage.warning(t('page.weightTest.warnFreeTierSumMax'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -291,13 +325,11 @@
|
||||
running.value = true
|
||||
try {
|
||||
await api.startWeightTest(buildPayload())
|
||||
ElMessage.success(
|
||||
'测试任务已创建,后台将自动执行。请在【玩家抽奖记录(测试数据)】中查看生成的测试数据'
|
||||
)
|
||||
ElMessage.success(t('page.weightTest.successCreated'))
|
||||
visible.value = false
|
||||
emit('success')
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || '创建测试任务失败')
|
||||
ElMessage.error(e?.message || t('page.weightTest.failCreate'))
|
||||
} finally {
|
||||
running.value = false
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:loading="createRewardLoading"
|
||||
@click="handleCreateRewardReference"
|
||||
v-ripple
|
||||
title="按规则:start_index=config(grid_number).id;顺时针 end_index=(start_index+grid_number)%26;逆时针 end_index=start_index-grid_number≥0?start_index-grid_number:26+start_index-grid_number"
|
||||
:title="$t('page.toolbar.createRewardRefTitle')"
|
||||
>
|
||||
{{ $t('page.toolbar.createRewardRef') }}
|
||||
</ElButton>
|
||||
@@ -18,9 +18,9 @@
|
||||
</template>
|
||||
|
||||
<ElTabs v-model="activeTab" type="card" class="top-tabs">
|
||||
<ElTabPane label="奖励索引" name="index">
|
||||
<ElTabPane :label="$t('page.configPage.tabIndex')" name="index">
|
||||
<div class="tab-panel">
|
||||
<div class="panel-tip">色子点数须在 5~30 之间且本表内不重复。</div>
|
||||
<div class="panel-tip">{{ $t('page.configPage.tipIndex') }}</div>
|
||||
<div class="table-scroll-wrap">
|
||||
<ElTable
|
||||
v-loading="loading"
|
||||
@@ -29,12 +29,12 @@
|
||||
size="default"
|
||||
class="config-table"
|
||||
>
|
||||
<ElTableColumn label="索引(id)" prop="id" width="60" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colId')" prop="id" width="60" align="center">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.id }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="色子点数" min-width="100" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colDicePoints')" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInputNumber
|
||||
v-model="row.grid_number"
|
||||
@@ -46,17 +46,25 @@
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="显示文本" min-width="100" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colDisplayText')" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.ui_text" size="small" placeholder="显示文本(中文)" />
|
||||
<ElInput
|
||||
v-model="row.ui_text"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderDisplayZh')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="显示文本(英文)" min-width="120" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colDisplayTextEn')" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.ui_text_en" size="small" placeholder="显示文本(英文)" />
|
||||
<ElInput
|
||||
v-model="row.ui_text_en"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderDisplayEn')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="真实结算" min-width="110" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colRealEv')" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInputNumber
|
||||
v-model="row.real_ev"
|
||||
@@ -66,11 +74,11 @@
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="所属档位" width="100" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colTier')" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElSelect
|
||||
v-model="row.tier"
|
||||
placeholder="档位"
|
||||
:placeholder="$t('page.configPage.placeholderTierSelect')"
|
||||
clearable
|
||||
size="small"
|
||||
class="full-width"
|
||||
@@ -83,9 +91,13 @@
|
||||
</ElSelect>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="备注" min-width="140" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colRemark')" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.remark" size="small" placeholder="备注" />
|
||||
<ElInput
|
||||
v-model="row.remark"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderRemark')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
@@ -96,18 +108,15 @@
|
||||
type="primary"
|
||||
:loading="savingIndex"
|
||||
@click="handleSaveIndex"
|
||||
>保存</ElButton
|
||||
>{{ $t('page.configPage.btnSave') }}</ElButton
|
||||
>
|
||||
<ElButton @click="handleResetIndex">重置</ElButton>
|
||||
<ElButton @click="handleResetIndex">{{ $t('page.configPage.btnReset') }}</ElButton>
|
||||
</div>
|
||||
</div>
|
||||
</ElTabPane>
|
||||
<ElTabPane label="大奖权重" name="bigwin">
|
||||
<ElTabPane :label="$t('page.configPage.tabBigwin')" name="bigwin">
|
||||
<div class="tab-panel">
|
||||
<div class="panel-tip"
|
||||
>从左至右:中大奖点数(不可改)、显示信息、实际中奖、备注、权重(0~10000)。点数 5、30
|
||||
权重固定 100%。本表单独立提交,仅提交大奖权重。</div
|
||||
>
|
||||
<div class="panel-tip">{{ $t('page.configPage.tipBigwin') }}</div>
|
||||
<div class="table-scroll-wrap">
|
||||
<ElTable
|
||||
v-loading="loading"
|
||||
@@ -116,22 +125,30 @@
|
||||
size="default"
|
||||
class="config-table bigwin-table"
|
||||
>
|
||||
<ElTableColumn label="中大奖点数" width="100" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colBigwinPoints')" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="readonly-value">{{ row.grid_number }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="显示信息" min-width="140" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colDisplayInfo')" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.ui_text" size="small" placeholder="显示信息(中文)" />
|
||||
<ElInput
|
||||
v-model="row.ui_text"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderDisplayInfoZh')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="显示信息(英文)" min-width="160" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colDisplayInfoEn')" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.ui_text_en" size="small" placeholder="显示信息(英文)" />
|
||||
<ElInput
|
||||
v-model="row.ui_text_en"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderDisplayInfoEn')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="实际中奖" min-width="120" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colRealPrize')" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInputNumber
|
||||
v-model="row.real_ev"
|
||||
@@ -141,12 +158,16 @@
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="备注" min-width="140" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colRemark')" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<ElInput v-model="row.remark" size="small" placeholder="备注" />
|
||||
<ElInput
|
||||
v-model="row.remark"
|
||||
size="small"
|
||||
:placeholder="$t('page.configPage.placeholderRemark')"
|
||||
/>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="权重(0-10000)" min-width="220" align="center">
|
||||
<ElTableColumn :label="$t('page.configPage.colWeightRange')" min-width="220" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="weight-cell">
|
||||
<ElSlider
|
||||
@@ -167,15 +188,15 @@
|
||||
class="weight-input"
|
||||
/>
|
||||
</div>
|
||||
<span v-if="isBigwinWeightDisabled(row)" class="weight-tip"
|
||||
>点数 5、30 固定 100%</span
|
||||
>
|
||||
<span v-if="isBigwinWeightDisabled(row)" class="weight-tip">{{
|
||||
$t('page.configPage.weightFixedTip')
|
||||
}}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
</div>
|
||||
<div v-if="bigwinRows.length === 0 && !loading" class="empty-tip">
|
||||
暂无 BIGWIN 档位配置,请在「奖励索引」中设置 tier 为 BIGWIN。
|
||||
{{ $t('page.configPage.emptyBigwin') }}
|
||||
</div>
|
||||
<div class="tab-footer">
|
||||
<ElButton
|
||||
@@ -183,9 +204,9 @@
|
||||
type="primary"
|
||||
:loading="savingBigwin"
|
||||
@click="handleSaveBigwin"
|
||||
>保存</ElButton
|
||||
>{{ $t('page.configPage.btnSave') }}</ElButton
|
||||
>
|
||||
<ElButton @click="handleResetBigwin">重置</ElButton>
|
||||
<ElButton @click="handleResetBigwin">{{ $t('page.configPage.btnReset') }}</ElButton>
|
||||
</div>
|
||||
</div>
|
||||
</ElTabPane>
|
||||
@@ -196,8 +217,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import api from '../../api/reward_config/index'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
/** 第一页:奖励索引行(来自 DiceRewardConfig 表) */
|
||||
interface IndexRow {
|
||||
id: number
|
||||
@@ -247,11 +271,11 @@
|
||||
async function handleCreateRewardReference() {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'按规则创建奖励对照:起始索引 start_index=奖励配置中 grid_number 对应格位的 id;顺时针 end_index=(start_index+摇取点数)%26;逆时针 end_index=start_index-摇取点数≥0 则取该值,否则 26+start_index-摇取点数。先清空现有数据再为 5-30 共 26 个点数、顺/逆时针分别生成。是否继续?',
|
||||
'创建奖励对照',
|
||||
t('page.configPage.confirmCreateRefMsg'),
|
||||
t('page.configPage.confirmCreateRefTitle'),
|
||||
{
|
||||
confirmButtonText: '确定创建',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: t('page.configPage.confirmCreateRefOk'),
|
||||
cancelButtonText: t('page.configPage.confirmCreateRefCancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
@@ -262,14 +286,23 @@
|
||||
try {
|
||||
const res: any = await api.createRewardReference()
|
||||
const data = res?.data ?? res
|
||||
const msg =
|
||||
typeof data === 'object' && data !== null
|
||||
? `已按 5-30 共26个点数、顺时针+逆时针创建:顺时针新增 ${data.created_clockwise ?? 0} 条、逆时针新增 ${data.created_counterclockwise ?? 0} 条;顺时针更新 ${data.updated_clockwise ?? 0} 条、逆时针更新 ${data.updated_counterclockwise ?? 0} 条${(data.skipped ?? 0) > 0 ? `;${data.skipped} 个点数使用兜底起始索引` : ''}`
|
||||
: '创建成功'
|
||||
let msg = t('page.configPage.createRefSuccessSimple')
|
||||
if (typeof data === 'object' && data !== null) {
|
||||
const skipped = Number(data.skipped ?? 0)
|
||||
const skippedPart =
|
||||
skipped > 0 ? t('page.configPage.createRefSuccessSkipped', { n: skipped }) : ''
|
||||
msg = t('page.configPage.createRefSuccess', {
|
||||
cwNew: data.created_clockwise ?? 0,
|
||||
ccwNew: data.created_counterclockwise ?? 0,
|
||||
cwUp: data.updated_clockwise ?? 0,
|
||||
ccwUp: data.updated_counterclockwise ?? 0,
|
||||
skippedPart
|
||||
})
|
||||
}
|
||||
ElMessage.success(msg)
|
||||
loadIndexList()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message ?? '创建奖励对照失败')
|
||||
ElMessage.error(e?.message ?? t('page.configPage.createRefFail'))
|
||||
} finally {
|
||||
createRewardLoading.value = false
|
||||
}
|
||||
@@ -288,7 +321,7 @@
|
||||
indexRowsSnapshot = rows.map((r) => ({ ...r }))
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error('获取奖励索引配置失败')
|
||||
ElMessage.error(t('page.configPage.loadIndexFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
@@ -319,18 +352,20 @@
|
||||
function validateIndexFormForSave(): string | null {
|
||||
const toSave = indexRows.value.filter((r) => r.tier !== 'BIGWIN')
|
||||
if (toSave.length === 0) {
|
||||
return '暂无奖励索引数据可保存'
|
||||
return t('page.configPage.warnNoIndexToSave')
|
||||
}
|
||||
const nums = toSave.map((r) => Number(r.grid_number))
|
||||
const outOfRange = nums.filter(
|
||||
(n) => Number.isNaN(n) || n < GRID_NUMBER_MIN || n > GRID_NUMBER_MAX
|
||||
)
|
||||
if (outOfRange.length > 0) {
|
||||
return `色子点数必须在 ${GRID_NUMBER_MIN}~${GRID_NUMBER_MAX} 之间`
|
||||
return t('page.configPage.warnGridRange', { min: GRID_NUMBER_MIN, max: GRID_NUMBER_MAX })
|
||||
}
|
||||
const duplicates = findDuplicateValues(nums)
|
||||
if (duplicates.length > 0) {
|
||||
return `色子点数在本表内不能重复,重复的点数为:${duplicates.join('、')}`
|
||||
return t('page.configPage.warnDupGrid', {
|
||||
list: duplicates.join(t('page.configPage.dupJoiner'))
|
||||
})
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -355,10 +390,10 @@
|
||||
remark: r.remark
|
||||
}))
|
||||
await api.batchUpdate(indexPayload)
|
||||
ElMessage.success('保存成功')
|
||||
ElMessage.success(t('page.configPage.saveSuccess'))
|
||||
indexRowsSnapshot = indexRows.value.map((r) => ({ ...r }))
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message ?? '保存失败')
|
||||
ElMessage.error(e?.message ?? t('page.configPage.saveFail'))
|
||||
} finally {
|
||||
savingIndex.value = false
|
||||
}
|
||||
@@ -367,25 +402,27 @@
|
||||
/** 奖励索引页:重置为本页数据(重新拉取列表) */
|
||||
function handleResetIndex() {
|
||||
loadIndexList()
|
||||
ElMessage.info('已重新加载奖励索引,恢复为服务器最新数据')
|
||||
ElMessage.info(t('page.configPage.resetIndexReloaded'))
|
||||
}
|
||||
|
||||
/** 大奖权重表单校验:点数在本表内不重复 */
|
||||
function validateBigwinFormForSave(): string | null {
|
||||
const rows = bigwinRows.value
|
||||
if (rows.length === 0) {
|
||||
return '暂无 BIGWIN 档位配置可保存'
|
||||
return t('page.configPage.warnNoBigwinToSave')
|
||||
}
|
||||
const nums = rows.map((r) => Number(r.grid_number))
|
||||
const outOfRange = nums.filter(
|
||||
(n) => Number.isNaN(n) || n < GRID_NUMBER_MIN || n > GRID_NUMBER_MAX
|
||||
)
|
||||
if (outOfRange.length > 0) {
|
||||
return `色子点数必须在 ${GRID_NUMBER_MIN}~${GRID_NUMBER_MAX} 之间`
|
||||
return t('page.configPage.warnGridRange', { min: GRID_NUMBER_MIN, max: GRID_NUMBER_MAX })
|
||||
}
|
||||
const duplicates = findDuplicateValues(nums)
|
||||
if (duplicates.length > 0) {
|
||||
return `大奖权重本表内点数不能重复,重复的点数为:${duplicates.join('、')}`
|
||||
return t('page.configPage.warnBigwinDupGrid', {
|
||||
list: duplicates.join(t('page.configPage.dupJoiner'))
|
||||
})
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -394,7 +431,7 @@
|
||||
async function handleSaveBigwin() {
|
||||
const rows = bigwinRows.value
|
||||
if (rows.length === 0) {
|
||||
ElMessage.info('暂无 BIGWIN 档位配置,请先在「奖励索引」中设置 tier 为 BIGWIN')
|
||||
ElMessage.info(t('page.configPage.infoNoBigwin'))
|
||||
return
|
||||
}
|
||||
const err = validateBigwinFormForSave()
|
||||
@@ -421,10 +458,10 @@
|
||||
: Math.max(0, Math.min(10000, Math.floor(r.weight)))
|
||||
}))
|
||||
await api.saveBigwinWeightsByGrid(weightItems)
|
||||
ElMessage.success('保存成功')
|
||||
ElMessage.success(t('page.configPage.saveSuccess'))
|
||||
loadIndexList()
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message ?? '保存失败')
|
||||
ElMessage.error(e?.message ?? t('page.configPage.saveFail'))
|
||||
} finally {
|
||||
savingBigwin.value = false
|
||||
}
|
||||
@@ -433,7 +470,7 @@
|
||||
/** 大奖权重页:重置(重新拉取列表,BIGWIN 数据随之更新) */
|
||||
function handleResetBigwin() {
|
||||
loadIndexList()
|
||||
ElMessage.info('已重新加载,大奖权重恢复为服务器最新数据')
|
||||
ElMessage.info(t('page.configPage.resetBigwinReloaded'))
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增奖励配置' : '编辑奖励配置'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="色子点数" prop="grid_number">
|
||||
<el-form-item :label="$t('page.form.labelDicePoints')" prop="grid_number">
|
||||
<el-input-number
|
||||
v-model="formData.grid_number"
|
||||
placeholder="请输入色子点数"
|
||||
:placeholder="$t('page.form.placeholderDicePoints')"
|
||||
:disabled="dialogType === 'edit'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端显示文本" prop="ui_text">
|
||||
<el-input v-model="formData.ui_text" placeholder="请输入前端显示文本(中文)" />
|
||||
<el-form-item :label="$t('page.form.labelUiText')" prop="ui_text">
|
||||
<el-input v-model="formData.ui_text" :placeholder="$t('page.form.placeholderUiText')"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端显示文本(英文)" prop="ui_text_en">
|
||||
<el-input v-model="formData.ui_text_en" placeholder="请输入前端显示文本(英文)" />
|
||||
<el-form-item :label="$t('page.form.labelUiTextEn')" prop="ui_text_en">
|
||||
<el-input v-model="formData.ui_text_en" :placeholder="$t('page.form.placeholderUiTextEn')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="真实资金结算" prop="real_ev">
|
||||
<el-input-number v-model="formData.real_ev" placeholder="请输入真实资金结算" />
|
||||
<el-form-item :label="$t('page.form.labelRealEv')" prop="real_ev">
|
||||
<el-input-number v-model="formData.real_ev" :placeholder="$t('page.form.placeholderRealEv')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属档位" prop="tier">
|
||||
<el-form-item :label="$t('page.form.labelTier')" prop="tier">
|
||||
<el-select
|
||||
v-model="formData.tier"
|
||||
placeholder="请选择所属档位"
|
||||
:placeholder="$t('page.form.placeholderTier')"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="dialogType === 'edit'"
|
||||
@@ -37,39 +37,39 @@
|
||||
<el-option label="T3" value="T3" />
|
||||
<el-option label="T4" value="T4" />
|
||||
<el-option label="T5" value="T5" />
|
||||
<el-option label="BIGWIN(超级大奖)" value="BIGWIN" />
|
||||
<el-option :label="$t('page.form.tierBigWin')" value="BIGWIN" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- BIGWIN 时可编辑权重:10000=100% 中奖,0=0% 中奖;点数 5、30 固定 100% 不可改 -->
|
||||
<el-form-item v-if="formData.tier === 'BIGWIN'" label="大奖权重" prop="weight">
|
||||
<el-form-item v-if="formData.tier === 'BIGWIN'" :label="$t('page.form.labelBigWinWeight')" prop="weight">
|
||||
<el-input-number
|
||||
v-model="formData.weight"
|
||||
:min="0"
|
||||
:max="10000"
|
||||
:step="100"
|
||||
placeholder="0~10000,10000=100%中奖"
|
||||
:placeholder="$t('page.form.placeholderBigWinWeight')"
|
||||
:disabled="isBigwinWeightDisabled"
|
||||
/>
|
||||
<div v-if="isBigwinWeightDisabled" class="form-tip">
|
||||
点数 5、30 摇到必中大奖,权重固定 10000
|
||||
{{ $t('page.form.bigWinWeightDisabledTip') }}
|
||||
</div>
|
||||
<div v-else class="form-tip">10000=100% 中奖,0=0% 中奖;仅对点数 10/15/20/25 生效</div>
|
||||
<div v-else class="form-tip">{{ $t('page.form.bigWinWeightTip') }}</div>
|
||||
</el-form-item>
|
||||
<!-- 权重已迁移至「T1-T5 与 BIGWIN 权重配比」弹窗(dice_reward 表);BIGWIN 时本弹窗可编辑 weight;起始索引已迁移至 dice_reward.start_index -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -78,6 +78,7 @@
|
||||
import api from '../../../api/reward_config/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -97,6 +98,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -111,14 +113,16 @@
|
||||
/**
|
||||
* 表单验证规则(权重已迁移至权重配比弹窗)
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
grid_number: [{ required: true, message: '色子点数必需填写', trigger: 'blur' }],
|
||||
ui_text: [{ required: true, message: '前端显示文本必需填写', trigger: 'blur' }],
|
||||
ui_text_en: [{ max: 255, message: '前端显示文本(英文)长度需小于 255 字符', trigger: 'blur' }],
|
||||
real_ev: [{ required: true, message: '真实资金结算必需填写', trigger: 'blur' }],
|
||||
tier: [{ required: true, message: '所属档位必需填写', trigger: 'blur' }],
|
||||
weight: [{ type: 'number', min: 0, max: 10000, message: '大奖权重 0~10000', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
grid_number: [{ required: true, message: t('page.form.ruleDicePointsRequired'), trigger: 'blur' }],
|
||||
ui_text: [{ required: true, message: t('page.form.ruleUiTextRequired'), trigger: 'blur' }],
|
||||
ui_text_en: [{ max: 255, message: t('page.form.ruleUiTextEnMax'), trigger: 'blur' }],
|
||||
real_ev: [{ required: true, message: t('page.form.ruleRealEvRequired'), trigger: 'blur' }],
|
||||
tier: [{ required: true, message: t('page.form.ruleTierRequired'), trigger: 'blur' }],
|
||||
weight: [
|
||||
{ type: 'number', min: 0, max: 10000, message: t('page.form.ruleBigWinWeightRange'), trigger: 'blur' }
|
||||
]
|
||||
}))
|
||||
|
||||
/** 点数 5、30 固定 100% 中大奖,权重不可改 */
|
||||
const isBigwinWeightDisabled = computed(
|
||||
@@ -222,10 +226,10 @@
|
||||
}
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(payload)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(payload)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="T1-T5 权重配比(顺时针/逆时针)"
|
||||
:title="$t('page.weightRatio.title')"
|
||||
width="900px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="global-tip">
|
||||
权重来自<strong>奖励对照表(dice_reward)</strong>,按<strong>结束索引(DiceRewardConfig.id)</strong>区分<strong>顺时针</strong>与<strong>逆时针</strong>两套权重;抽奖时按当前方向取对应权重。
|
||||
{{ $t('page.weightRatio.globalTip') }}
|
||||
</div>
|
||||
<el-tabs v-model="activeTier" type="card">
|
||||
<el-tab-pane v-for="t in tierKeys" :key="t" :label="t" :name="t">
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip"> 该档位暂无配置数据 </div>
|
||||
<div v-if="getTierItems(t).length === 0" class="empty-tip">{{ $t('page.weightRatio.emptyTier') }}</div>
|
||||
<template v-else>
|
||||
<div class="chart-wrap" v-if="t !== 'T4' && t !== 'T5'">
|
||||
<div class="chart-row">
|
||||
<ArtBarChart
|
||||
x-axis-name="结束索引"
|
||||
:x-axis-name="$t('page.weightRatio.xAxisEndIndex')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartData(t, 'clockwise')"
|
||||
height="180px"
|
||||
/>
|
||||
<ArtBarChart
|
||||
x-axis-name="结束索引"
|
||||
:x-axis-name="$t('page.weightRatio.xAxisEndIndex')"
|
||||
:x-axis-data="getTierChartLabels(t)"
|
||||
:data="getTierChartData(t, 'counterclockwise')"
|
||||
height="180px"
|
||||
@@ -31,20 +31,41 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="weight-sum" v-if="t !== 'T4' && t !== 'T5'">
|
||||
当前档位权重合计(顺时针):<strong>{{ getTierSumForValidation(t, 'clockwise') }}</strong>
|
||||
;逆时针:<strong>{{ getTierSumForValidation(t, 'counterclockwise') }}</strong>
|
||||
(各条 1-10000,档位内按权重比抽取,和不限制)
|
||||
{{
|
||||
$t('page.weightRatio.sumLine', {
|
||||
cw: getTierSumForValidation(t, 'clockwise'),
|
||||
ccw: getTierSumForValidation(t, 'counterclockwise')
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div class="weight-sum weight-sum-t4t5" v-else>
|
||||
T4、T5 档位抽中时仅有一个结果,无需配置权重。
|
||||
{{ $t('page.weightRatio.t4t5Note') }}
|
||||
</div>
|
||||
<el-table :data="getTierItems(t)" border size="small" class="weight-table">
|
||||
<el-table-column label="结束索引(id)" prop="id" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="色子点数" prop="grid_number" width="80" align="center" />
|
||||
<el-table-column label="实际中奖金额" prop="real_ev" width="90" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="显示文本" prop="ui_text" min-width="70" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" min-width="70" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="顺时针权重(1-10000)" min-width="160" align="center">
|
||||
<el-table-column
|
||||
:label="$t('page.weightRatio.colEndIndexId')"
|
||||
prop="id"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column :label="$t('page.weightRatio.colDicePoints')" prop="grid_number" width="80" align="center" />
|
||||
<el-table-column
|
||||
:label="$t('page.weightRatio.colRealEv')"
|
||||
prop="real_ev"
|
||||
width="90"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('page.weightRatio.colUiText')"
|
||||
prop="ui_text"
|
||||
min-width="70"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column :label="$t('page.table.remark')" prop="remark" min-width="70" align="center" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('page.weightRatio.colWeightCw')" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="weight-cell-vertical">
|
||||
<div class="weight-slider-wrap">
|
||||
@@ -87,7 +108,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="逆时针权重(1-10000)" min-width="160" align="center">
|
||||
<el-table-column :label="$t('page.weightRatio.colWeightCcw')" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<div class="weight-cell-vertical">
|
||||
<div class="weight-slider-wrap">
|
||||
@@ -135,13 +156,14 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button
|
||||
v-permission="'dice:reward_config:index:batchUpdateWeights'"
|
||||
type="primary"
|
||||
:loading="submitting"
|
||||
@click="handleSubmit"
|
||||
>提交</el-button>
|
||||
>{{ $t('table.form.submit') }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -150,6 +172,9 @@
|
||||
import api from '../../../api/reward_config/index'
|
||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const TIER_KEYS = ['T1', 'T2', 'T3', 'T4', 'T5'] as const
|
||||
type DirectionKey = 'clockwise' | 'counterclockwise'
|
||||
@@ -340,7 +365,7 @@
|
||||
grouped.value = parseWeightRatioPayload(res)
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error('获取权重配比数据失败')
|
||||
ElMessage.error(t('page.weightRatio.fetchFail'))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -363,19 +388,19 @@
|
||||
function handleSubmit() {
|
||||
const items = collectItems()
|
||||
if (items.length === 0) {
|
||||
ElMessage.info('没有可提交的配置')
|
||||
ElMessage.info(t('page.weightRatio.nothingToSubmit'))
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
api
|
||||
.batchUpdateWeights(items)
|
||||
.then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
ElMessage.success(t('page.weightRatio.saveSuccess'))
|
||||
emit('success')
|
||||
handleClose()
|
||||
})
|
||||
.catch((e: { message?: string }) => {
|
||||
ElMessage.error(e?.message ?? '保存失败')
|
||||
ElMessage.error(e?.message ?? t('page.weightRatio.submitFail'))
|
||||
})
|
||||
.finally(() => {
|
||||
submitting.value = false
|
||||
|
||||
@@ -42,11 +42,17 @@
|
||||
</template>
|
||||
<!-- 付费抽取:顺时针、逆时针抽取次数(兼容旧数据用 s_count/n_count) -->
|
||||
<template #paid_draw="{ row }">
|
||||
<span>顺 {{ getPaidS(row) }} / 逆 {{ getPaidN(row) }}</span>
|
||||
<span
|
||||
>{{ $t('page.table.clockwiseAbbr') }} {{ getPaidS(row) }} /
|
||||
{{ $t('page.table.counterclockwiseAbbr') }} {{ getPaidN(row) }}</span
|
||||
>
|
||||
</template>
|
||||
<!-- 免费抽取:顺时针、逆时针抽取次数 -->
|
||||
<template #free_draw="{ row }">
|
||||
<span>顺 {{ row.free_s_count ?? 0 }} / 逆 {{ row.free_n_count ?? 0 }}</span>
|
||||
<span
|
||||
>{{ $t('page.table.clockwiseAbbr') }} {{ row.free_s_count ?? 0 }} /
|
||||
{{ $t('page.table.counterclockwiseAbbr') }} {{ row.free_n_count ?? 0 }}</span
|
||||
>
|
||||
</template>
|
||||
<!-- 平台赚取金额 -->
|
||||
<template #platform_profit="{ row }">
|
||||
@@ -127,7 +133,7 @@
|
||||
if (s === -1) return t('page.table.statusFail')
|
||||
if (s === 1) return t('page.table.statusDone')
|
||||
if (s === 0 || s === 2) return t('page.table.statusTesting')
|
||||
return '—'
|
||||
return t('page.detail.dash')
|
||||
}
|
||||
|
||||
// 付费抽取次数(兼容旧数据:无 paid_s_count 时用 s_count)
|
||||
@@ -144,9 +150,10 @@
|
||||
|
||||
// 平台赚取金额展示(未完成或空显示 —)
|
||||
function formatPlatformProfit(v: unknown): string {
|
||||
if (v === null || v === undefined || v === '') return '—'
|
||||
const dash = t('page.detail.dash')
|
||||
if (v === null || v === undefined || v === '') return dash
|
||||
const n = Number(v)
|
||||
if (Number.isNaN(n)) return '—'
|
||||
if (Number.isNaN(n)) return dash
|
||||
return String(n)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
v-model="visible"
|
||||
title="测试记录详情"
|
||||
:title="$t('page.detail.title')"
|
||||
:size="drawerSize"
|
||||
direction="rtl"
|
||||
destroy-on-close
|
||||
@@ -9,37 +9,39 @@
|
||||
>
|
||||
<template v-if="record">
|
||||
<div class="detail-section">
|
||||
<div class="section-title">基本信息</div>
|
||||
<div class="section-title">{{ $t('page.detail.sectionBasic') }}</div>
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<el-descriptions-item label="记录ID">
|
||||
<el-descriptions-item :label="$t('page.detail.recordId')">
|
||||
{{ record.id }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="测试次数">{{ record.test_count }} 次</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ record.create_time || '—' }}
|
||||
<el-descriptions-item :label="$t('page.detail.testCount')"
|
||||
>{{ record.test_count }}{{ $t('page.detail.testCountSuffix') }}</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item :label="$t('page.detail.createTime')">
|
||||
{{ record.create_time || $t('page.detail.dash') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="执行管理员">
|
||||
{{ record.admin_name ?? record.admin_id ?? '—' }}
|
||||
<el-descriptions-item :label="$t('page.detail.admin')">
|
||||
{{ record.admin_name ?? record.admin_id ?? $t('page.detail.dash') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="付费奖池配置ID">
|
||||
{{ record.paid_lottery_config_id ?? record.lottery_config_id ?? '—' }}
|
||||
<el-descriptions-item :label="$t('page.detail.paidPoolId')">
|
||||
{{ record.paid_lottery_config_id ?? record.lottery_config_id ?? $t('page.detail.dash') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="免费奖池配置ID">
|
||||
{{ record.free_lottery_config_id ?? '—' }}
|
||||
<el-descriptions-item :label="$t('page.detail.freePoolId')">
|
||||
{{ record.free_lottery_config_id ?? $t('page.detail.dash') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="BIGWIN 权重快照">
|
||||
<el-descriptions-item :label="$t('page.detail.bigwinSnapshot')">
|
||||
<template v-if="bigwinWeightDisplay.length">
|
||||
<span v-for="item in bigwinWeightDisplay" :key="item.grid" class="mr-2">
|
||||
{{ item.grid }}:{{ item.weight }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else>—</template>
|
||||
<template v-else>{{ $t('page.detail.dash') }}</template>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="section-title">付费抽奖档位概率(T1-T5,测试时使用)</div>
|
||||
<div class="section-title">{{ $t('page.detail.sectionPaidTier') }}</div>
|
||||
<el-table
|
||||
v-if="paidTierTableData.length"
|
||||
:data="paidTierTableData"
|
||||
@@ -48,17 +50,17 @@
|
||||
class="tier-weights-table"
|
||||
max-height="160"
|
||||
>
|
||||
<el-table-column prop="tier" label="档位" width="80" align="center" />
|
||||
<el-table-column prop="weight" label="权重" width="100" align="center" />
|
||||
<el-table-column prop="percent" label="占比" width="100" align="center" />
|
||||
<el-table-column prop="tier" :label="$t('page.detail.colTier')" width="80" align="center" />
|
||||
<el-table-column prop="weight" :label="$t('page.detail.colWeight')" width="100" align="center" />
|
||||
<el-table-column prop="percent" :label="$t('page.detail.colPercent')" width="100" align="center" />
|
||||
</el-table>
|
||||
<div v-else class="empty-tip">
|
||||
暂无付费档位数据(旧记录可能仅保存 tier_weights_snapshot)
|
||||
{{ $t('page.detail.emptyPaidTier') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="section-title">免费抽奖档位概率(T1-T5,测试时使用)</div>
|
||||
<div class="section-title">{{ $t('page.detail.sectionFreeTier') }}</div>
|
||||
<el-table
|
||||
v-if="freeTierTableData.length"
|
||||
:data="freeTierTableData"
|
||||
@@ -67,18 +69,18 @@
|
||||
class="tier-weights-table"
|
||||
max-height="160"
|
||||
>
|
||||
<el-table-column prop="tier" label="档位" width="80" align="center" />
|
||||
<el-table-column prop="weight" label="权重" width="100" align="center" />
|
||||
<el-table-column prop="percent" label="占比" width="100" align="center" />
|
||||
<el-table-column prop="tier" :label="$t('page.detail.colTier')" width="80" align="center" />
|
||||
<el-table-column prop="weight" :label="$t('page.detail.colWeight')" width="100" align="center" />
|
||||
<el-table-column prop="percent" :label="$t('page.detail.colPercent')" width="100" align="center" />
|
||||
</el-table>
|
||||
<div v-else class="empty-tip">暂无免费档位数据</div>
|
||||
<div v-else class="empty-tip">{{ $t('page.detail.emptyFreeTier') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="section-title">权重配比快照(测试时使用的 T1-T5/BIGWIN 配置)</div>
|
||||
<div class="section-title">{{ $t('page.detail.sectionSnapshot') }}</div>
|
||||
|
||||
<div class="snapshot-group">
|
||||
<div class="snapshot-subtitle">顺时针(非 BIGWIN)</div>
|
||||
<div class="snapshot-subtitle">{{ $t('page.detail.subCw') }}</div>
|
||||
<el-table
|
||||
:data="snapshotClockwise"
|
||||
border
|
||||
@@ -86,15 +88,15 @@
|
||||
max-height="180"
|
||||
class="snapshot-table"
|
||||
>
|
||||
<el-table-column prop="tier" label="档位" width="80" align="center" />
|
||||
<el-table-column prop="grid_number" label="色子点数" width="100" align="center" />
|
||||
<el-table-column prop="weight" label="权重" width="90" align="center" />
|
||||
<el-table-column prop="tier" :label="$t('page.detail.colTier')" width="80" align="center" />
|
||||
<el-table-column prop="grid_number" :label="$t('page.detail.colGridNumber')" width="100" align="center" />
|
||||
<el-table-column prop="weight" :label="$t('page.detail.colWeight')" width="90" align="center" />
|
||||
</el-table>
|
||||
<div v-if="!snapshotClockwise.length" class="empty-tip">暂无顺时针数据</div>
|
||||
<div v-if="!snapshotClockwise.length" class="empty-tip">{{ $t('page.detail.emptyCw') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="snapshot-group">
|
||||
<div class="snapshot-subtitle">逆时针(非 BIGWIN)</div>
|
||||
<div class="snapshot-subtitle">{{ $t('page.detail.subCcw') }}</div>
|
||||
<el-table
|
||||
:data="snapshotCounterclockwise"
|
||||
border
|
||||
@@ -102,15 +104,15 @@
|
||||
max-height="180"
|
||||
class="snapshot-table"
|
||||
>
|
||||
<el-table-column prop="tier" label="档位" width="80" align="center" />
|
||||
<el-table-column prop="grid_number" label="色子点数" width="100" align="center" />
|
||||
<el-table-column prop="weight" label="权重" width="90" align="center" />
|
||||
<el-table-column prop="tier" :label="$t('page.detail.colTier')" width="80" align="center" />
|
||||
<el-table-column prop="grid_number" :label="$t('page.detail.colGridNumber')" width="100" align="center" />
|
||||
<el-table-column prop="weight" :label="$t('page.detail.colWeight')" width="90" align="center" />
|
||||
</el-table>
|
||||
<div v-if="!snapshotCounterclockwise.length" class="empty-tip">暂无逆时针数据</div>
|
||||
<div v-if="!snapshotCounterclockwise.length" class="empty-tip">{{ $t('page.detail.emptyCcw') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="snapshot-group">
|
||||
<div class="snapshot-subtitle">BIGWIN(按 DiceRewardConfig 配置快照)</div>
|
||||
<div class="snapshot-subtitle">{{ $t('page.detail.subBigwin') }}</div>
|
||||
<el-table
|
||||
:data="bigwinTableData"
|
||||
border
|
||||
@@ -118,25 +120,25 @@
|
||||
max-height="180"
|
||||
class="snapshot-table"
|
||||
>
|
||||
<el-table-column prop="grid_number" label="色子点数" width="100" align="center" />
|
||||
<el-table-column prop="weight" label="权重" width="90" align="center" />
|
||||
<el-table-column prop="grid_number" :label="$t('page.detail.colGridNumber')" width="100" align="center" />
|
||||
<el-table-column prop="weight" :label="$t('page.detail.colWeight')" width="90" align="center" />
|
||||
</el-table>
|
||||
<div v-if="!bigwinTableData.length" class="empty-tip">暂无 BIGWIN 数据</div>
|
||||
<div v-if="!bigwinTableData.length" class="empty-tip">{{ $t('page.detail.emptyBigwinTable') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="section-title">落点统计(各 grid_number 出现次数)</div>
|
||||
<div class="section-title">{{ $t('page.detail.sectionResult') }}</div>
|
||||
<div class="chart-wrap">
|
||||
<ArtBarChart
|
||||
x-axis-name="色子点数 (grid_number)"
|
||||
:x-axis-name="$t('page.detail.chartXAxis')"
|
||||
:x-axis-data="chartLabels"
|
||||
:data="chartData"
|
||||
height="280px"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="resultTotal === 0" class="empty-tip">暂无落点数据</div>
|
||||
<div v-else class="result-summary">总落点次数:{{ resultTotal }}</div>
|
||||
<div v-if="resultTotal === 0" class="empty-tip">{{ $t('page.detail.emptyResult') }}</div>
|
||||
<div v-else class="result-summary">{{ $t('page.detail.resultTotal', { n: resultTotal }) }}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-section footer-actions">
|
||||
@@ -146,7 +148,7 @@
|
||||
:loading="importing"
|
||||
@click="openImport"
|
||||
>
|
||||
导入到当前配置
|
||||
{{ $t('page.detail.btnImport') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -154,21 +156,19 @@
|
||||
<!-- 导入弹窗 -->
|
||||
<el-dialog
|
||||
v-model="importVisible"
|
||||
title="导入到正式配置"
|
||||
:title="$t('page.detail.importTitle')"
|
||||
width="520px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<p class="import-desc">
|
||||
将本测试记录导入:<strong>DiceReward</strong>(格子权重)、
|
||||
<strong>DiceRewardConfig</strong>(BIGWIN weight)、
|
||||
<strong>DiceLotteryPoolConfig</strong>(付费/免费 T1-T5 档位概率)。请选择要写入的奖池。
|
||||
{{ $t('page.detail.importDesc') }}
|
||||
</p>
|
||||
<el-form label-width="160px">
|
||||
<el-form-item label="导入付费档位概率到奖池">
|
||||
<el-form-item :label="$t('page.detail.importPaidLabel')">
|
||||
<el-select
|
||||
v-model="importPaidLotteryConfigId"
|
||||
placeholder="选择任意奖池(建议付费池)"
|
||||
:placeholder="$t('page.detail.importPaidPlaceholder')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@@ -180,12 +180,12 @@
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="form-tip">不选则使用本记录保存时的付费奖池配置 ID</div>
|
||||
<div class="form-tip">{{ $t('page.detail.importPaidTip') }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="导入免费档位概率到奖池">
|
||||
<el-form-item :label="$t('page.detail.importFreeLabel')">
|
||||
<el-select
|
||||
v-model="importFreeLotteryConfigId"
|
||||
placeholder="选择任意奖池(建议免费池)"
|
||||
:placeholder="$t('page.detail.importFreePlaceholder')"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
@@ -197,17 +197,18 @@
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="form-tip">不选则使用本记录保存时的免费奖池配置 ID</div>
|
||||
<div class="form-tip">{{ $t('page.detail.importFreeTip') }}</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="importVisible = false">取消</el-button>
|
||||
<el-button @click="importVisible = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button
|
||||
v-permission="'dice:reward_config_record:index:importFromRecord'"
|
||||
type="primary"
|
||||
:loading="importing"
|
||||
@click="confirmImport"
|
||||
>确认导入</el-button>
|
||||
>{{ $t('page.detail.btnConfirmImport') }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
@@ -218,6 +219,9 @@
|
||||
import recordApi from '../../../api/reward_config_record/index'
|
||||
import lotteryConfigApi from '../../../api/lottery_pool_config/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
const GRID_NUMBERS = [
|
||||
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||
@@ -278,22 +282,24 @@
|
||||
const importFreeLotteryConfigId = ref<number | null>(null)
|
||||
const lotteryConfigOptions = ref<Array<{ id: number; name: string }>>([])
|
||||
|
||||
function tierWeightsToTableData(t: Record<string, number> | null | undefined) {
|
||||
if (!t || typeof t !== 'object') return []
|
||||
function tierWeightsToTableData(weightsMap: Record<string, number> | null | undefined) {
|
||||
const dash = t('page.detail.dash')
|
||||
if (!weightsMap || typeof weightsMap !== 'object') return []
|
||||
const tiers = ['T1', 'T2', 'T3', 'T4', 'T5']
|
||||
const rows = tiers.map((tier) => {
|
||||
const w = t[tier] ?? t[tier.toLowerCase()] ?? 0
|
||||
const w = weightsMap[tier] ?? weightsMap[tier.toLowerCase()] ?? 0
|
||||
return { tier, weight: w }
|
||||
})
|
||||
const total = rows.reduce((sum, r) => sum + r.weight, 0)
|
||||
return rows.map((r) => ({
|
||||
tier: r.tier,
|
||||
weight: r.weight,
|
||||
percent: total > 0 ? `${((r.weight / total) * 100).toFixed(1)}%` : '—'
|
||||
percent: total > 0 ? `${((r.weight / total) * 100).toFixed(1)}%` : dash
|
||||
}))
|
||||
}
|
||||
|
||||
const paidTierTableData = computed(() => {
|
||||
locale.value
|
||||
const r = props.record
|
||||
const paidFromRecord = r?.paid_tier_weights
|
||||
const snapshot = r?.tier_weights_snapshot
|
||||
@@ -315,6 +321,7 @@
|
||||
})
|
||||
|
||||
const freeTierTableData = computed(() => {
|
||||
locale.value
|
||||
const r = props.record
|
||||
const freeFromRecord = r?.free_tier_weights
|
||||
const snapshot = r?.tier_weights_snapshot
|
||||
@@ -362,6 +369,8 @@
|
||||
})
|
||||
|
||||
const snapshotTableData = computed(() => {
|
||||
locale.value
|
||||
const dash = t('page.detail.dash')
|
||||
const snapshot = props.record?.weight_config_snapshot as
|
||||
| Array<{
|
||||
tier?: string
|
||||
@@ -374,11 +383,12 @@
|
||||
return snapshot.map((item) => {
|
||||
const dir = item.direction
|
||||
return {
|
||||
tier: item.tier ?? '—',
|
||||
tier: item.tier ?? dash,
|
||||
direction: dir,
|
||||
direction_label: dir === 0 ? '顺时针' : dir === 1 ? '逆时针' : '—',
|
||||
grid_number: item.grid_number ?? '—',
|
||||
weight: item.weight ?? '—'
|
||||
direction_label:
|
||||
dir === 0 ? t('page.detail.dirCw') : dir === 1 ? t('page.detail.dirCcw') : dash,
|
||||
grid_number: item.grid_number ?? dash,
|
||||
weight: item.weight ?? dash
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -468,11 +478,11 @@
|
||||
paid_lottery_config_id: importPaidLotteryConfigId.value ?? undefined,
|
||||
free_lottery_config_id: importFreeLotteryConfigId.value ?? undefined
|
||||
})
|
||||
ElMessage.success('导入成功,已刷新 DiceReward、DiceRewardConfig(BIGWIN)、奖池配置')
|
||||
ElMessage.success(t('page.detail.importSuccess'))
|
||||
importVisible.value = false
|
||||
emit('import-done')
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message ?? '导入失败')
|
||||
ElMessage.error(e?.message ?? t('page.detail.importFail'))
|
||||
} finally {
|
||||
importing.value = false
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增奖励配置权重测试记录' : '编辑奖励配置权重测试记录'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="测试次数:100/500/1000" prop="test_count">
|
||||
<el-input v-model="formData.test_count" placeholder="请输入测试次数:100/500/1000" />
|
||||
<el-form-item :label="$t('page.form.labelTestCount')" prop="test_count">
|
||||
<el-input v-model="formData.test_count" :placeholder="$t('page.form.placeholderTestCount')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="测试时权重配比快照:按档位保存 id,grid_number,tier,weight" prop="weight_config_snapshot">
|
||||
<el-input v-model="formData.weight_config_snapshot" placeholder="请输入测试时权重配比快照:按档位保存 id,grid_number,tier,weight" />
|
||||
<el-form-item :label="$t('page.form.labelWeightSnapshot')" prop="weight_config_snapshot">
|
||||
<el-input v-model="formData.weight_config_snapshot" :placeholder="$t('page.form.placeholderWeightSnapshot')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="落点统计:grid_number=>出现次数" prop="result_counts">
|
||||
<el-input v-model="formData.result_counts" placeholder="请输入落点统计:grid_number=>出现次数" />
|
||||
<el-form-item :label="$t('page.form.labelResultCounts')" prop="result_counts">
|
||||
<el-input v-model="formData.result_counts" :placeholder="$t('page.form.placeholderResultCounts')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -29,6 +29,7 @@
|
||||
import api from '../../../api/reward_config_record/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -48,6 +49,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -62,9 +64,9 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
test_count: [{ required: true, message: '测试次数:100/500/1000必需填写', trigger: 'blur' }],
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
test_count: [{ required: true, message: t('page.form.ruleTestCountRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -136,10 +138,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增文件' : '编辑文件'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="800px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px">
|
||||
<el-form-item label="文件名称" prop="origin_name">
|
||||
<el-input v-model="formData.origin_name" placeholder="请输入文件名称" />
|
||||
<el-form-item :label="$t('page.form.labelFileName')" prop="origin_name">
|
||||
<el-input v-model="formData.origin_name" :placeholder="$t('page.form.placeholderFileName')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -24,6 +24,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import api from '@/api/safeguard/attachment'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -43,6 +45,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -55,9 +58,9 @@
|
||||
})
|
||||
|
||||
// 表单验证规则
|
||||
const rules: FormRules = {
|
||||
origin_name: [{ required: true, message: '请输入文件名称', trigger: 'blur' }]
|
||||
}
|
||||
const rules = computed<FormRules>(() => ({
|
||||
origin_name: [{ required: true, message: t('page.form.ruleFileNameRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
// 初始表单数据
|
||||
const initialFormData = {
|
||||
@@ -123,7 +126,7 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'edit') {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增部门' : '编辑部门'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="上级部门" prop="parent_id">
|
||||
<el-form-item :label="$t('page.form.labelParentDept')" prop="parent_id">
|
||||
<el-tree-select
|
||||
v-model="formData.parent_id"
|
||||
:data="optionData.treeData"
|
||||
@@ -17,33 +17,33 @@
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入部门名称" />
|
||||
<el-form-item :label="$t('page.form.labelDeptName')" prop="name">
|
||||
<el-input v-model="formData.name" :placeholder="$t('page.form.placeholderDeptName')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门编码" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入部门编码" />
|
||||
<el-form-item :label="$t('page.form.labelDeptCode')" prop="code">
|
||||
<el-input v-model="formData.code" :placeholder="$t('page.form.placeholderDeptCode')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门领导">
|
||||
<el-form-item :label="$t('page.form.labelLeader')">
|
||||
<sa-user v-model="formData.leader_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入部门描述"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" placeholder="请输入排序" />
|
||||
<el-form-item :label="$t('page.form.labelSort')" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :placeholder="$t('page.form.placeholderSort')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="启用" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -52,6 +52,7 @@
|
||||
import api from '@/api/system/dept'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -71,6 +72,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const optionData = reactive({
|
||||
@@ -88,11 +90,13 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
parent_id: [{ required: true, message: '请选择上级部门', trigger: 'change' }],
|
||||
name: [{ required: true, message: '请输入部门名称', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入部门编码', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
parent_id: [
|
||||
{ required: true, message: t('page.form.ruleParentDeptRequired'), trigger: 'change' }
|
||||
],
|
||||
name: [{ required: true, message: t('page.form.ruleDeptNameRequired'), trigger: 'blur' }],
|
||||
code: [{ required: true, message: t('page.form.ruleDeptCodeRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -138,7 +142,7 @@
|
||||
{
|
||||
id: 0,
|
||||
value: 0,
|
||||
label: '无上级部门',
|
||||
label: t('page.form.noParentDept'),
|
||||
children: data
|
||||
}
|
||||
]
|
||||
@@ -180,10 +184,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增菜单' : '编辑菜单'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="820px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="菜单类型" prop="type">
|
||||
<el-form-item :label="$t('page.form.labelMenuType')" prop="type">
|
||||
<sa-radio v-model="formData.type" type="button" dict="menu_type"></sa-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级菜单" prop="parent_id">
|
||||
<el-form-item :label="$t('page.form.labelParentMenu')" prop="parent_id">
|
||||
<el-tree-select
|
||||
v-model="formData.parent_id"
|
||||
:data="optionData.treeData"
|
||||
@@ -22,63 +22,63 @@
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入菜单名称" />
|
||||
<el-form-item :label="$t('page.form.labelMenuName')" prop="name">
|
||||
<el-input v-model="formData.name" :placeholder="$t('page.form.labelMenuName')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.type < 3">
|
||||
<el-form-item prop="path">
|
||||
<template #label>
|
||||
<sa-label
|
||||
label="路由地址"
|
||||
tooltip="一级菜单:以 / 开头的绝对路径(如 /dashboard) 二级及以下:相对路径(如 console、user)"
|
||||
:label="$t('page.form.labelRoutePath')"
|
||||
:tooltip="$t('page.form.labelRoutePathTip')"
|
||||
/>
|
||||
</template>
|
||||
<el-input v-model="formData.path" placeholder="如:/dashboard 或 console" />
|
||||
<el-input v-model="formData.path" :placeholder="$t('page.form.placeholderRoutePath')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.type != 3">
|
||||
<el-form-item label="组件名称" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="如: User" />
|
||||
<el-form-item :label="$t('page.form.labelComponentName')" prop="code">
|
||||
<el-input v-model="formData.code" :placeholder="$t('page.form.placeholderComponentName')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.type === 2">
|
||||
<el-form-item prop="component">
|
||||
<template #label>
|
||||
<sa-label label="组件路径" tooltip="填写组件路径(views目录下) 目录菜单:留空" />
|
||||
<sa-label :label="$t('page.form.labelComponentPath')" :tooltip="$t('page.form.labelComponentPathTip')" />
|
||||
</template>
|
||||
<el-autocomplete
|
||||
class="w-full"
|
||||
v-model="formData.component"
|
||||
:fetch-suggestions="querySearch"
|
||||
clearable
|
||||
placeholder="如:/system/user 或留空"
|
||||
:placeholder="$t('page.form.placeholderComponentPath')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.type != 3">
|
||||
<el-form-item label="菜单图标" prop="icon">
|
||||
<el-form-item :label="$t('page.form.labelMenuIcon')" prop="icon">
|
||||
<sa-icon-picker v-model="formData.icon" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.type === 3">
|
||||
<el-form-item label="权限标识" prop="slug">
|
||||
<el-input v-model="formData.slug" placeholder="请输入权限标识" />
|
||||
<el-form-item :label="$t('page.form.labelPermSlug')" prop="slug">
|
||||
<el-input v-model="formData.slug" :placeholder="$t('page.form.placeholderPermSlug')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="formData.type === 4">
|
||||
<el-form-item label="外链地址" prop="link_url">
|
||||
<el-input v-model="formData.link_url" placeholder="如:https://saithink.top" />
|
||||
<el-form-item :label="$t('page.form.labelLinkUrl')" prop="link_url">
|
||||
<el-input v-model="formData.link_url" :placeholder="$t('page.form.placeholderLinkUrl')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="sort">
|
||||
<template #label>
|
||||
<sa-label label="排序" tooltip="数字越大越靠前" />
|
||||
<sa-label :label="$t('page.form.labelSort')" :tooltip="$t('page.form.labelSortTip')" />
|
||||
</template>
|
||||
<el-input-number
|
||||
v-model="formData.sort"
|
||||
placeholder="请输入排序"
|
||||
:placeholder="$t('page.form.placeholderSort')"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -86,7 +86,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="status">
|
||||
<template #label>
|
||||
<sa-label label="状态" tooltip="禁用后,该菜单项将不可用" />
|
||||
<sa-label :label="$t('page.form.labelStatus')" :tooltip="$t('page.form.labelStatusTip')" />
|
||||
</template>
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
@@ -94,7 +94,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="is_iframe">
|
||||
<template #label>
|
||||
<sa-label label="是否内嵌" tooltip="外链模式下有效" />
|
||||
<sa-label :label="$t('page.form.labelIsIframe')" :tooltip="$t('page.form.labelIsIframeTip')" />
|
||||
</template>
|
||||
<sa-switch v-model="formData.is_iframe" dict="yes_or_no" :showText="false" />
|
||||
</el-form-item>
|
||||
@@ -102,7 +102,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="is_keep_alive">
|
||||
<template #label>
|
||||
<sa-label label="是否缓存" tooltip="切换tabs不刷新" />
|
||||
<sa-label :label="$t('page.form.labelIsKeepAlive')" :tooltip="$t('page.form.labelIsKeepAliveTip')" />
|
||||
</template>
|
||||
<sa-switch v-model="formData.is_keep_alive" dict="yes_or_no" :showText="false" />
|
||||
</el-form-item>
|
||||
@@ -110,7 +110,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="is_hidden">
|
||||
<template #label>
|
||||
<sa-label label="是否隐藏" tooltip="不在菜单栏显示,但是可以通过路由访问" />
|
||||
<sa-label :label="$t('page.form.labelIsHidden')" :tooltip="$t('page.form.labelIsHiddenTip')" />
|
||||
</template>
|
||||
<sa-switch v-model="formData.is_hidden" dict="yes_or_no" :showText="false" />
|
||||
</el-form-item>
|
||||
@@ -118,7 +118,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="is_fixed_tab">
|
||||
<template #label>
|
||||
<sa-label label="是否固定" tooltip="固定在tabs导航栏" />
|
||||
<sa-label :label="$t('page.form.labelIsFixedTab')" :tooltip="$t('page.form.labelIsFixedTabTip')" />
|
||||
</template>
|
||||
<sa-switch v-model="formData.is_fixed_tab" dict="yes_or_no" :showText="false" />
|
||||
</el-form-item>
|
||||
@@ -126,7 +126,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="is_full_page">
|
||||
<template #label>
|
||||
<sa-label label="是否全屏" tooltip="不继承左侧菜单和顶部导航栏" />
|
||||
<sa-label :label="$t('page.form.labelIsFullPage')" :tooltip="$t('page.form.labelIsFullPageTip')" />
|
||||
</template>
|
||||
<sa-switch v-model="formData.is_full_page" dict="yes_or_no" :showText="false" />
|
||||
</el-form-item>
|
||||
@@ -134,8 +134,8 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -144,6 +144,7 @@
|
||||
import api from '@/api/system/menu'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -163,6 +164,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const optionData = reactive({
|
||||
@@ -197,14 +199,14 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
parent_id: [{ required: true, message: '请选择上级菜单', trigger: 'change' }],
|
||||
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
|
||||
path: [{ required: true, message: '请输入路由地址', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入组件名称', trigger: 'blur' }],
|
||||
slug: [{ required: true, message: '请输入权限标识', trigger: 'blur' }],
|
||||
link_url: [{ required: true, message: '请输入外链地址', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
parent_id: [{ required: true, message: t('page.form.ruleParentMenuRequired'), trigger: 'change' }],
|
||||
name: [{ required: true, message: t('page.form.ruleMenuNameRequired'), trigger: 'blur' }],
|
||||
path: [{ required: true, message: t('page.form.ruleRoutePathRequired'), trigger: 'blur' }],
|
||||
code: [{ required: true, message: t('page.form.ruleComponentNameRequired'), trigger: 'blur' }],
|
||||
slug: [{ required: true, message: t('page.form.rulePermSlugRequired'), trigger: 'blur' }],
|
||||
link_url: [{ required: true, message: t('page.form.ruleLinkUrlRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -302,10 +304,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增岗位' : '编辑岗位'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="岗位名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入岗位名称" />
|
||||
<el-form-item :label="$t('page.form.labelName')" prop="name">
|
||||
<el-input v-model="formData.name" :placeholder="$t('page.form.placeholderName')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位编码" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入岗位编码" />
|
||||
<el-form-item :label="$t('page.form.labelCode')" prop="code">
|
||||
<el-input v-model="formData.code" :placeholder="$t('page.form.placeholderCode')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入岗位描述"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" placeholder="请输入排序" />
|
||||
<el-form-item :label="$t('page.form.labelSort')" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :placeholder="$t('page.form.placeholderSort')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="启用" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -40,6 +40,7 @@
|
||||
import api from '@/api/system/post'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -59,6 +60,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -73,10 +75,10 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
name: [{ required: true, message: '请输入岗位名称', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入岗位编码', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
name: [{ required: true, message: t('page.form.ruleNameRequired'), trigger: 'blur' }],
|
||||
code: [{ required: true, message: t('page.form.ruleCodeRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -150,10 +152,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,42 +1,40 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增角色' : '编辑角色'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="600px"
|
||||
align-center
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
||||
<el-form-item :label="$t('page.form.labelName')" prop="name">
|
||||
<el-input v-model="formData.name" :placeholder="$t('page.form.placeholderName')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色标识" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入角色编码" />
|
||||
<el-form-item :label="$t('page.form.labelCode')" prop="code">
|
||||
<el-input v-model="formData.code" :placeholder="$t('page.form.placeholderCode')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色级别" prop="level">
|
||||
<el-input-number v-model="formData.level" placeholder="角色级别" :max="99" :min="1" />
|
||||
<el-form-item :label="$t('page.form.labelLevel')" prop="level">
|
||||
<el-input-number v-model="formData.level" :placeholder="$t('page.form.labelLevel')" :max="99" :min="1" />
|
||||
</el-form-item>
|
||||
<div class="text-xs text-gray-400 pl-32 pb-4"
|
||||
>控制角色的权限层级, 不能操作职级高于自己的角色</div
|
||||
>
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<div class="text-xs text-gray-400 pl-32 pb-4">{{ $t('page.form.levelTip') }}</div>
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入角色描述"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" placeholder="请输入排序" />
|
||||
<el-form-item :label="$t('page.form.labelSort')" prop="sort">
|
||||
<el-input-number v-model="formData.sort" :placeholder="$t('page.form.placeholderSort')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="启用" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -45,6 +43,7 @@
|
||||
import api from '@/api/system/role'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -64,6 +63,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -78,11 +78,11 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
name: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入角色编码', trigger: 'blur' }],
|
||||
level: [{ required: true, message: '请输入角色级别', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
name: [{ required: true, message: t('page.form.ruleNameRequired'), trigger: 'blur' }],
|
||||
code: [{ required: true, message: t('page.form.ruleCodeRequired'), trigger: 'blur' }],
|
||||
level: [{ required: true, message: t('page.form.ruleLevelRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -157,10 +157,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增用户' : '编辑用户'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="800px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px">
|
||||
<el-form-item label="头像" prop="avatar">
|
||||
<el-form-item :label="$t('page.form.labelAvatar')" prop="avatar">
|
||||
<sa-image-picker v-model="formData.avatar" round />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-form-item :label="$t('page.form.labelUsername')" prop="username">
|
||||
<el-input v-model="formData.username" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="真实姓名" prop="realname">
|
||||
<el-form-item :label="$t('page.form.labelRealname')" prop="realname">
|
||||
<el-input v-model="formData.realname" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="dialogType === 'add'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-form-item :label="$t('page.form.labelPassword')" prop="password">
|
||||
<el-input type="password" v-model="formData.password" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="确认密码" prop="password_confirm">
|
||||
<el-form-item :label="$t('page.form.labelPasswordConfirm')" prop="password_confirm">
|
||||
<el-input type="password" v-model="formData.password_confirm" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -38,20 +38,20 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="formData.email" placeholder="请输入邮箱" />
|
||||
<el-form-item :label="$t('page.form.labelEmail')" prop="email">
|
||||
<el-input v-model="formData.email" :placeholder="$t('page.form.placeholderEmail')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入手机号" />
|
||||
<el-form-item :label="$t('page.form.labelPhone')" prop="phone">
|
||||
<el-input v-model="formData.phone" :placeholder="$t('page.form.placeholderPhone')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门" prop="dept_id">
|
||||
<el-form-item :label="$t('page.form.labelDept')" prop="dept_id">
|
||||
<el-tree-select
|
||||
v-model="formData.dept_id"
|
||||
:data="optionData.deptData"
|
||||
@@ -62,7 +62,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色" prop="role_ids">
|
||||
<el-form-item :label="$t('page.form.labelRole')" prop="role_ids">
|
||||
<el-select v-model="formData.role_ids" multiple clearable>
|
||||
<el-option
|
||||
v-for="role in optionData.roleList"
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" prop="post_ids">
|
||||
<el-form-item :label="$t('page.form.labelPost')" prop="post_ids">
|
||||
<el-select v-model="formData.post_ids" multiple clearable>
|
||||
<el-option
|
||||
v-for="post in optionData.postList"
|
||||
@@ -89,14 +89,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-form-item :label="$t('page.form.labelGender')" prop="gender">
|
||||
<sa-radio v-model="formData.gender" dict="gender" valueType="string" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -117,8 +117,8 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -130,6 +130,8 @@
|
||||
import deptApi from '@/api/system/dept'
|
||||
import roleApi from '@/api/system/role'
|
||||
import postApi from '@/api/system/post'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -149,6 +151,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const optionData = reactive({
|
||||
@@ -167,30 +170,30 @@
|
||||
|
||||
const validatePasswordConfirm = (rule: any, value: any, callback: any) => {
|
||||
if (value !== formData.password) {
|
||||
callback(new Error('两次输入的密码不一致'))
|
||||
callback(new Error(t('page.form.rulePasswordNotMatch')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
// 表单验证规则
|
||||
const rules: FormRules = {
|
||||
const rules = computed<FormRules>(() => ({
|
||||
username: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||
{ required: true, message: t('page.form.ruleUsernameRequired'), trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: t('page.form.ruleUsernameLength'), trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
|
||||
{ required: true, message: t('page.form.rulePasswordRequired'), trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: t('page.form.rulePasswordLength'), trigger: 'blur' }
|
||||
],
|
||||
password_confirm: [
|
||||
{ required: true, message: '请输入确认密码', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
|
||||
{ required: true, message: t('page.form.rulePasswordConfirmRequired'), trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: t('page.form.rulePasswordLength'), trigger: 'blur' },
|
||||
{ validator: validatePasswordConfirm, trigger: 'blur' }
|
||||
],
|
||||
dept_id: [{ required: true, message: '请选择部门', trigger: 'change' }],
|
||||
role_ids: [{ required: true, message: '请选择角色', trigger: 'blur' }]
|
||||
}
|
||||
dept_id: [{ required: true, message: t('page.form.ruleDeptRequired'), trigger: 'change' }],
|
||||
role_ids: [{ required: true, message: t('page.form.ruleRoleRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
// 初始表单数据
|
||||
const initialFormData = {
|
||||
@@ -287,10 +290,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="dialogType === 'add' ? '新增定时任务' : '编辑定时任务'"
|
||||
:title="dialogType === 'add' ? $t('page.form.titleAdd') : $t('page.form.titleEdit')"
|
||||
width="800px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
|
||||
<el-form-item label="任务名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入任务名称" />
|
||||
<el-form-item :label="$t('page.form.labelName')" prop="name">
|
||||
<el-input v-model="formData.name" :placeholder="$t('page.form.placeholderName')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="type">
|
||||
<el-form-item :label="$t('page.form.labelType')" prop="type">
|
||||
<sa-select v-model="formData.type" dict="crontab_task_type" />
|
||||
</el-form-item>
|
||||
<el-form-item label="定时规则" prop="task_style">
|
||||
<el-form-item :label="$t('page.form.labelTaskStyle')" prop="task_style">
|
||||
<el-space>
|
||||
<el-select v-model="formData.task_style" :style="{ width: '100px' }">
|
||||
<el-option :value="1" label="每天" />
|
||||
<el-option :value="2" label="每小时" />
|
||||
<el-option :value="3" label="N小时" />
|
||||
<el-option :value="4" label="N分钟" />
|
||||
<el-option :value="5" label="N秒" />
|
||||
<el-option :value="6" label="每周" />
|
||||
<el-option :value="7" label="每月" />
|
||||
<el-option :value="8" label="每年" />
|
||||
<el-option :value="1" :label="$t('page.form.taskStyleEveryDay')" />
|
||||
<el-option :value="2" :label="$t('page.form.taskStyleEveryHour')" />
|
||||
<el-option :value="3" :label="$t('page.form.taskStyleNHours')" />
|
||||
<el-option :value="4" :label="$t('page.form.taskStyleNMinutes')" />
|
||||
<el-option :value="5" :label="$t('page.form.taskStyleNSeconds')" />
|
||||
<el-option :value="6" :label="$t('page.form.taskStyleEveryWeek')" />
|
||||
<el-option :value="7" :label="$t('page.form.taskStyleEveryMonth')" />
|
||||
<el-option :value="8" :label="$t('page.form.taskStyleEveryYear')" />
|
||||
</el-select>
|
||||
<template v-if="formData.task_style == 8">
|
||||
<el-input-number
|
||||
@@ -35,7 +35,7 @@
|
||||
controls-position="right"
|
||||
:style="{ width: '100px' }"
|
||||
/>
|
||||
<span>月</span>
|
||||
<span>{{ $t('page.form.unitMonth') }}</span>
|
||||
</template>
|
||||
<template v-if="formData.task_style > 6">
|
||||
<el-input-number
|
||||
@@ -46,20 +46,20 @@
|
||||
controls-position="right"
|
||||
:style="{ width: '100px' }"
|
||||
/>
|
||||
<span>日</span>
|
||||
<span>{{ $t('page.form.unitDay') }}</span>
|
||||
</template>
|
||||
<el-select
|
||||
v-if="formData.task_style == 6"
|
||||
v-model="formData.week"
|
||||
:style="{ width: '100px' }"
|
||||
>
|
||||
<el-option :value="1" label="周一" />
|
||||
<el-option :value="2" label="周二" />
|
||||
<el-option :value="3" label="周三" />
|
||||
<el-option :value="4" label="周四" />
|
||||
<el-option :value="5" label="周五" />
|
||||
<el-option :value="6" label="周六" />
|
||||
<el-option :value="0" label="周日" />
|
||||
<el-option :value="1" :label="$t('page.form.weekMon')" />
|
||||
<el-option :value="2" :label="$t('page.form.weekTue')" />
|
||||
<el-option :value="3" :label="$t('page.form.weekWed')" />
|
||||
<el-option :value="4" :label="$t('page.form.weekThu')" />
|
||||
<el-option :value="5" :label="$t('page.form.weekFri')" />
|
||||
<el-option :value="6" :label="$t('page.form.weekSat')" />
|
||||
<el-option :value="0" :label="$t('page.form.weekSun')" />
|
||||
</el-select>
|
||||
<template v-if="[1, 3, 6, 7, 8].includes(formData.task_style)">
|
||||
<el-input-number
|
||||
@@ -70,7 +70,7 @@
|
||||
controls-position="right"
|
||||
:style="{ width: '100px' }"
|
||||
/>
|
||||
<span>时</span>
|
||||
<span>{{ $t('page.form.unitHour') }}</span>
|
||||
</template>
|
||||
<template v-if="formData.task_style != 5">
|
||||
<el-input-number
|
||||
@@ -81,7 +81,7 @@
|
||||
controls-position="right"
|
||||
:style="{ width: '100px' }"
|
||||
/>
|
||||
<span>分</span>
|
||||
<span>{{ $t('page.form.unitMinute') }}</span>
|
||||
</template>
|
||||
<template v-if="formData.task_style == 5">
|
||||
<el-input-number
|
||||
@@ -92,36 +92,41 @@
|
||||
controls-position="right"
|
||||
:style="{ width: '100px' }"
|
||||
/>
|
||||
<span>秒</span>
|
||||
<span>{{ $t('page.form.unitSecond') }}</span>
|
||||
</template>
|
||||
</el-space>
|
||||
</el-form-item>
|
||||
<el-form-item label="调用目标" prop="target">
|
||||
<el-form-item :label="$t('page.form.labelTarget')" prop="target">
|
||||
<el-input
|
||||
v-model="formData.target"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入调用目标"
|
||||
:placeholder="$t('page.form.placeholderTarget')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务参数" prop="params">
|
||||
<el-form-item :label="$t('page.form.labelParams')" prop="params">
|
||||
<el-input
|
||||
v-model="formData.parameter"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入任务参数"
|
||||
:placeholder="$t('page.form.placeholderParams')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-form-item :label="$t('page.form.labelStatus')" prop="status">
|
||||
<sa-radio v-model="formData.status" dict="data_status" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||
<el-form-item :label="$t('page.form.labelRemark')" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
:placeholder="$t('page.form.placeholderRemark')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">{{ $t('table.form.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -130,6 +135,7 @@
|
||||
import api from '@/api/tool/crontab'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean
|
||||
@@ -149,6 +155,7 @@
|
||||
})
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -163,12 +170,12 @@
|
||||
/**
|
||||
* 表单验证规则
|
||||
*/
|
||||
const rules = reactive<FormRules>({
|
||||
name: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '任务类型不能为空', trigger: 'blur' }],
|
||||
task_style: [{ required: true, message: '定时规则不能为空', trigger: 'blur' }],
|
||||
target: [{ required: true, message: '调用目标不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const rules = computed<FormRules>(() => ({
|
||||
name: [{ required: true, message: t('page.form.ruleNameRequired'), trigger: 'blur' }],
|
||||
type: [{ required: true, message: t('page.form.ruleTypeRequired'), trigger: 'blur' }],
|
||||
task_style: [{ required: true, message: t('page.form.ruleTaskStyleRequired'), trigger: 'blur' }],
|
||||
target: [{ required: true, message: t('page.form.ruleTargetRequired'), trigger: 'blur' }]
|
||||
}))
|
||||
|
||||
/**
|
||||
* 初始数据
|
||||
@@ -264,10 +271,10 @@
|
||||
await formRef.value.validate()
|
||||
if (props.dialogType === 'add') {
|
||||
await api.save(formData)
|
||||
ElMessage.success('新增成功')
|
||||
ElMessage.success(t('page.form.addSuccess'))
|
||||
} else {
|
||||
await api.update(formData)
|
||||
ElMessage.success('修改成功')
|
||||
ElMessage.success(t('page.form.editSuccess'))
|
||||
}
|
||||
emit('success')
|
||||
handleClose()
|
||||
|
||||
@@ -43,11 +43,13 @@ class GameController extends BaseController
|
||||
}
|
||||
|
||||
$adminId = null;
|
||||
$adminIdsInTopDept = null;
|
||||
$agentId = trim((string) ($request->agent_id ?? ''));
|
||||
if ($agentId !== '') {
|
||||
$systemUser = SystemUser::where('agent_id', $agentId)->find();
|
||||
if ($systemUser) {
|
||||
$adminId = (int) $systemUser->id;
|
||||
$adminIdsInTopDept = UserLogic::getAdminIdsByAgentIdTopDept($agentId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ class GameController extends BaseController
|
||||
|
||||
try {
|
||||
$logic = new UserLogic();
|
||||
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId);
|
||||
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId, $adminIdsInTopDept);
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
|
||||
@@ -77,18 +77,14 @@ class PlayStartLogic
|
||||
throw new ApiException('Lottery pool config not found (name=default required)');
|
||||
}
|
||||
|
||||
// 玩家累计盈利:仅统计 lottery_config_id=type=0 的成功对局(中奖金额-100*局数)
|
||||
$playerQuery = DicePlayRecord::where('player_id', $playerId)
|
||||
->where('lottery_config_id', $configType0->id)
|
||||
->where('status', self::RECORD_STATUS_SUCCESS);
|
||||
$playerWinSum = (float) $playerQuery->sum('win_coin');
|
||||
$playerPlayCount = (int) $playerQuery->count();
|
||||
$playerProfitTotal = $playerWinSum - 100.0 * $playerPlayCount;
|
||||
// 彩金池累计盈利:用于判断是否触发杀分(不再依赖单个玩家累计盈利)
|
||||
// 该值来自 dice_lottery_pool_config.profit_amount
|
||||
$poolProfitTotal = $configType0->profit_amount ?? 0;
|
||||
$safetyLine = (int) ($configType0->safety_line ?? 0);
|
||||
$killEnabled = ((int) ($configType0->kill_enabled ?? 1)) === 1;
|
||||
// 盈利>=安全线且开启杀分:付费/免费都用 killScore;盈利<安全线:付费用玩家权重,免费用 killScore(无则用 default)
|
||||
// 记录 lottery_config_id:用池权重时记对应池,付费用玩家权重时记 default
|
||||
$usePoolWeights = ($ticketType === self::LOTTERY_TYPE_PAID && $killEnabled && $playerProfitTotal >= $safetyLine && $configType1 !== null)
|
||||
$usePoolWeights = ($ticketType === self::LOTTERY_TYPE_PAID && $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null)
|
||||
|| ($ticketType === self::LOTTERY_TYPE_FREE);
|
||||
$config = $usePoolWeights
|
||||
? (($ticketType === self::LOTTERY_TYPE_FREE && $configType1 === null) ? $configType0 : $configType1)
|
||||
@@ -109,6 +105,13 @@ class PlayStartLogic
|
||||
Log::warning("档位 {$tier} 方向 {$direction} 无任何 DiceReward,重新摇取档位");
|
||||
continue;
|
||||
}
|
||||
if ($usePoolWeights) {
|
||||
$tierRewards = self::filterOutSuperWinOnlyGrids($tierRewards);
|
||||
if (empty($tierRewards)) {
|
||||
Log::warning("档位 {$tier} 方向 {$direction} 杀分档位下排除 5/30 后无可用奖励,重新摇取档位");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try {
|
||||
$chosen = self::drawRewardByWeight($tierRewards);
|
||||
} catch (\RuntimeException $e) {
|
||||
@@ -133,36 +136,44 @@ class PlayStartLogic
|
||||
$rewardWinCoin = $isTierT5 ? $realEv : (100 + $realEv);
|
||||
|
||||
// 豹子判定:5/30 必豹子;10/15/20/25 按 DiceRewardConfig 中 BIGWIN 该点数的 weight 判定(0-10000,10000=100%)
|
||||
// 杀分档位:不触发豹子,5/30 已在上方抽取时排除,10/15/20/25 仅生成非豹子组合
|
||||
$superWinCoin = 0;
|
||||
$isWin = 0;
|
||||
$bigWinRealEv = 0.0;
|
||||
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
||||
$bigWinConfig = DiceRewardConfig::getCachedByTierAndGridNumber('BIGWIN', $rollNumber);
|
||||
$alwaysSuperWin = in_array($rollNumber, self::SUPER_WIN_ALWAYS_GRID_NUMBERS, true);
|
||||
$doSuperWin = $alwaysSuperWin;
|
||||
if (!$doSuperWin) {
|
||||
$bigWinWeight = 10000;
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['weight'])) {
|
||||
$bigWinWeight = min(10000, max(0, (int) $bigWinConfig['weight']));
|
||||
$bigWinRealEv = (float) ($bigWinConfig['real_ev'] ?? 0);
|
||||
}
|
||||
$roll = (random_int(0, PHP_INT_MAX - 1) / (float) PHP_INT_MAX);
|
||||
$doSuperWin = $bigWinWeight > 0 && $roll < ($bigWinWeight / 10000.0);
|
||||
} else {
|
||||
if ($bigWinConfig !== null) {
|
||||
$bigWinRealEv = (float) ($bigWinConfig['real_ev'] ?? 0);
|
||||
}
|
||||
}
|
||||
if ($doSuperWin) {
|
||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||
$isWin = 1;
|
||||
$superWinCoin = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
|
||||
$rewardWinCoin = 0;
|
||||
$realEv = 0;
|
||||
$isTierT5 = false;
|
||||
} else {
|
||||
if ($usePoolWeights) {
|
||||
// 杀分档位:绝不触发豹子,仅生成非豹子组合,不发放豹子奖金
|
||||
$isWin = 0;
|
||||
$superWinCoin = 0.0;
|
||||
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
||||
} else {
|
||||
$bigWinConfig = DiceRewardConfig::getCachedByTierAndGridNumber('BIGWIN', $rollNumber);
|
||||
$alwaysSuperWin = in_array($rollNumber, self::SUPER_WIN_ALWAYS_GRID_NUMBERS, true);
|
||||
$doSuperWin = $alwaysSuperWin;
|
||||
if (!$doSuperWin) {
|
||||
$bigWinWeight = 10000;
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['weight'])) {
|
||||
$bigWinWeight = min(10000, max(0, (int) $bigWinConfig['weight']));
|
||||
$bigWinRealEv = (float) ($bigWinConfig['real_ev'] ?? 0);
|
||||
}
|
||||
$roll = (random_int(0, PHP_INT_MAX - 1) / (float) PHP_INT_MAX);
|
||||
$doSuperWin = $bigWinWeight > 0 && $roll < ($bigWinWeight / 10000.0);
|
||||
} else {
|
||||
if ($bigWinConfig !== null) {
|
||||
$bigWinRealEv = (float) ($bigWinConfig['real_ev'] ?? 0);
|
||||
}
|
||||
}
|
||||
if ($doSuperWin) {
|
||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||
$isWin = 1;
|
||||
$superWinCoin = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
|
||||
$rewardWinCoin = 0;
|
||||
$realEv = 0;
|
||||
$isTierT5 = false;
|
||||
} else {
|
||||
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$rollArray = $this->generateRollArrayFromSum($rollNumber);
|
||||
@@ -254,8 +265,10 @@ class PlayStartLogic
|
||||
|
||||
$p->save();
|
||||
|
||||
// 玩家累计盈利累加在 type=0 彩金池上:每局按“当前中奖金额(含 BIGWIN) - 抽奖券费用 100”
|
||||
$perPlayProfit = $winCoin - 100.0;
|
||||
// 彩金池累计盈利累加在 name=default 彩金池上:
|
||||
// 付费券:每局按“当前中奖金额(含 BIGWIN) - 抽奖券费用 100”
|
||||
// 免费券:取消票价成本 100,只计入中奖金额
|
||||
$perPlayProfit = ($ticketType === self::LOTTERY_TYPE_PAID) ? ($winCoin - 100.0) : $winCoin;
|
||||
$addProfit = $perPlayProfit;
|
||||
try {
|
||||
DiceLotteryPoolConfig::where('id', $type0ConfigId)->update([
|
||||
@@ -330,6 +343,21 @@ class PlayStartLogic
|
||||
/** 该组配置权重均为 0 时抛出,供调用方重试 */
|
||||
private const EXCEPTION_WEIGHT_ALL_ZERO = 'REWARD_WEIGHT_ALL_ZERO';
|
||||
|
||||
/** 杀分档位需排除的豹子号:5 和 30 只能组成豹子,无法生成非豹子组合 */
|
||||
private const KILL_MODE_EXCLUDE_GRIDS = [5, 30];
|
||||
|
||||
/**
|
||||
* 杀分档位下排除 grid_number=5/30 的奖励(5/30 只能豹子,无法剔除)
|
||||
* @return array 排除后的奖励列表,保持索引连续
|
||||
*/
|
||||
private static function filterOutSuperWinOnlyGrids(array $rewards): array
|
||||
{
|
||||
return array_values(array_filter($rewards, function ($r) {
|
||||
$g = (int) ($r['grid_number'] ?? 0);
|
||||
return !in_array($g, self::KILL_MODE_EXCLUDE_GRIDS, true);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按权重抽取一条配置:仅 weight>0 参与抽取(weight=0 不会被摇到)
|
||||
* 使用 [0, total) 浮点随机,支持最小权重 0.1%(如 weight=0.1),避免整数随机导致小权重失真
|
||||
@@ -463,6 +491,14 @@ class PlayStartLogic
|
||||
if (empty($tierRewards)) {
|
||||
continue;
|
||||
}
|
||||
// 免费券或 killScore 池:与实际流程一致,排除 5/30 且不触发豹子
|
||||
$useKillMode = ($lotteryType === 1) || ($config !== null && (string) ($config->name ?? '') === 'killScore');
|
||||
if ($useKillMode) {
|
||||
$tierRewards = self::filterOutSuperWinOnlyGrids($tierRewards);
|
||||
if (empty($tierRewards)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try {
|
||||
$chosen = self::drawRewardByWeight($tierRewards);
|
||||
} catch (\RuntimeException $e) {
|
||||
@@ -488,27 +524,34 @@ class PlayStartLogic
|
||||
$isWin = 0;
|
||||
$bigWinRealEv = 0.0;
|
||||
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
||||
$bigWinConfig = DiceRewardConfig::getCachedByTierAndGridNumber('BIGWIN', $rollNumber);
|
||||
$alwaysSuperWin = in_array($rollNumber, self::SUPER_WIN_ALWAYS_GRID_NUMBERS, true);
|
||||
$doSuperWin = $alwaysSuperWin;
|
||||
if (!$doSuperWin) {
|
||||
$bigWinWeight = 10000;
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['weight'])) {
|
||||
$bigWinWeight = min(10000, max(0, (int) $bigWinConfig['weight']));
|
||||
}
|
||||
$roll = (random_int(0, PHP_INT_MAX - 1) / (float) PHP_INT_MAX);
|
||||
$doSuperWin = $bigWinWeight > 0 && $roll < ($bigWinWeight / 10000.0);
|
||||
}
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['real_ev'])) {
|
||||
$bigWinRealEv = (float) $bigWinConfig['real_ev'];
|
||||
}
|
||||
if ($doSuperWin) {
|
||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||
$isWin = 1;
|
||||
$superWinCoin = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||
$rewardWinCoin = 0;
|
||||
} else {
|
||||
if ($useKillMode) {
|
||||
// 杀分档位:绝不触发豹子,仅生成非豹子组合,不发放豹子奖金
|
||||
$isWin = 0;
|
||||
$superWinCoin = 0.0;
|
||||
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
||||
} else {
|
||||
$bigWinConfig = DiceRewardConfig::getCachedByTierAndGridNumber('BIGWIN', $rollNumber);
|
||||
$alwaysSuperWin = in_array($rollNumber, self::SUPER_WIN_ALWAYS_GRID_NUMBERS, true);
|
||||
$doSuperWin = $alwaysSuperWin;
|
||||
if (!$doSuperWin) {
|
||||
$bigWinWeight = 10000;
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['weight'])) {
|
||||
$bigWinWeight = min(10000, max(0, (int) $bigWinConfig['weight']));
|
||||
}
|
||||
$roll = (random_int(0, PHP_INT_MAX - 1) / (float) PHP_INT_MAX);
|
||||
$doSuperWin = $bigWinWeight > 0 && $roll < ($bigWinWeight / 10000.0);
|
||||
}
|
||||
if ($bigWinConfig !== null && isset($bigWinConfig['real_ev'])) {
|
||||
$bigWinRealEv = (float) $bigWinConfig['real_ev'];
|
||||
}
|
||||
if ($doSuperWin) {
|
||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||
$isWin = 1;
|
||||
$superWinCoin = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||
$rewardWinCoin = 0;
|
||||
} else {
|
||||
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$rollArray = $this->generateRollArrayFromSum($rollNumber);
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace app\api\logic;
|
||||
|
||||
use app\dice\model\player\DicePlayer;
|
||||
use app\api\cache\UserCache;
|
||||
use plugin\saiadmin\app\model\system\SystemDept;
|
||||
use plugin\saiadmin\app\model\system\SystemUser;
|
||||
use plugin\saiadmin\exception\ApiException;
|
||||
use Tinywan\Jwt\JwtToken;
|
||||
|
||||
@@ -41,21 +43,98 @@ class UserLogic
|
||||
return md5(self::PASSWORD_SALT . $password);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 parent_id 向上遍历找到顶级部门(parent_id=0)
|
||||
*/
|
||||
private static function getTopDeptIdByParentId(int $deptId): ?int
|
||||
{
|
||||
$currentId = $deptId;
|
||||
$visited = [];
|
||||
while ($currentId > 0 && !isset($visited[$currentId])) {
|
||||
$visited[$currentId] = true;
|
||||
$dept = SystemDept::find($currentId);
|
||||
if (!$dept) {
|
||||
return null;
|
||||
}
|
||||
$parentId = (int) ($dept->parent_id ?? 0);
|
||||
if ($parentId === 0) {
|
||||
return $currentId;
|
||||
}
|
||||
$currentId = $parentId;
|
||||
}
|
||||
return $currentId > 0 ? $currentId : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据顶级部门 id,递归获取其下所有部门 id(含自身),仅用 id 和 parent_id
|
||||
*/
|
||||
private static function getAllDeptIdsUnderTop(int $topId): array
|
||||
{
|
||||
$deptIds = [$topId];
|
||||
$prevCount = 0;
|
||||
while (count($deptIds) > $prevCount) {
|
||||
$prevCount = count($deptIds);
|
||||
$children = SystemDept::whereIn('parent_id', $deptIds)->column('id');
|
||||
$deptIds = array_unique(array_merge($deptIds, array_map('intval', $children)));
|
||||
}
|
||||
return array_values($deptIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 agent_id 获取当前管理员所在顶级部门下的所有管理员 ID 列表
|
||||
* 使用 SystemDept 的 id 和 parent_id 字段遍历:先向上找顶级部门(parent_id=0),再向下收集所有子部门
|
||||
* 用于 getGameUrl 接口判断 DicePlayer 是否属于该部门,同顶级部门下不重复创建玩家
|
||||
*
|
||||
* @param string $agentId 代理标识(sa_system_user.agent_id)
|
||||
* @return int[] 管理员 ID 列表,空数组表示未找到或无法解析
|
||||
*/
|
||||
public static function getAdminIdsByAgentIdTopDept(string $agentId): array
|
||||
{
|
||||
$agentId = trim($agentId);
|
||||
if ($agentId === '') {
|
||||
return [];
|
||||
}
|
||||
$admin = SystemUser::where('agent_id', $agentId)->find();
|
||||
if (!$admin) {
|
||||
return [];
|
||||
}
|
||||
$deptId = $admin->dept_id ?? null;
|
||||
if ($deptId === null || $deptId === '') {
|
||||
return [(int) $admin->id];
|
||||
}
|
||||
$deptId = (int) $deptId;
|
||||
$topId = self::getTopDeptIdByParentId($deptId);
|
||||
if ($topId === null) {
|
||||
return [(int) $admin->id];
|
||||
}
|
||||
$deptIds = self::getAllDeptIdsUnderTop($topId);
|
||||
if (empty($deptIds)) {
|
||||
$deptIds = [$deptId];
|
||||
}
|
||||
$adminIds = SystemUser::whereIn('dept_id', $deptIds)->column('id');
|
||||
return array_map('intval', $adminIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录(JSON:username, password, lang, coin, time)
|
||||
* 存在则校验密码并更新 coin(累加);不存在则创建用户并写入 coin。
|
||||
* 将会话写入 Redis,返回 token 与前端连接地址。
|
||||
*
|
||||
* @param int|null $adminId 创建新用户时关联的后台管理员ID(sa_system_user.id),可选
|
||||
* @param int[]|null $adminIdsInTopDept 当前管理员顶级部门下的所有管理员ID,用于按部门范围查找玩家;为空时退化为仅按 username 查找
|
||||
*/
|
||||
public function loginByUsername(string $username, string $password, string $lang, float $coin, string $time, ?int $adminId = null): array
|
||||
public function loginByUsername(string $username, string $password, string $lang, float $coin, string $time, ?int $adminId = null, ?array $adminIdsInTopDept = null): array
|
||||
{
|
||||
$username = trim($username);
|
||||
if ($username === '') {
|
||||
throw new ApiException('username is required');
|
||||
}
|
||||
|
||||
$player = DicePlayer::where('username', $username)->find();
|
||||
$query = DicePlayer::where('username', $username);
|
||||
if ($adminIdsInTopDept !== null && !empty($adminIdsInTopDept)) {
|
||||
$query->whereIn('admin_id', $adminIdsInTopDept);
|
||||
}
|
||||
$player = $query->find();
|
||||
if ($player) {
|
||||
if ((int) ($player->status ?? 1) === 0) {
|
||||
throw new ApiException('Account is disabled and cannot log in');
|
||||
|
||||
@@ -60,7 +60,16 @@ class DicePlayRecordController extends BaseController
|
||||
'diceRewardConfig',
|
||||
'diceLotteryPoolConfig',
|
||||
]);
|
||||
|
||||
// 按当前筛选条件统计:平台总盈利 = 付费抽奖(lottery_type=0)次数×100 - 玩家总收益(win_coin 求和)
|
||||
$sumQuery = clone $query;
|
||||
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
||||
$paidCountQuery = clone $query;
|
||||
$paidCount = (int) $paidCountQuery->where('lottery_type', 0)->count();
|
||||
$totalWinCoin = $paidCount * 100 - $playerTotalWin;
|
||||
|
||||
$data = $this->logic->getList($query);
|
||||
$data['total_win_coin'] = $totalWinCoin;
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ class DicePlayRecordLogic extends BaseLogic
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new DicePlayRecord();
|
||||
// 默认按主键倒序:最新数据优先展示
|
||||
$this->setOrderType('DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,8 @@ class DicePlayerTicketRecordLogic extends BaseLogic
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new DicePlayerTicketRecord();
|
||||
// 默认按主键倒序:最新数据优先展示
|
||||
$this->setOrderType('DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,6 +23,8 @@ class DicePlayerWalletRecordLogic extends BaseLogic
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new DicePlayerWalletRecord();
|
||||
// 默认按主键倒序:最新数据优先展示
|
||||
$this->setOrderType('DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,8 @@ class DiceRewardConfigRecordLogic extends BaseLogic
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new DiceRewardConfigRecord();
|
||||
// 默认按主键倒序:最新数据优先展示
|
||||
$this->setOrderType('DESC');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,8 +80,8 @@ class WeightTestRunner
|
||||
DiceRewardConfig::clearRequestInstance();
|
||||
DiceReward::clearRequestInstance();
|
||||
|
||||
//“玩家”盈利: 玩家累计盈利:仅统计 lottery_config_id=default 的成功对局(win_coin - 100),与 PlayStartLogic 一致
|
||||
$playerProfitTotal = 0.0;
|
||||
// 彩金池累计盈利:用于判断是否触发杀分(不再依赖单个玩家累计盈利)
|
||||
$poolProfitTotal = $configType0->profit_amount ?? 0;
|
||||
|
||||
$playLogic = new PlayStartLogic();
|
||||
$resultCounts = [];
|
||||
@@ -91,22 +91,22 @@ class WeightTestRunner
|
||||
|
||||
try {
|
||||
for ($i = 0; $i < $paidS; $i++) {
|
||||
$usePoolWeights = $killEnabled && $playerProfitTotal >= $safetyLine && $configType1 !== null;
|
||||
$usePoolWeights = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
||||
$paidConfig = $usePoolWeights ? $configType1 : $configType0;
|
||||
$customWeights = $usePoolWeights ? null : $paidTierWeights;
|
||||
$row = $playLogic->simulateOnePlay($paidConfig, 0, 0, $customWeights);
|
||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $playerProfitTotal);
|
||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $poolProfitTotal);
|
||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
||||
$done++;
|
||||
$this->flushIfNeeded($buffer, $recordId, $done, $total, $resultCounts, $tierCounts);
|
||||
}
|
||||
for ($i = 0; $i < $paidN; $i++) {
|
||||
$usePoolWeights = $killEnabled && $playerProfitTotal >= $safetyLine && $configType1 !== null;
|
||||
$usePoolWeights = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
||||
$paidConfig = $usePoolWeights ? $configType1 : $configType0;
|
||||
$customWeights = $usePoolWeights ? null : $paidTierWeights;
|
||||
$row = $playLogic->simulateOnePlay($paidConfig, 1, 0, $customWeights);
|
||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $playerProfitTotal);
|
||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $poolProfitTotal);
|
||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
||||
$done++;
|
||||
@@ -114,6 +114,7 @@ class WeightTestRunner
|
||||
}
|
||||
for ($i = 0; $i < $freeS; $i++) {
|
||||
$row = $playLogic->simulateOnePlay($freeConfig, 0, 1, null);
|
||||
$this->accumulateProfitForDefault($row, 1, $freeConfig, $configType0, $poolProfitTotal);
|
||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
||||
$done++;
|
||||
@@ -121,6 +122,7 @@ class WeightTestRunner
|
||||
}
|
||||
for ($i = 0; $i < $freeN; $i++) {
|
||||
$row = $playLogic->simulateOnePlay($freeConfig, 1, 1, null);
|
||||
$this->accumulateProfitForDefault($row, 1, $freeConfig, $configType0, $poolProfitTotal);
|
||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
||||
$done++;
|
||||
@@ -139,18 +141,19 @@ class WeightTestRunner
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅当付费抽奖且使用 default 池时累加玩家盈利(win_coin - 100),与 PlayStartLogic 一致
|
||||
* @param object $usedConfig 本次使用的奖池配置
|
||||
* 累加彩金池累计盈利,用于触发杀分,与 PlayStartLogic 一致
|
||||
* @param int $lotteryType 0=付费券,1=免费券
|
||||
* @param object $usedConfig 本次使用的奖池配置(仅用于校验非空)
|
||||
* @param object $configType0 name=default 的彩金池
|
||||
* @param float $playerProfitTotal 实际为“彩金池累计盈利”滚动值
|
||||
*/
|
||||
private function accumulateProfitForDefault(array $row, int $lotteryType, $usedConfig, $configType0, float &$playerProfitTotal): void
|
||||
{
|
||||
if ($lotteryType !== 0 || $usedConfig === null || $configType0 === null || !isset($row['win_coin'])) {
|
||||
if (($lotteryType !== 0 && $lotteryType !== 1) || $usedConfig === null || $configType0 === null || !isset($row['win_coin'])) {
|
||||
return;
|
||||
}
|
||||
if ((int) $usedConfig->id === (int) $configType0->id) {
|
||||
$playerProfitTotal += (float) $row['win_coin'] - 100.0;
|
||||
}
|
||||
$winCoin = (float) $row['win_coin'];
|
||||
$playerProfitTotal += $lotteryType === 0 ? ($winCoin - 100.0) : $winCoin;
|
||||
}
|
||||
|
||||
private function aggregate(array $row, array &$resultCounts, array &$tierCounts): void
|
||||
|
||||
@@ -18,7 +18,6 @@ class DiceLotteryPoolConfigValidate extends BaseValidate
|
||||
*/
|
||||
protected $rule = [
|
||||
'name' => 'require',
|
||||
'type' => 'require',
|
||||
't1_weight' => 'require',
|
||||
't2_weight' => 'require',
|
||||
't3_weight' => 'require',
|
||||
@@ -31,7 +30,6 @@ class DiceLotteryPoolConfigValidate extends BaseValidate
|
||||
*/
|
||||
protected $message = [
|
||||
'name' => '名称必须填写',
|
||||
'type' => '奖池类型必须填写',
|
||||
't1_weight' => 'T1池权重必须填写',
|
||||
't2_weight' => 'T2池权重必须填写',
|
||||
't3_weight' => 'T3池权重必须填写',
|
||||
@@ -45,7 +43,6 @@ class DiceLotteryPoolConfigValidate extends BaseValidate
|
||||
protected $scene = [
|
||||
'save' => [
|
||||
'name',
|
||||
'type',
|
||||
't1_weight',
|
||||
't2_weight',
|
||||
't3_weight',
|
||||
@@ -54,7 +51,6 @@ class DiceLotteryPoolConfigValidate extends BaseValidate
|
||||
],
|
||||
'update' => [
|
||||
'name',
|
||||
'type',
|
||||
't1_weight',
|
||||
't2_weight',
|
||||
't3_weight',
|
||||
|
||||
Reference in New Issue
Block a user