leisure-core 0.5.86 → 0.5.88
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/le-list/src/main.vue +20 -0
- package/le-login/src/main.vue +3 -0
- package/le-role-user/src/main.vue +4 -2
- package/package.json +1 -1
package/le-list/src/main.vue
CHANGED
|
@@ -319,13 +319,33 @@ export default {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
case "currency":
|
|
322
|
+
// if (value == null || value === "") return "";
|
|
323
|
+
// const num = parseFloat(value);
|
|
324
|
+
// if (isNaN(num)) return value;
|
|
325
|
+
|
|
326
|
+
// return new Intl.NumberFormat("zh-CN", {
|
|
327
|
+
// style: "currency",
|
|
328
|
+
// currency: "CNY",
|
|
329
|
+
// minimumFractionDigits: 0, // 最少小数位数
|
|
330
|
+
// maximumFractionDigits: 4, // 最多小数位数
|
|
331
|
+
// }).format(num);
|
|
322
332
|
if (value == null || value === "") return "";
|
|
323
333
|
const num = parseFloat(value);
|
|
324
334
|
if (isNaN(num)) return value;
|
|
325
335
|
|
|
336
|
+
// 简单自适应:整数不显示小数,小数显示实际位数(最多4位)
|
|
337
|
+
const decimalPart = num.toString().split(".")[1];
|
|
338
|
+
const hasDecimal = decimalPart && decimalPart.length > 0;
|
|
339
|
+
|
|
326
340
|
return new Intl.NumberFormat("zh-CN", {
|
|
327
341
|
style: "currency",
|
|
328
342
|
currency: "CNY",
|
|
343
|
+
minimumFractionDigits: hasDecimal
|
|
344
|
+
? Math.min(decimalPart.length, 2)
|
|
345
|
+
: 0,
|
|
346
|
+
maximumFractionDigits: hasDecimal
|
|
347
|
+
? Math.min(decimalPart.length, 4)
|
|
348
|
+
: 0,
|
|
329
349
|
}).format(num);
|
|
330
350
|
|
|
331
351
|
default:
|
package/le-login/src/main.vue
CHANGED
|
@@ -121,8 +121,10 @@ export default {
|
|
|
121
121
|
},
|
|
122
122
|
roleLoadFinished() {
|
|
123
123
|
if (this.isShowRoleList) {
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
if (Object.keys(this.currentItem).length !== 0) {
|
|
125
|
+
let uid = this.currentItem.id;
|
|
126
|
+
this.$refs.roleComponent.fillCheckboxStatus(uid);
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
129
|
},
|
|
128
130
|
openEditWindow(item) {
|