@indfnd/common 0.0.79 → 0.0.81

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,27 @@
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.81](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.80...v0.0.81) (2024-02-18)
6
+
7
+
8
+ ### Features
9
+
10
+ * 表格紧凑模式样式修改 ([fe1106b](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/fe1106b66281d0d74fe451d7e9f3e402d27b44d7))
11
+ * 表格组件支持树形展现、树形选择 ([f50dfbd](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/f50dfbdb9326e25f9d4017c6f1322f5561ea1c09))
12
+ * 导出excel兼容枚举定义为空的场景 ([bb86ec9](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/bb86ec90e2a07a998ee3e9179ef76363d46d8609))
13
+
14
+ ### [0.0.80](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.79...v0.0.80) (2024-02-04)
15
+
16
+
17
+ ### Features
18
+
19
+ * 更新单位切换的默认小数位数 ([1e387c6](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/1e387c6bc1fe82f4ba23078e4c0e12b9c639b47e))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * 树选择组件bug修复 ([44e04ac](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/44e04acd4ffdd5fca5ad73a96d8355f393ac8a4c))
25
+
5
26
  ### [0.0.79](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.78...v0.0.79) (2024-02-01)
6
27
 
7
28
 
@@ -2,7 +2,7 @@ import { Button as Button$1, ButtonGroup as ButtonGroup$1, Input, Drawer as Draw
2
2
  import { isNil, useConfig, getLocalStorage, getQuarterNum, formatQuarter, str2Date, isDate, isArray, checkIdCard, checkVehicleNo, checkPhone, getDictMapApi, formatDate as formatDate$1, axios, isFunction, exportJsonToExcel as exportJsonToExcel$1, importJsonFromExcel, getPriceCode, getPriceSeg, getItem, on as on$1, off as off$1, deleteMenuHistoryApi, deleteMenuCollectApi, getMenuHistoryApi, getMenuCollectApi, getCaptchaURL, guid, setLocalStorage, removeLocalStorage, clearSessionStorage, cryptor, getToken, MIME_TYPE, responseInterceptors, config as config$1, setToken, loginApi, clearUserInfoCache, clearPermissionCache, logoutApi, getUserInfoCache, getUserInfoApi, setUserInfoCache, getSessionStorage, setSessionStorage, getAppListApi, getPermissionCache, getPermissionApi, setPermissionCache, menuHistoryApi, addMenuCollectApi, removeMenuCollectApi } from "@indfnd/utils";
3
3
  import Vue$1 from "vue";
4
4
  const name$1 = "@indfnd/common";
5
- const version$1 = "0.0.78";
5
+ const version$1 = "0.0.81";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -54,6 +54,7 @@ const dependencies = {
54
54
  const devDependencies = {
55
55
  "@indfnd/utils": "^0.0.33",
56
56
  "ag-grid-community": "^30.1.0",
57
+ "ag-grid-enterprise": "^30.1.0",
57
58
  "ag-grid-vue": "^30.1.0",
58
59
  eslint: "^3.19.0",
59
60
  "eslint-config-prettier": "^8.5.0",
@@ -43037,13 +43038,13 @@ function getAgColumnTitleAndData({ columns, datas }) {
43037
43038
  } else if (d.cellClass.indexOf("enum") != -1) {
43038
43039
  datasClo.forEach((dd) => {
43039
43040
  var _a, _b, _c;
43040
- let enumList = (_a = d == null ? void 0 : d.cellRendererParams) == null ? void 0 : _a.enumList;
43041
- let enumData = (_b = d == null ? void 0 : d.cellRendererParams) == null ? void 0 : _b.enumData;
43041
+ let enumList = ((_a = d == null ? void 0 : d.cellRendererParams) == null ? void 0 : _a.enumList) || [];
43042
+ let enumData = ((_b = d == null ? void 0 : d.cellRendererParams) == null ? void 0 : _b.enumData) || {};
43042
43043
  if (enumList) {
43043
- let v = ((_c = _.find(enumList, { K: dd[d.field] })) == null ? void 0 : _c.V) || "";
43044
+ let v = ((_c = _.find(enumList, { K: dd[d.field] })) == null ? void 0 : _c.V) || dd[d.field];
43044
43045
  dd[d.field] = v;
43045
43046
  } else {
43046
- dd[d.field] = enumData[dd[d.field]];
43047
+ dd[d.field] = enumData[dd[d.field]] || dd[d.field];
43047
43048
  }
43048
43049
  });
43049
43050
  }
@@ -49576,8 +49577,11 @@ const __vue2_script$10 = {
49576
49577
  },
49577
49578
  methods: {
49578
49579
  setDefaultItem(item2) {
49580
+ let oldDefault = item2.isDefault;
49579
49581
  _.forEach(this.datas, (d) => d.isDefault = "0");
49580
- item2.isDefault = "1";
49582
+ item2.isDefault = oldDefault == "1" ? "0" : "1";
49583
+ let datasTmp = _.cloneDeep(this.datas);
49584
+ this.datas = datasTmp;
49581
49585
  this.syncToStorage();
49582
49586
  },
49583
49587
  useItem(item2) {
@@ -49611,7 +49615,6 @@ const __vue2_script$10 = {
49611
49615
  },
49612
49616
  {}
49613
49617
  );
49614
- console.log(field.formKey, " enumTmp is", enumTmp);
49615
49618
  if (v instanceof Array) {
49616
49619
  return v.map((d) => enumTmp[d]).join("\u3001");
49617
49620
  } else {
@@ -56117,7 +56120,7 @@ var render$M = function() {
56117
56120
  _vm.checkAllGroup = $$v;
56118
56121
  }, expression: "checkAllGroup" } }, [_vm._l(_vm.columns, function(item2) {
56119
56122
  return [item2.title ? _c("Checkbox", { key: item2.field, attrs: { "label": item2.title } }, [_vm._v(_vm._s(item2.title))]) : _vm._e()];
56120
- }), _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, "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, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.overlayNoRowsTemplate }, 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), _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)], 1);
56123
+ }), _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, "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, "tooltipShowDelay": 500, "overlayNoRowsTemplate": _vm.overlayNoRowsTemplate, "treeData": _vm.treeData, "getDataPath": _vm.getDataPath, "autoGroupColumnDef": _vm.autoGroupColumnDef, "groupSelectsChildren": true }, 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), _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)], 1);
56121
56124
  };
56122
56125
  var staticRenderFns$M = [];
56123
56126
  function suppressNavigation(params) {
@@ -56170,13 +56173,13 @@ function suppressNavigation(params) {
56170
56173
  });
56171
56174
  return suppress;
56172
56175
  }
