当前{state.activeIndex == -1 ? '暂未播放' : `播放到${state.activeIndex}条`},
共{videoData.length}条
@@ -250,6 +256,7 @@ export default function LiveIndex() {
setState({showToTop: top > 30})}
onCallback={() => {
}}
@@ -274,6 +281,7 @@ export default function LiveIndex() {
id={v.id}
key={index}
active={state.activeIndex == index}
+ playing={state.activeIndex == index}
className={`list-item-${index} mt-3 mb-2`}
checked={checkedIdArray.includes(v.id)}
onCheckedChange={(checked) => {
diff --git a/src/pages/news/components/search-panel.tsx b/src/pages/news/components/search-panel.tsx
index 431e836..cc6e889 100644
--- a/src/pages/news/components/search-panel.tsx
+++ b/src/pages/news/components/search-panel.tsx
@@ -202,9 +202,10 @@ export default function SearchPanel({onSearch,defaultParams}: SearchPanelProps)
{
- tags.filter(s => s.value !== 999999).map(it => (
-
s.value !== 999999).map(it => {
+ const currentPinned = pinnedTag?.includes(Number(it.value));
+ return (
{
const value = Number(it.value)
@@ -215,10 +216,11 @@ export default function SearchPanel({onSearch,defaultParams}: SearchPanelProps)
}
}}>
{it.label}
- {pinnedTag?.includes(Number(it.value)) &&
+ {currentPinned &&
}
)
- )
+ })
+
}
diff --git a/src/pages/news/components/style.module.scss b/src/pages/news/components/style.module.scss
index 239bbc7..073e227 100644
--- a/src/pages/news/components/style.module.scss
+++ b/src/pages/news/components/style.module.scss
@@ -78,8 +78,9 @@
.header{
@apply bg-primary-bg;
.col{
-
+ @apply text-sm;
height: 42px;
+
}
.operations{
}
diff --git a/src/pages/news/edit.tsx b/src/pages/news/edit.tsx
index 63b010f..05b7073 100644
--- a/src/pages/news/edit.tsx
+++ b/src/pages/news/edit.tsx
@@ -10,7 +10,7 @@ import ButtonPush2Video from "@/pages/news/components/button-push2video.tsx";
import styles from './components/style.module.scss'
import InfiniteScroller, {InfiniteScrollerRef} from "@/components/scoller/infinite-scroller.tsx";
-import {IconDelete, IconEdit} from "@/components/icons";
+import {IconDelete, IconWarningCircle} from "@/components/icons";
import {clsx} from "clsx";
import ButtonToTop from "@/components/scoller/button-to-top.tsx";
import ButtonDeleteBatch from "@/pages/news/components/button-delete-batch.tsx";
@@ -58,11 +58,11 @@ export default function NewEdit() {
setSelectedRowKeys([])
}
}
- const scrollerRef = useRef
(null)
- const handleDelete = (id)=>{
- deleteByIds([id]).then(()=>{
+ const scrollerRef = useRef(null)
+ const handleDelete = (id) => {
+ deleteByIds([id]).then(() => {
refresh()
- showToast('删除成功','success')
+ showToast('删除成功', 'success')
}).catch(showErrorToast)
}
@@ -83,9 +83,10 @@ export default function NewEdit() {
{
handleCheckAll(!state.checkAll)
}}>全选
- {
- handleCheckAll(e.target.checked)
- }} />
+ {
+ handleCheckAll(e.target.checked)
+ }}/>
@@ -102,7 +103,8 @@ export default function NewEdit() {
...prev,
pagination: {page, limit: 10}
}))
- }} onScroll={(top)=> setState({showToTop: top > 30})} loading={loading} pagination={data?.pagination}>
+ }} onScroll={(top) => setState({showToTop: top > 30})} loading={loading}
+ pagination={data?.pagination}>
{data?.list?.map((item, i) => {
const checked = selectedRowKeys.includes(item.id)
@@ -129,9 +131,17 @@ export default function NewEdit() {
{/*
*/}
-
{
- handleDelete(item.id)
- }}>
+ }
+ title={'你确定要删除吗?'}
+ description={'删除后需从新闻素材中重新选择'}
+ onConfirm={() => {
+ handleDelete(item.id)
+ }}
+ >
- scrollerRef.current?.scrollToPosition(0)} />
- {selectedRowKeys?.length >0 && }
+ scrollerRef.current?.scrollToPosition(0)}/>
+ {selectedRowKeys?.length > 0 && }
diff --git a/src/pages/video/index.tsx b/src/pages/video/index.tsx
index 914e822..12fd083 100644
--- a/src/pages/video/index.tsx
+++ b/src/pages/video/index.tsx
@@ -1,4 +1,4 @@
-import {Checkbox, Empty} from "antd";
+import {Checkbox, Empty, Space} from "antd";
import React, {useEffect, useMemo, useRef, useState} from "react";
import {DndContext} from "@dnd-kit/core";
import {arrayMove, SortableContext} from "@dnd-kit/sortable";
@@ -16,7 +16,6 @@ import ButtonToTop from "@/components/scoller/button-to-top.tsx";
import InfiniteScroller, {InfiniteScrollerRef} from "@/components/scoller/infinite-scroller.tsx";
import {IconDelete} from "@/components/icons";
import {useLocation} from "react-router-dom";
-import {playState} from "@/service/api/live.ts";
export default function VideoIndex() {
const [editId, setEditId] = useState(-1)
@@ -32,12 +31,14 @@ export default function VideoIndex() {
playState: {
current: -1,
total: -1
- }
+ },
+ loading:false
})
const [checkedIdArray, setCheckedIdArray] = useState
([])
// 加载列表
const loadList = (needReset = true) => {
+ setState({loading: true})
getList().then((ret) => {
const list = ret.list || []
setVideoData(list)
@@ -50,6 +51,9 @@ export default function VideoIndex() {
// 每5s重新获取一次最新数据
setTimeout(() => loadList(false), 5000)
}
+ }).catch(showErrorToast)
+ .finally(()=>{
+ setState({loading: false})
})
}
@@ -112,12 +116,13 @@ export default function VideoIndex() {
}).catch(showErrorToast)
}
- return (
+ return (
+
预览视频 - 点击视频列表播放
-
+
{
@@ -137,11 +142,15 @@ export default function VideoIndex() {
{formatDuration(state.playState.current)} / {formatDuration(state.playState.total)}
-
+
-
-
-
+
No.
@@ -159,7 +168,7 @@ export default function VideoIndex() {
-
setState({showToTop: top > 30})}>
+ setState({showToTop: top > 30})}>
{
videoData.length == 0 ?
:
diff --git a/src/types/api.d.ts b/src/types/api.d.ts
index 4d0fada..347fb0d 100644
--- a/src/types/api.d.ts
+++ b/src/types/api.d.ts
@@ -98,6 +98,7 @@ declare interface VideoInfo {
article_id: number;
status: number;
publish_time?: number|string;
+ ctime?: number|string;
}
// room live
declare interface LiveVideoInfo {
@@ -111,6 +112,7 @@ declare interface LiveVideoInfo {
status: number;
order_no: string;
publish_time?: number|string;
+ ctime?: number|string;
}
declare interface LiveState{
diff --git a/tailwind.config.js b/tailwind.config.js
index 9b69019..7c077de 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -11,6 +11,11 @@ const themeConfig = {
'active': '#FFE0E0',
'primary-red':'#F5222D',
'primary-red-70':'rgba(245,34,45,0.7)',
+
+ 'popconfirm-bg':'#ff5C5C',
+ 'popconfirm-btn-primary-hover':'#f15656',
+ 'popconfirm-btn-cancel':'#818181',
+ 'popconfirm-btn-cancel-hover':'rgba(71, 71, 71, 1)',
},
widths:{
'chat-avatar-size': '32px',
@@ -48,6 +53,9 @@ export default {
},
backgroundColor: {
...themeConfig.colors,
+ },
+ textColor: {
+ ...themeConfig.colors,
}
},
screens: {