@indfnd/common 0.1.7 → 0.1.9

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,15 @@
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.9](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.8...v0.1.9) (2024-03-29)
6
+
7
+ ### [0.1.8](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.7...v0.1.8) (2024-03-29)
8
+
9
+
10
+ ### Features
11
+
12
+ * 查询表单支持查询条件通行;报表组件完善入库 ([9640832](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/96408327b005bc2beeb5dd64697307dd0d0d90a0))
13
+
5
14
  ### [0.1.7](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.6...v0.1.7) (2024-03-29)
6
15
 
7
16
  ### [0.1.6](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.1.5...v0.1.6) (2024-03-28)
@@ -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.6";
5
+ const version = "0.1.8";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -48525,7 +48525,10 @@ var FormImpl = {
48525
48525
  render(h) {
48526
48526
  let formItems = [];
48527
48527
  let spanList;
48528
- spanList = _.fill(_.range(this.fieldList.length), this.formType == "search" ? 6 : this.defaultSpan);
48528
+ spanList = _.fill(
48529
+ _.range(this.fieldList.length),
48530
+ this.formType == "search" ? 6 : this.defaultSpan
48531
+ );
48529
48532
  _.forEach(this.fieldList, (d, idx) => {
48530
48533
  if (d.span) {
48531
48534
  spanList[idx] = d.span;
@@ -51860,7 +51863,7 @@ var render$U = function() {
51860
51863
  _vm.checkAllGroup = $$v;
51861
51864
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
51862
51865
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
51863
- }), _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 || null, "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);
51866
+ }), _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, "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);
51864
51867
  };
51865
51868
  var staticRenderFns$U = [];
51866
51869
  function suppressNavigation(params) {
@@ -60297,7 +60300,6 @@ function deepEach$1(parentNode, list, callback) {
60297
60300
  }
60298
60301
  }
60299
60302
  function generateNodeWithPath(dimension, nodes) {
60300
- console.log("dimension is", dimension, "nodes is", nodes);
60301
60303
  let nodeClone = _.cloneDeep(nodes);
60302
60304
  deepEach$1(dimension, nodeClone, (d, p, idx) => {
60303
60305
  let pPath = p.path ? _.cloneDeep(p.path) : [{ id: p.id, title: p.title }];
@@ -60323,7 +60325,6 @@ function concatNodes(choosedNodes, newNodes, options) {
60323
60325
  let newPathArr = oldPathStr.split("_");
60324
60326
  newPathArr.splice(1, 1, dd.id);
60325
60327
  let newPathStr = newPathArr.join("_");
60326
- console.log("newPathStr is", newPathStr);
60327
60328
  if (_.findIndex(choosedNodesClone, { pathStr: newPathStr }) == -1) {
60328
60329
  let pathTmp = _.cloneDeep(d.path);
60329
60330
  pathTmp.splice(1, 0, { id: dd.id, title: dd.title });
@@ -60339,9 +60340,34 @@ function concatNodes(choosedNodes, newNodes, options) {
60339
60340
  });
60340
60341
  return choosedNodesClone;
60341
60342
  }
60343
+ function generateChoosedNodesByInit(options) {
60344
+ let rlt = [];
60345
+ _.forEach(options, (option) => {
60346
+ let checkedOptions = _.filter(option.options, { checked: true });
60347
+ let checkedIndex = [];
60348
+ let indexListTmp = generateNodeWithPath(option, [
60349
+ {
60350
+ id: "ALL",
60351
+ title: "\u5168\u9009",
60352
+ children: option.indexList
60353
+ }
60354
+ ]);
60355
+ deepEach$1({}, indexListTmp, (d) => {
60356
+ if (!d.children || !d.children.length) {
60357
+ if (d.checked === true) {
60358
+ checkedIndex.push(d);
60359
+ }
60360
+ }
60361
+ });
60362
+ if (checkedOptions.length && checkedIndex.length) {
60363
+ rlt = concatNodes(rlt, checkedIndex, checkedOptions);
60364
+ }
60365
+ });
60366
+ console.log("generateChoosedNodesByInit rlt is", rlt);
60367
+ return rlt;
60368
+ }
60342
60369
  function addNodeToTree(tree, node) {
60343
60370
  function addNodeToTreeInner(subTree, path2) {
60344
- console.log(subTree, "path is", path2);
60345
60371
  if (!(path2 == null ? void 0 : path2.length)) {
60346
60372
  return;
60347
60373
  }
@@ -60364,6 +60390,13 @@ function addNodeToTree(tree, node) {
60364
60390
  function generateTreeByNodes(nodes) {
60365
60391
  let rlt = [];
60366
60392
  nodes.forEach((d) => addNodeToTree(rlt, d));
60393
+ rlt = _.orderBy(rlt, ["seq"], ["asc"]);
60394
+ deepEach$1({}, rlt, (d) => {
60395
+ var _a;
60396
+ if ((_a = d.children) == null ? void 0 : _a.length) {
60397
+ d.children = _.orderBy(d.children, ["seq"], ["asc"]);
60398
+ }
60399
+ });
60367
60400
  return rlt;
60368
60401
  }
60369
60402
  function generateColumnsByTreeNodes(treeNodes) {
@@ -60416,17 +60449,17 @@ var render$d = function() {
60416
60449
  var _vm = this;
60417
60450
  var _h = _vm.$createElement;
60418
60451
  var _c = _vm._self._c || _h;
60419
- return _c("Modal", { attrs: { "value": _vm.show, "title": _vm.title, "mask-closable": false, "width": _vm.width, "transfer": "" }, on: { "input": function($event) {
60452
+ return _c("Modal", { attrs: { "lazyRender": false, "value": _vm.show, "title": _vm.title, "mask-closable": false, "width": _vm.width, "transfer": "" }, on: { "input": function($event) {
60420
60453
  return _vm.$emit("update:show", $event);
60421
60454
  }, "on-cancel": _vm.onCancel } }, [_c("div", { staticClass: "report-index-model-panel ind-flex" }, [_c("div", { staticClass: "left-panel ind-flex ind-flex-grow" }, [_c("div", { staticClass: "report-index-dimension1-panel ind-flex-no-shrink ind-flex-column" }, _vm._l(_vm.indexesSouce, function(dimensionItem1, idx) {
60422
60455
  return _c("div", { key: "dimension1" + idx, staticClass: "report-index-dimension1", class: [dimensionItem1.id == _vm.dimension1.id ? "selected" : ""], on: { "click": function($event) {
60423
60456
  return _vm.chooseDimension1(dimensionItem1);
60424
60457
  } } }, [_vm._v(" " + _vm._s(dimensionItem1.title) + " ")]);
60425
- }), 0), _c("div", { staticClass: "report-index-index-panel ind-flex-column ind-flex-grow" }, [_c("div", { staticClass: "report-index-options" }, [_vm.dimension1.options.length == 1 ? [_vm._v(" " + _vm._s(_vm.options[0].title || "") + " ")] : [_c("Select", { attrs: { "multiple": "" }, model: { value: _vm.optionsData, callback: function($$v) {
60458
+ }), 0), _c("div", { staticClass: "report-index-index-panel ind-flex-column ind-flex-grow" }, [_c("div", { staticClass: "report-index-options" }, [_vm.dimension1.options.length == 1 ? [_vm._v(" " + _vm._s(_vm.options[0].title || "") + " ")] : [_c("Select", { attrs: { "multiple": "" }, on: { "on-change": _vm.setDisabled1 }, model: { value: _vm.optionsData, callback: function($$v) {
60426
60459
  _vm.optionsData = $$v;
60427
60460
  }, expression: "optionsData" } }, _vm._l(_vm.dimension1.options, function(item2) {
60428
60461
  return _c("Option", { key: item2.id, attrs: { "value": item2.id } }, [_vm._v(_vm._s(item2.title))]);
60429
- }), 1)]], 2), _c("div", { staticClass: "report-index-index" }, [_c("Tree", { ref: "tree1", attrs: { "height": "500px", "expandAll": "", "show-checkbox": "", "data": _vm.indexListSrc, "isShowHeader": false, "is-show-search": true, "check-directly": "" } })], 1)])]), _c("div", { staticClass: "opt-panel ind-flex-no-shrink ind-flex-column" }, [_c("Button", { attrs: { "type": "default", "icon": "md-arrow-back" }, on: { "click": _vm.removeIndex } }), _c("Button", { staticStyle: { "margin-top": "10px" }, attrs: { "type": "default", "icon": "md-arrow-forward" }, on: { "click": _vm.addIndex } })], 1), _c("div", { staticClass: "right-panel ind-flex-grow" }, [_c("Tree", { ref: "tree2", attrs: { "height": "600px", "expandAll": "", "show-checkbox": "", "data": _vm.choosedIndexTree, "isShowHeader": false, "is-show-search": true, "check-directly": "" } })], 1)]), _c("div", { attrs: { "slot": "footer" }, slot: "footer" }, [_c("IndButtonGroup", { attrs: { "right": "", "split": "" } }, [_c("IndButton", { attrs: { "bizType": "cancel" }, on: { "click": _vm.onCancel } }, [_vm._v("\u53D6\u6D88")]), _c("IndButton", { attrs: { "bizType": "confirm" }, on: { "click": _vm.onOk } }, [_vm._v("\u786E\u5B9A")])], 1)], 1)]);
60462
+ }), 1)]], 2), _c("div", { staticClass: "report-index-index" }, [_c("Tree", { ref: "tree1", attrs: { "height": "500px", "expandAll": "", "show-checkbox": "", "data": _vm.indexListSrc, "isShowHeader": false, "is-show-search": true, "check-directly": "" }, on: { "on-check-change": _vm.setDisabled1 } })], 1)])]), _c("div", { staticClass: "opt-panel ind-flex-no-shrink ind-flex-column" }, [_c("Button", { attrs: { "disabled": _vm.addDisabled, "type": "default", "icon": "md-arrow-forward" }, on: { "click": _vm.addIndex } }), _c("Button", { staticStyle: { "margin-top": "10px" }, attrs: { "type": "default", "disabled": _vm.removeDisabled, "icon": "md-arrow-back" }, on: { "click": _vm.removeIndex } })], 1), _c("div", { staticClass: "right-panel ind-flex-grow" }, [_c("Tree", { ref: "tree2", attrs: { "height": "600px", "expandAll": "", "show-checkbox": "", "data": _vm.choosedIndexTree, "isShowHeader": false, "is-show-search": true, "check-directly": "" }, on: { "on-check-change": _vm.setDisabled2 } })], 1)]), _c("div", { attrs: { "slot": "footer" }, slot: "footer" }, [_c("IndButtonGroup", { attrs: { "right": "", "split": "" } }, [_c("IndButton", { attrs: { "bizType": "cancel" }, on: { "click": _vm.onCancel } }, [_vm._v("\u53D6\u6D88")]), _c("IndButton", { attrs: { "bizType": "confirm" }, on: { "click": _vm.onOk } }, [_vm._v("\u786E\u5B9A")])], 1)], 1)]);
60430
60463
  };
60431
60464
  var staticRenderFns$d = [];
60432
60465
  const __vue2_script$d = {
@@ -60459,13 +60492,32 @@ const __vue2_script$d = {
60459
60492
  indexListSrc: [],
60460
60493
  indexList: [],
60461
60494
  choosedIndexList: [],
60462
- choosedIndexTree: []
60495
+ choosedIndexTree: [],
60496
+ addDisabled: true,
60497
+ removeDisabled: true
60463
60498
  };
60464
60499
  },
60465
60500
  created() {
60466
60501
  this.initSrc();
60467
60502
  },
60503
+ watch: {
60504
+ options: {
60505
+ handler: function() {
60506
+ this.initSrc();
60507
+ },
60508
+ deep: true
60509
+ }
60510
+ },
60468
60511
  methods: {
60512
+ setDisabled1() {
60513
+ var _a;
60514
+ let indexList1 = this.$refs.tree1.getCheckedNodes(true);
60515
+ this.addDisabled = !((indexList1 == null ? void 0 : indexList1.length) && ((_a = this.optionsData) == null ? void 0 : _a.length));
60516
+ },
60517
+ setDisabled2() {
60518
+ let indexList2 = this.$refs.tree2.getCheckedNodes(true);
60519
+ this.removeDisabled = !(indexList2 == null ? void 0 : indexList2.length);
60520
+ },
60469
60521
  async initSrc() {
60470
60522
  if (this.dataApi) {
60471
60523
  const { data } = await this.dataApi(this.searchParams);
@@ -60483,6 +60535,14 @@ const __vue2_script$d = {
60483
60535
  }
60484
60536
  ]);
60485
60537
  this.indexList = [];
60538
+ this.initIndexByDefault();
60539
+ },
60540
+ initIndexByDefault() {
60541
+ this.choosedIndexList = generateChoosedNodesByInit(this.indexesSouce) || [];
60542
+ this.choosedIndexTree = generateTreeByNodes(this.choosedIndexList);
60543
+ this.$nextTick(() => {
60544
+ this.onOk();
60545
+ });
60486
60546
  },
60487
60547
  chooseDimension1(dimension1) {
60488
60548
  this.dimension1 = dimension1;
@@ -60508,7 +60568,7 @@ const __vue2_script$d = {
60508
60568
  },
60509
60569
  removeIndex() {
60510
60570
  let choosedIndexListClone = _.cloneDeep(this.choosedIndexList);
60511
- let indexes = this.$refs.tree1.getCheckedNodes(true);
60571
+ let indexes = this.$refs.tree2.getCheckedNodes(true);
60512
60572
  _.remove(choosedIndexListClone, (d) => {
60513
60573
  return _.some(indexes, (dd) => {
60514
60574
  return dd.pathStr === d.pathStr;