gcs-ui-lib 1.2.35 → 1.2.37
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/lib/gcs-ui-lib.common.js +912 -1082
- package/lib/gcs-ui-lib.css +3 -2
- package/lib/gcs-ui-lib.umd.js +912 -1082
- package/lib/gcs-ui-lib.umd.min.js +29 -29
- package/package.json +1 -1
- package/packages/AutoFillService/src/components/paymentCategoryT.vue +29 -4
- package/packages/SelectTreeUnit/src/Tree/index.vue +1 -0
- package/packages/SelectTreeUnit/src/main.vue +17 -4
- package/packages/SelectTreeUnitForm/src/main.vue +17 -4
- package/packages/Trade/src/components/i18n.json +3337 -3337
- package/src/lang/i18n.json +1184 -1184
package/package.json
CHANGED
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
22
|
+
import {getCashflow, getPaymentCategory, getRecUnit} from "@/api/common";
|
|
23
|
+
import {SelectTree} from "n20-common-lib";
|
|
24
|
+
|
|
24
25
|
export default {
|
|
25
26
|
props: {
|
|
26
27
|
value: {
|
|
@@ -197,10 +198,34 @@ export default {
|
|
|
197
198
|
}
|
|
198
199
|
let res = await this.Api(params);
|
|
199
200
|
res = this.tranData(res);
|
|
200
|
-
this.type
|
|
201
|
-
|
|
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
|
+
}
|
|
202
208
|
},
|
|
203
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());
|
|
228
|
+
},
|
|
204
229
|
tranData(res) {
|
|
205
230
|
const eachItem = (parent, list) => {
|
|
206
231
|
list.forEach((item) => {
|
|
@@ -626,10 +626,14 @@ export default {
|
|
|
626
626
|
// } else {
|
|
627
627
|
this.getTreeData("1", { resolve, expandFlag: true });
|
|
628
628
|
// }
|
|
629
|
-
}).then((
|
|
630
|
-
if (
|
|
631
|
-
|
|
632
|
-
|
|
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((
|
|
617
|
-
if (
|
|
618
|
-
|
|
619
|
-
|
|
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
|
//单选才会进入
|