mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
improve order display
This commit is contained in:
@@ -98,6 +98,30 @@ const orderColumn: DataTableColumns<ResponsePointOrder2UserModel | ResponsePoint
|
|||||||
title: '订单号',
|
title: '订单号',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '用户',
|
||||||
|
key: 'user',
|
||||||
|
disabled: () => props.type == 'user',
|
||||||
|
render: (row: ResponsePointOrder2UserModel | ResponsePointOrder2OwnerModel) => {
|
||||||
|
return row.instanceOf == 'user'
|
||||||
|
? ''
|
||||||
|
: h(NTooltip, null, {
|
||||||
|
trigger: () =>
|
||||||
|
h(
|
||||||
|
NButton,
|
||||||
|
{
|
||||||
|
text: true,
|
||||||
|
type: 'primary',
|
||||||
|
tag: 'a',
|
||||||
|
href: 'https://space.bilibili.com/' + row.customer.userId + '',
|
||||||
|
target: '_blank',
|
||||||
|
},
|
||||||
|
{ default: () => row.customer.name },
|
||||||
|
),
|
||||||
|
default: () => row.customer.userId,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '礼物名',
|
title: '礼物名',
|
||||||
key: 'giftName',
|
key: 'giftName',
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import { objectsToCSV } from '@/Utils'
|
|||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
|
import { List } from 'linqts'
|
||||||
import { NButton, NCard, NCheckbox, NDivider, NEmpty, NFlex, NSelect, NSpin, useMessage } from 'naive-ui'
|
import { NButton, NCard, NCheckbox, NDivider, NEmpty, NFlex, NSelect, NSpin, useMessage } from 'naive-ui'
|
||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
|
|
||||||
type OrderFilterSettings = {
|
type OrderFilterSettings = {
|
||||||
type?: GoodsTypes
|
type?: GoodsTypes
|
||||||
status?: PointOrderStatus
|
status?: PointOrderStatus
|
||||||
|
customer?: number
|
||||||
onlyRequireShippingInfo: boolean
|
onlyRequireShippingInfo: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ const filteredOrders = computed(() => {
|
|||||||
if (filterSettings.value.type != undefined && o.type !== filterSettings.value.type) return false
|
if (filterSettings.value.type != undefined && o.type !== filterSettings.value.type) return false
|
||||||
if (filterSettings.value.status != undefined && o.status !== filterSettings.value.status) return false
|
if (filterSettings.value.status != undefined && o.status !== filterSettings.value.status) return false
|
||||||
if (filterSettings.value.onlyRequireShippingInfo && o.trackingNumber) return false
|
if (filterSettings.value.onlyRequireShippingInfo && o.trackingNumber) return false
|
||||||
|
if (filterSettings.value.customer && o.customer.userId != filterSettings.value.customer) return false
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -142,6 +145,19 @@ onMounted(async () => {
|
|||||||
clearable
|
clearable
|
||||||
style="width: 150px"
|
style="width: 150px"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<NSelect
|
||||||
|
v-model:value="filterSettings.customer"
|
||||||
|
:options="
|
||||||
|
new List(orders)
|
||||||
|
.DistinctBy((s) => s.customer.userId)
|
||||||
|
.Select((s) => ({ label: s.customer.name, value: s.customer.userId }))
|
||||||
|
.ToArray()
|
||||||
|
"
|
||||||
|
placeholder="用户"
|
||||||
|
clearable
|
||||||
|
style="width: 150px"
|
||||||
|
/>
|
||||||
<NCheckbox v-model:checked="filterSettings.onlyRequireShippingInfo" label="仅包含未填写快递单号的订单" />
|
<NCheckbox v-model:checked="filterSettings.onlyRequireShippingInfo" label="仅包含未填写快递单号的订单" />
|
||||||
</NFlex>
|
</NFlex>
|
||||||
</NCard>
|
</NCard>
|
||||||
|
|||||||
Reference in New Issue
Block a user