fix: 代码优化

This commit is contained in:
苑宏博 2024-05-13 09:57:44 +08:00
parent 6eb14f8eef
commit 64d38943f7
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ export const WindowToggle: React.FC<WindowToggleProps> = (props) => {
<div className='body'> <div className='body'>
<Row gutter={[0, 20]} style={{ width: "100%" }}> {/* 设置栅格间距 */} <Row gutter={[0, 20]} style={{ width: "100%" }} > {/* 设置栅格间距 */}
{ {
size === "large" ? size === "large" ?
<> <>
@ -59,7 +59,7 @@ export const WindowToggle: React.FC<WindowToggleProps> = (props) => {
dataSource?.map((item, index) => { // 仅显示前四个元素,即两行两列 dataSource?.map((item, index) => { // 仅显示前四个元素,即两行两列
if (index > 0) return null if (index > 0) return null
return ( return (
<Col xs={24} sm={24} md={24} lg={24} xl={24} > <Col xs={24} sm={24} md={24} lg={24} xl={24} key={item.windowKey}>
<VideoPlayerCard <VideoPlayerCard
key={""} key={""}
selectedWindowKey={selectedWindowKey} selectedWindowKey={selectedWindowKey}
@ -76,7 +76,7 @@ export const WindowToggle: React.FC<WindowToggleProps> = (props) => {
: <> : <>
{dataSource?.map((item) => { {dataSource?.map((item) => {
return ( return (
<Col xs={24} sm={12} md={12} lg={12} xl={12} className='sm-card'> <Col xs={24} sm={12} md={12} lg={12} xl={12} className='sm-card' key={item.windowKey}>
<VideoPlayerCard <VideoPlayerCard
key={item.windowKey} key={item.windowKey}
selectedWindowKey={selectedWindowKey} selectedWindowKey={selectedWindowKey}

View File

@ -88,7 +88,7 @@ export const VideoPlayerCard: React.FC<VideoPlayerCardProps> = (props) => {
</div> </div>
</Space>} </Space>}
style={{ display: "flex", flexDirection: "column", borderRadius: 4, overflow: "hidden", ...cardStyle }} style={{ display: "flex", flexDirection: "column", borderRadius: 4, overflow: "hidden", ...cardStyle }}
bodyStyle={{ flex: 1 }} styles={{ body: { flex: 1 } }}
{...cardProps} {...cardProps}
> >
{cardContent ? ( {cardContent ? (