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

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
@@ -512,7 +512,15 @@ import { PlusOutlined } from '@ant-design/icons-vue'
import DraftActions from '@/components/DraftActions.vue'
import TableEllipsisText from '@/components/TableEllipsisText.vue'
import { DEFAULT_PRODUCT_IMAGE } from '@/constants'
/**
* Purpose: Product supports ProductsView.vue by holding or executing the product 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 { adminProductApi, type Product, adminShopApi, type Shop, adminFileApi, adminTagApi, adminArtistApi, adminCouponApi } from '@/api/admin'
/**
* Purpose: ChunkUploadTask supports ProductsView.vue by holding or executing the chunk upload task 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 { createChunkUploadTask, type ChunkUploadTask } from '@/utils/chunk-upload'
import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecord } from '@/utils/form-draft'
import { usePermission } from '@/utils/permission'
@@ -531,11 +539,35 @@ const { isMobile } = useAdminViewport()
const loading = ref(false)
/** searchText is a reactive state variable used by the template and event handlers. */
const searchText = ref('')
/**
* Purpose: shopFilter supports ProductsView.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<IdType | undefined>()
/**
* Purpose: tagFilter supports ProductsView.vue by holding or executing the tag 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 tagFilter = ref<IdType | undefined>()
/**
* Purpose: minPriceFilter supports ProductsView.vue by holding or executing the min price 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 minPriceFilter = ref<number | undefined>()
/**
* Purpose: maxPriceFilter supports ProductsView.vue by holding or executing the max price 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 maxPriceFilter = ref<number | undefined>()
/**
* Purpose: createdRange supports ProductsView.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: productList supports ProductsView.vue by holding or executing the product 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 productList = ref<Product[]>([])
/** modalVisible is a reactive state variable used by the template and event handlers. */
const modalVisible = ref(false)
@@ -545,16 +577,36 @@ const viewModalVisible = ref(false)
const modalLoading = ref(false)
/** isEdit is a reactive state variable used by the template and event handlers. */
const isEdit = ref(false)
/**
* Purpose: currentProduct supports ProductsView.vue by holding or executing the current product 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 currentProduct = ref<Product | null>(null)
/**
* Purpose: shops supports ProductsView.vue by holding or executing the shops 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 shops = ref<Shop[]>([])
/** loadingShops is a reactive state variable used by the template and event handlers. */
const loadingShops = ref(false)
/**
* Purpose: tags supports ProductsView.vue by holding or executing the tags 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 tags = ref<any[]>([])
/** loadingTags is a reactive state variable used by the template and event handlers. */
const loadingTags = ref(false)
/**
* Purpose: artists supports ProductsView.vue by holding or executing the artists 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 artists = ref<any[]>([])
/** loadingArtists is a reactive state variable used by the template and event handlers. */
const loadingArtists = ref(false)
/**
* Purpose: coupons supports ProductsView.vue by holding or executing the coupons 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 coupons = ref<any[]>([])
/** loadingCoupons is a reactive state variable used by the template and event handlers. */
const loadingCoupons = ref(false)
@@ -562,20 +614,56 @@ const loadingCoupons = ref(false)
const previewVisible = ref(false)
/** previewImage is a reactive state variable used by the template and event handlers. */
const previewImage = ref('')
/**
* Purpose: imageFileList supports ProductsView.vue by holding or executing the image file 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 imageFileList = ref<any[]>([])
/**
* Purpose: uploadedFileIds supports ProductsView.vue by holding or executing the uploaded file ids 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 uploadedFileIds = ref<string[]>([])
/**
* Purpose: imageUrls supports ProductsView.vue by holding or executing the image urls 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 imageUrls = ref<Record<string, string[]>>({})
/**
* Purpose: viewImageUrls supports ProductsView.vue by holding or executing the view image urls 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 viewImageUrls = ref<string[]>([])
/**
* Purpose: imageIdCache supports ProductsView.vue by holding or executing the image id cache 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 imageIdCache = ref<Record<string, string>>({})
/** isAdmin is a reactive state variable used by the template and event handlers. */
const isAdmin = ref(false)
/**
* Purpose: formRef supports ProductsView.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<any>(null)
/**
* Purpose: uploadTaskMap supports ProductsView.vue by holding or executing the upload task map 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 uploadTaskMap = new Map<string, ChunkUploadTask<any>>()
/** activeUploadCount is a reactive state variable used by the template and event handlers. */
const activeUploadCount = ref(0)
/** isUploadPending is a reactive state variable used by the template and event handlers. */
const isUploadPending = computed(() => activeUploadCount.value > 0)
/**
* Purpose: draftSavedAt supports ProductsView.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)
/**
* Purpose: requestTokens supports ProductsView.vue by holding or executing the request tokens 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 requestTokens = reactive({
shops: 0,
tags: 0,
@@ -602,6 +690,10 @@ const formatDuration = (value?: string | number | null) => {
return text.includes('分钟') ? text : `${text}分钟`
}
/**
* Purpose: viewFormState supports ProductsView.vue by holding or executing the view 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 viewFormState = reactive({
shopId: undefined,
title: '',
@@ -616,6 +708,10 @@ const viewFormState = reactive({
availableCoupons: [] as string[]
})
/**
* Purpose: pagination supports ProductsView.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,
@@ -625,6 +721,10 @@ const pagination = reactive({
showTotal: (total: number) => `共 ${total} 条`
})
/**
* Purpose: formState supports ProductsView.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({
shopId: undefined,
title: '',
@@ -661,6 +761,10 @@ const formRules: any = {
bookableArtists: [{ required: true, message: '请选择美甲师', trigger: 'change' }]
}
/**
* Purpose: columns supports ProductsView.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: 'image', width: 150 },
{ title: '作品名称', dataIndex: 'title', key: 'title' },
@@ -892,6 +996,10 @@ const fetchProductList = async () => {
}
}
/**
* Purpose: resetFilters supports ProductsView.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 = undefined