56173
- function deepEach$2(list, callback) {
56176
+ function deepEach$2(parentNode, list, callback) {
56174
56177
  if (Array.isArray(list) && list.length) {
56175
- _.forEach(list, (node) => {
56178
+ _.forEach(list, (node, idx) => {
56176
56179
  let breakDeep = false;
56177
56180
  if (typeof callback === "function") {
56178
56181
  try {
56179
- const callbackResult = callback(node);
56182
+ const callbackResult = callback(node, parentNode, idx);
56180
56183
  if (typeof callbackResult === "boolean") {
56181
56184
  breakDeep = callbackResult;
56182
56185
  }
@@ -56185,7 +56188,7 @@ function deepEach$2(list, callback) {
56185
56188
  }
56186
56189
  }
56187
56190
  if (!breakDeep) {
56188
- deepEach$2(node.children, callback);
56191
+ deepEach$2(node, node.children, callback);
56189
56192
  }
56190
56193
  });
56191
56194
  }
@@ -56313,15 +56316,17 @@ const __vue2_script$N = {
56313
56316
  },
56314
56317
  xScale: {
56315
56318
  type: Number,
56316
- default: 2
56319
+ default: 4
56317
56320
  },
56318
56321
  wzScale: {
56319
56322
  type: Number,
56320
- default: 2
56323
+ default: 4
56321
56324
  },
56322
- funId: String
56325
+ funId: String,
56326
+ xmlInfo: String
56323
56327
  },
56324
56328
  data() {
56329
+ var _a, _b, _c, _d;
56325
56330
  return {
56326
56331
  tableRef: null,
56327
56332
  refreshTable: true,
@@ -56358,8 +56363,8 @@ const __vue2_script$N = {
56358
56363
  suppressMenu: true,
56359
56364
  wrapHeaderText: this.headerAutoHeight,
56360
56365
  autoHeaderHeight: this.headerAutoHeight,
56361
- wrapText: true,
56362
- autoHeight: true,
56366
+ wrapText: ((_b = (_a = this.$store) == null ? void 0 : _a.getters) == null ? void 0 : _b.getTheme) != "theme1",
56367
+ autoHeight: ((_d = (_c = this.$store) == null ? void 0 : _c.getters) == null ? void 0 : _d.getTheme) != "theme1",
56363
56368
  suppressKeyboardEvent: (params) => {
56364
56369
  return suppressNavigation(params);
56365
56370
  },
@@ -56383,13 +56388,18 @@ const __vue2_script$N = {
56383
56388
  showUnitSwitch: false,
56384
56389
  switchCols: [],
56385
56390
  unitType: this.defaultUnitType || "X",
56386
- topRows: this.pinnedTopRowData || null
56391
+ topRows: this.pinnedTopRowData || null,
56392
+ treeData: false,
56393
+ getDataPath: (data) => {
56394
+ return data.treeLevelFlag;
56395
+ },
56396
+ autoGroupColumnDef: null
56387
56397
  };
56388
56398
  },
56389
56399
  computed: {
56390
56400
  flatColumns() {
56391
56401
  let rlt = [];
56392
- deepEach$2(this.columns, (d) => {
56402
+ deepEach$2(null, this.columns, (d) => {
56393
56403
  rlt.push(d);
56394
56404
  });
56395
56405
  return rlt;
@@ -56558,9 +56568,9 @@ const __vue2_script$N = {
56558
56568
  deep: true
56559
56569
  },
56560
56570
  value: {
56561
- handler(val) {
56562
- this.overlayNoRowsTemplate = '<span style="padding: 10px;">\u6570\u636E\u4E3A\u7A7A</span>';
56571
+ async handler(val) {
56563
56572
  if (!this.updating) {
56573
+ val = await this.renderTreeData(val);
56564
56574
  this.tableData = this.formatDatas(_.cloneDeep(val));
56565
56575
  this.totalNumber = val.length;
56566
56576
  }
@@ -56568,7 +56578,8 @@ const __vue2_script$N = {
56568
56578
  deep: true
56569
56579
  },
56570
56580
  tableData: {
56571
- handler(val) {
56581
+ async handler(val) {
56582
+ this.overlayNoRowsTemplate = '<span style="padding: 10px;">\u6570\u636E\u4E3A\u7A7A</span>';
56572
56583
  this.updating = true;
56573
56584
  this.renderSumRow();
56574
56585
  this.$emit("input", _.cloneDeep(val));
@@ -56637,7 +56648,7 @@ const __vue2_script$N = {
56637
56648
  if (this.$listeners && this.$listeners.cellClicked) {
56638
56649
  this.$listeners.cellClicked(event);
56639
56650
  } else {
56640
- let col = event.colDef;
56651
+ let col = event.colDef || {};
56641
56652
  if (((_a = col == null ? void 0 : col.cellRendererParams) == null ? void 0 : _a.onClick) instanceof Function) {
56642
56653
  col.cellRendererParams.onClick(event.data);
56643
56654
  }
@@ -56647,7 +56658,7 @@ const __vue2_script$N = {
56647
56658
  if (this.$listeners && this.$listeners.cellDoubleClicked) {
56648
56659
  this.$listeners.cellDoubleClicked(event);
56649
56660
  } else {
56650
- let colClicked = event.colDef;
56661
+ let colClicked = event.colDef || {};
56651
56662
  colClicked = _.find(
56652
56663
  this.columns,
56653
56664
  (d) => colClicked.key && d.key == colClicked.key || colClicked.field && d.field == colClicked.field
@@ -56858,14 +56869,14 @@ const __vue2_script$N = {
56858
56869
  agColumn.cellClass = agColumn.cellClass + " ag-center-aligned-cell";
56859
56870
  } else if (column.type == "checkbox") {
56860
56871
  agColumn.headerCheckboxSelection = true;
56861
- agColumn.checkboxSelection = true;
56872
+ agColumn.checkboxSelection = column.checkboxSelection || true;
56862
56873
  agColumn.showDisabledCheckboxes = true;
56863
56874
  this.rowSelection = "multiple";
56864
56875
  agColumn.cellClass = agColumn.cellClass + " ag-center-aligned-cell ind-ag-check-cell";
56865
56876
  this.suppressRowClickSelection = true;
56866
56877
  } else if (column.type == "radio") {
56867
56878
  agColumn.headerCheckboxSelection = false;
56868
- agColumn.checkboxSelection = true;
56879
+ agColumn.checkboxSelection = column.checkboxSelection || true;
56869
56880
  agColumn.showDisabledCheckboxes = true;
56870
56881
  this.rowSelection = "single";
56871
56882
  this.suppressRowClickSelection = false;
@@ -57039,7 +57050,7 @@ const __vue2_script$N = {
57039
57050
  this.sortParams,
57040
57051
  this.searchParams
57041
57052
  )
57042
- ).then((result) => {
57053
+ ).then(async (result) => {
57043
57054
  if (result) {
57044
57055
  this.overlayNoRowsTemplate = '<span style="padding: 10px;">\u6570\u636E\u4E3A\u7A7A</span>';
57045
57056
  this.$emit("on-data-load", result);
@@ -57070,7 +57081,7 @@ const __vue2_script$N = {
57070
57081
  });
57071
57082
  }
57072
57083
  }
57073
- this.tableData = this.formatDatas(data);
57084
+ this.tableData = await this.renderTreeData(this.formatDatas(data));
57074
57085
  this.totalNumber = result.data.total || 0;
57075
57086
  this.$emit("on-data-format-load", result);
57076
57087
  }
@@ -57373,6 +57384,49 @@ const __vue2_script$N = {
57373
57384
  } else {
57374
57385
  this.topRows = this.pinnedTopRowData;
57375
57386
  }
57387
+ },
57388
+ async renderTreeData(val) {
57389
+ var _a;
57390
+ this.treeData = _.some(val, (d) => {
57391
+ var _a2, _b;
57392
+ return ((_a2 = d.children) == null ? void 0 : _a2.length) || ((_b = d.treeLevelFlag) == null ? void 0 : _b.length);
57393
+ });
57394
+ if (this.treeData) {
57395
+ this.renderTreeFlag(val);
57396
+ let rlt = [];
57397
+ deepEach$2(null, val, (d) => {
57398
+ rlt.push(d);
57399
+ });
57400
+ val = rlt;
57401
+ let treeColDef = _.find(this.columns, { tree: true });
57402
+ if (_.isEmpty(treeColDef)) {
57403
+ treeColDef = this.columns[0];
57404
+ }
57405
+ let treeCol = (treeColDef == null ? void 0 : treeColDef.field) || (treeColDef == null ? void 0 : treeColDef.key);
57406
+ let tableColumnTree = _.find(this.tableColumns, { field: treeCol });
57407
+ this.autoGroupColumnDef = {
57408
+ ...tableColumnTree
57409
+ };
57410
+ if ((_a = tableColumnTree == null ? void 0 : tableColumnTree.cellRendererParams) == null ? void 0 : _a.checkbox) {
57411
+ this.rowSelection = "multiple";
57412
+ }
57413
+ let tableColumnsClone = _.cloneDeep(this.tableColumns);
57414
+ this.tableColumns = tableColumnsClone.slice(1);
57415
+ this.refreshTable = false;
57416
+ await this.$nextTick();
57417
+ this.refreshTable = true;
57418
+ }
57419
+ return val;
57420
+ },
57421
+ renderTreeFlag(datas) {
57422
+ let treeColDef = _.find(this.columns, { tree: true });
57423
+ if (_.isEmpty(treeColDef)) {
57424
+ treeColDef = this.columns[0];
57425
+ }
57426
+ let treeCol = (treeColDef == null ? void 0 : treeColDef.field) || (treeColDef == null ? void 0 : treeColDef.key);
57427
+ deepEach$2(null, datas, (d, parentNode, idx) => {
57428
+ d.treeLevelFlag = parentNode ? [...parentNode.treeLevelFlag, d[treeCol]] : [d[treeCol]];
57429
+ });
57376
57430
  }
57377
57431
  },
57378
57432
  components: {
@@ -57906,7 +57960,11 @@ const __vue2_script$J = {
57906
57960
  },
57907
57961
  computed: {
57908
57962
  defaultValueStr() {
57909
- return JSON.stringify(this.defaultValue);
57963
+ return JSON.stringify(
57964
+ this.defaultValue.map((d) => {
57965
+ return d.id || d;
57966
+ })
57967
+ );
57910
57968
  }
57911
57969
  },
57912
57970
  methods: {
@@ -57943,7 +58001,7 @@ const __vue2_script$J = {
57943
58001
  0
57944
58002
  );
57945
58003
  deepEach2$1(list, []);
57946
- this.treeData = list;
58004
+ this.treeData = _.cloneDeep(list);
57947
58005
  this.backupTreeData = _.cloneDeep(this.treeData);
57948
58006
  this.defaultValueHandler();
57949
58007
  this.loading = false;
@@ -57997,35 +58055,33 @@ const __vue2_script$J = {
57997
58055
  },
57998
58056
  setDefaultValue2Nodes() {
57999
58057
  deepEach$1(this.treeData, (node) => {
58058
+ node.expand = this.expandAll ? true : node.expand;
58059
+ if (this.defaultExpandLevel != void 0) {
58060
+ node.expand = node.level <= this.defaultExpandLevel;
58061
+ }
58000
58062
  if (this.defaultValueCalc.includes(node.id)) {
58001
- node.expand = true;
58002
58063
  if (this.showCheckbox) {
58003
58064
  node.checked = true;
58004
58065
  } else {
58005
58066
  node.selected = true;
58006
58067
  }
58007
58068
  } else {
58008
- node.expand = this.expandAll ? true : false;
58009
- if (this.defaultExpandLevel != void 0) {
58010
- node.expand = node.level <= this.defaultExpandLevel;
58011
- }
58012
58069
  node.checked = false;
58013
58070
  node.selected = false;
58014
58071
  }
58015
58072
  });
58016
58073
  deepEach$1(this.backupTreeData, (node) => {
58074
+ node.expand = this.expandAll ? true : node.expand;
58075
+ if (this.defaultExpandLevel != void 0) {
58076
+ node.expand = node.level <= this.defaultExpandLevel;
58077
+ }
58017
58078
  if (this.defaultValueCalc.includes(node.id)) {
58018
- node.expand = true;
58019
58079
  if (this.showCheckbox) {
58020
58080
  node.checked = true;
58021
58081
  } else {
58022
58082
  node.selected = true;
58023
58083
  }
58024
58084
  } else {
58025
- node.expand = this.expandAll ? true : false;
58026
- if (this.defaultExpandLevel != void 0) {
58027
- node.expand = node.level <= this.defaultExpandLevel;
58028
- }
58029
58085
  node.checked = false;
58030
58086
  node.selected = false;
58031
58087
  }
@@ -58074,24 +58130,26 @@ const __vue2_script$J = {
58074
58130
  this.backupTreeData = _.cloneDeep(this.treeData);
58075
58131
  },
58076
58132
  processAncestorNodesExpandStatus() {
58077
- deepEach$1(this.treeData, (node) => {
58078
- let matched = false;
58079
- deepEach$1(node.children, (child) => {
58080
- if (child.selected || child.checked || child.expand || node.expand) {
58081
- return matched = true;
58082
- }
58133
+ if (!this.showCheckbox) {
58134
+ deepEach$1(this.treeData, (node) => {
58135
+ let matched = false;
58136
+ deepEach$1(node.children, (child) => {
58137
+ if (child.selected || child.checked || child.expand || node.expand) {
58138
+ return matched = true;
58139
+ }
58140
+ });
58141
+ node.expand = matched;
58083
58142
  });
58084
- node.expand = matched;
58085
- });
58086
- deepEach$1(this.backupTreeData, (node) => {
58087
- let matched = false;
58088
- deepEach$1(node.children, (child) => {
58089
- if (child.selected || child.checked || child.expand || node.expand) {
58090
- return matched = true;
58091
- }
58143
+ deepEach$1(this.backupTreeData, (node) => {
58144
+ let matched = false;
58145
+ deepEach$1(node.children, (child) => {
58146
+ if (child.selected || child.checked || child.expand || node.expand) {
58147
+ return matched = true;
58148
+ }
58149
+ });
58150
+ node.expand = matched;
58092
58151
  });
58093
- node.expand = matched;
58094
- });
58152
+ }
58095
58153
  },
58096
58154
  watchDataProp() {
58097
58155
  if (!this.dataApi) {
@@ -58108,10 +58166,16 @@ const __vue2_script$J = {
58108
58166
  console.log("not inited yet");
58109
58167
  return;
58110
58168
  }
58169
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58170
+ this.expandFirstLevel();
58171
+ }
58111
58172
  if (this.defaultValue.length) {
58112
58173
  this.setDefaultValue2Nodes();
58113
58174
  this.processAncestorNodesExpandStatus();
58114
58175
  this.scrollToDefaultNode();
58176
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58177
+ this.expandFirstLevel();
58178
+ }
58115
58179
  this.$nextTick(() => {
58116
58180
  this.$emit(
58117
58181
  "on-default-change",
@@ -58121,8 +58185,7 @@ const __vue2_script$J = {
58121
58185
  } else {
58122
58186
  this.clearCheckedAndSelectedNodes(true);
58123
58187
  if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58124
- this.$set(this.treeData[0], "expand", true);
58125
- this.$set(this.backupTreeData[0], "expand", true);
58188
+ this.expandFirstLevel();
58126
58189
  }
58127
58190
  if (this.selectFirstLeaf) {
58128
58191
  this._selectFirstLeaf();
@@ -58250,7 +58313,6 @@ const __vue2_script$J = {
58250
58313
  checkAll = false;
58251
58314
  }
58252
58315
  });
58253
- console.log("checkAll", checkAll);
58254
58316
  curNode.indeterminate = false;
58255
58317
  if (checkAll) {
58256
58318
  curNode.checked = false;
@@ -58293,7 +58355,6 @@ const __vue2_script$J = {
58293
58355
  console.log("\u5355\u9009 \u975EleafOnly \u9009\u62E9\u4E86\u8282\u70B9");
58294
58356
  this.$emit("on-select-change", !nodes || nodes.length == 0 ? [curNode] : nodes, curNode);
58295
58357
  }
58296
- console.log("curNode is", curNode);
58297
58358
  curNode.expand = !curNode.expand;
58298
58359
  } else {
58299
58360
  deepEach$1(nodes, (node) => {
@@ -58309,7 +58370,6 @@ const __vue2_script$J = {
58309
58370
  deepEach$1(this.treeData, (node) => {
58310
58371
  if (selectNodes.includes(node.id)) {
58311
58372
  node.checked = true;
58312
- node.expand = true;
58313
58373
  } else {
58314
58374
  this.treeData[0].checked = false;
58315
58375
  node.checked = false;
@@ -58325,7 +58385,7 @@ const __vue2_script$J = {
58325
58385
  deepEach$1(this.backupTreeData, (node) => {
58326
58386
  if (selectNodes.includes(node.id)) {
58327
58387
  node.checked = true;
58328
- node.expand = true;
58388
+ node.expand = node.expand;
58329
58389
  } else {
58330
58390
  this.backupTreeData[0].checked = false;
58331
58391
  node.checked = false;
@@ -58484,11 +58544,11 @@ const __vue2_script$J = {
58484
58544
  }
58485
58545
  },
58486
58546
  highlightNodes(selectedTitles, callback) {
58487
- if (!selectedTitles) {
58488
- this.treeData = [];
58547
+ if (!selectedTitles || !selectedTitles[0]) {
58548
+ let checkedNodes2 = this.getCheckedNodes(true);
58489
58549
  this.treeData = _.cloneDeep(this.backupTreeData);
58490
58550
  this.$nextTick(() => {
58491
- this.$emit("on-check-change");
58551
+ this.$emit("on-check-change", checkedNodes2);
58492
58552
  });
58493
58553
  if (typeof callback === "function") {
58494
58554
  callback(0);
@@ -58522,7 +58582,11 @@ const __vue2_script$J = {
58522
58582
  }
58523
58583
  });
58524
58584
  }
58525
- this.treeData = this.deleteNoMatchedNodes(data);
58585
+ let checkedNodes = this.getCheckedNodes(true);
58586
+ this.treeData = _.cloneDeep(this.deleteNoMatchedNodes(data));
58587
+ this.$nextTick(() => {
58588
+ this.$emit("on-check-change", checkedNodes);
58589
+ });
58526
58590
  if (typeof callback === "function") {
58527
58591
  callback(num);
58528
58592
  }