aldehyde 0.2.480 → 0.2.481
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 +201 -201
- package/README.md +2 -2
- package/lib/controls/2dEditor/2dEditor/index.less +5 -5
- package/lib/controls/2dEditor/2dView/index.less +8 -8
- package/lib/controls/2dEditor/components/component.less +83 -83
- package/lib/controls/action/index.css +8 -8
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/chemstruc/index.css +28 -28
- package/lib/controls/collapse-card/index.css +8 -8
- package/lib/controls/collapse-card/index.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/index.css +7 -7
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/file-view/index.less +9 -9
- package/lib/controls/html-editor/index.less +67 -67
- package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +147 -147
- package/lib/controls/password-setter/index.css +2 -2
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/qr-code/index.less +28 -28
- package/lib/controls/relation-existion/index.css +3 -3
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.css +4 -4
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
- package/lib/controls/text/index.less +7 -7
- package/lib/controls/upload/index.d.ts.map +1 -1
- package/lib/controls/upload/mult-file-upload.d.ts.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/index.css +42 -42
- package/lib/detail/dtmpl.css +67 -67
- package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/popover-edit-card.d.ts.map +1 -1
- package/lib/detail/rightbar/index.css +34 -34
- package/lib/detail/rightbar/index.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/tab-act-dtmpl-view.d.ts.map +1 -1
- package/lib/draw-canvas-edit/components/render/components/index.d.ts +3 -0
- package/lib/draw-canvas-edit/components/render/components/index.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/components/index.js +3 -0
- package/lib/draw-canvas-edit/components/render/components/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/components/workstation-component.d.ts +31 -0
- package/lib/draw-canvas-edit/components/render/components/workstation-component.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/components/workstation-component.js +105 -0
- package/lib/draw-canvas-edit/components/render/components/workstation-component.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/component-factory.d.ts +2 -0
- package/lib/draw-canvas-edit/components/render/tools/component-factory.d.ts.map +1 -1
- package/lib/draw-canvas-edit/components/render/tools/component-factory.js +10 -42
- package/lib/draw-canvas-edit/components/render/tools/component-factory.js.map +1 -1
- package/lib/draw-canvas-edit/components/render/types.d.ts +3 -0
- package/lib/draw-canvas-edit/components/render/types.d.ts.map +1 -1
- package/lib/draw-canvas-edit/components/render/types.js.map +1 -1
- package/lib/draw-canvas-edit/index.less +48 -48
- package/lib/draw-canvas-view/index.less +59 -59
- package/lib/draw-canvas-view/view.d.ts.map +1 -1
- package/lib/draw-canvas-view/view.js +19 -6
- package/lib/draw-canvas-view/view.js.map +1 -1
- package/lib/export/export-frame.css +2 -2
- package/lib/export/export-frame.d.ts.map +1 -1
- package/lib/export/select-code-export-frame.d.ts.map +1 -1
- package/lib/form/dtmpl-form.css +3 -3
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +1 -1
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/index.css +12 -12
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/import/index.css +53 -53
- package/lib/import/template.css +50 -50
- package/lib/layout/common.css +64 -64
- package/lib/layout/coverstyle.css +51 -51
- package/lib/layout/footer/index.css +5 -5
- package/lib/layout/header/index.css +122 -122
- package/lib/layout/menu/block.css +7 -7
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/message-bar.less +73 -73
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/sidebar/index.css +57 -57
- package/lib/layout2/css/header.css +41 -41
- package/lib/layout2/css/sider.less +17 -17
- package/lib/layout2/css/tabs-layout.less +18 -18
- package/lib/layout3/css/header.less +195 -195
- package/lib/layout3/css/main.less +161 -161
- package/lib/layout3/css/sider.less +32 -32
- package/lib/layout3/css/tabs-layout.less +38 -38
- package/lib/layout4/css/header.less +196 -196
- package/lib/layout4/css/main.less +154 -154
- package/lib/layout4/css/sider.less +37 -37
- package/lib/layout4/css/tabs-layout.less +42 -42
- package/lib/layout5/css/header.less +35 -35
- package/lib/layout5/css/sider.less +18 -18
- package/lib/list/calendar/index.less +20 -20
- package/lib/list/card-list/index.less +154 -154
- package/lib/list/gantt/index.less +8 -8
- package/lib/list/vertical-list/index.less +208 -208
- package/lib/login/index.css +19 -19
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/vertify/index.css +143 -143
- package/lib/login3/index.less +136 -136
- package/lib/lowcode-components/act-table/index.less +26 -26
- package/lib/lowcode-components/base-button/index.less +7 -7
- package/lib/lowcode-components/base-map/index.js +6 -6
- package/lib/lowcode-components/base-radio/index.less +23 -23
- package/lib/lowcode-components/base-tabs/index.less +14 -14
- package/lib/lowcode-components/border/border10/index.less +26 -26
- package/lib/lowcode-components/border/border11/index.js +46 -46
- package/lib/lowcode-components/border/border11/index.less +17 -17
- package/lib/lowcode-components/border/border12/index.js +13 -13
- package/lib/lowcode-components/border/border12/index.less +13 -13
- package/lib/lowcode-components/border/border13/index.js +5 -5
- package/lib/lowcode-components/border/border13/index.less +13 -13
- package/lib/lowcode-components/border/border2/index.less +17 -17
- package/lib/lowcode-components/border/border3/index.less +25 -25
- package/lib/lowcode-components/border/border4/index.js +2 -2
- package/lib/lowcode-components/border/border4/index.less +72 -72
- package/lib/lowcode-components/border/border5/index.js +2 -2
- package/lib/lowcode-components/border/border5/index.less +35 -35
- package/lib/lowcode-components/border/border6/index.less +17 -17
- package/lib/lowcode-components/border/border7/index.less +26 -26
- package/lib/lowcode-components/border/border8/index.less +13 -13
- package/lib/lowcode-components/border/border9/index.js +14 -14
- package/lib/lowcode-components/border/border9/index.less +13 -13
- package/lib/lowcode-components/decoration/decoration1/index.less +7 -7
- package/lib/lowcode-components/decoration/decoration10/index.js +3 -3
- package/lib/lowcode-components/decoration/decoration10/index.less +5 -5
- package/lib/lowcode-components/decoration/decoration11/index.less +5 -5
- package/lib/lowcode-components/decoration/decoration2/index.less +6 -6
- package/lib/lowcode-components/decoration/decoration3/index.less +7 -7
- package/lib/lowcode-components/decoration/decoration4/index.less +29 -29
- package/lib/lowcode-components/decoration/decoration5/index.less +3 -3
- package/lib/lowcode-components/decoration/decoration6/index.less +7 -7
- package/lib/lowcode-components/decoration/decoration7/index.less +4 -4
- package/lib/lowcode-components/decoration/decoration8/index.less +14 -14
- package/lib/lowcode-components/decoration/decoration9/index.less +4 -4
- package/lib/lowcode-components/effectScatter-map/index.js +6 -6
- package/lib/lowcode-components/effectScatter-map-3d/index.js +6 -6
- package/lib/lowcode-components/lowcode-view/index.less +19 -19
- package/lib/lowcode-components/search-form/index.less +25 -25
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/index.less +4 -4
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/routable/index.less +25 -25
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/column/index.less +63 -63
- package/lib/table/index.css +211 -211
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/pagination.css +14 -14
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +14 -2
- package/lib/table/select-table.js.map +1 -1
- package/lib/table/selected-rows-card.d.ts.map +1 -1
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/block-menu-auth-tree.d.ts.map +1 -1
- package/lib/tree/index.css +22 -22
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/welcome/components/menu-card.less +96 -96
- package/lib/welcome/components/page-card.less +49 -49
- package/lib/welcome/components/quick-entrance.less +120 -120
- package/lib/welcome/components/user-menus.less +192 -192
- package/lib/welcome/components/workbench.less +118 -118
- package/lib/welcome/index.css +13 -13
- package/package.json +223 -223
- package/src/aldehyde/controls/2dEditor/2dEditor/index.less +5 -5
- package/src/aldehyde/controls/2dEditor/2dEditor/index.tsx +270 -270
- package/src/aldehyde/controls/2dEditor/2dView/index.less +8 -8
- package/src/aldehyde/controls/2dEditor/2dView/index.tsx +110 -110
- package/src/aldehyde/controls/2dEditor/components/card.tsx +256 -256
- package/src/aldehyde/controls/2dEditor/components/component.less +83 -83
- package/src/aldehyde/controls/2dEditor/components/data.d.ts +32 -32
- package/src/aldehyde/controls/2dEditor/components/hotspot.tsx +80 -80
- package/src/aldehyde/controls/2dEditor/components/html-box.tsx +101 -101
- package/src/aldehyde/controls/2dEditor/components/image.tsx +99 -99
- package/src/aldehyde/controls/2dEditor/components/line.tsx +73 -73
- package/src/aldehyde/controls/action/index.css +8 -8
- package/src/aldehyde/controls/action/index.tsx +406 -406
- package/src/aldehyde/controls/action/utils.tsx +306 -306
- package/src/aldehyde/controls/auto-complete/index.tsx +82 -82
- package/src/aldehyde/controls/cascader/index.tsx +112 -112
- package/src/aldehyde/controls/chemstruc/graph.tsx +185 -185
- package/src/aldehyde/controls/chemstruc/index.css +28 -28
- package/src/aldehyde/controls/code-editor/sql-code-editor.tsx +73 -73
- package/src/aldehyde/controls/collapse-card/index.css +8 -8
- package/src/aldehyde/controls/collapse-card/index.tsx +109 -109
- package/src/aldehyde/controls/color-picker/index.tsx +21 -21
- package/src/aldehyde/controls/counting-tag/index.tsx +53 -53
- package/src/aldehyde/controls/cquery/cquick-button.tsx +145 -145
- package/src/aldehyde/controls/date-picker/index.tsx +199 -199
- package/src/aldehyde/controls/direct-file-view/drawer-file-view.tsx +54 -54
- package/src/aldehyde/controls/direct-file-view/index.tsx +145 -145
- package/src/aldehyde/controls/direct-upload/index.tsx +139 -139
- package/src/aldehyde/controls/entity-select/entity-select.tsx +791 -791
- package/src/aldehyde/controls/entity-select/index.css +7 -7
- package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +154 -154
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +205 -205
- package/src/aldehyde/controls/entry-control.tsx +418 -418
- package/src/aldehyde/controls/enum-badge/index.tsx +42 -42
- package/src/aldehyde/controls/enum-tag/index.tsx +45 -45
- package/src/aldehyde/controls/field-history/index.tsx +81 -81
- package/src/aldehyde/controls/file-export/select-code-export.tsx +40 -40
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +117 -117
- package/src/aldehyde/controls/file-view/index.less +9 -9
- package/src/aldehyde/controls/file-view/index.tsx +148 -148
- package/src/aldehyde/controls/file-view/multi-file-view.tsx +39 -39
- package/src/aldehyde/controls/file-view/newin-file-view.tsx +40 -40
- package/src/aldehyde/controls/html-editor/draft.tsx +136 -136
- package/src/aldehyde/controls/html-editor/index.less +67 -67
- package/src/aldehyde/controls/icon-selector/app-icon-selector.tsx +68 -68
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +147 -147
- package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +240 -240
- package/src/aldehyde/controls/icon-selector/pc-icon-selector.tsx +68 -68
- package/src/aldehyde/controls/input-number/index.tsx +148 -148
- package/src/aldehyde/controls/input-range/index.tsx +59 -59
- package/src/aldehyde/controls/password-setter/index.css +2 -2
- package/src/aldehyde/controls/password-setter/index.js +88 -88
- package/src/aldehyde/controls/progress/index.tsx +74 -74
- package/src/aldehyde/controls/qr-code/index.less +28 -28
- package/src/aldehyde/controls/qr-code/index.tsx +40 -40
- package/src/aldehyde/controls/relation-existion/index.css +3 -3
- package/src/aldehyde/controls/relation-existion/index.tsx +144 -144
- package/src/aldehyde/controls/rfield/index.css +4 -4
- package/src/aldehyde/controls/rfield/index.tsx +225 -225
- package/src/aldehyde/controls/select/index.tsx +216 -216
- package/src/aldehyde/controls/signature/index.tsx +226 -226
- package/src/aldehyde/controls/single-checkbox/index.tsx +18 -18
- package/src/aldehyde/controls/steps/index.tsx +59 -59
- package/src/aldehyde/controls/text/ellipsis-text.tsx +98 -98
- package/src/aldehyde/controls/text/index.less +7 -7
- package/src/aldehyde/controls/tree-select/navigation-tree.tsx +122 -122
- package/src/aldehyde/controls/tree-select/tree-entity-select.tsx +121 -121
- package/src/aldehyde/controls/upload/index.tsx +128 -128
- package/src/aldehyde/controls/upload/mult-file-upload.tsx +240 -240
- package/src/aldehyde/controls/view-control.tsx +289 -289
- package/src/aldehyde/custom-page/custom-detail-modal-page.tsx +69 -69
- package/src/aldehyde/custom-page/custom-page-router.tsx +64 -64
- package/src/aldehyde/custom-page/def-custom-page.tsx +17 -17
- package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +88 -88
- package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +91 -91
- package/src/aldehyde/detail/button/cquery-button-bar.tsx +144 -144
- package/src/aldehyde/detail/button/edit-button.tsx +61 -61
- package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +186 -186
- package/src/aldehyde/detail/button/index.css +42 -42
- package/src/aldehyde/detail/button/inline-edit-button.tsx +40 -40
- package/src/aldehyde/detail/button/submit-button-bar.tsx +57 -57
- package/src/aldehyde/detail/button/view-button.tsx +64 -64
- package/src/aldehyde/detail/dtmpl.css +67 -67
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +279 -279
- package/src/aldehyde/detail/edit/fields-edit-card.tsx +145 -145
- package/src/aldehyde/detail/edit/modal-row-edit.tsx +95 -95
- package/src/aldehyde/detail/edit/popover-edit-card.tsx +167 -167
- package/src/aldehyde/detail/edit/popover-editor.tsx +70 -70
- package/src/aldehyde/detail/edit/post-result/index.tsx +86 -86
- package/src/aldehyde/detail/rightbar/index.css +34 -34
- package/src/aldehyde/detail/rightbar/index.tsx +92 -92
- package/src/aldehyde/detail/tooltipbar/index.tsx +32 -32
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +288 -288
- package/src/aldehyde/detail/view/dtmpl-view.tsx +314 -314
- package/src/aldehyde/detail/view/field-view-group.tsx +88 -88
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +73 -73
- package/src/aldehyde/detail/view/snapshot-timeline.tsx +231 -231
- package/src/aldehyde/detail/view/tab-act-dtmpl-view.tsx +304 -304
- package/src/aldehyde/detail/view/view-compare-panel.tsx +57 -57
- package/src/aldehyde/draw-canvas-edit/components/render/components/index.ts +3 -0
- package/src/aldehyde/draw-canvas-edit/components/render/components/workstation-component.tsx +104 -0
- package/src/aldehyde/draw-canvas-edit/components/render/draws/bg-draw.ts +176 -176
- package/src/aldehyde/draw-canvas-edit/components/render/draws/contextmenu-draw.ts +329 -329
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/bezier.ts +542 -542
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-outside-handlers.ts +72 -72
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/selection-handlers.ts +396 -396
- package/src/aldehyde/draw-canvas-edit/components/render/index.ts +808 -808
- package/src/aldehyde/draw-canvas-edit/components/render/tools/attract-tool.ts +457 -457
- package/src/aldehyde/draw-canvas-edit/components/render/tools/component-factory.ts +270 -302
- package/src/aldehyde/draw-canvas-edit/components/render/tools/copy-tool.ts +244 -244
- package/src/aldehyde/draw-canvas-edit/components/render/tools/import-export-tool.ts +576 -576
- package/src/aldehyde/draw-canvas-edit/components/render/tools/index.ts +10 -10
- package/src/aldehyde/draw-canvas-edit/components/render/tools/position-tool.ts +191 -191
- package/src/aldehyde/draw-canvas-edit/components/render/tools/selection-tool.ts +140 -140
- package/src/aldehyde/draw-canvas-edit/components/render/types.ts +294 -291
- package/src/aldehyde/draw-canvas-edit/components/setting-form/index.tsx +291 -291
- package/src/aldehyde/draw-canvas-edit/constant.ts +5 -5
- package/src/aldehyde/draw-canvas-edit/index.less +48 -48
- package/src/aldehyde/draw-canvas-edit/index.tsx +201 -201
- package/src/aldehyde/draw-canvas-view/index.less +59 -59
- package/src/aldehyde/draw-canvas-view/index.tsx +49 -49
- package/src/aldehyde/draw-canvas-view/view.tsx +17 -5
- package/src/aldehyde/export/export-frame.css +2 -2
- package/src/aldehyde/export/export-frame.tsx +301 -301
- package/src/aldehyde/export/select-code-export-frame.tsx +212 -212
- package/src/aldehyde/form/criteria-form.tsx +604 -604
- package/src/aldehyde/form/dtmpl-form.css +3 -3
- package/src/aldehyde/form/dtmpl-form.tsx +552 -552
- package/src/aldehyde/form/field-group-form.tsx +102 -102
- package/src/aldehyde/form/fields-form.tsx +45 -45
- package/src/aldehyde/form/form-Item-group.tsx +245 -245
- package/src/aldehyde/form/index.css +12 -12
- package/src/aldehyde/hooks/use-match-route/index.tsx +62 -62
- package/src/aldehyde/hooks/use-tabs/index.tsx +139 -139
- package/src/aldehyde/hooks/useVarCssColor.ts +6 -6
- package/src/aldehyde/icon/aliIcon.tsx +9 -9
- package/src/aldehyde/icon/index.tsx +28 -28
- package/src/aldehyde/import/excel-import.tsx +450 -450
- package/src/aldehyde/import/index.css +53 -53
- package/src/aldehyde/import/template.css +50 -50
- package/src/aldehyde/index.tsx +220 -220
- package/src/aldehyde/layout/MainPage.tsx +334 -334
- package/src/aldehyde/layout/common.css +64 -64
- package/src/aldehyde/layout/coverstyle.css +51 -51
- package/src/aldehyde/layout/footer/index.css +5 -5
- package/src/aldehyde/layout/footer/index.js +17 -17
- package/src/aldehyde/layout/header/index.css +122 -122
- package/src/aldehyde/layout/header/index.tsx +152 -152
- package/src/aldehyde/layout/menu/block.css +7 -7
- package/src/aldehyde/layout/menu/block.tsx +174 -174
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +160 -160
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +175 -175
- package/src/aldehyde/layout/menu/menu-2layers.tsx +117 -117
- package/src/aldehyde/layout/menu/menu-render.tsx +168 -168
- package/src/aldehyde/layout/menu/message-bar.less +73 -73
- package/src/aldehyde/layout/menu/reset-password.tsx +255 -255
- package/src/aldehyde/layout/menu/user-bar.tsx +259 -259
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +69 -69
- package/src/aldehyde/layout/sidebar/index.css +57 -57
- package/src/aldehyde/layout/sidebar/index.tsx +84 -84
- package/src/aldehyde/layout2/components/icon-font.tsx +7 -7
- package/src/aldehyde/layout2/components/screenfull-button.tsx +21 -21
- package/src/aldehyde/layout2/components/search-menu.tsx +85 -85
- package/src/aldehyde/layout2/components/system-messages.tsx +75 -75
- package/src/aldehyde/layout2/components/theme-button.tsx +65 -65
- package/src/aldehyde/layout2/components/user-button.tsx +258 -258
- package/src/aldehyde/layout2/components/user-notification.tsx +74 -74
- package/src/aldehyde/layout2/css/header.css +41 -41
- package/src/aldehyde/layout2/css/sider.less +17 -17
- package/src/aldehyde/layout2/css/tabs-layout.less +18 -18
- package/src/aldehyde/layout2/header.tsx +278 -278
- package/src/aldehyde/layout2/layout-context.tsx +95 -95
- package/src/aldehyde/layout2/main.tsx +30 -30
- package/src/aldehyde/layout2/page.tsx +315 -315
- package/src/aldehyde/layout2/sider.tsx +230 -230
- package/src/aldehyde/layout2/tabs/tabs-context.tsx +37 -37
- package/src/aldehyde/layout2/tabs/tabs-layout.tsx +146 -146
- package/src/aldehyde/layout2/type/layout-type.ts +15 -15
- package/src/aldehyde/layout2/util/menu-util.tsx +125 -125
- package/src/aldehyde/layout3/components/tabs-layout.tsx +110 -110
- package/src/aldehyde/layout3/components/time.tsx +25 -25
- package/src/aldehyde/layout3/css/header.less +195 -195
- package/src/aldehyde/layout3/css/main.less +161 -161
- package/src/aldehyde/layout3/css/sider.less +32 -32
- package/src/aldehyde/layout3/css/tabs-layout.less +38 -38
- package/src/aldehyde/layout3/header.tsx +187 -187
- package/src/aldehyde/layout3/main.tsx +29 -29
- package/src/aldehyde/layout3/page.tsx +110 -110
- package/src/aldehyde/layout3/sider.tsx +198 -198
- package/src/aldehyde/layout4/components/tabs-layout.tsx +110 -110
- package/src/aldehyde/layout4/css/header.less +196 -196
- package/src/aldehyde/layout4/css/main.less +154 -154
- package/src/aldehyde/layout4/css/sider.less +37 -37
- package/src/aldehyde/layout4/css/tabs-layout.less +42 -42
- package/src/aldehyde/layout4/header.tsx +190 -190
- package/src/aldehyde/layout4/main.tsx +29 -29
- package/src/aldehyde/layout4/page.tsx +125 -125
- package/src/aldehyde/layout4/sider.tsx +201 -201
- package/src/aldehyde/layout5/css/header.less +35 -35
- package/src/aldehyde/layout5/css/sider.less +18 -18
- package/src/aldehyde/layout5/header.tsx +204 -204
- package/src/aldehyde/layout5/page.tsx +107 -107
- package/src/aldehyde/layout5/sider.tsx +235 -235
- package/src/aldehyde/list/calendar/index.less +20 -20
- package/src/aldehyde/list/calendar/index.tsx +157 -157
- package/src/aldehyde/list/card-list/card-list-item.tsx +111 -111
- package/src/aldehyde/list/card-list/index.less +154 -154
- package/src/aldehyde/list/card-list/index.tsx +83 -83
- package/src/aldehyde/list/gantt/index.less +8 -8
- package/src/aldehyde/list/gantt/index.tsx +508 -508
- package/src/aldehyde/list/vertical-list/index.less +208 -208
- package/src/aldehyde/list/vertical-list/index.tsx +55 -55
- package/src/aldehyde/list/vertical-list/item.tsx +136 -136
- package/src/aldehyde/locale/LocaleButton.tsx +48 -48
- package/src/aldehyde/locale/LocaleProvider.tsx +265 -265
- package/src/aldehyde/locale/langMp.ts +45 -45
- package/src/aldehyde/locale/translate.ts +80 -80
- package/src/aldehyde/locale/useLocale.ts +72 -72
- package/src/aldehyde/login/context-setter.tsx +130 -130
- package/src/aldehyde/login/index.css +19 -19
- package/src/aldehyde/login/login.tsx +255 -255
- package/src/aldehyde/login/router-login.tsx +107 -107
- package/src/aldehyde/login/vertify/index.css +143 -143
- package/src/aldehyde/login/vertify/index.tsx +360 -360
- package/src/aldehyde/login/vertify/tool.ts +13 -13
- package/src/aldehyde/login2/login-page.tsx +92 -92
- package/src/aldehyde/login2/login.tsx +226 -226
- package/src/aldehyde/login3/index.less +136 -136
- package/src/aldehyde/login3/login-page.tsx +71 -71
- package/src/aldehyde/lowcode-components/act-table/index.less +26 -26
- package/src/aldehyde/lowcode-components/act-table/index.tsx +139 -139
- package/src/aldehyde/lowcode-components/assets/lowcode-constant.tsx +12 -12
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +268 -268
- package/src/aldehyde/lowcode-components/base-button/index.less +7 -7
- package/src/aldehyde/lowcode-components/base-button/index.tsx +197 -197
- package/src/aldehyde/lowcode-components/base-image/index.tsx +220 -220
- package/src/aldehyde/lowcode-components/base-map/index.tsx +292 -292
- package/src/aldehyde/lowcode-components/base-radio/index.less +23 -23
- package/src/aldehyde/lowcode-components/base-radio/index.tsx +157 -157
- package/src/aldehyde/lowcode-components/base-table/index.tsx +268 -268
- package/src/aldehyde/lowcode-components/base-tabs/index.less +14 -14
- package/src/aldehyde/lowcode-components/base-tabs/index.tsx +183 -183
- package/src/aldehyde/lowcode-components/base-text/index.tsx +58 -58
- package/src/aldehyde/lowcode-components/border/border1/index.tsx +70 -70
- package/src/aldehyde/lowcode-components/border/border10/index.less +26 -26
- package/src/aldehyde/lowcode-components/border/border10/index.tsx +45 -45
- package/src/aldehyde/lowcode-components/border/border11/index.less +17 -17
- package/src/aldehyde/lowcode-components/border/border11/index.tsx +232 -232
- package/src/aldehyde/lowcode-components/border/border12/index.less +13 -13
- package/src/aldehyde/lowcode-components/border/border12/index.tsx +115 -115
- package/src/aldehyde/lowcode-components/border/border13/index.less +13 -13
- package/src/aldehyde/lowcode-components/border/border13/index.tsx +69 -69
- package/src/aldehyde/lowcode-components/border/border2/index.less +17 -17
- package/src/aldehyde/lowcode-components/border/border2/index.tsx +51 -51
- package/src/aldehyde/lowcode-components/border/border3/index.less +25 -25
- package/src/aldehyde/lowcode-components/border/border3/index.tsx +61 -61
- package/src/aldehyde/lowcode-components/border/border4/index.less +72 -72
- package/src/aldehyde/lowcode-components/border/border4/index.tsx +79 -79
- package/src/aldehyde/lowcode-components/border/border5/index.less +35 -35
- package/src/aldehyde/lowcode-components/border/border5/index.tsx +75 -75
- package/src/aldehyde/lowcode-components/border/border6/index.less +17 -17
- package/src/aldehyde/lowcode-components/border/border6/index.tsx +60 -60
- package/src/aldehyde/lowcode-components/border/border7/index.less +26 -26
- package/src/aldehyde/lowcode-components/border/border7/index.tsx +75 -75
- package/src/aldehyde/lowcode-components/border/border8/index.less +13 -13
- package/src/aldehyde/lowcode-components/border/border8/index.tsx +84 -84
- package/src/aldehyde/lowcode-components/border/border9/index.less +13 -13
- package/src/aldehyde/lowcode-components/border/border9/index.tsx +154 -154
- package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +290 -290
- package/src/aldehyde/lowcode-components/carousel/index.tsx +218 -218
- package/src/aldehyde/lowcode-components/circular-progress-chart/index.tsx +263 -263
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +438 -438
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +293 -293
- package/src/aldehyde/lowcode-components/data-number/index.tsx +219 -219
- package/src/aldehyde/lowcode-components/data.d.ts +18 -18
- package/src/aldehyde/lowcode-components/decoration/decoration1/index.less +7 -7
- package/src/aldehyde/lowcode-components/decoration/decoration1/index.tsx +153 -153
- package/src/aldehyde/lowcode-components/decoration/decoration10/index.less +5 -5
- package/src/aldehyde/lowcode-components/decoration/decoration10/index.tsx +89 -89
- package/src/aldehyde/lowcode-components/decoration/decoration11/index.less +5 -5
- package/src/aldehyde/lowcode-components/decoration/decoration11/index.tsx +133 -133
- package/src/aldehyde/lowcode-components/decoration/decoration2/index.less +6 -6
- package/src/aldehyde/lowcode-components/decoration/decoration2/index.tsx +61 -61
- package/src/aldehyde/lowcode-components/decoration/decoration3/index.less +7 -7
- package/src/aldehyde/lowcode-components/decoration/decoration3/index.tsx +87 -87
- package/src/aldehyde/lowcode-components/decoration/decoration4/index.less +29 -29
- package/src/aldehyde/lowcode-components/decoration/decoration4/index.tsx +53 -53
- package/src/aldehyde/lowcode-components/decoration/decoration5/index.less +3 -3
- package/src/aldehyde/lowcode-components/decoration/decoration5/index.tsx +116 -116
- package/src/aldehyde/lowcode-components/decoration/decoration6/index.less +7 -7
- package/src/aldehyde/lowcode-components/decoration/decoration6/index.tsx +121 -121
- package/src/aldehyde/lowcode-components/decoration/decoration7/index.less +4 -4
- package/src/aldehyde/lowcode-components/decoration/decoration7/index.tsx +70 -70
- package/src/aldehyde/lowcode-components/decoration/decoration8/index.less +14 -14
- package/src/aldehyde/lowcode-components/decoration/decoration8/index.tsx +122 -122
- package/src/aldehyde/lowcode-components/decoration/decoration9/index.less +4 -4
- package/src/aldehyde/lowcode-components/decoration/decoration9/index.tsx +196 -196
- package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +315 -315
- package/src/aldehyde/lowcode-components/effectScatter-map-3d/index.tsx +419 -419
- package/src/aldehyde/lowcode-components/gauge-chart/index.tsx +254 -254
- package/src/aldehyde/lowcode-components/index.ts +130 -130
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +300 -300
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +290 -290
- package/src/aldehyde/lowcode-components/liquid-chart/index.tsx +250 -250
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +478 -478
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-controller.ts +153 -153
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-definition.ts +23 -23
- package/src/aldehyde/lowcode-components/lowcode-view/component/loading.tsx +20 -20
- package/src/aldehyde/lowcode-components/lowcode-view/component/util.ts +27 -27
- package/src/aldehyde/lowcode-components/lowcode-view/index.less +19 -19
- package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +277 -277
- package/src/aldehyde/lowcode-components/lowcode-view/interface.ts +189 -189
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +349 -349
- package/src/aldehyde/lowcode-components/progress-chart/index.tsx +295 -295
- package/src/aldehyde/lowcode-components/radar-chart/index.tsx +322 -322
- package/src/aldehyde/lowcode-components/search-form/index.less +25 -25
- package/src/aldehyde/lowcode-components/search-form/index.tsx +121 -121
- package/src/aldehyde/lowcode-components/stroke-animation/index.tsx +219 -219
- package/src/aldehyde/module/block-menu-tree-drawer.tsx +118 -118
- package/src/aldehyde/module/criteria-page.tsx1 +175 -175
- package/src/aldehyde/module/draggable-modal.tsx +66 -66
- package/src/aldehyde/module/dtmpl-edit-card.tsx +437 -437
- package/src/aldehyde/module/dtmpl-edit-drawer.tsx +23 -23
- package/src/aldehyde/module/dtmpl-edit-modal.tsx +25 -25
- package/src/aldehyde/module/dtmpl-edit-page.tsx +558 -558
- package/src/aldehyde/module/dtmpl-editor.tsx +165 -165
- package/src/aldehyde/module/dtmpl-view-card.tsx +64 -64
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +71 -71
- package/src/aldehyde/module/dtmpl-view-modal.tsx +56 -56
- package/src/aldehyde/module/embed-dtmpl-edit-page.tsx +137 -137
- package/src/aldehyde/module/index.less +4 -4
- package/src/aldehyde/module/ltmpl-drawer.tsx +60 -60
- package/src/aldehyde/module/ltmpl-modal.tsx +63 -63
- package/src/aldehyde/module/ltmpl-table.tsx +378 -378
- package/src/aldehyde/module/ttmpl-tree.tsx +47 -47
- package/src/aldehyde/routable/dtmpl-route.tsx +173 -173
- package/src/aldehyde/routable/import-route.tsx +35 -35
- package/src/aldehyde/routable/index.less +25 -25
- package/src/aldehyde/routable/ltmpl-route.tsx +539 -539
- package/src/aldehyde/routable/splitview-ltmpl-route.tsx +377 -377
- package/src/aldehyde/routable/ttmpl-route.tsx +93 -93
- package/src/aldehyde/routable/withroute.tsx +36 -36
- package/src/aldehyde/sso-Login/index.tsx +73 -73
- package/src/aldehyde/sso-Login/service/index.js +16 -16
- package/src/aldehyde/sso-Login/service/login.js +75 -75
- package/src/aldehyde/table/act-table.tsx +1831 -1831
- package/src/aldehyde/table/column/column-builder.tsx +864 -864
- package/src/aldehyde/table/column/column-selector.tsx +130 -130
- package/src/aldehyde/table/column/index.less +63 -63
- package/src/aldehyde/table/column/summary-builder.tsx +712 -712
- package/src/aldehyde/table/column/theme-color-getter.tsx +25 -25
- package/src/aldehyde/table/control-table-x-axis-wrapper.tsx +80 -80
- package/src/aldehyde/table/index.css +211 -211
- package/src/aldehyde/table/l2-act-table.tsx +91 -91
- package/src/aldehyde/table/modal-select-table.tsx +308 -308
- package/src/aldehyde/table/page-config-button.tsx +203 -203
- package/src/aldehyde/table/pagination.css +14 -14
- package/src/aldehyde/table/pagination.tsx +81 -81
- package/src/aldehyde/table/query-table.tsx +658 -658
- package/src/aldehyde/table/relation-table.tsx +1093 -1093
- package/src/aldehyde/table/report-table.tsx +125 -125
- package/src/aldehyde/table/resizable-table.tsx +97 -97
- package/src/aldehyde/table/select-table.tsx +559 -548
- package/src/aldehyde/table/selected-rows-card.tsx +78 -78
- package/src/aldehyde/table/stat/restat.tsx +122 -122
- package/src/aldehyde/table/table-util.tsx +25 -25
- package/src/aldehyde/tmpl/control-type-supportor.tsx +154 -154
- package/src/aldehyde/tmpl/hc-data-source.tsx +566 -566
- package/src/aldehyde/tmpl/hcservice-v3.tsx +1590 -1590
- package/src/aldehyde/tmpl/interface.tsx +919 -919
- package/src/aldehyde/tmpl/model-struc-v3.tsx +111 -111
- package/src/aldehyde/tmpl/superagent.js +146 -146
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +585 -585
- package/src/aldehyde/tmpl/web-socket.ts +366 -366
- package/src/aldehyde/tree/act-tree.tsx +217 -217
- package/src/aldehyde/tree/block-menu-auth-tree.tsx +189 -189
- package/src/aldehyde/tree/index.css +22 -22
- package/src/aldehyde/tree/navigation-tree.tsx +39 -39
- package/src/aldehyde/tree/tmpl-tree.tsx +751 -751
- package/src/aldehyde/tree/tree-node.tsx +73 -73
- package/src/aldehyde/tree/tree-utils.tsx +317 -317
- package/src/aldehyde/units/EncryptUtils.js +37 -37
- package/src/aldehyde/units/image.d.ts +7 -7
- package/src/aldehyde/units/index.tsx +1367 -1367
- package/src/aldehyde/units/storage.js +2 -2
- package/src/aldehyde/utils/dsu.ts +27 -27
- package/src/aldehyde/welcome/HCWelcome.js +404 -404
- package/src/aldehyde/welcome/HCWelcome1.js +259 -259
- package/src/aldehyde/welcome/components/menu-card.less +96 -96
- package/src/aldehyde/welcome/components/menu-card.tsx +70 -70
- package/src/aldehyde/welcome/components/page-card.less +49 -49
- package/src/aldehyde/welcome/components/page-card.tsx +97 -97
- package/src/aldehyde/welcome/components/quick-entrance.less +120 -120
- package/src/aldehyde/welcome/components/quick-entrance.tsx +80 -80
- package/src/aldehyde/welcome/components/user-menus.less +192 -192
- package/src/aldehyde/welcome/components/user-menus.tsx +279 -279
- package/src/aldehyde/welcome/components/workbench.less +118 -118
- package/src/aldehyde/welcome/components/workbench.tsx +146 -146
- package/src/aldehyde/welcome/index.css +13 -13
|
@@ -1,1831 +1,1831 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Button, Card, Checkbox, Col, Divider, Popover, Row, Space, Drawer, Tooltip,
|
|
4
|
-
message, Layout, Table, Form as AntdForm, FormInstance, Modal, Input, Alert, Tabs, Radio, Typography
|
|
5
|
-
} from "antd";
|
|
6
|
-
import {
|
|
7
|
-
ExportOutlined, FundOutlined, LineChartOutlined,
|
|
8
|
-
PlusCircleOutlined, PlusOutlined, ReloadOutlined, RetweetOutlined, SearchOutlined,
|
|
9
|
-
TableOutlined, ImportOutlined
|
|
10
|
-
} from "@ant-design/icons";
|
|
11
|
-
import _ from "lodash";
|
|
12
|
-
import "./index.css";
|
|
13
|
-
import {
|
|
14
|
-
ActTableMode, ActTableViewModel, AggregateVO, ClassAddConfig, ColumnConfig,
|
|
15
|
-
CustomButton, CustomButtonConfig, DoEditParam, DtmplData, JumpConfig, LtmplConfig, QueryKey,
|
|
16
|
-
SelectedRow, ShowViewParam, TmplBaseProps,
|
|
17
|
-
} from "../tmpl/interface";
|
|
18
|
-
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
19
|
-
import HCDataSource from "../tmpl/hc-data-source";
|
|
20
|
-
import QueryTable from "./query-table";
|
|
21
|
-
import CriteriaForm from "./../form/criteria-form";
|
|
22
|
-
import ProgramConfig from "../units";
|
|
23
|
-
import ColumnSelector from "./column/column-selector";
|
|
24
|
-
import ExportFrame, { ExportType, ExportMode } from "../export/export-frame";
|
|
25
|
-
import L2ActTable from "./l2-act-table";
|
|
26
|
-
import Restat from "./stat/restat";
|
|
27
|
-
import CollapseCard from "../controls/collapse-card";
|
|
28
|
-
import ToolTipBar from "../detail/tooltipbar";
|
|
29
|
-
import { LocaleContext } from "../locale/LocaleProvider";
|
|
30
|
-
import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
|
|
31
|
-
import ModelSelectTable from "./../table/modal-select-table";
|
|
32
|
-
import ColumnBuilder from "./column/column-builder";
|
|
33
|
-
import ReportTable from "./report-table";
|
|
34
|
-
import EntryControl from "../controls/entry-control";
|
|
35
|
-
import DraggableModal from "../module/draggable-modal";
|
|
36
|
-
import Icon from "../icon/aliIcon";
|
|
37
|
-
import PageConfigButton from "./page-config-button";
|
|
38
|
-
import { defPageSizeOptions } from "./pagination"; // 默认分页数
|
|
39
|
-
|
|
40
|
-
const { Content, Sider } = Layout;
|
|
41
|
-
const { Text } = Typography;
|
|
42
|
-
|
|
43
|
-
type Level = "l1" | "l2";
|
|
44
|
-
|
|
45
|
-
const enumTypes = ["select", "multiselect", "texttags", "checkbox", "radio", "steps"];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const defaultDisabledColIds: string[] = ["20000", "10000"];
|
|
49
|
-
|
|
50
|
-
interface ActTableProps extends TmplBaseProps {
|
|
51
|
-
criteriaData: object;
|
|
52
|
-
pageNo: number;
|
|
53
|
-
pageSize: number;
|
|
54
|
-
onChangePage: (pageNo: number, pageSize: number, pageSizeOptions?: number[]) => void;
|
|
55
|
-
ltmplConfig: LtmplConfig;
|
|
56
|
-
menuId?: string;
|
|
57
|
-
showView?: (showVievParam: ShowViewParam) => void;
|
|
58
|
-
doCreate?: (addtmplId: string, toCustomPage: boolean) => void;
|
|
59
|
-
customCreatable?: boolean;
|
|
60
|
-
doEdit?: (doEditParam: DoEditParam) => void;
|
|
61
|
-
customEditable?: boolean;
|
|
62
|
-
doDelete?: (code: string) => void;
|
|
63
|
-
doSearch?: (params: object) => void;
|
|
64
|
-
doRAction?: (ractionId: string, mainCode: string) => void;
|
|
65
|
-
level?: Level;
|
|
66
|
-
funcMode?: ActTableMode;
|
|
67
|
-
title?: ReactNode;
|
|
68
|
-
tip?: any;
|
|
69
|
-
collapsible?: boolean;
|
|
70
|
-
initCollapse?: boolean;
|
|
71
|
-
readOnly?: boolean;
|
|
72
|
-
tableType?: "common" | "report" | "select";
|
|
73
|
-
operatable?: boolean;
|
|
74
|
-
onSelectChange?: (val: { selectedRows: SelectedRow[], selectedDatas: DtmplData[] }) => void;
|
|
75
|
-
defShowType?: ActTableViewModel; // 默认视图
|
|
76
|
-
showPagination?: boolean; // 是否显示分页
|
|
77
|
-
showAggregates?: boolean; // 是否显示统计数据
|
|
78
|
-
userPageConfig?: { [key: string]: any }; // 用户页面配置本地缓存
|
|
79
|
-
setUserPageConfig?: (config: { [key: string]: any }) => void; // 更新用户页面配置本地缓存
|
|
80
|
-
resetUserPageConfig?: () => void; // 重置用户页面配置本地缓存
|
|
81
|
-
allowUserConfig?: boolean; // 是否可用户自定义配置
|
|
82
|
-
deleteCallback?: (val: object) => void; // 删除回调
|
|
83
|
-
onUpdatePageSizeOptions?: (val: number[]) => void; // 更新分页数数组
|
|
84
|
-
showEmpty?: boolean; // 空数据是否显示空状态,默认显示
|
|
85
|
-
loadDataCallback?: (val: object[]) => void; // 请求数据回调函数
|
|
86
|
-
doEdit2D?: (val: string) => void; // 2D图编辑
|
|
87
|
-
doView2D?: (val: string) => void; // 2D图查看
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
interface ActTableStat {
|
|
91
|
-
sortedColConfigs?: ColumnConfig[];
|
|
92
|
-
queryKey?: QueryKey;
|
|
93
|
-
loading?: boolean;
|
|
94
|
-
selectedRows?: SelectedRow[];
|
|
95
|
-
selectedDatas?: DtmplData[];
|
|
96
|
-
hiddenColIds?: string[];
|
|
97
|
-
drillingColIds?: string[];
|
|
98
|
-
disabledColIds?: string[];
|
|
99
|
-
hiddenRowCodes?: string[];
|
|
100
|
-
viewModels?: ActTableViewModel[];
|
|
101
|
-
showL2ActTable?: boolean;
|
|
102
|
-
showL2Chart?: boolean;
|
|
103
|
-
recordCode?: string;
|
|
104
|
-
record?: DtmplData;
|
|
105
|
-
blockMenuTreeDrawerOpen?: boolean;
|
|
106
|
-
showCustomCard?: boolean;
|
|
107
|
-
customButton?: CustomButton;
|
|
108
|
-
customButtonData?: DtmplData[];
|
|
109
|
-
showRatmplSelector?: boolean;
|
|
110
|
-
aggregateVO?: AggregateVO;
|
|
111
|
-
restatParams?: object;
|
|
112
|
-
pageInfo?: object;
|
|
113
|
-
ltreeData?: object;
|
|
114
|
-
userCriteriaData: object;
|
|
115
|
-
editings: string[]; // 行内编辑code
|
|
116
|
-
delModalOpen?: boolean; // 强删除弹窗是否打开
|
|
117
|
-
tabsOptions?: { key: string, value: string, label: React.ReactNode, title?: string, id?: string, ids?: string[] }[]; // tabs选项
|
|
118
|
-
tabActiveKey?: string; // Tabs选中项
|
|
119
|
-
pageSizeOptions?: number[]; // 设备分页数
|
|
120
|
-
customDrawerSize?: number | string; // 自定义页面抽屉宽度
|
|
121
|
-
}
|
|
122
|
-
let serial_number = new Date().getTime();
|
|
123
|
-
let busyReminderTime = 0;
|
|
124
|
-
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
125
|
-
state = {
|
|
126
|
-
//tableColumns: undefined,
|
|
127
|
-
sortedColConfigs: undefined,
|
|
128
|
-
queryKey: undefined,
|
|
129
|
-
loading: true,
|
|
130
|
-
disableCols: undefined,
|
|
131
|
-
hiddenColIds: defaultDisabledColIds,
|
|
132
|
-
selectedRows: [],
|
|
133
|
-
selectedDatas: [],
|
|
134
|
-
hiddenRowCodes: [],
|
|
135
|
-
viewModels: [],
|
|
136
|
-
drillingColIds: undefined,
|
|
137
|
-
disabledColIds: undefined,
|
|
138
|
-
showL2ActTable: false,
|
|
139
|
-
showL2Chart: false,
|
|
140
|
-
recordCode: undefined,
|
|
141
|
-
record: undefined,
|
|
142
|
-
blockMenuTreeDrawerOpen: false,
|
|
143
|
-
showCustomCard: false,
|
|
144
|
-
customButtonData: undefined,
|
|
145
|
-
customButton: undefined,
|
|
146
|
-
showRatmplSelector: false,
|
|
147
|
-
aggregateVO: undefined,
|
|
148
|
-
restatParams: undefined,
|
|
149
|
-
pageInfo: { pageNo: 1, pageSize: 10 },
|
|
150
|
-
ltreeData: {},
|
|
151
|
-
userCriteriaData: undefined,
|
|
152
|
-
editings: [], // 行内编辑code
|
|
153
|
-
delModalOpen: false, // 强删除弹窗是否打开
|
|
154
|
-
tabsOptions: [],
|
|
155
|
-
tabActiveKey: "all",
|
|
156
|
-
pageSizeOptions: defPageSizeOptions,
|
|
157
|
-
customDrawerSize: undefined
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
static contextType = LocaleContext;
|
|
161
|
-
context: React.ContextType<typeof LocaleContext>;
|
|
162
|
-
formRef = React.createRef<FormInstance>(); // 可编辑表格的form Ref
|
|
163
|
-
|
|
164
|
-
static defaultProps = {
|
|
165
|
-
criteriaData: {},
|
|
166
|
-
funcMode: "complete",
|
|
167
|
-
collapsible: false,
|
|
168
|
-
initCollapse: false,
|
|
169
|
-
readOnly: false,
|
|
170
|
-
operatable: true,
|
|
171
|
-
showPagination: true,
|
|
172
|
-
showAggregates: true,
|
|
173
|
-
showEmpty: true,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
// 获取标签选项
|
|
177
|
-
getTabsOptions = async () => {
|
|
178
|
-
const { ltmplConfig, criteriaData, sourceId } = this.props;
|
|
179
|
-
const { translate } = this.context;
|
|
180
|
-
const { split2TabCriteria, showSplitTabDataCount } = ltmplConfig || {};
|
|
181
|
-
if (!split2TabCriteria) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
const allIds = [];
|
|
185
|
-
let groupCount = [];
|
|
186
|
-
if (showSplitTabDataCount) {
|
|
187
|
-
groupCount = await HcserviceV3.getLtmplDataGroupCount(sourceId);
|
|
188
|
-
}
|
|
189
|
-
const options = split2TabCriteria.map(fieldConfig => {
|
|
190
|
-
const id = `c_${fieldConfig.id}`;
|
|
191
|
-
allIds.push(id);
|
|
192
|
-
if (enumTypes.includes(fieldConfig.controlType || fieldConfig.extControlType)) {
|
|
193
|
-
const items = HCDataSource.getEnums(fieldConfig.mstrucId);
|
|
194
|
-
const options = items.map((item) => {
|
|
195
|
-
const count = groupCount.find(r => r[0]?.fieldId === fieldConfig.id && r[0]?.value === item.title)?.[1]?.value;
|
|
196
|
-
const countVal = (count || count === 0) ? ` (${count})` : "";
|
|
197
|
-
return {
|
|
198
|
-
label: <span style={{ padding: "0 10px" }}>{translate("${" + item.title + "}")}{countVal}</span>,
|
|
199
|
-
key: item.value,
|
|
200
|
-
id,
|
|
201
|
-
title: translate("${" + item.title + "}") + countVal,
|
|
202
|
-
value: item.value
|
|
203
|
-
};
|
|
204
|
-
});
|
|
205
|
-
if (fieldConfig.relDeduplication && fieldConfig.exceptCodes?.length) {
|
|
206
|
-
return options.filter(item => !fieldConfig.exceptCodes.includes(item.key));
|
|
207
|
-
}
|
|
208
|
-
return options;
|
|
209
|
-
}
|
|
210
|
-
if ([fieldConfig.controlType, fieldConfig.extControlType].includes("single-checkbox")) {
|
|
211
|
-
const count = groupCount.find(r => r[0]?.fieldId === fieldConfig.id)?.[1]?.value;
|
|
212
|
-
const countVal = (count || count === 0) ? ` (${count})` : "";
|
|
213
|
-
return [{
|
|
214
|
-
label: <span style={{ padding: "0 10px" }}>{translate("${" + fieldConfig.title + "}")}{countVal}</span>,
|
|
215
|
-
key: "1",
|
|
216
|
-
id,
|
|
217
|
-
title: translate("${" + fieldConfig.title + "}") + countVal,
|
|
218
|
-
value: "1",
|
|
219
|
-
}];
|
|
220
|
-
}
|
|
221
|
-
return [];
|
|
222
|
-
})?.flat() || [];
|
|
223
|
-
const defOption = {
|
|
224
|
-
label: <span style={{ padding: "0 10px" }}>{translate("${全部}")}</span>,
|
|
225
|
-
key: "all",
|
|
226
|
-
ids: allIds,
|
|
227
|
-
title: translate("${全部}"),
|
|
228
|
-
value: "all"
|
|
229
|
-
};
|
|
230
|
-
const temId = Object.keys(criteriaData).find(r => allIds.includes(r));
|
|
231
|
-
const tabActiveKey = temId ? criteriaData[temId] : "all";
|
|
232
|
-
this.setState({ tabsOptions: [defOption, ...options], tabActiveKey });
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
loadData = async (
|
|
236
|
-
hiddenColIds: string[],
|
|
237
|
-
hiddenRowCodes: string[],
|
|
238
|
-
sortedColConfigs: ColumnConfig[]
|
|
239
|
-
) => {
|
|
240
|
-
const {
|
|
241
|
-
sourceId, criteriaData, ltmplConfig,
|
|
242
|
-
mainCode, level, pageNo, pageSize, serverKey, defShowType, userPageConfig
|
|
243
|
-
} = this.props;
|
|
244
|
-
|
|
245
|
-
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
246
|
-
return
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
if (!ltmplConfig) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
// 处理菜单切换,查询条件清空,重置tab拆解条件选中项
|
|
254
|
-
const tabActiveKey = ltmplConfig.split2TabCriteria?.find(r => criteriaData[`c_${r.id}`])?.id;
|
|
255
|
-
this.setState({
|
|
256
|
-
loading: true,
|
|
257
|
-
userCriteriaData: criteriaData,
|
|
258
|
-
tabActiveKey: tabActiveKey ? criteriaData[`c_${tabActiveKey}`] : "all"
|
|
259
|
-
});
|
|
260
|
-
let disabledColIds: string[] = [];
|
|
261
|
-
let hiddenColIds_ = [...hiddenColIds];
|
|
262
|
-
if (criteriaData && criteriaData["drillingColIds"]) {
|
|
263
|
-
let dColIds = [...criteriaData["drillingColIds"]];
|
|
264
|
-
ltmplConfig.columns.forEach((item) => {
|
|
265
|
-
if (
|
|
266
|
-
item.statColType == "dimension" &&
|
|
267
|
-
!dColIds.includes(item.id) &&
|
|
268
|
-
!hiddenColIds_.includes(item.id)
|
|
269
|
-
) {
|
|
270
|
-
hiddenColIds_.push(item.id);
|
|
271
|
-
disabledColIds.push(item.id);
|
|
272
|
-
}
|
|
273
|
-
if (
|
|
274
|
-
item.statColType == "dimension" &&
|
|
275
|
-
!dColIds.includes(item.id) &&
|
|
276
|
-
!disabledColIds.includes(item.id)
|
|
277
|
-
) {
|
|
278
|
-
disabledColIds.push(item.id);
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
hiddenColIds_ = hiddenColIds_.filter((id) => {
|
|
282
|
-
return !dColIds.includes(id);
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
ltmplConfig.columns.forEach((item) => {
|
|
286
|
-
if (item.hidden) {
|
|
287
|
-
hiddenColIds_.push(item.id);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
/** 构建column **/
|
|
291
|
-
const { defaultPageSize, showType } = ltmplConfig;
|
|
292
|
-
|
|
293
|
-
let pageInfo = {
|
|
294
|
-
pageNo: pageNo || 1,
|
|
295
|
-
pageSize: pageSize || defaultPageSize || 10,
|
|
296
|
-
virtualEndPageNo: undefined,
|
|
297
|
-
};
|
|
298
|
-
const viewModels = this.state.viewModels.length > 0 ? this.state.viewModels : (userPageConfig?.["viewModels"] || [defShowType || showType || "table"]);
|
|
299
|
-
|
|
300
|
-
/** 构建 dataSource **/
|
|
301
|
-
//构建过滤条件
|
|
302
|
-
const params = { ...criteriaData, ...pageInfo, mainCode };
|
|
303
|
-
let queryKey: QueryKey;
|
|
304
|
-
if (level && level === "l2") {
|
|
305
|
-
queryKey = await HcserviceV3.requestL2LtmplQueryKey(serverKey, sourceId, params);
|
|
306
|
-
} else {
|
|
307
|
-
if (viewModels.includes("ganttChart")) {
|
|
308
|
-
queryKey = await HcserviceV3.requestGttRootQueryKey(serverKey, sourceId, params);
|
|
309
|
-
} else {
|
|
310
|
-
queryKey = await HcserviceV3.requestLtmplQueryKey(serverKey, sourceId, params);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (!queryKey.sourceId || queryKey.sourceId == this.props.sourceId) {
|
|
315
|
-
this.setState({
|
|
316
|
-
pageInfo,
|
|
317
|
-
disabledColIds, hiddenColIds: hiddenColIds_, hiddenRowCodes,
|
|
318
|
-
sortedColConfigs, queryKey, showL2Chart: false, selectedRows: [], selectedDatas: [],
|
|
319
|
-
viewModels
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
this.setState({
|
|
323
|
-
loading: false,
|
|
324
|
-
});
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
doCustomButton = async (customButton: CustomButton, records: DtmplData[]) => {
|
|
328
|
-
if (!this.buttonClickable()) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
const { serverKey, sourceId } = this.props;
|
|
332
|
-
let doType = customButton.doType;
|
|
333
|
-
let config: CustomButtonConfig = ProgramConfig.getCustomButtonConfig(customButton.id);
|
|
334
|
-
if ("request_refresh" == doType) {
|
|
335
|
-
if (config && config.doAction) {
|
|
336
|
-
await config.doAction(customButton, records);
|
|
337
|
-
} else if (config && config.getRequestUrl) {
|
|
338
|
-
let url = await config.getRequestUrl(customButton, records);
|
|
339
|
-
await HcserviceV3.doPostRequest(serverKey, url);
|
|
340
|
-
} else if (customButton.path) {
|
|
341
|
-
let codes = [];
|
|
342
|
-
let res = undefined;
|
|
343
|
-
if (records != null) {
|
|
344
|
-
records.forEach(item => {
|
|
345
|
-
codes.push(item.code)
|
|
346
|
-
})
|
|
347
|
-
}
|
|
348
|
-
if (customButton.requestMethod === "get") {
|
|
349
|
-
res = await HcserviceV3.doGetRequest(serverKey, customButton.path, { codes });
|
|
350
|
-
} else {
|
|
351
|
-
res = await HcserviceV3.doPostRequest(serverKey, customButton.path, { codes });
|
|
352
|
-
}
|
|
353
|
-
if (res?.msg || res?.message) {
|
|
354
|
-
message.info(res.msg || res.message);
|
|
355
|
-
}
|
|
356
|
-
} else {
|
|
357
|
-
message.error("Button Config Error");
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
this.doSearchDirect(null);
|
|
361
|
-
} else if ("show_window" == doType) {
|
|
362
|
-
this.setState({
|
|
363
|
-
showCustomCard: true,
|
|
364
|
-
customButton,
|
|
365
|
-
customButtonData: records,
|
|
366
|
-
});
|
|
367
|
-
} else {
|
|
368
|
-
message.error("Unsuport Button dotype " + doType);
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
renderAboveCustomPage = () => {
|
|
373
|
-
return this.renderCustomPage("above-table");
|
|
374
|
-
};
|
|
375
|
-
|
|
376
|
-
renderOhterCustomPage = () => {
|
|
377
|
-
return (
|
|
378
|
-
<>
|
|
379
|
-
{this.renderCustomPage("under-table")}
|
|
380
|
-
{this.renderCustomPage("modal-window")}
|
|
381
|
-
{this.renderCustomPage("left-drawer")}
|
|
382
|
-
{this.renderCustomPage("right-drawer")}
|
|
383
|
-
</>
|
|
384
|
-
);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
renderCustomPage = (
|
|
388
|
-
windowPosition:
|
|
389
|
-
| "under-table"
|
|
390
|
-
| "above-table"
|
|
391
|
-
| "modal-window"
|
|
392
|
-
| "left-drawer"
|
|
393
|
-
| "right-drawer"
|
|
394
|
-
) => {
|
|
395
|
-
const { translate } = this.context;
|
|
396
|
-
const { customButton, customButtonData, customDrawerSize } = this.state;
|
|
397
|
-
|
|
398
|
-
if (!customButton) {
|
|
399
|
-
return "";
|
|
400
|
-
}
|
|
401
|
-
if (windowPosition && windowPosition != customButton.windowPosition) {
|
|
402
|
-
return "";
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
let customProps = {
|
|
406
|
-
customButton: customButton, data: customButtonData,
|
|
407
|
-
onOk: () => { this.actTableDoSearch(null) }
|
|
408
|
-
, onclose: () => {
|
|
409
|
-
this.setState({ customButton: undefined });
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
let config: CustomButtonConfig = ProgramConfig.getCustomButtonConfig(customButton.id);
|
|
414
|
-
let page;
|
|
415
|
-
if (config && config.getCurrentPage) {
|
|
416
|
-
page = config.getCurrentPage(customButton, customButtonData);
|
|
417
|
-
}
|
|
418
|
-
if (!page) {
|
|
419
|
-
page = ProgramConfig.getCustomPage(customButton.id);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (!page) {
|
|
423
|
-
message.error("Not found CustomButton Page");
|
|
424
|
-
this.setState({
|
|
425
|
-
customButton: undefined
|
|
426
|
-
})
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
let customElement = React.createElement(page, customProps);
|
|
431
|
-
if (
|
|
432
|
-
customButton.windowPosition == "under-table" ||
|
|
433
|
-
customButton.windowPosition == "above-table"
|
|
434
|
-
) {
|
|
435
|
-
return (
|
|
436
|
-
<Card
|
|
437
|
-
id={"CustomCard" + customButton.id}
|
|
438
|
-
size={"small"}
|
|
439
|
-
style={{ marginTop: "6px" }}
|
|
440
|
-
extra={
|
|
441
|
-
<Button
|
|
442
|
-
size={"small"}
|
|
443
|
-
danger={true}
|
|
444
|
-
onClick={() => {
|
|
445
|
-
this.setState({ customButton: undefined });
|
|
446
|
-
}}
|
|
447
|
-
>
|
|
448
|
-
{translate("${关闭}")}
|
|
449
|
-
</Button>
|
|
450
|
-
}
|
|
451
|
-
>
|
|
452
|
-
{customElement}
|
|
453
|
-
</Card>
|
|
454
|
-
);
|
|
455
|
-
} else if (
|
|
456
|
-
customButton.windowPosition == "left-drawer" ||
|
|
457
|
-
customButton.windowPosition == "right-drawer"
|
|
458
|
-
) {
|
|
459
|
-
return (
|
|
460
|
-
<Drawer
|
|
461
|
-
open={true}
|
|
462
|
-
id={"CustomCard" + customButton.id}
|
|
463
|
-
placement={
|
|
464
|
-
customButton.windowPosition == "right-drawer" ? "right" : "left"
|
|
465
|
-
}
|
|
466
|
-
resizable={{ onResize: (newSize => this.setState({ customDrawerSize: newSize })) }}
|
|
467
|
-
size={customDrawerSize !== undefined ? customDrawerSize : customButton.windowWidth}
|
|
468
|
-
onClose={() => {
|
|
469
|
-
this.setState({ customButton: undefined });
|
|
470
|
-
}}
|
|
471
|
-
styles={{ body: { minWidth: customButton.windowWidth } }}
|
|
472
|
-
>
|
|
473
|
-
{customElement}
|
|
474
|
-
</Drawer>
|
|
475
|
-
);
|
|
476
|
-
} else if (customButton.windowPosition == "modal-window") {
|
|
477
|
-
return (
|
|
478
|
-
<DraggableModal
|
|
479
|
-
open={true}
|
|
480
|
-
closable={true}
|
|
481
|
-
width={customButton.windowWidth}
|
|
482
|
-
style={{ height: customButton.windowHeight }}
|
|
483
|
-
onCancel={() => {
|
|
484
|
-
this.setState({ customButton: undefined });
|
|
485
|
-
}}
|
|
486
|
-
>
|
|
487
|
-
{customElement}
|
|
488
|
-
</DraggableModal>
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
async componentDidMount() {
|
|
495
|
-
const { ltmplConfig, tableType, userPageConfig, defShowType, onUpdatePageSizeOptions, setUserPageConfig, pageSize } = this.props;
|
|
496
|
-
const { sortedColIds } = userPageConfig || {};
|
|
497
|
-
const { translate } = this.context;
|
|
498
|
-
let sortedColConfigs = undefined;
|
|
499
|
-
if (ltmplConfig) {
|
|
500
|
-
sortedColConfigs = tableType == 'report' ? ltmplConfig.columns : [
|
|
501
|
-
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
502
|
-
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
503
|
-
...ltmplConfig.columns,
|
|
504
|
-
];
|
|
505
|
-
if (sortedColIds) { // 使用缓存的列排序
|
|
506
|
-
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
507
|
-
}
|
|
508
|
-
const temViewModels = userPageConfig?.["viewModels"] || [defShowType || ltmplConfig?.showType || "table"];
|
|
509
|
-
this.setState({ viewModels: temViewModels });
|
|
510
|
-
if (onUpdatePageSizeOptions && temViewModels.includes("cardList")) { // 初始化是卡片视图,则更新父组件中分页数组
|
|
511
|
-
const temPageSizes = Array.from({ length: 7 }, (_, i) => ltmplConfig.rowCardCount * Math.pow(2, i));
|
|
512
|
-
onUpdatePageSizeOptions(temPageSizes);
|
|
513
|
-
if (setUserPageConfig && !(userPageConfig?.pageSize >= 0)) setUserPageConfig({ pageSize: 1 });
|
|
514
|
-
this.setState({ pageSizeOptions: temPageSizes, sortedColConfigs });
|
|
515
|
-
} else {
|
|
516
|
-
this.loadData(userPageConfig?.hiddenColIds || defaultDisabledColIds, [], sortedColConfigs);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
this.getTabsOptions();
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
// 卡片列表-更新列表分页数
|
|
523
|
-
handleCardListPageSize(preViewModels, viewModels) {
|
|
524
|
-
const { ltmplConfig, onChangePage, pageSize, pageNo } = this.props;
|
|
525
|
-
const { defaultPageSize } = ltmplConfig || {};
|
|
526
|
-
const preIsCard = preViewModels.includes("cardList");
|
|
527
|
-
const isCard = viewModels.includes("cardList");
|
|
528
|
-
let temPageSizes = defPageSizeOptions;
|
|
529
|
-
let temPageSize = defaultPageSize;
|
|
530
|
-
if ((!preIsCard && !isCard) || (preIsCard && isCard)) {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
if (!preIsCard && isCard) { // 普通切换到Card
|
|
534
|
-
temPageSizes = Array.from({ length: 7 }, (_, i) => ltmplConfig.rowCardCount * Math.pow(2, i));
|
|
535
|
-
temPageSize = temPageSizes.includes(Number(pageSize)) ? pageSize : (temPageSizes.includes(Number(defaultPageSize)) ? defaultPageSize : temPageSizes[1]);
|
|
536
|
-
} else if (preIsCard && !isCard) { // card切换到普通
|
|
537
|
-
temPageSize = defPageSizeOptions.includes(Number(pageSize)) ? pageSize : (defPageSizeOptions.includes(Number(defaultPageSize)) ? defaultPageSize : defPageSizeOptions[1]);
|
|
538
|
-
}
|
|
539
|
-
this.setState({ pageSizeOptions: temPageSizes });
|
|
540
|
-
onChangePage(pageNo || 1, temPageSize, temPageSizes);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
async componentDidUpdate(prevProps, prevState) {
|
|
544
|
-
const { sourceId, criteriaData, ltmplConfig, tableType, pageSize, pageNo, userPageConfig, defShowType } = this.props;
|
|
545
|
-
// const {userCriteriaData:preUserCriteriaData}=prevState;
|
|
546
|
-
const { userCriteriaData } = this.state;
|
|
547
|
-
const { translate } = this.context;
|
|
548
|
-
let {
|
|
549
|
-
ltmplConfig: preLtmplConfig,
|
|
550
|
-
criteriaData: preCriteriaData,
|
|
551
|
-
sourceId: preSourceId, pageSize: prePageSize, pageNo: prePageNo,
|
|
552
|
-
userPageConfig: preUserPageConfig
|
|
553
|
-
} = prevProps;
|
|
554
|
-
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
555
|
-
return false;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
if (prePageSize != pageSize || pageNo != prePageNo) {
|
|
559
|
-
this.setState({
|
|
560
|
-
pageInfo: { pageNo, pageSize },
|
|
561
|
-
userCriteriaData: criteriaData,
|
|
562
|
-
})
|
|
563
|
-
}
|
|
564
|
-
if (!preUserPageConfig && userPageConfig) {
|
|
565
|
-
this.setState({ viewModels: userPageConfig?.["viewModels"] || [defShowType || ltmplConfig?.showType || "table"] });
|
|
566
|
-
}
|
|
567
|
-
if (!_.isEqual(prevState.viewModels, this.state.viewModels)) { // 显示视图变化-更改卡片列表分页条数
|
|
568
|
-
this.handleCardListPageSize(prevState.viewModels, this.state.viewModels);
|
|
569
|
-
}
|
|
570
|
-
let { hiddenColIds, sortedColConfigs } = this.state;
|
|
571
|
-
let currentQueryParams = ProgramConfig.transQueryParamsToStr(criteriaData, false, [
|
|
572
|
-
"pageSize",
|
|
573
|
-
"pageNo",
|
|
574
|
-
]);
|
|
575
|
-
let preCurrentQueryParams = ProgramConfig.transQueryParamsToStr(userCriteriaData, false, [
|
|
576
|
-
"pageSize",
|
|
577
|
-
"pageNo",
|
|
578
|
-
]);
|
|
579
|
-
if ((sourceId && preSourceId != sourceId) ||
|
|
580
|
-
(ltmplConfig &&
|
|
581
|
-
(!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id)) ||
|
|
582
|
-
((currentQueryParams != preCurrentQueryParams) &&
|
|
583
|
-
(!criteriaData['menuId'] || preCriteriaData.menuId == criteriaData['menuId']))
|
|
584
|
-
) {
|
|
585
|
-
//5秒后允许再次请求数据
|
|
586
|
-
//refresh=false;
|
|
587
|
-
if (preLtmplConfig && ltmplConfig.id == preLtmplConfig.id) {
|
|
588
|
-
await this.loadData(hiddenColIds, [], sortedColConfigs);
|
|
589
|
-
} else {
|
|
590
|
-
let sColConfigs = undefined;
|
|
591
|
-
const { sortedColIds } = userPageConfig || {};
|
|
592
|
-
if (ltmplConfig) {
|
|
593
|
-
sColConfigs = tableType == 'report' ? ltmplConfig.columns : [
|
|
594
|
-
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
595
|
-
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
596
|
-
...ltmplConfig.columns,
|
|
597
|
-
];
|
|
598
|
-
if (sortedColIds) { // 使用缓存的列排序
|
|
599
|
-
sColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
await this.loadData(userPageConfig?.hiddenColIds || defaultDisabledColIds, [], sColConfigs);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
} else {
|
|
606
|
-
return false;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
isSameSourceQuery = (sourceId, criteriaData) => {
|
|
611
|
-
if (sourceId && criteriaData && (criteriaData['sourceId'] && criteriaData['sourceId'] != sourceId)
|
|
612
|
-
|| (criteriaData['menuId'] && criteriaData['menuId'] != sourceId)) {
|
|
613
|
-
return false;
|
|
614
|
-
} else {
|
|
615
|
-
return true;
|
|
616
|
-
}
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
handleShowChart = () => {
|
|
620
|
-
this.setState({
|
|
621
|
-
showL2Chart: !this.state.showL2Chart,
|
|
622
|
-
});
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
handleDataAnalysis = () => {
|
|
626
|
-
this.setState({
|
|
627
|
-
showL2ActTable: !this.state.showL2ActTable,
|
|
628
|
-
});
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
unHiden = () => {
|
|
632
|
-
const { ltmplConfig } = this.props;
|
|
633
|
-
const { hiddenColIds, sortedColConfigs } = this.state;
|
|
634
|
-
this.setState({
|
|
635
|
-
hiddenRowCodes: [],
|
|
636
|
-
});
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
onHide = (code: string) => {
|
|
640
|
-
const { hiddenRowCodes } = this.state;
|
|
641
|
-
let hiddenCodes = [...hiddenRowCodes, code];
|
|
642
|
-
this.setState({
|
|
643
|
-
hiddenRowCodes: hiddenCodes,
|
|
644
|
-
});
|
|
645
|
-
};
|
|
646
|
-
|
|
647
|
-
changeViewModel = (viewModels) => {
|
|
648
|
-
const { setUserPageConfig } = this.props;
|
|
649
|
-
const { hiddenColIds, hiddenRowCodes, sortedColConfigs, viewModels: oldViewModels } = this.state;
|
|
650
|
-
setUserPageConfig({ viewModels });
|
|
651
|
-
this.setState({ viewModels }, () => {
|
|
652
|
-
if (viewModels.length && viewModels.includes("ganttChart") !== oldViewModels.includes("ganttChart")) {
|
|
653
|
-
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs); // 前后选择是否存在甘特图,刷新数据
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
changeHiddenColumns = (hiddenColIds: string[]) => {
|
|
659
|
-
const { setUserPageConfig } = this.props;
|
|
660
|
-
this.setState({ showL2Chart: false, hiddenColIds });
|
|
661
|
-
setUserPageConfig({ hiddenColIds });
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
665
|
-
const { selectedRows } = this.state;
|
|
666
|
-
this.doAction(actionId, selectedRows, params);
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
670
|
-
const { serverKey } = this.props;
|
|
671
|
-
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
672
|
-
this.setState({
|
|
673
|
-
loading: true,
|
|
674
|
-
});
|
|
675
|
-
let result: boolean = await HcserviceV3.postActions(
|
|
676
|
-
serverKey,
|
|
677
|
-
actionId,
|
|
678
|
-
selectedRows,
|
|
679
|
-
params
|
|
680
|
-
);
|
|
681
|
-
if (result) {
|
|
682
|
-
//重新加载数据
|
|
683
|
-
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
684
|
-
} else {
|
|
685
|
-
this.setState({
|
|
686
|
-
loading: false,
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
692
|
-
this.doAction(actionId, [{ title: undefined, code: codes[0] }], params);
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
doDelete = async () => {
|
|
696
|
-
const { sourceId, serverKey, mainCode } = this.props;
|
|
697
|
-
const {
|
|
698
|
-
selectedRows,
|
|
699
|
-
hiddenColIds,
|
|
700
|
-
hiddenRowCodes,
|
|
701
|
-
sortedColConfigs,
|
|
702
|
-
} = this.state;
|
|
703
|
-
this.setState({
|
|
704
|
-
loading: true,
|
|
705
|
-
});
|
|
706
|
-
let result: boolean = await HcserviceV3.deleteData(
|
|
707
|
-
serverKey,
|
|
708
|
-
sourceId,
|
|
709
|
-
selectedRows,
|
|
710
|
-
mainCode
|
|
711
|
-
);
|
|
712
|
-
if (result) {
|
|
713
|
-
//重新加载数据
|
|
714
|
-
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
715
|
-
} else {
|
|
716
|
-
this.setState({
|
|
717
|
-
loading: false,
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
};
|
|
721
|
-
|
|
722
|
-
doDeleteByCode = async (record: DtmplData) => {
|
|
723
|
-
const { sourceId, serverKey, mainCode, doDelete, deleteCallback } = this.props;
|
|
724
|
-
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
725
|
-
this.setState({
|
|
726
|
-
loading: true,
|
|
727
|
-
});
|
|
728
|
-
let result: boolean = await HcserviceV3.deleteByCode(
|
|
729
|
-
serverKey,
|
|
730
|
-
sourceId,
|
|
731
|
-
[record.code],
|
|
732
|
-
mainCode
|
|
733
|
-
);
|
|
734
|
-
if (result) {
|
|
735
|
-
//重新加载数据
|
|
736
|
-
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
737
|
-
doDelete && doDelete(record.code);
|
|
738
|
-
deleteCallback && deleteCallback(record);
|
|
739
|
-
this.setState({ loading: false, delModalOpen: false, recordCode: undefined, record: undefined });
|
|
740
|
-
} else {
|
|
741
|
-
this.setState({ loading: false });
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
|
|
745
|
-
doSelectedCQuery = async (cqueryId: string) => { };
|
|
746
|
-
|
|
747
|
-
doJump = async (jump: JumpConfig, record_: DtmplData) => {
|
|
748
|
-
let record = record_.fieldMap ? record_.fieldMap : record_;
|
|
749
|
-
const version = localStorage.getItem("version") || "";
|
|
750
|
-
|
|
751
|
-
let url = null;
|
|
752
|
-
let path = jump.path;
|
|
753
|
-
if (!path) {
|
|
754
|
-
path = "/";
|
|
755
|
-
}
|
|
756
|
-
//是否以http开头
|
|
757
|
-
if (path?.indexOf("#") == 0 || url?.indexOf("/#") == 0) {
|
|
758
|
-
url = "";
|
|
759
|
-
} else if (
|
|
760
|
-
path.indexOf("http://") == 0 ||
|
|
761
|
-
path.indexOf("HTTP://") == 0 ||
|
|
762
|
-
path.indexOf("https://") == 0 ||
|
|
763
|
-
path.indexOf("HTTPS://") == 0
|
|
764
|
-
) {
|
|
765
|
-
url = path.split("//")[0] + "//";
|
|
766
|
-
path = path.split("//")[1];
|
|
767
|
-
} else {
|
|
768
|
-
url = `/#/${version}`;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
//处理路由参数
|
|
772
|
-
let paths = path.split("/");
|
|
773
|
-
|
|
774
|
-
let routeParamConfigs = jump.routeParams;
|
|
775
|
-
if (routeParamConfigs) {
|
|
776
|
-
for (let i = 0; i < paths.length; i++) {
|
|
777
|
-
if (paths[i].indexOf(":") == 0) {
|
|
778
|
-
let pa = paths[i].substring(1);
|
|
779
|
-
//根据参数名匹配参数
|
|
780
|
-
for (let p of routeParamConfigs) {
|
|
781
|
-
if (p && pa == p.title) {
|
|
782
|
-
//赋值替换
|
|
783
|
-
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
784
|
-
paths[i] = v;
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
url = ProgramConfig.joinPath(url, paths.join("/"));
|
|
791
|
-
} else {
|
|
792
|
-
url = ProgramConfig.joinPath(url, path);
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
//处理search 参数
|
|
796
|
-
let searchParamConfigs = jump.searchParams;
|
|
797
|
-
let searchs = [];
|
|
798
|
-
//放入token
|
|
799
|
-
if (jump.tokenName) {
|
|
800
|
-
searchs[0] = jump.tokenName + "=" + ProgramConfig.hydrocarbonToken();
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
if (searchParamConfigs) {
|
|
804
|
-
let initSearchLength = searchs.length;
|
|
805
|
-
for (let i = 0; i < searchParamConfigs.length; i++) {
|
|
806
|
-
let p = searchParamConfigs[i];
|
|
807
|
-
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
808
|
-
if (!v && p.title == "code") {
|
|
809
|
-
v = record_.code;
|
|
810
|
-
}
|
|
811
|
-
searchs[initSearchLength + i] = p.title + "=" + v;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
if (searchs.length > 0) {
|
|
815
|
-
if (url.indexOf("?") != url.length - 1) {
|
|
816
|
-
url = url + "?";
|
|
817
|
-
}
|
|
818
|
-
url = url + searchs.join("&");
|
|
819
|
-
}
|
|
820
|
-
if (jump.linkTarget == '_self') {
|
|
821
|
-
window.location.hash = url.substring(url.indexOf("#") + 1);
|
|
822
|
-
} else {
|
|
823
|
-
debugger
|
|
824
|
-
if (url.indexOf("/#") == 0) {
|
|
825
|
-
// url=window.location.href.split("#/")[0]+url;
|
|
826
|
-
url = window.location.href.split("#/")[0] + url.substring(url.indexOf("/#") + 1);
|
|
827
|
-
}
|
|
828
|
-
window.open(url);
|
|
829
|
-
}
|
|
830
|
-
// if (
|
|
831
|
-
// url.indexOf("#") == 0 ||
|
|
832
|
-
// url.indexOf("/#") == 0 ||
|
|
833
|
-
// url.indexOf("//#") == 0
|
|
834
|
-
// ) {
|
|
835
|
-
// window.location.hash = url.substring(url.indexOf("#") + 1);
|
|
836
|
-
// } else {
|
|
837
|
-
// window.open(url);
|
|
838
|
-
// }
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
blockMenuTreeDrawerOpen = (record) => {
|
|
842
|
-
this.setState({
|
|
843
|
-
blockMenuTreeDrawerOpen: true,
|
|
844
|
-
recordCode: record.code,
|
|
845
|
-
record
|
|
846
|
-
})
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
doRowJump = async (jump: JumpConfig, record: DtmplData) => {
|
|
850
|
-
this.doJump(jump, record);
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
renderExportButton = (title, type: ExportType, sourceId?: string) => {
|
|
854
|
-
const { pageNo, pageSize, serverKey, ltmplConfig, tableType } = this.props;
|
|
855
|
-
|
|
856
|
-
//let buttons = ltmplConfig?.buttons;
|
|
857
|
-
|
|
858
|
-
const { queryKey } = this.state;
|
|
859
|
-
const { translate } = this.context;
|
|
860
|
-
let exportModes: ExportMode[] = tableType == "report" ?
|
|
861
|
-
["all"] : ["current", "page", "all"];
|
|
862
|
-
|
|
863
|
-
return (
|
|
864
|
-
<Popover
|
|
865
|
-
content={
|
|
866
|
-
<ExportFrame //导出组件
|
|
867
|
-
currentPage={{
|
|
868
|
-
pageNo: pageNo ? pageNo : 1,
|
|
869
|
-
pageSize: pageSize ? pageSize : ltmplConfig.defaultPageSize,
|
|
870
|
-
}}
|
|
871
|
-
exportModes={exportModes}
|
|
872
|
-
type={type}
|
|
873
|
-
serverKey={serverKey}
|
|
874
|
-
queryKey={queryKey}
|
|
875
|
-
sourceId={sourceId}
|
|
876
|
-
title={translate(
|
|
877
|
-
"${" + ltmplConfig.title + "}" + "-" + "${" + title + "}"
|
|
878
|
-
)}
|
|
879
|
-
/>
|
|
880
|
-
}
|
|
881
|
-
title={translate("${" + title + "}")}
|
|
882
|
-
placement="bottomRight"
|
|
883
|
-
trigger="click"
|
|
884
|
-
>
|
|
885
|
-
<Tooltip title={translate("${" + title + "}")}>
|
|
886
|
-
<Button
|
|
887
|
-
style={{
|
|
888
|
-
// marginLeft: "5px",
|
|
889
|
-
}}
|
|
890
|
-
//为了点击到没有导出模块,使组件不致销毁,丢失导出数据
|
|
891
|
-
>{type == "ltmpl-data-excel" ? <ExportOutlined /> : title}
|
|
892
|
-
</Button>
|
|
893
|
-
</Tooltip>
|
|
894
|
-
</Popover>
|
|
895
|
-
);
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
renderFileExportButton = () => {
|
|
899
|
-
const { ltmplConfig } = this.props;
|
|
900
|
-
let fileExports = ltmplConfig?.topFileExports;
|
|
901
|
-
if (fileExports) {
|
|
902
|
-
return fileExports.map((fileExport) => {
|
|
903
|
-
return this.renderExportButton(
|
|
904
|
-
fileExport.title,
|
|
905
|
-
"ltmpl-data-filedata",
|
|
906
|
-
fileExport.id
|
|
907
|
-
);
|
|
908
|
-
});
|
|
909
|
-
} else {
|
|
910
|
-
return <></>;
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
doSelectedJump = async (jump: JumpConfig) => {
|
|
915
|
-
const { selectedDatas } = this.state;
|
|
916
|
-
if (selectedDatas.length == 1) {
|
|
917
|
-
this.doJump(jump, selectedDatas[0]);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
changeRowSelection = (
|
|
922
|
-
selectedRows: SelectedRow[],
|
|
923
|
-
selectedDatas: DtmplData[]
|
|
924
|
-
) => {
|
|
925
|
-
const { onSelectChange } = this.props;
|
|
926
|
-
this.setState({ selectedRows, selectedDatas });
|
|
927
|
-
if (onSelectChange) {
|
|
928
|
-
onSelectChange({ selectedRows, selectedDatas });
|
|
929
|
-
}
|
|
930
|
-
};
|
|
931
|
-
|
|
932
|
-
onChangeColSort = (sortedColConfigs: ColumnConfig[]) => {
|
|
933
|
-
const { setUserPageConfig } = this.props;
|
|
934
|
-
this.setState({ sortedColConfigs });
|
|
935
|
-
const sortedColIds = sortedColConfigs.map(r => r.id);
|
|
936
|
-
setUserPageConfig({ sortedColIds });
|
|
937
|
-
};
|
|
938
|
-
|
|
939
|
-
// 更新本地缓存列宽度
|
|
940
|
-
onChangeResize = (colResize: { [key: string]: number }) => {
|
|
941
|
-
const { setUserPageConfig, userPageConfig } = this.props;
|
|
942
|
-
const oldColResize = userPageConfig?.colResize || {};
|
|
943
|
-
setUserPageConfig({ colResize: { ...oldColResize, ...colResize } });
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
getAddTmplButton = (classAddConfigs: ClassAddConfig[]) => {
|
|
947
|
-
const { translate } = this.context;
|
|
948
|
-
if (classAddConfigs && classAddConfigs.length < 1) {
|
|
949
|
-
return translate("${没有分类添加按钮}");
|
|
950
|
-
}
|
|
951
|
-
return classAddConfigs.map((config) => {
|
|
952
|
-
return (
|
|
953
|
-
<p>
|
|
954
|
-
<Button
|
|
955
|
-
size={"small"}
|
|
956
|
-
type={"text"}
|
|
957
|
-
onClick={() => this.props.doCreate(config.id, false)}
|
|
958
|
-
>
|
|
959
|
-
{config.title}
|
|
960
|
-
</Button>
|
|
961
|
-
</p>
|
|
962
|
-
);
|
|
963
|
-
});
|
|
964
|
-
};
|
|
965
|
-
|
|
966
|
-
// 重置当前页面配置
|
|
967
|
-
handleResetUserPageConfig = () => {
|
|
968
|
-
const { resetUserPageConfig, ltmplConfig, tableType, defShowType } = this.props;
|
|
969
|
-
const { translate } = this.context;
|
|
970
|
-
let sortedColConfigs = undefined;
|
|
971
|
-
if (ltmplConfig) {
|
|
972
|
-
sortedColConfigs = tableType === 'report' ? ltmplConfig.columns : [
|
|
973
|
-
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
974
|
-
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
975
|
-
...ltmplConfig.columns,
|
|
976
|
-
];
|
|
977
|
-
}
|
|
978
|
-
this.setState({ viewModels: [defShowType || ltmplConfig.showType || "table"], hiddenColIds: defaultDisabledColIds, sortedColConfigs });
|
|
979
|
-
resetUserPageConfig();
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
// 更新当前页面配置
|
|
983
|
-
handleUpdateUserPageConfig = (val: { [key: string]: any }) => {
|
|
984
|
-
const { sortedColIds, hiddenColIds, viewModels, criteriaData } = val || {};
|
|
985
|
-
const { setUserPageConfig, ltmplConfig, tableType, defShowType, menuId } = this.props;
|
|
986
|
-
const { userCriteriaData } = this.state;
|
|
987
|
-
const { translate } = this.context;
|
|
988
|
-
let sortedColConfigs = undefined;
|
|
989
|
-
if (ltmplConfig) {
|
|
990
|
-
sortedColConfigs = tableType === 'report' ? ltmplConfig.columns : [
|
|
991
|
-
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
992
|
-
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
993
|
-
...ltmplConfig.columns,
|
|
994
|
-
];
|
|
995
|
-
}
|
|
996
|
-
if (sortedColIds) { // 页面配置更新列排序
|
|
997
|
-
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
998
|
-
}
|
|
999
|
-
// 旧过滤参数设置为空
|
|
1000
|
-
const oldParms = Object.keys(userCriteriaData || {}).reduce((total, item) => { total[item] = ""; return total; }, {});
|
|
1001
|
-
this.actTableDoSearch({ ...oldParms, ...(criteriaData || { menuId }) });
|
|
1002
|
-
this.setState({ userCriteriaData: criteriaData, viewModels: viewModels || [defShowType || ltmplConfig.showType || "table"], hiddenColIds: hiddenColIds || defaultDisabledColIds, sortedColConfigs });
|
|
1003
|
-
setUserPageConfig({ ...val, criteriaData: undefined });
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
renderHeaderButtons = () => {
|
|
1007
|
-
let {
|
|
1008
|
-
hiddenColIds, viewModels, sortedColConfigs, disabledColIds, showL2Chart,
|
|
1009
|
-
showL2ActTable, restatParams, userCriteriaData
|
|
1010
|
-
} = this.state;
|
|
1011
|
-
const {
|
|
1012
|
-
ltmplConfig, sourceId, doCreate, doSearch, menuId,
|
|
1013
|
-
funcMode, customCreatable, serverKey, readOnly, userPageConfig, allowUserConfig
|
|
1014
|
-
} = this.props;
|
|
1015
|
-
const { translate } = this.context;
|
|
1016
|
-
let { buttons } = ltmplConfig;
|
|
1017
|
-
const version = localStorage.getItem("version") || "";
|
|
1018
|
-
|
|
1019
|
-
return (
|
|
1020
|
-
<>
|
|
1021
|
-
<Space>
|
|
1022
|
-
{userPageConfig && allowUserConfig ? <PageConfigButton menuCode={menuId} handleResetUserPageConfig={this.handleResetUserPageConfig} handleUpdateUserPageConfig={this.handleUpdateUserPageConfig} userCriteriaData={userCriteriaData} /> : ""}
|
|
1023
|
-
{funcMode == "common" && this.criteriaFormUseful() ? (
|
|
1024
|
-
<Popover trigger="click" content={this.renderCriteriaForm()}>
|
|
1025
|
-
<Button>
|
|
1026
|
-
<SearchOutlined />
|
|
1027
|
-
</Button>
|
|
1028
|
-
</Popover>
|
|
1029
|
-
) : null}
|
|
1030
|
-
{buttons.includes("ratmplSelect") && !readOnly ? (
|
|
1031
|
-
<Button onClick={() => this.setState({ showRatmplSelector: true })}>
|
|
1032
|
-
{translate("${选择}")}
|
|
1033
|
-
</Button>
|
|
1034
|
-
) : (
|
|
1035
|
-
""
|
|
1036
|
-
)}
|
|
1037
|
-
{buttons.includes("dtmplAdd") && doCreate && !readOnly ? (
|
|
1038
|
-
ltmplConfig.classAddConfigs &&
|
|
1039
|
-
ltmplConfig.classAddConfigs.length > 0 ? (
|
|
1040
|
-
<Popover
|
|
1041
|
-
arrow={false}
|
|
1042
|
-
content={this.getAddTmplButton(ltmplConfig.classAddConfigs)}
|
|
1043
|
-
placement="bottomRight"
|
|
1044
|
-
>
|
|
1045
|
-
<Tooltip>
|
|
1046
|
-
<Button>
|
|
1047
|
-
<PlusOutlined />
|
|
1048
|
-
</Button>
|
|
1049
|
-
</Tooltip>
|
|
1050
|
-
</Popover>
|
|
1051
|
-
) : (
|
|
1052
|
-
<Tooltip title={translate("${" + (ltmplConfig.createBtnTitle || "创建") + "}")}>
|
|
1053
|
-
<Button onClick={() => doCreate(null, false)}>
|
|
1054
|
-
<PlusOutlined />
|
|
1055
|
-
</Button>
|
|
1056
|
-
</Tooltip>
|
|
1057
|
-
)
|
|
1058
|
-
) : (
|
|
1059
|
-
""
|
|
1060
|
-
)}
|
|
1061
|
-
{(buttons.includes("dtmplCustomAdd") || customCreatable) &&
|
|
1062
|
-
doCreate &&
|
|
1063
|
-
!readOnly ? (
|
|
1064
|
-
<Tooltip title={translate("${" + (ltmplConfig.createBtnTitle || "创建") + "}")}>
|
|
1065
|
-
<Button onClick={() => doCreate(null, true)}>
|
|
1066
|
-
<PlusCircleOutlined />
|
|
1067
|
-
</Button>
|
|
1068
|
-
</Tooltip>
|
|
1069
|
-
) : (
|
|
1070
|
-
""
|
|
1071
|
-
)}
|
|
1072
|
-
{buttons.includes("importLtmplExcel") && !readOnly ? (
|
|
1073
|
-
<Tooltip title={translate("${导入}")}>
|
|
1074
|
-
<Button
|
|
1075
|
-
href={`#/${version}/${sourceId}/importer?menuId=${menuId}`}
|
|
1076
|
-
target={"_blank"}
|
|
1077
|
-
>
|
|
1078
|
-
<ImportOutlined />
|
|
1079
|
-
</Button>
|
|
1080
|
-
</Tooltip>
|
|
1081
|
-
) : (
|
|
1082
|
-
""
|
|
1083
|
-
)}
|
|
1084
|
-
{buttons.includes("exportLtmplExcel") && !readOnly
|
|
1085
|
-
? this.renderExportButton("导出", "ltmpl-data-excel")
|
|
1086
|
-
: ""}
|
|
1087
|
-
{this.renderFileExportButton()}
|
|
1088
|
-
{false
|
|
1089
|
-
&& buttons.includes("showChart") ? (
|
|
1090
|
-
<Tooltip
|
|
1091
|
-
title={
|
|
1092
|
-
showL2Chart
|
|
1093
|
-
? translate("${隐藏}${图表}")
|
|
1094
|
-
: translate("${展示}${图表}")
|
|
1095
|
-
}
|
|
1096
|
-
>
|
|
1097
|
-
<Button onClick={this.handleShowChart}>
|
|
1098
|
-
<LineChartOutlined />
|
|
1099
|
-
</Button>
|
|
1100
|
-
</Tooltip>
|
|
1101
|
-
) : (
|
|
1102
|
-
""
|
|
1103
|
-
)}
|
|
1104
|
-
{buttons.includes("analysis") ? (
|
|
1105
|
-
<Tooltip
|
|
1106
|
-
title={
|
|
1107
|
-
showL2ActTable
|
|
1108
|
-
? translate("${隐藏}${数据分析}")
|
|
1109
|
-
: translate("${展示}${数据分析}")
|
|
1110
|
-
}
|
|
1111
|
-
>
|
|
1112
|
-
<Button onClick={this.handleDataAnalysis}>
|
|
1113
|
-
<FundOutlined />
|
|
1114
|
-
</Button>
|
|
1115
|
-
</Tooltip>
|
|
1116
|
-
) : (
|
|
1117
|
-
""
|
|
1118
|
-
)}
|
|
1119
|
-
{buttons.includes("reStat") && !readOnly ? (
|
|
1120
|
-
<Restat
|
|
1121
|
-
value={restatParams}
|
|
1122
|
-
serverKey={serverKey}
|
|
1123
|
-
fields={ltmplConfig.reStatParams}
|
|
1124
|
-
sourceId={sourceId}
|
|
1125
|
-
onfinish={(restatParams) => {
|
|
1126
|
-
this.actTableDoSearch(null);
|
|
1127
|
-
this.setState({ restatParams: restatParams });
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
></Restat>
|
|
1131
|
-
) : (
|
|
1132
|
-
""
|
|
1133
|
-
)}
|
|
1134
|
-
<Popover
|
|
1135
|
-
content={
|
|
1136
|
-
<Checkbox.Group
|
|
1137
|
-
value={viewModels}
|
|
1138
|
-
onChange={this.changeViewModel}
|
|
1139
|
-
>
|
|
1140
|
-
<Row style={{ width: "120px" }}>
|
|
1141
|
-
<Col span={24}>
|
|
1142
|
-
<Checkbox value={"table"}>{translate("${表格}")}</Checkbox>
|
|
1143
|
-
</Col>
|
|
1144
|
-
<Col span={24}>
|
|
1145
|
-
<Checkbox value={"verticalList"}>
|
|
1146
|
-
{translate("${纵向列表}")}
|
|
1147
|
-
</Checkbox>
|
|
1148
|
-
</Col>
|
|
1149
|
-
<Col span={24}>
|
|
1150
|
-
<Checkbox value="cardList">
|
|
1151
|
-
{translate("${卡片列表}")}
|
|
1152
|
-
</Checkbox>
|
|
1153
|
-
</Col>
|
|
1154
|
-
<Col span={24}>
|
|
1155
|
-
<Checkbox value="ganttChart">
|
|
1156
|
-
{translate("${甘特图}")}
|
|
1157
|
-
</Checkbox>
|
|
1158
|
-
</Col>
|
|
1159
|
-
<Col span={24}>
|
|
1160
|
-
<Checkbox value="calendar">
|
|
1161
|
-
{translate("${日历}")}
|
|
1162
|
-
</Checkbox>
|
|
1163
|
-
</Col>
|
|
1164
|
-
{/*<Col span={24}><Checkbox value={'horizontalList'}>横向列表</Checkbox></Col>*/}
|
|
1165
|
-
</Row>
|
|
1166
|
-
</Checkbox.Group>
|
|
1167
|
-
}
|
|
1168
|
-
title={translate("${视图}")}
|
|
1169
|
-
placement="bottomRight"
|
|
1170
|
-
trigger="click"
|
|
1171
|
-
>
|
|
1172
|
-
<Tooltip title={translate("${选择视图}")}>
|
|
1173
|
-
<Button>
|
|
1174
|
-
<RetweetOutlined />
|
|
1175
|
-
</Button>
|
|
1176
|
-
</Tooltip>
|
|
1177
|
-
</Popover>
|
|
1178
|
-
<Popover
|
|
1179
|
-
content={
|
|
1180
|
-
<ColumnSelector
|
|
1181
|
-
columns={sortedColConfigs}
|
|
1182
|
-
disabledColIds={disabledColIds}
|
|
1183
|
-
hiddenColIds={hiddenColIds}
|
|
1184
|
-
onChangeColSort={this.onChangeColSort}
|
|
1185
|
-
onChangeHiddenCols={this.changeHiddenColumns}
|
|
1186
|
-
/>
|
|
1187
|
-
}
|
|
1188
|
-
title={translate("${排序和选择列}")}
|
|
1189
|
-
placement="bottomRight"
|
|
1190
|
-
trigger="click"
|
|
1191
|
-
>
|
|
1192
|
-
<Tooltip title={translate("${点击排序和选择列}")}>
|
|
1193
|
-
<Button>
|
|
1194
|
-
<TableOutlined />
|
|
1195
|
-
</Button>
|
|
1196
|
-
</Tooltip>
|
|
1197
|
-
</Popover>
|
|
1198
|
-
{doSearch ? (
|
|
1199
|
-
<Button
|
|
1200
|
-
className="hoverbig"
|
|
1201
|
-
title={translate("${刷新}")}
|
|
1202
|
-
onClick={() => {
|
|
1203
|
-
this.actTableDoSearch(null);
|
|
1204
|
-
}}
|
|
1205
|
-
>
|
|
1206
|
-
<ReloadOutlined />
|
|
1207
|
-
</Button>
|
|
1208
|
-
) : (
|
|
1209
|
-
""
|
|
1210
|
-
)}
|
|
1211
|
-
{/*<Tooltip title={translate("${常用配置}")}>*/}
|
|
1212
|
-
{/* <Button*/}
|
|
1213
|
-
{/* className="hoverbig"*/}
|
|
1214
|
-
{/* onClick={() => {*/}
|
|
1215
|
-
{/* //doSearch(null);*/}
|
|
1216
|
-
{/* }}*/}
|
|
1217
|
-
{/* >*/}
|
|
1218
|
-
{/* <SettingOutlined />*/}
|
|
1219
|
-
{/* </Button>*/}
|
|
1220
|
-
{/*</Tooltip>*/}
|
|
1221
|
-
|
|
1222
|
-
</Space>
|
|
1223
|
-
</>
|
|
1224
|
-
);
|
|
1225
|
-
};
|
|
1226
|
-
|
|
1227
|
-
criteriaFormUseful = () => {
|
|
1228
|
-
const { ltmplConfig } = this.props;
|
|
1229
|
-
let { buttons, criteria, updrillButtonConfigs } = ltmplConfig;
|
|
1230
|
-
if (
|
|
1231
|
-
((buttons.includes("query") ||
|
|
1232
|
-
(updrillButtonConfigs && updrillButtonConfigs.length > 0)) &&
|
|
1233
|
-
((criteria && criteria.length > 0) ||
|
|
1234
|
-
buttons.includes("drilling"))) ||
|
|
1235
|
-
this.checkBoxUseful() || buttons.includes("multiRowEdit")
|
|
1236
|
-
) {
|
|
1237
|
-
return true;
|
|
1238
|
-
} else {
|
|
1239
|
-
return false;
|
|
1240
|
-
}
|
|
1241
|
-
};
|
|
1242
|
-
|
|
1243
|
-
checkBoxUseful = () => {
|
|
1244
|
-
const { ltmplConfig } = this.props;
|
|
1245
|
-
let { buttons, jumps, actions, fileExports, customButtons } = ltmplConfig;
|
|
1246
|
-
if (
|
|
1247
|
-
buttons.includes("batchDelete") ||
|
|
1248
|
-
(actions && actions.length > 0) || (customButtons && customButtons.length > 0) ||
|
|
1249
|
-
(jumps && jumps.length > 0) || (fileExports && fileExports.length > 0)
|
|
1250
|
-
) {
|
|
1251
|
-
return true;
|
|
1252
|
-
} else {
|
|
1253
|
-
return false;
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
|
|
1257
|
-
actTableDoSearch = (data: object) => {
|
|
1258
|
-
const { ltreeData } = this.state;
|
|
1259
|
-
this.doSearch_(data, ltreeData);
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
doSearch_ = async (criteriaData, ltreeData) => {
|
|
1263
|
-
const { doSearch } = this.props;
|
|
1264
|
-
|
|
1265
|
-
let new_serial_number = new Date().getTime();
|
|
1266
|
-
if (doSearch && new_serial_number - serial_number > 2000) {
|
|
1267
|
-
serial_number = new_serial_number;
|
|
1268
|
-
await doSearch({ ...criteriaData, serial_number, ...ltreeData });
|
|
1269
|
-
//busyReminderTime=0;
|
|
1270
|
-
// }else{
|
|
1271
|
-
// if(busyReminder){
|
|
1272
|
-
// if(busyReminderTime==1){
|
|
1273
|
-
// const { translate } = this.context;
|
|
1274
|
-
// message.warning(translate("${系统忙,请稍后再试}"));
|
|
1275
|
-
// busyReminderTime=0;
|
|
1276
|
-
// }else{
|
|
1277
|
-
// busyReminderTime=1;
|
|
1278
|
-
// }
|
|
1279
|
-
//}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
ltreeValueChange = async (v) => {
|
|
1284
|
-
let ltreeEntitySelect = this.getLtreeEntitySelectCriteria();
|
|
1285
|
-
const { ltreeData } = this.state;
|
|
1286
|
-
const { criteriaData } = this.props;
|
|
1287
|
-
if (ltreeData && ltreeData["c_" + ltreeEntitySelect.id] != v) {
|
|
1288
|
-
let ltreeData_ = {};
|
|
1289
|
-
ltreeData_["c_" + ltreeEntitySelect.id] = v;
|
|
1290
|
-
await this.doSearch_(criteriaData, ltreeData_);
|
|
1291
|
-
this.setState({ ltreeData: ltreeData_ });
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
doSearchDirect = (data: object) => {
|
|
1297
|
-
|
|
1298
|
-
let { doSearch } = this.props;
|
|
1299
|
-
if (doSearch) {
|
|
1300
|
-
doSearch({ ...data, serial_number });
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
buttonClickable = () => {
|
|
1306
|
-
let new_serial_number = new Date().getTime();
|
|
1307
|
-
if (new_serial_number - serial_number > 1500) {
|
|
1308
|
-
serial_number = new_serial_number;
|
|
1309
|
-
return true;
|
|
1310
|
-
} else {
|
|
1311
|
-
return false;
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
renderCriteriaForm = () => {
|
|
1316
|
-
let { loading, selectedRows, selectedDatas, userCriteriaData, editings, tabActiveKey, tabsOptions } = this.state;
|
|
1317
|
-
let { ltmplConfig, serverKey, sourceId } = this.props;
|
|
1318
|
-
const tabCriteriaId = tabsOptions.find(r => r.key === tabActiveKey)?.id;
|
|
1319
|
-
return (
|
|
1320
|
-
<CriteriaForm
|
|
1321
|
-
key={sourceId}
|
|
1322
|
-
serverKey={serverKey}
|
|
1323
|
-
loading={loading}
|
|
1324
|
-
selectedDatas={selectedDatas}
|
|
1325
|
-
selectedRows={selectedRows}
|
|
1326
|
-
doCustomButton={this.doCustomButton}
|
|
1327
|
-
ltmplConfig={ltmplConfig}
|
|
1328
|
-
data={userCriteriaData}
|
|
1329
|
-
doCQuery={this.doSelectedCQuery}
|
|
1330
|
-
doAction={this.doSelectedAction}
|
|
1331
|
-
doDelete={this.doDelete}
|
|
1332
|
-
doJump={this.doSelectedJump}
|
|
1333
|
-
doSearch={this.actTableDoSearch}
|
|
1334
|
-
doMultiRowEdit={this.doMultiRowEdit}
|
|
1335
|
-
multiRowEditDisabled={!editings.length}
|
|
1336
|
-
tabCriteriaId={tabCriteriaId}
|
|
1337
|
-
/>
|
|
1338
|
-
);
|
|
1339
|
-
};
|
|
1340
|
-
//暂时无用
|
|
1341
|
-
// queryTotal = async () => {
|
|
1342
|
-
// const { queryKey} = this.state;
|
|
1343
|
-
// const { serverKey }=this.props;
|
|
1344
|
-
// let aggregateVO:AggregateVO = await HcserviceV3.requestQueryAggregates(serverKey, queryKey.key);
|
|
1345
|
-
// this.setState({
|
|
1346
|
-
// aggregateVO,
|
|
1347
|
-
// });
|
|
1348
|
-
// return aggregateVO;
|
|
1349
|
-
// };
|
|
1350
|
-
|
|
1351
|
-
getLtreeEntitySelectCriteria = () => {
|
|
1352
|
-
let { ltmplConfig } = this.props
|
|
1353
|
-
|
|
1354
|
-
if (ltmplConfig && ltmplConfig.criteria) {
|
|
1355
|
-
for (let c of ltmplConfig.criteria) {
|
|
1356
|
-
if (c?.extControlType == "ltree-entity-select" || c?.extControlType == "ltree-entity-select-value") {
|
|
1357
|
-
return c;
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
return undefined;
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
// 行内编辑start
|
|
1365
|
-
editRowEdit = (code: string) => {
|
|
1366
|
-
this.setState({ editings: [...this.state.editings, code] });
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
cancelRowEdit = (code: string) => {
|
|
1370
|
-
this.setState({ editings: this.state.editings.filter(r => r !== code) });
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
// 单独提交
|
|
1374
|
-
postLtmplData = async (dtmplData) => {
|
|
1375
|
-
const { serverKey, sourceId } = this.props;
|
|
1376
|
-
let res = await HcserviceV3.postLtmplData(
|
|
1377
|
-
serverKey,
|
|
1378
|
-
sourceId,
|
|
1379
|
-
dtmplData,
|
|
1380
|
-
message
|
|
1381
|
-
);
|
|
1382
|
-
if (res.status === "success") {
|
|
1383
|
-
this.cancelRowEdit(dtmplData["唯一编码"]);
|
|
1384
|
-
this.actTableDoSearch(undefined);
|
|
1385
|
-
this.formRef.current.resetFields([]);
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
|
|
1389
|
-
// 批量提交
|
|
1390
|
-
postLtmplMultiData = async (dtmplData) => {
|
|
1391
|
-
const { serverKey, sourceId } = this.props;
|
|
1392
|
-
let res = await HcserviceV3.postLtmplMultiData(
|
|
1393
|
-
serverKey,
|
|
1394
|
-
sourceId,
|
|
1395
|
-
dtmplData,
|
|
1396
|
-
message
|
|
1397
|
-
);
|
|
1398
|
-
if (res.status === "success") {
|
|
1399
|
-
this.cancelRowEdit(dtmplData["唯一编码"]);
|
|
1400
|
-
this.actTableDoSearch(undefined);
|
|
1401
|
-
this.formRef.current.resetFields([]); // 重置表单数据
|
|
1402
|
-
this.setState({ editings: [] });
|
|
1403
|
-
}
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
saveRowData = async (data: DtmplData) => {
|
|
1407
|
-
const { code } = data;
|
|
1408
|
-
let currentForm = this.formRef.current;
|
|
1409
|
-
let dtmplData = { "唯一编码": code };
|
|
1410
|
-
await currentForm.validateFields().then((values) => {
|
|
1411
|
-
for (let key in values) {
|
|
1412
|
-
if (values.hasOwnProperty(key) && key.startsWith(code)) {
|
|
1413
|
-
dtmplData[key.split("_")[1]] = values[key];
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
this.postLtmplData(dtmplData);
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
// 批量提交
|
|
1421
|
-
doMultiRowEdit = async () => {
|
|
1422
|
-
const { editings } = this.state;
|
|
1423
|
-
if (!editings.length) {
|
|
1424
|
-
return;
|
|
1425
|
-
}
|
|
1426
|
-
let currentForm = this.formRef.current;
|
|
1427
|
-
let dtmplData = {};
|
|
1428
|
-
await currentForm.validateFields().then((values) => {
|
|
1429
|
-
for (let key in values) {
|
|
1430
|
-
if (values.hasOwnProperty(key)) {
|
|
1431
|
-
const code = key.split("_")[0];
|
|
1432
|
-
if (editings.includes(code)) {
|
|
1433
|
-
dtmplData[code] = { "唯一编码": code, ...(dtmplData[code] || {}), [key.split("_")[1]]: (values[key] || values[key] === 0) ? values[key] : null }
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
this.postLtmplMultiData({ data: JSON.stringify(Object.values(dtmplData)) });
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
// 批量编辑表单值更新
|
|
1442
|
-
doRowEditFormChange = (data: { [key: string]: any }) => {
|
|
1443
|
-
const { editings } = this.state;
|
|
1444
|
-
const code = Object.keys(data)[0].split("_")[0];
|
|
1445
|
-
if (!editings.includes(code)) {
|
|
1446
|
-
this.setState({ editings: [...editings, code] });
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
// 行内编辑end
|
|
1450
|
-
|
|
1451
|
-
// 删除确认弹窗打开
|
|
1452
|
-
doDelModalOpen = (record: DtmplData) => {
|
|
1453
|
-
this.setState({ record, recordCode: record.code, delModalOpen: true });
|
|
1454
|
-
};
|
|
1455
|
-
|
|
1456
|
-
// tab页切换查询
|
|
1457
|
-
doTabSearch = (val: string) => {
|
|
1458
|
-
const { tabsOptions, tabActiveKey } = this.state;
|
|
1459
|
-
let new_serial_number = new Date().getTime();
|
|
1460
|
-
if (new_serial_number - serial_number < 2000) return;
|
|
1461
|
-
if (tabActiveKey === val) return;
|
|
1462
|
-
const ids = tabsOptions.find(r => r.key === "all").ids || [];
|
|
1463
|
-
const item = tabsOptions.find(r => r.key === val);
|
|
1464
|
-
let params = ids?.reduce((total, cur) => {
|
|
1465
|
-
total[cur] = (val === "all" || cur !== item.id) ? undefined : val;
|
|
1466
|
-
return total;
|
|
1467
|
-
}, {});
|
|
1468
|
-
this.actTableDoSearch(params);
|
|
1469
|
-
this.setState({ tabActiveKey: val });
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
renderAggregates() { // 统计数据渲染
|
|
1473
|
-
const { aggregateVO } = this.state;
|
|
1474
|
-
const { ltmplConfig } = this.props;
|
|
1475
|
-
const aggregates = aggregateVO?.aggregates || [];
|
|
1476
|
-
const columns = ltmplConfig?.columns || [];
|
|
1477
|
-
return aggregates?.length ? <div className="aggregates">{aggregates.map(item => {
|
|
1478
|
-
const column = columns.find(r => r.id === item.fieldId);
|
|
1479
|
-
if (!column) {
|
|
1480
|
-
return "";
|
|
1481
|
-
}
|
|
1482
|
-
const { dataUnit, themeColor, themeIcon } = column;
|
|
1483
|
-
return <Card className="aggregate-card" hoverable styles={{ body: { padding: 20 } }}>
|
|
1484
|
-
<div style={{ display: "flex", alignItems: "start", justifyContent: "space-between" }}>
|
|
1485
|
-
<div style={{ width: "calc(100% - 40px)" }}>
|
|
1486
|
-
<p className="title">{item.fieldTitle}</p>
|
|
1487
|
-
<div className="value">
|
|
1488
|
-
<Text
|
|
1489
|
-
style={{ maxWidth: "100%" }}
|
|
1490
|
-
ellipsis={{ tooltip: item.value }}
|
|
1491
|
-
>
|
|
1492
|
-
<span className="number">{item.value}</span>
|
|
1493
|
-
</Text>
|
|
1494
|
-
{dataUnit ? <span className="unit">{dataUnit}</span> : ""}
|
|
1495
|
-
</div>
|
|
1496
|
-
</div>
|
|
1497
|
-
{themeIcon ?
|
|
1498
|
-
<div className="icon" style={{ color: themeColor, background: `${themeColor}26` }}>
|
|
1499
|
-
<Icon type={themeIcon} />
|
|
1500
|
-
</div> :
|
|
1501
|
-
""}
|
|
1502
|
-
</div>
|
|
1503
|
-
</Card>
|
|
1504
|
-
}).filter(Boolean)
|
|
1505
|
-
}</div > : "";
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
renderContent = () => {
|
|
1509
|
-
let {
|
|
1510
|
-
queryKey, loading, selectedRows, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable,
|
|
1511
|
-
pageInfo, editings, userCriteriaData, tabsOptions, tabActiveKey, pageSizeOptions
|
|
1512
|
-
} = this.state;
|
|
1513
|
-
let {
|
|
1514
|
-
mainCode, sourceId, ltmplConfig, funcMode, operatable,
|
|
1515
|
-
title, collapsible,
|
|
1516
|
-
onChangePage, serverKey, criteriaData, showEmpty, loadDataCallback,
|
|
1517
|
-
showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig,
|
|
1518
|
-
doEdit2D, doView2D
|
|
1519
|
-
} = this.props;
|
|
1520
|
-
const { translate } = this.context;
|
|
1521
|
-
|
|
1522
|
-
if (!ltmplConfig || !sourceId) {
|
|
1523
|
-
return (
|
|
1524
|
-
<>
|
|
1525
|
-
<Card loading={loading}></Card>
|
|
1526
|
-
<Table loading={loading}></Table>
|
|
1527
|
-
</>
|
|
1528
|
-
);
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
|
-
let tableColumns = ColumnBuilder.buildTableColumns(
|
|
1532
|
-
{
|
|
1533
|
-
ltmplConfig, operatable,
|
|
1534
|
-
hiddenColIds, hiddenRowCodes, sortedColConfigs, showView,
|
|
1535
|
-
doEdit,
|
|
1536
|
-
doRAction, customEditable,
|
|
1537
|
-
serverKey, readOnly,
|
|
1538
|
-
sourceId, translate, unHiden: this.unHiden,
|
|
1539
|
-
onHide: this.onHide, doCustomButton: this.doCustomButton, doRowJump: this.doRowJump,
|
|
1540
|
-
blockMenuTreeDrawerOpen: this.blockMenuTreeDrawerOpen,
|
|
1541
|
-
doRowAction: this.doRowAction, doDeleteByCode: this.doDeleteByCode, sortColumns: criteriaData["sortColIds"],
|
|
1542
|
-
editings, editRowEdit: this.editRowEdit, cancelRowEdit: this.cancelRowEdit, saveRowData: this.saveRowData,
|
|
1543
|
-
doDelModalOpen: this.doDelModalOpen, mainCode, criteriaData: userCriteriaData, actTableDoSearch: this.actTableDoSearch,
|
|
1544
|
-
columnResize: userPageConfig?.colResize, doEdit2D, doView2D
|
|
1545
|
-
}
|
|
1546
|
-
);
|
|
1547
|
-
|
|
1548
|
-
let { buttons, extDisplayConfig, rowCardCount, customViewPagePath, splitTabShowType } = ltmplConfig;
|
|
1549
|
-
let { primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols } = extDisplayConfig;
|
|
1550
|
-
let displayCriteriaCard: boolean = false;
|
|
1551
|
-
if (funcMode == "simple" || funcMode == "common") {
|
|
1552
|
-
displayCriteriaCard = false;
|
|
1553
|
-
} else if (this.criteriaFormUseful()) {
|
|
1554
|
-
displayCriteriaCard = true;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
let columnConfigs = [];
|
|
1558
|
-
if (sortedColConfigs) {
|
|
1559
|
-
for (let colConfig of sortedColConfigs) {
|
|
1560
|
-
if (!hiddenColIds.includes(colConfig.id)) {
|
|
1561
|
-
columnConfigs.push(colConfig);
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
const sortColumnData = [];
|
|
1567
|
-
if (Array.isArray(criteriaData["sortColIds"])) {
|
|
1568
|
-
sortColumnData.push(...criteriaData["sortColIds"]);
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
let ltreeEntitySelect = this.getLtreeEntitySelectCriteria();
|
|
1572
|
-
|
|
1573
|
-
// actTable渲染
|
|
1574
|
-
const renderActTable = loading ? (
|
|
1575
|
-
<Table loading={loading}></Table>
|
|
1576
|
-
) : (tableType == "report" ? <ReportTable
|
|
1577
|
-
tableProps={{ scrollY: ltmplConfig.scrollY, clickDisplayTotal: !ltmplConfig.directShowTotal }}
|
|
1578
|
-
serverKey={serverKey} hiddenColIds={hiddenColIds}
|
|
1579
|
-
maxSelectedRows={this.checkBoxUseful() ? 1000 : -1}
|
|
1580
|
-
columns={tableColumns}
|
|
1581
|
-
selectedRows={selectedRows} queryKey={queryKey}
|
|
1582
|
-
onChangeRowSelection={this.changeRowSelection}
|
|
1583
|
-
leftFixedCols={ltmplConfig.leftFixedCols}
|
|
1584
|
-
onChangeResize={this.onChangeResize}
|
|
1585
|
-
showEmpty={showEmpty}
|
|
1586
|
-
/> :
|
|
1587
|
-
<QueryTable key={"querytable" + sourceId} sourceId={sourceId}
|
|
1588
|
-
// queryTotal={this.queryTotal}
|
|
1589
|
-
tableProps={{ scrollY: ltmplConfig.scrollY, clickDisplayTotal: !ltmplConfig.directShowTotal }}
|
|
1590
|
-
serverKey={serverKey}
|
|
1591
|
-
onChangePage={onChangePage}
|
|
1592
|
-
viewModels={viewModels}
|
|
1593
|
-
primaryColumn={primaryColumn}
|
|
1594
|
-
columnConfigs={columnConfigs} summaryConfigs={ltmplConfig.totalColumnConfigs}
|
|
1595
|
-
maxSelectedRows={this.props?.tableType === "select" || this.checkBoxUseful() ? 10000 : -1}
|
|
1596
|
-
selectedRows={selectedRows} columns={tableColumns}
|
|
1597
|
-
hiddenRowCodes={hiddenRowCodes}
|
|
1598
|
-
pageInfo={pageInfo}
|
|
1599
|
-
queryKey={queryKey}
|
|
1600
|
-
onChangeRowSelection={this.changeRowSelection}
|
|
1601
|
-
subtotalXColumn={
|
|
1602
|
-
ltmplConfig.subtotalXColumn == null ||
|
|
1603
|
-
ltmplConfig.subtotalXColumn.length <= 0
|
|
1604
|
-
? null
|
|
1605
|
-
: ltmplConfig.subtotalXColumn
|
|
1606
|
-
}
|
|
1607
|
-
groupIColumns={ltmplConfig.groupIColumns}
|
|
1608
|
-
doSearch={this.actTableDoSearch}
|
|
1609
|
-
sortColumnData={sortColumnData}
|
|
1610
|
-
cardListConfig={{ primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, rowCardCount, buttons, customViewPagePath, mainCode }}
|
|
1611
|
-
ltmplConfig={ltmplConfig}
|
|
1612
|
-
showView={showView}
|
|
1613
|
-
showPagination={showPagination}
|
|
1614
|
-
onChangeAggregateVO={(val) => this.setState({ aggregateVO: val })}
|
|
1615
|
-
onChangeResize={this.onChangeResize}
|
|
1616
|
-
pageSizeOptions={pageSizeOptions}
|
|
1617
|
-
showEmpty={showEmpty}
|
|
1618
|
-
loadDataCallback={loadDataCallback}
|
|
1619
|
-
/>);
|
|
1620
|
-
|
|
1621
|
-
// tab拆解条件渲染
|
|
1622
|
-
const renderSplitTab = <>
|
|
1623
|
-
{splitTabShowType === "tab" ? <Tabs tabBarGutter={12} size="small" activeKey={tabActiveKey} items={tabsOptions} onChange={this.doTabSearch} tabBarExtraContent={this.renderHeaderButtons()} /> : ""}
|
|
1624
|
-
{splitTabShowType === "tag" ? <div className="split-tab" ><Space className="split-tab-left" >{tabsOptions.map(r => <Button style={{ height: "28px" }} size="small" onClick={() => this.doTabSearch(r.key)} shape="round" type={tabActiveKey === r.key ? "primary" : "default"}>{r.title}</Button>)}</Space><div className="split-tab-right">{this.renderHeaderButtons()}</div></div> : ""}
|
|
1625
|
-
{splitTabShowType === "radio" ? <div className="split-tab" ><div className="split-tab-left"><Radio.Group onChange={(e) => this.doTabSearch(e.target.value)} value={tabActiveKey} options={tabsOptions} /></div><div className="split-tab-right">{this.renderHeaderButtons()}</div></div> : ""}
|
|
1626
|
-
</>;
|
|
1627
|
-
|
|
1628
|
-
return (
|
|
1629
|
-
<>
|
|
1630
|
-
{buttons.includes("analysis") && showL2ActTable ? (
|
|
1631
|
-
<div>
|
|
1632
|
-
<L2ActTable
|
|
1633
|
-
serverKey={serverKey}
|
|
1634
|
-
innerQueryKey={queryKey.key}
|
|
1635
|
-
sourceId={sourceId}
|
|
1636
|
-
/>
|
|
1637
|
-
<Divider
|
|
1638
|
-
dashed
|
|
1639
|
-
style={{ borderTopColor: "#40a9ff" }}
|
|
1640
|
-
plain
|
|
1641
|
-
></Divider>
|
|
1642
|
-
</div>
|
|
1643
|
-
) : (
|
|
1644
|
-
""
|
|
1645
|
-
)}
|
|
1646
|
-
<div className="actTable">
|
|
1647
|
-
<Row>
|
|
1648
|
-
<Col span={24}>
|
|
1649
|
-
{funcMode == "complete" || funcMode == "common" ? (
|
|
1650
|
-
collapsible ? null : (
|
|
1651
|
-
<span>
|
|
1652
|
-
{ltmplConfig.header ? (
|
|
1653
|
-
<div
|
|
1654
|
-
style={{ padding: "6px" }}
|
|
1655
|
-
dangerouslySetInnerHTML={{ __html: ltmplConfig.header }}
|
|
1656
|
-
></div>
|
|
1657
|
-
) : null}
|
|
1658
|
-
{tabsOptions.length ? renderSplitTab :
|
|
1659
|
-
<>
|
|
1660
|
-
<h3 >
|
|
1661
|
-
<p className="act-table-title" style={{ position: "relative", float: "left", marginBottom: "4px" }}> {!title
|
|
1662
|
-
? translate("${" + ltmplConfig.title + "}")
|
|
1663
|
-
: typeof title == "string"
|
|
1664
|
-
? translate("${" + title + "}")
|
|
1665
|
-
: title}</p>
|
|
1666
|
-
</h3>
|
|
1667
|
-
<p className="fr" style={{ marginBottom: "4px" }}>{this.renderHeaderButtons()}</p>
|
|
1668
|
-
</>}
|
|
1669
|
-
</span>
|
|
1670
|
-
)
|
|
1671
|
-
) : null}
|
|
1672
|
-
</Col>
|
|
1673
|
-
</Row>
|
|
1674
|
-
{(<Row><Col span={24}><Layout hasSider style={{ backgroundColor: "#fff" }}>
|
|
1675
|
-
<Sider
|
|
1676
|
-
width={ltreeEntitySelect ? 260 : 0}
|
|
1677
|
-
theme={"light"}
|
|
1678
|
-
style={{
|
|
1679
|
-
paddingRight: ltreeEntitySelect ? '10px' : "0px"
|
|
1680
|
-
}}
|
|
1681
|
-
>
|
|
1682
|
-
{ltreeEntitySelect ?
|
|
1683
|
-
<EntryControl style={{ width: "300px" }} onChange={this.ltreeValueChange} fieldConfig={ltreeEntitySelect}></EntryControl>
|
|
1684
|
-
// <NavigationTree fieldConfig={ltreeEntitySelect} />
|
|
1685
|
-
: null}
|
|
1686
|
-
</Sider>
|
|
1687
|
-
<Layout style={{ backgroundColor: "#fff" }}>
|
|
1688
|
-
<Content style={{ overflow: "initial" }}>
|
|
1689
|
-
{showAggregates ? this.renderAggregates() : ""}
|
|
1690
|
-
{displayCriteriaCard ? this.renderCriteriaForm() : null}
|
|
1691
|
-
{buttons.includes("rowEdit") ? <AntdForm ref={this.formRef} component={false} onValuesChange={this.doRowEditFormChange}>{renderActTable}</AntdForm> : renderActTable}
|
|
1692
|
-
</Content>
|
|
1693
|
-
</Layout>
|
|
1694
|
-
</Layout></Col></Row>
|
|
1695
|
-
)}
|
|
1696
|
-
{/*此处放页脚*/}
|
|
1697
|
-
{ltmplConfig.footer ? (
|
|
1698
|
-
<div
|
|
1699
|
-
style={{ padding: "6px" }}
|
|
1700
|
-
dangerouslySetInnerHTML={{ __html: ltmplConfig.footer }}
|
|
1701
|
-
></div>
|
|
1702
|
-
) : null}
|
|
1703
|
-
</div>
|
|
1704
|
-
</>
|
|
1705
|
-
);
|
|
1706
|
-
};
|
|
1707
|
-
|
|
1708
|
-
saveRatmplSelect = async (selectedRows: SelectedRow[]) => {
|
|
1709
|
-
this.setState({
|
|
1710
|
-
showRatmplSelector: false,
|
|
1711
|
-
});
|
|
1712
|
-
const { serverKey, sourceId, mainCode, doSearch } = this.props;
|
|
1713
|
-
if (!selectedRows || selectedRows.length <= 0) {
|
|
1714
|
-
return;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
//查询
|
|
1718
|
-
const codes: string[] = [];
|
|
1719
|
-
for (let row of selectedRows) {
|
|
1720
|
-
codes.push(row.code);
|
|
1721
|
-
}
|
|
1722
|
-
await HcserviceV3.saveRatmplSelectCodes(
|
|
1723
|
-
serverKey,
|
|
1724
|
-
sourceId,
|
|
1725
|
-
mainCode,
|
|
1726
|
-
codes
|
|
1727
|
-
);
|
|
1728
|
-
this.actTableDoSearch(null);
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
render() {
|
|
1732
|
-
let { queryKey, loading, blockMenuTreeDrawerOpen, recordCode, record, showRatmplSelector, delModalOpen } = this.state;
|
|
1733
|
-
let { sourceId, ltmplConfig, title, collapsible, initCollapse, tip, serverKey, mainCode } = this.props;
|
|
1734
|
-
const { strongDeleteConfirmText } = ltmplConfig || {};
|
|
1735
|
-
const { translate } = this.context;
|
|
1736
|
-
const delFormRef = React.createRef<FormInstance>(); // 强删除表单的form Ref
|
|
1737
|
-
|
|
1738
|
-
if (!ltmplConfig || !sourceId) {
|
|
1739
|
-
return (
|
|
1740
|
-
<>
|
|
1741
|
-
<Card loading={loading}></Card>
|
|
1742
|
-
<Table loading={loading}></Table>
|
|
1743
|
-
</>
|
|
1744
|
-
);
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
return (
|
|
1748
|
-
<>
|
|
1749
|
-
{this.renderAboveCustomPage()}
|
|
1750
|
-
{collapsible ? (
|
|
1751
|
-
<CollapseCard
|
|
1752
|
-
initCollapse={initCollapse}
|
|
1753
|
-
title={
|
|
1754
|
-
<>
|
|
1755
|
-
{!title ? ltmplConfig.title : title}
|
|
1756
|
-
<ToolTipBar
|
|
1757
|
-
content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
|
|
1758
|
-
/>
|
|
1759
|
-
</>
|
|
1760
|
-
}
|
|
1761
|
-
id={queryKey + ltmplConfig.id}
|
|
1762
|
-
className={`hoverable`}
|
|
1763
|
-
styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
|
|
1764
|
-
loading={loading}
|
|
1765
|
-
//暂时注释掉,后续要支持配置。
|
|
1766
|
-
extra={this.renderHeaderButtons()}
|
|
1767
|
-
>
|
|
1768
|
-
{this.renderContent()}
|
|
1769
|
-
</CollapseCard>
|
|
1770
|
-
) : (
|
|
1771
|
-
<>{this.renderContent()}</>
|
|
1772
|
-
)}
|
|
1773
|
-
{this.renderOhterCustomPage()}
|
|
1774
|
-
<BlockMenuTreeDrawer
|
|
1775
|
-
onOk={() => {
|
|
1776
|
-
this.setState({
|
|
1777
|
-
blockMenuTreeDrawerOpen: false,
|
|
1778
|
-
});
|
|
1779
|
-
}}
|
|
1780
|
-
onCancel={() => {
|
|
1781
|
-
this.setState({
|
|
1782
|
-
blockMenuTreeDrawerOpen: false,
|
|
1783
|
-
});
|
|
1784
|
-
}}
|
|
1785
|
-
open={blockMenuTreeDrawerOpen}
|
|
1786
|
-
roleCode={recordCode}
|
|
1787
|
-
/>
|
|
1788
|
-
{showRatmplSelector ? (
|
|
1789
|
-
<ModelSelectTable
|
|
1790
|
-
serverKey={serverKey}
|
|
1791
|
-
// defaultCriteriaValue={fieldGroupConfig.defaultCriteriaValue}
|
|
1792
|
-
// maxSelectedRows={fieldGroupConfig.max}
|
|
1793
|
-
open={showRatmplSelector}
|
|
1794
|
-
onOK={this.saveRatmplSelect}
|
|
1795
|
-
onCancel={() => {
|
|
1796
|
-
this.setState({ showRatmplSelector: false });
|
|
1797
|
-
}}
|
|
1798
|
-
mainCode={mainCode}
|
|
1799
|
-
sourceId={sourceId}
|
|
1800
|
-
existRelation={"false"}
|
|
1801
|
-
/>
|
|
1802
|
-
) : ""}
|
|
1803
|
-
{delModalOpen ?
|
|
1804
|
-
<Modal
|
|
1805
|
-
open={delModalOpen}
|
|
1806
|
-
title={translate("${确定要[删除]此数据吗}?")}
|
|
1807
|
-
onOk={() => delFormRef.current.validateFields().then(() => this.doDeleteByCode(record)).catch(() => { })}
|
|
1808
|
-
onCancel={() => this.setState({ record: undefined, recordCode: undefined, delModalOpen: false })}
|
|
1809
|
-
>
|
|
1810
|
-
<AntdForm ref={delFormRef} layout="vertical">
|
|
1811
|
-
<AntdForm.Item noStyle >
|
|
1812
|
-
<Alert message={translate("${风险操作,此操作不可逆,是否继续操作}?")} type="warning" showIcon style={{ margin: "12px 0" }} />
|
|
1813
|
-
</AntdForm.Item>
|
|
1814
|
-
<AntdForm.Item
|
|
1815
|
-
label={<div>{translate("${请手动输入}")}<span style={{ color: "#ff4d4f" }}> “ {translate("${" + strongDeleteConfirmText + "}")} ” </span>{translate("${完成验证}")}</div>}
|
|
1816
|
-
name="rule"
|
|
1817
|
-
rules={[
|
|
1818
|
-
{ required: true, message: translate("${请输入}" + "${" + strongDeleteConfirmText + "}") },
|
|
1819
|
-
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入}" + "${" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1820
|
-
]}
|
|
1821
|
-
>
|
|
1822
|
-
<Input placeholder={translate("${" + strongDeleteConfirmText + "}")} />
|
|
1823
|
-
</AntdForm.Item>
|
|
1824
|
-
</AntdForm>
|
|
1825
|
-
</Modal> : ""}
|
|
1826
|
-
</>
|
|
1827
|
-
);
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
export default ActTable;
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button, Card, Checkbox, Col, Divider, Popover, Row, Space, Drawer, Tooltip,
|
|
4
|
+
message, Layout, Table, Form as AntdForm, FormInstance, Modal, Input, Alert, Tabs, Radio, Typography
|
|
5
|
+
} from "antd";
|
|
6
|
+
import {
|
|
7
|
+
ExportOutlined, FundOutlined, LineChartOutlined,
|
|
8
|
+
PlusCircleOutlined, PlusOutlined, ReloadOutlined, RetweetOutlined, SearchOutlined,
|
|
9
|
+
TableOutlined, ImportOutlined
|
|
10
|
+
} from "@ant-design/icons";
|
|
11
|
+
import _ from "lodash";
|
|
12
|
+
import "./index.css";
|
|
13
|
+
import {
|
|
14
|
+
ActTableMode, ActTableViewModel, AggregateVO, ClassAddConfig, ColumnConfig,
|
|
15
|
+
CustomButton, CustomButtonConfig, DoEditParam, DtmplData, JumpConfig, LtmplConfig, QueryKey,
|
|
16
|
+
SelectedRow, ShowViewParam, TmplBaseProps,
|
|
17
|
+
} from "../tmpl/interface";
|
|
18
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
19
|
+
import HCDataSource from "../tmpl/hc-data-source";
|
|
20
|
+
import QueryTable from "./query-table";
|
|
21
|
+
import CriteriaForm from "./../form/criteria-form";
|
|
22
|
+
import ProgramConfig from "../units";
|
|
23
|
+
import ColumnSelector from "./column/column-selector";
|
|
24
|
+
import ExportFrame, { ExportType, ExportMode } from "../export/export-frame";
|
|
25
|
+
import L2ActTable from "./l2-act-table";
|
|
26
|
+
import Restat from "./stat/restat";
|
|
27
|
+
import CollapseCard from "../controls/collapse-card";
|
|
28
|
+
import ToolTipBar from "../detail/tooltipbar";
|
|
29
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
30
|
+
import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
|
|
31
|
+
import ModelSelectTable from "./../table/modal-select-table";
|
|
32
|
+
import ColumnBuilder from "./column/column-builder";
|
|
33
|
+
import ReportTable from "./report-table";
|
|
34
|
+
import EntryControl from "../controls/entry-control";
|
|
35
|
+
import DraggableModal from "../module/draggable-modal";
|
|
36
|
+
import Icon from "../icon/aliIcon";
|
|
37
|
+
import PageConfigButton from "./page-config-button";
|
|
38
|
+
import { defPageSizeOptions } from "./pagination"; // 默认分页数
|
|
39
|
+
|
|
40
|
+
const { Content, Sider } = Layout;
|
|
41
|
+
const { Text } = Typography;
|
|
42
|
+
|
|
43
|
+
type Level = "l1" | "l2";
|
|
44
|
+
|
|
45
|
+
const enumTypes = ["select", "multiselect", "texttags", "checkbox", "radio", "steps"];
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
const defaultDisabledColIds: string[] = ["20000", "10000"];
|
|
49
|
+
|
|
50
|
+
interface ActTableProps extends TmplBaseProps {
|
|
51
|
+
criteriaData: object;
|
|
52
|
+
pageNo: number;
|
|
53
|
+
pageSize: number;
|
|
54
|
+
onChangePage: (pageNo: number, pageSize: number, pageSizeOptions?: number[]) => void;
|
|
55
|
+
ltmplConfig: LtmplConfig;
|
|
56
|
+
menuId?: string;
|
|
57
|
+
showView?: (showVievParam: ShowViewParam) => void;
|
|
58
|
+
doCreate?: (addtmplId: string, toCustomPage: boolean) => void;
|
|
59
|
+
customCreatable?: boolean;
|
|
60
|
+
doEdit?: (doEditParam: DoEditParam) => void;
|
|
61
|
+
customEditable?: boolean;
|
|
62
|
+
doDelete?: (code: string) => void;
|
|
63
|
+
doSearch?: (params: object) => void;
|
|
64
|
+
doRAction?: (ractionId: string, mainCode: string) => void;
|
|
65
|
+
level?: Level;
|
|
66
|
+
funcMode?: ActTableMode;
|
|
67
|
+
title?: ReactNode;
|
|
68
|
+
tip?: any;
|
|
69
|
+
collapsible?: boolean;
|
|
70
|
+
initCollapse?: boolean;
|
|
71
|
+
readOnly?: boolean;
|
|
72
|
+
tableType?: "common" | "report" | "select";
|
|
73
|
+
operatable?: boolean;
|
|
74
|
+
onSelectChange?: (val: { selectedRows: SelectedRow[], selectedDatas: DtmplData[] }) => void;
|
|
75
|
+
defShowType?: ActTableViewModel; // 默认视图
|
|
76
|
+
showPagination?: boolean; // 是否显示分页
|
|
77
|
+
showAggregates?: boolean; // 是否显示统计数据
|
|
78
|
+
userPageConfig?: { [key: string]: any }; // 用户页面配置本地缓存
|
|
79
|
+
setUserPageConfig?: (config: { [key: string]: any }) => void; // 更新用户页面配置本地缓存
|
|
80
|
+
resetUserPageConfig?: () => void; // 重置用户页面配置本地缓存
|
|
81
|
+
allowUserConfig?: boolean; // 是否可用户自定义配置
|
|
82
|
+
deleteCallback?: (val: object) => void; // 删除回调
|
|
83
|
+
onUpdatePageSizeOptions?: (val: number[]) => void; // 更新分页数数组
|
|
84
|
+
showEmpty?: boolean; // 空数据是否显示空状态,默认显示
|
|
85
|
+
loadDataCallback?: (val: object[]) => void; // 请求数据回调函数
|
|
86
|
+
doEdit2D?: (val: string) => void; // 2D图编辑
|
|
87
|
+
doView2D?: (val: string) => void; // 2D图查看
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface ActTableStat {
|
|
91
|
+
sortedColConfigs?: ColumnConfig[];
|
|
92
|
+
queryKey?: QueryKey;
|
|
93
|
+
loading?: boolean;
|
|
94
|
+
selectedRows?: SelectedRow[];
|
|
95
|
+
selectedDatas?: DtmplData[];
|
|
96
|
+
hiddenColIds?: string[];
|
|
97
|
+
drillingColIds?: string[];
|
|
98
|
+
disabledColIds?: string[];
|
|
99
|
+
hiddenRowCodes?: string[];
|
|
100
|
+
viewModels?: ActTableViewModel[];
|
|
101
|
+
showL2ActTable?: boolean;
|
|
102
|
+
showL2Chart?: boolean;
|
|
103
|
+
recordCode?: string;
|
|
104
|
+
record?: DtmplData;
|
|
105
|
+
blockMenuTreeDrawerOpen?: boolean;
|
|
106
|
+
showCustomCard?: boolean;
|
|
107
|
+
customButton?: CustomButton;
|
|
108
|
+
customButtonData?: DtmplData[];
|
|
109
|
+
showRatmplSelector?: boolean;
|
|
110
|
+
aggregateVO?: AggregateVO;
|
|
111
|
+
restatParams?: object;
|
|
112
|
+
pageInfo?: object;
|
|
113
|
+
ltreeData?: object;
|
|
114
|
+
userCriteriaData: object;
|
|
115
|
+
editings: string[]; // 行内编辑code
|
|
116
|
+
delModalOpen?: boolean; // 强删除弹窗是否打开
|
|
117
|
+
tabsOptions?: { key: string, value: string, label: React.ReactNode, title?: string, id?: string, ids?: string[] }[]; // tabs选项
|
|
118
|
+
tabActiveKey?: string; // Tabs选中项
|
|
119
|
+
pageSizeOptions?: number[]; // 设备分页数
|
|
120
|
+
customDrawerSize?: number | string; // 自定义页面抽屉宽度
|
|
121
|
+
}
|
|
122
|
+
let serial_number = new Date().getTime();
|
|
123
|
+
let busyReminderTime = 0;
|
|
124
|
+
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
125
|
+
state = {
|
|
126
|
+
//tableColumns: undefined,
|
|
127
|
+
sortedColConfigs: undefined,
|
|
128
|
+
queryKey: undefined,
|
|
129
|
+
loading: true,
|
|
130
|
+
disableCols: undefined,
|
|
131
|
+
hiddenColIds: defaultDisabledColIds,
|
|
132
|
+
selectedRows: [],
|
|
133
|
+
selectedDatas: [],
|
|
134
|
+
hiddenRowCodes: [],
|
|
135
|
+
viewModels: [],
|
|
136
|
+
drillingColIds: undefined,
|
|
137
|
+
disabledColIds: undefined,
|
|
138
|
+
showL2ActTable: false,
|
|
139
|
+
showL2Chart: false,
|
|
140
|
+
recordCode: undefined,
|
|
141
|
+
record: undefined,
|
|
142
|
+
blockMenuTreeDrawerOpen: false,
|
|
143
|
+
showCustomCard: false,
|
|
144
|
+
customButtonData: undefined,
|
|
145
|
+
customButton: undefined,
|
|
146
|
+
showRatmplSelector: false,
|
|
147
|
+
aggregateVO: undefined,
|
|
148
|
+
restatParams: undefined,
|
|
149
|
+
pageInfo: { pageNo: 1, pageSize: 10 },
|
|
150
|
+
ltreeData: {},
|
|
151
|
+
userCriteriaData: undefined,
|
|
152
|
+
editings: [], // 行内编辑code
|
|
153
|
+
delModalOpen: false, // 强删除弹窗是否打开
|
|
154
|
+
tabsOptions: [],
|
|
155
|
+
tabActiveKey: "all",
|
|
156
|
+
pageSizeOptions: defPageSizeOptions,
|
|
157
|
+
customDrawerSize: undefined
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
static contextType = LocaleContext;
|
|
161
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
162
|
+
formRef = React.createRef<FormInstance>(); // 可编辑表格的form Ref
|
|
163
|
+
|
|
164
|
+
static defaultProps = {
|
|
165
|
+
criteriaData: {},
|
|
166
|
+
funcMode: "complete",
|
|
167
|
+
collapsible: false,
|
|
168
|
+
initCollapse: false,
|
|
169
|
+
readOnly: false,
|
|
170
|
+
operatable: true,
|
|
171
|
+
showPagination: true,
|
|
172
|
+
showAggregates: true,
|
|
173
|
+
showEmpty: true,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// 获取标签选项
|
|
177
|
+
getTabsOptions = async () => {
|
|
178
|
+
const { ltmplConfig, criteriaData, sourceId } = this.props;
|
|
179
|
+
const { translate } = this.context;
|
|
180
|
+
const { split2TabCriteria, showSplitTabDataCount } = ltmplConfig || {};
|
|
181
|
+
if (!split2TabCriteria) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const allIds = [];
|
|
185
|
+
let groupCount = [];
|
|
186
|
+
if (showSplitTabDataCount) {
|
|
187
|
+
groupCount = await HcserviceV3.getLtmplDataGroupCount(sourceId);
|
|
188
|
+
}
|
|
189
|
+
const options = split2TabCriteria.map(fieldConfig => {
|
|
190
|
+
const id = `c_${fieldConfig.id}`;
|
|
191
|
+
allIds.push(id);
|
|
192
|
+
if (enumTypes.includes(fieldConfig.controlType || fieldConfig.extControlType)) {
|
|
193
|
+
const items = HCDataSource.getEnums(fieldConfig.mstrucId);
|
|
194
|
+
const options = items.map((item) => {
|
|
195
|
+
const count = groupCount.find(r => r[0]?.fieldId === fieldConfig.id && r[0]?.value === item.title)?.[1]?.value;
|
|
196
|
+
const countVal = (count || count === 0) ? ` (${count})` : "";
|
|
197
|
+
return {
|
|
198
|
+
label: <span style={{ padding: "0 10px" }}>{translate("${" + item.title + "}")}{countVal}</span>,
|
|
199
|
+
key: item.value,
|
|
200
|
+
id,
|
|
201
|
+
title: translate("${" + item.title + "}") + countVal,
|
|
202
|
+
value: item.value
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
if (fieldConfig.relDeduplication && fieldConfig.exceptCodes?.length) {
|
|
206
|
+
return options.filter(item => !fieldConfig.exceptCodes.includes(item.key));
|
|
207
|
+
}
|
|
208
|
+
return options;
|
|
209
|
+
}
|
|
210
|
+
if ([fieldConfig.controlType, fieldConfig.extControlType].includes("single-checkbox")) {
|
|
211
|
+
const count = groupCount.find(r => r[0]?.fieldId === fieldConfig.id)?.[1]?.value;
|
|
212
|
+
const countVal = (count || count === 0) ? ` (${count})` : "";
|
|
213
|
+
return [{
|
|
214
|
+
label: <span style={{ padding: "0 10px" }}>{translate("${" + fieldConfig.title + "}")}{countVal}</span>,
|
|
215
|
+
key: "1",
|
|
216
|
+
id,
|
|
217
|
+
title: translate("${" + fieldConfig.title + "}") + countVal,
|
|
218
|
+
value: "1",
|
|
219
|
+
}];
|
|
220
|
+
}
|
|
221
|
+
return [];
|
|
222
|
+
})?.flat() || [];
|
|
223
|
+
const defOption = {
|
|
224
|
+
label: <span style={{ padding: "0 10px" }}>{translate("${全部}")}</span>,
|
|
225
|
+
key: "all",
|
|
226
|
+
ids: allIds,
|
|
227
|
+
title: translate("${全部}"),
|
|
228
|
+
value: "all"
|
|
229
|
+
};
|
|
230
|
+
const temId = Object.keys(criteriaData).find(r => allIds.includes(r));
|
|
231
|
+
const tabActiveKey = temId ? criteriaData[temId] : "all";
|
|
232
|
+
this.setState({ tabsOptions: [defOption, ...options], tabActiveKey });
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
loadData = async (
|
|
236
|
+
hiddenColIds: string[],
|
|
237
|
+
hiddenRowCodes: string[],
|
|
238
|
+
sortedColConfigs: ColumnConfig[]
|
|
239
|
+
) => {
|
|
240
|
+
const {
|
|
241
|
+
sourceId, criteriaData, ltmplConfig,
|
|
242
|
+
mainCode, level, pageNo, pageSize, serverKey, defShowType, userPageConfig
|
|
243
|
+
} = this.props;
|
|
244
|
+
|
|
245
|
+
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
if (!ltmplConfig) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
// 处理菜单切换,查询条件清空,重置tab拆解条件选中项
|
|
254
|
+
const tabActiveKey = ltmplConfig.split2TabCriteria?.find(r => criteriaData[`c_${r.id}`])?.id;
|
|
255
|
+
this.setState({
|
|
256
|
+
loading: true,
|
|
257
|
+
userCriteriaData: criteriaData,
|
|
258
|
+
tabActiveKey: tabActiveKey ? criteriaData[`c_${tabActiveKey}`] : "all"
|
|
259
|
+
});
|
|
260
|
+
let disabledColIds: string[] = [];
|
|
261
|
+
let hiddenColIds_ = [...hiddenColIds];
|
|
262
|
+
if (criteriaData && criteriaData["drillingColIds"]) {
|
|
263
|
+
let dColIds = [...criteriaData["drillingColIds"]];
|
|
264
|
+
ltmplConfig.columns.forEach((item) => {
|
|
265
|
+
if (
|
|
266
|
+
item.statColType == "dimension" &&
|
|
267
|
+
!dColIds.includes(item.id) &&
|
|
268
|
+
!hiddenColIds_.includes(item.id)
|
|
269
|
+
) {
|
|
270
|
+
hiddenColIds_.push(item.id);
|
|
271
|
+
disabledColIds.push(item.id);
|
|
272
|
+
}
|
|
273
|
+
if (
|
|
274
|
+
item.statColType == "dimension" &&
|
|
275
|
+
!dColIds.includes(item.id) &&
|
|
276
|
+
!disabledColIds.includes(item.id)
|
|
277
|
+
) {
|
|
278
|
+
disabledColIds.push(item.id);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
hiddenColIds_ = hiddenColIds_.filter((id) => {
|
|
282
|
+
return !dColIds.includes(id);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
ltmplConfig.columns.forEach((item) => {
|
|
286
|
+
if (item.hidden) {
|
|
287
|
+
hiddenColIds_.push(item.id);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
/** 构建column **/
|
|
291
|
+
const { defaultPageSize, showType } = ltmplConfig;
|
|
292
|
+
|
|
293
|
+
let pageInfo = {
|
|
294
|
+
pageNo: pageNo || 1,
|
|
295
|
+
pageSize: pageSize || defaultPageSize || 10,
|
|
296
|
+
virtualEndPageNo: undefined,
|
|
297
|
+
};
|
|
298
|
+
const viewModels = this.state.viewModels.length > 0 ? this.state.viewModels : (userPageConfig?.["viewModels"] || [defShowType || showType || "table"]);
|
|
299
|
+
|
|
300
|
+
/** 构建 dataSource **/
|
|
301
|
+
//构建过滤条件
|
|
302
|
+
const params = { ...criteriaData, ...pageInfo, mainCode };
|
|
303
|
+
let queryKey: QueryKey;
|
|
304
|
+
if (level && level === "l2") {
|
|
305
|
+
queryKey = await HcserviceV3.requestL2LtmplQueryKey(serverKey, sourceId, params);
|
|
306
|
+
} else {
|
|
307
|
+
if (viewModels.includes("ganttChart")) {
|
|
308
|
+
queryKey = await HcserviceV3.requestGttRootQueryKey(serverKey, sourceId, params);
|
|
309
|
+
} else {
|
|
310
|
+
queryKey = await HcserviceV3.requestLtmplQueryKey(serverKey, sourceId, params);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (!queryKey.sourceId || queryKey.sourceId == this.props.sourceId) {
|
|
315
|
+
this.setState({
|
|
316
|
+
pageInfo,
|
|
317
|
+
disabledColIds, hiddenColIds: hiddenColIds_, hiddenRowCodes,
|
|
318
|
+
sortedColConfigs, queryKey, showL2Chart: false, selectedRows: [], selectedDatas: [],
|
|
319
|
+
viewModels
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
this.setState({
|
|
323
|
+
loading: false,
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
doCustomButton = async (customButton: CustomButton, records: DtmplData[]) => {
|
|
328
|
+
if (!this.buttonClickable()) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const { serverKey, sourceId } = this.props;
|
|
332
|
+
let doType = customButton.doType;
|
|
333
|
+
let config: CustomButtonConfig = ProgramConfig.getCustomButtonConfig(customButton.id);
|
|
334
|
+
if ("request_refresh" == doType) {
|
|
335
|
+
if (config && config.doAction) {
|
|
336
|
+
await config.doAction(customButton, records);
|
|
337
|
+
} else if (config && config.getRequestUrl) {
|
|
338
|
+
let url = await config.getRequestUrl(customButton, records);
|
|
339
|
+
await HcserviceV3.doPostRequest(serverKey, url);
|
|
340
|
+
} else if (customButton.path) {
|
|
341
|
+
let codes = [];
|
|
342
|
+
let res = undefined;
|
|
343
|
+
if (records != null) {
|
|
344
|
+
records.forEach(item => {
|
|
345
|
+
codes.push(item.code)
|
|
346
|
+
})
|
|
347
|
+
}
|
|
348
|
+
if (customButton.requestMethod === "get") {
|
|
349
|
+
res = await HcserviceV3.doGetRequest(serverKey, customButton.path, { codes });
|
|
350
|
+
} else {
|
|
351
|
+
res = await HcserviceV3.doPostRequest(serverKey, customButton.path, { codes });
|
|
352
|
+
}
|
|
353
|
+
if (res?.msg || res?.message) {
|
|
354
|
+
message.info(res.msg || res.message);
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
message.error("Button Config Error");
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
this.doSearchDirect(null);
|
|
361
|
+
} else if ("show_window" == doType) {
|
|
362
|
+
this.setState({
|
|
363
|
+
showCustomCard: true,
|
|
364
|
+
customButton,
|
|
365
|
+
customButtonData: records,
|
|
366
|
+
});
|
|
367
|
+
} else {
|
|
368
|
+
message.error("Unsuport Button dotype " + doType);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
renderAboveCustomPage = () => {
|
|
373
|
+
return this.renderCustomPage("above-table");
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
renderOhterCustomPage = () => {
|
|
377
|
+
return (
|
|
378
|
+
<>
|
|
379
|
+
{this.renderCustomPage("under-table")}
|
|
380
|
+
{this.renderCustomPage("modal-window")}
|
|
381
|
+
{this.renderCustomPage("left-drawer")}
|
|
382
|
+
{this.renderCustomPage("right-drawer")}
|
|
383
|
+
</>
|
|
384
|
+
);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
renderCustomPage = (
|
|
388
|
+
windowPosition:
|
|
389
|
+
| "under-table"
|
|
390
|
+
| "above-table"
|
|
391
|
+
| "modal-window"
|
|
392
|
+
| "left-drawer"
|
|
393
|
+
| "right-drawer"
|
|
394
|
+
) => {
|
|
395
|
+
const { translate } = this.context;
|
|
396
|
+
const { customButton, customButtonData, customDrawerSize } = this.state;
|
|
397
|
+
|
|
398
|
+
if (!customButton) {
|
|
399
|
+
return "";
|
|
400
|
+
}
|
|
401
|
+
if (windowPosition && windowPosition != customButton.windowPosition) {
|
|
402
|
+
return "";
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
let customProps = {
|
|
406
|
+
customButton: customButton, data: customButtonData,
|
|
407
|
+
onOk: () => { this.actTableDoSearch(null) }
|
|
408
|
+
, onclose: () => {
|
|
409
|
+
this.setState({ customButton: undefined });
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
let config: CustomButtonConfig = ProgramConfig.getCustomButtonConfig(customButton.id);
|
|
414
|
+
let page;
|
|
415
|
+
if (config && config.getCurrentPage) {
|
|
416
|
+
page = config.getCurrentPage(customButton, customButtonData);
|
|
417
|
+
}
|
|
418
|
+
if (!page) {
|
|
419
|
+
page = ProgramConfig.getCustomPage(customButton.id);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (!page) {
|
|
423
|
+
message.error("Not found CustomButton Page");
|
|
424
|
+
this.setState({
|
|
425
|
+
customButton: undefined
|
|
426
|
+
})
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
let customElement = React.createElement(page, customProps);
|
|
431
|
+
if (
|
|
432
|
+
customButton.windowPosition == "under-table" ||
|
|
433
|
+
customButton.windowPosition == "above-table"
|
|
434
|
+
) {
|
|
435
|
+
return (
|
|
436
|
+
<Card
|
|
437
|
+
id={"CustomCard" + customButton.id}
|
|
438
|
+
size={"small"}
|
|
439
|
+
style={{ marginTop: "6px" }}
|
|
440
|
+
extra={
|
|
441
|
+
<Button
|
|
442
|
+
size={"small"}
|
|
443
|
+
danger={true}
|
|
444
|
+
onClick={() => {
|
|
445
|
+
this.setState({ customButton: undefined });
|
|
446
|
+
}}
|
|
447
|
+
>
|
|
448
|
+
{translate("${关闭}")}
|
|
449
|
+
</Button>
|
|
450
|
+
}
|
|
451
|
+
>
|
|
452
|
+
{customElement}
|
|
453
|
+
</Card>
|
|
454
|
+
);
|
|
455
|
+
} else if (
|
|
456
|
+
customButton.windowPosition == "left-drawer" ||
|
|
457
|
+
customButton.windowPosition == "right-drawer"
|
|
458
|
+
) {
|
|
459
|
+
return (
|
|
460
|
+
<Drawer
|
|
461
|
+
open={true}
|
|
462
|
+
id={"CustomCard" + customButton.id}
|
|
463
|
+
placement={
|
|
464
|
+
customButton.windowPosition == "right-drawer" ? "right" : "left"
|
|
465
|
+
}
|
|
466
|
+
resizable={{ onResize: (newSize => this.setState({ customDrawerSize: newSize })) }}
|
|
467
|
+
size={customDrawerSize !== undefined ? customDrawerSize : customButton.windowWidth}
|
|
468
|
+
onClose={() => {
|
|
469
|
+
this.setState({ customButton: undefined });
|
|
470
|
+
}}
|
|
471
|
+
styles={{ body: { minWidth: customButton.windowWidth } }}
|
|
472
|
+
>
|
|
473
|
+
{customElement}
|
|
474
|
+
</Drawer>
|
|
475
|
+
);
|
|
476
|
+
} else if (customButton.windowPosition == "modal-window") {
|
|
477
|
+
return (
|
|
478
|
+
<DraggableModal
|
|
479
|
+
open={true}
|
|
480
|
+
closable={true}
|
|
481
|
+
width={customButton.windowWidth}
|
|
482
|
+
style={{ height: customButton.windowHeight }}
|
|
483
|
+
onCancel={() => {
|
|
484
|
+
this.setState({ customButton: undefined });
|
|
485
|
+
}}
|
|
486
|
+
>
|
|
487
|
+
{customElement}
|
|
488
|
+
</DraggableModal>
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
async componentDidMount() {
|
|
495
|
+
const { ltmplConfig, tableType, userPageConfig, defShowType, onUpdatePageSizeOptions, setUserPageConfig, pageSize } = this.props;
|
|
496
|
+
const { sortedColIds } = userPageConfig || {};
|
|
497
|
+
const { translate } = this.context;
|
|
498
|
+
let sortedColConfigs = undefined;
|
|
499
|
+
if (ltmplConfig) {
|
|
500
|
+
sortedColConfigs = tableType == 'report' ? ltmplConfig.columns : [
|
|
501
|
+
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
502
|
+
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
503
|
+
...ltmplConfig.columns,
|
|
504
|
+
];
|
|
505
|
+
if (sortedColIds) { // 使用缓存的列排序
|
|
506
|
+
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
507
|
+
}
|
|
508
|
+
const temViewModels = userPageConfig?.["viewModels"] || [defShowType || ltmplConfig?.showType || "table"];
|
|
509
|
+
this.setState({ viewModels: temViewModels });
|
|
510
|
+
if (onUpdatePageSizeOptions && temViewModels.includes("cardList")) { // 初始化是卡片视图,则更新父组件中分页数组
|
|
511
|
+
const temPageSizes = Array.from({ length: 7 }, (_, i) => ltmplConfig.rowCardCount * Math.pow(2, i));
|
|
512
|
+
onUpdatePageSizeOptions(temPageSizes);
|
|
513
|
+
if (setUserPageConfig && !(userPageConfig?.pageSize >= 0)) setUserPageConfig({ pageSize: 1 });
|
|
514
|
+
this.setState({ pageSizeOptions: temPageSizes, sortedColConfigs });
|
|
515
|
+
} else {
|
|
516
|
+
this.loadData(userPageConfig?.hiddenColIds || defaultDisabledColIds, [], sortedColConfigs);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
this.getTabsOptions();
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// 卡片列表-更新列表分页数
|
|
523
|
+
handleCardListPageSize(preViewModels, viewModels) {
|
|
524
|
+
const { ltmplConfig, onChangePage, pageSize, pageNo } = this.props;
|
|
525
|
+
const { defaultPageSize } = ltmplConfig || {};
|
|
526
|
+
const preIsCard = preViewModels.includes("cardList");
|
|
527
|
+
const isCard = viewModels.includes("cardList");
|
|
528
|
+
let temPageSizes = defPageSizeOptions;
|
|
529
|
+
let temPageSize = defaultPageSize;
|
|
530
|
+
if ((!preIsCard && !isCard) || (preIsCard && isCard)) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (!preIsCard && isCard) { // 普通切换到Card
|
|
534
|
+
temPageSizes = Array.from({ length: 7 }, (_, i) => ltmplConfig.rowCardCount * Math.pow(2, i));
|
|
535
|
+
temPageSize = temPageSizes.includes(Number(pageSize)) ? pageSize : (temPageSizes.includes(Number(defaultPageSize)) ? defaultPageSize : temPageSizes[1]);
|
|
536
|
+
} else if (preIsCard && !isCard) { // card切换到普通
|
|
537
|
+
temPageSize = defPageSizeOptions.includes(Number(pageSize)) ? pageSize : (defPageSizeOptions.includes(Number(defaultPageSize)) ? defaultPageSize : defPageSizeOptions[1]);
|
|
538
|
+
}
|
|
539
|
+
this.setState({ pageSizeOptions: temPageSizes });
|
|
540
|
+
onChangePage(pageNo || 1, temPageSize, temPageSizes);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
async componentDidUpdate(prevProps, prevState) {
|
|
544
|
+
const { sourceId, criteriaData, ltmplConfig, tableType, pageSize, pageNo, userPageConfig, defShowType } = this.props;
|
|
545
|
+
// const {userCriteriaData:preUserCriteriaData}=prevState;
|
|
546
|
+
const { userCriteriaData } = this.state;
|
|
547
|
+
const { translate } = this.context;
|
|
548
|
+
let {
|
|
549
|
+
ltmplConfig: preLtmplConfig,
|
|
550
|
+
criteriaData: preCriteriaData,
|
|
551
|
+
sourceId: preSourceId, pageSize: prePageSize, pageNo: prePageNo,
|
|
552
|
+
userPageConfig: preUserPageConfig
|
|
553
|
+
} = prevProps;
|
|
554
|
+
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
555
|
+
return false;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (prePageSize != pageSize || pageNo != prePageNo) {
|
|
559
|
+
this.setState({
|
|
560
|
+
pageInfo: { pageNo, pageSize },
|
|
561
|
+
userCriteriaData: criteriaData,
|
|
562
|
+
})
|
|
563
|
+
}
|
|
564
|
+
if (!preUserPageConfig && userPageConfig) {
|
|
565
|
+
this.setState({ viewModels: userPageConfig?.["viewModels"] || [defShowType || ltmplConfig?.showType || "table"] });
|
|
566
|
+
}
|
|
567
|
+
if (!_.isEqual(prevState.viewModels, this.state.viewModels)) { // 显示视图变化-更改卡片列表分页条数
|
|
568
|
+
this.handleCardListPageSize(prevState.viewModels, this.state.viewModels);
|
|
569
|
+
}
|
|
570
|
+
let { hiddenColIds, sortedColConfigs } = this.state;
|
|
571
|
+
let currentQueryParams = ProgramConfig.transQueryParamsToStr(criteriaData, false, [
|
|
572
|
+
"pageSize",
|
|
573
|
+
"pageNo",
|
|
574
|
+
]);
|
|
575
|
+
let preCurrentQueryParams = ProgramConfig.transQueryParamsToStr(userCriteriaData, false, [
|
|
576
|
+
"pageSize",
|
|
577
|
+
"pageNo",
|
|
578
|
+
]);
|
|
579
|
+
if ((sourceId && preSourceId != sourceId) ||
|
|
580
|
+
(ltmplConfig &&
|
|
581
|
+
(!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id)) ||
|
|
582
|
+
((currentQueryParams != preCurrentQueryParams) &&
|
|
583
|
+
(!criteriaData['menuId'] || preCriteriaData.menuId == criteriaData['menuId']))
|
|
584
|
+
) {
|
|
585
|
+
//5秒后允许再次请求数据
|
|
586
|
+
//refresh=false;
|
|
587
|
+
if (preLtmplConfig && ltmplConfig.id == preLtmplConfig.id) {
|
|
588
|
+
await this.loadData(hiddenColIds, [], sortedColConfigs);
|
|
589
|
+
} else {
|
|
590
|
+
let sColConfigs = undefined;
|
|
591
|
+
const { sortedColIds } = userPageConfig || {};
|
|
592
|
+
if (ltmplConfig) {
|
|
593
|
+
sColConfigs = tableType == 'report' ? ltmplConfig.columns : [
|
|
594
|
+
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
595
|
+
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
596
|
+
...ltmplConfig.columns,
|
|
597
|
+
];
|
|
598
|
+
if (sortedColIds) { // 使用缓存的列排序
|
|
599
|
+
sColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
await this.loadData(userPageConfig?.hiddenColIds || defaultDisabledColIds, [], sColConfigs);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
} else {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
isSameSourceQuery = (sourceId, criteriaData) => {
|
|
611
|
+
if (sourceId && criteriaData && (criteriaData['sourceId'] && criteriaData['sourceId'] != sourceId)
|
|
612
|
+
|| (criteriaData['menuId'] && criteriaData['menuId'] != sourceId)) {
|
|
613
|
+
return false;
|
|
614
|
+
} else {
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
handleShowChart = () => {
|
|
620
|
+
this.setState({
|
|
621
|
+
showL2Chart: !this.state.showL2Chart,
|
|
622
|
+
});
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
handleDataAnalysis = () => {
|
|
626
|
+
this.setState({
|
|
627
|
+
showL2ActTable: !this.state.showL2ActTable,
|
|
628
|
+
});
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
unHiden = () => {
|
|
632
|
+
const { ltmplConfig } = this.props;
|
|
633
|
+
const { hiddenColIds, sortedColConfigs } = this.state;
|
|
634
|
+
this.setState({
|
|
635
|
+
hiddenRowCodes: [],
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
onHide = (code: string) => {
|
|
640
|
+
const { hiddenRowCodes } = this.state;
|
|
641
|
+
let hiddenCodes = [...hiddenRowCodes, code];
|
|
642
|
+
this.setState({
|
|
643
|
+
hiddenRowCodes: hiddenCodes,
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
changeViewModel = (viewModels) => {
|
|
648
|
+
const { setUserPageConfig } = this.props;
|
|
649
|
+
const { hiddenColIds, hiddenRowCodes, sortedColConfigs, viewModels: oldViewModels } = this.state;
|
|
650
|
+
setUserPageConfig({ viewModels });
|
|
651
|
+
this.setState({ viewModels }, () => {
|
|
652
|
+
if (viewModels.length && viewModels.includes("ganttChart") !== oldViewModels.includes("ganttChart")) {
|
|
653
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs); // 前后选择是否存在甘特图,刷新数据
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
changeHiddenColumns = (hiddenColIds: string[]) => {
|
|
659
|
+
const { setUserPageConfig } = this.props;
|
|
660
|
+
this.setState({ showL2Chart: false, hiddenColIds });
|
|
661
|
+
setUserPageConfig({ hiddenColIds });
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
665
|
+
const { selectedRows } = this.state;
|
|
666
|
+
this.doAction(actionId, selectedRows, params);
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
670
|
+
const { serverKey } = this.props;
|
|
671
|
+
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
672
|
+
this.setState({
|
|
673
|
+
loading: true,
|
|
674
|
+
});
|
|
675
|
+
let result: boolean = await HcserviceV3.postActions(
|
|
676
|
+
serverKey,
|
|
677
|
+
actionId,
|
|
678
|
+
selectedRows,
|
|
679
|
+
params
|
|
680
|
+
);
|
|
681
|
+
if (result) {
|
|
682
|
+
//重新加载数据
|
|
683
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
684
|
+
} else {
|
|
685
|
+
this.setState({
|
|
686
|
+
loading: false,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
692
|
+
this.doAction(actionId, [{ title: undefined, code: codes[0] }], params);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
doDelete = async () => {
|
|
696
|
+
const { sourceId, serverKey, mainCode } = this.props;
|
|
697
|
+
const {
|
|
698
|
+
selectedRows,
|
|
699
|
+
hiddenColIds,
|
|
700
|
+
hiddenRowCodes,
|
|
701
|
+
sortedColConfigs,
|
|
702
|
+
} = this.state;
|
|
703
|
+
this.setState({
|
|
704
|
+
loading: true,
|
|
705
|
+
});
|
|
706
|
+
let result: boolean = await HcserviceV3.deleteData(
|
|
707
|
+
serverKey,
|
|
708
|
+
sourceId,
|
|
709
|
+
selectedRows,
|
|
710
|
+
mainCode
|
|
711
|
+
);
|
|
712
|
+
if (result) {
|
|
713
|
+
//重新加载数据
|
|
714
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
715
|
+
} else {
|
|
716
|
+
this.setState({
|
|
717
|
+
loading: false,
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
doDeleteByCode = async (record: DtmplData) => {
|
|
723
|
+
const { sourceId, serverKey, mainCode, doDelete, deleteCallback } = this.props;
|
|
724
|
+
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
725
|
+
this.setState({
|
|
726
|
+
loading: true,
|
|
727
|
+
});
|
|
728
|
+
let result: boolean = await HcserviceV3.deleteByCode(
|
|
729
|
+
serverKey,
|
|
730
|
+
sourceId,
|
|
731
|
+
[record.code],
|
|
732
|
+
mainCode
|
|
733
|
+
);
|
|
734
|
+
if (result) {
|
|
735
|
+
//重新加载数据
|
|
736
|
+
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
737
|
+
doDelete && doDelete(record.code);
|
|
738
|
+
deleteCallback && deleteCallback(record);
|
|
739
|
+
this.setState({ loading: false, delModalOpen: false, recordCode: undefined, record: undefined });
|
|
740
|
+
} else {
|
|
741
|
+
this.setState({ loading: false });
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
doSelectedCQuery = async (cqueryId: string) => { };
|
|
746
|
+
|
|
747
|
+
doJump = async (jump: JumpConfig, record_: DtmplData) => {
|
|
748
|
+
let record = record_.fieldMap ? record_.fieldMap : record_;
|
|
749
|
+
const version = localStorage.getItem("version") || "";
|
|
750
|
+
|
|
751
|
+
let url = null;
|
|
752
|
+
let path = jump.path;
|
|
753
|
+
if (!path) {
|
|
754
|
+
path = "/";
|
|
755
|
+
}
|
|
756
|
+
//是否以http开头
|
|
757
|
+
if (path?.indexOf("#") == 0 || url?.indexOf("/#") == 0) {
|
|
758
|
+
url = "";
|
|
759
|
+
} else if (
|
|
760
|
+
path.indexOf("http://") == 0 ||
|
|
761
|
+
path.indexOf("HTTP://") == 0 ||
|
|
762
|
+
path.indexOf("https://") == 0 ||
|
|
763
|
+
path.indexOf("HTTPS://") == 0
|
|
764
|
+
) {
|
|
765
|
+
url = path.split("//")[0] + "//";
|
|
766
|
+
path = path.split("//")[1];
|
|
767
|
+
} else {
|
|
768
|
+
url = `/#/${version}`;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
//处理路由参数
|
|
772
|
+
let paths = path.split("/");
|
|
773
|
+
|
|
774
|
+
let routeParamConfigs = jump.routeParams;
|
|
775
|
+
if (routeParamConfigs) {
|
|
776
|
+
for (let i = 0; i < paths.length; i++) {
|
|
777
|
+
if (paths[i].indexOf(":") == 0) {
|
|
778
|
+
let pa = paths[i].substring(1);
|
|
779
|
+
//根据参数名匹配参数
|
|
780
|
+
for (let p of routeParamConfigs) {
|
|
781
|
+
if (p && pa == p.title) {
|
|
782
|
+
//赋值替换
|
|
783
|
+
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
784
|
+
paths[i] = v;
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
url = ProgramConfig.joinPath(url, paths.join("/"));
|
|
791
|
+
} else {
|
|
792
|
+
url = ProgramConfig.joinPath(url, path);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
//处理search 参数
|
|
796
|
+
let searchParamConfigs = jump.searchParams;
|
|
797
|
+
let searchs = [];
|
|
798
|
+
//放入token
|
|
799
|
+
if (jump.tokenName) {
|
|
800
|
+
searchs[0] = jump.tokenName + "=" + ProgramConfig.hydrocarbonToken();
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (searchParamConfigs) {
|
|
804
|
+
let initSearchLength = searchs.length;
|
|
805
|
+
for (let i = 0; i < searchParamConfigs.length; i++) {
|
|
806
|
+
let p = searchParamConfigs[i];
|
|
807
|
+
let v = record[p.id] ? record[p.id] : p.defaultValue;
|
|
808
|
+
if (!v && p.title == "code") {
|
|
809
|
+
v = record_.code;
|
|
810
|
+
}
|
|
811
|
+
searchs[initSearchLength + i] = p.title + "=" + v;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
if (searchs.length > 0) {
|
|
815
|
+
if (url.indexOf("?") != url.length - 1) {
|
|
816
|
+
url = url + "?";
|
|
817
|
+
}
|
|
818
|
+
url = url + searchs.join("&");
|
|
819
|
+
}
|
|
820
|
+
if (jump.linkTarget == '_self') {
|
|
821
|
+
window.location.hash = url.substring(url.indexOf("#") + 1);
|
|
822
|
+
} else {
|
|
823
|
+
debugger
|
|
824
|
+
if (url.indexOf("/#") == 0) {
|
|
825
|
+
// url=window.location.href.split("#/")[0]+url;
|
|
826
|
+
url = window.location.href.split("#/")[0] + url.substring(url.indexOf("/#") + 1);
|
|
827
|
+
}
|
|
828
|
+
window.open(url);
|
|
829
|
+
}
|
|
830
|
+
// if (
|
|
831
|
+
// url.indexOf("#") == 0 ||
|
|
832
|
+
// url.indexOf("/#") == 0 ||
|
|
833
|
+
// url.indexOf("//#") == 0
|
|
834
|
+
// ) {
|
|
835
|
+
// window.location.hash = url.substring(url.indexOf("#") + 1);
|
|
836
|
+
// } else {
|
|
837
|
+
// window.open(url);
|
|
838
|
+
// }
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
blockMenuTreeDrawerOpen = (record) => {
|
|
842
|
+
this.setState({
|
|
843
|
+
blockMenuTreeDrawerOpen: true,
|
|
844
|
+
recordCode: record.code,
|
|
845
|
+
record
|
|
846
|
+
})
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
doRowJump = async (jump: JumpConfig, record: DtmplData) => {
|
|
850
|
+
this.doJump(jump, record);
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
renderExportButton = (title, type: ExportType, sourceId?: string) => {
|
|
854
|
+
const { pageNo, pageSize, serverKey, ltmplConfig, tableType } = this.props;
|
|
855
|
+
|
|
856
|
+
//let buttons = ltmplConfig?.buttons;
|
|
857
|
+
|
|
858
|
+
const { queryKey } = this.state;
|
|
859
|
+
const { translate } = this.context;
|
|
860
|
+
let exportModes: ExportMode[] = tableType == "report" ?
|
|
861
|
+
["all"] : ["current", "page", "all"];
|
|
862
|
+
|
|
863
|
+
return (
|
|
864
|
+
<Popover
|
|
865
|
+
content={
|
|
866
|
+
<ExportFrame //导出组件
|
|
867
|
+
currentPage={{
|
|
868
|
+
pageNo: pageNo ? pageNo : 1,
|
|
869
|
+
pageSize: pageSize ? pageSize : ltmplConfig.defaultPageSize,
|
|
870
|
+
}}
|
|
871
|
+
exportModes={exportModes}
|
|
872
|
+
type={type}
|
|
873
|
+
serverKey={serverKey}
|
|
874
|
+
queryKey={queryKey}
|
|
875
|
+
sourceId={sourceId}
|
|
876
|
+
title={translate(
|
|
877
|
+
"${" + ltmplConfig.title + "}" + "-" + "${" + title + "}"
|
|
878
|
+
)}
|
|
879
|
+
/>
|
|
880
|
+
}
|
|
881
|
+
title={translate("${" + title + "}")}
|
|
882
|
+
placement="bottomRight"
|
|
883
|
+
trigger="click"
|
|
884
|
+
>
|
|
885
|
+
<Tooltip title={translate("${" + title + "}")}>
|
|
886
|
+
<Button
|
|
887
|
+
style={{
|
|
888
|
+
// marginLeft: "5px",
|
|
889
|
+
}}
|
|
890
|
+
//为了点击到没有导出模块,使组件不致销毁,丢失导出数据
|
|
891
|
+
>{type == "ltmpl-data-excel" ? <ExportOutlined /> : title}
|
|
892
|
+
</Button>
|
|
893
|
+
</Tooltip>
|
|
894
|
+
</Popover>
|
|
895
|
+
);
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
renderFileExportButton = () => {
|
|
899
|
+
const { ltmplConfig } = this.props;
|
|
900
|
+
let fileExports = ltmplConfig?.topFileExports;
|
|
901
|
+
if (fileExports) {
|
|
902
|
+
return fileExports.map((fileExport) => {
|
|
903
|
+
return this.renderExportButton(
|
|
904
|
+
fileExport.title,
|
|
905
|
+
"ltmpl-data-filedata",
|
|
906
|
+
fileExport.id
|
|
907
|
+
);
|
|
908
|
+
});
|
|
909
|
+
} else {
|
|
910
|
+
return <></>;
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
doSelectedJump = async (jump: JumpConfig) => {
|
|
915
|
+
const { selectedDatas } = this.state;
|
|
916
|
+
if (selectedDatas.length == 1) {
|
|
917
|
+
this.doJump(jump, selectedDatas[0]);
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
changeRowSelection = (
|
|
922
|
+
selectedRows: SelectedRow[],
|
|
923
|
+
selectedDatas: DtmplData[]
|
|
924
|
+
) => {
|
|
925
|
+
const { onSelectChange } = this.props;
|
|
926
|
+
this.setState({ selectedRows, selectedDatas });
|
|
927
|
+
if (onSelectChange) {
|
|
928
|
+
onSelectChange({ selectedRows, selectedDatas });
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
onChangeColSort = (sortedColConfigs: ColumnConfig[]) => {
|
|
933
|
+
const { setUserPageConfig } = this.props;
|
|
934
|
+
this.setState({ sortedColConfigs });
|
|
935
|
+
const sortedColIds = sortedColConfigs.map(r => r.id);
|
|
936
|
+
setUserPageConfig({ sortedColIds });
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// 更新本地缓存列宽度
|
|
940
|
+
onChangeResize = (colResize: { [key: string]: number }) => {
|
|
941
|
+
const { setUserPageConfig, userPageConfig } = this.props;
|
|
942
|
+
const oldColResize = userPageConfig?.colResize || {};
|
|
943
|
+
setUserPageConfig({ colResize: { ...oldColResize, ...colResize } });
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
getAddTmplButton = (classAddConfigs: ClassAddConfig[]) => {
|
|
947
|
+
const { translate } = this.context;
|
|
948
|
+
if (classAddConfigs && classAddConfigs.length < 1) {
|
|
949
|
+
return translate("${没有分类添加按钮}");
|
|
950
|
+
}
|
|
951
|
+
return classAddConfigs.map((config) => {
|
|
952
|
+
return (
|
|
953
|
+
<p>
|
|
954
|
+
<Button
|
|
955
|
+
size={"small"}
|
|
956
|
+
type={"text"}
|
|
957
|
+
onClick={() => this.props.doCreate(config.id, false)}
|
|
958
|
+
>
|
|
959
|
+
{config.title}
|
|
960
|
+
</Button>
|
|
961
|
+
</p>
|
|
962
|
+
);
|
|
963
|
+
});
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
// 重置当前页面配置
|
|
967
|
+
handleResetUserPageConfig = () => {
|
|
968
|
+
const { resetUserPageConfig, ltmplConfig, tableType, defShowType } = this.props;
|
|
969
|
+
const { translate } = this.context;
|
|
970
|
+
let sortedColConfigs = undefined;
|
|
971
|
+
if (ltmplConfig) {
|
|
972
|
+
sortedColConfigs = tableType === 'report' ? ltmplConfig.columns : [
|
|
973
|
+
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
974
|
+
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
975
|
+
...ltmplConfig.columns,
|
|
976
|
+
];
|
|
977
|
+
}
|
|
978
|
+
this.setState({ viewModels: [defShowType || ltmplConfig.showType || "table"], hiddenColIds: defaultDisabledColIds, sortedColConfigs });
|
|
979
|
+
resetUserPageConfig();
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// 更新当前页面配置
|
|
983
|
+
handleUpdateUserPageConfig = (val: { [key: string]: any }) => {
|
|
984
|
+
const { sortedColIds, hiddenColIds, viewModels, criteriaData } = val || {};
|
|
985
|
+
const { setUserPageConfig, ltmplConfig, tableType, defShowType, menuId } = this.props;
|
|
986
|
+
const { userCriteriaData } = this.state;
|
|
987
|
+
const { translate } = this.context;
|
|
988
|
+
let sortedColConfigs = undefined;
|
|
989
|
+
if (ltmplConfig) {
|
|
990
|
+
sortedColConfigs = tableType === 'report' ? ltmplConfig.columns : [
|
|
991
|
+
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
992
|
+
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
993
|
+
...ltmplConfig.columns,
|
|
994
|
+
];
|
|
995
|
+
}
|
|
996
|
+
if (sortedColIds) { // 页面配置更新列排序
|
|
997
|
+
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
998
|
+
}
|
|
999
|
+
// 旧过滤参数设置为空
|
|
1000
|
+
const oldParms = Object.keys(userCriteriaData || {}).reduce((total, item) => { total[item] = ""; return total; }, {});
|
|
1001
|
+
this.actTableDoSearch({ ...oldParms, ...(criteriaData || { menuId }) });
|
|
1002
|
+
this.setState({ userCriteriaData: criteriaData, viewModels: viewModels || [defShowType || ltmplConfig.showType || "table"], hiddenColIds: hiddenColIds || defaultDisabledColIds, sortedColConfigs });
|
|
1003
|
+
setUserPageConfig({ ...val, criteriaData: undefined });
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
renderHeaderButtons = () => {
|
|
1007
|
+
let {
|
|
1008
|
+
hiddenColIds, viewModels, sortedColConfigs, disabledColIds, showL2Chart,
|
|
1009
|
+
showL2ActTable, restatParams, userCriteriaData
|
|
1010
|
+
} = this.state;
|
|
1011
|
+
const {
|
|
1012
|
+
ltmplConfig, sourceId, doCreate, doSearch, menuId,
|
|
1013
|
+
funcMode, customCreatable, serverKey, readOnly, userPageConfig, allowUserConfig
|
|
1014
|
+
} = this.props;
|
|
1015
|
+
const { translate } = this.context;
|
|
1016
|
+
let { buttons } = ltmplConfig;
|
|
1017
|
+
const version = localStorage.getItem("version") || "";
|
|
1018
|
+
|
|
1019
|
+
return (
|
|
1020
|
+
<>
|
|
1021
|
+
<Space>
|
|
1022
|
+
{userPageConfig && allowUserConfig ? <PageConfigButton menuCode={menuId} handleResetUserPageConfig={this.handleResetUserPageConfig} handleUpdateUserPageConfig={this.handleUpdateUserPageConfig} userCriteriaData={userCriteriaData} /> : ""}
|
|
1023
|
+
{funcMode == "common" && this.criteriaFormUseful() ? (
|
|
1024
|
+
<Popover trigger="click" content={this.renderCriteriaForm()}>
|
|
1025
|
+
<Button>
|
|
1026
|
+
<SearchOutlined />
|
|
1027
|
+
</Button>
|
|
1028
|
+
</Popover>
|
|
1029
|
+
) : null}
|
|
1030
|
+
{buttons.includes("ratmplSelect") && !readOnly ? (
|
|
1031
|
+
<Button onClick={() => this.setState({ showRatmplSelector: true })}>
|
|
1032
|
+
{translate("${选择}")}
|
|
1033
|
+
</Button>
|
|
1034
|
+
) : (
|
|
1035
|
+
""
|
|
1036
|
+
)}
|
|
1037
|
+
{buttons.includes("dtmplAdd") && doCreate && !readOnly ? (
|
|
1038
|
+
ltmplConfig.classAddConfigs &&
|
|
1039
|
+
ltmplConfig.classAddConfigs.length > 0 ? (
|
|
1040
|
+
<Popover
|
|
1041
|
+
arrow={false}
|
|
1042
|
+
content={this.getAddTmplButton(ltmplConfig.classAddConfigs)}
|
|
1043
|
+
placement="bottomRight"
|
|
1044
|
+
>
|
|
1045
|
+
<Tooltip>
|
|
1046
|
+
<Button>
|
|
1047
|
+
<PlusOutlined />
|
|
1048
|
+
</Button>
|
|
1049
|
+
</Tooltip>
|
|
1050
|
+
</Popover>
|
|
1051
|
+
) : (
|
|
1052
|
+
<Tooltip title={translate("${" + (ltmplConfig.createBtnTitle || "创建") + "}")}>
|
|
1053
|
+
<Button onClick={() => doCreate(null, false)}>
|
|
1054
|
+
<PlusOutlined />
|
|
1055
|
+
</Button>
|
|
1056
|
+
</Tooltip>
|
|
1057
|
+
)
|
|
1058
|
+
) : (
|
|
1059
|
+
""
|
|
1060
|
+
)}
|
|
1061
|
+
{(buttons.includes("dtmplCustomAdd") || customCreatable) &&
|
|
1062
|
+
doCreate &&
|
|
1063
|
+
!readOnly ? (
|
|
1064
|
+
<Tooltip title={translate("${" + (ltmplConfig.createBtnTitle || "创建") + "}")}>
|
|
1065
|
+
<Button onClick={() => doCreate(null, true)}>
|
|
1066
|
+
<PlusCircleOutlined />
|
|
1067
|
+
</Button>
|
|
1068
|
+
</Tooltip>
|
|
1069
|
+
) : (
|
|
1070
|
+
""
|
|
1071
|
+
)}
|
|
1072
|
+
{buttons.includes("importLtmplExcel") && !readOnly ? (
|
|
1073
|
+
<Tooltip title={translate("${导入}")}>
|
|
1074
|
+
<Button
|
|
1075
|
+
href={`#/${version}/${sourceId}/importer?menuId=${menuId}`}
|
|
1076
|
+
target={"_blank"}
|
|
1077
|
+
>
|
|
1078
|
+
<ImportOutlined />
|
|
1079
|
+
</Button>
|
|
1080
|
+
</Tooltip>
|
|
1081
|
+
) : (
|
|
1082
|
+
""
|
|
1083
|
+
)}
|
|
1084
|
+
{buttons.includes("exportLtmplExcel") && !readOnly
|
|
1085
|
+
? this.renderExportButton("导出", "ltmpl-data-excel")
|
|
1086
|
+
: ""}
|
|
1087
|
+
{this.renderFileExportButton()}
|
|
1088
|
+
{false
|
|
1089
|
+
&& buttons.includes("showChart") ? (
|
|
1090
|
+
<Tooltip
|
|
1091
|
+
title={
|
|
1092
|
+
showL2Chart
|
|
1093
|
+
? translate("${隐藏}${图表}")
|
|
1094
|
+
: translate("${展示}${图表}")
|
|
1095
|
+
}
|
|
1096
|
+
>
|
|
1097
|
+
<Button onClick={this.handleShowChart}>
|
|
1098
|
+
<LineChartOutlined />
|
|
1099
|
+
</Button>
|
|
1100
|
+
</Tooltip>
|
|
1101
|
+
) : (
|
|
1102
|
+
""
|
|
1103
|
+
)}
|
|
1104
|
+
{buttons.includes("analysis") ? (
|
|
1105
|
+
<Tooltip
|
|
1106
|
+
title={
|
|
1107
|
+
showL2ActTable
|
|
1108
|
+
? translate("${隐藏}${数据分析}")
|
|
1109
|
+
: translate("${展示}${数据分析}")
|
|
1110
|
+
}
|
|
1111
|
+
>
|
|
1112
|
+
<Button onClick={this.handleDataAnalysis}>
|
|
1113
|
+
<FundOutlined />
|
|
1114
|
+
</Button>
|
|
1115
|
+
</Tooltip>
|
|
1116
|
+
) : (
|
|
1117
|
+
""
|
|
1118
|
+
)}
|
|
1119
|
+
{buttons.includes("reStat") && !readOnly ? (
|
|
1120
|
+
<Restat
|
|
1121
|
+
value={restatParams}
|
|
1122
|
+
serverKey={serverKey}
|
|
1123
|
+
fields={ltmplConfig.reStatParams}
|
|
1124
|
+
sourceId={sourceId}
|
|
1125
|
+
onfinish={(restatParams) => {
|
|
1126
|
+
this.actTableDoSearch(null);
|
|
1127
|
+
this.setState({ restatParams: restatParams });
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
></Restat>
|
|
1131
|
+
) : (
|
|
1132
|
+
""
|
|
1133
|
+
)}
|
|
1134
|
+
<Popover
|
|
1135
|
+
content={
|
|
1136
|
+
<Checkbox.Group
|
|
1137
|
+
value={viewModels}
|
|
1138
|
+
onChange={this.changeViewModel}
|
|
1139
|
+
>
|
|
1140
|
+
<Row style={{ width: "120px" }}>
|
|
1141
|
+
<Col span={24}>
|
|
1142
|
+
<Checkbox value={"table"}>{translate("${表格}")}</Checkbox>
|
|
1143
|
+
</Col>
|
|
1144
|
+
<Col span={24}>
|
|
1145
|
+
<Checkbox value={"verticalList"}>
|
|
1146
|
+
{translate("${纵向列表}")}
|
|
1147
|
+
</Checkbox>
|
|
1148
|
+
</Col>
|
|
1149
|
+
<Col span={24}>
|
|
1150
|
+
<Checkbox value="cardList">
|
|
1151
|
+
{translate("${卡片列表}")}
|
|
1152
|
+
</Checkbox>
|
|
1153
|
+
</Col>
|
|
1154
|
+
<Col span={24}>
|
|
1155
|
+
<Checkbox value="ganttChart">
|
|
1156
|
+
{translate("${甘特图}")}
|
|
1157
|
+
</Checkbox>
|
|
1158
|
+
</Col>
|
|
1159
|
+
<Col span={24}>
|
|
1160
|
+
<Checkbox value="calendar">
|
|
1161
|
+
{translate("${日历}")}
|
|
1162
|
+
</Checkbox>
|
|
1163
|
+
</Col>
|
|
1164
|
+
{/*<Col span={24}><Checkbox value={'horizontalList'}>横向列表</Checkbox></Col>*/}
|
|
1165
|
+
</Row>
|
|
1166
|
+
</Checkbox.Group>
|
|
1167
|
+
}
|
|
1168
|
+
title={translate("${视图}")}
|
|
1169
|
+
placement="bottomRight"
|
|
1170
|
+
trigger="click"
|
|
1171
|
+
>
|
|
1172
|
+
<Tooltip title={translate("${选择视图}")}>
|
|
1173
|
+
<Button>
|
|
1174
|
+
<RetweetOutlined />
|
|
1175
|
+
</Button>
|
|
1176
|
+
</Tooltip>
|
|
1177
|
+
</Popover>
|
|
1178
|
+
<Popover
|
|
1179
|
+
content={
|
|
1180
|
+
<ColumnSelector
|
|
1181
|
+
columns={sortedColConfigs}
|
|
1182
|
+
disabledColIds={disabledColIds}
|
|
1183
|
+
hiddenColIds={hiddenColIds}
|
|
1184
|
+
onChangeColSort={this.onChangeColSort}
|
|
1185
|
+
onChangeHiddenCols={this.changeHiddenColumns}
|
|
1186
|
+
/>
|
|
1187
|
+
}
|
|
1188
|
+
title={translate("${排序和选择列}")}
|
|
1189
|
+
placement="bottomRight"
|
|
1190
|
+
trigger="click"
|
|
1191
|
+
>
|
|
1192
|
+
<Tooltip title={translate("${点击排序和选择列}")}>
|
|
1193
|
+
<Button>
|
|
1194
|
+
<TableOutlined />
|
|
1195
|
+
</Button>
|
|
1196
|
+
</Tooltip>
|
|
1197
|
+
</Popover>
|
|
1198
|
+
{doSearch ? (
|
|
1199
|
+
<Button
|
|
1200
|
+
className="hoverbig"
|
|
1201
|
+
title={translate("${刷新}")}
|
|
1202
|
+
onClick={() => {
|
|
1203
|
+
this.actTableDoSearch(null);
|
|
1204
|
+
}}
|
|
1205
|
+
>
|
|
1206
|
+
<ReloadOutlined />
|
|
1207
|
+
</Button>
|
|
1208
|
+
) : (
|
|
1209
|
+
""
|
|
1210
|
+
)}
|
|
1211
|
+
{/*<Tooltip title={translate("${常用配置}")}>*/}
|
|
1212
|
+
{/* <Button*/}
|
|
1213
|
+
{/* className="hoverbig"*/}
|
|
1214
|
+
{/* onClick={() => {*/}
|
|
1215
|
+
{/* //doSearch(null);*/}
|
|
1216
|
+
{/* }}*/}
|
|
1217
|
+
{/* >*/}
|
|
1218
|
+
{/* <SettingOutlined />*/}
|
|
1219
|
+
{/* </Button>*/}
|
|
1220
|
+
{/*</Tooltip>*/}
|
|
1221
|
+
|
|
1222
|
+
</Space>
|
|
1223
|
+
</>
|
|
1224
|
+
);
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
criteriaFormUseful = () => {
|
|
1228
|
+
const { ltmplConfig } = this.props;
|
|
1229
|
+
let { buttons, criteria, updrillButtonConfigs } = ltmplConfig;
|
|
1230
|
+
if (
|
|
1231
|
+
((buttons.includes("query") ||
|
|
1232
|
+
(updrillButtonConfigs && updrillButtonConfigs.length > 0)) &&
|
|
1233
|
+
((criteria && criteria.length > 0) ||
|
|
1234
|
+
buttons.includes("drilling"))) ||
|
|
1235
|
+
this.checkBoxUseful() || buttons.includes("multiRowEdit")
|
|
1236
|
+
) {
|
|
1237
|
+
return true;
|
|
1238
|
+
} else {
|
|
1239
|
+
return false;
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
checkBoxUseful = () => {
|
|
1244
|
+
const { ltmplConfig } = this.props;
|
|
1245
|
+
let { buttons, jumps, actions, fileExports, customButtons } = ltmplConfig;
|
|
1246
|
+
if (
|
|
1247
|
+
buttons.includes("batchDelete") ||
|
|
1248
|
+
(actions && actions.length > 0) || (customButtons && customButtons.length > 0) ||
|
|
1249
|
+
(jumps && jumps.length > 0) || (fileExports && fileExports.length > 0)
|
|
1250
|
+
) {
|
|
1251
|
+
return true;
|
|
1252
|
+
} else {
|
|
1253
|
+
return false;
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
actTableDoSearch = (data: object) => {
|
|
1258
|
+
const { ltreeData } = this.state;
|
|
1259
|
+
this.doSearch_(data, ltreeData);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
doSearch_ = async (criteriaData, ltreeData) => {
|
|
1263
|
+
const { doSearch } = this.props;
|
|
1264
|
+
|
|
1265
|
+
let new_serial_number = new Date().getTime();
|
|
1266
|
+
if (doSearch && new_serial_number - serial_number > 2000) {
|
|
1267
|
+
serial_number = new_serial_number;
|
|
1268
|
+
await doSearch({ ...criteriaData, serial_number, ...ltreeData });
|
|
1269
|
+
//busyReminderTime=0;
|
|
1270
|
+
// }else{
|
|
1271
|
+
// if(busyReminder){
|
|
1272
|
+
// if(busyReminderTime==1){
|
|
1273
|
+
// const { translate } = this.context;
|
|
1274
|
+
// message.warning(translate("${系统忙,请稍后再试}"));
|
|
1275
|
+
// busyReminderTime=0;
|
|
1276
|
+
// }else{
|
|
1277
|
+
// busyReminderTime=1;
|
|
1278
|
+
// }
|
|
1279
|
+
//}
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
ltreeValueChange = async (v) => {
|
|
1284
|
+
let ltreeEntitySelect = this.getLtreeEntitySelectCriteria();
|
|
1285
|
+
const { ltreeData } = this.state;
|
|
1286
|
+
const { criteriaData } = this.props;
|
|
1287
|
+
if (ltreeData && ltreeData["c_" + ltreeEntitySelect.id] != v) {
|
|
1288
|
+
let ltreeData_ = {};
|
|
1289
|
+
ltreeData_["c_" + ltreeEntitySelect.id] = v;
|
|
1290
|
+
await this.doSearch_(criteriaData, ltreeData_);
|
|
1291
|
+
this.setState({ ltreeData: ltreeData_ });
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
doSearchDirect = (data: object) => {
|
|
1297
|
+
|
|
1298
|
+
let { doSearch } = this.props;
|
|
1299
|
+
if (doSearch) {
|
|
1300
|
+
doSearch({ ...data, serial_number });
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
buttonClickable = () => {
|
|
1306
|
+
let new_serial_number = new Date().getTime();
|
|
1307
|
+
if (new_serial_number - serial_number > 1500) {
|
|
1308
|
+
serial_number = new_serial_number;
|
|
1309
|
+
return true;
|
|
1310
|
+
} else {
|
|
1311
|
+
return false;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
renderCriteriaForm = () => {
|
|
1316
|
+
let { loading, selectedRows, selectedDatas, userCriteriaData, editings, tabActiveKey, tabsOptions } = this.state;
|
|
1317
|
+
let { ltmplConfig, serverKey, sourceId } = this.props;
|
|
1318
|
+
const tabCriteriaId = tabsOptions.find(r => r.key === tabActiveKey)?.id;
|
|
1319
|
+
return (
|
|
1320
|
+
<CriteriaForm
|
|
1321
|
+
key={sourceId}
|
|
1322
|
+
serverKey={serverKey}
|
|
1323
|
+
loading={loading}
|
|
1324
|
+
selectedDatas={selectedDatas}
|
|
1325
|
+
selectedRows={selectedRows}
|
|
1326
|
+
doCustomButton={this.doCustomButton}
|
|
1327
|
+
ltmplConfig={ltmplConfig}
|
|
1328
|
+
data={userCriteriaData}
|
|
1329
|
+
doCQuery={this.doSelectedCQuery}
|
|
1330
|
+
doAction={this.doSelectedAction}
|
|
1331
|
+
doDelete={this.doDelete}
|
|
1332
|
+
doJump={this.doSelectedJump}
|
|
1333
|
+
doSearch={this.actTableDoSearch}
|
|
1334
|
+
doMultiRowEdit={this.doMultiRowEdit}
|
|
1335
|
+
multiRowEditDisabled={!editings.length}
|
|
1336
|
+
tabCriteriaId={tabCriteriaId}
|
|
1337
|
+
/>
|
|
1338
|
+
);
|
|
1339
|
+
};
|
|
1340
|
+
//暂时无用
|
|
1341
|
+
// queryTotal = async () => {
|
|
1342
|
+
// const { queryKey} = this.state;
|
|
1343
|
+
// const { serverKey }=this.props;
|
|
1344
|
+
// let aggregateVO:AggregateVO = await HcserviceV3.requestQueryAggregates(serverKey, queryKey.key);
|
|
1345
|
+
// this.setState({
|
|
1346
|
+
// aggregateVO,
|
|
1347
|
+
// });
|
|
1348
|
+
// return aggregateVO;
|
|
1349
|
+
// };
|
|
1350
|
+
|
|
1351
|
+
getLtreeEntitySelectCriteria = () => {
|
|
1352
|
+
let { ltmplConfig } = this.props
|
|
1353
|
+
|
|
1354
|
+
if (ltmplConfig && ltmplConfig.criteria) {
|
|
1355
|
+
for (let c of ltmplConfig.criteria) {
|
|
1356
|
+
if (c?.extControlType == "ltree-entity-select" || c?.extControlType == "ltree-entity-select-value") {
|
|
1357
|
+
return c;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
return undefined;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// 行内编辑start
|
|
1365
|
+
editRowEdit = (code: string) => {
|
|
1366
|
+
this.setState({ editings: [...this.state.editings, code] });
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
cancelRowEdit = (code: string) => {
|
|
1370
|
+
this.setState({ editings: this.state.editings.filter(r => r !== code) });
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// 单独提交
|
|
1374
|
+
postLtmplData = async (dtmplData) => {
|
|
1375
|
+
const { serverKey, sourceId } = this.props;
|
|
1376
|
+
let res = await HcserviceV3.postLtmplData(
|
|
1377
|
+
serverKey,
|
|
1378
|
+
sourceId,
|
|
1379
|
+
dtmplData,
|
|
1380
|
+
message
|
|
1381
|
+
);
|
|
1382
|
+
if (res.status === "success") {
|
|
1383
|
+
this.cancelRowEdit(dtmplData["唯一编码"]);
|
|
1384
|
+
this.actTableDoSearch(undefined);
|
|
1385
|
+
this.formRef.current.resetFields([]);
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
// 批量提交
|
|
1390
|
+
postLtmplMultiData = async (dtmplData) => {
|
|
1391
|
+
const { serverKey, sourceId } = this.props;
|
|
1392
|
+
let res = await HcserviceV3.postLtmplMultiData(
|
|
1393
|
+
serverKey,
|
|
1394
|
+
sourceId,
|
|
1395
|
+
dtmplData,
|
|
1396
|
+
message
|
|
1397
|
+
);
|
|
1398
|
+
if (res.status === "success") {
|
|
1399
|
+
this.cancelRowEdit(dtmplData["唯一编码"]);
|
|
1400
|
+
this.actTableDoSearch(undefined);
|
|
1401
|
+
this.formRef.current.resetFields([]); // 重置表单数据
|
|
1402
|
+
this.setState({ editings: [] });
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
saveRowData = async (data: DtmplData) => {
|
|
1407
|
+
const { code } = data;
|
|
1408
|
+
let currentForm = this.formRef.current;
|
|
1409
|
+
let dtmplData = { "唯一编码": code };
|
|
1410
|
+
await currentForm.validateFields().then((values) => {
|
|
1411
|
+
for (let key in values) {
|
|
1412
|
+
if (values.hasOwnProperty(key) && key.startsWith(code)) {
|
|
1413
|
+
dtmplData[key.split("_")[1]] = values[key];
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
this.postLtmplData(dtmplData);
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// 批量提交
|
|
1421
|
+
doMultiRowEdit = async () => {
|
|
1422
|
+
const { editings } = this.state;
|
|
1423
|
+
if (!editings.length) {
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1426
|
+
let currentForm = this.formRef.current;
|
|
1427
|
+
let dtmplData = {};
|
|
1428
|
+
await currentForm.validateFields().then((values) => {
|
|
1429
|
+
for (let key in values) {
|
|
1430
|
+
if (values.hasOwnProperty(key)) {
|
|
1431
|
+
const code = key.split("_")[0];
|
|
1432
|
+
if (editings.includes(code)) {
|
|
1433
|
+
dtmplData[code] = { "唯一编码": code, ...(dtmplData[code] || {}), [key.split("_")[1]]: (values[key] || values[key] === 0) ? values[key] : null }
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
this.postLtmplMultiData({ data: JSON.stringify(Object.values(dtmplData)) });
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
// 批量编辑表单值更新
|
|
1442
|
+
doRowEditFormChange = (data: { [key: string]: any }) => {
|
|
1443
|
+
const { editings } = this.state;
|
|
1444
|
+
const code = Object.keys(data)[0].split("_")[0];
|
|
1445
|
+
if (!editings.includes(code)) {
|
|
1446
|
+
this.setState({ editings: [...editings, code] });
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
// 行内编辑end
|
|
1450
|
+
|
|
1451
|
+
// 删除确认弹窗打开
|
|
1452
|
+
doDelModalOpen = (record: DtmplData) => {
|
|
1453
|
+
this.setState({ record, recordCode: record.code, delModalOpen: true });
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
// tab页切换查询
|
|
1457
|
+
doTabSearch = (val: string) => {
|
|
1458
|
+
const { tabsOptions, tabActiveKey } = this.state;
|
|
1459
|
+
let new_serial_number = new Date().getTime();
|
|
1460
|
+
if (new_serial_number - serial_number < 2000) return;
|
|
1461
|
+
if (tabActiveKey === val) return;
|
|
1462
|
+
const ids = tabsOptions.find(r => r.key === "all").ids || [];
|
|
1463
|
+
const item = tabsOptions.find(r => r.key === val);
|
|
1464
|
+
let params = ids?.reduce((total, cur) => {
|
|
1465
|
+
total[cur] = (val === "all" || cur !== item.id) ? undefined : val;
|
|
1466
|
+
return total;
|
|
1467
|
+
}, {});
|
|
1468
|
+
this.actTableDoSearch(params);
|
|
1469
|
+
this.setState({ tabActiveKey: val });
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
renderAggregates() { // 统计数据渲染
|
|
1473
|
+
const { aggregateVO } = this.state;
|
|
1474
|
+
const { ltmplConfig } = this.props;
|
|
1475
|
+
const aggregates = aggregateVO?.aggregates || [];
|
|
1476
|
+
const columns = ltmplConfig?.columns || [];
|
|
1477
|
+
return aggregates?.length ? <div className="aggregates">{aggregates.map(item => {
|
|
1478
|
+
const column = columns.find(r => r.id === item.fieldId);
|
|
1479
|
+
if (!column) {
|
|
1480
|
+
return "";
|
|
1481
|
+
}
|
|
1482
|
+
const { dataUnit, themeColor, themeIcon } = column;
|
|
1483
|
+
return <Card className="aggregate-card" hoverable styles={{ body: { padding: 20 } }}>
|
|
1484
|
+
<div style={{ display: "flex", alignItems: "start", justifyContent: "space-between" }}>
|
|
1485
|
+
<div style={{ width: "calc(100% - 40px)" }}>
|
|
1486
|
+
<p className="title">{item.fieldTitle}</p>
|
|
1487
|
+
<div className="value">
|
|
1488
|
+
<Text
|
|
1489
|
+
style={{ maxWidth: "100%" }}
|
|
1490
|
+
ellipsis={{ tooltip: item.value }}
|
|
1491
|
+
>
|
|
1492
|
+
<span className="number">{item.value}</span>
|
|
1493
|
+
</Text>
|
|
1494
|
+
{dataUnit ? <span className="unit">{dataUnit}</span> : ""}
|
|
1495
|
+
</div>
|
|
1496
|
+
</div>
|
|
1497
|
+
{themeIcon ?
|
|
1498
|
+
<div className="icon" style={{ color: themeColor, background: `${themeColor}26` }}>
|
|
1499
|
+
<Icon type={themeIcon} />
|
|
1500
|
+
</div> :
|
|
1501
|
+
""}
|
|
1502
|
+
</div>
|
|
1503
|
+
</Card>
|
|
1504
|
+
}).filter(Boolean)
|
|
1505
|
+
}</div > : "";
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
renderContent = () => {
|
|
1509
|
+
let {
|
|
1510
|
+
queryKey, loading, selectedRows, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable,
|
|
1511
|
+
pageInfo, editings, userCriteriaData, tabsOptions, tabActiveKey, pageSizeOptions
|
|
1512
|
+
} = this.state;
|
|
1513
|
+
let {
|
|
1514
|
+
mainCode, sourceId, ltmplConfig, funcMode, operatable,
|
|
1515
|
+
title, collapsible,
|
|
1516
|
+
onChangePage, serverKey, criteriaData, showEmpty, loadDataCallback,
|
|
1517
|
+
showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig,
|
|
1518
|
+
doEdit2D, doView2D
|
|
1519
|
+
} = this.props;
|
|
1520
|
+
const { translate } = this.context;
|
|
1521
|
+
|
|
1522
|
+
if (!ltmplConfig || !sourceId) {
|
|
1523
|
+
return (
|
|
1524
|
+
<>
|
|
1525
|
+
<Card loading={loading}></Card>
|
|
1526
|
+
<Table loading={loading}></Table>
|
|
1527
|
+
</>
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
let tableColumns = ColumnBuilder.buildTableColumns(
|
|
1532
|
+
{
|
|
1533
|
+
ltmplConfig, operatable,
|
|
1534
|
+
hiddenColIds, hiddenRowCodes, sortedColConfigs, showView,
|
|
1535
|
+
doEdit,
|
|
1536
|
+
doRAction, customEditable,
|
|
1537
|
+
serverKey, readOnly,
|
|
1538
|
+
sourceId, translate, unHiden: this.unHiden,
|
|
1539
|
+
onHide: this.onHide, doCustomButton: this.doCustomButton, doRowJump: this.doRowJump,
|
|
1540
|
+
blockMenuTreeDrawerOpen: this.blockMenuTreeDrawerOpen,
|
|
1541
|
+
doRowAction: this.doRowAction, doDeleteByCode: this.doDeleteByCode, sortColumns: criteriaData["sortColIds"],
|
|
1542
|
+
editings, editRowEdit: this.editRowEdit, cancelRowEdit: this.cancelRowEdit, saveRowData: this.saveRowData,
|
|
1543
|
+
doDelModalOpen: this.doDelModalOpen, mainCode, criteriaData: userCriteriaData, actTableDoSearch: this.actTableDoSearch,
|
|
1544
|
+
columnResize: userPageConfig?.colResize, doEdit2D, doView2D
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
|
|
1548
|
+
let { buttons, extDisplayConfig, rowCardCount, customViewPagePath, splitTabShowType } = ltmplConfig;
|
|
1549
|
+
let { primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols } = extDisplayConfig;
|
|
1550
|
+
let displayCriteriaCard: boolean = false;
|
|
1551
|
+
if (funcMode == "simple" || funcMode == "common") {
|
|
1552
|
+
displayCriteriaCard = false;
|
|
1553
|
+
} else if (this.criteriaFormUseful()) {
|
|
1554
|
+
displayCriteriaCard = true;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
let columnConfigs = [];
|
|
1558
|
+
if (sortedColConfigs) {
|
|
1559
|
+
for (let colConfig of sortedColConfigs) {
|
|
1560
|
+
if (!hiddenColIds.includes(colConfig.id)) {
|
|
1561
|
+
columnConfigs.push(colConfig);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
const sortColumnData = [];
|
|
1567
|
+
if (Array.isArray(criteriaData["sortColIds"])) {
|
|
1568
|
+
sortColumnData.push(...criteriaData["sortColIds"]);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
let ltreeEntitySelect = this.getLtreeEntitySelectCriteria();
|
|
1572
|
+
|
|
1573
|
+
// actTable渲染
|
|
1574
|
+
const renderActTable = loading ? (
|
|
1575
|
+
<Table loading={loading}></Table>
|
|
1576
|
+
) : (tableType == "report" ? <ReportTable
|
|
1577
|
+
tableProps={{ scrollY: ltmplConfig.scrollY, clickDisplayTotal: !ltmplConfig.directShowTotal }}
|
|
1578
|
+
serverKey={serverKey} hiddenColIds={hiddenColIds}
|
|
1579
|
+
maxSelectedRows={this.checkBoxUseful() ? 1000 : -1}
|
|
1580
|
+
columns={tableColumns}
|
|
1581
|
+
selectedRows={selectedRows} queryKey={queryKey}
|
|
1582
|
+
onChangeRowSelection={this.changeRowSelection}
|
|
1583
|
+
leftFixedCols={ltmplConfig.leftFixedCols}
|
|
1584
|
+
onChangeResize={this.onChangeResize}
|
|
1585
|
+
showEmpty={showEmpty}
|
|
1586
|
+
/> :
|
|
1587
|
+
<QueryTable key={"querytable" + sourceId} sourceId={sourceId}
|
|
1588
|
+
// queryTotal={this.queryTotal}
|
|
1589
|
+
tableProps={{ scrollY: ltmplConfig.scrollY, clickDisplayTotal: !ltmplConfig.directShowTotal }}
|
|
1590
|
+
serverKey={serverKey}
|
|
1591
|
+
onChangePage={onChangePage}
|
|
1592
|
+
viewModels={viewModels}
|
|
1593
|
+
primaryColumn={primaryColumn}
|
|
1594
|
+
columnConfigs={columnConfigs} summaryConfigs={ltmplConfig.totalColumnConfigs}
|
|
1595
|
+
maxSelectedRows={this.props?.tableType === "select" || this.checkBoxUseful() ? 10000 : -1}
|
|
1596
|
+
selectedRows={selectedRows} columns={tableColumns}
|
|
1597
|
+
hiddenRowCodes={hiddenRowCodes}
|
|
1598
|
+
pageInfo={pageInfo}
|
|
1599
|
+
queryKey={queryKey}
|
|
1600
|
+
onChangeRowSelection={this.changeRowSelection}
|
|
1601
|
+
subtotalXColumn={
|
|
1602
|
+
ltmplConfig.subtotalXColumn == null ||
|
|
1603
|
+
ltmplConfig.subtotalXColumn.length <= 0
|
|
1604
|
+
? null
|
|
1605
|
+
: ltmplConfig.subtotalXColumn
|
|
1606
|
+
}
|
|
1607
|
+
groupIColumns={ltmplConfig.groupIColumns}
|
|
1608
|
+
doSearch={this.actTableDoSearch}
|
|
1609
|
+
sortColumnData={sortColumnData}
|
|
1610
|
+
cardListConfig={{ primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, rowCardCount, buttons, customViewPagePath, mainCode }}
|
|
1611
|
+
ltmplConfig={ltmplConfig}
|
|
1612
|
+
showView={showView}
|
|
1613
|
+
showPagination={showPagination}
|
|
1614
|
+
onChangeAggregateVO={(val) => this.setState({ aggregateVO: val })}
|
|
1615
|
+
onChangeResize={this.onChangeResize}
|
|
1616
|
+
pageSizeOptions={pageSizeOptions}
|
|
1617
|
+
showEmpty={showEmpty}
|
|
1618
|
+
loadDataCallback={loadDataCallback}
|
|
1619
|
+
/>);
|
|
1620
|
+
|
|
1621
|
+
// tab拆解条件渲染
|
|
1622
|
+
const renderSplitTab = <>
|
|
1623
|
+
{splitTabShowType === "tab" ? <Tabs tabBarGutter={12} size="small" activeKey={tabActiveKey} items={tabsOptions} onChange={this.doTabSearch} tabBarExtraContent={this.renderHeaderButtons()} /> : ""}
|
|
1624
|
+
{splitTabShowType === "tag" ? <div className="split-tab" ><Space className="split-tab-left" >{tabsOptions.map(r => <Button style={{ height: "28px" }} size="small" onClick={() => this.doTabSearch(r.key)} shape="round" type={tabActiveKey === r.key ? "primary" : "default"}>{r.title}</Button>)}</Space><div className="split-tab-right">{this.renderHeaderButtons()}</div></div> : ""}
|
|
1625
|
+
{splitTabShowType === "radio" ? <div className="split-tab" ><div className="split-tab-left"><Radio.Group onChange={(e) => this.doTabSearch(e.target.value)} value={tabActiveKey} options={tabsOptions} /></div><div className="split-tab-right">{this.renderHeaderButtons()}</div></div> : ""}
|
|
1626
|
+
</>;
|
|
1627
|
+
|
|
1628
|
+
return (
|
|
1629
|
+
<>
|
|
1630
|
+
{buttons.includes("analysis") && showL2ActTable ? (
|
|
1631
|
+
<div>
|
|
1632
|
+
<L2ActTable
|
|
1633
|
+
serverKey={serverKey}
|
|
1634
|
+
innerQueryKey={queryKey.key}
|
|
1635
|
+
sourceId={sourceId}
|
|
1636
|
+
/>
|
|
1637
|
+
<Divider
|
|
1638
|
+
dashed
|
|
1639
|
+
style={{ borderTopColor: "#40a9ff" }}
|
|
1640
|
+
plain
|
|
1641
|
+
></Divider>
|
|
1642
|
+
</div>
|
|
1643
|
+
) : (
|
|
1644
|
+
""
|
|
1645
|
+
)}
|
|
1646
|
+
<div className="actTable">
|
|
1647
|
+
<Row>
|
|
1648
|
+
<Col span={24}>
|
|
1649
|
+
{funcMode == "complete" || funcMode == "common" ? (
|
|
1650
|
+
collapsible ? null : (
|
|
1651
|
+
<span>
|
|
1652
|
+
{ltmplConfig.header ? (
|
|
1653
|
+
<div
|
|
1654
|
+
style={{ padding: "6px" }}
|
|
1655
|
+
dangerouslySetInnerHTML={{ __html: ltmplConfig.header }}
|
|
1656
|
+
></div>
|
|
1657
|
+
) : null}
|
|
1658
|
+
{tabsOptions.length ? renderSplitTab :
|
|
1659
|
+
<>
|
|
1660
|
+
<h3 >
|
|
1661
|
+
<p className="act-table-title" style={{ position: "relative", float: "left", marginBottom: "4px" }}> {!title
|
|
1662
|
+
? translate("${" + ltmplConfig.title + "}")
|
|
1663
|
+
: typeof title == "string"
|
|
1664
|
+
? translate("${" + title + "}")
|
|
1665
|
+
: title}</p>
|
|
1666
|
+
</h3>
|
|
1667
|
+
<p className="fr" style={{ marginBottom: "4px" }}>{this.renderHeaderButtons()}</p>
|
|
1668
|
+
</>}
|
|
1669
|
+
</span>
|
|
1670
|
+
)
|
|
1671
|
+
) : null}
|
|
1672
|
+
</Col>
|
|
1673
|
+
</Row>
|
|
1674
|
+
{(<Row><Col span={24}><Layout hasSider style={{ backgroundColor: "#fff" }}>
|
|
1675
|
+
<Sider
|
|
1676
|
+
width={ltreeEntitySelect ? 260 : 0}
|
|
1677
|
+
theme={"light"}
|
|
1678
|
+
style={{
|
|
1679
|
+
paddingRight: ltreeEntitySelect ? '10px' : "0px"
|
|
1680
|
+
}}
|
|
1681
|
+
>
|
|
1682
|
+
{ltreeEntitySelect ?
|
|
1683
|
+
<EntryControl style={{ width: "300px" }} onChange={this.ltreeValueChange} fieldConfig={ltreeEntitySelect}></EntryControl>
|
|
1684
|
+
// <NavigationTree fieldConfig={ltreeEntitySelect} />
|
|
1685
|
+
: null}
|
|
1686
|
+
</Sider>
|
|
1687
|
+
<Layout style={{ backgroundColor: "#fff" }}>
|
|
1688
|
+
<Content style={{ overflow: "initial" }}>
|
|
1689
|
+
{showAggregates ? this.renderAggregates() : ""}
|
|
1690
|
+
{displayCriteriaCard ? this.renderCriteriaForm() : null}
|
|
1691
|
+
{buttons.includes("rowEdit") ? <AntdForm ref={this.formRef} component={false} onValuesChange={this.doRowEditFormChange}>{renderActTable}</AntdForm> : renderActTable}
|
|
1692
|
+
</Content>
|
|
1693
|
+
</Layout>
|
|
1694
|
+
</Layout></Col></Row>
|
|
1695
|
+
)}
|
|
1696
|
+
{/*此处放页脚*/}
|
|
1697
|
+
{ltmplConfig.footer ? (
|
|
1698
|
+
<div
|
|
1699
|
+
style={{ padding: "6px" }}
|
|
1700
|
+
dangerouslySetInnerHTML={{ __html: ltmplConfig.footer }}
|
|
1701
|
+
></div>
|
|
1702
|
+
) : null}
|
|
1703
|
+
</div>
|
|
1704
|
+
</>
|
|
1705
|
+
);
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
saveRatmplSelect = async (selectedRows: SelectedRow[]) => {
|
|
1709
|
+
this.setState({
|
|
1710
|
+
showRatmplSelector: false,
|
|
1711
|
+
});
|
|
1712
|
+
const { serverKey, sourceId, mainCode, doSearch } = this.props;
|
|
1713
|
+
if (!selectedRows || selectedRows.length <= 0) {
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
//查询
|
|
1718
|
+
const codes: string[] = [];
|
|
1719
|
+
for (let row of selectedRows) {
|
|
1720
|
+
codes.push(row.code);
|
|
1721
|
+
}
|
|
1722
|
+
await HcserviceV3.saveRatmplSelectCodes(
|
|
1723
|
+
serverKey,
|
|
1724
|
+
sourceId,
|
|
1725
|
+
mainCode,
|
|
1726
|
+
codes
|
|
1727
|
+
);
|
|
1728
|
+
this.actTableDoSearch(null);
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1731
|
+
render() {
|
|
1732
|
+
let { queryKey, loading, blockMenuTreeDrawerOpen, recordCode, record, showRatmplSelector, delModalOpen } = this.state;
|
|
1733
|
+
let { sourceId, ltmplConfig, title, collapsible, initCollapse, tip, serverKey, mainCode } = this.props;
|
|
1734
|
+
const { strongDeleteConfirmText } = ltmplConfig || {};
|
|
1735
|
+
const { translate } = this.context;
|
|
1736
|
+
const delFormRef = React.createRef<FormInstance>(); // 强删除表单的form Ref
|
|
1737
|
+
|
|
1738
|
+
if (!ltmplConfig || !sourceId) {
|
|
1739
|
+
return (
|
|
1740
|
+
<>
|
|
1741
|
+
<Card loading={loading}></Card>
|
|
1742
|
+
<Table loading={loading}></Table>
|
|
1743
|
+
</>
|
|
1744
|
+
);
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
return (
|
|
1748
|
+
<>
|
|
1749
|
+
{this.renderAboveCustomPage()}
|
|
1750
|
+
{collapsible ? (
|
|
1751
|
+
<CollapseCard
|
|
1752
|
+
initCollapse={initCollapse}
|
|
1753
|
+
title={
|
|
1754
|
+
<>
|
|
1755
|
+
{!title ? ltmplConfig.title : title}
|
|
1756
|
+
<ToolTipBar
|
|
1757
|
+
content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
|
|
1758
|
+
/>
|
|
1759
|
+
</>
|
|
1760
|
+
}
|
|
1761
|
+
id={queryKey + ltmplConfig.id}
|
|
1762
|
+
className={`hoverable`}
|
|
1763
|
+
styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
|
|
1764
|
+
loading={loading}
|
|
1765
|
+
//暂时注释掉,后续要支持配置。
|
|
1766
|
+
extra={this.renderHeaderButtons()}
|
|
1767
|
+
>
|
|
1768
|
+
{this.renderContent()}
|
|
1769
|
+
</CollapseCard>
|
|
1770
|
+
) : (
|
|
1771
|
+
<>{this.renderContent()}</>
|
|
1772
|
+
)}
|
|
1773
|
+
{this.renderOhterCustomPage()}
|
|
1774
|
+
<BlockMenuTreeDrawer
|
|
1775
|
+
onOk={() => {
|
|
1776
|
+
this.setState({
|
|
1777
|
+
blockMenuTreeDrawerOpen: false,
|
|
1778
|
+
});
|
|
1779
|
+
}}
|
|
1780
|
+
onCancel={() => {
|
|
1781
|
+
this.setState({
|
|
1782
|
+
blockMenuTreeDrawerOpen: false,
|
|
1783
|
+
});
|
|
1784
|
+
}}
|
|
1785
|
+
open={blockMenuTreeDrawerOpen}
|
|
1786
|
+
roleCode={recordCode}
|
|
1787
|
+
/>
|
|
1788
|
+
{showRatmplSelector ? (
|
|
1789
|
+
<ModelSelectTable
|
|
1790
|
+
serverKey={serverKey}
|
|
1791
|
+
// defaultCriteriaValue={fieldGroupConfig.defaultCriteriaValue}
|
|
1792
|
+
// maxSelectedRows={fieldGroupConfig.max}
|
|
1793
|
+
open={showRatmplSelector}
|
|
1794
|
+
onOK={this.saveRatmplSelect}
|
|
1795
|
+
onCancel={() => {
|
|
1796
|
+
this.setState({ showRatmplSelector: false });
|
|
1797
|
+
}}
|
|
1798
|
+
mainCode={mainCode}
|
|
1799
|
+
sourceId={sourceId}
|
|
1800
|
+
existRelation={"false"}
|
|
1801
|
+
/>
|
|
1802
|
+
) : ""}
|
|
1803
|
+
{delModalOpen ?
|
|
1804
|
+
<Modal
|
|
1805
|
+
open={delModalOpen}
|
|
1806
|
+
title={translate("${确定要[删除]此数据吗}?")}
|
|
1807
|
+
onOk={() => delFormRef.current.validateFields().then(() => this.doDeleteByCode(record)).catch(() => { })}
|
|
1808
|
+
onCancel={() => this.setState({ record: undefined, recordCode: undefined, delModalOpen: false })}
|
|
1809
|
+
>
|
|
1810
|
+
<AntdForm ref={delFormRef} layout="vertical">
|
|
1811
|
+
<AntdForm.Item noStyle >
|
|
1812
|
+
<Alert message={translate("${风险操作,此操作不可逆,是否继续操作}?")} type="warning" showIcon style={{ margin: "12px 0" }} />
|
|
1813
|
+
</AntdForm.Item>
|
|
1814
|
+
<AntdForm.Item
|
|
1815
|
+
label={<div>{translate("${请手动输入}")}<span style={{ color: "#ff4d4f" }}> “ {translate("${" + strongDeleteConfirmText + "}")} ” </span>{translate("${完成验证}")}</div>}
|
|
1816
|
+
name="rule"
|
|
1817
|
+
rules={[
|
|
1818
|
+
{ required: true, message: translate("${请输入}" + "${" + strongDeleteConfirmText + "}") },
|
|
1819
|
+
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入}" + "${" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1820
|
+
]}
|
|
1821
|
+
>
|
|
1822
|
+
<Input placeholder={translate("${" + strongDeleteConfirmText + "}")} />
|
|
1823
|
+
</AntdForm.Item>
|
|
1824
|
+
</AntdForm>
|
|
1825
|
+
</Modal> : ""}
|
|
1826
|
+
</>
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
export default ActTable;
|