leisure-core 0.5.87 → 0.5.89

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.
@@ -5,7 +5,9 @@
5
5
  <el-form-item>
6
6
  <div class="queryBtnClass">
7
7
  <slot></slot>
8
- <le-button type="primary" @click="onClickQuery()">查询</le-button>
8
+ <le-button type="primary" @click="onClickQuery()" v-if="isDispQBtn"
9
+ >查询</le-button
10
+ >
9
11
  <le-button type="primary" @click="addItem()" v-if="isDispAddBtn">{{
10
12
  addBtnText
11
13
  }}</le-button>
@@ -138,6 +140,10 @@ export default {
138
140
  type: Boolean,
139
141
  default: true,
140
142
  },
143
+ isDispQBtn: {
144
+ type: Boolean,
145
+ default: true,
146
+ },
141
147
  addBtnText: {
142
148
  type: String,
143
149
  default: "新建",
@@ -319,13 +325,32 @@ export default {
319
325
  }
320
326
 
321
327
  case "currency":
328
+ // if (value == null || value === "") return "";
329
+ // const num = parseFloat(value);
330
+ // if (isNaN(num)) return value;
331
+
332
+ // return new Intl.NumberFormat("zh-CN", {
333
+ // style: "currency",
334
+ // currency: "CNY",
335
+ // minimumFractionDigits: 0, // 最少小数位数
336
+ // maximumFractionDigits: 4, // 最多小数位数
337
+ // }).format(num);
322
338
  if (value == null || value === "") return "";
323
339
  const num = parseFloat(value);
324
340
  if (isNaN(num)) return value;
325
341
 
342
+ const decimalPart = num.toString().split(".")[1];
343
+ const hasDecimal = decimalPart && decimalPart.length > 0;
344
+
326
345
  return new Intl.NumberFormat("zh-CN", {
327
346
  style: "currency",
328
347
  currency: "CNY",
348
+ minimumFractionDigits: hasDecimal
349
+ ? Math.min(decimalPart.length, 2)
350
+ : 0,
351
+ maximumFractionDigits: hasDecimal
352
+ ? Math.min(decimalPart.length, 4)
353
+ : 0,
329
354
  }).format(num);
330
355
 
331
356
  default:
@@ -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.87",
3
+ "version": "0.5.89",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",