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,865 +1,1297 @@
|
|
|
1
|
-
import React, {ReactNode} from
|
|
2
|
-
import {Button, Card, Checkbox, Col, Collapse, Divider, Popconfirm, Popover, Row, Space, Table, Tooltip} from 'antd';
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
PlusOutlined,
|
|
18
|
-
ReloadOutlined,
|
|
19
|
-
RetweetOutlined,
|
|
20
|
-
SearchOutlined,
|
|
21
|
-
TableOutlined,
|
|
22
|
-
UploadOutlined
|
|
23
|
-
} from '@ant-design/icons';
|
|
24
|
-
import "./index.css"
|
|
3
|
+
Button,
|
|
4
|
+
Card,
|
|
5
|
+
Checkbox,
|
|
6
|
+
Col,
|
|
7
|
+
Collapse,
|
|
8
|
+
Divider,
|
|
9
|
+
Popconfirm,
|
|
10
|
+
Popover,
|
|
11
|
+
Row,
|
|
12
|
+
Space,
|
|
13
|
+
Tooltip,
|
|
14
|
+
} from "antd";
|
|
15
|
+
import { Table } from "./control-table-x-axis-wrapper";
|
|
25
16
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
AlignCenterOutlined,
|
|
18
|
+
AlignLeftOutlined,
|
|
19
|
+
CopyOutlined,
|
|
20
|
+
DeleteOutlined,
|
|
21
|
+
DownloadOutlined,
|
|
22
|
+
EditOutlined,
|
|
23
|
+
EyeInvisibleOutlined,
|
|
24
|
+
EyeOutlined,
|
|
25
|
+
FormOutlined,
|
|
26
|
+
FundOutlined,
|
|
27
|
+
LineChartOutlined,
|
|
28
|
+
MenuOutlined,
|
|
29
|
+
PlusCircleOutlined,
|
|
30
|
+
PlusOutlined,
|
|
31
|
+
ReloadOutlined,
|
|
32
|
+
RetweetOutlined,
|
|
33
|
+
SearchOutlined,
|
|
34
|
+
TableOutlined,
|
|
35
|
+
UploadOutlined,
|
|
36
|
+
} from "@ant-design/icons";
|
|
37
|
+
import "./index.css";
|
|
38
|
+
import {
|
|
39
|
+
ActTableMode,
|
|
40
|
+
ActTableViewModel,
|
|
41
|
+
AddOrUpdate,
|
|
42
|
+
ClassifiedAddConfig,
|
|
43
|
+
ColumnConfig,
|
|
44
|
+
DtmplData,
|
|
45
|
+
JumpConfig,
|
|
46
|
+
LtmplConfig,
|
|
47
|
+
QueryKey,
|
|
48
|
+
SelectedRow,
|
|
49
|
+
TmplBaseProps,
|
|
35
50
|
} from "../tmpl/interface";
|
|
36
51
|
import TableUnits from "./table-util";
|
|
37
|
-
import SupportInputTypes from
|
|
52
|
+
import SupportInputTypes from "../tmpl/control-type-supportor";
|
|
38
53
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
39
|
-
import QueryTable from
|
|
54
|
+
import QueryTable from "./query-table";
|
|
40
55
|
import CriteriaForm from "./../form/criteria-form";
|
|
41
56
|
import ViewControl from "../controls/view-control";
|
|
42
57
|
import Units from "../units";
|
|
43
|
-
import ColumnSelector from
|
|
44
|
-
import ExportFrame from
|
|
45
|
-
import {SortableHandle} from
|
|
58
|
+
import ColumnSelector from "./column/column-selector";
|
|
59
|
+
import ExportFrame from "../exportor/export-frame";
|
|
60
|
+
import { SortableHandle } from "react-sortable-hoc";
|
|
46
61
|
import L2ActTable from "./l2-act-table";
|
|
47
62
|
|
|
48
|
-
import Action from
|
|
49
|
-
import Restat from "./stat/restat"
|
|
50
|
-
import ActionUtils from
|
|
63
|
+
import Action from "../controls/action";
|
|
64
|
+
import Restat from "./stat/restat";
|
|
65
|
+
import ActionUtils from "../controls/action/utils";
|
|
51
66
|
import CquickButton from "../controls/cquery/cquick-button";
|
|
52
67
|
import CollapseCard from "../controls/collapse-card";
|
|
53
68
|
import ToolTipBar from "../detail/tooltipbar";
|
|
69
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
54
70
|
|
|
55
|
-
const DragHandle = SortableHandle(() =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
const DragHandle = SortableHandle(() => (
|
|
72
|
+
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
73
|
+
));
|
|
74
|
+
const { Panel } = Collapse;
|
|
59
75
|
|
|
76
|
+
type Level = "l1" | "l2";
|
|
60
77
|
|
|
61
|
-
const defaultDisabledColIds: string[] = [
|
|
78
|
+
const defaultDisabledColIds: string[] = ["20000", "10000"];
|
|
62
79
|
|
|
63
80
|
interface ActTableProps extends TmplBaseProps {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
81
|
+
criteriaData: object;
|
|
82
|
+
pageNo: number;
|
|
83
|
+
pageSize: number;
|
|
84
|
+
onChangePage: (pageNo: number, pageSize: number) => void;
|
|
85
|
+
ltmplConfig: LtmplConfig;
|
|
86
|
+
menuId?: string;
|
|
87
|
+
showView?: (code: string, toCustomPage?: boolean) => void;
|
|
88
|
+
doCreate?: (addtmplId: string, toCustomPage: boolean) => void;
|
|
89
|
+
customCreatable?: boolean;
|
|
90
|
+
doEdit?: (code: string, mode: AddOrUpdate, toCustomPage?: boolean) => void;
|
|
91
|
+
customEditable?: boolean;
|
|
92
|
+
doDelete?: (code: string) => void;
|
|
93
|
+
doSearch?: (params: object) => void;
|
|
94
|
+
doRAction?: (ractionId: string, mainCode: string) => void;
|
|
95
|
+
level?: Level;
|
|
96
|
+
funcMode?: ActTableMode;
|
|
97
|
+
title?: ReactNode;
|
|
98
|
+
tip?: any;
|
|
99
|
+
collapsible?: boolean;
|
|
100
|
+
initCollapse?: boolean;
|
|
101
|
+
readOnly?: boolean;
|
|
102
|
+
}
|
|
86
103
|
|
|
87
104
|
interface ActTableStat {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
105
|
+
//tableColumns?: object[];
|
|
106
|
+
sortedColConfigs?: ColumnConfig[];
|
|
107
|
+
queryKey?: QueryKey;
|
|
108
|
+
loading?: boolean;
|
|
109
|
+
selectedRows?: SelectedRow[];
|
|
110
|
+
selectedDatas?: DtmplData[];
|
|
111
|
+
hiddenColIds?: string[];
|
|
112
|
+
drillingColIds?: string[];
|
|
113
|
+
disabledColIds?: string[];
|
|
114
|
+
hiddenRowCodes?: string[];
|
|
115
|
+
viewModels?: ActTableViewModel[];
|
|
116
|
+
showL2ActTable?: boolean;
|
|
117
|
+
showL2Chart?: boolean;
|
|
118
|
+
}
|
|
102
119
|
|
|
103
120
|
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
state = {
|
|
122
|
+
//tableColumns: undefined,
|
|
123
|
+
sortedColConfigs: undefined,
|
|
124
|
+
queryKey: undefined,
|
|
125
|
+
loading: true,
|
|
126
|
+
disableCols: undefined,
|
|
127
|
+
hiddenColIds: defaultDisabledColIds,
|
|
128
|
+
selectedRows: [],
|
|
129
|
+
selectedDatas: [],
|
|
130
|
+
hiddenRowCodes: [],
|
|
131
|
+
viewModels: [],
|
|
132
|
+
drillingColIds: undefined,
|
|
133
|
+
disabledColIds: undefined,
|
|
134
|
+
showL2ActTable: false,
|
|
135
|
+
showL2Chart: false,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
static contextType = LocaleContext;
|
|
139
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
140
|
+
|
|
141
|
+
static defaultProps = {
|
|
142
|
+
criteriaData: {},
|
|
143
|
+
funcMode: "complete",
|
|
144
|
+
collapsible: false,
|
|
145
|
+
initCollapse: false,
|
|
146
|
+
readOnly: false,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
loadData = async (
|
|
150
|
+
hiddenColIds: string[],
|
|
151
|
+
hiddenRowCodes: string[],
|
|
152
|
+
sortedColConfigs: ColumnConfig[]
|
|
153
|
+
) => {
|
|
154
|
+
const {
|
|
155
|
+
sourceId,
|
|
156
|
+
criteriaData,
|
|
157
|
+
ltmplConfig,
|
|
158
|
+
mainCode,
|
|
159
|
+
level,
|
|
160
|
+
pageNo,
|
|
161
|
+
pageSize,
|
|
162
|
+
serverKey,
|
|
163
|
+
} = this.props;
|
|
164
|
+
if (!ltmplConfig) {
|
|
165
|
+
return;
|
|
119
166
|
}
|
|
120
167
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
168
|
+
this.setState({
|
|
169
|
+
loading: true,
|
|
170
|
+
});
|
|
171
|
+
let disabledColIds: string[] = [];
|
|
172
|
+
let hiddenColIds_ = [...hiddenColIds];
|
|
173
|
+
if (criteriaData && criteriaData["drillingColIds"]) {
|
|
174
|
+
let dColIds = [...criteriaData["drillingColIds"]];
|
|
175
|
+
ltmplConfig.columns.forEach((item) => {
|
|
176
|
+
if (
|
|
177
|
+
item.statColType == "dimension" &&
|
|
178
|
+
!dColIds.includes(item.id) &&
|
|
179
|
+
!hiddenColIds_.includes(item.id)
|
|
180
|
+
) {
|
|
181
|
+
hiddenColIds_.push(item.id);
|
|
182
|
+
disabledColIds.push(item.id);
|
|
133
183
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (criteriaData && criteriaData['drillingColIds']) {
|
|
141
|
-
let dColIds = [...criteriaData['drillingColIds']];
|
|
142
|
-
ltmplConfig.columns.forEach((item) => {
|
|
143
|
-
if (item.statColType == 'dimension' && !dColIds.includes(item.id) && !hiddenColIds_.includes(item.id)) {
|
|
144
|
-
hiddenColIds_.push(item.id);
|
|
145
|
-
disabledColIds.push(item.id);
|
|
146
|
-
}
|
|
147
|
-
if (item.statColType == 'dimension' && !dColIds.includes(item.id) && !disabledColIds.includes(item.id)) {
|
|
148
|
-
disabledColIds.push(item.id);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
hiddenColIds_ = hiddenColIds_.filter((id) => {
|
|
152
|
-
return !dColIds.includes(id)
|
|
153
|
-
});
|
|
184
|
+
if (
|
|
185
|
+
item.statColType == "dimension" &&
|
|
186
|
+
!dColIds.includes(item.id) &&
|
|
187
|
+
!disabledColIds.includes(item.id)
|
|
188
|
+
) {
|
|
189
|
+
disabledColIds.push(item.id);
|
|
154
190
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})
|
|
160
|
-
/** 构建column **/
|
|
161
|
-
// let tableColumns = this.buildTableColumns(ltmplConfig, hiddenColIds_, hiddenRowCodes, sortedColConfigs);
|
|
162
|
-
|
|
163
|
-
const {defaultPageSize} = ltmplConfig;
|
|
164
|
-
|
|
165
|
-
let pageInfo = {
|
|
166
|
-
pageNo:pageNo?pageNo:1,
|
|
167
|
-
pageSize:pageSize?pageSize:defaultPageSize ? defaultPageSize : 10,
|
|
168
|
-
virtualEndPageNo: undefined,
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/** 构建 dataSource **/
|
|
172
|
-
//构建过滤条件
|
|
173
|
-
let queryKey: QueryKey
|
|
174
|
-
if (level && level == 'l2') {
|
|
175
|
-
queryKey = await HcserviceV3.requestL2LtmplQueryKey(serverKey,sourceId, {
|
|
176
|
-
...criteriaData, ...pageInfo,
|
|
177
|
-
mainCode
|
|
178
|
-
});
|
|
179
|
-
} else {
|
|
180
|
-
queryKey = await HcserviceV3.requestLtmplQueryKey(serverKey,sourceId, {
|
|
181
|
-
...criteriaData, ...pageInfo,
|
|
182
|
-
mainCode
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
this.setState({
|
|
188
|
-
disabledColIds,
|
|
189
|
-
hiddenColIds: hiddenColIds_,
|
|
190
|
-
hiddenRowCodes,
|
|
191
|
-
sortedColConfigs,
|
|
192
|
-
queryKey,
|
|
193
|
-
loading: false,
|
|
194
|
-
showL2Chart: false,
|
|
195
|
-
selectedRows: [],
|
|
196
|
-
selectedDatas: [],
|
|
197
|
-
viewModels: (this.state.viewModels.length > 0 ? this.state.viewModels : ['table']),
|
|
198
|
-
})
|
|
191
|
+
});
|
|
192
|
+
hiddenColIds_ = hiddenColIds_.filter((id) => {
|
|
193
|
+
return !dColIds.includes(id);
|
|
194
|
+
});
|
|
199
195
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} else if (item.id == '10000') {
|
|
232
|
-
column['title'] = <Tooltip title={'拖拽排序'}>{item.title}</Tooltip>;
|
|
233
|
-
column['width'] = 30;
|
|
234
|
-
column['dataIndex'] = item.id;
|
|
235
|
-
column['className'] = 'drag-visible';
|
|
236
|
-
column['render'] = () => <DragHandle/>;
|
|
237
|
-
} else if (item.id == '20000') {//隐藏
|
|
238
|
-
column['align'] = 'center';
|
|
239
|
-
column['width'] = 14;
|
|
240
|
-
column['title'] = <>{hiddenRowCodes.length > 0 ?
|
|
241
|
-
<Tooltip title={'取消隐藏'}><Button style={{marginRight: '0px'}}
|
|
242
|
-
size="small" shape={'circle'}
|
|
243
|
-
icon={<EyeOutlined/>} type={'text'}
|
|
244
|
-
onClick={() => this.unHiden()}>
|
|
245
|
-
</Button></Tooltip> : ''}</>;
|
|
246
|
-
column['render'] = (text, record) => (<Tooltip title={'隐藏'}> <Button style={{marginRight: '0px'}}
|
|
247
|
-
icon={<EyeInvisibleOutlined/>}
|
|
248
|
-
type="dashed"
|
|
249
|
-
size="small"
|
|
250
|
-
onClick={() => this.onHide(record.code)}>
|
|
251
|
-
</Button></Tooltip>);
|
|
252
|
-
} else if (item.title === "操作") {
|
|
253
|
-
column['fixed'] = 'right';
|
|
254
|
-
column['align'] = 'center';
|
|
255
|
-
column['className'] = 'opsColumn';
|
|
256
|
-
column['title'] = <>操 作</>
|
|
257
|
-
column['render'] = (text, record) => (
|
|
258
|
-
<Space size={[0, 4]} wrap>
|
|
259
|
-
{buttons.includes('detail') && showView ?
|
|
260
|
-
<Button
|
|
261
|
-
size="small"
|
|
262
|
-
type="primary"
|
|
263
|
-
icon={<AlignLeftOutlined/>}
|
|
264
|
-
onClick={() => showView(record.code)}>
|
|
265
|
-
</Button>
|
|
266
|
-
: ""}
|
|
267
|
-
{buttons.includes('customDetail') && showView ?
|
|
268
|
-
<Button
|
|
269
|
-
size="small"
|
|
270
|
-
type="primary"
|
|
271
|
-
icon={<AlignCenterOutlined/>}
|
|
272
|
-
onClick={() => showView(record.code, true)}>
|
|
273
|
-
</Button>
|
|
274
|
-
: ""}
|
|
275
|
-
{buttons.includes('dtmplEdit') && doEdit && !readOnly
|
|
276
|
-
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction, [record], undefined)) ?
|
|
277
|
-
< Button
|
|
278
|
-
size="small"
|
|
279
|
-
type="dashed"
|
|
280
|
-
icon={<EditOutlined/>}
|
|
281
|
-
onClick={() => doEdit(record.code, 'update')}>
|
|
282
|
-
</Button> : ""}
|
|
283
|
-
{(buttons.includes('dtmplCustomEdit') || customEditable) && doEdit && !readOnly
|
|
284
|
-
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction, [record], undefined)) ?
|
|
285
|
-
< Button
|
|
286
|
-
size="small"
|
|
287
|
-
type="dashed"
|
|
288
|
-
icon={<FormOutlined/>}
|
|
289
|
-
onClick={() => doEdit(record.code, 'update', true)}>
|
|
290
|
-
</Button> : ""}
|
|
291
|
-
{buttons.includes('copy') && doEdit && !readOnly
|
|
292
|
-
?
|
|
293
|
-
<Tooltip title={'复制'}>< Button
|
|
294
|
-
size="small"
|
|
295
|
-
type="dashed"
|
|
296
|
-
icon={<CopyOutlined/>}
|
|
297
|
-
onClick={ async () => {
|
|
298
|
-
//先复制
|
|
299
|
-
let toCustomPage=false;
|
|
300
|
-
if(buttons.includes('dtmplCustomEdit') || customEditable){
|
|
301
|
-
toCustomPage=true;
|
|
302
|
-
}
|
|
303
|
-
let code = await HcserviceV3.doCopy(serverKey,sourceId,record.code);
|
|
304
|
-
if(code){
|
|
305
|
-
doEdit(code, 'update',toCustomPage);
|
|
306
|
-
}
|
|
307
|
-
}}>
|
|
308
|
-
</Button></Tooltip> : ""}
|
|
309
|
-
{ltmplConfig.ractions && !readOnly ? ltmplConfig.ractions.map((raction) => {
|
|
310
|
-
return <Button
|
|
311
|
-
key={raction.id}
|
|
312
|
-
size="small"
|
|
313
|
-
type="dashed"
|
|
314
|
-
onClick={() => doRAction(raction.id, record.code)}
|
|
315
|
-
>
|
|
316
|
-
{raction.title}
|
|
317
|
-
</Button>
|
|
318
|
-
}) : ""}
|
|
319
|
-
{ltmplConfig.rowActions && !readOnly && ltmplConfig.rowActions.length > 0 ?
|
|
320
|
-
ltmplConfig.rowActions.map((action) => {
|
|
321
|
-
|
|
322
|
-
return <Action serverKey={serverKey} iconType={'icon'} key={action.id} data={[record]} actionConfig={action}
|
|
323
|
-
doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
324
|
-
}) : ""}
|
|
325
|
-
{ltmplConfig.rowJumps && ltmplConfig.rowJumps.length > 0 && !readOnly ?
|
|
326
|
-
ltmplConfig.rowJumps.map((jump) => {
|
|
327
|
-
return <Button key={jump.id} size="small" type="dashed"
|
|
328
|
-
onClick={() => this.doRowJump(jump, record)}
|
|
329
|
-
>{jump.title}</Button>;
|
|
330
|
-
}) : ""}
|
|
331
|
-
{ltmplConfig.rowCQuerys && ltmplConfig.rowCQuerys.length > 0 && !readOnly?
|
|
332
|
-
ltmplConfig.rowCQuerys.map((cquery) => {
|
|
333
|
-
// console.log("record record", record);
|
|
334
|
-
return <CquickButton serverKey={serverKey} key={cquery.id} size={"small"} pageType={'drawer'}
|
|
335
|
-
// onClick={() => doCQuery(cquery.id)}
|
|
336
|
-
cQueryConfig={cquery}
|
|
337
|
-
mainCode={cquery.mainCodeColId ? record[cquery.mainCodeColId] : record.code}/>
|
|
338
|
-
}) : ""}
|
|
339
|
-
{buttons.includes('singleDelete') && !readOnly && (!ltmplConfig.deleteAction || ActionUtils.isShow(ltmplConfig.deleteAction, [record], undefined)) ?
|
|
340
|
-
<Popconfirm
|
|
341
|
-
placement="rightBottom"
|
|
342
|
-
title={'确定要【删除】此数据吗?'}
|
|
343
|
-
onConfirm={() => {
|
|
344
|
-
this.doDeleteByCode(record.code)
|
|
345
|
-
}}
|
|
346
|
-
okText="确定"
|
|
347
|
-
cancelText="取消"
|
|
348
|
-
okType={"danger"}
|
|
349
|
-
>
|
|
350
|
-
<Button size="small" type="dashed" danger><DeleteOutlined/></Button>
|
|
351
|
-
</Popconfirm>
|
|
352
|
-
: ""}
|
|
353
|
-
</Space>);
|
|
354
|
-
} else {
|
|
355
|
-
column['className'] = 'opsColumn';
|
|
356
|
-
column['render'] = (text, record) => {
|
|
357
|
-
return <ViewControl serverKey={serverKey} fieldConfig={item} value={record[item.id]} holderType={'table'}/>
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
return tableColumns
|
|
196
|
+
ltmplConfig.columns.forEach((item) => {
|
|
197
|
+
if (item.hidden) {
|
|
198
|
+
hiddenColIds_.push(item.id);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
/** 构建column **/
|
|
202
|
+
// let tableColumns = this.buildTableColumns(ltmplConfig, hiddenColIds_, hiddenRowCodes, sortedColConfigs);
|
|
203
|
+
|
|
204
|
+
const { defaultPageSize } = ltmplConfig;
|
|
205
|
+
|
|
206
|
+
let pageInfo = {
|
|
207
|
+
pageNo: pageNo ? pageNo : 1,
|
|
208
|
+
pageSize: pageSize ? pageSize : defaultPageSize ? defaultPageSize : 10,
|
|
209
|
+
virtualEndPageNo: undefined,
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/** 构建 dataSource **/
|
|
213
|
+
//构建过滤条件
|
|
214
|
+
let queryKey: QueryKey;
|
|
215
|
+
if (level && level == "l2") {
|
|
216
|
+
queryKey = await HcserviceV3.requestL2LtmplQueryKey(serverKey, sourceId, {
|
|
217
|
+
...criteriaData,
|
|
218
|
+
...pageInfo,
|
|
219
|
+
mainCode,
|
|
220
|
+
});
|
|
221
|
+
} else {
|
|
222
|
+
queryKey = await HcserviceV3.requestLtmplQueryKey(serverKey, sourceId, {
|
|
223
|
+
...criteriaData,
|
|
224
|
+
...pageInfo,
|
|
225
|
+
mainCode,
|
|
226
|
+
});
|
|
363
227
|
}
|
|
364
228
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
229
|
+
this.setState({
|
|
230
|
+
disabledColIds,
|
|
231
|
+
hiddenColIds: hiddenColIds_,
|
|
232
|
+
hiddenRowCodes,
|
|
233
|
+
sortedColConfigs,
|
|
234
|
+
queryKey,
|
|
235
|
+
loading: false,
|
|
236
|
+
showL2Chart: false,
|
|
237
|
+
selectedRows: [],
|
|
238
|
+
selectedDatas: [],
|
|
239
|
+
viewModels:
|
|
240
|
+
this.state.viewModels.length > 0 ? this.state.viewModels : ["table"],
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
buildTableColumns = (
|
|
245
|
+
ltmplConfig: LtmplConfig,
|
|
246
|
+
hiddenColIds: string[],
|
|
247
|
+
hiddenRowCodes: string[],
|
|
248
|
+
sortedColConfigs: ColumnConfig[]
|
|
249
|
+
) => {
|
|
250
|
+
const {
|
|
251
|
+
showView,
|
|
252
|
+
doEdit,
|
|
253
|
+
doRAction,
|
|
254
|
+
customEditable,
|
|
255
|
+
serverKey,
|
|
256
|
+
readOnly,
|
|
257
|
+
sourceId,
|
|
258
|
+
} = this.props;
|
|
259
|
+
const { translate } = this.context;
|
|
260
|
+
const { buttons } = ltmplConfig;
|
|
261
|
+
let tableColumns = [];
|
|
262
|
+
let s = 0;
|
|
263
|
+
let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
|
|
264
|
+
|
|
265
|
+
colConfigs.forEach((item) => {
|
|
266
|
+
let column = {};
|
|
267
|
+
if (!hiddenColIds || !hiddenColIds.includes(item.id)) {
|
|
268
|
+
tableColumns.push(column);
|
|
269
|
+
}
|
|
270
|
+
column["title"] = item.title;
|
|
271
|
+
column["dataIndex"] = item.id;
|
|
272
|
+
// column['ellipsis']= true;
|
|
273
|
+
s++;
|
|
274
|
+
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
275
|
+
if (s < 10 && item.title != "操作" && item.title != "序号") {
|
|
276
|
+
if (hiddenColIds.includes("10000")) {
|
|
277
|
+
TableUnits.sort(column, itemType);
|
|
371
278
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
279
|
+
}
|
|
280
|
+
//特殊列处理
|
|
281
|
+
//序号
|
|
282
|
+
if (item.title === "序号") {
|
|
283
|
+
//item.fixed='left';
|
|
284
|
+
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
285
|
+
item["sorter"] = undefined;
|
|
286
|
+
} else if (item.id == "10000") {
|
|
287
|
+
column["title"] = <Tooltip title={"拖拽排序"}>{item.title}</Tooltip>;
|
|
288
|
+
column["width"] = 30;
|
|
289
|
+
column["dataIndex"] = item.id;
|
|
290
|
+
column["className"] = "drag-visible";
|
|
291
|
+
column["render"] = () => <DragHandle />;
|
|
292
|
+
} else if (item.id == "20000") {
|
|
293
|
+
//隐藏
|
|
294
|
+
column["align"] = "center";
|
|
295
|
+
column["width"] = 14;
|
|
296
|
+
column["title"] = (
|
|
297
|
+
<>
|
|
298
|
+
{hiddenRowCodes.length > 0 ? (
|
|
299
|
+
<Tooltip title={translate("${取消隐藏}")}>
|
|
300
|
+
<Button
|
|
301
|
+
style={{ marginRight: "0px" }}
|
|
302
|
+
size="small"
|
|
303
|
+
shape={"circle"}
|
|
304
|
+
icon={<EyeOutlined />}
|
|
305
|
+
type={"text"}
|
|
306
|
+
onClick={() => this.unHiden()}
|
|
307
|
+
></Button>
|
|
308
|
+
</Tooltip>
|
|
309
|
+
) : (
|
|
310
|
+
""
|
|
311
|
+
)}
|
|
312
|
+
</>
|
|
313
|
+
);
|
|
314
|
+
column["render"] = (text, record) => (
|
|
315
|
+
<Tooltip title={translate("${隐藏}")}>
|
|
316
|
+
{" "}
|
|
317
|
+
<Button
|
|
318
|
+
style={{ marginRight: "0px" }}
|
|
319
|
+
icon={<EyeInvisibleOutlined />}
|
|
320
|
+
type="dashed"
|
|
321
|
+
size="small"
|
|
322
|
+
onClick={() => this.onHide(record.code)}
|
|
323
|
+
></Button>
|
|
324
|
+
</Tooltip>
|
|
325
|
+
);
|
|
326
|
+
} else if (item.title === "操作") {
|
|
327
|
+
column["fixed"] = "right";
|
|
328
|
+
column["align"] = "center";
|
|
329
|
+
column["className"] = "opsColumn";
|
|
330
|
+
column["title"] = <>{translate("${操作}")}</>;
|
|
331
|
+
column["render"] = (text, record) => (
|
|
332
|
+
<Space size={[0, 4]} wrap>
|
|
333
|
+
{buttons.includes("detail") && showView ? (
|
|
334
|
+
<Button
|
|
335
|
+
size="small"
|
|
336
|
+
type="primary"
|
|
337
|
+
icon={<AlignLeftOutlined />}
|
|
338
|
+
onClick={() => showView(record.code)}
|
|
339
|
+
></Button>
|
|
340
|
+
) : (
|
|
341
|
+
""
|
|
342
|
+
)}
|
|
343
|
+
{buttons.includes("customDetail") && showView ? (
|
|
344
|
+
<Button
|
|
345
|
+
size="small"
|
|
346
|
+
type="primary"
|
|
347
|
+
icon={<AlignCenterOutlined />}
|
|
348
|
+
onClick={() => showView(record.code, true)}
|
|
349
|
+
></Button>
|
|
350
|
+
) : (
|
|
351
|
+
""
|
|
352
|
+
)}
|
|
353
|
+
{buttons.includes("dtmplEdit") &&
|
|
354
|
+
doEdit &&
|
|
355
|
+
!readOnly &&
|
|
356
|
+
(!ltmplConfig.editAction ||
|
|
357
|
+
ActionUtils.isShow(
|
|
358
|
+
ltmplConfig.editAction,
|
|
359
|
+
[record],
|
|
360
|
+
undefined
|
|
361
|
+
)) ? (
|
|
362
|
+
<Button
|
|
363
|
+
size="small"
|
|
364
|
+
type="dashed"
|
|
365
|
+
icon={<EditOutlined />}
|
|
366
|
+
onClick={() => doEdit(record.code, "update")}
|
|
367
|
+
></Button>
|
|
368
|
+
) : (
|
|
369
|
+
""
|
|
370
|
+
)}
|
|
371
|
+
{(buttons.includes("dtmplCustomEdit") || customEditable) &&
|
|
372
|
+
doEdit &&
|
|
373
|
+
!readOnly &&
|
|
374
|
+
(!ltmplConfig.editAction ||
|
|
375
|
+
ActionUtils.isShow(
|
|
376
|
+
ltmplConfig.editAction,
|
|
377
|
+
[record],
|
|
378
|
+
undefined
|
|
379
|
+
)) ? (
|
|
380
|
+
<Button
|
|
381
|
+
size="small"
|
|
382
|
+
type="dashed"
|
|
383
|
+
icon={<FormOutlined />}
|
|
384
|
+
onClick={() => doEdit(record.code, "update", true)}
|
|
385
|
+
></Button>
|
|
386
|
+
) : (
|
|
387
|
+
""
|
|
388
|
+
)}
|
|
389
|
+
{buttons.includes("copy") && doEdit && !readOnly ? (
|
|
390
|
+
<Tooltip title={translate("${复制}")}>
|
|
391
|
+
<Button
|
|
392
|
+
size="small"
|
|
393
|
+
type="dashed"
|
|
394
|
+
icon={<CopyOutlined />}
|
|
395
|
+
onClick={async () => {
|
|
396
|
+
//先复制
|
|
397
|
+
let toCustomPage = false;
|
|
398
|
+
if (buttons.includes("dtmplCustomEdit") || customEditable) {
|
|
399
|
+
toCustomPage = true;
|
|
400
|
+
}
|
|
401
|
+
let code = await HcserviceV3.doCopy(
|
|
402
|
+
serverKey,
|
|
403
|
+
sourceId,
|
|
404
|
+
record.code
|
|
405
|
+
);
|
|
406
|
+
if (code) {
|
|
407
|
+
doEdit(code, "update", toCustomPage);
|
|
408
|
+
}
|
|
409
|
+
}}
|
|
410
|
+
></Button>
|
|
411
|
+
</Tooltip>
|
|
412
|
+
) : (
|
|
413
|
+
""
|
|
414
|
+
)}
|
|
415
|
+
{ltmplConfig.ractions && !readOnly
|
|
416
|
+
? ltmplConfig.ractions.map((raction) => {
|
|
417
|
+
return (
|
|
418
|
+
<Button
|
|
419
|
+
key={raction.id}
|
|
420
|
+
size="small"
|
|
421
|
+
type="dashed"
|
|
422
|
+
onClick={() => doRAction(raction.id, record.code)}
|
|
423
|
+
>
|
|
424
|
+
{raction.title}
|
|
425
|
+
</Button>
|
|
426
|
+
);
|
|
392
427
|
})
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
428
|
+
: ""}
|
|
429
|
+
{ltmplConfig.rowActions &&
|
|
430
|
+
!readOnly &&
|
|
431
|
+
ltmplConfig.rowActions.length > 0
|
|
432
|
+
? ltmplConfig.rowActions.map((action) => {
|
|
433
|
+
return (
|
|
434
|
+
<Action
|
|
435
|
+
serverKey={serverKey}
|
|
436
|
+
iconType={"icon"}
|
|
437
|
+
key={action.id}
|
|
438
|
+
data={[record]}
|
|
439
|
+
actionConfig={action}
|
|
440
|
+
doAction={this.doRowAction}
|
|
441
|
+
buttonSize={"small"}
|
|
442
|
+
serial={1}
|
|
443
|
+
></Action>
|
|
444
|
+
);
|
|
445
|
+
})
|
|
446
|
+
: ""}
|
|
447
|
+
{ltmplConfig.rowJumps &&
|
|
448
|
+
ltmplConfig.rowJumps.length > 0 &&
|
|
449
|
+
!readOnly
|
|
450
|
+
? ltmplConfig.rowJumps.map((jump) => {
|
|
451
|
+
return (
|
|
452
|
+
<Button
|
|
453
|
+
key={jump.id}
|
|
454
|
+
size="small"
|
|
455
|
+
type="dashed"
|
|
456
|
+
onClick={() => this.doRowJump(jump, record)}
|
|
457
|
+
>
|
|
458
|
+
{jump.title}
|
|
459
|
+
</Button>
|
|
460
|
+
);
|
|
461
|
+
})
|
|
462
|
+
: ""}
|
|
463
|
+
{ltmplConfig.rowCQuerys &&
|
|
464
|
+
ltmplConfig.rowCQuerys.length > 0 &&
|
|
465
|
+
!readOnly
|
|
466
|
+
? ltmplConfig.rowCQuerys.map((cquery) => {
|
|
467
|
+
// console.log("record record", record);
|
|
468
|
+
return (
|
|
469
|
+
<CquickButton
|
|
470
|
+
serverKey={serverKey}
|
|
471
|
+
key={cquery.id}
|
|
472
|
+
size={"small"}
|
|
473
|
+
pageType={"drawer"}
|
|
474
|
+
// onClick={() => doCQuery(cquery.id)}
|
|
475
|
+
cQueryConfig={cquery}
|
|
476
|
+
mainCode={
|
|
477
|
+
cquery.mainCodeColId
|
|
478
|
+
? record[cquery.mainCodeColId]
|
|
479
|
+
: record.code
|
|
480
|
+
}
|
|
481
|
+
/>
|
|
482
|
+
);
|
|
483
|
+
})
|
|
484
|
+
: ""}
|
|
485
|
+
{buttons.includes("singleDelete") &&
|
|
486
|
+
!readOnly &&
|
|
487
|
+
(!ltmplConfig.deleteAction ||
|
|
488
|
+
ActionUtils.isShow(
|
|
489
|
+
ltmplConfig.deleteAction,
|
|
490
|
+
[record],
|
|
491
|
+
undefined
|
|
492
|
+
)) ? (
|
|
493
|
+
<Popconfirm
|
|
494
|
+
placement="rightBottom"
|
|
495
|
+
title={translate("${确定要[删除]此数据吗}?")}
|
|
496
|
+
onConfirm={() => {
|
|
497
|
+
this.doDeleteByCode(record.code);
|
|
498
|
+
}}
|
|
499
|
+
okText={translate("${确定}")}
|
|
500
|
+
cancelText={translate("${取消}")}
|
|
501
|
+
okType={"danger"}
|
|
502
|
+
>
|
|
503
|
+
<Button size="small" type="dashed" danger>
|
|
504
|
+
<DeleteOutlined />
|
|
505
|
+
</Button>
|
|
506
|
+
</Popconfirm>
|
|
507
|
+
) : (
|
|
508
|
+
""
|
|
509
|
+
)}
|
|
510
|
+
</Space>
|
|
511
|
+
);
|
|
512
|
+
} else {
|
|
513
|
+
column["className"] = "opsColumn";
|
|
514
|
+
column["render"] = (text, record) => {
|
|
515
|
+
return (
|
|
516
|
+
<ViewControl
|
|
517
|
+
serverKey={serverKey}
|
|
518
|
+
fieldConfig={item}
|
|
519
|
+
value={record[item.id]}
|
|
520
|
+
holderType={"table"}
|
|
521
|
+
/>
|
|
522
|
+
);
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
return tableColumns;
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
async componentDidMount() {
|
|
530
|
+
const { ltmplConfig } = this.props;
|
|
531
|
+
const { translate } = this.context;
|
|
532
|
+
let sortedColConfigs = undefined;
|
|
533
|
+
if (ltmplConfig) {
|
|
534
|
+
sortedColConfigs = [
|
|
535
|
+
{ id: "10000", title: translate("${排序}") },
|
|
536
|
+
...ltmplConfig.columns,
|
|
537
|
+
{ id: "20000", title: translate("${隐藏}") },
|
|
538
|
+
];
|
|
396
539
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
540
|
+
this.loadData(defaultDisabledColIds, [], sortedColConfigs);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
async componentDidUpdate(prevProps) {
|
|
544
|
+
const { sourceId, criteriaData, ltmplConfig } = this.props;
|
|
545
|
+
const { translate } = this.context;
|
|
546
|
+
let {
|
|
547
|
+
ltmplConfig: preLtmplConfig,
|
|
548
|
+
criteriaData: preCriteriaData,
|
|
549
|
+
sourceId: preSourceId,
|
|
550
|
+
} = prevProps;
|
|
551
|
+
|
|
552
|
+
let { hiddenColIds, sortedColConfigs } = this.state;
|
|
553
|
+
if (
|
|
554
|
+
(sourceId && preSourceId != sourceId) ||
|
|
555
|
+
(ltmplConfig &&
|
|
556
|
+
(!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id)) ||
|
|
557
|
+
Units.transQueryParamsToStr(criteriaData, false, [
|
|
558
|
+
"pageSize",
|
|
559
|
+
"pageNo",
|
|
560
|
+
]) !=
|
|
561
|
+
Units.transQueryParamsToStr(preCriteriaData, false, [
|
|
562
|
+
"pageSize",
|
|
563
|
+
"pageNo",
|
|
564
|
+
])
|
|
565
|
+
) {
|
|
566
|
+
if (ltmplConfig.id == preLtmplConfig.id) {
|
|
567
|
+
this.loadData(hiddenColIds, [], sortedColConfigs);
|
|
568
|
+
} else {
|
|
569
|
+
let sColConfigs = undefined;
|
|
570
|
+
if (ltmplConfig) {
|
|
571
|
+
sColConfigs = [
|
|
572
|
+
{ id: "10000", title: translate("${排序}") },
|
|
573
|
+
...ltmplConfig.columns,
|
|
574
|
+
{ id: "20000", title: translate("${隐藏}") },
|
|
575
|
+
];
|
|
576
|
+
}
|
|
400
577
|
this.setState({
|
|
401
|
-
|
|
402
|
-
})
|
|
578
|
+
viewModels: ["table"],
|
|
579
|
+
});
|
|
580
|
+
this.loadData(defaultDisabledColIds, [], sColConfigs);
|
|
581
|
+
}
|
|
403
582
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
handleShowChart = () => {
|
|
586
|
+
this.setState({
|
|
587
|
+
showL2Chart: !this.state.showL2Chart,
|
|
588
|
+
});
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
handleDataAnalysis = () => {
|
|
592
|
+
this.setState({
|
|
593
|
+
showL2ActTable: !this.state.showL2ActTable,
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
unHiden = () => {
|
|
598
|
+
const { ltmplConfig } = this.props;
|
|
599
|
+
const { hiddenColIds, sortedColConfigs } = this.state;
|
|
600
|
+
this.setState({
|
|
601
|
+
hiddenRowCodes: [],
|
|
602
|
+
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, [], sortedColConfigs),
|
|
603
|
+
});
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
onHide = (code: string) => {
|
|
607
|
+
const { ltmplConfig } = this.props;
|
|
608
|
+
const { hiddenRowCodes, hiddenColIds, sortedColConfigs } = this.state;
|
|
609
|
+
let hiddenCodes = [...hiddenRowCodes, code];
|
|
610
|
+
this.setState({
|
|
611
|
+
hiddenRowCodes: hiddenCodes,
|
|
612
|
+
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenCodes, sortedColConfigs),
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
changeViewModel = (viewModels) => {
|
|
617
|
+
this.setState({
|
|
618
|
+
viewModels,
|
|
619
|
+
});
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
changeHiddenColumns = (hiddenColIds: string[]) => {
|
|
623
|
+
const {} = this.props;
|
|
624
|
+
const {} = this.state;
|
|
625
|
+
this.setState({
|
|
626
|
+
showL2Chart: false,
|
|
627
|
+
hiddenColIds,
|
|
628
|
+
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
633
|
+
const { selectedRows } = this.state;
|
|
634
|
+
this.doAction(actionId, selectedRows, params);
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
638
|
+
const { serverKey } = this.props;
|
|
639
|
+
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
640
|
+
this.setState({
|
|
641
|
+
loading: true,
|
|
642
|
+
});
|
|
643
|
+
let result: boolean = await HcserviceV3.postActions(
|
|
644
|
+
serverKey,
|
|
645
|
+
actionId,
|
|
646
|
+
selectedRows,
|
|
647
|
+
params
|
|
648
|
+
);
|
|
649
|
+
if (result) {
|
|
650
|
+
//重新加载数据
|
|
651
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
652
|
+
} else {
|
|
653
|
+
this.setState({
|
|
654
|
+
loading: false,
|
|
655
|
+
});
|
|
410
656
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
660
|
+
this.doAction(actionId, [{ title: undefined, code: codes[0] }], params);
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
doDelete = async () => {
|
|
664
|
+
const { sourceId, serverKey } = this.props;
|
|
665
|
+
const {
|
|
666
|
+
selectedRows,
|
|
667
|
+
hiddenColIds,
|
|
668
|
+
hiddenRowCodes,
|
|
669
|
+
sortedColConfigs,
|
|
670
|
+
} = this.state;
|
|
671
|
+
this.setState({
|
|
672
|
+
loading: true,
|
|
673
|
+
});
|
|
674
|
+
let result: boolean = await HcserviceV3.deleteData(
|
|
675
|
+
serverKey,
|
|
676
|
+
sourceId,
|
|
677
|
+
selectedRows
|
|
678
|
+
);
|
|
679
|
+
if (result) {
|
|
680
|
+
//重新加载数据
|
|
681
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
682
|
+
} else {
|
|
683
|
+
this.setState({
|
|
684
|
+
loading: false,
|
|
685
|
+
});
|
|
429
686
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
doDeleteByCode = async (code: string) => {
|
|
690
|
+
const { sourceId, serverKey } = this.props;
|
|
691
|
+
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
692
|
+
this.setState({
|
|
693
|
+
loading: true,
|
|
694
|
+
});
|
|
695
|
+
let result: boolean = await HcserviceV3.deleteByCode(serverKey, sourceId, [
|
|
696
|
+
code,
|
|
697
|
+
]);
|
|
698
|
+
if (result) {
|
|
699
|
+
//重新加载数据
|
|
700
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
701
|
+
} else {
|
|
702
|
+
this.setState({
|
|
703
|
+
loading: false,
|
|
704
|
+
});
|
|
435
705
|
}
|
|
706
|
+
};
|
|
436
707
|
|
|
437
|
-
|
|
438
|
-
const {} = this.props
|
|
439
|
-
const {} = this.state;
|
|
440
|
-
this.setState({
|
|
441
|
-
showL2Chart: false,
|
|
442
|
-
hiddenColIds,
|
|
443
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
444
|
-
})
|
|
445
|
-
}
|
|
708
|
+
doSelectedCQuery = async (cqueryId: string) => {};
|
|
446
709
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
this.doAction(actionId, selectedRows, params);
|
|
450
|
-
}
|
|
710
|
+
doJump = async (jump: JumpConfig, record_: DtmplData) => {
|
|
711
|
+
let record = record_.fieldMap ? record_.fieldMap : record_;
|
|
451
712
|
|
|
452
|
-
|
|
453
|
-
const {serverKey} = this.props;
|
|
454
|
-
const {hiddenColIds, hiddenRowCodes, sortedColConfigs} = this.state;
|
|
455
|
-
this.setState({
|
|
456
|
-
loading: true,
|
|
457
|
-
})
|
|
458
|
-
let result: boolean = await HcserviceV3.postActions(serverKey,actionId, selectedRows, params);
|
|
459
|
-
if (result) {//重新加载数据
|
|
460
|
-
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
461
|
-
} else {
|
|
462
|
-
this.setState({
|
|
463
|
-
loading: false,
|
|
464
|
-
})
|
|
465
|
-
}
|
|
466
|
-
}
|
|
713
|
+
let url = null;
|
|
467
714
|
|
|
468
|
-
|
|
469
|
-
|
|
715
|
+
let path = jump.path;
|
|
716
|
+
if (!path) {
|
|
717
|
+
path = "/";
|
|
470
718
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
})
|
|
485
|
-
}
|
|
719
|
+
//是否以http开头
|
|
720
|
+
if (path.indexOf("#") == 0 || url.indexOf("/#") == 0) {
|
|
721
|
+
url = "";
|
|
722
|
+
} else if (
|
|
723
|
+
path.indexOf("http://") == 0 ||
|
|
724
|
+
path.indexOf("HTTP://") == 0 ||
|
|
725
|
+
path.indexOf("https://") == 0 ||
|
|
726
|
+
path.indexOf("HTTPS://") == 0
|
|
727
|
+
) {
|
|
728
|
+
url = path.split("//")[0] + "//";
|
|
729
|
+
path = path.split("//")[1];
|
|
730
|
+
} else {
|
|
731
|
+
url = new URL(window.location.href).pathname;
|
|
486
732
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
733
|
+
//处理路由参数
|
|
734
|
+
let paths = path.split("/");
|
|
735
|
+
|
|
736
|
+
let routeParamConfigs = jump.routeParams;
|
|
737
|
+
if (routeParamConfigs) {
|
|
738
|
+
for (let i = 0; i < paths.length; i++) {
|
|
739
|
+
if (paths[i].indexOf(":") == 0) {
|
|
740
|
+
let pa = paths[i].substring(1);
|
|
741
|
+
//根据参数名匹配参数
|
|
742
|
+
for (let p of routeParamConfigs) {
|
|
743
|
+
if (p && pa == p.title) {
|
|
744
|
+
//赋值替换
|
|
745
|
+
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
746
|
+
paths[i] = v;
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
501
750
|
}
|
|
751
|
+
}
|
|
752
|
+
url = Units.joinPath(url, paths.join("/"));
|
|
753
|
+
} else {
|
|
754
|
+
url = Units.joinPath(url, path);
|
|
502
755
|
}
|
|
503
756
|
|
|
504
|
-
|
|
757
|
+
//处理search 参数
|
|
758
|
+
let searchParamConfigs = jump.searchParams;
|
|
759
|
+
let searchs = [];
|
|
760
|
+
//放入token
|
|
761
|
+
if (jump.tokenName) {
|
|
762
|
+
searchs[0] = jump.tokenName + "=" + Units.hydrocarbonToken();
|
|
505
763
|
}
|
|
506
764
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
let
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
if(!path){
|
|
515
|
-
path="/"
|
|
516
|
-
}
|
|
517
|
-
//是否以http开头
|
|
518
|
-
if(path.indexOf('#')==0 || url.indexOf('/#')==0){
|
|
519
|
-
url= "";
|
|
520
|
-
} else if( (path.indexOf('http://')==0 || path.indexOf('HTTP://')==0) || (path.indexOf('https://')==0 || path.indexOf('HTTPS://')==0)){
|
|
521
|
-
url= path.split("//")[0]+"//";
|
|
522
|
-
path=path.split("//")[1];
|
|
523
|
-
}else{
|
|
524
|
-
url=new URL(window.location.href).pathname;
|
|
525
|
-
}
|
|
526
|
-
//处理路由参数
|
|
527
|
-
let paths=path.split("/");
|
|
528
|
-
|
|
529
|
-
let routeParamConfigs=jump.routeParams;
|
|
530
|
-
if(routeParamConfigs){
|
|
531
|
-
for (let i=0;i<paths.length;i++) {
|
|
532
|
-
if(paths[i].indexOf(":")==0){
|
|
533
|
-
let pa=paths[i].substring(1);
|
|
534
|
-
//根据参数名匹配参数
|
|
535
|
-
for(let p of routeParamConfigs){
|
|
536
|
-
if(p && pa == p.title){//赋值替换
|
|
537
|
-
let v=record[p.id]?record[p.id]:p.defaultValue;
|
|
538
|
-
paths[i]=v
|
|
539
|
-
break;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
url=Units.joinPath(url,paths.join("/"));
|
|
545
|
-
}else{
|
|
546
|
-
url=Units.joinPath(url,path);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
//处理search 参数
|
|
550
|
-
let searchParamConfigs=jump.searchParams;
|
|
551
|
-
let searchs=[];
|
|
552
|
-
//放入token
|
|
553
|
-
if(jump.tokenName){
|
|
554
|
-
searchs[0]=jump.tokenName+"="+Units.hydrocarbonToken();
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
if(searchParamConfigs){
|
|
558
|
-
let initSearchLength=searchs.length
|
|
559
|
-
for(let i=0;i<searchParamConfigs.length;i++){
|
|
560
|
-
let p= searchParamConfigs[i];
|
|
561
|
-
let v=record[p.id]?record[p.id]:p.defaultValue;
|
|
562
|
-
if(!v && p.title=='code'){
|
|
563
|
-
v=record_.code;
|
|
564
|
-
}
|
|
565
|
-
searchs[initSearchLength+i]=p.title+"="+ v;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
if(searchs.length>0){
|
|
569
|
-
if( url.indexOf("?")!=url.length-1){
|
|
570
|
-
url=url+"?";
|
|
571
|
-
}
|
|
572
|
-
url=url+searchs.join("&");
|
|
573
|
-
}
|
|
574
|
-
if(url.indexOf('#')==0 || url.indexOf('/#')==0 || url.indexOf('//#')==0){
|
|
575
|
-
window.location.hash = url.substring(url.indexOf('#')+1);
|
|
576
|
-
}else{
|
|
577
|
-
window.open(url);
|
|
765
|
+
if (searchParamConfigs) {
|
|
766
|
+
let initSearchLength = searchs.length;
|
|
767
|
+
for (let i = 0; i < searchParamConfigs.length; i++) {
|
|
768
|
+
let p = searchParamConfigs[i];
|
|
769
|
+
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
770
|
+
if (!v && p.title == "code") {
|
|
771
|
+
v = record_.code;
|
|
578
772
|
}
|
|
773
|
+
searchs[initSearchLength + i] = p.title + "=" + v;
|
|
774
|
+
}
|
|
579
775
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
776
|
+
if (searchs.length > 0) {
|
|
777
|
+
if (url.indexOf("?") != url.length - 1) {
|
|
778
|
+
url = url + "?";
|
|
779
|
+
}
|
|
780
|
+
url = url + searchs.join("&");
|
|
583
781
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
782
|
+
if (
|
|
783
|
+
url.indexOf("#") == 0 ||
|
|
784
|
+
url.indexOf("/#") == 0 ||
|
|
785
|
+
url.indexOf("//#") == 0
|
|
786
|
+
) {
|
|
787
|
+
window.location.hash = url.substring(url.indexOf("#") + 1);
|
|
788
|
+
} else {
|
|
789
|
+
window.open(url);
|
|
590
790
|
}
|
|
791
|
+
};
|
|
591
792
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
selectedDatas,
|
|
596
|
-
})
|
|
597
|
-
}
|
|
793
|
+
doRowJump = async (jump: JumpConfig, record: DtmplData) => {
|
|
794
|
+
this.doJump(jump, record);
|
|
795
|
+
};
|
|
598
796
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
sortedColConfigs,
|
|
604
|
-
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
605
|
-
})
|
|
797
|
+
doSelectedJump = async (jump: JumpConfig) => {
|
|
798
|
+
const { selectedDatas } = this.state;
|
|
799
|
+
if (selectedDatas.length == 1) {
|
|
800
|
+
this.doJump(jump, selectedDatas[0]);
|
|
606
801
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
changeRowSelection = (
|
|
805
|
+
selectedRows: SelectedRow[],
|
|
806
|
+
selectedDatas: DtmplData[]
|
|
807
|
+
) => {
|
|
808
|
+
this.setState({
|
|
809
|
+
selectedRows,
|
|
810
|
+
selectedDatas,
|
|
811
|
+
});
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
onChangeColSort = (sortedColConfigs: ColumnConfig[]) => {
|
|
815
|
+
const { ltmplConfig } = this.props;
|
|
816
|
+
const { hiddenRowCodes, hiddenColIds } = this.state;
|
|
817
|
+
this.setState({
|
|
818
|
+
sortedColConfigs,
|
|
819
|
+
// tableColumns: this.buildTableColumns(ltmplConfig, hiddenColIds, hiddenRowCodes, sortedColConfigs),
|
|
820
|
+
});
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
getAddTmplButton = (classifiedAddConfigs: ClassifiedAddConfig[]) => {
|
|
824
|
+
const { translate } = this.context;
|
|
825
|
+
if (classifiedAddConfigs && classifiedAddConfigs.length < 1) {
|
|
826
|
+
return translate("${没有分类添加按钮}");
|
|
618
827
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
{
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
<
|
|
665
|
-
|
|
666
|
-
display: buttons.includes("exportLtmplExcel") && !readOnly ? "inline" : "none",
|
|
667
|
-
marginLeft: '5px'
|
|
668
|
-
}} //为了点击到没有导出模块,使组件不致销毁,丢失导出数据
|
|
669
|
-
>
|
|
670
|
-
<DownloadOutlined/>
|
|
671
|
-
</Button></Tooltip>
|
|
672
|
-
</Popover>:""}
|
|
673
|
-
{buttons.includes("showChart") ? <Tooltip title={showL2Chart ? '隐藏图表' : '展示图表'}><Button
|
|
674
|
-
onClick={this.handleShowChart}>
|
|
675
|
-
<LineChartOutlined/></Button></Tooltip> : ""
|
|
676
|
-
}
|
|
677
|
-
{buttons.includes("analysis") ? <Tooltip title={showL2ActTable ? '隐藏数据分析' : '展示数据分析'}><Button
|
|
678
|
-
onClick={this.handleDataAnalysis}>
|
|
679
|
-
<FundOutlined/>
|
|
680
|
-
</Button></Tooltip> : ""}
|
|
681
|
-
{buttons.includes("reStat") && !readOnly ? <Restat serverKey={serverKey} fields={ltmplConfig.reStatParams} sourceId={sourceId}
|
|
682
|
-
onfinish={() => doSearch(null)}></Restat> : ""}
|
|
683
|
-
<Popover content={<Checkbox.Group value={viewModels} onChange={this.changeViewModel}>
|
|
684
|
-
<Row style={{width: '120px'}}>
|
|
685
|
-
<Col span={24}><Checkbox value={'table'}>表格</Checkbox></Col>
|
|
686
|
-
<Col span={24}><Checkbox value={'verticalList'}>纵向列表</Checkbox></Col>
|
|
687
|
-
{/*<Col span={24}><Checkbox value={'horizontalList'}>横向列表</Checkbox></Col>*/}
|
|
688
|
-
</Row>
|
|
689
|
-
</Checkbox.Group>} title="视图" placement="bottomRight"
|
|
690
|
-
trigger="click">
|
|
691
|
-
<Tooltip title={'选择视图'}>
|
|
692
|
-
<Button><RetweetOutlined/></Button>
|
|
693
|
-
</Tooltip>
|
|
828
|
+
return classifiedAddConfigs.map((config) => {
|
|
829
|
+
return (
|
|
830
|
+
<p>
|
|
831
|
+
<Button
|
|
832
|
+
size={"small"}
|
|
833
|
+
type={"text"}
|
|
834
|
+
onClick={() => this.props.doCreate(config.id, false)}
|
|
835
|
+
>
|
|
836
|
+
{config.title}
|
|
837
|
+
</Button>
|
|
838
|
+
</p>
|
|
839
|
+
);
|
|
840
|
+
});
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
renderHeaderButtons = () => {
|
|
844
|
+
let {
|
|
845
|
+
hiddenColIds,
|
|
846
|
+
queryKey,
|
|
847
|
+
viewModels,
|
|
848
|
+
sortedColConfigs,
|
|
849
|
+
disabledColIds,
|
|
850
|
+
showL2Chart,
|
|
851
|
+
showL2ActTable,
|
|
852
|
+
} = this.state;
|
|
853
|
+
const {
|
|
854
|
+
ltmplConfig,
|
|
855
|
+
sourceId,
|
|
856
|
+
doCreate,
|
|
857
|
+
doSearch,
|
|
858
|
+
menuId,
|
|
859
|
+
funcMode,
|
|
860
|
+
customCreatable,
|
|
861
|
+
serverKey,
|
|
862
|
+
readOnly,
|
|
863
|
+
} = this.props;
|
|
864
|
+
const { translate } = this.context;
|
|
865
|
+
let { buttons } = ltmplConfig;
|
|
866
|
+
|
|
867
|
+
return (
|
|
868
|
+
<>
|
|
869
|
+
<Space>
|
|
870
|
+
{funcMode == "common" && this.criteriaFormUseful() ? (
|
|
871
|
+
<Popover trigger="click" content={this.renderCriteriaForm()}>
|
|
872
|
+
<Button>
|
|
873
|
+
<SearchOutlined />
|
|
874
|
+
</Button>
|
|
694
875
|
</Popover>
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
876
|
+
) : null}
|
|
877
|
+
{buttons.includes("dtmplAdd") && doCreate && !readOnly ? (
|
|
878
|
+
ltmplConfig.classifiedAddConfigs &&
|
|
879
|
+
ltmplConfig.classifiedAddConfigs.length > 0 ? (
|
|
880
|
+
<Popover
|
|
881
|
+
arrow={false}
|
|
882
|
+
content={this.getAddTmplButton(
|
|
883
|
+
ltmplConfig.classifiedAddConfigs
|
|
884
|
+
)}
|
|
885
|
+
placement="bottomRight"
|
|
886
|
+
>
|
|
887
|
+
<Tooltip>
|
|
888
|
+
<Button>
|
|
889
|
+
<PlusOutlined />
|
|
890
|
+
</Button>
|
|
705
891
|
</Tooltip>
|
|
706
|
-
|
|
707
|
-
|
|
892
|
+
</Popover>
|
|
893
|
+
) : (
|
|
894
|
+
<Tooltip title={translate("${创建}")}>
|
|
895
|
+
<Button onClick={() => doCreate(null, false)}>
|
|
896
|
+
<PlusOutlined />
|
|
897
|
+
</Button>{" "}
|
|
898
|
+
</Tooltip>
|
|
899
|
+
)
|
|
900
|
+
) : (
|
|
901
|
+
""
|
|
902
|
+
)}
|
|
903
|
+
{(buttons.includes("dtmplCustomAdd") || customCreatable) &&
|
|
904
|
+
doCreate &&
|
|
905
|
+
!readOnly ? (
|
|
906
|
+
<Tooltip title={translate("${创建}")}>
|
|
907
|
+
<Button onClick={() => doCreate(null, true)}>
|
|
908
|
+
<PlusCircleOutlined />
|
|
909
|
+
</Button>
|
|
910
|
+
</Tooltip>
|
|
911
|
+
) : (
|
|
912
|
+
""
|
|
913
|
+
)}
|
|
914
|
+
{buttons.includes("importLtmplExcel") && !readOnly ? (
|
|
915
|
+
<Tooltip title={translate("${导入}")}>
|
|
916
|
+
{" "}
|
|
917
|
+
<Button
|
|
918
|
+
href={`#/${sourceId}/importer?menuId=${menuId}`}
|
|
919
|
+
target={"_blank"}
|
|
920
|
+
>
|
|
921
|
+
<UploadOutlined />
|
|
922
|
+
</Button>
|
|
923
|
+
</Tooltip>
|
|
924
|
+
) : (
|
|
925
|
+
""
|
|
926
|
+
)}
|
|
927
|
+
{buttons.includes("exportLtmplExcel") && !readOnly ? (
|
|
928
|
+
<Popover
|
|
929
|
+
content={
|
|
930
|
+
<ExportFrame //导出组件
|
|
931
|
+
serverKey={serverKey}
|
|
932
|
+
queryKey={queryKey}
|
|
933
|
+
title={ltmplConfig.title}
|
|
934
|
+
/>
|
|
935
|
+
}
|
|
936
|
+
title={translate("${导出}")}
|
|
937
|
+
placement="bottomRight"
|
|
938
|
+
trigger="click"
|
|
939
|
+
>
|
|
940
|
+
<Tooltip title={translate("${导出}")}>
|
|
708
941
|
<Button
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
942
|
+
style={{
|
|
943
|
+
display:
|
|
944
|
+
buttons.includes("exportLtmplExcel") && !readOnly
|
|
945
|
+
? "inline"
|
|
946
|
+
: "none",
|
|
947
|
+
marginLeft: "5px",
|
|
948
|
+
}} //为了点击到没有导出模块,使组件不致销毁,丢失导出数据
|
|
949
|
+
>
|
|
950
|
+
<DownloadOutlined />
|
|
951
|
+
</Button>
|
|
952
|
+
</Tooltip>
|
|
953
|
+
</Popover>
|
|
954
|
+
) : (
|
|
955
|
+
""
|
|
956
|
+
)}
|
|
957
|
+
{buttons.includes("showChart") ? (
|
|
958
|
+
<Tooltip
|
|
959
|
+
title={
|
|
960
|
+
showL2Chart
|
|
961
|
+
? translate("${隐藏}${图表}")
|
|
962
|
+
: translate("${展示}${图表}")
|
|
963
|
+
}
|
|
964
|
+
>
|
|
965
|
+
<Button onClick={this.handleShowChart}>
|
|
966
|
+
<LineChartOutlined />
|
|
967
|
+
</Button>
|
|
968
|
+
</Tooltip>
|
|
969
|
+
) : (
|
|
970
|
+
""
|
|
971
|
+
)}
|
|
972
|
+
{buttons.includes("analysis") ? (
|
|
973
|
+
<Tooltip
|
|
974
|
+
title={
|
|
975
|
+
showL2ActTable
|
|
976
|
+
? translate("${隐藏}${数据分析}")
|
|
977
|
+
: translate("${展示}${数据分析}")
|
|
978
|
+
}
|
|
979
|
+
>
|
|
980
|
+
<Button onClick={this.handleDataAnalysis}>
|
|
981
|
+
<FundOutlined />
|
|
982
|
+
</Button>
|
|
983
|
+
</Tooltip>
|
|
984
|
+
) : (
|
|
985
|
+
""
|
|
986
|
+
)}
|
|
987
|
+
{buttons.includes("reStat") && !readOnly ? (
|
|
988
|
+
<Restat
|
|
989
|
+
serverKey={serverKey}
|
|
990
|
+
fields={ltmplConfig.reStatParams}
|
|
991
|
+
sourceId={sourceId}
|
|
992
|
+
onfinish={() => doSearch(null)}
|
|
993
|
+
></Restat>
|
|
994
|
+
) : (
|
|
995
|
+
""
|
|
996
|
+
)}
|
|
997
|
+
<Popover
|
|
998
|
+
content={
|
|
999
|
+
<Checkbox.Group
|
|
1000
|
+
value={viewModels}
|
|
1001
|
+
onChange={this.changeViewModel}
|
|
1002
|
+
>
|
|
1003
|
+
<Row style={{ width: "120px" }}>
|
|
1004
|
+
<Col span={24}>
|
|
1005
|
+
<Checkbox value={"table"}>{translate("${表格}")}</Checkbox>
|
|
1006
|
+
</Col>
|
|
1007
|
+
<Col span={24}>
|
|
1008
|
+
<Checkbox value={"verticalList"}>
|
|
1009
|
+
{translate("纵向列表")}
|
|
1010
|
+
</Checkbox>
|
|
1011
|
+
</Col>
|
|
1012
|
+
{/*<Col span={24}><Checkbox value={'horizontalList'}>横向列表</Checkbox></Col>*/}
|
|
1013
|
+
</Row>
|
|
1014
|
+
</Checkbox.Group>
|
|
1015
|
+
}
|
|
1016
|
+
title={translate("${视图}")}
|
|
1017
|
+
placement="bottomRight"
|
|
1018
|
+
trigger="click"
|
|
1019
|
+
>
|
|
1020
|
+
<Tooltip title={translate("${选择视图}")}>
|
|
1021
|
+
<Button>
|
|
1022
|
+
<RetweetOutlined />
|
|
1023
|
+
</Button>
|
|
1024
|
+
</Tooltip>
|
|
1025
|
+
</Popover>
|
|
1026
|
+
<Popover
|
|
1027
|
+
content={
|
|
1028
|
+
<ColumnSelector
|
|
1029
|
+
columns={sortedColConfigs}
|
|
1030
|
+
disabledColIds={disabledColIds}
|
|
1031
|
+
hiddenColIds={hiddenColIds}
|
|
1032
|
+
onChangeColSort={this.onChangeColSort}
|
|
1033
|
+
onChangeHiddenCols={this.changeHiddenColumns}
|
|
1034
|
+
/>
|
|
1035
|
+
}
|
|
1036
|
+
title={translate("${排序和选择列}")}
|
|
1037
|
+
placement="bottomRight"
|
|
1038
|
+
trigger="click"
|
|
1039
|
+
>
|
|
1040
|
+
<Tooltip title={translate("${点击排序和选择列}")}>
|
|
1041
|
+
<Button>
|
|
1042
|
+
<TableOutlined />
|
|
1043
|
+
</Button>
|
|
1044
|
+
</Tooltip>
|
|
1045
|
+
</Popover>
|
|
1046
|
+
{doSearch ? (
|
|
1047
|
+
<Button
|
|
1048
|
+
className="hoverbig"
|
|
1049
|
+
title={translate("${刷新}")}
|
|
1050
|
+
onClick={() => {
|
|
1051
|
+
doSearch(null);
|
|
1052
|
+
}}
|
|
1053
|
+
>
|
|
1054
|
+
<ReloadOutlined />
|
|
1055
|
+
</Button>
|
|
1056
|
+
) : (
|
|
1057
|
+
""
|
|
1058
|
+
)}
|
|
1059
|
+
</Space>
|
|
1060
|
+
</>
|
|
1061
|
+
);
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
criteriaFormUseful = () => {
|
|
1065
|
+
const { ltmplConfig } = this.props;
|
|
1066
|
+
let { buttons, criterias } = ltmplConfig;
|
|
1067
|
+
if (
|
|
1068
|
+
(buttons.includes("query") &&
|
|
1069
|
+
((criterias && criterias.length > 0) ||
|
|
1070
|
+
buttons.includes("drilling"))) ||
|
|
1071
|
+
this.checkBoxUseful()
|
|
1072
|
+
) {
|
|
1073
|
+
return true;
|
|
1074
|
+
} else {
|
|
1075
|
+
return false;
|
|
718
1076
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
checkBoxUseful = () => {
|
|
1080
|
+
const { ltmplConfig } = this.props;
|
|
1081
|
+
let { buttons, jumps, actions } = ltmplConfig;
|
|
1082
|
+
if (
|
|
1083
|
+
buttons.includes("batchDelete") ||
|
|
1084
|
+
(actions && actions.length > 0) ||
|
|
1085
|
+
(jumps && jumps.length > 0)
|
|
1086
|
+
) {
|
|
1087
|
+
return true;
|
|
1088
|
+
} else {
|
|
1089
|
+
return false;
|
|
729
1090
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
}
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
renderCriteriaForm = () => {
|
|
1094
|
+
let { loading, selectedRows, selectedDatas } = this.state;
|
|
1095
|
+
let { ltmplConfig, doSearch, criteriaData, serverKey } = this.props;
|
|
1096
|
+
return (
|
|
1097
|
+
<CriteriaForm
|
|
1098
|
+
serverKey={serverKey}
|
|
1099
|
+
loading={loading}
|
|
1100
|
+
selectedDatas={selectedDatas}
|
|
1101
|
+
selectedRows={selectedRows}
|
|
1102
|
+
ltmplConfig={ltmplConfig}
|
|
1103
|
+
data={criteriaData}
|
|
1104
|
+
doCQuery={this.doSelectedCQuery}
|
|
1105
|
+
doAction={this.doSelectedAction}
|
|
1106
|
+
doDelete={this.doDelete}
|
|
1107
|
+
doJump={this.doSelectedJump}
|
|
1108
|
+
doSearch={doSearch}
|
|
1109
|
+
/>
|
|
1110
|
+
);
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
renderContent = () => {
|
|
1114
|
+
let {
|
|
1115
|
+
queryKey,
|
|
1116
|
+
loading,
|
|
1117
|
+
selectedRows,
|
|
1118
|
+
hiddenRowCodes,
|
|
1119
|
+
viewModels,
|
|
1120
|
+
sortedColConfigs,
|
|
1121
|
+
hiddenColIds,
|
|
1122
|
+
showL2ActTable,
|
|
1123
|
+
} = this.state;
|
|
1124
|
+
let {
|
|
1125
|
+
sourceId,
|
|
1126
|
+
ltmplConfig,
|
|
1127
|
+
funcMode,
|
|
1128
|
+
title,
|
|
1129
|
+
collapsible,
|
|
1130
|
+
pageSize,
|
|
1131
|
+
pageNo,
|
|
1132
|
+
onChangePage,
|
|
1133
|
+
serverKey,
|
|
1134
|
+
} = this.props;
|
|
1135
|
+
|
|
1136
|
+
if (!ltmplConfig || !sourceId) {
|
|
1137
|
+
return (
|
|
1138
|
+
<>
|
|
1139
|
+
<Card loading={loading}></Card>
|
|
1140
|
+
<Table loading={loading}></Table>
|
|
1141
|
+
</>
|
|
1142
|
+
);
|
|
740
1143
|
}
|
|
741
1144
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
1145
|
+
let tableColumns = this.buildTableColumns(
|
|
1146
|
+
ltmplConfig,
|
|
1147
|
+
hiddenColIds,
|
|
1148
|
+
hiddenRowCodes,
|
|
1149
|
+
sortedColConfigs
|
|
1150
|
+
);
|
|
1151
|
+
|
|
1152
|
+
let { buttons } = ltmplConfig;
|
|
1153
|
+
let displayCriteriaCard: boolean = false;
|
|
1154
|
+
if (funcMode == "simple" || funcMode == "common") {
|
|
1155
|
+
displayCriteriaCard = false;
|
|
1156
|
+
} else if (this.criteriaFormUseful()) {
|
|
1157
|
+
displayCriteriaCard = true;
|
|
752
1158
|
}
|
|
753
1159
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
return <>
|
|
760
|
-
<Card loading={loading}>
|
|
761
|
-
</Card>
|
|
762
|
-
<Table loading={loading}>
|
|
763
|
-
</Table>
|
|
764
|
-
</>
|
|
1160
|
+
let columnConfigs = [];
|
|
1161
|
+
if (sortedColConfigs) {
|
|
1162
|
+
for (let colConfig of sortedColConfigs) {
|
|
1163
|
+
if (!hiddenColIds.includes(colConfig.id)) {
|
|
1164
|
+
columnConfigs.push(colConfig);
|
|
765
1165
|
}
|
|
766
|
-
|
|
767
|
-
let tableColumns = this.buildTableColumns(ltmplConfig,hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
768
|
-
|
|
769
|
-
let {buttons} = ltmplConfig
|
|
770
|
-
let displayCriteriaCard: boolean = false;
|
|
771
|
-
if (funcMode == 'simple' || funcMode == 'common') {
|
|
772
|
-
displayCriteriaCard = false;
|
|
773
|
-
} else if (this.criteriaFormUseful()) {
|
|
774
|
-
displayCriteriaCard = true;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
let columnConfigs = [];
|
|
778
|
-
if (sortedColConfigs) {
|
|
779
|
-
for (let colConfig of sortedColConfigs) {
|
|
780
|
-
if (!hiddenColIds.includes(colConfig.id)) {
|
|
781
|
-
columnConfigs.push(colConfig);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
return (
|
|
786
|
-
<>
|
|
787
|
-
{/*暂时不支持L2chart 后续用echart*/}
|
|
788
|
-
{/*{buttons.includes("showChart") && showL2Chart ? <div>*/}
|
|
789
|
-
{/* <StatViewL2Chart queryKey={queryKey.key} ltmplConfig={ltmplConfig} hiddenColIds={hiddenColIds}*/}
|
|
790
|
-
{/* hiddenRowCodes={hiddenRowCodes}/>*/}
|
|
791
|
-
{/* /!*<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>*!/*/}
|
|
792
|
-
{/*</div> : ""*/}
|
|
793
|
-
{/*}*/}
|
|
794
|
-
{buttons.includes("analysis") && showL2ActTable ? <div>
|
|
795
|
-
<L2ActTable serverKey={serverKey} innerQueryKey={queryKey.key} sourceId={sourceId}/>
|
|
796
|
-
<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>
|
|
797
|
-
</div> : ""
|
|
798
|
-
}
|
|
799
|
-
<div className="actTable">
|
|
800
|
-
{funcMode == 'complete' || funcMode == 'common' ?
|
|
801
|
-
collapsible?null:
|
|
802
|
-
<span>
|
|
803
|
-
{ltmplConfig.header?<div style={{padding:'6px'}} dangerouslySetInnerHTML={{__html:ltmplConfig.header}} ></div>:null}
|
|
804
|
-
<h3> {title ? title : ltmplConfig.title}
|
|
805
|
-
<p className="fr">
|
|
806
|
-
{this.renderHeaderButtons()}
|
|
807
|
-
</p></h3>
|
|
808
|
-
</span> : null
|
|
809
|
-
}
|
|
810
|
-
{displayCriteriaCard ?
|
|
811
|
-
this.renderCriteriaForm() : null
|
|
812
|
-
}
|
|
813
|
-
{loading?"":<QueryTable serverKey={serverKey} onChangePage={onChangePage} viewModels={viewModels} primaryColumn={ltmplConfig.primaryColumn} columnConfigs={columnConfigs}
|
|
814
|
-
maxSelectedRows={this.checkBoxUseful() ? 10000 : -1}
|
|
815
|
-
selectedRows={selectedRows}
|
|
816
|
-
columns={tableColumns}
|
|
817
|
-
hiddenRowCodes={hiddenRowCodes}
|
|
818
|
-
pageInfo={{pageNo:pageNo?pageNo:1,pageSize:pageSize?pageSize:ltmplConfig.defaultPageSize}}
|
|
819
|
-
queryKey={queryKey}
|
|
820
|
-
onChangeRowSelection={this.changeRowSelection}/>}
|
|
821
|
-
{/*此处放页脚*/}
|
|
822
|
-
{ltmplConfig.footer?<div style={{padding:'6px'}} dangerouslySetInnerHTML={{__html:ltmplConfig.footer}} ></div>:null}
|
|
823
|
-
</div>
|
|
824
|
-
</>
|
|
825
|
-
);
|
|
1166
|
+
}
|
|
826
1167
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
1168
|
+
return (
|
|
1169
|
+
<>
|
|
1170
|
+
{/*暂时不支持L2chart 后续用echart*/}
|
|
1171
|
+
{/*{buttons.includes("showChart") && showL2Chart ? <div>*/}
|
|
1172
|
+
{/* <StatViewL2Chart queryKey={queryKey.key} ltmplConfig={ltmplConfig} hiddenColIds={hiddenColIds}*/}
|
|
1173
|
+
{/* hiddenRowCodes={hiddenRowCodes}/>*/}
|
|
1174
|
+
{/* /!*<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>*!/*/}
|
|
1175
|
+
{/*</div> : ""*/}
|
|
1176
|
+
{/*}*/}
|
|
1177
|
+
{buttons.includes("analysis") && showL2ActTable ? (
|
|
1178
|
+
<div>
|
|
1179
|
+
<L2ActTable
|
|
1180
|
+
serverKey={serverKey}
|
|
1181
|
+
innerQueryKey={queryKey.key}
|
|
1182
|
+
sourceId={sourceId}
|
|
1183
|
+
/>
|
|
1184
|
+
<Divider
|
|
1185
|
+
dashed
|
|
1186
|
+
style={{ borderTopColor: "#40a9ff" }}
|
|
1187
|
+
plain
|
|
1188
|
+
></Divider>
|
|
1189
|
+
</div>
|
|
1190
|
+
) : (
|
|
1191
|
+
""
|
|
1192
|
+
)}
|
|
1193
|
+
<div className="actTable">
|
|
1194
|
+
{funcMode == "complete" || funcMode == "common" ? (
|
|
1195
|
+
collapsible ? null : (
|
|
1196
|
+
<span>
|
|
1197
|
+
{ltmplConfig.header ? (
|
|
1198
|
+
<div
|
|
1199
|
+
style={{ padding: "6px" }}
|
|
1200
|
+
dangerouslySetInnerHTML={{ __html: ltmplConfig.header }}
|
|
1201
|
+
></div>
|
|
1202
|
+
) : null}
|
|
1203
|
+
<h3>
|
|
1204
|
+
{" "}
|
|
1205
|
+
{title ? title : ltmplConfig.title}
|
|
1206
|
+
<p className="fr">{this.renderHeaderButtons()}</p>
|
|
1207
|
+
</h3>
|
|
1208
|
+
</span>
|
|
1209
|
+
)
|
|
1210
|
+
) : null}
|
|
1211
|
+
{displayCriteriaCard ? this.renderCriteriaForm() : null}
|
|
1212
|
+
{loading ? (
|
|
1213
|
+
""
|
|
1214
|
+
) : (
|
|
1215
|
+
<QueryTable
|
|
1216
|
+
serverKey={serverKey}
|
|
1217
|
+
onChangePage={onChangePage}
|
|
1218
|
+
viewModels={viewModels}
|
|
1219
|
+
primaryColumn={ltmplConfig.primaryColumn}
|
|
1220
|
+
columnConfigs={columnConfigs}
|
|
1221
|
+
maxSelectedRows={this.checkBoxUseful() ? 10000 : -1}
|
|
1222
|
+
selectedRows={selectedRows}
|
|
1223
|
+
columns={tableColumns}
|
|
1224
|
+
hiddenRowCodes={hiddenRowCodes}
|
|
1225
|
+
pageInfo={{
|
|
1226
|
+
pageNo: pageNo ? pageNo : 1,
|
|
1227
|
+
pageSize: pageSize ? pageSize : ltmplConfig.defaultPageSize,
|
|
1228
|
+
}}
|
|
1229
|
+
queryKey={queryKey}
|
|
1230
|
+
onChangeRowSelection={this.changeRowSelection}
|
|
1231
|
+
/>
|
|
1232
|
+
)}
|
|
1233
|
+
{/*此处放页脚*/}
|
|
1234
|
+
{ltmplConfig.footer ? (
|
|
1235
|
+
<div
|
|
1236
|
+
style={{ padding: "6px" }}
|
|
1237
|
+
dangerouslySetInnerHTML={{ __html: ltmplConfig.footer }}
|
|
1238
|
+
></div>
|
|
1239
|
+
) : null}
|
|
1240
|
+
</div>
|
|
1241
|
+
</>
|
|
1242
|
+
);
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
render() {
|
|
1246
|
+
let { queryKey, loading } = this.state;
|
|
1247
|
+
let {
|
|
1248
|
+
sourceId,
|
|
1249
|
+
ltmplConfig,
|
|
1250
|
+
title,
|
|
1251
|
+
collapsible,
|
|
1252
|
+
initCollapse,
|
|
1253
|
+
tip,
|
|
1254
|
+
} = this.props;
|
|
1255
|
+
|
|
1256
|
+
if (!ltmplConfig || !sourceId) {
|
|
1257
|
+
return (
|
|
1258
|
+
<>
|
|
1259
|
+
<Card loading={loading}></Card>
|
|
1260
|
+
<Table loading={loading}></Table>
|
|
860
1261
|
</>
|
|
861
|
-
|
|
1262
|
+
);
|
|
862
1263
|
}
|
|
1264
|
+
|
|
1265
|
+
return (
|
|
1266
|
+
<>
|
|
1267
|
+
{" "}
|
|
1268
|
+
{collapsible ? (
|
|
1269
|
+
<CollapseCard
|
|
1270
|
+
initCollapse={initCollapse}
|
|
1271
|
+
title={
|
|
1272
|
+
<>
|
|
1273
|
+
{title ? title : ltmplConfig.title}
|
|
1274
|
+
<ToolTipBar
|
|
1275
|
+
content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
|
|
1276
|
+
/>
|
|
1277
|
+
</>
|
|
1278
|
+
}
|
|
1279
|
+
id={queryKey + ltmplConfig.id}
|
|
1280
|
+
className={`hoverable`}
|
|
1281
|
+
headStyle={{ background: "#f2f4f5" }}
|
|
1282
|
+
loading={loading}
|
|
1283
|
+
bodyStyle={{ padding: "6px" }}
|
|
1284
|
+
//暂时注释掉,后续要支持配置。
|
|
1285
|
+
extra={this.renderHeaderButtons()}
|
|
1286
|
+
>
|
|
1287
|
+
{this.renderContent()}
|
|
1288
|
+
</CollapseCard>
|
|
1289
|
+
) : (
|
|
1290
|
+
<>{this.renderContent()}</>
|
|
1291
|
+
)}
|
|
1292
|
+
</>
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
863
1295
|
}
|
|
864
1296
|
|
|
865
|
-
export default ActTable;
|
|
1297
|
+
export default ActTable;
|