@indfnd/common-mobile 0.0.10 → 0.0.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.12](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.11...v0.0.12) (2024-03-21)
6
+
7
+
8
+ ### Features
9
+
10
+ * detail-view暴露参数,切换单位 ([c29bb43](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/c29bb4327c9b99de589b3eaee887282c5bd95002))
11
+
12
+ ### [0.0.11](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.10...v0.0.11) (2024-03-20)
13
+
14
+
15
+ ### Features
16
+
17
+ * page-view支持单位切换 ([da0f84e](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/da0f84ee5c0a5c7841be8810cb741e2cc9e052d6))
18
+
5
19
  ### [0.0.10](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.9...v0.0.10) (2024-03-19)
6
20
 
7
21
 
@@ -2,7 +2,7 @@ import { getQuarterNum, getHalfYearNum, getHalfYear, formatDate, checkIdCard, ch
2
2
  import { DropdownMenu as DropdownMenu$1, DropdownItem as DropdownItem$1, Message, LoadingBar, Spin } from "view-design";
3
3
  import Vue$1 from "vue";
4
4
  const name = "@indfnd/common-mobile";
5
- const version$1 = "0.0.9";
5
+ const version$1 = "0.0.11";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -44276,7 +44276,9 @@ var render$i = function() {
44276
44276
  return _vm.setForm(table, $event);
44277
44277
  }, "fieldChange": function($event) {
44278
44278
  return _vm.fieldChange(table, $event);
44279
- }, "itemClick": _vm.itemClick } })];
44279
+ }, "itemClick": function($event) {
44280
+ return _vm.itemClick($event, table);
44281
+ } } })];
44280
44282
  } }], null, true) })], 1)];
44281
44283
  }, { "table": table })] : _vm._e()];
44282
44284
  }), _c("van-collapse", { model: { value: _vm.activeNames, callback: function($$v) {
@@ -44295,7 +44297,9 @@ var render$i = function() {
44295
44297
  return _vm.setForm(cTable, $event);
44296
44298
  }, "fieldChange": function($event) {
44297
44299
  return _vm.fieldChange(cTable, $event);
44298
- }, "itemClick": _vm.itemClick } })];
44300
+ }, "itemClick": function($event) {
44301
+ return _vm.itemClick($event, cTable);
44302
+ } } })];
44299
44303
  } }], null, true) })], 1)];
44300
44304
  }, { "table": cTable })] : _vm._e()], 2);
