@indfnd/common 1.1.42 → 1.1.43

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,19 @@
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
+ ### [1.1.43](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.42...v1.1.43) (2026-01-29)
6
+
7
+
8
+ ### Features
9
+
10
+ * data-picker增加on-change触发 ([00d21a7](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/00d21a7028f2e3dfb992f42934555f37f5ec2702))
11
+ * table表格增加keepSelected属性 ([73dd3ed](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/73dd3ed26a015febb257e93b7920a50a12055887))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * table和formImpl增加intNums控制数字输入框长度 ([dd9c1a2](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/dd9c1a2d1a8d811121a915a079453f61268bb1c4))
17
+
5
18
  ### [1.1.42](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v1.1.41...v1.1.42) (2026-01-23)
6
19
 
7
20
 
@@ -5460,7 +5460,7 @@ var lodash = { exports: {} };
5460
5460
  })(lodash, lodash.exports);
5461
5461
  var _ = lodash.exports;
5462
5462
  const name$1 = "@indfnd/common";
5463
- const version = "1.1.41";
5463
+ const version = "1.1.42";
5464
5464
  const author = "huxuetong";
5465
5465
  const publishConfig = {
5466
5466
  registry: "https://registry.npmjs.org/"
@@ -48603,6 +48603,7 @@ const __vue2_script$1w = {
48603
48603
  },
48604
48604
  emitChange(value) {
48605
48605
  this.$emit("input", value);
48606
+ this.$emit("on-change", value);
48606
48607
  },
48607
48608
  handleOpenChange(eventName, value) {
48608
48609
  this.$emit(eventName, value);
@@ -49340,20 +49341,25 @@ var FormImpl = {
49340
49341
  },
49341
49342
  on: {
49342
49343
  "on-blur": (event) => {
49343
- var _a2;
49344
+ var _a2, _b2, _c2, _d2;
49344
49345
  let v = event.target.value;
49345
- let formatRlt = /(-?)(\d{1,10})(\d{0,999})(\.\d{1,6})?/.exec(v);
49346
+ let intNums = ((_a2 = d.props) == null ? void 0 : _a2.intNums) === void 0 ? ((_b2 = this.$config) == null ? void 0 : _b2.indNumDefault) || 13 : (_c2 = d.props) == null ? void 0 : _c2.intNums;
49347
+ let formatPattern = new RegExp(
49348
+ `(-?)(\\d{1,${intNums}})(\\d{0,999})(\\.\\d{1,6})?`
49349
+ );
49350
+ let formatRlt = formatPattern.exec(v);
49346
49351
  if (d && d.props && d.props.scale === 0) {
49347
- formatRlt = /(-?)(\d{1,13})(\d{0,999})?/.exec(v);
49352
+ let formatPatternNoScale = new RegExp(`(-?)(\\d{1,${intNums}})(\\d{0,999})?`);
49353
+ formatRlt = formatPatternNoScale.exec(v);
49348
49354
  } else if (d && d.props && d.props.scale) {
49349
49355
  let scale = d.props.scale;
49350
- let formatPattern = new RegExp(
49351
- `(-?)(\\d{1,13})(\\d{0,999})(\\.\\d{1,${scale}})?`
49356
+ let formatPattern2 = new RegExp(
49357
+ `(-?)(\\d{1,${intNums}})(\\d{0,999})(\\.\\d{1,${scale}})?`
49352
49358
  );
49353
- formatRlt = formatPattern.exec(v);
49359
+ formatRlt = formatPattern2.exec(v);
49354
49360
  }
49355
49361
  if (formatRlt && formatRlt.length) {
49356
- v = (((_a2 = d == null ? void 0 : d.props) == null ? void 0 : _a2.enableNegative) ? formatRlt[1] : "") + formatRlt[2] + (formatRlt[4] || "");
49362
+ v = (((_d2 = d == null ? void 0 : d.props) == null ? void 0 : _d2.enableNegative) ? formatRlt[1] : "") + formatRlt[2] + (formatRlt[4] || "");
49357
49363
  }
49358
49364
  this.form[d.formKey] = parseFloat(v);
49359
49365
  this.$refs[d.formKey] && this.$refs[d.formKey].setCurrentValue(v);
@@ -51915,7 +51921,7 @@ var AgTooltip = /* @__PURE__ */ function() {
51915
51921
  const __vue2_script$1j = {
51916
51922
  name: "IndAgInput",
51917
51923
  render(h) {
51918
- const { value, data: data2, colDef, scaleFn, api, node, column } = this.params;
51924
+ const { intNums, value, data: data2, colDef, scaleFn, api, node, column } = this.params;
51919
51925
  const { props } = (colDef == null ? void 0 : colDef.cellRendererParams) || {};
51920
51926
  const { type, disabled: disabledDef, textCondition } = props || {};
51921
51927
  const disabled = disabledDef instanceof Function ? disabledDef(data2) : disabledDef;
@@ -51965,7 +51971,8 @@ const __vue2_script$1j = {
51965
51971
  let v = event.target.value;
51966
51972
  let updateV = null;
51967
51973
  if (type == "number") {
51968
- let formatRlt = /(-?)(\d{1,10})(\d{0,999})(\.\d{1,6})?/.exec(v);
51974
+ let formatPattern = new RegExp(`(-?)(\\d{1,${intNums}})(\\d{0,999})(\\.\\d{1,6})?`);
51975
+ let formatRlt = formatPattern.exec(v);
51969
51976
  if (formatRlt && formatRlt.length) {
51970
51977
  v = ((props == null ? void 0 : props.enableNegative) ? formatRlt[1] : "") + formatRlt[2] + (formatRlt[4] || "");
51971
51978
  }
@@ -53331,6 +53338,8 @@ const __vue2_script$15 = {
53331
53338
  AgUploadImg
53332
53339
  },
53333
53340
  props: {
53341
+ intNums: Number,
53342
+ keepSelected: Boolean,
53334
53343
  uuid: String,
53335
53344
  showMenu: Boolean,
53336
53345
  rowHeight: Number,
@@ -54389,6 +54398,7 @@ const __vue2_script$15 = {
54389
54398
  if (column.type) {
54390
54399
  if (column.isSum) {
54391
54400
  agColumn.cellRendererSelector = (params) => {
54401
+ var _a2;
54392
54402
  if (params.node.rowPinned) {
54393
54403
  return {
54394
54404
  component: "AgFormat",
@@ -54403,13 +54413,15 @@ const __vue2_script$15 = {
54403
54413
  params: {
54404
54414
  ...column.cellRendererParams,
54405
54415
  scopedSlots: this.$scopedSlots,
54406
- scaleFn: () => this.dealColumnScale(column)
54416
+ scaleFn: () => this.dealColumnScale(column),
54417
+ intNums: this.intNums == void 0 ? ((_a2 = this.$config) == null ? void 0 : _a2.indNumDefault) || 13 : this.intNums
54407
54418
  }
54408
54419
  };
54409
54420
  }
54410
54421
  };
54411
54422
  } else {
54412
54423
  agColumn.cellRendererSelector = (params) => {
54424
+ var _a2;
54413
54425
  if (params.node.rowPinned) {
54414
54426
  return void 0;
54415
54427
  } else {
@@ -54418,7 +54430,8 @@ const __vue2_script$15 = {
54418
54430
  params: {
54419
54431
  ...column.cellRendererParams,
54420
54432
  scopedSlots: this.$scopedSlots,
54421
- scaleFn: () => this.dealColumnScale(column)
54433
+ scaleFn: () => this.dealColumnScale(column),
54434
+ intNums: this.intNums == void 0 ? ((_a2 = this.$config) == null ? void 0 : _a2.indNumDefault) || 13 : this.intNums
54422
54435
  }
54423
54436
  };
54424
54437
  }
@@ -54800,6 +54813,12 @@ const __vue2_script$15 = {
54800
54813
  if (this.gridApi) {
54801
54814
  this.gridApi.hideOverlay();
54802
54815
  }
54816
+ const keepSelected = this.keepSelected == void 0 ? this.$config.agKeepSelected || false : this.keepSelected;
54817
+ let selectedRowsCache;
54818
+ if (keepSelected && this.gridApi) {
54819
+ selectedRowsCache = this.getSelection();
54820
+ console.log("new selectedRowsCache:", selectedRowsCache);
54821
+ }
54803
54822
  this.tableLoading = true;
54804
54823
  this.dataApi(
54805
54824
  Object.assign(
@@ -54830,6 +54849,33 @@ const __vue2_script$15 = {
54830
54849
  });
54831
54850
  }
54832
54851
  this.tableData = await this.renderTreeData(data2);
54852
+ console.log("rowKey:", this.rowKey);
54853
+ if (keepSelected && (selectedRowsCache == null ? void 0 : selectedRowsCache.length) > 0 && this.gridApi && this.rowKey !== "") {
54854
+ this.$nextTick(() => {
54855
+ const copyTableData = _.cloneDeep(this.rowDataFiltered);
54856
+ const visibleData = selectedRowsCache.filter((cachedRow) => {
54857
+ if (!cachedRow.hasOwnProperty(this.rowKey) || cachedRow[this.rowKey] === void 0) {
54858
+ console.log("rowKey\u4E0D\u5B58\u5728", this.rowKey);
54859
+ return false;
54860
+ }
54861
+ return copyTableData.some((row) => row[this.rowKey] === cachedRow[this.rowKey]);
54862
+ });
54863
+ if (visibleData.length === 0) {
54864
+ return;
54865
+ }
54866
+ this.setSelectionByRowKey(visibleData, true);
54867
+ const rowIndexs = visibleData.map((selectRow) => {
54868
+ const index2 = copyTableData.findIndex(
54869
+ (row) => row[this.rowKey] === selectRow[this.rowKey]
54870
+ );
54871
+ return index2;
54872
+ }).filter((idx) => idx !== -1);
54873
+ if (rowIndexs.length > 0) {
54874
+ const minIndex = Math.min(...rowIndexs);
54875
+ this.gridApi.ensureIndexVisible(minIndex, "middle");
54876
+ }
54877
+ });
54878
+ }
54833
54879
  this.totalNumber = result.data.total || 0;
54834
54880
  this.$emit("on-data-format-load", result);
54835
54881
  }
@@ -54920,6 +54966,23 @@ const __vue2_script$15 = {
54920
54966
  this.gridApi.setNodesSelected({ nodes: deselected, newValue: false });
54921
54967
  }, 50);
54922
54968
  },
54969
+ setSelectionByRowKey(items, cancelOthers) {
54970
+ if (this.rowKey === "")
54971
+ return;
54972
+ let sels = (items || []).map((d) => d[this.rowKey]);
54973
+ let selected = [], deselected = [];
54974
+ setTimeout(() => {
54975
+ this.gridApi.forEachNode((node) => {
54976
+ if (sels.includes(node.data[this.rowKey])) {
54977
+ selected.push(node);
54978
+ } else if (cancelOthers) {
54979
+ deselected.push(node);
54980
+ }
54981
+ });
54982
+ this.gridApi.setNodesSelected({ nodes: selected, newValue: true });
54983
+ this.gridApi.setNodesSelected({ nodes: deselected, newValue: false });
54984
+ }, 50);
54985
+ },
54923
54986
  getXData() {
54924
54987
  if (this.unitType == "X") {
54925
54988
  return this.tableData;