diff --git a/.env.production b/.env.production index 5abfbd1..ce69b86 100644 --- a/.env.production +++ b/.env.production @@ -20,7 +20,7 @@ VITE_BASE_API_RETRY=5 VITE_BASE_API_RETRY_DELAY=3000 # 是否在打包时使用cdn替换本地库 替换 true 不替换 false -VITE_CDN=false +VITE_CDN=true # 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件) # 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) diff --git a/build/buildEnv.ts b/build/buildEnv.ts index 074a3c2..6b13a67 100644 --- a/build/buildEnv.ts +++ b/build/buildEnv.ts @@ -42,7 +42,7 @@ export const buildEnvironment = () => { manualChunks: id => { // 如果是包含在包中则打包成 vendor if (id.includes('node_modules')) { - return `vendor`; + return id.toString().split('node_modules/')[1].split('/')[1].toString(); } }, }, diff --git a/images/ReadMe/image-20241107133345299.png b/images/ReadMe/image-20241107133345299.png deleted file mode 100644 index c1b212d..0000000 Binary files a/images/ReadMe/image-20241107133345299.png and /dev/null differ diff --git a/src/api/v1/financial/bill.ts b/src/api/v1/financial/admin/bill.ts similarity index 100% rename from src/api/v1/financial/bill.ts rename to src/api/v1/financial/admin/bill.ts diff --git a/src/api/v1/financial/budgetCategory.ts b/src/api/v1/financial/admin/budgetCategory.ts similarity index 100% rename from src/api/v1/financial/budgetCategory.ts rename to src/api/v1/financial/admin/budgetCategory.ts diff --git a/src/api/v1/financial/category.ts b/src/api/v1/financial/admin/category.ts similarity index 100% rename from src/api/v1/financial/category.ts rename to src/api/v1/financial/admin/category.ts diff --git a/src/api/v1/financial/debtRepaymentPlan.ts b/src/api/v1/financial/admin/debtRepaymentPlan.ts similarity index 100% rename from src/api/v1/financial/debtRepaymentPlan.ts rename to src/api/v1/financial/admin/debtRepaymentPlan.ts diff --git a/src/api/v1/financial/debtTracking.ts b/src/api/v1/financial/admin/debtTracking.ts similarity index 100% rename from src/api/v1/financial/debtTracking.ts rename to src/api/v1/financial/admin/debtTracking.ts diff --git a/src/api/v1/financial/savingGoal.ts b/src/api/v1/financial/admin/savingGoal.ts similarity index 100% rename from src/api/v1/financial/savingGoal.ts rename to src/api/v1/financial/admin/savingGoal.ts diff --git a/src/api/v1/financialUser/billUser.ts b/src/api/v1/financial/user/billUser.ts similarity index 82% rename from src/api/v1/financialUser/billUser.ts rename to src/api/v1/financial/user/billUser.ts index 6b2b248..051950e 100644 --- a/src/api/v1/financialUser/billUser.ts +++ b/src/api/v1/financial/user/billUser.ts @@ -8,6 +8,11 @@ export const fetchGetUserBillList = (data: any) => { return http.request>('get', `bill/noManage/getUserBillList/${data.currentPage}/${data.pageSize}`, { params: data }); }; +/** 账单信息---账单收入和支出 */ +export const fetchGetExpendOrIncome = (data: any) => { + return http.request>('get', 'bill/noManage/getExpendOrIncome', { params: data }); +}; + /** 账单信息---添加账单信息 */ export const fetchAddUserBill = (data: any) => { return http.request>('post', 'bill/noManage/addUserBill', { data }); diff --git a/src/api/v1/financialUser/budgetCategoryUser.ts b/src/api/v1/financial/user/budgetCategoryUser.ts similarity index 100% rename from src/api/v1/financialUser/budgetCategoryUser.ts rename to src/api/v1/financial/user/budgetCategoryUser.ts diff --git a/src/api/v1/financialUser/categoryUser.ts b/src/api/v1/financial/user/categoryUser.ts similarity index 100% rename from src/api/v1/financialUser/categoryUser.ts rename to src/api/v1/financial/user/categoryUser.ts diff --git a/src/api/v1/financialUser/debtRepaymentPlanUser.ts b/src/api/v1/financial/user/debtRepaymentPlanUser.ts similarity index 100% rename from src/api/v1/financialUser/debtRepaymentPlanUser.ts rename to src/api/v1/financial/user/debtRepaymentPlanUser.ts diff --git a/src/api/v1/financialUser/debtTrackingUser.ts b/src/api/v1/financial/user/debtTrackingUser.ts similarity index 100% rename from src/api/v1/financialUser/debtTrackingUser.ts rename to src/api/v1/financial/user/debtTrackingUser.ts diff --git a/src/api/v1/financialUser/savingGoalUser.ts b/src/api/v1/financial/user/savingGoalUser.ts similarity index 100% rename from src/api/v1/financialUser/savingGoalUser.ts rename to src/api/v1/financial/user/savingGoalUser.ts diff --git a/src/components/Analyse/analyse-table.vue b/src/components/Analyse/analyse-table.vue new file mode 100644 index 0000000..3597865 --- /dev/null +++ b/src/components/Analyse/analyse-table.vue @@ -0,0 +1,166 @@ + + + + + + + diff --git a/src/components/Analyse/char-line.vue b/src/components/Analyse/char-line.vue new file mode 100644 index 0000000..6d4530b --- /dev/null +++ b/src/components/Analyse/char-line.vue @@ -0,0 +1,104 @@ + + + diff --git a/src/components/Analyse/char-pie.vue b/src/components/Analyse/char-pie.vue new file mode 100644 index 0000000..59f2bd4 --- /dev/null +++ b/src/components/Analyse/char-pie.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/components/Analyse/empty.svg b/src/components/Analyse/empty.svg new file mode 100644 index 0000000..5c8b211 --- /dev/null +++ b/src/components/Analyse/empty.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Analyse/index.vue b/src/components/Analyse/index.vue new file mode 100644 index 0000000..3459ee4 --- /dev/null +++ b/src/components/Analyse/index.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/src/components/Flicker/index.css b/src/components/Flicker/index.css new file mode 100644 index 0000000..4c40af4 --- /dev/null +++ b/src/components/Flicker/index.css @@ -0,0 +1,39 @@ +.point { + width: var(--point-width); + height: var(--point-height); + background: var(--point-background); + position: relative; + border-radius: var(--point-border-radius); +} + +.point-flicker:after { + background: var(--point-background); +} + +.point-flicker:before, +.point-flicker:after { + content: ""; + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + border-radius: var(--point-border-radius); + animation: flicker 1.2s ease-out infinite; +} + +@keyframes flicker { + 0% { + transform: scale(0.5); + opacity: 1; + } + + 30% { + opacity: 1; + } + + 100% { + transform: scale(var(--point-scale)); + opacity: 0; + } +} diff --git a/src/components/Flicker/index.ts b/src/components/Flicker/index.ts new file mode 100644 index 0000000..b829323 --- /dev/null +++ b/src/components/Flicker/index.ts @@ -0,0 +1,44 @@ +import "./index.css"; +import { type Component, h, defineComponent } from "vue"; + +export interface attrsType { + width?: string; + height?: string; + borderRadius?: number | string; + background?: string; + scale?: number | string; +} + +/** + * 圆点、方形闪烁动画组件 + * @param width 可选 string 宽 + * @param height 可选 string 高 + * @param borderRadius 可选 number | string 传0为方形、传50%或者不传为圆形 + * @param background 可选 string 闪烁颜色 + * @param scale 可选 number | string 闪烁范围,默认2,值越大闪烁范围越大 + * @returns Component + */ +export function useRenderFlicker(attrs?: attrsType): Component { + return defineComponent({ + name: "ReFlicker", + render() { + return h( + "div", + { + class: "point point-flicker", + style: { + "--point-width": attrs?.width ?? "12px", + "--point-height": attrs?.height ?? "12px", + "--point-background": + attrs?.background ?? "var(--el-color-primary)", + "--point-border-radius": attrs?.borderRadius ?? "50%", + "--point-scale": attrs?.scale ?? "2" + } + }, + { + default: () => [] + } + ); + } + }); +} diff --git a/src/enums/dateEnums.ts b/src/enums/dateEnums.ts new file mode 100644 index 0000000..f6621a0 --- /dev/null +++ b/src/enums/dateEnums.ts @@ -0,0 +1,6 @@ +import dayjs from 'dayjs'; + +export const currentWeek = [dayjs().startOf('week').add(1, 'day'), dayjs().endOf('week').add(1, 'day')]; +export const currentMouth = [dayjs().startOf('month'), dayjs().endOf('month').add(1, 'day')]; +export const currentYear = [dayjs().startOf('year'), dayjs().endOf('year')]; +export const days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; diff --git a/src/layout/components/lay-footer/index.vue b/src/layout/components/lay-footer/index.vue index 4359551..58586b4 100644 --- a/src/layout/components/lay-footer/index.vue +++ b/src/layout/components/lay-footer/index.vue @@ -8,8 +8,7 @@ const Copyright = getConfig('Copyright'); diff --git a/src/router/modules/financial.ts b/src/router/modules/financial.ts index eae139c..e257684 100644 --- a/src/router/modules/financial.ts +++ b/src/router/modules/financial.ts @@ -10,7 +10,7 @@ export default [ rank: 1, }, children: [ - // 账单查询 + // 账单概览 { path: '/financial-user/bill', name: 'BillUser', @@ -20,7 +20,28 @@ export default [ title: 'billManagement', }, }, - // 用户分类 + + // 支出分析 + { + path: '/financial-user/expend', + name: 'ExpendUser', + component: () => import('@/views/financial-user/account-bill/expend/index.vue'), + meta: { + icon: 'icon-park-outline:expenses', + title: 'expendAnalyse', + }, + }, + // 收入分析 + { + path: '/financial-user/income', + name: 'IncomeUser', + component: () => import('@/views/financial-user/account-bill/income/index.vue'), + meta: { + icon: 'icon-park-outline:income', + title: 'incomeAnalyse', + }, + }, + // 账单分类管理 { path: '/financial-user/category', name: 'CategoryUser', diff --git a/src/store/financial/bill.ts b/src/store/financial/bill.ts index c4eaaf5..8995ceb 100644 --- a/src/store/financial/bill.ts +++ b/src/store/financial/bill.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddBill, fetchDeleteBill, fetchGetBillList, fetchUpdateBill } from '@/api/v1/financial/bill'; +import { fetchAddBill, fetchDeleteBill, fetchGetBillList, fetchUpdateBill } from '@/api/v1/financial/admin/bill'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financial/budgetCategory.ts b/src/store/financial/budgetCategory.ts index b34b0fe..08361dc 100644 --- a/src/store/financial/budgetCategory.ts +++ b/src/store/financial/budgetCategory.ts @@ -1,5 +1,10 @@ import { defineStore } from 'pinia'; -import { fetchAddBudgetCategory, fetchDeleteBudgetCategory, fetchGetBudgetCategoryList, fetchUpdateBudgetCategory } from '@/api/v1/financial/budgetCategory'; +import { + fetchAddBudgetCategory, + fetchDeleteBudgetCategory, + fetchGetBudgetCategoryList, + fetchUpdateBudgetCategory, +} from '@/api/v1/financial/admin/budgetCategory'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financial/category.ts b/src/store/financial/category.ts index 0ae1ae8..d068162 100644 --- a/src/store/financial/category.ts +++ b/src/store/financial/category.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddCategory, fetchDeleteCategory, fetchGetCategoryAllList, fetchGetCategoryList, fetchUpdateCategory } from '@/api/v1/financial/category'; +import { fetchAddCategory, fetchDeleteCategory, fetchGetCategoryAllList, fetchGetCategoryList, fetchUpdateCategory } from '@/api/v1/financial/admin/category'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financial/debtRepaymentPlan.ts b/src/store/financial/debtRepaymentPlan.ts index 59b3356..5f4d5e4 100644 --- a/src/store/financial/debtRepaymentPlan.ts +++ b/src/store/financial/debtRepaymentPlan.ts @@ -4,7 +4,7 @@ import { fetchDeleteDebtRepaymentPlan, fetchGetDebtRepaymentPlanList, fetchUpdateDebtRepaymentPlan, -} from '@/api/v1/financial/debtRepaymentPlan'; +} from '@/api/v1/financial/admin/debtRepaymentPlan'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financial/debtTracking.ts b/src/store/financial/debtTracking.ts index 2f9a51b..d9ffaa2 100644 --- a/src/store/financial/debtTracking.ts +++ b/src/store/financial/debtTracking.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddDebtTracking, fetchDeleteDebtTracking, fetchGetDebtTrackingList, fetchUpdateDebtTracking } from '@/api/v1/financial/debtTracking'; +import { fetchAddDebtTracking, fetchDeleteDebtTracking, fetchGetDebtTrackingList, fetchUpdateDebtTracking } from '@/api/v1/financial/admin/debtTracking'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financial/savingGoal.ts b/src/store/financial/savingGoal.ts index 585501c..c07cffa 100644 --- a/src/store/financial/savingGoal.ts +++ b/src/store/financial/savingGoal.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddSavingGoal, fetchDeleteSavingGoal, fetchGetSavingGoalList, fetchUpdateSavingGoal } from '@/api/v1/financial/savingGoal'; +import { fetchAddSavingGoal, fetchDeleteSavingGoal, fetchGetSavingGoalList, fetchUpdateSavingGoal } from '@/api/v1/financial/admin/savingGoal'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financialUser/billUser.ts b/src/store/financialUser/billUser.ts index c244d6d..94135ad 100644 --- a/src/store/financialUser/billUser.ts +++ b/src/store/financialUser/billUser.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddUserBill, fetchDeleteUserBill, fetchGetUserBillList, fetchUpdateUserBill } from '@/api/v1/financialUser/billUser'; +import { fetchAddUserBill, fetchDeleteUserBill, fetchGetUserBillList, fetchUpdateUserBill } from '@/api/v1/financial/user/billUser'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; @@ -13,6 +13,8 @@ export const useBillUserStore = defineStore('billUserStore', { return { // 账单信息列表 datalist: [], + // 收入和支出 + expendWithIncomeList: [], // 查询表单 form: { // 类型:1 - 收入,-1 - 支出 diff --git a/src/store/financialUser/budgetCategoryUser.ts b/src/store/financialUser/budgetCategoryUser.ts index e1e2f2d..dc5dd01 100644 --- a/src/store/financialUser/budgetCategoryUser.ts +++ b/src/store/financialUser/budgetCategoryUser.ts @@ -7,7 +7,7 @@ import { fetchDeleteUserBudgetCategory, fetchGetUserBudgetCategoryList, fetchUpdateUserBudgetCategory, -} from '@/api/v1/financialUser/budgetCategoryUser'; +} from '@/api/v1/financial/user/budgetCategoryUser'; import { getDefaultDateRange } from '@/utils/date'; /** diff --git a/src/store/financialUser/categoryUser.ts b/src/store/financialUser/categoryUser.ts index 404b45d..d9c3255 100644 --- a/src/store/financialUser/categoryUser.ts +++ b/src/store/financialUser/categoryUser.ts @@ -5,7 +5,7 @@ import { fetchGetCategoryUserAllList, fetchGetCategoryUserList, fetchUpdateCategoryUser, -} from '@/api/v1/financialUser/categoryUser'; +} from '@/api/v1/financial/user/categoryUser'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; diff --git a/src/store/financialUser/debtRepaymentPlanUser.ts b/src/store/financialUser/debtRepaymentPlanUser.ts index f28635d..eaadcc7 100644 --- a/src/store/financialUser/debtRepaymentPlanUser.ts +++ b/src/store/financialUser/debtRepaymentPlanUser.ts @@ -7,7 +7,7 @@ import { fetchDeleteUserDebtRepaymentPlan, fetchGetUserDebtRepaymentPlanList, fetchUpdateUserDebtRepaymentPlan, -} from '@/api/v1/financialUser/debtRepaymentPlanUser'; +} from '@/api/v1/financial/user/debtRepaymentPlanUser'; /** * 债务还款计划表 Store diff --git a/src/store/financialUser/debtTrackingUser.ts b/src/store/financialUser/debtTrackingUser.ts index f5ca7cc..cdcad82 100644 --- a/src/store/financialUser/debtTrackingUser.ts +++ b/src/store/financialUser/debtTrackingUser.ts @@ -7,7 +7,7 @@ import { fetchDeleteUserDebtTracking, fetchGetUserDebtTrackingList, fetchUpdateUserDebtTracking, -} from '@/api/v1/financialUser/debtTrackingUser'; +} from '@/api/v1/financial/user/debtTrackingUser'; /** * 债务追踪 Store diff --git a/src/store/financialUser/savingGoalUser.ts b/src/store/financialUser/savingGoalUser.ts index cdf50fa..f231777 100644 --- a/src/store/financialUser/savingGoalUser.ts +++ b/src/store/financialUser/savingGoalUser.ts @@ -7,7 +7,7 @@ import { fetchDeleteUserSavingGoal, fetchGetUserSavingGoalList, fetchUpdateUserSavingGoal, -} from '@/api/v1/financialUser/savingGoalUser'; +} from '@/api/v1/financial/user/savingGoalUser'; import { getDefaultDateRange } from '@/utils/date'; /** diff --git a/src/views/configuration/emailTemplate/index.vue b/src/views/configuration/emailTemplate/index.vue index b022d56..12709dc 100644 --- a/src/views/configuration/emailTemplate/index.vue +++ b/src/views/configuration/emailTemplate/index.vue @@ -4,7 +4,7 @@ import { columns } from '@/views/configuration/emailTemplate/utils/columns'; import PureTableBar from '@/components/TableBar/src/bar'; import AddFill from '@iconify-icons/ri/add-circle-line'; import PureTable from '@pureadmin/table'; -import { onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows } from '@/views/configuration/emailTemplate/utils/hooks'; +import { onAdd, onDelete, onDeleteBatch, onSearch, onUpdate, selectRows, viewTemplate } from '@/views/configuration/emailTemplate/utils/hooks'; import Delete from '@iconify-icons/ep/delete'; import EditPen from '@iconify-icons/ep/edit-pen'; import Refresh from '@iconify-icons/ep/refresh'; @@ -14,6 +14,7 @@ import { useEmailTemplateStore } from '@/store/configuration/emailTemplate.ts'; import { useRenderIcon } from '@/components/CommonIcon/src/hooks'; import { auth } from '@/views/configuration/emailTemplate/utils/auth'; import { hasAuth } from '@/router/utils'; +import View from '@iconify-icons/ep/view'; const tableRef = ref(); const formRef = ref(); @@ -122,7 +123,12 @@ onMounted(() => {