wt-antd 4.2.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/esm/assets/location.png +0 -0
- package/dist/esm/component/BiuAAutoComplete/index.d.ts +4 -0
- package/dist/esm/component/BiuAAutoComplete/index.js +13 -0
- package/dist/esm/component/BiuAButton/index.d.ts +18 -0
- package/dist/esm/component/BiuAButton/index.js +8 -0
- package/dist/esm/component/BiuACard/index.d.ts +2 -0
- package/dist/esm/component/BiuACard/index.js +9 -0
- package/dist/esm/component/BiuACascader/index.d.ts +10 -0
- package/dist/esm/component/BiuACascader/index.js +8 -0
- package/dist/esm/component/BiuADatePicker/index.d.ts +19 -0
- package/dist/esm/component/BiuADatePicker/index.js +18 -0
- package/dist/esm/component/BiuAForm/index.d.ts +7 -0
- package/dist/esm/component/BiuAForm/index.js +10 -0
- package/dist/esm/component/BiuAInput/index.d.ts +14 -0
- package/dist/esm/component/BiuAInput/index.js +32 -0
- package/dist/esm/component/BiuASelect/index.d.ts +6 -0
- package/dist/esm/component/BiuASelect/index.js +14 -0
- package/dist/esm/component/BiuASwitch/index.d.ts +2 -0
- package/dist/esm/component/BiuASwitch/index.js +9 -0
- package/dist/esm/component/BiuATimePicker/index.d.ts +4 -0
- package/dist/esm/component/BiuATimePicker/index.js +8 -0
- package/dist/esm/component/BiuATreeSelect/index.d.ts +2 -0
- package/dist/esm/component/BiuATreeSelect/index.js +8 -0
- package/dist/esm/component/BiuBar/index.d.ts +13 -0
- package/dist/esm/component/BiuBar/index.js +43 -0
- package/dist/esm/component/BiuComSelect/index.d.ts +19 -0
- package/dist/esm/component/BiuComSelect/index.js +106 -0
- package/dist/esm/component/BiuCue/index.d.ts +18 -0
- package/dist/esm/component/BiuCue/index.js +44 -0
- package/dist/esm/component/BiuCustomSelect/index.d.ts +19 -0
- package/dist/esm/component/BiuCustomSelect/index.js +160 -0
- package/dist/esm/component/BiuCustomTable/index.d.ts +15 -0
- package/dist/esm/component/BiuCustomTable/index.js +77 -0
- package/dist/esm/component/BiuCustomerOperCard/component/editTable.d.ts +9 -0
- package/dist/esm/component/BiuCustomerOperCard/component/editTable.js +268 -0
- package/dist/esm/component/BiuCustomerOperCard/component/index.d.ts +1 -0
- package/dist/esm/component/BiuCustomerOperCard/component/index.js +1 -0
- package/dist/esm/component/BiuCustomerOperCard/component/index.less +5 -0
- package/dist/esm/component/BiuCustomerOperCard/index.d.ts +20 -0
- package/dist/esm/component/BiuCustomerOperCard/index.js +56 -0
- package/dist/esm/component/BiuCustomerOperCard/type.d.ts +117 -0
- package/dist/esm/component/BiuCustomerOperCard/type.js +1 -0
- package/dist/esm/component/BiuCustomerOperCard/utils.d.ts +48 -0
- package/dist/esm/component/BiuCustomerOperCard/utils.js +236 -0
- package/dist/esm/component/BiuDescriptions/index.d.ts +9 -0
- package/dist/esm/component/BiuDescriptions/index.js +39 -0
- package/dist/esm/component/BiuDetailDrawer/index.d.ts +14 -0
- package/dist/esm/component/BiuDetailDrawer/index.js +55 -0
- package/dist/esm/component/BiuDivider/index.d.ts +4 -0
- package/dist/esm/component/BiuDivider/index.js +31 -0
- package/dist/esm/component/BiuField/component/AddressTableSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/AddressTableSelect.js +150 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/index.d.ts +3 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/index.js +3 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertSubValue.d.ts +2 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertSubValue.js +49 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertUnSubValue.d.ts +2 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useConvertUnSubValue.js +146 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useInConvertUnSubValue.d.ts +5 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/hooks/useInConvertUnSubValue.js +82 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/index.d.ts +14 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/index.js +400 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/type.d.ts +123 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/type.js +1 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/utils.d.ts +5 -0
- package/dist/esm/component/BiuField/component/DepartOrgSelect/utils.js +59 -0
- package/dist/esm/component/BiuField/component/OMSSystem/cityAreaSelect.d.ts +12 -0
- package/dist/esm/component/BiuField/component/OMSSystem/cityAreaSelect.js +130 -0
- package/dist/esm/component/BiuField/component/OMSSystem/warehouseSel.d.ts +7 -0
- package/dist/esm/component/BiuField/component/OMSSystem/warehouseSel.js +80 -0
- package/dist/esm/component/BiuField/component/SNInput.d.ts +13 -0
- package/dist/esm/component/BiuField/component/SNInput.js +622 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/addressSelect.d.ts +24 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/addressSelect.js +191 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/base.d.ts +13 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/base.js +204 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/goodSelect.d.ts +21 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/goodSelect.js +238 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/index.d.ts +3 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/index.js +74 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/interface.d.ts +16 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/interface.js +1 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.d.ts +28 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.js +177 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/newGoodsSelect.d.ts +21 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/newGoodsSelect.js +247 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/package.d.ts +3 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/package.js +149 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/supplierSelect.d.ts +18 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/supplierSelect.js +145 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseAreaSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseAreaSelect.js +117 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseInfoSelects.d.ts +18 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/warehouseInfoSelects.js +100 -0
- package/dist/esm/component/BiuField/component/appliedgoodsTypeSelect.d.ts +9 -0
- package/dist/esm/component/BiuField/component/appliedgoodsTypeSelect.js +75 -0
- package/dist/esm/component/BiuField/component/autoComplete.d.ts +8 -0
- package/dist/esm/component/BiuField/component/autoComplete.js +82 -0
- package/dist/esm/component/BiuField/component/biuMultipleAInput.d.ts +2 -0
- package/dist/esm/component/BiuField/component/biuMultipleAInput.js +133 -0
- package/dist/esm/component/BiuField/component/boxTypeSelect.d.ts +11 -0
- package/dist/esm/component/BiuField/component/boxTypeSelect.js +139 -0
- package/dist/esm/component/BiuField/component/businessdistrictselect.d.ts +55 -0
- package/dist/esm/component/BiuField/component/businessdistrictselect.js +414 -0
- package/dist/esm/component/BiuField/component/carrierInfoSelect.d.ts +13 -0
- package/dist/esm/component/BiuField/component/carrierInfoSelect.js +145 -0
- package/dist/esm/component/BiuField/component/channelSelect.d.ts +8 -0
- package/dist/esm/component/BiuField/component/channelSelect.js +94 -0
- package/dist/esm/component/BiuField/component/cityAreaCascader.d.ts +11 -0
- package/dist/esm/component/BiuField/component/cityAreaCascader.js +86 -0
- package/dist/esm/component/BiuField/component/clientInfoTableSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/clientInfoTableSelect.js +198 -0
- package/dist/esm/component/BiuField/component/customMenu.d.ts +3 -0
- package/dist/esm/component/BiuField/component/customMenu.js +110 -0
- package/dist/esm/component/BiuField/component/databaseSelect.d.ts +6 -0
- package/dist/esm/component/BiuField/component/databaseSelect.js +42 -0
- package/dist/esm/component/BiuField/component/departmentTreeSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/departmentTreeSelect.js +107 -0
- package/dist/esm/component/BiuField/component/dicNameSelect.d.ts +12 -0
- package/dist/esm/component/BiuField/component/dicNameSelect.js +53 -0
- package/dist/esm/component/BiuField/component/dicTypeSelect.d.ts +42 -0
- package/dist/esm/component/BiuField/component/dicTypeSelect.js +87 -0
- package/dist/esm/component/BiuField/component/dockingPartySelect.d.ts +8 -0
- package/dist/esm/component/BiuField/component/dockingPartySelect.js +63 -0
- package/dist/esm/component/BiuField/component/editLocationSelect.d.ts +21 -0
- package/dist/esm/component/BiuField/component/editLocationSelect.js +124 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/accountSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/accountSelect.js +36 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/addresSelect.d.ts +14 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/addresSelect.js +97 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/platformSelect.d.ts +7 -0
- package/dist/esm/component/BiuField/component/electronicFaceSheet/platformSelect.js +73 -0
- package/dist/esm/component/BiuField/component/goodsTypeSelect.d.ts +10 -0
- package/dist/esm/component/BiuField/component/goodsTypeSelect.js +92 -0
- package/dist/esm/component/BiuField/component/index.d.ts +39 -0
- package/dist/esm/component/BiuField/component/index.js +39 -0
- package/dist/esm/component/BiuField/component/interfaceNameSelect.d.ts +9 -0
- package/dist/esm/component/BiuField/component/interfaceNameSelect.js +65 -0
- package/dist/esm/component/BiuField/component/lpnSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/lpnSelect.js +95 -0
- package/dist/esm/component/BiuField/component/lpnSelectNew.d.ts +17 -0
- package/dist/esm/component/BiuField/component/lpnSelectNew.js +188 -0
- package/dist/esm/component/BiuField/component/newEditLocationSelect.d.ts +21 -0
- package/dist/esm/component/BiuField/component/newEditLocationSelect.js +129 -0
- package/dist/esm/component/BiuField/component/orderTypeSelect.d.ts +16 -0
- package/dist/esm/component/BiuField/component/orderTypeSelect.js +82 -0
- package/dist/esm/component/BiuField/component/orderTypeTableSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/orderTypeTableSelect.js +45 -0
- package/dist/esm/component/BiuField/component/parkSelect.d.ts +12 -0
- package/dist/esm/component/BiuField/component/parkSelect.js +88 -0
- package/dist/esm/component/BiuField/component/personnelinfoselect.d.ts +57 -0
- package/dist/esm/component/BiuField/component/personnelinfoselect.js +431 -0
- package/dist/esm/component/BiuField/component/propertNameSelect.d.ts +9 -0
- package/dist/esm/component/BiuField/component/propertNameSelect.js +114 -0
- package/dist/esm/component/BiuField/component/shipperTableSelect.d.ts +3 -0
- package/dist/esm/component/BiuField/component/shipperTableSelect.js +94 -0
- package/dist/esm/component/BiuField/component/userSelect.d.ts +11 -0
- package/dist/esm/component/BiuField/component/userSelect.js +172 -0
- package/dist/esm/component/BiuField/component/warehouseAreaSelect.d.ts +9 -0
- package/dist/esm/component/BiuField/component/warehouseAreaSelect.js +103 -0
- package/dist/esm/component/BiuField/component/warehouseInfoSelect.d.ts +14 -0
- package/dist/esm/component/BiuField/component/warehouseInfoSelect.js +94 -0
- package/dist/esm/component/BiuField/component/warehouseLoctionSelect.d.ts +14 -0
- package/dist/esm/component/BiuField/component/warehouseLoctionSelect.js +124 -0
- package/dist/esm/component/BiuField/index.d.ts +8 -0
- package/dist/esm/component/BiuField/index.js +670 -0
- package/dist/esm/component/BiuFileInput/index.d.ts +11 -0
- package/dist/esm/component/BiuFileInput/index.js +58 -0
- package/dist/esm/component/BiuForm/index.d.ts +14 -0
- package/dist/esm/component/BiuForm/index.js +264 -0
- package/dist/esm/component/BiuForm/type.d.ts +47 -0
- package/dist/esm/component/BiuForm/type.js +1 -0
- package/dist/esm/component/BiuForm/utils.d.ts +2 -0
- package/dist/esm/component/BiuForm/utils.js +53 -0
- package/dist/esm/component/BiuIcon/index.d.ts +3 -0
- package/dist/esm/component/BiuIcon/index.js +15 -0
- package/dist/esm/component/BiuMapSelectSite/index.d.ts +52 -0
- package/dist/esm/component/BiuMapSelectSite/index.js +558 -0
- package/dist/esm/component/BiuModal/index.d.ts +24 -0
- package/dist/esm/component/BiuModal/index.js +240 -0
- package/dist/esm/component/BiuOperForm/index.d.ts +22 -0
- package/dist/esm/component/BiuOperForm/index.js +390 -0
- package/dist/esm/component/BiuOperForm/type.d.ts +24 -0
- package/dist/esm/component/BiuOperForm/type.js +1 -0
- package/dist/esm/component/BiuOperTable/index.d.ts +15 -0
- package/dist/esm/component/BiuOperTable/index.js +349 -0
- package/dist/esm/component/BiuOperTable/type.d.ts +142 -0
- package/dist/esm/component/BiuOperTable/type.js +1 -0
- package/dist/esm/component/BiuOperTable/utils.d.ts +6 -0
- package/dist/esm/component/BiuOperTable/utils.js +13 -0
- package/dist/esm/component/BiuPagination/index.d.ts +15 -0
- package/dist/esm/component/BiuPagination/index.js +34 -0
- package/dist/esm/component/BiuResizeTable/component/VirtualTable.d.ts +3 -0
- package/dist/esm/component/BiuResizeTable/component/VirtualTable.js +127 -0
- package/dist/esm/component/BiuResizeTable/component/biuTableCell.d.ts +1 -0
- package/dist/esm/component/BiuResizeTable/component/biuTableCell.js +78 -0
- package/dist/esm/component/BiuResizeTable/component/index.d.ts +1 -0
- package/dist/esm/component/BiuResizeTable/component/index.js +1 -0
- package/dist/esm/component/BiuResizeTable/index.d.ts +2 -0
- package/dist/esm/component/BiuResizeTable/index.js +71 -0
- package/dist/esm/component/BiuResizeTable/index.less +19 -0
- package/dist/esm/component/BiuSplit/index.d.ts +32 -0
- package/dist/esm/component/BiuSplit/index.js +57 -0
- package/dist/esm/component/BiuTable/component/index.d.ts +3 -0
- package/dist/esm/component/BiuTable/component/index.js +3 -0
- package/dist/esm/component/BiuTable/component/tableActionBarRender.d.ts +9 -0
- package/dist/esm/component/BiuTable/component/tableActionBarRender.js +206 -0
- package/dist/esm/component/BiuTable/component/tableCellRender.d.ts +14 -0
- package/dist/esm/component/BiuTable/component/tableCellRender.js +125 -0
- package/dist/esm/component/BiuTable/component/tableSettingRender.d.ts +2 -0
- package/dist/esm/component/BiuTable/component/tableSettingRender.js +345 -0
- package/dist/esm/component/BiuTable/context.d.ts +2 -0
- package/dist/esm/component/BiuTable/context.js +2 -0
- package/dist/esm/component/BiuTable/index.d.ts +67 -0
- package/dist/esm/component/BiuTable/index.js +576 -0
- package/dist/esm/component/BiuTable/type.d.ts +200 -0
- package/dist/esm/component/BiuTable/type.js +1 -0
- package/dist/esm/component/BiuTable/utils.d.ts +12 -0
- package/dist/esm/component/BiuTable/utils.js +123 -0
- package/dist/esm/component/BiuTableLink/index.d.ts +11 -0
- package/dist/esm/component/BiuTableLink/index.js +54 -0
- package/dist/esm/component/BiuTableSelect/index.d.ts +53 -0
- package/dist/esm/component/BiuTableSelect/index.js +227 -0
- package/dist/esm/component/BiuTabs/index.d.ts +4 -0
- package/dist/esm/component/BiuTabs/index.js +18 -0
- package/dist/esm/component/index.d.ts +34 -0
- package/dist/esm/component/index.js +34 -0
- package/dist/esm/constant/Cache_Key.d.ts +28 -0
- package/dist/esm/constant/Cache_Key.js +28 -0
- package/dist/esm/constant/DateTime.d.ts +12 -0
- package/dist/esm/constant/DateTime.js +15 -0
- package/dist/esm/constant/External.d.ts +64 -0
- package/dist/esm/constant/External.js +260 -0
- package/dist/esm/constant/Gateway_Path.d.ts +5 -0
- package/dist/esm/constant/Gateway_Path.js +5 -0
- package/dist/esm/constant/Layout.d.ts +210 -0
- package/dist/esm/constant/Layout.js +215 -0
- package/dist/esm/constant/Regexp.d.ts +109 -0
- package/dist/esm/constant/Regexp.js +130 -0
- package/dist/esm/constant/index.d.ts +6 -0
- package/dist/esm/constant/index.js +6 -0
- package/dist/esm/hooks/index.d.ts +7 -0
- package/dist/esm/hooks/index.js +7 -0
- package/dist/esm/hooks/useAuth.d.ts +4 -0
- package/dist/esm/hooks/useAuth.js +22 -0
- package/dist/esm/hooks/useCurrentSystem.d.ts +6 -0
- package/dist/esm/hooks/useCurrentSystem.js +17 -0
- package/dist/esm/hooks/useLayoutInfo.d.ts +10 -0
- package/dist/esm/hooks/useLayoutInfo.js +14 -0
- package/dist/esm/hooks/useReducerState.d.ts +16 -0
- package/dist/esm/hooks/useReducerState.js +45 -0
- package/dist/esm/hooks/useUmeng.d.ts +5 -0
- package/dist/esm/hooks/useUmeng.js +168 -0
- package/dist/esm/hooks/useUserInfo.d.ts +4 -0
- package/dist/esm/hooks/useUserInfo.js +17 -0
- package/dist/esm/hooks/useWareInfo.d.ts +4 -0
- package/dist/esm/hooks/useWareInfo.js +17 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/package/index.d.ts +1 -0
- package/dist/esm/package/index.js +1 -0
- package/dist/esm/package/requestWrapper/baseRequest.d.ts +3 -0
- package/dist/esm/package/requestWrapper/baseRequest.js +47 -0
- package/dist/esm/package/requestWrapper/index.d.ts +4 -0
- package/dist/esm/package/requestWrapper/index.js +425 -0
- package/dist/esm/package/requestWrapper/type.d.ts +41 -0
- package/dist/esm/package/requestWrapper/type.js +1 -0
- package/dist/esm/package/requestWrapper/utils.d.ts +10 -0
- package/dist/esm/package/requestWrapper/utils.js +35 -0
- package/dist/esm/types/track.d.ts +113 -0
- package/dist/esm/types/track.js +63 -0
- package/dist/esm/types/umeng.d.ts +7 -0
- package/dist/esm/utils/authUtils.d.ts +18 -0
- package/dist/esm/utils/authUtils.js +36 -0
- package/dist/esm/utils/cacheUtils.d.ts +4 -0
- package/dist/esm/utils/cacheUtils.js +24 -0
- package/dist/esm/utils/chainUtils.d.ts +26 -0
- package/dist/esm/utils/chainUtils.js +54 -0
- package/dist/esm/utils/dateUtils.d.ts +23 -0
- package/dist/esm/utils/dateUtils.js +55 -0
- package/dist/esm/utils/decimalUtils.d.ts +5 -0
- package/dist/esm/utils/decimalUtils.js +7 -0
- package/dist/esm/utils/excelUtils.d.ts +22 -0
- package/dist/esm/utils/excelUtils.js +165 -0
- package/dist/esm/utils/index.d.ts +11 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/layoutUtils.d.ts +1 -0
- package/dist/esm/utils/layoutUtils.js +13 -0
- package/dist/esm/utils/objectUtils.d.ts +1 -0
- package/dist/esm/utils/objectUtils.js +3 -0
- package/dist/esm/utils/soundUtils.d.ts +5 -0
- package/dist/esm/utils/soundUtils.js +29 -0
- package/dist/esm/utils/stringUtils.d.ts +24 -0
- package/dist/esm/utils/stringUtils.js +39 -0
- package/dist/esm/utils/sysUtils.d.ts +8 -0
- package/dist/esm/utils/sysUtils.js +33 -0
- package/dist/esm/utils/umeng.d.ts +3 -0
- package/dist/esm/utils/umeng.js +161 -0
- package/package.json +60 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare enum UmengSysType {
|
|
3
|
+
MDM = "MDM",
|
|
4
|
+
OMS = "OMS",
|
|
5
|
+
WMS = "WMS",
|
|
6
|
+
TMS = "TMS",
|
|
7
|
+
CRM = "CRM",
|
|
8
|
+
TENANT = "TENANT",
|
|
9
|
+
IOT = "IOT",
|
|
10
|
+
BMS = "BMS",
|
|
11
|
+
PAY = "PAY",
|
|
12
|
+
BI = "BI",
|
|
13
|
+
SSO = "SSO"
|
|
14
|
+
}
|
|
15
|
+
export interface UmengBridgeProps {
|
|
16
|
+
siteId?: string;
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
onEventTracked?: (event: TrackEvent) => void;
|
|
19
|
+
onError?: (error: Error) => void;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 埋点事件数据结构
|
|
24
|
+
*/
|
|
25
|
+
export interface TrackEvent {
|
|
26
|
+
category?: UmengSysType;
|
|
27
|
+
action: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
value?: number;
|
|
30
|
+
buttonType?: UmengButtonType | string;
|
|
31
|
+
standard?: boolean;
|
|
32
|
+
el?: HTMLElement;
|
|
33
|
+
}
|
|
34
|
+
export interface PostMessageData {
|
|
35
|
+
type: 'UMENG_EVENT' | 'UMENG_INIT' | 'UMENG_READY' | 'UMENG_ERROR';
|
|
36
|
+
data: TrackEvent | any;
|
|
37
|
+
source: string;
|
|
38
|
+
target: string;
|
|
39
|
+
timestamp: number;
|
|
40
|
+
}
|
|
41
|
+
export interface WindowInfo {
|
|
42
|
+
id: string;
|
|
43
|
+
url: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: 'parent' | 'child' | 'iframe';
|
|
46
|
+
origin: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 按钮类型枚举
|
|
50
|
+
*/
|
|
51
|
+
export declare enum UmengButtonType {
|
|
52
|
+
MENU = "menu",// 菜单按钮
|
|
53
|
+
ACTION = "action",// 功能按钮
|
|
54
|
+
FORM = "form",// 表单按钮
|
|
55
|
+
TOOLBAR = "toolbar",// 工具栏按钮
|
|
56
|
+
LINK = "link",// 链接按钮
|
|
57
|
+
SUBMIT = "submit",// 提交按钮
|
|
58
|
+
RESET = "reset",// 重置按钮
|
|
59
|
+
SEARCH = "search",// 搜索按钮
|
|
60
|
+
FILTER = "filter",// 筛选按钮
|
|
61
|
+
EXPORT = "export",// 导出按钮
|
|
62
|
+
IMPORT = "import",// 导入按钮
|
|
63
|
+
DELETE = "delete",// 删除按钮
|
|
64
|
+
EDIT = "edit",// 编辑按钮
|
|
65
|
+
ADD = "add",// 新增按钮
|
|
66
|
+
VIEW = "view",// 查看按钮
|
|
67
|
+
PRINT = "print",// 打印按钮
|
|
68
|
+
REFRESH = "refresh",// 刷新按钮
|
|
69
|
+
SAVE = "save",// 保存按钮
|
|
70
|
+
CANCEL = "cancel",// 取消按钮
|
|
71
|
+
CONFIRM = "confirm",// 确认按钮
|
|
72
|
+
BACK = "back",// 返回按钮
|
|
73
|
+
TAB = "tab",// 页签
|
|
74
|
+
LOGOUT = "logout",
|
|
75
|
+
PASSWORD = "PASSWORD",
|
|
76
|
+
HELP = "help",
|
|
77
|
+
APPDOWNLOAD = "appdownload"
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 按钮功能描述
|
|
81
|
+
*/
|
|
82
|
+
export type ButtonFunction = '新增' | '编辑' | '删除' | '查看' | '查询' | '搜索' | '筛选' | '导出' | '导入' | '保存' | '取消' | '提交' | '重置' | '打印' | '刷新' | '返回' | '确认' | '下载' | '上传' | '复制' | '移动' | '启用' | '停用' | '审核' | '驳回' | '分配' | '转交' | string;
|
|
83
|
+
export interface LableVO {
|
|
84
|
+
[x: string]: any;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 埋点配置
|
|
88
|
+
*/
|
|
89
|
+
export interface TrackConfig {
|
|
90
|
+
siteId?: string;
|
|
91
|
+
parentOnly?: boolean;
|
|
92
|
+
maxRetryTimes?: number;
|
|
93
|
+
retryInterval?: number;
|
|
94
|
+
timeout?: number;
|
|
95
|
+
debug?: boolean;
|
|
96
|
+
sampleRate?: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 指令绑定值
|
|
100
|
+
*/
|
|
101
|
+
export interface TrackDirectiveBinding {
|
|
102
|
+
category?: UmengSysType;
|
|
103
|
+
type?: UmengButtonType | string;
|
|
104
|
+
action?: string;
|
|
105
|
+
buttonType?: UmengButtonType;
|
|
106
|
+
buttonFunction?: ButtonFunction;
|
|
107
|
+
pagePath?: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
value?: number;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
once?: boolean;
|
|
112
|
+
debounce?: number;
|
|
113
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export var UmengSysType = /*#__PURE__*/function (UmengSysType) {
|
|
2
|
+
UmengSysType["MDM"] = "MDM";
|
|
3
|
+
UmengSysType["OMS"] = "OMS";
|
|
4
|
+
UmengSysType["WMS"] = "WMS";
|
|
5
|
+
UmengSysType["TMS"] = "TMS";
|
|
6
|
+
UmengSysType["CRM"] = "CRM";
|
|
7
|
+
UmengSysType["TENANT"] = "TENANT";
|
|
8
|
+
UmengSysType["IOT"] = "IOT";
|
|
9
|
+
UmengSysType["BMS"] = "BMS";
|
|
10
|
+
UmengSysType["PAY"] = "PAY";
|
|
11
|
+
UmengSysType["BI"] = "BI";
|
|
12
|
+
UmengSysType["SSO"] = "SSO";
|
|
13
|
+
return UmengSysType;
|
|
14
|
+
}({});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 埋点事件数据结构
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 按钮类型枚举
|
|
22
|
+
*/
|
|
23
|
+
export var UmengButtonType = /*#__PURE__*/function (UmengButtonType) {
|
|
24
|
+
UmengButtonType["MENU"] = "menu";
|
|
25
|
+
UmengButtonType["ACTION"] = "action";
|
|
26
|
+
UmengButtonType["FORM"] = "form";
|
|
27
|
+
UmengButtonType["TOOLBAR"] = "toolbar";
|
|
28
|
+
UmengButtonType["LINK"] = "link";
|
|
29
|
+
UmengButtonType["SUBMIT"] = "submit";
|
|
30
|
+
UmengButtonType["RESET"] = "reset";
|
|
31
|
+
UmengButtonType["SEARCH"] = "search";
|
|
32
|
+
UmengButtonType["FILTER"] = "filter";
|
|
33
|
+
UmengButtonType["EXPORT"] = "export";
|
|
34
|
+
UmengButtonType["IMPORT"] = "import";
|
|
35
|
+
UmengButtonType["DELETE"] = "delete";
|
|
36
|
+
UmengButtonType["EDIT"] = "edit";
|
|
37
|
+
UmengButtonType["ADD"] = "add";
|
|
38
|
+
UmengButtonType["VIEW"] = "view";
|
|
39
|
+
UmengButtonType["PRINT"] = "print";
|
|
40
|
+
UmengButtonType["REFRESH"] = "refresh";
|
|
41
|
+
UmengButtonType["SAVE"] = "save";
|
|
42
|
+
UmengButtonType["CANCEL"] = "cancel";
|
|
43
|
+
UmengButtonType["CONFIRM"] = "confirm";
|
|
44
|
+
UmengButtonType["BACK"] = "back";
|
|
45
|
+
UmengButtonType["TAB"] = "tab";
|
|
46
|
+
UmengButtonType["LOGOUT"] = "logout";
|
|
47
|
+
UmengButtonType["PASSWORD"] = "PASSWORD";
|
|
48
|
+
UmengButtonType["HELP"] = "help";
|
|
49
|
+
UmengButtonType["APPDOWNLOAD"] = "appdownload";
|
|
50
|
+
return UmengButtonType;
|
|
51
|
+
}({});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 按钮功能描述
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 埋点配置
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 指令绑定值
|
|
63
|
+
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 清除 token
|
|
3
|
+
*/
|
|
4
|
+
export declare function clearToken(): void;
|
|
5
|
+
/**
|
|
6
|
+
* 设置 token
|
|
7
|
+
* @param token token
|
|
8
|
+
*/
|
|
9
|
+
export declare function setToken(token: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* 获取 token
|
|
12
|
+
*/
|
|
13
|
+
export declare function getToken(): string | null;
|
|
14
|
+
export declare function clearAuthToken(): void;
|
|
15
|
+
export declare function setAuthToken(token: string): void;
|
|
16
|
+
export declare function getAuthToken(): string | null;
|
|
17
|
+
export declare function setAuthBtnID(MenuBtnData: any[]): void;
|
|
18
|
+
export declare function getAuthBtnID(location: any): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BUBU100_CACHE_AUTH_TOKEN_KEY, BUBU100_CACHE_TOKEN_KEY } from "../constant";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 清除 token
|
|
5
|
+
*/
|
|
6
|
+
export function clearToken() {
|
|
7
|
+
localStorage.removeItem(BUBU100_CACHE_TOKEN_KEY);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 设置 token
|
|
11
|
+
* @param token token
|
|
12
|
+
*/
|
|
13
|
+
export function setToken(token) {
|
|
14
|
+
localStorage.setItem(BUBU100_CACHE_TOKEN_KEY, token);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 获取 token
|
|
18
|
+
*/
|
|
19
|
+
export function getToken() {
|
|
20
|
+
return localStorage.getItem(BUBU100_CACHE_TOKEN_KEY);
|
|
21
|
+
}
|
|
22
|
+
export function clearAuthToken() {
|
|
23
|
+
localStorage.removeItem(BUBU100_CACHE_AUTH_TOKEN_KEY);
|
|
24
|
+
}
|
|
25
|
+
export function setAuthToken(token) {
|
|
26
|
+
localStorage.setItem(BUBU100_CACHE_AUTH_TOKEN_KEY, token);
|
|
27
|
+
}
|
|
28
|
+
export function getAuthToken() {
|
|
29
|
+
return localStorage.getItem(BUBU100_CACHE_AUTH_TOKEN_KEY);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
33
|
+
export function setAuthBtnID(MenuBtnData) {}
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
|
+
export function getAuthBtnID(location) {}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const GetWareHouseCache: () => Record<string, any>;
|
|
2
|
+
export declare const SetWareHouseCache: (data: Record<string, any>) => void;
|
|
3
|
+
export declare const cacheDB: () => Promise<import("idb").IDBPDatabase<unknown>>;
|
|
4
|
+
export declare const clearDB: () => Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { deleteDB, openDB } from 'idb';
|
|
2
|
+
import { BUBU100_CACHE_WAREINFO_KEY } from "../constant";
|
|
3
|
+
export var GetWareHouseCache = function GetWareHouseCache() {
|
|
4
|
+
var cacheData = localStorage.getItem(BUBU100_CACHE_WAREINFO_KEY);
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(cacheData !== null && cacheData !== void 0 ? cacheData : '');
|
|
7
|
+
} catch (error) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export var SetWareHouseCache = function SetWareHouseCache(data) {
|
|
12
|
+
var stringData = JSON.stringify(data);
|
|
13
|
+
localStorage.setItem(BUBU100_CACHE_WAREINFO_KEY, stringData);
|
|
14
|
+
};
|
|
15
|
+
export var cacheDB = function cacheDB() {
|
|
16
|
+
return openDB('request-cache', 1, {
|
|
17
|
+
upgrade: function upgrade(db) {
|
|
18
|
+
db.createObjectStore('cache');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export var clearDB = function clearDB() {
|
|
23
|
+
return deleteDB('request-cache');
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 节流|防抖
|
|
3
|
+
* @param fn 函数
|
|
4
|
+
* @param wait 等待时间
|
|
5
|
+
* @param isThrottle 是否节流
|
|
6
|
+
*/
|
|
7
|
+
export declare const ChainDebounceOrThrottle: (fn: (...args: any) => any, wait?: number, isThrottle?: boolean) => (...args: any) => any;
|
|
8
|
+
/**
|
|
9
|
+
* 深拷贝
|
|
10
|
+
* @param value 原始对象
|
|
11
|
+
*/
|
|
12
|
+
export declare const ChainDeepClone: (value: any) => any;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* 判断值是否相等
|
|
16
|
+
*
|
|
17
|
+
* abstract 浅对比,不包含迭代
|
|
18
|
+
* samevalue 确定两个值是否在任何情况下功能上是相同的
|
|
19
|
+
*
|
|
20
|
+
* [MDN JS 值相等参考]](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness)
|
|
21
|
+
*
|
|
22
|
+
* @param value1
|
|
23
|
+
* @param value2
|
|
24
|
+
* @param equalType 'abstract' 抽象相等 | 'samevalue' 同值相等
|
|
25
|
+
*/
|
|
26
|
+
export declare const ChainValueEqual: (value1: object, value2: object, equalType?: 'abstract' | 'samevalue') => boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { throttle, debounce, cloneDeep } from 'lodash';
|
|
2
|
+
|
|
3
|
+
// 工具链函数
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 节流|防抖
|
|
7
|
+
* @param fn 函数
|
|
8
|
+
* @param wait 等待时间
|
|
9
|
+
* @param isThrottle 是否节流
|
|
10
|
+
*/
|
|
11
|
+
export var ChainDebounceOrThrottle = function ChainDebounceOrThrottle(fn) {
|
|
12
|
+
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
13
|
+
var isThrottle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
14
|
+
if (isThrottle) {
|
|
15
|
+
// 节流
|
|
16
|
+
// 等待结束后调用
|
|
17
|
+
return throttle(fn, wait, {
|
|
18
|
+
trailing: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 防抖
|
|
23
|
+
// 延迟开始前调用
|
|
24
|
+
return debounce(fn, wait, {
|
|
25
|
+
leading: true
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 深拷贝
|
|
31
|
+
* @param value 原始对象
|
|
32
|
+
*/
|
|
33
|
+
export var ChainDeepClone = function ChainDeepClone(value) {
|
|
34
|
+
return cloneDeep(value);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* 判断值是否相等
|
|
40
|
+
*
|
|
41
|
+
* abstract 浅对比,不包含迭代
|
|
42
|
+
* samevalue 确定两个值是否在任何情况下功能上是相同的
|
|
43
|
+
*
|
|
44
|
+
* [MDN JS 值相等参考]](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness)
|
|
45
|
+
*
|
|
46
|
+
* @param value1
|
|
47
|
+
* @param value2
|
|
48
|
+
* @param equalType 'abstract' 抽象相等 | 'samevalue' 同值相等
|
|
49
|
+
*/
|
|
50
|
+
export var ChainValueEqual = function ChainValueEqual(value1, value2) {
|
|
51
|
+
var equalType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'abstract';
|
|
52
|
+
if (equalType === 'abstract') return value1 === value2;
|
|
53
|
+
return Object.is(value1, value2);
|
|
54
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
/**
|
|
3
|
+
* 将字符串转换为Moment对象,转换失败返回undefined
|
|
4
|
+
* @param value 要转换的对象
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatMoment: (value: moment.Moment) => moment.Moment | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* 将Moment对象的日期转换为字符串,转换失败返回undefined
|
|
9
|
+
* @param value 要转换的对象
|
|
10
|
+
* @param format 转换的格式或者组件的名称字符串
|
|
11
|
+
*/
|
|
12
|
+
export declare const momentFormat: (value: moment.Moment | undefined | null, format?: string) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* 转换类型到 moment 类型
|
|
15
|
+
* @param value 输入类型
|
|
16
|
+
*/
|
|
17
|
+
export declare const objToMoment: (value: any) => any;
|
|
18
|
+
/**
|
|
19
|
+
* 将value值转换为特定格式的时间字符串,转换失败返回传入的值
|
|
20
|
+
* @param value 任意value值
|
|
21
|
+
* @param fmt 转换格式
|
|
22
|
+
*/
|
|
23
|
+
export declare const formatDate: (value: any, fmt?: string) => any;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { DATE_FORMAT } from "../constant";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 将字符串转换为Moment对象,转换失败返回undefined
|
|
6
|
+
* @param value 要转换的对象
|
|
7
|
+
*/
|
|
8
|
+
export var formatMoment = function formatMoment(value) {
|
|
9
|
+
if (value === undefined || value === null) return undefined;
|
|
10
|
+
var momentValue = moment(value);
|
|
11
|
+
if (momentValue.isValid()) return momentValue;
|
|
12
|
+
return undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 将Moment对象的日期转换为字符串,转换失败返回undefined
|
|
17
|
+
* @param value 要转换的对象
|
|
18
|
+
* @param format 转换的格式或者组件的名称字符串
|
|
19
|
+
*/
|
|
20
|
+
export var momentFormat = function momentFormat(value) {
|
|
21
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DATE_FORMAT.default;
|
|
22
|
+
var newFormat = format;
|
|
23
|
+
if (format === 'date') newFormat = DATE_FORMAT.date('23:59:59');
|
|
24
|
+
if (value === undefined || value === null) return undefined;
|
|
25
|
+
if (typeof value === 'string') return value;
|
|
26
|
+
if (value.format === undefined) return undefined;
|
|
27
|
+
return value.format(newFormat);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 转换类型到 moment 类型
|
|
32
|
+
* @param value 输入类型
|
|
33
|
+
*/
|
|
34
|
+
export var objToMoment = function objToMoment(value) {
|
|
35
|
+
// if (!moment.isDate(value)) return undefined;
|
|
36
|
+
if (!value) return undefined;
|
|
37
|
+
if (moment.isMoment(value)) return value;
|
|
38
|
+
if (value === null) return undefined;
|
|
39
|
+
return moment(value);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 将value值转换为特定格式的时间字符串,转换失败返回传入的值
|
|
44
|
+
* @param value 任意value值
|
|
45
|
+
* @param fmt 转换格式
|
|
46
|
+
*/
|
|
47
|
+
export var formatDate = function formatDate(value) {
|
|
48
|
+
var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DATE_FORMAT.default;
|
|
49
|
+
if (!value) return undefined;
|
|
50
|
+
var momentValue = moment(value);
|
|
51
|
+
if (momentValue.isValid()) {
|
|
52
|
+
return momentValue.format(fmt);
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const exportExcelTemp: (columns: any[], fileName?: string, ...omit: any[]) => void;
|
|
2
|
+
export declare const exportExcel: (columns: any[], data: any[] | null, fileName?: any, ...omit: any[]) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Excel 文件上传并解析
|
|
5
|
+
* @param file 上传的文件信息
|
|
6
|
+
* @param fieldMap 字段映射,{ [原始字段]:[导入后需要解析转换的字段] }
|
|
7
|
+
* @param dataOptions 导入成功之后每行都会执行此函数
|
|
8
|
+
* @returns 异步函数,会直接包含解析的数据源
|
|
9
|
+
*/
|
|
10
|
+
export declare const importExcel: (file: Blob | undefined, fieldMap?: any, dataOptions?: (record: any, index: any) => any, importOptions?: {
|
|
11
|
+
rowStart: number;
|
|
12
|
+
}) => Promise<any[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Excel 文件上传并解析
|
|
15
|
+
* @param file 上传的文件信息
|
|
16
|
+
* @param fieldMap 字段映射,{ [原始字段]:[导入后需要解析转换的字段] }
|
|
17
|
+
* @param dataOptions 导入成功之后每行都会执行此函数
|
|
18
|
+
* @returns 异步函数,会直接包含解析的数据源
|
|
19
|
+
*/
|
|
20
|
+
export declare const ImpoertExcelTemplateHeader: (file: Blob | undefined, importOptions?: {
|
|
21
|
+
rowStart: number;
|
|
22
|
+
}) => Promise<any[]>;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import moment from 'moment';
|
|
8
|
+
import { read, utils, writeFile } from 'xlsx';
|
|
9
|
+
export var exportExcelTemp = function exportExcelTemp(columns) {
|
|
10
|
+
var fileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '导出文件模板';
|
|
11
|
+
for (var _len = arguments.length, omit = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
12
|
+
omit[_key - 2] = arguments[_key];
|
|
13
|
+
}
|
|
14
|
+
var header = columns.reduce(function (obj, cur) {
|
|
15
|
+
if (cur.noShow || omit && omit.includes(cur.dataIndex || cur.key)) return obj;
|
|
16
|
+
return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, cur.title, ''));
|
|
17
|
+
}, {});
|
|
18
|
+
var worksheet = utils.json_to_sheet([header]);
|
|
19
|
+
var workbook = utils.book_new();
|
|
20
|
+
utils.book_append_sheet(workbook, worksheet);
|
|
21
|
+
writeFile(workbook, "".concat(fileName, ".xls"), {
|
|
22
|
+
bookType: 'xls',
|
|
23
|
+
bookSST: false,
|
|
24
|
+
type: 'base64' // 编码方式
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export var exportExcel = function exportExcel(columns, data) {
|
|
28
|
+
var fileName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '导出文件';
|
|
29
|
+
for (var _len2 = arguments.length, omit = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
|
30
|
+
omit[_key2 - 3] = arguments[_key2];
|
|
31
|
+
}
|
|
32
|
+
if (!(data === null || data !== null && data !== void 0 && data.length)) {
|
|
33
|
+
// const worksheet = utils.json_to_sheet([])
|
|
34
|
+
var header = columns === null || columns === void 0 ? void 0 : columns.reduce(function (obj, cur) {
|
|
35
|
+
if (cur.noShow || omit && omit.includes(cur.dataIndex || cur.key)) return obj;
|
|
36
|
+
return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, cur.title, ''));
|
|
37
|
+
}, {});
|
|
38
|
+
var worksheet = utils.json_to_sheet([header]);
|
|
39
|
+
var workbook = utils.book_new();
|
|
40
|
+
utils.book_append_sheet(workbook, worksheet);
|
|
41
|
+
writeFile(workbook, "".concat(fileName).concat(moment().format('x'), ".xls"), {
|
|
42
|
+
bookType: 'xls',
|
|
43
|
+
bookSST: false,
|
|
44
|
+
type: 'base64' // 编码方式
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
var keys = [];
|
|
48
|
+
var keyMap = columns.reduce(function (obj, cur) {
|
|
49
|
+
if (cur.noShow || omit && omit.includes(cur.dataIndex || cur.key)) return obj;
|
|
50
|
+
keys.push(cur.dataIndex || cur.key);
|
|
51
|
+
return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, cur.dataIndex || cur.key, cur.title));
|
|
52
|
+
}, {});
|
|
53
|
+
var newData = data === null || data === void 0 ? void 0 : data.reduce(function (arr, cur) {
|
|
54
|
+
var newObj = keys.reduce(function (newCur, key) {
|
|
55
|
+
return _objectSpread(_objectSpread({}, newCur), {}, _defineProperty({}, keyMap[key], cur[key] === undefined || cur[key] === null ? '' : cur[key]));
|
|
56
|
+
}, {});
|
|
57
|
+
arr.push(newObj);
|
|
58
|
+
return arr;
|
|
59
|
+
}, []);
|
|
60
|
+
var _worksheet = utils.json_to_sheet(newData);
|
|
61
|
+
var _workbook = utils.book_new();
|
|
62
|
+
utils.book_append_sheet(_workbook, _worksheet);
|
|
63
|
+
writeFile(_workbook, "".concat(fileName).concat(moment().format('x'), ".xls"), {
|
|
64
|
+
bookType: 'xls',
|
|
65
|
+
bookSST: false,
|
|
66
|
+
type: 'base64' // 编码方式
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Excel 文件上传并解析
|
|
73
|
+
* @param file 上传的文件信息
|
|
74
|
+
* @param fieldMap 字段映射,{ [原始字段]:[导入后需要解析转换的字段] }
|
|
75
|
+
* @param dataOptions 导入成功之后每行都会执行此函数
|
|
76
|
+
* @returns 异步函数,会直接包含解析的数据源
|
|
77
|
+
*/
|
|
78
|
+
export var importExcel = function importExcel(file, fieldMap, dataOptions) {
|
|
79
|
+
var importOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
|
80
|
+
rowStart: 1
|
|
81
|
+
};
|
|
82
|
+
return new Promise(function (resolve) {
|
|
83
|
+
if (file === undefined) {
|
|
84
|
+
throw new Error('没有要上传的文件');
|
|
85
|
+
}
|
|
86
|
+
var fileReader = new FileReader();
|
|
87
|
+
fileReader.onload = function (e) {
|
|
88
|
+
var _e$target;
|
|
89
|
+
var wb = read((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result, {
|
|
90
|
+
type: 'binary',
|
|
91
|
+
cellDates: true
|
|
92
|
+
});
|
|
93
|
+
var jArray = utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], {
|
|
94
|
+
header: 1,
|
|
95
|
+
defval: '',
|
|
96
|
+
rawNumbers: false
|
|
97
|
+
});
|
|
98
|
+
if (jArray.length < importOptions.rowStart) {
|
|
99
|
+
resolve([]);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var sheetTitle = jArray[importOptions.rowStart - 1];
|
|
103
|
+
var dataSource = jArray.reduce(function (arr, cur, index) {
|
|
104
|
+
if (index <= importOptions.rowStart - 1) return arr;
|
|
105
|
+
var obj = {};
|
|
106
|
+
//时间导入会少43秒,所有手动加上43秒
|
|
107
|
+
cur.forEach(function (item, itemIndex) {
|
|
108
|
+
var value = moment.isDate(item) ? moment(item).add(43, 's').format('YYYY-MM-DD HH:mm:ss') : item;
|
|
109
|
+
var title = sheetTitle[itemIndex];
|
|
110
|
+
obj[fieldMap ? fieldMap[title] : title] = value;
|
|
111
|
+
});
|
|
112
|
+
if (typeof dataOptions === 'function') {
|
|
113
|
+
arr.push(dataOptions(obj, index));
|
|
114
|
+
} else {
|
|
115
|
+
arr.push(obj);
|
|
116
|
+
}
|
|
117
|
+
return arr;
|
|
118
|
+
}, []);
|
|
119
|
+
resolve(dataSource);
|
|
120
|
+
};
|
|
121
|
+
fileReader.onerror = function () {
|
|
122
|
+
throw new Error('Blob文件转换错误');
|
|
123
|
+
};
|
|
124
|
+
fileReader.readAsBinaryString(file);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Excel 文件上传并解析
|
|
130
|
+
* @param file 上传的文件信息
|
|
131
|
+
* @param fieldMap 字段映射,{ [原始字段]:[导入后需要解析转换的字段] }
|
|
132
|
+
* @param dataOptions 导入成功之后每行都会执行此函数
|
|
133
|
+
* @returns 异步函数,会直接包含解析的数据源
|
|
134
|
+
*/
|
|
135
|
+
export var ImpoertExcelTemplateHeader = function ImpoertExcelTemplateHeader(file) {
|
|
136
|
+
var importOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
137
|
+
rowStart: 1
|
|
138
|
+
};
|
|
139
|
+
return new Promise(function (resolve) {
|
|
140
|
+
if (file === undefined) {
|
|
141
|
+
throw new Error('没有要上传的文件');
|
|
142
|
+
}
|
|
143
|
+
var fileReader = new FileReader();
|
|
144
|
+
fileReader.onload = function (e) {
|
|
145
|
+
var _e$target2;
|
|
146
|
+
var wb = read((_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.result, {
|
|
147
|
+
type: 'binary',
|
|
148
|
+
cellDates: true
|
|
149
|
+
});
|
|
150
|
+
var jArray = utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], {
|
|
151
|
+
header: 1
|
|
152
|
+
});
|
|
153
|
+
if (jArray.length < importOptions.rowStart) {
|
|
154
|
+
resolve([]);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
var sheetTitle = jArray[importOptions.rowStart - 1];
|
|
158
|
+
resolve(sheetTitle);
|
|
159
|
+
};
|
|
160
|
+
fileReader.onerror = function () {
|
|
161
|
+
throw new Error('Blob文件转换错误');
|
|
162
|
+
};
|
|
163
|
+
fileReader.readAsBinaryString(file);
|
|
164
|
+
});
|
|
165
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './authUtils';
|
|
2
|
+
export * from './cacheUtils';
|
|
3
|
+
export * from './chainUtils';
|
|
4
|
+
export * from './dateUtils';
|
|
5
|
+
export * from './decimalUtils';
|
|
6
|
+
export * from './excelUtils';
|
|
7
|
+
export * from './layoutUtils';
|
|
8
|
+
export * from './objectUtils';
|
|
9
|
+
export * from './soundUtils';
|
|
10
|
+
export * from './stringUtils';
|
|
11
|
+
export * from './sysUtils';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./authUtils";
|
|
2
|
+
export * from "./cacheUtils";
|
|
3
|
+
export * from "./chainUtils";
|
|
4
|
+
export * from "./dateUtils";
|
|
5
|
+
export * from "./decimalUtils";
|
|
6
|
+
export * from "./excelUtils";
|
|
7
|
+
export * from "./layoutUtils";
|
|
8
|
+
export * from "./objectUtils";
|
|
9
|
+
export * from "./soundUtils";
|
|
10
|
+
export * from "./stringUtils";
|
|
11
|
+
export * from "./sysUtils";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calcOperationLayout: (num: number) => {};
|