mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2025-12-12 10:12:51 +00:00
Merge pull request #95 from mokinzhao/master
refactor: move BasicShop to Materials
This commit is contained in:
commit
b97eeb6ff8
@ -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 '@/components/BasicShop/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 '@/components/BasicShop/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'> {
|
||||||
@ -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 '@/components/BasicShop/BasicComponents/Form/BaseForm';
|
import BaseForm from '@/materials/base/Form/BaseForm';
|
||||||
import BasePopoverForm from '@/components/BasicShop/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';
|
||||||
@ -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} />;
|
||||||
|
|||||||
@ -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)) {
|
||||||
|
|||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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';
|
||||||
@ -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';
|
||||||
|
|
||||||
@ -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<
|
||||||
@ -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
|
||||||
@ -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';
|
||||||
@ -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<
|
||||||
@ -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<
|
||||||
@ -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<
|
||||||
@ -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
|
||||||
@ -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
|
||||||
@ -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
|
||||||
@ -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<
|
||||||
@ -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 {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user