export { get, set, has, cloneDeep } from 'lodash'; // simple uuid export function uuid() { return ((Math.random() * 1e6) >> 0).toString(36); } export const isPageDesigner = () => { const { hash } = window.location; return hash ? !!hash.startsWith('#/page') : false; }; const devMode = ['localhost:3333', '192.168.168.183:3333']; export const isDev = devMode.includes(window.location.host); // 获取页面schema export const findPageParent = (component: any): any => { if (!component) return null; // 如果当前组件是 Page,直接返回 if (component.componentName === 'Page' || component.componentName === 'Block') { return component; } // 递归查找 parent if (component.parent) { return findPageParent(component.parent); } return null; };