Browse Source

增加id第3方网页跳转

main
dark 6 months ago
parent
commit
b8e651e3ab
  1. 64
      src/pages/videos/list/index.tsx

64
src/pages/videos/list/index.tsx

@ -21,7 +21,7 @@ import { categoryByIdAtom, categoryIdAtom } from '@/store/videos/category.ts'
import TagPro from '@/components/tag-pro/TagPro.tsx' import TagPro from '@/components/tag-pro/TagPro.tsx'
import TagValue from '@/components/tag-value/TagValue.tsx' import TagValue from '@/components/tag-value/TagValue.tsx'
import { useStyle } from './style' import { useStyle } from './style'
import { FilterOutlined } from '@ant-design/icons'
import { ExportOutlined, FilterOutlined } from '@ant-design/icons'
import { getValueCount } from '@/utils' import { getValueCount } from '@/utils'
const i18nPrefix = 'videos.list' const i18nPrefix = 'videos.list'
@ -214,11 +214,20 @@ const Video = () => {
{ {
'title': t(`${i18nPrefix}.columns.douban_id`, 'DouBanId'), 'title': t(`${i18nPrefix}.columns.douban_id`, 'DouBanId'),
'dataIndex': 'douban_id', 'dataIndex': 'douban_id',
hideInTable: true,
width: 120,
fieldProps: {
style: { width: '100%' }
},
// hideInTable: true,
colProps: { colProps: {
span: 6 span: 6
}, render: (_dom, record) => {
return <TagValue
},
render: (_dom, record) => {
if(!record.douban_id) return null
return <Space.Compact>
<a href={`https://movie.douban.com/subject/${record.douban_id}`}
target={'_blank'}><ExportOutlined/></a>
<TagValue
tags={[ record.douban_id ]} tags={[ record.douban_id ]}
wrap={currentVideo?.id === record.id} wrap={currentVideo?.id === record.id}
value={search?.douban_id} value={search?.douban_id}
@ -232,16 +241,27 @@ const Video = () => {
setFilterOpen(true) setFilterOpen(true)
}} }}
/> />
</Space.Compact>
}, },
}, },
{ {
'title': t(`${i18nPrefix}.columns.imdb_id`, 'ImdbId'), 'title': t(`${i18nPrefix}.columns.imdb_id`, 'ImdbId'),
'dataIndex': 'imdb_id', 'dataIndex': 'imdb_id',
hideInTable: true,
width: 120,
fieldProps: {
style: { width: '100%' }
},
// hideInTable: true,
colProps: { colProps: {
span: 6 span: 6
}, render: (_dom, record) => {
return <TagValue
},
render: (_dom, record) => {
if(!record.imdb_id) return null
return <Space.Compact>
<a href={`https://www.imdb.com/title/${record.imdb_id}`} target={'_blank'}>
<ExportOutlined/>
</a>
<TagValue
tags={[ record.imdb_id ]} tags={[ record.imdb_id ]}
wrap={currentVideo?.id === record.id} wrap={currentVideo?.id === record.id}
value={search?.imdb_id} value={search?.imdb_id}
@ -255,16 +275,25 @@ const Video = () => {
setFilterOpen(true) setFilterOpen(true)
}} }}
/> />
</Space.Compact>
}, },
}, },
{ {
'title': t(`${i18nPrefix}.columns.rt_id`, 'RtId'), 'title': t(`${i18nPrefix}.columns.rt_id`, 'RtId'),
'dataIndex': 'rt_id', 'dataIndex': 'rt_id',
hideInTable: true,
width: 120,
fieldProps: {
style: { width: '100%' }
},
colProps: { colProps: {
span: 6 span: 6
}, render: (_dom, record) => {
return <TagValue
},
render: (_dom, record) => {
if(!record.rt_id) return null
return <Space.Compact>
<a href={`https://www.rottentomatoes.com/m/${record.rt_id}`} target={'_blank'}
><ExportOutlined/></a>
<TagValue
tags={[ record.rt_id ]} tags={[ record.rt_id ]}
wrap={currentVideo?.id === record.id} wrap={currentVideo?.id === record.id}
value={search?.rt_id} value={search?.rt_id}
@ -278,16 +307,24 @@ const Video = () => {
setFilterOpen(true) setFilterOpen(true)
}} }}
/> />
</Space.Compact>
}, },
}, },
{ {
'title': t(`${i18nPrefix}.columns.mal_id`, 'MalId'), 'title': t(`${i18nPrefix}.columns.mal_id`, 'MalId'),
'dataIndex': 'mal_id', 'dataIndex': 'mal_id',
hideInTable: true,
width: 120,
fieldProps: {
style: { width: '100%' }
},
colProps: { colProps: {
span: 6 span: 6
}, render: (_dom, record) => {
return <TagValue
},
render: (_dom, record) => {
if (!record.mal_id) return null
return <Space.Compact>
<a href={`https://myanimelist.net/anime/${record.mal_id}`} target={'_blank'}><ExportOutlined/></a>
<TagValue
tags={[ record.mal_id ]} tags={[ record.mal_id ]}
wrap={currentVideo?.id === record.id} wrap={currentVideo?.id === record.id}
value={search?.mal_id} value={search?.mal_id}
@ -301,6 +338,7 @@ const Video = () => {
setFilterOpen(true) setFilterOpen(true)
}} }}
/> />
</Space.Compact>
}, },
}, },
{ {

Loading…
Cancel
Save