@kmkf-fe-packages/basic-components 2.0.79-beta.60 → 2.0.79-beta.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';
2
- import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Popover, Table, Tabs, ConfigProvider, Pagination, Typography, Skeleton, Empty, Tooltip } from 'antd';
3
- import { EyeOutlined, DeleteOutlined, CloseOutlined, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, UpOutlined, DownOutlined, MinusCircleFilled, VideoCameraTwoTone } from '@ant-design/icons';
2
+ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Tooltip, Popover, Table, Tabs, ConfigProvider, Pagination, Typography, Skeleton, Empty } from 'antd';
3
+ import { EyeOutlined, DeleteOutlined, CloseOutlined, MinusCircleFilled, PlusCircleFilled, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, UpOutlined, DownOutlined, VideoCameraTwoTone } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
6
  import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, servers, columnsGoodsList, LogisticsAddressData, SendDataCenter, hasAddNullComponent, SUBMIT_TIME_ID, UPGRADE_TIME_ID, FINAL_TIME_ID, CUSTOM_TIME_ID, useStatus, finalFormData, transformList, dataSourceTrans, DATA_SPLIT_COMPONENT_FIELDS_MAP, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterJyOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, JY_SYSTEM_ORDER_CONFIG, updateWlnGoodsHandle, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, updateJyGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
