Commit 0c3112871fb1c3db0512ef3bb3504680c8b7d53a
1 parent
c158e9de
feat: update 开票管理列表
Showing
1 changed file
with
43 additions
and
6 deletions
src/pages/Invoice/index.tsx
... | ... | @@ -15,9 +15,26 @@ import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant'; |
15 | 15 | import './index.less'; |
16 | 16 | |
17 | 17 | const userInfo = getUserInfo(); |
18 | -// const | |
18 | + | |
19 | +const BreakWordDiv = ({ text = '暂无内容' }) => { | |
20 | + return <div className="overflow-wrap-break-word">{text}</div>; | |
21 | +}; | |
22 | + | |
23 | +const getTableCellText = (target: any) => { | |
24 | + if (!target) { | |
25 | + return ''; | |
26 | + } | |
27 | + | |
28 | + if (target.props) { | |
29 | + return target.props.text; | |
30 | + } | |
31 | + | |
32 | + return target; | |
33 | +}; | |
34 | + | |
19 | 35 | const InvoicePage = () => { |
20 | 36 | const actionRef = useRef<ActionType>(); |
37 | + | |
21 | 38 | return ( |
22 | 39 | <> |
23 | 40 | <PageContainer |
... | ... | @@ -61,19 +78,39 @@ const InvoicePage = () => { |
61 | 78 | let newItem = { ...item }; |
62 | 79 | if (item.dataIndex === 'invoiceStatus') { |
63 | 80 | newItem.render = (text) => { |
64 | - return enumValueToLabel(text.props.text, INVOCING_STATUS); | |
81 | + return ( | |
82 | + <BreakWordDiv | |
83 | + text={enumValueToLabel( | |
84 | + getTableCellText(text), | |
85 | + INVOCING_STATUS, | |
86 | + )} | |
87 | + /> | |
88 | + ); | |
65 | 89 | }; |
66 | 90 | } |
67 | - | |
68 | 91 | if (item.dataIndex === 'status') { |
69 | 92 | newItem.render = (text) => { |
70 | - return enumValueToLabel(text, INVOICE_STATUS); | |
93 | + console.log(text); | |
94 | + return ( | |
95 | + <BreakWordDiv | |
96 | + text={enumValueToLabel( | |
97 | + getTableCellText(text), | |
98 | + INVOICE_STATUS, | |
99 | + )} | |
100 | + /> | |
101 | + ); | |
71 | 102 | }; |
72 | 103 | } |
73 | - | |
74 | 104 | if (item.dataIndex === 'payee') { |
75 | 105 | newItem.render = (text) => { |
76 | - return enumValueToLabel(text, PAYEE_OPTIONS); | |
106 | + return ( | |
107 | + <BreakWordDiv | |
108 | + text={enumValueToLabel( | |
109 | + getTableCellText(text), | |
110 | + PAYEE_OPTIONS, | |
111 | + )} | |
112 | + /> | |
113 | + ); | |
77 | 114 | }; |
78 | 115 | } |
79 | 116 | return newItem; | ... | ... |