@indfnd/common 0.0.88 → 0.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
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.89](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.88...v0.0.89) (2024-03-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * 表头样式 ([05d3c9a](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/05d3c9acb155f7b4823a16114125c830017808e4))
11
+ * 修改表格样式,calcRule初始化计算 ([12f8446](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/12f8446bb86cb7394d3cbf4284a70f1549a36657))
12
+ * 样式 ([44c6a4c](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/44c6a4c10ec85ac107c5298a7cb9f80dcbdc9d7a))
13
+ * 允许修改表头高度 ([c5e3dfb](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/c5e3dfb14c1fa93fc4f78c564df6d6b1cef3452a))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * 修改样式 ([e074565](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/e074565e33e8a11c7f22c03cbbf8c397d34040ca))
19
+
5
20
  ### [0.0.88](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.87...v0.0.88) (2024-03-12)
6
21
 
7
22
 
@@ -2,7 +2,7 @@ import { Button as Button$1, ButtonGroup as ButtonGroup$1, Input, Drawer as Draw
2
2
  import { isNil, formatDate as formatDate$1, useConfig, getLocalStorage, getQuarterNum, formatQuarter, str2Date, isDate, isArray, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, axios, isFunction, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on as on$1, off as off$1, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, MIME_TYPE, base64ToBlob, putOssFileApi, getPriceInfo, getItem, getCaptchaURL, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, getToken, putOssFileUrl, getOssFileUrl, responseInterceptors, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, getSessionStorage, setSessionStorage, getAppListApi, getPermissionCache, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi, getIndexDescCache, listIndexDescApi, setIndexDescCache } from "@indfnd/utils";
3
3
  import Vue$1 from "vue";
4
4
  const name$1 = "@indfnd/common";
5
- const version$1 = "0.0.87";
5
+ const version$1 = "0.0.88";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -62,7 +62,7 @@ const dependencies = {
62
62
  "xlsx-populate": "^1.11.0"
63
63
  };
64
64
  const devDependencies = {
65
- "@indfnd/utils": "^0.0.39",
65
+ "@indfnd/utils": "^0.0.40",
66
66
  "ag-grid-community": "^30.1.0",
67
67
  "ag-grid-enterprise": "^30.1.0",
68
68
  "ag-grid-vue": "^30.1.0",
@@ -56199,6 +56199,32 @@ const doCalc = function doCalc2(ast, data, errRtn) {
56199
56199
  }
56200
56200
  }
56201
56201
  };
56202
+ const calcDatas = function(datas, options) {
56203
+ var astHash = {};
56204
+ var precisionHash = {};
56205
+ var errRtnHash = {};
56206
+ if (options && options.calcRules) {
56207
+ options.calcRules.forEach((n) => {
56208
+ astHash[n.rltKey] = n.ast;
56209
+ precisionHash[n.rltKey] = n.precision || 0;
56210
+ errRtnHash[n.rltKey] = n.errRtn || 0;
56211
+ });
56212
+ datas.forEach((d) => {
56213
+ Object.keys(astHash).forEach((k) => {
56214
+ d[k] = doCalc(astHash[k], d, errRtnHash[k]);
56215
+ if (isNaN(d[k])) {
56216
+ d[k] = "-";
56217
+ return;
56218
+ }
56219
+ if (precisionHash[k]) {
56220
+ d[k] = !!d[k] ? d[k].toFixed(precisionHash[k]) : d[k];
56221
+ } else {
56222
+ d[k] = parseInt(d[k]);
56223
+ }
56224
+ });
56225
+ });
56226
+ }
56227
+ };
56202
56228
  const calcData = function(data, options) {
56203
56229
  var astHash = {};
56204
56230
  var precisionHash = {};
@@ -56237,7 +56263,7 @@ var render$O = function() {
56237
56263
  _vm.checkAllGroup = $$v;
56238
56264
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
56239
56265
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
56240
- }), _c("br"), _c("br"), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnSave } }, [_vm._v("\u4FDD \u5B58")]), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnClear } }, [_vm._v("\u6E05 \u9664")])], 2)] : _vm._e(), _vm.btnSel != "1" ? _c("Button", { staticStyle: { "position": "absolute", "top": "10px", "right": "10px" }, attrs: { "type": "primary", "icon": "md-close", "size": "small", "title": "\u5173\u95ED" }, on: { "click": _vm.closeTableSettingDropdown } }) : _vm._e()], 2)], 1) : _vm._e()], 2)]) : _vm._e()], 2)], 1), _c("IndLoadingPanel", { attrs: { "loading": _vm.tableLoading } }, [!_vm.refreshTable ? _c("ag-grid-vue", _vm._g(_vm._b({ ref: "tableRef", staticClass: "ag-theme-balham", style: { height: _vm.height && !_vm.fullSreen ? _vm.height + "px" : "100%" }, attrs: { "id": "agTable", "suppressCellFocus": true, "suppressMenu": true, "suppressContextMenu": true, "defaultColDef": _vm.defaultColDef, "getRowHeight": _vm.getRowHeight, "rowData": _vm.tableData, "rowSelection": _vm.rowSelection, "columnDefs": _vm.tableColumns, "localeText": _vm.localeText, "singleClickEdit": true, "pinnedTopRowData": _vm.topRows, "pinnedBottomRowData": _vm.pinnedBottomRowData, "suppressRowClickSelection": _vm.suppressRowClickSelection, "suppressRowTransform": true, "stopEditingWhenCellsLoseFocus": true, "getRowClass": _vm.getRowClass, "getRowId": _vm.getRowId, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.noRowsTemplate || _vm.overlayNoRowsTemplate, "treeData": _vm.treeData, "getDataPath": _vm.getDataPath, "autoGroupColumnDef": _vm.autoGroupColumnDef, "groupDisplayType": _vm.groupDisplayType, "groupSelectsChildren": _vm.groupSelectsChildren, "groupDefaultExpanded": _vm.groupDefaultExpanded }, on: { "sortChanged": _vm.sortChanged, "selection-changed": _vm.selectionChanged, "grid-ready": _vm.onGridReady, "cellClicked": _vm.cellClicked, "cellDoubleClicked": _vm.cellDoubleClicked } }, "ag-grid-vue", _vm.$attrs, false), _vm.$listeners)) : _vm._e()], 1), _vm.showBottom ? _c("div", { ref: "bottom" }, [_c("Row", { staticStyle: { "margin-top": "10px" } }, [_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "span": "18" } }, [_c("Page", { directives: [{ name: "show", rawName: "v-show", value: !_vm.disablePage, expression: "!disablePage" }], attrs: { "size": "small", "total": _vm.totalNumber, "current": _vm.currentPage, "page-size": _vm.limitNumber, "show-sizer": "", "show-total": "", "show-elevator": "" }, on: { "on-change": _vm.onPageChange, "on-page-size-change": _vm.onPageSizeChange } }), _c("span", { directives: [{ name: "show", rawName: "v-show", value: _vm.disablePage, expression: "disablePage" }] }, [_vm._v("\u5171 " + _vm._s(_vm.tableData.length) + " \u6761\u6570\u636E")])], 1)], 1)], 1) : _vm._e()], 1);
56266
+ }), _c("br"), _c("br"), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnSave } }, [_vm._v("\u4FDD \u5B58")]), _vm._v(" \xA0 "), _c("Button", { staticClass: "table-column-select-btn", attrs: { "type": "default" }, on: { "click": _vm.columnClear } }, [_vm._v("\u6E05 \u9664")])], 2)] : _vm._e(), _vm.btnSel != "1" ? _c("Button", { staticStyle: { "position": "absolute", "top": "10px", "right": "10px" }, attrs: { "type": "primary", "icon": "md-close", "size": "small", "title": "\u5173\u95ED" }, on: { "click": _vm.closeTableSettingDropdown } }) : _vm._e()], 2)], 1) : _vm._e()], 2)]) : _vm._e()], 2)], 1), _c("IndLoadingPanel", { attrs: { "loading": _vm.tableLoading } }, [!_vm.refreshTable ? _c("ag-grid-vue", _vm._g(_vm._b({ ref: "tableRef", staticClass: "ag-theme-balham", style: { height: _vm.height && !_vm.fullSreen ? _vm.height + "px" : "100%" }, attrs: { "id": "agTable", "rowMultiSelectWithClick": _vm.rowSelection == "multiple" || _vm.rowMultiSelectWithClick, "suppressCellFocus": true, "suppressMenu": true, "suppressContextMenu": true, "defaultColDef": _vm.defaultColDef, "headerHeight": _vm.headerHeight || (_vm.getTheme == "ind-small-theme" ? null : 38), "getRowHeight": _vm.getRowHeight, "rowData": _vm.tableData, "rowSelection": _vm.rowSelection, "columnDefs": _vm.tableColumns, "localeText": _vm.localeText, "singleClickEdit": true, "pinnedTopRowData": _vm.topRows, "pinnedBottomRowData": _vm.pinnedBottomRowData, "suppressRowClickSelection": _vm.suppressRowClickSelection, "suppressRowTransform": true, "stopEditingWhenCellsLoseFocus": true, "getRowClass": _vm.getRowClass, "getRowId": _vm.getRowId, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.noRowsTemplate || _vm.overlayNoRowsTemplate, "treeData": _vm.treeData, "getDataPath": _vm.getDataPath, "autoGroupColumnDef": _vm.autoGroupColumnDef, "groupDisplayType": _vm.groupDisplayType, "groupSelectsChildren": _vm.groupSelectsChildren, "groupDefaultExpanded": _vm.groupDefaultExpanded }, on: { "sortChanged": _vm.sortChanged, "selection-changed": _vm.selectionChanged, "grid-ready": _vm.onGridReady, "cellClicked": _vm.cellClicked, "cellDoubleClicked": _vm.cellDoubleClicked } }, "ag-grid-vue", _vm.$attrs, false), _vm.$listeners)) : _vm._e()], 1), _vm.showBottom ? _c("div", { ref: "bottom" }, [_c("Row", { staticStyle: { "margin-top": "10px" } }, [_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "span": "18" } }, [_c("Page", { directives: [{ name: "show", rawName: "v-show", value: !_vm.disablePage, expression: "!disablePage" }], attrs: { "size": "small", "total": _vm.totalNumber, "current": _vm.currentPage, "page-size": _vm.limitNumber, "show-sizer": "", "show-total": "", "show-elevator": "" }, on: { "on-change": _vm.onPageChange, "on-page-size-change": _vm.onPageSizeChange } }), _c("span", { directives: [{ name: "show", rawName: "v-show", value: _vm.disablePage, expression: "disablePage" }] }, [_vm._v("\u5171 " + _vm._s(_vm.tableData.length) + " \u6761\u6570\u636E")])], 1)], 1)], 1) : _vm._e()], 1);
56241
56267
  };