@@ -8046,6 +8046,29 @@ function withFormItem(WrappedComponent) {
8046
8046
  */
8047
8047
  var extendRequest = extend$1({});
8048
8048
 
8049
+ function HoverTableRowDeleteIcon(_ref) {
8050
+ var index = _ref.index,
8051
+ hoveredRowIndex = _ref.hoveredRowIndex,
8052
+ handleClick = _ref.handleClick;
8053
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
8054
+ style: {
8055
+ display: hoveredRowIndex === index ? 'none' : 'inline'
8056
+ }
8057
+ }, index + 1), /*#__PURE__*/React.createElement("span", {
8058
+ style: {
8059
+ cursor: 'pointer'
8060
+ },
8061
+ onClick: handleClick,
8062
+ title: "\u5220\u9664"
8063
+ }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
8064
+ style: {
8065
+ fontSize: 18,
8066
+ color: '#1890ff',
8067
+ display: hoveredRowIndex === index ? 'inline' : 'none'
8068
+ }
8069
+ })));
8070
+ }
8071
+
8049
8072
  var WidgetMap = {
8050
8073
  INPUT: 'input',
8051
8074
  TEXTAREA: 'textarea'
@@ -8066,7 +8089,8 @@ var SubForm = function SubForm(props) {
8066
8089
  tableHeader = props.tableHeader,
8067
8090
  disabled = props.disabled,
8068
8091
  platform = props.platform,
8069
- maxCount = props.maxCount;
8092
+ maxCount = props.maxCount,
8093
+ manual = props.manual;
8070
8094
  var ref = useRef(null);
8071
8095
  var isRequest = useRef(false);
8072
8096
  var _useState = useState(false),
@@ -8093,6 +8117,10 @@ var SubForm = function SubForm(props) {
8093
8117
  _useState12 = _slicedToArray(_useState11, 2),
8094
8118
  hasMore = _useState12[0],
8095
8119
  setHasMore = _useState12[1];
8120
+ var _useState13 = useState(null),
8121
+ _useState14 = _slicedToArray(_useState13, 2),
8122
+ hoveredRowIndex = _useState14[0],
8123
+ setHoveredRowIndex = _useState14[1];
8096
8124
  var updateHandle = function updateHandle(val, index, type) {
8097
8125
  if (value === null || value === void 0 ? void 0 : value.length) {
8098
8126
  var valueItem = tableHeader.find(function (t) {
@@ -8126,11 +8154,14 @@ var SubForm = function SubForm(props) {
8126
8154
  title: '序号',
8127
8155
  width: 50,
8128
8156
  render: function render(val, record, index) {
8129
- return /*#__PURE__*/React.createElement("div", {
8130
- style: {
8131
- width: 25
8157
+ return /*#__PURE__*/React.createElement(HoverTableRowDeleteIcon, {
8158
+ index: index,
8159
+ hoveredRowIndex: hoveredRowIndex,
8160
+ handleClick: function handleClick() {
8161
+ return deleteHandle(record.uuid);
8132
8162
  }
8133
- }, index + 1);
8163
+ });
8164
+ // return <div style={{ width: 25 }}>{index + 1}</div>;
8134
8165
  }
8135
8166
  }].concat(_toConsumableArray(newTableHeader.map(function (t) {
8136
8167
  return {
@@ -8171,13 +8202,28 @@ var SubForm = function SubForm(props) {
8171
8202
  dataIndex: 'operation',
8172
8203
  title: '操作',
8173
8204
  width: 70,
8205
+ fixed: 'right',
8174
8206
  render: function render(val, record, index) {
8175
- return /*#__PURE__*/React.createElement(Button, {
8176
- type: "link",
8207
+ return /*#__PURE__*/React.createElement(Space, null, manual && /*#__PURE__*/React.createElement(Tooltip, {
8208
+ title: "\u6DFB\u52A0"
8209
+ }, /*#__PURE__*/React.createElement(PlusCircleFilled, {
8210
+ style: {
8211
+ fontSize: 18,
8212
+ color: '#1890ff'
8213
+ },
8214
+ onClick: function onClick() {
8215
+ return addHandle(index + 1);
8216
+ }
8217
+ })), /*#__PURE__*/React.createElement(Tooltip, {
8218
+ title: "\u5220\u9664"
8219
+ }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
8220
+ style: {
8221
+ fontSize: 18
8222
+ },
8177
8223
  onClick: function onClick() {
8178
8224
  return deleteHandle(record.uuid);
8179
8225
  }
8180
- }, "\u5220\u9664");
8226
+ })));
8181
8227
  }
8182
8228
  }]);
8183
8229
  var columsSearch = useMemo(function () {
@@ -8203,6 +8249,12 @@ var SubForm = function SubForm(props) {
8203
8249
  return prv;
8204
8250
  }, {});
8205
8251
  }, [newTableHeader]);
8252
+ var defaultValueMap = useMemo(function () {
8253
+ return Object.keys(valueMap).reduce(function (prv, next) {
8254
+ prv["".concat(valueMap[next])] = '';
8255
+ return prv;
8256
+ }, {});
8257
+ }, [valueMap]);
8206
8258
  var selectOptions = useMemo(function () {
8207
8259
  var _options$;
8208
8260
  var options = newTableHeader.map(function (item) {
@@ -8220,6 +8272,17 @@ var SubForm = function SubForm(props) {
8220
8272
  });
8221
8273
  onChange === null || onChange === void 0 ? void 0 : onChange(newList);
8222
8274
  };
8275
+ var addHandle = function addHandle(index) {
8276
+ if (maxCount && (value === null || value === void 0 ? void 0 : value.length) >= maxCount) {
8277
+ message.error("\u8BE5\u5B50\u8868\u5355\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u6761"));
8278
+ return;
8279
+ }
8280
+ var newValue = _toConsumableArray(value || []);
8281
+ newValue.splice(index, 0, _objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
8282
+ uuid: uuid()
8283
+ }));
8284
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8285
+ };
8223
8286
  var onScrollCapture = function onScrollCapture(e) {
8224
8287
  if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight - 20) {
8225
8288
  if (hasMore && !isRequest.current) {
@@ -8431,7 +8494,22 @@ var SubForm = function SubForm(props) {
8431
8494
  x: '100%'
8432
8495
  },
8433
8496
  locale: {
8434
- emptyText: '暂无数据'
8497
+ emptyText: manual ? /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E,", /*#__PURE__*/React.createElement(Button, {
8498
+ type: "link",
8499
+ onClick: function onClick() {
8500
+ return addHandle(0);
8501
+ }
8502
+ }, "\u70B9\u51FB\u6DFB\u52A0")) : '暂无数据'
8503
+ },
8504
+ onRow: function onRow(_, index) {
8505
+ return {
8506
+ onMouseEnter: function onMouseEnter() {
8507
+ return setHoveredRowIndex(index !== null && index !== void 0 ? index : null);
8508
+ },
8509
+ onMouseLeave: function onMouseLeave() {
8510
+ return setHoveredRowIndex(null);
8511
+ }
8512
+ };
8435
8513
  }
8436
8514
  }));
8437
8515
  };
@@ -19024,29 +19102,6 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
19024
19102
  });
19025
19103
  };
19026
19104
 
