Browse Source

增加id第3方网页跳转

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

168
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,93 +214,131 @@ 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
tags={[ record.douban_id ]}
wrap={currentVideo?.id === record.id}
value={search?.douban_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
douban_id: values[0],
}
})
setFilterOpen(true)
}}
/>
},
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 ]}
wrap={currentVideo?.id === record.id}
value={search?.douban_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
douban_id: values[0],
}
})
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
tags={[ record.imdb_id ]}
wrap={currentVideo?.id === record.id}
value={search?.imdb_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
imdb_id: values[0],
}
})
setFilterOpen(true)
}}
/>
},
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 ]}
wrap={currentVideo?.id === record.id}
value={search?.imdb_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
imdb_id: values[0],
}
})
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
tags={[ record.rt_id ]}
wrap={currentVideo?.id === record.id}
value={search?.rt_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
rt_id: values[0],
}
})
setFilterOpen(true)
}}
/>
},
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 ]}
wrap={currentVideo?.id === record.id}
value={search?.rt_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
rt_id: values[0],
}
})
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
tags={[ record.mal_id ]}
wrap={currentVideo?.id === record.id}
value={search?.mal_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
mal_id: values[0],
}
})
setFilterOpen(true)
}}
/>
},
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 ]}
wrap={currentVideo?.id === record.id}
value={search?.mal_id}
onChange={(values) => {
setSearch((prev: any) => {
return {
...prev,
mal_id: values[0],
}
})
setFilterOpen(true)
}}
/>
</Space.Compact>
}, },
}, },
{ {

Loading…
Cancel
Save