供应商名称点击弹出问题
This commit is contained in:
@ -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>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user