|
@@ -38,11 +38,13 @@ const filters = reactive<{
|
|
|
recipientLabel: string | null
|
|
recipientLabel: string | null
|
|
|
senderAddress: string | null
|
|
senderAddress: string | null
|
|
|
recipientAddress: string | null
|
|
recipientAddress: string | null
|
|
|
|
|
+ timeRange: [number, number] | null
|
|
|
}>({
|
|
}>({
|
|
|
senderLabel: null,
|
|
senderLabel: null,
|
|
|
recipientLabel: null,
|
|
recipientLabel: null,
|
|
|
senderAddress: null,
|
|
senderAddress: null,
|
|
|
recipientAddress: null,
|
|
recipientAddress: null,
|
|
|
|
|
+ timeRange: null,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
function formatDash(v: unknown): string {
|
|
function formatDash(v: unknown): string {
|
|
@@ -276,12 +278,26 @@ async function load(): Promise<void> {
|
|
|
}
|
|
}
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
|
|
|
+ let startTime: string | null = null
|
|
|
|
|
+ let endTime: string | null = null
|
|
|
|
|
+ if (filters.timeRange?.[0] != null) {
|
|
|
|
|
+ const d = new Date(filters.timeRange[0])
|
|
|
|
|
+ const pad = (n: number) => String(n).padStart(2, '0')
|
|
|
|
|
+ startTime = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} 00:00:00`
|
|
|
|
|
+ }
|
|
|
|
|
+ if (filters.timeRange?.[1] != null) {
|
|
|
|
|
+ const d = new Date(filters.timeRange[1])
|
|
|
|
|
+ const pad = (n: number) => String(n).padStart(2, '0')
|
|
|
|
|
+ endTime = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} 23:59:59`
|
|
|
|
|
+ }
|
|
|
const res = await fetchVaultTransactions({
|
|
const res = await fetchVaultTransactions({
|
|
|
vaultId: vault.currentVaultId,
|
|
vaultId: vault.currentVaultId,
|
|
|
senderLabel: filters.senderLabel,
|
|
senderLabel: filters.senderLabel,
|
|
|
recipientLabel: filters.recipientLabel,
|
|
recipientLabel: filters.recipientLabel,
|
|
|
senderAddress: filters.senderAddress,
|
|
senderAddress: filters.senderAddress,
|
|
|
recipientAddress: filters.recipientAddress,
|
|
recipientAddress: filters.recipientAddress,
|
|
|
|
|
+ startTime,
|
|
|
|
|
+ endTime,
|
|
|
// senderIsVaultAddress: filters.senderIsVaultAddress,
|
|
// senderIsVaultAddress: filters.senderIsVaultAddress,
|
|
|
// recipientIsVaultAddress: filters.recipientIsVaultAddress,
|
|
// recipientIsVaultAddress: filters.recipientIsVaultAddress,
|
|
|
page: {
|
|
page: {
|
|
@@ -315,7 +331,7 @@ watch(
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
watch(
|
|
watch(
|
|
|
- () => [filters.senderLabel, filters.recipientLabel, filters.senderAddress, filters.recipientAddress],
|
|
|
|
|
|
|
+ () => [filters.senderLabel, filters.recipientLabel, filters.senderAddress, filters.recipientAddress, filters.timeRange],
|
|
|
() => {
|
|
() => {
|
|
|
pagination.page = 1
|
|
pagination.page = 1
|
|
|
void load()
|
|
void load()
|
|
@@ -340,12 +356,26 @@ async function onExport(): Promise<void> {
|
|
|
if (vault.currentVaultId == null) return
|
|
if (vault.currentVaultId == null) return
|
|
|
exporting.value = true
|
|
exporting.value = true
|
|
|
try {
|
|
try {
|
|
|
|
|
+ let startTime: string | null = null
|
|
|
|
|
+ let endTime: string | null = null
|
|
|
|
|
+ if (filters.timeRange?.[0] != null) {
|
|
|
|
|
+ const d = new Date(filters.timeRange[0])
|
|
|
|
|
+ const pad = (n: number) => String(n).padStart(2, '0')
|
|
|
|
|
+ startTime = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} 00:00:00`
|
|
|
|
|
+ }
|
|
|
|
|
+ if (filters.timeRange?.[1] != null) {
|
|
|
|
|
+ const d = new Date(filters.timeRange[1])
|
|
|
|
|
+ const pad = (n: number) => String(n).padStart(2, '0')
|
|
|
|
|
+ endTime = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} 23:59:59`
|
|
|
|
|
+ }
|
|
|
const res = await exportVaultTransactions({
|
|
const res = await exportVaultTransactions({
|
|
|
vaultId: vault.currentVaultId,
|
|
vaultId: vault.currentVaultId,
|
|
|
senderLabel: filters.senderLabel,
|
|
senderLabel: filters.senderLabel,
|
|
|
recipientLabel: filters.recipientLabel,
|
|
recipientLabel: filters.recipientLabel,
|
|
|
senderAddress: filters.senderAddress,
|
|
senderAddress: filters.senderAddress,
|
|
|
recipientAddress: filters.recipientAddress,
|
|
recipientAddress: filters.recipientAddress,
|
|
|
|
|
+ startTime,
|
|
|
|
|
+ endTime,
|
|
|
// senderIsVaultAddress: filters.senderIsVaultAddress,
|
|
// senderIsVaultAddress: filters.senderIsVaultAddress,
|
|
|
// recipientIsVaultAddress: filters.recipientIsVaultAddress,
|
|
// recipientIsVaultAddress: filters.recipientIsVaultAddress,
|
|
|
page: {
|
|
page: {
|
|
@@ -372,6 +402,7 @@ function onResetFilters(): void {
|
|
|
filters.recipientLabel = null
|
|
filters.recipientLabel = null
|
|
|
filters.senderAddress = null
|
|
filters.senderAddress = null
|
|
|
filters.recipientAddress = null
|
|
filters.recipientAddress = null
|
|
|
|
|
+ filters.timeRange = null
|
|
|
// filters.senderIsVaultAddress = null
|
|
// filters.senderIsVaultAddress = null
|
|
|
// filters.recipientIsVaultAddress = null
|
|
// filters.recipientIsVaultAddress = null
|
|
|
}
|
|
}
|
|
@@ -424,6 +455,14 @@ function onResetFilters(): void {
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 260px"
|
|
style="width: 260px"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <n-date-picker
|
|
|
|
|
+ v-model:value="filters.timeRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :start-placeholder="t('vaultTx.filterStartTime')"
|
|
|
|
|
+ :end-placeholder="t('vaultTx.filterEndTime')"
|
|
|
|
|
+ style="width: 420px"
|
|
|
|
|
+ />
|
|
|
<!-- <n-select-->
|
|
<!-- <n-select-->
|
|
|
<!-- v-model:value="filters.senderIsVaultAddress"-->
|
|
<!-- v-model:value="filters.senderIsVaultAddress"-->
|
|
|
<!-- :options="boolFilterOptions"-->
|
|
<!-- :options="boolFilterOptions"-->
|
|
@@ -440,7 +479,7 @@ function onResetFilters(): void {
|
|
|
<!-- />-->
|
|
<!-- />-->
|
|
|
<n-button tertiary @click="onResetFilters">{{ t('vaultTx.filterReset') }}</n-button>
|
|
<n-button tertiary @click="onResetFilters">{{ t('vaultTx.filterReset') }}</n-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <n-button type="primary" secondary :loading="exporting" @click="onExport">
|
|
|
|
|
|
|
+ <n-button class="vault-panel__export" type="primary" secondary :loading="exporting" @click="onExport">
|
|
|
{{ t('vaultTx.export') }}
|
|
{{ t('vaultTx.export') }}
|
|
|
</n-button>
|
|
</n-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -504,7 +543,7 @@ function onResetFilters(): void {
|
|
|
min-height: 0;
|
|
min-height: 0;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ overflow-y: scroll;
|
|
|
padding: 15px !important;
|
|
padding: 15px !important;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
}
|
|
}
|
|
@@ -597,7 +636,7 @@ function onResetFilters(): void {
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
gap: 10px;
|
|
gap: 10px;
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
|
|
+ //flex-wrap: wrap;
|
|
|
padding: 0 14px 10px;
|
|
padding: 0 14px 10px;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
}
|
|
}
|
|
@@ -609,6 +648,9 @@ function onResetFilters(): void {
|
|
|
gap: 10px;
|
|
gap: 10px;
|
|
|
min-width: 0;
|
|
min-width: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+.vault-panel__export{
|
|
|
|
|
+ align-self: flex-start;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
.vault-panel__table-frame {
|
|
.vault-panel__table-frame {
|
|
|
flex: 0 0 auto;
|
|
flex: 0 0 auto;
|