refactor:move formComponents to common

This commit is contained in:
mokinzhao 2021-03-27 15:41:04 +08:00
parent 9e36966c46
commit 3984102e5a
50 changed files with 37 additions and 37 deletions

View File

@ -1,15 +1,15 @@
import React, { memo, RefObject, useEffect } from 'react'; import React, { memo, RefObject, useEffect } from 'react';
import { Form, Select, InputNumber, Input, Switch, Radio } from 'antd'; import { Form, Select, InputNumber, Input, Switch, Radio } from 'antd';
import Upload from '../FormComponents/Upload'; import Upload from '../../components/FormComponents/Upload';
import DataList from '../FormComponents/DataList'; import DataList from '../../components/FormComponents/DataList';
import MutiText from '../FormComponents/MutiText'; import MutiText from '../../components/FormComponents/MutiText';
import Color from '../FormComponents/Color'; import Color from '../../components/FormComponents/Color';
import CardPicker from '../FormComponents/CardPicker'; import CardPicker from '../../components/FormComponents/CardPicker';
import Table from '../FormComponents/Table'; import Table from '../../components/FormComponents/Table';
import Pos from '../FormComponents/Pos'; import Pos from '../../components/FormComponents/Pos';
import { Store } from 'antd/lib/form/interface'; import { Store } from 'antd/lib/form/interface';
import RichText from '../FormComponents/XEditor'; import RichText from '../../components/FormComponents/XEditor';
import FormItems from '../FormComponents/FormItems'; import FormItems from '../../components/FormComponents/FormItems';
const normFile = (e: any) => { const normFile = (e: any) => {
console.log('Upload event:', e); console.log('Upload event:', e);
if (Array.isArray(e)) { if (Array.isArray(e)) {

View File

@ -9,7 +9,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTextDefaultType, TTextDefaultType,
TUploadDefaultType, TUploadDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -11,7 +11,7 @@ import {
TUploadDefaultType, TUploadDefaultType,
TTextAreaDefaultType, TTextAreaDefaultType,
TRichTextDefaultType, TRichTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -9,7 +9,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TSelectDefaultType, TSelectDefaultType,
TSwitchDefaultType, TSwitchDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -7,7 +7,7 @@ import {
TDataListDefaultType, TDataListDefaultType,
TMutiTextDefaultType, TMutiTextDefaultType,
TNumberDefaultType, TNumberDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -11,7 +11,7 @@ import {
TUploadDefaultType, TUploadDefaultType,
TTextAreaDefaultType, TTextAreaDefaultType,
TRichTextDefaultType, TRichTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -7,7 +7,7 @@ import {
TRadioDefaultType, TRadioDefaultType,
TSwitchDefaultType, TSwitchDefaultType,
TNumberDefaultType, TNumberDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { serverUrl } from '@/utils/tool'; import { serverUrl } from '@/utils/tool';

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TSelectDefaultType, TSelectDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common'; import { baseConfig, baseDefault, ICommonBaseType } from '../../common';
export type TfooterSelectKeyType = 'left' | 'center' | 'right'; export type TfooterSelectKeyType = 'left' | 'center' | 'right';

View File

@ -9,7 +9,7 @@ import {
TSelectDefaultType, TSelectDefaultType,
ISelectConfigType, ISelectConfigType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TTextWeightSelectKeyType = '300' | '400' | '500' | '600'; export type TTextWeightSelectKeyType = '300' | '400' | '500' | '600';

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTextDefaultType, TTextDefaultType,
TUploadDefaultType, TUploadDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common'; import { baseConfig, baseDefault, ICommonBaseType } from '../../common';
export type THeaderEditData = Array< export type THeaderEditData = Array<

View File

@ -9,7 +9,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TSwitchDefaultType, TSwitchDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TIconEditData = Array< export type TIconEditData = Array<
| IColorConfigType | IColorConfigType

View File

@ -11,7 +11,7 @@ import {
TPosDefaultType, TPosDefaultType,
TTextDefaultType, TTextDefaultType,
ITextConfigType, ITextConfigType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common'; import { baseConfig, baseDefault, ICommonBaseType } from '../../common';
export type TTextSelectKeyType = 'left' | 'right' | 'center'; export type TTextSelectKeyType = 'left' | 'right' | 'center';

View File

@ -7,7 +7,7 @@ import {
TDataListDefaultType, TDataListDefaultType,
TNumberDefaultType, TNumberDefaultType,
TSelectDefaultType, TSelectDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
import { baseConfig, baseDefault, ICommonBaseType } from '../../common'; import { baseConfig, baseDefault, ICommonBaseType } from '../../common';
export type TListSelectKeyType = '60' | '80' | '100' | '120' | '150'; export type TListSelectKeyType = '60' | '80' | '100' | '120' | '150';
export type TListEditData = Array< export type TListEditData = Array<

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TSelectDefaultType, TSelectDefaultType,
TTextAreaDefaultType, TTextAreaDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TLongTextSelectKeyType = 'left' | 'center' | 'right'; export type TLongTextSelectKeyType = 'left' | 'center' | 'right';
export type TLongTextEditData = Array< export type TLongTextEditData = Array<

View File

@ -7,7 +7,7 @@ import {
TSelectDefaultType, TSelectDefaultType,
TSwitchDefaultType, TSwitchDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TNoticeSelectKeyType = 'default' | 'warning' | 'primary' | 'success' | 'danger'; export type TNoticeSelectKeyType = 'default' | 'warning' | 'primary' | 'success' | 'danger';
export type TNoticeEditData = Array< export type TNoticeEditData = Array<

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTextDefaultType, TTextDefaultType,
TUploadDefaultType, TUploadDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TQrcodeEditData = Array< export type TQrcodeEditData = Array<
IUploadConfigType | ITextConfigType | IColorConfigType | INumberConfigType IUploadConfigType | ITextConfigType | IColorConfigType | INumberConfigType

View File

@ -7,7 +7,7 @@ import {
TTextDefaultType, TTextDefaultType,
IRichTextConfigType, IRichTextConfigType,
TRichTextDefaultType, TRichTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TButtonEditData = Array< export type TButtonEditData = Array<
ITextConfigType | IColorConfigType | INumberConfigType | IRichTextConfigType ITextConfigType | IColorConfigType | INumberConfigType | IRichTextConfigType

View File

@ -7,7 +7,7 @@ import {
TDataListDefaultType, TDataListDefaultType,
TMutiTextDefaultType, TMutiTextDefaultType,
TNumberDefaultType, TNumberDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TTabEditData = Array< export type TTabEditData = Array<
IMutiTextConfigType | IColorConfigType | INumberConfigType | IDataListConfigType IMutiTextConfigType | IColorConfigType | INumberConfigType | IDataListConfigType

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TSelectDefaultType, TSelectDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TTextSelectKeyType = 'left' | 'right' | 'center'; export type TTextSelectKeyType = 'left' | 'right' | 'center';
export type TTextEditData = Array< export type TTextEditData = Array<

View File

@ -5,7 +5,7 @@ import {
TColorDefaultType, TColorDefaultType,
TNumberDefaultType, TNumberDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TWhiteTplEditData = Array<IColorConfigType | INumberConfigType | ITextConfigType>; export type TWhiteTplEditData = Array<IColorConfigType | INumberConfigType | ITextConfigType>;
export interface IWhiteTplConfig { export interface IWhiteTplConfig {

View File

@ -3,7 +3,7 @@ import {
INumberConfigType, INumberConfigType,
TTextDefaultType, TTextDefaultType,
TNumberDefaultType, TNumberDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TAudioEditData = Array<INumberConfigType | ITextConfigType>; export type TAudioEditData = Array<INumberConfigType | ITextConfigType>;
export interface IAudioConfig { export interface IAudioConfig {

View File

@ -4,7 +4,7 @@ import {
TTextDefaultType, TTextDefaultType,
TNumberDefaultType, TNumberDefaultType,
IColorConfigType, IColorConfigType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TCalendarEditData = Array<INumberConfigType | ITextConfigType | IColorConfigType>; export type TCalendarEditData = Array<INumberConfigType | ITextConfigType | IColorConfigType>;
export interface ICalendarConfig { export interface ICalendarConfig {

View File

@ -5,7 +5,7 @@ import {
TTextDefaultType, TTextDefaultType,
TPosDefaultType, TPosDefaultType,
TTextAreaDefaultType, TTextAreaDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TMapEditData = Array<ITextConfigType | ITextAreaConfigType | IPosConfigType>; export type TMapEditData = Array<ITextConfigType | ITextAreaConfigType | IPosConfigType>;
export interface IMapConfig { export interface IMapConfig {

View File

@ -3,7 +3,7 @@ import {
IUploadConfigType, IUploadConfigType,
TTextDefaultType, TTextDefaultType,
TUploadDefaultType, TUploadDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TVideoEditData = Array<IUploadConfigType | ITextConfigType>; export type TVideoEditData = Array<IUploadConfigType | ITextConfigType>;
export interface IVideoConfig { export interface IVideoConfig {

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTableDefaultType, TTableDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TChartEditData = Array< export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTableDefaultType, TTableDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TChartEditData = Array< export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTableDefaultType, TTableDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TChartEditData = Array< export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType

View File

@ -7,7 +7,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TTableDefaultType, TTableDefaultType,
TTextDefaultType, TTextDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TChartEditData = Array< export type TChartEditData = Array<
ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType ITextConfigType | INumberConfigType | IColorConfigType | ITableConfigType

View File

@ -5,7 +5,7 @@ import {
TNumberDefaultType, TNumberDefaultType,
TRadioDefaultType, TRadioDefaultType,
TSelectDefaultType, TSelectDefaultType,
} from '@/core/FormComponents/types'; } from '@/components/FormComponents/types';
export type TXProgressSelectKeyType = 'success' | 'warning' | 'danger'; export type TXProgressSelectKeyType = 'success' | 'warning' | 'danger';
export type TXProgressRadiotKeyType = 'circle' | 'line' | 'semi-circle'; export type TXProgressRadiotKeyType = 'circle' | 'line' | 'semi-circle';
export type TXProgressEditData = Array< export type TXProgressEditData = Array<