@indfnd/common 0.1.3 → 0.1.4

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,14 @@
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.1.4](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.3...v0.1.4) (2024-03-22)
6
+
7
+
8
+ ### Features
9
+
10
+ * 单位样式 ([66a9b90](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/66a9b9007d926c5358931f59b7f96131d015c89e))
11
+ * auto-refresh逻辑修复;支持表格默认单位 ([c1013bf](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/c1013bf4cec8c126b9cbccad36d90c9c003d71d7))
12
+
5
13
  ### [0.1.3](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.2...v0.1.3) (2024-03-21)
6
14
 
7
15
 
@@ -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, isString, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, on, off, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, listItemTreeApi, getPriceInfo, MIME_TYPE, base64ToBlob, putOssFileApi, isEqual, 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 = "0.1.2";
5
+ const version = "0.1.3";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -51839,7 +51839,7 @@ var render$T = function() {
51839
51839
  var _vm = this;
51840
51840
  var _h = _vm.$createElement;
51841
51841
  var _c = _vm._self._c || _h;
51842
- return _c("div", { staticClass: "lambo-grid-table", class: [_vm.fullSreen ? "fullscreen-fixed" : ""] }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.search, expression: "$slots.search" }], ref: "search", staticClass: "search" }, [_vm._t("search")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.tip, expression: "$slots.tip" }], ref: "tip", staticClass: "tip" }, [_vm._t("tip")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.important - _vm.tip, expression: "$slots.important - tip" }], ref: "important-tip", staticClass: "important-tip" }, [_c("Icon", { attrs: { "type": "md-information-circle" } }), _vm._t("important-tip")], 2), _c("div", { ref: "buttons", staticClass: "other-button" }, [_c("Row", [[_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "flex": "1 1 0%" } }, [_c("IndButtonGroup", { attrs: { "split": "", "mb": "" } }, [_vm._t("buttons")], 2)], 1)], _vm.showUnitSwitch && _vm.isShowUnitSwitch || _vm.showTableOption || _vm.$slots.options ? _c("i-col", { staticStyle: { "text-align": "right" }, attrs: { "flex": "0 0 auto" } }, [_c("div", { staticClass: "ind-flex end" }, [_vm._t("options"), _vm.showUnitSwitch && _vm.isShowUnitSwitch ? _c("IndUnitRadio", { staticStyle: { "margin-bottom": "10px", "line-height": "1" }, attrs: { "isShowWX": _vm.isShowWX, "isShowJ": _vm.isShowJ }, model: { value: _vm.unitType, callback: function($$v) {
51842
+ return _c("div", { staticClass: "lambo-grid-table", class: [_vm.fullSreen ? "fullscreen-fixed" : ""] }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.search, expression: "$slots.search" }], ref: "search", staticClass: "search" }, [_vm._t("search")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.tip, expression: "$slots.tip" }], ref: "tip", staticClass: "tip" }, [_vm._t("tip")], 2), _c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.$slots.important - _vm.tip, expression: "$slots.important - tip" }], ref: "important-tip", staticClass: "important-tip" }, [_c("Icon", { attrs: { "type": "md-information-circle" } }), _vm._t("important-tip")], 2), _c("div", { ref: "buttons", staticClass: "other-button" }, [_c("Row", [[_c("i-col", { staticStyle: { "text-align": "left" }, attrs: { "flex": "1 1 0%" } }, [_c("IndButtonGroup", { attrs: { "split": "", "mb": "" } }, [_vm._t("buttons")], 2)], 1)], _vm.showUnitSwitch && _vm.isShowUnitSwitch || _vm.showTableOption || _vm.$slots.options ? _c("i-col", { staticStyle: { "text-align": "right" }, attrs: { "flex": "0 0 auto" } }, [_c("div", { staticClass: "ind-flex end" }, [_c("div", { staticStyle: { "line-height": "32px", "padding-bottom": "var(--ind-padding-base)", "margin-right": "10px" } }, [_vm._t("options")], 2), _vm.showUnitSwitch && _vm.isShowUnitSwitch ? _c("IndUnitRadio", { staticStyle: { "margin-bottom": "10px", "line-height": "1" }, attrs: { "isShowWX": _vm.isShowWX, "isShowJ": _vm.isShowJ }, model: { value: _vm.unitType, callback: function($$v) {
51843
51843
  _vm.unitType = $$v;
51844
51844
  }, expression: "unitType" } }) : _vm._e(), _vm.showTableOption ? _c("Dropdown", { staticClass: "table-option-dropdown", staticStyle: { "float": "right", "margin-bottom": "var(--ind-padding-base)" }, attrs: { "trigger": "custom", "visible": _vm.optionDropdownVisible, "placement": "bottom-end" }, on: { "on-click": _vm.resetTableSize } }, [_c("IndButtonGroup", { staticStyle: { "display": "flex" }, attrs: { "split": false, "mb": "" } }, [_c("IndButton", { attrs: { "bizType": "reset" }, on: { "click": _vm.toggleFullScreen } }, [_vm._v(" " + _vm._s(_vm.fullSreen ? "\u53D6\u6D88\u5168\u5C4F" : "\u5168\u5C4F") + " ")]), _vm.revertBtn ? _c("IndButton", { attrs: { "bizType": "reset" }, on: { "click": function($event) {
51845
51845
  return _vm.$emit("revertColumnRow");
@@ -51849,7 +51849,7 @@ var render$T = function() {
51849
51849
  _vm.checkAllGroup = $$v;
51850
51850
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
51851
51851
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
51852
- }), _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);
51852
+ }), _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()], 1)]) : _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, "headerHeight": _vm.headerHeight || (_vm.getTheme == "ind-small-theme" ? null : 38), "getRowHeight": _vm.getRowHeight, "rowData": _vm.tableData, "suppressRowClickSelection": _vm.isEditTable || _vm.suppressRowClickSelection, "rowSelection": _vm.rowSelection, "rowMultiSelectWithClick": !_vm.isEditTable && (_vm.rowSelection == "multiple" || _vm.rowMultiSelectWithClick), "columnDefs": _vm.tableColumns, "localeText": _vm.localeText, "singleClickEdit": true, "pinnedTopRowData": _vm.topRows, "pinnedBottomRowData": _vm.pinnedBottomRowData, "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);
51853
51853
  };
51854
51854
  var staticRenderFns$T = [];
51855
51855
  function suppressNavigation(params) {
@@ -52066,6 +52066,10 @@ const __vue2_script$U = {
52066
52066
  type: String,
52067
52067
  default: "X"
52068
52068
  },
52069
+ defaultTableUnitType: {
52070
+ type: String,
52071
+ default: "X"
52072
+ },
52069
52073
  xScale: {
52070
52074
  type: Number,
52071
52075
  default: 4
@@ -52136,7 +52140,7 @@ const __vue2_script$U = {
52136
52140
  overlayNoRowsTemplate: '<span style="padding: 10px;">\u8BF7\u9009\u62E9\u67E5\u8BE2\u6761\u4EF6</span>',
52137
52141
  showUnitSwitch: false,
52138
52142
  switchCols: [],
52139
- unitType: this.defaultUnitType || "X",
52143
+ unitType: this.defaultTableUnitType || this.defaultUnitType || "X",
52140
52144
  topRows: this.pinnedTopRowData || null,
52141
52145
  treeData: false,
52142
52146
  getDataPath: (data) => {
@@ -52147,6 +52151,11 @@ const __vue2_script$U = {
52147
52151
  };
52148
52152
  },
52149
52153
  computed: {
52154
+ isEditTable() {
52155
+ return _.some(this.flatColumns, (d) => {
52156
+ return ["input", "select", "treeselect"].includes(d.type);
52157
+ });
52158
+ },
52150
52159
  getRowId() {
52151
52160
  return this.rowKey ? (params) => params.data[this.rowKey] : null;
52152
52161
  },
@@ -52342,6 +52351,8 @@ const __vue2_script$U = {
52342
52351
  },
52343
52352
  async created() {
52344
52353
  this.tableRef = this;
52354
+ this.unitType = this.defaultTableUnitType;
52355
+ console.log("this.unitType is", this.unitType);
52345
52356
  this.cloneColumns = this.tableColumnsInner(_.cloneDeep(this.columns) || []);
52346
52357
  this.cloneColumns2 = this.tableColumnsInner(_.cloneDeep(this.columns) || []);
52347
52358
  this.tableColumns = _.cloneDeep(this.cloneColumns);
@@ -52419,17 +52430,13 @@ const __vue2_script$U = {
52419
52430
  }
52420
52431
  },
52421
52432
  resetColumns(columns) {
52422
- const columnDataMap = _.reduce(
52423
- this.columns || [],
52424
- (rlt, item2) => {
52425
- let field = item2.field || item2.key;
52426
- Object.assign(rlt, { [field]: item2 });
52427
- return rlt;
52428
- },
52429
- {}
52430
- );
52431
- columns.forEach((d) => {
52432
- let srcColumn = columnDataMap[d.field || d.key];
52433
+ const columnDataMap = {};
52434
+ deepEach$2(null, this.columns || [], (item2) => {
52435
+ let field = item2.field || item2.key || item2.type;
52436
+ Object.assign(columnDataMap, { [field]: item2 });
52437
+ });
52438
+ deepEach$2(null, columns, (d) => {
52439
+ let srcColumn = columnDataMap[d.field || d.key || d.type];
52433
52440
  srcColumn.hide = !d.checked;
52434
52441
  if (d.pinned) {
52435
52442
  srcColumn.pinned = d.pinned;
@@ -53083,7 +53090,8 @@ const __vue2_script$U = {
53083
53090
  });
53084
53091
  },
53085
53092
  tableRefresh: _.debounce(function(noQuery) {
53086
- if (this.dataApi && !noQuery) {
53093
+ var _a;
53094
+ if (this.dataApi && (!noQuery || !((_a = this.tableData) == null ? void 0 : _a.length))) {
53087
53095
  if (this.gridApi) {
53088
53096
  this.gridApi.hideOverlay();
53089
53097
  }
@@ -53109,6 +53117,12 @@ const __vue2_script$U = {
53109
53117
  data.forEach((d, idx) => {
53110
53118
  d["_initialseq"] = idx;
53111
53119
  });
53120
+ console.log(
53121
+ "this.unitType is",
53122
+ this.unitType,
53123
+ "this.defaultUnitType is",
53124
+ this.defaultUnitType
53125
+ );
53112
53126
  if (this.unitType != this.defaultUnitType) {
53113
53127
  if (this.unitType == "WZ") {
53114
53128
  data.forEach((d) => {