feat:重构模块

This commit is contained in:
2025-10-08 22:06:39 +08:00
parent f60d78fe8b
commit 2e81e57774
222 changed files with 2267 additions and 3059 deletions

View File

@@ -4,106 +4,106 @@ import {
IBillCategory,
IBillPay,
IBillQuery,
IBillRecord,
IBillRecord
} from '@/types/bill'
import { IStatsChart } from 'vue3-common/dist/types'
export const addBillRecordApi = (billRecord: IBillRecord): Promise<boolean> =>
cloudService({
url: '/home-service/bill',
url: '/home-api/bill',
method: 'post',
data: billRecord
})
export const updateBillRecordApi = (id: number, billRecord: IBillRecord): Promise<boolean> =>
cloudService({
url: `/home-service/bill/${id}`,
url: `/home-api/bill/${id}`,
method: 'put',
data: billRecord
})
export const deleteBillRecordApi = (id: number): Promise<boolean> =>
cloudService({
url: `/home-service/bill/${id}`,
url: `/home-api/bill/${id}`,
method: 'DELETE'
})
export const queryBillRecordApi = (id: number): Promise<IBillRecord> =>
cloudService({
url: `/home-service/bill/${id}`,
url: `/home-api/bill/${id}`,
method: 'get'
})
export const queryBillSummaryApi = (query: IBillQuery): Promise<IBillRecord[]> =>
cloudService({
url: '/home-service/bill/summary',
url: '/home-api/bill/summary',
method: 'get',
params: query
})
export const queryBillStatsApi = (type: string, query: IBillQuery): Promise<IStatsChart[]> =>
cloudService({
url: `/home-service/bill/stats/${type}`,
url: `/home-api/bill/stats/${type}`,
method: 'get',
params: query
})
export const queryBillPayApi = (): Promise<IBillPay[]> =>
cloudService({
url: '/home-service/bill/pay',
url: '/home-api/bill/pay',
method: 'get'
})
export const queryBillBookApi = (): Promise<IBillBook[]> =>
cloudService({
url: '/home-service/bill/book',
url: '/home-api/bill/book',
method: 'get'
})
export const queryBillCategoryApi = (): Promise<IBillCategory[]> =>
cloudService({
url: '/home-service/bill/category',
url: '/home-api/bill/category',
method: 'get'
})
export const addBillPayApi = (billPay: IBillPay): Promise<boolean> =>
cloudService({
url: '/home-service/bill-manage/pay',
url: '/home-api/bill-manage/pay',
method: 'post',
data: billPay
})
export const updateBillPayApi = (id: number, billPay: IBillPay): Promise<boolean> =>
cloudService({
url: `/home-service/bill-manage/pay/${id}`,
url: `/home-api/bill-manage/pay/${id}`,
method: 'put',
data: billPay
})
export const addBillBookApi = (billBook: IBillBook): Promise<boolean> =>
cloudService({
url: '/home-service/bill-manage/book',
url: '/home-api/bill-manage/book',
method: 'post',
data: billBook
})
export const updateBillBookApi = (id: number, billBook: IBillBook): Promise<boolean> =>
cloudService({
url: `/home-service/bill-manage/book/${id}`,
url: `/home-api/bill-manage/book/${id}`,
method: 'put',
data: billBook
})
export const addBillCategoryApi = (billCategory: IBillCategory): Promise<boolean> =>
cloudService({
url: '/home-service/bill-manage/category',
url: '/home-api/bill-manage/category',
method: 'post',
data: billCategory
})
export const updateBillCategoryApi = (id: number, billCategory: IBillCategory): Promise<boolean> =>
cloudService({
url: `/home-service/bill-manage/category/${id}`,
url: `/home-api/bill-manage/category/${id}`,
method: 'put',
data: billCategory
})