强化前端格式检测

This commit is contained in:
yml2213
2026-06-08 06:46:47 +08:00
parent 500f511185
commit 04f42e5a96
23 changed files with 17 additions and 64 deletions
@@ -93,12 +93,6 @@ async function handleSubmit() {
submitting.value = false
}
}
function getStatusTag(count: number) {
if (count === 0) return { text: '空闲', type: 'success' }
if (count <= 3) return { text: '正常', type: '' }
return { text: '繁忙', type: 'warning' }
}
</script>
<template>
@@ -66,7 +66,7 @@ async function loadAnnouncements() {
})
announcements.value = result.items
total.value = result.total
} catch (err) {
} catch {
ElMessage.error('加载公告列表失败')
} finally {
loading.value = false
@@ -96,7 +96,7 @@ async function handleSave(data: CreateAnnouncementRequest | UpdateAnnouncementRe
}
dialogVisible.value = false
loadAnnouncements()
} catch (err) {
} catch {
ElMessage.error('保存失败')
}
}
@@ -161,11 +161,6 @@ async function handlePageChange() {
await loadAnnouncements()
}
async function handleSizeChange() {
currentPage.value = 1
await loadAnnouncements()
}
function getCategoryLabel(category: string) {
return categories.find(c => c.value === category)?.label || category
}
@@ -54,11 +54,6 @@ async function handlePageChange() {
await loadLogs()
}
async function handleSizeChange() {
currentPage.value = 1
await loadLogs()
}
function actorName(row: AdminAuditLog) {
return row.actor_nickname || row.actor_username || `${row.actor_type} ${row.actor_id}`
}
@@ -47,7 +47,7 @@ const activeMembers = computed(() => {
const participants = active.value?.participants || []
return participants
.map(item => {
const remark = getParticipantRemark(item)
const remark = getParticipantRemark()
const name = remark ? `${remark}(${item.display_name})` : item.display_name
return `${roleLabel(item.role)}${name}`
})
@@ -58,7 +58,7 @@ const canSend = computed(() => content.value.trim() !== '' || attachments.value.
// 桌面通知
const desktopNotification = useDesktopNotification('admin')
function getParticipantRemark(participant: any) {
function getParticipantRemark() {
if (!active.value) return ''
const myParticipant = active.value.participants?.find(
p => p.participant_type === 'admin' && p.participant_id === currentAdminId
@@ -37,11 +37,6 @@ async function handlePageChange() {
await loadDisputes()
}
async function handleSizeChange() {
currentPage.value = 1
await loadDisputes()
}
function openArbitration(row: Dispute) {
activeDispute.value = row
result.value = row.arbitration_result || 'release_deposit'
@@ -31,7 +31,6 @@ const {
currentPage,
currentPageSize,
load: loadAdmins,
handleSizeChange,
} = useAdminPaginatedTable<AdminMgrUser>({
fetchFn: fetchAdminMgrUsers,
})
@@ -24,7 +24,6 @@ const {
currentPage,
currentPageSize,
load: loadUsers,
handleSizeChange,
} = useAdminPaginatedTable<AdminUserItem>({
fetchFn: fetchAdminUsers,
})
@@ -63,11 +63,6 @@ async function handlePageChange() {
await loadLedger()
}
async function handleSizeChange() {
currentPage.value = 1
await loadLedger()
}
function money(value: number) {
return `¥${Math.round(Number(value || 0))}`
}
@@ -16,7 +16,7 @@ const form = reactive({
code: '',
})
const { countDown, sending, handleSendCode, readError } = useSmsCountdown()
const { countDown, sending, handleSendCode } = useSmsCountdown()
async function handleLogin() {
if (!agreed.value) {
@@ -42,7 +42,7 @@ async function handleAvatarFileChange(event: Event) {
if (!file) return
uploadingAvatar.value = true
const toast = showToast({
const loadingToast = showToast({
type: 'loading',
message: '上传中...',
forbidClick: true,
@@ -56,6 +56,7 @@ async function handleAvatarFileChange(event: Event) {
} catch (error) {
showToast({ message: readError(error, '上传失败'), icon: 'cross' })
} finally {
loadingToast.close()
uploadingAvatar.value = false
}
}
@@ -17,7 +17,7 @@ const form = reactive({
inviteCode: '',
})
const { countDown, sending, handleSendCode, readError } = useSmsCountdown()
const { countDown, sending, handleSendCode } = useSmsCountdown()
async function handleRegister() {
if (!agreed.value) {
@@ -2,7 +2,7 @@
import { computed, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { ChatDotRound, Refresh, Tickets } from '@element-plus/icons-vue'
import { Refresh, Tickets } from '@element-plus/icons-vue'
import { fetchChats, type ChatConversation } from '@/features/chats/api/chats'
import { useChatSSE, type ChatEvent } from '@/features/chats/composables/useChatSSE'
import { useDesktopNotification } from '@/features/chats/composables/useDesktopNotification'
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Filter, Refresh, ArrowDown } from '@element-plus/icons-vue'
import { Filter, Refresh } from '@element-plus/icons-vue'
import { ElButton, ElIcon } from 'element-plus'
import RangeFilter from './RangeFilter.vue'
import StringFilter from './StringFilter.vue'
@@ -12,7 +12,7 @@ interface Props {
sortBy: string
}
const props = defineProps<Props>()
defineProps<Props>()
const emit = defineEmits<{
'update:activeZone': [value: string]
@@ -36,10 +36,7 @@ describe('useHomeFilters', () => {
const publishOptions = ref(emptyListingPublishOptions)
const listings = ref([])
const { filters, setStringFilter, closeFilterPopover } = useHomeFilters(
publishOptions,
listings
)
const { filters, setStringFilter } = useHomeFilters(publishOptions, listings)
setStringFilter('region', '上海')
@@ -45,7 +45,6 @@ const {
loadingMore,
listings,
totalListings,
zoneCounts,
hasMoreListings,
loadListingsPage,
zoneCount,
@@ -28,7 +28,6 @@ import {
getOnlineTimeText,
getLoginMethod,
getServerRegion,
readAssetNumber,
readAssetString,
} from '@/utils/listingDisplay'
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, onMounted, reactive, ref } from 'vue'
import { computed, onMounted, ref } from 'vue'
import {
emptyListingPublishOptions,
@@ -30,7 +30,6 @@ import {
readAssetNumber,
readAssetString,
} from '@/utils/listingDisplay'
import { listingStatusLabel } from '@/utils/statusLabels'
/* ------------------------------------------------------------------ */
/* 数据加载 */
@@ -256,12 +256,6 @@ function readError(error: unknown, fallback: string) {
}
return fallback
}
/** 判断当前底部导航是否激活 */
function isNavActive(path: string) {
if (path === '/m') return route.path === '/m'
return route.path.startsWith(path)
}
</script>
<template>
@@ -36,7 +36,6 @@ const {
screenshotSlots,
priceConfig,
fireLevelPlaceholder,
coinMAmount,
dailyLossMAmount,
calculatedDefaultSaleRatio,
maxAcceleratedSaleRatio,
@@ -100,15 +100,6 @@ async function handleSubmit() {
}
}
function accountTypeLabel(type: string) {
const labels: Record<string, string> = {
alipay: '支付宝',
wechat: '微信',
bank: '银行卡',
}
return labels[type] || type
}
async function handleUpload(event: Event) {
const input = event.target as HTMLInputElement
const file = input.files?.[0]
@@ -2,7 +2,7 @@
import { computed, onMounted, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'
import { Wallet, Money, DocumentChecked, Warning } from '@element-plus/icons-vue'
import { Wallet, Money } from '@element-plus/icons-vue'
import {
fetchPaymentAccounts,