@bchr/bchr-front-lib 0.3.136 → 0.3.139

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.
@@ -68,24 +68,37 @@ window.AppFormulaFunctions = {
68
68
 
69
69
  return null;
70
70
  },
71
- calcOtherWaByBaseWa: function calcOtherWaByBaseWa(baseWa, percent, calcType) {
71
+
72
+ /**
73
+ * 根据基本工资计算其他工资项
74
+ * @param baseWa 级别薪资
75
+ * @param percent 百分比
76
+ * @param digitsNum 保留小数点后几位 (默认0)
77
+ * @param calcType 计算方式(默认向上取整)
78
+ * @returns {null|number}
79
+ */
80
+ calcOtherWaByBaseWa: function calcOtherWaByBaseWa(baseWa, percent, digitsNum, calcType) {
72
81
  if (!baseWa || !percent) {
73
82
  console.log("calcOtherWaByBaseWa param baseWa: " + baseWa + ",percent" + percent);
74
83
  return null;
75
84
  }
76
85
 
77
- var wa = Math.floor(parseFloat(baseWa * 100 * percent));
86
+ if (!digitsNum) {
87
+ digitsNum = 0;
88
+ }
89
+
90
+ var wa = parseFloat(baseWa * Math.pow(10, digitsNum) * percent);
78
91
 
79
92
  if (!calcType) {
80
93
  calcType = 3;
81
94
  }
82
95
 
83
96
  if (calcType == 1) {
84
- return Math.ceil(wa) / 100; //向上取整
97
+ return Math.round(wa) / Math.pow(10, digitsNum); //四舍五入
85
98
  } else if (calcType == 2) {
86
- return Math.floor(wa) / 100; //向下取整
99
+ return Math.floor(wa) / Math.pow(10, digitsNum); //向下取整
87
100
  } else {
88
- return Math.round(wa) / 100; //四舍五入
101
+ return Math.ceil(wa) / Math.pow(10, digitsNum); //向上取整
89
102
  }
90
103
  },
91
104
  //生活补贴标准级别
@@ -82,6 +82,7 @@ var showInfo = function showInfo(options) {
82
82
  content: options.content,
83
83
  okText: options.okText,
84
84
  zIndex: options.zIndex,
85
+ closable: options.closable,
85
86
  onOk: function onOk() {
86
87
  options.okCallback ? options.okCallback() : function () {};
87
88
  }
@@ -99,6 +100,7 @@ var showSuccess = function showSuccess(options) {
99
100
  content: options.content,
100
101
  okText: options.okText,
101
102
  zIndex: options.zIndex,
103
+ closable: options.closable,
102
104
  onOk: function onOk() {
103
105
  options.okCallback ? options.okCallback() : function () {};
104
106
  }
@@ -116,6 +118,7 @@ var showError = function showError(options) {
116
118
  content: options.content,
117
119
  okText: options.okText,
118
120
  zIndex: options.zIndex,
121
+ closable: options.closable,
119
122
  onOk: function onOk() {
120
123
  options.okCallback ? options.okCallback() : function () {};
121
124
  }
@@ -133,6 +136,7 @@ var showWarn = function showWarn(options) {
133
136
  content: options.content,
134
137
  okText: options.okText,
135
138
  zIndex: options.zIndex,
139
+ closable: options.closable,
136
140
  onOk: function onOk() {
137
141
  options.okCallback ? options.okCallback() : function () {};
138
142
  }
@@ -152,6 +156,7 @@ var showAutoCloseInfo = function showAutoCloseInfo(options) {
152
156
  content: "".concat(timeOut, "\u79D2\u540E\u81EA\u52A8\u5173\u95ED"),
153
157
  okText: options.okText,
154
158
  zIndex: options.zIndex,
159
+ closable: options.closable,
155
160
  onOk: function onOk() {
156
161
  options.okCallback ? options.okCallback() : function () {};
157
162
  }
@@ -177,6 +182,7 @@ var showAutoCloseSuccess = function showAutoCloseSuccess(options) {
177
182
  content: "".concat(timeOut, "\u79D2\u540E\u81EA\u52A8\u5173\u95ED"),
178
183
  okText: options.okText,
179
184
  zIndex: options.zIndex,
185
+ closable: options.closable,
180
186
  onOk: function onOk() {
181
187
  options.okCallback ? options.okCallback() : function () {};
182
188
  }
@@ -202,6 +208,7 @@ var showAutoCloseError = function showAutoCloseError(options) {
202
208
  content: "".concat(timeOut, "\u79D2\u540E\u81EA\u52A8\u5173\u95ED"),
203
209
  okText: options.okText,
204
210
  zIndex: options.zIndex,
211
+ closable: options.closable,
205
212
  onOk: function onOk() {
206
213
  options.okCallback ? options.okCallback() : function () {};
207
214
  }
@@ -227,6 +234,7 @@ var showAutoCloseWarn = function showAutoCloseWarn(options) {
227
234
  content: "".concat(timeOut, "\u79D2\u540E\u81EA\u52A8\u5173\u95ED"),
228
235
  okText: options.okText,
229
236
  zIndex: options.zIndex,
237
+ closable: options.closable,
230
238
  onOk: function onOk() {
231
239
  options.okCallback ? options.okCallback() : function () {};
232
240
  }
@@ -1238,6 +1238,10 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
1238
1238
  if (callback && typeof callback === "function") {
1239
1239
  callback(value, label, extra, ref);
1240
1240
  }
1241
+
1242
+ if (value) {
1243
+ this.formItemOnChangeForFormula(config, value);
1244
+ }
1241
1245
  }
1242
1246
  }, {
1243
1247
  key: "showModal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.3.136",
3
+ "version": "0.3.139",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -49,3 +49,4 @@
49
49
  "react-loadable": "^5.5.0"
50
50
  }
51
51
  }
52
+
@@ -73,24 +73,36 @@ window.AppFormulaFunctions = {
73
73
  return null;
74
74
  },
75
75
 
76
- calcOtherWaByBaseWa(baseWa, percent, calcType) {
76
+ /**
77
+ * 根据基本工资计算其他工资项
78
+ * @param baseWa 级别薪资
79
+ * @param percent 百分比
80
+ * @param digitsNum 保留小数点后几位 (默认0)
81
+ * @param calcType 计算方式(默认向上取整)
82
+ * @returns {null|number}
83
+ */
84
+ calcOtherWaByBaseWa(baseWa, percent, digitsNum, calcType) {
77
85
  if (!baseWa || !percent) {
78
86
  console.log("calcOtherWaByBaseWa param baseWa: " + baseWa + ",percent" + percent);
79
87
  return null;
80
88
  }
81
89
 
82
- let wa = Math.floor(parseFloat(baseWa * 100 * percent));
90
+ if (!digitsNum) {
91
+ digitsNum = 0;
92
+ }
93
+
94
+ let wa = parseFloat(baseWa * Math.pow(10, digitsNum) * percent);
83
95
 
84
96
  if (!calcType) {
85
97
  calcType = 3;
86
98
  }
87
99
 
88
100
  if (calcType == 1) {
89
- return Math.ceil(wa)/100; //向上取整
101
+ return Math.round(wa)/Math.pow(10, digitsNum); //四舍五入
90
102
  } else if (calcType == 2) {
91
- return Math.floor(wa)/100; //向下取整
103
+ return Math.floor(wa)/Math.pow(10, digitsNum); //向下取整
92
104
  } else {
93
- return Math.round(wa)/100; //四舍五入
105
+ return Math.ceil(wa)/Math.pow(10, digitsNum); //向上取整
94
106
  }
95
107
  },
96
108
 
@@ -77,6 +77,7 @@ const showInfo = function(options) {
77
77
  content: options.content,
78
78
  okText: options.okText,
79
79
  zIndex: options.zIndex,
80
+ closable: options.closable,
80
81
  onOk() {
81
82
  options.okCallback ? options.okCallback() : function () {}
82
83
  },
@@ -94,6 +95,7 @@ const showSuccess = function(options) {
94
95
  content: options.content,
95
96
  okText: options.okText,
96
97
  zIndex: options.zIndex,
98
+ closable: options.closable,
97
99
  onOk() {
98
100
  options.okCallback ? options.okCallback() : function () {}
99
101
  },
@@ -111,6 +113,7 @@ const showError = function(options) {
111
113
  content: options.content,
112
114
  okText: options.okText,
113
115
  zIndex: options.zIndex,
116
+ closable: options.closable,
114
117
  onOk() {
115
118
  options.okCallback ? options.okCallback() : function () {}
116
119
  },
@@ -128,6 +131,7 @@ const showWarn = function(options) {
128
131
  content: options.content,
129
132
  okText: options.okText,
130
133
  zIndex: options.zIndex,
134
+ closable: options.closable,
131
135
  onOk() {
132
136
  options.okCallback ? options.okCallback() : function () {}
133
137
  },
@@ -147,6 +151,7 @@ const showAutoCloseInfo = function(options) {
147
151
  content: `${timeOut}秒后自动关闭`,
148
152
  okText: options.okText,
149
153
  zIndex: options.zIndex,
154
+ closable: options.closable,
150
155
  onOk() {
151
156
  options.okCallback ? options.okCallback() : function () {}
152
157
  },
@@ -171,6 +176,7 @@ const showAutoCloseSuccess = function(options) {
171
176
  content: `${timeOut}秒后自动关闭`,
172
177
  okText: options.okText,
173
178
  zIndex: options.zIndex,
179
+ closable: options.closable,
174
180
  onOk() {
175
181
  options.okCallback ? options.okCallback() : function () {}
176
182
  },
@@ -195,6 +201,7 @@ const showAutoCloseError = function(options) {
195
201
  content: `${timeOut}秒后自动关闭`,
196
202
  okText: options.okText,
197
203
  zIndex: options.zIndex,
204
+ closable: options.closable,
198
205
  onOk() {
199
206
  options.okCallback ? options.okCallback() : function () {}
200
207
  },
@@ -219,6 +226,7 @@ const showAutoCloseWarn = function(options) {
219
226
  content: `${timeOut}秒后自动关闭`,
220
227
  okText: options.okText,
221
228
  zIndex: options.zIndex,
229
+ closable: options.closable,
222
230
  onOk() {
223
231
  options.okCallback ? options.okCallback() : function () {}
224
232
  },
@@ -1058,6 +1058,10 @@ class FormForModify extends React.Component{
1058
1058
  if (callback && typeof callback === "function") {
1059
1059
  callback(value, label, extra, ref);
1060
1060
  }
1061
+
1062
+ if (value) {
1063
+ this.formItemOnChangeForFormula(config, value)
1064
+ }
1061
1065
  }
1062
1066
 
1063
1067
  showModal(config) {