19027
- function HoverTableRowDeleteIcon(_ref) {
19028
- var index = _ref.index,
19029
- hoveredRowIndex = _ref.hoveredRowIndex,
19030
- handleClick = _ref.handleClick;
19031
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
19032
- style: {
19033
- display: hoveredRowIndex === index ? 'none' : 'inline'
19034
- }
19035
- }, index + 1), /*#__PURE__*/React.createElement("span", {
19036
- style: {
19037
- cursor: 'pointer'
19038
- },
19039
- onClick: handleClick,
19040
- title: "\u5220\u9664"
19041
- }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
19042
- style: {
19043
- fontSize: 18,
19044
- color: '#1890ff',
19045
- display: hoveredRowIndex === index ? 'inline' : 'none'
19046
- }
19047
- })));
19048
- }
19049
-
19050
19105
  var isErpType = {
19051
19106
  isWdt: function isWdt(type) {
19052
19107
  return ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type);
package/dist/index.js CHANGED
@@ -8059,6 +8059,29 @@ function withFormItem(WrappedComponent) {
8059
8059
  */
8060
8060
  var extendRequest = request.extend({});
8061
8061
 
8062
+ function HoverTableRowDeleteIcon(_ref) {
8063
+ var index = _ref.index,
8064
+ hoveredRowIndex = _ref.hoveredRowIndex,
8065
+ handleClick = _ref.handleClick;
8066
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
8067
+ style: {
8068
+ display: hoveredRowIndex === index ? 'none' : 'inline'
8069
+ }
8070
+ }, index + 1), /*#__PURE__*/React__default['default'].createElement("span", {
8071
+ style: {
8072
+ cursor: 'pointer'
8073
+ },
8074
+ onClick: handleClick,
8075
+ title: "\u5220\u9664"
8076
+ }, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
8077
+ style: {
8078
+ fontSize: 18,
8079
+ color: '#1890ff',
8080
+ display: hoveredRowIndex === index ? 'inline' : 'none'
8081
+ }
8082
+ })));
8083
+ }
8084
+
8062
8085
  var WidgetMap = {
8063
8086
  INPUT: 'input',
8064
8087
  TEXTAREA: 'textarea'
@@ -8079,7 +8102,8 @@ var SubForm = function SubForm(props) {
8079
8102
  tableHeader = props.tableHeader,
8080
8103
  disabled = props.disabled,
8081
8104
  platform = props.platform,
8082
- maxCount = props.maxCount;
8105
+ maxCount = props.maxCount,
8106
+ manual = props.manual;
8083
8107
  var ref = React.useRef(null);
8084
8108
  var isRequest = React.useRef(false);
8085
8109
  var _useState = React.useState(false),
@@ -8106,6 +8130,10 @@ var SubForm = function SubForm(props) {
8106
8130
  _useState12 = _slicedToArray(_useState11, 2),
8107
8131
  hasMore = _useState12[0],
8108
8132
  setHasMore = _useState12[1];
8133
+ var _useState13 = React.useState(null),
8134
+ _useState14 = _slicedToArray(_useState13, 2),
8135
+ hoveredRowIndex = _useState14[0],
8136
+ setHoveredRowIndex = _useState14[1];
8109
8137
  var updateHandle = function updateHandle(val, index, type) {
8110
8138
  if (value === null || value === void 0 ? void 0 : value.length) {
8111
8139
  var valueItem = tableHeader.find(function (t) {
@@ -8139,11 +8167,14 @@ var SubForm = function SubForm(props) {
8139
8167
  title: '序号',
8140
8168
  width: 50,
8141
8169
  render: function render(val, record, index) {
8142
- return /*#__PURE__*/React__default['default'].createElement("div", {
8143
- style: {
8144
- width: 25
8170
+ return /*#__PURE__*/React__default['default'].createElement(HoverTableRowDeleteIcon, {
8171
+ index: index,
8172
+ hoveredRowIndex: hoveredRowIndex,
8173
+ handleClick: function handleClick() {
8174
+ return deleteHandle(record.uuid);
8145
8175
  }
8146
- }, index + 1);
8176
+ });
8177
+ // return <div style={{ width: 25 }}>{index + 1}</div>;
8147
8178
  }
8148
8179
  }].concat(_toConsumableArray(newTableHeader.map(function (t) {
8149
8180
  return {
@@ -8184,13 +8215,28 @@ var SubForm = function SubForm(props) {
8184
8215
  dataIndex: 'operation',
8185
8216
  title: '操作',
8186
8217
  width: 70,
8218
+ fixed: 'right',
8187
8219
  render: function render(val, record, index) {
8188
- return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
8189
- type: "link",
8220
+ return /*#__PURE__*/React__default['default'].createElement(antd.Space, null, manual && /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
8221
+ title: "\u6DFB\u52A0"
8222
+ }, /*#__PURE__*/React__default['default'].createElement(icons.PlusCircleFilled, {
8223
+ style: {
8224
+ fontSize: 18,
8225
+ color: '#1890ff'
8226
+ },
8227
+ onClick: function onClick() {
8228
+ return addHandle(index + 1);
8229
+ }
8230
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
8231
+ title: "\u5220\u9664"
8232
+ }, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
8233
+ style: {
8234
+ fontSize: 18
8235
+ },
8190
8236
  onClick: function onClick() {
8191
8237
  return deleteHandle(record.uuid);
8192
8238
  }
8193
- }, "\u5220\u9664");
8239
+ })));
8194
8240
  }
8195
8241
  }]);
8196
8242
  var columsSearch = React.useMemo(function () {
@@ -8216,6 +8262,12 @@ var SubForm = function SubForm(props) {
8216
8262
  return prv;
8217
8263
  }, {});
8218
8264
  }, [newTableHeader]);
8265
+ var defaultValueMap = React.useMemo(function () {
8266
+ return Object.keys(valueMap).reduce(function (prv, next) {
8267
+ prv["".concat(valueMap[next])] = '';
8268
+ return prv;
8269
+ }, {});
8270
+ }, [valueMap]);
8219
8271
  var selectOptions = React.useMemo(function () {
8220
8272
  var _options$;
8221
8273
  var options = newTableHeader.map(function (item) {
@@ -8233,6 +8285,17 @@ var SubForm = function SubForm(props) {
8233
8285
  });
8234
8286
  onChange === null || onChange === void 0 ? void 0 : onChange(newList);
8235
8287
  };
8288
+ var addHandle = function addHandle(index) {
8289
+ if (maxCount && (value === null || value === void 0 ? void 0 : value.length) >= maxCount) {
8290
+ antd.message.error("\u8BE5\u5B50\u8868\u5355\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u6761"));
8291
+ return;
8292
+ }
8293
+ var newValue = _toConsumableArray(value || []);
8294
+ newValue.splice(index, 0, _objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
8295
+ uuid: kmkfUtils.uuid()
8296
+ }));
8297
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8298
+ };
8236
8299
  var onScrollCapture = function onScrollCapture(e) {
8237
8300
  if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight - 20) {
8238
8301
  if (hasMore && !isRequest.current) {
@@ -8444,7 +8507,22 @@ var SubForm = function SubForm(props) {
8444
8507
  x: '100%'
8445
8508
  },
8446
8509
  locale: {
8447
- emptyText: '暂无数据'
8510
+ emptyText: manual ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u6682\u65E0\u6570\u636E,", /*#__PURE__*/React__default['default'].createElement(antd.Button, {
8511
+ type: "link",
8512
+ onClick: function onClick() {
8513
+ return addHandle(0);
8514
+ }
8515
+ }, "\u70B9\u51FB\u6DFB\u52A0")) : '暂无数据'
8516
+ },
8517
+ onRow: function onRow(_, index) {
8518
+ return {
8519
+ onMouseEnter: function onMouseEnter() {
8520
+ return setHoveredRowIndex(index !== null && index !== void 0 ? index : null);
8521
+ },
8522
+ onMouseLeave: function onMouseLeave() {
8523
+ return setHoveredRowIndex(null);
8524
+ }
8525
+ };
8448
8526
  }
8449
8527
  }));
