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,153 @@
|
|
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 = ["requestName", "requestParams", "requestConfig", "onReady", "value", "formatValue", "onFetchData", "optionList", "onChange", "placeholder", "allowClear", "showSearch", "optionFilterProp"],
|
3
|
+
_excluded2 = ["label", "value"];
|
4
|
+
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; }
|
5
|
+
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; }
|
6
|
+
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; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
8
|
+
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); }
|
9
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
10
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
14
|
+
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."); }
|
15
|
+
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); }
|
16
|
+
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; }
|
17
|
+
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; } }
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
19
|
+
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; }
|
20
|
+
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; }
|
21
|
+
import { useBoolean } from 'ahooks';
|
22
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
23
|
+
import { BiuASelect, BiuASelectOption } from "./..";
|
24
|
+
import { request } from "../../package";
|
25
|
+
|
26
|
+
// value的类型
|
27
|
+
|
28
|
+
/**
|
29
|
+
* 下拉框props
|
30
|
+
* @param requestName 请求接口名字
|
31
|
+
* @param requestParams 请求接口参数, 约束为对象
|
32
|
+
* @param value 选中值
|
33
|
+
* @param onReady 是否准备就绪, (请求参数, loading) => boolean, 返回true则调用接口
|
34
|
+
* @param formatValue 格式化value函数,通常用来转换value类型确保选中
|
35
|
+
* @param optionList 自定义下拉项,通常用于接口格式不规范
|
36
|
+
*/
|
37
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
38
|
+
export var BiuCustomSelect = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
39
|
+
var requestName = props.requestName,
|
40
|
+
requestParams = props.requestParams,
|
41
|
+
requestConfig = props.requestConfig,
|
42
|
+
onReady = props.onReady,
|
43
|
+
value = props.value,
|
44
|
+
formatValue = props.formatValue,
|
45
|
+
onFetchData = props.onFetchData,
|
46
|
+
optionList = props.optionList,
|
47
|
+
_onChange = props.onChange,
|
48
|
+
_props$placeholder = props.placeholder,
|
49
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
50
|
+
_props$allowClear = props.allowClear,
|
51
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
52
|
+
_props$showSearch = props.showSearch,
|
53
|
+
showSearch = _props$showSearch === void 0 ? true : _props$showSearch,
|
54
|
+
_props$optionFilterPr = props.optionFilterProp,
|
55
|
+
optionFilterProp = _props$optionFilterPr === void 0 ? 'children' : _props$optionFilterPr,
|
56
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
57
|
+
var isOnReady = useMemo(function () {
|
58
|
+
if (!onReady) return function () {
|
59
|
+
return true;
|
60
|
+
};
|
61
|
+
return onReady;
|
62
|
+
}, [onReady]);
|
63
|
+
|
64
|
+
// select的加载状态
|
65
|
+
var _useBoolean = useBoolean(false),
|
66
|
+
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
67
|
+
loading = _useBoolean2[0],
|
68
|
+
_useBoolean2$ = _useBoolean2[1],
|
69
|
+
setTrue = _useBoolean2$.setTrue,
|
70
|
+
setFalse = _useBoolean2$.setFalse;
|
71
|
+
// 菜单展示项
|
72
|
+
var _useState = useState([]),
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
74
|
+
listSource = _useState2[0],
|
75
|
+
setListSource = _useState2[1];
|
76
|
+
// select的命中值
|
77
|
+
var _useState3 = useState(value),
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
79
|
+
selectedValue = _useState4[0],
|
80
|
+
setSelectedValue = _useState4[1];
|
81
|
+
var isSelectedValue = useCallback(function (currentSelectvalue) {
|
82
|
+
if (formatValue) {
|
83
|
+
setSelectedValue(formatValue(currentSelectvalue));
|
84
|
+
} else {
|
85
|
+
setSelectedValue(currentSelectvalue);
|
86
|
+
}
|
87
|
+
}, [formatValue]);
|
88
|
+
|
89
|
+
/**
|
90
|
+
* 把第一次赋值作为组件初始化,进行手动赋值,防止组件初始化时,value为undefined
|
91
|
+
* 一般情况下组件内部值需要通过 onChange 事件来进行赋值,但是如果组件初始化时,onChange事件不会触发
|
92
|
+
*/
|
93
|
+
useEffect(function () {
|
94
|
+
var currentValue = formatValue ? formatValue(value) : value;
|
95
|
+
if (currentValue !== selectedValue) {
|
96
|
+
isSelectedValue(currentValue);
|
97
|
+
}
|
98
|
+
}, [formatValue, isSelectedValue, selectedValue, value]);
|
99
|
+
useEffect(function () {
|
100
|
+
if (isOnReady && isOnReady(requestParams) && requestName) {
|
101
|
+
setTrue();
|
102
|
+
request({
|
103
|
+
apiName: requestName,
|
104
|
+
data: requestParams,
|
105
|
+
requestConfig: requestConfig
|
106
|
+
}).then(function (result) {
|
107
|
+
if (onFetchData) {
|
108
|
+
setListSource(onFetchData(result));
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
if (!Array.isArray(result)) {
|
112
|
+
throw new Error('数据类型不匹配,请返回数组类型或使用 onFetchData 进行前置处理!');
|
113
|
+
}
|
114
|
+
setListSource(_toConsumableArray(result));
|
115
|
+
}).finally(function () {
|
116
|
+
setFalse();
|
117
|
+
});
|
118
|
+
}
|
119
|
+
}, [isOnReady, onFetchData, optionList, requestConfig, requestName, requestParams, setFalse, setTrue]);
|
120
|
+
useEffect(function () {
|
121
|
+
if (optionList && !requestName) {
|
122
|
+
setListSource(optionList());
|
123
|
+
}
|
124
|
+
}, [optionList, requestName]);
|
125
|
+
return /*#__PURE__*/_jsx(BiuASelect, _objectSpread(_objectSpread({
|
126
|
+
ref: ref,
|
127
|
+
loading: loading,
|
128
|
+
value: selectedValue,
|
129
|
+
allowClear: allowClear,
|
130
|
+
placeholder: placeholder,
|
131
|
+
showSearch: showSearch,
|
132
|
+
optionFilterProp: optionFilterProp,
|
133
|
+
filterOption: function filterOption(input, option) {
|
134
|
+
var _option$children;
|
135
|
+
return ((_option$children = option.children) === null || _option$children === void 0 ? void 0 : _option$children.toLowerCase().indexOf(input.trim().toLowerCase())) >= 0;
|
136
|
+
}
|
137
|
+
}, restProps), {}, {
|
138
|
+
onChange: function onChange(selectValue, option) {
|
139
|
+
isSelectedValue(selectValue);
|
140
|
+
if (_onChange) _onChange(selectValue, option);
|
141
|
+
},
|
142
|
+
children: listSource.map(function (_ref) {
|
143
|
+
var label = _ref.label,
|
144
|
+
v = _ref.value,
|
145
|
+
options = _objectWithoutProperties(_ref, _excluded2);
|
146
|
+
return /*#__PURE__*/_jsx(BiuASelectOption, _objectSpread(_objectSpread({
|
147
|
+
value: v
|
148
|
+
}, options), {}, {
|
149
|
+
children: label
|
150
|
+
}), v);
|
151
|
+
})
|
152
|
+
}));
|
153
|
+
}));
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { TableProps } from 'antd/es/table';
|
2
|
+
import React from 'react';
|
3
|
+
import type { BiuColumnType } from "..";
|
4
|
+
/**
|
5
|
+
* 把原生表格包裹起来,方便后续拓展样式或者默认属性
|
6
|
+
*/
|
7
|
+
export declare const BiuCustomTable: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
8
|
+
cardtitle?: React.ReactNode;
|
9
|
+
tableW?: string | number | undefined;
|
10
|
+
suppWidth?: number | undefined;
|
11
|
+
tableH?: number | undefined;
|
12
|
+
virtual?: boolean | undefined;
|
13
|
+
columns?: BiuColumnType[] | undefined;
|
14
|
+
} & Omit<TableProps<any>, "columns"> & React.RefAttributes<unknown>>>;
|
@@ -0,0 +1,76 @@
|
|
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 = ["cardtitle", "tableW", "suppWidth", "tableH", "columns", "virtual"];
|
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 _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; }
|
9
|
+
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; }
|
10
|
+
import React, { forwardRef, useMemo } from 'react';
|
11
|
+
import { BiuDivider, BiuVirtualTable, BiuResizeTable } from "./..";
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
|
+
var calcColsTotalWidth = function calcColsTotalWidth(cols) {
|
16
|
+
var suppWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
17
|
+
var resSum = suppWidth;
|
18
|
+
cols.forEach(function (d) {
|
19
|
+
resSum += +(d.width || 180);
|
20
|
+
});
|
21
|
+
return resSum;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* 把原生表格包裹起来,方便后续拓展样式或者默认属性
|
25
|
+
*/
|
26
|
+
export var BiuCustomTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
27
|
+
var cardtitle = props.cardtitle,
|
28
|
+
tableW = props.tableW,
|
29
|
+
suppWidth = props.suppWidth,
|
30
|
+
tableH = props.tableH,
|
31
|
+
_props$columns = props.columns,
|
32
|
+
columns = _props$columns === void 0 ? [] : _props$columns,
|
33
|
+
_props$virtual = props.virtual,
|
34
|
+
virtual = _props$virtual === void 0 ? false : _props$virtual,
|
35
|
+
tableProps = _objectWithoutProperties(props, _excluded);
|
36
|
+
var scrollX = useMemo(function () {
|
37
|
+
var scrollWidth = calcColsTotalWidth(columns, suppWidth);
|
38
|
+
if (tableW === undefined) {
|
39
|
+
return scrollWidth;
|
40
|
+
}
|
41
|
+
return tableW >= scrollWidth ? undefined : scrollWidth;
|
42
|
+
}, [columns, suppWidth, tableW]);
|
43
|
+
var defaultTableProps = useMemo(function () {
|
44
|
+
return {
|
45
|
+
scroll: {
|
46
|
+
x: scrollX,
|
47
|
+
y: tableH
|
48
|
+
},
|
49
|
+
pagination: false,
|
50
|
+
columns: columns.filter(function (col) {
|
51
|
+
return !col.noShow;
|
52
|
+
}).map(function (col) {
|
53
|
+
return _objectSpread(_objectSpread({
|
54
|
+
key: col.dataIndex
|
55
|
+
}, col), {}, {
|
56
|
+
width: col.width,
|
57
|
+
render: function render(text, record, index) {
|
58
|
+
return col.render ? col.render(text, record, index) : text;
|
59
|
+
}
|
60
|
+
});
|
61
|
+
})
|
62
|
+
};
|
63
|
+
}, [columns, scrollX, tableH]);
|
64
|
+
var myTable = virtual ? /*#__PURE__*/_jsx(BiuVirtualTable, _objectSpread(_objectSpread({
|
65
|
+
ref: ref
|
66
|
+
}, tableProps), defaultTableProps)) : /*#__PURE__*/_jsx(BiuResizeTable, _objectSpread(_objectSpread({
|
67
|
+
ref: ref,
|
68
|
+
isCellEdit: true
|
69
|
+
}, defaultTableProps), tableProps));
|
70
|
+
if (cardtitle === undefined || cardtitle === null) return myTable;
|
71
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
72
|
+
children: [/*#__PURE__*/_jsx(BiuDivider, {
|
73
|
+
children: cardtitle
|
74
|
+
}), myTable]
|
75
|
+
});
|
76
|
+
}));
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { CustomerGoodsTableProps } from '../type';
|
3
|
+
/**
|
4
|
+
* 库内模块可编辑表格
|
5
|
+
* @param props
|
6
|
+
* @param ref
|
7
|
+
*/
|
8
|
+
export declare const EditTable: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<CustomerGoodsTableProps>>>;
|
@@ -0,0 +1,264 @@
|
|
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 = ["id", "omit", "fixed", "initialvalue", "width", "onChange", "getChangeValue", "onChangeData", "verify", "renderForm"],
|
3
|
+
_excluded2 = ["formItemType", "id", "rules", "required", "options", "layout"];
|
4
|
+
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; }
|
5
|
+
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; }
|
6
|
+
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; }
|
7
|
+
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; }
|
8
|
+
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; }
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
10
|
+
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); }
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
12
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
14
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
16
|
+
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."); }
|
17
|
+
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); }
|
18
|
+
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; }
|
19
|
+
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; } }
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
21
|
+
import { MinusOutlined } from '@ant-design/icons';
|
22
|
+
import { Button, Card } from 'antd';
|
23
|
+
import { concat, differenceBy, isEmpty, keys, pullAllBy } from 'lodash';
|
24
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
25
|
+
import { BiuCue, BiuField, BiuResizeTable } from "../..";
|
26
|
+
import { DATE_FORMTYPE } from "../../../constant";
|
27
|
+
import { formatMoment, momentFormat } from "../../../utils";
|
28
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
30
|
+
var requiredCols = {};
|
31
|
+
var formatList = [];
|
32
|
+
|
33
|
+
/**
|
34
|
+
* 库内模块可编辑表格
|
35
|
+
* @param props
|
36
|
+
* @param ref
|
37
|
+
*/
|
38
|
+
export var EditTable = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
39
|
+
var initialList = props.initialList,
|
40
|
+
_props$columnsOptions = props.columnsOptions,
|
41
|
+
columnsOptions = _props$columnsOptions === void 0 ? [] : _props$columnsOptions,
|
42
|
+
_props$iteratee = props.iteratee,
|
43
|
+
iteratee = _props$iteratee === void 0 ? 'attributeId' : _props$iteratee,
|
44
|
+
cardProps = props.cardProps,
|
45
|
+
delInitalList = props.delInitalList;
|
46
|
+
var _useState = useState([]),
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
48
|
+
list = _useState2[0],
|
49
|
+
setList = _useState2[1];
|
50
|
+
useEffect(function () {
|
51
|
+
setList(function (currentList) {
|
52
|
+
var newData = (initialList === null || initialList === void 0 ? void 0 : initialList.length) > 0 ? [].concat(_toConsumableArray(differenceBy(initialList, currentList, iteratee)), _toConsumableArray(currentList)) : [];
|
53
|
+
return newData ? newData.map(function (e, index) {
|
54
|
+
return _objectSpread({
|
55
|
+
key: index
|
56
|
+
}, e);
|
57
|
+
}) : [];
|
58
|
+
});
|
59
|
+
}, [initialList, iteratee]);
|
60
|
+
useImperativeHandle(ref, function () {
|
61
|
+
return {
|
62
|
+
getList: function getList() {
|
63
|
+
var fields = keys(requiredCols);
|
64
|
+
try {
|
65
|
+
list.map(function (e, index) {
|
66
|
+
if (fields.length > 0) {
|
67
|
+
fields.forEach(function (field) {
|
68
|
+
if (isEmpty(e[field])) {
|
69
|
+
throw new Error("\u7B2C".concat(index + 1, "\u884C\u7684").concat(requiredCols[field].label, "\u5FC5\u586B"));
|
70
|
+
}
|
71
|
+
});
|
72
|
+
}
|
73
|
+
if (formatList && formatList.length > 0) {
|
74
|
+
formatList.forEach(function (f) {
|
75
|
+
var time = e[f.field];
|
76
|
+
e[f.field] = momentFormat(time, f.format);
|
77
|
+
});
|
78
|
+
}
|
79
|
+
return e;
|
80
|
+
});
|
81
|
+
} catch (error) {
|
82
|
+
BiuCue.Warning(error.message);
|
83
|
+
}
|
84
|
+
return list;
|
85
|
+
},
|
86
|
+
clearTable: function clearTable() {
|
87
|
+
setList([]);
|
88
|
+
}
|
89
|
+
};
|
90
|
+
}, [list]);
|
91
|
+
|
92
|
+
/**
|
93
|
+
* 删除
|
94
|
+
* @param record
|
95
|
+
*/
|
96
|
+
var handleRemoveRow = useCallback(function (record) {
|
97
|
+
setList(function (currentList) {
|
98
|
+
var basicList = _toConsumableArray(currentList);
|
99
|
+
pullAllBy(basicList, [{
|
100
|
+
key: record.key
|
101
|
+
}], 'key');
|
102
|
+
if (delInitalList) delInitalList([record], currentList);
|
103
|
+
return _toConsumableArray(basicList);
|
104
|
+
});
|
105
|
+
}, [delInitalList]);
|
106
|
+
var actionColumns = useMemo(function () {
|
107
|
+
return [{
|
108
|
+
width: 60,
|
109
|
+
title: '行号',
|
110
|
+
align: 'center',
|
111
|
+
dataIndex: 'serialNumber',
|
112
|
+
key: 'serialNumber',
|
113
|
+
fixed: 'left',
|
114
|
+
render: function render(text, record, index) {
|
115
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
116
|
+
children: index + 1
|
117
|
+
});
|
118
|
+
}
|
119
|
+
}, {
|
120
|
+
width: 100,
|
121
|
+
title: '操作',
|
122
|
+
align: 'center',
|
123
|
+
dataIndex: 'oper',
|
124
|
+
key: 'oper',
|
125
|
+
fixed: 'left',
|
126
|
+
render: function render(text, record, index) {
|
127
|
+
if (index === list.length - 1) {
|
128
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
129
|
+
children: /*#__PURE__*/_jsx(Button, {
|
130
|
+
type: "primary",
|
131
|
+
shape: "circle",
|
132
|
+
icon: /*#__PURE__*/_jsx(MinusOutlined, {}),
|
133
|
+
disabled: props.disabled,
|
134
|
+
onClick: function onClick() {
|
135
|
+
return handleRemoveRow(record);
|
136
|
+
}
|
137
|
+
})
|
138
|
+
});
|
139
|
+
}
|
140
|
+
return /*#__PURE__*/_jsx(Button, {
|
141
|
+
type: "primary",
|
142
|
+
shape: "circle",
|
143
|
+
icon: /*#__PURE__*/_jsx(MinusOutlined, {}),
|
144
|
+
disabled: props.disabled,
|
145
|
+
onClick: function onClick() {
|
146
|
+
return handleRemoveRow(record);
|
147
|
+
}
|
148
|
+
});
|
149
|
+
}
|
150
|
+
}];
|
151
|
+
}, [handleRemoveRow, list.length, props.disabled]);
|
152
|
+
var columns = useMemo(function () {
|
153
|
+
var coles = columnsOptions.map(function (_ref, index) {
|
154
|
+
var key = _ref.id,
|
155
|
+
omit = _ref.omit,
|
156
|
+
fixed = _ref.fixed,
|
157
|
+
initialvalue = _ref.initialvalue,
|
158
|
+
width = _ref.width,
|
159
|
+
onChange = _ref.onChange,
|
160
|
+
getChangeValue = _ref.getChangeValue,
|
161
|
+
onChangeData = _ref.onChangeData,
|
162
|
+
verify = _ref.verify,
|
163
|
+
renderForm = _ref.renderForm,
|
164
|
+
restCol = _objectWithoutProperties(_ref, _excluded);
|
165
|
+
if (restCol.required) {
|
166
|
+
requiredCols[key] = columnsOptions[index];
|
167
|
+
}
|
168
|
+
if (DATE_FORMTYPE.includes(restCol.formItemType)) {
|
169
|
+
if (restCol.format && typeof restCol.format === 'string') {
|
170
|
+
formatList.push({
|
171
|
+
field: key,
|
172
|
+
format: restCol.format
|
173
|
+
});
|
174
|
+
} else {
|
175
|
+
throw new Error('请给表格中的日期类型显示设置格式化字段format');
|
176
|
+
}
|
177
|
+
}
|
178
|
+
var formatChangeValue = getChangeValue || function () {
|
179
|
+
switch (restCol.formItemType) {
|
180
|
+
case 'text':
|
181
|
+
return function (e) {
|
182
|
+
return e.target.value;
|
183
|
+
};
|
184
|
+
default:
|
185
|
+
return function (e) {
|
186
|
+
return e;
|
187
|
+
};
|
188
|
+
}
|
189
|
+
}();
|
190
|
+
return {
|
191
|
+
width: width || 100,
|
192
|
+
title: restCol.label,
|
193
|
+
key: key,
|
194
|
+
className: restCol.required ? 'thead-item-required' : '',
|
195
|
+
align: 'center',
|
196
|
+
dataIndex: key,
|
197
|
+
fixed: fixed,
|
198
|
+
ellipsis: true,
|
199
|
+
render: function render(text, record, rowIndex) {
|
200
|
+
var newValue = text;
|
201
|
+
if (DATE_FORMTYPE.includes(restCol.formItemType)) {
|
202
|
+
newValue = formatMoment(newValue);
|
203
|
+
}
|
204
|
+
var ops = _objectSpread(_objectSpread({}, restCol), {}, {
|
205
|
+
value: newValue || initialvalue,
|
206
|
+
id: "params[".concat(record.key, "].").concat(key),
|
207
|
+
formItemType: restCol.formItemType || 'label'
|
208
|
+
}, renderForm ? renderForm(record) : undefined);
|
209
|
+
if (restCol.formItemType === 'number') {
|
210
|
+
ops.min = 0;
|
211
|
+
}
|
212
|
+
if (onChangeData) {
|
213
|
+
ops.onChangeData = function (e, data) {
|
214
|
+
setList(function (currentList) {
|
215
|
+
if (onChangeData) {
|
216
|
+
currentList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, currentList[rowIndex]), onChangeData(data, currentList[rowIndex])));
|
217
|
+
}
|
218
|
+
return currentList;
|
219
|
+
});
|
220
|
+
};
|
221
|
+
}
|
222
|
+
ops.onChange = function (e, v) {
|
223
|
+
var value = formatChangeValue(e, v);
|
224
|
+
setList(function (currentList) {
|
225
|
+
var basicList = _toConsumableArray(currentList);
|
226
|
+
basicList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, basicList[rowIndex]), {}, _defineProperty({}, key, value)));
|
227
|
+
if (onChange) {
|
228
|
+
basicList.splice(rowIndex, 1, _objectSpread(_objectSpread({}, basicList[rowIndex]), onChange(value, basicList[rowIndex])));
|
229
|
+
}
|
230
|
+
return _toConsumableArray(basicList);
|
231
|
+
});
|
232
|
+
};
|
233
|
+
var formItemType = ops.formItemType,
|
234
|
+
id = ops.id,
|
235
|
+
rules = ops.rules,
|
236
|
+
required = ops.required,
|
237
|
+
options = ops.options,
|
238
|
+
layout = ops.layout,
|
239
|
+
restProps = _objectWithoutProperties(ops, _excluded2);
|
240
|
+
return /*#__PURE__*/_jsx(BiuField, _objectSpread({
|
241
|
+
valueType: formItemType,
|
242
|
+
allowClear: !required,
|
243
|
+
style: {
|
244
|
+
width: '100%'
|
245
|
+
}
|
246
|
+
}, restProps));
|
247
|
+
}
|
248
|
+
};
|
249
|
+
});
|
250
|
+
return concat(actionColumns, coles);
|
251
|
+
}, [actionColumns, columnsOptions]);
|
252
|
+
return /*#__PURE__*/_jsx(Card, _objectSpread(_objectSpread({
|
253
|
+
bordered: false
|
254
|
+
}, cardProps), {}, {
|
255
|
+
children: /*#__PURE__*/_jsx(BiuResizeTable, _objectSpread({
|
256
|
+
rowKey: function rowKey(record, index) {
|
257
|
+
return index;
|
258
|
+
},
|
259
|
+
columns: columns,
|
260
|
+
dataSource: list,
|
261
|
+
isCellEdit: true
|
262
|
+
}, props))
|
263
|
+
}));
|
264
|
+
}));
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './editTable';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./editTable";
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import type { ButtonProps } from 'antd';
|
2
|
+
import React from 'react';
|
3
|
+
export type OperCardProps = {
|
4
|
+
children?: React.ReactNode;
|
5
|
+
onSubmit?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
6
|
+
onSubmitKeep?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
7
|
+
onCancel?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
8
|
+
submitText?: string;
|
9
|
+
submitKeepText?: string;
|
10
|
+
cancelText?: string;
|
11
|
+
loading?: boolean;
|
12
|
+
submitButtonProps?: ButtonProps;
|
13
|
+
submitKeepButtonProps?: ButtonProps;
|
14
|
+
cancelButtonProps?: ButtonProps;
|
15
|
+
};
|
16
|
+
export declare const OperationButton: React.MemoExoticComponent<(props: OperCardProps) => import("react/jsx-runtime").JSX.Element>;
|
17
|
+
export declare const BiuCustomerOperCard: React.MemoExoticComponent<React.ForwardRefExoticComponent<OperCardProps & React.RefAttributes<unknown>>>;
|
18
|
+
export * from './type';
|
19
|
+
export * from './component';
|
20
|
+
export * from './utils';
|
@@ -0,0 +1,56 @@
|
|
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 { Button, Card } from 'antd';
|
8
|
+
import React, { forwardRef } from 'react';
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
+
export var OperationButton = /*#__PURE__*/React.memo(function (props) {
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
14
|
+
children: [props.onSubmit ? /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
15
|
+
type: "primary",
|
16
|
+
style: {
|
17
|
+
marginRight: 8
|
18
|
+
},
|
19
|
+
onClick: props.onSubmit,
|
20
|
+
loading: props.loading || false
|
21
|
+
}, props.submitButtonProps), {}, {
|
22
|
+
children: props.submitText || '提交'
|
23
|
+
})) : null, props.onSubmitKeep ? /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
24
|
+
type: "primary",
|
25
|
+
style: {
|
26
|
+
marginRight: 8
|
27
|
+
},
|
28
|
+
onClick: props.onSubmitKeep,
|
29
|
+
loading: props.loading || false
|
30
|
+
}, props.submitKeepButtonProps), {}, {
|
31
|
+
children: props.submitKeepText || '继续保存'
|
32
|
+
})) : null, props.onCancel ? /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
33
|
+
type: "default",
|
34
|
+
onClick: props.onCancel
|
35
|
+
}, props.cancelButtonProps), {}, {
|
36
|
+
loading: props.loading || false,
|
37
|
+
children: props.cancelText || '返回'
|
38
|
+
})) : null]
|
39
|
+
});
|
40
|
+
});
|
41
|
+
export var BiuCustomerOperCard = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
42
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
43
|
+
children: [props.children, /*#__PURE__*/_jsx(Card, {
|
44
|
+
ref: ref,
|
45
|
+
bodyStyle: {
|
46
|
+
paddingLeft: 0,
|
47
|
+
paddingRight: 0
|
48
|
+
},
|
49
|
+
bordered: false,
|
50
|
+
children: /*#__PURE__*/_jsx(OperationButton, _objectSpread({}, props))
|
51
|
+
})]
|
52
|
+
});
|
53
|
+
}));
|
54
|
+
export * from "./type";
|
55
|
+
export * from "./component";
|
56
|
+
export * from "./utils";
|