aldehyde 0.2.235 → 0.2.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/action/index.d.ts +2 -0
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts +2 -0
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/collapse-card/index.d.ts +2 -0
- package/lib/controls/collapse-card/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.d.ts +2 -0
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +2 -0
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/date-picker/index.d.ts.map +1 -1
- package/lib/controls/date-picker/index.js +9 -1
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +2 -0
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts +2 -0
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +2 -0
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +4 -1
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/file-view/drawer-file-view.js +1 -1
- package/lib/controls/file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/file-view/index.d.ts +1 -1
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +3 -3
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/file-view/multi-file-view.d.ts +12 -0
- package/lib/controls/file-view/multi-file-view.d.ts.map +1 -0
- package/lib/controls/file-view/multi-file-view.js +27 -0
- package/lib/controls/file-view/multi-file-view.js.map +1 -0
- package/lib/controls/password-setter/index.d.ts +2 -0
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.d.ts +2 -0
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.d.ts +2 -0
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/select/index.d.ts +2 -0
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/signature/index.d.ts +2 -0
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts +2 -0
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/tree-select/tree-entity-select.d.ts.map +1 -1
- package/lib/controls/tree-select/tree-entity-select.js +0 -1
- package/lib/controls/tree-select/tree-entity-select.js.map +1 -1
- package/lib/controls/upload/index.d.ts +2 -0
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/upload/index.js +3 -2
- package/lib/controls/upload/index.js.map +1 -1
- package/lib/controls/upload/mult-file-upload.d.ts +35 -0
- package/lib/controls/upload/mult-file-upload.d.ts.map +1 -0
- package/lib/controls/upload/mult-file-upload.js +181 -0
- package/lib/controls/upload/mult-file-upload.js.map +1 -0
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +3 -1
- package/lib/controls/view-control.js.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +2 -0
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts +2 -0
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts +2 -0
- package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.d.ts +2 -0
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/edit/fields-edit-card.d.ts +2 -0
- package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts +2 -0
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/row-edit-card.d.ts +2 -0
- package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
- package/lib/detail/rightbar/index.d.ts +2 -0
- package/lib/detail/rightbar/index.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts +2 -0
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +1 -1
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +0 -3
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/field-view-group.d.ts +2 -0
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts +2 -0
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts +2 -0
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/tab-act-dtmpl-view.d.ts +68 -0
- package/lib/detail/view/tab-act-dtmpl-view.d.ts.map +1 -0
- package/lib/detail/view/tab-act-dtmpl-view.js +182 -0
- package/lib/detail/view/tab-act-dtmpl-view.js.map +1 -0
- package/lib/export/export-frame.d.ts +2 -0
- package/lib/export/export-frame.d.ts.map +1 -1
- package/lib/export/select-code-export-frame.d.ts +2 -0
- package/lib/export/select-code-export-frame.d.ts.map +1 -1
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +11 -3
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts +2 -0
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/field-group-form.d.ts +2 -0
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/form-Item-group.d.ts +2 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +3 -2
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/hooks/use-match-route/index.d.ts +10 -0
- package/lib/hooks/use-match-route/index.d.ts.map +1 -0
- package/lib/hooks/use-match-route/index.js +41 -0
- package/lib/hooks/use-match-route/index.js.map +1 -0
- package/lib/hooks/use-tabs/index.d.ts +18 -0
- package/lib/hooks/use-tabs/index.d.ts.map +1 -0
- package/lib/hooks/use-tabs/index.js +112 -0
- package/lib/hooks/use-tabs/index.js.map +1 -0
- package/lib/import/excel-import.d.ts +2 -0
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/layout/MainPage.js +1 -1
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/coverstyle.css +1 -1
- package/lib/layout/menu/block.d.ts +2 -0
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +2 -0
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts +2 -0
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.d.ts +2 -0
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.d.ts +2 -0
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts +2 -0
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/sidebar/index.js +4 -2
- package/lib/layout/sidebar/index.js.map +1 -1
- package/lib/layout2/components/userButton.d.ts.map +1 -1
- package/lib/layout2/components/userButton.js +9 -2
- package/lib/layout2/components/userButton.js.map +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +4 -66
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/main.d.ts +1 -1
- package/lib/layout2/main.d.ts.map +1 -1
- package/lib/layout2/main.js +3 -3
- package/lib/layout2/main.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +20 -2
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/sider.d.ts +1 -2
- package/lib/layout2/sider.d.ts.map +1 -1
- package/lib/layout2/sider.js +6 -125
- package/lib/layout2/sider.js.map +1 -1
- package/lib/layout2/tabs/tabs-context.d.ts +20 -0
- package/lib/layout2/tabs/tabs-context.d.ts.map +1 -0
- package/lib/layout2/tabs/tabs-context.js +9 -0
- package/lib/layout2/tabs/tabs-context.js.map +1 -0
- package/lib/layout2/tabs/tabs-layout.d.ts +4 -0
- package/lib/layout2/tabs/tabs-layout.d.ts.map +1 -0
- package/lib/layout2/tabs/tabs-layout.js +87 -0
- package/lib/layout2/tabs/tabs-layout.js.map +1 -0
- package/lib/locale/LocaleProvider.d.ts +2 -0
- package/lib/locale/LocaleProvider.d.ts.map +1 -1
- package/lib/locale/LocaleProvider.js +7 -1
- package/lib/locale/LocaleProvider.js.map +1 -1
- package/lib/locale/useLocale.d.ts +2 -0
- package/lib/locale/useLocale.d.ts.map +1 -1
- package/lib/locale/useLocale.js +8 -2
- package/lib/locale/useLocale.js.map +1 -1
- package/lib/login/login.d.ts +2 -0
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login2/login-page.js +1 -1
- package/lib/login2/login-page.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts +2 -0
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +0 -1
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +2 -0
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-view-card.d.ts.map +1 -1
- package/lib/module/dtmpl-view-card.js +0 -10
- package/lib/module/dtmpl-view-card.js.map +1 -1
- package/lib/module/ltmpl-modal.d.ts +2 -0
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-table.d.ts +4 -0
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +3 -2
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/dtmpl-route.d.ts.map +1 -1
- package/lib/routable/dtmpl-route.js +2 -2
- package/lib/routable/dtmpl-route.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +20 -13
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/ttmpl-route.d.ts +1 -0
- package/lib/routable/ttmpl-route.d.ts.map +1 -1
- package/lib/routable/ttmpl-route.js +2 -2
- package/lib/routable/ttmpl-route.js.map +1 -1
- package/lib/routable/withroute.d.ts.map +1 -1
- package/lib/routable/withroute.js +8 -2
- package/lib/routable/withroute.js.map +1 -1
- package/lib/table/act-table.d.ts +13 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +117 -55
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts +1 -0
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +100 -81
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +2 -0
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +1 -1
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/pagination.d.ts +2 -0
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/query-table.d.ts +7 -3
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +62 -12
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +2 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +1 -1
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts +2 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +2 -1
- package/lib/table/select-table.js.map +1 -1
- package/lib/table/selected-rows-card.d.ts +3 -0
- package/lib/table/selected-rows-card.d.ts.map +1 -1
- package/lib/table/selected-rows-card.js +2 -1
- package/lib/table/selected-rows-card.js.map +1 -1
- package/lib/table/stat/restat.d.ts +3 -1
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/table/stat/restat.js +1 -1
- package/lib/table/stat/restat.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +5 -2
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +62 -21
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +28 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tree/act-tree.d.ts +6 -1
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/act-tree.js +5 -5
- package/lib/tree/act-tree.js.map +1 -1
- package/lib/tree/tmpl-tree.d.ts +2 -0
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/tree/tree-utils.js +1 -1
- package/lib/tree/tree-utils.js.map +1 -1
- package/lib/units/index.d.ts +5 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +25 -0
- package/lib/units/index.js.map +1 -1
- package/lib/welcome/quick-entrance.d.ts +2 -0
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/workbench.d.ts +2 -0
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/aldehyde/controls/date-picker/index.tsx +15 -1
- package/src/aldehyde/controls/entry-control.tsx +4 -1
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +1 -1
- package/src/aldehyde/controls/file-view/index.tsx +4 -4
- package/src/aldehyde/controls/file-view/multi-file-view.tsx +43 -0
- package/src/aldehyde/controls/tree-select/tree-entity-select.tsx +0 -1
- package/src/aldehyde/controls/upload/index.tsx +8 -3
- package/src/aldehyde/controls/upload/mult-file-upload.tsx +216 -0
- package/src/aldehyde/controls/view-control.tsx +3 -1
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +1 -3
- package/src/aldehyde/detail/view/dtmpl-view.tsx +1 -4
- package/src/aldehyde/detail/view/tab-act-dtmpl-view.tsx +304 -0
- package/src/aldehyde/form/criteria-form.tsx +23 -3
- package/src/aldehyde/form/form-Item-group.tsx +4 -3
- package/src/aldehyde/hooks/use-match-route/index.tsx +63 -0
- package/src/aldehyde/hooks/use-tabs/index.tsx +130 -0
- package/src/aldehyde/layout/MainPage.tsx +1 -1
- package/src/aldehyde/layout/coverstyle.css +1 -1
- package/src/aldehyde/layout/sidebar/index.tsx +4 -4
- package/src/aldehyde/layout2/components/userButton.tsx +15 -2
- package/src/aldehyde/layout2/header.tsx +5 -69
- package/src/aldehyde/layout2/main.tsx +4 -3
- package/src/aldehyde/layout2/page.tsx +25 -3
- package/src/aldehyde/layout2/sider.tsx +5 -133
- package/src/aldehyde/layout2/tabs/tabs-context.tsx +30 -0
- package/src/aldehyde/layout2/tabs/tabs-layout.tsx +152 -0
- package/src/aldehyde/locale/LocaleProvider.tsx +13 -2
- package/src/aldehyde/locale/useLocale.ts +10 -2
- package/src/aldehyde/login2/login-page.tsx +1 -1
- package/src/aldehyde/module/dtmpl-edit-card.tsx +0 -1
- package/src/aldehyde/module/dtmpl-view-card.tsx +0 -11
- package/src/aldehyde/module/ltmpl-table.tsx +13 -27
- package/src/aldehyde/routable/dtmpl-route.tsx +2 -1
- package/src/aldehyde/routable/ltmpl-route.tsx +38 -50
- package/src/aldehyde/routable/ttmpl-route.tsx +3 -2
- package/src/aldehyde/routable/withroute.tsx +12 -2
- package/src/aldehyde/table/act-table.tsx +158 -177
- package/src/aldehyde/table/column/column-builder.tsx +256 -257
- package/src/aldehyde/table/modal-select-table.tsx +3 -2
- package/src/aldehyde/table/query-table.tsx +84 -14
- package/src/aldehyde/table/relation-table.tsx +1 -2
- package/src/aldehyde/table/select-table.tsx +2 -1
- package/src/aldehyde/table/selected-rows-card.tsx +3 -0
- package/src/aldehyde/table/stat/restat.tsx +2 -3
- package/src/aldehyde/tmpl/hcservice-v3.tsx +58 -22
- package/src/aldehyde/tmpl/interface.tsx +36 -3
- package/src/aldehyde/tree/act-tree.tsx +7 -5
- package/src/aldehyde/tree/tree-utils.tsx +1 -1
- package/src/aldehyde/units/index.tsx +40 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Button, Card, Form as AntdForm, FormInstance, message, Tabs, Tooltip} from "antd";
|
|
3
|
+
import {DtmplBaseProps, DtmplConfig, DtmplData} from "../../tmpl/interface";
|
|
4
|
+
import {
|
|
5
|
+
ReloadOutlined,
|
|
6
|
+
ScheduleOutlined,
|
|
7
|
+
EditOutlined, BankOutlined,
|
|
8
|
+
} from "@ant-design/icons";
|
|
9
|
+
import HCDataSource from "../../tmpl/hc-data-source";
|
|
10
|
+
import "../dtmpl.css";
|
|
11
|
+
import SnapshotTimeline from "./snapshot-timeline";
|
|
12
|
+
import DtmplView from "./dtmpl-view";
|
|
13
|
+
import Units from "../../units";
|
|
14
|
+
import ToolTipBar from "../tooltipbar";
|
|
15
|
+
import {LocaleContext} from "../../locale/LocaleProvider";
|
|
16
|
+
import Action from "../../controls/action";
|
|
17
|
+
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
18
|
+
import LtmplTable from "../../module/ltmpl-table";
|
|
19
|
+
import ActionUtils from "../../controls/action/utils";
|
|
20
|
+
|
|
21
|
+
export interface ActDtmplViewProps extends DtmplBaseProps {
|
|
22
|
+
versionId?: number;
|
|
23
|
+
goBackToLtmpl?: () => void,
|
|
24
|
+
title?: any;
|
|
25
|
+
showHeader?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ActDtmplViewStat {
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
dtmplConfig?: DtmplConfig;
|
|
31
|
+
premisesTitle?: string;
|
|
32
|
+
snapshotOpen?: boolean;
|
|
33
|
+
layout?: object;
|
|
34
|
+
refreshCode?: string;
|
|
35
|
+
actionDtmplData?:DtmplData;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class TabActDtmplView extends React.PureComponent<
|
|
39
|
+
ActDtmplViewProps,
|
|
40
|
+
ActDtmplViewStat
|
|
41
|
+
> {
|
|
42
|
+
static defaultProps = {
|
|
43
|
+
showRightNav: true,
|
|
44
|
+
rightBarPositionRight: 15,
|
|
45
|
+
showHeader: true,
|
|
46
|
+
};
|
|
47
|
+
formRef = React.createRef<FormInstance>();
|
|
48
|
+
static contextType = LocaleContext;
|
|
49
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
50
|
+
|
|
51
|
+
state = {
|
|
52
|
+
loading: true,
|
|
53
|
+
dtmplConfig: undefined,
|
|
54
|
+
snapshotOpen: false,
|
|
55
|
+
premisesTitle: "默认字段",
|
|
56
|
+
layout: {
|
|
57
|
+
labelCol: {span: 8},
|
|
58
|
+
wrapperCol: {span: 16},
|
|
59
|
+
},
|
|
60
|
+
refreshCode: undefined,
|
|
61
|
+
actionDtmplData:undefined,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
async componentDidMount() {
|
|
65
|
+
const {sourceId,code, serverKey} = this.props;
|
|
66
|
+
let dtmplConfig = await HCDataSource.requestViewDtmplConfig(
|
|
67
|
+
serverKey,
|
|
68
|
+
sourceId
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
await this.loadActionDtmplData(dtmplConfig);
|
|
72
|
+
|
|
73
|
+
this.setState({
|
|
74
|
+
dtmplConfig,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
loadActionDtmplData = async (dtmplConfig:DtmplConfig) => {
|
|
79
|
+
let actionDtmplData=undefined;
|
|
80
|
+
const {sourceId,code, serverKey} = this.props;
|
|
81
|
+
if(dtmplConfig?.viewActions && dtmplConfig?.viewActions.length>0){
|
|
82
|
+
actionDtmplData = await HcserviceV3.requestViewDtmplData(
|
|
83
|
+
serverKey,
|
|
84
|
+
sourceId,
|
|
85
|
+
code,null
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
this.setState({
|
|
89
|
+
actionDtmplData,
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
doRefresh = async () => {
|
|
94
|
+
const {dtmplConfig} = this.state;
|
|
95
|
+
await this.loadActionDtmplData(dtmplConfig);
|
|
96
|
+
this.setState({
|
|
97
|
+
refreshCode: Units.getRandomNum(6),
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
goEdit = () => {
|
|
102
|
+
const {goDtmpl, code} = this.props;
|
|
103
|
+
goDtmpl(code);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
showSnapshot = () => {
|
|
107
|
+
this.setState({
|
|
108
|
+
snapshotOpen: true,
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
onSnapshotClose = () => {
|
|
113
|
+
this.setState({
|
|
114
|
+
snapshotOpen: false,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
toSnapshot = () => {
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
onSubmit = async (values: any) => {
|
|
122
|
+
this.setState({
|
|
123
|
+
loading: true,
|
|
124
|
+
});
|
|
125
|
+
const { sourceId, code, serverKey } = this.props;
|
|
126
|
+
if (code) {
|
|
127
|
+
//有code是修改,没有是新增实体模板
|
|
128
|
+
values["唯一编码"] = code;
|
|
129
|
+
}
|
|
130
|
+
let res = await HcserviceV3.postDtmplData(
|
|
131
|
+
serverKey,
|
|
132
|
+
sourceId,
|
|
133
|
+
values,
|
|
134
|
+
message
|
|
135
|
+
);
|
|
136
|
+
this.setState({
|
|
137
|
+
loading: false,
|
|
138
|
+
});
|
|
139
|
+
if (res.status === "success") {
|
|
140
|
+
if(this.props.goBackToLtmpl){
|
|
141
|
+
this.props.goBackToLtmpl();
|
|
142
|
+
}else{
|
|
143
|
+
this.doRefresh();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
doSubmit = (actionId?: number, codes?: string[], params?: object) => {
|
|
149
|
+
const { mainCode } = this.props;
|
|
150
|
+
//if (actionId) {
|
|
151
|
+
this.formRef.current.setFieldsValue({ actionId: actionId });
|
|
152
|
+
// }
|
|
153
|
+
if (mainCode) {
|
|
154
|
+
this.formRef.current.setFieldsValue({ mainCode: mainCode });
|
|
155
|
+
}
|
|
156
|
+
if (params) {
|
|
157
|
+
this.formRef.current.setFieldsValue(params);
|
|
158
|
+
}
|
|
159
|
+
this.formRef.current.submit();
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
render() {
|
|
163
|
+
const {
|
|
164
|
+
showRightNav,
|
|
165
|
+
rightBarPositionRight,
|
|
166
|
+
code,
|
|
167
|
+
sourceId,
|
|
168
|
+
goDtmpl,
|
|
169
|
+
serverKey,
|
|
170
|
+
codeSource,
|
|
171
|
+
title,
|
|
172
|
+
showHeader
|
|
173
|
+
} = this.props;
|
|
174
|
+
const {
|
|
175
|
+
dtmplConfig,
|
|
176
|
+
snapshotOpen,
|
|
177
|
+
refreshCode,actionDtmplData,
|
|
178
|
+
} = this.state;
|
|
179
|
+
const {translate} = this.context;
|
|
180
|
+
|
|
181
|
+
const buttons = dtmplConfig ? dtmplConfig.buttons : undefined;
|
|
182
|
+
//const premises = dtmplConfig ? dtmplConfig.premises : undefined;
|
|
183
|
+
let showRightNav_ = showRightNav;
|
|
184
|
+
if (dtmplConfig && dtmplConfig.groups.length < 4) {
|
|
185
|
+
showRightNav_ = false;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let items=[];
|
|
189
|
+
items.push( {
|
|
190
|
+
label: <BankOutlined size={50}/>,
|
|
191
|
+
key: 'main',
|
|
192
|
+
children: <DtmplView
|
|
193
|
+
codeSource={codeSource}
|
|
194
|
+
serverKey={serverKey}
|
|
195
|
+
refreshCode={refreshCode}
|
|
196
|
+
showRightNav={showRightNav_}
|
|
197
|
+
rightBarPositionRight={rightBarPositionRight}
|
|
198
|
+
dtmplConfig={dtmplConfig}
|
|
199
|
+
sourceId={sourceId}
|
|
200
|
+
code={code}
|
|
201
|
+
></DtmplView>,
|
|
202
|
+
})
|
|
203
|
+
if(code && dtmplConfig?.viewRactions){
|
|
204
|
+
dtmplConfig.viewRactions.forEach(r=>{
|
|
205
|
+
if(ActionUtils.isShow(
|
|
206
|
+
r?.preposes,
|
|
207
|
+
[actionDtmplData],
|
|
208
|
+
undefined
|
|
209
|
+
)){
|
|
210
|
+
items.push( {
|
|
211
|
+
label: r.title,
|
|
212
|
+
key: r.id,
|
|
213
|
+
children: <LtmplTable readOnly={true}
|
|
214
|
+
serverKey={null}
|
|
215
|
+
sourceId={r.id}
|
|
216
|
+
mainCode={code}
|
|
217
|
+
></LtmplTable>,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
return (
|
|
224
|
+
<div
|
|
225
|
+
className={`detailPage ${
|
|
226
|
+
showRightNav_ ? "showRightNav" : "noRightNav"
|
|
227
|
+
}`}
|
|
228
|
+
><Tabs type="card"
|
|
229
|
+
defaultActiveKey="main"
|
|
230
|
+
// size={"small"}
|
|
231
|
+
style={{ marginBottom: 32 }}
|
|
232
|
+
tabBarExtraContent={{left:<h3 style={{marginRight:20,marginLeft:10}}>{translate("${" + (title ? title : "详情") + "}")}
|
|
233
|
+
{dtmplConfig ? <ToolTipBar content={dtmplConfig.tip}/> : null}</h3>,
|
|
234
|
+
right:<div className="fr">
|
|
235
|
+
{buttons &&
|
|
236
|
+
buttons.includes("dtmplEdit") &&
|
|
237
|
+
goDtmpl &&
|
|
238
|
+
!dtmplConfig.editAction ? (
|
|
239
|
+
<Button className="hoverbig" onClick={this.goEdit}>
|
|
240
|
+
<EditOutlined/>
|
|
241
|
+
</Button>
|
|
242
|
+
) : (
|
|
243
|
+
""
|
|
244
|
+
)}
|
|
245
|
+
{dtmplConfig?.viewActions?.map((ac) => {
|
|
246
|
+
return (<Action
|
|
247
|
+
serverKey={serverKey}
|
|
248
|
+
iconType={"icon-title"}
|
|
249
|
+
hiddenType={"disabled"}
|
|
250
|
+
data={[actionDtmplData]}
|
|
251
|
+
key={ac.id}
|
|
252
|
+
formRef={this.formRef}
|
|
253
|
+
actionConfig={ac}
|
|
254
|
+
doAction={this.doSubmit}
|
|
255
|
+
></Action>)
|
|
256
|
+
})}
|
|
257
|
+
|
|
258
|
+
{buttons && buttons.includes("history") ? (
|
|
259
|
+
<Tooltip title={translate("${数据快照}")}>
|
|
260
|
+
<Button className="hoverbig" onClick={this.showSnapshot}>
|
|
261
|
+
<ScheduleOutlined/>
|
|
262
|
+
</Button>
|
|
263
|
+
</Tooltip>
|
|
264
|
+
) : (
|
|
265
|
+
""
|
|
266
|
+
)}
|
|
267
|
+
<Button
|
|
268
|
+
className="hoverbig"
|
|
269
|
+
title={translate("${刷新}")}
|
|
270
|
+
onClick={this.doRefresh}
|
|
271
|
+
>
|
|
272
|
+
<ReloadOutlined/>
|
|
273
|
+
</Button>
|
|
274
|
+
<SnapshotTimeline
|
|
275
|
+
serverKey={serverKey}
|
|
276
|
+
dtmplConfig={dtmplConfig}
|
|
277
|
+
code={code}
|
|
278
|
+
onClose={this.onSnapshotClose}
|
|
279
|
+
showSnapshot={this.toSnapshot}
|
|
280
|
+
sourceId={sourceId}
|
|
281
|
+
open={snapshotOpen}
|
|
282
|
+
></SnapshotTimeline>
|
|
283
|
+
</div>}
|
|
284
|
+
}
|
|
285
|
+
items={items}
|
|
286
|
+
/>
|
|
287
|
+
|
|
288
|
+
<AntdForm
|
|
289
|
+
scrollToFirstError={true}
|
|
290
|
+
labelWrap={true}
|
|
291
|
+
ref={this.formRef}
|
|
292
|
+
name="control-hooks"
|
|
293
|
+
//onValuesChange={this.onValuesChange}
|
|
294
|
+
onFinish={this.onSubmit}
|
|
295
|
+
>
|
|
296
|
+
<AntdForm.Item hidden={true} name={"actionId"}></AntdForm.Item>
|
|
297
|
+
<AntdForm.Item hidden={true} name={"mainCode"}></AntdForm.Item>
|
|
298
|
+
</AntdForm>
|
|
299
|
+
</div>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export default TabActDtmplView;
|
|
@@ -23,7 +23,7 @@ import EntryControl from "../controls/entry-control";
|
|
|
23
23
|
import Action from "../controls/action";
|
|
24
24
|
import CquickButton from "../controls/cquery/cquick-button";
|
|
25
25
|
import { useLocale } from "../locale/useLocale";
|
|
26
|
-
import { SearchOutlined } from "@ant-design/icons";
|
|
26
|
+
import {DownOutlined, LeftOutlined, RightOutlined, SearchOutlined, UpOutlined} from "@ant-design/icons";
|
|
27
27
|
import { ProgramConfig } from "../index";
|
|
28
28
|
import SelectCodeExport from "../controls/file-export/select-code-export";
|
|
29
29
|
|
|
@@ -80,7 +80,8 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
80
80
|
drillingParams,
|
|
81
81
|
columns,
|
|
82
82
|
updrillButtonConfigs,
|
|
83
|
-
innerParams
|
|
83
|
+
innerParams,
|
|
84
|
+
defShowCriteriaCount,
|
|
84
85
|
} = ltmplConfig;
|
|
85
86
|
const initialValues = {};
|
|
86
87
|
const searchSubmit = (data) => {
|
|
@@ -96,9 +97,18 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
96
97
|
// let currentDrillButton=null;
|
|
97
98
|
const [currentDrillButton, setCurrentDrillButton] = useState(null);
|
|
98
99
|
const [drillLoadings, setDrillLoadings] = useState<string>(null);
|
|
100
|
+
const [collapsible, setCollapsible] = useState<boolean>(false);
|
|
101
|
+
const [expanded, setExpanded] = useState<boolean>(false);
|
|
102
|
+
|
|
103
|
+
let collapseCriteria:CriteriaConfig[] =defShowCriteriaCount<=0?criterias:criterias.slice(0,defShowCriteriaCount);
|
|
104
|
+
|
|
105
|
+
|
|
99
106
|
|
|
100
107
|
useEffect(() => {
|
|
101
108
|
form.resetFields();
|
|
109
|
+
if(collapseCriteria.length<criterias.length){
|
|
110
|
+
setCollapsible(true);
|
|
111
|
+
}
|
|
102
112
|
});
|
|
103
113
|
|
|
104
114
|
let showQueryButton = buttons.includes("query") && doSearch;
|
|
@@ -431,10 +441,20 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
431
441
|
{renderDrillDimension()}</>
|
|
432
442
|
: null}
|
|
433
443
|
{showQueryButton || (updrillButtonConfigs && updrillButtonConfigs.length > 0)
|
|
434
|
-
? renderCriteria(criterias)
|
|
444
|
+
? renderCriteria(expanded?criterias:collapseCriteria)
|
|
435
445
|
: null}
|
|
436
446
|
|
|
437
447
|
<Space className="btns">
|
|
448
|
+
{collapsible ? (
|
|
449
|
+
expanded?<Button icon={<LeftOutlined />} type={"link"} onClick={()=>setExpanded(false)}>
|
|
450
|
+
{translate("${收起}")}
|
|
451
|
+
</Button>:
|
|
452
|
+
<Button icon={<RightOutlined />} type={"link"} onClick={()=>setExpanded(true)}>
|
|
453
|
+
{translate("${更多条件}")}
|
|
454
|
+
</Button>
|
|
455
|
+
) : (
|
|
456
|
+
""
|
|
457
|
+
)}
|
|
438
458
|
{showQueryButton ? (
|
|
439
459
|
<Button type="primary" htmlType="submit">
|
|
440
460
|
{translate("${查询}")}
|
|
@@ -97,7 +97,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
97
97
|
}
|
|
98
98
|
return rules;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
debugger
|
|
101
101
|
return (
|
|
102
102
|
<FormItem
|
|
103
103
|
label={translate("${" + item.title + "}")}
|
|
@@ -118,7 +118,8 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
118
118
|
? { span: 15 }
|
|
119
119
|
: { span: 19 }
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
|
|
122
|
+
tooltip={(!item.tip || item.tip=="")?undefined:item.tip}
|
|
122
123
|
initialValue={fieldValue}
|
|
123
124
|
style={{ margin: 4 }}
|
|
124
125
|
rules={getRules(item)}
|
|
@@ -147,7 +148,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
147
148
|
if (fields && fields.length > 0) {
|
|
148
149
|
fields.forEach((item, index) => {
|
|
149
150
|
let fieldValue = valueMap ? valueMap[item.id] : undefined;
|
|
150
|
-
const fieldKey = item.id + Math.random() * 100;
|
|
151
|
+
//const fieldKey = item.id + Math.random() * 100;
|
|
151
152
|
fieldValue =
|
|
152
153
|
fieldValue || fieldValue == 0
|
|
153
154
|
? fieldValue
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {useLocation, useMatches, useOutlet, useParams, useSearchParams} from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
interface MatchRouteType {
|
|
5
|
+
// 菜单名称
|
|
6
|
+
title: string;
|
|
7
|
+
// tab对应的url
|
|
8
|
+
pathname: string;
|
|
9
|
+
// 要渲染的组件
|
|
10
|
+
children: any;
|
|
11
|
+
// 路由,和pathname区别是,详情页 pathname是 /:id,routePath是 /1
|
|
12
|
+
routePath: string;
|
|
13
|
+
// 图标
|
|
14
|
+
icon?: string;
|
|
15
|
+
// searchParmStr:string;
|
|
16
|
+
//key:string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useMatchRoute(): MatchRouteType | undefined {
|
|
20
|
+
// 获取路由组件实例
|
|
21
|
+
const children = useOutlet();
|
|
22
|
+
// 获取所有路由
|
|
23
|
+
const matches = useMatches();
|
|
24
|
+
// 获取当前url
|
|
25
|
+
const { pathname,search } = useLocation();
|
|
26
|
+
|
|
27
|
+
const { sourceId } = useParams();
|
|
28
|
+
|
|
29
|
+
// //const lastRoute = matches[matches.length - 1];
|
|
30
|
+
// const [searchParams, setSearchParams] = useSearchParams();
|
|
31
|
+
// console.log(searchParams.toString());
|
|
32
|
+
// let searchParmStr=searchParams.toString();
|
|
33
|
+
// if(searchParmStr){
|
|
34
|
+
// searchParmStr="?"+searchParmStr;
|
|
35
|
+
// }
|
|
36
|
+
let urlName=pathname+search;
|
|
37
|
+
//let urlName=pathname;
|
|
38
|
+
const [matchRoute, setMatchRoute] = useState<MatchRouteType | undefined>();
|
|
39
|
+
|
|
40
|
+
// 监听pathname变了,说明路由有变化,重新匹配,返回新路由信息
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
// 获取当前匹配的路由
|
|
43
|
+
//const lastRoute = matches[matches.length - 1];
|
|
44
|
+
|
|
45
|
+
// if (!lastRoute?.handle) return;
|
|
46
|
+
//let sourceId=lastRoute?.params['sourceId'];
|
|
47
|
+
let sourceId_=sourceId;
|
|
48
|
+
if(pathname.indexOf("/home")>0){
|
|
49
|
+
sourceId_="home";
|
|
50
|
+
}
|
|
51
|
+
setMatchRoute({
|
|
52
|
+
title:sourceId_||'其他',
|
|
53
|
+
pathname:urlName,
|
|
54
|
+
children,
|
|
55
|
+
routePath: pathname,
|
|
56
|
+
//icon: (lastRoute?.handle as any)?.icon,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
},[urlName])
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return matchRoute;
|
|
63
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useMatchRoute } from '../use-match-route';
|
|
2
|
+
// import { router } from '@/router';
|
|
3
|
+
import { useSessionStorageState } from 'ahooks';
|
|
4
|
+
import { omit } from 'lodash-es';
|
|
5
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
6
|
+
import {useNavigate} from "react-router-dom";
|
|
7
|
+
|
|
8
|
+
export interface KeepAliveTab {
|
|
9
|
+
title: string;
|
|
10
|
+
routePath: string;
|
|
11
|
+
key: string;
|
|
12
|
+
pathname: string;
|
|
13
|
+
// searchParmStr:string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getKey() {
|
|
19
|
+
return new Date().getTime().toString();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useTabs() {
|
|
23
|
+
// 存放页面记录
|
|
24
|
+
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', {
|
|
25
|
+
defaultValue: [],
|
|
26
|
+
serializer: value => {
|
|
27
|
+
// 把 children 剔除掉,不然会报错
|
|
28
|
+
return JSON.stringify(value.map(item => omit(item, ['children'])))
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
// 当前激活的tab
|
|
32
|
+
const [activeTabRoutePath, setActiveTabRoutePath] = useState<string>('');
|
|
33
|
+
|
|
34
|
+
const matchRoute = useMatchRoute();
|
|
35
|
+
let navigate = useNavigate();
|
|
36
|
+
// 关闭tab
|
|
37
|
+
const closeTab = useCallback(
|
|
38
|
+
(routePath: string = activeTabRoutePath || '') => {
|
|
39
|
+
if (!keepAliveTabs?.length) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const index = (keepAliveTabs || []).findIndex(o => o.routePath === routePath);
|
|
43
|
+
if (keepAliveTabs[index].routePath === activeTabRoutePath && keepAliveTabs.length > 1) {
|
|
44
|
+
if (index > 0) {
|
|
45
|
+
navigate(keepAliveTabs[index - 1].pathname);
|
|
46
|
+
} else {
|
|
47
|
+
navigate(keepAliveTabs[index + 1].pathname);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
keepAliveTabs.splice(index, 1);
|
|
51
|
+
setKeepAliveTabs([...keepAliveTabs]);
|
|
52
|
+
},
|
|
53
|
+
[activeTabRoutePath],
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// 关闭除了自己其它tab
|
|
57
|
+
const closeOtherTab = useCallback((routePath: string = activeTabRoutePath || '') => {
|
|
58
|
+
if (!keepAliveTabs?.length) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const tab = keepAliveTabs.find(o => o.routePath === routePath);
|
|
62
|
+
setKeepAliveTabs(keepAliveTabs.filter(o => o.routePath === routePath));
|
|
63
|
+
//router.navigate(tab?.pathname || routePath);
|
|
64
|
+
}, [activeTabRoutePath]);
|
|
65
|
+
|
|
66
|
+
// 刷新tab
|
|
67
|
+
const refreshTab = useCallback((routePath: string = activeTabRoutePath || '') => {
|
|
68
|
+
|
|
69
|
+
// setKeepAliveTabs(prev => {
|
|
70
|
+
// const index = (prev || []).findIndex(tab => tab.pathname === routePath);
|
|
71
|
+
//
|
|
72
|
+
// if (index >= 0 && prev) {
|
|
73
|
+
// // 这个是react的特性,key变了,组件会卸载重新渲染
|
|
74
|
+
// prev[index].key = getKey();
|
|
75
|
+
// }
|
|
76
|
+
// return [...prev || []];
|
|
77
|
+
// });
|
|
78
|
+
}, [activeTabRoutePath]);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!matchRoute) return;
|
|
82
|
+
|
|
83
|
+
const existKeepAliveTab = (keepAliveTabs || []).find(o => o.routePath === matchRoute?.routePath);
|
|
84
|
+
|
|
85
|
+
// 如果不存在则需要插入
|
|
86
|
+
if (!existKeepAliveTab) {
|
|
87
|
+
setKeepAliveTabs([...(keepAliveTabs || []), {
|
|
88
|
+
title: matchRoute.title,
|
|
89
|
+
key: getKey(),
|
|
90
|
+
routePath: matchRoute.routePath,
|
|
91
|
+
pathname: matchRoute.pathname,
|
|
92
|
+
children: matchRoute.children,
|
|
93
|
+
icon: matchRoute.icon
|
|
94
|
+
// searchParmStr:matchRoute.searchParmStr||""
|
|
95
|
+
}]);
|
|
96
|
+
} else if (existKeepAliveTab.pathname !== matchRoute.pathname) {
|
|
97
|
+
// 如果是同一个路由,但是参数不同,我们只需要刷新当前页签并且把pathname设置为新的pathname, children设置为新的children
|
|
98
|
+
setKeepAliveTabs(prev => {
|
|
99
|
+
const index = (prev || []).findIndex(tab => tab.routePath === matchRoute.routePath);
|
|
100
|
+
if (index >= 0 && prev) {
|
|
101
|
+
prev[index].key = getKey();
|
|
102
|
+
prev[index].pathname = matchRoute.pathname;
|
|
103
|
+
prev[index].children = matchRoute.children;
|
|
104
|
+
// prev[index].searchParmStr=matchRoute.searchParmStr ||""
|
|
105
|
+
}
|
|
106
|
+
return [...(prev || [])];
|
|
107
|
+
});
|
|
108
|
+
} else if (!existKeepAliveTab.children) {
|
|
109
|
+
// 如果pathname相同,但是children为空,说明重缓存中加载的数据,我们只需要刷新当前页签并且把children设置为新的children
|
|
110
|
+
setKeepAliveTabs(prev => {
|
|
111
|
+
const index = (prev || []).findIndex(tab => tab.routePath === matchRoute.routePath);
|
|
112
|
+
if (index >= 0 && prev) {
|
|
113
|
+
prev[index].key = getKey();
|
|
114
|
+
prev[index].children = matchRoute.children;
|
|
115
|
+
}
|
|
116
|
+
return [...(prev || [])];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
setActiveTabRoutePath(matchRoute.routePath);
|
|
120
|
+
}, [matchRoute])
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
tabs: keepAliveTabs,
|
|
124
|
+
activeTabRoutePath,
|
|
125
|
+
closeTab,
|
|
126
|
+
closeOtherTab,
|
|
127
|
+
refreshTab,
|
|
128
|
+
setTabs: setKeepAliveTabs,
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -292,7 +292,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
292
292
|
<SideBar
|
|
293
293
|
header={leftHeader}
|
|
294
294
|
collapsedHeader={leftCollapsedHeader}
|
|
295
|
-
title={
|
|
295
|
+
title={sideBartitle}
|
|
296
296
|
logo={sideBarLogo}
|
|
297
297
|
blockMenu={this.findCurrentBlock()}
|
|
298
298
|
currentL2MenuId={currentL2MenuId}
|
|
@@ -20,7 +20,9 @@ const SideBar: React.FC<SideBarProps> = (props) => {
|
|
|
20
20
|
const { translate } = useLocale();
|
|
21
21
|
const { token } = useToken();
|
|
22
22
|
let syyy = { "--logo-blue-background": token.colorPrimary } as CSSProperties;
|
|
23
|
-
let { collapsed,header,collapsedHeader } = props;
|
|
23
|
+
let { collapsed,header,collapsedHeader ,title} = props;
|
|
24
|
+
let programLabel= title ? title : Units.programName_NavLeft();
|
|
25
|
+
programLabel=translate("${"+ programLabel +"}");
|
|
24
26
|
return (
|
|
25
27
|
<div>
|
|
26
28
|
<Scrollbars
|
|
@@ -67,9 +69,7 @@ const SideBar: React.FC<SideBarProps> = (props) => {
|
|
|
67
69
|
) : (
|
|
68
70
|
<></>
|
|
69
71
|
)}
|
|
70
|
-
{
|
|
71
|
-
props.title ? props.title : Units.programName_NavLeft()
|
|
72
|
-
)}
|
|
72
|
+
{programLabel}
|
|
73
73
|
</>
|
|
74
74
|
</h1>
|
|
75
75
|
</>
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
CaretDownOutlined,
|
|
4
4
|
ClearOutlined,
|
|
5
5
|
LoginOutlined,
|
|
6
|
-
LogoutOutlined,
|
|
6
|
+
LogoutOutlined, MenuFoldOutlined, MenuUnfoldOutlined,
|
|
7
7
|
SettingOutlined,
|
|
8
8
|
UnlockOutlined,
|
|
9
9
|
UserOutlined,
|
|
@@ -16,6 +16,7 @@ import { useLocale } from "../../locale/useLocale";
|
|
|
16
16
|
import { NavLink, useNavigate } from "react-router-dom";
|
|
17
17
|
import ResetPassword from "../../layout/menu/reset-password";
|
|
18
18
|
import HCDataSource from "../../tmpl/hc-data-source";
|
|
19
|
+
import Units from "../../units";
|
|
19
20
|
|
|
20
21
|
type DropDownMenuType = {
|
|
21
22
|
label: string | number | ReactNode;
|
|
@@ -26,7 +27,7 @@ type DropDownMenuType = {
|
|
|
26
27
|
|
|
27
28
|
const UserButton: React.FC<ButtonProps> = (props) => {
|
|
28
29
|
// translate
|
|
29
|
-
const { translate } = useLocale();
|
|
30
|
+
const { translate,changeSiderCollapsed,getSiderCollapsed } = useLocale();
|
|
30
31
|
|
|
31
32
|
// navigation
|
|
32
33
|
const navigate = useNavigate();
|
|
@@ -123,6 +124,17 @@ const UserButton: React.FC<ButtonProps> = (props) => {
|
|
|
123
124
|
show: () => {
|
|
124
125
|
return isLogin && userConfig.cleanCachable;
|
|
125
126
|
},
|
|
127
|
+
},{
|
|
128
|
+
label: (
|
|
129
|
+
<span onClick={() => changeSiderCollapsed()}>
|
|
130
|
+
{getSiderCollapsed()?translate("${显示侧边栏}"):translate("${隐藏侧边栏}")}
|
|
131
|
+
</span>
|
|
132
|
+
),
|
|
133
|
+
key: "collapseSider",
|
|
134
|
+
icon: <span>{getSiderCollapsed()? <MenuUnfoldOutlined /> :<MenuFoldOutlined /> }</span>,
|
|
135
|
+
show: () => {
|
|
136
|
+
return isLogin ;
|
|
137
|
+
},
|
|
126
138
|
},
|
|
127
139
|
{
|
|
128
140
|
label: <span onClick={logout}>{translate("${退出}")}</span>,
|
|
@@ -132,6 +144,7 @@ const UserButton: React.FC<ButtonProps> = (props) => {
|
|
|
132
144
|
return isLogin;
|
|
133
145
|
},
|
|
134
146
|
},
|
|
147
|
+
|
|
135
148
|
];
|
|
136
149
|
const cleanDropdownMenuList: GetProp<MenuProps, "items"> = dropdownMenuList
|
|
137
150
|
.filter((item) => {
|