@voplus/morpho-workspace 1.1.0-dev014 → 1.1.0-dev016
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 +5 -3
- package/es/data/board/BoardColumnStore.d.ts +3 -13
- package/es/data/board/BoardColumnStore.js +2 -24
- package/es/data/board/BoardColumnStore.js.map +1 -1
- package/es/data/board/BoardStore.d.ts +2 -12
- package/es/data/board/BoardStore.js +1 -23
- package/es/data/board/BoardStore.js.map +1 -1
- package/es/data/board/contexts/BoardListContextState/index.d.ts +19 -0
- package/es/data/board/contexts/BoardListContextState/index.js +49 -0
- package/es/data/board/contexts/BoardListContextState/index.js.map +1 -0
- package/es/data/board/index.d.ts +1 -1
- package/es/data/board/index.js +1 -1
- package/es/data/board/index.js.map +1 -1
- package/es/modules/board/components/Board/index.js +34 -41
- package/es/modules/board/components/Board/index.js.map +1 -1
- package/es/modules/board/components/Board/index.less +83 -51
- package/es/modules/board/components/Board/state.d.ts +22 -5
- package/es/modules/board/components/Board/state.js +70 -15
- package/es/modules/board/components/Board/state.js.map +1 -1
- package/es/modules/board/components/BoardColumn/index.js +21 -35
- package/es/modules/board/components/BoardColumn/index.js.map +1 -1
- package/es/modules/board/components/BoardColumn/index.less +22 -12
- package/es/modules/board/components/BoardColumn/state.d.ts +17 -18
- package/es/modules/board/components/BoardColumn/state.js +43 -42
- package/es/modules/board/components/BoardColumn/state.js.map +1 -1
- package/es/modules/board/components/DocumentCard/index.d.ts +0 -2
- package/es/modules/board/components/DocumentCard/index.js +16 -79
- package/es/modules/board/components/DocumentCard/index.js.map +1 -1
- package/es/modules/board/components/DocumentCard/index.less +16 -13
- package/es/modules/board/components/DocumentCard/state.d.ts +6 -6
- package/es/modules/board/components/DocumentCard/state.js +34 -21
- package/es/modules/board/components/DocumentCard/state.js.map +1 -1
- package/es/modules/board/components/SubDocument/index.d.ts +13 -0
- package/es/modules/board/components/SubDocument/index.js +13 -0
- package/es/modules/board/components/SubDocument/index.js.map +1 -0
- package/es/modules/board/components/SubDocumentList/index.d.ts +4 -0
- package/es/modules/board/components/SubDocumentList/index.js +74 -0
- package/es/modules/board/components/SubDocumentList/index.js.map +1 -0
- package/es/modules/board/components/SubDocumentList/index.less +28 -0
- package/es/modules/board/components/SubDocumentList/state.d.ts +25 -0
- package/es/modules/board/components/SubDocumentList/state.js +60 -0
- package/es/modules/board/components/SubDocumentList/state.js.map +1 -0
- package/es/modules/board/components/TaskCard/index.js +27 -76
- package/es/modules/board/components/TaskCard/index.js.map +1 -1
- package/es/modules/board/components/TaskCard/index.less +9 -4
- package/es/modules/board/components/TaskCard/state.d.ts +1 -8
- package/es/modules/board/components/TaskCard/state.js +28 -23
- package/es/modules/board/components/TaskCard/state.js.map +1 -1
- package/package.json +1 -1
- package/es/data/board/LinkStore.d.ts +0 -11
- package/es/data/board/LinkStore.js +0 -44
- package/es/data/board/LinkStore.js.map +0 -1
- package/es/modules/board/components/LinkList/index.d.ts +0 -4
- package/es/modules/board/components/LinkList/index.js +0 -38
- package/es/modules/board/components/LinkList/index.js.map +0 -1
- package/es/modules/board/components/LinkList/state.d.ts +0 -15
- package/es/modules/board/components/LinkList/state.js +0 -37
- package/es/modules/board/components/LinkList/state.js.map +0 -1
- package/es/modules/board/components/links/index.d.ts +0 -12
- package/es/modules/board/components/links/index.js +0 -26
- package/es/modules/board/components/links/index.js.map +0 -1
@@ -1,110 +1,47 @@
|
|
1
|
-
import { Button, Checkbox
|
1
|
+
import { Button, Checkbox } from "@voplus/antd";
|
2
2
|
import React, { useState } from "react";
|
3
|
-
import { faBars,
|
3
|
+
import { faBars, faSave, faUndo } from "@fortawesome/pro-light-svg-icons";
|
4
4
|
import { useDocument, useDocumentStore } from "@voplus/morpho-document";
|
5
5
|
import Card from "@voplus/morpho-ui/es/controls/Card";
|
6
|
-
import
|
6
|
+
import DocumentName from "@voplus/morpho-document/es/components/DocumentName";
|
7
7
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
8
8
|
import FlagIcon from "@voplus/morpho-document/es/controls/FlagIcon";
|
9
|
-
import
|
9
|
+
import QuickDataIcon from "@voplus/morpho-document/es/controls/QuickDataIcon";
|
10
10
|
import { State } from "./state";
|
11
11
|
import ToolBar from "@voplus/morpho-document/es/controls/ToolBar";
|
12
12
|
import classnames from "classnames";
|
13
13
|
import styles from "./index.less";
|
14
|
-
import { useLayout } from "@voplus/morpho-data";
|
15
14
|
import { useObserver } from "mobx-react-lite";
|
16
15
|
const DocumentCard = (props) => {
|
17
|
-
const [state] = useState(new State());
|
18
|
-
const [store] = useState(new LinkStore());
|
19
16
|
const documentStore = useDocumentStore();
|
17
|
+
const [state] = useState(new State(documentStore));
|
20
18
|
const [parentReadonly, setParentReadonly] = useState(false);
|
21
|
-
const { id
|
19
|
+
const { id } = { ...props };
|
22
20
|
state.reload = !!props.reload;
|
23
21
|
state.document = useDocument(props.id, { reload: parentReadonly });
|
24
22
|
const readonly = state.document.status === "Readonly";
|
25
|
-
const onSave = async () => {
|
26
|
-
if (!state.name) {
|
27
|
-
return message.warn("Title is required");
|
28
|
-
}
|
29
|
-
if (state.name.trim() === state.document.name) {
|
30
|
-
// 没有变动无需请求
|
31
|
-
return (state.editable = false);
|
32
|
-
}
|
33
|
-
state.loading = true;
|
34
|
-
await documentStore.edit(props.id, { Name: state.name });
|
35
|
-
state.editable = !state.editable;
|
36
|
-
state.loading = false;
|
37
|
-
};
|
38
|
-
const onEdit = () => {
|
39
|
-
state.name = state.document.name;
|
40
|
-
state.isHover = false;
|
41
|
-
state.editable = !state.editable;
|
42
|
-
};
|
43
|
-
const onDelete = () => {
|
44
|
-
documentStore.editLinks(props.leftId, { RemoveLinks: [props.linkId] });
|
45
|
-
};
|
46
|
-
const onMove = () => {
|
47
|
-
store.onMove([{ leftId: leftId, rightId: id, linkId: linkId }]);
|
48
|
-
};
|
49
|
-
const onPaste = async () => {
|
50
|
-
const moveIds = store.moveIds.map((item) => item.rightId);
|
51
|
-
if (moveIds.some((id) => id === props.id))
|
52
|
-
return message.warn("Cannot move to itself");
|
53
|
-
store.onPaste(async () => {
|
54
|
-
await documentStore.move(moveIds, id);
|
55
|
-
});
|
56
|
-
state.reload = true;
|
57
|
-
};
|
58
|
-
const onLock = () => {
|
59
|
-
documentStore.edit(state.document.id, { Status: "Readonly" });
|
60
|
-
};
|
61
|
-
const onUnlock = () => {
|
62
|
-
documentStore.edit(state.document.id, { Status: "Normal" });
|
63
|
-
};
|
64
|
-
const onChangeImportant = (e) => {
|
65
|
-
if (readonly)
|
66
|
-
return;
|
67
|
-
e.stopPropagation();
|
68
|
-
};
|
69
|
-
const layout = useLayout();
|
70
|
-
layout.history.listen(() => {
|
71
|
-
state.visible = false;
|
72
|
-
state.visibleQuickView = false;
|
73
|
-
});
|
74
|
-
const iconList = (React.createElement(React.Fragment, null,
|
75
|
-
React.createElement("span", null,
|
76
|
-
React.createElement(FAIcon, { icon: faPaperclip }),
|
77
|
-
state.document.documents || 0),
|
78
|
-
React.createElement("span", null,
|
79
|
-
React.createElement(FAIcon, { icon: faCommentDots }),
|
80
|
-
state.document.comments || 0),
|
81
|
-
React.createElement("span", null,
|
82
|
-
React.createElement(FAIcon, { icon: faCopy }),
|
83
|
-
0)));
|
84
23
|
const { multiple } = props;
|
85
24
|
return useObserver(() => {
|
86
|
-
var _a
|
25
|
+
var _a;
|
87
26
|
return (React.createElement(Card, { className: styles["task-card"], padding: "15px 12px", shadow: true },
|
88
27
|
React.createElement("div", { className: "task-card-item", onMouseOver: () => (state.isHover = true), onMouseLeave: () => (state.isHover = false) },
|
89
28
|
React.createElement("div", { className: "task-card-head" },
|
90
29
|
multiple && React.createElement(Checkbox, { value: state.document.id, className: "multiple-box" }),
|
91
|
-
!multiple && (React.createElement(FlagIcon, { id: state.document.id, editable: !readonly, flag: state.document.flag,
|
92
|
-
|
93
|
-
React.createElement(Input.TextArea, { className: "task-card-title", autoSize: true, autoFocus: true, value: state.name, onChange: e => (state.name = e.target.value) }))) : (React.createElement("div", { className: "task-card-title", onClick: () => (state.visibleQuickView = true) }, ((_a = state.document.name) === null || _a === void 0 ? void 0 : _a.length) > 25 ? (React.createElement(Tooltip, { title: state.document.name, placement: "topLeft" },
|
94
|
-
React.createElement("span", null, state.document.name))) : (state.document.name)))),
|
30
|
+
!multiple && (React.createElement(FlagIcon, { id: state.document.id, editable: !readonly, flag: state.document.flag, className: "task-flag" })),
|
31
|
+
React.createElement(DocumentName, { id: id, includes: "tags,task-number-reports", editable: state.editable, onChange: value => (state.name = value), className: "task-name", status: false, showTags: false })),
|
95
32
|
React.createElement("div", { className: "task-card-control" },
|
96
33
|
state.isHover &&
|
97
|
-
!multiple && ((
|
98
|
-
|
34
|
+
!multiple && ((_a = props.connectDragSource) === null || _a === void 0 ? void 0 : _a.call(props, React.createElement("span", { className: classnames("task-icon-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars })))),
|
35
|
+
React.createElement("div", null,
|
36
|
+
React.createElement(QuickDataIcon, { id: id }))),
|
99
37
|
React.createElement("div", { className: "task-card-label" },
|
100
38
|
state.isHover && !state.editable && (React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
101
|
-
React.createElement(ToolBar, { id: props.id, size: "small", url: `/document/${props.id}`, edit: false, hoverEdit: !readonly,
|
39
|
+
React.createElement(ToolBar, { id: props.id, size: "small", url: `/document/${props.id}`, edit: false, hoverEdit: !readonly, onEdit: () => state.onEdit() }))),
|
102
40
|
state.editable && (React.createElement("div", { className: "task-card-editable-name" },
|
103
|
-
React.createElement(Button, { shape: "circle",
|
41
|
+
React.createElement(Button, { shape: "circle", onClick: () => (state.editable = false) },
|
104
42
|
React.createElement(FAIcon, { icon: faUndo })),
|
105
|
-
React.createElement(Button, { type: "primary",
|
106
|
-
React.createElement(FAIcon, { icon: faSave }))))))
|
107
|
-
React.createElement(DocumentQuickViewDialog, { id: props.id, doc: state.document, visible: state.visibleQuickView, onCancel: () => (state.visibleQuickView = false) })));
|
43
|
+
React.createElement(Button, { type: "primary", ghost: true, shape: "circle", disabled: !state.hasChanges, loading: state.loading, className: "margin-left-10", onClick: () => state.save() },
|
44
|
+
React.createElement(FAIcon, { icon: faSave }))))))));
|
108
45
|
});
|
109
46
|
};
|
110
47
|
export default DocumentCard;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/DocumentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/DocumentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,QAAQ,MAAM,8CAA8C,CAAC;AACpE,OAAO,aAAa,MAAM,mDAAmD,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,OAAO,MAAM,6CAA6C,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,YAAY,GAAG,CAAC,KAKrB,EAAE,EAAE;IACJ,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,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,CAAC,QAAQ,GAAG,KAAK,CAAC;4BAC7D,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CAChB;wBACT,oBAAC,MAAM,IACN,IAAI,EAAC,SAAS,EACd,KAAK,QACL,KAAK,EAAC,QAAQ,EACd,QAAQ,EAAE,CAAC,KAAK,CAAC,UAAU,EAC3B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE;4BAE3B,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CAChB,CACJ,CACN,CACI,CACD,CACA,CACP,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -1,29 +1,32 @@
|
|
1
1
|
@import "../../../../style/common.less";
|
2
2
|
.task-card {
|
3
|
-
margin-bottom: 15px;
|
3
|
+
// margin-bottom: 15px;
|
4
4
|
background: #ffffff;
|
5
5
|
cursor: pointer;
|
6
6
|
:global {
|
7
7
|
.task-card-head {
|
8
8
|
display: flex;
|
9
9
|
align-items: center;
|
10
|
-
.task-
|
11
|
-
|
12
|
-
font-size: 16px;
|
13
|
-
color: #000000;
|
14
|
-
white-space: nowrap;
|
15
|
-
overflow: hidden;
|
16
|
-
text-overflow: ellipsis;
|
17
|
-
margin-left: 6px;
|
10
|
+
.task-flag {
|
11
|
+
width: 20px;
|
18
12
|
}
|
13
|
+
// .task-card-title {
|
14
|
+
// flex: 1;
|
15
|
+
// // max-width: 100px;
|
16
|
+
// font-size: 16px;
|
17
|
+
// color: #000000;
|
18
|
+
// white-space: nowrap;
|
19
|
+
// overflow: hidden;
|
20
|
+
// text-overflow: ellipsis;
|
21
|
+
// margin-left: 6px;
|
22
|
+
// }
|
19
23
|
}
|
20
24
|
.task-card-control {
|
21
|
-
margin-top: 6px;
|
22
25
|
display: flex;
|
23
26
|
align-items: center;
|
24
|
-
padding: 5px 0;
|
25
27
|
font-size: 13px;
|
26
28
|
color: #666;
|
29
|
+
line-height: 24px;
|
27
30
|
& > span {
|
28
31
|
display: flex;
|
29
32
|
align-items: center;
|
@@ -47,8 +50,8 @@
|
|
47
50
|
}
|
48
51
|
}
|
49
52
|
.task-card-label {
|
50
|
-
height:
|
51
|
-
margin-top:
|
53
|
+
height: 24px;
|
54
|
+
margin-top: 4px;
|
52
55
|
.item {
|
53
56
|
display: inline-block;
|
54
57
|
font-size: 13px;
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import { IDocument } from "@voplus/morpho-document";
|
1
|
+
import { DocumentStore, IDocument } from "@voplus/morpho-document";
|
2
2
|
export declare class State {
|
3
|
+
private store;
|
3
4
|
document: IDocument;
|
4
5
|
id: string;
|
5
|
-
ids: string[];
|
6
|
-
members: any[];
|
7
6
|
name: string;
|
8
7
|
editable: boolean;
|
9
8
|
loading: boolean;
|
10
|
-
visible: boolean;
|
11
|
-
visibleQuickView: boolean;
|
12
|
-
modalType: string;
|
13
9
|
isHover: boolean;
|
14
10
|
reload: boolean;
|
11
|
+
constructor(store: DocumentStore);
|
12
|
+
get hasChanges(): boolean | undefined;
|
13
|
+
save: () => Promise<void>;
|
14
|
+
onEdit: () => void;
|
15
15
|
}
|
@@ -1,19 +1,38 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { observable } from "mobx";
|
2
|
+
import { action, computed, observable } from "mobx";
|
3
|
+
import { isEqual } from "lodash-es";
|
3
4
|
let State = /** @class */ (() => {
|
4
5
|
class State {
|
5
|
-
constructor() {
|
6
|
+
constructor(store) {
|
7
|
+
this.store = store;
|
6
8
|
this.id = "";
|
7
|
-
this.ids = [];
|
8
|
-
this.members = [];
|
9
9
|
this.name = "";
|
10
10
|
this.editable = false;
|
11
11
|
this.loading = false;
|
12
|
-
this.visible = false;
|
13
|
-
this.visibleQuickView = false;
|
14
|
-
this.modalType = "";
|
15
12
|
this.isHover = false;
|
16
13
|
this.reload = false;
|
14
|
+
this.save = async () => {
|
15
|
+
const params = { Name: this.name };
|
16
|
+
this.loading = true;
|
17
|
+
await this.store.edit(this.document.id, params);
|
18
|
+
this.loading = false;
|
19
|
+
this.editable = false;
|
20
|
+
};
|
21
|
+
this.onEdit = () => {
|
22
|
+
this.name = this.document.name;
|
23
|
+
this.isHover = false;
|
24
|
+
this.editable = !this.editable;
|
25
|
+
};
|
26
|
+
}
|
27
|
+
get hasChanges() {
|
28
|
+
if (!this.name)
|
29
|
+
return;
|
30
|
+
const { name } = this.document;
|
31
|
+
const originalData = { name };
|
32
|
+
const modifiedData = {
|
33
|
+
name: this.name.trim()
|
34
|
+
};
|
35
|
+
return !isEqual(originalData, modifiedData);
|
17
36
|
}
|
18
37
|
}
|
19
38
|
__decorate([
|
@@ -22,12 +41,6 @@ let State = /** @class */ (() => {
|
|
22
41
|
__decorate([
|
23
42
|
observable
|
24
43
|
], State.prototype, "id", void 0);
|
25
|
-
__decorate([
|
26
|
-
observable
|
27
|
-
], State.prototype, "ids", void 0);
|
28
|
-
__decorate([
|
29
|
-
observable
|
30
|
-
], State.prototype, "members", void 0);
|
31
44
|
__decorate([
|
32
45
|
observable
|
33
46
|
], State.prototype, "name", void 0);
|
@@ -39,19 +52,19 @@ let State = /** @class */ (() => {
|
|
39
52
|
], State.prototype, "loading", void 0);
|
40
53
|
__decorate([
|
41
54
|
observable
|
42
|
-
], State.prototype, "
|
55
|
+
], State.prototype, "isHover", void 0);
|
43
56
|
__decorate([
|
44
57
|
observable
|
45
|
-
], State.prototype, "
|
58
|
+
], State.prototype, "reload", void 0);
|
46
59
|
__decorate([
|
47
|
-
|
48
|
-
], State.prototype, "
|
60
|
+
computed
|
61
|
+
], State.prototype, "hasChanges", null);
|
49
62
|
__decorate([
|
50
|
-
|
51
|
-
], State.prototype, "
|
63
|
+
action
|
64
|
+
], State.prototype, "save", void 0);
|
52
65
|
__decorate([
|
53
|
-
|
54
|
-
], State.prototype, "
|
66
|
+
action
|
67
|
+
], State.prototype, "onEdit", void 0);
|
55
68
|
return State;
|
56
69
|
})();
|
57
70
|
export { State };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/DocumentCard/state.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/DocumentCard/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;IAAA,MAAa,KAAK;QASjB,YAA2B,KAAoB;YAApB,UAAK,GAAL,KAAK,CAAe;YAP5B,OAAE,GAAG,EAAE,CAAC;YACR,SAAI,GAAG,EAAE,CAAC;YACV,aAAQ,GAAG,KAAK,CAAC;YACjB,YAAO,GAAG,KAAK,CAAC;YAChB,YAAO,GAAG,KAAK,CAAC;YAChB,WAAM,GAAG,KAAK,CAAC;YAgB3B,SAAI,GAAG,KAAK,IAAI,EAAE;gBACxB,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAS,CAAC;gBAC1C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBACpB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;gBAChD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACvB,CAAC,CAAC;YAGK,WAAM,GAAG,GAAG,EAAE;gBACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;YAChC,CAAC,CAAC;QA3BgD,CAAC;QAGnD,IAAW,UAAU;YACpB,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YACvB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC/B,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,CAAC;YAC9B,MAAM,YAAY,GAAG;gBACpB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;aACtB,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC7C,CAAC;KAiBD;IApCY;QAAX,UAAU;2CAA4B;IAC3B;QAAX,UAAU;qCAAgB;IACf;QAAX,UAAU;uCAAkB;IACjB;QAAX,UAAU;2CAAyB;IACxB;QAAX,UAAU;0CAAwB;IACvB;QAAX,UAAU;0CAAwB;IACvB;QAAX,UAAU;yCAAuB;IAKlC;QADC,QAAQ;2CASR;IAGD;QADC,MAAM;uCAOL;IAGF;QADC,MAAM;yCAKL;IACH,YAAC;KAAA;SArCY,KAAK"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const SubDocument: (props: {
|
3
|
+
id: string;
|
4
|
+
/** Droppable type */
|
5
|
+
listType?: string | undefined;
|
6
|
+
/** sub-document length ids */
|
7
|
+
onDocumentData?: ((params?: any) => void) | undefined;
|
8
|
+
/** move 目标数据 */
|
9
|
+
destination?: any;
|
10
|
+
/** move 原数据 */
|
11
|
+
source?: any;
|
12
|
+
}) => JSX.Element;
|
13
|
+
export default SubDocument;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Droppable } from "react-beautiful-dnd";
|
2
|
+
import React from "react";
|
3
|
+
import SubDocumentList from "../SubDocumentList";
|
4
|
+
import { useObserver } from "mobx-react-lite";
|
5
|
+
const SubDocument = (props) => {
|
6
|
+
const { id = "LIST", listType, destination, source } = props;
|
7
|
+
return useObserver(() => (React.createElement(Droppable, { droppableId: id, type: listType }, (dropProvided, dropSnapshot) => (React.createElement("div", Object.assign({ className: "wrapper", isdraggingover: dropSnapshot.isDraggingOver.toString(), isdraggingfrom: Boolean(dropSnapshot.draggingFromThisWith).toString() }, dropProvided.droppableProps),
|
8
|
+
React.createElement("div", { className: "dropZone", ref: dropProvided.innerRef },
|
9
|
+
React.createElement(SubDocumentList, { id: id, onDocumentData: props.onDocumentData, destination: destination, source: source }),
|
10
|
+
dropProvided.placeholder))))));
|
11
|
+
};
|
12
|
+
export default SubDocument;
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/SubDocument/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,CAAC,KAUpB,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC7D,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,oBAAC,SAAS,IAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,IACxC,CAAC,YAAiB,EAAE,YAAiB,EAAE,EAAE,CAAC,CAC1C,2CACC,SAAS,EAAC,SAAS,EACnB,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,QAAQ,EAAE,EACtD,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,IACjE,YAAY,CAAC,cAAc;QAE/B,6BAAK,SAAS,EAAC,UAAU,EAAC,GAAG,EAAE,YAAY,CAAC,QAAQ;YACnD,oBAAC,eAAe,IACf,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,GACb;YACD,YAAY,CAAC,WAAW,CACpB,CACD,CACN,CACU,CACZ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import { useDocumentListEffect, useDocumentStore, useOnDeleteDocument, useOnNewDocument } from "@voplus/morpho-document";
|
2
|
+
import React, { useEffect, useState } from "react";
|
3
|
+
import { Spin, Upload, message } from "@voplus/antd";
|
4
|
+
import { State } from "./state";
|
5
|
+
import { observer, useObserver } from "mobx-react-lite";
|
6
|
+
import DocumentCard from "../DocumentCard";
|
7
|
+
import { Draggable } from "react-beautiful-dnd";
|
8
|
+
import { LoadingOutlined } from "@ant-design/icons";
|
9
|
+
import TaskCard from "../TaskCard";
|
10
|
+
import styles from "./index.less";
|
11
|
+
import { useBoardtListContext } from "../../../../data/board";
|
12
|
+
import { useListDataContext } from "@voplus/morpho-ui/es/data";
|
13
|
+
const SubDocumentList = (props) => {
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
15
|
+
const [state] = useState(new State());
|
16
|
+
/** DocumentList filters list options */
|
17
|
+
const list = useListDataContext();
|
18
|
+
const lists = useBoardtListContext();
|
19
|
+
const store = useDocumentStore();
|
20
|
+
state.props = props;
|
21
|
+
const { destination, source } = { ...props };
|
22
|
+
state.destination = props.destination;
|
23
|
+
state.source = props.source;
|
24
|
+
/** filters - useListDataContext
|
25
|
+
* Filters , Sort
|
26
|
+
*/
|
27
|
+
let filters = [];
|
28
|
+
if ((_b = (_a = list.filters) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.Filters) {
|
29
|
+
filters = (_d = (_c = list.filters) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.Filters;
|
30
|
+
}
|
31
|
+
/** filters - useBoardtListContext
|
32
|
+
* Filters.name
|
33
|
+
*/
|
34
|
+
let opts = [];
|
35
|
+
if ((_e = lists.options) === null || _e === void 0 ? void 0 : _e.Filters) {
|
36
|
+
opts = (_f = lists.options) === null || _f === void 0 ? void 0 : _f.Filters;
|
37
|
+
}
|
38
|
+
useEffect(() => {
|
39
|
+
state.move();
|
40
|
+
}, [destination, source]);
|
41
|
+
useDocumentListEffect(null, (list) => {
|
42
|
+
state.lists = list;
|
43
|
+
state.loading = false;
|
44
|
+
props.onDocumentData(state.docData);
|
45
|
+
}, {
|
46
|
+
Filters: [...filters, ...opts, { c: "ParentNodeId", o: "=", l: "And", v1: props.id }]
|
47
|
+
});
|
48
|
+
useOnNewDocument((s, doc) => {
|
49
|
+
if (doc.parentNodeId === props.id && doc.parentNodeId !== (destination === null || destination === void 0 ? void 0 : destination.parentId)) {
|
50
|
+
state.lists.push(doc);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
useOnDeleteDocument((s, doc) => {
|
54
|
+
if (doc.parentNodeId === props.id && doc.parentNodeId !== (source === null || source === void 0 ? void 0 : source.parentId)) {
|
55
|
+
state.lists =
|
56
|
+
doc instanceof Array
|
57
|
+
? state.lists.filter(item => !doc.some(({ id }) => item.id === id))
|
58
|
+
: state.lists.filter(item => item.id !== doc.id);
|
59
|
+
}
|
60
|
+
});
|
61
|
+
return useObserver(() => (React.createElement("div", { className: styles["link-list-page"] },
|
62
|
+
React.createElement(Upload.Dragger, { className: "link-upload", customRequest: (option) => customRequest(option), showUploadList: false, openFileDialogOnClick: false, multiple: true },
|
63
|
+
state.lists.map((item, index) => (React.createElement(Draggable, { key: item.id, draggableId: item.id, index: index }, (dragProvided, dragSnapshot) => (React.createElement("div", Object.assign({ className: "link-container", isdragging: dragSnapshot.isDragging.toString(), isgroupedover: Boolean(dragSnapshot.combineTargetFor).toString(), ref: dragProvided.innerRef }, dragProvided.draggableProps, dragProvided.dragHandleProps, { "data-is-dragging": dragSnapshot.isDragging, "data-testid": props.id, "data-index": index }),
|
64
|
+
React.createElement("div", { className: "link-content" }, item.type === "Task" ? React.createElement(TaskCard, { id: item.id }) : React.createElement(DocumentCard, { id: item.id }))))))),
|
65
|
+
state.loading && (React.createElement("div", { className: "list-loading" },
|
66
|
+
React.createElement(Spin, { tip: "Loading...", indicator: React.createElement(LoadingOutlined, null) })))))));
|
67
|
+
/** upload */
|
68
|
+
async function customRequest(option) {
|
69
|
+
await store.upload(props.id, [option.file]);
|
70
|
+
message.success(`${option.file.name} file uploaded successfully.`);
|
71
|
+
}
|
72
|
+
};
|
73
|
+
export default observer(SubDocumentList);
|
74
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/SubDocumentList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGN,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAwB,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;;IACvD,MAAM,CAAC,KAAK,CAAC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C,IAAI,CAAC,IAAI,8BAA8B,CAAC,CAAC;IACpE,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC,eAAe,CAAC,CAAC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.link-list-page {
|
2
|
+
height: 100%;
|
3
|
+
:global {
|
4
|
+
.link-upload {
|
5
|
+
background: transparent;
|
6
|
+
border: none;
|
7
|
+
border-radius: none;
|
8
|
+
&.ant-upload.ant-upload-drag {
|
9
|
+
text-align: left;
|
10
|
+
}
|
11
|
+
&.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-updoad-disabled) {
|
12
|
+
border: solid 2px #1890ff;
|
13
|
+
}
|
14
|
+
&.ant-upload.ant-upload-drag .ant-upload {
|
15
|
+
padding: 0;
|
16
|
+
width: 100%;
|
17
|
+
}
|
18
|
+
&.ant-upload.ant-upload-drag .ant-upload-drag-container {
|
19
|
+
display: block;
|
20
|
+
height: 100%;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
.list-loading{
|
24
|
+
text-align: center;
|
25
|
+
padding: 20px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export declare type SubDocumentListProps = {
|
2
|
+
id: string;
|
3
|
+
/** sub-document length ids */
|
4
|
+
onDocumentData?: (params?: any) => void;
|
5
|
+
/** move 目标数据 */
|
6
|
+
destination?: any;
|
7
|
+
/** move 原数据 */
|
8
|
+
source?: any;
|
9
|
+
};
|
10
|
+
export declare class State {
|
11
|
+
props: SubDocumentListProps;
|
12
|
+
lists: any[];
|
13
|
+
loading: boolean;
|
14
|
+
/** move 目标数据 */
|
15
|
+
destination: any;
|
16
|
+
/** move 原数据 */
|
17
|
+
source: any;
|
18
|
+
/** sub-document move function */
|
19
|
+
move(): void;
|
20
|
+
/** props.onDocumentData 需要的数据 */
|
21
|
+
get docData(): {
|
22
|
+
documents: number;
|
23
|
+
ids: string[];
|
24
|
+
};
|
25
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { action, computed, observable } from "mobx";
|
3
|
+
let State = /** @class */ (() => {
|
4
|
+
class State {
|
5
|
+
constructor() {
|
6
|
+
this.lists = [];
|
7
|
+
this.loading = true;
|
8
|
+
}
|
9
|
+
/** sub-document move function */
|
10
|
+
move() {
|
11
|
+
var _a, _b;
|
12
|
+
console.log("move---", this.props.source, this.props.destination);
|
13
|
+
if (((_a = this.props.source) === null || _a === void 0 ? void 0 : _a.parentId) === this.props.id) {
|
14
|
+
const iNum = this.lists.findIndex(item => {
|
15
|
+
return item.id === this.props.source.id;
|
16
|
+
});
|
17
|
+
if (iNum >= 0 && this.lists[iNum].id === this.props.source.id) {
|
18
|
+
this.lists.splice(iNum, 1);
|
19
|
+
this.props.onDocumentData(this.docData);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
if (((_b = this.props.destination) === null || _b === void 0 ? void 0 : _b.parentId) === this.props.id) {
|
23
|
+
const index = this.lists.findIndex(item => { var _a; return item.id === ((_a = this.props.destination) === null || _a === void 0 ? void 0 : _a.id); });
|
24
|
+
const doc = {
|
25
|
+
id: this.props.destination.id
|
26
|
+
};
|
27
|
+
const iNum = this.props.destination.index;
|
28
|
+
this.lists.splice(iNum, 0, doc);
|
29
|
+
this.props.onDocumentData(this.docData);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
/** props.onDocumentData 需要的数据 */
|
33
|
+
get docData() {
|
34
|
+
const ids = [];
|
35
|
+
this.lists.map(i => ids.push(i.id));
|
36
|
+
return { documents: this.lists.length, ids: ids };
|
37
|
+
}
|
38
|
+
}
|
39
|
+
__decorate([
|
40
|
+
observable
|
41
|
+
], State.prototype, "lists", void 0);
|
42
|
+
__decorate([
|
43
|
+
observable
|
44
|
+
], State.prototype, "loading", void 0);
|
45
|
+
__decorate([
|
46
|
+
observable
|
47
|
+
], State.prototype, "destination", void 0);
|
48
|
+
__decorate([
|
49
|
+
observable
|
50
|
+
], State.prototype, "source", void 0);
|
51
|
+
__decorate([
|
52
|
+
action
|
53
|
+
], State.prototype, "move", null);
|
54
|
+
__decorate([
|
55
|
+
computed
|
56
|
+
], State.prototype, "docData", null);
|
57
|
+
return State;
|
58
|
+
})();
|
59
|
+
export { State };
|
60
|
+
//# sourceMappingURL=state.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/SubDocumentList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAWpD;IAAA,MAAa,KAAK;QAAlB;YAEoB,UAAK,GAAU,EAAE,CAAC;YAClB,YAAO,GAAG,IAAI,CAAC;QAsCnC,CAAC;QAhCA,iCAAiC;QAE1B,IAAI;;YACV,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAClE,IAAI,OAAA,IAAI,CAAC,KAAK,CAAC,MAAM,0CAAE,QAAQ,MAAK,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE;gBAClD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;oBACxC,OAAO,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzC,CAAC,CAAC,CAAC;gBACH,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE;oBAC9D,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;oBAC3B,IAAI,CAAC,KAAK,CAAC,cAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACzC;aACD;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