|
|
@ -1,6 +1,6 @@ |
|
|
|
import { useTranslation } from '@/i18n.ts' |
|
|
|
import { Badge, Button, DatePicker, Divider, Form, Image, Popconfirm, Space, Tooltip } from 'antd' |
|
|
|
import { useAtom, useAtomValue,useSetAtom } from 'jotai' |
|
|
|
import { useAtom, useAtomValue, useSetAtom } from 'jotai' |
|
|
|
import { |
|
|
|
deleteVideoAtom, |
|
|
|
saveOrUpdateVideoAtom, videoAtom, videosAtom, videoSearchAtom, videoTypes |
|
|
@ -55,15 +55,17 @@ const Video = () => { |
|
|
|
hideInSearch: true, |
|
|
|
hideInSetting: true, |
|
|
|
formItemProps: { hidden: true }, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
'title': t(`${i18nPrefix}.columns.title`, 'Title'), |
|
|
|
'dataIndex': 'title', |
|
|
|
onHeaderCell: () => { |
|
|
|
return { |
|
|
|
width: 200, |
|
|
|
} |
|
|
|
fixed: 'left', |
|
|
|
ellipsis: true, |
|
|
|
width: 250, |
|
|
|
fieldProps: { |
|
|
|
style: { width: '100%' } |
|
|
|
}, |
|
|
|
colProps: { |
|
|
|
span: 12 |
|
|
@ -78,10 +80,10 @@ const Video = () => { |
|
|
|
{ |
|
|
|
'title': t(`${i18nPrefix}.columns.title_sub`, 'TitleSub'), |
|
|
|
'dataIndex': 'title_sub', |
|
|
|
onHeaderCell: () => { |
|
|
|
return { |
|
|
|
width: 200, |
|
|
|
} |
|
|
|
ellipsis: true, |
|
|
|
width: 250, |
|
|
|
fieldProps: { |
|
|
|
style: { width: '100%' } |
|
|
|
}, |
|
|
|
colProps: { |
|
|
|
span: 12 |
|
|
@ -104,10 +106,9 @@ const Video = () => { |
|
|
|
'dataIndex': 'source_url', |
|
|
|
ellipsis: true, |
|
|
|
copyable: true, |
|
|
|
onHeaderCell: () => { |
|
|
|
return { |
|
|
|
width: 200, |
|
|
|
} |
|
|
|
width: 200, |
|
|
|
fieldProps: { |
|
|
|
style: { width: '100%' } |
|
|
|
}, |
|
|
|
hideInSearch: true, |
|
|
|
}, |
|
|
@ -212,7 +213,7 @@ const Video = () => { |
|
|
|
}, |
|
|
|
render: (_dom, record) => { |
|
|
|
return <TagValue |
|
|
|
tags={categories?.rows.filter(item=>item.id === record.category_id).map(item=>{ |
|
|
|
tags={categories?.rows.filter(item => item.id === record.category_id).map(item => { |
|
|
|
return { |
|
|
|
label: item.name, |
|
|
|
value: item.id |
|
|
@ -313,14 +314,14 @@ const Video = () => { |
|
|
|
'dataIndex': 'remarks', |
|
|
|
hideInSearch: true, |
|
|
|
}, |
|
|
|
/* { |
|
|
|
'title': t(`${i18nPrefix}.columns.pubdate`, 'Pubdate'), |
|
|
|
'dataIndex': 'pubdate', |
|
|
|
valueType: 'dateTime', |
|
|
|
colProps: { |
|
|
|
span: 4 |
|
|
|
} |
|
|
|
},*/ |
|
|
|
/* { |
|
|
|
'title': t(`${i18nPrefix}.columns.pubdate`, 'Pubdate'), |
|
|
|
'dataIndex': 'pubdate', |
|
|
|
valueType: 'dateTime', |
|
|
|
colProps: { |
|
|
|
span: 4 |
|
|
|
} |
|
|
|
},*/ |
|
|
|
{ |
|
|
|
'title': t(`${i18nPrefix}.columns.total`, 'Total'), |
|
|
|
'dataIndex': 'total', |
|
|
@ -350,13 +351,13 @@ const Video = () => { |
|
|
|
'title': t(`${i18nPrefix}.columns.year`, 'Year'), |
|
|
|
'dataIndex': 'year', |
|
|
|
valueType: 'dateYear', |
|
|
|
fieldProps:{ |
|
|
|
style:{ |
|
|
|
fieldProps: { |
|
|
|
style: { |
|
|
|
width: '100%' |
|
|
|
} |
|
|
|
}, |
|
|
|
colProps: { |
|
|
|
span: openFilter? 12: 4, |
|
|
|
span: openFilter ? 12 : 4, |
|
|
|
}, |
|
|
|
render: (_dom, record) => { |
|
|
|
if (record.year === undefined || record.year === null || record.year === 0) { |
|
|
@ -365,7 +366,7 @@ const Video = () => { |
|
|
|
|
|
|
|
return <TagValue |
|
|
|
tags={[ record.year ]} |
|
|
|
wrap={ currentVideo?.id === record.id} |
|
|
|
wrap={currentVideo?.id === record.id} |
|
|
|
value={search?.year} |
|
|
|
single={true} |
|
|
|
onChange={(values) => { |
|
|
@ -616,7 +617,7 @@ const Video = () => { |
|
|
|
] |
|
|
|
} |
|
|
|
] as ProColumns[] |
|
|
|
}, [ isDeleting, category, isCategoryFetching, categories, isCateLoading, category, currentVideo, search, openFilter ]) |
|
|
|
}, [ isDeleting, category, isCategoryFetching, categories, isCateLoading, category, currentVideo, search, openFilter ]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
@ -632,7 +633,7 @@ const Video = () => { |
|
|
|
}, [ isSuccess ]) |
|
|
|
|
|
|
|
return ( |
|
|
|
<ListPageLayout className={styles.container}> |
|
|
|
<ListPageLayout className={styles.container}> |
|
|
|
<ProTable |
|
|
|
rowKey="id" |
|
|
|
headerTitle={t(`${i18nPrefix}.title`, '视频管理')} |
|
|
@ -676,7 +677,7 @@ const Video = () => { |
|
|
|
] |
|
|
|
}} |
|
|
|
scroll={{ |
|
|
|
x: 3500, y: 'calc(100vh - 290px)' |
|
|
|
x: 3800, y: 'calc(100vh - 290px)' |
|
|
|
}} |
|
|
|
onRow={(record) => { |
|
|
|
return { |
|
|
|