@bchr/bchr-front-lib 0.3.132 → 0.3.135

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.
@@ -48,7 +48,7 @@ window.AppFormulaFunctions = {
48
48
  datePlusMonths: function datePlusMonths(dateStr, during_months) {
49
49
  if (dateStr && during_months) {
50
50
  var baseDate = (0, _moment["default"])(dateStr, "YYYY-MM-DD");
51
- return baseDate.add(during_months, 'months').format("YYYY-MM-DD");
51
+ return baseDate.add(during_months, 'months').subtract(1, 'days').format("YYYY-MM-DD");
52
52
  }
53
53
 
54
54
  return null;
@@ -61,6 +61,33 @@ window.AppFormulaFunctions = {
61
61
 
62
62
  return null;
63
63
  },
64
+ getDateValueByDate: function getDateValueByDate(dateStr) {
65
+ if (dateStr) {
66
+ return dateStr;
67
+ }
68
+
69
+ return null;
70
+ },
71
+ calcOtherWaByBaseWa: function calcOtherWaByBaseWa(baseWa, percent, calcType) {
72
+ if (!baseWa || !percent) {
73
+ console.log("calcOtherWaByBaseWa param baseWa: " + baseWa + ",percent" + percent);
74
+ return null;
75
+ }
76
+
77
+ var wa = Math.floor(parseFloat(baseWa * 100 * percent));
78
+
79
+ if (!calcType) {
80
+ calcType = 3;
81
+ }
82
+
83
+ if (calcType == 1) {
84
+ return Math.ceil(wa) / 100; //向上取整
85
+ } else if (calcType == 2) {
86
+ return Math.floor(wa) / 100; //向下取整
87
+ } else {
88
+ return Math.round(wa) / 100; //四舍五入
89
+ }
90
+ },
64
91
  //生活补贴标准级别
65
92
  lifeBTLevel: function lifeBTLevel(execute_wa_grade_pk, work_place_pk) {
66
93
  if (!execute_wa_grade_pk || !work_place_pk) {
@@ -90,8 +90,12 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
90
90
  return item.belong_form_group === groupName && !item.b_show_infoset_field_group;
91
91
  }).map(function (item, index) {
92
92
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
93
- lg: 12,
94
- md: 24,
93
+ xs: _this.xs,
94
+ sm: _this.sm,
95
+ md: _this.md,
96
+ lg: _this.lg,
97
+ xl: _this.xl,
98
+ xxl: _this.xxl,
95
99
  key: "ext_col_" + index
96
100
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
97
101
  className: "ant-form-item-group-" + _this.props.label_col + (item.className ? " " + item.className : ""),
@@ -113,8 +117,12 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
113
117
  return !item.b_show_infoset_field_group;
114
118
  }).map(function (item, index) {
115
119
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
116
- lg: 12,
117
- md: 24,
120
+ xs: _this.xs,
121
+ sm: _this.sm,
122
+ md: _this.md,
123
+ lg: _this.lg,
124
+ xl: _this.xl,
125
+ xxl: _this.xxl,
118
126
  key: "ext_col_" + index
119
127
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
120
128
  className: "ant-form-item-group-" + _this.props.label_col + (item.className ? " " + item.className : ""),
@@ -304,8 +312,12 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
304
312
  _defineProperty(_assertThisInitialized(_this), "generatorFormItem", function (dataItem, is_ext_field) {
305
313
  if (is_ext_field) {
306
314
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
307
- lg: 12,
308
- md: 24,
315
+ xs: _this.xs,
316
+ sm: _this.sm,
317
+ md: _this.md,
318
+ lg: _this.lg,
319
+ xl: _this.xl,
320
+ xxl: _this.xxl,
309
321
  key: "ext_col_" + dataItem.code
310
322
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
311
323
  className: "ant-form-item-group-" + _this.props.label_col + (dataItem.className ? " " + dataItem.className : ""),
@@ -400,8 +412,12 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
400
412
  }
401
413
 
402
414
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
403
- lg: 12,
404
- md: 24,
415
+ xs: _this.xs,
416
+ sm: _this.sm,
417
+ md: _this.md,
418
+ lg: _this.lg,
419
+ xl: _this.xl,
420
+ xxl: _this.xxl,
405
421
  key: "col_" + code
406
422
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
407
423
  className: "ant-form-item-group-" + _this.props.label_col,
@@ -451,6 +467,12 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
451
467
  });
452
468
 
453
469
  _this.ref = _this.props.formref || /*#__PURE__*/_react["default"].createRef();
470
+ _this.xs = _this.props.xs || 24;
471
+ _this.sm = _this.props.sm || 24;
472
+ _this.md = _this.props.md || 24;
473
+ _this.lg = _this.props.lg || 12;
474
+ _this.xl = _this.props.xl || 12;
475
+ _this.xxl = _this.props.xxl || 12;
454
476
  return _this;
455
477
  }
456
478
 
@@ -110,8 +110,12 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
110
110
  return item.belong_form_group === groupName && !item.b_show_infoset_field_group;
111
111
  }).map(function (item, index) {
112
112
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
113
- lg: 12,
114
- md: 24,
113
+ xs: _this2.xs,
114
+ sm: _this2.sm,
115
+ md: _this2.md,
116
+ lg: _this2.lg,
117
+ xl: _this2.xl,
118
+ xxl: _this2.xxl,
115
119
  key: "ext_col_" + index
116
120
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
117
121
  className: "ant-form-item-group-" + _this2.props.label_col + (item.className ? " " + item.className : ""),
@@ -133,8 +137,12 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
133
137
  return !item.b_show_infoset_field_group;
134
138
  }).map(function (item, index) {
135
139
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
136
- lg: 12,
137
- md: 24,
140
+ xs: _this2.xs,
141
+ sm: _this2.sm,
142
+ md: _this2.md,
143
+ lg: _this2.lg,
144
+ xl: _this2.xl,
145
+ xxl: _this2.xxl,
138
146
  key: "ext_col_" + index
139
147
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
140
148
  className: "ant-form-item-group-" + _this2.props.label_col + (item.className ? " " + item.className : ""),
@@ -327,8 +335,12 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
327
335
 
328
336
  if (is_ext_field) {
329
337
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
330
- lg: 12,
331
- md: 24,
338
+ xs: _this2.xs,
339
+ sm: _this2.sm,
340
+ md: _this2.md,
341
+ lg: _this2.lg,
342
+ xl: _this2.xl,
343
+ xxl: _this2.xxl,
332
344
  key: "ext_col_" + dataItem.code
333
345
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
334
346
  className: "ant-form-item-group-" + _this2.props.label_col + (dataItem.className ? " " + dataItem.className : ""),
@@ -602,8 +614,12 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
602
614
  }
603
615
 
604
616
  return /*#__PURE__*/_react["default"].createElement(_antd.Col, {
605
- lg: 12,
606
- md: 24,
617
+ xs: _this2.xs,
618
+ sm: _this2.sm,
619
+ md: _this2.md,
620
+ lg: _this2.lg,
621
+ xl: _this2.xl,
622
+ xxl: _this2.xxl,
607
623
  id: "ant_form_item_".concat(code),
608
624
  key: "col_" + code
609
625
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
@@ -879,6 +895,12 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
879
895
  });
880
896
 
881
897
  _this2.ref = _this2.props.formref || /*#__PURE__*/_react["default"].createRef();
898
+ _this2.xs = _this2.props.xs || 24;
899
+ _this2.sm = _this2.props.sm || 24;
900
+ _this2.md = _this2.props.md || 24;
901
+ _this2.lg = _this2.props.lg || 12;
902
+ _this2.xl = _this2.props.xl || 12;
903
+ _this2.xxl = _this2.props.xxl || 12;
882
904
  _this2.state = {
883
905
  fieldCodeKeyMap: {}
884
906
  };
@@ -1127,13 +1149,13 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
1127
1149
  this.props.data[display_code] = display_value;
1128
1150
  }
1129
1151
 
1130
- if (value) {
1131
- this.formItemOnChangeForFormula(config, value);
1132
- }
1133
-
1134
1152
  if (callback && typeof callback === "function") {
1135
1153
  callback(value, option);
1136
1154
  }
1155
+
1156
+ if (value) {
1157
+ this.formItemOnChangeForFormula(config, value);
1158
+ }
1137
1159
  }
1138
1160
  }, {
1139
1161
  key: "buildTreeData",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.3.132",
3
+ "version": "0.3.135",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -50,7 +50,7 @@ window.AppFormulaFunctions = {
50
50
  datePlusMonths : function (dateStr, during_months) {
51
51
  if (dateStr && during_months) {
52
52
  let baseDate = moment(dateStr, "YYYY-MM-DD");
53
- return baseDate.add(during_months, 'months').format("YYYY-MM-DD")
53
+ return baseDate.add(during_months, 'months').subtract(1, 'days').format("YYYY-MM-DD")
54
54
  }
55
55
 
56
56
  return null;
@@ -65,6 +65,35 @@ window.AppFormulaFunctions = {
65
65
  return null;
66
66
  },
67
67
 
68
+ getDateValueByDate(dateStr) {
69
+ if (dateStr) {
70
+ return dateStr;
71
+ }
72
+
73
+ return null;
74
+ },
75
+
76
+ calcOtherWaByBaseWa(baseWa, percent, calcType) {
77
+ if (!baseWa || !percent) {
78
+ console.log("calcOtherWaByBaseWa param baseWa: " + baseWa + ",percent" + percent);
79
+ return null;
80
+ }
81
+
82
+ let wa = Math.floor(parseFloat(baseWa * 100 * percent));
83
+
84
+ if (!calcType) {
85
+ calcType = 3;
86
+ }
87
+
88
+ if (calcType == 1) {
89
+ return Math.ceil(wa)/100; //向上取整
90
+ } else if (calcType == 2) {
91
+ return Math.floor(wa)/100; //向下取整
92
+ } else {
93
+ return Math.round(wa)/100; //四舍五入
94
+ }
95
+ },
96
+
68
97
  //生活补贴标准级别
69
98
  lifeBTLevel : function (execute_wa_grade_pk, work_place_pk) {
70
99
  if (!execute_wa_grade_pk || !work_place_pk) {
@@ -11,6 +11,12 @@ class FormForBrowse extends React.Component{
11
11
  super(props);
12
12
 
13
13
  this.ref = this.props.formref || React.createRef();
14
+ this.xs = this.props.xs || 24;
15
+ this.sm = this.props.sm || 24;
16
+ this.md = this.props.md || 24;
17
+ this.lg = this.props.lg || 12;
18
+ this.xl = this.props.xl || 12;
19
+ this.xxl = this.props.xxl || 12;
14
20
  }
15
21
 
16
22
  componentDidMount() {
@@ -45,7 +51,7 @@ class FormForBrowse extends React.Component{
45
51
  {
46
52
  ext_form_items.filter(item => item.belong_form_group === groupName && !item.b_show_infoset_field_group).map((item, index) => {
47
53
  return (
48
- <Col lg={12} md={24} key={"ext_col_" + index}>
54
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + index}>
49
55
  {
50
56
  <Form.Item
51
57
  className={("ant-form-item-group-" + this.props.label_col) + (item.className ? " " + item.className : "")}
@@ -73,7 +79,7 @@ class FormForBrowse extends React.Component{
73
79
  {
74
80
  ext_form_items.filter(item => !item.b_show_infoset_field_group).map((item, index) => {
75
81
  return (
76
- <Col lg={12} md={24} key={"ext_col_" + index}>
82
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + index}>
77
83
  {
78
84
  <Form.Item
79
85
  className={("ant-form-item-group-" + this.props.label_col) + (item.className ? " " + item.className : "")}
@@ -276,7 +282,7 @@ class FormForBrowse extends React.Component{
276
282
  if (is_ext_field) {
277
283
 
278
284
  return (
279
- <Col lg={12} md={24} key={"ext_col_" + dataItem.code}>
285
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + dataItem.code}>
280
286
  {
281
287
  <Form.Item
282
288
  className={("ant-form-item-group-" + this.props.label_col) + (dataItem.className ? " " + dataItem.className : "")}
@@ -371,7 +377,7 @@ class FormForBrowse extends React.Component{
371
377
  }
372
378
 
373
379
  return (
374
- <Col lg={12} md={24} key={"col_" + code}>
380
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"col_" + code}>
375
381
  <Form.Item
376
382
  className={"ant-form-item-group-" + this.props.label_col}
377
383
  key={dataItem.code}
@@ -38,6 +38,13 @@ class FormForModify extends React.Component{
38
38
 
39
39
  this.ref = this.props.formref || React.createRef();
40
40
 
41
+ this.xs = this.props.xs || 24;
42
+ this.sm = this.props.sm || 24;
43
+ this.md = this.props.md || 24;
44
+ this.lg = this.props.lg || 12;
45
+ this.xl = this.props.xl || 12;
46
+ this.xxl = this.props.xxl || 12;
47
+
41
48
  this.state = {
42
49
  fieldCodeKeyMap: {},
43
50
  }
@@ -114,7 +121,7 @@ class FormForModify extends React.Component{
114
121
  {
115
122
  ext_form_items.filter(item => item.belong_form_group === groupName && !item.b_show_infoset_field_group).map((item, index) => {
116
123
  return (
117
- <Col lg={12} md={24} key={"ext_col_" + index}>
124
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + index}>
118
125
  {
119
126
  <Form.Item
120
127
  className={("ant-form-item-group-" + this.props.label_col) + (item.className ? " " + item.className : "")}
@@ -143,7 +150,7 @@ class FormForModify extends React.Component{
143
150
  {
144
151
  ext_form_items.filter(item => !item.b_show_infoset_field_group).map((item, index) => {
145
152
  return (
146
- <Col lg={12} md={24} key={"ext_col_" + index}>
153
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + index}>
147
154
  {
148
155
  <Form.Item
149
156
  className={("ant-form-item-group-" + this.props.label_col) + (item.className ? " " + item.className : "")}
@@ -319,7 +326,7 @@ class FormForModify extends React.Component{
319
326
 
320
327
  if (is_ext_field) {
321
328
  return (
322
- <Col lg={12} md={24} key={"ext_col_" + dataItem.code}>
329
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} key={"ext_col_" + dataItem.code}>
323
330
  {
324
331
  <Form.Item
325
332
  className={("ant-form-item-group-" + this.props.label_col) + (dataItem.className ? " " + dataItem.className : "")}
@@ -702,7 +709,7 @@ class FormForModify extends React.Component{
702
709
  }
703
710
 
704
711
  return (
705
- <Col lg={12} md={24} id={`ant_form_item_${code}`} key={"col_" + code}>
712
+ <Col xs={this.xs} sm={this.sm} md={this.md} lg={this.lg} xl={this.xl} xxl={this.xxl} id={`ant_form_item_${code}`} key={"col_" + code}>
706
713
  <Form.Item
707
714
  className={(b_readonly ? "readonly-form-ant-col " : " ") + " ant-form-item-group-" + this.props.label_col}
708
715
  key={code}
@@ -969,13 +976,13 @@ class FormForModify extends React.Component{
969
976
  this.props.data[display_code] = display_value;
970
977
  }
971
978
 
972
- if (value) {
973
- this.formItemOnChangeForFormula(config, value)
974
- }
975
-
976
979
  if (callback && typeof callback === "function") {
977
980
  callback(value, option);
978
981
  }
982
+
983
+ if (value) {
984
+ this.formItemOnChangeForFormula(config, value)
985
+ }
979
986
  }
980
987
 
981
988
  buildTreeData(selectedNodes) {