修复打包报错

This commit is contained in:
2026-03-19 15:59:10 +08:00
parent 3dbd68829a
commit f9f8a1e169
4 changed files with 21 additions and 10 deletions

View File

@@ -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($t('page.form.ruleWeightsSumMustBe100'))
ElMessage.warning(t('page.form.ruleWeightsSumMustBe100'))
return
}
const payload = { ...formData }
@@ -428,10 +430,10 @@
}
if (props.dialogType === 'add') {
await api.save(payload)
ElMessage.success($t('page.form.addSuccess'))
ElMessage.success(t('page.form.addSuccess'))
} else {
await api.update(payload)
ElMessage.success($t('page.form.editSuccess'))
ElMessage.success(t('page.form.editSuccess'))
}
emit('success')
handleClose()