doway-coms 2.11.67 → 2.11.69

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": "2.11.67",
3
+ "version": "2.11.69",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -2101,6 +2101,7 @@ export default {
2101
2101
  }
2102
2102
  if (originCol.align) {
2103
2103
  colInfo['align'] = originCol.align
2104
+ colInfo['footerAlign'] = originCol.align
2104
2105
  }
2105
2106
  if (originCol.visible === false) {
2106
2107
  colInfo.visible = false
@@ -3339,6 +3340,7 @@ export default {
3339
3340
  return '选中'
3340
3341
  }
3341
3342
  if (this.footerSum.includes(column.property)) {
3343
+
3342
3344
  let tempSumVal = XEUtils.sum(tempSelectRows, column.property)
3343
3345
  if (
3344
3346
  column.formatter &&
@@ -3363,6 +3365,8 @@ export default {
3363
3365
  return '合计'
3364
3366
  }
3365
3367
  if (this.footerSum.includes(column.property)) {
3368
+ // console.debug('column',column)
3369
+ // column.footerAlign = 'right';
3366
3370
  let tempSumVal = XEUtils.sum(data, column.property)
3367
3371
  if (
3368
3372
  column.formatter &&
@@ -4585,12 +4589,13 @@ export default {
4585
4589
  ::v-deep .vxe-cell--sort-wrapper {
4586
4590
  display: inline-flex;
4587
4591
  }
4588
-
4589
- ::v-deep .vxe-cell {
4592
+ /* 需要注释,会影响表尾合计的对齐方式,不知道为什么要加这个,需要跟玉龙确认*/
4593
+ ::v-deep .vxe-header--column .vxe-cell {
4590
4594
  display: flex !important;
4591
4595
  align-items: center !important;
4592
4596
  justify-content: flex-start !important;
4593
4597
  }
4598
+
4594
4599
  ::v-deep table > tbody > tr > td >.c--tooltip {
4595
4600
  display: block !important;
4596
4601
  }
@@ -442,6 +442,14 @@ export function secondDisplayTime(value) {
442
442
  * @param {*} colInfo
443
443
  */
444
444
  export function gridDefaultValueDisplay(rowInfo,colInfo){
445
+
446
+ //获取全局配置,数字是否显示小数点补零
447
+ let girdNumberPointZero = 2
448
+ if(store.getters.baseSetting && store.getters.baseSetting.pointZero){
449
+ girdNumberPointZero = XEUtils.toInteger(store.getters.baseSetting.pointZero)
450
+ }
451
+
452
+
445
453
  let colControlType = colInfo.params.controlType
446
454
  let displayValue = rowInfo[colInfo.field]
447
455
  if(displayValue===null){
@@ -475,11 +483,23 @@ export function gridDefaultValueDisplay(rowInfo,colInfo){
475
483
  if(colInfo.params.thousandDigit===true){
476
484
  displayValue = displayValue.toLocaleString('en-US',{ maximumFractionDigits: 10 })
477
485
  }
486
+ //查看是否小数点补零位数
487
+ if(girdNumberPointZero>0){
488
+ girdNumberPointZero = girdNumberPointZero>XEUtils.toInteger(colInfo.params.precision)?
489
+ girdNumberPointZero:XEUtils.toInteger(colInfo.params.precision)
490
+ displayValue = setNumberZero(displayValue,girdNumberPointZero)
491
+ }
478
492
  displayValue = displayValue+'%'
479
493
  }else{
480
494
  if(colInfo.params.thousandDigit===true){
481
495
  displayValue = displayValue.toLocaleString('en-US',{ maximumFractionDigits: 10 })
482
496
  }
497
+ //查看是否小数点补零位数
498
+ if(girdNumberPointZero>0){
499
+ girdNumberPointZero = girdNumberPointZero>XEUtils.toInteger(colInfo.params.precision)?
500
+ girdNumberPointZero:XEUtils.toInteger(colInfo.params.precision)
501
+ displayValue = setNumberZero(displayValue,girdNumberPointZero)
502
+ }
483
503
  }
484
504
  }
485
505
 
@@ -493,4 +513,31 @@ export function gridDefaultValueDisplay(rowInfo,colInfo){
493
513
  break
494
514
  }
495
515
  return displayValue
516
+ }
517
+ export function setNumberZero(value,numberPointZero){
518
+ //转成字符串,防止是数字
519
+ // 转成字符串,防止是数字
520
+ //判断是否存在小数点,如果不存在就直接补小数点和对应的0,如果存在就判断小数点后面存在几个字符,如果小于设定的字符数就补零
521
+ let strValue = value + '';
522
+
523
+ // 判断是否存在小数点
524
+ const decimalIndex = strValue.indexOf('.');
525
+
526
+ if (decimalIndex === -1) {
527
+ // 不存在小数点,直接补小数点和对应的0
528
+ if (numberPointZero > 0) {
529
+ strValue += '.' + '0'.repeat(numberPointZero);
530
+ }
531
+ } else {
532
+ // 存在小数点,判断小数点后的位数
533
+ const decimalPart = strValue.substring(decimalIndex + 1);
534
+ const decimalLength = decimalPart.length;
535
+
536
+ if (decimalLength < numberPointZero) {
537
+ // 不足位数则补零
538
+ strValue += '0'.repeat(numberPointZero - decimalLength);
539
+ }
540
+ }
541
+ return strValue;
542
+
496
543
  }