代码格式化: prettier --write 统一代码风格

39 个文件按 .prettierrc.json (printWidth 100 / no semi / singleQuote) 统一格式, 纯空白与换行调整, 无逻辑变更。为接入代码门禁做准备, 让 npm run check (format:check + lint:strict + typecheck) 干净通过。
This commit is contained in:
yml
2026-06-14 16:24:01 +08:00
parent ae4297fec7
commit f410be3797
39 changed files with 87 additions and 80 deletions
@@ -79,7 +79,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -95,7 +95,6 @@ function isGroupPartial(perms: Permission[]) {
return perms.some(p => selectedPermIds.value.includes(p.id)) && !isGroupAllSelected(perms)
}
const resourceLabels: Record<string, string> = {
dashboard: '仪表盘',
user: '用户管理',
@@ -52,7 +52,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -64,7 +64,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -69,7 +69,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -110,7 +110,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -127,7 +127,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -128,7 +128,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -110,7 +110,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -183,7 +183,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -77,7 +77,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -88,7 +88,6 @@ async function handleSave() {
submitting.value = false
}
}
</script>
<template>
@@ -41,7 +41,9 @@ const filteredDisputes = computed(() => {
const pendingCount = computed(
() => disputes.value.filter(item => ['open', 'processing'].includes(item.status)).length
)
const resolvedCount = computed(() => disputes.value.filter(item => item.status === 'resolved').length)
const resolvedCount = computed(
() => disputes.value.filter(item => item.status === 'resolved').length
)
const cancelledCount = computed(
() => disputes.value.filter(item => item.status === 'cancelled').length
)
@@ -192,7 +194,8 @@ function evidenceName(value: string, index: number) {
function evidenceDetail(value: string) {
const key = evidenceObjectKey(value)
if (key) return decodeURIComponent(key)
if (value.startsWith('/api/files/object') || value.startsWith('/api/admin/files/object')) return value
if (value.startsWith('/api/files/object') || value.startsWith('/api/admin/files/object'))
return value
try {
const parsed = new URL(value, window.location.origin)
return parsed.href
@@ -277,7 +280,6 @@ async function handleArbitrate() {
submitting.value = false
}
}
</script>
<template>
@@ -339,7 +341,10 @@ async function handleArbitrate() {
<template #default="{ row }">
<div class="main-cell">
<strong>{{ row.title }}</strong>
<span>{{ orderStatusLabel(row.order_status) }} · {{ handoffStatusLabel(row.handoff_status) }}</span>
<span
>{{ orderStatusLabel(row.order_status) }} ·
{{ handoffStatusLabel(row.handoff_status) }}</span
>
</div>
</template>
</el-table-column>
@@ -356,8 +361,14 @@ async function handleArbitrate() {
<el-table-column label="双方信息" min-width="240">
<template #default="{ row }">
<div class="party-cell">
<span>申诉方{{ roleLabel(row, row.initiator_id) }} {{ userPhone(row, row.initiator_id) }}</span>
<span>申诉方{{ roleLabel(row, row.target_user_id) }} {{ userPhone(row, row.target_user_id) }}</span>
<span
>申诉方{{ roleLabel(row, row.initiator_id) }}
{{ userPhone(row, row.initiator_id) }}</span
>
<span
>被申诉方{{ roleLabel(row, row.target_user_id) }}
{{ userPhone(row, row.target_user_id) }}</span
>
</div>
</template>
</el-table-column>
@@ -377,7 +388,9 @@ async function handleArbitrate() {
<template #default="{ row }">{{ arbitrationResultLabel(row.arbitration_result) }}</template>
</el-table-column>
<el-table-column label="处理时间" min-width="180">
<template #default="{ row }">{{ row.handled_at ? formatDateTime(row.handled_at) : '-' }}</template>
<template #default="{ row }">{{
row.handled_at ? formatDateTime(row.handled_at) : '-'
}}</template>
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
@@ -387,10 +400,7 @@ async function handleArbitrate() {
@click="evidenceDispute = row"
>证据</el-button
>
<el-button
size="small"
:disabled="!canArbitrate(row)"
@click="openArbitration(row)"
<el-button size="small" :disabled="!canArbitrate(row)" @click="openArbitration(row)"
>仲裁</el-button
>
</template>
@@ -508,10 +518,7 @@ async function handleArbitrate() {
<p>{{ evidenceDispute.description || '-' }}</p>
</div>
<el-empty
v-if="evidenceItems(evidenceDispute).length === 0"
description="暂无证据文件"
/>
<el-empty v-if="evidenceItems(evidenceDispute).length === 0" description="暂无证据文件" />
<div v-else class="evidence-list">
<div
v-for="(item, index) in evidenceItems(evidenceDispute)"
@@ -105,7 +105,6 @@ async function openScreenshot(url: string) {
window.open(url, '_blank')
}
}
</script>
<template>
@@ -549,7 +549,6 @@ async function openScreenshot(url: string) {
window.open(url, '_blank')
}
}
</script>
<template>
@@ -54,7 +54,6 @@ async function handleLogin() {
loading.value = false
}
}
</script>
<template>
@@ -94,7 +94,6 @@ async function handleChangePassword() {
}
}
const statusLabel: Record<string, string> = {
active: '启用',
disabled: '禁用',
@@ -89,7 +89,6 @@ async function submitAction() {
}
}
function orderRentedAt() {
return order.value?.rented_at
}
@@ -86,7 +86,6 @@ async function handleUnfreeze(row: AdminUserItem) {
}
}
function moneyCent(value: number | string | undefined) {
return formatCent(Number(value || 0))
}
@@ -96,7 +96,6 @@ async function handleLogin() {
loading.value = false
}
}
</script>
<template>
@@ -206,7 +206,6 @@ async function saveProfile() {
}
}
function confirmLogout() {
showSettings.value = false
showDialog({
@@ -145,7 +145,6 @@ async function saveProfile() {
saving.value = false
}
}
</script>
<template>
@@ -108,7 +108,6 @@ async function handleSubmit() {
loading.value = false
}
}
</script>
<template>
@@ -88,9 +88,7 @@ function readItems(key: string): ListingCollectionItem[] {
if (!raw) return []
const parsed = JSON.parse(raw) as unknown
if (!Array.isArray(parsed)) return []
return parsed
.map(normalizeItem)
.filter((item): item is ListingCollectionItem => Boolean(item))
return parsed.map(normalizeItem).filter((item): item is ListingCollectionItem => Boolean(item))
} catch {
localStorage.removeItem(key)
return []
@@ -30,8 +30,12 @@ const {
} = useListingCollections()
const activeTab = ref(route.query.tab === 'favorites' ? 'favorites' : 'history')
const isMobilePage = computed(() => route.path.startsWith('/m/'))
const activeItems = computed(() => (activeTab.value === 'favorites' ? favorites.value : history.value))
const emptyText = computed(() => (activeTab.value === 'favorites' ? '暂无收藏账号' : '暂无浏览记录'))
const activeItems = computed(() =>
activeTab.value === 'favorites' ? favorites.value : history.value
)
const emptyText = computed(() =>
activeTab.value === 'favorites' ? '暂无收藏账号' : '暂无浏览记录'
)
async function handleClearHistory() {
try {
@@ -81,13 +85,21 @@ function timeText(item: ListingCollectionItem) {
<h1>我的足迹</h1>
<p>找回看过和收藏过的账号</p>
</div>
<button v-if="activeTab === 'history' && history.length" type="button" @click="handleClearHistory">
<button
v-if="activeTab === 'history' && history.length"
type="button"
@click="handleClearHistory"
>
清空记录
</button>
</header>
<nav class="collection-tabs">
<button :class="{ active: activeTab === 'history' }" type="button" @click="activeTab = 'history'">
<button
:class="{ active: activeTab === 'history' }"
type="button"
@click="activeTab = 'history'"
>
浏览记录 <span>{{ history.length }}</span>
</button>
<button
@@ -291,7 +291,6 @@ function updateAgreementReadState(type: 'virtual' | 'renter') {
}
}
// 手动锁定/解锁背景滚动
watch(agreementVisible, visible => {
// 只锁定 .pc-main 容器,不影响 body 和 sticky 导航栏
@@ -513,7 +512,11 @@ function handleToggleFavorite() {
>
{{ listing.in_transaction ? '交易中' : '立即下单' }}
</el-button>
<el-button class="full-control favorite-order-btn" size="large" @click="handleToggleFavorite">
<el-button
class="full-control favorite-order-btn"
size="large"
@click="handleToggleFavorite"
>
{{ listingFavorited ? '取消收藏' : '收藏账号' }}
</el-button>
</el-form>
+3 -1
View File
@@ -237,7 +237,9 @@ export function startPayment(orderId: number, payWay: string, jsPayFlag?: string
}
export async function queryOrderPayment(orderId: number) {
const { data } = await apiClient.get<ApiResponse<PaymentOrder>>(`/orders/${orderId}/query-payment`)
const { data } = await apiClient.get<ApiResponse<PaymentOrder>>(
`/orders/${orderId}/query-payment`
)
return data.data
}
@@ -479,7 +479,9 @@ export function useOrderActions(options: UseOrderActionsOptions) {
uploadingEvidence.value = true
try {
const uploaded = await uploadFile(file, 'dispute')
disputeEvidenceText.value = [disputeEvidenceText.value, uploaded.url].filter(Boolean).join('\n')
disputeEvidenceText.value = [disputeEvidenceText.value, uploaded.url]
.filter(Boolean)
.join('\n')
options.notifySuccess('证据文件已上传')
} catch (error) {
options.notifyError(readError(error, '上传失败'))
@@ -132,7 +132,6 @@ function getStatusTagType(status: string) {
return 'danger'
}
async function copyListingCode() {
if (!order.value) return
try {
@@ -144,7 +143,6 @@ async function copyListingCode() {
}
</script>
<template>
<main class="mobile-order-detail-view">
<header class="page-header">
@@ -158,7 +158,6 @@ async function copyListingCode() {
}
</script>
<template>
<section class="page order-detail-page" v-loading="loading">
<div v-if="order" class="page-header">
@@ -103,7 +103,6 @@ async function handlePay(order: Order) {
}
}
function orderRole(order: Order) {
if (order.renter_id === session.userId) return '租客'
if (order.owner_id === session.userId) return '号主'
@@ -690,7 +690,10 @@ export function usePublishForm(options: UsePublishFormOptions) {
await router.push(options.submitSuccessPath)
} catch (error) {
options.notifyError(
readError(error, isEditMode.value ? '修改失败,请稍后重试' : '发布失败,请确认已登录并完成实名认证')
readError(
error,
isEditMode.value ? '修改失败,请稍后重试' : '发布失败,请确认已登录并完成实名认证'
)
)
} finally {
loading.value = false
@@ -966,7 +969,6 @@ export function usePublishForm(options: UsePublishFormOptions) {
}
}
function parseOnlineTime(value: string) {
const match = /^(\d{2}):(\d{2})$/.exec(value)
if (!match) return null
@@ -695,9 +695,9 @@ function selectDailyLoss(value: string | number) {
@click="handleSaveDraft"
>保存草稿</el-button
>
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft"
>{{ isEditMode ? '恢复原信息' : '重置草稿' }}</el-button
>
<el-button :icon="RefreshRight" :disabled="loading" @click="handleResetDraft">{{
isEditMode ? '恢复原信息' : '重置草稿'
}}</el-button>
</div>
</div>
</aside>
@@ -160,7 +160,10 @@ async function handleAddAccount() {
return
}
if (!accountForm.account_no.trim()) {
showToast({ message: accountForm.account_type === 'bank' ? '请输入银行卡号' : '请输入账号', icon: 'warning-o' })
showToast({
message: accountForm.account_type === 'bank' ? '请输入银行卡号' : '请输入账号',
icon: 'warning-o',
})
return
}
if (accountForm.account_type === 'bank' && !accountForm.bank_name.trim()) {
@@ -416,7 +419,11 @@ function statusType(status: string): 'primary' | 'success' | 'danger' | 'warning
>
<div class="popup-body">
<h2>添加收款账号</h2>
<van-radio-group v-model="accountForm.account_type" direction="horizontal" class="type-tabs">
<van-radio-group
v-model="accountForm.account_type"
direction="horizontal"
class="type-tabs"
>
<van-radio name="alipay">支付宝</van-radio>
<van-radio name="wechat">微信</van-radio>
<van-radio name="bank">银行卡</van-radio>
@@ -447,11 +454,7 @@ function statusType(status: string): 'primary' | 'success' | 'danger' | 'warning
placeholder="如:中国工商银行"
required
/>
<van-field
v-model.trim="accountForm.bank_branch"
label="开户支行"
placeholder="可选"
/>
<van-field v-model.trim="accountForm.bank_branch" label="开户支行" placeholder="可选" />
</template>
<div class="account-tip">
@@ -232,7 +232,6 @@ function amountPrefix(direction: string) {
@size-change="handleSizeChange"
/>
</div>
</section>
</template>
+18 -3
View File
@@ -117,9 +117,19 @@ const allNavGroups: NavGroup[] = [
icon: Document,
permission: 'wallet:view',
},
{ label: '资金流水', to: adminPath('wallet-ledger'), icon: Wallet, permission: 'wallet:view' },
{
label: '资金流水',
to: adminPath('wallet-ledger'),
icon: Wallet,
permission: 'wallet:view',
},
{ label: '支付流水', to: adminPath('payments'), icon: CreditCard, permission: 'wallet:view' },
{ label: '提现审核', to: adminPath('withdrawals'), icon: Money, permission: 'withdrawal:list' },
{
label: '提现审核',
to: adminPath('withdrawals'),
icon: Money,
permission: 'withdrawal:list',
},
{
label: '支付配置',
to: adminPath('payment-configs'),
@@ -152,7 +162,12 @@ const allNavGroups: NavGroup[] = [
index: 'system-auth',
icon: Lock,
children: [
{ label: '审计日志', to: adminPath('audit-logs'), icon: Document, permission: 'audit_log:view' },
{
label: '审计日志',
to: adminPath('audit-logs'),
icon: Document,
permission: 'audit_log:view',
},
{
label: '管理员管理',
to: adminPath('admin-users'),
+1 -7
View File
@@ -2,13 +2,7 @@
* API 性能监控
* 记录和分析 API 请求性能
*/
import {
debugGroup,
debugGroupEnd,
debugLog,
debugTable,
debugWarn,
} from '@/shared/utils/debug'
import { debugGroup, debugGroupEnd, debugLog, debugTable, debugWarn } from '@/shared/utils/debug'
interface RequestMetrics {
url: string
@@ -59,7 +59,6 @@ export function useSmsCountdown() {
}
}
return {
countDown,
sending,
+1 -4
View File
@@ -1,7 +1,4 @@
type DebugConsole = Pick<
Console,
'log' | 'warn' | 'error' | 'group' | 'groupEnd' | 'table'
>
type DebugConsole = Pick<Console, 'log' | 'warn' | 'error' | 'group' | 'groupEnd' | 'table'>
function runInDev(method: keyof DebugConsole, args: unknown[]) {
if (!import.meta.env.DEV) return