kts-component-invoice-operate 3.2.176 → 3.2.178

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.
@@ -3,6 +3,12 @@ import './index.less';
3
3
  export interface IGoodsListProps {
4
4
  /** 产品最大数 */
5
5
  goodMax?: number;
6
+ addressOptions: any[];
7
+ vehicleTypeList: any[];
8
+ /**
9
+ * 建筑服务地址数据字段名
10
+ */
11
+ fieldNames?: any;
6
12
  }
7
13
  export default class FreightList extends React.Component<IGoodsListProps> {
8
14
  render(): JSX.Element;
package/dist/index.esm.js CHANGED
@@ -25668,8 +25668,7 @@ var Main$4 = decorator(Form.create())(function (props) {
25668
25668
  return _ref.apply(this, arguments);
25669
25669
  };
25670
25670
  }())(props.form);
25671
- }, [controller, props.form]); // 跟新 货物
25672
-
25671
+ }, [controller, props.form]);
25673
25672
  React.useEffect(function () {
25674
25673
  controller.run( /*#__PURE__*/function () {
25675
25674
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
@@ -25677,12 +25676,9 @@ var Main$4 = decorator(Form.create())(function (props) {
25677
25676
  while (1) {
25678
25677
  switch (_context2.prev = _context2.next) {
25679
25678
  case 0:
25680
- s.freightListState.goodsMap = new Map();
25681
- goodsList.forEach(function (e) {
25682
- s.freightListState.goodsMap.set(e.$index, e);
25683
- });
25679
+ s.freightListState.addressFieldNames = props.fieldNames;
25684
25680
 
25685
- case 2:
25681
+ case 1:
25686
25682
  case "end":
25687
25683
  return _context2.stop();
25688
25684
  }
@@ -25694,17 +25690,15 @@ var Main$4 = decorator(Form.create())(function (props) {
25694
25690
  return _ref2.apply(this, arguments);
25695
25691
  };
25696
25692
  }());
25697
- }, [controller, goodsList]);
25698
- /** props 产品最大数 更新 */
25699
-
25693
+ }, [props.fieldNames]);
25700
25694
  React.useEffect(function () {
25701
- controller.pipeline( /*#__PURE__*/function () {
25695
+ controller.run( /*#__PURE__*/function () {
25702
25696
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
25703
25697
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25704
25698
  while (1) {
25705
25699
  switch (_context3.prev = _context3.next) {
25706
25700
  case 0:
25707
- s.freightListState.goodMax = props.goodMax;
25701
+ s.freightListState.vehicleTypeList = props.vehicleTypeList;
25708
25702
 
25709
25703
  case 1:
25710
25704
  case "end":
@@ -25717,6 +25711,78 @@ var Main$4 = decorator(Form.create())(function (props) {
25717
25711
  return function (_x4) {
25718
25712
  return _ref3.apply(this, arguments);
25719
25713
  };
25714
+ }());
25715
+ }, [props.vehicleTypeList]);
25716
+ React.useEffect(function () {
25717
+ controller.run( /*#__PURE__*/function () {
25718
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
25719
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25720
+ while (1) {
25721
+ switch (_context4.prev = _context4.next) {
25722
+ case 0:
25723
+ s.freightListState.area = props.addressOptions;
25724
+
25725
+ case 1:
25726
+ case "end":
25727
+ return _context4.stop();
25728
+ }
25729
+ }
25730
+ }, _callee4);
25731
+ }));
25732
+
25733
+ return function (_x5) {
25734
+ return _ref4.apply(this, arguments);
25735
+ };
25736
+ }());
25737
+ }, [props.addressOptions]); // 跟新 货物
25738
+
25739
+ React.useEffect(function () {
25740
+ controller.run( /*#__PURE__*/function () {
25741
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
25742
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25743
+ while (1) {
25744
+ switch (_context5.prev = _context5.next) {
25745
+ case 0:
25746
+ s.freightListState.goodsMap = new Map();
25747
+ goodsList.forEach(function (e) {
25748
+ s.freightListState.goodsMap.set(e.$index, e);
25749
+ });
25750
+
25751
+ case 2:
25752
+ case "end":
25753
+ return _context5.stop();
25754
+ }
25755
+ }
25756
+ }, _callee5);
25757
+ }));
25758
+
25759
+ return function (_x6) {
25760
+ return _ref5.apply(this, arguments);
25761
+ };
25762
+ }());
25763
+ }, [controller, goodsList]);
25764
+ /** props 产品最大数 更新 */
25765
+
25766
+ React.useEffect(function () {
25767
+ controller.pipeline( /*#__PURE__*/function () {
25768
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
25769
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
25770
+ while (1) {
25771
+ switch (_context6.prev = _context6.next) {
25772
+ case 0:
25773
+ s.freightListState.goodMax = props.goodMax;
25774
+
25775
+ case 1:
25776
+ case "end":
25777
+ return _context6.stop();
25778
+ }
25779
+ }
25780
+ }, _callee6);
25781
+ }));
25782
+
25783
+ return function (_x7) {
25784
+ return _ref6.apply(this, arguments);
25785
+ };
25720
25786
  }())();
