Web 端数据交互与 design2 布局修复
统一门户 JSON 契约:新增 GET /templates/{id},模板/云文件/保存/打开走虚拟 key;
layer 保存弹层替代 prompt,本地 .soon 已登录后台 POST 登记;修复保存静默失败与 design2 全宽布局。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,9 @@ $("#object_attribute").css("height", "470px");
|
||||
$("#obj_list").css("height", document.body.clientHeight - 520);
|
||||
$(".obj_list").css("height", $("#obj_list").height() - 32);
|
||||
|
||||
$(".main").show();
|
||||
var mainEl = document.querySelector('.layui-fluid.main');
|
||||
if (mainEl) mainEl.style.display = 'flex';
|
||||
else $(".main").show();
|
||||
$(".canvas_box").css("height", document.body.clientHeight - 100);
|
||||
zoom = $(".canvas_bg_img").width() / 2787
|
||||
$("#canvas1").attr("width", $(".canvas_box").width() / zoom);
|
||||
@@ -259,7 +261,7 @@ if (typeof ipcRenderer !== 'undefined' && ipcRenderer) {
|
||||
applySysLan(window.platformBridge.getLocale());
|
||||
}
|
||||
function onCloseConfirm() {
|
||||
layer.confirm('<font style="color:black">' + language_str("whetherSave") + '</font>', {
|
||||
layer.confirm(language_str("whetherSave"), {
|
||||
btn: [language_str("save"), language_str("noSave"), language_str("cancel")]
|
||||
, btn3: function (index, layero) {}
|
||||
}, function (index, layero) {
|
||||
@@ -418,28 +420,14 @@ function addBackground() {
|
||||
recordObjs2.push(JSON.stringify(objs2));
|
||||
recordJson2.push(canvas2.toJSON(TO_JSON_PROPERTIES));
|
||||
|
||||
let file = GetFile().get('file');
|
||||
if (!file && typeof sessionStorage !== 'undefined') {
|
||||
try {
|
||||
file = sessionStorage.getItem('soondesign_open_file');
|
||||
if (file) {
|
||||
sessionStorage.removeItem('soondesign_open_file');
|
||||
sessionStorage.removeItem('soondesign_open_type');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
var file = typeof window.soonResolveOpenFileKey === 'function'
|
||||
? window.soonResolveOpenFileKey(GetFile)
|
||||
: (GetFile().get('file') || '');
|
||||
if (file && file != 'empty') {
|
||||
if (file.indexOf('soondesign_file:') === 0 && typeof sessionStorage !== 'undefined') {
|
||||
try {
|
||||
var metaRaw = sessionStorage.getItem('soondesign_open_meta');
|
||||
if (metaRaw) {
|
||||
window._soonFileMeta = JSON.parse(metaRaw);
|
||||
sessionStorage.removeItem('soondesign_open_meta');
|
||||
}
|
||||
} catch (e) {}
|
||||
if (typeof window.soonConsumeOpenMeta === 'function') {
|
||||
window.soonConsumeOpenMeta(file);
|
||||
}
|
||||
var p = window.openFile(file)
|
||||
if (p && p.then) p.then(function() {}, function() {})
|
||||
window.openFile(file);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user