From fee2a327f8b39e6ad06791348f7bc6b6ed83f514 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 3 Nov 2023 10:59:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=B8=82=E5=9C=BA>=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE.=20=E5=BA=94=E7=94=A8=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/SearchForm.jsx | 16 +- src/stores/OrdersStore.js | 14 + src/views/Orders.jsx | 366 +++++++++++---------------- 3 files changed, 170 insertions(+), 226 deletions(-) diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx index 092f774..57521db 100644 --- a/src/components/search/SearchForm.jsx +++ b/src/components/search/SearchForm.jsx @@ -198,10 +198,10 @@ export default observer((props) => { // layout="inline"
- + {getFields({ sort, initialValue, hides, shows, fieldProps, form })} {/* 'textAlign': 'right' */} - + - - - - - - +
+ + + { + orders_store.setSearchValues(obj, form); + orders_store.getOrderCount(); + orders_store.onChange_Tabs(orders_store.active_tab_key); + }} + /> + + - - - + - - orders_store.onChange_Tabs(active_key)}> - - - 来源类型 - - } - key="Form"> - - - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_form").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "来源类型.xlsx"); - }}> - 导出excel - - - - - - 产品类型 - - } - key="Product"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_product").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "产品类型.xlsx"); - }}> - 导出excel - - - - - - 国籍 - - } - key="Country"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_country").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "国籍.xlsx"); - }}> - 导出excel - - - - - - 线路 - - } - key="line"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_line").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "线路.xlsx"); - }}> - 导出excel - - - - - - 目的地 - - } - key="city"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_city").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "目的地.xlsx"); - }}> - 导出excel - - - - - - 页面类型 - - } - key="LineClass"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_LineClass").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "页面类型.xlsx"); - }}> - 导出excel - - - - - - 客群类别 - - } - key="GuestGroupType"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_GuestGroupType").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "客群类别.xlsx"); - }}> - 导出excel - - - - - - 出行动机 - - } - key="TravelMotivation"> -
- - { - const wb = utils.table_to_book(document.getElementById("table_to_xlsx_TravelMotivation").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "出行动机.xlsx"); - }}> - 导出excel - - - - - - - - - - - - - - - - ); + + + + + + + + + orders_store.onChange_Tabs(active_key)} + items={[ + { + key: 'Form', + label: ( + + + 来源类型 + + ), + }, + { + key: 'Country', + label: ( + + + 国籍 + + ), + }, + { + key: 'line', + label: ( + + + 线路 + + ), + }, + { + key: 'city', + label: ( + + + 目的地 + + ), + }, + { + key: 'LineClass', + label: ( + + + 页面类型 + + ), + }, + { + key: 'GuestGroupType', + label: ( + + + 客群类别 + + ), + }, + { + key: 'TravelMotivation', + label: ( + + + 出行动机 + + ), + }, + ].map((ele) => { + return { + ...ele, + children: ( + <> +
+ + { + const wb = utils.table_to_book(document.getElementById(`table_to_xlsx_${ele.key}`).getElementsByTagName('table')[0]); + writeFileXLSX(wb, `${ele.key}.xlsx`); + }} + > + 导出excel + + + + ), + }; + })} + /> + + + + + + + + + + + + ); } }