From 6dbe599eda7f2ff8ccf1f6d3660a02cf457e90e2 Mon Sep 17 00:00:00 2001 From: hwj Date: Wed, 22 Apr 2026 14:39:14 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E9=A6=96=E9=A1=B5-=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=A8=A1=E5=9D=97=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 7 + pnpm-lock.yaml | 215 +++++------------- src/components/dashboard/DeviceSection.vue | 58 ++--- .../qiun-data-charts/qiun-data-charts.vue | 4 +- src/config.js | 4 +- src/locales/index.js | 11 +- vite.config.js | 2 +- 7 files changed, 111 insertions(+), 190 deletions(-) diff --git a/package.json b/package.json index e207eec..e0f7373 100644 --- a/package.json +++ b/package.json @@ -84,5 +84,12 @@ "typescript": "^4.9.5", "vite": "5.2.8", "vue-tsc": "^1.8.8" + }, + "pnpm": { + "overrides": { + "@intlify/core-base": "9.10.2", + "@intlify/message-compiler": "9.10.2", + "@intlify/shared": "9.10.2" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c52576d..f7476de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + '@intlify/core-base': 9.10.2 + '@intlify/message-compiler': 9.10.2 + '@intlify/shared': 9.10.2 + importers: .: @@ -494,12 +499,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.23.3': - resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.24.7': resolution: {integrity: sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==} engines: {node: '>=6.9.0'} @@ -1119,22 +1118,10 @@ packages: '@floating-ui/utils@0.2.4': resolution: {integrity: sha512-dWO2pw8hhi+WrXq1YJy2yCuWoL20PddgGaqTgVe4cOS9Q6qklXCiA1tJEqX6BEwRNSCP84/afac9hd4MS+zEUA==} - '@intlify/core-base@9.1.9': - resolution: {integrity: sha512-x5T0p/Ja0S8hs5xs+ImKyYckVkL4CzcEXykVYYV6rcbXxJTe2o58IquSqX9bdncVKbRZP7GlBU1EcRaQEEJ+vw==} - engines: {node: '>= 10'} - '@intlify/core-base@9.10.2': resolution: {integrity: sha512-HGStVnKobsJL0DoYIyRCGXBH63DMQqEZxDUGrkNI05FuTcruYUtOAxyL3zoAZu/uDGO6mcUvm3VXBaHG2GdZCg==} engines: {node: '>= 16'} - '@intlify/devtools-if@9.1.9': - resolution: {integrity: sha512-oKSMKjttG3Ut/1UGEZjSdghuP3fwA15zpDPcjkf/1FjlOIm6uIBGMNS5jXzsZy593u+P/YcnrZD6cD3IVFz9vQ==} - engines: {node: '>= 10'} - - '@intlify/message-compiler@9.1.9': - resolution: {integrity: sha512-6YgCMF46Xd0IH2hMRLCssZI3gFG4aywidoWQ3QP4RGYQXQYYfFC54DxhSgfIPpVoPLQ+4AD29eoYmhiHZ+qLFQ==} - engines: {node: '>= 10'} - '@intlify/message-compiler@9.10.2': resolution: {integrity: sha512-ntY/kfBwQRtX5Zh6wL8cSATujPzWW2ZQd1QwKyWwAy5fMqJyyixHMeovN4fmEyCqSu+hFfYOE63nU94evsy4YA==} engines: {node: '>= 16'} @@ -1147,10 +1134,6 @@ packages: resolution: {integrity: sha512-XgPw8+UlHCiie3fI41HPVa/VDJb3/aSH7bLhY1hJvlvNV713PFtb4p4Jo+rlE0gAoMsMCGcsiT982fImolSltg==} engines: {node: '>= 10'} - '@intlify/shared@9.1.9': - resolution: {integrity: sha512-xKGM1d0EAxdDFCWedcYXOm6V5Pfw/TMudd6/qCdEb4tv0hk9EKeg7lwQF1azE0dP2phvx0yXxrt7UQK+IZjNdw==} - engines: {node: '>= 10'} - '@intlify/shared@9.10.2': resolution: {integrity: sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==} engines: {node: '>= 16'} @@ -1794,6 +1777,7 @@ packages: acorn-import-assertions@1.9.0: resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} + deprecated: package has been renamed to acorn-import-attributes peerDependencies: acorn: ^8 @@ -3653,10 +3637,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -4564,24 +4544,14 @@ snapshots: dependencies: '@babel/core': 7.24.8 - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.0 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.0)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.8)': dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.8)': @@ -4624,11 +4594,6 @@ snapshots: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 @@ -4639,61 +4604,31 @@ snapshots: '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 @@ -4704,24 +4639,19 @@ snapshots: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.0)': - dependencies: - '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.8)': dependencies: '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.24.0)': + '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.0)': dependencies: '@babel/core': 7.24.0 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.0)': + '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.8)': dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 '@babel/helper-plugin-utils': 7.24.8 '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.24.8)': @@ -5355,8 +5285,8 @@ snapshots: '@babel/types': 7.24.0 '@dcloudio/uni-i18n': 3.0.0-4020320240708001 '@dcloudio/uni-shared': 3.0.0-4020320240708001 - '@intlify/core-base': 9.1.9 - '@intlify/shared': 9.1.9 + '@intlify/core-base': 9.10.2 + '@intlify/shared': 9.10.2 '@intlify/vue-devtools': 9.1.9 '@rollup/pluginutils': 5.1.0(rollup@4.18.1) '@vue/compiler-core': 3.4.21 @@ -5883,44 +5813,23 @@ snapshots: '@floating-ui/utils@0.2.4': {} - '@intlify/core-base@9.1.9': - dependencies: - '@intlify/devtools-if': 9.1.9 - '@intlify/message-compiler': 9.1.9 - '@intlify/message-resolver': 9.1.9 - '@intlify/runtime': 9.1.9 - '@intlify/shared': 9.1.9 - '@intlify/vue-devtools': 9.1.9 - '@intlify/core-base@9.10.2': dependencies: '@intlify/message-compiler': 9.10.2 '@intlify/shared': 9.10.2 - '@intlify/devtools-if@9.1.9': - dependencies: - '@intlify/shared': 9.1.9 - - '@intlify/message-compiler@9.1.9': - dependencies: - '@intlify/message-resolver': 9.1.9 - '@intlify/shared': 9.1.9 - source-map: 0.6.1 - '@intlify/message-compiler@9.10.2': dependencies: '@intlify/shared': 9.10.2 - source-map-js: 1.0.2 + source-map-js: 1.2.0 '@intlify/message-resolver@9.1.9': {} '@intlify/runtime@9.1.9': dependencies: - '@intlify/message-compiler': 9.1.9 + '@intlify/message-compiler': 9.10.2 '@intlify/message-resolver': 9.1.9 - '@intlify/shared': 9.1.9 - - '@intlify/shared@9.1.9': {} + '@intlify/shared': 9.10.2 '@intlify/shared@9.10.2': {} @@ -5928,7 +5837,7 @@ snapshots: dependencies: '@intlify/message-resolver': 9.1.9 '@intlify/runtime': 9.1.9 - '@intlify/shared': 9.1.9 + '@intlify/shared': 9.10.2 '@istanbuljs/load-nyc-config@1.1.0': dependencies: @@ -6062,7 +5971,7 @@ snapshots: '@jest/transform@27.5.1': dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 '@jest/types': 27.5.1 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -6467,24 +6376,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.8 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.5 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.8 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.8 '@types/babel__traverse@7.20.5': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.8 '@types/eslint-scope@3.7.7': dependencies: @@ -6911,14 +6820,14 @@ snapshots: postcss: 8.4.38 postcss-value-parser: 4.2.0 - babel-jest@27.5.1(@babel/core@7.24.0): + babel-jest@27.5.1(@babel/core@7.24.8): dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 27.5.1(@babel/core@7.24.0) + babel-preset-jest: 27.5.1(@babel/core@7.24.8) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -6927,7 +6836,7 @@ snapshots: babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.24.8 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -6937,8 +6846,8 @@ snapshots: babel-plugin-jest-hoist@27.5.1: dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.0 + '@babel/template': 7.24.7 + '@babel/types': 7.24.8 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.5 @@ -6966,27 +6875,27 @@ snapshots: transitivePeerDependencies: - supports-color - babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.0): + babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.8): dependencies: - '@babel/core': 7.24.0 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.0) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.0) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.0) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.0) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.0) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.0) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.0) + '@babel/core': 7.24.8 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.8) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.8) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.8) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.8) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.8) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.8) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.8) - babel-preset-jest@27.5.1(@babel/core@7.24.0): + babel-preset-jest@27.5.1(@babel/core@7.24.8): dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 babel-plugin-jest-hoist: 27.5.1 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.0) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.8) balanced-match@1.0.2: {} @@ -7829,8 +7738,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.24.0 - '@babel/parser': 7.24.4 + '@babel/core': 7.24.8 + '@babel/parser': 7.24.8 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -7909,10 +7818,10 @@ snapshots: jest-config@27.5.1: dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.8 '@jest/test-sequencer': 27.5.1 '@jest/types': 27.5.1 - babel-jest: 27.5.1(@babel/core@7.24.0) + babel-jest: 27.5.1(@babel/core@7.24.8) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -8037,7 +7946,7 @@ snapshots: jest-message-util@27.5.1: dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.7 '@jest/types': 27.5.1 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -8142,16 +8051,16 @@ snapshots: jest-snapshot@27.5.1: dependencies: - '@babel/core': 7.24.0 - '@babel/generator': 7.23.6 - '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.24.0) - '@babel/traverse': 7.24.0 - '@babel/types': 7.24.0 + '@babel/core': 7.24.8 + '@babel/generator': 7.24.8 + '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.8) + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.8 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__traverse': 7.20.5 '@types/prettier': 2.7.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.0) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.8) chalk: 4.1.2 expect: 27.5.1 graceful-fs: 4.2.11 @@ -8586,7 +8495,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -8994,8 +8903,6 @@ snapshots: slash@3.0.0: {} - source-map-js@1.0.2: {} - source-map-js@1.2.0: {} source-map-support@0.5.21: @@ -9375,7 +9282,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.11.3 acorn-import-assertions: 1.9.0(acorn@8.11.3) - browserslist: 4.23.0 + browserslist: 4.23.2 chrome-trace-event: 1.0.3 enhanced-resolve: 5.16.0 es-module-lexer: 1.4.1 diff --git a/src/components/dashboard/DeviceSection.vue b/src/components/dashboard/DeviceSection.vue index a40d0e0..0c53458 100644 --- a/src/components/dashboard/DeviceSection.vue +++ b/src/components/dashboard/DeviceSection.vue @@ -69,7 +69,7 @@ - {{ t('deviceOverview.utilizationRanking') }} + {{ rankingTitle }} @@ -81,7 +81,7 @@ - {{ t('deviceOverview.deviceRateTrend') }} + {{ deviceTrendTitle }} {{ selectedDeviceName || t('deviceOverview.selectDevice') }} @@ -90,7 +90,7 @@ - + {{ t('deviceOverview.selectDeviceHint') }} @@ -147,6 +147,16 @@ const currentPeriodLabel = computed(() => { return periodLabelMap.value[currentPeriod.value] || t('deviceOverview.periodLast7Days') }) +const rankingTitle = computed(() => { + const period = currentPeriodLabel.value + return t('deviceOverview.utilizationRanking').replace('近7日', period) +}) + +const deviceTrendTitle = computed(() => { + const period = currentPeriodLabel.value + return t('deviceOverview.deviceRateTrend').replace('近7日', period) +}) + const rateChartOpts = { color: ['#1a3a5c', '#18bc37'], dataLabel: false, @@ -169,8 +179,13 @@ const rankingChartOpts = { color: ['#1a3a5c'], dataLabel: true, legend: { show: false }, - xAxis: { disableGrid: true, max: 100 }, - yAxis: { disableGrid: true }, + xAxis: { disableGrid: true, max: 100, axisLabel: { padding: [0, 0, 0, 10] } }, + yAxis: { disableGrid: true, axisLabel: { padding: [0, 10, 0, 0], formatter: function(value) { + if (value.length > 10) { + return value.substring(0, 10) + '...'; + } + return value; + } } }, extra: { bar: { type: 'group', @@ -219,23 +234,12 @@ const deviceIndex = computed(() => { const deviceTrendChartOpts = { color: ['#1a3a5c', '#18bc37'], - dataLabel: true, + dataLabel: false, + dataPointShape: false, legend: { show: true, position: 'bottom' }, - xAxis: { disableGrid: true, max: 100 }, - yAxis: { disableGrid: true }, - extra: { - bar: { - type: 'group', - width: 20, - seriesGap: 4, - categoryGap: 4, - barBorderRadius: [4, 4, 0, 0], - linearType: 'custom', - linearOpacity: 0.6, - activeBgColor: '#1a3a5c', - activeBgOpacity: 0.08 - } - } + xAxis: { disableGrid: true, labelCount: 5 }, + yAxis: { gridType: 'dash', dashLength: 2, data: [{ min: 0, max: 100 }] }, + extra: { line: { type: 'straight', width: 1, activeType: 'hollow' } } } const deviceTrendChartData = reactive({ @@ -284,12 +288,7 @@ async function loadRateTrend() { } async function loadUtilizationRanking() { - const now = new Date() - const pad2 = (n) => String(n).padStart(2, '0') - const endTime = `${now.getFullYear()}-${pad2(now.getMonth() + 1)}-${pad2(now.getDate())} 23:59:59` - const start = new Date(now.getTime() - 6 * 24 * 60 * 60 * 1000) - const startTime = `${start.getFullYear()}-${pad2(start.getMonth() + 1)}-${pad2(start.getDate())} 00:00:00` - const params = { startTime, endTime } + const params = { period: currentPeriod.value } const res = await request({ url: '/admin-api/iot/device-operation-record/deviceOperationPageList', method: 'get', params, showLoading: !isInitialLoad.value }) const list = res?.data || [] const sorted = [...list].sort((a, b) => { @@ -331,10 +330,11 @@ async function loadDeviceList() { async function loadDeviceRateTrend() { if (!selectedDeviceId.value) return + const params = { deviceId: selectedDeviceId.value, period: currentPeriod.value } const res = await request({ url: '/admin-api/iot/device-operation-record/deviceRateTrendByDeviceId', method: 'get', - params: { deviceId: selectedDeviceId.value }, + params, showLoading: !isInitialLoad.value }) const list = res?.data || [] @@ -369,6 +369,8 @@ function onPeriodChange(e) { if (!val) return currentPeriod.value = val loadRateTrend() + loadUtilizationRanking() + loadDeviceRateTrend() } function onSwitchChange() { diff --git a/src/components/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue b/src/components/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue index 5678f7d..ff22817 100644 --- a/src/components/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue +++ b/src/components/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue @@ -869,7 +869,9 @@ export default { const ctx = cfu.option[cid].context; if(typeof ctx === "object" && !!!cfu.option[cid].update){ ctx.clearRect(0, 0, this.cWidth*this.pixel, this.cHeight*this.pixel); - ctx.draw(); + if(typeof ctx.draw === 'function'){ + ctx.draw(); + } } } }, diff --git a/src/config.js b/src/config.js index 92ad00f..e6a94fa 100644 --- a/src/config.js +++ b/src/config.js @@ -2,8 +2,8 @@ const config = { // baseUrl: 'http://47.106.185.127:48080',127.0.0.1 // baseUrl: 'https://besure.ngsk.tech:7001', - // baseUrl: 'http://192.168.5.167:48081', - baseUrl: '', + baseUrl: 'http://192.168.5.167:48081', + // baseUrl: '', // 应用信息 appInfo: { // 应用名称 diff --git a/src/locales/index.js b/src/locales/index.js index e88d680..0c91794 100644 --- a/src/locales/index.js +++ b/src/locales/index.js @@ -82,10 +82,13 @@ function applyTabBarLanguage() { i18n.global.t('tab.mine') ] labels.forEach((text, index) => { - uni.setTabBarItem({ - index, - text - }) + try { + uni.setTabBarItem({ + index, + text + }) + } catch (e) { + } }) } diff --git a/vite.config.js b/vite.config.js index 2723f4f..3f853d4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,7 +9,7 @@ export default defineConfig(() => { outDir: 'dist', }, server: { - port: 9000 + port: 5173 }, plugins: [ uni()