@kmkf-fe-packages/basic-components 0.14.1 → 0.15.0-alpha.1

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
@@ -9724,6 +9724,24 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9724
9724
  return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
9725
9725
  };
9726
9726
 
9727
+ //组件类型的默认值
9728
+ var typeInitValueMap = {
9729
+ 1: [{
9730
+ logisticsCompany: null,
9731
+ logisticsCode: null
9732
+ }],
9733
+ 2: [{
9734
+ supplyId: null,
9735
+ supplyName: null
9736
+ }],
9737
+ 3: [{
9738
+ sendId: null,
9739
+ sendName: null
9740
+ }],
9741
+ 4: [{
9742
+ deliveryNo: null
9743
+ }]
9744
+ };
9727
9745
  var jstGoods = function jstGoods(props) {
9728
9746
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
9729
9747
  var _props$value = props.value,
@@ -9738,11 +9756,12 @@ var jstGoods = function jstGoods(props) {
9738
9756
  _useState2 = _slicedToArray(_useState, 2),
9739
9757
  changeIndex = _useState2[0],
9740
9758
  setChangeIndex = _useState2[1]; //选中的包裹
9741
- // useEffect(() => {
9742
- // if (value.length <= 1) {
9743
- // setChangeIndex(0);
9744
- // }
9745
- // }, [value]);
9759
+ useEffect(function () {
9760
+ //没有值塞个默认值
9761
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
9762
+ onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
9763
+ }
9764
+ }, [value, type]);
9746
9765
  var content = function content(item, index) {
9747
9766
  return /*#__PURE__*/React.createElement("div", {
9748
9767
  style: {
@@ -11791,6 +11810,28 @@ function CommonStatus(props) {
11791
11810
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", value === null || value === void 0 ? void 0 : value.reason) : null);
11792
11811
  }
11793
11812
 
11813
+ var typeInitValueMap$1 = {
11814
+ 1: {
11815
+ initValue: [{
11816
+ deliveryNo: ''
11817
+ }]
11818
+ },
11819
+ 2: {
11820
+ initValue: [{
11821
+ returnGoodsTradeId: ''
11822
+ }]
11823
+ },
11824
+ 3: {
11825
+ initValue: [{
11826
+ billNo: ''
11827
+ }]
11828
+ },
11829
+ 4: {
11830
+ initValue: [{
11831
+ billNo: ''
11832
+ }]
11833
+ }
11834
+ };
11794
11835
  var CommonSystemOrder = function CommonSystemOrder(props) {
11795
11836
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4;
11796
11837
  var _props$value = props.value,
@@ -11803,11 +11844,11 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
11803
11844
  _useState2 = _slicedToArray(_useState, 2),
11804
11845
  changeIndex = _useState2[0],
11805
11846
  setChangeIndex = _useState2[1]; //选中的包裹
11806
- // useEffect(() => {
11807
- // if (value.length <= 1) {
11808
- // setChangeIndex(0);
11809
- // }
11810
- // }, [value]);
11847
+ useEffect(function () {
11848
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
11849
+ onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap$1[type].initValue);
11850
+ }
11851
+ }, [value, type]);
11811
11852
  var content = function content(item, index) {
11812
11853
  return /*#__PURE__*/React.createElement("div", {
11813
11854
  style: {
@@ -11860,16 +11901,10 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
11860
11901
  })) : null, type === 3 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
11861
11902
  disabled: true,
11862
11903
  placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
11863
- onChange: function onChange(e) {
11864
- return changeInputHandle(e.target.value, 'reissueTradeId');
11865
- },
11866
11904
  value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
11867
11905
  })) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
11868
11906
  disabled: true,
11869
11907
  placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
11870
- onChange: function onChange(e) {
11871
- return changeInputHandle(e.target.value, 'exchangeTradeId');
11872
- },
11873
11908
  value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
11874
11909
  })) : null) : null);
11875
11910
  };
package/dist/index.js CHANGED
@@ -9735,6 +9735,24 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9735
9735
  return /*#__PURE__*/React__default['default'].createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React__default['default'].createElement(LogisticsSnapshot, null) : null);
