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,865 +1,865 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, FieldConfig, CustomButton, CQueryConfig } from "../../tmpl/interface";
|
|
3
|
-
import TableUnits from "../table-util";
|
|
4
|
-
import SupportInputTypes from "../../tmpl/control-type-supportor";
|
|
5
|
-
import { Button, Popconfirm, Popover, Space, Tooltip, Form as AntdForm } from "antd";
|
|
6
|
-
import { SortableHandle } from "react-sortable-hoc";
|
|
7
|
-
import {
|
|
8
|
-
AlignLeftOutlined, CopyOutlined, DeleteOutlined,
|
|
9
|
-
EllipsisOutlined,
|
|
10
|
-
EyeInvisibleOutlined,
|
|
11
|
-
EyeOutlined,
|
|
12
|
-
FormOutlined,
|
|
13
|
-
KeyOutlined,
|
|
14
|
-
MenuOutlined, QuestionCircleOutlined, PlaySquareOutlined,
|
|
15
|
-
SettingOutlined
|
|
16
|
-
} from "@ant-design/icons";
|
|
17
|
-
import ActionUtils from "../../controls/action/utils";
|
|
18
|
-
import ViewButton from "../../detail/button/view-button";
|
|
19
|
-
import EditButton from "../../detail/button/edit-button";
|
|
20
|
-
import InlineEditButton from "../../detail/button/inline-edit-button";
|
|
21
|
-
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
22
|
-
import Action from "../../controls/action";
|
|
23
|
-
import CquickButton from "../../controls/cquery/cquick-button";
|
|
24
|
-
import { ViewControl } from "../../index";
|
|
25
|
-
import NewinFileView from "../../controls/file-view/newin-file-view";
|
|
26
|
-
import { EntryControl } from "../../index";
|
|
27
|
-
import TmplConfigAnalysis from "../../tmpl/tmpl-config-analysis";
|
|
28
|
-
import Icon from "../../icon/aliIcon";
|
|
29
|
-
import SelectCodeExport from "../../controls/file-export/select-code-export";
|
|
30
|
-
import "./index.less";
|
|
31
|
-
|
|
32
|
-
const FormItem = AntdForm.Item;
|
|
33
|
-
|
|
34
|
-
const isDisabled = (record: DtmplData, item: FieldConfig) => {
|
|
35
|
-
if (!item.rowEditType) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
let isNew: boolean = record.editStatus === "new";
|
|
39
|
-
let type = item.rowEditType;
|
|
40
|
-
if (type === "editable" || (type === "editonly" && !isNew) || (type === "addonly" && isNew)) {
|
|
41
|
-
return false;
|
|
42
|
-
} else if (type === "readonly") {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
interface ColumnBuilderProps extends ActionRenderProps {
|
|
50
|
-
ltmplConfig: LtmplConfig,
|
|
51
|
-
hiddenColIds?: string[],
|
|
52
|
-
hiddenRowCodes?: string[],
|
|
53
|
-
sortedColConfigs?: ColumnConfig[],
|
|
54
|
-
unHiden?: () => any,
|
|
55
|
-
onHide?: (code: string) => any,
|
|
56
|
-
operatable?: boolean,
|
|
57
|
-
mainCode?: string,
|
|
58
|
-
criteriaData?: object,
|
|
59
|
-
actTableDoSearch?: (data: object) => void,
|
|
60
|
-
columnResize?: { [key: string]: number }
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface ReportColumnBuilderProps {
|
|
64
|
-
columnConfigs: ColumnConfig[],
|
|
65
|
-
hiddenColIds?: string[],
|
|
66
|
-
translate: (...strs: string[]) => string;
|
|
67
|
-
leftFixedCols: number,
|
|
68
|
-
hiddenRowCodes?: string[],
|
|
69
|
-
unHiden?: () => any,
|
|
70
|
-
onHide?: (code: string) => any,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export default {
|
|
75
|
-
|
|
76
|
-
buildTableColumns(props: ColumnBuilderProps) {
|
|
77
|
-
const {
|
|
78
|
-
ltmplConfig,
|
|
79
|
-
hiddenColIds,
|
|
80
|
-
hiddenRowCodes,
|
|
81
|
-
sortedColConfigs, unHiden,
|
|
82
|
-
onHide, translate,
|
|
83
|
-
sortColumns, serverKey,
|
|
84
|
-
editings, mainCode, criteriaData, actTableDoSearch, showView,
|
|
85
|
-
columnResize
|
|
86
|
-
} = props;
|
|
87
|
-
|
|
88
|
-
const { primaryColumn, secondColumn, primaryColumnLabel } = ltmplConfig.extDisplayConfig || {};
|
|
89
|
-
|
|
90
|
-
let tableColumns = [];
|
|
91
|
-
let s = 0;
|
|
92
|
-
let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
|
|
93
|
-
let buttons = ltmplConfig.buttons || [];
|
|
94
|
-
|
|
95
|
-
let currentDataColIndex = 0;
|
|
96
|
-
|
|
97
|
-
colConfigs.forEach((item) => {
|
|
98
|
-
let column = {};
|
|
99
|
-
if (hiddenColIds && hiddenColIds.includes(item.originalId)) {
|
|
100
|
-
return
|
|
101
|
-
} else {
|
|
102
|
-
if (item.columnGroupName) { // 表头分组功能实现
|
|
103
|
-
const groupIndex = tableColumns.findIndex(r => r.children?.length && r.title === item.columnGroupName);
|
|
104
|
-
if (groupIndex !== -1) {
|
|
105
|
-
tableColumns[groupIndex].children.push(column);
|
|
106
|
-
} else {
|
|
107
|
-
tableColumns.push({ title: item.columnGroupName, align: "center", children: [column] });
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
tableColumns.push(column);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
let title1 = translate("${" + item.title + "}");
|
|
114
|
-
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
115
|
-
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
116
|
-
column["dataIndex"] = item.id;
|
|
117
|
-
column["key"] = item.id;
|
|
118
|
-
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
119
|
-
if (item["statColType"]) column["statColType"] = item["statColType"];
|
|
120
|
-
if (item["aggFunc"]) column["cal"] = item["aggFunc"];
|
|
121
|
-
if (item["order"]) column["order"] = Number(item["order"]);
|
|
122
|
-
// column['ellipsis']= true;
|
|
123
|
-
s++;
|
|
124
|
-
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
125
|
-
if (s < 12 && item.title != "操作" && item.title != "序号") {
|
|
126
|
-
if (hiddenColIds.includes("10000")) {
|
|
127
|
-
const order = this.handleColumnOrder(column["dataIndex"], sortColumns);
|
|
128
|
-
if (item.sortable) {
|
|
129
|
-
TableUnits.sort(column, itemType, order);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
//特殊列处理
|
|
134
|
-
//序号
|
|
135
|
-
if (item.title === "序号") {
|
|
136
|
-
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
137
|
-
column["title"] = translate("${序号}");
|
|
138
|
-
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
139
|
-
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
140
|
-
item["sorter"] = undefined;
|
|
141
|
-
} else if (item.id == "10000") {
|
|
142
|
-
this.setSortProps(column, item, translate);
|
|
143
|
-
} else if (item.id == "20000") {
|
|
144
|
-
this.setHiddenRecordOpt(column, hiddenRowCodes, unHiden, onHide, translate);
|
|
145
|
-
} else if (item.title === "操作" && props.operatable) {
|
|
146
|
-
column["操作"] = "1";
|
|
147
|
-
column["fixed"] = "right";
|
|
148
|
-
column["align"] = "left";
|
|
149
|
-
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
150
|
-
column["className"] = "opsColumn";
|
|
151
|
-
column["title"] = <>{translate("${操作}")}</>;
|
|
152
|
-
column["render"] = (text, record) => this.renderAction(props, record);
|
|
153
|
-
} else {
|
|
154
|
-
currentDataColIndex++;
|
|
155
|
-
column["className"] = "opsColumn";
|
|
156
|
-
// column["title"] = item.tip? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
157
|
-
// <Button icon={<QuestionCircleOutlined />} /></Tooltip> </>: title1;
|
|
158
|
-
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
159
|
-
column["ellipsis"] = { showTitle: true };
|
|
160
|
-
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
161
|
-
if (
|
|
162
|
-
ltmplConfig.leftFixedCols &&
|
|
163
|
-
ltmplConfig.leftFixedCols >= currentDataColIndex
|
|
164
|
-
) {
|
|
165
|
-
column["fixed"] = "left";
|
|
166
|
-
} else {
|
|
167
|
-
column["fixed"] = item.colFixed
|
|
168
|
-
? item.colFixed == "right"
|
|
169
|
-
? "right"
|
|
170
|
-
: "left"
|
|
171
|
-
: false;
|
|
172
|
-
}
|
|
173
|
-
column["render"] = (text, record) => {
|
|
174
|
-
let detailParams = undefined;
|
|
175
|
-
if (showView && primaryColumn?.id === item.id) { // 首字段增加主题色显示/查看详情功能
|
|
176
|
-
if (buttons.includes("detail")) {
|
|
177
|
-
const classView = ltmplConfig.classViewConfigs.find(r => ActionUtils.isShow(r.preposes, [record], undefined));
|
|
178
|
-
if (classView) {
|
|
179
|
-
detailParams = { code: record.code, dtmplSourceId: classView.id };
|
|
180
|
-
} else {
|
|
181
|
-
const isdetail = ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
182
|
-
detailParams = isdetail ? { code: record.code } : undefined;
|
|
183
|
-
}
|
|
184
|
-
} else if (buttons.includes("customDetail")) {
|
|
185
|
-
detailParams = { code: record.code, toCustomPage: true };
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// 首字段渲染
|
|
190
|
-
const renderPrimaryColumn = <div className="column-table-primary">
|
|
191
|
-
<div className="primary-column" onClick={() => detailParams && showView(detailParams)}>
|
|
192
|
-
<ViewControl
|
|
193
|
-
serverKey={serverKey}
|
|
194
|
-
fieldConfig={item}
|
|
195
|
-
value={record[item.id]}
|
|
196
|
-
holderType="table"
|
|
197
|
-
/>
|
|
198
|
-
</div>
|
|
199
|
-
{primaryColumnLabel?.id ?
|
|
200
|
-
<div className="primary-column-label" >
|
|
201
|
-
<ViewControl
|
|
202
|
-
serverKey={serverKey}
|
|
203
|
-
fieldConfig={primaryColumnLabel}
|
|
204
|
-
value={record[primaryColumnLabel.id]}
|
|
205
|
-
holderType="table"
|
|
206
|
-
/>
|
|
207
|
-
</div> :
|
|
208
|
-
""}
|
|
209
|
-
{/* 首字段操作按钮 */}
|
|
210
|
-
{this.renderColumnAction(props, record, "primary")}
|
|
211
|
-
</div>;
|
|
212
|
-
// 次字段渲染
|
|
213
|
-
const renderSecondColumn = <div className="column-table-second">
|
|
214
|
-
<ViewControl
|
|
215
|
-
serverKey={serverKey}
|
|
216
|
-
fieldConfig={item}
|
|
217
|
-
value={record[item.id]}
|
|
218
|
-
holderType="table"
|
|
219
|
-
/>
|
|
220
|
-
{this.renderColumnAction(props, record, "secondary")}
|
|
221
|
-
</div>;
|
|
222
|
-
|
|
223
|
-
return (editings.includes(record.code) || buttons.includes("multiRowEdit") ?
|
|
224
|
-
<FormItem style={{ margin: 0 }}
|
|
225
|
-
name={record.code + "_" + item.id}
|
|
226
|
-
key={record.code + "_" + item.id}
|
|
227
|
-
rules={TmplConfigAnalysis.getRules(item, translate)}
|
|
228
|
-
initialValue={record[item.id]}>
|
|
229
|
-
<EntryControl
|
|
230
|
-
serverKey={serverKey}
|
|
231
|
-
fieldConfig={{ ...item, disabled: isDisabled(record, item) }}
|
|
232
|
-
value={record[item.id]}
|
|
233
|
-
/>
|
|
234
|
-
</FormItem> :
|
|
235
|
-
<div className={record['dataType'] ? record['dataType'] === "小计" ? "xiaoji" : 'heji' : ""}>
|
|
236
|
-
{primaryColumn?.id === item.id ? renderPrimaryColumn : secondColumn?.id === item.id ? renderSecondColumn :
|
|
237
|
-
<ViewControl
|
|
238
|
-
serverKey={serverKey}
|
|
239
|
-
fieldConfig={item}
|
|
240
|
-
value={record[item.id]}
|
|
241
|
-
holderType="table"
|
|
242
|
-
/>
|
|
243
|
-
}
|
|
244
|
-
</div>
|
|
245
|
-
);
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
// 表头列搜索
|
|
249
|
-
if (item.appendCriteria) {
|
|
250
|
-
const criteria = item.appendCriteria;
|
|
251
|
-
let searchVal = criteriaData?.[`c_${criteria.id}`];
|
|
252
|
-
column["filterDropdown"] = ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
253
|
-
<EntryControl
|
|
254
|
-
serverKey={serverKey}
|
|
255
|
-
mainCode={mainCode}
|
|
256
|
-
value={searchVal}
|
|
257
|
-
fieldConfig={criteria}
|
|
258
|
-
onChange={(val) => {
|
|
259
|
-
const value = val?.target ? val.target.value : val;
|
|
260
|
-
setSelectedKeys(value ? [value] : []);
|
|
261
|
-
searchVal = value;
|
|
262
|
-
}}
|
|
263
|
-
/>
|
|
264
|
-
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", paddingTop: 8 }}>
|
|
265
|
-
<Button type="text" size="small" onClick={() => {
|
|
266
|
-
clearFilters();
|
|
267
|
-
searchVal = undefined;
|
|
268
|
-
}}>{translate("${重置}")}</Button>
|
|
269
|
-
<Button onClick={() => {
|
|
270
|
-
actTableDoSearch({ [`c_${criteria.id}`]: selectedKeys[0] });
|
|
271
|
-
confirm();
|
|
272
|
-
}} type="primary" size="small">{translate("${确定}")}</Button>
|
|
273
|
-
</div>
|
|
274
|
-
</div>);
|
|
275
|
-
column["filteredValue"] = searchVal || undefined;
|
|
276
|
-
}
|
|
277
|
-
if (columnResize?.[item.id]) { // 本地缓存存在列宽配置
|
|
278
|
-
column["width"] = columnResize[item.id];
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
return tableColumns;
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
setSortProps(column: object, item: ColumnConfig, translate) {
|
|
285
|
-
column["title"] = (
|
|
286
|
-
<Tooltip title={translate("${拖拽排序}")}>
|
|
287
|
-
{translate("${" + item.title + "}")}
|
|
288
|
-
</Tooltip>
|
|
289
|
-
);
|
|
290
|
-
column["width"] = 40;
|
|
291
|
-
column["dataIndex"] = item.id;
|
|
292
|
-
column["key"] = item.id;
|
|
293
|
-
column["className"] = "drag-visible";
|
|
294
|
-
column["render"] = () => <DragHandle />;
|
|
295
|
-
},
|
|
296
|
-
setHiddenRecordOpt(column: object, hiddenRowCodes, unHiden, onHide, translate) {
|
|
297
|
-
//隐藏
|
|
298
|
-
column["align"] = "center";
|
|
299
|
-
column["width"] = 40;
|
|
300
|
-
column["title"] = (
|
|
301
|
-
<>
|
|
302
|
-
{hiddenRowCodes.length > 0 ? (
|
|
303
|
-
<Tooltip title={translate("${取消隐藏}")}>
|
|
304
|
-
<Button
|
|
305
|
-
style={{ marginRight: "0px" }}
|
|
306
|
-
size="small"
|
|
307
|
-
shape={"circle"}
|
|
308
|
-
icon={<EyeOutlined />}
|
|
309
|
-
type={"text"}
|
|
310
|
-
onClick={() => unHiden()}
|
|
311
|
-
></Button>
|
|
312
|
-
</Tooltip>
|
|
313
|
-
) : (
|
|
314
|
-
""
|
|
315
|
-
)}
|
|
316
|
-
</>
|
|
317
|
-
);
|
|
318
|
-
column["render"] = (text, record) => (
|
|
319
|
-
<Tooltip title={translate("${隐藏}")}>
|
|
320
|
-
{" "}
|
|
321
|
-
<Button
|
|
322
|
-
style={{ marginRight: "0px" }}
|
|
323
|
-
icon={<EyeInvisibleOutlined />}
|
|
324
|
-
type="dashed"
|
|
325
|
-
size="small"
|
|
326
|
-
onClick={() => onHide(record.code)}
|
|
327
|
-
></Button>
|
|
328
|
-
</Tooltip>
|
|
329
|
-
);
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
buildReportTableColumns(props: ReportColumnBuilderProps) {
|
|
333
|
-
const {
|
|
334
|
-
columnConfigs, translate, leftFixedCols, hiddenColIds, hiddenRowCodes, unHiden, onHide
|
|
335
|
-
} = props;
|
|
336
|
-
|
|
337
|
-
let tableColumns = [];
|
|
338
|
-
let s = 0;
|
|
339
|
-
let colConfigs = columnConfigs;
|
|
340
|
-
|
|
341
|
-
let currentDataColIndex = 0;
|
|
342
|
-
|
|
343
|
-
colConfigs.forEach((item) => {
|
|
344
|
-
if (item.hidden || (hiddenColIds && hiddenColIds.includes(item.originalId))) {
|
|
345
|
-
return
|
|
346
|
-
}
|
|
347
|
-
let column = {};
|
|
348
|
-
if (item.upperColumnTitle) {
|
|
349
|
-
let parent;
|
|
350
|
-
tableColumns.forEach(t => {
|
|
351
|
-
if (t.title == item.upperColumnTitle && t.children) {
|
|
352
|
-
parent = t;
|
|
353
|
-
return
|
|
354
|
-
}
|
|
355
|
-
})
|
|
356
|
-
if (parent) {
|
|
357
|
-
parent.children.push(column);
|
|
358
|
-
} else {
|
|
359
|
-
tableColumns.push({ title: item.upperColumnTitle, children: [column] })
|
|
360
|
-
}
|
|
361
|
-
} else {
|
|
362
|
-
tableColumns.push(column);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
let title1 = translate("${" + item.title + "}");
|
|
366
|
-
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
367
|
-
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
368
|
-
column["dataIndex"] = item.id;
|
|
369
|
-
column["key"] = item.id;
|
|
370
|
-
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
371
|
-
if (item["order"]) column["order"] = Number(item["order"]);
|
|
372
|
-
// column['ellipsis']= true;
|
|
373
|
-
s++;
|
|
374
|
-
|
|
375
|
-
//特殊列处理
|
|
376
|
-
//序号
|
|
377
|
-
if (item.title === "序号") {
|
|
378
|
-
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
379
|
-
column["title"] = translate("${序号}");
|
|
380
|
-
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
381
|
-
column["render"] = (text, record, index) =>
|
|
382
|
-
<label className={record['dataType'] ? record['dataType'] == "小计" ? "xiaoji" : 'heji' : ""}>{record[item.id]}</label>;
|
|
383
|
-
item["sorter"] = undefined;
|
|
384
|
-
} else if (item.id == "10000") {
|
|
385
|
-
this.setSortProps(column, item, translate);
|
|
386
|
-
} else if (item.id == "20000") {
|
|
387
|
-
this.setHiddenRecordOpt(column, hiddenRowCodes, unHiden, onHide, translate);
|
|
388
|
-
} else {
|
|
389
|
-
currentDataColIndex++;
|
|
390
|
-
column["className"] = "opsColumn";
|
|
391
|
-
//column["title"] = translate("${" + item.title + "}");
|
|
392
|
-
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
393
|
-
column["ellipsis"] = { showTitle: true };
|
|
394
|
-
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
395
|
-
if (
|
|
396
|
-
leftFixedCols &&
|
|
397
|
-
leftFixedCols >= currentDataColIndex
|
|
398
|
-
) {
|
|
399
|
-
column["fixed"] = "left";
|
|
400
|
-
} else {
|
|
401
|
-
column["fixed"] = item.colFixed
|
|
402
|
-
? item.colFixed == "right"
|
|
403
|
-
? "right"
|
|
404
|
-
: "left"
|
|
405
|
-
: false;
|
|
406
|
-
}
|
|
407
|
-
column["render"] = (text, record) => {
|
|
408
|
-
return (
|
|
409
|
-
<div className={record['dataType'] ? record['dataType'] == "小计" ? "xiaoji" : 'heji' : ""}>
|
|
410
|
-
<ViewControl
|
|
411
|
-
// serverKey={serverKey}
|
|
412
|
-
fieldConfig={item}
|
|
413
|
-
value={record[item.id]}
|
|
414
|
-
holderType={"table"}
|
|
415
|
-
/></div>
|
|
416
|
-
);
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
// console.log("columns", tableColumns);
|
|
422
|
-
|
|
423
|
-
return tableColumns;
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
handleColumnOrder(columnId, sortColumns) {
|
|
427
|
-
//const sortColumns = this.props.criteriaData["sortColIds"];
|
|
428
|
-
|
|
429
|
-
if (!Array.isArray(sortColumns)) return undefined;
|
|
430
|
-
|
|
431
|
-
for (const column of sortColumns) {
|
|
432
|
-
const [key, sort] = column.split("_");
|
|
433
|
-
|
|
434
|
-
if (key === columnId) {
|
|
435
|
-
if (sort === "asc") return "ascend";
|
|
436
|
-
if (sort === "desc") return "descend";
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
return undefined;
|
|
441
|
-
},
|
|
442
|
-
renderColumnAction(props: ActionRenderProps, record: DtmplData, type: "primary" | "secondary") { // 主列/次列悬浮按钮渲染
|
|
443
|
-
const { ltmplConfig, serverKey, doRowAction, doRAction, doCustomButton, translate, readOnly } = props;
|
|
444
|
-
const { primaryColumnButtons, secondColumnButtons } = ltmplConfig;
|
|
445
|
-
const temButtons = type === "primary" ? primaryColumnButtons : secondColumnButtons;
|
|
446
|
-
if (readOnly || !temButtons?.length) {
|
|
447
|
-
return null;
|
|
448
|
-
}
|
|
449
|
-
const actionButtons: any[] = temButtons.map(item => {
|
|
450
|
-
switch (item.functionType) {
|
|
451
|
-
case "action": // 操作按钮
|
|
452
|
-
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
453
|
-
return <Action
|
|
454
|
-
serverKey={serverKey}
|
|
455
|
-
iconType={"icon"}
|
|
456
|
-
key={item.id}
|
|
457
|
-
data={[record]}
|
|
458
|
-
actionConfig={item}
|
|
459
|
-
doAction={doRowAction}
|
|
460
|
-
buttonSize={"small"}
|
|
461
|
-
serial={1}
|
|
462
|
-
/>;
|
|
463
|
-
} else {
|
|
464
|
-
return undefined;
|
|
465
|
-
}
|
|
466
|
-
case "raction": // 关系按钮
|
|
467
|
-
if (ActionUtils.isShow(item?.preposes, [record], undefined)) {
|
|
468
|
-
return <Button
|
|
469
|
-
key={item.id}
|
|
470
|
-
size="small"
|
|
471
|
-
type="dashed"
|
|
472
|
-
onClick={() => doRAction(item.id, record.code)}
|
|
473
|
-
>
|
|
474
|
-
{item.icon ?
|
|
475
|
-
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
476
|
-
<Icon type={item.icon} />
|
|
477
|
-
</Tooltip>
|
|
478
|
-
: translate("${" + item.title + "}")}
|
|
479
|
-
</Button>;
|
|
480
|
-
} else {
|
|
481
|
-
return undefined;
|
|
482
|
-
}
|
|
483
|
-
case "customButton": // 自由按钮
|
|
484
|
-
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
485
|
-
return <Button
|
|
486
|
-
key={item.id}
|
|
487
|
-
size="small"
|
|
488
|
-
type={item.buttonType || "dashed"}
|
|
489
|
-
onClick={() => doCustomButton(item as unknown as CustomButton, [record])}
|
|
490
|
-
>
|
|
491
|
-
{item.icon ?
|
|
492
|
-
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
493
|
-
<Icon type={item.icon} />
|
|
494
|
-
</Tooltip>
|
|
495
|
-
: translate("${" + item.title + "}")}
|
|
496
|
-
</Button>
|
|
497
|
-
} else {
|
|
498
|
-
return undefined;
|
|
499
|
-
};
|
|
500
|
-
case "fileExport": // 文件导出
|
|
501
|
-
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
502
|
-
return <SelectCodeExport
|
|
503
|
-
serverKey={serverKey}
|
|
504
|
-
hiddenType="disabled"
|
|
505
|
-
codes={[record.code]}
|
|
506
|
-
key={item.id}
|
|
507
|
-
fileExport={item}
|
|
508
|
-
disabled={false}
|
|
509
|
-
/>;
|
|
510
|
-
} else {
|
|
511
|
-
return undefined;
|
|
512
|
-
}
|
|
513
|
-
case "customExport": // 自定义导出
|
|
514
|
-
return undefined;
|
|
515
|
-
case "cQuery": // 关联查询
|
|
516
|
-
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
517
|
-
const config: CQueryConfig = item;
|
|
518
|
-
return <CquickButton
|
|
519
|
-
serverKey={serverKey}
|
|
520
|
-
key={config.id}
|
|
521
|
-
size={"small"}
|
|
522
|
-
pageType={"drawer"}
|
|
523
|
-
cQueryConfig={config}
|
|
524
|
-
mainCode={config.mainCodeColId ? record[config.mainCodeColId] : record.code}
|
|
525
|
-
/>;
|
|
526
|
-
} else {
|
|
527
|
-
return undefined;
|
|
528
|
-
}
|
|
529
|
-
default:
|
|
530
|
-
return undefined;
|
|
531
|
-
}
|
|
532
|
-
}).filter(Boolean);
|
|
533
|
-
return actionButtons?.length ? <div className="column-action"><Space wrap size={4}>{actionButtons}</Space></div> : undefined;
|
|
534
|
-
},
|
|
535
|
-
renderAction(props: ActionRenderProps, record: DtmplData) { // 操作列按钮渲染
|
|
536
|
-
const { ltmplConfig, showView,
|
|
537
|
-
doEdit,
|
|
538
|
-
doRAction,
|
|
539
|
-
customEditable,
|
|
540
|
-
serverKey,
|
|
541
|
-
readOnly,
|
|
542
|
-
sourceId, translate, doCustomButton, doRowJump, blockMenuTreeDrawerOpen,
|
|
543
|
-
doRowAction, doDeleteByCode, editRowEdit, editings, cancelRowEdit, saveRowData, doDelModalOpen,
|
|
544
|
-
doView2D, doEdit2D
|
|
545
|
-
} = props;
|
|
546
|
-
const { buttons, builtInButtons, defShowRowActionCount, strongDeleteConfirmText, edit2DBtnTitle, view2DBtnTitle, deleteBtnTitle } = ltmplConfig;
|
|
547
|
-
|
|
548
|
-
let actionButtons: any[] = [];
|
|
549
|
-
|
|
550
|
-
const isShowDetail = buttons.includes("detail") && showView && ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
551
|
-
const isShowCustomDetail = buttons.includes("customDetail") && showView && ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
552
|
-
|
|
553
|
-
if (isShowCustomDetail) { // 自定义详情
|
|
554
|
-
actionButtons.push(<Button
|
|
555
|
-
size="small"
|
|
556
|
-
type="primary"
|
|
557
|
-
icon={<AlignLeftOutlined />}
|
|
558
|
-
onClick={() => showView({ code: record.code, toCustomPage: true, })}
|
|
559
|
-
/>)
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
if (isShowDetail) { // 默认详情
|
|
563
|
-
actionButtons.push(<ViewButton
|
|
564
|
-
showView={showView}
|
|
565
|
-
data={record}
|
|
566
|
-
ltmplConfig={ltmplConfig}
|
|
567
|
-
buttonType={isShowCustomDetail ? "default" : "primary"} />);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
if (buttons.includes("dtmplEdit") && doEdit && !readOnly) {
|
|
571
|
-
(
|
|
572
|
-
actionButtons.push(<EditButton
|
|
573
|
-
doEdit={doEdit}
|
|
574
|
-
data={record}
|
|
575
|
-
ltmplConfig={ltmplConfig}
|
|
576
|
-
></EditButton>)
|
|
577
|
-
)
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
// 2D图编辑
|
|
581
|
-
if (buttons.includes("edit2D") && doEdit2D && !readOnly) {
|
|
582
|
-
actionButtons.push((!edit2DBtnTitle || edit2DBtnTitle?.length < 4) ? <Button size="small" onClick={() => doEdit2D(record.code)}>{edit2DBtnTitle || <SettingOutlined />}</Button> :
|
|
583
|
-
<Tooltip title={edit2DBtnTitle}><Button size="small" onClick={() => doEdit2D(record.code)} icon={<SettingOutlined />} /></Tooltip>)
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// 2D图查看
|
|
587
|
-
if (buttons.includes("view2D") && doView2D && !readOnly) {
|
|
588
|
-
actionButtons.push((!view2DBtnTitle || view2DBtnTitle?.length < 4) ? <Button size="small" onClick={() => doView2D(record.code)}>{ltmplConfig.view2DBtnTitle || <PlaySquareOutlined />}</Button> :
|
|
589
|
-
<Tooltip title={edit2DBtnTitle}><Button size="small" onClick={() => doView2D(record.code)} icon={<PlaySquareOutlined />} /></Tooltip>)
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// 行内编辑
|
|
593
|
-
if (buttons.includes("rowEdit") && !buttons.includes("multiRowEdit")) {
|
|
594
|
-
actionButtons.push(<InlineEditButton
|
|
595
|
-
editings={editings}
|
|
596
|
-
editRowEdit={editRowEdit}
|
|
597
|
-
cancelRowEdit={cancelRowEdit}
|
|
598
|
-
saveRowData={saveRowData}
|
|
599
|
-
data={record}
|
|
600
|
-
/>);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
if (builtInButtons?.includes("blockAuthMenuTree") && !readOnly) {
|
|
604
|
-
actionButtons.push(<Button
|
|
605
|
-
size="small"
|
|
606
|
-
type="dashed"
|
|
607
|
-
icon={
|
|
608
|
-
<KeyOutlined
|
|
609
|
-
rotate={180}
|
|
610
|
-
style={{ color: "#f5222d", marginRight: "4px" }}
|
|
611
|
-
/>
|
|
612
|
-
}
|
|
613
|
-
onClick={() => blockMenuTreeDrawerOpen(record)
|
|
614
|
-
}
|
|
615
|
-
></Button>)
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
if ((buttons.includes("dtmplCustomEdit") || customEditable) &&
|
|
619
|
-
doEdit &&
|
|
620
|
-
!readOnly &&
|
|
621
|
-
ActionUtils.isShow(
|
|
622
|
-
ltmplConfig.buttonEditAction?.preposes,
|
|
623
|
-
[record],
|
|
624
|
-
undefined
|
|
625
|
-
)) {
|
|
626
|
-
actionButtons.push(<Button
|
|
627
|
-
size="small"
|
|
628
|
-
type="dashed"
|
|
629
|
-
icon={<FormOutlined />}
|
|
630
|
-
onClick={() =>
|
|
631
|
-
doEdit({
|
|
632
|
-
code: record.code,
|
|
633
|
-
mode: "update",
|
|
634
|
-
toCustomPage: true,
|
|
635
|
-
})
|
|
636
|
-
}
|
|
637
|
-
></Button>)
|
|
638
|
-
}
|
|
639
|
-
if (buttons.includes("copy") && doEdit && !readOnly) {
|
|
640
|
-
actionButtons.push(<Tooltip title={translate("${复制}")}>
|
|
641
|
-
<Button
|
|
642
|
-
size="small"
|
|
643
|
-
type="dashed"
|
|
644
|
-
icon={<CopyOutlined />}
|
|
645
|
-
onClick={async () => {
|
|
646
|
-
//先复制
|
|
647
|
-
let toCustomPage = false;
|
|
648
|
-
if (buttons.includes("dtmplCustomEdit") || customEditable) {
|
|
649
|
-
toCustomPage = true;
|
|
650
|
-
}
|
|
651
|
-
let code = await HcserviceV3.doCopy(
|
|
652
|
-
serverKey,
|
|
653
|
-
sourceId,
|
|
654
|
-
record.code
|
|
655
|
-
);
|
|
656
|
-
if (code) {
|
|
657
|
-
doEdit({ code, mode: "update", toCustomPage });
|
|
658
|
-
}
|
|
659
|
-
}}
|
|
660
|
-
></Button>
|
|
661
|
-
</Tooltip>)
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
if (ltmplConfig.rowCustomButtons) {
|
|
665
|
-
ltmplConfig.rowCustomButtons.map((customButton) => {
|
|
666
|
-
if (ActionUtils.isShow(
|
|
667
|
-
customButton.preposes,
|
|
668
|
-
[record],
|
|
669
|
-
undefined
|
|
670
|
-
)) {
|
|
671
|
-
actionButtons.push(
|
|
672
|
-
<Button
|
|
673
|
-
key={customButton.id}
|
|
674
|
-
size="small"
|
|
675
|
-
type={
|
|
676
|
-
customButton.buttonType
|
|
677
|
-
? customButton.buttonType
|
|
678
|
-
: "dashed"
|
|
679
|
-
}
|
|
680
|
-
onClick={() =>
|
|
681
|
-
doCustomButton(customButton, [record])
|
|
682
|
-
}
|
|
683
|
-
>
|
|
684
|
-
{customButton.icon ?
|
|
685
|
-
<Tooltip placement="top" title={translate("${" + customButton.title + "}")}>
|
|
686
|
-
<Icon type={customButton.icon}></Icon>
|
|
687
|
-
</Tooltip>
|
|
688
|
-
: translate("${" + customButton.title + "}")}
|
|
689
|
-
</Button>
|
|
690
|
-
)
|
|
691
|
-
};
|
|
692
|
-
})
|
|
693
|
-
}
|
|
694
|
-
if (ltmplConfig.ractions && !readOnly) {
|
|
695
|
-
ltmplConfig.ractions.map((raction) => {
|
|
696
|
-
if (ActionUtils.isShow(
|
|
697
|
-
raction?.preposes,
|
|
698
|
-
[record],
|
|
699
|
-
undefined
|
|
700
|
-
)) {
|
|
701
|
-
actionButtons.push(
|
|
702
|
-
<Button
|
|
703
|
-
key={raction.id}
|
|
704
|
-
size="small"
|
|
705
|
-
type="dashed"
|
|
706
|
-
onClick={() => doRAction(raction.id, record.code)}
|
|
707
|
-
>
|
|
708
|
-
{raction.icon ?
|
|
709
|
-
<Tooltip placement="top" title={translate("${" + raction.title + "}")}>
|
|
710
|
-
<Icon type={raction.icon}></Icon>
|
|
711
|
-
</Tooltip>
|
|
712
|
-
: translate("${" + raction.title + "}")}
|
|
713
|
-
</Button>
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
})
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
if (ltmplConfig.rowActions &&
|
|
720
|
-
!readOnly &&
|
|
721
|
-
ltmplConfig.rowActions.length > 0) {
|
|
722
|
-
ltmplConfig.rowActions.map((action) => {
|
|
723
|
-
actionButtons.push(
|
|
724
|
-
<Action
|
|
725
|
-
serverKey={serverKey}
|
|
726
|
-
iconType={"icon"}
|
|
727
|
-
key={action.id}
|
|
728
|
-
data={[record]}
|
|
729
|
-
actionConfig={action}
|
|
730
|
-
doAction={doRowAction}
|
|
731
|
-
buttonSize={"small"}
|
|
732
|
-
serial={1}
|
|
733
|
-
></Action>
|
|
734
|
-
);
|
|
735
|
-
})
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
if (ltmplConfig.rowJumps &&
|
|
739
|
-
ltmplConfig.rowJumps.length > 0 &&
|
|
740
|
-
!readOnly) {
|
|
741
|
-
ltmplConfig.rowJumps.map((jump) => {
|
|
742
|
-
if (ActionUtils.isShow(
|
|
743
|
-
jump.preposes,
|
|
744
|
-
[record],
|
|
745
|
-
undefined
|
|
746
|
-
)) {
|
|
747
|
-
actionButtons.push(
|
|
748
|
-
<Button
|
|
749
|
-
key={jump.id}
|
|
750
|
-
size="small"
|
|
751
|
-
type="dashed"
|
|
752
|
-
onClick={() => doRowJump(jump, record)}
|
|
753
|
-
>
|
|
754
|
-
{jump.icon ?
|
|
755
|
-
<Tooltip placement="top" title={translate("${" + jump.title + "}")}>
|
|
756
|
-
<Icon type={jump.icon}></Icon>
|
|
757
|
-
</Tooltip>
|
|
758
|
-
: translate("${" + jump.title + "}")}
|
|
759
|
-
</Button>
|
|
760
|
-
)
|
|
761
|
-
};
|
|
762
|
-
})
|
|
763
|
-
}
|
|
764
|
-
if (ltmplConfig.rowCQuerys &&
|
|
765
|
-
ltmplConfig.rowCQuerys.length > 0 &&
|
|
766
|
-
!readOnly
|
|
767
|
-
) {
|
|
768
|
-
ltmplConfig.rowCQuerys.map((cquery) => {
|
|
769
|
-
if (ActionUtils.isShow(
|
|
770
|
-
cquery.preposes,
|
|
771
|
-
[record],
|
|
772
|
-
undefined
|
|
773
|
-
)) {
|
|
774
|
-
actionButtons.push(
|
|
775
|
-
<CquickButton
|
|
776
|
-
serverKey={serverKey}
|
|
777
|
-
key={cquery.id}
|
|
778
|
-
size={"small"}
|
|
779
|
-
pageType={"drawer"}
|
|
780
|
-
cQueryConfig={cquery}
|
|
781
|
-
mainCode={
|
|
782
|
-
cquery.mainCodeColId
|
|
783
|
-
? record[cquery.mainCodeColId]
|
|
784
|
-
: record.code
|
|
785
|
-
}
|
|
786
|
-
/>
|
|
787
|
-
)
|
|
788
|
-
};
|
|
789
|
-
})
|
|
790
|
-
}
|
|
791
|
-
if (ltmplConfig.rowFileButtons &&
|
|
792
|
-
ltmplConfig.rowFileButtons.length > 0) {
|
|
793
|
-
ltmplConfig.rowFileButtons.map((openFileButton) => {
|
|
794
|
-
let v = record[openFileButton.fieldId];
|
|
795
|
-
if (v) {
|
|
796
|
-
if (v instanceof Array) {
|
|
797
|
-
v = v[0];
|
|
798
|
-
}
|
|
799
|
-
if (v.includes("@R@") > 0) {
|
|
800
|
-
v = v.split("@R@")[1];
|
|
801
|
-
}
|
|
802
|
-
actionButtons.push(
|
|
803
|
-
<NewinFileView
|
|
804
|
-
title={openFileButton.title}
|
|
805
|
-
filePath={HcserviceV3.toFilePath(v, serverKey)}
|
|
806
|
-
serverKey={serverKey}
|
|
807
|
-
key={openFileButton.id}
|
|
808
|
-
//size={"small"}
|
|
809
|
-
/>
|
|
810
|
-
);
|
|
811
|
-
}
|
|
812
|
-
})
|
|
813
|
-
}
|
|
814
|
-
if (buttons.includes("singleDelete") &&
|
|
815
|
-
!readOnly &&
|
|
816
|
-
ActionUtils.isShow(
|
|
817
|
-
ltmplConfig.buttonDeleteAction?.preposes,
|
|
818
|
-
[record],
|
|
819
|
-
undefined
|
|
820
|
-
)) {
|
|
821
|
-
actionButtons.push(
|
|
822
|
-
strongDeleteConfirmText ?
|
|
823
|
-
((!deleteBtnTitle || deleteBtnTitle?.length < 4) ?
|
|
824
|
-
<Button size="small" type="dashed" danger onClick={() => doDelModalOpen(record)}>
|
|
825
|
-
{deleteBtnTitle || <DeleteOutlined />}
|
|
826
|
-
</Button> : <Tooltip title={deleteBtnTitle}>
|
|
827
|
-
<Button size="small" type="dashed" danger onClick={() => doDelModalOpen(record)} icon={<DeleteOutlined />} />
|
|
828
|
-
</Tooltip>)
|
|
829
|
-
:
|
|
830
|
-
<Popconfirm
|
|
831
|
-
placement="rightBottom"
|
|
832
|
-
title={translate("${确定要[删除]此数据吗}?")}
|
|
833
|
-
onConfirm={() => doDeleteByCode(record)}
|
|
834
|
-
okText={translate("${确定}")}
|
|
835
|
-
cancelText={translate("${取消}")}
|
|
836
|
-
okType={"danger"}
|
|
837
|
-
>
|
|
838
|
-
{(!deleteBtnTitle || deleteBtnTitle?.length < 4) ?
|
|
839
|
-
<Button size="small" type="dashed" danger >{deleteBtnTitle || <DeleteOutlined />}</Button> :
|
|
840
|
-
<Tooltip title={deleteBtnTitle}><Button size="small" type="dashed" danger icon={<DeleteOutlined />} /></Tooltip>}
|
|
841
|
-
</Popconfirm>
|
|
842
|
-
)
|
|
843
|
-
}
|
|
844
|
-
let showButtons = [];
|
|
845
|
-
if (defShowRowActionCount <= 0 || defShowRowActionCount >= actionButtons.length) {
|
|
846
|
-
showButtons = actionButtons
|
|
847
|
-
} else {
|
|
848
|
-
showButtons = actionButtons.slice(0, defShowRowActionCount)
|
|
849
|
-
showButtons.push(
|
|
850
|
-
<Popover content={<Space wrap>
|
|
851
|
-
{actionButtons.slice(defShowRowActionCount, actionButtons.length)}
|
|
852
|
-
</Space>} title={"更多操作"} trigger="hover">
|
|
853
|
-
<Button size={"small"} icon={<EllipsisOutlined />} shape="circle" ></Button>
|
|
854
|
-
</Popover>
|
|
855
|
-
);
|
|
856
|
-
}
|
|
857
|
-
return <Space size={[0, 4]} wrap>
|
|
858
|
-
{showButtons}
|
|
859
|
-
</Space>
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
const DragHandle = SortableHandle(() => (
|
|
864
|
-
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ActionRenderProps, ColumnConfig, DtmplData, LtmplConfig, FieldConfig, CustomButton, CQueryConfig } from "../../tmpl/interface";
|
|
3
|
+
import TableUnits from "../table-util";
|
|
4
|
+
import SupportInputTypes from "../../tmpl/control-type-supportor";
|
|
5
|
+
import { Button, Popconfirm, Popover, Space, Tooltip, Form as AntdForm } from "antd";
|
|
6
|
+
import { SortableHandle } from "react-sortable-hoc";
|
|
7
|
+
import {
|
|
8
|
+
AlignLeftOutlined, CopyOutlined, DeleteOutlined,
|
|
9
|
+
EllipsisOutlined,
|
|
10
|
+
EyeInvisibleOutlined,
|
|
11
|
+
EyeOutlined,
|
|
12
|
+
FormOutlined,
|
|
13
|
+
KeyOutlined,
|
|
14
|
+
MenuOutlined, QuestionCircleOutlined, PlaySquareOutlined,
|
|
15
|
+
SettingOutlined
|
|
16
|
+
} from "@ant-design/icons";
|
|
17
|
+
import ActionUtils from "../../controls/action/utils";
|
|
18
|
+
import ViewButton from "../../detail/button/view-button";
|
|
19
|
+
import EditButton from "../../detail/button/edit-button";
|
|
20
|
+
import InlineEditButton from "../../detail/button/inline-edit-button";
|
|
21
|
+
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
22
|
+
import Action from "../../controls/action";
|
|
23
|
+
import CquickButton from "../../controls/cquery/cquick-button";
|
|
24
|
+
import { ViewControl } from "../../index";
|
|
25
|
+
import NewinFileView from "../../controls/file-view/newin-file-view";
|
|
26
|
+
import { EntryControl } from "../../index";
|
|
27
|
+
import TmplConfigAnalysis from "../../tmpl/tmpl-config-analysis";
|
|
28
|
+
import Icon from "../../icon/aliIcon";
|
|
29
|
+
import SelectCodeExport from "../../controls/file-export/select-code-export";
|
|
30
|
+
import "./index.less";
|
|
31
|
+
|
|
32
|
+
const FormItem = AntdForm.Item;
|
|
33
|
+
|
|
34
|
+
const isDisabled = (record: DtmplData, item: FieldConfig) => {
|
|
35
|
+
if (!item.rowEditType) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
let isNew: boolean = record.editStatus === "new";
|
|
39
|
+
let type = item.rowEditType;
|
|
40
|
+
if (type === "editable" || (type === "editonly" && !isNew) || (type === "addonly" && isNew)) {
|
|
41
|
+
return false;
|
|
42
|
+
} else if (type === "readonly") {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
interface ColumnBuilderProps extends ActionRenderProps {
|
|
50
|
+
ltmplConfig: LtmplConfig,
|
|
51
|
+
hiddenColIds?: string[],
|
|
52
|
+
hiddenRowCodes?: string[],
|
|
53
|
+
sortedColConfigs?: ColumnConfig[],
|
|
54
|
+
unHiden?: () => any,
|
|
55
|
+
onHide?: (code: string) => any,
|
|
56
|
+
operatable?: boolean,
|
|
57
|
+
mainCode?: string,
|
|
58
|
+
criteriaData?: object,
|
|
59
|
+
actTableDoSearch?: (data: object) => void,
|
|
60
|
+
columnResize?: { [key: string]: number }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface ReportColumnBuilderProps {
|
|
64
|
+
columnConfigs: ColumnConfig[],
|
|
65
|
+
hiddenColIds?: string[],
|
|
66
|
+
translate: (...strs: string[]) => string;
|
|
67
|
+
leftFixedCols: number,
|
|
68
|
+
hiddenRowCodes?: string[],
|
|
69
|
+
unHiden?: () => any,
|
|
70
|
+
onHide?: (code: string) => any,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
|
|
76
|
+
buildTableColumns(props: ColumnBuilderProps) {
|
|
77
|
+
const {
|
|
78
|
+
ltmplConfig,
|
|
79
|
+
hiddenColIds,
|
|
80
|
+
hiddenRowCodes,
|
|
81
|
+
sortedColConfigs, unHiden,
|
|
82
|
+
onHide, translate,
|
|
83
|
+
sortColumns, serverKey,
|
|
84
|
+
editings, mainCode, criteriaData, actTableDoSearch, showView,
|
|
85
|
+
columnResize
|
|
86
|
+
} = props;
|
|
87
|
+
|
|
88
|
+
const { primaryColumn, secondColumn, primaryColumnLabel } = ltmplConfig.extDisplayConfig || {};
|
|
89
|
+
|
|
90
|
+
let tableColumns = [];
|
|
91
|
+
let s = 0;
|
|
92
|
+
let colConfigs = sortedColConfigs ? sortedColConfigs : ltmplConfig.columns;
|
|
93
|
+
let buttons = ltmplConfig.buttons || [];
|
|
94
|
+
|
|
95
|
+
let currentDataColIndex = 0;
|
|
96
|
+
|
|
97
|
+
colConfigs.forEach((item) => {
|
|
98
|
+
let column = {};
|
|
99
|
+
if (hiddenColIds && hiddenColIds.includes(item.originalId)) {
|
|
100
|
+
return
|
|
101
|
+
} else {
|
|
102
|
+
if (item.columnGroupName) { // 表头分组功能实现
|
|
103
|
+
const groupIndex = tableColumns.findIndex(r => r.children?.length && r.title === item.columnGroupName);
|
|
104
|
+
if (groupIndex !== -1) {
|
|
105
|
+
tableColumns[groupIndex].children.push(column);
|
|
106
|
+
} else {
|
|
107
|
+
tableColumns.push({ title: item.columnGroupName, align: "center", children: [column] });
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
tableColumns.push(column);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
let title1 = translate("${" + item.title + "}");
|
|
114
|
+
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
115
|
+
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
116
|
+
column["dataIndex"] = item.id;
|
|
117
|
+
column["key"] = item.id;
|
|
118
|
+
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
119
|
+
if (item["statColType"]) column["statColType"] = item["statColType"];
|
|
120
|
+
if (item["aggFunc"]) column["cal"] = item["aggFunc"];
|
|
121
|
+
if (item["order"]) column["order"] = Number(item["order"]);
|
|
122
|
+
// column['ellipsis']= true;
|
|
123
|
+
s++;
|
|
124
|
+
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
125
|
+
if (s < 12 && item.title != "操作" && item.title != "序号") {
|
|
126
|
+
if (hiddenColIds.includes("10000")) {
|
|
127
|
+
const order = this.handleColumnOrder(column["dataIndex"], sortColumns);
|
|
128
|
+
if (item.sortable) {
|
|
129
|
+
TableUnits.sort(column, itemType, order);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//特殊列处理
|
|
134
|
+
//序号
|
|
135
|
+
if (item.title === "序号") {
|
|
136
|
+
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
137
|
+
column["title"] = translate("${序号}");
|
|
138
|
+
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
139
|
+
column["render"] = (text, record, index) => <label>{index + 1}</label>;
|
|
140
|
+
item["sorter"] = undefined;
|
|
141
|
+
} else if (item.id == "10000") {
|
|
142
|
+
this.setSortProps(column, item, translate);
|
|
143
|
+
} else if (item.id == "20000") {
|
|
144
|
+
this.setHiddenRecordOpt(column, hiddenRowCodes, unHiden, onHide, translate);
|
|
145
|
+
} else if (item.title === "操作" && props.operatable) {
|
|
146
|
+
column["操作"] = "1";
|
|
147
|
+
column["fixed"] = "right";
|
|
148
|
+
column["align"] = "left";
|
|
149
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
150
|
+
column["className"] = "opsColumn";
|
|
151
|
+
column["title"] = <>{translate("${操作}")}</>;
|
|
152
|
+
column["render"] = (text, record) => this.renderAction(props, record);
|
|
153
|
+
} else {
|
|
154
|
+
currentDataColIndex++;
|
|
155
|
+
column["className"] = "opsColumn";
|
|
156
|
+
// column["title"] = item.tip? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
157
|
+
// <Button icon={<QuestionCircleOutlined />} /></Tooltip> </>: title1;
|
|
158
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
159
|
+
column["ellipsis"] = { showTitle: true };
|
|
160
|
+
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
161
|
+
if (
|
|
162
|
+
ltmplConfig.leftFixedCols &&
|
|
163
|
+
ltmplConfig.leftFixedCols >= currentDataColIndex
|
|
164
|
+
) {
|
|
165
|
+
column["fixed"] = "left";
|
|
166
|
+
} else {
|
|
167
|
+
column["fixed"] = item.colFixed
|
|
168
|
+
? item.colFixed == "right"
|
|
169
|
+
? "right"
|
|
170
|
+
: "left"
|
|
171
|
+
: false;
|
|
172
|
+
}
|
|
173
|
+
column["render"] = (text, record) => {
|
|
174
|
+
let detailParams = undefined;
|
|
175
|
+
if (showView && primaryColumn?.id === item.id) { // 首字段增加主题色显示/查看详情功能
|
|
176
|
+
if (buttons.includes("detail")) {
|
|
177
|
+
const classView = ltmplConfig.classViewConfigs.find(r => ActionUtils.isShow(r.preposes, [record], undefined));
|
|
178
|
+
if (classView) {
|
|
179
|
+
detailParams = { code: record.code, dtmplSourceId: classView.id };
|
|
180
|
+
} else {
|
|
181
|
+
const isdetail = ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
182
|
+
detailParams = isdetail ? { code: record.code } : undefined;
|
|
183
|
+
}
|
|
184
|
+
} else if (buttons.includes("customDetail")) {
|
|
185
|
+
detailParams = { code: record.code, toCustomPage: true };
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// 首字段渲染
|
|
190
|
+
const renderPrimaryColumn = <div className="column-table-primary">
|
|
191
|
+
<div className="primary-column" onClick={() => detailParams && showView(detailParams)}>
|
|
192
|
+
<ViewControl
|
|
193
|
+
serverKey={serverKey}
|
|
194
|
+
fieldConfig={item}
|
|
195
|
+
value={record[item.id]}
|
|
196
|
+
holderType="table"
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
{primaryColumnLabel?.id ?
|
|
200
|
+
<div className="primary-column-label" >
|
|
201
|
+
<ViewControl
|
|
202
|
+
serverKey={serverKey}
|
|
203
|
+
fieldConfig={primaryColumnLabel}
|
|
204
|
+
value={record[primaryColumnLabel.id]}
|
|
205
|
+
holderType="table"
|
|
206
|
+
/>
|
|
207
|
+
</div> :
|
|
208
|
+
""}
|
|
209
|
+
{/* 首字段操作按钮 */}
|
|
210
|
+
{this.renderColumnAction(props, record, "primary")}
|
|
211
|
+
</div>;
|
|
212
|
+
// 次字段渲染
|
|
213
|
+
const renderSecondColumn = <div className="column-table-second">
|
|
214
|
+
<ViewControl
|
|
215
|
+
serverKey={serverKey}
|
|
216
|
+
fieldConfig={item}
|
|
217
|
+
value={record[item.id]}
|
|
218
|
+
holderType="table"
|
|
219
|
+
/>
|
|
220
|
+
{this.renderColumnAction(props, record, "secondary")}
|
|
221
|
+
</div>;
|
|
222
|
+
|
|
223
|
+
return (editings.includes(record.code) || buttons.includes("multiRowEdit") ?
|
|
224
|
+
<FormItem style={{ margin: 0 }}
|
|
225
|
+
name={record.code + "_" + item.id}
|
|
226
|
+
key={record.code + "_" + item.id}
|
|
227
|
+
rules={TmplConfigAnalysis.getRules(item, translate)}
|
|
228
|
+
initialValue={record[item.id]}>
|
|
229
|
+
<EntryControl
|
|
230
|
+
serverKey={serverKey}
|
|
231
|
+
fieldConfig={{ ...item, disabled: isDisabled(record, item) }}
|
|
232
|
+
value={record[item.id]}
|
|
233
|
+
/>
|
|
234
|
+
</FormItem> :
|
|
235
|
+
<div className={record['dataType'] ? record['dataType'] === "小计" ? "xiaoji" : 'heji' : ""}>
|
|
236
|
+
{primaryColumn?.id === item.id ? renderPrimaryColumn : secondColumn?.id === item.id ? renderSecondColumn :
|
|
237
|
+
<ViewControl
|
|
238
|
+
serverKey={serverKey}
|
|
239
|
+
fieldConfig={item}
|
|
240
|
+
value={record[item.id]}
|
|
241
|
+
holderType="table"
|
|
242
|
+
/>
|
|
243
|
+
}
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
// 表头列搜索
|
|
249
|
+
if (item.appendCriteria) {
|
|
250
|
+
const criteria = item.appendCriteria;
|
|
251
|
+
let searchVal = criteriaData?.[`c_${criteria.id}`];
|
|
252
|
+
column["filterDropdown"] = ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (<div style={{ padding: 8 }} onKeyDown={(e) => e.stopPropagation()}>
|
|
253
|
+
<EntryControl
|
|
254
|
+
serverKey={serverKey}
|
|
255
|
+
mainCode={mainCode}
|
|
256
|
+
value={searchVal}
|
|
257
|
+
fieldConfig={criteria}
|
|
258
|
+
onChange={(val) => {
|
|
259
|
+
const value = val?.target ? val.target.value : val;
|
|
260
|
+
setSelectedKeys(value ? [value] : []);
|
|
261
|
+
searchVal = value;
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", paddingTop: 8 }}>
|
|
265
|
+
<Button type="text" size="small" onClick={() => {
|
|
266
|
+
clearFilters();
|
|
267
|
+
searchVal = undefined;
|
|
268
|
+
}}>{translate("${重置}")}</Button>
|
|
269
|
+
<Button onClick={() => {
|
|
270
|
+
actTableDoSearch({ [`c_${criteria.id}`]: selectedKeys[0] });
|
|
271
|
+
confirm();
|
|
272
|
+
}} type="primary" size="small">{translate("${确定}")}</Button>
|
|
273
|
+
</div>
|
|
274
|
+
</div>);
|
|
275
|
+
column["filteredValue"] = searchVal || undefined;
|
|
276
|
+
}
|
|
277
|
+
if (columnResize?.[item.id]) { // 本地缓存存在列宽配置
|
|
278
|
+
column["width"] = columnResize[item.id];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
return tableColumns;
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
setSortProps(column: object, item: ColumnConfig, translate) {
|
|
285
|
+
column["title"] = (
|
|
286
|
+
<Tooltip title={translate("${拖拽排序}")}>
|
|
287
|
+
{translate("${" + item.title + "}")}
|
|
288
|
+
</Tooltip>
|
|
289
|
+
);
|
|
290
|
+
column["width"] = 40;
|
|
291
|
+
column["dataIndex"] = item.id;
|
|
292
|
+
column["key"] = item.id;
|
|
293
|
+
column["className"] = "drag-visible";
|
|
294
|
+
column["render"] = () => <DragHandle />;
|
|
295
|
+
},
|
|
296
|
+
setHiddenRecordOpt(column: object, hiddenRowCodes, unHiden, onHide, translate) {
|
|
297
|
+
//隐藏
|
|
298
|
+
column["align"] = "center";
|
|
299
|
+
column["width"] = 40;
|
|
300
|
+
column["title"] = (
|
|
301
|
+
<>
|
|
302
|
+
{hiddenRowCodes.length > 0 ? (
|
|
303
|
+
<Tooltip title={translate("${取消隐藏}")}>
|
|
304
|
+
<Button
|
|
305
|
+
style={{ marginRight: "0px" }}
|
|
306
|
+
size="small"
|
|
307
|
+
shape={"circle"}
|
|
308
|
+
icon={<EyeOutlined />}
|
|
309
|
+
type={"text"}
|
|
310
|
+
onClick={() => unHiden()}
|
|
311
|
+
></Button>
|
|
312
|
+
</Tooltip>
|
|
313
|
+
) : (
|
|
314
|
+
""
|
|
315
|
+
)}
|
|
316
|
+
</>
|
|
317
|
+
);
|
|
318
|
+
column["render"] = (text, record) => (
|
|
319
|
+
<Tooltip title={translate("${隐藏}")}>
|
|
320
|
+
{" "}
|
|
321
|
+
<Button
|
|
322
|
+
style={{ marginRight: "0px" }}
|
|
323
|
+
icon={<EyeInvisibleOutlined />}
|
|
324
|
+
type="dashed"
|
|
325
|
+
size="small"
|
|
326
|
+
onClick={() => onHide(record.code)}
|
|
327
|
+
></Button>
|
|
328
|
+
</Tooltip>
|
|
329
|
+
);
|
|
330
|
+
},
|
|
331
|
+
|
|
332
|
+
buildReportTableColumns(props: ReportColumnBuilderProps) {
|
|
333
|
+
const {
|
|
334
|
+
columnConfigs, translate, leftFixedCols, hiddenColIds, hiddenRowCodes, unHiden, onHide
|
|
335
|
+
} = props;
|
|
336
|
+
|
|
337
|
+
let tableColumns = [];
|
|
338
|
+
let s = 0;
|
|
339
|
+
let colConfigs = columnConfigs;
|
|
340
|
+
|
|
341
|
+
let currentDataColIndex = 0;
|
|
342
|
+
|
|
343
|
+
colConfigs.forEach((item) => {
|
|
344
|
+
if (item.hidden || (hiddenColIds && hiddenColIds.includes(item.originalId))) {
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
let column = {};
|
|
348
|
+
if (item.upperColumnTitle) {
|
|
349
|
+
let parent;
|
|
350
|
+
tableColumns.forEach(t => {
|
|
351
|
+
if (t.title == item.upperColumnTitle && t.children) {
|
|
352
|
+
parent = t;
|
|
353
|
+
return
|
|
354
|
+
}
|
|
355
|
+
})
|
|
356
|
+
if (parent) {
|
|
357
|
+
parent.children.push(column);
|
|
358
|
+
} else {
|
|
359
|
+
tableColumns.push({ title: item.upperColumnTitle, children: [column] })
|
|
360
|
+
}
|
|
361
|
+
} else {
|
|
362
|
+
tableColumns.push(column);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
let title1 = translate("${" + item.title + "}");
|
|
366
|
+
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
367
|
+
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
368
|
+
column["dataIndex"] = item.id;
|
|
369
|
+
column["key"] = item.id;
|
|
370
|
+
if (item["colWidth"]) column["width"] = item["colWidth"];
|
|
371
|
+
if (item["order"]) column["order"] = Number(item["order"]);
|
|
372
|
+
// column['ellipsis']= true;
|
|
373
|
+
s++;
|
|
374
|
+
|
|
375
|
+
//特殊列处理
|
|
376
|
+
//序号
|
|
377
|
+
if (item.title === "序号") {
|
|
378
|
+
column["width"] = item.colWidth ? item.colWidth : 50;
|
|
379
|
+
column["title"] = translate("${序号}");
|
|
380
|
+
column["align"] = item.valueAlign ? item.valueAlign : "center";
|
|
381
|
+
column["render"] = (text, record, index) =>
|
|
382
|
+
<label className={record['dataType'] ? record['dataType'] == "小计" ? "xiaoji" : 'heji' : ""}>{record[item.id]}</label>;
|
|
383
|
+
item["sorter"] = undefined;
|
|
384
|
+
} else if (item.id == "10000") {
|
|
385
|
+
this.setSortProps(column, item, translate);
|
|
386
|
+
} else if (item.id == "20000") {
|
|
387
|
+
this.setHiddenRecordOpt(column, hiddenRowCodes, unHiden, onHide, translate);
|
|
388
|
+
} else {
|
|
389
|
+
currentDataColIndex++;
|
|
390
|
+
column["className"] = "opsColumn";
|
|
391
|
+
//column["title"] = translate("${" + item.title + "}");
|
|
392
|
+
column["width"] = item.colWidth ? item.colWidth : 160;
|
|
393
|
+
column["ellipsis"] = { showTitle: true };
|
|
394
|
+
column["align"] = item.valueAlign ? item.valueAlign : "left";
|
|
395
|
+
if (
|
|
396
|
+
leftFixedCols &&
|
|
397
|
+
leftFixedCols >= currentDataColIndex
|
|
398
|
+
) {
|
|
399
|
+
column["fixed"] = "left";
|
|
400
|
+
} else {
|
|
401
|
+
column["fixed"] = item.colFixed
|
|
402
|
+
? item.colFixed == "right"
|
|
403
|
+
? "right"
|
|
404
|
+
: "left"
|
|
405
|
+
: false;
|
|
406
|
+
}
|
|
407
|
+
column["render"] = (text, record) => {
|
|
408
|
+
return (
|
|
409
|
+
<div className={record['dataType'] ? record['dataType'] == "小计" ? "xiaoji" : 'heji' : ""}>
|
|
410
|
+
<ViewControl
|
|
411
|
+
// serverKey={serverKey}
|
|
412
|
+
fieldConfig={item}
|
|
413
|
+
value={record[item.id]}
|
|
414
|
+
holderType={"table"}
|
|
415
|
+
/></div>
|
|
416
|
+
);
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
// console.log("columns", tableColumns);
|
|
422
|
+
|
|
423
|
+
return tableColumns;
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
handleColumnOrder(columnId, sortColumns) {
|
|
427
|
+
//const sortColumns = this.props.criteriaData["sortColIds"];
|
|
428
|
+
|
|
429
|
+
if (!Array.isArray(sortColumns)) return undefined;
|
|
430
|
+
|
|
431
|
+
for (const column of sortColumns) {
|
|
432
|
+
const [key, sort] = column.split("_");
|
|
433
|
+
|
|
434
|
+
if (key === columnId) {
|
|
435
|
+
if (sort === "asc") return "ascend";
|
|
436
|
+
if (sort === "desc") return "descend";
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return undefined;
|
|
441
|
+
},
|
|
442
|
+
renderColumnAction(props: ActionRenderProps, record: DtmplData, type: "primary" | "secondary") { // 主列/次列悬浮按钮渲染
|
|
443
|
+
const { ltmplConfig, serverKey, doRowAction, doRAction, doCustomButton, translate, readOnly } = props;
|
|
444
|
+
const { primaryColumnButtons, secondColumnButtons } = ltmplConfig;
|
|
445
|
+
const temButtons = type === "primary" ? primaryColumnButtons : secondColumnButtons;
|
|
446
|
+
if (readOnly || !temButtons?.length) {
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
const actionButtons: any[] = temButtons.map(item => {
|
|
450
|
+
switch (item.functionType) {
|
|
451
|
+
case "action": // 操作按钮
|
|
452
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
453
|
+
return <Action
|
|
454
|
+
serverKey={serverKey}
|
|
455
|
+
iconType={"icon"}
|
|
456
|
+
key={item.id}
|
|
457
|
+
data={[record]}
|
|
458
|
+
actionConfig={item}
|
|
459
|
+
doAction={doRowAction}
|
|
460
|
+
buttonSize={"small"}
|
|
461
|
+
serial={1}
|
|
462
|
+
/>;
|
|
463
|
+
} else {
|
|
464
|
+
return undefined;
|
|
465
|
+
}
|
|
466
|
+
case "raction": // 关系按钮
|
|
467
|
+
if (ActionUtils.isShow(item?.preposes, [record], undefined)) {
|
|
468
|
+
return <Button
|
|
469
|
+
key={item.id}
|
|
470
|
+
size="small"
|
|
471
|
+
type="dashed"
|
|
472
|
+
onClick={() => doRAction(item.id, record.code)}
|
|
473
|
+
>
|
|
474
|
+
{item.icon ?
|
|
475
|
+
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
476
|
+
<Icon type={item.icon} />
|
|
477
|
+
</Tooltip>
|
|
478
|
+
: translate("${" + item.title + "}")}
|
|
479
|
+
</Button>;
|
|
480
|
+
} else {
|
|
481
|
+
return undefined;
|
|
482
|
+
}
|
|
483
|
+
case "customButton": // 自由按钮
|
|
484
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
485
|
+
return <Button
|
|
486
|
+
key={item.id}
|
|
487
|
+
size="small"
|
|
488
|
+
type={item.buttonType || "dashed"}
|
|
489
|
+
onClick={() => doCustomButton(item as unknown as CustomButton, [record])}
|
|
490
|
+
>
|
|
491
|
+
{item.icon ?
|
|
492
|
+
<Tooltip placement="top" title={translate("${" + item.title + "}")}>
|
|
493
|
+
<Icon type={item.icon} />
|
|
494
|
+
</Tooltip>
|
|
495
|
+
: translate("${" + item.title + "}")}
|
|
496
|
+
</Button>
|
|
497
|
+
} else {
|
|
498
|
+
return undefined;
|
|
499
|
+
};
|
|
500
|
+
case "fileExport": // 文件导出
|
|
501
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
502
|
+
return <SelectCodeExport
|
|
503
|
+
serverKey={serverKey}
|
|
504
|
+
hiddenType="disabled"
|
|
505
|
+
codes={[record.code]}
|
|
506
|
+
key={item.id}
|
|
507
|
+
fileExport={item}
|
|
508
|
+
disabled={false}
|
|
509
|
+
/>;
|
|
510
|
+
} else {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
513
|
+
case "customExport": // 自定义导出
|
|
514
|
+
return undefined;
|
|
515
|
+
case "cQuery": // 关联查询
|
|
516
|
+
if (ActionUtils.isShow(item.preposes, [record], undefined)) {
|
|
517
|
+
const config: CQueryConfig = item;
|
|
518
|
+
return <CquickButton
|
|
519
|
+
serverKey={serverKey}
|
|
520
|
+
key={config.id}
|
|
521
|
+
size={"small"}
|
|
522
|
+
pageType={"drawer"}
|
|
523
|
+
cQueryConfig={config}
|
|
524
|
+
mainCode={config.mainCodeColId ? record[config.mainCodeColId] : record.code}
|
|
525
|
+
/>;
|
|
526
|
+
} else {
|
|
527
|
+
return undefined;
|
|
528
|
+
}
|
|
529
|
+
default:
|
|
530
|
+
return undefined;
|
|
531
|
+
}
|
|
532
|
+
}).filter(Boolean);
|
|
533
|
+
return actionButtons?.length ? <div className="column-action"><Space wrap size={4}>{actionButtons}</Space></div> : undefined;
|
|
534
|
+
},
|
|
535
|
+
renderAction(props: ActionRenderProps, record: DtmplData) { // 操作列按钮渲染
|
|
536
|
+
const { ltmplConfig, showView,
|
|
537
|
+
doEdit,
|
|
538
|
+
doRAction,
|
|
539
|
+
customEditable,
|
|
540
|
+
serverKey,
|
|
541
|
+
readOnly,
|
|
542
|
+
sourceId, translate, doCustomButton, doRowJump, blockMenuTreeDrawerOpen,
|
|
543
|
+
doRowAction, doDeleteByCode, editRowEdit, editings, cancelRowEdit, saveRowData, doDelModalOpen,
|
|
544
|
+
doView2D, doEdit2D
|
|
545
|
+
} = props;
|
|
546
|
+
const { buttons, builtInButtons, defShowRowActionCount, strongDeleteConfirmText, edit2DBtnTitle, view2DBtnTitle, deleteBtnTitle } = ltmplConfig;
|
|
547
|
+
|
|
548
|
+
let actionButtons: any[] = [];
|
|
549
|
+
|
|
550
|
+
const isShowDetail = buttons.includes("detail") && showView && ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
551
|
+
const isShowCustomDetail = buttons.includes("customDetail") && showView && ActionUtils.isShow(ltmplConfig.buttonViewAction?.preposes, [record], undefined);
|
|
552
|
+
|
|
553
|
+
if (isShowCustomDetail) { // 自定义详情
|
|
554
|
+
actionButtons.push(<Button
|
|
555
|
+
size="small"
|
|
556
|
+
type="primary"
|
|
557
|
+
icon={<AlignLeftOutlined />}
|
|
558
|
+
onClick={() => showView({ code: record.code, toCustomPage: true, })}
|
|
559
|
+
/>)
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (isShowDetail) { // 默认详情
|
|
563
|
+
actionButtons.push(<ViewButton
|
|
564
|
+
showView={showView}
|
|
565
|
+
data={record}
|
|
566
|
+
ltmplConfig={ltmplConfig}
|
|
567
|
+
buttonType={isShowCustomDetail ? "default" : "primary"} />);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (buttons.includes("dtmplEdit") && doEdit && !readOnly) {
|
|
571
|
+
(
|
|
572
|
+
actionButtons.push(<EditButton
|
|
573
|
+
doEdit={doEdit}
|
|
574
|
+
data={record}
|
|
575
|
+
ltmplConfig={ltmplConfig}
|
|
576
|
+
></EditButton>)
|
|
577
|
+
)
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
// 2D图编辑
|
|
581
|
+
if (buttons.includes("edit2D") && doEdit2D && !readOnly) {
|
|
582
|
+
actionButtons.push((!edit2DBtnTitle || edit2DBtnTitle?.length < 4) ? <Button size="small" onClick={() => doEdit2D(record.code)}>{edit2DBtnTitle || <SettingOutlined />}</Button> :
|
|
583
|
+
<Tooltip title={edit2DBtnTitle}><Button size="small" onClick={() => doEdit2D(record.code)} icon={<SettingOutlined />} /></Tooltip>)
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// 2D图查看
|
|
587
|
+
if (buttons.includes("view2D") && doView2D && !readOnly) {
|
|
588
|
+
actionButtons.push((!view2DBtnTitle || view2DBtnTitle?.length < 4) ? <Button size="small" onClick={() => doView2D(record.code)}>{ltmplConfig.view2DBtnTitle || <PlaySquareOutlined />}</Button> :
|
|
589
|
+
<Tooltip title={edit2DBtnTitle}><Button size="small" onClick={() => doView2D(record.code)} icon={<PlaySquareOutlined />} /></Tooltip>)
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// 行内编辑
|
|
593
|
+
if (buttons.includes("rowEdit") && !buttons.includes("multiRowEdit")) {
|
|
594
|
+
actionButtons.push(<InlineEditButton
|
|
595
|
+
editings={editings}
|
|
596
|
+
editRowEdit={editRowEdit}
|
|
597
|
+
cancelRowEdit={cancelRowEdit}
|
|
598
|
+
saveRowData={saveRowData}
|
|
599
|
+
data={record}
|
|
600
|
+
/>);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
if (builtInButtons?.includes("blockAuthMenuTree") && !readOnly) {
|
|
604
|
+
actionButtons.push(<Button
|
|
605
|
+
size="small"
|
|
606
|
+
type="dashed"
|
|
607
|
+
icon={
|
|
608
|
+
<KeyOutlined
|
|
609
|
+
rotate={180}
|
|
610
|
+
style={{ color: "#f5222d", marginRight: "4px" }}
|
|
611
|
+
/>
|
|
612
|
+
}
|
|
613
|
+
onClick={() => blockMenuTreeDrawerOpen(record)
|
|
614
|
+
}
|
|
615
|
+
></Button>)
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if ((buttons.includes("dtmplCustomEdit") || customEditable) &&
|
|
619
|
+
doEdit &&
|
|
620
|
+
!readOnly &&
|
|
621
|
+
ActionUtils.isShow(
|
|
622
|
+
ltmplConfig.buttonEditAction?.preposes,
|
|
623
|
+
[record],
|
|
624
|
+
undefined
|
|
625
|
+
)) {
|
|
626
|
+
actionButtons.push(<Button
|
|
627
|
+
size="small"
|
|
628
|
+
type="dashed"
|
|
629
|
+
icon={<FormOutlined />}
|
|
630
|
+
onClick={() =>
|
|
631
|
+
doEdit({
|
|
632
|
+
code: record.code,
|
|
633
|
+
mode: "update",
|
|
634
|
+
toCustomPage: true,
|
|
635
|
+
})
|
|
636
|
+
}
|
|
637
|
+
></Button>)
|
|
638
|
+
}
|
|
639
|
+
if (buttons.includes("copy") && doEdit && !readOnly) {
|
|
640
|
+
actionButtons.push(<Tooltip title={translate("${复制}")}>
|
|
641
|
+
<Button
|
|
642
|
+
size="small"
|
|
643
|
+
type="dashed"
|
|
644
|
+
icon={<CopyOutlined />}
|
|
645
|
+
onClick={async () => {
|
|
646
|
+
//先复制
|
|
647
|
+
let toCustomPage = false;
|
|
648
|
+
if (buttons.includes("dtmplCustomEdit") || customEditable) {
|
|
649
|
+
toCustomPage = true;
|
|
650
|
+
}
|
|
651
|
+
let code = await HcserviceV3.doCopy(
|
|
652
|
+
serverKey,
|
|
653
|
+
sourceId,
|
|
654
|
+
record.code
|
|
655
|
+
);
|
|
656
|
+
if (code) {
|
|
657
|
+
doEdit({ code, mode: "update", toCustomPage });
|
|
658
|
+
}
|
|
659
|
+
}}
|
|
660
|
+
></Button>
|
|
661
|
+
</Tooltip>)
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (ltmplConfig.rowCustomButtons) {
|
|
665
|
+
ltmplConfig.rowCustomButtons.map((customButton) => {
|
|
666
|
+
if (ActionUtils.isShow(
|
|
667
|
+
customButton.preposes,
|
|
668
|
+
[record],
|
|
669
|
+
undefined
|
|
670
|
+
)) {
|
|
671
|
+
actionButtons.push(
|
|
672
|
+
<Button
|
|
673
|
+
key={customButton.id}
|
|
674
|
+
size="small"
|
|
675
|
+
type={
|
|
676
|
+
customButton.buttonType
|
|
677
|
+
? customButton.buttonType
|
|
678
|
+
: "dashed"
|
|
679
|
+
}
|
|
680
|
+
onClick={() =>
|
|
681
|
+
doCustomButton(customButton, [record])
|
|
682
|
+
}
|
|
683
|
+
>
|
|
684
|
+
{customButton.icon ?
|
|
685
|
+
<Tooltip placement="top" title={translate("${" + customButton.title + "}")}>
|
|
686
|
+
<Icon type={customButton.icon}></Icon>
|
|
687
|
+
</Tooltip>
|
|
688
|
+
: translate("${" + customButton.title + "}")}
|
|
689
|
+
</Button>
|
|
690
|
+
)
|
|
691
|
+
};
|
|
692
|
+
})
|
|
693
|
+
}
|
|
694
|
+
if (ltmplConfig.ractions && !readOnly) {
|
|
695
|
+
ltmplConfig.ractions.map((raction) => {
|
|
696
|
+
if (ActionUtils.isShow(
|
|
697
|
+
raction?.preposes,
|
|
698
|
+
[record],
|
|
699
|
+
undefined
|
|
700
|
+
)) {
|
|
701
|
+
actionButtons.push(
|
|
702
|
+
<Button
|
|
703
|
+
key={raction.id}
|
|
704
|
+
size="small"
|
|
705
|
+
type="dashed"
|
|
706
|
+
onClick={() => doRAction(raction.id, record.code)}
|
|
707
|
+
>
|
|
708
|
+
{raction.icon ?
|
|
709
|
+
<Tooltip placement="top" title={translate("${" + raction.title + "}")}>
|
|
710
|
+
<Icon type={raction.icon}></Icon>
|
|
711
|
+
</Tooltip>
|
|
712
|
+
: translate("${" + raction.title + "}")}
|
|
713
|
+
</Button>
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
})
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
if (ltmplConfig.rowActions &&
|
|
720
|
+
!readOnly &&
|
|
721
|
+
ltmplConfig.rowActions.length > 0) {
|
|
722
|
+
ltmplConfig.rowActions.map((action) => {
|
|
723
|
+
actionButtons.push(
|
|
724
|
+
<Action
|
|
725
|
+
serverKey={serverKey}
|
|
726
|
+
iconType={"icon"}
|
|
727
|
+
key={action.id}
|
|
728
|
+
data={[record]}
|
|
729
|
+
actionConfig={action}
|
|
730
|
+
doAction={doRowAction}
|
|
731
|
+
buttonSize={"small"}
|
|
732
|
+
serial={1}
|
|
733
|
+
></Action>
|
|
734
|
+
);
|
|
735
|
+
})
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (ltmplConfig.rowJumps &&
|
|
739
|
+
ltmplConfig.rowJumps.length > 0 &&
|
|
740
|
+
!readOnly) {
|
|
741
|
+
ltmplConfig.rowJumps.map((jump) => {
|
|
742
|
+
if (ActionUtils.isShow(
|
|
743
|
+
jump.preposes,
|
|
744
|
+
[record],
|
|
745
|
+
undefined
|
|
746
|
+
)) {
|
|
747
|
+
actionButtons.push(
|
|
748
|
+
<Button
|
|
749
|
+
key={jump.id}
|
|
750
|
+
size="small"
|
|
751
|
+
type="dashed"
|
|
752
|
+
onClick={() => doRowJump(jump, record)}
|
|
753
|
+
>
|
|
754
|
+
{jump.icon ?
|
|
755
|
+
<Tooltip placement="top" title={translate("${" + jump.title + "}")}>
|
|
756
|
+
<Icon type={jump.icon}></Icon>
|
|
757
|
+
</Tooltip>
|
|
758
|
+
: translate("${" + jump.title + "}")}
|
|
759
|
+
</Button>
|
|
760
|
+
)
|
|
761
|
+
};
|
|
762
|
+
})
|
|
763
|
+
}
|
|
764
|
+
if (ltmplConfig.rowCQuerys &&
|
|
765
|
+
ltmplConfig.rowCQuerys.length > 0 &&
|
|
766
|
+
!readOnly
|
|
767
|
+
) {
|
|
768
|
+
ltmplConfig.rowCQuerys.map((cquery) => {
|
|
769
|
+
if (ActionUtils.isShow(
|
|
770
|
+
cquery.preposes,
|
|
771
|
+
[record],
|
|
772
|
+
undefined
|
|
773
|
+
)) {
|
|
774
|
+
actionButtons.push(
|
|
775
|
+
<CquickButton
|
|
776
|
+
serverKey={serverKey}
|
|
777
|
+
key={cquery.id}
|
|
778
|
+
size={"small"}
|
|
779
|
+
pageType={"drawer"}
|
|
780
|
+
cQueryConfig={cquery}
|
|
781
|
+
mainCode={
|
|
782
|
+
cquery.mainCodeColId
|
|
783
|
+
? record[cquery.mainCodeColId]
|
|
784
|
+
: record.code
|
|
785
|
+
}
|
|
786
|
+
/>
|
|
787
|
+
)
|
|
788
|
+
};
|
|
789
|
+
})
|
|
790
|
+
}
|
|
791
|
+
if (ltmplConfig.rowFileButtons &&
|
|
792
|
+
ltmplConfig.rowFileButtons.length > 0) {
|
|
793
|
+
ltmplConfig.rowFileButtons.map((openFileButton) => {
|
|
794
|
+
let v = record[openFileButton.fieldId];
|
|
795
|
+
if (v) {
|
|
796
|
+
if (v instanceof Array) {
|
|
797
|
+
v = v[0];
|
|
798
|
+
}
|
|
799
|
+
if (v.includes("@R@") > 0) {
|
|
800
|
+
v = v.split("@R@")[1];
|
|
801
|
+
}
|
|
802
|
+
actionButtons.push(
|
|
803
|
+
<NewinFileView
|
|
804
|
+
title={openFileButton.title}
|
|
805
|
+
filePath={HcserviceV3.toFilePath(v, serverKey)}
|
|
806
|
+
serverKey={serverKey}
|
|
807
|
+
key={openFileButton.id}
|
|
808
|
+
//size={"small"}
|
|
809
|
+
/>
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
})
|
|
813
|
+
}
|
|
814
|
+
if (buttons.includes("singleDelete") &&
|
|
815
|
+
!readOnly &&
|
|
816
|
+
ActionUtils.isShow(
|
|
817
|
+
ltmplConfig.buttonDeleteAction?.preposes,
|
|
818
|
+
[record],
|
|
819
|
+
undefined
|
|
820
|
+
)) {
|
|
821
|
+
actionButtons.push(
|
|
822
|
+
strongDeleteConfirmText ?
|
|
823
|
+
((!deleteBtnTitle || deleteBtnTitle?.length < 4) ?
|
|
824
|
+
<Button size="small" type="dashed" danger onClick={() => doDelModalOpen(record)}>
|
|
825
|
+
{deleteBtnTitle || <DeleteOutlined />}
|
|
826
|
+
</Button> : <Tooltip title={deleteBtnTitle}>
|
|
827
|
+
<Button size="small" type="dashed" danger onClick={() => doDelModalOpen(record)} icon={<DeleteOutlined />} />
|
|
828
|
+
</Tooltip>)
|
|
829
|
+
:
|
|
830
|
+
<Popconfirm
|
|
831
|
+
placement="rightBottom"
|
|
832
|
+
title={translate("${确定要[删除]此数据吗}?")}
|
|
833
|
+
onConfirm={() => doDeleteByCode(record)}
|
|
834
|
+
okText={translate("${确定}")}
|
|
835
|
+
cancelText={translate("${取消}")}
|
|
836
|
+
okType={"danger"}
|
|
837
|
+
>
|
|
838
|
+
{(!deleteBtnTitle || deleteBtnTitle?.length < 4) ?
|
|
839
|
+
<Button size="small" type="dashed" danger >{deleteBtnTitle || <DeleteOutlined />}</Button> :
|
|
840
|
+
<Tooltip title={deleteBtnTitle}><Button size="small" type="dashed" danger icon={<DeleteOutlined />} /></Tooltip>}
|
|
841
|
+
</Popconfirm>
|
|
842
|
+
)
|
|
843
|
+
}
|
|
844
|
+
let showButtons = [];
|
|
845
|
+
if (defShowRowActionCount <= 0 || defShowRowActionCount >= actionButtons.length) {
|
|
846
|
+
showButtons = actionButtons
|
|
847
|
+
} else {
|
|
848
|
+
showButtons = actionButtons.slice(0, defShowRowActionCount)
|
|
849
|
+
showButtons.push(
|
|
850
|
+
<Popover content={<Space wrap>
|
|
851
|
+
{actionButtons.slice(defShowRowActionCount, actionButtons.length)}
|
|
852
|
+
</Space>} title={"更多操作"} trigger="hover">
|
|
853
|
+
<Button size={"small"} icon={<EllipsisOutlined />} shape="circle" ></Button>
|
|
854
|
+
</Popover>
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
return <Space size={[0, 4]} wrap>
|
|
858
|
+
{showButtons}
|
|
859
|
+
</Space>
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
}
|
|
863
|
+
const DragHandle = SortableHandle(() => (
|
|
864
|
+
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
865
865
|
))
|