杂务:新增声明级注释覆盖率
This commit is contained in:
@@ -144,19 +144,75 @@ import type { OrderArtistChangeOptionsVO, OrderArtistChangeRequestVO } from '../
|
||||
import type { IdType } from '@/utils/id'
|
||||
import { runWithGlobalLoading } from '@/utils/action-loading'
|
||||
|
||||
/**
|
||||
* Purpose: router supports ArtistOrderView.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 ArtistOrderView.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: orders supports ArtistOrderView.vue by holding or executing the orders 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 orders = ref<any[]>([])
|
||||
/**
|
||||
* Purpose: imageIdCache supports ArtistOrderView.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: orderRefs supports ArtistOrderView.vue by holding or executing the order refs 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 orderRefs = ref<Record<string, any>>({})
|
||||
/**
|
||||
* Purpose: showCalendarEntry supports ArtistOrderView.vue by holding or executing the show calendar entry 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 showCalendarEntry = ref(false)
|
||||
/**
|
||||
* Purpose: currentUserId supports ArtistOrderView.vue by holding or executing the current user id 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 currentUserId = ref<IdType>()
|
||||
/**
|
||||
* Purpose: artistChangeModalOpen supports ArtistOrderView.vue by holding or executing the artist change modal open 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 artistChangeModalOpen = ref(false)
|
||||
/**
|
||||
* Purpose: artistChangeSubmitting supports ArtistOrderView.vue by holding or executing the artist change submitting 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 artistChangeSubmitting = ref(false)
|
||||
/**
|
||||
* Purpose: artistChangeOptionsLoading supports ArtistOrderView.vue by holding or executing the artist change options loading 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 artistChangeOptionsLoading = ref(false)
|
||||
/**
|
||||
* Purpose: artistChangeOptions supports ArtistOrderView.vue by holding or executing the artist change 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 artistChangeOptions = ref<OrderArtistChangeOptionsVO | null>(null)
|
||||
/**
|
||||
* Purpose: activeArtistChangeOrder supports ArtistOrderView.vue by holding or executing the active artist change order 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 activeArtistChangeOrder = ref<any | null>(null)
|
||||
/**
|
||||
* Purpose: activeArtistChangeItem supports ArtistOrderView.vue by holding or executing the active artist change item 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 activeArtistChangeItem = ref<any | null>(null)
|
||||
/**
|
||||
* Purpose: filters supports ArtistOrderView.vue by holding or executing the 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 filters = reactive({
|
||||
keyword: '',
|
||||
source: 'all',
|
||||
@@ -165,6 +221,10 @@ const filters = reactive({
|
||||
minAmount: undefined as number | undefined,
|
||||
maxAmount: undefined as number | undefined
|
||||
})
|
||||
/**
|
||||
* Purpose: artistChangeForm supports ArtistOrderView.vue by holding or executing the artist change 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 artistChangeForm = reactive({
|
||||
requestedArtistId: undefined as IdType | undefined,
|
||||
reason: ''
|
||||
@@ -233,10 +293,18 @@ const sourceClass = (source?: string) => {
|
||||
return 'source-service'
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: sameId supports ArtistOrderView.vue by holding or executing the same id 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 sameId = (left: unknown, right: unknown) => {
|
||||
return left !== undefined && left !== null && right !== undefined && right !== null && String(left) === String(right)
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: pendingArtistChangeForItem supports ArtistOrderView.vue by holding or executing the pending artist change for item 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 pendingArtistChangeForItem = (order: any, item: any): OrderArtistChangeRequestVO | undefined => {
|
||||
const itemValue = item?.pendingArtistChangeRequest as OrderArtistChangeRequestVO | undefined
|
||||
if (itemValue) return itemValue
|
||||
@@ -250,11 +318,19 @@ const canComplete = (order: any) => {
|
||||
return order.status === 1 && order.artistOrderSource !== 'SELF'
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: canRequestArtistChange supports ArtistOrderView.vue by holding or executing the can request artist change 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 canRequestArtistChange = (order: any, item: any) => {
|
||||
const assignedToCurrentUser = !currentUserId.value || !item.artistId || sameId(item.artistId, currentUserId.value)
|
||||
return order.status === 1 && item.id && assignedToCurrentUser && !pendingArtistChangeForItem(order, item)
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: selectableArtistOptions supports ArtistOrderView.vue by holding or executing the selectable artist 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 selectableArtistOptions = computed(() => {
|
||||
const options = artistChangeOptions.value?.artists || []
|
||||
return options.filter(artist => !sameId(artist.artistId, artistChangeOptions.value?.currentArtistId))
|
||||
@@ -318,6 +394,10 @@ const handleRefreshClick = async () => {
|
||||
await runWithGlobalLoading(() => loadOrders())
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: openArtistChangeModal supports ArtistOrderView.vue by holding or executing the open artist change modal 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 openArtistChangeModal = async (order: any, item: any) => {
|
||||
if (!canRequestArtistChange(order, item)) return
|
||||
activeArtistChangeOrder.value = order
|
||||
@@ -340,6 +420,10 @@ const openArtistChangeModal = async (order: any, item: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: closeArtistChangeModal supports ArtistOrderView.vue by holding or executing the close artist change modal 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 closeArtistChangeModal = () => {
|
||||
artistChangeModalOpen.value = false
|
||||
activeArtistChangeOrder.value = null
|
||||
@@ -349,6 +433,10 @@ const closeArtistChangeModal = () => {
|
||||
artistChangeForm.reason = ''
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: submitArtistChangeRequest supports ArtistOrderView.vue by holding or executing the submit artist change request 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 submitArtistChangeRequest = async () => {
|
||||
if (!activeArtistChangeOrder.value || !activeArtistChangeItem.value) return
|
||||
if (!artistChangeForm.requestedArtistId) {
|
||||
|
||||
Reference in New Issue
Block a user