aldehyde 0.2.20 → 0.2.21
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/lib/controls/action/index.d.ts +50 -50
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/action/index.js +187 -187
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/action/utils.d.ts +8 -8
- package/lib/controls/action/utils.js +109 -109
- package/lib/controls/auto-complete/index.d.ts +6 -6
- package/lib/controls/auto-complete/index.js +51 -51
- package/lib/controls/cascader/index.d.ts +22 -22
- package/lib/controls/cascader/index.d.ts.map +1 -1
- package/lib/controls/cascader/index.js +107 -106
- package/lib/controls/cascader/index.js.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts +28 -28
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.js +120 -119
- package/lib/controls/chemstruc/graph.js.map +1 -1
- package/lib/controls/code-editor/sql-code-editor.d.ts +14 -14
- package/lib/controls/code-editor/sql-code-editor.js +52 -51
- package/lib/controls/code-editor/sql-code-editor.js.map +1 -1
- package/lib/controls/collapse-card/index.d.ts +19 -19
- package/lib/controls/collapse-card/index.d.ts.map +1 -1
- package/lib/controls/collapse-card/index.js +62 -62
- package/lib/controls/color-picker/index.d.ts +18 -18
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +59 -59
- package/lib/controls/counting-tag/index.d.ts +17 -17
- package/lib/controls/counting-tag/index.js +31 -30
- package/lib/controls/counting-tag/index.js.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +23 -23
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.js +72 -72
- package/lib/controls/cquery/cquick-button.js.map +1 -1
- package/lib/controls/date-picker/index.d.ts +6 -6
- package/lib/controls/date-picker/index.js +83 -83
- package/lib/controls/entity-select/entity-select.d.ts +73 -73
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +427 -426
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts +24 -24
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.js +121 -120
- package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +19 -19
- package/lib/controls/entity-select/popover-entity-select.js +92 -91
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts +12 -12
- package/lib/controls/entry-control.js +202 -202
- package/lib/controls/enum-badge/index.d.ts +6 -6
- package/lib/controls/enum-badge/index.js +13 -13
- package/lib/controls/enum-tag/index.d.ts +6 -6
- package/lib/controls/enum-tag/index.js +23 -23
- package/lib/controls/file-view/drawer-file-view.d.ts +21 -21
- package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
- package/lib/controls/file-view/drawer-file-view.js +56 -55
- package/lib/controls/file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/file-view/index.d.ts +27 -27
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +135 -134
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/html-editor/draft.d.ts +21 -21
- package/lib/controls/html-editor/draft.d.ts.map +1 -1
- package/lib/controls/html-editor/draft.js +121 -121
- package/lib/controls/html-editor/draft.js.map +1 -1
- package/lib/controls/html-editor/tinymce.d.ts +12 -7
- package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
- package/lib/controls/html-editor/tinymce.js +44 -43
- package/lib/controls/html-editor/tinymce.js.map +1 -1
- package/lib/controls/input-number/index.d.ts +6 -6
- package/lib/controls/input-number/index.js +68 -68
- package/lib/controls/input-range/index.d.ts +6 -6
- package/lib/controls/input-range/index.js +27 -27
- package/lib/controls/password-setter/index.d.ts +8 -7
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/password-setter/index.js +50 -50
- package/lib/controls/progress/index.d.ts +6 -6
- package/lib/controls/progress/index.js +44 -44
- package/lib/controls/relation-existion/index.d.ts +19 -19
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.js +74 -74
- package/lib/controls/rfield/index.d.ts +28 -28
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.js +130 -130
- package/lib/controls/signature/index.d.ts +30 -30
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/signature/index.js +129 -128
- package/lib/controls/signature/index.js.map +1 -1
- package/lib/controls/steps/index.d.ts +6 -6
- package/lib/controls/steps/index.js +41 -41
- package/lib/controls/text/ellipsis-text.d.ts +21 -21
- package/lib/controls/text/ellipsis-text.js +46 -45
- package/lib/controls/text/ellipsis-text.js.map +1 -1
- package/lib/controls/upload/index.d.ts +14 -14
- package/lib/controls/upload/index.js +99 -99
- package/lib/controls/view-control.d.ts +9 -9
- package/lib/controls/view-control.js +174 -174
- package/lib/custom-page/custom-page-router.d.ts +7 -22
- package/lib/custom-page/custom-page-router.d.ts.map +1 -1
- package/lib/custom-page/custom-page-router.js +66 -64
- package/lib/custom-page/custom-page-router.js.map +1 -1
- package/lib/custom-page/def-custom-page.d.ts +6 -5
- package/lib/custom-page/def-custom-page.d.ts.map +1 -1
- package/lib/custom-page/def-custom-page.js +13 -13
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +42 -42
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js +35 -34
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts +15 -15
- package/lib/detail/button/cquery-button-bar.js +74 -74
- package/lib/detail/button/submit-button-bar.d.ts +18 -18
- package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/submit-button-bar.js +103 -104
- package/lib/detail/button/submit-button-bar.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.d.ts +47 -47
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +197 -196
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/edit/fields-edit-card.d.ts +38 -38
- package/lib/detail/edit/fields-edit-card.js +64 -63
- package/lib/detail/edit/fields-edit-card.js.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts +30 -30
- package/lib/detail/edit/modal-row-edit.js +56 -55
- package/lib/detail/edit/modal-row-edit.js.map +1 -1
- package/lib/detail/edit/post-result/index.d.ts +16 -16
- package/lib/detail/edit/post-result/index.js +27 -27
- package/lib/detail/edit/row-edit-card.d.ts +41 -41
- package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
- package/lib/detail/edit/row-edit-card.js +84 -83
- package/lib/detail/edit/row-edit-card.js.map +1 -1
- package/lib/detail/edit/row-editor.d.ts +32 -32
- package/lib/detail/edit/row-editor.d.ts.map +1 -1
- package/lib/detail/edit/row-editor.js +56 -55
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/detail/rightbar/index.d.ts +19 -19
- package/lib/detail/rightbar/index.js +51 -50
- package/lib/detail/rightbar/index.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts +43 -43
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +96 -96
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.d.ts +41 -41
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +115 -115
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/field-view-group.d.ts +16 -16
- package/lib/detail/view/field-view-group.js +50 -50
- package/lib/detail/view/modal-dtmpl-view.d.ts +27 -27
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.js +32 -31
- package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts +31 -31
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.js +89 -89
- package/lib/detail/view/snapshot-timeline.js.map +1 -1
- package/lib/exportor/export-frame.d.ts +49 -49
- package/lib/exportor/export-frame.d.ts.map +1 -1
- package/lib/exportor/export-frame.js +142 -141
- package/lib/exportor/export-frame.js.map +1 -1
- package/lib/exportor/index.d.ts +15 -15
- package/lib/exportor/index.js +43 -43
- package/lib/form/criteria-form.d.ts +19 -19
- package/lib/form/criteria-form.js +147 -147
- package/lib/form/dtmpl-form.d.ts +44 -44
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +204 -203
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts +20 -20
- package/lib/form/field-group-form.js +57 -57
- package/lib/form/fields-form.d.ts +19 -19
- package/lib/form/fields-form.js +31 -31
- package/lib/form/form-Item-group.d.ts +29 -29
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +108 -107
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/icon/index.d.ts +10 -10
- package/lib/icon/index.js +21 -21
- package/lib/import/excel-import.d.ts +47 -47
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/import/excel-import.js +234 -234
- package/lib/import/template-builder.d.ts +28 -20
- package/lib/import/template-builder.d.ts.map +1 -1
- package/lib/import/template-builder.js +425 -425
- package/lib/index.d.ts +41 -40
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +79 -78
- package/lib/index.js.map +1 -1
- package/lib/layout/MainPage.d.ts +4 -33
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js +204 -204
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/footer/index.d.ts +6 -5
- package/lib/layout/footer/index.d.ts.map +1 -1
- package/lib/layout/footer/index.js +10 -10
- package/lib/layout/header/index.d.ts +14 -14
- package/lib/layout/header/index.js +35 -35
- package/lib/layout/menu/block.d.ts +16 -8
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/block.js +46 -47
- package/lib/layout/menu/block.js.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts +23 -23
- package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +96 -96
- package/lib/layout/menu/l2menu-quick-bar.d.ts +29 -29
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +93 -93
- package/lib/layout/menu/menu-2layers.d.ts +13 -2
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/menu-2layers.js +69 -70
- package/lib/layout/menu/menu-2layers.js.map +1 -1
- package/lib/layout/menu/menu-render.d.ts +8 -8
- package/lib/layout/menu/menu-render.js +74 -74
- package/lib/layout/menu/reset-password.d.ts +24 -24
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.js +113 -113
- package/lib/layout/menu/user-bar.d.ts +22 -22
- package/lib/layout/menu/user-bar.js +99 -99
- package/lib/layout/menu/userinfo-bar.d.ts +16 -16
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +43 -43
- package/lib/layout/sidebar/index.d.ts +11 -11
- package/lib/layout/sidebar/index.js +17 -17
- package/lib/login/context-setter.d.ts +23 -23
- package/lib/login/context-setter.d.ts.map +1 -1
- package/lib/login/context-setter.js +97 -97
- package/lib/login/context-setter.js.map +1 -1
- package/lib/login/login-context.d.ts +21 -10
- package/lib/login/login-context.d.ts.map +1 -1
- package/lib/login/login-context.js +126 -126
- package/lib/login/login.d.ts +2 -10
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +105 -101
- package/lib/login/login.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts +42 -42
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +162 -162
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-drawer.d.ts +16 -16
- package/lib/module/dtmpl-edit-drawer.js +7 -7
- package/lib/module/dtmpl-edit-modal.d.ts +17 -17
- package/lib/module/dtmpl-edit-modal.js +7 -7
- package/lib/module/dtmpl-edit-page.d.ts +59 -59
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +191 -191
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-editor.d.ts +38 -38
- package/lib/module/dtmpl-editor.d.ts.map +1 -1
- package/lib/module/dtmpl-editor.js +146 -145
- package/lib/module/dtmpl-editor.js.map +1 -1
- package/lib/module/dtmpl-view-card.d.ts +18 -18
- package/lib/module/dtmpl-view-card.d.ts.map +1 -1
- package/lib/module/dtmpl-view-card.js +45 -45
- package/lib/module/dtmpl-view-drawer.d.ts +26 -26
- package/lib/module/dtmpl-view-drawer.js +39 -39
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/module/dtmpl-view-modal.d.ts +27 -27
- package/lib/module/dtmpl-view-modal.js +35 -35
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/ltmpl-drawer.d.ts +28 -28
- package/lib/module/ltmpl-drawer.js +37 -36
- package/lib/module/ltmpl-drawer.js.map +1 -1
- package/lib/module/ltmpl-modal.d.ts +28 -28
- package/lib/module/ltmpl-modal.js +36 -35
- package/lib/module/ltmpl-modal.js.map +1 -1
- package/lib/module/ltmpl-table.d.ts +61 -56
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +217 -210
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/dtmpl-route.d.ts +9 -30
- package/lib/routable/dtmpl-route.d.ts.map +1 -1
- package/lib/routable/dtmpl-route.js +151 -154
- package/lib/routable/dtmpl-route.js.map +1 -1
- package/lib/routable/import-route.d.ts +5 -12
- package/lib/routable/import-route.d.ts.map +1 -1
- package/lib/routable/import-route.js +29 -28
- package/lib/routable/import-route.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +10 -28
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +188 -169
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/withroute.d.ts +3 -0
- package/lib/routable/withroute.d.ts.map +1 -0
- package/lib/routable/withroute.js +11 -0
- package/lib/routable/withroute.js.map +1 -0
- package/lib/table/act-table.d.ts +90 -89
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +529 -532
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-selector.d.ts +24 -24
- package/lib/table/column/column-selector.js +59 -59
- package/lib/table/column/column-selector.js.map +1 -1
- package/lib/table/l2-act-table.d.ts +27 -22
- package/lib/table/l2-act-table.d.ts.map +1 -1
- package/lib/table/l2-act-table.js +86 -79
- package/lib/table/l2-act-table.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +46 -41
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +215 -207
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/pagination.d.ts +16 -16
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/pagination.js +39 -39
- package/lib/table/pagination.js.map +1 -1
- package/lib/table/query-table.d.ts +73 -64
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +264 -256
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +64 -64
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +425 -425
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts +45 -40
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +226 -220
- package/lib/table/select-table.js.map +1 -1
- package/lib/table/selected-rows-card.d.ts +15 -15
- package/lib/table/selected-rows-card.js +46 -46
- package/lib/table/stat/restat.d.ts +25 -25
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/table/stat/restat.js +60 -60
- package/lib/table/stat/restat.js.map +1 -1
- package/lib/table/table-util.d.ts +4 -4
- package/lib/table/table-util.js +25 -25
- package/lib/tmpl/control-type-supportor.d.ts +8 -8
- package/lib/tmpl/control-type-supportor.js +98 -98
- package/lib/tmpl/hc-data-source.d.ts +25 -25
- package/lib/tmpl/hc-data-source.js +331 -331
- package/lib/tmpl/hcservice-v3.d.ts +77 -77
- package/lib/tmpl/hcservice-v3.js +803 -803
- package/lib/tmpl/interface.d.ts +272 -269
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js +3 -3
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/superagent.d.ts +9 -9
- package/lib/tmpl/superagent.js +142 -142
- package/lib/tmpl/tmpl-config-analysis.d.ts +6 -6
- package/lib/tmpl/tmpl-config-analysis.js +106 -106
- package/lib/units/EncryptUtils.d.ts +6 -6
- package/lib/units/EncryptUtils.js +30 -29
- package/lib/units/EncryptUtils.js.map +1 -1
- package/lib/units/index.d.ts +80 -81
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +747 -746
- package/lib/units/index.js.map +1 -1
- package/lib/units/storage.d.ts +2 -2
- package/lib/units/storage.js +1 -1
- package/lib/welcome/HCWelcome.d.ts +17 -13
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js +199 -198
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/quick-entrance.d.ts +19 -19
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.js +78 -78
- package/lib/welcome/workbench.d.ts +19 -19
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/lib/welcome/workbench.js +77 -77
- package/package.json +10 -10
- package/src/aldehyde/controls/action/index.tsx +2 -3
- package/src/aldehyde/controls/cascader/index.tsx +1 -1
- package/src/aldehyde/controls/chemstruc/graph.tsx +2 -2
- package/src/aldehyde/controls/collapse-card/index.tsx +1 -1
- package/src/aldehyde/controls/color-picker/index.tsx +1 -1
- package/src/aldehyde/controls/cquery/cquick-button.tsx +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +12 -12
- package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +1 -1
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +1 -1
- package/src/aldehyde/controls/file-view/index.tsx +1 -1
- package/src/aldehyde/controls/html-editor/draft.tsx +2 -2
- package/src/aldehyde/controls/relation-existion/index.tsx +1 -1
- package/src/aldehyde/controls/rfield/index.tsx +4 -4
- package/src/aldehyde/controls/signature/index.tsx +3 -3
- package/src/aldehyde/custom-page/custom-page-router.tsx +18 -15
- package/src/aldehyde/detail/button/submit-button-bar.tsx +1 -2
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +11 -11
- package/src/aldehyde/detail/edit/row-edit-card.tsx +1 -1
- package/src/aldehyde/detail/edit/row-editor.tsx +1 -1
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +6 -6
- package/src/aldehyde/detail/view/dtmpl-view.tsx +4 -4
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +0 -2
- package/src/aldehyde/detail/view/snapshot-timeline.tsx +2 -2
- package/src/aldehyde/exportor/export-frame.tsx +11 -11
- package/src/aldehyde/form/dtmpl-form.tsx +3 -3
- package/src/aldehyde/form/form-Item-group.tsx +1 -1
- package/src/aldehyde/import/excel-import.tsx +11 -11
- package/src/aldehyde/index.tsx +4 -2
- package/src/aldehyde/layout/MainPage.tsx +17 -19
- package/src/aldehyde/layout/menu/block.tsx +3 -3
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +3 -3
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +4 -4
- package/src/aldehyde/layout/menu/menu-2layers.tsx +3 -4
- package/src/aldehyde/layout/menu/menu-render.tsx +1 -1
- package/src/aldehyde/layout/menu/reset-password.tsx +3 -3
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +1 -1
- package/src/aldehyde/login/context-setter.tsx +3 -3
- package/src/aldehyde/login/login.js +9 -2
- package/src/aldehyde/module/dtmpl-edit-card.tsx +8 -8
- package/src/aldehyde/module/dtmpl-edit-page.tsx +8 -8
- package/src/aldehyde/module/dtmpl-editor.tsx +5 -5
- package/src/aldehyde/module/dtmpl-view-card.tsx +1 -1
- package/src/aldehyde/module/ltmpl-table.tsx +22 -11
- package/src/aldehyde/routable/dtmpl-route.tsx +32 -34
- package/src/aldehyde/routable/import-route.tsx +4 -3
- package/src/aldehyde/routable/ltmpl-route.tsx +100 -75
- package/src/aldehyde/routable/withroute.tsx +22 -0
- package/src/aldehyde/table/act-table.tsx +31 -32
- package/src/aldehyde/table/l2-act-table.tsx +15 -8
- package/src/aldehyde/table/modal-select-table.tsx +22 -12
- package/src/aldehyde/table/pagination.tsx +3 -4
- package/src/aldehyde/table/query-table.tsx +63 -51
- package/src/aldehyde/table/relation-table.tsx +9 -9
- package/src/aldehyde/table/select-table.tsx +22 -10
- package/src/aldehyde/table/stat/restat.tsx +2 -2
- package/src/aldehyde/tmpl/interface.tsx +5 -1
- package/src/aldehyde/units/index.tsx +10 -10
- package/src/aldehyde/welcome/quick-entrance.tsx +1 -1
- package/src/aldehyde/welcome/workbench.tsx +1 -1
|
@@ -1,426 +1,426 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Super from "../tmpl/superagent";
|
|
3
|
-
import Units from "../units";
|
|
4
|
-
import { Button, Popover, Input, Modal, message, Collapse, Tag } from 'antd';
|
|
5
|
-
import { BulbOutlined, DeleteOutlined, FileAddOutlined, DownloadOutlined, SaveOutlined, SnippetsOutlined } from '@ant-design/icons';
|
|
6
|
-
import DragTable from '../drag-table';
|
|
7
|
-
import './index.css';
|
|
8
|
-
const { confirm } = Modal;
|
|
9
|
-
const { Panel } = Collapse;
|
|
10
|
-
const { CheckableTag } = Tag;
|
|
11
|
-
export default class ModelImport extends React.Component {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.state = {
|
|
15
|
-
modelList: [],
|
|
16
|
-
title: "",
|
|
17
|
-
visible: false,
|
|
18
|
-
dataSource: [],
|
|
19
|
-
};
|
|
20
|
-
this.loadWords = (menuId) => {
|
|
21
|
-
Super.super({
|
|
22
|
-
url: `v2/menu/${menuId}/ltmpl/importer/dict`,
|
|
23
|
-
method: 'GET',
|
|
24
|
-
}).then((res) => {
|
|
25
|
-
let selectWords = res.fieldDictionary.composites;
|
|
26
|
-
//console.log(selectWords)
|
|
27
|
-
const forType = [];
|
|
28
|
-
selectWords.forEach((item) => {
|
|
29
|
-
if (item.fields.length > 0) {
|
|
30
|
-
item.fields.forEach((it) => {
|
|
31
|
-
it.checked = false;
|
|
32
|
-
it.key = it.name;
|
|
33
|
-
if (item.type === "relation") {
|
|
34
|
-
it.compositeId = item.id;
|
|
35
|
-
}
|
|
36
|
-
const list = {
|
|
37
|
-
type: item.type,
|
|
38
|
-
fieldId: it.id,
|
|
39
|
-
};
|
|
40
|
-
forType.push(list);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.setState({
|
|
45
|
-
selectWords,
|
|
46
|
-
forType
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
this.switchTemplate = () => {
|
|
51
|
-
const { menuId } = this.props;
|
|
52
|
-
this.handleVisibleChange(true);
|
|
53
|
-
Super.super({
|
|
54
|
-
url: `v2/menu/${menuId}/ltmpl/importer/tmpls/list`,
|
|
55
|
-
method: 'GET',
|
|
56
|
-
}).then((res) => {
|
|
57
|
-
if (res) {
|
|
58
|
-
this.setState({
|
|
59
|
-
modelList: res.tmpls,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
this.handelModel = (tmplId) => {
|
|
65
|
-
const { menuId } = this.props;
|
|
66
|
-
const { forType, selectWords } = this.state;
|
|
67
|
-
Super.super({
|
|
68
|
-
url: `v2/menu/${menuId}/ltmpl/importer/tmpls/detail`,
|
|
69
|
-
query: {
|
|
70
|
-
tmplId
|
|
71
|
-
},
|
|
72
|
-
method: 'GET',
|
|
73
|
-
}).then((res) => {
|
|
74
|
-
//console.log(res.tmpl.fields)
|
|
75
|
-
if (res) {
|
|
76
|
-
selectWords.forEach((item) => {
|
|
77
|
-
if (item.type === "normal") {
|
|
78
|
-
item.fields.forEach((it) => {
|
|
79
|
-
let check = false;
|
|
80
|
-
res.tmpl.fields.forEach((i) => {
|
|
81
|
-
if (i.fieldId === it.id) {
|
|
82
|
-
check = true;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
it.checked = check;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
let data = [];
|
|
90
|
-
let type = "";
|
|
91
|
-
res.tmpl.fields.forEach((item) => {
|
|
92
|
-
forType.forEach((it) => {
|
|
93
|
-
if (item.mStrucFieldGroupId === it.mStrucFieldGroupId) {
|
|
94
|
-
type = it.type;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
let list = {
|
|
98
|
-
key: item.title,
|
|
99
|
-
name: item.title,
|
|
100
|
-
words: item.title,
|
|
101
|
-
fieldId: item.mStrucFieldId,
|
|
102
|
-
compositeId: item.mStrucFieldGroup,
|
|
103
|
-
id: item.id,
|
|
104
|
-
fieldIndex: item.fieldIndex,
|
|
105
|
-
type,
|
|
106
|
-
};
|
|
107
|
-
if (item.mStrucFieldId !== null) {
|
|
108
|
-
list.totalname = item.title.split("[")[0];
|
|
109
|
-
}
|
|
110
|
-
data.push(list);
|
|
111
|
-
});
|
|
112
|
-
this.setState({
|
|
113
|
-
tmplId: res.tmpl.id,
|
|
114
|
-
dataSource: data,
|
|
115
|
-
title: res.tmpl.title,
|
|
116
|
-
listLength: res.tmpl.fields.length,
|
|
117
|
-
selectWords
|
|
118
|
-
});
|
|
119
|
-
this.handleVisibleChange(false);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
this.handleVisibleChange = (value) => {
|
|
124
|
-
this.setState({ visible: value });
|
|
125
|
-
};
|
|
126
|
-
this.handleSave = () => {
|
|
127
|
-
const { menuId } = this.props;
|
|
128
|
-
let { tmplId, title, dataSource } = this.state;
|
|
129
|
-
const fields = this.getFields(dataSource);
|
|
130
|
-
Super.super({
|
|
131
|
-
url: `v2/menu/${menuId}/ltmpl/importer/tmpls`,
|
|
132
|
-
method: 'POST',
|
|
133
|
-
data: JSON.stringify({
|
|
134
|
-
tmplId,
|
|
135
|
-
title,
|
|
136
|
-
fields,
|
|
137
|
-
})
|
|
138
|
-
}, 'json').then((res) => {
|
|
139
|
-
if (res && res.status === "success") {
|
|
140
|
-
message.success("保存成功!");
|
|
141
|
-
this.setState({
|
|
142
|
-
tmplId: res.tmplId,
|
|
143
|
-
listLength: dataSource.length,
|
|
144
|
-
dataSource,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
message.error("Units.forFile(保存!)");
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
this.visibleModal = () => {
|
|
153
|
-
const { title } = this.state;
|
|
154
|
-
const _this = this;
|
|
155
|
-
if (!title) {
|
|
156
|
-
message.error("请设置模板名称!");
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
this.getdatasource.getdata();
|
|
160
|
-
confirm({
|
|
161
|
-
title: "确定保存导入模板?",
|
|
162
|
-
okText: '确定',
|
|
163
|
-
okType: 'danger',
|
|
164
|
-
cancelText: '取消',
|
|
165
|
-
onOk() {
|
|
166
|
-
_this.handleSave();
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
this.handleDownload = () => {
|
|
171
|
-
const { tmplId, title, listLength, dataSource } = this.state;
|
|
172
|
-
if (dataSource.length !== listLength) {
|
|
173
|
-
message.info("请保存模板");
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken");
|
|
177
|
-
if (tmplId) {
|
|
178
|
-
confirm({
|
|
179
|
-
title: `确认下载`,
|
|
180
|
-
content: `当前模板[${title}],模板内共有${listLength}个字段`,
|
|
181
|
-
okText: '是的',
|
|
182
|
-
cancelText: '取消',
|
|
183
|
-
onOk() {
|
|
184
|
-
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken");
|
|
185
|
-
Units.downloadFile(`v2/importer/${tmplId}/excel?@token=${hydrocarbonToken}`);
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
message.info("请选择模板");
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
this.setModelName = (e) => {
|
|
194
|
-
this.setState({
|
|
195
|
-
title: e.target.value
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
this.deleteRow = (record) => {
|
|
199
|
-
let { dataSource, selectWords } = this.state;
|
|
200
|
-
dataSource.forEach((item, i) => {
|
|
201
|
-
if (item.key === record.key) {
|
|
202
|
-
dataSource.splice(i, 1);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
if (record.type === "normal") {
|
|
206
|
-
selectWords.forEach((item, i) => {
|
|
207
|
-
if (item.fields.length > 0) {
|
|
208
|
-
item.fields.forEach((it) => {
|
|
209
|
-
if (it.key === record.key) {
|
|
210
|
-
it.checked = false;
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
let len = [];
|
|
218
|
-
let labelarr = [];
|
|
219
|
-
let data = [];
|
|
220
|
-
dataSource.forEach((item) => {
|
|
221
|
-
if (item.mStrucFieldGroupId === record.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
222
|
-
len.push(item);
|
|
223
|
-
}
|
|
224
|
-
if (item.key.includes("label")) {
|
|
225
|
-
labelarr.push(item);
|
|
226
|
-
}
|
|
227
|
-
if (item.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
228
|
-
data.push(item);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
len.forEach((item, i) => {
|
|
232
|
-
const NM = `${record.totalname}[${i}].${record.name.split(".")[1]}`;
|
|
233
|
-
item.key = NM;
|
|
234
|
-
item.name = NM;
|
|
235
|
-
item.words = NM;
|
|
236
|
-
item.fieldIndex = i;
|
|
237
|
-
});
|
|
238
|
-
if (record.type === "relation") {
|
|
239
|
-
let dele = true;
|
|
240
|
-
data.forEach((item) => {
|
|
241
|
-
const dataTotal = item.key.split(".")[0];
|
|
242
|
-
const labelLastTotal = labelarr[labelarr.length - 1].key.split(".")[0];
|
|
243
|
-
if (dataTotal === labelLastTotal) {
|
|
244
|
-
dele = false;
|
|
245
|
-
}
|
|
246
|
-
labelarr[labelarr.length - 1].delete = dele;
|
|
247
|
-
});
|
|
248
|
-
if (data.length === 0) {
|
|
249
|
-
labelarr[labelarr.length - 1].delete = true;
|
|
250
|
-
}
|
|
251
|
-
dataSource.forEach((item, i) => {
|
|
252
|
-
if (item.delete) {
|
|
253
|
-
dataSource.splice(i, 1);
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
this.setState({
|
|
259
|
-
dataSource: Units.uniq(dataSource, "key"),
|
|
260
|
-
selectWords,
|
|
261
|
-
});
|
|
262
|
-
};
|
|
263
|
-
this.getWords = (list, type) => {
|
|
264
|
-
let { dataSource, selectWords } = this.state;
|
|
265
|
-
if (type === "normal") {
|
|
266
|
-
dataSource.push(list);
|
|
267
|
-
selectWords.forEach((item, i) => {
|
|
268
|
-
if (item.fields.length > 0 && item.type === "normal") {
|
|
269
|
-
item.fields.forEach((it) => {
|
|
270
|
-
if (it.id === list.fieldId) {
|
|
271
|
-
it.checked = true;
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
let len = [];
|
|
279
|
-
dataSource.forEach((item) => {
|
|
280
|
-
if (item.mStrucFieldGroupId === list.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
281
|
-
len.push(item);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
const NM = `${list.totalname}[${len.length}].${list.name}`;
|
|
285
|
-
const res = {
|
|
286
|
-
mStrucFieldGroupId: list.mStrucFieldGroupId,
|
|
287
|
-
key: NM,
|
|
288
|
-
name: NM,
|
|
289
|
-
words: NM,
|
|
290
|
-
totalname: list.totalname,
|
|
291
|
-
fieldIndex: len.length,
|
|
292
|
-
type: list.type,
|
|
293
|
-
};
|
|
294
|
-
if (type === "relation") {
|
|
295
|
-
const NLabel = `${list.totalname}[${len.length}].$$label$$`;
|
|
296
|
-
const labelRes = {
|
|
297
|
-
key: NLabel,
|
|
298
|
-
name: NLabel,
|
|
299
|
-
words: NLabel,
|
|
300
|
-
fieldIndex: len.length,
|
|
301
|
-
totalname: list.totalname,
|
|
302
|
-
compositeId: list.compositeId
|
|
303
|
-
};
|
|
304
|
-
dataSource.push(labelRes);
|
|
305
|
-
}
|
|
306
|
-
dataSource.push(res);
|
|
307
|
-
}
|
|
308
|
-
//console.log(dataSource)
|
|
309
|
-
this.setState({
|
|
310
|
-
dataSource: Units.uniq(dataSource, "key"),
|
|
311
|
-
selectWords,
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
this.getFields = (dataSource) => {
|
|
315
|
-
const fields = [];
|
|
316
|
-
dataSource.forEach((item) => {
|
|
317
|
-
const list = {};
|
|
318
|
-
if (item.fieldIndex !== null) {
|
|
319
|
-
list.fieldIndex = item.fieldIndex;
|
|
320
|
-
}
|
|
321
|
-
if (item.mStrucFieldGroupId) {
|
|
322
|
-
list.mStrucFieldGroupId = item.mStrucFieldGroupId;
|
|
323
|
-
}
|
|
324
|
-
if (item.mStrucFieldId) {
|
|
325
|
-
list.mStrucFieldId = item.mStrucFieldId;
|
|
326
|
-
}
|
|
327
|
-
if (item.id) {
|
|
328
|
-
list.id = item.id;
|
|
329
|
-
}
|
|
330
|
-
fields.push(list);
|
|
331
|
-
});
|
|
332
|
-
return fields;
|
|
333
|
-
};
|
|
334
|
-
this.onRef = (ref) => {
|
|
335
|
-
this.getdatasource = ref;
|
|
336
|
-
};
|
|
337
|
-
this.setdatasource = (data) => {
|
|
338
|
-
this.setState({
|
|
339
|
-
dataSource: data
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
this.resetForm = () => {
|
|
343
|
-
this.setState({
|
|
344
|
-
modelList: [],
|
|
345
|
-
title: "",
|
|
346
|
-
visible: false,
|
|
347
|
-
dataSource: [],
|
|
348
|
-
});
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
componentDidMount() {
|
|
352
|
-
const { menuId } = this.props;
|
|
353
|
-
this.loadWords(menuId);
|
|
354
|
-
}
|
|
355
|
-
render() {
|
|
356
|
-
const { visible, title, dataSource, selectWords, modelList, tmplId } = this.state;
|
|
357
|
-
const content = (React.createElement("div", null, modelList.map(item => React.createElement("div", { key: item.id, className: "modelList", onClick: () => this.handelModel(item.id) },
|
|
358
|
-
React.createElement("span", { className: tmplId === item.id ? "light" : "" },
|
|
359
|
-
React.createElement(BulbOutlined, null)),
|
|
360
|
-
React.createElement("p", { className: "tit" }, item.title),
|
|
361
|
-
React.createElement("p", null, Units.formateDate(item.createTime))))));
|
|
362
|
-
const columns = [{
|
|
363
|
-
title: '表头',
|
|
364
|
-
key: 'name',
|
|
365
|
-
width: 200,
|
|
366
|
-
dataIndex: "name"
|
|
367
|
-
}, {
|
|
368
|
-
title: '字段',
|
|
369
|
-
key: 'words',
|
|
370
|
-
width: 200,
|
|
371
|
-
dataIndex: "words"
|
|
372
|
-
}, {
|
|
373
|
-
title: '操作',
|
|
374
|
-
key: 'action',
|
|
375
|
-
render: (text, record) => (React.createElement(Button, { style: { display: record.key.includes("label") ? 'none' : 'block' }, size: 'small', type: "danger", onClick: () => this.deleteRow(record) },
|
|
376
|
-
React.createElement(DeleteOutlined, null))),
|
|
377
|
-
},];
|
|
378
|
-
return (React.createElement("div", { className: "selectModal" },
|
|
379
|
-
React.createElement("h3", null,
|
|
380
|
-
"\u5BFC\u5165\u6A21\u677F\u914D\u7F6E",
|
|
381
|
-
React.createElement("p", { className: "fr" },
|
|
382
|
-
React.createElement(Button, { className: "hoverbig", title: "\u65B0\u5EFA\u6A21\u677F", onClick: this.resetForm },
|
|
383
|
-
React.createElement(FileAddOutlined, null)),
|
|
384
|
-
React.createElement(Button, { className: "hoverbig", title: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F", onClick: this.handleDownload },
|
|
385
|
-
React.createElement(DownloadOutlined, null)),
|
|
386
|
-
React.createElement(Button, { className: "hoverbig", title: "\u4FDD\u5B58\u6A21\u677F", onClick: this.visibleModal },
|
|
387
|
-
React.createElement(SaveOutlined, null)),
|
|
388
|
-
React.createElement(Popover, { content: content, placement: "bottomRight", trigger: "click", open: visible, onVisibleChange: this.handleVisibleChange },
|
|
389
|
-
React.createElement(Button, { className: "hoverbig", title: "\u5207\u6362\u6A21\u677F", onClick: this.switchTemplate },
|
|
390
|
-
React.createElement(SnippetsOutlined, null))))),
|
|
391
|
-
React.createElement("div", { style: { marginBottom: 20 } },
|
|
392
|
-
"\u6A21\u677F\u540D\u79F0\uFF1A",
|
|
393
|
-
React.createElement(Input, { placeholder: "\u8F93\u5165\u5BFC\u5165\u6A21\u677F\u540D\u79F0", style: { width: 200 }, value: title, onChange: this.setModelName })),
|
|
394
|
-
React.createElement("div", { className: "table" },
|
|
395
|
-
React.createElement(DragTable, { columns: columns, dataSource: dataSource, onRef: this.onRef, setdatasource: this.setdatasource, size: "small" })),
|
|
396
|
-
selectWords ? React.createElement(Collapse, { accordion: true, style: { float: "right" } }, selectWords.map((item) => {
|
|
397
|
-
if (item.fields.length > 0) {
|
|
398
|
-
return React.createElement(Panel, { header: item.name, key: item.id }, item.fields.map(it => React.createElement(MyTag, { key: it.name, id: it.id, name: it.name, checked: it.checked, getwords: this.getWords, type: item.type, totalname: item.name, compositeid: it.compositeId }, it.name)));
|
|
399
|
-
}
|
|
400
|
-
return false;
|
|
401
|
-
})) : ""));
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
class MyTag extends React.Component {
|
|
405
|
-
constructor() {
|
|
406
|
-
super(...arguments);
|
|
407
|
-
this.handleChange = (id, name) => {
|
|
408
|
-
const { type, totalname, compositeid } = this.props;
|
|
409
|
-
const list = {
|
|
410
|
-
key: name,
|
|
411
|
-
fieldId: id,
|
|
412
|
-
name: name,
|
|
413
|
-
words: name,
|
|
414
|
-
totalname,
|
|
415
|
-
type,
|
|
416
|
-
compositeId: compositeid
|
|
417
|
-
};
|
|
418
|
-
this.props.getwords(list, type);
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
render() {
|
|
422
|
-
const { name, id, checked } = this.props;
|
|
423
|
-
return (React.createElement(CheckableTag, Object.assign({}, this.props, { onChange: () => this.handleChange(id, name), className: checked ? "" : "borderTag" })));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Super from "../tmpl/superagent";
|
|
3
|
+
import Units from "../units";
|
|
4
|
+
import { Button, Popover, Input, Modal, message, Collapse, Tag } from 'antd';
|
|
5
|
+
import { BulbOutlined, DeleteOutlined, FileAddOutlined, DownloadOutlined, SaveOutlined, SnippetsOutlined } from '@ant-design/icons';
|
|
6
|
+
import DragTable from '../drag-table';
|
|
7
|
+
import './index.css';
|
|
8
|
+
const { confirm } = Modal;
|
|
9
|
+
const { Panel } = Collapse;
|
|
10
|
+
const { CheckableTag } = Tag;
|
|
11
|
+
export default class ModelImport extends React.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.state = {
|
|
15
|
+
modelList: [],
|
|
16
|
+
title: "",
|
|
17
|
+
visible: false,
|
|
18
|
+
dataSource: [],
|
|
19
|
+
};
|
|
20
|
+
this.loadWords = (menuId) => {
|
|
21
|
+
Super.super({
|
|
22
|
+
url: `v2/menu/${menuId}/ltmpl/importer/dict`,
|
|
23
|
+
method: 'GET',
|
|
24
|
+
}).then((res) => {
|
|
25
|
+
let selectWords = res.fieldDictionary.composites;
|
|
26
|
+
//console.log(selectWords)
|
|
27
|
+
const forType = [];
|
|
28
|
+
selectWords.forEach((item) => {
|
|
29
|
+
if (item.fields.length > 0) {
|
|
30
|
+
item.fields.forEach((it) => {
|
|
31
|
+
it.checked = false;
|
|
32
|
+
it.key = it.name;
|
|
33
|
+
if (item.type === "relation") {
|
|
34
|
+
it.compositeId = item.id;
|
|
35
|
+
}
|
|
36
|
+
const list = {
|
|
37
|
+
type: item.type,
|
|
38
|
+
fieldId: it.id,
|
|
39
|
+
};
|
|
40
|
+
forType.push(list);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.setState({
|
|
45
|
+
selectWords,
|
|
46
|
+
forType
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
this.switchTemplate = () => {
|
|
51
|
+
const { menuId } = this.props;
|
|
52
|
+
this.handleVisibleChange(true);
|
|
53
|
+
Super.super({
|
|
54
|
+
url: `v2/menu/${menuId}/ltmpl/importer/tmpls/list`,
|
|
55
|
+
method: 'GET',
|
|
56
|
+
}).then((res) => {
|
|
57
|
+
if (res) {
|
|
58
|
+
this.setState({
|
|
59
|
+
modelList: res.tmpls,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
this.handelModel = (tmplId) => {
|
|
65
|
+
const { menuId } = this.props;
|
|
66
|
+
const { forType, selectWords } = this.state;
|
|
67
|
+
Super.super({
|
|
68
|
+
url: `v2/menu/${menuId}/ltmpl/importer/tmpls/detail`,
|
|
69
|
+
query: {
|
|
70
|
+
tmplId
|
|
71
|
+
},
|
|
72
|
+
method: 'GET',
|
|
73
|
+
}).then((res) => {
|
|
74
|
+
//console.log(res.tmpl.fields)
|
|
75
|
+
if (res) {
|
|
76
|
+
selectWords.forEach((item) => {
|
|
77
|
+
if (item.type === "normal") {
|
|
78
|
+
item.fields.forEach((it) => {
|
|
79
|
+
let check = false;
|
|
80
|
+
res.tmpl.fields.forEach((i) => {
|
|
81
|
+
if (i.fieldId === it.id) {
|
|
82
|
+
check = true;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
it.checked = check;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
let data = [];
|
|
90
|
+
let type = "";
|
|
91
|
+
res.tmpl.fields.forEach((item) => {
|
|
92
|
+
forType.forEach((it) => {
|
|
93
|
+
if (item.mStrucFieldGroupId === it.mStrucFieldGroupId) {
|
|
94
|
+
type = it.type;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
let list = {
|
|
98
|
+
key: item.title,
|
|
99
|
+
name: item.title,
|
|
100
|
+
words: item.title,
|
|
101
|
+
fieldId: item.mStrucFieldId,
|
|
102
|
+
compositeId: item.mStrucFieldGroup,
|
|
103
|
+
id: item.id,
|
|
104
|
+
fieldIndex: item.fieldIndex,
|
|
105
|
+
type,
|
|
106
|
+
};
|
|
107
|
+
if (item.mStrucFieldId !== null) {
|
|
108
|
+
list.totalname = item.title.split("[")[0];
|
|
109
|
+
}
|
|
110
|
+
data.push(list);
|
|
111
|
+
});
|
|
112
|
+
this.setState({
|
|
113
|
+
tmplId: res.tmpl.id,
|
|
114
|
+
dataSource: data,
|
|
115
|
+
title: res.tmpl.title,
|
|
116
|
+
listLength: res.tmpl.fields.length,
|
|
117
|
+
selectWords
|
|
118
|
+
});
|
|
119
|
+
this.handleVisibleChange(false);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
this.handleVisibleChange = (value) => {
|
|
124
|
+
this.setState({ visible: value });
|
|
125
|
+
};
|
|
126
|
+
this.handleSave = () => {
|
|
127
|
+
const { menuId } = this.props;
|
|
128
|
+
let { tmplId, title, dataSource } = this.state;
|
|
129
|
+
const fields = this.getFields(dataSource);
|
|
130
|
+
Super.super({
|
|
131
|
+
url: `v2/menu/${menuId}/ltmpl/importer/tmpls`,
|
|
132
|
+
method: 'POST',
|
|
133
|
+
data: JSON.stringify({
|
|
134
|
+
tmplId,
|
|
135
|
+
title,
|
|
136
|
+
fields,
|
|
137
|
+
})
|
|
138
|
+
}, 'json').then((res) => {
|
|
139
|
+
if (res && res.status === "success") {
|
|
140
|
+
message.success("保存成功!");
|
|
141
|
+
this.setState({
|
|
142
|
+
tmplId: res.tmplId,
|
|
143
|
+
listLength: dataSource.length,
|
|
144
|
+
dataSource,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
message.error("Units.forFile(保存!)");
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
this.visibleModal = () => {
|
|
153
|
+
const { title } = this.state;
|
|
154
|
+
const _this = this;
|
|
155
|
+
if (!title) {
|
|
156
|
+
message.error("请设置模板名称!");
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.getdatasource.getdata();
|
|
160
|
+
confirm({
|
|
161
|
+
title: "确定保存导入模板?",
|
|
162
|
+
okText: '确定',
|
|
163
|
+
okType: 'danger',
|
|
164
|
+
cancelText: '取消',
|
|
165
|
+
onOk() {
|
|
166
|
+
_this.handleSave();
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
this.handleDownload = () => {
|
|
171
|
+
const { tmplId, title, listLength, dataSource } = this.state;
|
|
172
|
+
if (dataSource.length !== listLength) {
|
|
173
|
+
message.info("请保存模板");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken");
|
|
177
|
+
if (tmplId) {
|
|
178
|
+
confirm({
|
|
179
|
+
title: `确认下载`,
|
|
180
|
+
content: `当前模板[${title}],模板内共有${listLength}个字段`,
|
|
181
|
+
okText: '是的',
|
|
182
|
+
cancelText: '取消',
|
|
183
|
+
onOk() {
|
|
184
|
+
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken");
|
|
185
|
+
Units.downloadFile(`v2/importer/${tmplId}/excel?@token=${hydrocarbonToken}`);
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
message.info("请选择模板");
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
this.setModelName = (e) => {
|
|
194
|
+
this.setState({
|
|
195
|
+
title: e.target.value
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
this.deleteRow = (record) => {
|
|
199
|
+
let { dataSource, selectWords } = this.state;
|
|
200
|
+
dataSource.forEach((item, i) => {
|
|
201
|
+
if (item.key === record.key) {
|
|
202
|
+
dataSource.splice(i, 1);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
if (record.type === "normal") {
|
|
206
|
+
selectWords.forEach((item, i) => {
|
|
207
|
+
if (item.fields.length > 0) {
|
|
208
|
+
item.fields.forEach((it) => {
|
|
209
|
+
if (it.key === record.key) {
|
|
210
|
+
it.checked = false;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
let len = [];
|
|
218
|
+
let labelarr = [];
|
|
219
|
+
let data = [];
|
|
220
|
+
dataSource.forEach((item) => {
|
|
221
|
+
if (item.mStrucFieldGroupId === record.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
222
|
+
len.push(item);
|
|
223
|
+
}
|
|
224
|
+
if (item.key.includes("label")) {
|
|
225
|
+
labelarr.push(item);
|
|
226
|
+
}
|
|
227
|
+
if (item.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
228
|
+
data.push(item);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
len.forEach((item, i) => {
|
|
232
|
+
const NM = `${record.totalname}[${i}].${record.name.split(".")[1]}`;
|
|
233
|
+
item.key = NM;
|
|
234
|
+
item.name = NM;
|
|
235
|
+
item.words = NM;
|
|
236
|
+
item.fieldIndex = i;
|
|
237
|
+
});
|
|
238
|
+
if (record.type === "relation") {
|
|
239
|
+
let dele = true;
|
|
240
|
+
data.forEach((item) => {
|
|
241
|
+
const dataTotal = item.key.split(".")[0];
|
|
242
|
+
const labelLastTotal = labelarr[labelarr.length - 1].key.split(".")[0];
|
|
243
|
+
if (dataTotal === labelLastTotal) {
|
|
244
|
+
dele = false;
|
|
245
|
+
}
|
|
246
|
+
labelarr[labelarr.length - 1].delete = dele;
|
|
247
|
+
});
|
|
248
|
+
if (data.length === 0) {
|
|
249
|
+
labelarr[labelarr.length - 1].delete = true;
|
|
250
|
+
}
|
|
251
|
+
dataSource.forEach((item, i) => {
|
|
252
|
+
if (item.delete) {
|
|
253
|
+
dataSource.splice(i, 1);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.setState({
|
|
259
|
+
dataSource: Units.uniq(dataSource, "key"),
|
|
260
|
+
selectWords,
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
this.getWords = (list, type) => {
|
|
264
|
+
let { dataSource, selectWords } = this.state;
|
|
265
|
+
if (type === "normal") {
|
|
266
|
+
dataSource.push(list);
|
|
267
|
+
selectWords.forEach((item, i) => {
|
|
268
|
+
if (item.fields.length > 0 && item.type === "normal") {
|
|
269
|
+
item.fields.forEach((it) => {
|
|
270
|
+
if (it.id === list.fieldId) {
|
|
271
|
+
it.checked = true;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
let len = [];
|
|
279
|
+
dataSource.forEach((item) => {
|
|
280
|
+
if (item.mStrucFieldGroupId === list.mStrucFieldGroupId && !item.key.includes("label")) {
|
|
281
|
+
len.push(item);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
const NM = `${list.totalname}[${len.length}].${list.name}`;
|
|
285
|
+
const res = {
|
|
286
|
+
mStrucFieldGroupId: list.mStrucFieldGroupId,
|
|
287
|
+
key: NM,
|
|
288
|
+
name: NM,
|
|
289
|
+
words: NM,
|
|
290
|
+
totalname: list.totalname,
|
|
291
|
+
fieldIndex: len.length,
|
|
292
|
+
type: list.type,
|
|
293
|
+
};
|
|
294
|
+
if (type === "relation") {
|
|
295
|
+
const NLabel = `${list.totalname}[${len.length}].$$label$$`;
|
|
296
|
+
const labelRes = {
|
|
297
|
+
key: NLabel,
|
|
298
|
+
name: NLabel,
|
|
299
|
+
words: NLabel,
|
|
300
|
+
fieldIndex: len.length,
|
|
301
|
+
totalname: list.totalname,
|
|
302
|
+
compositeId: list.compositeId
|
|
303
|
+
};
|
|
304
|
+
dataSource.push(labelRes);
|
|
305
|
+
}
|
|
306
|
+
dataSource.push(res);
|
|
307
|
+
}
|
|
308
|
+
//console.log(dataSource)
|
|
309
|
+
this.setState({
|
|
310
|
+
dataSource: Units.uniq(dataSource, "key"),
|
|
311
|
+
selectWords,
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
this.getFields = (dataSource) => {
|
|
315
|
+
const fields = [];
|
|
316
|
+
dataSource.forEach((item) => {
|
|
317
|
+
const list = {};
|
|
318
|
+
if (item.fieldIndex !== null) {
|
|
319
|
+
list.fieldIndex = item.fieldIndex;
|
|
320
|
+
}
|
|
321
|
+
if (item.mStrucFieldGroupId) {
|
|
322
|
+
list.mStrucFieldGroupId = item.mStrucFieldGroupId;
|
|
323
|
+
}
|
|
324
|
+
if (item.mStrucFieldId) {
|
|
325
|
+
list.mStrucFieldId = item.mStrucFieldId;
|
|
326
|
+
}
|
|
327
|
+
if (item.id) {
|
|
328
|
+
list.id = item.id;
|
|
329
|
+
}
|
|
330
|
+
fields.push(list);
|
|
331
|
+
});
|
|
332
|
+
return fields;
|
|
333
|
+
};
|
|
334
|
+
this.onRef = (ref) => {
|
|
335
|
+
this.getdatasource = ref;
|
|
336
|
+
};
|
|
337
|
+
this.setdatasource = (data) => {
|
|
338
|
+
this.setState({
|
|
339
|
+
dataSource: data
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
this.resetForm = () => {
|
|
343
|
+
this.setState({
|
|
344
|
+
modelList: [],
|
|
345
|
+
title: "",
|
|
346
|
+
visible: false,
|
|
347
|
+
dataSource: [],
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
componentDidMount() {
|
|
352
|
+
const { menuId } = this.props;
|
|
353
|
+
this.loadWords(menuId);
|
|
354
|
+
}
|
|
355
|
+
render() {
|
|
356
|
+
const { visible, title, dataSource, selectWords, modelList, tmplId } = this.state;
|
|
357
|
+
const content = (React.createElement("div", null, modelList.map(item => React.createElement("div", { key: item.id, className: "modelList", onClick: () => this.handelModel(item.id) },
|
|
358
|
+
React.createElement("span", { className: tmplId === item.id ? "light" : "" },
|
|
359
|
+
React.createElement(BulbOutlined, null)),
|
|
360
|
+
React.createElement("p", { className: "tit" }, item.title),
|
|
361
|
+
React.createElement("p", null, Units.formateDate(item.createTime))))));
|
|
362
|
+
const columns = [{
|
|
363
|
+
title: '表头',
|
|
364
|
+
key: 'name',
|
|
365
|
+
width: 200,
|
|
366
|
+
dataIndex: "name"
|
|
367
|
+
}, {
|
|
368
|
+
title: '字段',
|
|
369
|
+
key: 'words',
|
|
370
|
+
width: 200,
|
|
371
|
+
dataIndex: "words"
|
|
372
|
+
}, {
|
|
373
|
+
title: '操作',
|
|
374
|
+
key: 'action',
|
|
375
|
+
render: (text, record) => (React.createElement(Button, { style: { display: record.key.includes("label") ? 'none' : 'block' }, size: 'small', type: "danger", onClick: () => this.deleteRow(record) },
|
|
376
|
+
React.createElement(DeleteOutlined, null))),
|
|
377
|
+
},];
|
|
378
|
+
return (React.createElement("div", { className: "selectModal" },
|
|
379
|
+
React.createElement("h3", null,
|
|
380
|
+
"\u5BFC\u5165\u6A21\u677F\u914D\u7F6E",
|
|
381
|
+
React.createElement("p", { className: "fr" },
|
|
382
|
+
React.createElement(Button, { className: "hoverbig", title: "\u65B0\u5EFA\u6A21\u677F", onClick: this.resetForm },
|
|
383
|
+
React.createElement(FileAddOutlined, null)),
|
|
384
|
+
React.createElement(Button, { className: "hoverbig", title: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F", onClick: this.handleDownload },
|
|
385
|
+
React.createElement(DownloadOutlined, null)),
|
|
386
|
+
React.createElement(Button, { className: "hoverbig", title: "\u4FDD\u5B58\u6A21\u677F", onClick: this.visibleModal },
|
|
387
|
+
React.createElement(SaveOutlined, null)),
|
|
388
|
+
React.createElement(Popover, { content: content, placement: "bottomRight", trigger: "click", open: visible, onVisibleChange: this.handleVisibleChange },
|
|
389
|
+
React.createElement(Button, { className: "hoverbig", title: "\u5207\u6362\u6A21\u677F", onClick: this.switchTemplate },
|
|
390
|
+
React.createElement(SnippetsOutlined, null))))),
|
|
391
|
+
React.createElement("div", { style: { marginBottom: 20 } },
|
|
392
|
+
"\u6A21\u677F\u540D\u79F0\uFF1A",
|
|
393
|
+
React.createElement(Input, { placeholder: "\u8F93\u5165\u5BFC\u5165\u6A21\u677F\u540D\u79F0", style: { width: 200 }, value: title, onChange: this.setModelName })),
|
|
394
|
+
React.createElement("div", { className: "table" },
|
|
395
|
+
React.createElement(DragTable, { columns: columns, dataSource: dataSource, onRef: this.onRef, setdatasource: this.setdatasource, size: "small" })),
|
|
396
|
+
selectWords ? React.createElement(Collapse, { accordion: true, style: { float: "right" } }, selectWords.map((item) => {
|
|
397
|
+
if (item.fields.length > 0) {
|
|
398
|
+
return React.createElement(Panel, { header: item.name, key: item.id }, item.fields.map(it => React.createElement(MyTag, { key: it.name, id: it.id, name: it.name, checked: it.checked, getwords: this.getWords, type: item.type, totalname: item.name, compositeid: it.compositeId }, it.name)));
|
|
399
|
+
}
|
|
400
|
+
return false;
|
|
401
|
+
})) : ""));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
class MyTag extends React.Component {
|
|
405
|
+
constructor() {
|
|
406
|
+
super(...arguments);
|
|
407
|
+
this.handleChange = (id, name) => {
|
|
408
|
+
const { type, totalname, compositeid } = this.props;
|
|
409
|
+
const list = {
|
|
410
|
+
key: name,
|
|
411
|
+
fieldId: id,
|
|
412
|
+
name: name,
|
|
413
|
+
words: name,
|
|
414
|
+
totalname,
|
|
415
|
+
type,
|
|
416
|
+
compositeId: compositeid
|
|
417
|
+
};
|
|
418
|
+
this.props.getwords(list, type);
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
render() {
|
|
422
|
+
const { name, id, checked } = this.props;
|
|
423
|
+
return (React.createElement(CheckableTag, Object.assign({}, this.props, { onChange: () => this.handleChange(id, name), className: checked ? "" : "borderTag" })));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
426
|
//# sourceMappingURL=template-builder.js.map
|