25721
25787
  }, [controller, props.goodMax]); // 注册 form
25722
25788
  // controller.useForm('freightInfo', form);
package/dist/index.js CHANGED
@@ -25678,8 +25678,7 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
25678
25678
  return _ref.apply(this, arguments);
25679
25679
  };
25680
25680
  }())(props.form);
25681
- }, [controller, props.form]); // 跟新 货物
25682
-
25681
+ }, [controller, props.form]);
25683
25682
  React__default['default'].useEffect(function () {
25684
25683
  controller.run( /*#__PURE__*/function () {
25685
25684
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
@@ -25687,12 +25686,9 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
25687
25686
  while (1) {
25688
25687
  switch (_context2.prev = _context2.next) {
25689
25688
  case 0:
25690
- s.freightListState.goodsMap = new Map();
25691
- goodsList.forEach(function (e) {
25692
- s.freightListState.goodsMap.set(e.$index, e);
25693
- });
25689
+ s.freightListState.addressFieldNames = props.fieldNames;
25694
25690
 
25695
- case 2:
25691
+ case 1:
25696
25692
  case "end":
25697
25693
  return _context2.stop();
25698
25694
  }
@@ -25704,17 +25700,15 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
25704
25700
  return _ref2.apply(this, arguments);
25705
25701
  };
25706
25702
  }());
25707
- }, [controller, goodsList]);
25708
- /** props 产品最大数 更新 */
25709
-
25703
+ }, [props.fieldNames]);
25710
25704
  React__default['default'].useEffect(function () {
25711
- controller.pipeline( /*#__PURE__*/function () {
25705
+ controller.run( /*#__PURE__*/function () {
25712
25706
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
25713
25707
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
25714
25708
  while (1) {
25715
25709
  switch (_context3.prev = _context3.next) {
25716
25710
  case 0:
25717
- s.freightListState.goodMax = props.goodMax;
25711
+ s.freightListState.vehicleTypeList = props.vehicleTypeList;
25718
25712
 
25719
25713
  case 1:
25720
25714
  case "end":
@@ -25727,6 +25721,78 @@ var Main$4 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
25727
25721
  return function (_x4) {
25728
25722
  return _ref3.apply(this, arguments);
25729
25723
  };
25724
+ }());
25725
+ }, [props.vehicleTypeList]);
25726
+ React__default['default'].useEffect(function () {
25727
+ controller.run( /*#__PURE__*/function () {
25728
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
25729
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
25730
+ while (1) {
25731
+ switch (_context4.prev = _context4.next) {
25732
+ case 0:
25733
+ s.freightListState.area = props.addressOptions;
25734
+
25735
+ case 1:
25736
+ case "end":
25737
+ return _context4.stop();
25738
+ }
25739
+ }
25740
+ }, _callee4);
25741
+ }));
25742
+
25743
+ return function (_x5) {
25744
+ return _ref4.apply(this, arguments);
25745
+ };
25746
+ }());
25747
+ }, [props.addressOptions]); // 跟新 货物
25748
+
25749
+ React__default['default'].useEffect(function () {
25750
+ controller.run( /*#__PURE__*/function () {
25751
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
25752
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
25753
+ while (1) {
25754
+ switch (_context5.prev = _context5.next) {
25755
+ case 0:
25756
+ s.freightListState.goodsMap = new Map();
25757
+ goodsList.forEach(function (e) {
25758
+ s.freightListState.goodsMap.set(e.$index, e);
25759
+ });
25760
+
25761
+ case 2:
25762
+ case "end":
25763
+ return _context5.stop();
25764
+ }
25765
+ }
25766
+ }, _callee5);
25767
+ }));
25768
+
25769
+ return function (_x6) {
25770
+ return _ref5.apply(this, arguments);
25771
+ };
25772
+ }());
25773
+ }, [controller, goodsList]);
25774
+ /** props 产品最大数 更新 */
25775
+
25776
+ React__default['default'].useEffect(function () {
25777
+ controller.pipeline( /*#__PURE__*/function () {
25778
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
25779
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
25780
+ while (1) {
25781
+ switch (_context6.prev = _context6.next) {
25782
+ case 0:
25783
+ s.freightListState.goodMax = props.goodMax;
25784
+
25785
+ case 1:
25786
+ case "end":
25787
+ return _context6.stop();
25788
+ }
25789
+ }
25790
+ }, _callee6);
25791
+ }));
25792
+
25793
+ return function (_x7) {
25794
+ return _ref6.apply(this, arguments);
25795
+ };
25730
25796
  }())();