8450
8528
  };
@@ -19037,29 +19115,6 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
19037
19115
  });
19038
19116
  };
19039
19117
 
19040
- function HoverTableRowDeleteIcon(_ref) {
19041
- var index = _ref.index,
19042
- hoveredRowIndex = _ref.hoveredRowIndex,
19043
- handleClick = _ref.handleClick;
19044
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
19045
- style: {
19046
- display: hoveredRowIndex === index ? 'none' : 'inline'
19047
- }
19048
- }, index + 1), /*#__PURE__*/React__default['default'].createElement("span", {
19049
- style: {
19050
- cursor: 'pointer'
19051
- },
19052
- onClick: handleClick,
19053
- title: "\u5220\u9664"
19054
- }, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
19055
- style: {
19056
- fontSize: 18,
19057
- color: '#1890ff',
19058
- display: hoveredRowIndex === index ? 'inline' : 'none'
19059
- }
19060
- })));
19061
- }
19062
-
19063
19118
  var isErpType = {
19064
19119
  isWdt: function isWdt(type) {
19065
19120
  return ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type);
@@ -26,6 +26,7 @@ type SubFormProps = {
26
26
  disabled: boolean;
27
27
  platform: string;
28
28
  maxCount?: number;
29
+ manual?: boolean;
29
30
  };
30
31
  declare const SubForm: (props: SubFormProps) => React.JSX.Element;
31
32
  export default SubForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.0.79-beta.60",
3
+ "version": "2.0.79-beta.63",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "0f294f5f72f0150cdfa41ad70b34446d1a7c37b0"
69
+ "gitHead": "ef02cfeac672869b23f3c9fa5a64807ed96ef81b"
70
70
  }