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,658 +1,658 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./index.css";
|
|
3
|
-
import {
|
|
4
|
-
DtmplData,
|
|
5
|
-
PageInfo,
|
|
6
|
-
QueryData,
|
|
7
|
-
SelectedRow, QueryTableProps, AggregateVO
|
|
8
|
-
} from "../tmpl/interface";
|
|
9
|
-
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
-
import Pagination from "./pagination";
|
|
11
|
-
import { TableRowSelection } from "antd/lib/table/interface";
|
|
12
|
-
import { SortableContainer, SortableElement } from "react-sortable-hoc";
|
|
13
|
-
import { arrayMoveImmutable } from "array-move";
|
|
14
|
-
import { LocaleContext } from "../locale/LocaleProvider";
|
|
15
|
-
import { init, merge, statistic } from "../utils/dsu";
|
|
16
|
-
import VerticalList from "../list/vertical-list";
|
|
17
|
-
import CardList from "../list/card-list";
|
|
18
|
-
import Gantt from "../list/gantt";
|
|
19
|
-
import Calendar from "../list/calendar";
|
|
20
|
-
import SummaryBuilder from "./column/summary-builder";
|
|
21
|
-
import { Button, Card, Descriptions, message, Statistic, Empty } from "antd";
|
|
22
|
-
import Units from "../units";
|
|
23
|
-
import { DownOutlined, UpOutlined } from "@ant-design/icons";
|
|
24
|
-
import ResizableTable from "./resizable-table";
|
|
25
|
-
|
|
26
|
-
const SortableItem = SortableElement((props) => (
|
|
27
|
-
<tr className="sortable-item-hover" {...props} />
|
|
28
|
-
));
|
|
29
|
-
const SortableBody = SortableContainer((props) => <tbody {...props} />);
|
|
30
|
-
|
|
31
|
-
interface CacheData {
|
|
32
|
-
dataSource: object[];
|
|
33
|
-
pageInfo: PageInfo;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
interface QueryTableStat {
|
|
38
|
-
queryDataCache?: Map<string, CacheData>;
|
|
39
|
-
virtualEndPageNo?: number;
|
|
40
|
-
dataSource?: object[];
|
|
41
|
-
loading?: boolean;
|
|
42
|
-
touchEnd?: boolean;
|
|
43
|
-
aggregateVO?: AggregateVO;
|
|
44
|
-
beforeSelectedRows?: number;
|
|
45
|
-
errorText?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
49
|
-
static defaultProps = {
|
|
50
|
-
pageInfo: {
|
|
51
|
-
pageNo: 1,
|
|
52
|
-
pageSize: 10,
|
|
53
|
-
virtualEndPageNo: undefined,
|
|
54
|
-
},
|
|
55
|
-
tableProps: {
|
|
56
|
-
size: "small",
|
|
57
|
-
clickDisplayTotal: false,
|
|
58
|
-
scrollY: 500,
|
|
59
|
-
},
|
|
60
|
-
hiddenRowCodes: [],
|
|
61
|
-
selectedRows: [],
|
|
62
|
-
viewModels: ["table"],
|
|
63
|
-
summaryConfigs: [],
|
|
64
|
-
cardListConfig: {},
|
|
65
|
-
ltmplConfig: {},
|
|
66
|
-
showPagination: true,
|
|
67
|
-
showEmpty: true,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
defaultAggregateShowSize = 7;
|
|
71
|
-
|
|
72
|
-
state = {
|
|
73
|
-
queryDataCache: undefined,
|
|
74
|
-
virtualEndPageNo: undefined,
|
|
75
|
-
dataSource: undefined,
|
|
76
|
-
loading: true,
|
|
77
|
-
touchEnd: undefined,
|
|
78
|
-
aggregateVO: undefined,
|
|
79
|
-
beforeSelectedRows: undefined,
|
|
80
|
-
errorText: undefined
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
static contextType = LocaleContext;
|
|
84
|
-
context: React.ContextType<typeof LocaleContext>;
|
|
85
|
-
|
|
86
|
-
async componentDidMount() {
|
|
87
|
-
const { queryKey, pageInfo } = this.props;
|
|
88
|
-
if (queryKey) {
|
|
89
|
-
await this.loadData(queryKey.key, pageInfo);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
componentWillUnmount() {
|
|
94
|
-
this.setState = () => false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async componentDidUpdate(prevProps) {
|
|
98
|
-
const { queryKey: preQueryKey, pageInfo: prePageInfo } = prevProps;
|
|
99
|
-
const { queryKey, pageInfo, sourceId } = this.props;
|
|
100
|
-
|
|
101
|
-
if (queryKey) {
|
|
102
|
-
|
|
103
|
-
if (preQueryKey?.key != queryKey.key) {
|
|
104
|
-
await this.loadData(queryKey.key, pageInfo, true);
|
|
105
|
-
} else if (
|
|
106
|
-
prePageInfo?.pageNo != pageInfo.pageNo ||
|
|
107
|
-
prePageInfo?.pageSize != pageInfo.pageSize
|
|
108
|
-
) {
|
|
109
|
-
await this.loadData(queryKey.key, pageInfo, false);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
DraggableContainer = (props) => (
|
|
115
|
-
<SortableBody
|
|
116
|
-
useDragHandle
|
|
117
|
-
disableAutoscroll
|
|
118
|
-
helperClass="row-dragging"
|
|
119
|
-
onSortEnd={this.onSortEnd}
|
|
120
|
-
{...props}
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
DraggableBodyRow = ({ className, style, ...restProps }) => {
|
|
125
|
-
const { dataSource } = this.state;
|
|
126
|
-
if (dataSource) {
|
|
127
|
-
const index = dataSource.findIndex(
|
|
128
|
-
(x) => x.key === restProps["data-row-key"]
|
|
129
|
-
);
|
|
130
|
-
return <SortableItem key={index} index={index} {...restProps} />;
|
|
131
|
-
} else {
|
|
132
|
-
return <></>;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
onSortEnd = ({ oldIndex, newIndex }) => {
|
|
137
|
-
const { dataSource } = this.state;
|
|
138
|
-
if (oldIndex !== newIndex) {
|
|
139
|
-
const newData = arrayMoveImmutable(
|
|
140
|
-
[].concat(dataSource),
|
|
141
|
-
oldIndex,
|
|
142
|
-
newIndex
|
|
143
|
-
).filter((el) => !!el);
|
|
144
|
-
//console.log('Sorted items: ', newData);
|
|
145
|
-
this.setState({ dataSource: newData });
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
loadData = async (
|
|
150
|
-
queryKey: string,
|
|
151
|
-
pageInfo: PageInfo,
|
|
152
|
-
cleanCache?: boolean
|
|
153
|
-
) => {
|
|
154
|
-
this.setState({ loading: true, errorText: undefined });
|
|
155
|
-
let { queryDataCache } = this.state;
|
|
156
|
-
const { translate } = this.context;
|
|
157
|
-
let { serverKey, tableProps, viewModels, ltmplConfig, loadDataCallback } = this.props;
|
|
158
|
-
let queryCache: Map<string, CacheData>;
|
|
159
|
-
if (cleanCache || !queryDataCache) {
|
|
160
|
-
queryCache = new Map<string, CacheData>();
|
|
161
|
-
this.setState({ aggregateVO: undefined });
|
|
162
|
-
} else {
|
|
163
|
-
queryCache = queryDataCache;
|
|
164
|
-
}
|
|
165
|
-
if (queryCache.has(pageInfo?.pageNo + "_" + pageInfo?.pageSize)) {
|
|
166
|
-
let cacheData = queryCache.get(
|
|
167
|
-
pageInfo?.pageNo + "_" + pageInfo?.pageSize
|
|
168
|
-
);
|
|
169
|
-
this.setState({
|
|
170
|
-
dataSource: cacheData.dataSource,
|
|
171
|
-
virtualEndPageNo: cacheData.pageInfo.virtualEndPageNo,
|
|
172
|
-
loading: false,
|
|
173
|
-
});
|
|
174
|
-
} else {
|
|
175
|
-
let queryData: QueryData = await HcserviceV3.requestQueryData(
|
|
176
|
-
serverKey,
|
|
177
|
-
queryKey,
|
|
178
|
-
pageInfo
|
|
179
|
-
);
|
|
180
|
-
if (queryData?.key !== queryKey) {
|
|
181
|
-
this.setState({ loading: false, errorText: translate("${查询异常}"), dataSource: [] });
|
|
182
|
-
if (loadDataCallback) loadDataCallback([]); // 请求数据回调函数
|
|
183
|
-
return;
|
|
184
|
-
} else {
|
|
185
|
-
let dataSource: object[] = [];
|
|
186
|
-
pageInfo = queryData?.pageInfo;
|
|
187
|
-
if (queryData?.entities) {
|
|
188
|
-
queryData.entities.forEach((item, index) => {
|
|
189
|
-
let row = {
|
|
190
|
-
key: item.code,
|
|
191
|
-
code: item.code, //增加code,为了删除操作
|
|
192
|
-
...item.fieldMap,
|
|
193
|
-
index,
|
|
194
|
-
};
|
|
195
|
-
dataSource.push(row);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
let touchEnd = queryData?.touchEnd;
|
|
199
|
-
|
|
200
|
-
if (viewModels.includes("ganttChart") && ltmplConfig.gttSubOpenRatmplId) {
|
|
201
|
-
// 存在甘特图展示组件,并且存在树形结构,表格同步开启树形结构
|
|
202
|
-
dataSource = dataSource.map(item => ({ ...item, children: [] }));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
//缓存数据
|
|
206
|
-
queryCache.set(pageInfo?.pageNo + "_" + pageInfo?.pageSize, {
|
|
207
|
-
dataSource,
|
|
208
|
-
pageInfo,
|
|
209
|
-
});
|
|
210
|
-
this.setState({
|
|
211
|
-
beforeSelectedRows: queryData.beforeSelectedRows,
|
|
212
|
-
dataSource,
|
|
213
|
-
virtualEndPageNo: pageInfo.virtualEndPageNo,
|
|
214
|
-
queryDataCache: queryCache,
|
|
215
|
-
touchEnd,
|
|
216
|
-
loading: false,
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
if (loadDataCallback) { // 请求数据回调函数
|
|
220
|
-
loadDataCallback(dataSource);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (!tableProps.clickDisplayTotal) {
|
|
224
|
-
await this.queryTotal();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// }
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
pageTo = async (pageNo: number, pageSize: number) => {
|
|
233
|
-
const { onChangePage } = this.props;
|
|
234
|
-
// const { virtualEndPageNo } = this.state;
|
|
235
|
-
// let pageInfo = {
|
|
236
|
-
// pageNo,
|
|
237
|
-
// pageSize: pageSize ? pageSize : 10,
|
|
238
|
-
// virtualEndPageNo,
|
|
239
|
-
// };
|
|
240
|
-
//const { queryKey } = this.props;
|
|
241
|
-
//await this.loadData(queryKey.key, pageInfo);
|
|
242
|
-
onChangePage(pageNo, pageSize);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
queryTotal = async () => {
|
|
246
|
-
const { queryKey, serverKey, queryTotal, onChangeAggregateVO } = this.props;
|
|
247
|
-
const { aggregateVO: stateAggregateVO } = this.state;
|
|
248
|
-
let aggregateVO;
|
|
249
|
-
if (stateAggregateVO && stateAggregateVO.queryKey == queryKey.key) {
|
|
250
|
-
return false;
|
|
251
|
-
} else {
|
|
252
|
-
if (queryTotal) {
|
|
253
|
-
aggregateVO = await queryTotal();
|
|
254
|
-
} else {
|
|
255
|
-
aggregateVO = await HcserviceV3.requestQueryAggregates(serverKey, queryKey.key);
|
|
256
|
-
}
|
|
257
|
-
onChangeAggregateVO && onChangeAggregateVO(aggregateVO);
|
|
258
|
-
this.setState({ aggregateVO });
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
getRowSelection = () => {
|
|
263
|
-
const {
|
|
264
|
-
columns,
|
|
265
|
-
onChangeRowSelection,
|
|
266
|
-
selectedRows,
|
|
267
|
-
maxSelectedRows,
|
|
268
|
-
primaryColumn,
|
|
269
|
-
} = this.props;
|
|
270
|
-
let { dataSource, beforeSelectedRows } = this.state;
|
|
271
|
-
let selectedRowKeys = [];
|
|
272
|
-
|
|
273
|
-
for (let row of selectedRows) {
|
|
274
|
-
selectedRowKeys.push(row.code);
|
|
275
|
-
}
|
|
276
|
-
const allRowKeys: string[] = [];
|
|
277
|
-
if (dataSource) {
|
|
278
|
-
for (let d of dataSource) {
|
|
279
|
-
allRowKeys.push(d.code);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
let tmplMax = maxSelectedRows ? maxSelectedRows : 0;
|
|
284
|
-
if (beforeSelectedRows > 0) {
|
|
285
|
-
tmplMax = tmplMax - beforeSelectedRows;
|
|
286
|
-
}
|
|
287
|
-
const { translate } = this.context;
|
|
288
|
-
if (tmplMax <= -1) {
|
|
289
|
-
return null;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (beforeSelectedRows > 0 && tmplMax <= 0) {
|
|
293
|
-
message.warning(translate("${已选超}"));
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const rowSelection: TableRowSelection<any> = {
|
|
298
|
-
|
|
299
|
-
fixed: true,
|
|
300
|
-
type: maxSelectedRows == 1 ? "radio" : "checkbox",
|
|
301
|
-
selectedRowKeys,
|
|
302
|
-
onChange: (selectedRowKeys, selectedRows) => {
|
|
303
|
-
if (tmplMax > 0 && selectedRowKeys.length > tmplMax) {
|
|
304
|
-
message.error(translate("${最多只能选择}") + " : " + tmplMax);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
let selectedRows_: SelectedRow[] = [];
|
|
308
|
-
let selectedDatas: DtmplData[] = [];
|
|
309
|
-
let titleColId = primaryColumn?.id;
|
|
310
|
-
if (!titleColId) {
|
|
311
|
-
columns.forEach((col) => {
|
|
312
|
-
if (col.title != "序号" && titleColId == null) {
|
|
313
|
-
titleColId = col.dataIndex;
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
selectedRows.forEach((item) => {
|
|
319
|
-
selectedRows_.push({ code: item["code"], title: item[titleColId] });
|
|
320
|
-
selectedDatas.push(item);
|
|
321
|
-
});
|
|
322
|
-
if (onChangeRowSelection) {
|
|
323
|
-
onChangeRowSelection(selectedRows_, selectedDatas, allRowKeys);
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
};
|
|
327
|
-
return rowSelection;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
getUnHidenDataSource = () => {
|
|
331
|
-
const { dataSource } = this.state;
|
|
332
|
-
const { hiddenRowCodes } = this.props;
|
|
333
|
-
let ds: object[] = [];
|
|
334
|
-
if (dataSource) {
|
|
335
|
-
for (let d of dataSource) {
|
|
336
|
-
if (!hiddenRowCodes.includes(d.code)) {
|
|
337
|
-
ds.push(d);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return ds;
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
mergeRowInCol(data, rowIdx, colIdx, mergeMp, calNum) {
|
|
345
|
-
const idx = rowIdx * calNum + colIdx;
|
|
346
|
-
// console.log(rowIdx, colIdx, mergeMp[idx]);
|
|
347
|
-
if (mergeMp[idx] !== undefined)
|
|
348
|
-
return {
|
|
349
|
-
rowSpan: mergeMp[idx].length,
|
|
350
|
-
};
|
|
351
|
-
return { rowSpan: 0 };
|
|
352
|
-
// return {};
|
|
353
|
-
}
|
|
354
|
-
sort_serial_number = new Date().getTime();
|
|
355
|
-
|
|
356
|
-
onChange(pagination, filters, sorter, extra) {
|
|
357
|
-
console.log("params", pagination, filters, sorter, extra);
|
|
358
|
-
if (extra.action === "sort") {
|
|
359
|
-
let new_sort_serial_number = new Date().getTime();
|
|
360
|
-
if (new_sort_serial_number - this.sort_serial_number < 2000) {
|
|
361
|
-
const { translate } = this.context;
|
|
362
|
-
message.warning(translate("${系统忙,请稍后再试}"));
|
|
363
|
-
return;
|
|
364
|
-
} else {
|
|
365
|
-
this.sort_serial_number = new_sort_serial_number;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
const extParams: Record<string, string> = {};
|
|
369
|
-
const sortColumnData = JSON.parse(
|
|
370
|
-
JSON.stringify(this.props.sortColumnData)
|
|
371
|
-
);
|
|
372
|
-
if (sorter.order === "ascend") {
|
|
373
|
-
Object.assign(extParams, {
|
|
374
|
-
sortColIds: [sorter.field + "_" + "asc"],
|
|
375
|
-
});
|
|
376
|
-
} else if (sorter.order === "descend") {
|
|
377
|
-
Object.assign(extParams, {
|
|
378
|
-
sortColIds: [sorter.field + "_" + "desc"],
|
|
379
|
-
});
|
|
380
|
-
} else {
|
|
381
|
-
Object.assign(extParams, {
|
|
382
|
-
sortColIds: [],
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
this.props.doSearch(extParams);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// 更新树形结构子节点
|
|
390
|
-
updateChildrenById = (data, parentCode, childrenData) => {
|
|
391
|
-
const newData = data.map(node => {
|
|
392
|
-
const newNode = { ...node };
|
|
393
|
-
if (node.code === parentCode) {
|
|
394
|
-
// 找到目标节点,更新children
|
|
395
|
-
newNode.children = childrenData;
|
|
396
|
-
} else if (node.children && node.children.length > 0) {
|
|
397
|
-
// 递归更新子节点
|
|
398
|
-
newNode.children = this.updateChildrenById(node.children, parentCode, childrenData);
|
|
399
|
-
}
|
|
400
|
-
return newNode;
|
|
401
|
-
});
|
|
402
|
-
return newData;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// 懒加载子节点
|
|
406
|
-
getChildrenData = async (parentCode: string) => {
|
|
407
|
-
const { ltmplConfig, pageInfo } = this.props;
|
|
408
|
-
let { queryDataCache, dataSource } = this.state;
|
|
409
|
-
this.setState({ loading: true });
|
|
410
|
-
let res = await HcserviceV3.requestLtmplQueryTop(null, ltmplConfig?.gttSubOpenRatmplId, { mainCode: parentCode });
|
|
411
|
-
const childrenData = res?.entities?.map((r, index) => ({
|
|
412
|
-
key: r.code,
|
|
413
|
-
code: r.code,
|
|
414
|
-
...r.fieldMap,
|
|
415
|
-
index,
|
|
416
|
-
children: []
|
|
417
|
-
})) || [];
|
|
418
|
-
const newData = this.updateChildrenById(dataSource, parentCode, childrenData);
|
|
419
|
-
this.setState({ dataSource: newData, loading: false });
|
|
420
|
-
// 更新数据缓存
|
|
421
|
-
queryDataCache.set(pageInfo?.pageNo + "_" + pageInfo?.pageSize, {
|
|
422
|
-
dataSource,
|
|
423
|
-
pageInfo,
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
render() {
|
|
428
|
-
const {
|
|
429
|
-
pageInfo, queryKey,
|
|
430
|
-
columns,
|
|
431
|
-
viewModels,
|
|
432
|
-
summaryConfigs,
|
|
433
|
-
subtotalXColumn,
|
|
434
|
-
tableProps,
|
|
435
|
-
groupIColumns,
|
|
436
|
-
hiddenRowCodes,
|
|
437
|
-
columnConfigs,
|
|
438
|
-
serverKey,
|
|
439
|
-
cardListConfig,
|
|
440
|
-
ltmplConfig,
|
|
441
|
-
showView,
|
|
442
|
-
showPagination,
|
|
443
|
-
onChangeResize,
|
|
444
|
-
pageSizeOptions,
|
|
445
|
-
onChangePage,
|
|
446
|
-
showEmpty
|
|
447
|
-
} = this.props;
|
|
448
|
-
//debugger
|
|
449
|
-
const { touchEnd, aggregateVO, loading, virtualEndPageNo, dataSource, errorText } = this.state;
|
|
450
|
-
const isProSumarryTable = Boolean(subtotalXColumn);
|
|
451
|
-
// 是否是树形表格(存在甘特图视图展示且存在展开关系)
|
|
452
|
-
const isTreeTable = viewModels.includes("ganttChart") && ltmplConfig.gttSubOpenRatmplId;
|
|
453
|
-
const { translate } = this.context;
|
|
454
|
-
const {
|
|
455
|
-
proSummaryTableColumns,
|
|
456
|
-
proSummaryTableData,
|
|
457
|
-
} = SummaryBuilder.handleProSummaryTable({ subtotalXColumn, columns, data: this.getUnHidenDataSource(), translate, groupIColumns });
|
|
458
|
-
let current_cols = isProSumarryTable ? proSummaryTableColumns : columns ? columns : [];
|
|
459
|
-
let table_x = 20;
|
|
460
|
-
current_cols.forEach((c) => { table_x = table_x + (c.width ? c.width : 140); });
|
|
461
|
-
let dat = this.getUnHidenDataSource();
|
|
462
|
-
const originData = isProSumarryTable ? proSummaryTableData : dat;
|
|
463
|
-
|
|
464
|
-
let summary = (pageData1) => {
|
|
465
|
-
return SummaryBuilder.summary({
|
|
466
|
-
translate, summaryConfigs,
|
|
467
|
-
pageData: dat, columns,
|
|
468
|
-
rowSelection: this.getRowSelection(), groupIColumns
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// console.log("%crender data: ", "color: red", originData);
|
|
473
|
-
// console.log("%crender col: ", "color: red", current_cols);
|
|
474
|
-
|
|
475
|
-
if (ltmplConfig.displayTotal) { // 显示合计判断
|
|
476
|
-
const washOriginData = originData.map((i, idx) => {
|
|
477
|
-
const data = {};
|
|
478
|
-
current_cols.forEach((col) => {
|
|
479
|
-
data[col["dataIndex"]] = i[col["dataIndex"]];
|
|
480
|
-
});
|
|
481
|
-
data["1"] = idx;
|
|
482
|
-
return data;
|
|
483
|
-
});
|
|
484
|
-
// console.log("清洗原始数据: ", washOriginData);
|
|
485
|
-
// 一列中多行预处理
|
|
486
|
-
const dateOf2D = Array.from({ length: washOriginData.length })
|
|
487
|
-
.fill(0)
|
|
488
|
-
.map(() => Array.from({ length: current_cols.length }).fill(0));
|
|
489
|
-
washOriginData.forEach((row, rowIdx) => {
|
|
490
|
-
current_cols.forEach((col, colIdx) => {
|
|
491
|
-
dateOf2D[rowIdx][colIdx] = row[col["dataIndex"]];
|
|
492
|
-
});
|
|
493
|
-
});
|
|
494
|
-
console.log("dataOf2D: ", dateOf2D);
|
|
495
|
-
init(washOriginData.length * current_cols.length + 10);
|
|
496
|
-
for (let i = 1; i < dateOf2D.length; i++) {
|
|
497
|
-
let flag = false;
|
|
498
|
-
if (Array.isArray(groupIColumns) && groupIColumns.length > 0) {
|
|
499
|
-
groupIColumns.forEach(({ title, sourceId }) => {
|
|
500
|
-
if (
|
|
501
|
-
washOriginData[i][title] !== undefined &&
|
|
502
|
-
washOriginData[i][title] !== washOriginData[i - 1][title]
|
|
503
|
-
) {
|
|
504
|
-
return (flag = true);
|
|
505
|
-
}
|
|
506
|
-
if (
|
|
507
|
-
washOriginData[i][sourceId] !== undefined &&
|
|
508
|
-
washOriginData[i][sourceId] !== washOriginData[i - 1][sourceId]
|
|
509
|
-
) {
|
|
510
|
-
return (flag = true);
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
} else {
|
|
514
|
-
flag = true;
|
|
515
|
-
}
|
|
516
|
-
for (let j = 0; j < dateOf2D[i].length; j++)
|
|
517
|
-
if (dateOf2D[i][j] === "小计" || dateOf2D[i][j] === "合计") flag = true;
|
|
518
|
-
for (let j = 0; j < dateOf2D[i - 1].length; j++)
|
|
519
|
-
if (dateOf2D[i - 1][j] === "小计" || dateOf2D[i - 1][j] === "合计")
|
|
520
|
-
flag = true;
|
|
521
|
-
if (flag) continue;
|
|
522
|
-
for (let j = 0; j < dateOf2D[i].length; j++) {
|
|
523
|
-
if (dateOf2D[i][j] === dateOf2D[i - 1][j])
|
|
524
|
-
merge(i * dateOf2D[i].length + j, (i - 1) * dateOf2D[i].length + j);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
const mergeMp = statistic();
|
|
528
|
-
//console.log("统计结果", mergeMp);
|
|
529
|
-
// 给 col 添加 mergeRowInCol
|
|
530
|
-
current_cols.forEach(
|
|
531
|
-
(col, colIdx) =>
|
|
532
|
-
(col.onCell = (_, rowIdx) =>
|
|
533
|
-
this.mergeRowInCol(_, rowIdx, colIdx, mergeMp, current_cols.length))
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return (
|
|
538
|
-
<>
|
|
539
|
-
{/*{viewModels.includes("table") ? (*/}
|
|
540
|
-
{/* <Table*/}
|
|
541
|
-
{/* size={tableProps.size ? tableProps.size : undefined}*/}
|
|
542
|
-
{/* rowSelection={this.getRowSelection()}*/}
|
|
543
|
-
{/* columns={current_cols}*/}
|
|
544
|
-
{/* dataSource={originData}*/}
|
|
545
|
-
{/* scroll={*/}
|
|
546
|
-
{/* tableProps.scrollY == -1 || tableProps.scrollY == 0*/}
|
|
547
|
-
{/* ? null*/}
|
|
548
|
-
{/* : {*/}
|
|
549
|
-
{/* y: tableProps.scrollY,*/}
|
|
550
|
-
{/* x: table_x,*/}
|
|
551
|
-
{/* }*/}
|
|
552
|
-
{/* }*/}
|
|
553
|
-
{/* bordered*/}
|
|
554
|
-
{/* pagination={false}*/}
|
|
555
|
-
{/* style={{ display: columns ? "block" : "none" }}*/}
|
|
556
|
-
{/* summary={summary}*/}
|
|
557
|
-
{/* loading={loading}*/}
|
|
558
|
-
{/* components={{*/}
|
|
559
|
-
{/* body: {*/}
|
|
560
|
-
{/* wrapper: this.DraggableContainer,*/}
|
|
561
|
-
{/* row: this.DraggableBodyRow,*/}
|
|
562
|
-
{/* },*/}
|
|
563
|
-
{/* }}*/}
|
|
564
|
-
{/* onChange={this.onChange.bind(this)}*/}
|
|
565
|
-
{/* ></Table>*/}
|
|
566
|
-
{/*) : (*/}
|
|
567
|
-
{/* ""*/}
|
|
568
|
-
{/*)}*/}
|
|
569
|
-
{viewModels.includes("table") ? (
|
|
570
|
-
<ResizableTable
|
|
571
|
-
size={tableProps.size ? tableProps.size : undefined}
|
|
572
|
-
rowSelection={this.getRowSelection()}
|
|
573
|
-
columns={current_cols}
|
|
574
|
-
dataSource={originData}
|
|
575
|
-
scroll={
|
|
576
|
-
tableProps.scrollY == -1 || tableProps.scrollY == 0
|
|
577
|
-
? null
|
|
578
|
-
: {
|
|
579
|
-
y: tableProps.scrollY,
|
|
580
|
-
x: table_x,
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
bordered
|
|
584
|
-
pagination={false}
|
|
585
|
-
style={{ display: columns ? "block" : "none" }}
|
|
586
|
-
summary={summary}
|
|
587
|
-
loading={loading}
|
|
588
|
-
components={{
|
|
589
|
-
body: {
|
|
590
|
-
wrapper: this.DraggableContainer,
|
|
591
|
-
row: this.DraggableBodyRow,
|
|
592
|
-
},
|
|
593
|
-
}}
|
|
594
|
-
onChange={this.onChange.bind(this)}
|
|
595
|
-
locale={{
|
|
596
|
-
emptyText: errorText ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={errorText} styles={{ description: { color: "#ff4d4f" } }} /> : undefined
|
|
597
|
-
}}
|
|
598
|
-
expandable={isTreeTable ? {
|
|
599
|
-
onExpand: (expanded, record) => {
|
|
600
|
-
if (expanded && !record.children?.length) { // 展开且没有子节点数据,请求子节点数据
|
|
601
|
-
this.getChildrenData(record.code);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
} : undefined}
|
|
605
|
-
onChangeResize={onChangeResize}
|
|
606
|
-
showEmpty={showEmpty}
|
|
607
|
-
/>
|
|
608
|
-
) : (
|
|
609
|
-
""
|
|
610
|
-
)}
|
|
611
|
-
{viewModels.includes("verticalList") ? (
|
|
612
|
-
<VerticalList hiddenRowCodes={hiddenRowCodes}
|
|
613
|
-
dataSource={dataSource}
|
|
614
|
-
columnConfigs={columnConfigs}
|
|
615
|
-
serverKey={serverKey}
|
|
616
|
-
columns={columns}
|
|
617
|
-
errorText={errorText}
|
|
618
|
-
listConfig={cardListConfig}
|
|
619
|
-
/>
|
|
620
|
-
) : (
|
|
621
|
-
""
|
|
622
|
-
)}
|
|
623
|
-
{/* showType */}
|
|
624
|
-
{viewModels.includes("cardList") ? (
|
|
625
|
-
<CardList
|
|
626
|
-
cardListConfig={cardListConfig}
|
|
627
|
-
columns={columns}
|
|
628
|
-
dataSource={dataSource}
|
|
629
|
-
sourceId={this.props.sourceId}
|
|
630
|
-
loading={loading}
|
|
631
|
-
errorText={errorText}
|
|
632
|
-
total={aggregateVO?.count}
|
|
633
|
-
pageInfo={pageInfo}
|
|
634
|
-
onChangePage={onChangePage}
|
|
635
|
-
/>
|
|
636
|
-
) : (
|
|
637
|
-
""
|
|
638
|
-
)}
|
|
639
|
-
{viewModels.includes("ganttChart") ?
|
|
640
|
-
<Gantt showView={showView} onRefresh={() => this.props.doSearch({})} serverKey={serverKey} sourceId={this.props.sourceId} loading={loading} dataSource={dataSource} ltmplConfig={ltmplConfig} errorText={errorText} getChildrenData={this.getChildrenData} /> : ""}
|
|
641
|
-
{viewModels.includes("calendar") ? <Calendar showView={showView} serverKey={serverKey} columns={current_cols} ltmplConfig={ltmplConfig} dataSource={dataSource} loading={loading} errorText={errorText} /> : ""}
|
|
642
|
-
{showPagination ? <Pagination key={queryKey ? queryKey.key : Units.getReactKey()}
|
|
643
|
-
touchEnd={touchEnd}
|
|
644
|
-
pageInfo={{ ...pageInfo, virtualEndPageNo }}
|
|
645
|
-
pageTo={this.pageTo}
|
|
646
|
-
queryTotal={this.queryTotal}
|
|
647
|
-
total={aggregateVO?.count}
|
|
648
|
-
paginationPosition={ltmplConfig?.paginationPosition}
|
|
649
|
-
pageSizeOptions={pageSizeOptions}
|
|
650
|
-
/> : ""}
|
|
651
|
-
</>
|
|
652
|
-
);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
export default QueryTable;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import {
|
|
4
|
+
DtmplData,
|
|
5
|
+
PageInfo,
|
|
6
|
+
QueryData,
|
|
7
|
+
SelectedRow, QueryTableProps, AggregateVO
|
|
8
|
+
} from "../tmpl/interface";
|
|
9
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
import Pagination from "./pagination";
|
|
11
|
+
import { TableRowSelection } from "antd/lib/table/interface";
|
|
12
|
+
import { SortableContainer, SortableElement } from "react-sortable-hoc";
|
|
13
|
+
import { arrayMoveImmutable } from "array-move";
|
|
14
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
15
|
+
import { init, merge, statistic } from "../utils/dsu";
|
|
16
|
+
import VerticalList from "../list/vertical-list";
|
|
17
|
+
import CardList from "../list/card-list";
|
|
18
|
+
import Gantt from "../list/gantt";
|
|
19
|
+
import Calendar from "../list/calendar";
|
|
20
|
+
import SummaryBuilder from "./column/summary-builder";
|
|
21
|
+
import { Button, Card, Descriptions, message, Statistic, Empty } from "antd";
|
|
22
|
+
import Units from "../units";
|
|
23
|
+
import { DownOutlined, UpOutlined } from "@ant-design/icons";
|
|
24
|
+
import ResizableTable from "./resizable-table";
|
|
25
|
+
|
|
26
|
+
const SortableItem = SortableElement((props) => (
|
|
27
|
+
<tr className="sortable-item-hover" {...props} />
|
|
28
|
+
));
|
|
29
|
+
const SortableBody = SortableContainer((props) => <tbody {...props} />);
|
|
30
|
+
|
|
31
|
+
interface CacheData {
|
|
32
|
+
dataSource: object[];
|
|
33
|
+
pageInfo: PageInfo;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
interface QueryTableStat {
|
|
38
|
+
queryDataCache?: Map<string, CacheData>;
|
|
39
|
+
virtualEndPageNo?: number;
|
|
40
|
+
dataSource?: object[];
|
|
41
|
+
loading?: boolean;
|
|
42
|
+
touchEnd?: boolean;
|
|
43
|
+
aggregateVO?: AggregateVO;
|
|
44
|
+
beforeSelectedRows?: number;
|
|
45
|
+
errorText?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
pageInfo: {
|
|
51
|
+
pageNo: 1,
|
|
52
|
+
pageSize: 10,
|
|
53
|
+
virtualEndPageNo: undefined,
|
|
54
|
+
},
|
|
55
|
+
tableProps: {
|
|
56
|
+
size: "small",
|
|
57
|
+
clickDisplayTotal: false,
|
|
58
|
+
scrollY: 500,
|
|
59
|
+
},
|
|
60
|
+
hiddenRowCodes: [],
|
|
61
|
+
selectedRows: [],
|
|
62
|
+
viewModels: ["table"],
|
|
63
|
+
summaryConfigs: [],
|
|
64
|
+
cardListConfig: {},
|
|
65
|
+
ltmplConfig: {},
|
|
66
|
+
showPagination: true,
|
|
67
|
+
showEmpty: true,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
defaultAggregateShowSize = 7;
|
|
71
|
+
|
|
72
|
+
state = {
|
|
73
|
+
queryDataCache: undefined,
|
|
74
|
+
virtualEndPageNo: undefined,
|
|
75
|
+
dataSource: undefined,
|
|
76
|
+
loading: true,
|
|
77
|
+
touchEnd: undefined,
|
|
78
|
+
aggregateVO: undefined,
|
|
79
|
+
beforeSelectedRows: undefined,
|
|
80
|
+
errorText: undefined
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
static contextType = LocaleContext;
|
|
84
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
85
|
+
|
|
86
|
+
async componentDidMount() {
|
|
87
|
+
const { queryKey, pageInfo } = this.props;
|
|
88
|
+
if (queryKey) {
|
|
89
|
+
await this.loadData(queryKey.key, pageInfo);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
componentWillUnmount() {
|
|
94
|
+
this.setState = () => false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async componentDidUpdate(prevProps) {
|
|
98
|
+
const { queryKey: preQueryKey, pageInfo: prePageInfo } = prevProps;
|
|
99
|
+
const { queryKey, pageInfo, sourceId } = this.props;
|
|
100
|
+
|
|
101
|
+
if (queryKey) {
|
|
102
|
+
|
|
103
|
+
if (preQueryKey?.key != queryKey.key) {
|
|
104
|
+
await this.loadData(queryKey.key, pageInfo, true);
|
|
105
|
+
} else if (
|
|
106
|
+
prePageInfo?.pageNo != pageInfo.pageNo ||
|
|
107
|
+
prePageInfo?.pageSize != pageInfo.pageSize
|
|
108
|
+
) {
|
|
109
|
+
await this.loadData(queryKey.key, pageInfo, false);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
DraggableContainer = (props) => (
|
|
115
|
+
<SortableBody
|
|
116
|
+
useDragHandle
|
|
117
|
+
disableAutoscroll
|
|
118
|
+
helperClass="row-dragging"
|
|
119
|
+
onSortEnd={this.onSortEnd}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
DraggableBodyRow = ({ className, style, ...restProps }) => {
|
|
125
|
+
const { dataSource } = this.state;
|
|
126
|
+
if (dataSource) {
|
|
127
|
+
const index = dataSource.findIndex(
|
|
128
|
+
(x) => x.key === restProps["data-row-key"]
|
|
129
|
+
);
|
|
130
|
+
return <SortableItem key={index} index={index} {...restProps} />;
|
|
131
|
+
} else {
|
|
132
|
+
return <></>;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
onSortEnd = ({ oldIndex, newIndex }) => {
|
|
137
|
+
const { dataSource } = this.state;
|
|
138
|
+
if (oldIndex !== newIndex) {
|
|
139
|
+
const newData = arrayMoveImmutable(
|
|
140
|
+
[].concat(dataSource),
|
|
141
|
+
oldIndex,
|
|
142
|
+
newIndex
|
|
143
|
+
).filter((el) => !!el);
|
|
144
|
+
//console.log('Sorted items: ', newData);
|
|
145
|
+
this.setState({ dataSource: newData });
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
loadData = async (
|
|
150
|
+
queryKey: string,
|
|
151
|
+
pageInfo: PageInfo,
|
|
152
|
+
cleanCache?: boolean
|
|
153
|
+
) => {
|
|
154
|
+
this.setState({ loading: true, errorText: undefined });
|
|
155
|
+
let { queryDataCache } = this.state;
|
|
156
|
+
const { translate } = this.context;
|
|
157
|
+
let { serverKey, tableProps, viewModels, ltmplConfig, loadDataCallback } = this.props;
|
|
158
|
+
let queryCache: Map<string, CacheData>;
|
|
159
|
+
if (cleanCache || !queryDataCache) {
|
|
160
|
+
queryCache = new Map<string, CacheData>();
|
|
161
|
+
this.setState({ aggregateVO: undefined });
|
|
162
|
+
} else {
|
|
163
|
+
queryCache = queryDataCache;
|
|
164
|
+
}
|
|
165
|
+
if (queryCache.has(pageInfo?.pageNo + "_" + pageInfo?.pageSize)) {
|
|
166
|
+
let cacheData = queryCache.get(
|
|
167
|
+
pageInfo?.pageNo + "_" + pageInfo?.pageSize
|
|
168
|
+
);
|
|
169
|
+
this.setState({
|
|
170
|
+
dataSource: cacheData.dataSource,
|
|
171
|
+
virtualEndPageNo: cacheData.pageInfo.virtualEndPageNo,
|
|
172
|
+
loading: false,
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
let queryData: QueryData = await HcserviceV3.requestQueryData(
|
|
176
|
+
serverKey,
|
|
177
|
+
queryKey,
|
|
178
|
+
pageInfo
|
|
179
|
+
);
|
|
180
|
+
if (queryData?.key !== queryKey) {
|
|
181
|
+
this.setState({ loading: false, errorText: translate("${查询异常}"), dataSource: [] });
|
|
182
|
+
if (loadDataCallback) loadDataCallback([]); // 请求数据回调函数
|
|
183
|
+
return;
|
|
184
|
+
} else {
|
|
185
|
+
let dataSource: object[] = [];
|
|
186
|
+
pageInfo = queryData?.pageInfo;
|
|
187
|
+
if (queryData?.entities) {
|
|
188
|
+
queryData.entities.forEach((item, index) => {
|
|
189
|
+
let row = {
|
|
190
|
+
key: item.code,
|
|
191
|
+
code: item.code, //增加code,为了删除操作
|
|
192
|
+
...item.fieldMap,
|
|
193
|
+
index,
|
|
194
|
+
};
|
|
195
|
+
dataSource.push(row);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
let touchEnd = queryData?.touchEnd;
|
|
199
|
+
|
|
200
|
+
if (viewModels.includes("ganttChart") && ltmplConfig.gttSubOpenRatmplId) {
|
|
201
|
+
// 存在甘特图展示组件,并且存在树形结构,表格同步开启树形结构
|
|
202
|
+
dataSource = dataSource.map(item => ({ ...item, children: [] }));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
//缓存数据
|
|
206
|
+
queryCache.set(pageInfo?.pageNo + "_" + pageInfo?.pageSize, {
|
|
207
|
+
dataSource,
|
|
208
|
+
pageInfo,
|
|
209
|
+
});
|
|
210
|
+
this.setState({
|
|
211
|
+
beforeSelectedRows: queryData.beforeSelectedRows,
|
|
212
|
+
dataSource,
|
|
213
|
+
virtualEndPageNo: pageInfo.virtualEndPageNo,
|
|
214
|
+
queryDataCache: queryCache,
|
|
215
|
+
touchEnd,
|
|
216
|
+
loading: false,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (loadDataCallback) { // 请求数据回调函数
|
|
220
|
+
loadDataCallback(dataSource);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (!tableProps.clickDisplayTotal) {
|
|
224
|
+
await this.queryTotal();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// }
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
pageTo = async (pageNo: number, pageSize: number) => {
|
|
233
|
+
const { onChangePage } = this.props;
|
|
234
|
+
// const { virtualEndPageNo } = this.state;
|
|
235
|
+
// let pageInfo = {
|
|
236
|
+
// pageNo,
|
|
237
|
+
// pageSize: pageSize ? pageSize : 10,
|
|
238
|
+
// virtualEndPageNo,
|
|
239
|
+
// };
|
|
240
|
+
//const { queryKey } = this.props;
|
|
241
|
+
//await this.loadData(queryKey.key, pageInfo);
|
|
242
|
+
onChangePage(pageNo, pageSize);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
queryTotal = async () => {
|
|
246
|
+
const { queryKey, serverKey, queryTotal, onChangeAggregateVO } = this.props;
|
|
247
|
+
const { aggregateVO: stateAggregateVO } = this.state;
|
|
248
|
+
let aggregateVO;
|
|
249
|
+
if (stateAggregateVO && stateAggregateVO.queryKey == queryKey.key) {
|
|
250
|
+
return false;
|
|
251
|
+
} else {
|
|
252
|
+
if (queryTotal) {
|
|
253
|
+
aggregateVO = await queryTotal();
|
|
254
|
+
} else {
|
|
255
|
+
aggregateVO = await HcserviceV3.requestQueryAggregates(serverKey, queryKey.key);
|
|
256
|
+
}
|
|
257
|
+
onChangeAggregateVO && onChangeAggregateVO(aggregateVO);
|
|
258
|
+
this.setState({ aggregateVO });
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
getRowSelection = () => {
|
|
263
|
+
const {
|
|
264
|
+
columns,
|
|
265
|
+
onChangeRowSelection,
|
|
266
|
+
selectedRows,
|
|
267
|
+
maxSelectedRows,
|
|
268
|
+
primaryColumn,
|
|
269
|
+
} = this.props;
|
|
270
|
+
let { dataSource, beforeSelectedRows } = this.state;
|
|
271
|
+
let selectedRowKeys = [];
|
|
272
|
+
|
|
273
|
+
for (let row of selectedRows) {
|
|
274
|
+
selectedRowKeys.push(row.code);
|
|
275
|
+
}
|
|
276
|
+
const allRowKeys: string[] = [];
|
|
277
|
+
if (dataSource) {
|
|
278
|
+
for (let d of dataSource) {
|
|
279
|
+
allRowKeys.push(d.code);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
let tmplMax = maxSelectedRows ? maxSelectedRows : 0;
|
|
284
|
+
if (beforeSelectedRows > 0) {
|
|
285
|
+
tmplMax = tmplMax - beforeSelectedRows;
|
|
286
|
+
}
|
|
287
|
+
const { translate } = this.context;
|
|
288
|
+
if (tmplMax <= -1) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (beforeSelectedRows > 0 && tmplMax <= 0) {
|
|
293
|
+
message.warning(translate("${已选超}"));
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const rowSelection: TableRowSelection<any> = {
|
|
298
|
+
|
|
299
|
+
fixed: true,
|
|
300
|
+
type: maxSelectedRows == 1 ? "radio" : "checkbox",
|
|
301
|
+
selectedRowKeys,
|
|
302
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
303
|
+
if (tmplMax > 0 && selectedRowKeys.length > tmplMax) {
|
|
304
|
+
message.error(translate("${最多只能选择}") + " : " + tmplMax);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
let selectedRows_: SelectedRow[] = [];
|
|
308
|
+
let selectedDatas: DtmplData[] = [];
|
|
309
|
+
let titleColId = primaryColumn?.id;
|
|
310
|
+
if (!titleColId) {
|
|
311
|
+
columns.forEach((col) => {
|
|
312
|
+
if (col.title != "序号" && titleColId == null) {
|
|
313
|
+
titleColId = col.dataIndex;
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
selectedRows.forEach((item) => {
|
|
319
|
+
selectedRows_.push({ code: item["code"], title: item[titleColId] });
|
|
320
|
+
selectedDatas.push(item);
|
|
321
|
+
});
|
|
322
|
+
if (onChangeRowSelection) {
|
|
323
|
+
onChangeRowSelection(selectedRows_, selectedDatas, allRowKeys);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
return rowSelection;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
getUnHidenDataSource = () => {
|
|
331
|
+
const { dataSource } = this.state;
|
|
332
|
+
const { hiddenRowCodes } = this.props;
|
|
333
|
+
let ds: object[] = [];
|
|
334
|
+
if (dataSource) {
|
|
335
|
+
for (let d of dataSource) {
|
|
336
|
+
if (!hiddenRowCodes.includes(d.code)) {
|
|
337
|
+
ds.push(d);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return ds;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
mergeRowInCol(data, rowIdx, colIdx, mergeMp, calNum) {
|
|
345
|
+
const idx = rowIdx * calNum + colIdx;
|
|
346
|
+
// console.log(rowIdx, colIdx, mergeMp[idx]);
|
|
347
|
+
if (mergeMp[idx] !== undefined)
|
|
348
|
+
return {
|
|
349
|
+
rowSpan: mergeMp[idx].length,
|
|
350
|
+
};
|
|
351
|
+
return { rowSpan: 0 };
|
|
352
|
+
// return {};
|
|
353
|
+
}
|
|
354
|
+
sort_serial_number = new Date().getTime();
|
|
355
|
+
|
|
356
|
+
onChange(pagination, filters, sorter, extra) {
|
|
357
|
+
console.log("params", pagination, filters, sorter, extra);
|
|
358
|
+
if (extra.action === "sort") {
|
|
359
|
+
let new_sort_serial_number = new Date().getTime();
|
|
360
|
+
if (new_sort_serial_number - this.sort_serial_number < 2000) {
|
|
361
|
+
const { translate } = this.context;
|
|
362
|
+
message.warning(translate("${系统忙,请稍后再试}"));
|
|
363
|
+
return;
|
|
364
|
+
} else {
|
|
365
|
+
this.sort_serial_number = new_sort_serial_number;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const extParams: Record<string, string> = {};
|
|
369
|
+
const sortColumnData = JSON.parse(
|
|
370
|
+
JSON.stringify(this.props.sortColumnData)
|
|
371
|
+
);
|
|
372
|
+
if (sorter.order === "ascend") {
|
|
373
|
+
Object.assign(extParams, {
|
|
374
|
+
sortColIds: [sorter.field + "_" + "asc"],
|
|
375
|
+
});
|
|
376
|
+
} else if (sorter.order === "descend") {
|
|
377
|
+
Object.assign(extParams, {
|
|
378
|
+
sortColIds: [sorter.field + "_" + "desc"],
|
|
379
|
+
});
|
|
380
|
+
} else {
|
|
381
|
+
Object.assign(extParams, {
|
|
382
|
+
sortColIds: [],
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
this.props.doSearch(extParams);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// 更新树形结构子节点
|
|
390
|
+
updateChildrenById = (data, parentCode, childrenData) => {
|
|
391
|
+
const newData = data.map(node => {
|
|
392
|
+
const newNode = { ...node };
|
|
393
|
+
if (node.code === parentCode) {
|
|
394
|
+
// 找到目标节点,更新children
|
|
395
|
+
newNode.children = childrenData;
|
|
396
|
+
} else if (node.children && node.children.length > 0) {
|
|
397
|
+
// 递归更新子节点
|
|
398
|
+
newNode.children = this.updateChildrenById(node.children, parentCode, childrenData);
|
|
399
|
+
}
|
|
400
|
+
return newNode;
|
|
401
|
+
});
|
|
402
|
+
return newData;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// 懒加载子节点
|
|
406
|
+
getChildrenData = async (parentCode: string) => {
|
|
407
|
+
const { ltmplConfig, pageInfo } = this.props;
|
|
408
|
+
let { queryDataCache, dataSource } = this.state;
|
|
409
|
+
this.setState({ loading: true });
|
|
410
|
+
let res = await HcserviceV3.requestLtmplQueryTop(null, ltmplConfig?.gttSubOpenRatmplId, { mainCode: parentCode });
|
|
411
|
+
const childrenData = res?.entities?.map((r, index) => ({
|
|
412
|
+
key: r.code,
|
|
413
|
+
code: r.code,
|
|
414
|
+
...r.fieldMap,
|
|
415
|
+
index,
|
|
416
|
+
children: []
|
|
417
|
+
})) || [];
|
|
418
|
+
const newData = this.updateChildrenById(dataSource, parentCode, childrenData);
|
|
419
|
+
this.setState({ dataSource: newData, loading: false });
|
|
420
|
+
// 更新数据缓存
|
|
421
|
+
queryDataCache.set(pageInfo?.pageNo + "_" + pageInfo?.pageSize, {
|
|
422
|
+
dataSource,
|
|
423
|
+
pageInfo,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
render() {
|
|
428
|
+
const {
|
|
429
|
+
pageInfo, queryKey,
|
|
430
|
+
columns,
|
|
431
|
+
viewModels,
|
|
432
|
+
summaryConfigs,
|
|
433
|
+
subtotalXColumn,
|
|
434
|
+
tableProps,
|
|
435
|
+
groupIColumns,
|
|
436
|
+
hiddenRowCodes,
|
|
437
|
+
columnConfigs,
|
|
438
|
+
serverKey,
|
|
439
|
+
cardListConfig,
|
|
440
|
+
ltmplConfig,
|
|
441
|
+
showView,
|
|
442
|
+
showPagination,
|
|
443
|
+
onChangeResize,
|
|
444
|
+
pageSizeOptions,
|
|
445
|
+
onChangePage,
|
|
446
|
+
showEmpty
|
|
447
|
+
} = this.props;
|
|
448
|
+
//debugger
|
|
449
|
+
const { touchEnd, aggregateVO, loading, virtualEndPageNo, dataSource, errorText } = this.state;
|
|
450
|
+
const isProSumarryTable = Boolean(subtotalXColumn);
|
|
451
|
+
// 是否是树形表格(存在甘特图视图展示且存在展开关系)
|
|
452
|
+
const isTreeTable = viewModels.includes("ganttChart") && ltmplConfig.gttSubOpenRatmplId;
|
|
453
|
+
const { translate } = this.context;
|
|
454
|
+
const {
|
|
455
|
+
proSummaryTableColumns,
|
|
456
|
+
proSummaryTableData,
|
|
457
|
+
} = SummaryBuilder.handleProSummaryTable({ subtotalXColumn, columns, data: this.getUnHidenDataSource(), translate, groupIColumns });
|
|
458
|
+
let current_cols = isProSumarryTable ? proSummaryTableColumns : columns ? columns : [];
|
|
459
|
+
let table_x = 20;
|
|
460
|
+
current_cols.forEach((c) => { table_x = table_x + (c.width ? c.width : 140); });
|
|
461
|
+
let dat = this.getUnHidenDataSource();
|
|
462
|
+
const originData = isProSumarryTable ? proSummaryTableData : dat;
|
|
463
|
+
|
|
464
|
+
let summary = (pageData1) => {
|
|
465
|
+
return SummaryBuilder.summary({
|
|
466
|
+
translate, summaryConfigs,
|
|
467
|
+
pageData: dat, columns,
|
|
468
|
+
rowSelection: this.getRowSelection(), groupIColumns
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// console.log("%crender data: ", "color: red", originData);
|
|
473
|
+
// console.log("%crender col: ", "color: red", current_cols);
|
|
474
|
+
|
|
475
|
+
if (ltmplConfig.displayTotal) { // 显示合计判断
|
|
476
|
+
const washOriginData = originData.map((i, idx) => {
|
|
477
|
+
const data = {};
|
|
478
|
+
current_cols.forEach((col) => {
|
|
479
|
+
data[col["dataIndex"]] = i[col["dataIndex"]];
|
|
480
|
+
});
|
|
481
|
+
data["1"] = idx;
|
|
482
|
+
return data;
|
|
483
|
+
});
|
|
484
|
+
// console.log("清洗原始数据: ", washOriginData);
|
|
485
|
+
// 一列中多行预处理
|
|
486
|
+
const dateOf2D = Array.from({ length: washOriginData.length })
|
|
487
|
+
.fill(0)
|
|
488
|
+
.map(() => Array.from({ length: current_cols.length }).fill(0));
|
|
489
|
+
washOriginData.forEach((row, rowIdx) => {
|
|
490
|
+
current_cols.forEach((col, colIdx) => {
|
|
491
|
+
dateOf2D[rowIdx][colIdx] = row[col["dataIndex"]];
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
console.log("dataOf2D: ", dateOf2D);
|
|
495
|
+
init(washOriginData.length * current_cols.length + 10);
|
|
496
|
+
for (let i = 1; i < dateOf2D.length; i++) {
|
|
497
|
+
let flag = false;
|
|
498
|
+
if (Array.isArray(groupIColumns) && groupIColumns.length > 0) {
|
|
499
|
+
groupIColumns.forEach(({ title, sourceId }) => {
|
|
500
|
+
if (
|
|
501
|
+
washOriginData[i][title] !== undefined &&
|
|
502
|
+
washOriginData[i][title] !== washOriginData[i - 1][title]
|
|
503
|
+
) {
|
|
504
|
+
return (flag = true);
|
|
505
|
+
}
|
|
506
|
+
if (
|
|
507
|
+
washOriginData[i][sourceId] !== undefined &&
|
|
508
|
+
washOriginData[i][sourceId] !== washOriginData[i - 1][sourceId]
|
|
509
|
+
) {
|
|
510
|
+
return (flag = true);
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
} else {
|
|
514
|
+
flag = true;
|
|
515
|
+
}
|
|
516
|
+
for (let j = 0; j < dateOf2D[i].length; j++)
|
|
517
|
+
if (dateOf2D[i][j] === "小计" || dateOf2D[i][j] === "合计") flag = true;
|
|
518
|
+
for (let j = 0; j < dateOf2D[i - 1].length; j++)
|
|
519
|
+
if (dateOf2D[i - 1][j] === "小计" || dateOf2D[i - 1][j] === "合计")
|
|
520
|
+
flag = true;
|
|
521
|
+
if (flag) continue;
|
|
522
|
+
for (let j = 0; j < dateOf2D[i].length; j++) {
|
|
523
|
+
if (dateOf2D[i][j] === dateOf2D[i - 1][j])
|
|
524
|
+
merge(i * dateOf2D[i].length + j, (i - 1) * dateOf2D[i].length + j);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
const mergeMp = statistic();
|
|
528
|
+
//console.log("统计结果", mergeMp);
|
|
529
|
+
// 给 col 添加 mergeRowInCol
|
|
530
|
+
current_cols.forEach(
|
|
531
|
+
(col, colIdx) =>
|
|
532
|
+
(col.onCell = (_, rowIdx) =>
|
|
533
|
+
this.mergeRowInCol(_, rowIdx, colIdx, mergeMp, current_cols.length))
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return (
|
|
538
|
+
<>
|
|
539
|
+
{/*{viewModels.includes("table") ? (*/}
|
|
540
|
+
{/* <Table*/}
|
|
541
|
+
{/* size={tableProps.size ? tableProps.size : undefined}*/}
|
|
542
|
+
{/* rowSelection={this.getRowSelection()}*/}
|
|
543
|
+
{/* columns={current_cols}*/}
|
|
544
|
+
{/* dataSource={originData}*/}
|
|
545
|
+
{/* scroll={*/}
|
|
546
|
+
{/* tableProps.scrollY == -1 || tableProps.scrollY == 0*/}
|
|
547
|
+
{/* ? null*/}
|
|
548
|
+
{/* : {*/}
|
|
549
|
+
{/* y: tableProps.scrollY,*/}
|
|
550
|
+
{/* x: table_x,*/}
|
|
551
|
+
{/* }*/}
|
|
552
|
+
{/* }*/}
|
|
553
|
+
{/* bordered*/}
|
|
554
|
+
{/* pagination={false}*/}
|
|
555
|
+
{/* style={{ display: columns ? "block" : "none" }}*/}
|
|
556
|
+
{/* summary={summary}*/}
|
|
557
|
+
{/* loading={loading}*/}
|
|
558
|
+
{/* components={{*/}
|
|
559
|
+
{/* body: {*/}
|
|
560
|
+
{/* wrapper: this.DraggableContainer,*/}
|
|
561
|
+
{/* row: this.DraggableBodyRow,*/}
|
|
562
|
+
{/* },*/}
|
|
563
|
+
{/* }}*/}
|
|
564
|
+
{/* onChange={this.onChange.bind(this)}*/}
|
|
565
|
+
{/* ></Table>*/}
|
|
566
|
+
{/*) : (*/}
|
|
567
|
+
{/* ""*/}
|
|
568
|
+
{/*)}*/}
|
|
569
|
+
{viewModels.includes("table") ? (
|
|
570
|
+
<ResizableTable
|
|
571
|
+
size={tableProps.size ? tableProps.size : undefined}
|
|
572
|
+
rowSelection={this.getRowSelection()}
|
|
573
|
+
columns={current_cols}
|
|
574
|
+
dataSource={originData}
|
|
575
|
+
scroll={
|
|
576
|
+
tableProps.scrollY == -1 || tableProps.scrollY == 0
|
|
577
|
+
? null
|
|
578
|
+
: {
|
|
579
|
+
y: tableProps.scrollY,
|
|
580
|
+
x: table_x,
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
bordered
|
|
584
|
+
pagination={false}
|
|
585
|
+
style={{ display: columns ? "block" : "none" }}
|
|
586
|
+
summary={summary}
|
|
587
|
+
loading={loading}
|
|
588
|
+
components={{
|
|
589
|
+
body: {
|
|
590
|
+
wrapper: this.DraggableContainer,
|
|
591
|
+
row: this.DraggableBodyRow,
|
|
592
|
+
},
|
|
593
|
+
}}
|
|
594
|
+
onChange={this.onChange.bind(this)}
|
|
595
|
+
locale={{
|
|
596
|
+
emptyText: errorText ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={errorText} styles={{ description: { color: "#ff4d4f" } }} /> : undefined
|
|
597
|
+
}}
|
|
598
|
+
expandable={isTreeTable ? {
|
|
599
|
+
onExpand: (expanded, record) => {
|
|
600
|
+
if (expanded && !record.children?.length) { // 展开且没有子节点数据,请求子节点数据
|
|
601
|
+
this.getChildrenData(record.code);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
} : undefined}
|
|
605
|
+
onChangeResize={onChangeResize}
|
|
606
|
+
showEmpty={showEmpty}
|
|
607
|
+
/>
|
|
608
|
+
) : (
|
|
609
|
+
""
|
|
610
|
+
)}
|
|
611
|
+
{viewModels.includes("verticalList") ? (
|
|
612
|
+
<VerticalList hiddenRowCodes={hiddenRowCodes}
|
|
613
|
+
dataSource={dataSource}
|
|
614
|
+
columnConfigs={columnConfigs}
|
|
615
|
+
serverKey={serverKey}
|
|
616
|
+
columns={columns}
|
|
617
|
+
errorText={errorText}
|
|
618
|
+
listConfig={cardListConfig}
|
|
619
|
+
/>
|
|
620
|
+
) : (
|
|
621
|
+
""
|
|
622
|
+
)}
|
|
623
|
+
{/* showType */}
|
|
624
|
+
{viewModels.includes("cardList") ? (
|
|
625
|
+
<CardList
|
|
626
|
+
cardListConfig={cardListConfig}
|
|
627
|
+
columns={columns}
|
|
628
|
+
dataSource={dataSource}
|
|
629
|
+
sourceId={this.props.sourceId}
|
|
630
|
+
loading={loading}
|
|
631
|
+
errorText={errorText}
|
|
632
|
+
total={aggregateVO?.count}
|
|
633
|
+
pageInfo={pageInfo}
|
|
634
|
+
onChangePage={onChangePage}
|
|
635
|
+
/>
|
|
636
|
+
) : (
|
|
637
|
+
""
|
|
638
|
+
)}
|
|
639
|
+
{viewModels.includes("ganttChart") ?
|
|
640
|
+
<Gantt showView={showView} onRefresh={() => this.props.doSearch({})} serverKey={serverKey} sourceId={this.props.sourceId} loading={loading} dataSource={dataSource} ltmplConfig={ltmplConfig} errorText={errorText} getChildrenData={this.getChildrenData} /> : ""}
|
|
641
|
+
{viewModels.includes("calendar") ? <Calendar showView={showView} serverKey={serverKey} columns={current_cols} ltmplConfig={ltmplConfig} dataSource={dataSource} loading={loading} errorText={errorText} /> : ""}
|
|
642
|
+
{showPagination ? <Pagination key={queryKey ? queryKey.key : Units.getReactKey()}
|
|
643
|
+
touchEnd={touchEnd}
|
|
644
|
+
pageInfo={{ ...pageInfo, virtualEndPageNo }}
|
|
645
|
+
pageTo={this.pageTo}
|
|
646
|
+
queryTotal={this.queryTotal}
|
|
647
|
+
total={aggregateVO?.count}
|
|
648
|
+
paginationPosition={ltmplConfig?.paginationPosition}
|
|
649
|
+
pageSizeOptions={pageSizeOptions}
|
|
650
|
+
/> : ""}
|
|
651
|
+
</>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export default QueryTable;
|