doway-coms 2.11.66 → 2.11.67
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/package.json
CHANGED
|
@@ -219,10 +219,9 @@
|
|
|
219
219
|
size="small"
|
|
220
220
|
@change="cellValueChange(scope)"
|
|
221
221
|
v-model="scope.row[scope.column.property]"
|
|
222
|
-
:
|
|
223
|
-
:
|
|
224
|
-
:
|
|
225
|
-
:max="scope.column.numberMax"
|
|
222
|
+
:max="scope.column.params.max"
|
|
223
|
+
:min="scope.column.params.min"
|
|
224
|
+
:precision="scope.column.params.precision"
|
|
226
225
|
:disabled="editDisabled(scope)"
|
|
227
226
|
:step="scope.column.params.step"
|
|
228
227
|
/>
|
|
@@ -2182,6 +2181,16 @@ export default {
|
|
|
2182
2181
|
if (originCol.rules) {
|
|
2183
2182
|
this.validRules[colInfo.field] = originCol.rules
|
|
2184
2183
|
}
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
// if (XEUtils.isNumber(originCol.min)) {
|
|
2187
|
+
// colParams['min'] =(XEUtils.isNumber(originCol.min)?originCol.min:'Infinity'
|
|
2188
|
+
// }
|
|
2189
|
+
// if (XEUtils.isNumber(originCol.max)) {
|
|
2190
|
+
// colParams['max'] = originCol.max
|
|
2191
|
+
// }
|
|
2192
|
+
colParams['max'] =XEUtils.isNumber(originCol.max)?originCol.max:'Infinity'
|
|
2193
|
+
colParams['min'] =XEUtils.isNumber(originCol.min)?originCol.min:'-Infinity'
|
|
2185
2194
|
if (originCol.precision) {
|
|
2186
2195
|
colParams['precision'] = originCol.precision
|
|
2187
2196
|
//加入验证逻辑
|
|
@@ -2192,12 +2201,8 @@ export default {
|
|
|
2192
2201
|
// validator: this.validPrecision
|
|
2193
2202
|
// })
|
|
2194
2203
|
}
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
}
|
|
2198
|
-
if (XEUtils.isInteger(originCol.max)) {
|
|
2199
|
-
colParams['max'] = originCol.max
|
|
2200
|
-
}
|
|
2204
|
+
|
|
2205
|
+
|
|
2201
2206
|
// else{
|
|
2202
2207
|
// colParams['precision'] = 10 //默认十位小数
|
|
2203
2208
|
// }
|
|
@@ -4025,17 +4030,18 @@ export default {
|
|
|
4025
4030
|
)
|
|
4026
4031
|
if (!reg.test(value)) {
|
|
4027
4032
|
//小数点验证不通过
|
|
4028
|
-
|
|
4033
|
+
console.debug('验证不通过',value)
|
|
4029
4034
|
returnValue = XEUtils.floor(value, tempPrecision)
|
|
4030
4035
|
}
|
|
4036
|
+
console.debug('returnValue',returnValue, XEUtils.toNumber(returnValue))
|
|
4031
4037
|
if (
|
|
4032
|
-
XEUtils.
|
|
4038
|
+
XEUtils.isNumber(scope.column.params.max) &&
|
|
4033
4039
|
XEUtils.toNumber(returnValue) > scope.column.params.max
|
|
4034
4040
|
) {
|
|
4035
4041
|
returnValue = scope.column.params.max
|
|
4036
4042
|
}
|
|
4037
4043
|
if (
|
|
4038
|
-
XEUtils.
|
|
4044
|
+
XEUtils.isNumber(scope.column.params.min) &&
|
|
4039
4045
|
XEUtils.toNumber(returnValue) < scope.column.params.min
|
|
4040
4046
|
) {
|
|
4041
4047
|
returnValue = scope.column.params.min
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
:placeholder="placeholder"
|
|
34
34
|
:formatter="numberFormatter"
|
|
35
35
|
:parser="numberParse"
|
|
36
|
+
:max="max"
|
|
37
|
+
:min="min"
|
|
38
|
+
:precision="precision"
|
|
36
39
|
style="width: 100%"
|
|
37
40
|
:class="{ 'd-error-input': v.errors.length > 0 }"
|
|
38
41
|
/>
|
|
@@ -46,6 +49,9 @@
|
|
|
46
49
|
:placeholder="placeholder"
|
|
47
50
|
:formatter="numberFormatter"
|
|
48
51
|
:parser="numberParse"
|
|
52
|
+
:max="max"
|
|
53
|
+
:min="min"
|
|
54
|
+
:precision="precision"
|
|
49
55
|
style="width: 100%"
|
|
50
56
|
:class="{ 'd-error-input': v.errors.length > 0 }"
|
|
51
57
|
/>
|
|
@@ -220,11 +226,12 @@ export default {
|
|
|
220
226
|
numberFormatter(value) {
|
|
221
227
|
// 百分比格式化
|
|
222
228
|
if (this.percent) {
|
|
223
|
-
if (this.precision) {
|
|
224
|
-
return XEUtils.round(value, this.precision) + "%";
|
|
225
|
-
} else {
|
|
226
229
|
return value + "%";
|
|
227
|
-
|
|
230
|
+
// if (this.precision) {
|
|
231
|
+
// return XEUtils.round(value, this.precision) + "%";
|
|
232
|
+
// } else {
|
|
233
|
+
// return value + "%";
|
|
234
|
+
// }
|
|
228
235
|
}
|
|
229
236
|
return value;
|
|
230
237
|
},
|
|
@@ -233,35 +240,36 @@ export default {
|
|
|
233
240
|
if (this.percent) {
|
|
234
241
|
value.replace("%", "");
|
|
235
242
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
let
|
|
241
|
-
let
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
243
|
+
return value
|
|
244
|
+
// if (value === null || value === "") {
|
|
245
|
+
// return value;
|
|
246
|
+
// }
|
|
247
|
+
// let returnValue = value;
|
|
248
|
+
// let tempPrecision = XEUtils.toNumber(this.precision);
|
|
249
|
+
// let reg = new RegExp(
|
|
250
|
+
// "^((-?)|(-?([1-9]{1}\\d*)|-?([0]{1})))(\\.(\\d){0," +
|
|
251
|
+
// tempPrecision +
|
|
252
|
+
// "})?$"
|
|
253
|
+
// );
|
|
254
|
+
// if (!reg.test(value)) {
|
|
255
|
+
// //小数点验证不通过
|
|
256
|
+
// returnValue = XEUtils.floor(value, tempPrecision);
|
|
257
|
+
// }
|
|
258
|
+
// if (
|
|
259
|
+
// this.max !== null &&
|
|
260
|
+
// this.max !== undefined &&
|
|
261
|
+
// XEUtils.toNumber(returnValue) > this.max
|
|
262
|
+
// ) {
|
|
263
|
+
// returnValue = this.max;
|
|
264
|
+
// }
|
|
265
|
+
// if (
|
|
266
|
+
// this.min !== null &&
|
|
267
|
+
// this.min !== undefined &&
|
|
268
|
+
// XEUtils.toNumber(returnValue) < this.min
|
|
269
|
+
// ) {
|
|
270
|
+
// returnValue = this.min;
|
|
271
|
+
// }
|
|
272
|
+
// return returnValue;
|
|
265
273
|
},
|
|
266
274
|
getFormatValue(value) {
|
|
267
275
|
if (this.percent) {
|