@voplus/morpho-workspace 1.1.0-dev013 → 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/components/AvatarList/state.js +50 -46
- package/es/components/AvatarList/state.js.map +1 -1
- package/es/components/TimeLog/index.d.ts +1 -1
- 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 +3 -1
- package/es/data/board/index.js.map +1 -1
- package/es/data/board/metas.js +15 -11
- package/es/data/board/metas.js.map +1 -1
- package/es/data/meeting/index.js +2 -0
- package/es/data/meeting/index.js.map +1 -1
- package/es/data/meeting/metas.js +22 -18
- package/es/data/meeting/metas.js.map +1 -1
- package/es/data/task/index.js +2 -0
- package/es/data/task/index.js.map +1 -1
- package/es/data/task/metas.js +19 -15
- package/es/data/task/metas.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 +165 -106
- 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 +144 -139
- package/es/modules/board/components/BoardColumn/state.js.map +1 -1
- package/es/modules/board/components/DocumentCard/index.d.ts +2 -4
- 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 +68 -51
- package/es/modules/board/components/DocumentCard/state.js.map +1 -1
- package/es/modules/board/components/NewTaskForm/state.js +41 -37
- package/es/modules/board/components/NewTaskForm/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 +121 -112
- package/es/modules/board/components/TaskCard/state.js.map +1 -1
- package/es/modules/board/pages/BoardViewList/state.js +14 -10
- package/es/modules/board/pages/BoardViewList/state.js.map +1 -1
- package/es/modules/calendar/components/CalendarMenu/index.d.ts +1 -1
- package/es/modules/calendar/components/TaskCard/state.js +58 -54
- package/es/modules/calendar/components/TaskCard/state.js.map +1 -1
- package/es/modules/calendar/pages/CalendarMonth/state.js +12 -8
- package/es/modules/calendar/pages/CalendarMonth/state.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaHeader/index.d.ts +2 -2
- package/es/modules/meeting/components/AgendaList/AgendaItem/components/TaskItem/index.d.ts +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/components/TaskList/state.js +40 -36
- package/es/modules/meeting/components/AgendaList/AgendaItem/components/TaskList/state.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/state.js +47 -43
- package/es/modules/meeting/components/AgendaList/AgendaItem/state.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaNewForm/state.js +19 -15
- package/es/modules/meeting/components/AgendaList/AgendaNewForm/state.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/state.js +22 -18
- package/es/modules/meeting/components/AgendaList/state.js.map +1 -1
- package/es/modules/meeting/components/MeetingDescription/index.d.ts +1 -1
- package/es/modules/meeting/components/MeetingHeader/index.d.ts +3 -3
- package/es/modules/meeting/components/MeetingItem/index.d.ts +1 -1
- package/es/modules/meeting/components/MeetingItem/state.js +22 -18
- package/es/modules/meeting/components/MeetingItem/state.js.map +1 -1
- package/es/modules/meeting/components/MeetingQuickViewDialog/index.d.ts +2 -2
- package/es/modules/meeting/components/NewMeetingForm/index.js +1 -1
- package/es/modules/meeting/components/NewMeetingForm/index.js.map +1 -1
- package/es/modules/meeting/components/NewMeetingForm/state.js +31 -27
- package/es/modules/meeting/components/NewMeetingForm/state.js.map +1 -1
- package/es/modules/menus/components/Access/index.d.ts +2 -2
- package/es/modules/menus/components/Account/index.d.ts +2 -2
- package/es/modules/menus/components/Status/index.d.ts +2 -2
- package/es/modules/tasks/components/NewTaskForm/index.js +1 -1
- package/es/modules/tasks/components/NewTaskForm/index.js.map +1 -1
- package/es/modules/tasks/components/NewTaskForm/state.js +30 -26
- package/es/modules/tasks/components/NewTaskForm/state.js.map +1 -1
- package/es/modules/tasks/components/SubTaskList/state.js +22 -18
- package/es/modules/tasks/components/SubTaskList/state.js.map +1 -1
- package/es/modules/tasks/components/TaskDescription/index.d.ts +1 -1
- package/es/modules/tasks/components/TaskItem/state.js +157 -153
- package/es/modules/tasks/components/TaskItem/state.js.map +1 -1
- package/es/modules/tasks/components/TaskPropertiesView/index.d.ts +1 -1
- package/es/modules/tasks/components/TaskQuickViewDialog/index.d.ts +2 -2
- package/es/modules/tasks/components/TaskTimeBox/index.d.ts +4 -4
- package/es/modules/tasks/components/TaskTimeBox/state.js +74 -70
- package/es/modules/tasks/components/TaskTimeBox/state.js.map +1 -1
- package/es/modules/workspaces/components/Access/index.d.ts +2 -2
- package/es/modules/workspaces/components/Account/index.d.ts +2 -2
- package/es/modules/workspaces/components/ListHeard/index.d.ts +1 -1
- package/es/modules/workspaces/components/Status/index.d.ts +2 -2
- package/package.json +5 -5
- package/es/data/board/LinkStore.d.ts +0 -11
- package/es/data/board/LinkStore.js +0 -40
- 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 -33
- 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,28 +1,28 @@
|
|
1
|
+
import { BoardListContextState, BoardtListContext, useBoardColumnListEffect, useBoardColumnStore } from "../../../../data/board";
|
2
|
+
import { CreateDateFilter, DocumentStatusFilter, FlagFilter } from "@voplus/morpho-document/es/controls/filters";
|
1
3
|
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
2
|
-
import { FilterOptionsContext, FilterOptionsContextState } from "@voplus/morpho-ui/es/data";
|
3
|
-
import { FilterViewContext, FilterViewContextState } from "@voplus/morpho-ui/es/data/FilterViewContext";
|
4
4
|
import { Input, Spin } from "@voplus/antd";
|
5
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
5
6
|
import { Observer, useObserver } from "mobx-react-lite";
|
6
7
|
import React, { useEffect, useState } from "react";
|
7
8
|
import { faCheck, faTimes } from "@fortawesome/pro-light-svg-icons";
|
8
|
-
import { useBoardColumnListEffect, useBoardColumnStore } from "../../../../data/board";
|
9
9
|
import BoardColumn from "../BoardColumn";
|
10
10
|
import Card from "@voplus/morpho-ui/es/controls/Card";
|
11
11
|
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
12
|
-
import
|
12
|
+
import ListHeader from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeader";
|
13
13
|
import { Scrollbars } from "react-custom-scrollbars";
|
14
14
|
import SearchHeader from "@voplus/morpho-ui/es/components/layout/ListView/components/SearchHeader";
|
15
|
-
import SortViewDropdown from "@voplus/morpho-ui/es/components/layout/ListView/controls/SortViewDropdown";
|
16
15
|
import { State } from "./state";
|
17
16
|
import styles from "./index.less";
|
18
|
-
import { toJS } from "mobx";
|
19
17
|
import { useDocumentStore } from "@voplus/morpho-document";
|
20
18
|
const Board = (props) => {
|
21
19
|
const boards = useBoardColumnStore();
|
22
20
|
const documentStore = useDocumentStore();
|
23
21
|
const [state] = useState(new State(boards, documentStore));
|
24
|
-
/**
|
25
|
-
const
|
22
|
+
/** 建立 ListView 和useTaskListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
23
|
+
const list = useCreateListDataState({}, []);
|
24
|
+
/**把store 传给子级 DocumentItem*/
|
25
|
+
const [lists] = useState(new BoardListContextState());
|
26
26
|
state.props = props;
|
27
27
|
useEffect(state.subscribeOnBoardCreateCallback, []);
|
28
28
|
useBoardColumnListEffect(list => {
|
@@ -30,20 +30,6 @@ const Board = (props) => {
|
|
30
30
|
}, {
|
31
31
|
Filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: props.parentId }]
|
32
32
|
});
|
33
|
-
/** BoardColumn filters sort */
|
34
|
-
const onSort = (value) => {
|
35
|
-
listoptions.sort = value;
|
36
|
-
};
|
37
|
-
/** BoardColumn filters status */
|
38
|
-
const onFilter = (value) => {
|
39
|
-
const { status } = value;
|
40
|
-
listoptions.replace({
|
41
|
-
c: "LinkStatus",
|
42
|
-
o: "contains",
|
43
|
-
l: "And",
|
44
|
-
v1: toJS(JSON.stringify(status))
|
45
|
-
});
|
46
|
-
};
|
47
33
|
/** BoardColumn filters name */
|
48
34
|
const onSearch = (value) => {
|
49
35
|
if (state.timeout) {
|
@@ -51,7 +37,12 @@ const Board = (props) => {
|
|
51
37
|
}
|
52
38
|
state.timeout = setTimeout(() => {
|
53
39
|
state.timeout = null;
|
54
|
-
|
40
|
+
lists.replace({
|
41
|
+
c: "Name",
|
42
|
+
o: "contains",
|
43
|
+
l: "And",
|
44
|
+
v1: value
|
45
|
+
});
|
55
46
|
}, 1500);
|
56
47
|
};
|
57
48
|
const board = useObserver(() => (React.createElement(Droppable, { droppableId: props.parentId, type: "COLUMN", direction: "horizontal" }, provided => (React.createElement(Scrollbars, { autoHide: true },
|
@@ -64,26 +55,28 @@ const Board = (props) => {
|
|
64
55
|
},
|
65
56
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
66
57
|
ref: provided.innerRef }, provided.droppableProps), (_a = state.boardcolumns) === null || _a === void 0 ? void 0 :
|
67
|
-
_a.map((item, index) => (React.createElement(BoardColumn, { key: item.id, index: index, id: item.id, reload: state.reload, colorStyle: state.colorList[index % 6], destination: state.destination, source: state.source }))),
|
58
|
+
_a.map((item, index) => (React.createElement(BoardColumn, { key: item.id, index: index, id: item.id, reload: state.reload, colorStyle: state.colorList[index % 6], destination: state.destination, source: state.source, onIds: (v) => state.onIds(v) }))),
|
68
59
|
provided.placeholder));
|
69
60
|
}))))));
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
React.createElement(
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
61
|
+
return useObserver(() => (React.createElement(BoardtListContext.Provider, { value: lists },
|
62
|
+
React.createElement(ListDataContext.Provider, { value: list },
|
63
|
+
React.createElement("div", { className: styles["board-context"] },
|
64
|
+
React.createElement(ListHeader, { header: React.createElement(SearchHeader, { onChange: onSearch }), filterViewProps: {
|
65
|
+
columns: [
|
66
|
+
React.createElement(CreateDateFilter, { key: "createDateFilter" }),
|
67
|
+
React.createElement(FlagFilter, { key: "flagFilter" }),
|
68
|
+
React.createElement(DocumentStatusFilter, { key: "documentStatusFilter" })
|
69
|
+
]
|
70
|
+
}, addAble: false }),
|
71
|
+
React.createElement("div", { className: "board-list" },
|
72
|
+
React.createElement(DragDropContext, { onDragEnd: (result) => state.onDragEnd(result) }, board),
|
73
|
+
React.createElement("div", { className: "add-board-controls" }, state.addBoardColumnAble && (React.createElement(Spin, { spinning: state.addLoading },
|
74
|
+
React.createElement(Card, { className: "add-board-able", padding: "0 15px", style: { borderTop: ` solid 2px #3AC43A` } },
|
75
|
+
React.createElement(Input, { placeholder: "STATUS NAME", value: state.name, onChange: e => (state.name = e.target.value) }),
|
76
|
+
React.createElement(FAIcon, { icon: faCheck, onClick: () => state.onSave() }),
|
77
|
+
React.createElement(FAIcon, { icon: faTimes, onClick: () => (state.addBoardColumnAble = false) }))))),
|
78
|
+
React.createElement("div", { className: "add-board" },
|
79
|
+
React.createElement("div", { onClick: () => (state.addBoardColumnAble = true) }, "+ ADD"))))))));
|
87
80
|
};
|
88
81
|
export default Board;
|
89
82
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,MAAM,6CAA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AAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAClE,KAAK,CACW;oBAClB,6BAAK,SAAS,EAAC,oBAAoB,IACjC,KAAK,CAAC,kBAAkB,IAAI,CAC5B,oBAAC,IAAI,IAAC,QAAQ,EAAE,KAAK,CAAC,UAAU;wBAC/B,oBAAC,IAAI,IACJ,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE;4BAE1C,oBAAC,KAAK,IACL,WAAW,EAAC,aAAa,EACzB,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC3C;4BACF,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,GAAI;4BACxD,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAAI,CACtE,CACD,CACP,CACI;oBACN,6BAAK,SAAS,EAAC,WAAW;wBACzB,6BAAK,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAa,CAC7D,CACD,CACD,CACoB,CACC,CAC7B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
@@ -1,67 +1,99 @@
|
|
1
|
-
.board-
|
1
|
+
.board-context {
|
2
2
|
height: 100%;
|
3
3
|
display: flex;
|
4
|
-
|
5
|
-
margin: 10px;
|
6
|
-
padding: 0 10px;
|
4
|
+
flex-direction: column;
|
7
5
|
:global {
|
8
|
-
.
|
9
|
-
flex: 1;
|
6
|
+
.list-view-header {
|
10
7
|
display: flex;
|
11
|
-
|
12
|
-
|
8
|
+
justify-content: space-between;
|
9
|
+
align-items: center;
|
10
|
+
padding: 10px 20px;
|
11
|
+
border-bottom: 1px solid #f2f2f2;
|
12
|
+
background: #ffffff;
|
13
|
+
.view-title {
|
14
|
+
color: #000;
|
15
|
+
font-size: 16px;
|
16
|
+
font-weight: 600;
|
13
17
|
}
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
margin: 8px 0;
|
22
|
-
> div {
|
18
|
+
.plus-icon {
|
19
|
+
display: inline-block;
|
20
|
+
padding: 4px;
|
21
|
+
margin-left: 10px;
|
22
|
+
font-size: 13px;
|
23
|
+
line-height: 1px;
|
24
|
+
background: #1abc9c;
|
23
25
|
cursor: pointer;
|
24
26
|
}
|
25
|
-
|
26
|
-
|
27
|
-
margin: 8px 0 8px 8px;
|
28
|
-
> div > .ant-spin {
|
29
|
-
height: 50px;
|
27
|
+
.margin-left-10 {
|
28
|
+
margin-left: 10px;
|
30
29
|
}
|
31
30
|
}
|
32
|
-
.
|
31
|
+
.board-list {
|
32
|
+
height: 100%;
|
33
33
|
display: flex;
|
34
|
-
justify-content:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
.ant-input {
|
44
|
-
padding: 0;
|
45
|
-
border: none;
|
34
|
+
justify-content: space-between;
|
35
|
+
padding: 10px 12px;
|
36
|
+
|
37
|
+
.board-sortDnD {
|
38
|
+
flex: 1;
|
39
|
+
display: flex;
|
40
|
+
> div {
|
41
|
+
flex: 1;
|
42
|
+
}
|
46
43
|
}
|
47
|
-
.
|
48
|
-
|
44
|
+
.add-board {
|
45
|
+
width: 100px;
|
46
|
+
min-width: 100px;
|
47
|
+
font-size: 16px;
|
48
|
+
text-align: center;
|
49
|
+
line-height: 50px;
|
50
|
+
margin: 8px 0;
|
51
|
+
> div {
|
52
|
+
cursor: pointer;
|
53
|
+
}
|
49
54
|
}
|
50
|
-
.
|
51
|
-
|
52
|
-
|
55
|
+
.add-board-controls {
|
56
|
+
.ant-spin-nested-loading {
|
57
|
+
margin: 8px 0 8px 8px;
|
58
|
+
> div > .ant-spin {
|
59
|
+
height: 50px;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
.add-board-able {
|
64
|
+
display: flex;
|
65
|
+
justify-content: center;
|
66
|
+
align-items: center;
|
67
|
+
height: 50px;
|
68
|
+
color: #000000;
|
69
|
+
line-height: 50px;
|
70
|
+
padding: 0 10px;
|
71
|
+
background: #ffffff;
|
72
|
+
margin-bottom: 15px;
|
73
|
+
min-width: 150px;
|
74
|
+
.ant-input {
|
75
|
+
padding: 0;
|
76
|
+
border: none;
|
77
|
+
}
|
78
|
+
.ant-input:focus {
|
79
|
+
box-shadow: none;
|
80
|
+
}
|
81
|
+
.svg-inline--fa {
|
82
|
+
cursor: pointer;
|
83
|
+
margin-left: 8px;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
.ant-calendar {
|
87
|
+
max-width: 250px;
|
53
88
|
}
|
54
|
-
}
|
55
|
-
.ant-calendar {
|
56
|
-
max-width: 250px;
|
57
89
|
}
|
58
90
|
}
|
59
91
|
}
|
60
|
-
.board_header {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
92
|
+
// .board_header {
|
93
|
+
// display: flex;
|
94
|
+
// justify-content: space-between;
|
95
|
+
// align-items: center;
|
96
|
+
// padding: 10px 20px;
|
97
|
+
// border-bottom: 1px solid #f2f2f2;
|
98
|
+
// background-color: #ffffff;
|
99
|
+
// }
|
@@ -1,14 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { BoardColumnStore, IBoardColumn } from "../../../../data/board";
|
2
|
+
import { DocumentStore, IDocument } from "@voplus/morpho-document";
|
3
|
+
import { FilterOption } from "@voplus/morpho-data";
|
3
4
|
export declare type BoardListProps = {
|
4
5
|
parentId: string;
|
5
6
|
};
|
7
|
+
export interface IBoardIds {
|
8
|
+
id: string;
|
9
|
+
ids: string[];
|
10
|
+
}
|
6
11
|
export declare class State {
|
7
12
|
private _store;
|
8
13
|
private _docStore;
|
9
14
|
props: BoardListProps;
|
10
15
|
constructor(_store: BoardColumnStore, _docStore: DocumentStore);
|
11
16
|
boardcolumns: IBoardColumn[];
|
17
|
+
/** board ids */
|
18
|
+
ids: IBoardIds[];
|
12
19
|
/** search filter 1.5秒 */
|
13
20
|
timeout: any;
|
14
21
|
/** add BoardColumn name */
|
@@ -24,11 +31,21 @@ export declare class State {
|
|
24
31
|
destination: any;
|
25
32
|
/** BoardColumn head border-top color */
|
26
33
|
colorList: string[];
|
27
|
-
|
28
|
-
|
34
|
+
/** documentlist filter name */
|
35
|
+
filterName: string;
|
36
|
+
filterList?: FilterOption[];
|
37
|
+
onBoardColumnCreated: (s: DocumentStore, t: IDocument) => void;
|
38
|
+
onBoardColumnDeleted: (s: DocumentStore, t: IDocument) => void;
|
29
39
|
subscribeOnBoardCreateCallback: () => () => void;
|
30
40
|
/** add BoardColumn save */
|
31
41
|
onSave: () => Promise<any>;
|
32
42
|
/** 拖拽方法 */
|
33
|
-
onDragEnd(result: any): void
|
43
|
+
onDragEnd(result: any): Promise<void>;
|
44
|
+
/** 存储ids 放便拖拽后查找 afterId */
|
45
|
+
onIds(v: any): void;
|
46
|
+
/**
|
47
|
+
* document filters
|
48
|
+
* @return document filters
|
49
|
+
*/
|
50
|
+
get filters(): any[];
|
34
51
|
}
|
@@ -1,118 +1,177 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import { action, observable } from "mobx";
|
2
|
+
import { action, computed, observable } from "mobx";
|
3
3
|
import { message } from "@voplus/antd";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
this.addLoading = false;
|
16
|
-
/** add BoardColumn */
|
17
|
-
this.addBoardColumnAble = false;
|
18
|
-
/** BoardColumn head border-top color */
|
19
|
-
this.colorList = ["#765FEE", "#fe4066", "#FFC832", "#FF8F5E", "#16ecec", "#FFC832"];
|
20
|
-
this.onBoardColumnCreated = (s, t) => {
|
21
|
-
if (t.parentId === this.props.parentId) {
|
22
|
-
this.boardcolumns.push(t);
|
23
|
-
this.reload = true;
|
24
|
-
}
|
25
|
-
};
|
26
|
-
this.onBoardColumnDeleted = (s, t) => {
|
27
|
-
this.boardcolumns = this.boardcolumns.filter(item => item.id !== t.id);
|
28
|
-
};
|
29
|
-
this.subscribeOnBoardCreateCallback = () => {
|
30
|
-
this._store.ItemCreatedEvent.subscribe(this.onBoardColumnCreated);
|
31
|
-
this._store.ItemDeletedEvent.subscribe(this.onBoardColumnDeleted);
|
32
|
-
return () => {
|
33
|
-
this._store.ItemCreatedEvent.unsubscribe(this.onBoardColumnCreated);
|
34
|
-
this._store.ItemDeletedEvent.unsubscribe(this.onBoardColumnDeleted);
|
35
|
-
};
|
36
|
-
};
|
37
|
-
/** add BoardColumn save */
|
38
|
-
this.onSave = async () => {
|
39
|
-
if (!this.name)
|
40
|
-
return message.warning("Title is required");
|
41
|
-
this.addLoading = true;
|
42
|
-
await this._store.create({ Name: this.name, ParentId: this.props.parentId });
|
4
|
+
let State = /** @class */ (() => {
|
5
|
+
class State {
|
6
|
+
constructor(_store, _docStore) {
|
7
|
+
this._store = _store;
|
8
|
+
this._docStore = _docStore;
|
9
|
+
this.boardcolumns = [];
|
10
|
+
/** board ids */
|
11
|
+
this.ids = [];
|
12
|
+
/** search filter 1.5秒 */
|
13
|
+
this.timeout = null;
|
14
|
+
/** add BoardColumn name */
|
43
15
|
this.name = "";
|
16
|
+
this.reload = false;
|
17
|
+
/** add BoardColumn save loading */
|
44
18
|
this.addLoading = false;
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
19
|
+
/** add BoardColumn */
|
20
|
+
this.addBoardColumnAble = false;
|
21
|
+
/** BoardColumn head border-top color */
|
22
|
+
this.colorList = ["#765FEE", "#fe4066", "#FFC832", "#FF8F5E", "#16ecec", "#FFC832"];
|
23
|
+
/** documentlist filter name */
|
24
|
+
this.filterName = "";
|
25
|
+
this.filterList = [];
|
26
|
+
this.onBoardColumnCreated = (s, t) => {
|
27
|
+
if (t.parentId === this.props.parentId && t.type == "BoardColumn") {
|
28
|
+
this.boardcolumns.push(t);
|
29
|
+
this.reload = true;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
this.onBoardColumnDeleted = (s, t) => {
|
33
|
+
if (t.type == "BoardColumn")
|
34
|
+
this.boardcolumns = this.boardcolumns.filter(item => item.id !== t.id);
|
35
|
+
};
|
36
|
+
this.subscribeOnBoardCreateCallback = () => {
|
37
|
+
this._docStore.DocumentCreatedEvent.subscribe(this.onBoardColumnCreated);
|
38
|
+
this._docStore.DocumentDeletedEvent.subscribe(this.onBoardColumnDeleted);
|
39
|
+
return () => {
|
40
|
+
this._docStore.DocumentCreatedEvent.unsubscribe(this.onBoardColumnCreated);
|
41
|
+
this._docStore.DocumentDeletedEvent.unsubscribe(this.onBoardColumnDeleted);
|
42
|
+
};
|
43
|
+
};
|
44
|
+
/** add BoardColumn save */
|
45
|
+
this.onSave = async () => {
|
46
|
+
if (!this.name)
|
47
|
+
return message.warning("Title is required");
|
48
|
+
this.addLoading = true;
|
49
|
+
await this._store.create({ Name: this.name, ParentId: this.props.parentId });
|
50
|
+
this.name = "";
|
51
|
+
this.addLoading = false;
|
52
|
+
};
|
52
53
|
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
/** 拖拽方法 */
|
55
|
+
async onDragEnd(result) {
|
56
|
+
// dropped nowhere
|
57
|
+
if (!result.destination) {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
const { source, destination, draggableId } = result;
|
61
|
+
// did not move anywhere - can bail early
|
62
|
+
if (source.droppableId === destination.droppableId && source.index === destination.index) {
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
// reordering column
|
66
|
+
if (result.type === "COLUMN") {
|
67
|
+
if (destination.index === 0) {
|
68
|
+
this._docStore.moveAfter(draggableId, "");
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
const afterId = this.boardcolumns.length - 1 === destination.index
|
72
|
+
? this.boardcolumns[destination.index].id
|
73
|
+
: this.boardcolumns[destination.index - 1].id;
|
74
|
+
this._docStore.moveAfter(draggableId, afterId);
|
75
|
+
}
|
76
|
+
const [removed] = this.boardcolumns.splice(source.index, 1);
|
77
|
+
this.boardcolumns.splice(destination.index, 0, removed);
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
// destination,source 数据 传给SubDocumentList 进行reordering list
|
81
|
+
this.source = { parentId: source.droppableId, id: draggableId };
|
82
|
+
this.destination = {
|
83
|
+
parentId: destination.droppableId,
|
84
|
+
id: draggableId,
|
85
|
+
index: destination.index
|
86
|
+
};
|
87
|
+
let afterId = "";
|
88
|
+
const idsList = this.ids.filter(item => item.id === destination.droppableId);
|
89
|
+
const index = destination.index - 1;
|
90
|
+
if (index >= 0) {
|
91
|
+
afterId = idsList[0].ids[index];
|
92
|
+
}
|
93
|
+
if (destination.droppableId === source.droppableId) {
|
94
|
+
this._docStore.moveAfter(draggableId, afterId);
|
95
|
+
}
|
96
|
+
else {
|
97
|
+
await this._docStore.move([draggableId], destination.droppableId);
|
98
|
+
if (afterId !== "") {
|
99
|
+
this._docStore.moveAfter(draggableId, afterId);
|
100
|
+
}
|
101
|
+
}
|
57
102
|
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
103
|
+
/** 存储ids 放便拖拽后查找 afterId */
|
104
|
+
onIds(v) {
|
105
|
+
const index = this.ids.findIndex(i => i.id === v.id);
|
106
|
+
if (index == -1) {
|
107
|
+
this.ids.push({ id: v.id, ids: v.ids });
|
62
108
|
}
|
63
109
|
else {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
110
|
+
this.ids[index] = { id: v.id, ids: v.ids };
|
111
|
+
}
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* document filters
|
115
|
+
* @return document filters
|
116
|
+
*/
|
117
|
+
get filters() {
|
118
|
+
let filters = [];
|
119
|
+
if (this.filterName) {
|
120
|
+
filters.push({ c: "Name", o: "contains", v1: this.filterName, l: "And" });
|
68
121
|
}
|
69
|
-
|
70
|
-
|
71
|
-
return;
|
122
|
+
filters = [...filters, ...this.filterList];
|
123
|
+
return filters;
|
72
124
|
}
|
73
|
-
const linkId = draggableId.split("/")[0];
|
74
|
-
const rightId = draggableId.split("/")[1];
|
75
|
-
this._docStore.moveLinks(destination.droppableId, source.droppableId, [{ Type: "Association", RightId: rightId, Position: destination.index }], [linkId]);
|
76
|
-
this.source = { id: source.droppableId, linkId: linkId };
|
77
|
-
this.destination = {
|
78
|
-
id: destination.droppableId,
|
79
|
-
rightId: rightId,
|
80
|
-
linkId: linkId,
|
81
|
-
index: destination.index
|
82
|
-
};
|
83
125
|
}
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
126
|
+
__decorate([
|
127
|
+
observable
|
128
|
+
], State.prototype, "boardcolumns", void 0);
|
129
|
+
__decorate([
|
130
|
+
observable
|
131
|
+
], State.prototype, "ids", void 0);
|
132
|
+
__decorate([
|
133
|
+
observable
|
134
|
+
], State.prototype, "timeout", void 0);
|
135
|
+
__decorate([
|
136
|
+
observable
|
137
|
+
], State.prototype, "name", void 0);
|
138
|
+
__decorate([
|
139
|
+
observable
|
140
|
+
], State.prototype, "reload", void 0);
|
141
|
+
__decorate([
|
142
|
+
observable
|
143
|
+
], State.prototype, "addLoading", void 0);
|
144
|
+
__decorate([
|
145
|
+
observable
|
146
|
+
], State.prototype, "addBoardColumnAble", void 0);
|
147
|
+
__decorate([
|
148
|
+
observable
|
149
|
+
], State.prototype, "source", void 0);
|
150
|
+
__decorate([
|
151
|
+
observable
|
152
|
+
], State.prototype, "destination", void 0);
|
153
|
+
__decorate([
|
154
|
+
observable
|
155
|
+
], State.prototype, "colorList", void 0);
|
156
|
+
__decorate([
|
157
|
+
observable
|
158
|
+
], State.prototype, "filterName", void 0);
|
159
|
+
__decorate([
|
160
|
+
observable
|
161
|
+
], State.prototype, "filterList", void 0);
|
162
|
+
__decorate([
|
163
|
+
action
|
164
|
+
], State.prototype, "onSave", void 0);
|
165
|
+
__decorate([
|
166
|
+
action
|
167
|
+
], State.prototype, "onDragEnd", null);
|
168
|
+
__decorate([
|
169
|
+
action
|
170
|
+
], State.prototype, "onIds", null);
|
171
|
+
__decorate([
|
172
|
+
computed
|
173
|
+
], State.prototype, "filters", null);
|
174
|
+
return State;
|
175
|
+
})();
|
176
|
+
export { State };
|
118
177
|
//# sourceMappingURL=state.js.map
|