@kmkf-fe-packages/basic-components 1.7.0 → 1.8.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,4 +18,4 @@ yarn start
18
18
  - common 公共组件
19
19
  - config 公共方法
20
20
  - assets 静态资源
21
- -
21
+ -
package/dist/index.esm.js CHANGED
@@ -1,12 +1,12 @@
1
- import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
2
- import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
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, Form, Popover, Table, Tabs, ConfigProvider, Pagination } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } 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, request as request$1, ExpressData, uuid, LogisticsAddressData, WdtSendData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith } from 'lodash';
8
+ import { useUpdateEffect, useDebounceEffect } from 'ahooks';
7
9
  import zhCN from 'antd/lib/locale/zh_CN';
8
- import { cloneDeep, difference, differenceWith } from 'lodash';
9
- import { useDebounceEffect } from 'ahooks';
10
10
  import pubsub from 'pubsub-js';
11
11
  import BigNumber from 'bignumber.js';
12
12
 
@@ -511,11 +511,12 @@ var ApaasDate = function ApaasDate(props) {
511
511
  }, otherProps));
512
512
  };
513
513
 
514
- var _excluded$1 = ["isNumber", "replaceWarn"];
514
+ var _excluded$1 = ["isNumber", "replaceWarn", "precision"];
515
515
  function ApaasInput(props) {
516
516
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
517
517
  var isNumber = props.isNumber,
518
518
  replaceWarn = props.replaceWarn,
519
+ precision = props.precision,
519
520
  other = _objectWithoutProperties(props, _excluded$1);
520
521
  var handleBlur = function handleBlur(e) {
521
522
  // 去除头尾空格
@@ -525,8 +526,12 @@ function ApaasInput(props) {
525
526
  typeof onChange === 'function' && onChange(e);
526
527
  typeof onBlur === 'function' && onBlur(e);
527
528
  };
529
+ return isNumber ?
530
+ /*#__PURE__*/
528
531
  // @ts-ignore
529
- return isNumber ? /*#__PURE__*/React.createElement(InputNumber, _objectSpread2({}, other)) : /*#__PURE__*/React.createElement(Input, _objectSpread2(_objectSpread2({}, other), {}, {
532
+ React.createElement(InputNumber, _objectSpread2(_objectSpread2({}, other), {}, {
533
+ precision: precision === 'nolimit' ? undefined : precision
534
+ })) : /*#__PURE__*/React.createElement(Input, _objectSpread2(_objectSpread2({}, other), {}, {
530
535
  onBlur: handleBlur
531
536
  }));
532
537
  }
@@ -7627,6 +7632,391 @@ function withFormItem(WrappedComponent) {
7627
7632
  };
7628
7633
  }
7629
7634
 
7635
+ /*
7636
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
7637
+ * @Date: 2022-09-13 11:06:09
7638
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
7639
+ * @LastEditTime: 2022-11-04 15:55:10
7640
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
7641
+ * @Description:
7642
+ *
7643
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
7644
+ */
7645
+ var extendRequest = extend$1({});
7646
+
7647
+ var WidgetMap = {
7648
+ INPUT: 'input',
7649
+ TEXTAREA: 'textarea'
7650
+ };
7651
+ var pageSize = 50;
7652
+ var SubForm = function SubForm(props) {
7653
+ var _selectOptions$;
7654
+ var value = props.value,
7655
+ onChange = props.onChange,
7656
+ needFilterShopByPermission = props.needFilterShopByPermission,
7657
+ _props$subConfig = props.subConfig,
7658
+ flowStatus = _props$subConfig.flowStatus,
7659
+ flowTemplateKey = _props$subConfig.flowTemplateKey,
7660
+ nodeId = _props$subConfig.nodeId,
7661
+ workOrderTemplateId = _props$subConfig.workOrderTemplateId,
7662
+ correlationList = _props$subConfig.correlationList,
7663
+ tableHeader = props.tableHeader,
7664
+ disabled = props.disabled;
7665
+ var ref = useRef(null);
7666
+ var _useState = useState(false),
7667
+ _useState2 = _slicedToArray(_useState, 2),
7668
+ open = _useState2[0],
7669
+ setOpen = _useState2[1];
7670
+ var _useState3 = useState(''),
7671
+ _useState4 = _slicedToArray(_useState3, 2),
7672
+ selectKey = _useState4[0],
7673
+ setSelectKey = _useState4[1];
7674
+ var _useState5 = useState(''),
7675
+ _useState6 = _slicedToArray(_useState5, 2),
7676
+ inputValue = _useState6[0],
7677
+ setInputValue = _useState6[1];
7678
+ var _useState7 = useState([]),
7679
+ _useState8 = _slicedToArray(_useState7, 2),
7680
+ list = _useState8[0],
7681
+ setList = _useState8[1];
7682
+ var _useState9 = useState(1),
7683
+ _useState10 = _slicedToArray(_useState9, 2),
7684
+ pageNo = _useState10[0],
7685
+ setPageNo = _useState10[1];
7686
+ var _useState11 = useState(true),
7687
+ _useState12 = _slicedToArray(_useState11, 2),
7688
+ hasMore = _useState12[0],
7689
+ setHasMore = _useState12[1];
7690
+ var updateHandle = function updateHandle(val, index, type) {
7691
+ if (value === null || value === void 0 ? void 0 : value.length) {
7692
+ var valueItem = tableHeader.find(function (t) {
7693
+ return t.key === type && t.isNumber && t.precision !== 'nolimit';
7694
+ });
7695
+ var newValue = JSON.parse(JSON.stringify(value));
7696
+ newValue[index][type] = valueItem ? Number(val).toFixed(+valueItem.precision) : val;
7697
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newValue));
7698
+ }
7699
+ };
7700
+ var newTableHeader = useMemo(function () {
7701
+ return correlationList.reduce(function (prv, next) {
7702
+ var t = tableHeader.find(function (t) {
7703
+ return t.key === next.key;
7704
+ }) || {
7705
+ isShow: true,
7706
+ isEdit: false,
7707
+ isRequired: false,
7708
+ isNumber: false,
7709
+ precision: 'nolimit',
7710
+ width: 150
7711
+ };
7712
+ if (t && t.isShow) {
7713
+ prv.push(_objectSpread2(_objectSpread2({}, next), t));
7714
+ }
7715
+ return prv;
7716
+ }, []);
7717
+ }, [correlationList, tableHeader]);
7718
+ var column = [{
7719
+ dataIndex: 'index',
7720
+ title: '序号',
7721
+ width: 50,
7722
+ render: function render(val, record, index) {
7723
+ return /*#__PURE__*/React.createElement("div", {
7724
+ style: {
7725
+ width: 25
7726
+ }
7727
+ }, index + 1);
7728
+ }
7729
+ }].concat(_toConsumableArray(newTableHeader.map(function (t) {
7730
+ return {
7731
+ dataIndex: t.key,
7732
+ title: /*#__PURE__*/React.createElement("span", null, t.isRequired ? /*#__PURE__*/React.createElement("span", {
7733
+ style: {
7734
+ color: 'red'
7735
+ }
7736
+ }, "*") : null, t.name),
7737
+ ellipsis: true,
7738
+ width: t.width,
7739
+ render: function render(val, record, index) {
7740
+ // @ts-ignore
7741
+ var precisionValue = t.precision === 'nolimit' ? undefined : t.precision;
7742
+ return !t.isEdit && !disabled ? t.isNumber ? /*#__PURE__*/React.createElement(InputNumber, {
7743
+ style: {
7744
+ width: '100%'
7745
+ },
7746
+ value: val,
7747
+ precision: precisionValue,
7748
+ onChange: function onChange(e) {
7749
+ return updateHandle(e, index, t.key);
7750
+ },
7751
+ stringMode: true
7752
+ }) : /*#__PURE__*/React.createElement(Input, {
7753
+ style: {
7754
+ width: '100%'
7755
+ },
7756
+ value: val,
7757
+ onChange: function onChange(e) {
7758
+ var _e$target;
7759
+ return updateHandle(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value, index, t.key);
7760
+ }
7761
+ }) : /*#__PURE__*/React.createElement("div", null, val);
7762
+ }
7763
+ };
7764
+ })), [disabled ? {} : {
7765
+ dataIndex: 'operation',
7766
+ title: '操作',
7767
+ width: 70,
7768
+ render: function render(val, record, index) {
7769
+ return /*#__PURE__*/React.createElement(Button, {
7770
+ type: "link",
7771
+ onClick: function onClick() {
7772
+ return deleteHandle(record.uuid);
7773
+ }
7774
+ }, "\u5220\u9664");
7775
+ }
7776
+ }]);
7777
+ var columsSearch = useMemo(function () {
7778
+ return [{
7779
+ dataIndex: 'index',
7780
+ title: '序号',
7781
+ render: function render(val, record, index) {
7782
+ return /*#__PURE__*/React.createElement("div", {
7783
+ style: {
7784
+ width: 25
7785
+ }
7786
+ }, index + 1);
7787
+ }
7788
+ }].concat(_toConsumableArray(newTableHeader.map(function (t) {
7789
+ return {
7790
+ dataIndex: t.key,
7791
+ title: t.name
7792
+ };
7793
+ })));
7794
+ }, [newTableHeader]);
7795
+ var valueMap = useMemo(function () {
7796
+ return newTableHeader.reduce(function (prv, next) {
7797
+ prv["".concat(next.key, "_").concat(WidgetMap[next.workOrderComponentType])] = next.key;
7798
+ return prv;
7799
+ }, {});
7800
+ }, [newTableHeader]);
7801
+ var selectOptions = useMemo(function () {
7802
+ var _options$;
7803
+ var options = newTableHeader.map(function (item) {
7804
+ return {
7805
+ label: item.name,
7806
+ value: "".concat(item.key, "_").concat(WidgetMap[item.workOrderComponentType])
7807
+ };
7808
+ });
7809
+ setSelectKey(options === null || options === void 0 ? void 0 : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value);
7810
+ return options;
7811
+ }, [newTableHeader]);
7812
+ var deleteHandle = function deleteHandle(uuid) {
7813
+ var newList = value.filter(function (item) {
7814
+ return item.uuid !== uuid;
7815
+ });
7816
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
7817
+ };
7818
+ var onScrollCapture = function onScrollCapture(e) {
7819
+ if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) {
7820
+ if (hasMore) {
7821
+ getWorkOrderList({
7822
+ pageNo: pageNo + 1
7823
+ });
7824
+ setPageNo(pageNo + 1);
7825
+ }
7826
+ }
7827
+ };
7828
+ var getWorkOrderList = /*#__PURE__*/function () {
7829
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7830
+ var _ref2,
7831
+ _ref2$pageNo,
7832
+ pageNo,
7833
+ params,
7834
+ res,
7835
+ data,
7836
+ success,
7837
+ newList,
7838
+ _args = arguments;
7839
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7840
+ while (1) switch (_context.prev = _context.next) {
7841
+ case 0:
7842
+ _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$pageNo = _ref2.pageNo, pageNo = _ref2$pageNo === void 0 ? 1 : _ref2$pageNo;
7843
+ if (!disabled) {
7844
+ _context.next = 3;
7845
+ break;
7846
+ }
7847
+ return _context.abrupt("return");
7848
+ case 3:
7849
+ params = {
7850
+ flowNodeId: nodeId,
7851
+ flowTemplateKey: flowTemplateKey === null || flowTemplateKey === void 0 ? void 0 : flowTemplateKey[1],
7852
+ pageNo: pageNo,
7853
+ pageSize: pageSize,
7854
+ templateKey: workOrderTemplateId,
7855
+ needReturnRepeatValue: true,
7856
+ needFilterShopByPermission: needFilterShopByPermission,
7857
+ queryComponents: [{
7858
+ key: 'flowStatus',
7859
+ symbol: 'in',
7860
+ value: flowStatus
7861
+ }]
7862
+ };
7863
+ if (selectKey && inputValue) {
7864
+ params.queryComponents = [{
7865
+ key: 'flowStatus',
7866
+ symbol: 'in',
7867
+ value: flowStatus
7868
+ }, {
7869
+ key: selectKey,
7870
+ symbol: 'in',
7871
+ value: [inputValue]
7872
+ }];
7873
+ }
7874
+ _context.next = 7;
7875
+ return extendRequest('/qy/view/workOrderList', {
7876
+ method: 'post',
7877
+ data: params
7878
+ });
7879
+ case 7:
7880
+ res = _context.sent;
7881
+ data = res.data, success = res.success;
7882
+ if (success) {
7883
+ newList = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
7884
+ var params = {};
7885
+ Object.keys(item.jsonMap).forEach(function (key) {
7886
+ if (valueMap[key]) {
7887
+ params[valueMap[key]] = item.jsonMap[key];
7888
+ }
7889
+ });
7890
+ return params;
7891
+ });
7892
+ if (pageNo === 1) {
7893
+ setList(newList);
7894
+ } else {
7895
+ setList([].concat(_toConsumableArray(list), _toConsumableArray(newList)));
7896
+ setHasMore((data === null || data === void 0 ? void 0 : data.list.length) === pageSize);
7897
+ }
7898
+ }
7899
+ case 10:
7900
+ case "end":
7901
+ return _context.stop();
7902
+ }
7903
+ }, _callee);
7904
+ }));
7905
+ return function getWorkOrderList() {
7906
+ return _ref.apply(this, arguments);
7907
+ };
7908
+ }();
7909
+ useEffect(function () {
7910
+ getWorkOrderList({
7911
+ pageNo: 1
7912
+ });
7913
+ }, []);
7914
+ useUpdateEffect(function () {
7915
+ setPageNo(1);
7916
+ getWorkOrderList({
7917
+ pageNo: 1
7918
+ });
7919
+ }, [inputValue]);
7920
+ var handleOpenChange = function handleOpenChange(newOpen) {
7921
+ setOpen(newOpen);
7922
+ };
7923
+ var onChangeInput = useCallback(debounce(function (val) {
7924
+ setInputValue(val);
7925
+ setOpen(true);
7926
+ }, 1000), []);
7927
+ var hasNumber = function hasNumber(val) {
7928
+ try {
7929
+ return isNaN$1(+val) ? false : isNumber$1(+val);
7930
+ } catch (e) {
7931
+ return false;
7932
+ }
7933
+ };
7934
+ var selectValueHandle = function selectValueHandle(record) {
7935
+ var numberKeys = newTableHeader.map(function (t) {
7936
+ if (t.isNumber) {
7937
+ return t.key;
7938
+ }
7939
+ });
7940
+ var newValue = _objectSpread2({}, record);
7941
+ if (numberKeys.length) {
7942
+ Object.keys(newValue).forEach(function (key) {
7943
+ if (numberKeys.includes(key)) {
7944
+ newValue[key] = hasNumber(newValue[key]) ? newValue[key] : '';
7945
+ }
7946
+ });
7947
+ }
7948
+ onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), [_objectSpread2(_objectSpread2({}, newValue), {}, {
7949
+ uuid: uuid()
7950
+ })]));
7951
+ };
7952
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(Space, {
7953
+ style: {
7954
+ marginBottom: '10px'
7955
+ }
7956
+ }, /*#__PURE__*/React.createElement(Select, {
7957
+ style: {
7958
+ width: '120px'
7959
+ },
7960
+ options: selectOptions,
7961
+ defaultValue: selectOptions === null || selectOptions === void 0 ? void 0 : (_selectOptions$ = selectOptions[0]) === null || _selectOptions$ === void 0 ? void 0 : _selectOptions$.value,
7962
+ value: selectKey,
7963
+ onChange: setSelectKey
7964
+ }), /*#__PURE__*/React.createElement(Popover, {
7965
+ content: /*#__PURE__*/React.createElement("div", {
7966
+ ref: ref,
7967
+ onScrollCapture: onScrollCapture,
7968
+ style: {
7969
+ height: 320,
7970
+ overflowY: 'scroll',
7971
+ overflowX: 'auto'
7972
+ }
7973
+ }, /*#__PURE__*/React.createElement(Table, {
7974
+ columns: columsSearch,
7975
+ dataSource: list,
7976
+ rowKey: 'index',
7977
+ size: "small",
7978
+ pagination: false,
7979
+ scroll: {
7980
+ x: '100%'
7981
+ },
7982
+ locale: {
7983
+ emptyText: '暂无数据'
7984
+ },
7985
+ onRow: function onRow(record) {
7986
+ return {
7987
+ onClick: function onClick(e) {
7988
+ e.stopPropagation();
7989
+ selectValueHandle(record);
7990
+ setOpen(false);
7991
+ }
7992
+ };
7993
+ }
7994
+ })),
7995
+ trigger: "click",
7996
+ placement: "bottom",
7997
+ visible: open,
7998
+ onVisibleChange: handleOpenChange
7999
+ }, /*#__PURE__*/React.createElement(Input, {
8000
+ placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u67E5\u8BE2",
8001
+ allowClear: true,
8002
+ onChange: function onChange(e) {
8003
+ onChangeInput(e.target.value);
8004
+ }
8005
+ }))), /*#__PURE__*/React.createElement(Table, {
8006
+ columns: column,
8007
+ dataSource: value,
8008
+ rowKey: 'uuid',
8009
+ size: "small",
8010
+ pagination: false,
8011
+ scroll: {
8012
+ x: '100%'
8013
+ },
8014
+ locale: {
8015
+ emptyText: '暂无数据'
8016
+ }
8017
+ }));
8018
+ };
8019
+
7630
8020
  var BuyerNick = function BuyerNick(props) {
7631
8021
  var _props$value = props.value,
7632
8022
  value = _props$value === void 0 ? {} : _props$value,
@@ -7913,18 +8303,6 @@ var AliPay = function AliPay(props) {
7913
8303
  })));
