refactor: 优化代码格式和注释

- 移除不必要的注释标记
- 简化CountTo组件属性格式
- 禁用不可编辑的输入框
This commit is contained in:
2026-01-20 11:57:56 +08:00
parent 2639aef69b
commit 764b5727ba
3 changed files with 5 additions and 10 deletions

View File

@ -50,7 +50,7 @@ const form = reactive({
<div class="mb-2 text-xs text-gray-400 font-medium">
参赛总人数
</div>
<NInputNumber v-if="isEdit" v-model:value="form.total" :show-button="false">
<NInputNumber v-if="isEdit" v-model:value="form.total" :disabled="true" :show-button="false">
<template #suffix>
</template>
@ -66,8 +66,8 @@ const form = reactive({
分组配额
</div>
<div v-if="isEdit" class="flex gap-2">
<NInputNumber v-model:value="form.teamPerGroup" size="small" placeholder="单组" :show-button="false" />
<NInputNumber v-model:value="form.promoteCount" size="small" placeholder="晋级" :show-button="false" />
<NInputNumber v-model:value="form.teamPerGroup" :disabled="true" size="small" placeholder="单组" :show-button="false" />
<NInputNumber v-model:value="form.promoteCount" :disabled="true" size="small" placeholder="晋级" :show-button="false" />
</div>
<div v-else class="flex items-center gap-3 text-sm text-gray-700">
<span>单组: <strong>{{ form.teamPerGroup }}</strong></span>

View File

@ -82,7 +82,6 @@ function getGradientColor(color: CardData['color']) {
<template>
<NCard :bordered="false" size="small" class="card-wrapper">
<!-- define component start: GradientBg -->
<DefineGradientBg v-slot="{ $slots, gradientColor }">
<div
class="px-16px pb-4px pt-8px text-white"
@ -91,8 +90,6 @@ function getGradientColor(color: CardData['color']) {
<component :is="$slots.default" />
</div>
</DefineGradientBg>
<!-- define component end: GradientBg -->
<NGrid cols="s:1 m:2 l:4" responsive="screen" :x-gap="16" :y-gap="16">
<NGi v-for="item in cardData" :key="item.key">
<GradientBg :gradient-color="getGradientColor(item.color)" class="flex-1">
@ -102,9 +99,7 @@ function getGradientColor(color: CardData['color']) {
<div class="flex justify-between pt-12px">
<SvgIcon :icon="item.icon" class="text-32px" />
<CountTo
:prefix="item.unit"
:start-value="1"
:end-value="item.value"
:prefix="item.unit" :start-value="1" :end-value="item.value"
class="text-30px text-white dark:text-dark"
/>
</div>

View File

@ -13,7 +13,7 @@ export function readStarConfig(options = {}, ...userConfigs) {
},
...options,
},
// --- 针对 Soybean 模版遗留问题的补丁 ---
// --- 模版遗留问题的补丁 ---
{
rules: {
// 强制块顺序script -> template -> style