@indfnd/common 0.0.78 → 0.0.80

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,25 @@
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.80](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.79...v0.0.80) (2024-02-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * 更新单位切换的默认小数位数 ([1e387c6](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/1e387c6bc1fe82f4ba23078e4c0e12b9c639b47e))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 树选择组件bug修复 ([44e04ac](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/44e04acd4ffdd5fca5ad73a96d8355f393ac8a4c))
16
+
17
+ ### [0.0.79](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.78...v0.0.79) (2024-02-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * 表格支持获取合计行数据 ([a1aace7](http://git.inspur.com/imp-ec/ind-front/ind-common-front/commit/a1aace7e2ca7ae39c40aec0c24d7184332580ef0))
23
+
5
24
  ### [0.0.78](http://git.inspur.com/imp-ec/ind-front/ind-common-front/compare/v0.0.77...v0.0.78) (2024-02-01)
6
25
 
7
26
 
@@ -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.77";
5
+ const version$1 = "0.0.79";
6
6
  const author = "huxuetong";
7
7
  const publishConfig = {
8
8
  registry: "https://registry.npmjs.org/"
@@ -56313,11 +56313,11 @@ const __vue2_script$N = {
56313
56313
  },
56314
56314
  xScale: {
56315
56315
  type: Number,
56316
- default: 2
56316
+ default: 4
56317
56317
  },
56318
56318
  wzScale: {
56319
56319
  type: Number,
56320
- default: 2
56320
+ default: 4
56321
56321
  },
56322
56322
  funId: String
56323
56323
  },
@@ -57298,6 +57298,34 @@ const __vue2_script$N = {
57298
57298
  return datasTmp;
57299
57299
  }
57300
57300
  },
