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

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 {
@@ -8172,12 +8203,26 @@ var SubForm = function SubForm(props) {
8172
8203
  title: '操作',
8173
8204
  width: 70,
8174
8205
  render: function render(val, record, index) {
8175
- return /*#__PURE__*/React.createElement(Button, {
8176
- type: "link",
8206
+ return /*#__PURE__*/React.createElement(Space, null, manual && /*#__PURE__*/React.createElement(Tooltip, {
8207
+ title: "\u6DFB\u52A0"
8208
+ }, /*#__PURE__*/React.createElement(PlusCircleFilled, {
8209
+ style: {
8210
+ fontSize: 18,
8211
+ color: '#1890ff'
8212
+ },
8213
+ onClick: function onClick() {
8214
+ return addHandle();
8215
+ }
8216
+ })), /*#__PURE__*/React.createElement(Tooltip, {
8217
+ title: "\u5220\u9664"
8218
+ }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
8219
+ style: {
8220
+ fontSize: 18
8221
+ },
8177
8222
  onClick: function onClick() {
8178
8223
  return deleteHandle(record.uuid);
8179
8224
  }
8180
- }, "\u5220\u9664");
8225
+ })));
8181
8226
  }
8182
8227
  }]);
8183
8228
  var columsSearch = useMemo(function () {
@@ -8203,6 +8248,12 @@ var SubForm = function SubForm(props) {
8203
8248
  return prv;
8204
8249
  }, {});
8205
8250
  }, [newTableHeader]);
8251
+ var defaultValueMap = useMemo(function () {
8252
+ return Object.keys(valueMap).reduce(function (prv, next) {
8253
+ prv["".concat(valueMap[next])] = '';
8254
+ return prv;
8255
+ }, {});
8256
+ }, [valueMap]);
8206
8257
  var selectOptions = useMemo(function () {
8207
8258
  var _options$;
8208
8259
  var options = newTableHeader.map(function (item) {
@@ -8220,6 +8271,11 @@ var SubForm = function SubForm(props) {
8220
8271
  });
8221
8272
  onChange === null || onChange === void 0 ? void 0 : onChange(newList);
8222
8273
  };
8274
+ var addHandle = function addHandle() {
8275
+ onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value || []), [_objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
8276
+ uuid: uuid()
8277
+ })]));
8278
+ };
8223
8279
  var onScrollCapture = function onScrollCapture(e) {
8224
8280
  if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight - 20) {
8225
8281
  if (hasMore && !isRequest.current) {
@@ -8431,7 +8487,22 @@ var SubForm = function SubForm(props) {
8431
8487
  x: '100%'
8432
8488
  },
8433
8489
  locale: {
8434
- emptyText: '暂无数据'
8490
+ emptyText: manual ? /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E,", /*#__PURE__*/React.createElement(Button, {
8491
+ type: "link",
8492
+ onClick: function onClick() {
8493
+ return addHandle();
8494
+ }
8495
+ }, "\u70B9\u51FB\u6DFB\u52A0")) : '暂无数据'
8496
+ },
8497
+ onRow: function onRow(_, index) {
8498
+ return {
8499
+ onMouseEnter: function onMouseEnter() {
8500
+ return setHoveredRowIndex(index !== null && index !== void 0 ? index : null);
8501
+ },
8502
+ onMouseLeave: function onMouseLeave() {
8503
+ return setHoveredRowIndex(null);
8504
+ }
8505
+ };
8435
8506
  }
8436
8507
  }));
8437
8508
  };
@@ -19024,29 +19095,6 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
19024
19095
  });
19025
19096
  };
19026
19097
 
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
19098
  var isErpType = {
19051
19099
  isWdt: function isWdt(type) {
19052
19100
  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 {
@@ -8185,12 +8216,26 @@ var SubForm = function SubForm(props) {
8185
8216
  title: '操作',
8186
8217
  width: 70,
8187
8218
  render: function render(val, record, index) {
8188
- return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
8189
- type: "link",
8219
+ return /*#__PURE__*/React__default['default'].createElement(antd.Space, null, manual && /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
8220
+ title: "\u6DFB\u52A0"
8221
+ }, /*#__PURE__*/React__default['default'].createElement(icons.PlusCircleFilled, {
8222
+ style: {
8223
+ fontSize: 18,
8224
+ color: '#1890ff'
8225
+ },
8226
+ onClick: function onClick() {
8227
+ return addHandle();
8228
+ }
8229
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
8230
+ title: "\u5220\u9664"
8231
+ }, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
8232
+ style: {
8233
+ fontSize: 18
8234
+ },
8190
8235
  onClick: function onClick() {
8191
8236
  return deleteHandle(record.uuid);
8192
8237
  }
8193
- }, "\u5220\u9664");
8238
+ })));
8194
8239
  }
8195
8240
  }]);
8196
8241
  var columsSearch = React.useMemo(function () {
@@ -8216,6 +8261,12 @@ var SubForm = function SubForm(props) {
8216
8261
  return prv;
8217
8262
  }, {});
8218
8263
  }, [newTableHeader]);
8264
+ var defaultValueMap = React.useMemo(function () {
8265
+ return Object.keys(valueMap).reduce(function (prv, next) {
8266
+ prv["".concat(valueMap[next])] = '';
8267
+ return prv;
8268
+ }, {});
8269
+ }, [valueMap]);
8219
8270
  var selectOptions = React.useMemo(function () {
8220
8271
  var _options$;
8221
8272
  var options = newTableHeader.map(function (item) {
@@ -8233,6 +8284,11 @@ var SubForm = function SubForm(props) {
8233
8284
  });
8234
8285
  onChange === null || onChange === void 0 ? void 0 : onChange(newList);
8235
8286
  };
8287
+ var addHandle = function addHandle() {
8288
+ onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value || []), [_objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
8289
+ uuid: kmkfUtils.uuid()
8290
+ })]));
8291
+ };
8236
8292
  var onScrollCapture = function onScrollCapture(e) {
8237
8293
  if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight - 20) {
8238
8294
  if (hasMore && !isRequest.current) {
@@ -8444,7 +8500,22 @@ var SubForm = function SubForm(props) {
8444
8500
  x: '100%'
8445
8501
  },
8446
8502
  locale: {
8447
- emptyText: '暂无数据'
8503
+ emptyText: manual ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u6682\u65E0\u6570\u636E,", /*#__PURE__*/React__default['default'].createElement(antd.Button, {
8504
+ type: "link",
8505
+ onClick: function onClick() {
8506
+ return addHandle();
8507
+ }
8508
+ }, "\u70B9\u51FB\u6DFB\u52A0")) : '暂无数据'
8509
+ },
8510
+ onRow: function onRow(_, index) {
8511
+ return {
8512
+ onMouseEnter: function onMouseEnter() {
8513
+ return setHoveredRowIndex(index !== null && index !== void 0 ? index : null);
8514
+ },
8515
+ onMouseLeave: function onMouseLeave() {
8516
+ return setHoveredRowIndex(null);
8517
+ }
8518
+ };
8448
8519
  }
8449
8520
  }));
8450
8521
  };
@@ -19037,29 +19108,6 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
19037
19108
  });
19038
19109
  };
19039
19110
 
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
19111
  var isErpType = {
19064
19112
  isWdt: function isWdt(type) {
19065
19113
  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.62",
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": "cc2d4b6d70bf4cfafa78720cf3ff3bb7f861de63"
70
70
  }