doway-coms 1.4.0 → 1.4.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- show-zoom -->
3
- <div style="margin:130px 0 0 130px">
3
+ <div>
4
4
  <vxe-modal
5
5
  append-to-body
6
6
  :maskClosable="false"
@@ -8,6 +8,7 @@
8
8
  resize
9
9
  width="80%"
10
10
  height="80%"
11
+ :position="{top: 100, left: 100}"
11
12
  v-model="isShow"
12
13
  destroy-on-close
13
14
  :closable="true"
@@ -490,4 +490,26 @@ export function setIndustryVersionFields(fields){
490
490
  XEUtils.remove(fields,i)
491
491
  }
492
492
  }
493
+ }
494
+
495
+ /**
496
+ * 计算数量保留位数及判断取整方向
497
+ * @param {行数据信息} rowInfo
498
+ * @param {数值} number
499
+ * @param {位数} digits
500
+ * @param {取整方向} round
501
+ */
502
+ export function numberDigitsRound(rowInfo, colInfo) {
503
+ // 向上、向下、四舍五入
504
+ switch (rowInfo[colInfo.round]) {
505
+ case 'ceiling':
506
+ XEUtils.ceil(rowInfo[colInfo.number], rowInfo[colInfo.digits])
507
+ break;
508
+ case 'floor':
509
+ XEUtils.floor(rowInfo[colInfo.number], rowInfo[colInfo.digits])
510
+ break;
511
+ case 'round':
512
+ rowInfo[colInfo.number] = rowInfo[colInfo.number].toFixed(rowInfo[colInfo.digits])
513
+ break;
514
+ }
493
515
  }