(key: T, value: K): void {
+ this.$patch(state => {
+ state[key] = value
+ })
}
}
})
diff --git a/src/views/chart/ContentLoad/index.ts b/src/views/chart/ContentLoad/index.ts
new file mode 100644
index 00000000..7e41ed39
--- /dev/null
+++ b/src/views/chart/ContentLoad/index.ts
@@ -0,0 +1,3 @@
+import ContentLoad from './index.vue'
+
+export { ContentLoad }
diff --git a/src/views/chart/ContentLoad/index.vue b/src/views/chart/ContentLoad/index.vue
new file mode 100644
index 00000000..6b7905a5
--- /dev/null
+++ b/src/views/chart/ContentLoad/index.vue
@@ -0,0 +1,33 @@
+
+
+
+ 拼命加载中...
+
+
+
+
+
+
diff --git a/src/views/chart/hooks/useSync.hook.ts b/src/views/chart/hooks/useSync.hook.ts
index 3d551f00..ac006245 100644
--- a/src/views/chart/hooks/useSync.hook.ts
+++ b/src/views/chart/hooks/useSync.hook.ts
@@ -2,6 +2,8 @@ import { getUUID } from '@/utils'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { ChartEditStoreEnum, ChartEditStorage } from '@/store/modules/chartEditStore/chartEditStore.d'
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
+import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
+import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
import { fetchChartComponent, fetchConfigComponent, createComponent } from '@/packages/index'
import { BaseEvent, EventLife, CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
import { PublicGroupConfigClass } from '@/packages/public/publicConfig'
@@ -85,7 +87,7 @@ const componentMerge = (newObject: any, sources: any, notComponent = false) => {
export const useSync = () => {
const chartEditStore = useChartEditStore()
const chartHistoryStore = useChartHistoryStore()
-
+ const chartLayoutStore = useChartLayoutStore()
/**
* * 组件动态注册
* @param projectData 项目数据
@@ -151,7 +153,14 @@ export const useSync = () => {
for (const key in projectData) {
// 组件
if (key === ChartEditStoreEnum.COMPONENT_LIST) {
+ let loadIndex = 0
+ const listLength = projectData[key].length;
+ console.log(listLength)
for (const comItem of projectData[key]) {
+ // 设置加载数量
+ let percentage = parseInt((parseFloat(`${++loadIndex / listLength}`) * 100).toString())
+ chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.PERCENTAGE, percentage)
+ // 判断类型
if (comItem.isGroup) {
// 创建分组
let groupClass = new PublicGroupConfigClass()
@@ -182,6 +191,9 @@ export const useSync = () => {
componentMerge(chartEditStore[key], projectData[key], true)
}
}
+
+ // 清除数量
+ chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.PERCENTAGE, 0)
}
return {
diff --git a/src/views/chart/index.vue b/src/views/chart/index.vue
index 46cbfe3e..89c60d95 100644
--- a/src/views/chart/index.vue
+++ b/src/views/chart/index.vue
@@ -32,6 +32,8 @@
:on-clickoutside="onClickOutSide"
@select="handleMenuSelect"
>
+
+
From 734c428a6b9eaa9f2f1498acf0f6c9f4812bb9c6 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: Sat, 31 Dec 2022 20:33:21 +0800
Subject: [PATCH 12/21] =?UTF-8?q?style:=20=E6=A0=BC=E5=BC=8F=E5=8C=96?=
=?UTF-8?q?=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Charts/Bars/CapsuleChart/index.vue | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/packages/components/Charts/Bars/CapsuleChart/index.vue b/src/packages/components/Charts/Bars/CapsuleChart/index.vue
index c5101c21..135ef1d0 100644
--- a/src/packages/components/Charts/Bars/CapsuleChart/index.vue
+++ b/src/packages/components/Charts/Bars/CapsuleChart/index.vue
@@ -111,14 +111,13 @@ watch(
}
)
-const calcData = (data: any,type?:string) => {
+const calcData = (data: any, type?: string) => {
mergeConfig(props.chartConfig.option)
- if(type=="preview"){
+ if (type == 'preview') {
calcCapsuleLengthAndLabelData(data)
- }else{
+ } else {
calcCapsuleLengthAndLabelData(state.mergedConfig.dataset)
}
-
}
const mergeConfig = (data: any) => {
@@ -126,7 +125,7 @@ const mergeConfig = (data: any) => {
}
// 数据解析
-const calcCapsuleLengthAndLabelData = (dataset:any) => {
+const calcCapsuleLengthAndLabelData = (dataset: any) => {
const { source } = dataset
if (!source.length) return
@@ -156,7 +155,7 @@ onMounted(() => {
// 预览
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
- calcData(newData,"preview")
+ calcData(newData, 'preview')
})
From c1af34e1e970fc19e1bc5420d175c89a52546aac 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: Sat, 31 Dec 2022 20:50:08 +0800
Subject: [PATCH 13/21] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E5=88=9B?=
=?UTF-8?q?=E5=BB=BA=E5=88=86=E7=BB=84=E5=90=8E=EF=BC=8C=E9=A2=84=E8=A7=88?=
=?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/preview/components/PreviewRenderList/index.vue | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/views/preview/components/PreviewRenderList/index.vue b/src/views/preview/components/PreviewRenderList/index.vue
index 8ed703d1..ee5ea39c 100644
--- a/src/views/preview/components/PreviewRenderList/index.vue
+++ b/src/views/preview/components/PreviewRenderList/index.vue
@@ -2,7 +2,7 @@
.chart-item {
position: absolute;
- overflow: hidden;
+ &.hidden {
+ overflow: hidden;
+ }
}
From e8748c26205c444fb40a4102bbc492be028ca682 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 14/21] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=83=B6?=
=?UTF-8?q?=E5=9B=8A=E6=9F=B1=E5=9B=BEmock=E6=95=B0=E6=8D=AE=EF=BC=8C?=
=?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=83=B6=E5=9B=8A=E4=B8=BB=E5=9B=BElabe?=
=?UTF-8?q?=E4=B8=8D=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 ef5d861a962b4f93379e3097c17df34176152dd4 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 15/21] =?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 @@