From e7ba7d7dd1fb2f44f991f9d89d5b79e7d5c5bd89 Mon Sep 17 00:00:00 2001 From: dark Date: Mon, 10 Jun 2024 17:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=97=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cms/collect/index.tsx | 43 +++++++++++++++----------- src/pages/cms/video/index.tsx | 59 ++++++++++++++++++------------------ src/pages/cms/video_cloud/index.tsx | 26 ++++++++-------- src/pages/cms/video_magnet/index.tsx | 26 ++++++++-------- src/pages/videos/list/index.tsx | 5 ++- 5 files changed, 85 insertions(+), 74 deletions(-) diff --git a/src/pages/cms/collect/index.tsx b/src/pages/cms/collect/index.tsx index cad0353..8ecb8b8 100644 --- a/src/pages/cms/collect/index.tsx +++ b/src/pages/cms/collect/index.tsx @@ -40,9 +40,11 @@ const Collect = () => { { 'title': t(`${i18nPrefix}.columns.name`, '站点名称'), 'dataIndex': 'name', - onHeaderCell: () => ({ - width: 200, - }), + fixed: 'left', + width: 200, + fieldProps: { + style: { width: '100%' } + }, ellipsis: true, formItemProps: { width: undefined, @@ -55,17 +57,19 @@ const Collect = () => { 'title': t(`${i18nPrefix}.columns.weights`, '权重'), 'dataIndex': 'weights', valueType: 'digit', - onHeaderCell: () => ({ - width: 80, - }), + width: 100, + fieldProps: { + style: { width: '100%' } + }, }, { 'title': t(`${i18nPrefix}.columns.site_auth`, '搜片认证站点'), 'dataIndex': 'site_auth', valueType: 'switch', - onHeaderCell: () => ({ - width: 100, - }), + width: 100, + fieldProps: { + style: { width: '100%' } + }, render: (_dom, record) => { return } @@ -74,9 +78,10 @@ const Collect = () => { 'title': t(`${i18nPrefix}.columns.site_cooperation`, '搜片合作优质站点'), 'dataIndex': 'site_cooperation', valueType: 'switch', - onHeaderCell: () => ({ - width: 130, - }), + width: 130, + fieldProps: { + style: { width: '100%' } + }, colProps: { span: 8 }, @@ -88,9 +93,10 @@ const Collect = () => { { 'title': t(`${i18nPrefix}.columns.icon_cdn`, '站点图标'), 'dataIndex': 'icon_cdn', - onHeaderCell: () => ({ - width: 80, - }), + width: 80, + fieldProps: { + style: { width: '100%' } + }, render: (_text, record) => { return }, @@ -98,9 +104,10 @@ const Collect = () => { { 'title': t(`${i18nPrefix}.columns.url`, '站点URL'), 'dataIndex': 'url', - onHeaderCell: () => ({ - width: 150, - }), + width: 200, + fieldProps: { + style: { width: '100%' } + }, ellipsis: true, copyable: true, }, diff --git a/src/pages/cms/video/index.tsx b/src/pages/cms/video/index.tsx index 7e022ee..934d8ba 100644 --- a/src/pages/cms/video/index.tsx +++ b/src/pages/cms/video/index.tsx @@ -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 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 { @@ -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 ( - + { ] }} scroll={{ - x: 3500, y: 'calc(100vh - 290px)' + x: 3800, y: 'calc(100vh - 290px)' }} onRow={(record) => { return { diff --git a/src/pages/cms/video_cloud/index.tsx b/src/pages/cms/video_cloud/index.tsx index e0a1658..0e19f4c 100644 --- a/src/pages/cms/video_cloud/index.tsx +++ b/src/pages/cms/video_cloud/index.tsx @@ -65,10 +65,11 @@ const VideoCloud = () => { { '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 @@ -83,10 +84,10 @@ const VideoCloud = () => { { '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 @@ -109,10 +110,9 @@ const VideoCloud = () => { 'dataIndex': 'source_url', ellipsis: true, copyable: true, - onHeaderCell: () => { - return { - width: 200, - } + width: 200, + fieldProps: { + style: { width: '100%' } }, hideInSearch: true, }, @@ -682,7 +682,7 @@ const VideoCloud = () => { }} scroll={{ - x: 3500, y: 'calc(100vh - 290px)' + x: 3800, y: 'calc(100vh - 290px)' }} onRow={(record) => { return { diff --git a/src/pages/cms/video_magnet/index.tsx b/src/pages/cms/video_magnet/index.tsx index 42ed674..6ae38f5 100644 --- a/src/pages/cms/video_magnet/index.tsx +++ b/src/pages/cms/video_magnet/index.tsx @@ -65,10 +65,11 @@ const VideoMagnet = () => { { '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 @@ -83,10 +84,10 @@ const VideoMagnet = () => { { '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 @@ -109,10 +110,9 @@ const VideoMagnet = () => { 'dataIndex': 'source_url', ellipsis: true, copyable: true, - onHeaderCell: () => { - return { - width: 200, - } + width: 200, + fieldProps: { + style: { width: '100%' } }, hideInSearch: true, }, @@ -681,7 +681,7 @@ const VideoMagnet = () => { ] }} scroll={{ - x: 3500, y: 'calc(100vh - 290px)' + x: 3800, y: 'calc(100vh - 290px)' }} onRow={(record) => { return { diff --git a/src/pages/videos/list/index.tsx b/src/pages/videos/list/index.tsx index 69d695e..7aeb20d 100644 --- a/src/pages/videos/list/index.tsx +++ b/src/pages/videos/list/index.tsx @@ -63,6 +63,8 @@ const Video = () => { { 'title': t(`${i18nPrefix}.columns.title`, 'Title'), 'dataIndex': 'title', + fixed: 'left', + ellipsis: true, width: 200, fieldProps: { style: { width: '100%' } @@ -80,6 +82,7 @@ const Video = () => { { 'title': t(`${i18nPrefix}.columns.title_sub`, 'TitleSub'), 'dataIndex': 'title_sub', + ellipsis: true, width: 200, fieldProps: { style: { width: '100%' } @@ -367,7 +370,7 @@ const Video = () => { const url = `/api/v1/videos/image/${record.video_id}` return cover + }} style={{ height: 40 }}/> }, }, {