gcs-ui-lib 1.2.36 → 1.2.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcs-ui-lib",
3
- "version": "1.2.36",
3
+ "version": "1.2.38",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -524,7 +524,7 @@ const AutoFillListHeader = [
524
524
  align: "center",
525
525
  width: "120",
526
526
  formatter: ({ row }) => {
527
- return row.isAutoConfirm ? "是" : "否";
527
+ return row.isAutoConfirm ? $l("是") : $l("否");
528
528
  },
529
529
  },
530
530
  {
@@ -188,7 +188,7 @@ export default {
188
188
  } else if (this.type == "paymentCategory") {
189
189
  params = {
190
190
  activeFlag: 1,
191
- direction: this.settingSource == '1' ? 1 : 0,
191
+ directionList: [this.settingSource == '1' ? 1 : 0, 2].join(','),
192
192
  resultType: 2,
193
193
  };
194
194
  } else {
@@ -198,33 +198,8 @@ export default {
198
198
  }
199
199
  let res = await this.Api(params);
200
200
  res = this.tranData(res);
201
- if (this.type === "paymentCategory"){
202
- const res1 = await getPaymentCategory({ ...params, direction: "2" })
203
- this.treeData = this.mergeTree(res, res1);
204
- } else {
205
- this.type == "cashflow" && this.handleData(res);
206
- this.treeData = res;
207
- }
208
- },
209
-
210
- // 递归合并两棵款项类别树(按paymentCategoryNo去重)
211
- mergeTree(arr1, arr2) {
212
- const map = new Map();
213
- arr1?.forEach((item) => {
214
- map.set(item.paymentCategoryNo, item);
215
- });
216
- arr2?.forEach((item) => {
217
- if (map.has(item.paymentCategoryNo)) {
218
- const existing = map.get(item.paymentCategoryNo);
219
- existing.children = this.mergeTree(
220
- existing.children,
221
- item.children
222
- );
223
- } else {
224
- map.set(item.paymentCategoryNo, item);
225
- }
226
- });
227
- return Array.from(map.values());
201
+ this.type == "cashflow" && this.handleData(res);
202
+ this.treeData = res;
228
203
  },
229
204
  tranData(res) {
230
205
  const eachItem = (parent, list) => {
@@ -14,6 +14,7 @@
14
14
  >
15
15
  <div
16
16
  slot-scope="{ node, data }"
17
+ :class="data.disabled ? 'nstc-tree-disabled' : ''"
17
18
  class="flex-box flex-lr flex-v w-100p cl-tree-item"
18
19
  @mouseenter="mouseenterTree(node, data)"
19
20
  @mouseleave="checkFlag = false"
@@ -626,10 +626,14 @@ export default {
626
626
  // } else {
627
627
  this.getTreeData("1", { resolve, expandFlag: true });
628
628
  // }
629
- }).then((data) => {
630
- if (data) {
631
- //默认展开节点
632
- this.defaultExpandedKeys = [data.id];
629
+ }).then(() => {
630
+ if (this.searchKey) {
631
+ //搜索时展开所有有子节点的父级路径
632
+ let expandKeys = [];
633
+ this.collectExpandKeys(this.data, expandKeys);
634
+ this.defaultExpandedKeys = expandKeys;
635
+ } else {
636
+ this.defaultExpandedKeys = [];
633
637
  }
634
638
  });
635
639
  }
@@ -1135,6 +1139,15 @@ export default {
1135
1139
  }
1136
1140
  });
1137
1141
  },
1142
+ collectExpandKeys(arr, keys) {
1143
+ if (!arr) return;
1144
+ arr.forEach((a) => {
1145
+ if (a.children && Array.isArray(a.children) && a.children.length > 0) {
1146
+ keys.push(a.id);
1147
+ this.collectExpandKeys(a.children, keys);
1148
+ }
1149
+ });
1150
+ },
1138
1151
  },
1139
1152
  };
1140
1153
  </script>
@@ -613,10 +613,14 @@ export default {
613
613
  } else {
614
614
  this.getTreeData("1", { resolve, expandFlag: true });
615
615
  }
616
- }).then((data) => {
617
- if (data) {
618
- //默认展开节点
619
- this.defaultExpandedKeys = [data.id];
616
+ }).then(() => {
617
+ if (this.searchKey) {
618
+ //搜索时展开所有有子节点的父级路径
619
+ let expandKeys = [];
620
+ this.collectExpandKeys(this.data, expandKeys);
621
+ this.defaultExpandedKeys = expandKeys;
622
+ } else {
623
+ this.defaultExpandedKeys = [];
620
624
  }
621
625
  });
622
626
  }
@@ -907,6 +911,15 @@ export default {
907
911
  }
908
912
  });
909
913
  },
914
+ collectExpandKeys(arr, keys) {
915
+ if (!arr) return;
916
+ arr.forEach((a) => {
917
+ if (a.children && Array.isArray(a.children) && a.children.length > 0) {
918
+ keys.push(a.id);
919
+ this.collectExpandKeys(a.children, keys);
920
+ }
921
+ });
922
+ },
910
923
  nodeClick(data) {
911
924
  this.$refs.tree.showDropMenu = null;
912
925
  //单选才会进入
@@ -381,7 +381,7 @@
381
381
  "en": "name of opposite Dep. bank"
382
382
  },
383
383
  "对方户名": {
384
- "en": "Counterparty Acct Name"
384
+ "en": "Beneficiary Name"
385
385
  },
386
386
  "对方账号": {
387
387
  "en": "Opposite Account"