|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
let initData = null;
|
|
|
|
|
let grid = null;
|
|
|
|
|
let currentComponent = null;
|
|
|
|
|
let cellHeight = 40;
|
|
|
|
|
|
|
|
|
|
// 生成唯一id
|
|
|
|
|
var generateUniqueId = function () {
|
|
|
|
|
@ -29,19 +30,21 @@
|
|
|
|
|
};
|
|
|
|
|
grid = GridStack.init({
|
|
|
|
|
// 一行高度
|
|
|
|
|
cellHeight: 60,
|
|
|
|
|
cellHeight,
|
|
|
|
|
// 间距
|
|
|
|
|
margin: 5,
|
|
|
|
|
minRow: 8,
|
|
|
|
|
minRow: Math.floor(($(window).height() - 80) / cellHeight),
|
|
|
|
|
acceptWidgets: true,
|
|
|
|
|
float: true,
|
|
|
|
|
removable: '#trash',
|
|
|
|
|
// subGridOpts: subOptions,
|
|
|
|
|
// subGridDynamic: true,
|
|
|
|
|
children: initData.children,
|
|
|
|
|
});
|
|
|
|
|
GridStack.setupDragIn('#components-panel .component-item', undefined, [
|
|
|
|
|
{
|
|
|
|
|
w: 12,
|
|
|
|
|
h: 2,
|
|
|
|
|
h: 1,
|
|
|
|
|
type: 'banner',
|
|
|
|
|
name: '我是轮播图',
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|