杂务:更新 YumiNail 工作区
This commit is contained in:
@@ -26,16 +26,16 @@
|
||||
placeholder="搜索订单号、用户 ID 或优惠券"
|
||||
@search="loadOrders"
|
||||
/>
|
||||
<a-select
|
||||
v-model:value="statusFilter"
|
||||
:options="statusOptions"
|
||||
:style="isMobile ? { width: '100%' } : { width: '160px' }"
|
||||
@change="loadOrders"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="admin-filter-bar">
|
||||
<AdminFilterPanel :active-count="activeFilterCount">
|
||||
<a-select
|
||||
v-model:value="statusFilter"
|
||||
:options="statusOptions"
|
||||
style="width: 160px"
|
||||
@change="loadOrders"
|
||||
/>
|
||||
<a-select
|
||||
v-model:value="shopFilter"
|
||||
:allow-clear="currentUserType === 4"
|
||||
@@ -60,9 +60,9 @@
|
||||
<a-input-number v-model:value="minAmount" :min="0" placeholder="最低金额" style="width: 120px" />
|
||||
<a-input-number v-model:value="maxAmount" :min="0" placeholder="最高金额" style="width: 120px" />
|
||||
<a-button @click="resetFilters">重置筛选</a-button>
|
||||
</div>
|
||||
</AdminFilterPanel>
|
||||
|
||||
<a-table v-if="!isMobile" :columns="columns" :data-source="filteredOrders" :loading="loading" row-key="id">
|
||||
<a-table v-if="!isMobile" :columns="columns" :data-source="filteredOrders" :loading="loading" row-key="id" :scroll="{ x: 'max-content' }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag :color="statusColor(record.status)">{{ record.statusText }}</a-tag>
|
||||
@@ -206,6 +206,7 @@
|
||||
:data-source="currentOrder.items"
|
||||
row-key="id"
|
||||
:pagination="false"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'price'">¥{{ record.price.toFixed(2) }}</template>
|
||||
@@ -284,6 +285,7 @@ import { sameId } from '@/utils/id'
|
||||
import { runWithGlobalLoading } from '@/utils/action-loading'
|
||||
import { useAdminViewport } from '@/composables/useAdminViewport'
|
||||
import AdminMobileCardList from '@/components/admin/AdminMobileCardList.vue'
|
||||
import AdminFilterPanel from '@/components/admin/AdminFilterPanel.vue'
|
||||
import AdminResponsiveModal from '@/components/admin/AdminResponsiveModal.vue'
|
||||
|
||||
const { isMobile } = useAdminViewport()
|
||||
@@ -398,6 +400,18 @@ const statusOptions = [
|
||||
{ label: '已取消', value: '3' }
|
||||
]
|
||||
|
||||
const activeFilterCount = computed(() => [
|
||||
keyword.value,
|
||||
statusFilter.value === 'all' ? undefined : statusFilter.value,
|
||||
currentUserType.value === 4 ? shopFilter.value : undefined,
|
||||
artistKeyword.value,
|
||||
userKeyword.value,
|
||||
createRange.value?.length ? 'createDate' : '',
|
||||
appointmentRange.value?.length ? 'appointmentDate' : '',
|
||||
minAmount.value,
|
||||
maxAmount.value
|
||||
].filter(value => value !== undefined && value !== null && value !== '').length)
|
||||
|
||||
/** filteredOrders is a reactive state variable used by the template and event handlers. */
|
||||
const filteredOrders = computed(() => {
|
||||
const keywordValue = keyword.value.trim().toLowerCase()
|
||||
@@ -651,13 +665,6 @@ onMounted(async () => {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.admin-filter-bar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.order-action-alert {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user