Commit 8d451ded0ca32f18475dbd8d8853805f31862819

Authored by 李娅兰
1 parent dea885c4

fix(数据导入): bug修护添加功能

src/pages/performance/DataImport/components/ExcelTable.tsx
... ... @@ -5,6 +5,7 @@ import { useRequest } from 'ahooks';
5 5 import { ErrorType } from '../entity';
6 6  
7 7 import moment from 'moment';
  8 +
8 9 interface Props {
9 10 fid?: string;
10 11 show?: boolean;
... ... @@ -19,7 +20,7 @@ export default function ExcelTable({ fid, show, indicator, setExcelvisible, refr
19 20 message.error(e.message);
20 21 },
21 22 });
22   -
  23 +
23 24 useEffect(() => {
24 25 if (show) {
25 26 run(fid || '', indicator?.code || '');
... ... @@ -96,6 +97,7 @@ export default function ExcelTable({ fid, show, indicator, setExcelvisible, refr
96 97 <Modal
97 98 open={show}
98 99 destroyOnClose
  100 + okButtonProps={{ disabled: (data?.successNum || 0) <= 0 }}
99 101 onCancel={() => {
100 102 setExcelvisible?.(false);
101 103 }}
... ...
src/pages/performance/DataImport/components/ImportList.tsx
... ... @@ -16,6 +16,7 @@ import type { ApprovalProgressModalRef } from &#39;@/components/ApprovalProgressModa
16 16 import dowloader from '@/utils/downloader';
17 17 import { IMGURL } from '@/utils';
18 18 import ExcelTable from './ExcelTable';
  19 +import { ErrorType } from '../entity';
19 20  
20 21 type Props = {
21 22 indicator?: MDataImport.IndicatorList;
... ... @@ -160,7 +161,23 @@ export default function TableList({ indicator }: Props) {
160 161 dataIndex: 'graderStaffName',
161 162 render: (name) => <span>{name || '--'}</span>,
162 163 },
  164 + {
  165 + title: '是否识别',
  166 + width: 100,
  167 + dataIndex: 'errorType',
  168 + align: 'center',
  169 + render: (_: any, record: any) => (record.errorType ? <div>未识别</div> : <div>已识别</div>),
  170 + },
  171 + {
  172 + title: '未识别原因',
  173 + width: 150,
  174 + dataIndex: 'errorType',
  175 + align: 'center',
  176 + render: (_: any, record: any) => (record.errorType ? ErrorType[record.errorType] : '--'),
  177 + },
163 178 ];
  179 +
  180 +
164 181 const columns: ColumnsType<MDataImport.DetailedList> = [
165 182 {
166 183 title: '导入时间',
... ... @@ -311,6 +328,10 @@ export default function TableList({ indicator }: Props) {
311 328 onClick={() => {
312 329 DownloadApi(indicator?.code)
313 330 .then((res) => {
  331 + if(!res){
  332 + message.error('模版不存在!')
  333 + return
  334 + }
314 335 dowloader.downloadFile({ fileUrl: IMGURL.showImage(res) });
315 336 })
316 337 .catch((e) => {
... ...