Commit dd308c73b1aca3a296a8783ece80d77faf72acb4
1 parent
a6607384
fix: 修改课题组列表选择器bug
Showing
1 changed file
with
29 additions
and
6 deletions
src/pages/ResearchGroup/ResearchGroup/index.tsx
@@ -531,17 +531,29 @@ const ResearchGroupListPage = () => { | @@ -531,17 +531,29 @@ const ResearchGroupListPage = () => { | ||
531 | columns={researchGroupColumnsInit()} | 531 | columns={researchGroupColumnsInit()} |
532 | actionRef={researchGroupActionRef} | 532 | actionRef={researchGroupActionRef} |
533 | cardBordered | 533 | cardBordered |
534 | + manualRequest={false} | ||
535 | + dataSource={undefined} // Use undefined to force server fetch | ||
534 | pagination={{ | 536 | pagination={{ |
535 | - pageSize: 10, | 537 | + showSizeChanger: true, |
538 | + pageSizeOptions: ['10', '20', '50', '100'], | ||
539 | + defaultCurrent: 1, | ||
540 | + defaultPageSize: 10, | ||
536 | }} | 541 | }} |
542 | + scroll={{ x: 1400 }} | ||
537 | request={async (params) => { | 543 | request={async (params) => { |
544 | + const { current, pageSize, ...rest } = params; | ||
538 | const res = await postResearchGroupsList({ | 545 | const res = await postResearchGroupsList({ |
539 | - data: { ...params }, | 546 | + data: { |
547 | + current: current, | ||
548 | + pageSize: pageSize, | ||
549 | + ...rest, | ||
550 | + }, | ||
540 | }); | 551 | }); |
541 | setPerms(res.data.specialPath); | 552 | setPerms(res.data.specialPath); |
542 | return { | 553 | return { |
543 | data: res?.data?.data || [], | 554 | data: res?.data?.data || [], |
544 | total: res?.data?.total || 0, | 555 | total: res?.data?.total || 0, |
556 | + success: res && res.result === RESPONSE_CODE.SUCCESS, | ||
545 | }; | 557 | }; |
546 | }} | 558 | }} |
547 | columnsState={{ | 559 | columnsState={{ |
@@ -566,7 +578,6 @@ const ResearchGroupListPage = () => { | @@ -566,7 +578,6 @@ const ResearchGroupListPage = () => { | ||
566 | form={{}} | 578 | form={{}} |
567 | dateFormatter="string" | 579 | dateFormatter="string" |
568 | headerTitle="课题组列表" | 580 | headerTitle="课题组列表" |
569 | - scroll={{ x: 1400 }} | ||
570 | toolBarRender={() => { | 581 | toolBarRender={() => { |
571 | let btns = []; | 582 | let btns = []; |
572 | if (perms?.includes('add')) { | 583 | if (perms?.includes('add')) { |
@@ -640,17 +651,29 @@ const ResearchGroupListPage = () => { | @@ -640,17 +651,29 @@ const ResearchGroupListPage = () => { | ||
640 | columns={memberApplyColumnsInit()} | 651 | columns={memberApplyColumnsInit()} |
641 | actionRef={memberApplyActionRef} | 652 | actionRef={memberApplyActionRef} |
642 | cardBordered | 653 | cardBordered |
654 | + manualRequest={false} | ||
655 | + dataSource={undefined} // Use undefined to force server fetch | ||
643 | pagination={{ | 656 | pagination={{ |
644 | - pageSize: 10, | 657 | + showSizeChanger: true, |
658 | + pageSizeOptions: ['10', '20', '50', '100'], | ||
659 | + defaultCurrent: 1, | ||
660 | + defaultPageSize: 10, | ||
645 | }} | 661 | }} |
662 | + scroll={{ x: 1400 }} | ||
646 | request={async (params) => { | 663 | request={async (params) => { |
664 | + const { current, pageSize, ...rest } = params; | ||
647 | const res = await postResearchGroupMemberRequestsList({ | 665 | const res = await postResearchGroupMemberRequestsList({ |
648 | - data: { ...params }, | 666 | + data: { |
667 | + current: current, | ||
668 | + pageSize: pageSize, | ||
669 | + ...rest, | ||
670 | + }, | ||
649 | }); | 671 | }); |
650 | setPerms(res.data.specialPath); | 672 | setPerms(res.data.specialPath); |
651 | return { | 673 | return { |
652 | data: res?.data?.data || [], | 674 | data: res?.data?.data || [], |
653 | total: res?.data?.total || 0, | 675 | total: res?.data?.total || 0, |
676 | + success: res && res.result === RESPONSE_CODE.SUCCESS, | ||
654 | }; | 677 | }; |
655 | }} | 678 | }} |
656 | columnsState={{ | 679 | columnsState={{ |
@@ -666,6 +689,7 @@ const ResearchGroupListPage = () => { | @@ -666,6 +689,7 @@ const ResearchGroupListPage = () => { | ||
666 | rowKey="id" | 689 | rowKey="id" |
667 | search={{ | 690 | search={{ |
668 | labelWidth: 'auto', | 691 | labelWidth: 'auto', |
692 | + defaultCollapsed: false, | ||
669 | }} | 693 | }} |
670 | options={{ | 694 | options={{ |
671 | setting: { | 695 | setting: { |
@@ -675,7 +699,6 @@ const ResearchGroupListPage = () => { | @@ -675,7 +699,6 @@ const ResearchGroupListPage = () => { | ||
675 | form={{}} | 699 | form={{}} |
676 | dateFormatter="string" | 700 | dateFormatter="string" |
677 | headerTitle="申请列表" | 701 | headerTitle="申请列表" |
678 | - scroll={{ x: 1400 }} | ||
679 | toolBarRender={() => { | 702 | toolBarRender={() => { |
680 | let btns = []; | 703 | let btns = []; |
681 | btns.push( | 704 | btns.push( |