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.
@@ -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:
@@ -153,6 +153,9 @@ export default {
153
153
  nav2Home() {
154
154
  this.$router.push({ path: this.home });
155
155
  },
156
+ getUserInfo() {
157
+ return this.formdata;
158
+ }
156
159
  },
157
160
  };
158
161
  </script>
@@ -121,8 +121,10 @@ export default {
121
121
  },
122
122
  roleLoadFinished() {
123
123
  if (this.isShowRoleList) {
124
- let uid = this.currentItem.id;
125
- this.$refs.roleComponent.fillCheckboxStatus(uid);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.5.86",
3
+ "version": "0.5.88",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",