Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchentong committed Oct 29, 2024
1 parent e9b928b commit 5c02dbb
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default defineNuxtConfig({
},
echarts: {
charts: ['LineChart', 'BarChart'],
components: ['TitleComponent', 'DatasetComponent', 'ToolboxComponent', 'GridComponent', 'TooltipComponent'],
components: ['LegendComponent', 'TitleComponent', 'DatasetComponent', 'ToolboxComponent', 'GridComponent', 'TooltipComponent'],
},
eslint: {
config: {
Expand Down
6 changes: 3 additions & 3 deletions pages/dashboard/components/bank-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</template>

<script setup lang="ts">
const batches = inject('batches')
const batches = inject<string[]>('batches')!
let data = $ref<{
cardName: string
Expand All @@ -54,8 +54,8 @@ const columns = [{
}]
async function requestData() {
data = await $request('/api/report/bank-card', {
method: 'GET',
query: {
method: 'POST',
body: {
batches,
},
})
Expand Down
6 changes: 3 additions & 3 deletions pages/dashboard/components/counterparty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const columns = [
}]
async function requestData() {
data = await $fetch('/api/report/counterparty', {
method: 'get',
query: {
batches,
method: 'POST',
body: {
batches: batches,
},
})
console.log(data)
Expand Down
3 changes: 2 additions & 1 deletion pages/dashboard/components/hour.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ let option = $ref<ECOption>()
async function requestData() {
const data = await $fetch('/api/report/hour', {
query: {
method: 'POST',
body: {
batches,
},
})
Expand Down
3 changes: 2 additions & 1 deletion pages/dashboard/components/month.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ let option = $ref<ECOption>()
async function requestData() {
const data = await $fetch('/api/report/month', {
query: {
method: 'POST',
body: {
batches,
},
})
Expand Down
1 change: 1 addition & 0 deletions pages/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ definePageMeta({
props: true,
})
console.log(Array.isArray(batches) ? batches : [batches])
provide('batches', Array.isArray(batches) ? batches : [batches])
onMounted(async () => {
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Schema = z.object({
})

export default defineEventHandler(async (event) => {
const { batches } = await useSafeQuery(event, Schema)
const { batches } = await useSafeBody(event, Schema)

const result = await db.select({
method: TransactionSchema.transactionMethod,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Schema = z.object({
})

export default defineEventHandler(async (event) => {
const { batches } = await useSafeQuery(event, Schema)
const { batches } = await useSafeBody(event, Schema)

const result = await db.select({
counterparty: TransactionSchema.counterparty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Schema = z.object({
})

export default defineEventHandler(async (event) => {
const { batches } = await useSafeQuery(event, Schema)
const { batches } = await useSafeBody(event, Schema)

const result = await db.select({
channel: TransactionSchema.transactionChannel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Schema = z.object({
})

export default defineEventHandler(async (event) => {
const { batches } = await useSafeQuery(event, Schema)
const { batches } = await useSafeBody(event, Schema)

const result = await db.select({
channel: TransactionSchema.transactionChannel,
Expand Down

0 comments on commit 5c02dbb

Please sign in to comment.