kts-component-invoice-operate 3.2.149 → 3.2.150

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
@@ -22969,15 +22969,16 @@ var MyArrMoment = /*#__PURE__*/function (_React$Component3) {
22969
22969
  _createClass(MyArrMoment, [{
22970
22970
  key: "render",
22971
22971
  value: function render() {
22972
- var _this$props$value2;
22973
-
22972
+ var _this$props$value2 = this.props.value,
22973
+ value = _this$props$value2 === void 0 ? [] : _this$props$value2;
22974
22974
  return /*#__PURE__*/React.createElement("div", {
22975
22975
  style: this.props.style
22976
- }, (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.map(function (e) {
22977
- return hooks.isMoment(e) && e.format('YYYY-MM-DD');
22978
- }).filter(function (e) {
22979
- return !!e;
22980
- }).join(' - '));
22976
+ }, /*#__PURE__*/React.createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React.createElement("span", {
22977
+ style: {
22978
+ color: '#9F603D',
22979
+ fontWeight: 600
22980
+ }
22981
+ }, " - "), /*#__PURE__*/React.createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
22981
22982
  }
22982
22983
  }]);
22983
22984
 
package/dist/index.js CHANGED
@@ -22979,15 +22979,16 @@ var MyArrMoment = /*#__PURE__*/function (_React$Component3) {
22979
22979
  _createClass(MyArrMoment, [{
22980
22980
  key: "render",
22981
22981
  value: function render() {
22982
- var _this$props$value2;
22983
-
22982
+ var _this$props$value2 = this.props.value,
22983
+ value = _this$props$value2 === void 0 ? [] : _this$props$value2;
22984
22984
  return /*#__PURE__*/React__default['default'].createElement("div", {
22985
22985
  style: this.props.style
22986
- }, (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.map(function (e) {
22987
- return hooks.isMoment(e) && e.format('YYYY-MM-DD');
22988
- }).filter(function (e) {
22989
- return !!e;
22990
- }).join(' - '));
22986
+ }, /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[0]) && value[0].format('YYYY-MM-DD')), /*#__PURE__*/React__default['default'].createElement("span", {
22987
+ style: {
22988
+ color: '#9F603D',
22989
+ fontWeight: 600
22990
+ }
22991
+ }, " - "), /*#__PURE__*/React__default['default'].createElement("span", null, hooks.isMoment(value[1]) && value[0].format('YYYY-MM-DD')));
22991
22992
  }
22992
22993
  }]);
22993
22994
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.149",
3
+ "version": "3.2.150",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -1,11 +1,22 @@
1
1
  import React from 'react';
2
2
  import Invoice from '../../..';
3
+ import moment from 'moment';
3
4
  import 'antd/dist/antd.css';
4
5
 
5
6
  export default () => {
7
+
8
+ const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
9
+
10
+ React.useEffect(() => {
11
+ controller.run(async s => {
12
+ s.model = 'readOnly'
13
+ })
14
+ }, [])
15
+
6
16
  return (
7
17
  <Invoice
8
18
  invoiceType='digtal'
19
+ controller={controller}
9
20
  specialInfor={<Invoice.RealEstateInfo />}
10
21
  />
11
22
  )
@@ -184,13 +184,12 @@ class MyArrString extends React.Component<{ value?: string[], style?: React.CSSP
184
184
 
185
185
  class MyArrMoment extends React.Component<{ value?: moment.Moment[], style?: React.CSSProperties }> {
186
186
  render(): React.ReactNode {
187
+ const { value = [] } = this.props
187
188
  return (
188
189
  <div style={this.props.style}>
189
- {
190
- this.props.value?.map(e => moment.isMoment(e) && e.format('YYYY-MM-DD'))
191
- .filter(e => !!e)
192
- .join(' - ')
193
- }
190
+ <span>{moment.isMoment(value[0]) && value[0].format('YYYY-MM-DD')}</span>
191
+ <span style={{ color: '#9F603D', fontWeight: 600 }} > - </span>
192
+ <span>{moment.isMoment(value[1]) && value[0].format('YYYY-MM-DD')}</span>
194
193
  </div>
195
194
  )
196
195
  }