diff --git a/src/assets/core.scss b/src/assets/core.scss index cb66d30..7897b61 100644 --- a/src/assets/core.scss +++ b/src/assets/core.scss @@ -343,9 +343,11 @@ .page-action { @apply fixed right-10 bottom-10 flex flex-col gap-4; button { - @apply border-0 min-w-[120px] h-[40px] rounded-3xl text-white pr-4 flex items-center justify-between; + @apply border-0 min-w-[120px] h-[40px] rounded-3xl pr-4 flex items-center justify-between drop-shadow; .text { flex: 1; + text-align: left; + padding-left: 15px; } &:disabled { diff --git a/src/components/scoller/button-to-top.tsx b/src/components/scoller/button-to-top.tsx index 66b7b52..6353d62 100644 --- a/src/components/scoller/button-to-top.tsx +++ b/src/components/scoller/button-to-top.tsx @@ -10,7 +10,7 @@ type ButtonToTopProps = { export default function ButtonToTop(props: ButtonToTopProps) { return (
- {props.visible &&
) diff --git a/src/pages/news/components/button-news-download.tsx b/src/pages/news/components/button-news-download.tsx index 6c0129c..5fa50c5 100644 --- a/src/pages/news/components/button-news-download.tsx +++ b/src/pages/news/components/button-news-download.tsx @@ -65,6 +65,7 @@ async function downloadAsZip(list: NewsInfo[]) { export default function ButtonNewsDownload(props: { ids: Id[] }) { const [loading, setLoading] = useState(false) const onDownloadClick = async (ids: Id[]) => { + if(loading) return; if (props.ids.length === 0) { showToast('请选择要下载的新闻', 'warning') return @@ -80,13 +81,13 @@ export default function ButtonNewsDownload(props: { ids: Id[] }) { } } return ( - + + ) } diff --git a/src/pages/news/components/button-push-news2article.tsx b/src/pages/news/components/button-push-news2article.tsx index 3d43247..333f621 100644 --- a/src/pages/news/components/button-push-news2article.tsx +++ b/src/pages/news/components/button-push-news2article.tsx @@ -1,4 +1,4 @@ -import {App, Button} from "antd"; +import {App} from "antd"; import {showToast} from "@/components/message.ts"; import {useState} from "react"; import {push2article} from "@/service/api/news.ts"; @@ -22,7 +22,7 @@ export default function ButtonPushNews2Article(props: { ids: Id[]; }) { } const onPushClick = () => { if (props.ids.length === 0) { - showToast('请选择要推送的新闻', 'warning') + showToast('请选择要推入编辑的新闻', 'warning') return } modal.confirm({ @@ -33,14 +33,13 @@ export default function ButtonPushNews2Article(props: { ids: Id[]; }) { }) } return ( - + + ) } \ No newline at end of file diff --git a/src/pages/news/components/button-push2video.tsx b/src/pages/news/components/button-push2video.tsx index 801ff1b..b2cd512 100644 --- a/src/pages/news/components/button-push2video.tsx +++ b/src/pages/news/components/button-push2video.tsx @@ -1,8 +1,8 @@ -import {Button, Modal} from "antd"; +import { Modal} from "antd"; import React, {useState} from "react"; import {showErrorToast, showToast} from "@/components/message.ts"; import {push2video} from "@/service/api/article.ts"; -import {IconArrowRight, IconDelete} from "@/components/icons"; +import {IconArrowRight} from "@/components/icons"; export default function ButtonPush2Video(props: { ids: Id[]; onSuccess?: () => void; }) { @@ -29,16 +29,15 @@ export default function ButtonPush2Video(props: { ids: Id[]; onSuccess?: () => v } return (
- + +
) } \ No newline at end of file diff --git a/src/pages/news/edit.tsx b/src/pages/news/edit.tsx index b593622..b89673f 100644 --- a/src/pages/news/edit.tsx +++ b/src/pages/news/edit.tsx @@ -77,10 +77,9 @@ export default function NewEdit() { { handleCheckAll(!state.checkAll) }}>全选 - { + { handleCheckAll(e.target.checked) - }} - indeterminate={selectedRowKeys.length > 0 && selectedRowKeys.length < data?.list.length}> + }} />
diff --git a/src/pages/news/index.tsx b/src/pages/news/index.tsx index 1e7be0b..494fc5a 100644 --- a/src/pages/news/index.tsx +++ b/src/pages/news/index.tsx @@ -1,4 +1,4 @@ -import React, {useState} from "react"; +import React, {useRef, useState} from "react"; import {Checkbox, Divider, Empty, Modal, Pagination, Space} from "antd"; import {useRequest} from "ahooks"; @@ -9,7 +9,8 @@ import {formatTime} from "@/util/strings.ts"; import ButtonPushNews2Article from "@/pages/news/components/button-push-news2article.tsx"; import ButtonNewsDownload from "@/pages/news/components/button-news-download.tsx"; import {clsx} from "clsx"; -import InfiniteScroller from "@/components/scoller/infinite-scroller.tsx"; +import InfiniteScroller, {InfiniteScrollerRef} from "@/components/scoller/infinite-scroller.tsx"; +import ButtonToTop from "@/components/scoller/button-to-top.tsx"; export default function NewsIndex() { @@ -21,6 +22,7 @@ export default function NewsIndex() { const [state, setState] = useState<{ checkAll?: boolean; + showToTop?: boolean; }>({}) const [data, setData] = useState>(); @@ -58,6 +60,7 @@ export default function NewsIndex() { setCheckedId([]) } } + const scrollerRef = useRef(null) return (
@@ -79,22 +82,24 @@ export default function NewsIndex() {
- 总共 {data?.list.length} 条 + 总共 {data?.list?.length || 0} 条 已选 {checkedId.length} 条
{ handleCheckAll(!state.checkAll) }}>全选 - { + { handleCheckAll(e.target.checked) }}>
setState({showToTop: top > 30})} onCallback={(page) => { setParams({...params, pagination: {...params.pagination, page}}) }} @@ -150,6 +155,7 @@ export default function NewsIndex() {
+ scrollerRef.current?.scrollToPosition(0)} />
diff --git a/src/pages/video/components/button-push2room.tsx b/src/pages/video/components/button-push2room.tsx index 8e3efc1..1024e3a 100644 --- a/src/pages/video/components/button-push2room.tsx +++ b/src/pages/video/components/button-push2room.tsx @@ -34,9 +34,17 @@ export default function ButtonPush2Room(props: { ids: Id[]; list: VideoInfo[];on }) } return ( - + +
+ +
) } \ No newline at end of file diff --git a/src/pages/video/index.tsx b/src/pages/video/index.tsx index 084ba6c..d9a8d30 100644 --- a/src/pages/video/index.tsx +++ b/src/pages/video/index.tsx @@ -176,13 +176,12 @@ export default function VideoIndex() {
scrollerRef.current?.scrollToPosition(0)}/> - {/**/} { showToast('删除成功!', 'success') @@ -190,7 +189,7 @@ export default function VideoIndex() { }} > 批量删除 - +