import { guid } from './index';
import _ from 'lodash';
// import { getComposedComponents } from './getComposedComponents';

// const composedComponents = getComposedComponents();

export const compoleteComponentData = (views) => {
  views.forEach(view => {
    delete view.properties.left;
    delete view.properties.top;


    // view.uuid = view.uuid || guid();
    // let _composedCmp = composedComponents[view.type];
    // view.component = _composedCmp.component.default;
    // let _composedProps = _.cloneDeep(_composedCmp.properties); // 组件预设的属性，Object类型

    // let _viewProps = view.properties || {}; // 组件对象的具体属性，key:value
    // let _keys = Object.keys(_viewProps);
    // _keys.forEach(k => {
    //   _composedProps[k].value = _viewProps[k]
    // });
    // view.properties = _composedProps;

    if (view.children) {
      compoleteComponentData(view.children);
    }
  });
}