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,1093 +1,1093 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
Col,
|
|
5
|
-
Form as AntdForm,
|
|
6
|
-
Popover,
|
|
7
|
-
Row,
|
|
8
|
-
Space,
|
|
9
|
-
Tooltip,
|
|
10
|
-
Typography, Popconfirm, FormInstance,
|
|
11
|
-
message
|
|
12
|
-
} from "antd";
|
|
13
|
-
import Table from "./control-table-x-axis-wrapper";
|
|
14
|
-
import {
|
|
15
|
-
AlignLeftOutlined, CheckOutlined, CloseCircleOutlined,
|
|
16
|
-
DeleteOutlined,
|
|
17
|
-
EditOutlined,
|
|
18
|
-
FormOutlined,
|
|
19
|
-
PlusSquareOutlined, QuestionCircleOutlined,
|
|
20
|
-
SnippetsOutlined,
|
|
21
|
-
} from "@ant-design/icons";
|
|
22
|
-
import "./index.css";
|
|
23
|
-
import {
|
|
24
|
-
ClassAddConfig,
|
|
25
|
-
DtmplData, FieldConfig,
|
|
26
|
-
FieldGroupConfig,
|
|
27
|
-
SelectedRow,
|
|
28
|
-
ViewOrEdit,
|
|
29
|
-
} from "../tmpl/interface";
|
|
30
|
-
import SupportInputTypes from "../tmpl/control-type-supportor";
|
|
31
|
-
import TableUnits from "./table-util";
|
|
32
|
-
import ViewControl from "../controls/view-control";
|
|
33
|
-
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
34
|
-
import DtmplEditPage from "../module/dtmpl-edit-page";
|
|
35
|
-
import ModelSelectTable from "./modal-select-table";
|
|
36
|
-
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
37
|
-
import CollapseCard from "../controls/collapse-card";
|
|
38
|
-
import PopoverEditor from "../detail/edit/popover-editor";
|
|
39
|
-
import Action from "../controls/action";
|
|
40
|
-
import CountingTag from "../controls/counting-tag";
|
|
41
|
-
import { LocaleContext } from "../locale/LocaleProvider";
|
|
42
|
-
import VerticalList from "../list/vertical-list";
|
|
43
|
-
import { EntryControl } from "../index";
|
|
44
|
-
import TmplConfigAnalysis from "../tmpl/tmpl-config-analysis";
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const FormItem = AntdForm.Item;
|
|
48
|
-
const { Text } = Typography;
|
|
49
|
-
|
|
50
|
-
interface RelationTableProps {
|
|
51
|
-
showRightNav?: boolean;
|
|
52
|
-
mainCode?: string;
|
|
53
|
-
serverKey?: string;
|
|
54
|
-
parentId: string;
|
|
55
|
-
loading: boolean;
|
|
56
|
-
viewOrEdit: ViewOrEdit;
|
|
57
|
-
refreshId?: string;
|
|
58
|
-
fieldGroupConfig: FieldGroupConfig;
|
|
59
|
-
value: DtmplData[];
|
|
60
|
-
parentFormInstance?: FormInstance;
|
|
61
|
-
onChange?: (fieldGroupConfig: FieldGroupConfig, value: DtmplData[]) => void;
|
|
62
|
-
onEditing?: (editing: boolean) => void;
|
|
63
|
-
initCollapse?: boolean;
|
|
64
|
-
showCollapseCard?: boolean; // 是否显示折叠卡片,默认显示
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface RelationTableStat {
|
|
68
|
-
selectedCode?: string;
|
|
69
|
-
showDtmplView?: boolean;
|
|
70
|
-
showDtmplEdit?: boolean;
|
|
71
|
-
showSelectTable?: boolean;
|
|
72
|
-
tableLoading?: boolean;
|
|
73
|
-
showRowEdit?: boolean;
|
|
74
|
-
selectedDtmplData?: DtmplData;
|
|
75
|
-
filterStr?: string;
|
|
76
|
-
pageSize?: number;
|
|
77
|
-
addTmplId?: string;
|
|
78
|
-
editings?: string[];
|
|
79
|
-
uploadingFiles?: object[];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
class RelationTable extends React.PureComponent<
|
|
83
|
-
RelationTableProps,
|
|
84
|
-
RelationTableStat
|
|
85
|
-
> {
|
|
86
|
-
state = {
|
|
87
|
-
showDtmplView: false,
|
|
88
|
-
selectedCode: undefined,
|
|
89
|
-
showSelectTable: false,
|
|
90
|
-
showDtmplEdit: false,
|
|
91
|
-
tableLoading: false,
|
|
92
|
-
showRowEdit: false,
|
|
93
|
-
selectedDtmplData: undefined,
|
|
94
|
-
filterStr: undefined,
|
|
95
|
-
pageSize: 10,
|
|
96
|
-
addTmplId: undefined,
|
|
97
|
-
editings: [],
|
|
98
|
-
uploadingFiles: [],
|
|
99
|
-
};
|
|
100
|
-
static contextType = LocaleContext;
|
|
101
|
-
context: React.ContextType<typeof LocaleContext>;
|
|
102
|
-
static defaultProps = {
|
|
103
|
-
showCollapseCard: true,
|
|
104
|
-
};
|
|
105
|
-
formRef = React.createRef<FormInstance>();
|
|
106
|
-
|
|
107
|
-
async componentDidMount() {
|
|
108
|
-
// const {fieldGroupConfig} = this.props;
|
|
109
|
-
// if (fieldGroupConfig.displayConfig.includes('folded')) {
|
|
110
|
-
// this.setState({
|
|
111
|
-
// collapse: true,
|
|
112
|
-
// })
|
|
113
|
-
// }
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async componentDidUpdate(prevProps) {
|
|
117
|
-
const { fieldGroupConfig } = this.props;
|
|
118
|
-
const { fieldGroupConfig: preFieldGroupConfig } = prevProps;
|
|
119
|
-
if (
|
|
120
|
-
fieldGroupConfig.disabled != preFieldGroupConfig.disabled ||
|
|
121
|
-
fieldGroupConfig.mainCode != preFieldGroupConfig.mainCode
|
|
122
|
-
) {
|
|
123
|
-
this.setState({ filterStr: "" });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
buildDataSource = () => {
|
|
128
|
-
const { filterStr } = this.state;
|
|
129
|
-
const { value } = this.props;
|
|
130
|
-
let dataSource = undefined;
|
|
131
|
-
|
|
132
|
-
/** 构建 dataSource **/
|
|
133
|
-
if (value) {
|
|
134
|
-
dataSource = [];
|
|
135
|
-
value.forEach((item, index) => {
|
|
136
|
-
let flag = true;
|
|
137
|
-
if (filterStr) {
|
|
138
|
-
flag = false;
|
|
139
|
-
for (let value of Object.values(item.fieldMap)) {
|
|
140
|
-
if (value && value.toString().indexOf(filterStr) >= 0) {
|
|
141
|
-
flag = true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
if (flag) {
|
|
146
|
-
let row = {
|
|
147
|
-
key: item.code,
|
|
148
|
-
editStatus: item.editStatus,
|
|
149
|
-
relationLabel: item.relationLabel,
|
|
150
|
-
code: item.code, //增加code,为了删除操作
|
|
151
|
-
...item.fieldMap,
|
|
152
|
-
};
|
|
153
|
-
dataSource.push(row);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return dataSource;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
isDisabled = (record: DtmplData, item: FieldConfig) => {
|
|
162
|
-
if (!item.rowEditType) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
let isNew: boolean = record.editStatus && record.editStatus == "new";
|
|
166
|
-
let type = item.rowEditType;
|
|
167
|
-
if (type == "editable") {
|
|
168
|
-
return false;
|
|
169
|
-
} else if (type == "readonly") {
|
|
170
|
-
return true;
|
|
171
|
-
} else if (type == "editonly" && !isNew) {
|
|
172
|
-
return false;
|
|
173
|
-
} else if (type == "addonly" && isNew) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
buildColumns = () => {
|
|
180
|
-
const { viewOrEdit, fieldGroupConfig, serverKey, parentFormInstance } = this.props;
|
|
181
|
-
const {
|
|
182
|
-
buttons,
|
|
183
|
-
fields,
|
|
184
|
-
showRelationName,
|
|
185
|
-
relationNames,
|
|
186
|
-
disabled,
|
|
187
|
-
deleteData, addOrEditType
|
|
188
|
-
} = fieldGroupConfig;
|
|
189
|
-
const { translate } = this.context;
|
|
190
|
-
const { editings } = this.state;
|
|
191
|
-
let columns = [];
|
|
192
|
-
/** 构建column **/
|
|
193
|
-
let s = 0;
|
|
194
|
-
fields.forEach((item) => {
|
|
195
|
-
let column = {};
|
|
196
|
-
columns.push(column);
|
|
197
|
-
let title1 = translate("${" + item.title + "}");
|
|
198
|
-
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
199
|
-
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
200
|
-
column["dataIndex"] = item.id;
|
|
201
|
-
if (item.colWidth) column["width"] = item.colWidth;
|
|
202
|
-
s++;
|
|
203
|
-
let itemType = SupportInputTypes.getControlType(item, null);
|
|
204
|
-
if (s < 12 && item.sortable) {
|
|
205
|
-
TableUnits.sort(column, itemType);
|
|
206
|
-
}
|
|
207
|
-
//配置字段的 默认次过滤条件
|
|
208
|
-
if (item.relValueField) {
|
|
209
|
-
if (!item.baseCriteria) {
|
|
210
|
-
item.baseCriteria = {}
|
|
211
|
-
}
|
|
212
|
-
item.baseCriteria = {
|
|
213
|
-
...item.baseCriteria,
|
|
214
|
-
"secondCriterion": parentFormInstance.getFieldValue(item.relValueField.id)
|
|
215
|
-
};
|
|
216
|
-
item.configChanged = true;
|
|
217
|
-
}
|
|
218
|
-
column["render"] = (text, record) => {
|
|
219
|
-
return (editings.indexOf(record.code) >= 0 ?
|
|
220
|
-
<FormItem style={{ margin: 0 }}
|
|
221
|
-
name={record.code + "_" + item.id}
|
|
222
|
-
key={record.code + "_" + item.id}
|
|
223
|
-
rules={TmplConfigAnalysis.getRules(item, translate)}
|
|
224
|
-
initialValue={record[item.id]}>
|
|
225
|
-
<EntryControl
|
|
226
|
-
serverKey={serverKey}
|
|
227
|
-
fieldConfig={{ ...item, disabled: this.isDisabled(record, item) }}
|
|
228
|
-
value={record[item.id]}
|
|
229
|
-
/></FormItem> :
|
|
230
|
-
<ViewControl
|
|
231
|
-
serverKey={serverKey}
|
|
232
|
-
holderType={"table"}
|
|
233
|
-
fieldConfig={item}
|
|
234
|
-
value={record[item.id]}
|
|
235
|
-
/>
|
|
236
|
-
);
|
|
237
|
-
};
|
|
238
|
-
});
|
|
239
|
-
if (showRelationName) {
|
|
240
|
-
//判断是否有关系属性
|
|
241
|
-
let rela = {
|
|
242
|
-
dataIndex: "relationLabel",
|
|
243
|
-
name: "relation",
|
|
244
|
-
title: translate("${关系}"),
|
|
245
|
-
type: "relation",
|
|
246
|
-
editable: true,
|
|
247
|
-
fieldAvailable: true,
|
|
248
|
-
id: "10000", //关系默认id是'10000'
|
|
249
|
-
options: relationNames,
|
|
250
|
-
};
|
|
251
|
-
columns.unshift(rela);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
//添加操作列
|
|
255
|
-
|
|
256
|
-
const viewable = buttons.includes("detail");
|
|
257
|
-
const rowEdit = buttons.includes("rowEdit");
|
|
258
|
-
const dtmplEdit = buttons.includes("dtmplEdit");
|
|
259
|
-
const deletable = buttons.includes("singleDelete");
|
|
260
|
-
if (
|
|
261
|
-
viewOrEdit == "edit" &&
|
|
262
|
-
(viewable || rowEdit || dtmplEdit || deletable)
|
|
263
|
-
) {
|
|
264
|
-
const actionColumn = {};
|
|
265
|
-
columns.push(actionColumn);
|
|
266
|
-
actionColumn["操作"] = 1;
|
|
267
|
-
actionColumn["title"] = translate("${操作}");
|
|
268
|
-
actionColumn["fixed"] = "right";
|
|
269
|
-
actionColumn["key"] = "action";
|
|
270
|
-
actionColumn["render"] = (record) => {
|
|
271
|
-
return (
|
|
272
|
-
<div className="actionbtn">
|
|
273
|
-
{/*详情*/}
|
|
274
|
-
{viewable ? (
|
|
275
|
-
<Button
|
|
276
|
-
disabled={disabled}
|
|
277
|
-
title={translate("${当前实体}")}
|
|
278
|
-
type="primary"
|
|
279
|
-
icon={<AlignLeftOutlined />}
|
|
280
|
-
size="small"
|
|
281
|
-
onClick={() => this.showEntityView(record)}
|
|
282
|
-
></Button>
|
|
283
|
-
) : (
|
|
284
|
-
""
|
|
285
|
-
)}
|
|
286
|
-
{/*模板编辑*/}
|
|
287
|
-
{dtmplEdit ? (
|
|
288
|
-
<Button
|
|
289
|
-
disabled={disabled}
|
|
290
|
-
title={translate("${编辑}${当前实体}")}
|
|
291
|
-
icon={<FormOutlined />}
|
|
292
|
-
size="small"
|
|
293
|
-
onClick={() => this.showEditDtmplModel(record)}
|
|
294
|
-
></Button>
|
|
295
|
-
) : (
|
|
296
|
-
""
|
|
297
|
-
)}
|
|
298
|
-
{fieldGroupConfig.rowActions &&
|
|
299
|
-
fieldGroupConfig.rowActions.length > 0
|
|
300
|
-
? fieldGroupConfig.rowActions.map((action) => {
|
|
301
|
-
return (
|
|
302
|
-
<Action
|
|
303
|
-
serverKey={serverKey}
|
|
304
|
-
disabled={disabled}
|
|
305
|
-
key={action.id}
|
|
306
|
-
data={[record]}
|
|
307
|
-
actionConfig={action}
|
|
308
|
-
doAction={this.doRowAction}
|
|
309
|
-
buttonSize={"small"}
|
|
310
|
-
></Action>
|
|
311
|
-
);
|
|
312
|
-
})
|
|
313
|
-
: ""}
|
|
314
|
-
{/*行编辑*/}
|
|
315
|
-
{rowEdit && editings.indexOf(record.code) < 0 ? (
|
|
316
|
-
addOrEditType !== "tableRow" ?
|
|
317
|
-
<PopoverEditor
|
|
318
|
-
serverKey={serverKey}
|
|
319
|
-
disabled={disabled}
|
|
320
|
-
buttonIcon={<EditOutlined />}
|
|
321
|
-
dtmplData={this.getRowEditData(record.code)}
|
|
322
|
-
fieldGroupConfig={fieldGroupConfig}
|
|
323
|
-
onOk={this.handleColData}
|
|
324
|
-
tooltipTitle={translate("${编辑当前行}")}
|
|
325
|
-
></PopoverEditor> : <Button icon={<EditOutlined />} size={'small'}
|
|
326
|
-
onClick={() => this.editRowEdit(record.code)}>
|
|
327
|
-
</Button>
|
|
328
|
-
) : ""
|
|
329
|
-
}
|
|
330
|
-
{editings.indexOf(record.code) >= 0 ?
|
|
331
|
-
<><Tooltip placement="topRight" title={translate("${确定修改}")}>
|
|
332
|
-
<Button onClick={() => this.saveRowData(record)}
|
|
333
|
-
icon={<CheckOutlined />} size={'small'}></Button></Tooltip>
|
|
334
|
-
{record.editStatus !== "new" &&
|
|
335
|
-
<Tooltip placement="topRight" title={translate("${取消修改}")}>
|
|
336
|
-
<Button onClick={() => this.cancelRowEdit(record.code)}
|
|
337
|
-
icon={<CloseCircleOutlined />} size={'small'}></Button>
|
|
338
|
-
</Tooltip>}
|
|
339
|
-
</> : ""}
|
|
340
|
-
{/*删除*/}
|
|
341
|
-
{deletable ?
|
|
342
|
-
deleteData ? <Popconfirm
|
|
343
|
-
placement="leftBottom"
|
|
344
|
-
title={translate("${确定要[删除]选中数据吗}?")}
|
|
345
|
-
onConfirm={() => {
|
|
346
|
-
this.delete(record);
|
|
347
|
-
}}
|
|
348
|
-
okText={translate("${确定}")}
|
|
349
|
-
cancelText={translate("${取消}")}
|
|
350
|
-
okType={"danger"}
|
|
351
|
-
> <Button
|
|
352
|
-
disabled={disabled}
|
|
353
|
-
danger
|
|
354
|
-
type="primary"
|
|
355
|
-
icon={<DeleteOutlined />}
|
|
356
|
-
size="small"></Button>
|
|
357
|
-
</Popconfirm> :
|
|
358
|
-
<Tooltip placement="right" title={translate("${删除}${当前行}")}>
|
|
359
|
-
<Button
|
|
360
|
-
disabled={disabled}
|
|
361
|
-
danger
|
|
362
|
-
type="primary"
|
|
363
|
-
icon={<DeleteOutlined />}
|
|
364
|
-
size="small"
|
|
365
|
-
onClick={() => this.delete(record)}></Button></Tooltip>
|
|
366
|
-
|
|
367
|
-
: (
|
|
368
|
-
""
|
|
369
|
-
)}
|
|
370
|
-
</div>
|
|
371
|
-
);
|
|
372
|
-
};
|
|
373
|
-
} else if (viewOrEdit == "view" && viewable) {
|
|
374
|
-
const actionColumn = {};
|
|
375
|
-
columns.push(actionColumn);
|
|
376
|
-
actionColumn["操作"] = 1;
|
|
377
|
-
actionColumn["title"] = translate("${操作}");
|
|
378
|
-
actionColumn["fixed"] = "right";
|
|
379
|
-
actionColumn["key"] = "action";
|
|
380
|
-
actionColumn["render"] = (record) => {
|
|
381
|
-
return (
|
|
382
|
-
<div className="actionbtn">
|
|
383
|
-
{/*详情*/}
|
|
384
|
-
{viewable ? (
|
|
385
|
-
<Button
|
|
386
|
-
disabled={disabled}
|
|
387
|
-
title={translate("${当前实体}")}
|
|
388
|
-
type="primary"
|
|
389
|
-
icon={<AlignLeftOutlined />}
|
|
390
|
-
size="small"
|
|
391
|
-
onClick={() => this.showEntityView(record)}
|
|
392
|
-
></Button>
|
|
393
|
-
) : (
|
|
394
|
-
""
|
|
395
|
-
)}
|
|
396
|
-
</div>
|
|
397
|
-
);
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
return columns;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
405
|
-
await this.doAction(
|
|
406
|
-
actionId,
|
|
407
|
-
[{ title: undefined, code: codes[0] }],
|
|
408
|
-
params
|
|
409
|
-
);
|
|
410
|
-
this.handleDtmplEdit(codes[0]);
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
414
|
-
this.setState({
|
|
415
|
-
tableLoading: true,
|
|
416
|
-
});
|
|
417
|
-
let { serverKey } = this.props;
|
|
418
|
-
let result: boolean = await HcserviceV3.postActions(
|
|
419
|
-
serverKey,
|
|
420
|
-
actionId,
|
|
421
|
-
selectedRows,
|
|
422
|
-
params
|
|
423
|
-
);
|
|
424
|
-
{
|
|
425
|
-
this.setState({
|
|
426
|
-
tableLoading: false,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
showEntityView = (record) => {
|
|
432
|
-
//console.log('tabel record:', record);
|
|
433
|
-
this.setState({
|
|
434
|
-
selectedCode: record.code,
|
|
435
|
-
showDtmplView: true,
|
|
436
|
-
});
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
hiddenEntityView = () => {
|
|
440
|
-
this.setState({
|
|
441
|
-
showDtmplView: false,
|
|
442
|
-
});
|
|
443
|
-
};
|
|
444
|
-
hiddenEntityEdit = () => {
|
|
445
|
-
this.setState({
|
|
446
|
-
showDtmplEdit: false,
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
delete = async (record) => {
|
|
451
|
-
const { value, fieldGroupConfig, onChange, serverKey } = this.props;
|
|
452
|
-
const { editings } = this.state;
|
|
453
|
-
//追加
|
|
454
|
-
const selectdDatas: DtmplData[] = [];
|
|
455
|
-
const selectdCodes: string[] = [];
|
|
456
|
-
if (value) {
|
|
457
|
-
for (let v of value) {
|
|
458
|
-
if (v.code != record.code) {
|
|
459
|
-
selectdDatas.push(v);
|
|
460
|
-
selectdCodes.push(v.code);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
//直接删除
|
|
465
|
-
if (fieldGroupConfig.deleteData) {
|
|
466
|
-
let result: boolean = await HcserviceV3.deleteByCode(serverKey, fieldGroupConfig.id, [record.code]);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
if (editings && editings.includes(record.code)) {
|
|
470
|
-
this.cancelRowEdit(record.code);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
onChange(fieldGroupConfig, selectdDatas);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
searchValue = (filterStr: string) => {
|
|
477
|
-
this.setState({
|
|
478
|
-
filterStr,
|
|
479
|
-
});
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
tabChange = (pagination) => {
|
|
483
|
-
//console.log('pagination',pagination);
|
|
484
|
-
this.setState({
|
|
485
|
-
pageSize: pagination.pageSize,
|
|
486
|
-
});
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
showSelect = () => {
|
|
490
|
-
//console.log('showSelectTable click');
|
|
491
|
-
this.setState({
|
|
492
|
-
showSelectTable: true,
|
|
493
|
-
});
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
select = async (selectedRows: SelectedRow[]) => {
|
|
497
|
-
this.setState({
|
|
498
|
-
showSelectTable: false,
|
|
499
|
-
});
|
|
500
|
-
if (!selectedRows || selectedRows.length <= 0) {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
//查询
|
|
505
|
-
const codes: string[] = [];
|
|
506
|
-
for (let row of selectedRows) {
|
|
507
|
-
codes.push(row.code);
|
|
508
|
-
}
|
|
509
|
-
await this.add(codes);
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
add = async (codes: string[]) => {
|
|
513
|
-
const { value, fieldGroupConfig, onChange, serverKey } = this.props;
|
|
514
|
-
const { relationNames } = fieldGroupConfig;
|
|
515
|
-
this.setState({
|
|
516
|
-
tableLoading: true,
|
|
517
|
-
});
|
|
518
|
-
let selectdDatas: DtmplData[] = await HcserviceV3.requestSelectedData(
|
|
519
|
-
serverKey,
|
|
520
|
-
fieldGroupConfig.id,
|
|
521
|
-
codes
|
|
522
|
-
);
|
|
523
|
-
|
|
524
|
-
//添加默认关系
|
|
525
|
-
if (selectdDatas) {
|
|
526
|
-
for (let d of selectdDatas) {
|
|
527
|
-
d["relationLabel"] = relationNames[0];
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
//追加
|
|
532
|
-
if (value) {
|
|
533
|
-
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
534
|
-
selectdDatas.push(...value);
|
|
535
|
-
} else {
|
|
536
|
-
selectdDatas.unshift(...value);
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
onChange(fieldGroupConfig, selectdDatas);
|
|
541
|
-
this.setState({
|
|
542
|
-
tableLoading: false,
|
|
543
|
-
});
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
getRowEditData = (code?: string) => {
|
|
547
|
-
const { value } = this.props;
|
|
548
|
-
let data = undefined;
|
|
549
|
-
if (code) {
|
|
550
|
-
for (let dtmplData of value) {
|
|
551
|
-
if (code == dtmplData.code) {
|
|
552
|
-
data = dtmplData;
|
|
553
|
-
break;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
return data;
|
|
558
|
-
};
|
|
559
|
-
handleDtmplAdd = async (code: string, isContinueSave?: boolean) => {
|
|
560
|
-
if (isContinueSave) {
|
|
561
|
-
this.setState({ selectedCode: code });
|
|
562
|
-
} else {
|
|
563
|
-
this.setState({ showDtmplEdit: false });
|
|
564
|
-
}
|
|
565
|
-
await this.add([code]);
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
handleDtmplEdit = async (code: string) => {
|
|
569
|
-
const { value, fieldGroupConfig, onChange } = this.props;
|
|
570
|
-
const {
|
|
571
|
-
serverKey,
|
|
572
|
-
} = fieldGroupConfig;
|
|
573
|
-
this.setState({
|
|
574
|
-
tableLoading: true,
|
|
575
|
-
showDtmplEdit: false,
|
|
576
|
-
});
|
|
577
|
-
let data: DtmplData = (
|
|
578
|
-
await HcserviceV3.requestSelectedData(serverKey, fieldGroupConfig.id, [
|
|
579
|
-
code,
|
|
580
|
-
])
|
|
581
|
-
)[0];
|
|
582
|
-
let datas: DtmplData[] = [...value];
|
|
583
|
-
|
|
584
|
-
if (datas && data) {
|
|
585
|
-
for (let v of datas) {
|
|
586
|
-
if (v.code == data.code) {
|
|
587
|
-
v.fieldMap = data.fieldMap;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
onChange(fieldGroupConfig, datas);
|
|
592
|
-
this.setState({
|
|
593
|
-
tableLoading: false,
|
|
594
|
-
});
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
handleRowEdit = (dtmplData: DtmplData) => {
|
|
598
|
-
const { value, fieldGroupConfig, onChange } = this.props;
|
|
599
|
-
let datas: DtmplData[] = [];
|
|
600
|
-
if (value) {
|
|
601
|
-
datas = [...value];
|
|
602
|
-
}
|
|
603
|
-
let isAdd = true;
|
|
604
|
-
for (let v of datas) {
|
|
605
|
-
if (v.code == dtmplData.code) {
|
|
606
|
-
isAdd = false;
|
|
607
|
-
if (dtmplData.editStatus) {
|
|
608
|
-
v.editStatus = dtmplData.editStatus;
|
|
609
|
-
}
|
|
610
|
-
v.fieldMap = dtmplData.fieldMap;
|
|
611
|
-
if (dtmplData.relationLabel) {
|
|
612
|
-
v.relationLabel = dtmplData.relationLabel;
|
|
613
|
-
}
|
|
614
|
-
break;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
if (isAdd) {
|
|
618
|
-
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
619
|
-
datas.push(dtmplData);
|
|
620
|
-
} else {
|
|
621
|
-
datas.unshift(dtmplData);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
onChange(fieldGroupConfig, datas);
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
showAddDtmplModel = (addTmplId?: string) => {
|
|
628
|
-
this.setState({
|
|
629
|
-
showDtmplEdit: true,
|
|
630
|
-
addTmplId,
|
|
631
|
-
selectedCode: undefined,
|
|
632
|
-
});
|
|
633
|
-
};
|
|
634
|
-
showEditDtmplModel = (record) => {
|
|
635
|
-
this.setState({
|
|
636
|
-
showDtmplEdit: true,
|
|
637
|
-
addTmplId: undefined,
|
|
638
|
-
selectedCode: record.code,
|
|
639
|
-
});
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
getAddTmplButton = (classAddConfigs: ClassAddConfig[]) => {
|
|
643
|
-
const { translate } = this.context;
|
|
644
|
-
|
|
645
|
-
if (classAddConfigs && classAddConfigs.length < 1) {
|
|
646
|
-
return translate("${没有分类添加按钮}");
|
|
647
|
-
}
|
|
648
|
-
return classAddConfigs.map((config) => {
|
|
649
|
-
return (
|
|
650
|
-
<p>
|
|
651
|
-
<Button
|
|
652
|
-
size={"small"}
|
|
653
|
-
type={"text"}
|
|
654
|
-
onClick={() => this.showAddDtmplModel(config.id)}
|
|
655
|
-
>
|
|
656
|
-
{config.title}
|
|
657
|
-
</Button>
|
|
658
|
-
</p>
|
|
659
|
-
);
|
|
660
|
-
});
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
addNewRow = (defaultValue) => {
|
|
664
|
-
const { value, fieldGroupConfig, onChange, onEditing } = this.props;
|
|
665
|
-
const { editings } = this.state;
|
|
666
|
-
let datas: DtmplData[] = [];
|
|
667
|
-
if (value) {
|
|
668
|
-
datas = [...value];
|
|
669
|
-
}
|
|
670
|
-
let fieldMaps = [];
|
|
671
|
-
if (!defaultValue) {
|
|
672
|
-
const defObj = {};
|
|
673
|
-
for (let f of fieldGroupConfig.fields) {
|
|
674
|
-
if (f.defaultValue) {
|
|
675
|
-
defObj[f.id] = f.defaultValue;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
// 添加一行设置默认值
|
|
679
|
-
fieldMaps = [defObj];
|
|
680
|
-
} else if (Array.isArray(defaultValue)) {
|
|
681
|
-
fieldMaps = defaultValue;
|
|
682
|
-
} else {
|
|
683
|
-
fieldMaps = [defaultValue]
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
let editingCodes = [...editings];
|
|
687
|
-
let i = 0;
|
|
688
|
-
for (let f of fieldMaps) {
|
|
689
|
-
|
|
690
|
-
let newData: DtmplData = {};
|
|
691
|
-
newData.editStatus = "new";
|
|
692
|
-
newData.code = Date.now() + "" + i++;
|
|
693
|
-
newData.relationLabel = fieldGroupConfig.relationNames[0]
|
|
694
|
-
newData.fieldMap = f;
|
|
695
|
-
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
696
|
-
datas.push(newData);
|
|
697
|
-
} else {
|
|
698
|
-
datas.unshift(newData);
|
|
699
|
-
}
|
|
700
|
-
editingCodes.push(newData.code);
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
this.setState({ editings: editingCodes })
|
|
704
|
-
onChange(fieldGroupConfig, datas);
|
|
705
|
-
if (onEditing) {
|
|
706
|
-
onEditing(editingCodes.length > 0);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
editRowEdit = (code) => {
|
|
711
|
-
const { editings } = this.state;
|
|
712
|
-
const { onEditing } = this.props;
|
|
713
|
-
let edis = [...editings, code];
|
|
714
|
-
this.setState({ editings: edis });
|
|
715
|
-
if (onEditing) {
|
|
716
|
-
onEditing(edis.length > 0);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
cancelRowEdit = (code: string) => {
|
|
721
|
-
const { onEditing } = this.props
|
|
722
|
-
const { editings } = this.state
|
|
723
|
-
let arr = editings.filter(item => item !== code);
|
|
724
|
-
this.setState({ editings: [...arr] });
|
|
725
|
-
if (onEditing) {
|
|
726
|
-
onEditing(arr.length > 0);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
// 单独提交
|
|
731
|
-
postDtmplData = async (dtmplData, record: DtmplData) => {
|
|
732
|
-
const { fieldGroupConfig, serverKey, onChange, value } = this.props;
|
|
733
|
-
const sourceId = fieldGroupConfig.id;
|
|
734
|
-
const { code, editStatus } = record;
|
|
735
|
-
if (editStatus !== "new") { //editStatus 为new时,是新增实体模版,不传code
|
|
736
|
-
dtmplData["唯一编码"] = code;
|
|
737
|
-
}
|
|
738
|
-
let res = await HcserviceV3.postDtmplData(
|
|
739
|
-
serverKey,
|
|
740
|
-
sourceId,
|
|
741
|
-
dtmplData,
|
|
742
|
-
message
|
|
743
|
-
);
|
|
744
|
-
if (res.status === "success") {
|
|
745
|
-
this.cancelRowEdit(editStatus !== "new" ? res.code : code);
|
|
746
|
-
if (editStatus === "new") {
|
|
747
|
-
onChange(fieldGroupConfig, value.filter(item => item.code !== code)); // 单独提交添加成功后,删除原未保存的数据
|
|
748
|
-
setTimeout(() => this.handleDtmplAdd(res.code), 100);
|
|
749
|
-
} else {
|
|
750
|
-
this.handleDtmplEdit(res.code);
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
saveRowData = async (record: DtmplData) => {
|
|
756
|
-
const { fieldGroupConfig } = this.props;
|
|
757
|
-
const { code } = record;
|
|
758
|
-
let currentForm = this.formRef.current;
|
|
759
|
-
let dtmplData: DtmplData = { code };
|
|
760
|
-
dtmplData.fieldMap = {};
|
|
761
|
-
dtmplData.editStatus = "changed";
|
|
762
|
-
await currentForm.validateFields().then(async (values) => {
|
|
763
|
-
for (let key in values) {
|
|
764
|
-
if (values.hasOwnProperty(key) && key.startsWith(code)) {
|
|
765
|
-
dtmplData.fieldMap[key.split("_")[1]] = values[key];
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
if (fieldGroupConfig.submitType === "separate") {
|
|
769
|
-
// 单独提交
|
|
770
|
-
this.postDtmplData(dtmplData.fieldMap, record);
|
|
771
|
-
} else {
|
|
772
|
-
this.cancelRowEdit(code);
|
|
773
|
-
this.handleRowEdit(dtmplData);
|
|
774
|
-
}
|
|
775
|
-
}).catch(errorInfo => {
|
|
776
|
-
})
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
// 单列、双列表单添加编辑
|
|
780
|
-
handleColData = (record: DtmplData) => {
|
|
781
|
-
const { fieldGroupConfig } = this.props;
|
|
782
|
-
if (fieldGroupConfig.submitType === "separate") {
|
|
783
|
-
// 单独提交
|
|
784
|
-
this.postDtmplData(record.fieldMap, record);
|
|
785
|
-
} else {
|
|
786
|
-
this.handleRowEdit(record);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
uploadFiles = (values) => {
|
|
793
|
-
|
|
794
|
-
const { batchAddFileField } = this.props.fieldGroupConfig
|
|
795
|
-
if (values) {
|
|
796
|
-
|
|
797
|
-
let uploading = false;
|
|
798
|
-
let vals = JSON.parse(values);
|
|
799
|
-
for (let value of vals) {
|
|
800
|
-
if (!value.status || value.status != "done") {
|
|
801
|
-
uploading = true;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
let datas = [];
|
|
805
|
-
if (!uploading) {
|
|
806
|
-
for (let value of vals) {
|
|
807
|
-
let data = {};
|
|
808
|
-
data[batchAddFileField.id] = JSON.stringify(value);
|
|
809
|
-
datas.push(data);
|
|
810
|
-
}
|
|
811
|
-
this.addNewRow(datas);
|
|
812
|
-
this.setState({ uploadingFiles: [] })
|
|
813
|
-
} else {
|
|
814
|
-
this.setState({ uploadingFiles: values })
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
// 处理fieldConfig,添加exceptCodes
|
|
820
|
-
handleFieldConfig = () => {
|
|
821
|
-
const { fieldGroupConfig, value } = this.props;
|
|
822
|
-
const fields = fieldGroupConfig.fields.map(field => {
|
|
823
|
-
if (!field || !value || !field.relDeduplication) {
|
|
824
|
-
return field;
|
|
825
|
-
}
|
|
826
|
-
const exceptCodes = value.map(item => {
|
|
827
|
-
let val = item.fieldMap[field.id];
|
|
828
|
-
if (val?.includes("@R@")) {
|
|
829
|
-
return val.split("@R@")[0];
|
|
830
|
-
}
|
|
831
|
-
return val;
|
|
832
|
-
}).filter(Boolean);
|
|
833
|
-
return { ...field, exceptCodes };
|
|
834
|
-
});
|
|
835
|
-
return { ...fieldGroupConfig, fields };
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
buildButtons = () => {
|
|
839
|
-
const { fieldGroupConfig, viewOrEdit, value, serverKey } = this.props;
|
|
840
|
-
const { translate } = this.context;
|
|
841
|
-
const { buttons, disabled, addOrEditType, batchAddFileField } = fieldGroupConfig;
|
|
842
|
-
const { uploadingFiles } = this.state;
|
|
843
|
-
const temFieldGroupConfig = this.handleFieldConfig();
|
|
844
|
-
|
|
845
|
-
const buttonDisabled: boolean = disabled
|
|
846
|
-
? disabled
|
|
847
|
-
: fieldGroupConfig.max
|
|
848
|
-
? fieldGroupConfig.max <= (value ? value.length : 0)
|
|
849
|
-
: false;
|
|
850
|
-
|
|
851
|
-
if (viewOrEdit == "edit") {
|
|
852
|
-
return (
|
|
853
|
-
<Row>
|
|
854
|
-
<Col span={20}>
|
|
855
|
-
<Space>
|
|
856
|
-
{buttons.includes("rowAdd") ? (
|
|
857
|
-
addOrEditType == "tableRow" ?
|
|
858
|
-
<>
|
|
859
|
-
<Button
|
|
860
|
-
onClick={() => this.addNewRow(undefined)}>{translate("${添加一行}")}</Button>
|
|
861
|
-
{batchAddFileField ?
|
|
862
|
-
<EntryControl value={uploadingFiles} onChange={this.uploadFiles}
|
|
863
|
-
fieldConfig={{ controlType: "relfile" }} /> : ""}
|
|
864
|
-
</> :
|
|
865
|
-
<PopoverEditor
|
|
866
|
-
serverKey={serverKey}
|
|
867
|
-
disabled={buttonDisabled}
|
|
868
|
-
buttonStyle={{ marginBottom: 10 }}
|
|
869
|
-
buttonTitle={translate("${新建一行}")}
|
|
870
|
-
fieldGroupConfig={temFieldGroupConfig}
|
|
871
|
-
onOk={this.handleColData}
|
|
872
|
-
/>
|
|
873
|
-
) : (
|
|
874
|
-
""
|
|
875
|
-
)}
|
|
876
|
-
{buttons.includes("dtmplAdd") ? (
|
|
877
|
-
fieldGroupConfig.classAddConfigs &&
|
|
878
|
-
fieldGroupConfig.classAddConfigs.length > 0 ? (
|
|
879
|
-
<Popover
|
|
880
|
-
arrow={false}
|
|
881
|
-
content={this.getAddTmplButton(
|
|
882
|
-
fieldGroupConfig.classAddConfigs
|
|
883
|
-
)}
|
|
884
|
-
placement="bottomRight"
|
|
885
|
-
>
|
|
886
|
-
<Tooltip>
|
|
887
|
-
<Button icon={<PlusSquareOutlined />}>
|
|
888
|
-
{translate("${新增}")}
|
|
889
|
-
</Button>
|
|
890
|
-
</Tooltip>
|
|
891
|
-
</Popover>
|
|
892
|
-
) : (
|
|
893
|
-
<Button
|
|
894
|
-
disabled={buttonDisabled}
|
|
895
|
-
icon={<PlusSquareOutlined />}
|
|
896
|
-
size="small"
|
|
897
|
-
onClick={() => this.showAddDtmplModel()}
|
|
898
|
-
style={{ marginBottom: 10 }}
|
|
899
|
-
>
|
|
900
|
-
{translate("${新增}")}
|
|
901
|
-
</Button>
|
|
902
|
-
)
|
|
903
|
-
) : (
|
|
904
|
-
""
|
|
905
|
-
)}
|
|
906
|
-
{buttons.includes("selectAdd") ? (
|
|
907
|
-
<Button
|
|
908
|
-
disabled={buttonDisabled}
|
|
909
|
-
type="primary"
|
|
910
|
-
icon={<SnippetsOutlined />}
|
|
911
|
-
size="small"
|
|
912
|
-
onClick={this.showSelect}
|
|
913
|
-
style={{ marginBottom: 10 }}
|
|
914
|
-
>
|
|
915
|
-
{translate("${选择}")}
|
|
916
|
-
</Button>
|
|
917
|
-
) : (
|
|
918
|
-
""
|
|
919
|
-
)}
|
|
920
|
-
{fieldGroupConfig.min && (!value || value.length <= 0) ? (
|
|
921
|
-
<Text style={{ color: "red" }}>
|
|
922
|
-
{translate("${请选择或添加}")}
|
|
923
|
-
{translate("${" + fieldGroupConfig.title + "}")}
|
|
924
|
-
</Text>
|
|
925
|
-
) : null}
|
|
926
|
-
<FormItem
|
|
927
|
-
name={"$virtual" + fieldGroupConfig.id}
|
|
928
|
-
style={{ margin: 0, maxHeight: "32px" }}
|
|
929
|
-
rules={
|
|
930
|
-
fieldGroupConfig.min
|
|
931
|
-
? [
|
|
932
|
-
{
|
|
933
|
-
required: true,
|
|
934
|
-
message: ``,
|
|
935
|
-
},
|
|
936
|
-
]
|
|
937
|
-
: null
|
|
938
|
-
}
|
|
939
|
-
>
|
|
940
|
-
<CountingTag
|
|
941
|
-
min={fieldGroupConfig.min + ""}
|
|
942
|
-
style={{ marginBottom: 10 }}
|
|
943
|
-
count={value ? value.length : 0}
|
|
944
|
-
value={value}
|
|
945
|
-
></CountingTag>
|
|
946
|
-
</FormItem>
|
|
947
|
-
</Space>
|
|
948
|
-
</Col>
|
|
949
|
-
</Row>
|
|
950
|
-
);
|
|
951
|
-
} else {
|
|
952
|
-
return "";
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
render() {
|
|
957
|
-
const {
|
|
958
|
-
fieldGroupConfig,
|
|
959
|
-
value,
|
|
960
|
-
parentId,
|
|
961
|
-
loading,
|
|
962
|
-
initCollapse,
|
|
963
|
-
mainCode,
|
|
964
|
-
serverKey,
|
|
965
|
-
showRightNav, parentFormInstance, showCollapseCard
|
|
966
|
-
} = this.props;
|
|
967
|
-
const {
|
|
968
|
-
pageSize,
|
|
969
|
-
selectedCode,
|
|
970
|
-
showDtmplView,
|
|
971
|
-
showSelectTable,
|
|
972
|
-
showDtmplEdit,
|
|
973
|
-
addTmplId,
|
|
974
|
-
tableLoading,
|
|
975
|
-
} = this.state;
|
|
976
|
-
const { translate } = this.context;
|
|
977
|
-
|
|
978
|
-
const { buttons, viewModel } = fieldGroupConfig;
|
|
979
|
-
let mainCode1 = fieldGroupConfig.mainCode
|
|
980
|
-
? fieldGroupConfig.mainCode
|
|
981
|
-
: mainCode
|
|
982
|
-
? mainCode
|
|
983
|
-
: parentId;
|
|
984
|
-
let page = {
|
|
985
|
-
pageSize: pageSize,
|
|
986
|
-
hideOnSinglePage: true,
|
|
987
|
-
defaultCurrent: 1,
|
|
988
|
-
total: value ? value.length : undefined,
|
|
989
|
-
showTotal: (total) => {
|
|
990
|
-
return translate("${共}" + total + "${条}");
|
|
991
|
-
},
|
|
992
|
-
};
|
|
993
|
-
let exceptCodes = [];
|
|
994
|
-
if (value) {
|
|
995
|
-
for (let v of value) {
|
|
996
|
-
exceptCodes.push(v.code);
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
const renderEditTableList = <div className="editTableList">
|
|
1001
|
-
{this.buildButtons()}
|
|
1002
|
-
{viewModel && viewModel === "verticalList" ? <VerticalList
|
|
1003
|
-
dataSource={this.buildDataSource()}
|
|
1004
|
-
columnConfigs={fieldGroupConfig?.fields}
|
|
1005
|
-
serverKey={serverKey}
|
|
1006
|
-
columns={this.buildColumns()} /> :
|
|
1007
|
-
<AntdForm ref={this.formRef} component={false}>
|
|
1008
|
-
<Table
|
|
1009
|
-
size={"small"}
|
|
1010
|
-
locale={{
|
|
1011
|
-
emptyText: (
|
|
1012
|
-
<div style={{ textAlign: "center", width: "100%" }}>
|
|
1013
|
-
<Text disabled>{translate("${暂无数据}...")}</Text>
|
|
1014
|
-
</div>
|
|
1015
|
-
),
|
|
1016
|
-
}}
|
|
1017
|
-
bordered
|
|
1018
|
-
loading={tableLoading}
|
|
1019
|
-
dataSource={this.buildDataSource()}
|
|
1020
|
-
columns={this.buildColumns()}
|
|
1021
|
-
pagination={page}
|
|
1022
|
-
onChange={this.tabChange}
|
|
1023
|
-
/></AntdForm>}
|
|
1024
|
-
</div>;
|
|
1025
|
-
|
|
1026
|
-
console.log("showCollapseCard", showCollapseCard);
|
|
1027
|
-
|
|
1028
|
-
return fieldGroupConfig.displayConfig.includes("nonDataNonDisplayed") &&
|
|
1029
|
-
(!value || value.length <= 0) ? "" : (
|
|
1030
|
-
<>
|
|
1031
|
-
{showCollapseCard ?
|
|
1032
|
-
<CollapseCard
|
|
1033
|
-
showRightNav={showRightNav}
|
|
1034
|
-
initCollapse={initCollapse || fieldGroupConfig.displayConfig.includes("folded")}
|
|
1035
|
-
title={fieldGroupConfig.title}
|
|
1036
|
-
tip={fieldGroupConfig.tip}
|
|
1037
|
-
id={parentId + fieldGroupConfig.id}
|
|
1038
|
-
className="hoverable"
|
|
1039
|
-
styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
|
|
1040
|
-
loading={loading}
|
|
1041
|
-
//暂时注释掉,后续要支持配置。
|
|
1042
|
-
//extra={<Input.Search onSearch={this.searchValue} allowClear placeholder=""/>}
|
|
1043
|
-
>
|
|
1044
|
-
{renderEditTableList}
|
|
1045
|
-
</CollapseCard> : renderEditTableList}
|
|
1046
|
-
{buttons.includes("detail") ? (
|
|
1047
|
-
<ModalDtmplView
|
|
1048
|
-
serverKey={serverKey}
|
|
1049
|
-
mainCode={mainCode1}
|
|
1050
|
-
open={showDtmplView}
|
|
1051
|
-
onCancel={this.hiddenEntityView}
|
|
1052
|
-
sourceId={fieldGroupConfig.id}
|
|
1053
|
-
code={selectedCode}
|
|
1054
|
-
>
|
|
1055
|
-
{" "}
|
|
1056
|
-
</ModalDtmplView>
|
|
1057
|
-
) : ""}
|
|
1058
|
-
{buttons.includes("dtmplEdit") || buttons.includes("dtmplAdd") ? (
|
|
1059
|
-
<DtmplEditPage
|
|
1060
|
-
addTmplId={addTmplId}
|
|
1061
|
-
serverKey={serverKey}
|
|
1062
|
-
mainCode={mainCode1}
|
|
1063
|
-
open={showDtmplEdit}
|
|
1064
|
-
onCancel={this.hiddenEntityEdit}
|
|
1065
|
-
sourceId={fieldGroupConfig.id}
|
|
1066
|
-
code={selectedCode}
|
|
1067
|
-
parentFormInstance={parentFormInstance}
|
|
1068
|
-
onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd}
|
|
1069
|
-
/>
|
|
1070
|
-
) : ""}
|
|
1071
|
-
{buttons.includes("selectAdd") ? (
|
|
1072
|
-
<ModelSelectTable
|
|
1073
|
-
serverKey={serverKey}
|
|
1074
|
-
defaultCriteriaValue={fieldGroupConfig.defaultCriteriaValue}
|
|
1075
|
-
maxSelectedRows={fieldGroupConfig.max}
|
|
1076
|
-
open={showSelectTable}
|
|
1077
|
-
onOK={this.select}
|
|
1078
|
-
onCancel={() => {
|
|
1079
|
-
this.setState({ showSelectTable: false });
|
|
1080
|
-
}}
|
|
1081
|
-
exceptCodes={exceptCodes}
|
|
1082
|
-
mainCode={mainCode1}
|
|
1083
|
-
sourceId={fieldGroupConfig.id}
|
|
1084
|
-
selectRelValueField={fieldGroupConfig.selectRelValueField}
|
|
1085
|
-
parentFormInstance={parentFormInstance}
|
|
1086
|
-
/>
|
|
1087
|
-
) : ""}
|
|
1088
|
-
</>
|
|
1089
|
-
);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
export default RelationTable;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Col,
|
|
5
|
+
Form as AntdForm,
|
|
6
|
+
Popover,
|
|
7
|
+
Row,
|
|
8
|
+
Space,
|
|
9
|
+
Tooltip,
|
|
10
|
+
Typography, Popconfirm, FormInstance,
|
|
11
|
+
message
|
|
12
|
+
} from "antd";
|
|
13
|
+
import Table from "./control-table-x-axis-wrapper";
|
|
14
|
+
import {
|
|
15
|
+
AlignLeftOutlined, CheckOutlined, CloseCircleOutlined,
|
|
16
|
+
DeleteOutlined,
|
|
17
|
+
EditOutlined,
|
|
18
|
+
FormOutlined,
|
|
19
|
+
PlusSquareOutlined, QuestionCircleOutlined,
|
|
20
|
+
SnippetsOutlined,
|
|
21
|
+
} from "@ant-design/icons";
|
|
22
|
+
import "./index.css";
|
|
23
|
+
import {
|
|
24
|
+
ClassAddConfig,
|
|
25
|
+
DtmplData, FieldConfig,
|
|
26
|
+
FieldGroupConfig,
|
|
27
|
+
SelectedRow,
|
|
28
|
+
ViewOrEdit,
|
|
29
|
+
} from "../tmpl/interface";
|
|
30
|
+
import SupportInputTypes from "../tmpl/control-type-supportor";
|
|
31
|
+
import TableUnits from "./table-util";
|
|
32
|
+
import ViewControl from "../controls/view-control";
|
|
33
|
+
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
34
|
+
import DtmplEditPage from "../module/dtmpl-edit-page";
|
|
35
|
+
import ModelSelectTable from "./modal-select-table";
|
|
36
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
37
|
+
import CollapseCard from "../controls/collapse-card";
|
|
38
|
+
import PopoverEditor from "../detail/edit/popover-editor";
|
|
39
|
+
import Action from "../controls/action";
|
|
40
|
+
import CountingTag from "../controls/counting-tag";
|
|
41
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
42
|
+
import VerticalList from "../list/vertical-list";
|
|
43
|
+
import { EntryControl } from "../index";
|
|
44
|
+
import TmplConfigAnalysis from "../tmpl/tmpl-config-analysis";
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const FormItem = AntdForm.Item;
|
|
48
|
+
const { Text } = Typography;
|
|
49
|
+
|
|
50
|
+
interface RelationTableProps {
|
|
51
|
+
showRightNav?: boolean;
|
|
52
|
+
mainCode?: string;
|
|
53
|
+
serverKey?: string;
|
|
54
|
+
parentId: string;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
viewOrEdit: ViewOrEdit;
|
|
57
|
+
refreshId?: string;
|
|
58
|
+
fieldGroupConfig: FieldGroupConfig;
|
|
59
|
+
value: DtmplData[];
|
|
60
|
+
parentFormInstance?: FormInstance;
|
|
61
|
+
onChange?: (fieldGroupConfig: FieldGroupConfig, value: DtmplData[]) => void;
|
|
62
|
+
onEditing?: (editing: boolean) => void;
|
|
63
|
+
initCollapse?: boolean;
|
|
64
|
+
showCollapseCard?: boolean; // 是否显示折叠卡片,默认显示
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface RelationTableStat {
|
|
68
|
+
selectedCode?: string;
|
|
69
|
+
showDtmplView?: boolean;
|
|
70
|
+
showDtmplEdit?: boolean;
|
|
71
|
+
showSelectTable?: boolean;
|
|
72
|
+
tableLoading?: boolean;
|
|
73
|
+
showRowEdit?: boolean;
|
|
74
|
+
selectedDtmplData?: DtmplData;
|
|
75
|
+
filterStr?: string;
|
|
76
|
+
pageSize?: number;
|
|
77
|
+
addTmplId?: string;
|
|
78
|
+
editings?: string[];
|
|
79
|
+
uploadingFiles?: object[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
class RelationTable extends React.PureComponent<
|
|
83
|
+
RelationTableProps,
|
|
84
|
+
RelationTableStat
|
|
85
|
+
> {
|
|
86
|
+
state = {
|
|
87
|
+
showDtmplView: false,
|
|
88
|
+
selectedCode: undefined,
|
|
89
|
+
showSelectTable: false,
|
|
90
|
+
showDtmplEdit: false,
|
|
91
|
+
tableLoading: false,
|
|
92
|
+
showRowEdit: false,
|
|
93
|
+
selectedDtmplData: undefined,
|
|
94
|
+
filterStr: undefined,
|
|
95
|
+
pageSize: 10,
|
|
96
|
+
addTmplId: undefined,
|
|
97
|
+
editings: [],
|
|
98
|
+
uploadingFiles: [],
|
|
99
|
+
};
|
|
100
|
+
static contextType = LocaleContext;
|
|
101
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
102
|
+
static defaultProps = {
|
|
103
|
+
showCollapseCard: true,
|
|
104
|
+
};
|
|
105
|
+
formRef = React.createRef<FormInstance>();
|
|
106
|
+
|
|
107
|
+
async componentDidMount() {
|
|
108
|
+
// const {fieldGroupConfig} = this.props;
|
|
109
|
+
// if (fieldGroupConfig.displayConfig.includes('folded')) {
|
|
110
|
+
// this.setState({
|
|
111
|
+
// collapse: true,
|
|
112
|
+
// })
|
|
113
|
+
// }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async componentDidUpdate(prevProps) {
|
|
117
|
+
const { fieldGroupConfig } = this.props;
|
|
118
|
+
const { fieldGroupConfig: preFieldGroupConfig } = prevProps;
|
|
119
|
+
if (
|
|
120
|
+
fieldGroupConfig.disabled != preFieldGroupConfig.disabled ||
|
|
121
|
+
fieldGroupConfig.mainCode != preFieldGroupConfig.mainCode
|
|
122
|
+
) {
|
|
123
|
+
this.setState({ filterStr: "" });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
buildDataSource = () => {
|
|
128
|
+
const { filterStr } = this.state;
|
|
129
|
+
const { value } = this.props;
|
|
130
|
+
let dataSource = undefined;
|
|
131
|
+
|
|
132
|
+
/** 构建 dataSource **/
|
|
133
|
+
if (value) {
|
|
134
|
+
dataSource = [];
|
|
135
|
+
value.forEach((item, index) => {
|
|
136
|
+
let flag = true;
|
|
137
|
+
if (filterStr) {
|
|
138
|
+
flag = false;
|
|
139
|
+
for (let value of Object.values(item.fieldMap)) {
|
|
140
|
+
if (value && value.toString().indexOf(filterStr) >= 0) {
|
|
141
|
+
flag = true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (flag) {
|
|
146
|
+
let row = {
|
|
147
|
+
key: item.code,
|
|
148
|
+
editStatus: item.editStatus,
|
|
149
|
+
relationLabel: item.relationLabel,
|
|
150
|
+
code: item.code, //增加code,为了删除操作
|
|
151
|
+
...item.fieldMap,
|
|
152
|
+
};
|
|
153
|
+
dataSource.push(row);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return dataSource;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
isDisabled = (record: DtmplData, item: FieldConfig) => {
|
|
162
|
+
if (!item.rowEditType) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
let isNew: boolean = record.editStatus && record.editStatus == "new";
|
|
166
|
+
let type = item.rowEditType;
|
|
167
|
+
if (type == "editable") {
|
|
168
|
+
return false;
|
|
169
|
+
} else if (type == "readonly") {
|
|
170
|
+
return true;
|
|
171
|
+
} else if (type == "editonly" && !isNew) {
|
|
172
|
+
return false;
|
|
173
|
+
} else if (type == "addonly" && isNew) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
buildColumns = () => {
|
|
180
|
+
const { viewOrEdit, fieldGroupConfig, serverKey, parentFormInstance } = this.props;
|
|
181
|
+
const {
|
|
182
|
+
buttons,
|
|
183
|
+
fields,
|
|
184
|
+
showRelationName,
|
|
185
|
+
relationNames,
|
|
186
|
+
disabled,
|
|
187
|
+
deleteData, addOrEditType
|
|
188
|
+
} = fieldGroupConfig;
|
|
189
|
+
const { translate } = this.context;
|
|
190
|
+
const { editings } = this.state;
|
|
191
|
+
let columns = [];
|
|
192
|
+
/** 构建column **/
|
|
193
|
+
let s = 0;
|
|
194
|
+
fields.forEach((item) => {
|
|
195
|
+
let column = {};
|
|
196
|
+
columns.push(column);
|
|
197
|
+
let title1 = translate("${" + item.title + "}");
|
|
198
|
+
column["title"] = item.tip ? <>{title1}<Tooltip placement="top" title={item.tip}>
|
|
199
|
+
<Button type={'text'} size={'small'} disabled={true} icon={<QuestionCircleOutlined />} /></Tooltip> </> : title1;
|
|
200
|
+
column["dataIndex"] = item.id;
|
|
201
|
+
if (item.colWidth) column["width"] = item.colWidth;
|
|
202
|
+
s++;
|
|
203
|
+
let itemType = SupportInputTypes.getControlType(item, null);
|
|
204
|
+
if (s < 12 && item.sortable) {
|
|
205
|
+
TableUnits.sort(column, itemType);
|
|
206
|
+
}
|
|
207
|
+
//配置字段的 默认次过滤条件
|
|
208
|
+
if (item.relValueField) {
|
|
209
|
+
if (!item.baseCriteria) {
|
|
210
|
+
item.baseCriteria = {}
|
|
211
|
+
}
|
|
212
|
+
item.baseCriteria = {
|
|
213
|
+
...item.baseCriteria,
|
|
214
|
+
"secondCriterion": parentFormInstance.getFieldValue(item.relValueField.id)
|
|
215
|
+
};
|
|
216
|
+
item.configChanged = true;
|
|
217
|
+
}
|
|
218
|
+
column["render"] = (text, record) => {
|
|
219
|
+
return (editings.indexOf(record.code) >= 0 ?
|
|
220
|
+
<FormItem style={{ margin: 0 }}
|
|
221
|
+
name={record.code + "_" + item.id}
|
|
222
|
+
key={record.code + "_" + item.id}
|
|
223
|
+
rules={TmplConfigAnalysis.getRules(item, translate)}
|
|
224
|
+
initialValue={record[item.id]}>
|
|
225
|
+
<EntryControl
|
|
226
|
+
serverKey={serverKey}
|
|
227
|
+
fieldConfig={{ ...item, disabled: this.isDisabled(record, item) }}
|
|
228
|
+
value={record[item.id]}
|
|
229
|
+
/></FormItem> :
|
|
230
|
+
<ViewControl
|
|
231
|
+
serverKey={serverKey}
|
|
232
|
+
holderType={"table"}
|
|
233
|
+
fieldConfig={item}
|
|
234
|
+
value={record[item.id]}
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
if (showRelationName) {
|
|
240
|
+
//判断是否有关系属性
|
|
241
|
+
let rela = {
|
|
242
|
+
dataIndex: "relationLabel",
|
|
243
|
+
name: "relation",
|
|
244
|
+
title: translate("${关系}"),
|
|
245
|
+
type: "relation",
|
|
246
|
+
editable: true,
|
|
247
|
+
fieldAvailable: true,
|
|
248
|
+
id: "10000", //关系默认id是'10000'
|
|
249
|
+
options: relationNames,
|
|
250
|
+
};
|
|
251
|
+
columns.unshift(rela);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
//添加操作列
|
|
255
|
+
|
|
256
|
+
const viewable = buttons.includes("detail");
|
|
257
|
+
const rowEdit = buttons.includes("rowEdit");
|
|
258
|
+
const dtmplEdit = buttons.includes("dtmplEdit");
|
|
259
|
+
const deletable = buttons.includes("singleDelete");
|
|
260
|
+
if (
|
|
261
|
+
viewOrEdit == "edit" &&
|
|
262
|
+
(viewable || rowEdit || dtmplEdit || deletable)
|
|
263
|
+
) {
|
|
264
|
+
const actionColumn = {};
|
|
265
|
+
columns.push(actionColumn);
|
|
266
|
+
actionColumn["操作"] = 1;
|
|
267
|
+
actionColumn["title"] = translate("${操作}");
|
|
268
|
+
actionColumn["fixed"] = "right";
|
|
269
|
+
actionColumn["key"] = "action";
|
|
270
|
+
actionColumn["render"] = (record) => {
|
|
271
|
+
return (
|
|
272
|
+
<div className="actionbtn">
|
|
273
|
+
{/*详情*/}
|
|
274
|
+
{viewable ? (
|
|
275
|
+
<Button
|
|
276
|
+
disabled={disabled}
|
|
277
|
+
title={translate("${当前实体}")}
|
|
278
|
+
type="primary"
|
|
279
|
+
icon={<AlignLeftOutlined />}
|
|
280
|
+
size="small"
|
|
281
|
+
onClick={() => this.showEntityView(record)}
|
|
282
|
+
></Button>
|
|
283
|
+
) : (
|
|
284
|
+
""
|
|
285
|
+
)}
|
|
286
|
+
{/*模板编辑*/}
|
|
287
|
+
{dtmplEdit ? (
|
|
288
|
+
<Button
|
|
289
|
+
disabled={disabled}
|
|
290
|
+
title={translate("${编辑}${当前实体}")}
|
|
291
|
+
icon={<FormOutlined />}
|
|
292
|
+
size="small"
|
|
293
|
+
onClick={() => this.showEditDtmplModel(record)}
|
|
294
|
+
></Button>
|
|
295
|
+
) : (
|
|
296
|
+
""
|
|
297
|
+
)}
|
|
298
|
+
{fieldGroupConfig.rowActions &&
|
|
299
|
+
fieldGroupConfig.rowActions.length > 0
|
|
300
|
+
? fieldGroupConfig.rowActions.map((action) => {
|
|
301
|
+
return (
|
|
302
|
+
<Action
|
|
303
|
+
serverKey={serverKey}
|
|
304
|
+
disabled={disabled}
|
|
305
|
+
key={action.id}
|
|
306
|
+
data={[record]}
|
|
307
|
+
actionConfig={action}
|
|
308
|
+
doAction={this.doRowAction}
|
|
309
|
+
buttonSize={"small"}
|
|
310
|
+
></Action>
|
|
311
|
+
);
|
|
312
|
+
})
|
|
313
|
+
: ""}
|
|
314
|
+
{/*行编辑*/}
|
|
315
|
+
{rowEdit && editings.indexOf(record.code) < 0 ? (
|
|
316
|
+
addOrEditType !== "tableRow" ?
|
|
317
|
+
<PopoverEditor
|
|
318
|
+
serverKey={serverKey}
|
|
319
|
+
disabled={disabled}
|
|
320
|
+
buttonIcon={<EditOutlined />}
|
|
321
|
+
dtmplData={this.getRowEditData(record.code)}
|
|
322
|
+
fieldGroupConfig={fieldGroupConfig}
|
|
323
|
+
onOk={this.handleColData}
|
|
324
|
+
tooltipTitle={translate("${编辑当前行}")}
|
|
325
|
+
></PopoverEditor> : <Button icon={<EditOutlined />} size={'small'}
|
|
326
|
+
onClick={() => this.editRowEdit(record.code)}>
|
|
327
|
+
</Button>
|
|
328
|
+
) : ""
|
|
329
|
+
}
|
|
330
|
+
{editings.indexOf(record.code) >= 0 ?
|
|
331
|
+
<><Tooltip placement="topRight" title={translate("${确定修改}")}>
|
|
332
|
+
<Button onClick={() => this.saveRowData(record)}
|
|
333
|
+
icon={<CheckOutlined />} size={'small'}></Button></Tooltip>
|
|
334
|
+
{record.editStatus !== "new" &&
|
|
335
|
+
<Tooltip placement="topRight" title={translate("${取消修改}")}>
|
|
336
|
+
<Button onClick={() => this.cancelRowEdit(record.code)}
|
|
337
|
+
icon={<CloseCircleOutlined />} size={'small'}></Button>
|
|
338
|
+
</Tooltip>}
|
|
339
|
+
</> : ""}
|
|
340
|
+
{/*删除*/}
|
|
341
|
+
{deletable ?
|
|
342
|
+
deleteData ? <Popconfirm
|
|
343
|
+
placement="leftBottom"
|
|
344
|
+
title={translate("${确定要[删除]选中数据吗}?")}
|
|
345
|
+
onConfirm={() => {
|
|
346
|
+
this.delete(record);
|
|
347
|
+
}}
|
|
348
|
+
okText={translate("${确定}")}
|
|
349
|
+
cancelText={translate("${取消}")}
|
|
350
|
+
okType={"danger"}
|
|
351
|
+
> <Button
|
|
352
|
+
disabled={disabled}
|
|
353
|
+
danger
|
|
354
|
+
type="primary"
|
|
355
|
+
icon={<DeleteOutlined />}
|
|
356
|
+
size="small"></Button>
|
|
357
|
+
</Popconfirm> :
|
|
358
|
+
<Tooltip placement="right" title={translate("${删除}${当前行}")}>
|
|
359
|
+
<Button
|
|
360
|
+
disabled={disabled}
|
|
361
|
+
danger
|
|
362
|
+
type="primary"
|
|
363
|
+
icon={<DeleteOutlined />}
|
|
364
|
+
size="small"
|
|
365
|
+
onClick={() => this.delete(record)}></Button></Tooltip>
|
|
366
|
+
|
|
367
|
+
: (
|
|
368
|
+
""
|
|
369
|
+
)}
|
|
370
|
+
</div>
|
|
371
|
+
);
|
|
372
|
+
};
|
|
373
|
+
} else if (viewOrEdit == "view" && viewable) {
|
|
374
|
+
const actionColumn = {};
|
|
375
|
+
columns.push(actionColumn);
|
|
376
|
+
actionColumn["操作"] = 1;
|
|
377
|
+
actionColumn["title"] = translate("${操作}");
|
|
378
|
+
actionColumn["fixed"] = "right";
|
|
379
|
+
actionColumn["key"] = "action";
|
|
380
|
+
actionColumn["render"] = (record) => {
|
|
381
|
+
return (
|
|
382
|
+
<div className="actionbtn">
|
|
383
|
+
{/*详情*/}
|
|
384
|
+
{viewable ? (
|
|
385
|
+
<Button
|
|
386
|
+
disabled={disabled}
|
|
387
|
+
title={translate("${当前实体}")}
|
|
388
|
+
type="primary"
|
|
389
|
+
icon={<AlignLeftOutlined />}
|
|
390
|
+
size="small"
|
|
391
|
+
onClick={() => this.showEntityView(record)}
|
|
392
|
+
></Button>
|
|
393
|
+
) : (
|
|
394
|
+
""
|
|
395
|
+
)}
|
|
396
|
+
</div>
|
|
397
|
+
);
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return columns;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
doRowAction = async (actionId: string, codes: string[], params: object) => {
|
|
405
|
+
await this.doAction(
|
|
406
|
+
actionId,
|
|
407
|
+
[{ title: undefined, code: codes[0] }],
|
|
408
|
+
params
|
|
409
|
+
);
|
|
410
|
+
this.handleDtmplEdit(codes[0]);
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
414
|
+
this.setState({
|
|
415
|
+
tableLoading: true,
|
|
416
|
+
});
|
|
417
|
+
let { serverKey } = this.props;
|
|
418
|
+
let result: boolean = await HcserviceV3.postActions(
|
|
419
|
+
serverKey,
|
|
420
|
+
actionId,
|
|
421
|
+
selectedRows,
|
|
422
|
+
params
|
|
423
|
+
);
|
|
424
|
+
{
|
|
425
|
+
this.setState({
|
|
426
|
+
tableLoading: false,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
showEntityView = (record) => {
|
|
432
|
+
//console.log('tabel record:', record);
|
|
433
|
+
this.setState({
|
|
434
|
+
selectedCode: record.code,
|
|
435
|
+
showDtmplView: true,
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
hiddenEntityView = () => {
|
|
440
|
+
this.setState({
|
|
441
|
+
showDtmplView: false,
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
hiddenEntityEdit = () => {
|
|
445
|
+
this.setState({
|
|
446
|
+
showDtmplEdit: false,
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
delete = async (record) => {
|
|
451
|
+
const { value, fieldGroupConfig, onChange, serverKey } = this.props;
|
|
452
|
+
const { editings } = this.state;
|
|
453
|
+
//追加
|
|
454
|
+
const selectdDatas: DtmplData[] = [];
|
|
455
|
+
const selectdCodes: string[] = [];
|
|
456
|
+
if (value) {
|
|
457
|
+
for (let v of value) {
|
|
458
|
+
if (v.code != record.code) {
|
|
459
|
+
selectdDatas.push(v);
|
|
460
|
+
selectdCodes.push(v.code);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
//直接删除
|
|
465
|
+
if (fieldGroupConfig.deleteData) {
|
|
466
|
+
let result: boolean = await HcserviceV3.deleteByCode(serverKey, fieldGroupConfig.id, [record.code]);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (editings && editings.includes(record.code)) {
|
|
470
|
+
this.cancelRowEdit(record.code);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
onChange(fieldGroupConfig, selectdDatas);
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
searchValue = (filterStr: string) => {
|
|
477
|
+
this.setState({
|
|
478
|
+
filterStr,
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
tabChange = (pagination) => {
|
|
483
|
+
//console.log('pagination',pagination);
|
|
484
|
+
this.setState({
|
|
485
|
+
pageSize: pagination.pageSize,
|
|
486
|
+
});
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
showSelect = () => {
|
|
490
|
+
//console.log('showSelectTable click');
|
|
491
|
+
this.setState({
|
|
492
|
+
showSelectTable: true,
|
|
493
|
+
});
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
select = async (selectedRows: SelectedRow[]) => {
|
|
497
|
+
this.setState({
|
|
498
|
+
showSelectTable: false,
|
|
499
|
+
});
|
|
500
|
+
if (!selectedRows || selectedRows.length <= 0) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
//查询
|
|
505
|
+
const codes: string[] = [];
|
|
506
|
+
for (let row of selectedRows) {
|
|
507
|
+
codes.push(row.code);
|
|
508
|
+
}
|
|
509
|
+
await this.add(codes);
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
add = async (codes: string[]) => {
|
|
513
|
+
const { value, fieldGroupConfig, onChange, serverKey } = this.props;
|
|
514
|
+
const { relationNames } = fieldGroupConfig;
|
|
515
|
+
this.setState({
|
|
516
|
+
tableLoading: true,
|
|
517
|
+
});
|
|
518
|
+
let selectdDatas: DtmplData[] = await HcserviceV3.requestSelectedData(
|
|
519
|
+
serverKey,
|
|
520
|
+
fieldGroupConfig.id,
|
|
521
|
+
codes
|
|
522
|
+
);
|
|
523
|
+
|
|
524
|
+
//添加默认关系
|
|
525
|
+
if (selectdDatas) {
|
|
526
|
+
for (let d of selectdDatas) {
|
|
527
|
+
d["relationLabel"] = relationNames[0];
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
//追加
|
|
532
|
+
if (value) {
|
|
533
|
+
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
534
|
+
selectdDatas.push(...value);
|
|
535
|
+
} else {
|
|
536
|
+
selectdDatas.unshift(...value);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
onChange(fieldGroupConfig, selectdDatas);
|
|
541
|
+
this.setState({
|
|
542
|
+
tableLoading: false,
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
getRowEditData = (code?: string) => {
|
|
547
|
+
const { value } = this.props;
|
|
548
|
+
let data = undefined;
|
|
549
|
+
if (code) {
|
|
550
|
+
for (let dtmplData of value) {
|
|
551
|
+
if (code == dtmplData.code) {
|
|
552
|
+
data = dtmplData;
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return data;
|
|
558
|
+
};
|
|
559
|
+
handleDtmplAdd = async (code: string, isContinueSave?: boolean) => {
|
|
560
|
+
if (isContinueSave) {
|
|
561
|
+
this.setState({ selectedCode: code });
|
|
562
|
+
} else {
|
|
563
|
+
this.setState({ showDtmplEdit: false });
|
|
564
|
+
}
|
|
565
|
+
await this.add([code]);
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
handleDtmplEdit = async (code: string) => {
|
|
569
|
+
const { value, fieldGroupConfig, onChange } = this.props;
|
|
570
|
+
const {
|
|
571
|
+
serverKey,
|
|
572
|
+
} = fieldGroupConfig;
|
|
573
|
+
this.setState({
|
|
574
|
+
tableLoading: true,
|
|
575
|
+
showDtmplEdit: false,
|
|
576
|
+
});
|
|
577
|
+
let data: DtmplData = (
|
|
578
|
+
await HcserviceV3.requestSelectedData(serverKey, fieldGroupConfig.id, [
|
|
579
|
+
code,
|
|
580
|
+
])
|
|
581
|
+
)[0];
|
|
582
|
+
let datas: DtmplData[] = [...value];
|
|
583
|
+
|
|
584
|
+
if (datas && data) {
|
|
585
|
+
for (let v of datas) {
|
|
586
|
+
if (v.code == data.code) {
|
|
587
|
+
v.fieldMap = data.fieldMap;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
onChange(fieldGroupConfig, datas);
|
|
592
|
+
this.setState({
|
|
593
|
+
tableLoading: false,
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
handleRowEdit = (dtmplData: DtmplData) => {
|
|
598
|
+
const { value, fieldGroupConfig, onChange } = this.props;
|
|
599
|
+
let datas: DtmplData[] = [];
|
|
600
|
+
if (value) {
|
|
601
|
+
datas = [...value];
|
|
602
|
+
}
|
|
603
|
+
let isAdd = true;
|
|
604
|
+
for (let v of datas) {
|
|
605
|
+
if (v.code == dtmplData.code) {
|
|
606
|
+
isAdd = false;
|
|
607
|
+
if (dtmplData.editStatus) {
|
|
608
|
+
v.editStatus = dtmplData.editStatus;
|
|
609
|
+
}
|
|
610
|
+
v.fieldMap = dtmplData.fieldMap;
|
|
611
|
+
if (dtmplData.relationLabel) {
|
|
612
|
+
v.relationLabel = dtmplData.relationLabel;
|
|
613
|
+
}
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if (isAdd) {
|
|
618
|
+
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
619
|
+
datas.push(dtmplData);
|
|
620
|
+
} else {
|
|
621
|
+
datas.unshift(dtmplData);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
onChange(fieldGroupConfig, datas);
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
showAddDtmplModel = (addTmplId?: string) => {
|
|
628
|
+
this.setState({
|
|
629
|
+
showDtmplEdit: true,
|
|
630
|
+
addTmplId,
|
|
631
|
+
selectedCode: undefined,
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
showEditDtmplModel = (record) => {
|
|
635
|
+
this.setState({
|
|
636
|
+
showDtmplEdit: true,
|
|
637
|
+
addTmplId: undefined,
|
|
638
|
+
selectedCode: record.code,
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
getAddTmplButton = (classAddConfigs: ClassAddConfig[]) => {
|
|
643
|
+
const { translate } = this.context;
|
|
644
|
+
|
|
645
|
+
if (classAddConfigs && classAddConfigs.length < 1) {
|
|
646
|
+
return translate("${没有分类添加按钮}");
|
|
647
|
+
}
|
|
648
|
+
return classAddConfigs.map((config) => {
|
|
649
|
+
return (
|
|
650
|
+
<p>
|
|
651
|
+
<Button
|
|
652
|
+
size={"small"}
|
|
653
|
+
type={"text"}
|
|
654
|
+
onClick={() => this.showAddDtmplModel(config.id)}
|
|
655
|
+
>
|
|
656
|
+
{config.title}
|
|
657
|
+
</Button>
|
|
658
|
+
</p>
|
|
659
|
+
);
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
addNewRow = (defaultValue) => {
|
|
664
|
+
const { value, fieldGroupConfig, onChange, onEditing } = this.props;
|
|
665
|
+
const { editings } = this.state;
|
|
666
|
+
let datas: DtmplData[] = [];
|
|
667
|
+
if (value) {
|
|
668
|
+
datas = [...value];
|
|
669
|
+
}
|
|
670
|
+
let fieldMaps = [];
|
|
671
|
+
if (!defaultValue) {
|
|
672
|
+
const defObj = {};
|
|
673
|
+
for (let f of fieldGroupConfig.fields) {
|
|
674
|
+
if (f.defaultValue) {
|
|
675
|
+
defObj[f.id] = f.defaultValue;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
// 添加一行设置默认值
|
|
679
|
+
fieldMaps = [defObj];
|
|
680
|
+
} else if (Array.isArray(defaultValue)) {
|
|
681
|
+
fieldMaps = defaultValue;
|
|
682
|
+
} else {
|
|
683
|
+
fieldMaps = [defaultValue]
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
let editingCodes = [...editings];
|
|
687
|
+
let i = 0;
|
|
688
|
+
for (let f of fieldMaps) {
|
|
689
|
+
|
|
690
|
+
let newData: DtmplData = {};
|
|
691
|
+
newData.editStatus = "new";
|
|
692
|
+
newData.code = Date.now() + "" + i++;
|
|
693
|
+
newData.relationLabel = fieldGroupConfig.relationNames[0]
|
|
694
|
+
newData.fieldMap = f;
|
|
695
|
+
if (fieldGroupConfig.addRowPosition && fieldGroupConfig.addRowPosition === 'end') {
|
|
696
|
+
datas.push(newData);
|
|
697
|
+
} else {
|
|
698
|
+
datas.unshift(newData);
|
|
699
|
+
}
|
|
700
|
+
editingCodes.push(newData.code);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
this.setState({ editings: editingCodes })
|
|
704
|
+
onChange(fieldGroupConfig, datas);
|
|
705
|
+
if (onEditing) {
|
|
706
|
+
onEditing(editingCodes.length > 0);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
editRowEdit = (code) => {
|
|
711
|
+
const { editings } = this.state;
|
|
712
|
+
const { onEditing } = this.props;
|
|
713
|
+
let edis = [...editings, code];
|
|
714
|
+
this.setState({ editings: edis });
|
|
715
|
+
if (onEditing) {
|
|
716
|
+
onEditing(edis.length > 0);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
cancelRowEdit = (code: string) => {
|
|
721
|
+
const { onEditing } = this.props
|
|
722
|
+
const { editings } = this.state
|
|
723
|
+
let arr = editings.filter(item => item !== code);
|
|
724
|
+
this.setState({ editings: [...arr] });
|
|
725
|
+
if (onEditing) {
|
|
726
|
+
onEditing(arr.length > 0);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// 单独提交
|
|
731
|
+
postDtmplData = async (dtmplData, record: DtmplData) => {
|
|
732
|
+
const { fieldGroupConfig, serverKey, onChange, value } = this.props;
|
|
733
|
+
const sourceId = fieldGroupConfig.id;
|
|
734
|
+
const { code, editStatus } = record;
|
|
735
|
+
if (editStatus !== "new") { //editStatus 为new时,是新增实体模版,不传code
|
|
736
|
+
dtmplData["唯一编码"] = code;
|
|
737
|
+
}
|
|
738
|
+
let res = await HcserviceV3.postDtmplData(
|
|
739
|
+
serverKey,
|
|
740
|
+
sourceId,
|
|
741
|
+
dtmplData,
|
|
742
|
+
message
|
|
743
|
+
);
|
|
744
|
+
if (res.status === "success") {
|
|
745
|
+
this.cancelRowEdit(editStatus !== "new" ? res.code : code);
|
|
746
|
+
if (editStatus === "new") {
|
|
747
|
+
onChange(fieldGroupConfig, value.filter(item => item.code !== code)); // 单独提交添加成功后,删除原未保存的数据
|
|
748
|
+
setTimeout(() => this.handleDtmplAdd(res.code), 100);
|
|
749
|
+
} else {
|
|
750
|
+
this.handleDtmplEdit(res.code);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
saveRowData = async (record: DtmplData) => {
|
|
756
|
+
const { fieldGroupConfig } = this.props;
|
|
757
|
+
const { code } = record;
|
|
758
|
+
let currentForm = this.formRef.current;
|
|
759
|
+
let dtmplData: DtmplData = { code };
|
|
760
|
+
dtmplData.fieldMap = {};
|
|
761
|
+
dtmplData.editStatus = "changed";
|
|
762
|
+
await currentForm.validateFields().then(async (values) => {
|
|
763
|
+
for (let key in values) {
|
|
764
|
+
if (values.hasOwnProperty(key) && key.startsWith(code)) {
|
|
765
|
+
dtmplData.fieldMap[key.split("_")[1]] = values[key];
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
if (fieldGroupConfig.submitType === "separate") {
|
|
769
|
+
// 单独提交
|
|
770
|
+
this.postDtmplData(dtmplData.fieldMap, record);
|
|
771
|
+
} else {
|
|
772
|
+
this.cancelRowEdit(code);
|
|
773
|
+
this.handleRowEdit(dtmplData);
|
|
774
|
+
}
|
|
775
|
+
}).catch(errorInfo => {
|
|
776
|
+
})
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// 单列、双列表单添加编辑
|
|
780
|
+
handleColData = (record: DtmplData) => {
|
|
781
|
+
const { fieldGroupConfig } = this.props;
|
|
782
|
+
if (fieldGroupConfig.submitType === "separate") {
|
|
783
|
+
// 单独提交
|
|
784
|
+
this.postDtmplData(record.fieldMap, record);
|
|
785
|
+
} else {
|
|
786
|
+
this.handleRowEdit(record);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
uploadFiles = (values) => {
|
|
793
|
+
|
|
794
|
+
const { batchAddFileField } = this.props.fieldGroupConfig
|
|
795
|
+
if (values) {
|
|
796
|
+
|
|
797
|
+
let uploading = false;
|
|
798
|
+
let vals = JSON.parse(values);
|
|
799
|
+
for (let value of vals) {
|
|
800
|
+
if (!value.status || value.status != "done") {
|
|
801
|
+
uploading = true;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
let datas = [];
|
|
805
|
+
if (!uploading) {
|
|
806
|
+
for (let value of vals) {
|
|
807
|
+
let data = {};
|
|
808
|
+
data[batchAddFileField.id] = JSON.stringify(value);
|
|
809
|
+
datas.push(data);
|
|
810
|
+
}
|
|
811
|
+
this.addNewRow(datas);
|
|
812
|
+
this.setState({ uploadingFiles: [] })
|
|
813
|
+
} else {
|
|
814
|
+
this.setState({ uploadingFiles: values })
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
// 处理fieldConfig,添加exceptCodes
|
|
820
|
+
handleFieldConfig = () => {
|
|
821
|
+
const { fieldGroupConfig, value } = this.props;
|
|
822
|
+
const fields = fieldGroupConfig.fields.map(field => {
|
|
823
|
+
if (!field || !value || !field.relDeduplication) {
|
|
824
|
+
return field;
|
|
825
|
+
}
|
|
826
|
+
const exceptCodes = value.map(item => {
|
|
827
|
+
let val = item.fieldMap[field.id];
|
|
828
|
+
if (val?.includes("@R@")) {
|
|
829
|
+
return val.split("@R@")[0];
|
|
830
|
+
}
|
|
831
|
+
return val;
|
|
832
|
+
}).filter(Boolean);
|
|
833
|
+
return { ...field, exceptCodes };
|
|
834
|
+
});
|
|
835
|
+
return { ...fieldGroupConfig, fields };
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
buildButtons = () => {
|
|
839
|
+
const { fieldGroupConfig, viewOrEdit, value, serverKey } = this.props;
|
|
840
|
+
const { translate } = this.context;
|
|
841
|
+
const { buttons, disabled, addOrEditType, batchAddFileField } = fieldGroupConfig;
|
|
842
|
+
const { uploadingFiles } = this.state;
|
|
843
|
+
const temFieldGroupConfig = this.handleFieldConfig();
|
|
844
|
+
|
|
845
|
+
const buttonDisabled: boolean = disabled
|
|
846
|
+
? disabled
|
|
847
|
+
: fieldGroupConfig.max
|
|
848
|
+
? fieldGroupConfig.max <= (value ? value.length : 0)
|
|
849
|
+
: false;
|
|
850
|
+
|
|
851
|
+
if (viewOrEdit == "edit") {
|
|
852
|
+
return (
|
|
853
|
+
<Row>
|
|
854
|
+
<Col span={20}>
|
|
855
|
+
<Space>
|
|
856
|
+
{buttons.includes("rowAdd") ? (
|
|
857
|
+
addOrEditType == "tableRow" ?
|
|
858
|
+
<>
|
|
859
|
+
<Button
|
|
860
|
+
onClick={() => this.addNewRow(undefined)}>{translate("${添加一行}")}</Button>
|
|
861
|
+
{batchAddFileField ?
|
|
862
|
+
<EntryControl value={uploadingFiles} onChange={this.uploadFiles}
|
|
863
|
+
fieldConfig={{ controlType: "relfile" }} /> : ""}
|
|
864
|
+
</> :
|
|
865
|
+
<PopoverEditor
|
|
866
|
+
serverKey={serverKey}
|
|
867
|
+
disabled={buttonDisabled}
|
|
868
|
+
buttonStyle={{ marginBottom: 10 }}
|
|
869
|
+
buttonTitle={translate("${新建一行}")}
|
|
870
|
+
fieldGroupConfig={temFieldGroupConfig}
|
|
871
|
+
onOk={this.handleColData}
|
|
872
|
+
/>
|
|
873
|
+
) : (
|
|
874
|
+
""
|
|
875
|
+
)}
|
|
876
|
+
{buttons.includes("dtmplAdd") ? (
|
|
877
|
+
fieldGroupConfig.classAddConfigs &&
|
|
878
|
+
fieldGroupConfig.classAddConfigs.length > 0 ? (
|
|
879
|
+
<Popover
|
|
880
|
+
arrow={false}
|
|
881
|
+
content={this.getAddTmplButton(
|
|
882
|
+
fieldGroupConfig.classAddConfigs
|
|
883
|
+
)}
|
|
884
|
+
placement="bottomRight"
|
|
885
|
+
>
|
|
886
|
+
<Tooltip>
|
|
887
|
+
<Button icon={<PlusSquareOutlined />}>
|
|
888
|
+
{translate("${新增}")}
|
|
889
|
+
</Button>
|
|
890
|
+
</Tooltip>
|
|
891
|
+
</Popover>
|
|
892
|
+
) : (
|
|
893
|
+
<Button
|
|
894
|
+
disabled={buttonDisabled}
|
|
895
|
+
icon={<PlusSquareOutlined />}
|
|
896
|
+
size="small"
|
|
897
|
+
onClick={() => this.showAddDtmplModel()}
|
|
898
|
+
style={{ marginBottom: 10 }}
|
|
899
|
+
>
|
|
900
|
+
{translate("${新增}")}
|
|
901
|
+
</Button>
|
|
902
|
+
)
|
|
903
|
+
) : (
|
|
904
|
+
""
|
|
905
|
+
)}
|
|
906
|
+
{buttons.includes("selectAdd") ? (
|
|
907
|
+
<Button
|
|
908
|
+
disabled={buttonDisabled}
|
|
909
|
+
type="primary"
|
|
910
|
+
icon={<SnippetsOutlined />}
|
|
911
|
+
size="small"
|
|
912
|
+
onClick={this.showSelect}
|
|
913
|
+
style={{ marginBottom: 10 }}
|
|
914
|
+
>
|
|
915
|
+
{translate("${选择}")}
|
|
916
|
+
</Button>
|
|
917
|
+
) : (
|
|
918
|
+
""
|
|
919
|
+
)}
|
|
920
|
+
{fieldGroupConfig.min && (!value || value.length <= 0) ? (
|
|
921
|
+
<Text style={{ color: "red" }}>
|
|
922
|
+
{translate("${请选择或添加}")}
|
|
923
|
+
{translate("${" + fieldGroupConfig.title + "}")}
|
|
924
|
+
</Text>
|
|
925
|
+
) : null}
|
|
926
|
+
<FormItem
|
|
927
|
+
name={"$virtual" + fieldGroupConfig.id}
|
|
928
|
+
style={{ margin: 0, maxHeight: "32px" }}
|
|
929
|
+
rules={
|
|
930
|
+
fieldGroupConfig.min
|
|
931
|
+
? [
|
|
932
|
+
{
|
|
933
|
+
required: true,
|
|
934
|
+
message: ``,
|
|
935
|
+
},
|
|
936
|
+
]
|
|
937
|
+
: null
|
|
938
|
+
}
|
|
939
|
+
>
|
|
940
|
+
<CountingTag
|
|
941
|
+
min={fieldGroupConfig.min + ""}
|
|
942
|
+
style={{ marginBottom: 10 }}
|
|
943
|
+
count={value ? value.length : 0}
|
|
944
|
+
value={value}
|
|
945
|
+
></CountingTag>
|
|
946
|
+
</FormItem>
|
|
947
|
+
</Space>
|
|
948
|
+
</Col>
|
|
949
|
+
</Row>
|
|
950
|
+
);
|
|
951
|
+
} else {
|
|
952
|
+
return "";
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
render() {
|
|
957
|
+
const {
|
|
958
|
+
fieldGroupConfig,
|
|
959
|
+
value,
|
|
960
|
+
parentId,
|
|
961
|
+
loading,
|
|
962
|
+
initCollapse,
|
|
963
|
+
mainCode,
|
|
964
|
+
serverKey,
|
|
965
|
+
showRightNav, parentFormInstance, showCollapseCard
|
|
966
|
+
} = this.props;
|
|
967
|
+
const {
|
|
968
|
+
pageSize,
|
|
969
|
+
selectedCode,
|
|
970
|
+
showDtmplView,
|
|
971
|
+
showSelectTable,
|
|
972
|
+
showDtmplEdit,
|
|
973
|
+
addTmplId,
|
|
974
|
+
tableLoading,
|
|
975
|
+
} = this.state;
|
|
976
|
+
const { translate } = this.context;
|
|
977
|
+
|
|
978
|
+
const { buttons, viewModel } = fieldGroupConfig;
|
|
979
|
+
let mainCode1 = fieldGroupConfig.mainCode
|
|
980
|
+
? fieldGroupConfig.mainCode
|
|
981
|
+
: mainCode
|
|
982
|
+
? mainCode
|
|
983
|
+
: parentId;
|
|
984
|
+
let page = {
|
|
985
|
+
pageSize: pageSize,
|
|
986
|
+
hideOnSinglePage: true,
|
|
987
|
+
defaultCurrent: 1,
|
|
988
|
+
total: value ? value.length : undefined,
|
|
989
|
+
showTotal: (total) => {
|
|
990
|
+
return translate("${共}" + total + "${条}");
|
|
991
|
+
},
|
|
992
|
+
};
|
|
993
|
+
let exceptCodes = [];
|
|
994
|
+
if (value) {
|
|
995
|
+
for (let v of value) {
|
|
996
|
+
exceptCodes.push(v.code);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
const renderEditTableList = <div className="editTableList">
|
|
1001
|
+
{this.buildButtons()}
|
|
1002
|
+
{viewModel && viewModel === "verticalList" ? <VerticalList
|
|
1003
|
+
dataSource={this.buildDataSource()}
|
|
1004
|
+
columnConfigs={fieldGroupConfig?.fields}
|
|
1005
|
+
serverKey={serverKey}
|
|
1006
|
+
columns={this.buildColumns()} /> :
|
|
1007
|
+
<AntdForm ref={this.formRef} component={false}>
|
|
1008
|
+
<Table
|
|
1009
|
+
size={"small"}
|
|
1010
|
+
locale={{
|
|
1011
|
+
emptyText: (
|
|
1012
|
+
<div style={{ textAlign: "center", width: "100%" }}>
|
|
1013
|
+
<Text disabled>{translate("${暂无数据}...")}</Text>
|
|
1014
|
+
</div>
|
|
1015
|
+
),
|
|
1016
|
+
}}
|
|
1017
|
+
bordered
|
|
1018
|
+
loading={tableLoading}
|
|
1019
|
+
dataSource={this.buildDataSource()}
|
|
1020
|
+
columns={this.buildColumns()}
|
|
1021
|
+
pagination={page}
|
|
1022
|
+
onChange={this.tabChange}
|
|
1023
|
+
/></AntdForm>}
|
|
1024
|
+
</div>;
|
|
1025
|
+
|
|
1026
|
+
console.log("showCollapseCard", showCollapseCard);
|
|
1027
|
+
|
|
1028
|
+
return fieldGroupConfig.displayConfig.includes("nonDataNonDisplayed") &&
|
|
1029
|
+
(!value || value.length <= 0) ? "" : (
|
|
1030
|
+
<>
|
|
1031
|
+
{showCollapseCard ?
|
|
1032
|
+
<CollapseCard
|
|
1033
|
+
showRightNav={showRightNav}
|
|
1034
|
+
initCollapse={initCollapse || fieldGroupConfig.displayConfig.includes("folded")}
|
|
1035
|
+
title={fieldGroupConfig.title}
|
|
1036
|
+
tip={fieldGroupConfig.tip}
|
|
1037
|
+
id={parentId + fieldGroupConfig.id}
|
|
1038
|
+
className="hoverable"
|
|
1039
|
+
styles={{ header: { background: "#f2f4f5" }, body: { padding: "6px" } }}
|
|
1040
|
+
loading={loading}
|
|
1041
|
+
//暂时注释掉,后续要支持配置。
|
|
1042
|
+
//extra={<Input.Search onSearch={this.searchValue} allowClear placeholder=""/>}
|
|
1043
|
+
>
|
|
1044
|
+
{renderEditTableList}
|
|
1045
|
+
</CollapseCard> : renderEditTableList}
|
|
1046
|
+
{buttons.includes("detail") ? (
|
|
1047
|
+
<ModalDtmplView
|
|
1048
|
+
serverKey={serverKey}
|
|
1049
|
+
mainCode={mainCode1}
|
|
1050
|
+
open={showDtmplView}
|
|
1051
|
+
onCancel={this.hiddenEntityView}
|
|
1052
|
+
sourceId={fieldGroupConfig.id}
|
|
1053
|
+
code={selectedCode}
|
|
1054
|
+
>
|
|
1055
|
+
{" "}
|
|
1056
|
+
</ModalDtmplView>
|
|
1057
|
+
) : ""}
|
|
1058
|
+
{buttons.includes("dtmplEdit") || buttons.includes("dtmplAdd") ? (
|
|
1059
|
+
<DtmplEditPage
|
|
1060
|
+
addTmplId={addTmplId}
|
|
1061
|
+
serverKey={serverKey}
|
|
1062
|
+
mainCode={mainCode1}
|
|
1063
|
+
open={showDtmplEdit}
|
|
1064
|
+
onCancel={this.hiddenEntityEdit}
|
|
1065
|
+
sourceId={fieldGroupConfig.id}
|
|
1066
|
+
code={selectedCode}
|
|
1067
|
+
parentFormInstance={parentFormInstance}
|
|
1068
|
+
onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd}
|
|
1069
|
+
/>
|
|
1070
|
+
) : ""}
|
|
1071
|
+
{buttons.includes("selectAdd") ? (
|
|
1072
|
+
<ModelSelectTable
|
|
1073
|
+
serverKey={serverKey}
|
|
1074
|
+
defaultCriteriaValue={fieldGroupConfig.defaultCriteriaValue}
|
|
1075
|
+
maxSelectedRows={fieldGroupConfig.max}
|
|
1076
|
+
open={showSelectTable}
|
|
1077
|
+
onOK={this.select}
|
|
1078
|
+
onCancel={() => {
|
|
1079
|
+
this.setState({ showSelectTable: false });
|
|
1080
|
+
}}
|
|
1081
|
+
exceptCodes={exceptCodes}
|
|
1082
|
+
mainCode={mainCode1}
|
|
1083
|
+
sourceId={fieldGroupConfig.id}
|
|
1084
|
+
selectRelValueField={fieldGroupConfig.selectRelValueField}
|
|
1085
|
+
parentFormInstance={parentFormInstance}
|
|
1086
|
+
/>
|
|
1087
|
+
) : ""}
|
|
1088
|
+
</>
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
export default RelationTable;
|