fix: move BasicShop to Materials

This commit is contained in:
mokinzhao 2021-03-27 15:16:40 +08:00
parent c5766eef64
commit 9e36966c46
99 changed files with 12 additions and 22 deletions

View File

@ -8,18 +8,8 @@ export type componentsType = 'media' | 'base' | 'visible';
const DynamicFunc = (type: string, componentsType: string) => { const DynamicFunc = (type: string, componentsType: string) => {
return dynamic({ return dynamic({
loader: async function() { loader: async function() {
let Component: FC<{ isTpl: boolean }>; const { default: Graph } = await import(`@/materials/${componentsType}/${type}`);
const Component = Graph;
if (componentsType === 'base') {
const { default: Graph } = await import(`@/components/BasicShop/BasicComponents/${type}`);
Component = Graph;
} else if (componentsType === 'media') {
const { default: Graph } = await import(`@/components/BasicShop/MediaComponents/${type}`);
Component = Graph;
} else {
const { default: Graph } = await import(`@/components/BasicShop/VisualComponents/${type}`);
Component = Graph;
}
return (props: DynamicType) => { return (props: DynamicType) => {
const { config, isTpl } = props; const { config, isTpl } = props;
return <Component {...config} isTpl={isTpl} />; return <Component {...config} isTpl={isTpl} />;

View File

@ -1,9 +1,9 @@
import { useState, useEffect, memo } from 'react'; import { useState, useEffect, memo } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import Icon from '@/materials/BasicComponents/Icon'; import Icon from '@/materials/base/Icon';
import styles from './index.less'; import styles from './index.less';
import React from 'react'; import React from 'react';
import { IconTypes } from '@/materials/BasicComponents/Icon/schema'; import { IconTypes } from '@/materials/base/Icon/schema';
import { ICardPickerConfigType } from '../types'; import { ICardPickerConfigType } from '../types';
interface CardPickerType extends Omit<ICardPickerConfigType<IconTypes>, 'type' | 'key' | 'name'> { interface CardPickerType extends Omit<ICardPickerConfigType<IconTypes>, 'type' | 'key' | 'name'> {

View File

@ -1,6 +1,6 @@
import React, { memo, RefObject, useCallback, useEffect, useState } from 'react'; import React, { memo, RefObject, useCallback, useEffect, useState } from 'react';
import BaseForm from '@/materials/BasicComponents/Form/BaseForm'; import BaseForm from '@/materials/base/Form/BaseForm';
import BasePopoverForm from '@/materials/BasicComponents/Form/BasePopoverForm'; import BasePopoverForm from '@/materials/base/Form/BasePopoverForm';
import EditorModal from './EditorModal'; import EditorModal from './EditorModal';
import { MinusCircleFilled, EditFilled, PlusOutlined } from '@ant-design/icons'; import { MinusCircleFilled, EditFilled, PlusOutlined } from '@ant-design/icons';
import styles from './formItems.less'; import styles from './formItems.less';

View File

@ -1,6 +1,6 @@
import BasicSchema from './BasicComponents/schema'; import BasicSchema from './base/schema';
import MediaSchema from './MediaComponents/schema'; import MediaSchema from './media/schema';
import VisualSchema from './VisualComponents/schema'; import VisualSchema from './visual/schema';
import shopSchema from './ShopComponents/schema'; import shopSchema from './ShopComponents/schema';
const schema = { const schema = {

View File

@ -16,9 +16,9 @@ import Calibration from 'components/Calibration';
import DynamicEngine, { componentsType } from '@/core/DynamicEngine'; import DynamicEngine, { componentsType } from '@/core/DynamicEngine';
import { FormRender } from '@/core'; import { FormRender } from '@/core';
import template from '@/materials/BasicComponents/template'; import template from '@/materials/base/template';
import mediaTpl from '@/materials/MediaComponents/template'; import mediaTpl from '@/materials/media/template';
import graphTpl from '@/materials/VisualComponents/template'; import graphTpl from '@/materials/visual/template';
import schemaH5 from '@/materials/schema'; import schemaH5 from '@/materials/schema';
import { ActionCreators, StateWithHistory } from 'redux-undo'; import { ActionCreators, StateWithHistory } from 'redux-undo';