@voplus/morpho-document 1.0.0-dev275 → 1.0.0-dev278
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 +1 -0
- package/es/components/ActivityLog/ActivityLog2/index.d.ts +6 -1
- package/es/components/ActivityLog/ActivityLog2/index.js +6 -4
- package/es/components/ActivityLog/ActivityLog2/index.js.map +1 -1
- package/es/components/ActivityLog/ActivityLog2/index.less +5 -29
- package/es/components/DocumentCard/index.js +1 -1
- package/es/components/DocumentCard/index.js.map +1 -1
- package/es/components/DocumentHeader/index.js +1 -1
- package/es/components/DocumentHeader/index.js.map +1 -1
- package/es/components/DocumentItem/index.js +1 -1
- package/es/components/DocumentItem/index.js.map +1 -1
- package/es/components/DocumentList/index.js +3 -3
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentList/index.less +3 -0
- package/es/components/DocumentQuickViewDialog/index.js +1 -4
- package/es/components/DocumentQuickViewDialog/index.js.map +1 -1
- package/es/components/DocumentTabs/index.d.ts +2 -0
- package/es/components/DocumentTabs/index.js +4 -3
- package/es/components/DocumentTabs/index.js.map +1 -1
- package/es/components/ExtraDataCardList/index.d.ts +5 -0
- package/es/components/ExtraDataCardList/index.js +38 -0
- package/es/components/ExtraDataCardList/index.js.map +1 -0
- package/es/components/Links/index.less +111 -111
- package/es/components/NewDocumentForm/index.d.ts +1 -0
- package/es/components/NewDocumentForm/index.js +4 -1
- package/es/components/NewDocumentForm/index.js.map +1 -1
- package/es/components/QuickAccessSearch/ObjectItem/index.js +2 -2
- package/es/components/QuickAccessSearch/ObjectItem/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.js +2 -6
- package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
- package/es/components/TextPropertiesView/index.d.ts +6 -0
- package/es/components/TextPropertiesView/index.js +20 -0
- package/es/components/TextPropertiesView/index.js.map +1 -0
- package/es/components/{TextQuickView → TextQuickViewDialog}/index.d.ts +2 -2
- package/es/components/{TextQuickView → TextQuickViewDialog}/index.js +6 -3
- package/es/components/TextQuickViewDialog/index.js.map +1 -0
- package/es/controls/ToolBar/ToolBar2.js +4 -3
- package/es/controls/ToolBar/ToolBar2.js.map +1 -1
- package/es/controls/ToolBar/ToolBarState.d.ts +15 -6
- package/es/controls/ToolBar/ToolBarState.js +11 -3
- package/es/controls/ToolBar/ToolBarState.js.map +1 -1
- package/es/controls/ToolBar/buttons/More.d.ts +2 -2
- package/es/controls/ToolBar/buttons/More.js +3 -3
- package/es/controls/ToolBar/buttons/More.js.map +1 -1
- package/es/controls/ToolBar/buttons/state.js +24 -12
- package/es/controls/ToolBar/buttons/state.js.map +1 -1
- package/es/controls/ToolBar/menus/Access.js +3 -3
- package/es/controls/ToolBar/menus/Access.js.map +1 -1
- package/es/controls/ToolBar/menus/Delete.js +1 -0
- package/es/controls/ToolBar/menus/Delete.js.map +1 -1
- package/es/controls/ToolBar/menus/Lock.js +1 -0
- package/es/controls/ToolBar/menus/Lock.js.map +1 -1
- package/es/controls/ToolBar/menus/Move.js +1 -0
- package/es/controls/ToolBar/menus/Move.js.map +1 -1
- package/es/controls/ToolBar/menus/OpenReferenceView.js +5 -3
- package/es/controls/ToolBar/menus/OpenReferenceView.js.map +1 -1
- package/es/controls/ToolBar/menus/OpenTreeView.js +1 -0
- package/es/controls/ToolBar/menus/OpenTreeView.js.map +1 -1
- package/es/controls/ToolBar/menus/Paste.js +1 -0
- package/es/controls/ToolBar/menus/Paste.js.map +1 -1
- package/es/controls/ToolBar/menus/Publish.js +3 -3
- package/es/controls/ToolBar/menus/Publish.js.map +1 -1
- package/es/controls/ToolBar/menus/PublishLock.js +3 -3
- package/es/controls/ToolBar/menus/PublishLock.js.map +1 -1
- package/es/controls/ToolBar/menus/Revert.js +3 -0
- package/es/controls/ToolBar/menus/Revert.js.map +1 -1
- package/es/modules/unit/components/ChangeUserPassword/index.d.ts +6 -0
- package/es/modules/unit/components/ChangeUserPassword/index.js +37 -0
- package/es/modules/unit/components/ChangeUserPassword/index.js.map +1 -0
- package/es/modules/unit/components/ChangeUserPassword/index.less +13 -0
- package/es/modules/unit/components/ContactUserInfoView/index.d.ts +3 -0
- package/es/modules/unit/components/ContactUserInfoView/index.js +40 -0
- package/es/modules/unit/components/ContactUserInfoView/index.js.map +1 -0
- package/es/modules/unit/components/ContactUserInfoView/index.less +20 -0
- package/es/modules/unit/components/ContactUserInfoView/state.d.ts +5 -0
- package/es/modules/unit/components/ContactUserInfoView/state.js +14 -0
- package/es/modules/unit/components/ContactUserInfoView/state.js.map +1 -0
- package/es/modules/unit/components/Members/index.js +14 -25
- package/es/modules/unit/components/Members/index.js.map +1 -1
- package/es/modules/unit/components/NewUnitForm/index.d.ts +1 -1
- package/es/modules/unit/components/SubUnitList/index.d.ts +6 -2
- package/es/modules/unit/components/SubUnitList/index.js +17 -20
- package/es/modules/unit/components/SubUnitList/index.js.map +1 -1
- package/es/modules/unit/components/SubUnitList/index.less +10 -4
- package/es/modules/unit/components/SubUnitList/state.d.ts +15 -0
- package/es/modules/unit/components/SubUnitList/state.js +36 -1
- package/es/modules/unit/components/SubUnitList/state.js.map +1 -1
- package/es/modules/unit/components/UnitItem/Item.d.ts +17 -0
- package/es/modules/unit/components/UnitItem/Item.js +24 -0
- package/es/modules/unit/components/UnitItem/Item.js.map +1 -0
- package/es/modules/unit/components/UnitItem/index.js +43 -0
- package/es/modules/unit/components/UnitItem/index.js.map +1 -0
- package/es/modules/unit/components/UnitItem/index.less +17 -9
- package/es/modules/unit/components/UnitItem/state.d.ts +2 -2
- package/es/modules/unit/components/UnitItem/state.js.map +1 -1
- package/es/modules/unit/components/UnitList/index.js +4 -4
- package/es/modules/unit/components/UnitList/index.js.map +1 -1
- package/es/modules/unit/components/UnitName/index.d.ts +5 -0
- package/es/modules/unit/components/UnitName/index.js +20 -0
- package/es/modules/unit/components/UnitName/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/index.js +4 -5
- package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -1
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.d.ts +3 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.js +22 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.js +82 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.less +316 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.js +21 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.less +4 -0
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
- package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/node-content-renderer.js +2 -2
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
- package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/node-content-renderer.less +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
- package/es/modules/unit/components/UnitTabs/index.js +5 -2
- package/es/modules/unit/components/UnitTabs/index.js.map +1 -1
- package/es/modules/unit/components/UnitsSelectDialog/index.d.ts +9 -0
- package/es/modules/unit/components/UnitsSelectDialog/index.js +35 -0
- package/es/modules/unit/components/UnitsSelectDialog/index.js.map +1 -0
- package/es/modules/unit/components/UnitsSelectDialog/index.less +36 -0
- package/es/modules/unit/components/UnitsSelectDialog/state.d.ts +34 -0
- package/es/modules/unit/components/UnitsSelectDialog/state.js +73 -0
- package/es/modules/unit/components/UnitsSelectDialog/state.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/index.less +12 -0
- package/es/modules/unit/data/UserStore.d.ts +33 -0
- package/es/modules/unit/data/UserStore.js +53 -0
- package/es/modules/unit/data/UserStore.js.map +1 -0
- package/es/modules/unit/data/hooks/useUserInfo.d.ts +6 -0
- package/es/modules/unit/data/hooks/useUserInfo.js +12 -0
- package/es/modules/unit/data/hooks/useUserInfo.js.map +1 -0
- package/es/modules/unit/data/interfaces/IUnit.d.ts +2 -0
- package/es/modules/unit/data/interfaces/IUserInfo.d.ts +12 -0
- package/es/modules/unit/data/interfaces/IUserInfo.js +1 -0
- package/es/modules/unit/data/interfaces/IUserInfo.js.map +1 -0
- package/es/modules/unit/data/interfaces/index.d.ts +1 -0
- package/es/modules/unit/data/interfaces/index.js +1 -0
- package/es/modules/unit/data/interfaces/index.js.map +1 -1
- package/es/modules/unit/pages/UnitTreeView/index.js +1 -1
- package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -1
- package/es/pages/Page/PageDefaultView/index.js +1 -1
- package/es/pages/Page/PageDefaultView/index.js.map +1 -1
- package/es/pages/Page/PageTextItem/index.js +1 -1
- package/es/pages/Page/PageTextItem/index.js.map +1 -1
- package/es/pages/VSubmit/VSubmitDefaultView/index.d.ts +3 -0
- package/es/pages/VSubmit/VSubmitDefaultView/index.js +59 -0
- package/es/pages/VSubmit/VSubmitDefaultView/index.js.map +1 -0
- package/es/pages/VSubmit/VSubmitDefaultView/index.less +10 -0
- package/es/pages/VSubmit/VSubmitDefaultView/state.d.ts +4 -0
- package/es/pages/VSubmit/VSubmitDefaultView/state.js +12 -0
- package/es/pages/VSubmit/VSubmitDefaultView/state.js.map +1 -0
- package/es/pages/VSubmit/VSubmitSubmitterView/index.d.ts +4 -0
- package/es/pages/VSubmit/VSubmitSubmitterView/index.js +35 -0
- package/es/pages/VSubmit/VSubmitSubmitterView/index.js.map +1 -0
- package/es/pages/VSubmit/VSubmitSubmitterView/index.less +30 -0
- package/es/pages/VSubmit/components/DocumentIconCard/index.d.ts +12 -0
- package/es/pages/VSubmit/components/DocumentIconCard/index.js +32 -0
- package/es/pages/VSubmit/components/DocumentIconCard/index.js.map +1 -0
- package/es/pages/VSubmit/components/DocumentIconCard/index.less +37 -0
- package/es/pages/VSubmit/components/DocumentIconView/index.d.ts +13 -0
- package/es/pages/VSubmit/components/DocumentIconView/index.js +61 -0
- package/es/pages/VSubmit/components/DocumentIconView/index.js.map +1 -0
- package/es/pages/VSubmit/components/DocumentIconView/index.less +65 -0
- package/es/pages/VSubmit/components/DocumentIconView/state.d.ts +8 -0
- package/es/pages/VSubmit/components/DocumentIconView/state.js +17 -0
- package/es/pages/VSubmit/components/DocumentIconView/state.js.map +1 -0
- package/es/pages/VSubmit/components/EmailRecipients/index.d.ts +9 -0
- package/es/pages/VSubmit/components/EmailRecipients/index.js +48 -0
- package/es/pages/VSubmit/components/EmailRecipients/index.js.map +1 -0
- package/es/pages/VSubmit/components/EmailRecipients/index.less +27 -0
- package/es/pages/VSubmit/components/EmailRecipients/state.d.ts +8 -0
- package/es/pages/VSubmit/components/EmailRecipients/state.js +23 -0
- package/es/pages/VSubmit/components/EmailRecipients/state.js.map +1 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/index.d.ts +14 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/index.js +40 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/index.js.map +1 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/index.less +60 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/state.d.ts +8 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/state.js +22 -0
- package/es/pages/VSubmit/components/SubmitSections/SectionItem/state.js.map +1 -0
- package/es/pages/VSubmit/components/SubmitSections/index.d.ts +6 -0
- package/es/pages/VSubmit/components/SubmitSections/index.js +54 -0
- package/es/pages/VSubmit/components/SubmitSections/index.js.map +1 -0
- package/es/pages/VSubmit/components/SubmitSections/index.less +31 -0
- package/es/pages/VSubmit/data/VSubmitStore.d.ts +10 -0
- package/es/pages/VSubmit/data/VSubmitStore.js +16 -0
- package/es/pages/VSubmit/data/VSubmitStore.js.map +1 -0
- package/es/pages/VSubmit/data/hook.d.ts +3 -0
- package/es/pages/VSubmit/data/hook.js +10 -0
- package/es/pages/VSubmit/data/hook.js.map +1 -0
- package/es/pages/VSubmit/data/index.d.ts +3 -0
- package/es/pages/VSubmit/data/index.js +4 -0
- package/es/pages/VSubmit/data/index.js.map +1 -0
- package/es/pages/VSubmit/data/interfaces.d.ts +8 -0
- package/es/pages/VSubmit/data/interfaces.js +1 -0
- package/es/pages/VSubmit/data/interfaces.js.map +1 -0
- package/es/routes.d.ts +12 -0
- package/es/routes.js +27 -1
- package/es/routes.js.map +1 -1
- package/package.json +2 -2
- package/es/components/TextQuickView/index.js.map +0 -1
- package/es/components/TextQuickView/index.less +0 -21
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +0 -1
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +0 -1
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +0 -1
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +0 -4
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +0 -29
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +0 -1
- package/es/modules/unit/components/UnitItem/SubUnitItem.js +0 -45
- package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +0 -1
- /package/es/modules/unit/components/UnitItem/{SubUnitItem.d.ts → index.d.ts} +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/FileExplorerTheme}/node-content-renderer.d.ts +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/FileExplorerTheme}/tree-node-renderer.d.ts +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/index.d.ts +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/index.js +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/tree-node-renderer.js +0 -0
- /package/es/modules/unit/components/{SortableTreeUnitTheme → UnitSortableTree/themes/SortableTreeUnitTheme}/tree-node-renderer.less +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "./index.less";
|
|
2
1
|
import { BatchHeader, DeleteButton, MoveButton } from "@voplus/morpho-ui/es/components/layout/ListView/headers";
|
|
3
|
-
import { DocumentStatusFilter, FlagFilter } from "../../../../controls/filters";
|
|
4
2
|
import { useAutoUpdateUnitListData, useUnitListEffect, useUnitStore } from "../../data";
|
|
5
3
|
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
6
4
|
import React, { useEffect } from "react";
|
|
@@ -8,8 +6,10 @@ import { State } from "./state";
|
|
|
8
6
|
import AddUnitDropdown from "../AddUnitDropdown";
|
|
9
7
|
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
10
8
|
import NewUnitForm from "../NewUnitForm";
|
|
11
|
-
import UnitItem from "../UnitItem
|
|
9
|
+
import UnitItem from "../UnitItem";
|
|
10
|
+
import UnitTypeFilter from "../../controls/UnitTypeFilter";
|
|
12
11
|
import classnames from "classnames";
|
|
12
|
+
import styles from "./index.less";
|
|
13
13
|
import { useDeepMemo } from "@voplus/morpho-data";
|
|
14
14
|
import { useObserver } from "mobx-react-lite";
|
|
15
15
|
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
@@ -17,18 +17,12 @@ const SubUnitList = (props) => {
|
|
|
17
17
|
const { readonly, parentId } = props;
|
|
18
18
|
const store = useUnitStore();
|
|
19
19
|
const state = useDeepMemo(() => new State(), [props.parentId]);
|
|
20
|
+
state.props = props;
|
|
21
|
+
state.id = props.parentId || "";
|
|
20
22
|
/** 建立 ListView 和useContactListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
|
21
23
|
const list = useCreateListDataState({
|
|
22
24
|
filterDefaults: {
|
|
23
|
-
filters:
|
|
24
|
-
{ c: "ParentNodeId", o: "=", l: "And", v1: parentId },
|
|
25
|
-
{
|
|
26
|
-
c: "Type",
|
|
27
|
-
o: "=",
|
|
28
|
-
l: "And",
|
|
29
|
-
v1: "Group"
|
|
30
|
-
}
|
|
31
|
-
]
|
|
25
|
+
filters: state.filters
|
|
32
26
|
}
|
|
33
27
|
}, [parentId]);
|
|
34
28
|
/** 如果 list.filters.options变更了就重渲染,使下一行的useContactListEffect 可以接收新参数*/
|
|
@@ -41,20 +35,20 @@ const SubUnitList = (props) => {
|
|
|
41
35
|
state.clearAdd();
|
|
42
36
|
}, [parentId]);
|
|
43
37
|
return useObserver(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
44
|
-
React.createElement("div", { className: classnames("sub-units-list", props.className) },
|
|
45
|
-
React.createElement(ListView, { renderId: parentId, headerProps: {
|
|
46
|
-
header: (React.createElement("div", null,
|
|
38
|
+
React.createElement("div", { className: classnames(styles["sub-units-list"], props.className) },
|
|
39
|
+
React.createElement(ListView, { className: "units-list-view", renderId: parentId, headerProps: {
|
|
40
|
+
header: props.multiple ? (React.createElement("div", null,
|
|
47
41
|
React.createElement(BatchHeader, { viewTitle: "Sub-Units", buttons: [
|
|
48
42
|
React.createElement(DeleteButton, { execute: onDelete, key: "DeleteButton" }),
|
|
49
43
|
React.createElement(MoveButton, { execute: onMove, key: "MoveButton" })
|
|
50
44
|
] }),
|
|
51
|
-
React.createElement(AddUnitDropdown, { className: "add-unit-dropdown", types: ["Organization", "Team"], onItemClick: (val) => state.onItemClick(val), onCancelClick: () => state.clearAdd() }))),
|
|
52
|
-
|
|
45
|
+
props.addAble && (React.createElement(AddUnitDropdown, { className: "add-unit-dropdown", types: ["Organization", "Team"], onItemClick: (val) => state.onItemClick(val), onCancelClick: () => state.clearAdd() })))) : (undefined),
|
|
46
|
+
searchHeader: props.type === "select" ? true : false,
|
|
47
|
+
addAble: props.addAble,
|
|
53
48
|
filterViewProps: {
|
|
54
|
-
columns: [React.createElement(
|
|
49
|
+
columns: [React.createElement(UnitTypeFilter, { key: "Type" })]
|
|
55
50
|
}
|
|
56
|
-
|
|
57
|
-
}, moveAfter: moveAfter, renderItem: ({ item, index, multiple, connectDragSource }) => (React.createElement(UnitItem, { id: item.id, index: index, type: "sub", multiple: multiple, reload: !!readonly })) }),
|
|
51
|
+
}, moveAfter: moveAfter, renderItem: ({ item, index, multiple, connectDragSource }) => (React.createElement(React.Fragment, null, props.type === "select" ? (React.createElement(UnitItem, { id: item.id, index: index, type: "select", onSelectUnit: props.onSelectUnit })) : (React.createElement(UnitItem, { id: item.id, index: index, type: "sub", multiple: multiple, reload: !!readonly })))) }),
|
|
58
52
|
state.addAble && React.createElement(NewUnitForm, { parentId: props.parentId, simple: true, type: state.type })))));
|
|
59
53
|
function onMove(state) {
|
|
60
54
|
store.cut(state.ids);
|
|
@@ -67,5 +61,8 @@ const SubUnitList = (props) => {
|
|
|
67
61
|
await store.delete(state.ids[0]);
|
|
68
62
|
}
|
|
69
63
|
};
|
|
64
|
+
SubUnitList.defaultProps = {
|
|
65
|
+
addAble: true
|
|
66
|
+
};
|
|
70
67
|
export default SubUnitList;
|
|
71
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/SubUnitList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/SubUnitList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,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,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAED,oBAAoB;IACpB,KAAK,UAAU,SAAS,CAAC,EAAU,EAAE,OAAe;QACnD,MAAM,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IACD,KAAK,UAAU,QAAQ,CAAC,KAAwB;QAC/C,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;AACF,CAAC,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG;IAC1B,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import "~@voplus/antd/es/style/themes/default.less";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
.sub-units-list {
|
|
4
|
+
:global {
|
|
4
5
|
display: flex;
|
|
5
6
|
flex-direction: column;
|
|
6
7
|
height: 100%;
|
|
@@ -9,14 +10,19 @@
|
|
|
9
10
|
font-weight: 600;
|
|
10
11
|
color: #000;
|
|
11
12
|
}
|
|
12
|
-
.list-view-header{
|
|
13
|
+
.list-view-header {
|
|
13
14
|
position: relative;
|
|
14
|
-
.add-unit-dropdown{
|
|
15
|
+
.add-unit-dropdown {
|
|
15
16
|
position: absolute;
|
|
16
17
|
right: 20px;
|
|
17
18
|
top: 50%;
|
|
18
19
|
transform: translateY(-50%);
|
|
19
20
|
}
|
|
20
21
|
}
|
|
22
|
+
.units-list-view {
|
|
23
|
+
.list-view-header .plus-icon {
|
|
24
|
+
background: transparent;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -5,14 +5,29 @@ export declare type UnitListProps = {
|
|
|
5
5
|
scrollParentRef?: any;
|
|
6
6
|
header?: boolean;
|
|
7
7
|
readonly?: boolean;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
type?: "detail" | "sub" | "select" | "drive";
|
|
10
|
+
viewTitle?: string;
|
|
11
|
+
addAble?: boolean;
|
|
12
|
+
onSelectUnit?: (params?: any) => void;
|
|
8
13
|
};
|
|
9
14
|
export declare class State {
|
|
10
15
|
props: UnitListProps;
|
|
16
|
+
id: string;
|
|
11
17
|
list: IUnit[];
|
|
12
18
|
addAble: boolean;
|
|
13
19
|
/** add unit type */
|
|
14
20
|
type: unitType;
|
|
21
|
+
/** unitlist filter name */
|
|
22
|
+
name: string;
|
|
23
|
+
/** all units to check */
|
|
24
|
+
checkAll: boolean;
|
|
15
25
|
clearAdd(): void;
|
|
16
26
|
/** AddDocDropdown(新增type下拉Menu) item click */
|
|
17
27
|
onItemClick(val: unitType): void;
|
|
28
|
+
/**
|
|
29
|
+
* document filters
|
|
30
|
+
* @return document filters
|
|
31
|
+
*/
|
|
32
|
+
get filters(): any[];
|
|
18
33
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { action, observable } from "mobx";
|
|
2
|
+
import { action, computed, observable } from "mobx";
|
|
3
3
|
export class State {
|
|
4
4
|
constructor() {
|
|
5
|
+
this.id = "";
|
|
5
6
|
this.list = [];
|
|
6
7
|
this.addAble = false;
|
|
8
|
+
/** unitlist filter name */
|
|
9
|
+
this.name = "";
|
|
10
|
+
/** all units to check */
|
|
11
|
+
this.checkAll = false;
|
|
7
12
|
}
|
|
8
13
|
clearAdd() {
|
|
9
14
|
this.addAble = false;
|
|
@@ -13,7 +18,28 @@ export class State {
|
|
|
13
18
|
this.type = val;
|
|
14
19
|
this.addAble = true;
|
|
15
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* document filters
|
|
23
|
+
* @return document filters
|
|
24
|
+
*/
|
|
25
|
+
get filters() {
|
|
26
|
+
let filters = [];
|
|
27
|
+
if (this.id) {
|
|
28
|
+
filters.push({ c: "ParentNodeId", o: "=", l: "And", v1: this.id });
|
|
29
|
+
}
|
|
30
|
+
if (this.name) {
|
|
31
|
+
filters.push({ c: "Name", o: "contains", v1: this.name, l: "And" });
|
|
32
|
+
}
|
|
33
|
+
if (this.props.type !== "select") {
|
|
34
|
+
filters.push({ c: "Type", o: "=", l: "And", v1: "Group" });
|
|
35
|
+
}
|
|
36
|
+
filters = [...filters];
|
|
37
|
+
return filters;
|
|
38
|
+
}
|
|
16
39
|
}
|
|
40
|
+
__decorate([
|
|
41
|
+
observable
|
|
42
|
+
], State.prototype, "id", void 0);
|
|
17
43
|
__decorate([
|
|
18
44
|
observable
|
|
19
45
|
], State.prototype, "list", void 0);
|
|
@@ -23,10 +49,19 @@ __decorate([
|
|
|
23
49
|
__decorate([
|
|
24
50
|
observable
|
|
25
51
|
], State.prototype, "type", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
observable
|
|
54
|
+
], State.prototype, "name", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
observable
|
|
57
|
+
], State.prototype, "checkAll", void 0);
|
|
26
58
|
__decorate([
|
|
27
59
|
action
|
|
28
60
|
], State.prototype, "clearAdd", null);
|
|
29
61
|
__decorate([
|
|
30
62
|
action
|
|
31
63
|
], State.prototype, "onItemClick", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
computed
|
|
66
|
+
], State.prototype, "filters", null);
|
|
32
67
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/SubUnitList/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/SubUnitList/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAepD,MAAM,OAAO,KAAK;IAAlB;QAEoB,OAAE,GAAG,EAAE,CAAC;QACR,SAAI,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;IAAX,UAAU;mCAAkB;AAEjB;IAAX,UAAU;uCAAyB;AAGpC;IADC,MAAM;qCAGN;AAID;IADC,MAAM;wCAIN;AAOD;IADC,QAAQ;oCAcR"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./index.less";
|
|
3
|
+
declare const UnitItem: {
|
|
4
|
+
(props: {
|
|
5
|
+
id: string;
|
|
6
|
+
index?: number;
|
|
7
|
+
includes?: string;
|
|
8
|
+
showAvatar?: boolean;
|
|
9
|
+
showQuickData?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): JSX.Element;
|
|
12
|
+
defaultProps: {
|
|
13
|
+
showAvatar: boolean;
|
|
14
|
+
showQuickData: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default UnitItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import QuickDataIcon from "../../controls/QuickDataIcon";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import UnitAvatar from "../UnitAvatar";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
import { useObserver } from "mobx-react-lite";
|
|
7
|
+
import { useUnit } from "../../data";
|
|
8
|
+
const UnitItem = (props) => {
|
|
9
|
+
const { id, index, includes, showAvatar, showQuickData, className } = props;
|
|
10
|
+
const contact = useUnit(id, { includes: includes });
|
|
11
|
+
return useObserver(() => (React.createElement("div", { className: classnames("unit-detail", className) },
|
|
12
|
+
showAvatar && (React.createElement("div", { className: "unit-avatar" },
|
|
13
|
+
React.createElement(UnitAvatar, { id: id, size: "large", index: index }))),
|
|
14
|
+
React.createElement("div", null,
|
|
15
|
+
React.createElement("div", { className: "unit-name" }, contact.name),
|
|
16
|
+
showQuickData && (React.createElement("div", null,
|
|
17
|
+
React.createElement(QuickDataIcon, { id: id })))))));
|
|
18
|
+
};
|
|
19
|
+
UnitItem.defaultProps = {
|
|
20
|
+
showAvatar: true,
|
|
21
|
+
showQuickData: true
|
|
22
|
+
};
|
|
23
|
+
export default UnitItem;
|
|
24
|
+
//# sourceMappingURL=Item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,QAAQ,GAAG,CAAC,KAOjB,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAS,EAAE,CAAC,CAAC;IAErD,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;QAClD,UAAU,IAAI,CACd,6BAAK,SAAS,EAAC,aAAa;YAC3B,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,GAAI,CAC5C,CACN;QACD;YACC,6BAAK,SAAS,EAAC,WAAW,IAAE,OAAO,CAAC,IAAI,CAAO;YAC9C,aAAa,IAAI,CACjB;gBACC,oBAAC,aAAa,IAAC,EAAE,EAAE,EAAE,GAAI,CACpB,CACN,CACI,CACD,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,YAAY,GAAG;IACvB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;CACnB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import { UnitContext, UnitContextState, useUnitContext } from "../../data/UnitContext";
|
|
4
|
+
import { useUnit, useUnitStore } from "../../data";
|
|
5
|
+
import { Checkbox } from "@voplus/antd";
|
|
6
|
+
import Item from "./Item";
|
|
7
|
+
import ToolBar from "../../controls/ToolBar";
|
|
8
|
+
import classnames from "classnames";
|
|
9
|
+
import styles from "./index.less";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
const SubUnitItem = (props) => {
|
|
12
|
+
const { id, index, parentId, multiple, className, type } = props;
|
|
13
|
+
const [state] = useState(new State());
|
|
14
|
+
state.contact = useUnit(id);
|
|
15
|
+
const unitStore = useUnitStore();
|
|
16
|
+
const store = useUnitContext();
|
|
17
|
+
const [options] = useState(new UnitContextState());
|
|
18
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
19
|
+
React.createElement("div", { className: classnames(styles["unit-item-content"], className) },
|
|
20
|
+
type === "sub" && (React.createElement("div", { className: "unit-item", onMouseLeave: () => (state.isHover = false) },
|
|
21
|
+
React.createElement("div", { className: classnames("unit-item_box", { "unit-item_hover": state.isHover }), onMouseOver: () => (state.isHover = !multiple && !state.editable) },
|
|
22
|
+
multiple && React.createElement(Checkbox, { value: props.id, className: "multiple-checkbox" }),
|
|
23
|
+
React.createElement(Item, { id: id, index: index })),
|
|
24
|
+
React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
25
|
+
React.createElement(ToolBar, { id: props.id, size: "middle", url: `/units/${props.id}`, onDelete: onDel })))),
|
|
26
|
+
type === "detail" && (React.createElement("div", { className: "unit-item" },
|
|
27
|
+
React.createElement(Item, { id: id, index: index }))),
|
|
28
|
+
type === "tree" && (React.createElement("div", { className: "unit-item", onClick: () => { var _a; return (_a = store === null || store === void 0 ? void 0 : store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, state.contact.id); } },
|
|
29
|
+
React.createElement(Item, { id: id, index: index }))),
|
|
30
|
+
type === "select" && (React.createElement("div", { className: "unit-item", onDoubleClick: () => { var _a; return (_a = props.onSelectUnit) === null || _a === void 0 ? void 0 : _a.call(props, state.contact); } },
|
|
31
|
+
React.createElement(Item, { id: id, index: index })))))));
|
|
32
|
+
/** unit item delete */
|
|
33
|
+
function onDel() {
|
|
34
|
+
if (state.contact.type === "User" && parentId) {
|
|
35
|
+
unitStore.deleteUser({ pid: parentId, id: id });
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
unitStore.delete(id);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export default SubUnitItem;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC5C,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@@
|
|
|
1
|
-
.unit-item {
|
|
1
|
+
.unit-item-content {
|
|
2
2
|
flex: 1;
|
|
3
|
-
color: #333;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
position: relative;
|
|
7
|
-
padding: 10px 0;
|
|
8
|
-
margin: 0 20px;
|
|
9
|
-
border-bottom: 1px solid #d9d9d9;
|
|
10
3
|
:global {
|
|
4
|
+
.unit-item {
|
|
5
|
+
flex: 1;
|
|
6
|
+
color: #333;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
padding: 10px 0;
|
|
11
|
+
margin: 0 20px;
|
|
12
|
+
border-bottom: 1px solid #d9d9d9;
|
|
13
|
+
}
|
|
14
|
+
.unit-detail{
|
|
15
|
+
flex: 1;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
11
19
|
.unit-item_box {
|
|
12
|
-
flex:1;
|
|
20
|
+
flex: 1;
|
|
13
21
|
display: flex;
|
|
14
22
|
align-items: center;
|
|
15
23
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ConnectDragSource } from "react-dnd";
|
|
2
1
|
import { IUnit } from "../../data";
|
|
3
2
|
export declare type UnitItemProps = {
|
|
4
3
|
/** unit item id */
|
|
@@ -6,13 +5,14 @@ export declare type UnitItemProps = {
|
|
|
6
5
|
/** unit item parentId */
|
|
7
6
|
parentId?: string;
|
|
8
7
|
index?: number;
|
|
8
|
+
/** "detail" 详情| "sub" sub列表| "select" 文件选择对话盒| "tree" UnitSortableTree */
|
|
9
9
|
type?: string;
|
|
10
10
|
reload?: boolean;
|
|
11
11
|
multiple?: boolean;
|
|
12
|
-
connectDragSource?: ConnectDragSource;
|
|
13
12
|
onExpand?: () => void;
|
|
14
13
|
onReload?: () => void;
|
|
15
14
|
className?: string;
|
|
15
|
+
onSelectUnit?: (params?: any) => void;
|
|
16
16
|
};
|
|
17
17
|
export declare class State {
|
|
18
18
|
contact: IUnit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/state.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAkBlC,MAAM,OAAO,KAAK;IAAlB;QAEC,0BAA0B;QACP,aAAQ,GAAG,KAAK,CAAC;QACpC,6BAA6B;QACV,YAAO,GAAG,KAAK,CAAC;IACpC,CAAC;CAAA;AALY;IAAX,UAAU;sCAAuB;AAEtB;IAAX,UAAU;uCAAyB;AAExB;IAAX,UAAU;sCAAwB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { DocumentStatusFilter, FlagFilter } from "../../../../controls/filters";
|
|
2
1
|
import { useAutoUpdateUnitListData, useUnitListEffect } from "../../data";
|
|
3
2
|
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
4
3
|
import React, { useState } from "react";
|
|
5
4
|
import { State } from "./state";
|
|
6
5
|
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
7
6
|
import NewUnitForm from "../NewUnitForm";
|
|
8
|
-
import UnitItem from "../UnitItem
|
|
7
|
+
import UnitItem from "../UnitItem";
|
|
9
8
|
import UnitPropertiesView from "../UnitPropertiesView";
|
|
9
|
+
import UnitTypeFilter from "../../controls/UnitTypeFilter";
|
|
10
10
|
import { useObserver } from "mobx-react-lite";
|
|
11
11
|
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
12
12
|
const UnitList = (props) => {
|
|
@@ -28,10 +28,10 @@ const UnitList = (props) => {
|
|
|
28
28
|
return useObserver(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
29
29
|
React.createElement(ListView, { renderId: parentId, headerProps: {
|
|
30
30
|
filterViewProps: {
|
|
31
|
-
columns: [React.createElement(
|
|
31
|
+
columns: [React.createElement(UnitTypeFilter, { key: "Type" })]
|
|
32
32
|
},
|
|
33
33
|
sortable: false
|
|
34
|
-
}, formViewTitle: "Add Unit", formView: React.createElement(NewUnitForm, { parentId: "c896a84e-b31a-4d10-a181-5d34a21b172d" }), propertiesView: (id) => React.createElement(UnitPropertiesView, { id: id }), renderItem: ({ item, index, connectDragSource }) => (React.createElement(UnitItem, { id: item.id, index: index, reload: !!readonly })) }))));
|
|
34
|
+
}, formViewTitle: "Add Unit", formView: React.createElement(NewUnitForm, { parentId: "c896a84e-b31a-4d10-a181-5d34a21b172d" }), propertiesView: (id) => React.createElement(UnitPropertiesView, { id: id }), renderItem: ({ item, index, connectDragSource }) => (React.createElement(UnitItem, { id: item.id, index: index, reload: !!readonly, type: "detail" })) }))));
|
|
35
35
|
};
|
|
36
36
|
export default UnitList;
|
|
37
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAE/C,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,+BA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C,GAAG,EACzE,cAAc,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,oBAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,GAAI,EAC9D,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAO,EAAE,EAAE,CAAC,CACxD,oBAAC,QAAQ,IACR,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClB,IAAI,EAAC,QAAQ,GAEZ,CACF,GACA,CACwB,CAC3B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { faSitemap, faUser, faUserAlt, faUsers } from "@fortawesome/pro-light-svg-icons";
|
|
2
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useObserver } from "mobx-react-lite";
|
|
5
|
+
import { useUnit } from "../../data";
|
|
6
|
+
import { useUnitContext } from "../../data/UnitContext";
|
|
7
|
+
const UnitName = (props) => {
|
|
8
|
+
const { id } = props;
|
|
9
|
+
const contact = useUnit(id, { reload: false });
|
|
10
|
+
const store = useUnitContext();
|
|
11
|
+
return useObserver(() => (React.createElement("div", { className: "file-document-name", onClick: () => { var _a; return (_a = store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, contact.id); } },
|
|
12
|
+
React.createElement("div", { className: "file-type" },
|
|
13
|
+
contact.type === "Organization" && React.createElement(FAIcon, { icon: faSitemap }),
|
|
14
|
+
contact.type === "Team" && React.createElement(FAIcon, { icon: faUsers }),
|
|
15
|
+
contact.type === "Account" && React.createElement(FAIcon, { icon: faUserAlt }),
|
|
16
|
+
contact.type === "User" && React.createElement(FAIcon, { icon: faUser })),
|
|
17
|
+
React.createElement("div", { className: "file-name" }, contact.name))));
|
|
18
|
+
};
|
|
19
|
+
export default UnitName;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitName/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACrB,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAE/B,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,wBAAC,KAAK,CAAC,cAAc,+CAApB,KAAK,EAAkB,OAAO,CAAC,EAAE,IAAC;QACtF,6BAAK,SAAS,EAAC,WAAW;YACxB,OAAO,CAAC,IAAI,KAAK,cAAc,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,SAAS,GAAI;YAC9D,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,GAAI;YACpD,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,SAAS,GAAI;YACzD,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CAC/C;QACN,6BAAK,SAAS,EAAC,WAAW,IAAE,OAAO,CAAC,IAAI,CAAO,CAC1C,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { useOnDeleteUnit, useOnNewUnit, useUnit, useUnitListEffect, useUnitStore
|
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
|
3
3
|
import { State } from "./state";
|
|
4
4
|
import { UnitContext, UnitContextState } from "../../data/UnitContext";
|
|
5
|
-
import
|
|
5
|
+
import Panable from "@voplus/morpho-ui/es/controls/Panable";
|
|
6
6
|
import SortableTree from "react-sortable-tree";
|
|
7
|
-
import SortableTreeUnitTheme from "
|
|
7
|
+
import SortableTreeUnitTheme from "./themes/SortableTreeUnitTheme";
|
|
8
8
|
import { useObserver } from "mobx-react-lite";
|
|
9
9
|
const UnitSortableTree = (props) => {
|
|
10
10
|
const { theme, canDrag } = props;
|
|
@@ -16,7 +16,7 @@ const UnitSortableTree = (props) => {
|
|
|
16
16
|
/** 根文件 */
|
|
17
17
|
const root = useUnit(props.id);
|
|
18
18
|
useObserver(() => {
|
|
19
|
-
if (root.id && !state.treeData.length) {
|
|
19
|
+
if (root.id && root.loaded && !state.treeData.length) {
|
|
20
20
|
// if (root.documents! > 0) {
|
|
21
21
|
root.children = state.treeChildren;
|
|
22
22
|
// }
|
|
@@ -40,7 +40,6 @@ const UnitSortableTree = (props) => {
|
|
|
40
40
|
});
|
|
41
41
|
useOnNewUnit((s, unit) => {
|
|
42
42
|
var _a, _b;
|
|
43
|
-
console.log("useOnNewUnit--tree", unit.id, unit.name);
|
|
44
43
|
state.editTreeData(state.treeData, unit.parentNodeId);
|
|
45
44
|
if (!((_a = state.treeNodeChildren) === null || _a === void 0 ? void 0 : _a.children)) {
|
|
46
45
|
state.treeNodeChildren.children = [unit];
|
|
@@ -60,7 +59,7 @@ const UnitSortableTree = (props) => {
|
|
|
60
59
|
/** isVirtualized={false} 可以解决滚动时,重新渲染UnitItem组件
|
|
61
60
|
* 设置为false可禁用虚拟化。默认为true。注意:拖动时自动滚动以及滚动到searchFocusOffset都将被禁用。*/
|
|
62
61
|
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
63
|
-
React.createElement(
|
|
62
|
+
React.createElement(Panable, { scroll: true },
|
|
64
63
|
React.createElement(SortableTree, { isVirtualized: false, treeData: state.treeData, onChange: (val) => state.updateTreeData(val), getNodeKey: ({ node }) => node.id, onVisibilityToggle: (val) => state.onVisibilityToggle(val), onMoveNode: (val) => state.onMoveNode(val), canDrop: ({ nextPath }) => ((nextPath === null || nextPath === void 0 ? void 0 : nextPath.length) > 1 ? true : false), canNodeHaveChildren: (node) => state.toHaveChildren(node), canDrag: canDrag, theme: theme })))));
|
|
65
64
|
};
|
|
66
65
|
UnitSortableTree.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitSortableTree/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,EACf,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitSortableTree/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,EACf,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MA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,CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAChE,mBAAmB,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAC9D,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,CACO,CACY,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG;IAC/B,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,qBAAqB;CAC5B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Can override the following:
|
|
2
|
+
//
|
|
3
|
+
// style: PropTypes.shape({}),
|
|
4
|
+
// innerStyle: PropTypes.shape({}),
|
|
5
|
+
// reactVirtualizedListProps: PropTypes.shape({}),
|
|
6
|
+
// scaffoldBlockPxWidth: PropTypes.number,
|
|
7
|
+
// slideRegionSize: PropTypes.number,
|
|
8
|
+
// rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
|
|
9
|
+
// treeNodeRenderer: PropTypes.func,
|
|
10
|
+
// nodeContentRenderer: PropTypes.func,
|
|
11
|
+
// placeholderRenderer: PropTypes.func,
|
|
12
|
+
import nodeContentRenderer from "./node-content-renderer";
|
|
13
|
+
import treeNodeRenderer from "./tree-node-renderer";
|
|
14
|
+
const FileExplorerTheme = {
|
|
15
|
+
nodeContentRenderer,
|
|
16
|
+
treeNodeRenderer,
|
|
17
|
+
scaffoldBlockPxWidth: 25,
|
|
18
|
+
rowHeight: 25,
|
|
19
|
+
slideRegionSize: 50
|
|
20
|
+
};
|
|
21
|
+
export default FileExplorerTheme;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8BAA8B;AAC9B,mCAAmC;AACnC,kDAAkD;AAClD,0CAA0C;AAC1C,qCAAqC;AACrC,sEAAsE;AACtE,oCAAoC;AACpC,uCAAuC;AACvC,uCAAuC;AAGvC,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,MAAM,iBAAiB,GAAe;IACrC,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB,EAAE,EAAE;IACxB,SAAS,EAAE,EAAE;IACb,eAAe,EAAE,EAAE;CACnB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|