57301
+ getXSum() {
57302
+ if (this.unitType == "X") {
57303
+ return this.topRows;
57304
+ } else {
57305
+ let datasTmp = _.cloneDeep(this.topRows);
57306
+ datasTmp.forEach((d) => {
57307
+ this.switchCols.forEach((dd) => {
57308
+ let t2 = parseFloat(d[dd]);
57309
+ d[dd] = isNaN(t2) ? null : t2 / 5;
57310
+ });
57311
+ });
57312
+ return datasTmp;
57313
+ }
57314
+ },
57315
+ getWZSum() {
57316
+ if (this.unitType == "WZ") {
57317
+ return this.topRows;
57318
+ } else {
57319
+ let datasTmp = _.cloneDeep(this.topRows);
57320
+ datasTmp.forEach((d) => {
57321
+ this.switchCols.forEach((dd) => {
57322
+ let t2 = parseFloat(d[dd]);
57323
+ d[dd] = isNaN(t2) ? null : t2 * 5;
57324
+ });
57325
+ });
57326
+ return datasTmp;
57327
+ }
57328
+ },
57301
57329
  renderSumRow() {
57302
57330
  var _a;
57303
57331
  let hasSumRow = _.some(this.flatColumns, { isSum: true });
@@ -57878,7 +57906,11 @@ const __vue2_script$J = {
57878
57906
  },
57879
57907
  computed: {
57880
57908
  defaultValueStr() {
57881
- return JSON.stringify(this.defaultValue);
57909
+ return JSON.stringify(
57910
+ this.defaultValue.map((d) => {
57911
+ return d.id || d;
57912
+ })
57913
+ );
57882
57914
  }
57883
57915
  },
57884
57916
  methods: {
@@ -57915,7 +57947,7 @@ const __vue2_script$J = {
57915
57947
  0
57916
57948
  );
57917
57949
  deepEach2$1(list, []);
57918
- this.treeData = list;
57950
+ this.treeData = _.cloneDeep(list);
57919
57951
  this.backupTreeData = _.cloneDeep(this.treeData);
57920
57952
  this.defaultValueHandler();
57921
57953
  this.loading = false;
@@ -57969,35 +58001,33 @@ const __vue2_script$J = {
57969
58001
  },
57970
58002
  setDefaultValue2Nodes() {
57971
58003
  deepEach$1(this.treeData, (node) => {
58004
+ node.expand = this.expandAll ? true : node.expand;
58005
+ if (this.defaultExpandLevel != void 0) {
58006
+ node.expand = node.level <= this.defaultExpandLevel;
58007
+ }
57972
58008
  if (this.defaultValueCalc.includes(node.id)) {
57973
- node.expand = true;
57974
58009
  if (this.showCheckbox) {
57975
58010
  node.checked = true;
57976
58011
  } else {
57977
58012
  node.selected = true;
57978
58013
  }
57979
58014
  } else {
57980
- node.expand = this.expandAll ? true : false;
57981
- if (this.defaultExpandLevel != void 0) {
57982
- node.expand = node.level <= this.defaultExpandLevel;
57983
- }
57984
58015
  node.checked = false;
57985
58016
  node.selected = false;
57986
58017
  }
57987
58018
  });
57988
58019
  deepEach$1(this.backupTreeData, (node) => {
58020
+ node.expand = this.expandAll ? true : node.expand;
58021
+ if (this.defaultExpandLevel != void 0) {
58022
+ node.expand = node.level <= this.defaultExpandLevel;
58023
+ }
57989
58024
  if (this.defaultValueCalc.includes(node.id)) {
57990
- node.expand = true;
57991
58025
  if (this.showCheckbox) {
57992
58026
  node.checked = true;
57993
58027
  } else {
57994
58028
  node.selected = true;
57995
58029
  }
57996
58030
  } else {
57997
- node.expand = this.expandAll ? true : false;
57998
- if (this.defaultExpandLevel != void 0) {
57999
- node.expand = node.level <= this.defaultExpandLevel;
58000
- }
58001
58031
  node.checked = false;
58002
58032
  node.selected = false;
58003
58033
  }
@@ -58046,24 +58076,6 @@ const __vue2_script$J = {
58046
58076
  this.backupTreeData = _.cloneDeep(this.treeData);
58047
58077
  },
58048
58078
  processAncestorNodesExpandStatus() {
58049
- deepEach$1(this.treeData, (node) => {
58050
- let matched = false;
58051
- deepEach$1(node.children, (child) => {
58052
- if (child.selected || child.checked || child.expand || node.expand) {
58053
- return matched = true;
58054
- }
58055
- });
58056
- node.expand = matched;
58057
- });
58058
- deepEach$1(this.backupTreeData, (node) => {
58059
- let matched = false;
58060
- deepEach$1(node.children, (child) => {
58061
- if (child.selected || child.checked || child.expand || node.expand) {
58062
- return matched = true;
58063
- }
58064
- });
58065
- node.expand = matched;
58066
- });
58067
58079
  },
58068
58080
  watchDataProp() {
58069
58081
  if (!this.dataApi) {
@@ -58080,10 +58092,16 @@ const __vue2_script$J = {
58080
58092
  console.log("not inited yet");
58081
58093
  return;
58082
58094
  }
58095
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58096
+ this.expandFirstLevel();
58097
+ }
58083
58098
  if (this.defaultValue.length) {
58084
58099
  this.setDefaultValue2Nodes();
58085
58100
  this.processAncestorNodesExpandStatus();
58086
58101
  this.scrollToDefaultNode();
58102
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58103
+ this.expandFirstLevel();
58104
+ }
58087
58105
  this.$nextTick(() => {
58088
58106
  this.$emit(
58089
58107
  "on-default-change",
@@ -58093,8 +58111,7 @@ const __vue2_script$J = {
58093
58111
  } else {
58094
58112
  this.clearCheckedAndSelectedNodes(true);
58095
58113
  if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58096
- this.$set(this.treeData[0], "expand", true);
58097
- this.$set(this.backupTreeData[0], "expand", true);
58114
+ this.expandFirstLevel();
58098
58115
  }
58099
58116
  if (this.selectFirstLeaf) {
58100
58117
  this._selectFirstLeaf();
@@ -58222,7 +58239,6 @@ const __vue2_script$J = {
58222
58239
  checkAll = false;
58223
58240
  }
58224
58241
  });
58225
- console.log("checkAll", checkAll);
58226
58242
  curNode.indeterminate = false;
58227
58243
  if (checkAll) {
58228
58244
  curNode.checked = false;
@@ -58265,7 +58281,6 @@ const __vue2_script$J = {
58265
58281
  console.log("\u5355\u9009 \u975EleafOnly \u9009\u62E9\u4E86\u8282\u70B9");
58266
58282
  this.$emit("on-select-change", !nodes || nodes.length == 0 ? [curNode] : nodes, curNode);
58267
58283
  }
58268
- console.log("curNode is", curNode);
58269
58284
  curNode.expand = !curNode.expand;
58270
58285
  } else {
58271
58286
  deepEach$1(nodes, (node) => {
@@ -58281,7 +58296,6 @@ const __vue2_script$J = {
58281
58296
  deepEach$1(this.treeData, (node) => {
58282
58297
  if (selectNodes.includes(node.id)) {
58283
58298
  node.checked = true;
58284
- node.expand = true;
58285
58299
  } else {
58286
58300
  this.treeData[0].checked = false;
58287
58301
  node.checked = false;
@@ -58297,7 +58311,7 @@ const __vue2_script$J = {
58297
58311
  deepEach$1(this.backupTreeData, (node) => {
58298
58312
  if (selectNodes.includes(node.id)) {
58299
58313
  node.checked = true;
58300
- node.expand = true;
58314
+ node.expand = node.expand;
58301
58315
  } else {
58302
58316
  this.backupTreeData[0].checked = false;
58303
58317
  node.checked = false;
@@ -58456,11 +58470,11 @@ const __vue2_script$J = {
58456
58470
  }
58457
58471
  },
58458
58472
  highlightNodes(selectedTitles, callback) {
58459
- if (!selectedTitles) {
58460
- this.treeData = [];
58473
+ if (!selectedTitles || !selectedTitles[0]) {
58474
+ let checkedNodes2 = this.getCheckedNodes(true);
58461
58475
  this.treeData = _.cloneDeep(this.backupTreeData);
58462
58476
  this.$nextTick(() => {
58463
- this.$emit("on-check-change");
58477
+ this.$emit("on-check-change", checkedNodes2);
58464
58478
  });
58465
58479
  if (typeof callback === "function") {
58466
58480
  callback(0);
@@ -58494,7 +58508,11 @@ const __vue2_script$J = {
58494
58508
  }
58495
58509
  });
58496
58510
  }
58497
- this.treeData = this.deleteNoMatchedNodes(data);
58511
+ let checkedNodes = this.getCheckedNodes(true);
58512
+ this.treeData = _.cloneDeep(this.deleteNoMatchedNodes(data));
58513
+ this.$nextTick(() => {
58514
+ this.$emit("on-check-change", checkedNodes);
58515
+ });
58498
58516
  if (typeof callback === "function") {
58499
58517
  callback(num);
58500
58518
  }