mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix: formUuid 可能不在 url 中
This commit is contained in:
parent
d936d2bdde
commit
8657ab8318
@ -2,7 +2,6 @@ import { RootSchema } from '@ali/lowcode-types';
|
||||
import { DocumentModel } from '@ali/lowcode-designer';
|
||||
import { designer } from './editor';
|
||||
import NodeCacheVisitor from './rootNodeVisitor';
|
||||
import { getFormUuid } from './util';
|
||||
|
||||
const { project } = designer;
|
||||
|
||||
@ -52,7 +51,8 @@ const pages = Object.assign(project, {
|
||||
project.load({
|
||||
version: '1.0.0',
|
||||
componentsMap: [],
|
||||
componentsTree
|
||||
componentsTree,
|
||||
id: pages[0].id,
|
||||
}, true);
|
||||
|
||||
// FIXME: 根本原因应该是 propStash 导致的,这样可以避免页面加载之后就被标记为 isModified
|
||||
@ -89,7 +89,7 @@ const pages = Object.assign(project, {
|
||||
if (!project.currentDocument) {
|
||||
return null;
|
||||
}
|
||||
const currentPage = { ...project.currentDocument, id: getFormUuid() };
|
||||
const currentPage = { ...project.currentDocument, id: project.getSchema().id };
|
||||
Object.setPrototypeOf(currentPage, Object.getPrototypeOf(project.currentDocument || {}));
|
||||
return currentPage;
|
||||
},
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
function getUrlParameter(sParam: string) {
|
||||
var sPageURL = window.location.search.substring(1),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export function getFormUuid() {
|
||||
return getUrlParameter('formUuid');
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user