7914
8304
  };
7915
8305
 
7916
- /*
7917
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
7918
- * @Date: 2022-09-13 11:06:09
7919
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
7920
- * @LastEditTime: 2022-11-04 15:55:10
7921
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
7922
- * @Description:
7923
- *
7924
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
7925
- */
7926
- var extendRequest = extend$1({});
7927
-
7928
8306
  var css_248z$5 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.goodsBox .right-context {\n font-size: 12px;\n}\n.goodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.goodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.goodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n.goods-imgBox .add-btn {\n color: #86909c;\n}\n.goods-imgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
7929
8307
  styleInject(css_248z$5);
7930
8308
 
@@ -8738,7 +9116,7 @@ var Goods = function Goods(props) {
8738
9116
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
8739
9117
  setVisible(false);
8740
9118
  //供应上编码组件 || 商品组件且可以选择sku
8741
- if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9119
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && list.length > 0)) {
8742
9120
  _context2.next = 12;
8743
9121
  break;
8744
9122
  }
@@ -8750,12 +9128,12 @@ var Goods = function Goods(props) {
8750
9128
  case 9:
8751
9129
  _yield$querySkus = _context2.sent;
8752
9130
  data = _yield$querySkus.data;
8753
- if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9131
+ if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
8754
9132
  options = data[0]['skus'].map(function (item) {
8755
9133
  return {
8756
- label: item.propertiesName.split(';').map(function (i) {
9134
+ label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
8757
9135
  return i.split(':').slice(2);
8758
- }).join(';'),
9136
+ }).join(';') : item.propertiesName,
8759
9137
  value: item.skuId,
8760
9138
  picUrl: item.picUrl,
8761
9139
  outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId
@@ -9068,7 +9446,7 @@ var GoodItem = function GoodItem(props) {
9068
9446
  });
9069
9447
  setVisible(false);
9070
9448
  //供应上编码组件 || 商品组件且可以选择sku
9071
- if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9449
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && list.length > 0)) {
9072
9450
  _context2.next = 10;
9073
9451
  break;
9074
9452
  }
