diff --git a/src/components/BasicShop/BasicComponents/Footer/index.tsx b/src/components/BasicShop/BasicComponents/Footer/index.tsx index bb9911e..4ccbca0 100644 --- a/src/components/BasicShop/BasicComponents/Footer/index.tsx +++ b/src/components/BasicShop/BasicComponents/Footer/index.tsx @@ -2,7 +2,6 @@ import React, { memo } from 'react'; import { IFooterConfig } from './schema'; const Footer = memo((props: IFooterConfig) => { const { bgColor, text, color, align, fontSize, height } = props; - console.log(props); return ( <> {props.isTpl && ( diff --git a/src/components/BasicShop/BasicComponents/WhiteTpl/index.tsx b/src/components/BasicShop/BasicComponents/WhiteTpl/index.tsx index 0361248..9ef8f3b 100644 --- a/src/components/BasicShop/BasicComponents/WhiteTpl/index.tsx +++ b/src/components/BasicShop/BasicComponents/WhiteTpl/index.tsx @@ -9,7 +9,6 @@ interface IProps extends IWhiteTplConfig { const WhiteTpl = memo((props: IProps) => { const { bgColor, text, fontSize, color, height, isTpl } = props; - console.log('data', bgColor, text, fontSize, color, height); return (
.ant-tabs-nav .ant-tabs-tab{ + padding:20px 0px !important; + +} +.ant-tabs-tab{ + margin:auto!important; +} +.ant-tabs-tab div{ + display: inline-block; +} +.ant-tabs-content-holder{ + overflow: auto; } \ No newline at end of file diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 3e35216..78b416d 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -84,7 +84,6 @@ export default function Layout({ children }: IRouteComponentProps) { ); const [state, setState] = useState('h5'); - debugger; return ( { + return (c: boolean) => { + setCollapsed(c); + }; + }, []); + const context = useContext(dooringContext); const curPoint = useMemo(() => { if (context.theme === 'h5') { @@ -62,7 +70,6 @@ const Container = (props: { if (context.theme === 'h5') { return schema1; } else { - console.log(schema2); return schema2; } }, [context.theme]); @@ -98,24 +105,21 @@ const Container = (props: { setScale(1); }; - const toggleCollapsed = (checked: boolean) => { - console.log(checked); - setCollapsed(checked); - }; - const CpIcon = { base: , media: , visible: , }; - const generateHeader = (type: componentsType, text: string) => { - return ( -
- {CpIcon[type]} {text} -
- ); - }; + const generateHeader = useMemo(() => { + return (type: componentsType, text: string) => { + return ( +
+ {CpIcon[type]} {text} +
+ ); + }; + }, [CpIcon]); const handleSliderChange = (v: number) => { setScale(prev => (v >= 150 ? 1.5 : v / 100)); @@ -198,7 +202,7 @@ const Container = (props: { arr.push(v.type); }); return arr; - }, []); + }, [graphTpl, mediaTpl, template]); const [dragstate, setDragState] = useState({ x: 0, y: 0 }); const [render] = useGetBall(setDragState, { @@ -207,8 +211,6 @@ const Container = (props: { intervalDelay: 5, }); - const [display] = useAnimation(collapsed, 500); - const renderRight = useMemo(() => { if (context.theme === 'h5') { return ( @@ -263,6 +265,64 @@ const Container = (props: { } }, [context.theme, cpointData.length, curPoint, handleDel, handleFormSave, pointData.length]); + const tabRender = useMemo(() => { + if (collapsed) { + return ( + <> + + + + + ); + } else { + return ( + <> + +
基础组件
+ {template.map((value, i) => { + return ( + + + + ); + })} +
+ +
媒体组件
+ {mediaTpl.map((value, i) => ( + + + + ))} +
+ +
可视化组件
+ {graphTpl.map((value, i) => ( + + + + ))} +
+ + ); + } + }, [canvasId, collapsed, generateHeader, graphTpl, mediaTpl, schema, template]); + return (
-
- -
Dooring升级啦!
-
已有1000+人使用
-
持续迭代中...
- - } - /> -
- - - {template.map((value, i) => { - return ( - - - - ); - })} - - - {mediaTpl.map((value, i) => ( - - - - ))} - - - {graphTpl.map((value, i) => ( - - - - ))} - + changeCollapse(false)} + defaultActiveKey="1" + tabPosition={'left'} + > + {tabRender}
+
changeCollapse(!collapsed)} + > + {collapsed ? : } +
+
+
diff --git a/src/pages/editor/SourceBox.tsx b/src/pages/editor/SourceBox.tsx index 343d8f2..6554964 100644 --- a/src/pages/editor/SourceBox.tsx +++ b/src/pages/editor/SourceBox.tsx @@ -58,7 +58,6 @@ const SourceBox = memo((props: SourceBoxProps) => { }, }); } else { - console.log(item.x); dispatch({ type: 'editorPcModal/addPointData', payload: { diff --git a/src/pages/editor/components/Header/index.less b/src/pages/editor/components/Header/index.less index 2d0fde6..a58dd7e 100644 --- a/src/pages/editor/components/Header/index.less +++ b/src/pages/editor/components/Header/index.less @@ -1,6 +1,6 @@ .header { position: relative; - z-index: 10; + z-index: 201; padding-left: 30px; padding-right: 30px; display: flex; @@ -32,6 +32,6 @@ } .btnArea { width: 320px; - text-align: right; + text-align: left; } } diff --git a/src/pages/editor/components/Header/index.tsx b/src/pages/editor/components/Header/index.tsx index 728abaa..fb47b17 100644 --- a/src/pages/editor/components/Header/index.tsx +++ b/src/pages/editor/components/Header/index.tsx @@ -29,11 +29,10 @@ interface HeaderComponentProps { clearData: any; undohandler: any; redohandler: any; - toggleCollapsed: any; } const HeaderComponent = memo((props: HeaderComponentProps) => { - const { pointData, location, clearData, undohandler, redohandler, toggleCollapsed } = props; + const { pointData, location, clearData, undohandler, redohandler } = props; const iptRef = useRef(null); const toPreview = () => { @@ -137,7 +136,6 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
Dooring
-