|
@@ -568,6 +568,7 @@ const actions = {
|
|
|
const pageSize = state.cardConfig.pageSize;
|
|
|
// 更新元件最新的高度信息
|
|
|
// 整理所有元件
|
|
|
+ const cardHeadElement = state.topics[0];
|
|
|
state.topics.forEach((element) => {
|
|
|
const elementDom = document.getElementById(`preview-${element.id}`);
|
|
|
|
|
@@ -585,6 +586,8 @@ const actions = {
|
|
|
|
|
|
// 动态计算每列可以分配的元件
|
|
|
const columnHeight = document.getElementById("topic-column").offsetHeight;
|
|
|
+ const simpleCardHeadHeight =
|
|
|
+ document.getElementById("simple-card-head").offsetHeight;
|
|
|
let pages = [];
|
|
|
let page = {};
|
|
|
let columns = [];
|
|
@@ -594,6 +597,23 @@ const actions = {
|
|
|
const initCurColumnElements = () => {
|
|
|
curColumnElements = [];
|
|
|
curColumnHeight = 0;
|
|
|
+ const groupColumnNumber = columnNumber * 2;
|
|
|
+ // 奇数页第一栏;
|
|
|
+ if (!(columns.length % groupColumnNumber)) {
|
|
|
+ // 非第一页奇数页第一栏
|
|
|
+ if (columns.length) {
|
|
|
+ const cardHeadSimpleElement = Object.assign({}, cardHeadElement, {
|
|
|
+ id: getElementId(),
|
|
|
+ isSimple: true,
|
|
|
+ h: simpleCardHeadHeight,
|
|
|
+ });
|
|
|
+ curColumnElements.push(cardHeadSimpleElement);
|
|
|
+ curColumnHeight += simpleCardHeadHeight;
|
|
|
+ } else {
|
|
|
+ curColumnElements.push(cardHeadElement);
|
|
|
+ curColumnHeight += cardHeadElement.h;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const checkElementIsCurColumnFirstType = (element) => {
|
|
@@ -641,7 +661,7 @@ const actions = {
|
|
|
|
|
|
// 批量添加所有元素。
|
|
|
initCurColumnElements();
|
|
|
- state.topics.forEach((element, eindex) => {
|
|
|
+ state.topics.slice(1).forEach((element, eindex) => {
|
|
|
element.elementSerialNo = eindex;
|
|
|
pushElement(element);
|
|
|
});
|