供应商名称点击弹出问题

This commit is contained in:
孙景学
2025-07-18 11:32:41 +08:00
parent 6960d402b2
commit e637f62d86
16 changed files with 123 additions and 37 deletions

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Table, Form, Select, Button, message, Space } from 'antd';
import { Table, Form, Select, Button, message, Space, Tooltip } from 'antd';
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
//接口
@ -146,14 +146,21 @@ const SupplierEntryReview: React.FC = () => {
dataIndex: 'categoryNameList',
width: 120,
align: 'center',
render: (_: any, record: any) => {
render: (value: { item: string }[] = []) => {
if (!value || value.length === 0) return '-';
if (value.length === 1) {
return <span>{value[0].item}</span>;
}
// 多于1条
const allNames = value.map(item => item).join('、');
return (
<>
{record.categoryNameList && record.categoryNameList.map((item: string) => {
return <div>{`${item}`}</div>
})}
</>
)
<Tooltip title={allNames} overlayStyle={{ zIndex: 1200 }}>
<span>
{value[0]}
<span></span>
</span>
</Tooltip>
);
},
},
{