提交 7f1ad213 authored 作者: wangjiahao's avatar wangjiahao

refactor: 历史仪表板初始化时默认使用最高的矩阵密度

上级 56c33ece
...@@ -72,10 +72,6 @@ export function panelInit(componentData, componentStyle) { ...@@ -72,10 +72,6 @@ export function panelInit(componentData, componentStyle) {
componentStyle.refreshViewLoading = (componentStyle.refreshViewLoading || false) componentStyle.refreshViewLoading = (componentStyle.refreshViewLoading || false)
componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute') componentStyle.refreshUnit = (componentStyle.refreshUnit || 'minute')
componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN)) componentStyle.aidedDesign = (componentStyle.aidedDesign || deepCopy(AIDED_DESIGN))
// // // 初始化密度为最高密度
// const matrixChange = 2 / componentStyle.aidedDesign.matrixBase
// componentStyle.aidedDesign.matrixBase = 2
componentData.forEach((item, index) => { componentData.forEach((item, index) => {
if (item.component && item.component === 'de-date') { if (item.component && item.component === 'de-date') {
if (item.options.attrs && if (item.options.attrs &&
...@@ -98,11 +94,20 @@ export function panelInit(componentData, componentStyle) { ...@@ -98,11 +94,20 @@ export function panelInit(componentData, componentStyle) {
item.y = (item.y || 1) item.y = (item.y || 1)
item.sizex = (item.sizex || 5) item.sizex = (item.sizex || 5)
item.sizey = (item.sizey || 5) item.sizey = (item.sizey || 5)
// 初始化密度为最高密度
if (componentStyle.aidedDesign.matrixBase !== 4) {
item.x = (item.x - 1) * componentStyle.aidedDesign.matrixBase + 1
item.y = (item.y - 1) * componentStyle.aidedDesign.matrixBase + 1
item.sizex = item.sizex * componentStyle.aidedDesign.matrixBase
item.sizey = item.sizey * componentStyle.aidedDesign.matrixBase
}
item.mobileSelected = (item.mobileSelected || false) item.mobileSelected = (item.mobileSelected || false)
item.mobileStyle = (item.mobileStyle || deepCopy(BASE_MOBILE_STYLE)) item.mobileStyle = (item.mobileStyle || deepCopy(BASE_MOBILE_STYLE))
item.hyperlinks = (item.hyperlinks || deepCopy(HYPERLINKS)) item.hyperlinks = (item.hyperlinks || deepCopy(HYPERLINKS))
item.commonBackground = item.commonBackground || deepCopy(COMMON_BACKGROUND_NONE) item.commonBackground = item.commonBackground || deepCopy(COMMON_BACKGROUND_NONE)
}) })
// 初始化密度为最高密度
componentStyle.aidedDesign.matrixBase = 4
// 将data 和 style 数据设置到全局store中 // 将data 和 style 数据设置到全局store中
store.commit('setComponentData', resetID(componentData)) store.commit('setComponentData', resetID(componentData))
store.commit('setCanvasStyle', componentStyle) store.commit('setCanvasStyle', componentStyle)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论