@@ -9080,12 +9458,12 @@ var GoodItem = function GoodItem(props) {
9080
9458
  case 7:
9081
9459
  _yield$querySkus = _context2.sent;
9082
9460
  data = _yield$querySkus.data;
9083
- if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9461
+ if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9084
9462
  options = data[0]['skus'].map(function (item) {
9085
9463
  return {
9086
- label: item.propertiesName.split(';').map(function (i) {
9464
+ label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
9087
9465
  return i.split(':').slice(2);
9088
- }).join(';'),
9466
+ }).join(';') : item.propertiesName,
9089
9467
  value: item.skuId,
9090
9468
  picUrl: item.picUrl,
9091
9469
  outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId,
@@ -13752,9 +14130,7 @@ var wdtReissue = function wdtReissue(props) {
13752
14130
  var _typeMap$type25;
13753
14131
  return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
13754
14132
  }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
13755
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
13756
- gutter: 8
13757
- }, /*#__PURE__*/React.createElement(Col, {
14133
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
13758
14134
  className: "gutter-row",
13759
14135
  xs: {
13760
14136
  span: 11
@@ -13786,6 +14162,9 @@ var wdtReissue = function wdtReissue(props) {
13786
14162
  },
13787
14163
  md: {
13788
14164
  span: 6
14165
+ },
14166
+ style: {
14167
+ marginLeft: '8px'
13789
14168
  }
13790
14169
  }, /*#__PURE__*/React.createElement(Cascader, {
13791
14170
  style: {
@@ -14580,4 +14959,4 @@ var CalculationInput = function CalculationInput(props) {
14580
14959
  }, config === null || config === void 0 ? void 0 : config.unit));
14581
14960
  };
14582
14961
 
14583
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
14962
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@ var icons = require('@ant-design/icons');
8
8
  var request = require('umi-request');
9
9
  var reactCopyToClipboard = require('react-copy-to-clipboard');
10
10
  var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
11
- var zhCN = require('antd/lib/locale/zh_CN');
12
11
  var lodash = require('lodash');
13
12
  var ahooks = require('ahooks');
13
+ var zhCN = require('antd/lib/locale/zh_CN');
14
14
  var pubsub = require('pubsub-js');
15
15
  var BigNumber = require('bignumber.js');
16
16
 
@@ -523,11 +523,12 @@ var ApaasDate = function ApaasDate(props) {
523
523
  }, otherProps));
524
524
  };
