@indfnd/common 0.0.79 → 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,18 @@
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
+
5
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)
6
18
 
7
19
 
@@ -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.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
  },
@@ -57906,7 +57906,11 @@ const __vue2_script$J = {
57906
57906
  },
57907
57907
  computed: {
57908
57908
  defaultValueStr() {
57909
- return JSON.stringify(this.defaultValue);
57909
+ return JSON.stringify(
57910
+ this.defaultValue.map((d) => {
57911
+ return d.id || d;
57912
+ })
57913
+ );
57910
57914
  }
57911
57915
  },
57912
57916
  methods: {
@@ -57943,7 +57947,7 @@ const __vue2_script$J = {
57943
57947
  0
57944
57948
  );
57945
57949
  deepEach2$1(list, []);
57946
- this.treeData = list;
57950
+ this.treeData = _.cloneDeep(list);
57947
57951
  this.backupTreeData = _.cloneDeep(this.treeData);
57948
57952
  this.defaultValueHandler();
57949
57953
  this.loading = false;
@@ -57997,35 +58001,33 @@ const __vue2_script$J = {
57997
58001
  },
57998
58002
  setDefaultValue2Nodes() {
57999
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
+ }
58000
58008
  if (this.defaultValueCalc.includes(node.id)) {
58001
- node.expand = true;
58002
58009
  if (this.showCheckbox) {
58003
58010
  node.checked = true;
58004
58011
  } else {
58005
58012
  node.selected = true;
58006
58013
  }
58007
58014
  } else {
58008
- node.expand = this.expandAll ? true : false;
58009
- if (this.defaultExpandLevel != void 0) {
58010
- node.expand = node.level <= this.defaultExpandLevel;
58011
- }
58012
58015
  node.checked = false;
58013
58016
  node.selected = false;
58014
58017
  }
58015
58018
  });
58016
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
+ }
58017
58024
  if (this.defaultValueCalc.includes(node.id)) {
58018
- node.expand = true;
58019
58025
  if (this.showCheckbox) {
58020
58026
  node.checked = true;
58021
58027
  } else {
58022
58028
  node.selected = true;
58023
58029
  }
58024
58030
  } else {
58025
- node.expand = this.expandAll ? true : false;
58026
- if (this.defaultExpandLevel != void 0) {
58027
- node.expand = node.level <= this.defaultExpandLevel;
58028
- }
58029
58031
  node.checked = false;
58030
58032
  node.selected = false;
58031
58033
  }
@@ -58074,24 +58076,6 @@ const __vue2_script$J = {
58074
58076
  this.backupTreeData = _.cloneDeep(this.treeData);
58075
58077
  },
58076
58078
  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
- }
58083
- });
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
- }
58092
- });
58093
- node.expand = matched;
58094
- });
58095
58079
  },
58096
58080
  watchDataProp() {
58097
58081
  if (!this.dataApi) {
@@ -58108,10 +58092,16 @@ const __vue2_script$J = {
58108
58092
  console.log("not inited yet");
58109
58093
  return;
58110
58094
  }
58095
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58096
+ this.expandFirstLevel();
58097
+ }
58111
58098
  if (this.defaultValue.length) {
58112
58099
  this.setDefaultValue2Nodes();
58113
58100
  this.processAncestorNodesExpandStatus();
58114
58101
  this.scrollToDefaultNode();
58102
+ if (!this.foldFirstLevel && this.firstLeafByStatus.length < 1 && this.treeData.length) {
58103
+ this.expandFirstLevel();
58104
+ }
58115
58105
  this.$nextTick(() => {
58116
58106
  this.$emit(
58117
58107
  "on-default-change",
@@ -58121,8 +58111,7 @@ const __vue2_script$J = {
58121
58111
  } else {
58122
58112
  this.clearCheckedAndSelectedNodes(true);
58123
58113
  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);
58114
+ this.expandFirstLevel();
58126
58115
  }
58127
58116
  if (this.selectFirstLeaf) {
58128
58117
  this._selectFirstLeaf();
@@ -58250,7 +58239,6 @@ const __vue2_script$J = {
58250
58239
  checkAll = false;
58251
58240
  }
58252
58241
  });
58253
- console.log("checkAll", checkAll);
58254
58242
  curNode.indeterminate = false;
58255
58243
  if (checkAll) {
58256
58244
  curNode.checked = false;
@@ -58293,7 +58281,6 @@ const __vue2_script$J = {
58293
58281
  console.log("\u5355\u9009 \u975EleafOnly \u9009\u62E9\u4E86\u8282\u70B9");
58294
58282
  this.$emit("on-select-change", !nodes || nodes.length == 0 ? [curNode] : nodes, curNode);
58295
58283
  }
58296
- console.log("curNode is", curNode);
58297
58284
  curNode.expand = !curNode.expand;
58298
58285
  } else {
58299
58286
  deepEach$1(nodes, (node) => {
@@ -58309,7 +58296,6 @@ const __vue2_script$J = {
58309
58296
  deepEach$1(this.treeData, (node) => {
58310
58297
  if (selectNodes.includes(node.id)) {
58311
58298
  node.checked = true;
58312
- node.expand = true;
58313
58299
  } else {
58314
58300
  this.treeData[0].checked = false;
58315
58301
  node.checked = false;
@@ -58325,7 +58311,7 @@ const __vue2_script$J = {
58325
58311
  deepEach$1(this.backupTreeData, (node) => {
58326
58312
  if (selectNodes.includes(node.id)) {
58327
58313
  node.checked = true;
58328
- node.expand = true;
58314
+ node.expand = node.expand;
58329
58315
  } else {
58330
58316
  this.backupTreeData[0].checked = false;
58331
58317
  node.checked = false;
@@ -58484,11 +58470,11 @@ const __vue2_script$J = {
58484
58470
  }
58485
58471
  },
58486
58472
  highlightNodes(selectedTitles, callback) {
58487
- if (!selectedTitles) {
58488
- this.treeData = [];
58473
+ if (!selectedTitles || !selectedTitles[0]) {
58474
+ let checkedNodes2 = this.getCheckedNodes(true);
58489
58475
  this.treeData = _.cloneDeep(this.backupTreeData);
58490
58476
  this.$nextTick(() => {
58491
- this.$emit("on-check-change");
58477
+ this.$emit("on-check-change", checkedNodes2);
58492
58478
  });
58493
58479
  if (typeof callback === "function") {
58494
58480
  callback(0);
@@ -58522,7 +58508,11 @@ const __vue2_script$J = {
58522
58508
  }
58523
58509
  });
58524
58510
  }
58525
- 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
+ });
58526
58516
  if (typeof callback === "function") {
58527
58517
  callback(num);
58528
58518
  }