fix(lint): 修正 defineProps 位置并格式化用户批量组件

- UserBatchResultSummary.vue: 将 defineProps 移到 <script setup> 首部,
  满足 vue/define-macros-order 规则,修复 CI eslint 失败
- 自动修复 vue/max-attributes-per-line 与
  vue/singleline-html-element-content-newline 格式警告
This commit is contained in:
AAEE86
2026-09-29 10:58:40 +08:00
parent 532af797bf
commit 11989e278e
2 changed files with 26 additions and 11 deletions
@@ -44,10 +44,17 @@
class="space-y-3 rounded-xl border border-border bg-background p-4" class="space-y-3 rounded-xl border border-border bg-background p-4"
> >
<div class="flex flex-wrap items-center justify-between gap-3"> <div class="flex flex-wrap items-center justify-between gap-3">
<Label for="user-batch-wallet-amount" class="text-sm font-medium"> <Label
for="user-batch-wallet-amount"
class="text-sm font-medium"
>
{{ legacyT('调整金额 (USD)') }} {{ legacyT('调整金额 (USD)') }}
</Label> </Label>
<div class="inline-flex rounded-md border border-border p-0.5" role="group" :aria-label="legacyT('余额调整方式')"> <div
class="inline-flex rounded-md border border-border p-0.5"
role="group"
:aria-label="legacyT('余额调整方式')"
>
<Button <Button
type="button" type="button"
size="sm" size="sm"
@@ -80,7 +87,10 @@
:aria-invalid="balanceAmount !== '' && balancePayload === null" :aria-invalid="balanceAmount !== '' && balancePayload === null"
@update:model-value="balanceAmount = String($event)" @update:model-value="balanceAmount = String($event)"
/> />
<p v-if="balanceAmount !== '' && balancePayload === null" class="text-xs text-destructive"> <p
v-if="balanceAmount !== '' && balancePayload === null"
class="text-xs text-destructive"
>
{{ legacyT('请输入大于 0 的有限金额') }} {{ legacyT('请输入大于 0 的有限金额') }}
</p> </p>
<p class="text-xs leading-relaxed text-muted-foreground"> <p class="text-xs leading-relaxed text-muted-foreground">
@@ -7,8 +7,13 @@
<span v-if="failuresLabel"> <span v-if="failuresLabel">
{{ failuresLabel }} {{ failuresLabel }}
</span> </span>
<details v-if="result.interrupted" class="mt-2 border-t border-border/60 pt-2"> <details
<summary class="cursor-pointer select-none">{{ legacyT('查看批次中断详情') }}</summary> v-if="result.interrupted"
class="mt-2 border-t border-border/60 pt-2"
>
<summary class="cursor-pointer select-none">
{{ legacyT('查看批次中断详情') }}
</summary>
<div class="mt-2 max-h-32 space-y-1 overflow-auto break-all"> <div class="mt-2 max-h-32 space-y-1 overflow-auto break-all">
<p>{{ legacyT('已完成用户 ID') }}:{{ userIds(result.completed_user_ids) }}</p> <p>{{ legacyT('已完成用户 ID') }}:{{ userIds(result.completed_user_ids) }}</p>
<p>{{ legacyT('结果待核对用户 ID') }}:{{ userIds(result.uncertain_user_ids) }}</p> <p>{{ legacyT('结果待核对用户 ID') }}:{{ userIds(result.uncertain_user_ids) }}</p>
@@ -22,15 +27,15 @@
import type { UserBatchActionResponse } from '@/api/users' import type { UserBatchActionResponse } from '@/api/users'
import { useI18n } from '@/i18n' import { useI18n } from '@/i18n'
const { legacyT } = useI18n()
function userIds(ids?: string[]): string {
return ids && ids.length > 0 ? ids.join(', ') : '-'
}
defineProps<{ defineProps<{
result: UserBatchActionResponse | null result: UserBatchActionResponse | null
label: string label: string
failuresLabel: string failuresLabel: string
}>() }>()
const { legacyT } = useI18n()
function userIds(ids?: string[]): string {
return ids && ids.length > 0 ? ids.join(', ') : '-'
}
</script> </script>