diff --git a/packages/editor-preset-vision/src/pages.ts b/packages/editor-preset-vision/src/pages.ts index c50b95ee0..06bbd957b 100644 --- a/packages/editor-preset-vision/src/pages.ts +++ b/packages/editor-preset-vision/src/pages.ts @@ -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; }, diff --git a/packages/editor-preset-vision/src/util/index.ts b/packages/editor-preset-vision/src/util/index.ts deleted file mode 100644 index b1ad217e9..000000000 --- a/packages/editor-preset-vision/src/util/index.ts +++ /dev/null @@ -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'); -} \ No newline at end of file