wt-enjoy-link-antd-repack 4.1.17
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +26 -0
- package/dist/esm/assets/location.png +0 -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 +42 -0
- package/dist/esm/component/BiuComSelect/index.d.ts +24 -0
- package/dist/esm/component/BiuComSelect/index.js +104 -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 +153 -0
- package/dist/esm/component/BiuCustomTable/index.d.ts +14 -0
- package/dist/esm/component/BiuCustomTable/index.js +76 -0
- package/dist/esm/component/BiuCustomerOperCard/component/editTable.d.ts +8 -0
- package/dist/esm/component/BiuCustomerOperCard/component/editTable.js +264 -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/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 +15 -0
- package/dist/esm/component/BiuDetailDrawer/index.js +54 -0
- package/dist/esm/component/BiuDivider/index.d.ts +4 -0
- package/dist/esm/component/BiuDivider/index.js +29 -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 +98 -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 +393 -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 +23 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/addressSelect.js +187 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/base.d.ts +13 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/base.js +153 -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 +66 -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 +24 -0
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.js +164 -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 +113 -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/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 +175 -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 +41 -0
- package/dist/esm/component/BiuField/component/dicTypeSelect.js +84 -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 +18 -0
- package/dist/esm/component/BiuField/component/editLocationSelect.js +119 -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 +37 -0
- package/dist/esm/component/BiuField/component/index.js +37 -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 +88 -0
- package/dist/esm/component/BiuField/component/orderTypeSelect.d.ts +15 -0
- package/dist/esm/component/BiuField/component/orderTypeSelect.js +79 -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 +8 -0
- package/dist/esm/component/BiuField/component/userSelect.js +163 -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 +13 -0
- package/dist/esm/component/BiuField/component/warehouseInfoSelect.js +92 -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 +607 -0
- package/dist/esm/component/BiuFileInput/index.d.ts +11 -0
- package/dist/esm/component/BiuFileInput/index.js +53 -0
- package/dist/esm/component/BiuForm/index.d.ts +12 -0
- package/dist/esm/component/BiuForm/index.js +241 -0
- package/dist/esm/component/BiuForm/type.d.ts +45 -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 +46 -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 +48 -0
- package/dist/esm/component/BiuMapSelectSite/index.js +453 -0
- package/dist/esm/component/BiuModal/index.d.ts +24 -0
- package/dist/esm/component/BiuModal/index.js +239 -0
- package/dist/esm/component/BiuOperForm/index.d.ts +15 -0
- package/dist/esm/component/BiuOperForm/index.js +375 -0
- package/dist/esm/component/BiuOperForm/type.d.ts +23 -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 +14 -0
- package/dist/esm/component/BiuPagination/index.js +34 -0
- package/dist/esm/component/BiuResizeTable/component/biuTableCell.d.ts +1 -0
- package/dist/esm/component/BiuResizeTable/component/biuTableCell.js +74 -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 +88 -0
- package/dist/esm/component/BiuTable/component/tableCellRender.d.ts +14 -0
- package/dist/esm/component/BiuTable/component/tableCellRender.js +108 -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/hooks/index.d.ts +1 -0
- package/dist/esm/component/BiuTable/hooks/index.js +1 -0
- package/dist/esm/component/BiuTable/hooks/useFetchData.d.ts +4 -0
- package/dist/esm/component/BiuTable/hooks/useFetchData.js +64 -0
- package/dist/esm/component/BiuTable/index.d.ts +42 -0
- package/dist/esm/component/BiuTable/index.js +484 -0
- package/dist/esm/component/BiuTable/type.d.ts +168 -0
- package/dist/esm/component/BiuTable/type.js +1 -0
- package/dist/esm/component/BiuTable/utils.d.ts +10 -0
- package/dist/esm/component/BiuTable/utils.js +117 -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 +49 -0
- package/dist/esm/component/BiuTableSelect/index.js +209 -0
- package/dist/esm/component/BiuTabs/index.d.ts +4 -0
- package/dist/esm/component/BiuTabs/index.js +18 -0
- package/dist/esm/component/BiuVirtualTable/index.d.ts +21 -0
- package/dist/esm/component/BiuVirtualTable/index.js +161 -0
- package/dist/esm/component/index.d.ts +35 -0
- package/dist/esm/component/index.js +35 -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 +6 -0
- package/dist/esm/hooks/index.js +6 -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 +15 -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 +43 -0
- package/dist/esm/hooks/useUserInfo.d.ts +4 -0
- package/dist/esm/hooks/useUserInfo.js +15 -0
- package/dist/esm/hooks/useWareInfo.d.ts +4 -0
- package/dist/esm/hooks/useWareInfo.js +15 -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 +402 -0
- package/dist/esm/package/requestWrapper/type.d.ts +36 -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/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 +153 -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 +4 -0
- package/dist/esm/utils/sysUtils.js +4 -0
- package/package.json +59 -0
@@ -0,0 +1,414 @@
|
|
1
|
+
var _excluded = ["requestName", "requestParams", "requestConfig", "value", "responseFun", "formatValue", "optionLabel", "optionValue", "optionList", "placeholder", "allowClear", "showSearch", "optionFilterProp", "valueKey", "defaultLabel", "onChange", "onChangeData"];
|
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
|
+
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); }
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
16
|
+
import { useBoolean } from 'ahooks';
|
17
|
+
import { debounce } from 'lodash';
|
18
|
+
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
19
|
+
import { styled } from 'styled-components';
|
20
|
+
import { BiuASelect, BiuASelectOption } from "../..";
|
21
|
+
import { requestV2 } from "../../../package";
|
22
|
+
|
23
|
+
// value的类型
|
24
|
+
|
25
|
+
/**
|
26
|
+
* 下拉框props
|
27
|
+
* @param requestName 请求接口名字
|
28
|
+
* @param requestParams 请求接口参数, 约束为对象
|
29
|
+
* @param value 选中值
|
30
|
+
* @param responseFun 接口请求完成后调用函数, (接口返回值, 过滤后的结果, 最终select选项) => void
|
31
|
+
* @param formatValue 格式化value函数,通常用来转换value类型确保选中
|
32
|
+
* @param optionLabel 接口响应结果绑定到Select.Option的显示值, 当传入optionList时此字段无效
|
33
|
+
* @param optionValue 接口响应结果绑定到Select.Option的value值, 当传入optionList时此字段无效
|
34
|
+
* @param optionList 自定义下拉项,通常用于接口格式不规范
|
35
|
+
* @param onChange change事件
|
36
|
+
*/
|
37
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
38
|
+
var StyledWrapper = styled.div.withConfig({
|
39
|
+
displayName: "StyledWrapper",
|
40
|
+
componentId: "enjoy-link-antd-repack__sc-133cprl-0"
|
41
|
+
})([".ant-select{.ant-select-selector{.ant-select-selection-overflow{flex-wrap:nowrap !important;overflow:hidden !important;}.ant-select-selection-search{width:100% !important;}.ant-select-selection-search-input{width:100% !important;opacity:1 !important;input{opacity:1 !important;}}}}.ant-select-selection-overflow-item{display:none;flex:1;}.ant-select-selection-overflow-item.ant-select-selection-overflow-item-suffix{display:block;}"]);
|
42
|
+
export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
43
|
+
var requestName = props.requestName,
|
44
|
+
requestParams = props.requestParams,
|
45
|
+
requestConfig = props.requestConfig,
|
46
|
+
value = props.value,
|
47
|
+
responseFun = props.responseFun,
|
48
|
+
formatValue = props.formatValue,
|
49
|
+
_props$optionLabel = props.optionLabel,
|
50
|
+
optionLabel = _props$optionLabel === void 0 ? 'busDistrictName' : _props$optionLabel,
|
51
|
+
_props$optionValue = props.optionValue,
|
52
|
+
optionValue = _props$optionValue === void 0 ? 'id' : _props$optionValue,
|
53
|
+
optionList = props.optionList,
|
54
|
+
_props$placeholder = props.placeholder,
|
55
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
56
|
+
_props$allowClear = props.allowClear,
|
57
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
58
|
+
_props$showSearch = props.showSearch,
|
59
|
+
showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
|
60
|
+
_props$optionFilterPr = props.optionFilterProp,
|
61
|
+
optionFilterProp = _props$optionFilterPr === void 0 ? 'children' : _props$optionFilterPr,
|
62
|
+
_props$valueKey = props.valueKey,
|
63
|
+
valueKey = _props$valueKey === void 0 ? 'busDistrictCode' : _props$valueKey,
|
64
|
+
defaultLabel = props.defaultLabel,
|
65
|
+
onChange = props.onChange,
|
66
|
+
onChangeData = props.onChangeData,
|
67
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
68
|
+
var multiple = (props === null || props === void 0 ? void 0 : props.mode) === 'multiple';
|
69
|
+
/** 生成唯一id */
|
70
|
+
var id = useRef("user-select-".concat(Math.random().toString(36).substring(2, 9)));
|
71
|
+
// select的加载状态
|
72
|
+
var _useBoolean = useBoolean(false),
|
73
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
74
|
+
loading = _useBoolean2[0],
|
75
|
+
_useBoolean2$ = _useBoolean2[1],
|
76
|
+
setTrue = _useBoolean2$.setTrue,
|
77
|
+
setFalse = _useBoolean2$.setFalse;
|
78
|
+
var _useState = useState(''),
|
79
|
+
_useState2 = _slicedToArray(_useState, 2),
|
80
|
+
inputValue = _useState2[0],
|
81
|
+
setInputValue = _useState2[1];
|
82
|
+
var _useState3 = useState(1),
|
83
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
84
|
+
refreshInputValueKey = _useState4[0],
|
85
|
+
setInputValueKey = _useState4[1];
|
86
|
+
|
87
|
+
// 菜单展示项
|
88
|
+
var _useState5 = useState([]),
|
89
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
90
|
+
options = _useState6[0],
|
91
|
+
setOptions = _useState6[1];
|
92
|
+
|
93
|
+
// select的命中值
|
94
|
+
var defaultValue = value ? value : multiple ? [] : undefined;
|
95
|
+
var _useState7 = useState(defaultValue),
|
96
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
97
|
+
customValue = _useState8[0],
|
98
|
+
_setCustomValue = _useState8[1];
|
99
|
+
var setCustomValue = useCallback(function (setValue) {
|
100
|
+
// 改变外部的值
|
101
|
+
if (onChangeData) onChangeData(setValue);
|
102
|
+
_setCustomValue(setValue);
|
103
|
+
}, [onChangeData]);
|
104
|
+
useEffect(function () {
|
105
|
+
var modelValue = value;
|
106
|
+
if (multiple) {
|
107
|
+
if (typeof modelValue === 'string') {
|
108
|
+
setCustomValue(modelValue ? modelValue.split(',').map(Number) : []);
|
109
|
+
} else if (typeof modelValue === 'number') {
|
110
|
+
setCustomValue([modelValue]);
|
111
|
+
return;
|
112
|
+
} else setCustomValue(modelValue || []);
|
113
|
+
}
|
114
|
+
setCustomValue(modelValue);
|
115
|
+
return;
|
116
|
+
}, [multiple, setCustomValue, value]);
|
117
|
+
var refreshInputValue = function refreshInputValue(val) {
|
118
|
+
setCustomValue(val);
|
119
|
+
if (!multiple) {
|
120
|
+
var _options$find;
|
121
|
+
var _str = ((_options$find = options.find(function (i) {
|
122
|
+
return i[valueKey] === val;
|
123
|
+
})) === null || _options$find === void 0 ? void 0 : _options$find.busDistrictName) || '';
|
124
|
+
// 强制输入框内容为选中的内容
|
125
|
+
setInputValue(_str);
|
126
|
+
var _inputDom = document.querySelector("#".concat(id.current, " .ant-select-selection-search-input"));
|
127
|
+
_inputDom === null || _inputDom === void 0 || _inputDom.setAttribute('placeholder', _str);
|
128
|
+
return;
|
129
|
+
}
|
130
|
+
var str = val.filter(function (item) {
|
131
|
+
return item;
|
132
|
+
}).reduce(function (currentStr, item) {
|
133
|
+
var _options$find2;
|
134
|
+
var employeeName = (_options$find2 = options.find(function (i) {
|
135
|
+
return i[valueKey] === item;
|
136
|
+
})) === null || _options$find2 === void 0 ? void 0 : _options$find2.busDistrictName;
|
137
|
+
if (employeeName) {
|
138
|
+
return "".concat(currentStr, ",").concat(employeeName);
|
139
|
+
} else {
|
140
|
+
return "".concat(currentStr, ",\u3010").concat(item, "\u3011");
|
141
|
+
}
|
142
|
+
}, '');
|
143
|
+
|
144
|
+
// 强制输入框内容为选中的内容
|
145
|
+
setInputValue(str.slice(1));
|
146
|
+
var inputDom = document.querySelector("#".concat(id.current, " .ant-select-selection-search-input"));
|
147
|
+
inputDom === null || inputDom === void 0 || inputDom.setAttribute('placeholder', str.slice(1));
|
148
|
+
};
|
149
|
+
/**
|
150
|
+
* 选中改变事件
|
151
|
+
*/
|
152
|
+
var change = function change(val) {
|
153
|
+
setCustomValue(val);
|
154
|
+
refreshInputValue(val);
|
155
|
+
if (!multiple) {
|
156
|
+
if (onChange) onChange(val, options);
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
if (onChange) onChange(val, options);
|
160
|
+
};
|
161
|
+
|
162
|
+
// 接口请求数据
|
163
|
+
var handleSearch = useCallback(function (keyword) {
|
164
|
+
var params = {
|
165
|
+
page: 1,
|
166
|
+
size: 10,
|
167
|
+
business: keyword
|
168
|
+
};
|
169
|
+
if (valueKey === 'id') {
|
170
|
+
if (multiple) {
|
171
|
+
params.ids = customValue.join(',');
|
172
|
+
} else {
|
173
|
+
params.ids = customValue;
|
174
|
+
}
|
175
|
+
} else if (valueKey === 'busDistrictCode') {
|
176
|
+
if (multiple) {
|
177
|
+
params.busDistrictCodes = customValue.join(',');
|
178
|
+
} else {
|
179
|
+
params.busDistrictCodes = customValue;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
setTrue();
|
183
|
+
var Codes = undefined;
|
184
|
+
if (_typeof(value) === 'object' && Array.isArray(value)) {
|
185
|
+
// 数据是数组
|
186
|
+
Codes = value;
|
187
|
+
} else if (typeof value === 'string') {
|
188
|
+
// 数据是字符串
|
189
|
+
Codes = value.split(',');
|
190
|
+
}
|
191
|
+
return requestV2({
|
192
|
+
apiName: '/tms/businessDistrictService/getBusinessSpinnerList',
|
193
|
+
data: _objectSpread(_objectSpread({
|
194
|
+
page: 1,
|
195
|
+
size: 50,
|
196
|
+
Codes: Codes
|
197
|
+
}, requestParams), params)
|
198
|
+
}).then(function (res) {
|
199
|
+
var filterRes = res.rows;
|
200
|
+
|
201
|
+
// 将结果转化为 select 需要的格式
|
202
|
+
var list;
|
203
|
+
if (optionList) {
|
204
|
+
list = optionList(filterRes); // 这里传入过滤之后的结果
|
205
|
+
} else {
|
206
|
+
list = filterRes.map(function (item) {
|
207
|
+
return _objectSpread({
|
208
|
+
label: item[optionLabel],
|
209
|
+
value: item[optionValue]
|
210
|
+
}, item);
|
211
|
+
});
|
212
|
+
}
|
213
|
+
// 执行接口请求完成的回调
|
214
|
+
if (responseFun) responseFun(res, filterRes, list);
|
215
|
+
setOptions(list);
|
216
|
+
setFalse();
|
217
|
+
}).catch(function () {
|
218
|
+
setFalse();
|
219
|
+
});
|
220
|
+
}, [customValue, multiple, optionLabel, optionList, optionValue, requestParams, responseFun, setFalse, setTrue, value, valueKey]);
|
221
|
+
useEffect(function () {
|
222
|
+
refreshInputValue(customValue);
|
223
|
+
}, [refreshInputValueKey]);
|
224
|
+
|
225
|
+
// 格式化命中值
|
226
|
+
useEffect(function () {
|
227
|
+
var label = defaultLabel;
|
228
|
+
var labelstr = Array.isArray(label) ? label.join(',') : label;
|
229
|
+
/**
|
230
|
+
* 校验customValue是不是在options全部存在,如果全部存在则不自动生成options
|
231
|
+
*/
|
232
|
+
if (options !== null && options !== void 0 && options.length && labelstr) {
|
233
|
+
var labelArr = labelstr.split(',');
|
234
|
+
var existentArr = labelArr.filter(function (str) {
|
235
|
+
return options.find(function (item) {
|
236
|
+
return item.busDistrictName === str;
|
237
|
+
});
|
238
|
+
});
|
239
|
+
if (labelArr.length === existentArr.length) return;
|
240
|
+
}
|
241
|
+
/**
|
242
|
+
* 数据初始化显示,支持传入label进入,初始化的时候不用调用接口
|
243
|
+
* 自己生成一个options,这样使组件显示正常
|
244
|
+
*/
|
245
|
+
if (multiple && labelstr) {
|
246
|
+
var _labelArr = labelstr.split(',');
|
247
|
+
setInputValue(labelstr);
|
248
|
+
if (valueKey === 'id') {
|
249
|
+
var fleetingOptions = customValue.map(function (item, index) {
|
250
|
+
return {
|
251
|
+
id: item,
|
252
|
+
busDistrictCode: 0,
|
253
|
+
busDistrictName: _labelArr[index] || String(item),
|
254
|
+
postName: '',
|
255
|
+
companyName: ''
|
256
|
+
};
|
257
|
+
});
|
258
|
+
setOptions(fleetingOptions);
|
259
|
+
} else {
|
260
|
+
var _fleetingOptions = customValue.map(function (item, index) {
|
261
|
+
return {
|
262
|
+
id: 0,
|
263
|
+
busDistrictCode: item,
|
264
|
+
busDistrictName: _labelArr[index] || String(item),
|
265
|
+
postName: '',
|
266
|
+
companyName: ''
|
267
|
+
};
|
268
|
+
});
|
269
|
+
setOptions(_fleetingOptions);
|
270
|
+
}
|
271
|
+
} else if (labelstr) {
|
272
|
+
setInputValue(labelstr);
|
273
|
+
if (valueKey === 'id') {
|
274
|
+
var _fleetingOptions2 = [{
|
275
|
+
id: customValue,
|
276
|
+
busDistrictCode: 0,
|
277
|
+
busDistrictName: labelstr,
|
278
|
+
postName: '',
|
279
|
+
companyName: ''
|
280
|
+
}];
|
281
|
+
setOptions(_fleetingOptions2);
|
282
|
+
} else {
|
283
|
+
var _fleetingOptions3 = [{
|
284
|
+
id: 0,
|
285
|
+
busDistrictCode: customValue,
|
286
|
+
busDistrictName: labelstr,
|
287
|
+
postName: '',
|
288
|
+
companyName: ''
|
289
|
+
}];
|
290
|
+
setOptions(_fleetingOptions3);
|
291
|
+
}
|
292
|
+
} else if (multiple && multiple && customValue.length || !multiple && customValue) {
|
293
|
+
// eslint-disable-next-line no-console
|
294
|
+
console.warn("\u7EC4\u4EF6\u521D\u59CB\u5316\u65F6\u6709\u503C\uFF0C\u4F46\u662F\u6CA1\u6709\u4F20\u5165defaultLabel\uFF0C\u8BF7\u4F18\u5316\uFF0C\u7EC4\u4EF6\uFF1AUserSelect\uFF0C\u5F53\u524Dvalue: ".concat(customValue));
|
295
|
+
handleSearch('').then(function () {
|
296
|
+
setInputValueKey(function (v) {
|
297
|
+
return v + 1;
|
298
|
+
});
|
299
|
+
});
|
300
|
+
}
|
301
|
+
if (labelstr) {
|
302
|
+
setTimeout(function () {
|
303
|
+
var inputDom = document.querySelector("#".concat(id.current, " .ant-select-selection-search-input"));
|
304
|
+
if (inputDom) {
|
305
|
+
inputDom.value = labelstr;
|
306
|
+
}
|
307
|
+
var spanDom = document.querySelector("#".concat(id.current, " .ant-select-selection-item"));
|
308
|
+
if (spanDom) {
|
309
|
+
spanDom.innerHTML = labelstr;
|
310
|
+
}
|
311
|
+
}, 0);
|
312
|
+
}
|
313
|
+
}, [defaultLabel]);
|
314
|
+
|
315
|
+
/**
|
316
|
+
* 聚焦事件
|
317
|
+
* 1、查询数据
|
318
|
+
* 2、聚焦时将输入框的value改成placeholder
|
319
|
+
*/
|
320
|
+
var focus = useCallback(function () {
|
321
|
+
// 查询数据
|
322
|
+
handleSearch('');
|
323
|
+
if (!inputValue) {
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
var inputDom = document.querySelector("#".concat(id.current, " .ant-select-selection-search-input"));
|
327
|
+
inputDom === null || inputDom === void 0 || inputDom.setAttribute('placeholder', inputValue);
|
328
|
+
inputDom.value = '';
|
329
|
+
}, [handleSearch, inputValue]);
|
330
|
+
/**
|
331
|
+
* 失焦事件
|
332
|
+
* 1、失焦时将输入框的placeholder还原成value
|
333
|
+
*/
|
334
|
+
var blur = useCallback(function () {
|
335
|
+
if (!inputValue) {
|
336
|
+
return;
|
337
|
+
}
|
338
|
+
var inputDom = document.querySelector("#".concat(id.current, " .ant-select-selection-search-input"));
|
339
|
+
if (!customValue || Array.isArray(customValue) && customValue.length === 0) {
|
340
|
+
inputDom.value = inputDom.getAttribute('placeholder') || '';
|
341
|
+
inputDom === null || inputDom === void 0 || inputDom.setAttribute('placeholder', placeholder || '');
|
342
|
+
}
|
343
|
+
}, [inputValue, placeholder]);
|
344
|
+
|
345
|
+
/**
|
346
|
+
* 自定义判断过滤时是否命中
|
347
|
+
* 1、多选时全部展示(展示接口返回的数据)
|
348
|
+
* 2、单选时逐条判断是否显示。原因:假如此时value是1,搜索2,但是接口返回的是1,我们想要展示空。
|
349
|
+
*/
|
350
|
+
var filterOption = function filterOption(text, option) {
|
351
|
+
if (multiple) {
|
352
|
+
return true;
|
353
|
+
}
|
354
|
+
// eslint-disable-next-line no-param-reassign
|
355
|
+
option = options.find(function (item) {
|
356
|
+
return item[valueKey] === option.value;
|
357
|
+
});
|
358
|
+
if (option) {
|
359
|
+
delete option.class;
|
360
|
+
if (Object.values(option).filter(function (i) {
|
361
|
+
return i;
|
362
|
+
}).map(String).some(function (values) {
|
363
|
+
if (values.indexOf(text) > -1) {
|
364
|
+
return true;
|
365
|
+
}
|
366
|
+
return false;
|
367
|
+
})) {
|
368
|
+
return true;
|
369
|
+
}
|
370
|
+
}
|
371
|
+
return false;
|
372
|
+
};
|
373
|
+
return /*#__PURE__*/_jsx(StyledWrapper, {
|
374
|
+
id: id.current,
|
375
|
+
children: /*#__PURE__*/_jsx(BiuASelect, _objectSpread(_objectSpread({
|
376
|
+
ref: ref,
|
377
|
+
loading: loading,
|
378
|
+
value: loading ? undefined : customValue,
|
379
|
+
allowClear: allowClear,
|
380
|
+
placeholder: placeholder,
|
381
|
+
showSearch: showSearch,
|
382
|
+
filterOption: filterOption,
|
383
|
+
optionLabelProp: "label",
|
384
|
+
optionFilterProp: optionFilterProp
|
385
|
+
}, restProps), {}, {
|
386
|
+
onSearch: debounce(handleSearch, 500),
|
387
|
+
onChange: change,
|
388
|
+
onFocus: focus,
|
389
|
+
onBlur: blur,
|
390
|
+
dropdownRender: function dropdownRender(menu) {
|
391
|
+
return /*#__PURE__*/_jsx("div", {
|
392
|
+
onMouseDown: function onMouseDown(e) {
|
393
|
+
e.preventDefault();
|
394
|
+
e.stopPropagation();
|
395
|
+
},
|
396
|
+
children: menu
|
397
|
+
});
|
398
|
+
},
|
399
|
+
children: options.map(function (item) {
|
400
|
+
return /*#__PURE__*/_jsx(BiuASelectOption, {
|
401
|
+
label: item.busDistrictName,
|
402
|
+
value: item[valueKey],
|
403
|
+
children: /*#__PURE__*/_jsx("div", {
|
404
|
+
style: {
|
405
|
+
fontSize: 14,
|
406
|
+
color: 'rgb(29, 33, 41)'
|
407
|
+
},
|
408
|
+
children: "".concat(item.busDistrictCode, "_").concat(item.busDistrictName)
|
409
|
+
})
|
410
|
+
}, item.busDistrictCode + item.id);
|
411
|
+
})
|
412
|
+
}))
|
413
|
+
});
|
414
|
+
}));
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { LabeledValue, SelectProps } from 'antd/es/select';
|
2
|
+
import React from 'react';
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
4
|
+
clientid: string;
|
5
|
+
noOwnerContent?: string | undefined;
|
6
|
+
initialLabeledValue?: LabeledValue | undefined;
|
7
|
+
requiredOwner?: boolean | undefined;
|
8
|
+
clientidNull?: string | undefined;
|
9
|
+
onChangeData?: ((value: any, record: any) => void) | undefined;
|
10
|
+
requestParams?: ((params: any) => any) | undefined;
|
11
|
+
isFirstLoad?: boolean | undefined;
|
12
|
+
} & SelectProps<any, import("antd/es/select").DefaultOptionType> & React.RefAttributes<unknown>>>;
|
13
|
+
export default _default;
|
@@ -0,0 +1,145 @@
|
|
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
|
+
var _excluded = ["clientid", "noOwnerContent", "initialLabeledValue", "requiredOwner", "clientidNull", "onChange", "onChangeData", "value", "requestParams", "isFirstLoad"];
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
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; }
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
7
|
+
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); }
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
15
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
16
|
+
import { toString } from 'lodash';
|
17
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
18
|
+
import { BiuCustomSelect } from "../..";
|
19
|
+
import { GATEWAY_ROUTE_MDM } from "../../../constant";
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
21
|
+
var requestConfig = {
|
22
|
+
GatewayRoute: GATEWAY_ROUTE_MDM
|
23
|
+
};
|
24
|
+
export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
25
|
+
var clientid = props.clientid,
|
26
|
+
_props$noOwnerContent = props.noOwnerContent,
|
27
|
+
noOwnerContent = _props$noOwnerContent === void 0 ? '请先选择货主' : _props$noOwnerContent,
|
28
|
+
initialLabeledValue = props.initialLabeledValue,
|
29
|
+
_props$requiredOwner = props.requiredOwner,
|
30
|
+
requiredOwner = _props$requiredOwner === void 0 ? true : _props$requiredOwner,
|
31
|
+
_props$clientidNull = props.clientidNull,
|
32
|
+
clientidNull = _props$clientidNull === void 0 ? '' : _props$clientidNull,
|
33
|
+
onChange = props.onChange,
|
34
|
+
onChangeData = props.onChangeData,
|
35
|
+
value = props.value,
|
36
|
+
requestParams = props.requestParams,
|
37
|
+
_props$isFirstLoad = props.isFirstLoad,
|
38
|
+
isFirstLoad = _props$isFirstLoad === void 0 ? true : _props$isFirstLoad,
|
39
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
40
|
+
var _useState = useState([]),
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
42
|
+
carrierInfoList = _useState2[0],
|
43
|
+
setCarrierInfoList = _useState2[1];
|
44
|
+
var _useState3 = useState(),
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
46
|
+
notFoundContent = _useState4[0],
|
47
|
+
setNotFoundContent = _useState4[1];
|
48
|
+
var _useState5 = useState(value),
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
50
|
+
newValue = _useState6[0],
|
51
|
+
setNewValue = _useState6[1];
|
52
|
+
var _useState7 = useState(isFirstLoad),
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
54
|
+
isFirstLoadSearch = _useState8[0],
|
55
|
+
setIsFirstLoadSearch = _useState8[1];
|
56
|
+
|
57
|
+
// 搜索
|
58
|
+
var _useState9 = useState(),
|
59
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
60
|
+
carriername = _useState10[0],
|
61
|
+
setCarriername = _useState10[1];
|
62
|
+
var handleSearch = useCallback(function (svalue) {
|
63
|
+
if (!clientid && requiredOwner === true) return;
|
64
|
+
setNotFoundContent(undefined);
|
65
|
+
setCarriername(svalue);
|
66
|
+
setIsFirstLoadSearch(true);
|
67
|
+
}, [clientid, requiredOwner]);
|
68
|
+
useEffect(function () {
|
69
|
+
if (restProps.labelInValue) {
|
70
|
+
setNewValue(value);
|
71
|
+
} else {
|
72
|
+
setNewValue(value ? "".concat(value) : '');
|
73
|
+
}
|
74
|
+
}, [restProps.labelInValue, value]);
|
75
|
+
useEffect(function () {
|
76
|
+
if (!clientid && requiredOwner === true) {
|
77
|
+
setNotFoundContent(noOwnerContent);
|
78
|
+
setCarrierInfoList([]);
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
if (initialLabeledValue && initialLabeledValue.key) {
|
82
|
+
setNotFoundContent(undefined);
|
83
|
+
if (restProps.labelInValue) {
|
84
|
+
setNewValue(initialLabeledValue);
|
85
|
+
} else {
|
86
|
+
setNewValue("".concat(initialLabeledValue.key));
|
87
|
+
}
|
88
|
+
setCarrierInfoList([{
|
89
|
+
id: toString(initialLabeledValue.key),
|
90
|
+
carriername: initialLabeledValue.label
|
91
|
+
}]);
|
92
|
+
} else {
|
93
|
+
setNotFoundContent('请输入承运商名称搜索');
|
94
|
+
}
|
95
|
+
}, [clientid, initialLabeledValue, noOwnerContent, requiredOwner, restProps.labelInValue]);
|
96
|
+
var params = useMemo(function () {
|
97
|
+
var data = {
|
98
|
+
page: 1,
|
99
|
+
size: 999999,
|
100
|
+
clientid: clientid,
|
101
|
+
carriername: carriername,
|
102
|
+
clientidNull: clientidNull,
|
103
|
+
isFirstLoadSearch: isFirstLoadSearch,
|
104
|
+
invalid: 0
|
105
|
+
};
|
106
|
+
if (!requestParams) return data;
|
107
|
+
return requestParams(data);
|
108
|
+
}, [clientid, carriername, clientidNull, isFirstLoadSearch, requestParams]);
|
109
|
+
var isOnReady = useCallback(function (readyParams) {
|
110
|
+
if (!readyParams.clientid && requiredOwner === true) return false;
|
111
|
+
if (!params.isFirstLoadSearch) return false;
|
112
|
+
return true;
|
113
|
+
}, [params.isFirstLoadSearch, requiredOwner]);
|
114
|
+
var onFetchData = useCallback(function (res) {
|
115
|
+
setCarrierInfoList(res.rows);
|
116
|
+
return res.rows.map(function (item) {
|
117
|
+
return {
|
118
|
+
label: item.carriername,
|
119
|
+
value: "".concat(item.id)
|
120
|
+
};
|
121
|
+
});
|
122
|
+
}, []);
|
123
|
+
var isOnChange = useCallback(function (_value, option) {
|
124
|
+
if (onChange) onChange(_value, option);
|
125
|
+
if (onChangeData) {
|
126
|
+
onChangeData(_value, carrierInfoList.filter(function (item) {
|
127
|
+
return "".concat(item.id) === "".concat(_value);
|
128
|
+
})[0]);
|
129
|
+
}
|
130
|
+
}, [carrierInfoList, onChange, onChangeData]);
|
131
|
+
return /*#__PURE__*/_jsx(BiuCustomSelect, _objectSpread({
|
132
|
+
ref: ref,
|
133
|
+
requestName: "wms.mdm.carrierInfoQuery",
|
134
|
+
requestParams: params,
|
135
|
+
requestConfig: requestConfig,
|
136
|
+
onReady: isOnReady,
|
137
|
+
allowClear: true,
|
138
|
+
notFoundContent: notFoundContent,
|
139
|
+
filterOption: false,
|
140
|
+
onSearch: handleSearch,
|
141
|
+
value: newValue,
|
142
|
+
onFetchData: onFetchData,
|
143
|
+
onChange: isOnChange
|
144
|
+
}, restProps), "carrierInfoSelect");
|
145
|
+
}));
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { SelectProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
4
|
+
warehouseId?: number | undefined;
|
5
|
+
onChangeData?: ((value: any, record: any) => void) | undefined;
|
6
|
+
isFirstLoad?: boolean | undefined;
|
7
|
+
} & SelectProps<any, import("antd/lib/select").DefaultOptionType> & React.RefAttributes<unknown>>>;
|
8
|
+
export default _default;
|