25731
25797
  }, [controller, props.goodMax]); // 注册 form
25732
25798
  // controller.useForm('freightInfo', form);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.176",
3
+ "version": "3.2.178",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -6,7 +6,7 @@ import 'antd/dist/antd.css';
6
6
  export default () => {
7
7
 
8
8
  const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
9
- const area=React.useMemo(() => [
9
+ const area = React.useMemo(() => [
10
10
  {
11
11
  "code": "11",
12
12
  "name": "北京市",
@@ -14545,12 +14545,12 @@ export default () => {
14545
14545
  React.useEffect(() => {
14546
14546
  controller.run(async s => {
14547
14547
  // await controller.run(async s => { s.model = 'readOnly' }); // 设置只读
14548
- controller.state.freightListState.vehicleTypeList = [
14549
- { label: '铁路运输', value: 'RAILWAY' }
14550
- ];
14551
- controller.state.freightListState.area=area;
14552
- controller.state.freightListState.addressFieldNames={label:'name',value:'name',children:'children'}
14553
- controller.state.freightListState.goodsList=[{$index:'222',type:'RAILWAY',itemName:'咖啡机',licensePlate:'渝bkb190',origin:['北京','市辖区','东城区'],destination:['北京','市辖区','东城区']}]
14548
+ // controller.state.freightListState.vehicleTypeList = [
14549
+ // { label: '铁路运输', value: 'RAILWAY' }
14550
+ // ];
14551
+ // controller.state.freightListState.area=area;
14552
+ // controller.state.freightListState.addressFieldNames={label:'name',value:'name',children:'children'}
14553
+ controller.state.freightListState.goodsList = [{ $index: '222', type: 'RAILWAY', itemName: '咖啡机', licensePlate: '渝bkb190', origin: ['北京', '市辖区', '东城区'], destination: ['北京', '市辖区', '东城区'] }]
14554
14554
  })
14555
14555
  }, [])
14556
14556
 
@@ -14558,7 +14558,18 @@ export default () => {
14558
14558
  <Invoice
14559
14559
  invoiceType='digtal'
14560
14560
  controller={controller}
14561
- specialInfor={<Invoice.FreightList />}
14561
+ specialInfor={<Invoice.FreightList
14562
+ vehicleTypeList={[
14563
+ { label: '铁路运输', value: 'RAILWAY' }
14564
+ ]}
14565
+ addressOptions={area}
14566
+ fieldNames={{
14567
+ label: 'name',
14568
+ value: 'name',
14569
+ children: 'children'
14570
+ }}
14571
+ />
14572
+ }
14562
14573
  />
14563
14574
  )
14564
14575
  };
@@ -25,6 +25,13 @@ export interface IGoodsListProps {
25
25
  /** 产品最大数 */
26
26
  goodMax?: number;
27
27
 
28
+ addressOptions: any[];
29
+ vehicleTypeList:any[];
30
+ /**
31
+ * 地址数据字段名
32
+ */
33
+ fieldNames?: any;
34
+
28
35
  }
29
36
 
30
37
  export default class FreightList extends React.Component<IGoodsListProps> {
@@ -56,7 +63,21 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
56
63
  React.useEffect(() => {
57
64
  controller.pipeline<WrappedFormUtils>(async (s, form) => { s.freightListState = { ...s.freightListState, form } })(props.form);
58
65
  }, [controller, props.form]);
59
-
66
+ React.useEffect(() => {
67
+ controller.run(async (s) => {
68
+ s.freightListState.addressFieldNames = props.fieldNames
69
+ });
70
+ }, [props.fieldNames])
71
+ React.useEffect(() => {
72
+ controller.run(async (s) => {
73
+ s.freightListState.vehicleTypeList = props.vehicleTypeList
74
+ });
75
+ }, [props.vehicleTypeList])
76
+ React.useEffect(() => {
77
+ controller.run(async (s) => {
78
+ s.freightListState.area = props.addressOptions
79
+ });
80
+ }, [props.addressOptions])
60
81
  // 跟新 货物
61
82
  React.useEffect(() => {
62
83
  controller.run(async (s) => {
@@ -69,7 +90,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
69
90
  React.useEffect(() => {
70
91
  controller.pipeline(async s => { s.freightListState.goodMax = props.goodMax })()
71
92
  }, [controller, props.goodMax])
72
- // 注册 form
93
+ // 注册 form
73
94
  // controller.useForm('freightInfo', form);
74
95
  return (
75
96
  <div className="kts-invoice-operate-freight">