diff --git a/Yi.Ai.Vue3/.eslintrc-auto-import.json b/Yi.Ai.Vue3/.eslintrc-auto-import.json index af1083b7..313e6711 100644 --- a/Yi.Ai.Vue3/.eslintrc-auto-import.json +++ b/Yi.Ai.Vue3/.eslintrc-auto-import.json @@ -5,6 +5,8 @@ "ComputedRef": true, "DirectiveBinding": true, "EffectScope": true, + "ElMessage": true, + "ElMessageBox": true, "ExtractDefaultPropTypes": true, "ExtractPropTypes": true, "ExtractPublicPropTypes": true, diff --git a/Yi.Ai.Vue3/package.json b/Yi.Ai.Vue3/package.json index 34e7d9a7..8591f58a 100644 --- a/Yi.Ai.Vue3/package.json +++ b/Yi.Ai.Vue3/package.json @@ -38,6 +38,7 @@ "@vueuse/core": "^13.5.0", "@vueuse/integrations": "^13.5.0", "driver.js": "^1.3.6", + "echarts": "^6.0.0", "element-plus": "^2.10.4", "fingerprintjs": "^0.5.3", "hook-fetch": "^2.0.4-beta.1", diff --git a/Yi.Ai.Vue3/pnpm-lock.yaml b/Yi.Ai.Vue3/pnpm-lock.yaml index 94c2661e..8d3ac5a4 100644 --- a/Yi.Ai.Vue3/pnpm-lock.yaml +++ b/Yi.Ai.Vue3/pnpm-lock.yaml @@ -35,6 +35,9 @@ importers: driver.js: specifier: ^1.3.6 version: 1.3.6 + echarts: + specifier: ^6.0.0 + version: 6.0.0 element-plus: specifier: ^2.10.4 version: 2.10.4(vue@3.5.17(typescript@5.8.3)) @@ -1919,6 +1922,9 @@ packages: duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} + echarts@6.0.0: + resolution: {integrity: sha512-Tte/grDQRiETQP4xz3iZWSvoHrkCQtwqd6hs+mifXcjrCuo2iKWbajFObuLJVBlDIJlOzgQPd1hsaKt/3+OMkQ==} + electron-to-chromium@1.5.165: resolution: {integrity: sha512-naiMx1Z6Nb2TxPU6fiFrUrDTjyPMLdTtaOd2oLmG8zVSg2hCWGkhPyxwk+qRmZ1ytwVqUv0u7ZcDA5+ALhaUtw==} @@ -4450,6 +4456,9 @@ packages: peerDependencies: typescript: '>=4.0.0' + tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -4853,6 +4862,9 @@ packages: resolution: {integrity: sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==} engines: {node: '>=12.20'} + zrender@6.0.0: + resolution: {integrity: sha512-41dFXEEXuJpNecuUQq6JlbybmnHaqqpGlbH1yxnA5V9MMP4SbohSVZsJIwz+zdjQXSSlR1Vc34EgH1zxyTDvhg==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -6789,6 +6801,11 @@ snapshots: duplexer@0.1.2: {} + echarts@6.0.0: + dependencies: + tslib: 2.3.0 + zrender: 6.0.0 + electron-to-chromium@1.5.165: {} element-plus@2.10.4(vue@3.5.17(typescript@5.8.3)): @@ -9819,6 +9836,8 @@ snapshots: picomatch: 4.0.2 typescript: 5.8.3 + tslib@2.3.0: {} + tslib@2.8.1: {} type-check@0.4.0: @@ -10359,4 +10378,8 @@ snapshots: yocto-queue@1.2.1: {} + zrender@6.0.0: + dependencies: + tslib: 2.3.0 + zwitch@2.0.4: {} diff --git a/Yi.Ai.Vue3/src/api/model/index.ts b/Yi.Ai.Vue3/src/api/model/index.ts index 8309f2a2..e6da3f77 100644 --- a/Yi.Ai.Vue3/src/api/model/index.ts +++ b/Yi.Ai.Vue3/src/api/model/index.ts @@ -19,3 +19,12 @@ export function getApiKey() { export function getRechargeLog() { return get('/recharge/account').json(); } + +// 查询用户近7天token消耗 +export function getLast7DaysTokenUsage() { + return get('/usage-statistics/last7Days-token-usage').json(); +} +// 查询用户token消耗各模型占比 +export function getModelTokenUsage() { + return get('/usage-statistics/model-token-usage').json(); +} diff --git a/Yi.Ai.Vue3/src/components/userPersonalCenter/NavDialog.vue b/Yi.Ai.Vue3/src/components/userPersonalCenter/NavDialog.vue index e32be9f8..99b8b485 100644 --- a/Yi.Ai.Vue3/src/components/userPersonalCenter/NavDialog.vue +++ b/Yi.Ai.Vue3/src/components/userPersonalCenter/NavDialog.vue @@ -17,7 +17,7 @@ interface Props { const props = withDefaults(defineProps(), { title: '弹窗标题', - width: '800px', + width: '1000px', defaultActive: '', }); @@ -55,6 +55,7 @@ function handleConfirm() {