diff --git a/src/pages/resource/images/index.module.less b/src/pages/resource/images/index.module.less index 1ace70d..482f8e3 100644 --- a/src/pages/resource/images/index.module.less +++ b/src/pages/resource/images/index.module.less @@ -19,3 +19,16 @@ line-height: 30px; display: flex; } + +.closeButton { + position: absolute; + right: -8px; + top: -8px; +} + + +.imageItem{ + position: relative; + width: 120px; + height: 80px; +} \ No newline at end of file diff --git a/src/pages/resource/images/index.tsx b/src/pages/resource/images/index.tsx index ea5d6e1..93f752c 100644 --- a/src/pages/resource/images/index.tsx +++ b/src/pages/resource/images/index.tsx @@ -3,7 +3,7 @@ import { Button, Row, Col, - Modal, + Popconfirm, Image, Empty, message, @@ -11,7 +11,6 @@ import { } from "antd"; import { resource, resourceCategory } from "../../../api"; import styles from "./index.module.less"; -import { CreateResourceCategory } from "../../../compenents/create-rs-category"; import { CloseOutlined } from "@ant-design/icons"; import { UploadImageSub } from "../../../compenents/upload-image-button/upload-image-sub"; import { TreeCategory, PerButton } from "../../../compenents"; @@ -45,7 +44,6 @@ export const ResourceImagesPage = () => { sort: 0, }, ]); - const [defaultCid, setDefaultCid] = useState(0); const [refreshCategories, setRefreshCategories] = useState(1); const [imageList, setImageList] = useState([]); @@ -54,6 +52,7 @@ export const ResourceImagesPage = () => { const [size, setSize] = useState(12); const [total, setTotal] = useState(0); const [category_ids, setCategoryIds] = useState([]); + const [selected, setSelected] = useState(0); // 获取图片资源的分类 const getCategories = () => { @@ -77,8 +76,9 @@ export const ResourceImagesPage = () => { // 获取图片列表 const getImageList = () => { + let categoryIds = category_ids.join(","); resource - .resourceList(page, size, "", "", "", "IMAGE", category_ids) + .resourceList(page, size, "", "", "", "IMAGE", categoryIds) .then((res: any) => { setTotal(res.data.result.total); setImageList(res.data.result.data); @@ -119,7 +119,7 @@ export const ResourceImagesPage = () => { { resetImageList(); }} @@ -139,19 +139,29 @@ export const ResourceImagesPage = () => { )} {imageList.map((item) => ( - { - console.log(item.url); - }} - > - + +
+ + removeCategory(item.id)} + okText="确定" + cancelText="取消" + > +
))}