mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
Merge branch 'dev' into master-fetch-dev
This commit is contained in:
@@ -6,6 +6,8 @@ import { EditCanvasTypeEnum, ChartEditStoreEnum, ProjectInfoEnum, ChartEditStora
|
||||
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
|
||||
import { StylesSetting } from '@/components/Pages/ChartItemSetting'
|
||||
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
|
||||
import { useChartLayoutStore } from '@/store/modules/chartLayoutStore/chartLayoutStore'
|
||||
import { ChartLayoutStoreEnum } from '@/store/modules/chartLayoutStore/chartLayoutStore.d'
|
||||
import { fetchChartComponent, fetchConfigComponent, createComponent } from '@/packages/index'
|
||||
import { saveInterval } from '@/settings/designSetting'
|
||||
import throttle from 'lodash/throttle'
|
||||
@@ -98,7 +100,7 @@ export const useSync = () => {
|
||||
const chartEditStore = useChartEditStore()
|
||||
const chartHistoryStore = useChartHistoryStore()
|
||||
const systemStore = useSystemStore()
|
||||
|
||||
const chartLayoutStore = useChartLayoutStore()
|
||||
/**
|
||||
* * 组件动态注册
|
||||
* @param projectData 项目数据
|
||||
@@ -164,7 +166,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()
|
||||
@@ -195,6 +204,9 @@ export const useSync = () => {
|
||||
componentMerge(chartEditStore[key], projectData[key], true)
|
||||
}
|
||||
}
|
||||
|
||||
// 清除数量
|
||||
chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.PERCENTAGE, 0)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user