56242
56268
  var staticRenderFns$O = [];
56243
56269
  function suppressNavigation(params) {
@@ -56327,6 +56353,8 @@ const __vue2_script$P = {
56327
56353
  AgFormat
56328
56354
  },
56329
56355
  props: {
56356
+ headerHeight: Number,
56357
+ rowMultiSelectWithClick: Boolean,
56330
56358
  pinnedTopRowData: Array,
56331
56359
  pinnedBottomRowData: Array,
56332
56360
  rowSpanColumns: Array,
@@ -56478,8 +56506,8 @@ const __vue2_script$P = {
56478
56506
  return {
56479
56507
  tableRef: null,
56480
56508
  refreshTable: false,
56481
- rowSelection: null,
56482
- suppressRowClickSelection: !this.rowClick,
56509
+ rowSelection: "single",
56510
+ suppressRowClickSelection: false,
56483
56511
  localeText: AG_GRID_LOCALE_ZH,
56484
56512
  btnSel: "",
56485
56513
  tableDataSrc: [],
@@ -56515,19 +56543,6 @@ const __vue2_script$P = {
56515
56543
  autoHeight: ((_d = (_c = this.$store) == null ? void 0 : _c.getters) == null ? void 0 : _d.getTheme) != "theme1",
56516
56544
  suppressKeyboardEvent: (params) => {
56517
56545
  return suppressNavigation(params);
56518
- },
56519
- headerComponentParams: {
56520
- template: `<div class="ag-cell-label-container" role="presentation">
56521
- <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
56522
- <span ref="eSortAsc" class="ag-header-icon ag-header-label-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
56523
- <span ref="eSortDesc" class="ag-header-icon ag-header-label-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
56524
- <span ref="eSortNone" class="ag-header-icon ag-header-label-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
56525
- <div ref="eLabel" class="ag-header-cell-label" role="presentation">
56526
- <span ref="eText" class="ag-header-cell-text"></span>
56527
- <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
56528
- <span ref="eSortOrder" class="ag-header-icon ag-header-label-icon ag-sort-order" aria-hidden="true"></span>
56529
- </div>
56530
- </div>`
56531
56546
  }
56532
56547
  },
56533
56548
  gridApi: null,
@@ -56558,7 +56573,7 @@ const __vue2_script$P = {
56558
56573
  },
56559
56574
  columnCalcMap() {
56560
56575
  let rlt = {};
56561
- _.forEach(this.columns, (d) => {
56576
+ _.forEach(this.flatColumns, (d) => {
56562
56577
  if (d.calcRule) {
56563
56578
  let ast = genAst(d.calcRule);
56564
56579
  let ruleVars = getVarsByAst(ast);
@@ -56716,8 +56731,7 @@ const __vue2_script$P = {
56716
56731
  })) {
56717
56732
  val = await this.renderTreeData(val);
56718
56733
  }
56719
- this.tableData = _.cloneDeep(val);
56720
- this.totalNumber = val.length;
56734
+ this.calcRulesData();
56721
56735
  }
56722
56736
  },
56723
56737
  deep: true
@@ -56725,6 +56739,7 @@ const __vue2_script$P = {
56725
56739
  tableData: {
56726
56740
  async handler(val) {
56727
56741
  this.overlayNoRowsTemplate = '<span style="padding: 10px;">\u6570\u636E\u4E3A\u7A7A</span>';
56742
+ console.log("tableData tigger", val);
56728
56743
  this.updating = true;
56729
56744
  this.renderSumRow();
56730
56745
  this.$emit("input", _.cloneDeep(val));
@@ -56734,6 +56749,13 @@ const __vue2_script$P = {
56734
56749
  },
56735
56750
  deep: true
56736
56751
  },
56752
+ columnCalcMap: {
56753
+ handler: function() {
56754
+ this.calcRulesData();
56755
+ },
56756
+ deep: true,
56757
+ immediate: true
56758
+ },
56737
56759
  showSummary: {
56738
56760
  handler(val) {
56739
56761
  this.tableShowSummary = val;
@@ -56785,6 +56807,35 @@ const __vue2_script$P = {
56785
56807
  this.optionDropdownVisible = false;
56786
56808
  },
56787
56809
  methods: {
56810
+ calcRulesData() {
56811
+ if (!_.isEmpty(this.columnCalcMap)) {
56812
+ let valueClone = _.cloneDeep(this.value);
56813
+ let calcRules = {};
56814
+ _.forEach(this.columnCalcMap, (v, k) => {
56815
+ _.merge(calcRules, v);
56816
+ });
56817
+ let rules = [];
56818
+ _.forEach(calcRules, (v, k) => {
56819
+ var _a;
56820
+ let column = _.find(this.flatColumns, (d) => {
56821
+ return d.field == k || d.key == k;
56822
+ });
56823
+ rules.push({
56824
+ rltKey: k,
56825
+ ast: v,
56826
+ precision: ((_a = column == null ? void 0 : column.cellRendererParams) == null ? void 0 : _a.scale) || 2,
56827
+ errRtn: 0
56828
+ });
56829
+ });
56830
+ let options = { calcRules: rules };
56831
+ calcDatas(valueClone, options);
56832
+ this.tableData = valueClone;
56833
+ this.totalNumber = valueClone.length;
56834
+ } else {
56835
+ this.tableData = _.cloneDeep(this.value);
56836
+ this.totalNumber = this.value.length;
56837
+ }
56838
+ },
56788
56839
  resetColumns(columns) {
56789
56840
  columns.forEach((d) => {
56790
56841
  d.hide = !d.checked;
@@ -56895,7 +56946,7 @@ const __vue2_script$P = {
56895
56946
  },
56896
56947
  getRowHeight() {
56897
56948
  let heightEnum = {
56898
- "ind-default-theme": 42,
56949
+ "ind-default-theme": 44,
56899
56950
  "ind-small-theme": 28
56900
56951
  };
56901
56952
  return heightEnum[this.getTheme];
@@ -57030,7 +57081,7 @@ const __vue2_script$P = {
57030
57081
  agColumn.showDisabledCheckboxes = true;
57031
57082
  this.rowSelection = "multiple";
57032
57083
  agColumn.cellClass = agColumn.cellClass + " ag-center-aligned-cell ind-ag-check-cell";
57033
- this.suppressRowClickSelection = this.rowClick ? false : true;
57084
+ this.suppressRowClickSelection = false;
57034
57085
  } else if (column.type == "radio") {
57035
57086
  agColumn.headerCheckboxSelection = false;
57036
57087
  agColumn.checkboxSelection = column.checkboxSelection || true;