9736
9736
  };
9737
9737
 
9738
+ //组件类型的默认值
9739
+ var typeInitValueMap = {
9740
+ 1: [{
9741
+ logisticsCompany: null,
9742
+ logisticsCode: null
9743
+ }],
9744
+ 2: [{
9745
+ supplyId: null,
9746
+ supplyName: null
9747
+ }],
9748
+ 3: [{
9749
+ sendId: null,
9750
+ sendName: null
9751
+ }],
9752
+ 4: [{
9753
+ deliveryNo: null
9754
+ }]
9755
+ };
9738
9756
  var jstGoods = function jstGoods(props) {
9739
9757
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
9740
9758
  var _props$value = props.value,
@@ -9749,11 +9767,12 @@ var jstGoods = function jstGoods(props) {
9749
9767
  _useState2 = _slicedToArray(_useState, 2),
9750
9768
  changeIndex = _useState2[0],
9751
9769
  setChangeIndex = _useState2[1]; //选中的包裹
9752
- // useEffect(() => {
9753
- // if (value.length <= 1) {
9754
- // setChangeIndex(0);
9755
- // }
9756
- // }, [value]);
9770
+ React.useEffect(function () {
9771
+ //没有值塞个默认值
9772
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
9773
+ onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
9774
+ }
9775
+ }, [value, type]);
9757
9776
  var content = function content(item, index) {
9758
9777
  return /*#__PURE__*/React__default['default'].createElement("div", {
9759
9778
  style: {
@@ -11802,6 +11821,28 @@ function CommonStatus(props) {
11802
11821
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", value === null || value === void 0 ? void 0 : value.reason) : null);
11803
11822
  }
11804
11823
 
11824
+ var typeInitValueMap$1 = {
11825
+ 1: {
11826
+ initValue: [{
11827
+ deliveryNo: ''
11828
+ }]
11829
+ },
11830
+ 2: {
11831
+ initValue: [{
11832
+ returnGoodsTradeId: ''
11833
+ }]
11834
+ },
11835
+ 3: {
11836
+ initValue: [{
11837
+ billNo: ''
11838
+ }]
11839
+ },
11840
+ 4: {
11841
+ initValue: [{
11842
+ billNo: ''
11843
+ }]
11844
+ }
11845
+ };
11805
11846
  var CommonSystemOrder = function CommonSystemOrder(props) {
11806
11847
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4;
11807
11848
  var _props$value = props.value,
@@ -11814,11 +11855,11 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
11814
11855
  _useState2 = _slicedToArray(_useState, 2),
11815
11856
  changeIndex = _useState2[0],
11816
11857
  setChangeIndex = _useState2[1]; //选中的包裹
11817
- // useEffect(() => {
11818
- // if (value.length <= 1) {
11819
- // setChangeIndex(0);
11820
- // }
11821
- // }, [value]);
11858
+ React.useEffect(function () {
11859
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
11860
+ onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap$1[type].initValue);
11861
+ }
11862
+ }, [value, type]);
11822
11863
  var content = function content(item, index) {
11823
11864
  return /*#__PURE__*/React__default['default'].createElement("div", {
11824
11865
  style: {
@@ -11871,16 +11912,10 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
11871
11912
  })) : null, type === 3 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11872
11913
  disabled: true,
11873
11914
  placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
11874
- onChange: function onChange(e) {
11875
- return changeInputHandle(e.target.value, 'reissueTradeId');
11876
- },
11877
11915
  value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
11878
11916
  })) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11879
11917
  disabled: true,
11880
11918
  placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
11881
- onChange: function onChange(e) {
11882
- return changeInputHandle(e.target.value, 'exchangeTradeId');
11883
- },
11884
11919
  value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
11885
11920
  })) : null) : null);
11886
11921
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.14.1",
3
+ "version": "0.15.0-alpha.1",
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": "^0.14.1",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.15.0-alpha.1",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "react-copy-to-clipboard": "^5.1.0",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "6cdf51565e497213b786f988ba694684a046d697"
64
+ "gitHead": "2799ddc04c519d1cc57cd3f84aac302d18655ef7"
65
65
  }