aldehyde 0.2.97 → 0.2.99
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/LICENSE +1 -1
- package/lib/controls/action/index.d.ts +16 -7
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/action/index.js +64 -48
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/action/utils.d.ts +1 -1
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +6 -4
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/auto-complete/index.d.ts +1 -1
- package/lib/controls/auto-complete/index.d.ts.map +1 -1
- package/lib/controls/auto-complete/index.js +12 -6
- package/lib/controls/auto-complete/index.js.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts +13 -4
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.js +40 -27
- package/lib/controls/chemstruc/graph.js.map +1 -1
- package/lib/controls/color-picker/index.d.ts +11 -2
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +23 -19
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +11 -2
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.js +30 -28
- package/lib/controls/cquery/cquick-button.js.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +12 -3
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +66 -64
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts +11 -2
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.js +26 -21
- package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +11 -2
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +30 -26
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +152 -98
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
- package/lib/controls/input-number/index.d.ts +1 -1
- package/lib/controls/input-number/index.d.ts.map +1 -1
- package/lib/controls/input-number/index.js +31 -23
- package/lib/controls/input-number/index.js.map +1 -1
- package/lib/controls/input-range/index.d.ts +1 -1
- package/lib/controls/input-range/index.d.ts.map +1 -1
- package/lib/controls/input-range/index.js +9 -8
- package/lib/controls/input-range/index.js.map +1 -1
- package/lib/controls/password-setter/index.d.ts +9 -3
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/password-setter/index.js +22 -14
- package/lib/controls/password-setter/index.js.map +1 -1
- package/lib/controls/progress/index.d.ts +1 -1
- package/lib/controls/progress/index.d.ts.map +1 -1
- package/lib/controls/progress/index.js +13 -6
- package/lib/controls/progress/index.js.map +1 -1
- package/lib/controls/relation-existion/index.d.ts +11 -2
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.js +30 -18
- package/lib/controls/relation-existion/index.js.map +1 -1
- package/lib/controls/rfield/index.d.ts +11 -2
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.js +33 -35
- package/lib/controls/rfield/index.js.map +1 -1
- package/lib/controls/signature/index.d.ts +10 -1
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/signature/index.js +56 -31
- package/lib/controls/signature/index.js.map +1 -1
- package/lib/controls/steps/index.d.ts +1 -1
- package/lib/controls/steps/index.d.ts.map +1 -1
- package/lib/controls/steps/index.js +8 -6
- package/lib/controls/steps/index.js.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts +9 -0
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.js +13 -11
- package/lib/controls/text/ellipsis-text.js.map +1 -1
- package/lib/controls/upload/index.d.ts +10 -1
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/upload/index.js +30 -21
- package/lib/controls/upload/index.js.map +1 -1
- package/lib/controls/view-control.d.ts +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +118 -85
- package/lib/controls/view-control.js.map +1 -1
- package/lib/custom-page/def-custom-page.d.ts +5 -6
- package/lib/custom-page/def-custom-page.d.ts.map +1 -1
- package/lib/custom-page/def-custom-page.js +13 -12
- package/lib/custom-page/def-custom-page.js.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +10 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js +19 -7
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts +11 -2
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.js +20 -12
- package/lib/detail/button/bottom-submit-button-bar.js.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts +12 -3
- package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
- package/lib/detail/button/cquery-button-bar.js +22 -18
- package/lib/detail/button/cquery-button-bar.js.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.d.ts +11 -2
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.js +28 -23
- package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -1
- package/lib/detail/edit/fields-edit-card.d.ts +11 -2
- package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/fields-edit-card.js +18 -19
- package/lib/detail/edit/fields-edit-card.js.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts +11 -2
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.js +14 -11
- package/lib/detail/edit/modal-row-edit.js.map +1 -1
- package/lib/detail/edit/post-result/index.d.ts +1 -1
- package/lib/detail/edit/post-result/index.d.ts.map +1 -1
- package/lib/detail/edit/post-result/index.js +17 -12
- package/lib/detail/edit/post-result/index.js.map +1 -1
- package/lib/detail/edit/row-edit-card.d.ts +11 -2
- package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/row-edit-card.js +23 -23
- package/lib/detail/edit/row-edit-card.js.map +1 -1
- package/lib/detail/rightbar/index.d.ts +12 -3
- package/lib/detail/rightbar/index.d.ts.map +1 -1
- package/lib/detail/rightbar/index.js +16 -9
- package/lib/detail/rightbar/index.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts +11 -2
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +26 -25
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.d.ts +2 -2
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +40 -40
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts +10 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.js +11 -8
- package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts +11 -2
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.js +18 -16
- package/lib/detail/view/snapshot-timeline.js.map +1 -1
- package/lib/exportor/export-frame.d.ts +11 -2
- package/lib/exportor/export-frame.d.ts.map +1 -1
- package/lib/exportor/export-frame.js +41 -42
- package/lib/exportor/export-frame.js.map +1 -1
- package/lib/form/criteria-form.d.ts +2 -2
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +58 -45
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts +11 -2
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +76 -61
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts +12 -3
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/field-group-form.js +26 -18
- package/lib/form/field-group-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +10 -1
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +43 -26
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/import/excel-import.d.ts +12 -3
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/import/excel-import.js +69 -55
- package/lib/import/excel-import.js.map +1 -1
- package/lib/index.d.ts +42 -39
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +43 -39
- package/lib/index.js.map +1 -1
- package/lib/layout/MainPage.d.ts +1 -1
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js +46 -36
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/footer/index.d.ts.map +1 -1
- package/lib/layout/header/index.d.ts +1 -1
- package/lib/layout/header/index.d.ts.map +1 -1
- package/lib/layout/header/index.js +16 -14
- package/lib/layout/header/index.js.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +11 -2
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +24 -19
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout/menu/reset-password.d.ts +12 -3
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.js +52 -36
- package/lib/layout/menu/reset-password.js.map +1 -1
- package/lib/layout/menu/user-bar.d.ts +12 -3
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.js +72 -42
- package/lib/layout/menu/user-bar.js.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts +10 -1
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +11 -10
- package/lib/layout/menu/userinfo-bar.js.map +1 -1
- package/lib/layout/sidebar/index.css +15 -4
- package/lib/layout/sidebar/index.d.ts +2 -2
- package/lib/layout/sidebar/index.d.ts.map +1 -1
- package/lib/layout/sidebar/index.js +19 -13
- package/lib/layout/sidebar/index.js.map +1 -1
- package/lib/locale/LocaleButton.d.ts +4 -0
- package/lib/locale/LocaleButton.d.ts.map +1 -0
- package/lib/locale/LocaleButton.js +24 -0
- package/lib/locale/LocaleButton.js.map +1 -0
- package/lib/locale/LocaleProvider.d.ts +13 -0
- package/lib/locale/LocaleProvider.d.ts.map +1 -0
- package/lib/locale/LocaleProvider.js +135 -0
- package/lib/locale/LocaleProvider.js.map +1 -0
- package/lib/locale/langMp.d.ts +16 -0
- package/lib/locale/langMp.d.ts.map +1 -0
- package/lib/locale/langMp.js +29 -0
- package/lib/locale/langMp.js.map +1 -0
- package/lib/locale/translate.d.ts +3 -0
- package/lib/locale/translate.d.ts.map +1 -0
- package/lib/locale/translate.js +74 -0
- package/lib/locale/translate.js.map +1 -0
- package/lib/locale/useLocale.d.ts +14 -0
- package/lib/locale/useLocale.d.ts.map +1 -0
- package/lib/locale/useLocale.js +34 -0
- package/lib/locale/useLocale.js.map +1 -0
- package/lib/login/login.d.ts +13 -3
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +38 -25
- package/lib/login/login.js.map +1 -1
- package/lib/login/router-login.d.ts +2 -2
- package/lib/login/router-login.d.ts.map +1 -1
- package/lib/login/router-login.js +33 -19
- package/lib/login/router-login.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts +11 -2
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +21 -13
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +12 -3
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +42 -31
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/ltmpl-modal.d.ts +10 -1
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-modal.js +15 -8
- package/lib/module/ltmpl-modal.js.map +1 -1
- package/lib/module/ltmpl-table.d.ts +11 -2
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +39 -39
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/table/act-table.d.ts +12 -3
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +256 -205
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/control-table-x-axis-wrapper.d.ts +5 -0
- package/lib/table/control-table-x-axis-wrapper.d.ts.map +1 -0
- package/lib/table/control-table-x-axis-wrapper.js +60 -0
- package/lib/table/control-table-x-axis-wrapper.js.map +1 -0
- package/lib/table/l2-act-table.d.ts +1 -1
- package/lib/table/pagination.d.ts +11 -2
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/pagination.js +13 -12
- package/lib/table/pagination.js.map +1 -1
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +2 -1
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +13 -4
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +117 -108
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/selected-rows-card.d.ts +10 -1
- package/lib/table/selected-rows-card.d.ts.map +1 -1
- package/lib/table/selected-rows-card.js +10 -9
- package/lib/table/selected-rows-card.js.map +1 -1
- package/lib/table/stat/restat.d.ts +10 -1
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/table/stat/restat.js +10 -9
- package/lib/table/stat/restat.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +21 -14
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +2 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +127 -100
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/model-struc-v3.d.ts.map +1 -1
- package/lib/tmpl/model-struc-v3.js +19 -18
- package/lib/tmpl/model-struc-v3.js.map +1 -1
- package/lib/tmpl/superagent.d.ts +2 -2
- package/lib/tmpl/superagent.d.ts.map +1 -1
- package/lib/tmpl/superagent.js +28 -23
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/tree/act-tree.d.ts +10 -1
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/act-tree.js +26 -20
- package/lib/tree/act-tree.js.map +1 -1
- package/lib/tree/tmpl-tree.d.ts +11 -2
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.js +76 -58
- package/lib/tree/tmpl-tree.js.map +1 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js +7 -23
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/HCWelcome1.d.ts +4 -0
- package/lib/welcome/HCWelcome1.d.ts.map +1 -0
- package/lib/welcome/HCWelcome1.js +192 -0
- package/lib/welcome/HCWelcome1.js.map +1 -0
- package/lib/welcome/quick-entrance.d.ts +12 -3
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.js +21 -17
- package/lib/welcome/quick-entrance.js.map +1 -1
- package/lib/welcome/workbench.d.ts +12 -3
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/lib/welcome/workbench.js +23 -19
- package/lib/welcome/workbench.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/index.tsx +328 -221
- package/src/aldehyde/controls/action/utils.tsx +6 -4
- package/src/aldehyde/controls/auto-complete/index.tsx +64 -60
- package/src/aldehyde/controls/chemstruc/graph.tsx +175 -139
- package/src/aldehyde/controls/color-picker/index.tsx +107 -78
- package/src/aldehyde/controls/cquery/cquick-button.tsx +129 -89
- package/src/aldehyde/controls/entity-select/entity-select.tsx +643 -521
- package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +140 -131
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +178 -133
- package/src/aldehyde/controls/entry-control.tsx +373 -248
- package/src/aldehyde/controls/input-number/index.tsx +131 -86
- package/src/aldehyde/controls/input-range/index.tsx +51 -40
- package/src/aldehyde/controls/password-setter/index.js +81 -63
- package/src/aldehyde/controls/progress/index.tsx +59 -46
- package/src/aldehyde/controls/relation-existion/index.tsx +125 -87
- package/src/aldehyde/controls/rfield/index.tsx +178 -151
- package/src/aldehyde/controls/signature/index.tsx +215 -151
- package/src/aldehyde/controls/steps/index.tsx +44 -42
- package/src/aldehyde/controls/text/ellipsis-text.tsx +79 -53
- package/src/aldehyde/controls/upload/index.tsx +125 -109
- package/src/aldehyde/controls/view-control.tsx +250 -188
- package/src/aldehyde/custom-page/def-custom-page.tsx +17 -0
- package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +75 -66
- package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +79 -43
- package/src/aldehyde/detail/button/cquery-button-bar.tsx +129 -98
- package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +161 -113
- package/src/aldehyde/detail/edit/fields-edit-card.tsx +124 -87
- package/src/aldehyde/detail/edit/modal-row-edit.tsx +81 -60
- package/src/aldehyde/detail/edit/post-result/index.tsx +80 -47
- package/src/aldehyde/detail/edit/row-edit-card.tsx +158 -107
- package/src/aldehyde/detail/rightbar/index.tsx +79 -63
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +177 -124
- package/src/aldehyde/detail/view/dtmpl-view.tsx +284 -178
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +67 -54
- package/src/aldehyde/detail/view/snapshot-timeline.tsx +143 -110
- package/src/aldehyde/exportor/export-frame.tsx +258 -200
- package/src/aldehyde/form/criteria-form.tsx +309 -201
- package/src/aldehyde/form/dtmpl-form.tsx +460 -305
- package/src/aldehyde/form/field-group-form.tsx +87 -66
- package/src/aldehyde/form/form-Item-group.tsx +190 -132
- package/src/aldehyde/import/excel-import.tsx +414 -331
- package/src/aldehyde/index.tsx +90 -45
- package/src/aldehyde/layout/MainPage.tsx +280 -245
- package/src/aldehyde/layout/header/index.tsx +59 -53
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +137 -118
- package/src/aldehyde/layout/menu/reset-password.tsx +213 -162
- package/src/aldehyde/layout/menu/user-bar.tsx +216 -147
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +58 -41
- package/src/aldehyde/layout/sidebar/index.css +15 -4
- package/src/aldehyde/layout/sidebar/index.tsx +66 -38
- package/src/aldehyde/locale/LocaleButton.tsx +31 -0
- package/src/aldehyde/locale/LocaleProvider.tsx +165 -0
- package/src/aldehyde/locale/langMp.ts +33 -0
- package/src/aldehyde/locale/translate.ts +78 -0
- package/src/aldehyde/locale/useLocale.ts +50 -0
- package/src/aldehyde/login/login.tsx +192 -141
- package/src/aldehyde/login/router-login.tsx +54 -21
- package/src/aldehyde/module/dtmpl-edit-card.tsx +225 -160
- package/src/aldehyde/module/dtmpl-edit-page.tsx +334 -212
- package/src/aldehyde/module/ltmpl-modal.tsx +57 -53
- package/src/aldehyde/module/ltmpl-table.tsx +329 -240
- package/src/aldehyde/table/act-table.tsx +1226 -794
- package/src/aldehyde/table/control-table-x-axis-wrapper.tsx +52 -0
- package/src/aldehyde/table/pagination.tsx +66 -59
- package/src/aldehyde/table/query-table.tsx +2 -1
- package/src/aldehyde/table/relation-table.tsx +781 -571
- package/src/aldehyde/table/selected-rows-card.tsx +61 -48
- package/src/aldehyde/table/stat/restat.tsx +112 -69
- package/src/aldehyde/tmpl/hc-data-source.tsx +381 -296
- package/src/aldehyde/tmpl/hcservice-v3.tsx +991 -796
- package/src/aldehyde/tmpl/model-struc-v3.tsx +95 -91
- package/src/aldehyde/tmpl/superagent.js +148 -142
- package/src/aldehyde/tree/act-tree.tsx +206 -138
- package/src/aldehyde/tree/tmpl-tree.tsx +611 -353
- package/src/aldehyde/welcome/HCWelcome.js +78 -110
- package/src/aldehyde/welcome/HCWelcome1.js +260 -0
- package/src/aldehyde/welcome/quick-entrance.tsx +82 -71
- package/src/aldehyde/welcome/workbench.tsx +83 -68
- package/src/aldehyde/custom-page/def-custom-page.js +0 -18
|
@@ -1,396 +1,654 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {Button, Card, Col, Input, Popconfirm, Popover, Row, Space, Tooltip, Tree, Typography} from 'antd';
|
|
1
|
+
import React from "react";
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
Col,
|
|
6
|
+
Input,
|
|
7
|
+
Popconfirm,
|
|
8
|
+
Popover,
|
|
9
|
+
Row,
|
|
10
|
+
Space,
|
|
11
|
+
Tooltip,
|
|
12
|
+
Tree,
|
|
13
|
+
Typography,
|
|
14
|
+
} from "antd";
|
|
15
|
+
import {
|
|
16
|
+
AlignLeftOutlined,
|
|
17
|
+
DeleteOutlined,
|
|
18
|
+
EditOutlined,
|
|
19
|
+
PlusOutlined,
|
|
20
|
+
PlusSquareOutlined,
|
|
21
|
+
ReloadOutlined,
|
|
22
|
+
} from "@ant-design/icons";
|
|
11
23
|
// import './index.css';
|
|
12
|
-
import Scrollbars from
|
|
13
|
-
import {HydrocarbonService} from "../index";
|
|
14
|
-
import TreeUtils, {TtmplNodeConfig} from "./tree-utils";
|
|
15
|
-
import {TreeDataNode} from
|
|
24
|
+
import Scrollbars from "react-custom-scrollbars";
|
|
25
|
+
import { HydrocarbonService } from "../index";
|
|
26
|
+
import TreeUtils, { TtmplNodeConfig } from "./tree-utils";
|
|
27
|
+
import { TreeDataNode } from "./tree-utils";
|
|
28
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
16
29
|
|
|
17
|
-
const {Text, Title} = Typography
|
|
30
|
+
const { Text, Title } = Typography;
|
|
18
31
|
|
|
19
32
|
interface TmplTreeProps {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
ttmplNodeConfig: TtmplNodeConfig;
|
|
34
|
+
currentId?: string;
|
|
35
|
+
doEditSub?: (
|
|
36
|
+
title: string,
|
|
37
|
+
ratmplId: string,
|
|
38
|
+
mainCode: string,
|
|
39
|
+
code?: string
|
|
40
|
+
) => void;
|
|
41
|
+
doViewSub?: (
|
|
42
|
+
title: string,
|
|
43
|
+
ratmplId: string,
|
|
44
|
+
mainCode: string,
|
|
45
|
+
code?: string
|
|
46
|
+
) => void;
|
|
47
|
+
doEditRoot?: (title: string, code?: string) => void;
|
|
48
|
+
doViewRoot?: (title: string, code?: string) => void;
|
|
49
|
+
doDelete?: (ratmplId: string, code?: string) => void;
|
|
50
|
+
doAddSub?: (
|
|
51
|
+
title: string,
|
|
52
|
+
ratmplId: string,
|
|
53
|
+
mainCode: string,
|
|
54
|
+
addTmplId: string
|
|
55
|
+
) => void;
|
|
28
56
|
}
|
|
29
57
|
|
|
30
58
|
interface TmplTreeState {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
data?: TreeDataNode[];
|
|
60
|
+
expandedKeys?: string[];
|
|
61
|
+
loadedKeys?: string[];
|
|
62
|
+
loading?: boolean;
|
|
63
|
+
drawMainCode?: string;
|
|
64
|
+
parentNodeData?: TreeDataNode;
|
|
65
|
+
currentNodeData?: TreeDataNode;
|
|
66
|
+
rootAddable?: boolean;
|
|
67
|
+
searchValue?: string;
|
|
40
68
|
}
|
|
41
69
|
|
|
42
|
-
|
|
43
70
|
class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
state = {
|
|
72
|
+
data: [],
|
|
73
|
+
expandedKeys: [],
|
|
74
|
+
loadedKeys: [],
|
|
75
|
+
loading: false,
|
|
76
|
+
currentEditKey: undefined,
|
|
77
|
+
parentNodeData: undefined,
|
|
78
|
+
currentNodeData: undefined,
|
|
79
|
+
rootAddable: false,
|
|
80
|
+
searchValue: undefined,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
static defaultProps = {
|
|
84
|
+
draggable: false,
|
|
85
|
+
readOnly: false,
|
|
86
|
+
};
|
|
87
|
+
static contextType = LocaleContext;
|
|
88
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
89
|
+
|
|
90
|
+
doDelete = async (node: TreeDataNode) => {
|
|
91
|
+
let { ttmplNodeConfig } = this.props;
|
|
92
|
+
let sourceId;
|
|
93
|
+
if (node.isLeaf) {
|
|
94
|
+
sourceId = ttmplNodeConfig.leafRatmplId;
|
|
95
|
+
} else {
|
|
96
|
+
sourceId = ttmplNodeConfig.branchRatmplId;
|
|
55
97
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
98
|
+
let res = await HydrocarbonService.deleteByCode(null, sourceId, [
|
|
99
|
+
node.code,
|
|
100
|
+
]);
|
|
101
|
+
if (node.parent) {
|
|
102
|
+
await this.reloadData(node.parent.code);
|
|
60
103
|
}
|
|
104
|
+
};
|
|
61
105
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (node.isLeaf) {
|
|
66
|
-
sourceId = ttmplNodeConfig.leafRatmplId;
|
|
67
|
-
} else {
|
|
68
|
-
sourceId = ttmplNodeConfig.branchRatmplId;
|
|
69
|
-
}
|
|
70
|
-
let res = await HydrocarbonService.deleteByCode(null, sourceId, [node.code]);
|
|
71
|
-
if(node.parent){
|
|
72
|
-
await this.reloadData(node.parent.code);
|
|
73
|
-
}
|
|
106
|
+
async componentDidMount() {
|
|
107
|
+
await this.refresh();
|
|
108
|
+
}
|
|
74
109
|
|
|
75
|
-
|
|
110
|
+
async componentDidUpdate(prevProps) {
|
|
111
|
+
let { ttmplNodeConfig: preTtmplNodeConfig } = prevProps;
|
|
112
|
+
let { ttmplNodeConfig } = this.props;
|
|
76
113
|
|
|
77
|
-
|
|
78
|
-
|
|
114
|
+
if (
|
|
115
|
+
!ttmplNodeConfig ||
|
|
116
|
+
(preTtmplNodeConfig && ttmplNodeConfig.id == preTtmplNodeConfig.id)
|
|
117
|
+
) {
|
|
118
|
+
return;
|
|
79
119
|
}
|
|
120
|
+
await this.refresh();
|
|
121
|
+
}
|
|
80
122
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (!ttmplNodeConfig || (preTtmplNodeConfig && ttmplNodeConfig.id == preTtmplNodeConfig.id)) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
await this.refresh();
|
|
123
|
+
async refresh() {
|
|
124
|
+
const { ttmplNodeConfig } = this.props;
|
|
125
|
+
if (!ttmplNodeConfig) {
|
|
126
|
+
return;
|
|
90
127
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
128
|
+
this.setState({
|
|
129
|
+
loading: true,
|
|
130
|
+
});
|
|
131
|
+
//let loadedKeys = [];
|
|
132
|
+
let data = await this.loadRootNodeData();
|
|
133
|
+
this.setState({
|
|
134
|
+
searchValue: null,
|
|
135
|
+
data,
|
|
136
|
+
rootAddable:
|
|
137
|
+
ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplAdd") > 0,
|
|
138
|
+
loading: false,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
loadRootNodeData = async () => {
|
|
143
|
+
const { ttmplNodeConfig } = this.props;
|
|
144
|
+
let data = await TreeUtils.loadRootNodeData(ttmplNodeConfig);
|
|
145
|
+
return data;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
async componentWillUnmount() {}
|
|
149
|
+
|
|
150
|
+
onExpand = async (
|
|
151
|
+
expandedKeys,
|
|
152
|
+
current: { expanded: boolean; node: TreeDataNode }
|
|
153
|
+
) => {
|
|
154
|
+
const { ttmplNodeConfig } = this.props;
|
|
155
|
+
const { data } = this.state;
|
|
156
|
+
if (current.expanded) {
|
|
157
|
+
await TreeUtils.pushSameCodeNodeData([current.node], ttmplNodeConfig);
|
|
158
|
+
}
|
|
159
|
+
this.setState({
|
|
160
|
+
data: [...data],
|
|
161
|
+
expandedKeys,
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
onClickNode = (dataNode: TreeDataNode) => {
|
|
166
|
+
const {
|
|
167
|
+
doEditRoot,
|
|
168
|
+
doViewRoot,
|
|
169
|
+
doViewSub,
|
|
170
|
+
doEditSub,
|
|
171
|
+
ttmplNodeConfig,
|
|
172
|
+
} = this.props;
|
|
173
|
+
if (dataNode.parent) {
|
|
174
|
+
//说明是sub
|
|
175
|
+
if (dataNode.isLeaf) {
|
|
176
|
+
if (ttmplNodeConfig.leafLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
177
|
+
doEditSub(
|
|
178
|
+
ttmplNodeConfig.leafTitle,
|
|
179
|
+
ttmplNodeConfig.leafRatmplId,
|
|
180
|
+
dataNode.parent.code,
|
|
181
|
+
dataNode.code
|
|
182
|
+
);
|
|
183
|
+
} else if (
|
|
184
|
+
ttmplNodeConfig.leafLTmplConfig.buttons.indexOf("detail") > 0
|
|
185
|
+
) {
|
|
186
|
+
doViewSub(
|
|
187
|
+
ttmplNodeConfig.leafTitle,
|
|
188
|
+
ttmplNodeConfig.leafRatmplId,
|
|
189
|
+
dataNode.parent.code,
|
|
190
|
+
dataNode.code
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
if (
|
|
195
|
+
ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("dtmplEdit") > 0
|
|
196
|
+
) {
|
|
197
|
+
doEditSub(
|
|
198
|
+
ttmplNodeConfig.branchTitle,
|
|
199
|
+
ttmplNodeConfig.branchRatmplId,
|
|
200
|
+
dataNode.parent.code,
|
|
201
|
+
dataNode.code
|
|
202
|
+
);
|
|
203
|
+
} else if (
|
|
204
|
+
ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("detail") > 0
|
|
205
|
+
) {
|
|
206
|
+
doViewSub(
|
|
207
|
+
ttmplNodeConfig.branchTitle,
|
|
208
|
+
ttmplNodeConfig.branchRatmplId,
|
|
209
|
+
dataNode.parent.code,
|
|
210
|
+
dataNode.code
|
|
211
|
+
);
|
|
96
212
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
//说明是root
|
|
216
|
+
//判断是否允许编辑
|
|
217
|
+
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
218
|
+
doEditRoot(ttmplNodeConfig.branchTitle, dataNode.code);
|
|
219
|
+
} else if (
|
|
220
|
+
ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("detail") > 0
|
|
221
|
+
) {
|
|
222
|
+
doViewRoot(ttmplNodeConfig.branchTitle, dataNode.code);
|
|
223
|
+
}
|
|
108
224
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
stopPropagation = (e) => {
|
|
228
|
+
if (e.stopPropagation) {
|
|
229
|
+
//如果提供了事件对象,则这是一个非IE浏览器
|
|
230
|
+
e.stopPropagation();
|
|
231
|
+
} else {
|
|
232
|
+
//兼容IE的方式来取消事件冒泡
|
|
233
|
+
window.event.cancelBubble = true;
|
|
114
234
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
reloadData = async (branchCode: string) => {
|
|
238
|
+
const { ttmplNodeConfig } = this.props;
|
|
239
|
+
const { data, expandedKeys } = this.state;
|
|
240
|
+
let newData;
|
|
241
|
+
if (branchCode == null) {
|
|
242
|
+
//加载根
|
|
243
|
+
newData = await this.loadRootNodeData();
|
|
244
|
+
this.mergeRootData(data, newData);
|
|
245
|
+
this.setState({
|
|
246
|
+
data: newData,
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
//重新加载 await
|
|
250
|
+
//先找到树节点
|
|
251
|
+
let rdatas = [];
|
|
252
|
+
this.searchNode(data, branchCode, rdatas);
|
|
253
|
+
await TreeUtils.pushSameCodeNodeData(rdatas, ttmplNodeConfig);
|
|
254
|
+
let newExpandeds = [];
|
|
255
|
+
for (let d of rdatas) {
|
|
256
|
+
newExpandeds.push(d.key);
|
|
257
|
+
}
|
|
258
|
+
this.setState({
|
|
259
|
+
expandedKeys: [...expandedKeys, ...newExpandeds],
|
|
260
|
+
data: [...data],
|
|
261
|
+
});
|
|
118
262
|
}
|
|
263
|
+
};
|
|
119
264
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
265
|
+
mergeRootData = (data, newData) => {
|
|
266
|
+
if (newData && data) {
|
|
267
|
+
for (let nd of newData) {
|
|
268
|
+
for (let d of data) {
|
|
269
|
+
if (nd.code == d.code) {
|
|
270
|
+
nd.children = d.children;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
125
273
|
}
|
|
126
|
-
|
|
127
|
-
data: [...data],
|
|
128
|
-
expandedKeys
|
|
129
|
-
})
|
|
274
|
+
}
|
|
130
275
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
if (ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
143
|
-
doEditSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
144
|
-
} else if (ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("detail") > 0) {
|
|
145
|
-
doViewSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
} else {//说明是root
|
|
149
|
-
//判断是否允许编辑
|
|
150
|
-
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
151
|
-
doEditRoot(ttmplNodeConfig.branchTitle,dataNode.code);
|
|
152
|
-
} else if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("detail") > 0) {
|
|
153
|
-
doViewRoot(ttmplNodeConfig.branchTitle,dataNode.code);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
searchNode = (
|
|
279
|
+
data: TreeDataNode[],
|
|
280
|
+
brachCode: string,
|
|
281
|
+
result: TreeDataNode[]
|
|
282
|
+
) => {
|
|
283
|
+
if (!data) {
|
|
284
|
+
return;
|
|
156
285
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
286
|
+
for (let d of data) {
|
|
287
|
+
if (d.code == brachCode) {
|
|
288
|
+
result.push(d);
|
|
289
|
+
break;
|
|
290
|
+
} else if (d.children.length > 0) {
|
|
291
|
+
//继续寻找
|
|
292
|
+
this.searchNode(d.children, brachCode, result);
|
|
293
|
+
}
|
|
164
294
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
getDeleteButton = (sourceId, code) => {
|
|
298
|
+
const { doDelete } = this.props;
|
|
299
|
+
const { translate } = this.context;
|
|
300
|
+
return (
|
|
301
|
+
<div
|
|
302
|
+
onClick={(e) => {
|
|
303
|
+
this.stopPropagation(e);
|
|
304
|
+
}}
|
|
305
|
+
>
|
|
306
|
+
<Popconfirm
|
|
307
|
+
placement="topLeft"
|
|
308
|
+
title={translate("${确定要删除吗}?")}
|
|
309
|
+
onConfirm={() => {
|
|
310
|
+
doDelete(sourceId, code);
|
|
311
|
+
}}
|
|
312
|
+
okText={translate("${确定}")}
|
|
313
|
+
cancelText={translate("${取消}")}
|
|
314
|
+
>
|
|
315
|
+
<Tooltip>
|
|
316
|
+
<Button size={"small"} danger={true}>
|
|
317
|
+
<DeleteOutlined />
|
|
318
|
+
</Button>
|
|
319
|
+
</Tooltip>
|
|
320
|
+
</Popconfirm>
|
|
321
|
+
</div>
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
getAddButton = (
|
|
326
|
+
title: string,
|
|
327
|
+
icon: any,
|
|
328
|
+
ratmplId: string,
|
|
329
|
+
mainCode: any
|
|
330
|
+
) => {
|
|
331
|
+
const { doAddSub } = this.props;
|
|
332
|
+
return (
|
|
333
|
+
<Button
|
|
334
|
+
onClick={(e) => {
|
|
335
|
+
this.stopPropagation(e);
|
|
336
|
+
doAddSub(title, ratmplId, mainCode, null);
|
|
337
|
+
}}
|
|
338
|
+
size={"small"}
|
|
339
|
+
>
|
|
340
|
+
{icon}
|
|
341
|
+
{title}
|
|
342
|
+
</Button>
|
|
343
|
+
);
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
packageTitle = (dataNode) => {
|
|
347
|
+
const {
|
|
348
|
+
doEditRoot,
|
|
349
|
+
doViewRoot,
|
|
350
|
+
doViewSub,
|
|
351
|
+
doEditSub,
|
|
352
|
+
ttmplNodeConfig,
|
|
353
|
+
} = this.props;
|
|
354
|
+
const { translate } = this.context;
|
|
355
|
+
let buttons = [];
|
|
356
|
+
if (dataNode.parent) {
|
|
357
|
+
//说明是sub
|
|
358
|
+
if (dataNode.isLeaf) {
|
|
359
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplEdit") > 0) {
|
|
360
|
+
buttons.push(
|
|
361
|
+
<Button
|
|
362
|
+
onClick={(e) => {
|
|
363
|
+
this.stopPropagation(e);
|
|
364
|
+
doEditSub(
|
|
365
|
+
ttmplNodeConfig.leafTitle,
|
|
366
|
+
ttmplNodeConfig.leafRatmplId,
|
|
367
|
+
dataNode.parent.code,
|
|
368
|
+
dataNode.code
|
|
369
|
+
);
|
|
370
|
+
}}
|
|
371
|
+
size={"small"}
|
|
372
|
+
>
|
|
373
|
+
<EditOutlined />
|
|
374
|
+
{translate("${编辑}")}
|
|
375
|
+
</Button>
|
|
376
|
+
);
|
|
189
377
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
378
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
379
|
+
buttons.push(
|
|
380
|
+
<Button
|
|
381
|
+
onClick={(e) => {
|
|
382
|
+
this.stopPropagation(e);
|
|
383
|
+
doViewSub(
|
|
384
|
+
ttmplNodeConfig.leafTitle,
|
|
385
|
+
ttmplNodeConfig.leafRatmplId,
|
|
386
|
+
dataNode.parent.code,
|
|
387
|
+
dataNode.code
|
|
388
|
+
);
|
|
389
|
+
}}
|
|
390
|
+
size={"small"}
|
|
391
|
+
>
|
|
392
|
+
<AlignLeftOutlined />
|
|
393
|
+
{translate("${查看}")}
|
|
394
|
+
</Button>
|
|
395
|
+
);
|
|
202
396
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
397
|
+
if (
|
|
398
|
+
ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("singleDelete") > 0
|
|
399
|
+
) {
|
|
400
|
+
buttons.push(
|
|
401
|
+
this.getDeleteButton(ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
402
|
+
);
|
|
208
403
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
404
|
+
} else if (ttmplNodeConfig.branchLTmplConfig) {
|
|
405
|
+
if (
|
|
406
|
+
ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("dtmplEdit") > 0
|
|
407
|
+
) {
|
|
408
|
+
buttons.push(
|
|
409
|
+
<Button
|
|
410
|
+
onClick={(e) => {
|
|
411
|
+
this.stopPropagation(e);
|
|
412
|
+
doEditSub(
|
|
413
|
+
ttmplNodeConfig.branchTitle,
|
|
414
|
+
ttmplNodeConfig.branchRatmplId,
|
|
415
|
+
dataNode.parent.code,
|
|
416
|
+
dataNode.code
|
|
417
|
+
);
|
|
418
|
+
}}
|
|
419
|
+
size={"small"}
|
|
420
|
+
>
|
|
421
|
+
<EditOutlined />
|
|
422
|
+
{translate("${编辑}")}
|
|
423
|
+
</Button>
|
|
424
|
+
);
|
|
216
425
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
okText="确定" cancelText="取消">
|
|
228
|
-
<Tooltip>
|
|
229
|
-
<Button size={'small'} danger={true}>
|
|
230
|
-
<DeleteOutlined/></Button>
|
|
231
|
-
</Tooltip>
|
|
232
|
-
</Popconfirm></div>
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
getAddButton = (title: string, icon: any, ratmplId: string, mainCode: any) => {
|
|
236
|
-
const {doAddSub} = this.props;
|
|
237
|
-
return <Button onClick={(e) => {
|
|
238
|
-
this.stopPropagation(e)
|
|
239
|
-
doAddSub(title,ratmplId, mainCode,null);
|
|
240
|
-
}} size={'small'}>{icon}{title}</Button>
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
packageTitle = (dataNode) => {
|
|
244
|
-
const {doEditRoot, doViewRoot, doViewSub, doEditSub, ttmplNodeConfig} = this.props;
|
|
245
|
-
let buttons = [];
|
|
246
|
-
if (dataNode.parent) {//说明是sub
|
|
247
|
-
if (dataNode.isLeaf) {
|
|
248
|
-
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplEdit") > 0) {
|
|
249
|
-
buttons.push(<Button onClick={(e) => {
|
|
250
|
-
this.stopPropagation(e)
|
|
251
|
-
doEditSub(ttmplNodeConfig.leafTitle,ttmplNodeConfig.leafRatmplId, dataNode.parent.code, dataNode.code);
|
|
252
|
-
}} size={'small'}><EditOutlined/>编辑</Button>);
|
|
253
|
-
}
|
|
254
|
-
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
255
|
-
buttons.push(<Button onClick={(e) => {
|
|
256
|
-
this.stopPropagation(e)
|
|
257
|
-
doViewSub(ttmplNodeConfig.leafTitle,ttmplNodeConfig.leafRatmplId, dataNode.parent.code, dataNode.code);
|
|
258
|
-
}} size={'small'}><AlignLeftOutlined/>查看</Button>);
|
|
259
|
-
}
|
|
260
|
-
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("singleDelete") > 0) {
|
|
261
|
-
buttons.push(this.getDeleteButton(ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
} else if (ttmplNodeConfig.branchLTmplConfig) {
|
|
266
|
-
if (ttmplNodeConfig.branchLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
267
|
-
buttons.push(<Button onClick={(e) => {
|
|
268
|
-
this.stopPropagation(e)
|
|
269
|
-
doEditSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
270
|
-
}} size={'small'}><EditOutlined/>编辑</Button>);
|
|
271
|
-
}
|
|
272
|
-
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
273
|
-
buttons.push(<Button onClick={(e) => {
|
|
274
|
-
this.stopPropagation(e)
|
|
275
|
-
doViewSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
276
|
-
}} size={'small'}><AlignLeftOutlined/>查看</Button>);
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
281
|
-
buttons.push(this.getAddButton(ttmplNodeConfig.branchTitle,
|
|
282
|
-
<PlusSquareOutlined/>, ttmplNodeConfig.branchRatmplId, dataNode.code)
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
287
|
-
buttons.push(this.getAddButton(ttmplNodeConfig.leafTitle,
|
|
288
|
-
<PlusOutlined/>, ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("singleDelete") > 0) {
|
|
292
|
-
buttons.push(this.getDeleteButton(ttmplNodeConfig.branchRatmplId, dataNode.code));
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
} else {//说明是root
|
|
296
|
-
//判断是否允许编辑
|
|
297
|
-
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
298
|
-
buttons.push(<Button onClick={(e) => {
|
|
299
|
-
this.stopPropagation(e)
|
|
300
|
-
doEditRoot(ttmplNodeConfig.branchTitle,dataNode.code);
|
|
301
|
-
}} size={'small'}><EditOutlined style={{color: 'blue'}}/>编辑</Button>);
|
|
302
|
-
}
|
|
303
|
-
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("detail") > 0) {
|
|
304
|
-
buttons.push(<Button onClick={(e) => {
|
|
305
|
-
this.stopPropagation(e)
|
|
306
|
-
doViewRoot(ttmplNodeConfig.branchTitle,dataNode.code);
|
|
307
|
-
}} size={'small'}><AlignLeftOutlined/>查看</Button>);
|
|
308
|
-
}
|
|
309
|
-
if (ttmplNodeConfig.branchLTmplConfig) {
|
|
310
|
-
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplAdd") > 0) {
|
|
311
|
-
buttons.push(this.getAddButton(ttmplNodeConfig.branchTitle,
|
|
312
|
-
<PlusSquareOutlined/>, ttmplNodeConfig.branchRatmplId, dataNode.code)
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
317
|
-
buttons.push(this.getAddButton(ttmplNodeConfig.leafTitle,
|
|
318
|
-
<PlusOutlined/>, ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
426
|
+
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
427
|
+
buttons.push(
|
|
428
|
+
<Button
|
|
429
|
+
onClick={(e) => {
|
|
430
|
+
this.stopPropagation(e);
|
|
431
|
+
doViewSub(
|
|
432
|
+
ttmplNodeConfig.branchTitle,
|
|
433
|
+
ttmplNodeConfig.branchRatmplId,
|
|
434
|
+
dataNode.parent.code,
|
|
435
|
+
dataNode.code
|
|
319
436
|
);
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
437
|
+
}}
|
|
438
|
+
size={"small"}
|
|
439
|
+
>
|
|
440
|
+
<AlignLeftOutlined />
|
|
441
|
+
{translate("${查看}")}
|
|
442
|
+
</Button>
|
|
443
|
+
);
|
|
325
444
|
}
|
|
326
445
|
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
446
|
+
if (
|
|
447
|
+
ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("dtmplAdd") > 0
|
|
448
|
+
) {
|
|
449
|
+
buttons.push(
|
|
450
|
+
this.getAddButton(
|
|
451
|
+
ttmplNodeConfig.branchTitle,
|
|
452
|
+
<PlusSquareOutlined />,
|
|
453
|
+
ttmplNodeConfig.branchRatmplId,
|
|
454
|
+
dataNode.code
|
|
455
|
+
)
|
|
456
|
+
);
|
|
334
457
|
}
|
|
335
458
|
|
|
459
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
460
|
+
buttons.push(
|
|
461
|
+
this.getAddButton(
|
|
462
|
+
ttmplNodeConfig.leafTitle,
|
|
463
|
+
<PlusOutlined />,
|
|
464
|
+
ttmplNodeConfig.leafRatmplId,
|
|
465
|
+
dataNode.code
|
|
466
|
+
)
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
if (
|
|
470
|
+
ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("singleDelete") > 0
|
|
471
|
+
) {
|
|
472
|
+
buttons.push(
|
|
473
|
+
this.getDeleteButton(ttmplNodeConfig.branchRatmplId, dataNode.code)
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
} else {
|
|
478
|
+
//说明是root
|
|
479
|
+
//判断是否允许编辑
|
|
480
|
+
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplEdit") > 0) {
|
|
481
|
+
buttons.push(
|
|
482
|
+
<Button
|
|
483
|
+
onClick={(e) => {
|
|
484
|
+
this.stopPropagation(e);
|
|
485
|
+
doEditRoot(ttmplNodeConfig.branchTitle, dataNode.code);
|
|
486
|
+
}}
|
|
487
|
+
size={"small"}
|
|
488
|
+
>
|
|
489
|
+
<EditOutlined style={{ color: "blue" }} />
|
|
490
|
+
{translate("${编辑}")}
|
|
491
|
+
</Button>
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("detail") > 0) {
|
|
495
|
+
buttons.push(
|
|
496
|
+
<Button
|
|
497
|
+
onClick={(e) => {
|
|
498
|
+
this.stopPropagation(e);
|
|
499
|
+
doViewRoot(ttmplNodeConfig.branchTitle, dataNode.code);
|
|
500
|
+
}}
|
|
501
|
+
size={"small"}
|
|
502
|
+
>
|
|
503
|
+
<AlignLeftOutlined />
|
|
504
|
+
{translate("${查看}")}
|
|
505
|
+
</Button>
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
if (ttmplNodeConfig.branchLTmplConfig) {
|
|
509
|
+
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("dtmplAdd") > 0) {
|
|
510
|
+
buttons.push(
|
|
511
|
+
this.getAddButton(
|
|
512
|
+
ttmplNodeConfig.branchTitle,
|
|
513
|
+
<PlusSquareOutlined />,
|
|
514
|
+
ttmplNodeConfig.branchRatmplId,
|
|
515
|
+
dataNode.code
|
|
516
|
+
)
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
521
|
+
buttons.push(
|
|
522
|
+
this.getAddButton(
|
|
523
|
+
ttmplNodeConfig.leafTitle,
|
|
524
|
+
<PlusOutlined />,
|
|
525
|
+
ttmplNodeConfig.leafRatmplId,
|
|
526
|
+
dataNode.code
|
|
527
|
+
)
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (ttmplNodeConfig.rootLTmplConfig.buttons.indexOf("singleDelete") > 0) {
|
|
532
|
+
buttons.push(
|
|
533
|
+
this.getDeleteButton(ttmplNodeConfig.branchRatmplId, dataNode.code)
|
|
534
|
+
);
|
|
535
|
+
}
|
|
336
536
|
}
|
|
337
537
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
538
|
+
if (buttons.length == 0) {
|
|
539
|
+
return dataNode.title;
|
|
540
|
+
} else {
|
|
541
|
+
return (
|
|
542
|
+
<Popover
|
|
543
|
+
zIndex={100}
|
|
544
|
+
content={
|
|
545
|
+
<>
|
|
546
|
+
<Space>{buttons}</Space>
|
|
547
|
+
</>
|
|
548
|
+
}
|
|
549
|
+
arrow={false}
|
|
550
|
+
>
|
|
551
|
+
{dataNode.title}
|
|
552
|
+
</Popover>
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
render() {
|
|
558
|
+
const { doEditRoot, ttmplNodeConfig } = this.props;
|
|
559
|
+
const {
|
|
560
|
+
data,
|
|
561
|
+
loading,
|
|
562
|
+
expandedKeys,
|
|
563
|
+
rootAddable,
|
|
564
|
+
searchValue,
|
|
565
|
+
} = this.state;
|
|
566
|
+
let treeData = data;
|
|
567
|
+
const { translate } = this.context;
|
|
568
|
+
if (searchValue) {
|
|
569
|
+
treeData = TreeUtils.filterTree(data, searchValue);
|
|
570
|
+
}
|
|
571
|
+
return (
|
|
572
|
+
<>
|
|
573
|
+
<Row>
|
|
574
|
+
<Col span={24}>
|
|
575
|
+
<Card
|
|
576
|
+
style={{ marginBottom: 0, width: "100%" }}
|
|
577
|
+
bordered={false}
|
|
578
|
+
bodyStyle={{ padding: "4px 2px 4px 8px" }}
|
|
579
|
+
>
|
|
580
|
+
<Row align="middle">
|
|
581
|
+
<Col span={8}>
|
|
582
|
+
{rootAddable && doEditRoot ? (
|
|
583
|
+
<Button
|
|
584
|
+
type={"link"}
|
|
585
|
+
onClick={() => doEditRoot(ttmplNodeConfig.branchTitle)}
|
|
586
|
+
>
|
|
587
|
+
{translate("${添加}")}
|
|
588
|
+
</Button>
|
|
589
|
+
) : null}
|
|
368
590
|
</Col>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
treeData={treeData}
|
|
385
|
-
/>
|
|
386
|
-
</Scrollbars>}
|
|
387
|
-
</Card>
|
|
591
|
+
<Col span={16}>
|
|
592
|
+
<Input.Search
|
|
593
|
+
value={searchValue}
|
|
594
|
+
allowClear
|
|
595
|
+
placeholder={translate("${输入查找内容}")}
|
|
596
|
+
onChange={(e) => {
|
|
597
|
+
this.setState({
|
|
598
|
+
searchValue: e.target.value,
|
|
599
|
+
});
|
|
600
|
+
}}
|
|
601
|
+
onSearch={(value) => {
|
|
602
|
+
this.refresh();
|
|
603
|
+
}}
|
|
604
|
+
enterButton={<ReloadOutlined />}
|
|
605
|
+
/>
|
|
388
606
|
</Col>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
607
|
+
</Row>
|
|
608
|
+
</Card>
|
|
609
|
+
</Col>
|
|
610
|
+
</Row>
|
|
611
|
+
<Row>
|
|
612
|
+
<Col span={24}>
|
|
613
|
+
<Card
|
|
614
|
+
bodyStyle={{
|
|
615
|
+
padding: "4px 4px 4px 16px",
|
|
616
|
+
height: "80vh",
|
|
617
|
+
minWidth: "292px",
|
|
618
|
+
}}
|
|
619
|
+
loading={loading}
|
|
620
|
+
>
|
|
621
|
+
{treeData.length == 0 ? (
|
|
622
|
+
translate("${没有找到数据}")
|
|
623
|
+
) : (
|
|
624
|
+
<Scrollbars
|
|
625
|
+
style={{ height: "80vh" }}
|
|
626
|
+
autoHide
|
|
627
|
+
autoHideTimeout={1000}
|
|
628
|
+
>
|
|
629
|
+
<Tree
|
|
630
|
+
blockNode
|
|
631
|
+
showLine={ttmplNodeConfig.showLine}
|
|
632
|
+
checkable={false}
|
|
633
|
+
expandedKeys={expandedKeys}
|
|
634
|
+
onExpand={this.onExpand}
|
|
635
|
+
titleRender={(nodeData) => {
|
|
636
|
+
return (
|
|
637
|
+
<div onClick={() => this.onClickNode(nodeData)}>
|
|
638
|
+
{this.packageTitle(nodeData)}
|
|
639
|
+
</div>
|
|
640
|
+
);
|
|
641
|
+
}}
|
|
642
|
+
treeData={treeData}
|
|
643
|
+
/>
|
|
644
|
+
</Scrollbars>
|
|
645
|
+
)}
|
|
646
|
+
</Card>
|
|
647
|
+
</Col>
|
|
648
|
+
</Row>
|
|
649
|
+
</>
|
|
650
|
+
);
|
|
651
|
+
}
|
|
394
652
|
}
|
|
395
653
|
|
|
396
|
-
export default TmplTree
|
|
654
|
+
export default TmplTree;
|