feat: 优化图片资源删除管理,生图任务列表管理
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* 支持导出组合码 / 导出记录 CSV / 清空记录;页面右下角固定第二个录入按钮。
|
||||
*/
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Input, message, Modal, Popconfirm, Table, Typography } from 'antd';
|
||||
import { Button, Input, message, Modal, Popconfirm, Table, Tooltip, Typography } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { CopyOutlined, DownloadOutlined, FileTextOutlined, PlusOutlined, RestOutlined } from '@ant-design/icons';
|
||||
import { ProductDetail } from '@/services/product';
|
||||
@@ -224,6 +224,26 @@ export default function TrialExportPanel({ product }: Props) {
|
||||
dataIndex: field,
|
||||
render: (v: unknown) => <Text style={{ fontSize: 13 }}>{fmt(v)}</Text>,
|
||||
});
|
||||
const renderLink = (url: string, maxWidth: number) => (
|
||||
<Tooltip title={url}>
|
||||
<a
|
||||
href={url.startsWith('http') ? url : `https://${url}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
style={{
|
||||
display: 'inline-block',
|
||||
maxWidth,
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 12,
|
||||
}}
|
||||
>
|
||||
{url}
|
||||
</a>
|
||||
</Tooltip>
|
||||
);
|
||||
const base: ColumnsType<RegisterRecord> = [
|
||||
{
|
||||
title: '操作',
|
||||
@@ -265,28 +285,17 @@ export default function TrialExportPanel({ product }: Props) {
|
||||
title: 'Ozon地址',
|
||||
dataIndex: 'sku',
|
||||
width: 160,
|
||||
render: (sku: string) =>
|
||||
sku ? (
|
||||
<a href={`https://www.ozon.ru/product/${sku}`} target="_blank" rel="noreferrer" style={{ fontSize: 12 }}>
|
||||
{`https://www.ozon.ru/product/${sku}`}
|
||||
</a>
|
||||
) : (
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>--</Text>
|
||||
),
|
||||
render: (sku: string) => {
|
||||
const url = sku ? `https://www.ozon.ru/product/${sku}` : '';
|
||||
return url ? renderLink(url, 128) : <Text type="secondary" style={{ fontSize: 12 }}>--</Text>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '采买地址',
|
||||
dataIndex: 'purchaseUrl',
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
render: (v: string) =>
|
||||
v ? (
|
||||
<a href={v.startsWith('http') ? v : `https://${v}`} target="_blank" rel="noreferrer" style={{ fontSize: 12 }} title={v}>
|
||||
{v}
|
||||
</a>
|
||||
) : (
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>--</Text>
|
||||
),
|
||||
v ? renderLink(v, 148) : <Text type="secondary" style={{ fontSize: 12 }}>--</Text>,
|
||||
},
|
||||
];
|
||||
return showOptional ? [...base, ...optional, ...rest, ...optional2, ...links] : [...base, ...rest, ...links];
|
||||
@@ -306,6 +315,7 @@ export default function TrialExportPanel({ product }: Props) {
|
||||
zIndex: 100,
|
||||
background: COLOR_SECONDARY,
|
||||
height: 40,
|
||||
width: 124,
|
||||
paddingInline: 16,
|
||||
boxShadow: '0 4px 12px rgba(16,185,129,0.4)',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user