💄 新闻素材推入编辑后直接跳转

This commit is contained in:
LittleBoy 2024-12-22 00:12:26 +08:00
parent e9c5e241f3
commit b1efffc9fe
3 changed files with 6 additions and 3 deletions

View File

@ -177,7 +177,7 @@
} }
.data-list-container { .data-list-container {
height: calc(100vh - var(--app-header-header) - 300px); height: calc(100vh - var(--app-header-header) - 200px);
overflow: auto; overflow: auto;
.data-list-container-inner { .data-list-container-inner {

View File

@ -3,14 +3,17 @@ import {showToast} from "@/components/message.ts";
import {useState} from "react"; import {useState} from "react";
import {push2article} from "@/service/api/news.ts"; import {push2article} from "@/service/api/news.ts";
import {IconArrowRight} from "@/components/icons"; import {IconArrowRight} from "@/components/icons";
import {useNavigate} from "react-router-dom";
export default function ButtonPushNews2Article(props: { ids: Id[] }) { export default function ButtonPushNews2Article(props: { ids: Id[]; }) {
const {modal} = App.useApp(); const {modal} = App.useApp();
const [loading,setLoading] = useState(false) const [loading,setLoading] = useState(false)
const navigate = useNavigate();
const handlePush = () => { const handlePush = () => {
setLoading(true) setLoading(true)
push2article(props.ids).then(() => { push2article(props.ids).then(() => {
showToast('推送成功', 'success') showToast('推送成功', 'success')
navigate('/edit')
}).catch(() => { }).catch(() => {
showToast('推送失败', 'error') showToast('推送失败', 'error')
}).finally(() => { }).finally(() => {

View File

@ -89,7 +89,7 @@ export default function NewsIndex() {
</div> </div>
</div> </div>
<InfiniteScroller <InfiniteScroller
className="grid grid-cols-3 gap-4 lg:grid-cols-4" className="grid grid-cols-3 gap-4 lg:grid-cols-4 pb-10"
pagination={data?.pagination} pagination={data?.pagination}
loading={loading} loading={loading}
onCallback={(page) => { onCallback={(page) => {