525
525
 
526
- var _excluded$1 = ["isNumber", "replaceWarn"];
526
+ var _excluded$1 = ["isNumber", "replaceWarn", "precision"];
527
527
  function ApaasInput(props) {
528
528
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
529
529
  var isNumber = props.isNumber,
530
530
  replaceWarn = props.replaceWarn,
531
+ precision = props.precision,
531
532
  other = _objectWithoutProperties(props, _excluded$1);
532
533
  var handleBlur = function handleBlur(e) {
533
534
  // 去除头尾空格
@@ -537,8 +538,12 @@ function ApaasInput(props) {
537
538
  typeof onChange === 'function' && onChange(e);
538
539
  typeof onBlur === 'function' && onBlur(e);
539
540
  };
541
+ return isNumber ?
542
+ /*#__PURE__*/
540
543
  // @ts-ignore
541
- return isNumber ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2({}, other)) : /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2(_objectSpread2({}, other), {}, {
544
+ React__default['default'].createElement(antd.InputNumber, _objectSpread2(_objectSpread2({}, other), {}, {
545
+ precision: precision === 'nolimit' ? undefined : precision
546
+ })) : /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2(_objectSpread2({}, other), {}, {
542
547
  onBlur: handleBlur
543
548
  }));
544
549
  }
@@ -7639,6 +7644,391 @@ function withFormItem(WrappedComponent) {
7639
7644
  };
7640
7645
  }
