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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { ConfigProvider } from "antd";
|
|
2
|
+
import React, { ReactNode, createContext, useEffect, useState } from "react";
|
|
3
|
+
import { useNavigatorLanguage } from "./useLocale";
|
|
4
|
+
import { antdLangMp, getLangWithLangApiMp, getLangWithLangMp } from "./langMp";
|
|
5
|
+
import { LocaleType } from "./langMp";
|
|
6
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
7
|
+
|
|
8
|
+
export const LocaleContext = createContext<{
|
|
9
|
+
locale: LocaleType;
|
|
10
|
+
langPkg: any;
|
|
11
|
+
changeLocale: (locale: LocaleType) => void;
|
|
12
|
+
t: (...strs: string[]) => string;
|
|
13
|
+
translate: (...strs: string[]) => string;
|
|
14
|
+
}>({
|
|
15
|
+
locale: undefined,
|
|
16
|
+
langPkg: {},
|
|
17
|
+
changeLocale: () => {},
|
|
18
|
+
t: (...str) => str.join(""),
|
|
19
|
+
translate: (str) => {
|
|
20
|
+
let res = [],
|
|
21
|
+
tres = "";
|
|
22
|
+
|
|
23
|
+
let matchStr = "",
|
|
24
|
+
enableMatch = false;
|
|
25
|
+
|
|
26
|
+
for (const char of str) {
|
|
27
|
+
if (char === "$") {
|
|
28
|
+
enableMatch = true;
|
|
29
|
+
res.push(tres);
|
|
30
|
+
tres = "";
|
|
31
|
+
} else if (enableMatch && char === "{") {
|
|
32
|
+
continue;
|
|
33
|
+
} else if (enableMatch && char === "}") {
|
|
34
|
+
res.push(matchStr);
|
|
35
|
+
enableMatch = false;
|
|
36
|
+
matchStr = "";
|
|
37
|
+
} else if (enableMatch) matchStr += char;
|
|
38
|
+
else tres += char;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
res.push(tres);
|
|
42
|
+
return res.join("");
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const getLocaleWithServer = async (lang: string) => {
|
|
47
|
+
const langStr = getLangWithLangApiMp(lang);
|
|
48
|
+
if (langStr === "zh") return;
|
|
49
|
+
|
|
50
|
+
const { value, status } = await HcserviceV3.getLocale(langStr);
|
|
51
|
+
|
|
52
|
+
if (status === "success") {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const LocaleProvider = ({ children }: { children: ReactNode }) => {
|
|
59
|
+
const { navigatorLanguage } = useNavigatorLanguage();
|
|
60
|
+
const localeStorageLang: LocaleType = window.localStorage.getItem(
|
|
61
|
+
"locale"
|
|
62
|
+
) as LocaleType;
|
|
63
|
+
const localeStorageLangPkg: object = JSON.parse(
|
|
64
|
+
window.localStorage.getItem("langPkg")
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const [locale, setLocale] = useState<LocaleType>(
|
|
68
|
+
localeStorageLang ? localeStorageLang : getLangWithLangMp(navigatorLanguage)
|
|
69
|
+
);
|
|
70
|
+
const [langPkg, setLangPkg] = useState(
|
|
71
|
+
localeStorageLangPkg ? localeStorageLangPkg : {}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const changeLocale = async (locale: LocaleType) => {
|
|
75
|
+
setLocale(locale);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
getLocaleWithServer(locale).then((res) => {
|
|
80
|
+
window.localStorage.setItem("locale", locale);
|
|
81
|
+
const newLangPkg = {
|
|
82
|
+
...langPkg,
|
|
83
|
+
[locale]: res,
|
|
84
|
+
};
|
|
85
|
+
setLangPkg(newLangPkg);
|
|
86
|
+
});
|
|
87
|
+
}, [locale]);
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
window.localStorage.setItem("langPkg", JSON.stringify(langPkg));
|
|
91
|
+
}, [langPkg]);
|
|
92
|
+
|
|
93
|
+
const t = (...strs: string[]) => {
|
|
94
|
+
if (locale === "zh") return strs.join("");
|
|
95
|
+
|
|
96
|
+
let res = "",
|
|
97
|
+
flag = false;
|
|
98
|
+
|
|
99
|
+
for (const str of strs) {
|
|
100
|
+
const tStr =
|
|
101
|
+
langPkg[locale] === undefined ? undefined : langPkg[locale][str];
|
|
102
|
+
if (tStr === undefined) {
|
|
103
|
+
flag = true;
|
|
104
|
+
break;
|
|
105
|
+
} else {
|
|
106
|
+
res += tStr + " ";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return flag ? strs.join("") : res.slice(0, res.length - 1);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const translate = (str) => {
|
|
113
|
+
let res = [],
|
|
114
|
+
resMp = [],
|
|
115
|
+
flag = false,
|
|
116
|
+
tres = "";
|
|
117
|
+
|
|
118
|
+
let matchStr = "",
|
|
119
|
+
enableMatch = false;
|
|
120
|
+
|
|
121
|
+
for (const char of str) {
|
|
122
|
+
if (char === "$") {
|
|
123
|
+
enableMatch = true;
|
|
124
|
+
res.push(tres);
|
|
125
|
+
tres = "";
|
|
126
|
+
resMp.push(false);
|
|
127
|
+
} else if (enableMatch && char === "{") {
|
|
128
|
+
continue;
|
|
129
|
+
} else if (enableMatch && char === "}") {
|
|
130
|
+
const tStr =
|
|
131
|
+
langPkg[locale] === undefined ? undefined : langPkg[locale][matchStr];
|
|
132
|
+
if (tStr === undefined) {
|
|
133
|
+
flag = true;
|
|
134
|
+
}
|
|
135
|
+
res.push(matchStr);
|
|
136
|
+
resMp.push(true);
|
|
137
|
+
enableMatch = false;
|
|
138
|
+
matchStr = "";
|
|
139
|
+
} else if (enableMatch) matchStr += char;
|
|
140
|
+
else tres += char;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
res.push(tres);
|
|
144
|
+
resMp.push(false);
|
|
145
|
+
|
|
146
|
+
if (flag) return res.join("");
|
|
147
|
+
|
|
148
|
+
let resStr = "";
|
|
149
|
+
for (let i = 0; i < res.length; i++) {
|
|
150
|
+
if (i !== 0) resStr = " " + resStr;
|
|
151
|
+
if (resMp[i]) resStr += langPkg[locale][res[i]];
|
|
152
|
+
else resStr += res[i];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return resStr;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<LocaleContext.Provider
|
|
160
|
+
value={{ locale, langPkg, changeLocale, t, translate }}
|
|
161
|
+
>
|
|
162
|
+
{children}
|
|
163
|
+
</LocaleContext.Provider>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import frFr from "antd/locale/fr_FR";
|
|
2
|
+
import zhCN from "antd/locale/zh_CN";
|
|
3
|
+
|
|
4
|
+
export type LocaleType = "zh" | "fr";
|
|
5
|
+
|
|
6
|
+
export const langMp = {
|
|
7
|
+
fr: ["fra", "fr-FR"],
|
|
8
|
+
zh: ["zh", "zh-CN"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const langApiMp = {
|
|
12
|
+
fra: ["fr", "fr-FR"],
|
|
13
|
+
zh: ["zh", "zh-CN"],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getLangWithLangMp: (lang: any) => LocaleType = (lang) => {
|
|
17
|
+
for (const [key, value] of Object.entries(langMp)) {
|
|
18
|
+
if (value.findIndex((i) => i === lang) > -1) return key as LocaleType;
|
|
19
|
+
}
|
|
20
|
+
return "zh" as LocaleType;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const getLangWithLangApiMp = (lang) => {
|
|
24
|
+
for (const [key, value] of Object.entries(langApiMp)) {
|
|
25
|
+
if (value.findIndex((i) => i === lang) > -1) return key;
|
|
26
|
+
}
|
|
27
|
+
return "zh";
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const antdLangMp = {
|
|
31
|
+
zh: zhCN,
|
|
32
|
+
fr: frFr,
|
|
33
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const noLocaleTranslate = (str) => {
|
|
2
|
+
let res = [],
|
|
3
|
+
tres = "";
|
|
4
|
+
|
|
5
|
+
let matchStr = "",
|
|
6
|
+
enableMatch = false;
|
|
7
|
+
|
|
8
|
+
for (const char of str) {
|
|
9
|
+
if (char === "$") {
|
|
10
|
+
enableMatch = true;
|
|
11
|
+
res.push(tres);
|
|
12
|
+
tres = "";
|
|
13
|
+
} else if (enableMatch && char === "{") {
|
|
14
|
+
continue;
|
|
15
|
+
} else if (enableMatch && char === "}") {
|
|
16
|
+
res.push(matchStr);
|
|
17
|
+
enableMatch = false;
|
|
18
|
+
matchStr = "";
|
|
19
|
+
} else if (enableMatch) matchStr += char;
|
|
20
|
+
else tres += char;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
res.push(tres);
|
|
24
|
+
return res.join("");
|
|
25
|
+
};
|
|
26
|
+
const translate = (str) => {
|
|
27
|
+
const locale = window.localStorage.getItem("locale");
|
|
28
|
+
const langPkg = window.localStorage.getItem("langPkg");
|
|
29
|
+
|
|
30
|
+
if (locale === undefined || langPkg === undefined)
|
|
31
|
+
return noLocaleTranslate(str);
|
|
32
|
+
|
|
33
|
+
let res = [],
|
|
34
|
+
resMp = [],
|
|
35
|
+
flag = false,
|
|
36
|
+
tres = "";
|
|
37
|
+
|
|
38
|
+
let matchStr = "",
|
|
39
|
+
enableMatch = false;
|
|
40
|
+
|
|
41
|
+
for (const char of str) {
|
|
42
|
+
if (char === "$") {
|
|
43
|
+
enableMatch = true;
|
|
44
|
+
res.push(tres);
|
|
45
|
+
tres = "";
|
|
46
|
+
resMp.push(false);
|
|
47
|
+
} else if (enableMatch && char === "{") {
|
|
48
|
+
continue;
|
|
49
|
+
} else if (enableMatch && char === "}") {
|
|
50
|
+
const tStr =
|
|
51
|
+
langPkg[locale] === undefined ? undefined : langPkg[locale][matchStr];
|
|
52
|
+
if (tStr === undefined) {
|
|
53
|
+
flag = true;
|
|
54
|
+
}
|
|
55
|
+
res.push(matchStr);
|
|
56
|
+
resMp.push(true);
|
|
57
|
+
enableMatch = false;
|
|
58
|
+
matchStr = "";
|
|
59
|
+
} else if (enableMatch) matchStr += char;
|
|
60
|
+
else tres += char;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
res.push(tres);
|
|
64
|
+
resMp.push(false);
|
|
65
|
+
|
|
66
|
+
if (flag) return res.join("");
|
|
67
|
+
|
|
68
|
+
let resStr = "";
|
|
69
|
+
for (let i = 0; i < res.length; i++) {
|
|
70
|
+
if (i !== 0) resStr = " " + resStr;
|
|
71
|
+
if (resMp[i]) resStr += langPkg[locale][res[i]];
|
|
72
|
+
else resStr += res[i];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return resStr;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default translate;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useContext, useState } from "react";
|
|
2
|
+
import { LocaleType } from "./langMp";
|
|
3
|
+
import { LocaleContext } from "./LocaleProvider";
|
|
4
|
+
|
|
5
|
+
type NavigatorLanguageState = {
|
|
6
|
+
isSupported: boolean;
|
|
7
|
+
navigatorLanguage: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const useNavigatorLanguage = (): Readonly<NavigatorLanguageState> => {
|
|
11
|
+
// 获取navigator
|
|
12
|
+
const navigator = window?.navigator;
|
|
13
|
+
|
|
14
|
+
// 查看当前浏览器是否支持language
|
|
15
|
+
const isSupported = Boolean(navigator && "language" in navigator);
|
|
16
|
+
|
|
17
|
+
// 存储当前language
|
|
18
|
+
const [navigatorLanguage, setNavigatorLanguage] = useState(
|
|
19
|
+
navigator?.language
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// 监听languagechange事件,如果有变化,就更新存储的language值
|
|
23
|
+
window.addEventListener("languagechange", () => {
|
|
24
|
+
if (navigator) {
|
|
25
|
+
setNavigatorLanguage(navigator.language);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
isSupported,
|
|
31
|
+
navigatorLanguage,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const useLocale = () => {
|
|
36
|
+
const { locale, langPkg, changeLocale, t, translate } = useContext(
|
|
37
|
+
LocaleContext
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
getLocale: () => {
|
|
42
|
+
return locale;
|
|
43
|
+
},
|
|
44
|
+
setLocale: (loacle: LocaleType) => {
|
|
45
|
+
changeLocale(loacle);
|
|
46
|
+
},
|
|
47
|
+
t,
|
|
48
|
+
translate,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -1,157 +1,208 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import
|
|
3
|
-
import {Button, Col, Form, Input, Row,
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import { Button, Col, Form, Input, Row, FormInstance } from "antd";
|
|
4
|
+
import {
|
|
5
|
+
LockOutlined,
|
|
6
|
+
SafetyCertificateOutlined,
|
|
7
|
+
UserOutlined,
|
|
8
|
+
} from "@ant-design/icons";
|
|
9
|
+
import HCserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
6
11
|
|
|
12
|
+
interface LoginProps {
|
|
13
|
+
onFinish: (token: string) => void;
|
|
14
|
+
title?: any;
|
|
15
|
+
programCode?: string;
|
|
16
|
+
autoSaveUser?: boolean;
|
|
17
|
+
}
|
|
7
18
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
loading?: boolean,
|
|
18
|
-
needKaptcha?: boolean,
|
|
19
|
-
kaptchaImg?: string,
|
|
20
|
-
kaptchaToken?: string,
|
|
21
|
-
pubkey?:string,
|
|
22
|
-
};
|
|
19
|
+
interface LoginState {
|
|
20
|
+
username?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
needKaptcha?: boolean;
|
|
24
|
+
kaptchaImg?: string;
|
|
25
|
+
kaptchaToken?: string;
|
|
26
|
+
pubkey?: string;
|
|
27
|
+
}
|
|
23
28
|
|
|
24
29
|
class Login extends React.PureComponent<LoginProps, LoginState> {
|
|
30
|
+
state = {
|
|
31
|
+
username: "",
|
|
32
|
+
password: "",
|
|
33
|
+
loading: true,
|
|
34
|
+
needKaptcha: false,
|
|
35
|
+
kaptchaImg: null,
|
|
36
|
+
kaptchaToken: null,
|
|
37
|
+
pubkey: undefined,
|
|
38
|
+
};
|
|
39
|
+
formRef = React.createRef<FormInstance>();
|
|
40
|
+
static contextType = LocaleContext;
|
|
41
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
25
42
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
formRef = React.createRef<FormInstance>();
|
|
36
|
-
|
|
43
|
+
componentDidMount = async () => {
|
|
44
|
+
const { programCode } = this.props;
|
|
45
|
+
window.removeEventListener("keydown", this.handleKeyDown);
|
|
46
|
+
let pubkey = await HCserviceV3.getRasPubkey(null, programCode);
|
|
47
|
+
this.setState({
|
|
48
|
+
pubkey,
|
|
49
|
+
loading: false,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if(res.img && res.img.indexOf("data:") == 0){
|
|
54
|
-
kaptchaImg = res.img;
|
|
55
|
-
}else{
|
|
56
|
-
kaptchaImg = `data:image/png;base64,${res.img}`;
|
|
57
|
-
}
|
|
58
|
-
this.setState({
|
|
59
|
-
kaptchaImg,
|
|
60
|
-
kaptchaToken: res.kaptchaToken,
|
|
61
|
-
needKaptcha: true
|
|
62
|
-
})
|
|
63
|
-
}
|
|
53
|
+
getKaptchaToken = async () => {
|
|
54
|
+
const { programCode } = this.props;
|
|
55
|
+
let res = await HCserviceV3.getKaptchaToken(programCode);
|
|
56
|
+
if (res) {
|
|
57
|
+
let kaptchaImg;
|
|
58
|
+
if (res.img && res.img.indexOf("data:") == 0) {
|
|
59
|
+
kaptchaImg = res.img;
|
|
60
|
+
} else {
|
|
61
|
+
kaptchaImg = `data:image/png;base64,${res.img}`;
|
|
62
|
+
}
|
|
63
|
+
this.setState({
|
|
64
|
+
kaptchaImg,
|
|
65
|
+
kaptchaToken: res.kaptchaToken,
|
|
66
|
+
needKaptcha: true,
|
|
67
|
+
});
|
|
64
68
|
}
|
|
69
|
+
};
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
handleSubmit = async () => {
|
|
72
|
+
this.setState({
|
|
73
|
+
loading: true,
|
|
74
|
+
});
|
|
75
|
+
let { kaptchaToken, pubkey } = this.state;
|
|
67
76
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
await this.formRef.current
|
|
78
|
+
.validateFields()
|
|
79
|
+
.then(async (values) => {
|
|
80
|
+
const { programCode } = this.props;
|
|
81
|
+
let json = { username: values.username, password: values.password };
|
|
82
|
+
let res = await HCserviceV3.login(
|
|
83
|
+
json,
|
|
84
|
+
kaptchaToken,
|
|
85
|
+
values.kaptchaText,
|
|
86
|
+
pubkey,
|
|
87
|
+
programCode
|
|
88
|
+
);
|
|
89
|
+
if (res.status === "success") {
|
|
90
|
+
this.props.onFinish(res.token);
|
|
91
|
+
} else if (res.status === "error") {
|
|
92
|
+
await this.getKaptchaToken();
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
.catch((errorInfo) => {});
|
|
96
|
+
this.setState({
|
|
97
|
+
loading: false,
|
|
98
|
+
});
|
|
99
|
+
};
|
|
72
100
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
).catch(errorInfo => {
|
|
84
|
-
})
|
|
85
|
-
this.setState({
|
|
86
|
-
loading: false
|
|
87
|
-
})
|
|
101
|
+
handleKeyDown = (event) => {
|
|
102
|
+
//按下enter键,触发login事件
|
|
103
|
+
switch (event.keyCode) {
|
|
104
|
+
case 13:
|
|
105
|
+
this.handleSubmit();
|
|
106
|
+
break;
|
|
107
|
+
default:
|
|
108
|
+
break;
|
|
88
109
|
}
|
|
110
|
+
};
|
|
89
111
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
break;
|
|
95
|
-
default:
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
112
|
+
changeKaptcha = async (event) => {
|
|
113
|
+
//切换验证码
|
|
114
|
+
await this.getKaptchaToken();
|
|
115
|
+
};
|
|
99
116
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
117
|
+
render() {
|
|
118
|
+
const { loading, needKaptcha, kaptchaImg } = this.state;
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
120
|
+
const { autoSaveUser = true } = this.props;
|
|
121
|
+
|
|
122
|
+
const { translate } = this.context;
|
|
123
|
+
return (
|
|
124
|
+
<Form
|
|
125
|
+
style={{ width: 350 }}
|
|
126
|
+
ref={this.formRef}
|
|
127
|
+
name="normal_login"
|
|
128
|
+
initialValues={{ remember: true }}
|
|
129
|
+
>
|
|
130
|
+
{this.props.title}
|
|
131
|
+
<Form.Item
|
|
132
|
+
name="username"
|
|
133
|
+
rules={[
|
|
134
|
+
{ required: true, message: translate("${请输入}${用户名}!") },
|
|
135
|
+
{ max: 30, min: 0, message: translate("${请输入}${0-30个字符}!") },
|
|
136
|
+
]}
|
|
137
|
+
>
|
|
138
|
+
<Input
|
|
139
|
+
prefix={<UserOutlined className="site-form-item-icon" />}
|
|
140
|
+
placeholder={translate("${用户名}")}
|
|
141
|
+
autoComplete={autoSaveUser ? "on" : "off"}
|
|
142
|
+
/>
|
|
143
|
+
</Form.Item>
|
|
144
|
+
<Form.Item
|
|
145
|
+
name="password"
|
|
146
|
+
rules={[{ required: true, message: translate("${请输入}${密码}!") }]}
|
|
147
|
+
>
|
|
148
|
+
<Input
|
|
149
|
+
style={
|
|
150
|
+
autoSaveUser
|
|
151
|
+
? {}
|
|
152
|
+
: ({ "-webkit-text-security": "disc" } as CSSProperties)
|
|
153
|
+
}
|
|
154
|
+
type={autoSaveUser ? "password" : "text"}
|
|
155
|
+
placeholder={translate("${密码}")}
|
|
156
|
+
onKeyDown={this.handleKeyDown}
|
|
157
|
+
autoComplete={autoSaveUser ? "on" : "off"}
|
|
158
|
+
prefix={<LockOutlined className="site-form-item-icon" />}
|
|
159
|
+
/>
|
|
160
|
+
</Form.Item>
|
|
161
|
+
{needKaptcha ? (
|
|
162
|
+
<Row gutter={8}>
|
|
163
|
+
<Col span={12}>
|
|
164
|
+
<Form.Item
|
|
165
|
+
name="kaptchaText"
|
|
166
|
+
rules={[
|
|
167
|
+
{ required: true, message: translate("${请输入}${验证码}!") },
|
|
168
|
+
]}
|
|
169
|
+
>
|
|
170
|
+
<Input
|
|
171
|
+
prefix={
|
|
172
|
+
<SafetyCertificateOutlined className="site-form-item-icon" />
|
|
173
|
+
}
|
|
174
|
+
placeholder={translate("${验证码}")}
|
|
175
|
+
onKeyDown={this.handleKeyDown}
|
|
176
|
+
/>
|
|
177
|
+
</Form.Item>
|
|
178
|
+
</Col>
|
|
179
|
+
<Col span={12}>
|
|
180
|
+
<img
|
|
181
|
+
style={{ cursor: "pointer" }}
|
|
182
|
+
height={30}
|
|
183
|
+
width={90}
|
|
184
|
+
title={translate("${点击刷新}")}
|
|
185
|
+
onClick={this.changeKaptcha}
|
|
186
|
+
src={kaptchaImg}
|
|
187
|
+
></img>
|
|
188
|
+
</Col>
|
|
189
|
+
</Row>
|
|
190
|
+
) : (
|
|
191
|
+
""
|
|
192
|
+
)}
|
|
193
|
+
<Form.Item>
|
|
194
|
+
<Button
|
|
195
|
+
type="primary"
|
|
196
|
+
style={{ width: "100%" }}
|
|
197
|
+
loading={loading}
|
|
198
|
+
onClick={this.handleSubmit}
|
|
199
|
+
>
|
|
200
|
+
{translate("${登录}")}
|
|
201
|
+
</Button>
|
|
202
|
+
</Form.Item>
|
|
203
|
+
</Form>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
155
206
|
}
|
|
156
207
|
|
|
157
|
-
export default Login;
|
|
208
|
+
export default Login;
|