|
|
|
@ -8,6 +8,7 @@
|
|
|
|
initData: null,
|
|
|
|
initData: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let currentComponent = null;
|
|
|
|
let currentComponent = null;
|
|
|
|
|
|
|
|
let currentScreen = 'welcome';
|
|
|
|
let cellHeight = 30;
|
|
|
|
let cellHeight = 30;
|
|
|
|
let locale = 'en';
|
|
|
|
let locale = 'en';
|
|
|
|
|
|
|
|
|
|
|
|
@ -553,6 +554,9 @@
|
|
|
|
.not('#' + tabId)
|
|
|
|
.not('#' + tabId)
|
|
|
|
.hide();
|
|
|
|
.hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理当前选中screen
|
|
|
|
|
|
|
|
var type = $this.data('type');
|
|
|
|
|
|
|
|
currentScreen = type;
|
|
|
|
// 处理右侧面板的显示/隐藏
|
|
|
|
// 处理右侧面板的显示/隐藏
|
|
|
|
currentComponent = null;
|
|
|
|
currentComponent = null;
|
|
|
|
hidePropsPanel();
|
|
|
|
hidePropsPanel();
|
|
|
|
@ -599,6 +603,50 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 点击复制组件按钮处理
|
|
|
|
|
|
|
|
var handleCopyComponentClick = function () {
|
|
|
|
|
|
|
|
$('#copy-component').click(function () {
|
|
|
|
|
|
|
|
if (!currentComponent) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(currentComponent);
|
|
|
|
|
|
|
|
let widget = {
|
|
|
|
|
|
|
|
w: currentComponent.w,
|
|
|
|
|
|
|
|
h: currentComponent.h,
|
|
|
|
|
|
|
|
name: userLangConfig[locale].user[`${currentComponent.type}_default_name`],
|
|
|
|
|
|
|
|
type: currentComponent.type,
|
|
|
|
|
|
|
|
background: currentComponent.background,
|
|
|
|
|
|
|
|
eventsType: currentComponent.eventsType,
|
|
|
|
|
|
|
|
eventsAction: currentComponent.eventsAction,
|
|
|
|
|
|
|
|
defaultFocus: false,
|
|
|
|
|
|
|
|
leftId: currentComponent.leftId,
|
|
|
|
|
|
|
|
rightId: currentComponent.rightId,
|
|
|
|
|
|
|
|
upId: currentComponent.upId,
|
|
|
|
|
|
|
|
downId: currentComponent.downId,
|
|
|
|
|
|
|
|
focusedStyle_background: currentComponent.focusedStyle_background,
|
|
|
|
|
|
|
|
focusedStyle_border_width: currentComponent.focusedStyle_border_width,
|
|
|
|
|
|
|
|
focusedStyle_border_color: currentComponent.focusedStyle_border_color,
|
|
|
|
|
|
|
|
focusedStyle_scale: currentComponent.focusedStyle_scale,
|
|
|
|
|
|
|
|
content: currentComponent.content,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
if (currentComponent.type === 'image') {
|
|
|
|
|
|
|
|
widget.image = currentComponent.image;
|
|
|
|
|
|
|
|
} else if (currentComponent.type === 'text') {
|
|
|
|
|
|
|
|
widget.childrenType = currentComponent.childrenType;
|
|
|
|
|
|
|
|
widget.fontSize = currentComponent.fontSize;
|
|
|
|
|
|
|
|
widget.color = currentComponent.color;
|
|
|
|
|
|
|
|
widget.text = currentComponent.text;
|
|
|
|
|
|
|
|
widget.fontWeight = currentComponent.fontWeight;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (currentScreen === 'main') {
|
|
|
|
|
|
|
|
main.grid.addWidget(widget);
|
|
|
|
|
|
|
|
} else if (currentScreen === 'welcome') {
|
|
|
|
|
|
|
|
welcome.grid.addWidget(widget);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(welcome.grid.save());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 点击画布处理
|
|
|
|
// 点击画布处理
|
|
|
|
var handleCanvasClick = function () {
|
|
|
|
var handleCanvasClick = function () {
|
|
|
|
handleAddComponent(welcome.initData, welcome);
|
|
|
|
handleAddComponent(welcome.initData, welcome);
|
|
|
|
@ -743,6 +791,8 @@
|
|
|
|
handleTabSwitch();
|
|
|
|
handleTabSwitch();
|
|
|
|
// 处理保存按钮
|
|
|
|
// 处理保存按钮
|
|
|
|
handleSaveClick();
|
|
|
|
handleSaveClick();
|
|
|
|
|
|
|
|
// 处理复制组件按钮
|
|
|
|
|
|
|
|
handleCopyComponentClick();
|
|
|
|
// 处理画布点击事件
|
|
|
|
// 处理画布点击事件
|
|
|
|
handleCanvasClick();
|
|
|
|
handleCanvasClick();
|
|
|
|
})();
|
|
|
|
})();
|
|
|
|
|