From 1310234803d522defd874fc0eb5df808cacaca4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=A8=81?= Date: Tue, 3 Jan 2023 16:59:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=83=B6=E5=9B=8A?= =?UTF-8?q?=E6=9F=B1=E5=9B=BEmock=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E8=83=B6=E5=9B=8A=E4=B8=BB=E5=9B=BElabe=E4=B8=8D?= =?UTF-8?q?=E5=8F=98=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mock/test.mock.ts | 8 ++------ .../components/Charts/Bars/CapsuleChart/index.vue | 12 ++++-------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/api/mock/test.mock.ts b/src/api/mock/test.mock.ts index a58cac53..f84b8cc3 100644 --- a/src/api/mock/test.mock.ts +++ b/src/api/mock/test.mock.ts @@ -26,12 +26,8 @@ export default { msg: '请求成功', data: { dimensions: ['name', 'value'], - source: [ - { name: '厦门', 'value|0-40': 20 }, - { name: '南阳', 'value|20-60': 40 }, - { name: '北京', 'value|40-80': 60 }, - { name: '上海', 'value|60-100': 80 }, - { name: '新疆', value: 100 } + "source|2-5": [ + { 'name|+1': ["厦门","福州","北京","上海","新疆","郑州","湖南","内蒙古"], 'value|0-40': 20 }, ] } }, diff --git a/src/packages/components/Charts/Bars/CapsuleChart/index.vue b/src/packages/components/Charts/Bars/CapsuleChart/index.vue index 135ef1d0..804ae0dc 100644 --- a/src/packages/components/Charts/Bars/CapsuleChart/index.vue +++ b/src/packages/components/Charts/Bars/CapsuleChart/index.vue @@ -112,16 +112,12 @@ watch( ) const calcData = (data: any, type?: string) => { - mergeConfig(props.chartConfig.option) + let cloneConfig = cloneDeep(props.chartConfig.option || {}) + state.mergedConfig = cloneConfig if (type == 'preview') { - calcCapsuleLengthAndLabelData(data) - } else { - calcCapsuleLengthAndLabelData(state.mergedConfig.dataset) + cloneConfig.dataset = data } -} - -const mergeConfig = (data: any) => { - state.mergedConfig = cloneDeep(data || {}) + calcCapsuleLengthAndLabelData(state.mergedConfig.dataset) } // 数据解析 From 7b262c9db28ffc2130b08e53ec0b10beba1a4bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sun, 8 Jan 2023 19:10:41 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=20i18n=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=92=8C=20props=20=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 ++--- src/components/GoLangSelect/index.vue | 3 +++ src/i18n/index.ts | 2 ++ src/store/modules/langStore/langStore.ts | 3 --- .../components/ProjectItemsCard/index.vue | 1 + .../ProjectItemsList/hooks/useModal.hook.ts | 5 ++-- .../components/ProjectItemsList/index.vue | 5 ++-- .../ProjectItemsModalCard/index.vue | 26 +++++++++++++++---- .../components/CreateModal/index.vue | 18 ++++++------- 9 files changed, 43 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 76306284..046ab291 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,13 @@ "html2canvas": "^1.4.1", "keymaster": "^1.6.2", "monaco-editor": "^0.33.0", - "naive-ui": "2.33.4", + "naive-ui": "2.34.3", "pinia": "^2.0.13", "screenfull": "^6.0.1", "three": "^0.145.0", "vue": "^3.2.31", "vue-demi": "^0.13.1", - "vue-i18n": "9.1.9", + "vue-i18n": "^9.2.2", "vue-router": "4.0.12", "vue3-lazyload": "^0.2.5-beta", "vue3-sketch-ruler": "^1.3.3", @@ -82,4 +82,4 @@ "vue-echarts": "^6.0.2", "vue-tsc": "^0.28.10" } -} \ No newline at end of file +} diff --git a/src/components/GoLangSelect/index.vue b/src/components/GoLangSelect/index.vue index 7989276a..0cf4a883 100644 --- a/src/components/GoLangSelect/index.vue +++ b/src/components/GoLangSelect/index.vue @@ -14,16 +14,19 @@ diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 06576c37..b6d851c0 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -23,6 +23,8 @@ export const langList = [ ] const i18n = createI18n({ + legacy: false, + globalInjection:true, locale: langStorage?.lang || lang, fallbackLocale: langStorage?.lang || lang, messages: { diff --git a/src/store/modules/langStore/langStore.ts b/src/store/modules/langStore/langStore.ts index d1795e6c..2b7d2709 100644 --- a/src/store/modules/langStore/langStore.ts +++ b/src/store/modules/langStore/langStore.ts @@ -2,7 +2,6 @@ import { defineStore } from 'pinia' import { lang } from '@/settings/designSetting' import { LangStateType } from './langStore.d' import { LangEnum } from '@/enums/styleEnum' -import i18n from '@/i18n/index' import { setLocalStorage, getLocalStorage, reloadRoutePage } from '@/utils' import { StorageEnum } from '@/enums/storageEnum' import { useSettingStore } from '@/store/modules/settingStore/settingStore' @@ -25,10 +24,8 @@ export const useLangStore = defineStore({ actions: { changeLang(lang: LangEnum): void { const settingStore = useSettingStore() - if (this.lang === lang) return this.lang = lang - i18n.global.locale = lang setLocalStorage(GO_LANG_STORE, this.$state) if (settingStore.getChangeLangReload) { diff --git a/src/views/project/items/components/ProjectItemsCard/index.vue b/src/views/project/items/components/ProjectItemsCard/index.vue index b042d229..63ec3c91 100644 --- a/src/views/project/items/components/ProjectItemsCard/index.vue +++ b/src/views/project/items/components/ProjectItemsCard/index.vue @@ -89,6 +89,7 @@ import { renderIcon, renderLang, requireErrorImg } from '@/utils' import { icon } from '@/plugins' import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn' import { Chartype } from '../../index.d' +import { log } from 'console' const { EllipsisHorizontalCircleSharpIcon, CopyIcon, diff --git a/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts b/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts index 89894b03..16434efd 100644 --- a/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts +++ b/src/views/project/items/components/ProjectItemsList/hooks/useModal.hook.ts @@ -1,7 +1,8 @@ -import { ref, Ref } from 'vue' +import { ref } from 'vue' import { ChartEnum } from '@/enums/pageEnum' import { fetchPathByName, routerTurnByPath } from '@/utils' -import { Chartype } from '../../..' +import { Chartype } from '../../../index.d' + export const useModalDataInit = () => { const modalShow = ref(false) const modalData = ref(null) diff --git a/src/views/project/items/components/ProjectItemsList/index.vue b/src/views/project/items/components/ProjectItemsList/index.vue index dc4f9206..80d0c2ff 100644 --- a/src/views/project/items/components/ProjectItemsList/index.vue +++ b/src/views/project/items/components/ProjectItemsList/index.vue @@ -25,7 +25,7 @@