diff --git a/src/compenents/upload-image-button/index.tsx b/src/compenents/upload-image-button/index.tsx index 2967e9a..7346b58 100644 --- a/src/compenents/upload-image-button/index.tsx +++ b/src/compenents/upload-image-button/index.tsx @@ -46,7 +46,7 @@ export const UploadImageButton = (props: PropsInterface) => { const [imageList, setImageList] = useState([]); const [refresh, setRefresh] = useState(false); const [page, setPage] = useState(1); - const [size, setSize] = useState(12); + const [size, setSize] = useState(15); const [total, setTotal] = useState(0); // 获取图片列表 @@ -92,11 +92,11 @@ export const UploadImageButton = (props: PropsInterface) => { setShowModal(false); }} open={true} - width="1000px" + width={820} maskClosable={false} > - - + + { onUpdate={(keys: any) => setCategoryIds(keys)} /> - - + + { > - +
{imageList.length === 0 && ( @@ -129,37 +124,33 @@ export const UploadImageButton = (props: PropsInterface) => { )} {imageList.map((item) => ( - { props.onSelected(item.url); setShowModal(false); }} - > - - + >
))} - - {imageList.length > 0 && ( - - { - setPage(currentPage); - setSize(currentSize); - }} - defaultCurrent={page} - total={total} - /> - - )} -
+ + {imageList.length > 0 && ( + + { + setPage(currentPage); + setSize(currentSize); + }} + defaultCurrent={page} + total={total} + /> + + )}
diff --git a/src/index.less b/src/index.less index 906d6a1..32ef7db 100644 --- a/src/index.less +++ b/src/index.less @@ -540,6 +540,26 @@ textarea.ant-input { } } +.image-list-box { + width: 100%; + box-sizing: border-box; + padding-left: 10px; + display: grid; + gap: 21px; + grid-template-columns: repeat(5, minmax(0, 1fr)); + margin-bottom: 24px; + .image-item { + width: 100px; + height: 100px; + border-radius: 6px; + aspect-ratio: 1/1; + background-repeat: no-repeat; + background-size: contain; + background-position: center center; + background-color: #f6f6f6; + } +} + .tree-video-title { margin-left: 4px; width: 346px; diff --git a/src/pages/dashboard/index.module.less b/src/pages/dashboard/index.module.less index 62ccd56..2629f12 100644 --- a/src/pages/dashboard/index.module.less +++ b/src/pages/dashboard/index.module.less @@ -67,13 +67,13 @@ grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; .link-mode { - width: 176px; + width: auto; height: 76px; border-radius: 7px; display: flex; align-items: center; box-sizing: border-box; - padding: 24px; + padding: 8%; cursor: pointer; &:hover { background: #fafafa; @@ -99,18 +99,20 @@ border-radius: 7px; display: flex; align-items: center; + flex-direction: row-reverse; margin-top: 24px; .banner { width: 130px; height: 130px; position: absolute; top: 22px; - left: 196px; + left: 20%; z-index: 10; } .link { - margin-left: 352px; + margin-right: 10%; + width: auto; height: 24px; font-size: 14px; font-weight: 400; @@ -175,7 +177,7 @@ margin-right: 8px; } .item-name { - width: 150px; + width: 100px; height: 24px; font-size: 14px; font-weight: 400; diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index fc56d47..415cd1a 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -2,9 +2,6 @@ import React, { useState, useEffect } from "react"; import styles from "./index.module.less"; import { Row, Col, message } from "antd"; import { useNavigate } from "react-router-dom"; -import { DepartmentCreate } from "../department/compenents/create"; -import { MemberCreate } from "../member/compenents/create"; -import { CourseCreate } from "../course/compenents/create"; import banner from "../../assets/images/dashboard/img-a1.png"; import icon from "../../assets/images/dashboard/icon-more.png"; import iconN1 from "../../assets/images/dashboard/icon-n1.png"; @@ -13,10 +10,6 @@ import iconN3 from "../../assets/images/dashboard/icon-n3.png"; export const Dashboard: React.FC = () => { const navigate = useNavigate(); - const [departmentVisible, setDepartmentVisible] = useState(false); - const [memberVisible, setMembeVisible] = useState(false); - const [uploadVideoVisible, setUploadVideoVisible] = useState(false); - const [courseVisible, setCourseVisible] = useState(false); useEffect(() => { renderPieView({ @@ -88,7 +81,7 @@ export const Dashboard: React.FC = () => { label: { show: true, position: "center", - formatter: ("总资源数" + num), // 可以自定义,也可以{a}{b}{c}这种 + formatter: "总资源数" + num, // 可以自定义,也可以{a}{b}{c}这种 textStyle: { // 主标题样式 fontSize: 14, @@ -110,24 +103,6 @@ export const Dashboard: React.FC = () => { return ( <> - { - setDepartmentVisible(false); - }} - /> - { - setMembeVisible(false); - }} - /> - { - setCourseVisible(false); - }} - />
@@ -169,7 +144,7 @@ export const Dashboard: React.FC = () => {
{ - setMembeVisible(true); + navigate("/member"); }} > = () => { > 添加学员
-
+
{ + navigate("/videos"); + }} + > = () => {
{ - setCourseVisible(true); + navigate("/course"); }} > - 新建线上课 + 线上课
{ - setDepartmentVisible(true); + navigate("/department"); }} >