杂务:新增声明级注释覆盖率

This commit is contained in:
xiaowang
2026-05-23 18:44:57 +08:00
parent 8f038894e7
commit 844516988b
234 changed files with 8356 additions and 0 deletions
@@ -497,6 +497,10 @@ import DraftActions from '@/components/DraftActions.vue'
import { DEFAULT_AVATAR } from '@/constants'
import { ACCOUNT_REGEX, ACCOUNT_RULE_MESSAGE, sanitizeAccountInput } from '@/utils/account'
import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecord } from '@/utils/form-draft'
/**
* Purpose: AvailabilityCheckResponse supports UsersView.vue by holding or executing the availability check response page or API role.
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
*/
import { userApi, type AvailabilityCheckResponse } from '@/api/user'
import {
adminShopApi,
@@ -552,19 +556,75 @@ const viewModalVisible = ref(false)
const isEdit = ref(false)
/** searchText is a reactive state variable used by the template and event handlers. */
const searchText = ref('')
/**
* Purpose: shopFilter supports UsersView.vue by holding or executing the shop filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const shopFilter = ref<string | undefined>()
/**
* Purpose: typeFilter supports UsersView.vue by holding or executing the type filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const typeFilter = ref<number | undefined>()
/**
* Purpose: vipLevelFilter supports UsersView.vue by holding or executing the vip level filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const vipLevelFilter = ref<string | undefined>()
/**
* Purpose: statusFilter supports UsersView.vue by holding or executing the status filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const statusFilter = ref<number | undefined>()
/**
* Purpose: createdRange supports UsersView.vue by holding or executing the created range page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const createdRange = ref<[string, string] | undefined>()
/**
* Purpose: hasPhoneFilter supports UsersView.vue by holding or executing the has phone filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const hasPhoneFilter = ref<'true' | 'false' | undefined>()
/**
* Purpose: hasOrderFilter supports UsersView.vue by holding or executing the has order filter page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const hasOrderFilter = ref<'true' | 'false' | undefined>()
/**
* Purpose: formRef supports UsersView.vue by holding or executing the form ref page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const formRef = ref<FormInstance>()
/**
* Purpose: userList supports UsersView.vue by holding or executing the user list page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const userList = ref<UserVO[]>([])
/**
* Purpose: shopList supports UsersView.vue by holding or executing the shop list page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const shopList = ref<Shop[]>([])
/**
* Purpose: vipLevelOptions supports UsersView.vue by holding or executing the vip level options page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const vipLevelOptions = ref<string[]>(['普通', '青铜', '白银', '黄金'])
/**
* Purpose: currentUser supports UsersView.vue by holding or executing the current user page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const currentUser = ref<UserVO | null>(null)
/**
* Purpose: viewRecord supports UsersView.vue by holding or executing the view record page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const viewRecord = ref<UserVO | null>(null)
/**
* Purpose: draftSavedAt supports UsersView.vue by holding or executing the draft saved at page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const draftSavedAt = ref<number | null>(null)
/** assetModalVisible is a reactive state variable used by the template and event handlers. */
@@ -573,10 +633,30 @@ const assetModalVisible = ref(false)
const assetLoading = ref(false)
/** assetSaving is a reactive state variable used by the template and event handlers. */
const assetSaving = ref(false)
/**
* Purpose: assetTargetUser supports UsersView.vue by holding or executing the asset target user page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const assetTargetUser = ref<UserVO | null>(null)
/**
* Purpose: assetData supports UsersView.vue by holding or executing the asset data page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const assetData = ref<UserAssetVO | null>(null)
/**
* Purpose: balanceHistory supports UsersView.vue by holding or executing the balance history page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const balanceHistory = ref<UserBalanceHistoryItem[]>([])
/**
* Purpose: balanceDraftSavedAt supports UsersView.vue by holding or executing the balance draft saved at page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const balanceDraftSavedAt = ref<number | null>(null)
/**
* Purpose: vipDraftSavedAt supports UsersView.vue by holding or executing the vip draft saved at page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const vipDraftSavedAt = ref<number | null>(null)
/** canOpenAssetPanel is a reactive state variable used by the template and event handlers. */
@@ -620,8 +700,16 @@ const canDeleteUser = computed(() =>
const canUnbindUser = computed(() =>
hasPermission('user:unbind')
)
/**
* Purpose: PHONE_REGEX supports UsersView.vue by holding or executing the phone regex page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const PHONE_REGEX = /^1[3-9]\d{9}$/
/**
* Purpose: pagination supports UsersView.vue by holding or executing the pagination page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const pagination = reactive({
current: 1,
pageSize: 10,
@@ -631,6 +719,10 @@ const pagination = reactive({
showTotal: (total: number) => `共 ${total} 条`
})
/**
* Purpose: formState supports UsersView.vue by holding or executing the form state page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const formState = reactive({
account: '',
nickname: '',
@@ -681,6 +773,10 @@ const validatePhoneUniqueness = async (value: string) => {
}
}
/**
* Purpose: balanceForm supports UsersView.vue by holding or executing the balance form page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const balanceForm = reactive<AdminUserBalanceChangeRequest>({
changeScene: 'RECHARGE',
amount: undefined as unknown as number,
@@ -689,6 +785,10 @@ const balanceForm = reactive<AdminUserBalanceChangeRequest>({
remark: ''
})
/**
* Purpose: vipForm supports UsersView.vue by holding or executing the vip form page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const vipForm = reactive<AdminUserVipOverrideRequest>({
vipLevel: '普通',
remark: ''
@@ -773,6 +873,10 @@ const handleClearVipDraft = (showMessage = true) => {
}
}
/**
* Purpose: formRules supports UsersView.vue by holding or executing the form rules page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const formRules = {
account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
@@ -808,6 +912,10 @@ const formRules = {
type: [{ required: true, message: '请选择用户类型', trigger: 'change' }]
} as any
/**
* Purpose: columns supports UsersView.vue by holding or executing the columns page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const columns = [
{ title: '头像', key: 'avatar', width: 80 },
{ title: '账号', dataIndex: 'account', key: 'account' },
@@ -821,6 +929,10 @@ const columns = [
{ title: '操作', key: 'actions', width: 280, fixed: 'right' as const }
]
/**
* Purpose: historyColumns supports UsersView.vue by holding or executing the history columns page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const historyColumns = [
{ title: '场景', key: 'changeScene', width: 120 },
{ title: '金额', key: 'amount', width: 110 },
@@ -1032,6 +1144,10 @@ const fetchUserList = async () => {
}
}
/**
* Purpose: resetFilters supports UsersView.vue by holding or executing the reset filters page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const resetFilters = () => {
searchText.value = ''
shopFilter.value = currentUserType.value !== 4 ? normalizeShopId(currentUserInfo?.shopId) : undefined
@@ -1465,6 +1581,10 @@ const handleVipRecalculate = () => {
})
}
/**
* Purpose: fetchVipLevelOptions supports UsersView.vue by holding or executing the fetch vip level options page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const fetchVipLevelOptions = async () => {
try {
const levels = await adminVipRechargePlanApi.listVipLevelOptions(currentUserInfo?.shopId)