sone-ui-component-3.2.4 2.1.40 → 2.1.41
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/Notice.md +106 -0
- package/lib/sone-ui.common.js +35 -13
- package/lib/sone-ui.common.js.map +1 -1
- package/lib/sone-ui.umd.js +35 -13
- package/lib/sone-ui.umd.js.map +1 -1
- package/lib/sone-ui.umd.min.js +2 -2
- package/lib/sone-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/inputNumber/src/main.vue +22 -0
- package/packages/table/src/mainNew.vue +4 -4
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -231,6 +231,7 @@ export default {
|
|
|
231
231
|
|
|
232
232
|
if (this.precision !== undefined) {
|
|
233
233
|
currentValue = this.toPrecision(currentValue, this.precision);
|
|
234
|
+
// currentValue = this.fixPrecision(currentValue, this.precision);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
this.$emit("updateDisplayValue", currentValue);
|
|
@@ -238,6 +239,27 @@ export default {
|
|
|
238
239
|
}
|
|
239
240
|
},
|
|
240
241
|
methods: {
|
|
242
|
+
fixPrecision(num, precision){
|
|
243
|
+
if(precision === 0) return num;
|
|
244
|
+
if(typeof num !== 'number') return num;
|
|
245
|
+
let val = num;
|
|
246
|
+
if(String(val).indexOf('.') === -1){
|
|
247
|
+
for(let i = 0; i < precision; i++){
|
|
248
|
+
if(i === 0){
|
|
249
|
+
val = val + '.0'
|
|
250
|
+
}else{
|
|
251
|
+
val = val + '0'
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}else{
|
|
255
|
+
let arr = String(val).split('.');
|
|
256
|
+
let newPrecision = precision - arr[1].length;
|
|
257
|
+
for(let i = 0; i < newPrecision; i++){
|
|
258
|
+
val = val + '0'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return val;
|
|
262
|
+
},
|
|
241
263
|
toPrecision(num, precision) {
|
|
242
264
|
if (num === "" || num === null || num === undefined) {
|
|
243
265
|
return "";
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
>
|
|
100
100
|
<template v-for="(item,index) in operation.buttonList">
|
|
101
101
|
<el-tooltip
|
|
102
|
-
:content="item.label"
|
|
102
|
+
:content="String(item.label)"
|
|
103
103
|
:key="index"
|
|
104
104
|
effect="light"
|
|
105
105
|
placement="top"
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
>
|
|
124
124
|
<template v-for="(item,index) in scope.row.buttonShow.filter(d=>d.isShow).slice(0,2)">
|
|
125
125
|
<el-tooltip
|
|
126
|
-
:content="operation.buttonList.find(d=>d.id===item.id).label"
|
|
126
|
+
:content="String(operation.buttonList.find(d=>d.id===item.id).label)"
|
|
127
127
|
:key="index"
|
|
128
128
|
effect="light"
|
|
129
129
|
placement="top"
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
>
|
|
177
177
|
<template v-for="(item,index) in operation.buttonList">
|
|
178
178
|
<el-tooltip
|
|
179
|
-
:content="item.label"
|
|
179
|
+
:content="String(item.label)"
|
|
180
180
|
:key="index"
|
|
181
181
|
effect="light"
|
|
182
182
|
placement="top"
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
>
|
|
199
199
|
<template v-for="(item,index) in operation.buttonList.slice(0,2)">
|
|
200
200
|
<el-tooltip
|
|
201
|
-
:content="item.label"
|
|
201
|
+
:content="String(item.label)"
|
|
202
202
|
:key="index"
|
|
203
203
|
effect="light"
|
|
204
204
|
placement="top"
|