7641
7646
 
7647
+ /*
7648
+ * @Author: wangzhenggui jianjia.wzg@raycloud.com
7649
+ * @Date: 2022-09-13 11:06:09
7650
+ * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
7651
+ * @LastEditTime: 2022-11-04 15:55:10
7652
+ * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
7653
+ * @Description:
7654
+ *
7655
+ * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
7656
+ */
7657
+ var extendRequest = request.extend({});
7658
+
7659
+ var WidgetMap = {
7660
+ INPUT: 'input',
7661
+ TEXTAREA: 'textarea'
7662
+ };
7663
+ var pageSize = 50;
7664
+ var SubForm = function SubForm(props) {
7665
+ var _selectOptions$;
7666
+ var value = props.value,
7667
+ onChange = props.onChange,
7668
+ needFilterShopByPermission = props.needFilterShopByPermission,
7669
+ _props$subConfig = props.subConfig,
7670
+ flowStatus = _props$subConfig.flowStatus,
7671
+ flowTemplateKey = _props$subConfig.flowTemplateKey,
7672
+ nodeId = _props$subConfig.nodeId,
7673
+ workOrderTemplateId = _props$subConfig.workOrderTemplateId,
7674
+ correlationList = _props$subConfig.correlationList,
7675
+ tableHeader = props.tableHeader,
7676
+ disabled = props.disabled;
7677
+ var ref = React.useRef(null);
7678
+ var _useState = React.useState(false),
7679
+ _useState2 = _slicedToArray(_useState, 2),
7680
+ open = _useState2[0],
7681
+ setOpen = _useState2[1];
7682
+ var _useState3 = React.useState(''),
7683
+ _useState4 = _slicedToArray(_useState3, 2),
7684
+ selectKey = _useState4[0],
7685
+ setSelectKey = _useState4[1];
7686
+ var _useState5 = React.useState(''),
7687
+ _useState6 = _slicedToArray(_useState5, 2),
7688
+ inputValue = _useState6[0],
7689
+ setInputValue = _useState6[1];
7690
+ var _useState7 = React.useState([]),
7691
+ _useState8 = _slicedToArray(_useState7, 2),
7692
+ list = _useState8[0],
7693
+ setList = _useState8[1];
7694
+ var _useState9 = React.useState(1),
7695
+ _useState10 = _slicedToArray(_useState9, 2),
7696
+ pageNo = _useState10[0],
7697
+ setPageNo = _useState10[1];
7698
+ var _useState11 = React.useState(true),
7699
+ _useState12 = _slicedToArray(_useState11, 2),
7700
+ hasMore = _useState12[0],
7701
+ setHasMore = _useState12[1];
7702
+ var updateHandle = function updateHandle(val, index, type) {
7703
+ if (value === null || value === void 0 ? void 0 : value.length) {
7704
+ var valueItem = tableHeader.find(function (t) {
7705
+ return t.key === type && t.isNumber && t.precision !== 'nolimit';
7706
+ });
7707
+ var newValue = JSON.parse(JSON.stringify(value));
7708
+ newValue[index][type] = valueItem ? Number(val).toFixed(+valueItem.precision) : val;
7709
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newValue));
7710
+ }
7711
+ };
7712
+ var newTableHeader = React.useMemo(function () {
7713
+ return correlationList.reduce(function (prv, next) {
7714
+ var t = tableHeader.find(function (t) {
7715
+ return t.key === next.key;
7716
+ }) || {
7717
+ isShow: true,
7718
+ isEdit: false,
7719
+ isRequired: false,
7720
+ isNumber: false,
7721
+ precision: 'nolimit',
7722
+ width: 150
7723
+ };
7724
+ if (t && t.isShow) {
7725
+ prv.push(_objectSpread2(_objectSpread2({}, next), t));
7726
+ }
7727
+ return prv;
7728
+ }, []);
7729
+ }, [correlationList, tableHeader]);
7730
+ var column = [{
7731
+ dataIndex: 'index',
7732
+ title: '序号',
7733
+ width: 50,
7734
+ render: function render(val, record, index) {
7735
+ return /*#__PURE__*/React__default['default'].createElement("div", {
7736
+ style: {
7737
+ width: 25
7738
+ }
7739
+ }, index + 1);
7740
+ }
7741
+ }].concat(_toConsumableArray(newTableHeader.map(function (t) {
7742
+ return {
7743
+ dataIndex: t.key,
7744
+ title: /*#__PURE__*/React__default['default'].createElement("span", null, t.isRequired ? /*#__PURE__*/React__default['default'].createElement("span", {
7745
+ style: {
7746
+ color: 'red'
7747
+ }
7748
+ }, "*") : null, t.name),
7749
+ ellipsis: true,
7750
+ width: t.width,
7751
+ render: function render(val, record, index) {
7752
+ // @ts-ignore
7753
+ var precisionValue = t.precision === 'nolimit' ? undefined : t.precision;
7754
+ return !t.isEdit && !disabled ? t.isNumber ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
7755
+ style: {
7756
+ width: '100%'
7757
+ },
7758
+ value: val,
7759
+ precision: precisionValue,
7760
+ onChange: function onChange(e) {
7761
+ return updateHandle(e, index, t.key);
7762
+ },
7763
+ stringMode: true
7764
+ }) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
7765
+ style: {
7766
+ width: '100%'
7767
+ },
7768
+ value: val,
7769
+ onChange: function onChange(e) {
7770
+ var _e$target;
7771
+ return updateHandle(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value, index, t.key);
7772
+ }
7773
+ }) : /*#__PURE__*/React__default['default'].createElement("div", null, val);
7774
+ }
7775
+ };
7776
+ })), [disabled ? {} : {
7777
+ dataIndex: 'operation',
7778
+ title: '操作',
7779
+ width: 70,
7780
+ render: function render(val, record, index) {
7781
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7782
+ type: "link",
7783
+ onClick: function onClick() {
7784
+ return deleteHandle(record.uuid);
7785
+ }
7786
+ }, "\u5220\u9664");
7787
+ }
7788
+ }]);
7789
+ var columsSearch = React.useMemo(function () {
7790
+ return [{
7791
+ dataIndex: 'index',
7792
+ title: '序号',
7793
+ render: function render(val, record, index) {
7794
+ return /*#__PURE__*/React__default['default'].createElement("div", {
7795
+ style: {
7796
+ width: 25
7797
+ }
7798
+ }, index + 1);
7799
+ }
7800
+ }].concat(_toConsumableArray(newTableHeader.map(function (t) {
7801
+ return {
7802
+ dataIndex: t.key,
7803
+ title: t.name
7804
+ };
7805
+ })));
7806
+ }, [newTableHeader]);
7807
+ var valueMap = React.useMemo(function () {
7808
+ return newTableHeader.reduce(function (prv, next) {
7809
+ prv["".concat(next.key, "_").concat(WidgetMap[next.workOrderComponentType])] = next.key;
7810
+ return prv;
7811
+ }, {});
7812
+ }, [newTableHeader]);
7813
+ var selectOptions = React.useMemo(function () {
7814
+ var _options$;
7815
+ var options = newTableHeader.map(function (item) {
7816
+ return {
7817
+ label: item.name,
7818
+ value: "".concat(item.key, "_").concat(WidgetMap[item.workOrderComponentType])
7819
+ };
7820
+ });
7821
+ setSelectKey(options === null || options === void 0 ? void 0 : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value);
7822
+ return options;
7823
+ }, [newTableHeader]);
7824
+ var deleteHandle = function deleteHandle(uuid) {
7825
+ var newList = value.filter(function (item) {
7826
+ return item.uuid !== uuid;
7827
+ });
7828
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
7829
+ };
7830
+ var onScrollCapture = function onScrollCapture(e) {
7831
+ if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) {
7832
+ if (hasMore) {
7833
+ getWorkOrderList({
7834
+ pageNo: pageNo + 1
7835
+ });
7836
+ setPageNo(pageNo + 1);
7837
+ }
7838
+ }
7839
+ };
7840
+ var getWorkOrderList = /*#__PURE__*/function () {
7841
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7842
+ var _ref2,
7843
+ _ref2$pageNo,
7844
+ pageNo,
7845
+ params,
7846
+ res,
7847
+ data,
7848
+ success,
7849
+ newList,
7850
+ _args = arguments;
7851
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7852
+ while (1) switch (_context.prev = _context.next) {
7853
+ case 0:
7854
+ _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$pageNo = _ref2.pageNo, pageNo = _ref2$pageNo === void 0 ? 1 : _ref2$pageNo;
7855
+ if (!disabled) {
7856
+ _context.next = 3;
7857
+ break;
7858
+ }
7859
+ return _context.abrupt("return");
7860
+ case 3:
7861
+ params = {
7862
+ flowNodeId: nodeId,
7863
+ flowTemplateKey: flowTemplateKey === null || flowTemplateKey === void 0 ? void 0 : flowTemplateKey[1],
7864
+ pageNo: pageNo,
7865
+ pageSize: pageSize,
7866
+ templateKey: workOrderTemplateId,
7867
+ needReturnRepeatValue: true,
7868
+ needFilterShopByPermission: needFilterShopByPermission,
7869
+ queryComponents: [{
7870
+ key: 'flowStatus',
7871
+ symbol: 'in',
7872
+ value: flowStatus
7873
+ }]
7874
+ };
7875
+ if (selectKey && inputValue) {
7876
+ params.queryComponents = [{
7877
+ key: 'flowStatus',
7878
+ symbol: 'in',
7879
+ value: flowStatus
7880
+ }, {
7881
+ key: selectKey,
7882
+ symbol: 'in',
7883
+ value: [inputValue]
7884
+ }];
7885
+ }
7886
+ _context.next = 7;
7887
+ return extendRequest('/qy/view/workOrderList', {
7888
+ method: 'post',
7889
+ data: params
7890
+ });
7891
+ case 7:
7892
+ res = _context.sent;
7893
+ data = res.data, success = res.success;
7894
+ if (success) {
7895
+ newList = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
7896
+ var params = {};
7897
+ Object.keys(item.jsonMap).forEach(function (key) {
7898
+ if (valueMap[key]) {
7899
+ params[valueMap[key]] = item.jsonMap[key];
7900
+ }
7901
+ });
7902
+ return params;
7903
+ });
7904
+ if (pageNo === 1) {
7905
+ setList(newList);
7906
+ } else {
7907
+ setList([].concat(_toConsumableArray(list), _toConsumableArray(newList)));
7908
+ setHasMore((data === null || data === void 0 ? void 0 : data.list.length) === pageSize);
7909
+ }
7910
+ }
7911
+ case 10:
7912
+ case "end":
7913
+ return _context.stop();
7914
+ }
7915
+ }, _callee);
7916
+ }));
7917
+ return function getWorkOrderList() {
7918
+ return _ref.apply(this, arguments);
7919
+ };
7920
+ }();
7921
+ React.useEffect(function () {
7922
+ getWorkOrderList({
7923
+ pageNo: 1
7924
+ });
7925
+ }, []);
7926
+ ahooks.useUpdateEffect(function () {
7927
+ setPageNo(1);
7928
+ getWorkOrderList({
7929
+ pageNo: 1
7930
+ });
7931
+ }, [inputValue]);
7932
+ var handleOpenChange = function handleOpenChange(newOpen) {
7933
+ setOpen(newOpen);
7934
+ };
7935
+ var onChangeInput = React.useCallback(lodash.debounce(function (val) {
7936
+ setInputValue(val);
7937
+ setOpen(true);
7938
+ }, 1000), []);
7939
+ var hasNumber = function hasNumber(val) {
7940
+ try {
7941
+ return lodash.isNaN(+val) ? false : lodash.isNumber(+val);
7942
+ } catch (e) {
7943
+ return false;
7944
+ }
7945
+ };
7946
+ var selectValueHandle = function selectValueHandle(record) {
7947
+ var numberKeys = newTableHeader.map(function (t) {
7948
+ if (t.isNumber) {
7949
+ return t.key;
7950
+ }
7951
+ });
7952
+ var newValue = _objectSpread2({}, record);
7953
+ if (numberKeys.length) {
7954
+ Object.keys(newValue).forEach(function (key) {
7955
+ if (numberKeys.includes(key)) {
7956
+ newValue[key] = hasNumber(newValue[key]) ? newValue[key] : '';
7957
+ }
7958
+ });
7959
+ }
7960
+ onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), [_objectSpread2(_objectSpread2({}, newValue), {}, {
7961
+ uuid: kmkfUtils.uuid()
7962
+ })]));
7963
+ };
7964
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && /*#__PURE__*/React__default['default'].createElement(antd.Space, {
7965
+ style: {
7966
+ marginBottom: '10px'
7967
+ }
7968
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
7969
+ style: {
7970
+ width: '120px'
7971
+ },
7972
+ options: selectOptions,
7973
+ defaultValue: selectOptions === null || selectOptions === void 0 ? void 0 : (_selectOptions$ = selectOptions[0]) === null || _selectOptions$ === void 0 ? void 0 : _selectOptions$.value,
7974
+ value: selectKey,
7975
+ onChange: setSelectKey
7976
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
7977
+ content: /*#__PURE__*/React__default['default'].createElement("div", {
7978
+ ref: ref,
7979
+ onScrollCapture: onScrollCapture,
7980
+ style: {
7981
+ height: 320,
7982
+ overflowY: 'scroll',
7983
+ overflowX: 'auto'
7984
+ }
7985
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
7986
+ columns: columsSearch,
7987
+ dataSource: list,
7988
+ rowKey: 'index',
7989
+ size: "small",
7990
+ pagination: false,
7991
+ scroll: {
7992
+ x: '100%'
7993
+ },
7994
+ locale: {
7995
+ emptyText: '暂无数据'
7996
+ },
7997
+ onRow: function onRow(record) {
7998
+ return {
7999
+ onClick: function onClick(e) {
8000
+ e.stopPropagation();
8001
+ selectValueHandle(record);
8002
+ setOpen(false);
8003
+ }
8004
+ };
8005
+ }
8006
+ })),
8007
+ trigger: "click",
8008
+ placement: "bottom",
8009
+ visible: open,
8010
+ onVisibleChange: handleOpenChange
8011
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
8012
+ placeholder: "\u8F93\u5165\u5173\u952E\u8BCD\u67E5\u8BE2",
8013
+ allowClear: true,
8014
+ onChange: function onChange(e) {
8015
+ onChangeInput(e.target.value);
8016
+ }
8017
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
8018
+ columns: column,
8019
+ dataSource: value,
8020
+ rowKey: 'uuid',
8021
+ size: "small",
8022
+ pagination: false,
8023
+ scroll: {
8024
+ x: '100%'
8025
+ },
8026
+ locale: {
8027
+ emptyText: '暂无数据'
8028
+ }
8029
+ }));
8030
+ };
8031
+
7642
8032
  var BuyerNick = function BuyerNick(props) {
7643
8033
  var _props$value = props.value,
7644
8034
  value = _props$value === void 0 ? {} : _props$value,
@@ -7925,18 +8315,6 @@ var AliPay = function AliPay(props) {
7925
8315
  })));
