Skip to content

Commit

Permalink
Merge pull request MrXujiang#95 from mokinzhao/master
Browse files Browse the repository at this point in the history
refactor: move BasicShop to Materials
  • Loading branch information
MrXujiang authored Mar 27, 2021
2 parents 8360916 + dc47f27 commit b97eeb6
Show file tree
Hide file tree
Showing 144 changed files with 304 additions and 315 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState, useEffect, memo } from 'react';
import classnames from 'classnames';
import Icon from '@/components/BasicShop/BasicComponents/Icon';
import Icon from '@/materials/base/Icon';
import styles from './index.less';
import React from 'react';
import { IconTypes } from '@/components/BasicShop/BasicComponents/Icon/schema';
import { IconTypes } from '@/materials/base/Icon/schema';
import { ICardPickerConfigType } from '../types';

interface CardPickerType extends Omit<ICardPickerConfigType<IconTypes>, 'type' | 'key' | 'name'> {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { memo, RefObject, useCallback, useEffect, useState } from 'react';
import BaseForm from '@/components/BasicShop/BasicComponents/Form/BaseForm';
import BasePopoverForm from '@/components/BasicShop/BasicComponents/Form/BasePopoverForm';
import BaseForm from '@/materials/base/Form/BaseForm';
import BasePopoverForm from '@/materials/base/Form/BasePopoverForm';
import EditorModal from './EditorModal';
import { MinusCircleFilled, EditFilled, PlusOutlined } from '@ant-design/icons';
import styles from './formItems.less';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 2 additions & 12 deletions src/core/DynamicEngine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@ export type componentsType = 'media' | 'base' | 'visible';
const DynamicFunc = (type: string, componentsType: string) => {
return dynamic({
loader: async function() {
let Component: FC<{ isTpl: boolean }>;

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;
}
const { default: Graph } = await import(`@/materials/${componentsType}/${type}`);
const Component = Graph;
return (props: DynamicType) => {
const { config, isTpl } = props;
return <Component {...config} isTpl={isTpl} />;
Expand Down
18 changes: 9 additions & 9 deletions src/core/renderer/FormRender.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { memo, RefObject, useEffect } from 'react';
import { Form, Select, InputNumber, Input, Switch, Radio } from 'antd';
import Upload from '../FormComponents/Upload';
import DataList from '../FormComponents/DataList';
import MutiText from '../FormComponents/MutiText';
import Color from '../FormComponents/Color';
import CardPicker from '../FormComponents/CardPicker';
import Table from '../FormComponents/Table';
import Pos from '../FormComponents/Pos';
import Upload from '../../components/FormComponents/Upload';
import DataList from '../../components/FormComponents/DataList';
import MutiText from '../../components/FormComponents/MutiText';
import Color from '../../components/FormComponents/Color';
import CardPicker from '../../components/FormComponents/CardPicker';
import Table from '../../components/FormComponents/Table';
import Pos from '../../components/FormComponents/Pos';
import { Store } from 'antd/lib/form/interface';
import RichText from '../FormComponents/XEditor';
import FormItems from '../FormComponents/FormItems';
import RichText from '../../components/FormComponents/XEditor';
import FormItems from '../../components/FormComponents/FormItems';
const normFile = (e: any) => {
console.log('Upload event:', e);
if (Array.isArray(e)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TNumberDefaultType,
TTextDefaultType,
TUploadDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TUploadDefaultType,
TTextAreaDefaultType,
TRichTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TNumberDefaultType,
TSelectDefaultType,
TSwitchDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TDataListDefaultType,
TMutiTextDefaultType,
TNumberDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TUploadDefaultType,
TTextAreaDefaultType,
TRichTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TRadioDefaultType,
TSwitchDefaultType,
TNumberDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

import { serverUrl } from '@/utils/tool';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TSelectDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common';

export type TfooterSelectKeyType = 'left' | 'center' | 'right';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TSelectDefaultType,
ISelectConfigType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TTextWeightSelectKeyType = '300' | '400' | '500' | '600';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTextDefaultType,
TUploadDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common';

export type THeaderEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TNumberDefaultType,
TSwitchDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TIconEditData = Array<
| IColorConfigType
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TPosDefaultType,
TTextDefaultType,
ITextConfigType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common';

export type TTextSelectKeyType = 'left' | 'right' | 'center';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TDataListDefaultType,
TNumberDefaultType,
TSelectDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common';
export type TListSelectKeyType = '60' | '80' | '100' | '120' | '150';
export type TListEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TSelectDefaultType,
TTextAreaDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
export type TLongTextSelectKeyType = 'left' | 'center' | 'right';

export type TLongTextEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TSelectDefaultType,
TSwitchDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TNoticeSelectKeyType = 'default' | 'warning' | 'primary' | 'success' | 'danger';
export type TNoticeEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTextDefaultType,
TUploadDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TQrcodeEditData = Array<
IUploadConfigType | ITextConfigType | IColorConfigType | INumberConfigType
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TTextDefaultType,
IRichTextConfigType,
TRichTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TButtonEditData = Array<
ITextConfigType | IColorConfigType | INumberConfigType | IRichTextConfigType
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TDataListDefaultType,
TMutiTextDefaultType,
TNumberDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TTabEditData = Array<
IMutiTextConfigType | IColorConfigType | INumberConfigType | IDataListConfigType
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TSelectDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TTextSelectKeyType = 'left' | 'right' | 'center';
export type TTextEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TColorDefaultType,
TNumberDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TWhiteTplEditData = Array<IColorConfigType | INumberConfigType | ITextConfigType>;
export interface IWhiteTplConfig {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
INumberConfigType,
TTextDefaultType,
TNumberDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TAudioEditData = Array<INumberConfigType | ITextConfigType>;
export interface IAudioConfig {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TTextDefaultType,
TNumberDefaultType,
IColorConfigType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TCalendarEditData = Array<INumberConfigType | ITextConfigType | IColorConfigType>;
export interface ICalendarConfig {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TTextDefaultType,
TPosDefaultType,
TTextAreaDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TMapEditData = Array<ITextConfigType | ITextAreaConfigType | IPosConfigType>;
export interface IMapConfig {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
IUploadConfigType,
TTextDefaultType,
TUploadDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TVideoEditData = Array<IUploadConfigType | ITextConfigType>;
export interface IVideoConfig {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BasicSchema from './BasicComponents/schema';
import MediaSchema from './MediaComponents/schema';
import VisualSchema from './VisualComponents/schema';
import BasicSchema from './base/schema';
import MediaSchema from './media/schema';
import VisualSchema from './visual/schema';
import shopSchema from './ShopComponents/schema';

const schema = {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTableDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTableDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTableDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TNumberDefaultType,
TTableDefaultType,
TTextDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';

export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TNumberDefaultType,
TRadioDefaultType,
TSelectDefaultType,
} from '@/core/FormComponents/types';
} from '@/components/FormComponents/types';
export type TXProgressSelectKeyType = 'success' | 'warning' | 'danger';
export type TXProgressRadiotKeyType = 'circle' | 'line' | 'semi-circle';
export type TXProgressEditData = Array<
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/pages/editor/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import {
import { connect } from 'dva';
import HeaderComponent from './components/Header';
import CanvasControl from './components/CanvasControl';
import SourceBox from './SourceBox';
import TargetBox from './TargetBox';
import SourceBox from './TargetBox';
import TargetBox from './SourceBox';
import Calibration from 'components/Calibration';
import DynamicEngine, { componentsType } from '@/core/DynamicEngine';
import { FormRender } from '@/core';

import template from 'components/BasicShop/BasicComponents/template';
import mediaTpl from 'components/BasicShop/MediaComponents/template';
import graphTpl from 'components/BasicShop/VisualComponents/template';
import template from '@/materials/base/template';
import mediaTpl from '@/materials/media/template';
import graphTpl from '@/materials/visual/template';

import schemaH5 from 'components/BasicShop/schema';
import schemaH5 from '@/materials/schema';
import { ActionCreators, StateWithHistory } from 'redux-undo';
import { throttle, detectMobileBrowser, getBrowserNavigatorMetaInfo } from '@/utils/tool';

Expand Down
Loading

0 comments on commit b97eeb6

Please sign in to comment.