44301
44305
  }), 1)], 2), _vm._t("bottom", function() {
@@ -44402,7 +44406,7 @@ const __vue2_script$i = {
44402
44406
  }
44403
44407
  this.subTable.forEach((d) => {
44404
44408
  let unitFields = _.filter(d.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44405
- (d2) => d2.id
44409
+ (m) => m.id
44406
44410
  );
44407
44411
  if (d.dataField) {
44408
44412
  let tmpData = dataSrc[d.dataField];
@@ -44412,10 +44416,10 @@ const __vue2_script$i = {
44412
44416
  _.forEach(unitFields, (ddd) => {
44413
44417
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44414
44418
  let t2 = _.round(parseFloat(dd[ddd]), 6);
44415
- dd[ddd] = isNaN(t2) ? null : t2 * 5;
44419
+ dd[ddd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44416
44420
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44417
44421
  let t2 = _.round(parseFloat(dd[ddd]), 6);
44418
- dd[ddd] = isNaN(t2) ? null : t2 / 5;
44422
+ dd[ddd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44419
44423
  }
44420
44424
  });
44421
44425
  });
@@ -44423,10 +44427,10 @@ const __vue2_script$i = {
44423
44427
  _.forEach(unitFields, (dd) => {
44424
44428
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44425
44429
  let t2 = _.round(parseFloat(tmpData[dd]), 6);
44426
- tmpData[dd] = isNaN(t2) ? null : t2 * 5;
44430
+ tmpData[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44427
44431
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44428
44432
  let t2 = _.round(parseFloat(tmpData[dd]), 6);
44429
- tmpData[dd] = isNaN(t2) ? null : t2 / 5;
44433
+ tmpData[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44430
44434
  }
44431
44435
  });
44432
44436
  }
@@ -44436,10 +44440,10 @@ const __vue2_script$i = {
44436
44440
  _.forEach(unitFields, (dd) => {
44437
44441
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44438
44442
  let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44439
- dataSrc[dd] = isNaN(t2) ? null : t2 * 5;
44443
+ dataSrc[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44440
44444
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44441
44445
  let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44442
- dataSrc[dd] = isNaN(t2) ? null : t2 / 5;
44446
+ dataSrc[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44443
44447
  }
44444
44448
  });
44445
44449
  }
@@ -44455,7 +44459,7 @@ const __vue2_script$i = {
44455
44459
  }
44456
44460
  this.subTable.forEach((d) => {
44457
44461
  let unitFields = _.filter(d.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44458
- (d2) => d2.id
44462
+ (m) => m.id
44459
44463
  );
44460
44464
  if (d.dataField) {
44461
44465
  let tmpData = dataSrc[d.dataField];
@@ -44465,10 +44469,10 @@ const __vue2_script$i = {
44465
44469
  _.forEach(unitFields, (ddd) => {
44466
44470
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44467
44471
  let t2 = _.round(parseFloat(dd[ddd]), 6);
44468
- dd[ddd] = isNaN(t2) ? null : t2 / 5;
44472
+ dd[ddd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44469
44473
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44470
44474
  let t2 = _.round(parseFloat(dd[ddd]), 6);
44471
- dd[ddd] = isNaN(t2) ? null : t2 * 5;
44475
+ dd[ddd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44472
44476
  }
44473
44477
  });
44474
44478
  });
@@ -44476,10 +44480,10 @@ const __vue2_script$i = {
44476
44480
  _.forEach(unitFields, (dd) => {
44477
44481
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44478
44482
  let t2 = _.round(parseFloat(tmpData[dd]), 6);
44479
- tmpData[dd] = isNaN(t2) ? null : t2 / 5;
44483
+ tmpData[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44480
44484
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44481
44485
  let t2 = _.round(parseFloat(tmpData[dd]), 6);
44482
- tmpData[dd] = isNaN(t2) ? null : t2 * 5;
44486
+ tmpData[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44483
44487
  }
44484
44488
  });
44485
44489
  }
@@ -44489,10 +44493,10 @@ const __vue2_script$i = {
44489
44493
  _.forEach(unitFields, (dd) => {
44490
44494
  if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44491
44495
  let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44492
- dataSrc[dd] = isNaN(t2) ? null : t2 / 5;
44496
+ dataSrc[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44493
44497
  } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44494
44498
  let t2 = _.round(parseFloat(dataSrc[dd]), 6);
44495
- dataSrc[dd] = isNaN(t2) ? null : t2 * 5;
44499
+ dataSrc[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44496
44500
  }
44497
44501
  });
44498
44502
  }
@@ -44501,8 +44505,24 @@ const __vue2_script$i = {
44501
44505
  this.$emit("update:formValue", dataSrc);
44502
44506
  },
44503
44507
  fieldChange(table, event) {
44508
+ let itemClone = _.cloneDeep((event == null ? void 0 : event.row) || {});
44509
+ let unitFields = _.filter(table.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44510
+ (m) => m.id
44511
+ );
44512
+ if (unitFields == null ? void 0 : unitFields.length) {
44513
+ _.forEach(unitFields, (dd) => {
44514
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44515
+ let t2 = _.round(parseFloat(itemClone[dd]), 6);
44516
+ itemClone[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44517
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44518
+ let t2 = _.round(parseFloat(itemClone[dd]), 6);
44519
+ itemClone[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44520
+ }
44521
+ });
44522
+ }
44504
44523
  this.$emit("fieldChange", {
44505
- ...event,
44524
+ formKey: event.formKey,
44525
+ row: itemClone,
44506
44526
  table
44507
44527
  });
44508
44528
  },
@@ -44563,8 +44583,23 @@ const __vue2_script$i = {
44563
44583
  async submit() {
44564
44584
  this.$emit("submit");
44565
44585
  },
44566
- itemClick: _.debounce(function(item2) {
44567
- this.$emit("itemClick", item2);
44586
+ itemClick: _.debounce(function(item2, table) {
44587
+ let itemClone = _.cloneDeep(item2);
44588
+ let unitFields = _.filter(table.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44589
+ (m) => m.id
44590
+ );
44591
+ if (unitFields == null ? void 0 : unitFields.length) {
44592
+ _.forEach(unitFields, (dd) => {
44593
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44594
+ let t2 = _.round(parseFloat(itemClone[dd]), 6);
44595
+ itemClone[dd] = isNaN(t2) ? null : _.round(t2 / 5, 6);
44596
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44597
+ let t2 = _.round(parseFloat(itemClone[dd]), 6);
44598
+ itemClone[dd] = isNaN(t2) ? null : _.round(t2 * 5, 6);
44599
+ }
44600
+ });
44601
+ }
44602
+ this.$emit("itemClick", itemClone);
44568
44603
  }, 1)
44569
44604
  }
44570
44605
  };
@@ -44666,15 +44701,37 @@ const __vue2_script$h = {
44666
44701
  },
44667
44702
  computed: {
44668
44703
  displayRows() {
44704
+ let datas;
44669
44705
  if (this.searchVal) {
44670
- return _.filter(this.rows, (d) => {
44706
+ datas = _.filter(this.rows, (d) => {
44671
44707
  return _.some(this.formFieldList, (dd) => {
44672
44708
  return _.includes(d[dd.formKey], this.searchVal);
44673
44709
  });
44674
44710
  }) || [];
44675
44711
  } else {
44676
- return this.rows || [];
44712
+ datas = this.rows || [];
44713
+ }
44714
+ let dataSrc = _.cloneDeep(datas);
44715
+ if (this.dataUnit == this.pageUnit) {
44716
+ return dataSrc;
44717
+ }
44718
+ let unitFields = _.filter(this.formFieldList, (dd) => dd.isSwitchUnit === "true").map(
44719
+ (m) => m.id
44720
+ );
44721
+ if (unitFields == null ? void 0 : unitFields.length) {
44722
+ _.forEach(dataSrc, (dd) => {
44723
+ _.forEach(unitFields, (ddd) => {
44724
+ if (this.dataUnit == "X" && this.pageUnit == "WZ") {
44725
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44726
+ dd[ddd] = isNaN(t2) ? null : t2 * 5;
44727
+ } else if (this.dataUnit == "WZ" && this.pageUnit == "X") {
44728
+ let t2 = _.round(parseFloat(dd[ddd]), 6);
44729
+ dd[ddd] = isNaN(t2) ? null : t2 / 5;
44730
+ }
44731
+ });
44732
+ });
44677
44733
  }
44734
+ return dataSrc;
44678
44735
  }
44679
44736
  },
44680
44737
  methods: {