7926
8316
  };
7927
8317
 
7928
- /*
7929
- * @Author: wangzhenggui jianjia.wzg@raycloud.com
7930
- * @Date: 2022-09-13 11:06:09
7931
- * @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
7932
- * @LastEditTime: 2022-11-04 15:55:10
7933
- * @FilePath: /raycloud-apaas-fe-setup/packages/apaas-react-basics-widgets/src/common/request.ts
7934
- * @Description:
7935
- *
7936
- * Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
7937
- */
7938
- var extendRequest = request.extend({});
7939
-
7940
8318
  var css_248z$5 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.goodsBox .right-context {\n font-size: 12px;\n}\n.goodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.goodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.goodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n}\n.goods-imgBox .add-btn {\n color: #86909c;\n}\n.goods-imgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
7941
8319
  styleInject(css_248z$5);
7942
8320
 
@@ -8750,7 +9128,7 @@ var Goods = function Goods(props) {
8750
9128
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
8751
9129
  setVisible(false);
8752
9130
  //供应上编码组件 || 商品组件且可以选择sku
8753
- if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9131
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && list.length > 0)) {
8754
9132
  _context2.next = 12;
8755
9133
  break;
8756
9134
  }
@@ -8762,12 +9140,12 @@ var Goods = function Goods(props) {
8762
9140
  case 9:
8763
9141
  _yield$querySkus = _context2.sent;
8764
9142
  data = _yield$querySkus.data;
8765
- if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9143
+ if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
8766
9144
  options = data[0]['skus'].map(function (item) {
8767
9145
  return {
8768
- label: item.propertiesName.split(';').map(function (i) {
9146
+ label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
8769
9147
  return i.split(':').slice(2);
8770
- }).join(';'),
9148
+ }).join(';') : item.propertiesName,
8771
9149
  value: item.skuId,
8772
9150
  picUrl: item.picUrl,
8773
9151
  outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId
@@ -9080,7 +9458,7 @@ var GoodItem = function GoodItem(props) {
9080
9458
  });
9081
9459
  setVisible(false);
9082
9460
  //供应上编码组件 || 商品组件且可以选择sku
9083
- if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9461
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && list.length > 0)) {
9084
9462
  _context2.next = 10;
9085
9463
  break;
9086
9464
  }
