Commit 82f250ddd748ffa371de8a2bda962893d1d82040
Merge branch 'fix-bug-0417' into dev
Showing
1 changed file
with
50 additions
and
54 deletions
src/pages/Order/OrderList/OrderDrawer.tsx
... | ... | @@ -768,73 +768,69 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
768 | 768 | }> |
769 | 769 | open |
770 | 770 | width={1000} |
771 | - title={drawerTitle} | |
772 | - resize={{ | |
773 | - onResize() { | |
774 | - console.log('resize!'); | |
775 | - }, | |
776 | - maxWidth: window.innerWidth * 0.8, | |
777 | - minWidth: 400, | |
771 | + modalProps={{ | |
772 | + destroyOnClose: true, | |
773 | + maskClosable: true, | |
774 | + title: ( | |
775 | + <div | |
776 | + style={{ display: 'flex', alignItems: 'center', width: '100%' }} | |
777 | + > | |
778 | + <span>{drawerTitle}</span> | |
779 | + {hasLocalData && ( | |
780 | + <Button | |
781 | + key="useLocalData" | |
782 | + type="link" | |
783 | + onClick={() => { | |
784 | + useLocalFormData(); | |
785 | + }} | |
786 | + > | |
787 | + 使用草稿 | |
788 | + </Button> | |
789 | + )} | |
790 | + </div> | |
791 | + ), | |
778 | 792 | }} |
779 | 793 | onFinishFailed={() => { |
780 | 794 | message.error('表单项存在错误,请检查'); |
781 | 795 | setSubmitBtnLoading(false); |
782 | 796 | }} |
783 | 797 | submitter={{ |
784 | - render: (props) => { | |
785 | - return [ | |
786 | - <Button | |
787 | - key="cancel" | |
788 | - onClick={() => { | |
789 | - onClose(); | |
790 | - }} | |
791 | - > | |
792 | - 取消 | |
793 | - </Button>, | |
794 | - <Button | |
795 | - key="localSave" | |
796 | - loading={localSaveLoading} | |
797 | - hidden={!optType('add') && !optType('copy')} | |
798 | - onClick={() => { | |
799 | - setLocalSaveLoading(true); | |
800 | - saveFormDataToLocal(); | |
801 | - }} | |
802 | - > | |
803 | - 本地保存 | |
804 | - </Button>, | |
805 | - <Button | |
806 | - key="ok" | |
807 | - type="primary" | |
808 | - loading={submitBtnLoading} | |
809 | - disabled={optType('after-sales-check')} | |
810 | - onClick={() => { | |
811 | - setSubmitBtnLoading(true); | |
812 | - props.submit(); | |
813 | - }} | |
814 | - > | |
815 | - 提交 | |
816 | - </Button>, | |
817 | - ]; | |
818 | - }, | |
819 | - }} | |
820 | - form={form} | |
821 | - autoFocusFirstInput | |
822 | - drawerProps={{ | |
823 | - destroyOnClose: true, | |
824 | - maskClosable: false, | |
825 | - extra: [ | |
798 | + render: (props) => [ | |
799 | + <Button | |
800 | + key="cancel" | |
801 | + onClick={() => { | |
802 | + onClose(); | |
803 | + }} | |
804 | + > | |
805 | + 取消 | |
806 | + </Button>, | |
826 | 807 | <Button |
827 | - key="useLocalData" | |
828 | - hidden={!hasLocalData} | |
829 | - type="link" | |
808 | + key="localSave" | |
809 | + loading={localSaveLoading} | |
810 | + hidden={!optType('add') && !optType('copy')} | |
830 | 811 | onClick={() => { |
831 | - useLocalFormData(); | |
812 | + setLocalSaveLoading(true); | |
813 | + saveFormDataToLocal(); | |
832 | 814 | }} |
833 | 815 | > |
834 | - 使用草稿 | |
816 | + 本地保存 | |
817 | + </Button>, | |
818 | + <Button | |
819 | + key="ok" | |
820 | + type="primary" | |
821 | + loading={submitBtnLoading} | |
822 | + disabled={optType('after-sales-check')} | |
823 | + onClick={() => { | |
824 | + setSubmitBtnLoading(true); | |
825 | + props.submit(); | |
826 | + }} | |
827 | + > | |
828 | + 提交 | |
835 | 829 | </Button>, |
836 | 830 | ], |
837 | 831 | }} |
832 | + form={form} | |
833 | + autoFocusFirstInput | |
838 | 834 | submitTimeout={2000} |
839 | 835 | onFinish={async (values) => { |
840 | 836 | let res = {}; | ... | ... |