Browse Source

修复columns宽度

main
dark 4 months ago
parent
commit
d9c35f52fa
  1. 2
      src/locales/lang/pages/videos/list/zh-CN.ts
  2. 99
      src/pages/videos/list/index.tsx

2
src/locales/lang/pages/videos/list/zh-CN.ts

@ -44,7 +44,7 @@ export default {
douban_score: '豆瓣评分',
douban_id: '豆瓣ID',
imdb_score: 'imdb评分',
imdb_id: 'imdb的id',
imdb_id: 'imdbId',
content: '内容',
created_at: '创建时间',
updated_at: '更新时间'

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

@ -8,13 +8,11 @@ import {
saveOrUpdateVideoAtom, videosAtom, videoSearchAtom, videoTypes
} from '@/store/videos/video.ts'
import { useEffect, useMemo, useState } from 'react'
import Switch from '@/components/switch'
import Action from '@/components/action/Action.tsx'
import {
BetaSchemaForm,
ProColumns,
ProFormColumnsType,
ProFormDatePicker,
ProFormUploadButton,
ProTable
} from '@ant-design/pro-components'
@ -57,22 +55,20 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.title`, 'Title'),
'dataIndex': 'title',
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
colProps: {
span: 8
}
},
},
{
'title': t(`${i18nPrefix}.columns.title_sub`, 'TitleSub'),
'dataIndex': 'title_sub',
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
colProps: {
span: 16
@ -82,8 +78,10 @@ const Video = () => {
'title': t(`${i18nPrefix}.columns.type_id`, 'TypeId'),
'dataIndex': 'type_id',
valueType: 'select',
width: 100,
fieldProps: {
options: videoTypes,
style: { width: '100%' }
},
render: (_dom, record) => {
return t(`${i18nPrefix}.type_id.${record.type_id}`)
@ -106,6 +104,10 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.year`, 'Year'),
'dataIndex': 'year',
width: 100,
fieldProps: {
style: { width: '100%' }
},
valueType: 'dateYear',
colProps: {
span: 4
@ -125,6 +127,10 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.category_id`, 'CategoryId'),
'dataIndex': 'class_name',
width: 100,
fieldProps: {
style: { width: '100%' }
},
colProps: {
span: 12
@ -133,6 +139,7 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.douban_id`, 'DouBanId'),
'dataIndex': 'douban_id',
hideInTable: true,
colProps: {
span: 6
},
@ -140,6 +147,7 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.imdb_id`, 'ImdbId'),
'dataIndex': 'imdb_id',
hideInTable: true,
colProps: {
span: 6
},
@ -147,6 +155,7 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.rt_id`, 'RtId'),
'dataIndex': 'rt_id',
hideInTable: true,
colProps: {
span: 6
},
@ -154,6 +163,7 @@ const Video = () => {
{
'title': t(`${i18nPrefix}.columns.mal_id`, 'MalId'),
'dataIndex': 'mal_id',
hideInTable: true,
colProps: {
span: 6
},
@ -187,29 +197,37 @@ const Video = () => {
'title': t(`${i18nPrefix}.columns.actor`, 'Actor'),
'dataIndex': 'actor',
ellipsis: true,
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
},
{
'title': t(`${i18nPrefix}.columns.director`, 'Director'),
'dataIndex': 'director'
'dataIndex': 'director',
width: 200,
fieldProps: {
style: { width: '100%' }
},
},
{
'title': t(`${i18nPrefix}.columns.writer`, 'Writer'),
'dataIndex': 'writer'
'dataIndex': 'writer',
width: 200,
fieldProps: {
style: { width: '100%' }
},
},
{
'title': t(`${i18nPrefix}.columns.content`, 'Content'),
'dataIndex': 'content',
valueType: 'textarea',
ellipsis: true,
onHeaderCell: () => ({
width: 200,
}),
width: 200,
fieldProps: {
style: { width: '100%' }
},
},
// {
// 'title': t(`${i18nPrefix}.columns.remarks`, 'Remarks'),
@ -222,10 +240,9 @@ const Video = () => {
'dataIndex': 'tag',
valueType: 'textarea',
ellipsis: true,
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
renderFormItem: (schema, config) => {
return <TagPro loading={isCategoryFetching}
@ -236,10 +253,9 @@ const Video = () => {
'title': t(`${i18nPrefix}.columns.area`, 'Area'),
'dataIndex': 'area',
ellipsis: true,
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
renderFormItem: (schema, config) => {
return <TagPro loading={isCategoryFetching}
@ -250,10 +266,9 @@ const Video = () => {
'title': t(`${i18nPrefix}.columns.lang`, 'Lang'),
'dataIndex': 'lang',
ellipsis: true,
onHeaderCell: () => {
return {
width: 200,
}
width: 200,
fieldProps: {
style: { width: '100%' }
},
renderFormItem: (schema, config) => {
return <TagPro loading={isCategoryFetching}
@ -285,14 +300,7 @@ const Video = () => {
formItemProps: { hidden: true },
hideInTable: true,
},
{
'title': t(`${i18nPrefix}.columns.douban_id`, 'DoubanId'),
'dataIndex': 'douban_id',
hideInSearch: true,
hideInSetting: true,
formItemProps: { hidden: true },
hideInTable: true,
},
{
'title': t(`${i18nPrefix}.columns.imdb_score`, 'ImdbScore'),
'dataIndex': 'imdb_score',
@ -301,14 +309,7 @@ const Video = () => {
formItemProps: { hidden: true },
hideInTable: true,
},
{
'title': t(`${i18nPrefix}.columns.imdb_id`, 'ImdbId'),
'dataIndex': 'imdb_id',
hideInSearch: true,
hideInSetting: true,
formItemProps: { hidden: true },
hideInTable: true,
},
{
title: t(`${i18nPrefix}.columns.option`, '操作'),
@ -375,7 +376,7 @@ const Video = () => {
]
}}
scroll={{
x: 3500,
x: 2500, y: 'calc(100vh - 290px)'
}}
loading={isLoading || isFetching}
dataSource={data?.rows ?? []}

Loading…
Cancel
Save