@@ -9092,12 +9470,12 @@ var GoodItem = function GoodItem(props) {
9092
9470
  case 7:
9093
9471
  _yield$querySkus = _context2.sent;
9094
9472
  data = _yield$querySkus.data;
9095
- if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9473
+ if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9096
9474
  options = data[0]['skus'].map(function (item) {
9097
9475
  return {
9098
- label: item.propertiesName.split(';').map(function (i) {
9476
+ label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
9099
9477
  return i.split(':').slice(2);
9100
- }).join(';'),
9478
+ }).join(';') : item.propertiesName,
9101
9479
  value: item.skuId,
9102
9480
  picUrl: item.picUrl,
9103
9481
  outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId,
@@ -13764,9 +14142,7 @@ var wdtReissue = function wdtReissue(props) {
13764
14142
  var _typeMap$type25;
13765
14143
  return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
13766
14144
  }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
13767
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
13768
- gutter: 8
13769
- }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
14145
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, null, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
13770
14146
  className: "gutter-row",
13771
14147
  xs: {
13772
14148
  span: 11
@@ -13798,6 +14174,9 @@ var wdtReissue = function wdtReissue(props) {
13798
14174
  },
13799
14175
  md: {
13800
14176
  span: 6
14177
+ },
14178
+ style: {
14179
+ marginLeft: '8px'
13801
14180
  }
13802
14181
  }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
13803
14182
  style: {
@@ -14644,6 +15023,7 @@ exports.Remark = RemarkInput;
14644
15023
  exports.ReturnLogistics = ExpressLogistics;
14645
15024
  exports.ShopName = ShopNameSelect;
14646
15025
  exports.Status = Status;
15026
+ exports.SubForm = SubForm;
14647
15027
  exports.Supplier = Supplier;
14648
15028
  exports.TBGoodId = TBGoodId;
14649
15029
  exports.TBGoodSerial = TBGoodSerial;
@@ -3,6 +3,7 @@ import { InputProps } from 'antd';
3
3
  export interface ApaasInputProps extends InputProps {
4
4
  isNumber?: boolean;
5
5
  replaceWarn?: boolean;
6
+ precision?: 'nolimit' | number | undefined;
6
7
  }
7
8
  declare function ApaasInput(props: ApaasInputProps): React.JSX.Element;
8
9
  export default ApaasInput;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ type subConfigType = {
3
+ name: string;
4
+ key: string;
5
+ workOrderComponentType: string;
6
+ isShow: boolean;
7
+ isEdit: boolean;
8
+ isRequired: boolean;
9
+ isNumber: boolean;
10
+ precision: string | number;
11
+ width: number;
12
+ [key: string]: any;
13
+ };
14
+ type SubFormProps = {
15
+ value: any;
16
+ onChange: (val: any) => void;
17
+ subConfig: {
18
+ flowStatus: Array<string>;
19
+ flowTemplateKey: Array<any>;
20
+ nodeId: string;
21
+ workOrderTemplateId: string;
22
+ correlationList: subConfigType[];
23
+ };
24
+ needFilterShopByPermission: boolean;
25
+ tableHeader: subConfigType[];
26
+ disabled: boolean;
27
+ };
28
+ declare const SubForm: (props: SubFormProps) => React.JSX.Element;
29
+ export default SubForm;
@@ -16,6 +16,7 @@ export { default as ApaasAddress } from './apaas/ApaasAddress';
16
16
  export { default as ApaasPosting } from './apaas/ApaasPosting';
17
17
  export { default as ApaasLogistics } from './apaas/ApaasLogistics';
18
18
  export { default as ApaasHoc } from './apaas/hoc/withFormItem';
19
+ export { default as SubForm } from './apaas/SubForm';
19
20
  export { default as BuyerNick } from './business/BuyerNick';
20
21
  export { default as TradeId } from './business/TradeId';
21
22
  export { default as ShopName } from './business/ShopName';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-beta.0",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "1.7.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "1.8.0-beta.0",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.8",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "2994578e8b3158fd2b05e9909be0f0d2f2c50daa"
68
+ "gitHead": "b854b2c34a9d25d96f0484f45aa15d4d7b5eb958"
69
69
  }