@voplus/morpho-document 5.0.77 → 5.0.79
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.
|
@@ -2,9 +2,11 @@ import { ILetter } from "../../data/envelope";
|
|
|
2
2
|
export declare class State {
|
|
3
3
|
lines: readonly ILetter[];
|
|
4
4
|
userId: string;
|
|
5
|
+
removeDuplicatesList: ILetter[];
|
|
5
6
|
referenceList: ILetter[];
|
|
6
7
|
signedList: ILetter[];
|
|
7
8
|
pendingList: ILetter[];
|
|
8
9
|
constructor(lines: readonly ILetter[], userId: string);
|
|
9
|
-
|
|
10
|
+
private removeDuplicates;
|
|
11
|
+
private loadMenuItems;
|
|
10
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { makeObservable, observable, action } from "mobx";
|
|
3
|
+
import { clone } from "lodash-es";
|
|
3
4
|
export class State {
|
|
4
5
|
constructor(lines, userId) {
|
|
5
6
|
Object.defineProperty(this, "lines", {
|
|
@@ -14,6 +15,13 @@ export class State {
|
|
|
14
15
|
writable: true,
|
|
15
16
|
value: userId
|
|
16
17
|
});
|
|
18
|
+
// 如果同一个文件的两个签名人是同一个人, 则去掉其中的一项
|
|
19
|
+
Object.defineProperty(this, "removeDuplicatesList", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: []
|
|
24
|
+
});
|
|
17
25
|
Object.defineProperty(this, "referenceList", {
|
|
18
26
|
enumerable: true,
|
|
19
27
|
configurable: true,
|
|
@@ -33,10 +41,26 @@ export class State {
|
|
|
33
41
|
value: []
|
|
34
42
|
});
|
|
35
43
|
makeObservable(this);
|
|
44
|
+
this.removeDuplicates();
|
|
45
|
+
}
|
|
46
|
+
removeDuplicates() {
|
|
47
|
+
this.removeDuplicatesList = clone(this.lines);
|
|
48
|
+
this.removeDuplicatesList.map((letter) => {
|
|
49
|
+
let signArr = [];
|
|
50
|
+
letter.signatureLines.map((sign) => {
|
|
51
|
+
var _a;
|
|
52
|
+
signArr.push((_a = sign.signer) === null || _a === void 0 ? void 0 : _a.id);
|
|
53
|
+
});
|
|
54
|
+
// 判断同一个文件中有2个签名人, 并且两个签名人为同一个人
|
|
55
|
+
if (signArr.length === 2 && new Set(signArr).size === 1) {
|
|
56
|
+
// 如果两个签名人为同一个人, 则去掉后面一个
|
|
57
|
+
letter.signatureLines.pop();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
36
60
|
this.loadMenuItems();
|
|
37
61
|
}
|
|
38
62
|
loadMenuItems() {
|
|
39
|
-
this.
|
|
63
|
+
this.removeDuplicatesList.map((letter) => {
|
|
40
64
|
if (!letter.signatureLines.find((s) => { var _a; return ((_a = s.signer) === null || _a === void 0 ? void 0 : _a.id) === this.userId; })) {
|
|
41
65
|
this.referenceList.push(letter);
|
|
42
66
|
}
|
|
@@ -54,6 +78,9 @@ export class State {
|
|
|
54
78
|
});
|
|
55
79
|
}
|
|
56
80
|
}
|
|
81
|
+
__decorate([
|
|
82
|
+
observable
|
|
83
|
+
], State.prototype, "removeDuplicatesList", void 0);
|
|
57
84
|
__decorate([
|
|
58
85
|
observable
|
|
59
86
|
], State.prototype, "referenceList", void 0);
|
|
@@ -63,6 +90,9 @@ __decorate([
|
|
|
63
90
|
__decorate([
|
|
64
91
|
observable
|
|
65
92
|
], State.prototype, "pendingList", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
action
|
|
95
|
+
], State.prototype, "removeDuplicates", null);
|
|
66
96
|
__decorate([
|
|
67
97
|
action
|
|
68
98
|
], State.prototype, "loadMenuItems", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/Letter/LetterRecipientItem/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+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