杂务:新增声明级注释覆盖率
This commit is contained in:
@@ -137,25 +137,61 @@ import { onMounted, ref, watch, inject, computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { CheckOutlined, LeftOutlined, SearchOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
/**
|
||||
* Purpose: ProductVO supports ProductListView.vue by holding or executing the product vo 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 { productApi, type ProductVO } from '@/api/product'
|
||||
/**
|
||||
* Purpose: TagVO supports ProductListView.vue by holding or executing the tag vo 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 { tagApi, type TagVO } from '@/api/tag'
|
||||
import { cartApi } from '@/api/cart'
|
||||
import { fileApi } from '@/api/file'
|
||||
import { runWithGlobalLoading } from '@/utils/action-loading'
|
||||
import { fetchCartProductIdSet, hasCartProduct, withAddedCartProduct } from '@/utils/cart-state'
|
||||
|
||||
/**
|
||||
* Purpose: ProductListItem supports ProductListView.vue by holding or executing the product list item 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.
|
||||
*/
|
||||
type ProductListItem = ProductVO & {
|
||||
inCart?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: router supports ProductListView.vue by holding or executing the router 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 router = useRouter()
|
||||
/**
|
||||
* Purpose: route supports ProductListView.vue by holding or executing the route 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 route = useRoute()
|
||||
/**
|
||||
* Purpose: updateCartCount supports ProductListView.vue by holding or executing the update cart count 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 updateCartCount = inject<() => Promise<void>>('updateCartCount', async () => {})
|
||||
|
||||
/**
|
||||
* Purpose: allTags supports ProductListView.vue by holding or executing the all 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 allTags = ref<TagVO[]>([])
|
||||
/**
|
||||
* Purpose: categories supports ProductListView.vue by holding or executing the categories 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 categories = ref<string[]>(['全部'])
|
||||
/** selectedCategory is a reactive state variable used by the template and event handlers. */
|
||||
const selectedCategory = ref('全部')
|
||||
/**
|
||||
* Purpose: products supports ProductListView.vue by holding or executing the products 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 products = ref<ProductListItem[]>([])
|
||||
/** loading is a reactive state variable used by the template and event handlers. */
|
||||
const loading = ref(false)
|
||||
@@ -163,10 +199,22 @@ const loading = ref(false)
|
||||
const showSearch = ref(false)
|
||||
/** searchKeyword is a reactive state variable used by the template and event handlers. */
|
||||
const searchKeyword = ref('')
|
||||
/**
|
||||
* Purpose: imageIdCache supports ProductListView.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>>({})
|
||||
/**
|
||||
* Purpose: imageUrls supports ProductListView.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[]>>({})
|
||||
/** cartProductIdSet is a reactive state variable used by the template and event handlers. */
|
||||
const cartProductIdSet = ref(new Set<string>())
|
||||
/**
|
||||
* Purpose: useGlobalLoadingForNextRouteSync supports ProductListView.vue by holding or executing the use global loading for next route sync page or API role.
|
||||
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
let useGlobalLoadingForNextRouteSync = false
|
||||
|
||||
/** isLoggedIn is a reactive state variable used by the template and event handlers. */
|
||||
@@ -182,6 +230,10 @@ const activeBannerText = computed(() => {
|
||||
return ''
|
||||
})
|
||||
|
||||
/**
|
||||
* Purpose: DEFAULT_PRODUCT_IMAGE supports ProductListView.vue by holding or executing the default product image 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 DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCBmaWxsPSIjZjVmNWY1IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIvPjx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBmaWxsPSIjYmZiZmJmIiBmb250LXNpemU9IjI0IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+YWFhPC90ZXh0Pjwvc3ZnPg=='
|
||||
|
||||
/** ensureLoginForAction is a local helper used by this page script. */
|
||||
|
||||
Reference in New Issue
Block a user