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,1590 +1,1590 @@
|
|
|
1
|
-
import Units from "../units";
|
|
2
|
-
import Super from "./superagent";
|
|
3
|
-
|
|
4
|
-
import { message } from "antd";
|
|
5
|
-
import EncryptUtils from "../units/EncryptUtils";
|
|
6
|
-
import "dayjs/locale/en";
|
|
7
|
-
import dayjs from "dayjs";
|
|
8
|
-
import utc from "dayjs/plugin/utc";
|
|
9
|
-
import timezone from "dayjs/plugin/timezone";
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
CodeSource, CommonFilePath,
|
|
13
|
-
DtmplConfig,
|
|
14
|
-
MenuConfigAPIType,
|
|
15
|
-
PageInfo,
|
|
16
|
-
SelectedRow,
|
|
17
|
-
} from "./interface";
|
|
18
|
-
|
|
19
|
-
import { ProgramConfig } from "../index";
|
|
20
|
-
import translate from "../locale/translate";
|
|
21
|
-
|
|
22
|
-
dayjs.extend(utc);
|
|
23
|
-
dayjs.extend(timezone);
|
|
24
|
-
|
|
25
|
-
export default class HcserviceV3 {
|
|
26
|
-
static async requestEnum(serverKey: string, mstrucIds, path: string) {
|
|
27
|
-
if (!path) {
|
|
28
|
-
return await this.requestEnumWithPath(serverKey, mstrucIds, "/enum");
|
|
29
|
-
} else {
|
|
30
|
-
return await this.requestEnumWithPath(serverKey, mstrucIds, path);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static getJsonValue = (file) => {
|
|
35
|
-
let jsonFile = file;
|
|
36
|
-
if (!file) {
|
|
37
|
-
return undefined;
|
|
38
|
-
} else if (typeof (file) == 'string') {
|
|
39
|
-
jsonFile = JSON.parse(file);
|
|
40
|
-
}
|
|
41
|
-
return jsonFile;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static toFilePath(value, serverKey) {
|
|
45
|
-
if (!value) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
let filePath: CommonFilePath = {};
|
|
49
|
-
if (typeof (value) == 'string') {
|
|
50
|
-
if (value.toLowerCase().startsWith("http")) {
|
|
51
|
-
filePath.path = value;
|
|
52
|
-
filePath.fileName = this.getFileNameFrom(value);
|
|
53
|
-
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
54
|
-
} else if (value.toLowerCase().startsWith("/")) {
|
|
55
|
-
filePath.path = this.getFileUrl(serverKey, value);
|
|
56
|
-
filePath.fileName = this.getFileNameFrom(value);
|
|
57
|
-
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
58
|
-
} else {
|
|
59
|
-
let jsonValue = this.getJsonValue(value);
|
|
60
|
-
filePath = this.toFilePathObject(jsonValue, serverKey);
|
|
61
|
-
}
|
|
62
|
-
} else if (value.base) {
|
|
63
|
-
filePath = this.toFilePathObject(value, serverKey);
|
|
64
|
-
}
|
|
65
|
-
return filePath;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
static toFilePathObject(jsonValue, serverKey: string) {
|
|
69
|
-
let filePath: any = {};
|
|
70
|
-
if (jsonValue) {
|
|
71
|
-
filePath.path = this.getFileUrl(serverKey, jsonValue.base?.path);
|
|
72
|
-
filePath.iconPath = jsonValue.icon?.path ? this.getFileUrl(serverKey, jsonValue.icon?.path) : null;
|
|
73
|
-
filePath.fileName = jsonValue.fileName ? jsonValue.fileName : this.getFileNameFrom(jsonValue.base?.path);
|
|
74
|
-
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
75
|
-
filePath.valid = jsonValue.valid;
|
|
76
|
-
filePath.baseType = jsonValue.base?.type;
|
|
77
|
-
filePath.basePath = jsonValue.base?.path;
|
|
78
|
-
return filePath;
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
static async requestEnumWithPath(serverKey: string, mstrucIds, path) {
|
|
84
|
-
if (mstrucIds.length > 0) {
|
|
85
|
-
let res = await Super.super({
|
|
86
|
-
url: Units.joinPath("/v3", path),
|
|
87
|
-
serverKey,
|
|
88
|
-
data: {
|
|
89
|
-
mstrucIds,
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
return res.enumMap;
|
|
93
|
-
} else {
|
|
94
|
-
return {};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static async requestOptions(serverKey: string, mstrucId) {
|
|
99
|
-
//有下拉菜单时,请求下拉选项操作
|
|
100
|
-
return await this.requestEnum(serverKey, [mstrucId], null);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
static async requestDtmplConfig(
|
|
104
|
-
serverKey: string,
|
|
105
|
-
sourceId: string,
|
|
106
|
-
code: string
|
|
107
|
-
) {
|
|
108
|
-
let url = `/v3/dtmpl/config`;
|
|
109
|
-
let res = await Super.super({
|
|
110
|
-
url,
|
|
111
|
-
serverKey,
|
|
112
|
-
method: "GET",
|
|
113
|
-
query: { sourceId, code },
|
|
114
|
-
});
|
|
115
|
-
return res.dtmplConfig;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static async requestTtmplConfig(serverKey: string, sourceId: string) {
|
|
119
|
-
let url = `/v3/ttmpl/config`;
|
|
120
|
-
let res = await Super.super({
|
|
121
|
-
url,
|
|
122
|
-
serverKey,
|
|
123
|
-
method: "GET",
|
|
124
|
-
query: { sourceId },
|
|
125
|
-
});
|
|
126
|
-
return res.ttmplConfig;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
static async requestViewDtmplConfig(serverKey: string, sourceId: string) {
|
|
130
|
-
let url = `/v3/view-dtmpl/config`;
|
|
131
|
-
let res = await Super.super({
|
|
132
|
-
url,
|
|
133
|
-
serverKey,
|
|
134
|
-
method: "GET",
|
|
135
|
-
query: { sourceId },
|
|
136
|
-
});
|
|
137
|
-
return res.dtmplConfig;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
static async requestAddDtmplConfig(
|
|
141
|
-
serverKey: string,
|
|
142
|
-
sourceId: string,
|
|
143
|
-
addTmplId: string
|
|
144
|
-
) {
|
|
145
|
-
let url = `/v3/add-dtmpl/config`;
|
|
146
|
-
let res = await Super.super({
|
|
147
|
-
url,
|
|
148
|
-
serverKey,
|
|
149
|
-
method: "GET",
|
|
150
|
-
query: { sourceId, addTmplId },
|
|
151
|
-
});
|
|
152
|
-
return res.dtmplConfig;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
static async requestSelectConfig(serverKey: string, sourceId) {
|
|
156
|
-
let url = `/v3/select/config`;
|
|
157
|
-
let res = await Super.super({
|
|
158
|
-
url,
|
|
159
|
-
serverKey,
|
|
160
|
-
method: "GET",
|
|
161
|
-
query: { sourceId },
|
|
162
|
-
});
|
|
163
|
-
return res.selectConfig;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
static async requestLtmplConfig(serverKey: string, sourceId: string) {
|
|
167
|
-
let url = `/v3/ltmpl/config`;
|
|
168
|
-
let res = await Super.super({
|
|
169
|
-
url,
|
|
170
|
-
serverKey,
|
|
171
|
-
method: "GET",
|
|
172
|
-
query: { sourceId },
|
|
173
|
-
});
|
|
174
|
-
return res;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
static async requestL2LtmplConfig(serverKey: string, sourceId) {
|
|
178
|
-
let url = `/v3/l2/ltmpl/config`;
|
|
179
|
-
let res = await Super.super({
|
|
180
|
-
url,
|
|
181
|
-
serverKey,
|
|
182
|
-
method: "GET",
|
|
183
|
-
query: { sourceId },
|
|
184
|
-
});
|
|
185
|
-
return res;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
static async requestLtmplQueryKey(
|
|
189
|
-
serverKey: string,
|
|
190
|
-
sourceId: string,
|
|
191
|
-
condition?
|
|
192
|
-
) {
|
|
193
|
-
//console.log('condition:',condition);
|
|
194
|
-
let url = `/v3/ltmpl/query/key`;
|
|
195
|
-
let res = await Super.super({
|
|
196
|
-
url: url,
|
|
197
|
-
serverKey,
|
|
198
|
-
method: "GET",
|
|
199
|
-
query: { ...condition, sourceId },
|
|
200
|
-
});
|
|
201
|
-
return res;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
static async requestGttRootQueryKey(
|
|
205
|
-
serverKey: string,
|
|
206
|
-
sourceId: string,
|
|
207
|
-
condition?
|
|
208
|
-
) {
|
|
209
|
-
let url = `/v3/gtt/root-query/key`;
|
|
210
|
-
let res = await Super.super({
|
|
211
|
-
url: url,
|
|
212
|
-
serverKey,
|
|
213
|
-
method: "GET",
|
|
214
|
-
query: { ...condition, sourceId },
|
|
215
|
-
});
|
|
216
|
-
return res;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
static async requestLtmplQueryTop(
|
|
220
|
-
serverKey: string,
|
|
221
|
-
sourceId: string,
|
|
222
|
-
condition
|
|
223
|
-
) {
|
|
224
|
-
// console.log('condition:',condition);
|
|
225
|
-
let url = `/v3/ltmpl/top-data`;
|
|
226
|
-
return await this.requestCommonLtmplQueryTop(
|
|
227
|
-
serverKey,
|
|
228
|
-
sourceId,
|
|
229
|
-
condition,
|
|
230
|
-
url
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
static async requestQueryReportData(
|
|
235
|
-
serverKey: string,
|
|
236
|
-
queryKey: string, language: string
|
|
237
|
-
) {
|
|
238
|
-
let url = "/v3/ltmpl/report-data";
|
|
239
|
-
let res = await Super.super({
|
|
240
|
-
url: url,
|
|
241
|
-
serverKey,
|
|
242
|
-
method: "GET",
|
|
243
|
-
query: { queryKey, language },
|
|
244
|
-
});
|
|
245
|
-
return res;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
static async requestTtmplRootData(
|
|
249
|
-
serverKey: string,
|
|
250
|
-
sourceId: string,
|
|
251
|
-
condition
|
|
252
|
-
) {
|
|
253
|
-
let url = `/v3/ttmpl/root-data`;
|
|
254
|
-
return await this.requestCommonLtmplQueryTop(
|
|
255
|
-
serverKey,
|
|
256
|
-
sourceId,
|
|
257
|
-
condition,
|
|
258
|
-
url
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
static async requestMstrucLtmplQueryTop(
|
|
263
|
-
serverKey: string,
|
|
264
|
-
sourceId: string,
|
|
265
|
-
condition
|
|
266
|
-
) {
|
|
267
|
-
//console.log('condition:',condition);
|
|
268
|
-
let url = `/v3/mstruc/ltmpl/top-data`;
|
|
269
|
-
return await this.requestCommonLtmplQueryTop(
|
|
270
|
-
serverKey,
|
|
271
|
-
sourceId,
|
|
272
|
-
condition,
|
|
273
|
-
url
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
static async queryTop1(serverKey: string, sourceId: string) {
|
|
278
|
-
let data = await this.requestMstrucLtmplQueryTop(serverKey, sourceId, {
|
|
279
|
-
top: 1,
|
|
280
|
-
});
|
|
281
|
-
let queriedCode = null;
|
|
282
|
-
if (data && data.entities && data.entities[0]) {
|
|
283
|
-
queriedCode = data.entities[0].code;
|
|
284
|
-
}
|
|
285
|
-
return queriedCode;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
static async requestCommonLtmplQueryTop(
|
|
289
|
-
serverKey: string,
|
|
290
|
-
sourceId: string,
|
|
291
|
-
condition,
|
|
292
|
-
url
|
|
293
|
-
) {
|
|
294
|
-
if (!sourceId) {
|
|
295
|
-
message.error("SourceId is undefined!", 5);
|
|
296
|
-
} else {
|
|
297
|
-
let res = await Super.super({
|
|
298
|
-
url: url,
|
|
299
|
-
serverKey,
|
|
300
|
-
method: "GET",
|
|
301
|
-
query: { ...condition, sourceId },
|
|
302
|
-
});
|
|
303
|
-
return res;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
static async requestSelectedData(serverKey: string, sourceId: string, codes) {
|
|
308
|
-
if (!codes) {
|
|
309
|
-
message.warning(translate("${没有选择实体}"));
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
let url = `/v3/field-group/data/selected`;
|
|
313
|
-
|
|
314
|
-
let res = await Super.super({
|
|
315
|
-
url: url,
|
|
316
|
-
serverKey,
|
|
317
|
-
query: { codes, sourceId },
|
|
318
|
-
method: "GET",
|
|
319
|
-
});
|
|
320
|
-
if (res.status === "success") {
|
|
321
|
-
return res.entities;
|
|
322
|
-
} else {
|
|
323
|
-
message.error(translate("${没有找到实体}!"), 5);
|
|
324
|
-
return null;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
static isForeignLanguageMode() {
|
|
329
|
-
if (translate("${保存}") == "保存") {
|
|
330
|
-
return false;
|
|
331
|
-
} else {
|
|
332
|
-
return true;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
static async requestVersionList(serverKey: string, sourceId: string, code, pageNo?: number) {
|
|
337
|
-
let res = await Super.super({
|
|
338
|
-
url: `/v3/dtmpl/data/versions`,
|
|
339
|
-
serverKey,
|
|
340
|
-
query: {
|
|
341
|
-
pageNo: pageNo ? pageNo : 1,
|
|
342
|
-
sourceId,
|
|
343
|
-
code,
|
|
344
|
-
},
|
|
345
|
-
method: "GET",
|
|
346
|
-
});
|
|
347
|
-
return res.versions;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
static async requestFieldVersionList(
|
|
351
|
-
serverKey: string,
|
|
352
|
-
sourceId: string,
|
|
353
|
-
code
|
|
354
|
-
) {
|
|
355
|
-
let res = await Super.super({
|
|
356
|
-
url: `/v3/dtmpl/field-data/versions`,
|
|
357
|
-
serverKey,
|
|
358
|
-
query: {
|
|
359
|
-
pageNo: 1,
|
|
360
|
-
sourceId,
|
|
361
|
-
code,
|
|
362
|
-
},
|
|
363
|
-
method: "GET",
|
|
364
|
-
});
|
|
365
|
-
return res.versions;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
static async requestCommonDtmplData(
|
|
369
|
-
serverKey: string,
|
|
370
|
-
sourceId: string,
|
|
371
|
-
code,
|
|
372
|
-
versionId,
|
|
373
|
-
url
|
|
374
|
-
) {
|
|
375
|
-
let res = await Super.super({
|
|
376
|
-
url,
|
|
377
|
-
serverKey,
|
|
378
|
-
query: {
|
|
379
|
-
code,
|
|
380
|
-
versionId,
|
|
381
|
-
sourceId,
|
|
382
|
-
},
|
|
383
|
-
method: "GET",
|
|
384
|
-
});
|
|
385
|
-
if (res?.status === "success") {
|
|
386
|
-
return { sourceId, ...res.entity };
|
|
387
|
-
} else {
|
|
388
|
-
//message.error(translate("${实体不存在}!"),5);
|
|
389
|
-
return null;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
static async requestDtmplData(
|
|
394
|
-
serverKey: string,
|
|
395
|
-
sourceId: string,
|
|
396
|
-
code,
|
|
397
|
-
versionId
|
|
398
|
-
) {
|
|
399
|
-
let url = `/v3/dtmpl/data`;
|
|
400
|
-
return await this.requestCommonDtmplData(
|
|
401
|
-
serverKey,
|
|
402
|
-
sourceId,
|
|
403
|
-
code,
|
|
404
|
-
versionId,
|
|
405
|
-
url
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
static async getDtmplData(
|
|
410
|
-
dtmplConfig: DtmplConfig,
|
|
411
|
-
serverKey: string,
|
|
412
|
-
sourceId: string,
|
|
413
|
-
code
|
|
414
|
-
) {
|
|
415
|
-
let dtmplData_;
|
|
416
|
-
if (dtmplConfig && dtmplConfig.dynamic) {
|
|
417
|
-
dtmplData_ = dtmplConfig.entity;
|
|
418
|
-
}
|
|
419
|
-
if (!dtmplData_) {
|
|
420
|
-
dtmplData_ = await this.requestDtmplData(serverKey, sourceId, code, null);
|
|
421
|
-
}
|
|
422
|
-
return dtmplData_;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
static async requestMstrucDtmplData(
|
|
426
|
-
serverKey: string,
|
|
427
|
-
sourceId: string,
|
|
428
|
-
code,
|
|
429
|
-
versionId
|
|
430
|
-
) {
|
|
431
|
-
let url = `/v3/mstruc/dtmpl/data`;
|
|
432
|
-
return await this.requestCommonDtmplData(
|
|
433
|
-
serverKey,
|
|
434
|
-
sourceId,
|
|
435
|
-
code,
|
|
436
|
-
versionId,
|
|
437
|
-
url
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
static async requestViewDtmplData(
|
|
442
|
-
serverKey: string,
|
|
443
|
-
sourceId: string,
|
|
444
|
-
code,
|
|
445
|
-
versionId
|
|
446
|
-
) {
|
|
447
|
-
let url = `/v3/view-dtmpl/data`;
|
|
448
|
-
return await this.requestCommonDtmplData(
|
|
449
|
-
serverKey,
|
|
450
|
-
sourceId,
|
|
451
|
-
code,
|
|
452
|
-
versionId,
|
|
453
|
-
url
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
static async requestMstrucViewDtmplData(
|
|
458
|
-
serverKey: string,
|
|
459
|
-
sourceId,
|
|
460
|
-
code,
|
|
461
|
-
versionId
|
|
462
|
-
) {
|
|
463
|
-
let url = `/v3/mstruc/view-dtmpl/data`;
|
|
464
|
-
return await this.requestCommonDtmplData(
|
|
465
|
-
serverKey,
|
|
466
|
-
sourceId,
|
|
467
|
-
code,
|
|
468
|
-
versionId,
|
|
469
|
-
url
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
static async postCommonDtmplData(
|
|
474
|
-
serverKey: string,
|
|
475
|
-
sourceId: string,
|
|
476
|
-
formDataObj,
|
|
477
|
-
message,
|
|
478
|
-
url
|
|
479
|
-
) {
|
|
480
|
-
const formData = new FormData();
|
|
481
|
-
for (let k in formDataObj) {
|
|
482
|
-
if (!k.startsWith("$virtual")) {
|
|
483
|
-
formData.append(
|
|
484
|
-
k,
|
|
485
|
-
formDataObj[k] || formDataObj[k] == 0 ? formDataObj[k] : ""
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
formData.append("sourceId", sourceId.toString());
|
|
490
|
-
let res = await Super.super(
|
|
491
|
-
{
|
|
492
|
-
url,
|
|
493
|
-
serverKey,
|
|
494
|
-
data: formData,
|
|
495
|
-
method: "POST",
|
|
496
|
-
},
|
|
497
|
-
"formdata"
|
|
498
|
-
);
|
|
499
|
-
let code = null;
|
|
500
|
-
if (res) {
|
|
501
|
-
if (res.status === "success") {
|
|
502
|
-
if (message) {
|
|
503
|
-
if (res.message) {
|
|
504
|
-
message.warning(translate("${保存成功}!") + res.message, 4);
|
|
505
|
-
} else {
|
|
506
|
-
message.success(translate("${保存成功}!"), 1);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
code = res.entityCode ? res.entityCode : res.code;
|
|
510
|
-
}
|
|
511
|
-
// else {
|
|
512
|
-
// if (message) {
|
|
513
|
-
// message.error("保存失败");
|
|
514
|
-
// }
|
|
515
|
-
// }
|
|
516
|
-
} else {
|
|
517
|
-
if (message) {
|
|
518
|
-
message.error(translate("${保存失败}!"), 5);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
return { code, status: res ? res.status : "error" };
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
static async postDtmplData(
|
|
525
|
-
serverKey: string,
|
|
526
|
-
sourceId: string,
|
|
527
|
-
formDataObj,
|
|
528
|
-
message
|
|
529
|
-
) {
|
|
530
|
-
let url = `/v3/dtmpl/data`;
|
|
531
|
-
return await this.postCommonDtmplData(
|
|
532
|
-
serverKey,
|
|
533
|
-
sourceId,
|
|
534
|
-
formDataObj,
|
|
535
|
-
message,
|
|
536
|
-
url
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
static async postLtmplData(
|
|
541
|
-
serverKey: string,
|
|
542
|
-
sourceId: string,
|
|
543
|
-
formDataObj,
|
|
544
|
-
message
|
|
545
|
-
) {
|
|
546
|
-
let url = `/v3/ltmpl/data`;
|
|
547
|
-
return await this.postCommonDtmplData(
|
|
548
|
-
serverKey,
|
|
549
|
-
sourceId,
|
|
550
|
-
formDataObj,
|
|
551
|
-
message,
|
|
552
|
-
url
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
static async postLtmplMultiData(
|
|
557
|
-
serverKey: string,
|
|
558
|
-
sourceId: string,
|
|
559
|
-
formDataObj,
|
|
560
|
-
message
|
|
561
|
-
) {
|
|
562
|
-
let url = `/v3/ltmpl/multi-data`;
|
|
563
|
-
return await this.postCommonDtmplData(
|
|
564
|
-
serverKey,
|
|
565
|
-
sourceId,
|
|
566
|
-
formDataObj,
|
|
567
|
-
message,
|
|
568
|
-
url
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
static async postMstrucDtmplData(
|
|
573
|
-
serverKey: string,
|
|
574
|
-
sourceId: string,
|
|
575
|
-
formDataObj,
|
|
576
|
-
message
|
|
577
|
-
) {
|
|
578
|
-
let url = `/v3/mstruc/dtmpl/data`;
|
|
579
|
-
return await this.postCommonDtmplData(
|
|
580
|
-
serverKey,
|
|
581
|
-
sourceId,
|
|
582
|
-
formDataObj,
|
|
583
|
-
message,
|
|
584
|
-
url
|
|
585
|
-
);
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
static postFileAction(serverKey: string, file) {
|
|
589
|
-
return Units.joinPath(Units.api(serverKey), "/v3/upload");
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// static async postFile(formData, message) {
|
|
593
|
-
// let res = await Super.super({
|
|
594
|
-
// url: `/v3/upload`,
|
|
595
|
-
// data: formData,
|
|
596
|
-
// method: 'POST'
|
|
597
|
-
// }, 'formdata')
|
|
598
|
-
// let fileKey = null;
|
|
599
|
-
// if (res) {
|
|
600
|
-
// if (res.status === "success") {
|
|
601
|
-
// if (message) {
|
|
602
|
-
// message.success("上传成功! ")
|
|
603
|
-
// }
|
|
604
|
-
// fileKey = res.fileKey;
|
|
605
|
-
// }
|
|
606
|
-
// } else {
|
|
607
|
-
// if (message) {
|
|
608
|
-
// message.error("上传失败!");
|
|
609
|
-
// }
|
|
610
|
-
// }
|
|
611
|
-
// return fileKey;
|
|
612
|
-
// }
|
|
613
|
-
|
|
614
|
-
static async requestL2LtmplQueryKey(serverKey: string, sourceId, condition) {
|
|
615
|
-
let url = `v3/l2/ltmpl/query/key`;
|
|
616
|
-
let res = await Super.super({
|
|
617
|
-
url,
|
|
618
|
-
serverKey,
|
|
619
|
-
method: "GET",
|
|
620
|
-
query: { ...condition, sourceId },
|
|
621
|
-
});
|
|
622
|
-
return res;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
static async requestLtmplCount(serverKey: string, sourceId) {
|
|
626
|
-
let url = `/v3/ltmpl/data/count`;
|
|
627
|
-
let res = await Super.super({
|
|
628
|
-
url,
|
|
629
|
-
serverKey,
|
|
630
|
-
query: { sourceId },
|
|
631
|
-
method: "GET",
|
|
632
|
-
});
|
|
633
|
-
return res.count;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
static async requestQueryData(
|
|
637
|
-
serverKey: string,
|
|
638
|
-
queryKey: string,
|
|
639
|
-
pageInfo: PageInfo
|
|
640
|
-
) {
|
|
641
|
-
let res = await Super.super({
|
|
642
|
-
url: `/v3/ltmpl/query/data`,
|
|
643
|
-
serverKey,
|
|
644
|
-
method: "GET",
|
|
645
|
-
query: { queryKey, ...pageInfo },
|
|
646
|
-
});
|
|
647
|
-
return res;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
static getCodesOfSelectedRows(selectedRows: SelectedRow[]) {
|
|
651
|
-
let codes: string[] = [];
|
|
652
|
-
if (!selectedRows || selectedRows.length < 1) {
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
for (let item of selectedRows) {
|
|
657
|
-
if (item.code) {
|
|
658
|
-
codes.push(item.code);
|
|
659
|
-
} else {
|
|
660
|
-
message.error(translate("${没找到所选数据的Code}!!"), 5);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
if (codes.length < 1) {
|
|
665
|
-
message.error(translate("${没找到所选数据的Code}!!"), 5);
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
return codes;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
static async deleteData(
|
|
672
|
-
serverKey: string,
|
|
673
|
-
sourceId,
|
|
674
|
-
selectedRows: SelectedRow[],
|
|
675
|
-
mainCode?
|
|
676
|
-
) {
|
|
677
|
-
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
678
|
-
return await this.deleteByCode(serverKey, sourceId, codes, mainCode);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
static async deleteByCode(
|
|
682
|
-
serverKey: string,
|
|
683
|
-
sourceId,
|
|
684
|
-
codes: string[],
|
|
685
|
-
mainCode?
|
|
686
|
-
) {
|
|
687
|
-
let res = await Super.super({
|
|
688
|
-
url: `/v3/ltmpl/data`,
|
|
689
|
-
serverKey,
|
|
690
|
-
data: {
|
|
691
|
-
codes,
|
|
692
|
-
sourceId,
|
|
693
|
-
mainCode,
|
|
694
|
-
},
|
|
695
|
-
method: "DELETE",
|
|
696
|
-
});
|
|
697
|
-
if (res && res.status == "success") {
|
|
698
|
-
message.success(translate("${删除成功}"), 1);
|
|
699
|
-
return true;
|
|
700
|
-
} else {
|
|
701
|
-
message.error(translate("${删除失败}"), 3);
|
|
702
|
-
//console.log("删除失败消息",res.message);
|
|
703
|
-
return false;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
static async requestQueryAggregates(serverKey: string, queryKey: string) {
|
|
708
|
-
let res = await Super.super({
|
|
709
|
-
url: `/v3/ltmpl/query/count`,
|
|
710
|
-
serverKey,
|
|
711
|
-
method: "GET",
|
|
712
|
-
query: { queryKey },
|
|
713
|
-
});
|
|
714
|
-
return res;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
static async doPostRequest(serverKey: string, url: string, params?: object) {
|
|
718
|
-
let res = await Super.super({
|
|
719
|
-
url,
|
|
720
|
-
serverKey,
|
|
721
|
-
method: "POST",
|
|
722
|
-
data: { ...params },
|
|
723
|
-
});
|
|
724
|
-
return res;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
static async doGetRequest(serverKey: string, url: string, params?: object) {
|
|
728
|
-
let res = await Super.super({
|
|
729
|
-
url,
|
|
730
|
-
serverKey,
|
|
731
|
-
method: "GET",
|
|
732
|
-
query: { ...params },
|
|
733
|
-
});
|
|
734
|
-
return res;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
static async requestChartData(
|
|
738
|
-
serverKey: string,
|
|
739
|
-
sourceId: string,
|
|
740
|
-
params?: object
|
|
741
|
-
) {
|
|
742
|
-
let res = await Super.super({
|
|
743
|
-
url: `/v3/chart/data`,
|
|
744
|
-
serverKey,
|
|
745
|
-
method: "GET",
|
|
746
|
-
query: { sourceId, ...params },
|
|
747
|
-
});
|
|
748
|
-
return res;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
static async requestCharMultitData(
|
|
752
|
-
serverKey: string,
|
|
753
|
-
dataSourceConfigs: string
|
|
754
|
-
) {
|
|
755
|
-
let res = await Super.super({
|
|
756
|
-
url: `/v3/chart/multi-data`,
|
|
757
|
-
serverKey,
|
|
758
|
-
method: "GET",
|
|
759
|
-
query: { dataSourceConfigs },
|
|
760
|
-
});
|
|
761
|
-
return res;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
static async requestCharWSConfig(
|
|
765
|
-
serverKey: string,
|
|
766
|
-
sourceIds: string[]
|
|
767
|
-
) {
|
|
768
|
-
let res = await Super.super({
|
|
769
|
-
url: `/v3/chart/ws/config`,
|
|
770
|
-
serverKey,
|
|
771
|
-
method: "GET",
|
|
772
|
-
query: { sourceIds },
|
|
773
|
-
});
|
|
774
|
-
return res;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
static async postActions(
|
|
778
|
-
serverKey: string,
|
|
779
|
-
actionId: string,
|
|
780
|
-
selectedRows: SelectedRow[],
|
|
781
|
-
actionDataObj?: Object
|
|
782
|
-
) {
|
|
783
|
-
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
784
|
-
const formData = new FormData();
|
|
785
|
-
for (let k in actionDataObj) {
|
|
786
|
-
formData.append(k, actionDataObj[k] ? actionDataObj[k] : "");
|
|
787
|
-
}
|
|
788
|
-
formData.append("sourceId", actionId.toString());
|
|
789
|
-
formData.append("codes", codes.join(","));
|
|
790
|
-
let res = await Super.super(
|
|
791
|
-
{
|
|
792
|
-
url: `/v3/action`,
|
|
793
|
-
serverKey,
|
|
794
|
-
data: formData,
|
|
795
|
-
method: "POST",
|
|
796
|
-
},
|
|
797
|
-
"formdata",
|
|
798
|
-
null
|
|
799
|
-
);
|
|
800
|
-
return res;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
static async increCalc(serverKey: string, sourceId: string, params = {}) {
|
|
805
|
-
let res = await Super.super({
|
|
806
|
-
url: `/v3/stat/increcalc`,
|
|
807
|
-
serverKey,
|
|
808
|
-
method: "POST",
|
|
809
|
-
data: { ...params, sourceId },
|
|
810
|
-
});
|
|
811
|
-
if (res && res.status === "success") {
|
|
812
|
-
message.success(translate("${统计成功}"), 1);
|
|
813
|
-
} else {
|
|
814
|
-
message.error(translate("${统计失败}"));
|
|
815
|
-
}
|
|
816
|
-
return res;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
static async saveRatmplSelectCodes(
|
|
820
|
-
serverKey: string,
|
|
821
|
-
sourceId: string,
|
|
822
|
-
mainCode,
|
|
823
|
-
codes: string[]
|
|
824
|
-
) {
|
|
825
|
-
let res = await Super.super({
|
|
826
|
-
url: `/v3/ratmpl-select/data`,
|
|
827
|
-
serverKey,
|
|
828
|
-
method: "POST",
|
|
829
|
-
data: { codes, mainCode, sourceId },
|
|
830
|
-
});
|
|
831
|
-
if (res && res.status != "success") {
|
|
832
|
-
message.error(translate("${" + res.message + "}"));
|
|
833
|
-
}
|
|
834
|
-
return res;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
static async doCopy(
|
|
838
|
-
serverKey: string,
|
|
839
|
-
sourceId: string,
|
|
840
|
-
code: string,
|
|
841
|
-
copyRelation?,
|
|
842
|
-
copyOpp2One?
|
|
843
|
-
) {
|
|
844
|
-
let res = await Super.super(
|
|
845
|
-
{
|
|
846
|
-
url: `/v3/mstruc/copy-data`,
|
|
847
|
-
serverKey,
|
|
848
|
-
method: "POST",
|
|
849
|
-
query: {
|
|
850
|
-
sourceId,
|
|
851
|
-
code,
|
|
852
|
-
copyRelation,
|
|
853
|
-
copyOpp2One,
|
|
854
|
-
},
|
|
855
|
-
},
|
|
856
|
-
null,
|
|
857
|
-
null
|
|
858
|
-
);
|
|
859
|
-
if (res && res.status == "success") {
|
|
860
|
-
if (res.message) {
|
|
861
|
-
message.info(res.message, 4);
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
return res.entityCode;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
// static downloadDetailExcel(sourceId, entityCode) {
|
|
868
|
-
// const hydrocarbonToken = Units.hydrocarbonToken();
|
|
869
|
-
// let url = Units.joinPath(Units.api(), `/v3/dtmpl/excel`)+`?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
|
|
870
|
-
// Units.downloadFile(url, "详情");
|
|
871
|
-
// }
|
|
872
|
-
|
|
873
|
-
static async queryCode(
|
|
874
|
-
sourceId: string,
|
|
875
|
-
codeSource: CodeSource,
|
|
876
|
-
serverKey?: string
|
|
877
|
-
) {
|
|
878
|
-
let queriedCode = undefined;
|
|
879
|
-
if (codeSource) {
|
|
880
|
-
if (codeSource == "listop") {
|
|
881
|
-
queriedCode = await this.queryTop1(serverKey, sourceId);
|
|
882
|
-
if (!queriedCode) {
|
|
883
|
-
queriedCode = "bad-code";
|
|
884
|
-
}
|
|
885
|
-
} else if (codeSource == "listop-new") {
|
|
886
|
-
queriedCode = await this.queryTop1(serverKey, sourceId);
|
|
887
|
-
} else if (codeSource == "new") {
|
|
888
|
-
queriedCode = null;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
return queriedCode;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
static download(serverKey: string, path) {
|
|
895
|
-
let vars = path.split("/");
|
|
896
|
-
let fileName = vars[vars.length - 1];
|
|
897
|
-
this.downloadDir(this.getFileUrl(serverKey, path), fileName);
|
|
898
|
-
// let vars = path.split("/");
|
|
899
|
-
// let fileName = vars[vars.length - 1];
|
|
900
|
-
// Units.downloadFile(
|
|
901
|
-
// this.getFileUrl(serverKey, path) + `&disposition=attachment`,
|
|
902
|
-
// fileName
|
|
903
|
-
// );
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
static downloadDir(path, fileName) {
|
|
907
|
-
// let fileName = this.getFileNameFrom(path);
|
|
908
|
-
Units.downloadFile(path + `&disposition=attachment`, fileName);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
static openfile(serverKey: string, path, toolbar) {
|
|
912
|
-
let vars = path.split("/");
|
|
913
|
-
let fileName = vars[vars.length - 1];
|
|
914
|
-
this.openfileDir(fileName, this.getFileUrl(serverKey, path), toolbar);
|
|
915
|
-
// Units.openFile(this.getFileUrl(serverKey, path), fileName, toolbar);
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
static getFileNameFrom(path) {
|
|
919
|
-
if (!path) {
|
|
920
|
-
return undefined;
|
|
921
|
-
}
|
|
922
|
-
let vars = path.split("/");
|
|
923
|
-
let fileName = vars[vars.length - 1];
|
|
924
|
-
return fileName;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
static getFileSuffixFrom(fileName) {
|
|
928
|
-
if (!fileName) {
|
|
929
|
-
return undefined;
|
|
930
|
-
}
|
|
931
|
-
let ss = fileName.split(".");
|
|
932
|
-
if (ss.length > 1) {
|
|
933
|
-
return ss.pop();
|
|
934
|
-
} else {
|
|
935
|
-
return undefined;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
static openfileDir(path, fileName, toolbar) {
|
|
940
|
-
//let fileName = this.getFileNameFrom(path);
|
|
941
|
-
Units.openFile(path, fileName, toolbar);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
static getFileUrl(serverKey: string, path: string) {
|
|
945
|
-
const hydrocarbonToken = Units.serverHydrocarbonToken(serverKey);
|
|
946
|
-
const programCode = Units.programCode(serverKey);
|
|
947
|
-
const applicationCode = Units.applicationCode(serverKey);
|
|
948
|
-
let root;
|
|
949
|
-
let url;
|
|
950
|
-
//判断是否为全URL
|
|
951
|
-
if (path?.startsWith("http") || path?.startsWith("HTTP")) {
|
|
952
|
-
root = path;
|
|
953
|
-
if (path.indexOf("?") > 0) {
|
|
954
|
-
url = root +
|
|
955
|
-
`&@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
956
|
-
} else {
|
|
957
|
-
url = root +
|
|
958
|
-
`?@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
959
|
-
}
|
|
960
|
-
} else {
|
|
961
|
-
root = Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files", path));
|
|
962
|
-
url = root +
|
|
963
|
-
`?@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
let encodeUri = encodeURI(url);
|
|
967
|
-
return encodeUri;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
static async loadFileTxt(serverKey: string, path) {
|
|
972
|
-
let res = await Super.super({
|
|
973
|
-
url: encodeURI(Units.joinPath("/v3/files/text", path)),
|
|
974
|
-
serverKey,
|
|
975
|
-
method: "GET",
|
|
976
|
-
});
|
|
977
|
-
return res.text;
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
static async requestBlocks(
|
|
982
|
-
l2MenuId: string,
|
|
983
|
-
blockId: string,
|
|
984
|
-
programCode?: string,
|
|
985
|
-
applicationCode?: string
|
|
986
|
-
): Promise<MenuConfigAPIType> {
|
|
987
|
-
let url = `/v3/menu/blocks`;
|
|
988
|
-
let res = await Super.super({
|
|
989
|
-
url: url,
|
|
990
|
-
method: "GET",
|
|
991
|
-
header: { programCode, applicationCode },
|
|
992
|
-
query: {
|
|
993
|
-
l2MenuId,
|
|
994
|
-
blockId,
|
|
995
|
-
},
|
|
996
|
-
});
|
|
997
|
-
return res;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
static async requestBlockMenuAuths() {
|
|
1001
|
-
let url = `/v3/menu/block-menu-auths`;
|
|
1002
|
-
let res = await Super.super({
|
|
1003
|
-
url: url,
|
|
1004
|
-
method: "GET",
|
|
1005
|
-
query: {},
|
|
1006
|
-
});
|
|
1007
|
-
return res?.blocks;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
static async requestRoleAuths(roleCode: string) {
|
|
1011
|
-
let url = `/v3/auth/role-auths`;
|
|
1012
|
-
let res = await Super.super({
|
|
1013
|
-
url: url,
|
|
1014
|
-
method: "GET",
|
|
1015
|
-
query: {
|
|
1016
|
-
roleCode,
|
|
1017
|
-
},
|
|
1018
|
-
});
|
|
1019
|
-
return res;
|
|
1020
|
-
}
|
|
1021
|
-
static async postRoleAuths(roleCode: string, auths: string[]) {
|
|
1022
|
-
let url = `/v3/auth/role-auths`;
|
|
1023
|
-
let res = await Super.super({
|
|
1024
|
-
url: url,
|
|
1025
|
-
method: "POST",
|
|
1026
|
-
query: {
|
|
1027
|
-
roleCode,
|
|
1028
|
-
auths,
|
|
1029
|
-
},
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
return res;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
static async logout() {
|
|
1036
|
-
Super.super({
|
|
1037
|
-
url: "/v3/auth/token",
|
|
1038
|
-
method: "DELETE",
|
|
1039
|
-
}).then((res) => {
|
|
1040
|
-
Units.toLogin();
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
static async logout2() {
|
|
1045
|
-
return Super.super({
|
|
1046
|
-
url: "/v3/auth/token",
|
|
1047
|
-
method: "DELETE",
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
static async resetPassword(
|
|
1052
|
-
serverKey: string,
|
|
1053
|
-
oPassword: string,
|
|
1054
|
-
nPassword: string,
|
|
1055
|
-
pubkey
|
|
1056
|
-
) {
|
|
1057
|
-
let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
|
|
1058
|
-
let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
|
|
1059
|
-
let res = await Super.super({
|
|
1060
|
-
url: "/v3/auth/password",
|
|
1061
|
-
serverKey,
|
|
1062
|
-
query: {
|
|
1063
|
-
oldPassword,
|
|
1064
|
-
newPassword,
|
|
1065
|
-
},
|
|
1066
|
-
method: "POST",
|
|
1067
|
-
});
|
|
1068
|
-
|
|
1069
|
-
return res;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
static async resetPassword2(
|
|
1073
|
-
serverKey: string, userName: string,
|
|
1074
|
-
oPassword: string,
|
|
1075
|
-
nPassword: string,
|
|
1076
|
-
pubkey
|
|
1077
|
-
) {
|
|
1078
|
-
let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
|
|
1079
|
-
let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
|
|
1080
|
-
let res = await Super.super({
|
|
1081
|
-
url: "/v3/auth/password2",
|
|
1082
|
-
serverKey,
|
|
1083
|
-
query: {
|
|
1084
|
-
userName,
|
|
1085
|
-
oldPassword,
|
|
1086
|
-
newPassword,
|
|
1087
|
-
},
|
|
1088
|
-
method: "POST",
|
|
1089
|
-
});
|
|
1090
|
-
|
|
1091
|
-
return res;
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
static async getContextSourceConfig() {
|
|
1095
|
-
let res = await Super.super({
|
|
1096
|
-
url: "/v3/context-source-config",
|
|
1097
|
-
method: "GET",
|
|
1098
|
-
});
|
|
1099
|
-
if (res) {
|
|
1100
|
-
return res.config;
|
|
1101
|
-
} else {
|
|
1102
|
-
return null;
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
static async getContextSourceValue() {
|
|
1107
|
-
let res = await Super.super({
|
|
1108
|
-
url: "/v3/auth/context-source-value",
|
|
1109
|
-
method: "GET",
|
|
1110
|
-
});
|
|
1111
|
-
return res ? res.value : null;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
static async loginServer(serverKey: string, username: string, password: string) {
|
|
1115
|
-
let pubkey = await this.getRasPubkey(serverKey);
|
|
1116
|
-
if (pubkey) {
|
|
1117
|
-
let json = { username, password };
|
|
1118
|
-
let res = await this.login(json, null, null, pubkey, null, serverKey);
|
|
1119
|
-
if (res.status == "success") {
|
|
1120
|
-
Units.setServerHydrocarbonToken(serverKey, res.token);
|
|
1121
|
-
return res;
|
|
1122
|
-
} else {
|
|
1123
|
-
return { status: "error", message: "登陆失败" }
|
|
1124
|
-
}
|
|
1125
|
-
} else {
|
|
1126
|
-
return { status: "error", message: "登陆失败" }
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
static async login(
|
|
1131
|
-
json,
|
|
1132
|
-
kaptchaToken,
|
|
1133
|
-
kaptchaText,
|
|
1134
|
-
pubkey,
|
|
1135
|
-
programCode?: string,
|
|
1136
|
-
serverKey?: string,
|
|
1137
|
-
applicationCode?: string
|
|
1138
|
-
) {
|
|
1139
|
-
let datetime = dayjs(new Date())
|
|
1140
|
-
.tz("Europe/London")
|
|
1141
|
-
.format("YYYY-MM-DD HH:mm:ss");
|
|
1142
|
-
json["datetime"] = datetime;
|
|
1143
|
-
|
|
1144
|
-
let userInfo = EncryptUtils.rsaEncrypt(JSON.stringify(json), pubkey);
|
|
1145
|
-
|
|
1146
|
-
let res = await Super.super({
|
|
1147
|
-
url: "/v3/auth/hctoken",
|
|
1148
|
-
serverKey,
|
|
1149
|
-
header: { programCode, applicationCode },
|
|
1150
|
-
query: {
|
|
1151
|
-
userInfo,
|
|
1152
|
-
kaptchaToken,
|
|
1153
|
-
kaptchaText,
|
|
1154
|
-
},
|
|
1155
|
-
method: "GET",
|
|
1156
|
-
});
|
|
1157
|
-
if (res.passwordState) {
|
|
1158
|
-
if (res.passwordState == "expiry") {
|
|
1159
|
-
message.warning(translate("${" + res.message + "}"), 10);
|
|
1160
|
-
} else if (res.passwordState == "expiried") {
|
|
1161
|
-
message.error(translate("${" + res.message + "}"), 10)
|
|
1162
|
-
} else if (res.passwordState == "restricted") {
|
|
1163
|
-
message.error(translate("${" + res.message + "}"), 15)
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
return { status: res.status, token: res.token };
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
static async setContext(json) {
|
|
1170
|
-
const formData = new FormData();
|
|
1171
|
-
formData.append("context", JSON.stringify(json));
|
|
1172
|
-
let res = await Super.super(
|
|
1173
|
-
{
|
|
1174
|
-
url: "/v3/auth/context",
|
|
1175
|
-
data: formData,
|
|
1176
|
-
method: "POST",
|
|
1177
|
-
},
|
|
1178
|
-
"formdata"
|
|
1179
|
-
);
|
|
1180
|
-
|
|
1181
|
-
if (res && res.status === "success") {
|
|
1182
|
-
window.location.hash = "#/home";
|
|
1183
|
-
}
|
|
1184
|
-
return res;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
static async getKaptchaToken(programCode?: string, applicationCode?: string) {
|
|
1188
|
-
let res = await Super.super({
|
|
1189
|
-
url: "/v3/auth/kaptcha",
|
|
1190
|
-
header: { programCode, applicationCode },
|
|
1191
|
-
method: "POST",
|
|
1192
|
-
});
|
|
1193
|
-
if (res && res.status === "success") {
|
|
1194
|
-
return res;
|
|
1195
|
-
} else {
|
|
1196
|
-
return null;
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
static async getRasPubkey(serverKey?: string, programCode?: string, applicationCode?: string) {
|
|
1201
|
-
let res = await Super.super({
|
|
1202
|
-
url: "/v3/auth/ras-pubkey",
|
|
1203
|
-
header: { programCode, applicationCode },
|
|
1204
|
-
serverKey,
|
|
1205
|
-
method: "GET",
|
|
1206
|
-
});
|
|
1207
|
-
if (res && res.status === "success") {
|
|
1208
|
-
return res.rasPubkey;
|
|
1209
|
-
} else {
|
|
1210
|
-
return null;
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
static async getUser(programCode?: string, hydrocarbonToken?: string, applicationCode?: string) {
|
|
1215
|
-
let res = await Super.super({
|
|
1216
|
-
header: { programCode, hydrocarbonToken, applicationCode },
|
|
1217
|
-
url: "/v3/current-user",
|
|
1218
|
-
});
|
|
1219
|
-
return res ? res.user : null;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
static async requestFastMenu() {
|
|
1223
|
-
let url = `/v3/menu/fast-menu`;
|
|
1224
|
-
let res = await Super.super({
|
|
1225
|
-
url: url,
|
|
1226
|
-
method: "GET",
|
|
1227
|
-
});
|
|
1228
|
-
return res ? res.fastMenu : null;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
static async reload() {
|
|
1232
|
-
let url = `/v3/tmpl/reload`;
|
|
1233
|
-
let res = await Super.super({
|
|
1234
|
-
url: url,
|
|
1235
|
-
method: "GET",
|
|
1236
|
-
});
|
|
1237
|
-
return res;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
static async getAllLang(serverKey?: string) {
|
|
1241
|
-
let url = "/v3/languages";
|
|
1242
|
-
const data = {
|
|
1243
|
-
url,
|
|
1244
|
-
method: "GET",
|
|
1245
|
-
};
|
|
1246
|
-
if (serverKey !== undefined) data["serverKey"] = serverKey;
|
|
1247
|
-
let res = await Super.super(data);
|
|
1248
|
-
return res;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
static async getLocale(lang, serverKey?: string) {
|
|
1254
|
-
let url = "/v3/multilingual";
|
|
1255
|
-
const data = {
|
|
1256
|
-
url: `${url}?language=${lang}`,
|
|
1257
|
-
method: "GET",
|
|
1258
|
-
};
|
|
1259
|
-
if (serverKey !== undefined) data["serverKey"] = serverKey;
|
|
1260
|
-
let res = await Super.super(data);
|
|
1261
|
-
return res;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
static async initProgramConfig(ProgramConfigJson) {
|
|
1267
|
-
//设置项目配置信息
|
|
1268
|
-
if (ProgramConfigJson["programCode"]) {
|
|
1269
|
-
ProgramConfig.setProgramCode(ProgramConfigJson["programCode"]);
|
|
1270
|
-
}
|
|
1271
|
-
if (ProgramConfigJson["applicationCode"]) {
|
|
1272
|
-
ProgramConfig.setApplicationCode(ProgramConfigJson["applicationCode"]);
|
|
1273
|
-
}
|
|
1274
|
-
if (ProgramConfigJson["hydrocarbonServer"]) {
|
|
1275
|
-
ProgramConfig.setHydrocarbonServer(
|
|
1276
|
-
ProgramConfigJson["hydrocarbonServer"]
|
|
1277
|
-
);
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
//注册扩展服务器
|
|
1281
|
-
if (ProgramConfigJson["extendServer"]) {
|
|
1282
|
-
let extend = ProgramConfigJson["extendServer"];
|
|
1283
|
-
if (typeof extend == "object") {
|
|
1284
|
-
let extendServers = [];
|
|
1285
|
-
if (Array.isArray(extend)) {
|
|
1286
|
-
extendServers = extend;
|
|
1287
|
-
} else {
|
|
1288
|
-
extendServers.push(extend);
|
|
1289
|
-
}
|
|
1290
|
-
ProgramConfig.putExtendServers(extendServers);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
ProgramConfig.setProgramName(ProgramConfigJson["programName"]);
|
|
1295
|
-
ProgramConfig.setProgramName_sub(ProgramConfigJson["programName_sub"]);
|
|
1296
|
-
ProgramConfig.setProgramName_NavLeft(
|
|
1297
|
-
ProgramConfigJson["programName_NavLeft"]
|
|
1298
|
-
);
|
|
1299
|
-
ProgramConfig.setProgramName_Logo(ProgramConfigJson["programName_Logo"]);
|
|
1300
|
-
ProgramConfig.setThemes(ProgramConfigJson["themes"]);
|
|
1301
|
-
ProgramConfig.setDefaultTheme(ProgramConfigJson["defaultTheme"]);
|
|
1302
|
-
|
|
1303
|
-
let result = await Super.getProramConfig();
|
|
1304
|
-
|
|
1305
|
-
if (result) {
|
|
1306
|
-
//console.log('result',result)
|
|
1307
|
-
//先放入programCode
|
|
1308
|
-
ProgramConfig.setProgramCode(result.programCode);
|
|
1309
|
-
ProgramConfig.setApplicationCode(result.applicationCode);
|
|
1310
|
-
ProgramConfig.setHydrocarbonServer(result.hydrocarbonServer);
|
|
1311
|
-
ProgramConfig.setProgramName(result.programName);
|
|
1312
|
-
ProgramConfig.setProgramName_sub(result.programName_sub);
|
|
1313
|
-
ProgramConfig.setProgramName_NavLeft(result.programName_NavLeft);
|
|
1314
|
-
ProgramConfig.setProgramName_Logo(result.programName_Logo);
|
|
1315
|
-
ProgramConfig.setThemes(result.themes);
|
|
1316
|
-
ProgramConfig.setDefaultTheme(result.defaultTheme);
|
|
1317
|
-
//注册扩展服务器
|
|
1318
|
-
if (result.extendServer) {
|
|
1319
|
-
let extend = result.extendServer;
|
|
1320
|
-
if (typeof extend == "object") {
|
|
1321
|
-
let extendServers = [];
|
|
1322
|
-
if (Array.isArray(extend)) {
|
|
1323
|
-
extendServers = extend;
|
|
1324
|
-
} else {
|
|
1325
|
-
extendServers.push(extend);
|
|
1326
|
-
}
|
|
1327
|
-
ProgramConfig.putExtendServers(extendServers);
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
static async requestDDpageData(ddpageId: string) {
|
|
1334
|
-
let res = await Super.super({
|
|
1335
|
-
url: "/v3/ddpage/data",
|
|
1336
|
-
method: "GET",
|
|
1337
|
-
query: {
|
|
1338
|
-
ddpageId,
|
|
1339
|
-
},
|
|
1340
|
-
});
|
|
1341
|
-
return res;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
static async ssoTokenLogin(json: { username: string, ssoToken: string }, programCode?: string, serverKey?: string, applicationCode?: string) {
|
|
1345
|
-
let res = await Super.super({
|
|
1346
|
-
url: "/v3/auth/sso/token",
|
|
1347
|
-
serverKey,
|
|
1348
|
-
header: { programCode, applicationCode },
|
|
1349
|
-
query: json,
|
|
1350
|
-
method: "GET",
|
|
1351
|
-
});
|
|
1352
|
-
return res;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
static async getThemeConfig(serverKey?: string, programCode?: string, applicationCode?: string) {
|
|
1356
|
-
let res = await Super.super({
|
|
1357
|
-
url: "/v3/theme-config",
|
|
1358
|
-
header: { programCode, applicationCode },
|
|
1359
|
-
serverKey,
|
|
1360
|
-
method: "GET",
|
|
1361
|
-
});
|
|
1362
|
-
if (res && res.status === "success") {
|
|
1363
|
-
return res;
|
|
1364
|
-
} else {
|
|
1365
|
-
return null;
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
// 获取列表页统计数据
|
|
1370
|
-
static async getLtmplDataGroupCount(sourceId: string) {
|
|
1371
|
-
let res = await Super.super({
|
|
1372
|
-
url: "v3/ltmpl/data/group-count",
|
|
1373
|
-
method: "GET",
|
|
1374
|
-
query: { sourceId }
|
|
1375
|
-
});
|
|
1376
|
-
if (res?.status === "success") {
|
|
1377
|
-
return res["group-aggregates"] || [];
|
|
1378
|
-
} else {
|
|
1379
|
-
return [];
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
// 设置页面默认配置
|
|
1384
|
-
static async setPageConfigDefault(name: string, menuCode: string, content: string) {
|
|
1385
|
-
let res = await Super.super({
|
|
1386
|
-
url: `/v3/devops/page-config/default`,
|
|
1387
|
-
method: "POST",
|
|
1388
|
-
data: { name, menuCode, content },
|
|
1389
|
-
});
|
|
1390
|
-
if (res?.status === "success") {
|
|
1391
|
-
message.success(translate("${保存成功}"), 1);
|
|
1392
|
-
return true;
|
|
1393
|
-
} else {
|
|
1394
|
-
message.error(translate("${保存失败}"), 3);
|
|
1395
|
-
return false;
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
// 获取页面默认配置
|
|
1400
|
-
static async getPageConfigDefault() {
|
|
1401
|
-
let res = await Super.super({
|
|
1402
|
-
url: `/v3/devops/page-config/default`,
|
|
1403
|
-
method: "GET",
|
|
1404
|
-
});
|
|
1405
|
-
if (res?.status === "success") {
|
|
1406
|
-
message.success(translate("${拉取成功}"), 1);
|
|
1407
|
-
return res.configs;
|
|
1408
|
-
} else {
|
|
1409
|
-
message.error(translate("${拉取失败}"), 3);
|
|
1410
|
-
return null;
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
static async deletePageConfigDefault(menuCode: string) {
|
|
1415
|
-
let res = await Super.super({
|
|
1416
|
-
url: `/v3/devops/page-config/default`,
|
|
1417
|
-
data: { menuCode },
|
|
1418
|
-
method: "DELETE",
|
|
1419
|
-
});
|
|
1420
|
-
if (res?.status === "success") {
|
|
1421
|
-
message.success(translate("${删除成功}"), 1);
|
|
1422
|
-
return true;
|
|
1423
|
-
} else {
|
|
1424
|
-
message.error(translate("${删除失败}"), 3);
|
|
1425
|
-
return false;
|
|
1426
|
-
}
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
// 设置页面用户自定义配置
|
|
1430
|
-
static async setPageConfigCommon(name: string, menuCode: string, content: string, configCode?: string) {
|
|
1431
|
-
let res = await Super.super({
|
|
1432
|
-
url: `/v3/devops/page-config/common`,
|
|
1433
|
-
method: "POST",
|
|
1434
|
-
data: { name, menuCode, content, configCode },
|
|
1435
|
-
});
|
|
1436
|
-
if (res?.status === "success") {
|
|
1437
|
-
message.success(translate("${保存成功}"), 1);
|
|
1438
|
-
return true;
|
|
1439
|
-
} else {
|
|
1440
|
-
message.error(translate("${保存失败}"), 3);
|
|
1441
|
-
return false;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
// 获取用户页面自定义配置
|
|
1446
|
-
static async getPageConfigCommon(menuCode?: string) {
|
|
1447
|
-
let res = await Super.super({
|
|
1448
|
-
url: `/v3/devops/page-config/common`,
|
|
1449
|
-
method: "GET",
|
|
1450
|
-
query: { menuCode }
|
|
1451
|
-
});
|
|
1452
|
-
if (res?.status === "success") {
|
|
1453
|
-
return res.configs;
|
|
1454
|
-
} else {
|
|
1455
|
-
return null;
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
static async deletePageConfigCommon(configCode: string) {
|
|
1460
|
-
let res = await Super.super({
|
|
1461
|
-
url: `/v3/devops/page-config/common`,
|
|
1462
|
-
data: { configCode },
|
|
1463
|
-
method: "DELETE",
|
|
1464
|
-
});
|
|
1465
|
-
if (res?.status === "success") {
|
|
1466
|
-
message.success(translate("${删除成功}"), 1);
|
|
1467
|
-
return true;
|
|
1468
|
-
} else {
|
|
1469
|
-
message.error(translate("${删除失败}"), 3);
|
|
1470
|
-
return false;
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
// 请求用户我的菜单
|
|
1475
|
-
static async getQuickMenu() {
|
|
1476
|
-
let res = await Super.super({
|
|
1477
|
-
url: `/v3/devops/menu-config/quick-menu`,
|
|
1478
|
-
method: "GET",
|
|
1479
|
-
});
|
|
1480
|
-
if (res?.status === "success") {
|
|
1481
|
-
return res.configs;
|
|
1482
|
-
} else {
|
|
1483
|
-
return null;
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
// 添加用户我的菜单
|
|
1488
|
-
static async postQuickMenu(menuCodes: string[]) {
|
|
1489
|
-
let res = await Super.super({
|
|
1490
|
-
url: `/v3/devops/menu-config/quick-menu`,
|
|
1491
|
-
method: "POST",
|
|
1492
|
-
data: { menuCodes },
|
|
1493
|
-
});
|
|
1494
|
-
if (res?.status === "success") {
|
|
1495
|
-
message.success(translate("${保存成功}"), 1);
|
|
1496
|
-
return true;
|
|
1497
|
-
} else {
|
|
1498
|
-
message.error(translate("${保存失败}"), 3);
|
|
1499
|
-
return false;
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
// 删除用户我的菜单
|
|
1504
|
-
static async deleteQuickMenu(menuCode: string) {
|
|
1505
|
-
let res = await Super.super({
|
|
1506
|
-
url: `/v3/devops/menu-config/quick-menu`,
|
|
1507
|
-
data: { menuCode },
|
|
1508
|
-
method: "DELETE",
|
|
1509
|
-
});
|
|
1510
|
-
if (res?.status === "success") {
|
|
1511
|
-
message.success(translate("${删除成功}"), 1);
|
|
1512
|
-
return true;
|
|
1513
|
-
} else {
|
|
1514
|
-
message.error(translate("${删除失败}"), 3);
|
|
1515
|
-
return false;
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
// ws发送消息
|
|
1520
|
-
// data:{ message: "测试数据", destination: "/user/queue/dashboard" }
|
|
1521
|
-
static async wsPush(hydrocarbonToken, data) {
|
|
1522
|
-
const res = await Super.super({
|
|
1523
|
-
url: `/v3/ws-push/${hydrocarbonToken}`,
|
|
1524
|
-
data,
|
|
1525
|
-
method: "POST",
|
|
1526
|
-
});
|
|
1527
|
-
if (res.code === 200) {
|
|
1528
|
-
message.success(translate("${已发送}"));
|
|
1529
|
-
} else {
|
|
1530
|
-
message.error(translate("${发送失败}"), 3);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
static async wsPushTopic(hydrocarbonToken, data) {
|
|
1535
|
-
const res = await Super.super({
|
|
1536
|
-
url: `/v3/ws-push-topic/${hydrocarbonToken}`,
|
|
1537
|
-
data,
|
|
1538
|
-
method: "POST",
|
|
1539
|
-
});
|
|
1540
|
-
if (res.code === 200) {
|
|
1541
|
-
message.success(translate("${已发送}"));
|
|
1542
|
-
} else {
|
|
1543
|
-
message.error(translate("${发送失败}"), 3);
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
// 请求2D图组件
|
|
1548
|
-
static async get2DComponent(groups: string[]) {
|
|
1549
|
-
let { status, ...res } = await Super.super({
|
|
1550
|
-
url: `/v3/component/2d-config`,
|
|
1551
|
-
method: "GET",
|
|
1552
|
-
query: { groups }
|
|
1553
|
-
});
|
|
1554
|
-
if (status === "success") {
|
|
1555
|
-
return res;
|
|
1556
|
-
} else {
|
|
1557
|
-
return {};
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
// 保存2D图
|
|
1562
|
-
static async postDiagram2DConfig(recordCode: string, content: string) {
|
|
1563
|
-
let res = await Super.super({
|
|
1564
|
-
url: `/v3/devops/diagram-2d-config`,
|
|
1565
|
-
method: "POST",
|
|
1566
|
-
data: { recordCode, content },
|
|
1567
|
-
});
|
|
1568
|
-
if (res?.status === "success") {
|
|
1569
|
-
message.success(translate("${保存成功}"), 1);
|
|
1570
|
-
return true;
|
|
1571
|
-
} else {
|
|
1572
|
-
message.error(translate("${保存失败}"), 3);
|
|
1573
|
-
return false;
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
// 查询2D图
|
|
1578
|
-
static async getDiagram2DConfig(recordCode: string) {
|
|
1579
|
-
let res = await Super.super({
|
|
1580
|
-
url: `/v3/devops/diagram-2d-config`,
|
|
1581
|
-
method: "GET",
|
|
1582
|
-
query: { recordCode }
|
|
1583
|
-
});
|
|
1584
|
-
if (res?.status === "success") {
|
|
1585
|
-
return res?.configs || [];
|
|
1586
|
-
} else {
|
|
1587
|
-
return [];
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1
|
+
import Units from "../units";
|
|
2
|
+
import Super from "./superagent";
|
|
3
|
+
|
|
4
|
+
import { message } from "antd";
|
|
5
|
+
import EncryptUtils from "../units/EncryptUtils";
|
|
6
|
+
import "dayjs/locale/en";
|
|
7
|
+
import dayjs from "dayjs";
|
|
8
|
+
import utc from "dayjs/plugin/utc";
|
|
9
|
+
import timezone from "dayjs/plugin/timezone";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
CodeSource, CommonFilePath,
|
|
13
|
+
DtmplConfig,
|
|
14
|
+
MenuConfigAPIType,
|
|
15
|
+
PageInfo,
|
|
16
|
+
SelectedRow,
|
|
17
|
+
} from "./interface";
|
|
18
|
+
|
|
19
|
+
import { ProgramConfig } from "../index";
|
|
20
|
+
import translate from "../locale/translate";
|
|
21
|
+
|
|
22
|
+
dayjs.extend(utc);
|
|
23
|
+
dayjs.extend(timezone);
|
|
24
|
+
|
|
25
|
+
export default class HcserviceV3 {
|
|
26
|
+
static async requestEnum(serverKey: string, mstrucIds, path: string) {
|
|
27
|
+
if (!path) {
|
|
28
|
+
return await this.requestEnumWithPath(serverKey, mstrucIds, "/enum");
|
|
29
|
+
} else {
|
|
30
|
+
return await this.requestEnumWithPath(serverKey, mstrucIds, path);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static getJsonValue = (file) => {
|
|
35
|
+
let jsonFile = file;
|
|
36
|
+
if (!file) {
|
|
37
|
+
return undefined;
|
|
38
|
+
} else if (typeof (file) == 'string') {
|
|
39
|
+
jsonFile = JSON.parse(file);
|
|
40
|
+
}
|
|
41
|
+
return jsonFile;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static toFilePath(value, serverKey) {
|
|
45
|
+
if (!value) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
let filePath: CommonFilePath = {};
|
|
49
|
+
if (typeof (value) == 'string') {
|
|
50
|
+
if (value.toLowerCase().startsWith("http")) {
|
|
51
|
+
filePath.path = value;
|
|
52
|
+
filePath.fileName = this.getFileNameFrom(value);
|
|
53
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
54
|
+
} else if (value.toLowerCase().startsWith("/")) {
|
|
55
|
+
filePath.path = this.getFileUrl(serverKey, value);
|
|
56
|
+
filePath.fileName = this.getFileNameFrom(value);
|
|
57
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
58
|
+
} else {
|
|
59
|
+
let jsonValue = this.getJsonValue(value);
|
|
60
|
+
filePath = this.toFilePathObject(jsonValue, serverKey);
|
|
61
|
+
}
|
|
62
|
+
} else if (value.base) {
|
|
63
|
+
filePath = this.toFilePathObject(value, serverKey);
|
|
64
|
+
}
|
|
65
|
+
return filePath;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static toFilePathObject(jsonValue, serverKey: string) {
|
|
69
|
+
let filePath: any = {};
|
|
70
|
+
if (jsonValue) {
|
|
71
|
+
filePath.path = this.getFileUrl(serverKey, jsonValue.base?.path);
|
|
72
|
+
filePath.iconPath = jsonValue.icon?.path ? this.getFileUrl(serverKey, jsonValue.icon?.path) : null;
|
|
73
|
+
filePath.fileName = jsonValue.fileName ? jsonValue.fileName : this.getFileNameFrom(jsonValue.base?.path);
|
|
74
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
75
|
+
filePath.valid = jsonValue.valid;
|
|
76
|
+
filePath.baseType = jsonValue.base?.type;
|
|
77
|
+
filePath.basePath = jsonValue.base?.path;
|
|
78
|
+
return filePath;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static async requestEnumWithPath(serverKey: string, mstrucIds, path) {
|
|
84
|
+
if (mstrucIds.length > 0) {
|
|
85
|
+
let res = await Super.super({
|
|
86
|
+
url: Units.joinPath("/v3", path),
|
|
87
|
+
serverKey,
|
|
88
|
+
data: {
|
|
89
|
+
mstrucIds,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
return res.enumMap;
|
|
93
|
+
} else {
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static async requestOptions(serverKey: string, mstrucId) {
|
|
99
|
+
//有下拉菜单时,请求下拉选项操作
|
|
100
|
+
return await this.requestEnum(serverKey, [mstrucId], null);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static async requestDtmplConfig(
|
|
104
|
+
serverKey: string,
|
|
105
|
+
sourceId: string,
|
|
106
|
+
code: string
|
|
107
|
+
) {
|
|
108
|
+
let url = `/v3/dtmpl/config`;
|
|
109
|
+
let res = await Super.super({
|
|
110
|
+
url,
|
|
111
|
+
serverKey,
|
|
112
|
+
method: "GET",
|
|
113
|
+
query: { sourceId, code },
|
|
114
|
+
});
|
|
115
|
+
return res.dtmplConfig;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
static async requestTtmplConfig(serverKey: string, sourceId: string) {
|
|
119
|
+
let url = `/v3/ttmpl/config`;
|
|
120
|
+
let res = await Super.super({
|
|
121
|
+
url,
|
|
122
|
+
serverKey,
|
|
123
|
+
method: "GET",
|
|
124
|
+
query: { sourceId },
|
|
125
|
+
});
|
|
126
|
+
return res.ttmplConfig;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static async requestViewDtmplConfig(serverKey: string, sourceId: string) {
|
|
130
|
+
let url = `/v3/view-dtmpl/config`;
|
|
131
|
+
let res = await Super.super({
|
|
132
|
+
url,
|
|
133
|
+
serverKey,
|
|
134
|
+
method: "GET",
|
|
135
|
+
query: { sourceId },
|
|
136
|
+
});
|
|
137
|
+
return res.dtmplConfig;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static async requestAddDtmplConfig(
|
|
141
|
+
serverKey: string,
|
|
142
|
+
sourceId: string,
|
|
143
|
+
addTmplId: string
|
|
144
|
+
) {
|
|
145
|
+
let url = `/v3/add-dtmpl/config`;
|
|
146
|
+
let res = await Super.super({
|
|
147
|
+
url,
|
|
148
|
+
serverKey,
|
|
149
|
+
method: "GET",
|
|
150
|
+
query: { sourceId, addTmplId },
|
|
151
|
+
});
|
|
152
|
+
return res.dtmplConfig;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static async requestSelectConfig(serverKey: string, sourceId) {
|
|
156
|
+
let url = `/v3/select/config`;
|
|
157
|
+
let res = await Super.super({
|
|
158
|
+
url,
|
|
159
|
+
serverKey,
|
|
160
|
+
method: "GET",
|
|
161
|
+
query: { sourceId },
|
|
162
|
+
});
|
|
163
|
+
return res.selectConfig;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static async requestLtmplConfig(serverKey: string, sourceId: string) {
|
|
167
|
+
let url = `/v3/ltmpl/config`;
|
|
168
|
+
let res = await Super.super({
|
|
169
|
+
url,
|
|
170
|
+
serverKey,
|
|
171
|
+
method: "GET",
|
|
172
|
+
query: { sourceId },
|
|
173
|
+
});
|
|
174
|
+
return res;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static async requestL2LtmplConfig(serverKey: string, sourceId) {
|
|
178
|
+
let url = `/v3/l2/ltmpl/config`;
|
|
179
|
+
let res = await Super.super({
|
|
180
|
+
url,
|
|
181
|
+
serverKey,
|
|
182
|
+
method: "GET",
|
|
183
|
+
query: { sourceId },
|
|
184
|
+
});
|
|
185
|
+
return res;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static async requestLtmplQueryKey(
|
|
189
|
+
serverKey: string,
|
|
190
|
+
sourceId: string,
|
|
191
|
+
condition?
|
|
192
|
+
) {
|
|
193
|
+
//console.log('condition:',condition);
|
|
194
|
+
let url = `/v3/ltmpl/query/key`;
|
|
195
|
+
let res = await Super.super({
|
|
196
|
+
url: url,
|
|
197
|
+
serverKey,
|
|
198
|
+
method: "GET",
|
|
199
|
+
query: { ...condition, sourceId },
|
|
200
|
+
});
|
|
201
|
+
return res;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
static async requestGttRootQueryKey(
|
|
205
|
+
serverKey: string,
|
|
206
|
+
sourceId: string,
|
|
207
|
+
condition?
|
|
208
|
+
) {
|
|
209
|
+
let url = `/v3/gtt/root-query/key`;
|
|
210
|
+
let res = await Super.super({
|
|
211
|
+
url: url,
|
|
212
|
+
serverKey,
|
|
213
|
+
method: "GET",
|
|
214
|
+
query: { ...condition, sourceId },
|
|
215
|
+
});
|
|
216
|
+
return res;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static async requestLtmplQueryTop(
|
|
220
|
+
serverKey: string,
|
|
221
|
+
sourceId: string,
|
|
222
|
+
condition
|
|
223
|
+
) {
|
|
224
|
+
// console.log('condition:',condition);
|
|
225
|
+
let url = `/v3/ltmpl/top-data`;
|
|
226
|
+
return await this.requestCommonLtmplQueryTop(
|
|
227
|
+
serverKey,
|
|
228
|
+
sourceId,
|
|
229
|
+
condition,
|
|
230
|
+
url
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
static async requestQueryReportData(
|
|
235
|
+
serverKey: string,
|
|
236
|
+
queryKey: string, language: string
|
|
237
|
+
) {
|
|
238
|
+
let url = "/v3/ltmpl/report-data";
|
|
239
|
+
let res = await Super.super({
|
|
240
|
+
url: url,
|
|
241
|
+
serverKey,
|
|
242
|
+
method: "GET",
|
|
243
|
+
query: { queryKey, language },
|
|
244
|
+
});
|
|
245
|
+
return res;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
static async requestTtmplRootData(
|
|
249
|
+
serverKey: string,
|
|
250
|
+
sourceId: string,
|
|
251
|
+
condition
|
|
252
|
+
) {
|
|
253
|
+
let url = `/v3/ttmpl/root-data`;
|
|
254
|
+
return await this.requestCommonLtmplQueryTop(
|
|
255
|
+
serverKey,
|
|
256
|
+
sourceId,
|
|
257
|
+
condition,
|
|
258
|
+
url
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
static async requestMstrucLtmplQueryTop(
|
|
263
|
+
serverKey: string,
|
|
264
|
+
sourceId: string,
|
|
265
|
+
condition
|
|
266
|
+
) {
|
|
267
|
+
//console.log('condition:',condition);
|
|
268
|
+
let url = `/v3/mstruc/ltmpl/top-data`;
|
|
269
|
+
return await this.requestCommonLtmplQueryTop(
|
|
270
|
+
serverKey,
|
|
271
|
+
sourceId,
|
|
272
|
+
condition,
|
|
273
|
+
url
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
static async queryTop1(serverKey: string, sourceId: string) {
|
|
278
|
+
let data = await this.requestMstrucLtmplQueryTop(serverKey, sourceId, {
|
|
279
|
+
top: 1,
|
|
280
|
+
});
|
|
281
|
+
let queriedCode = null;
|
|
282
|
+
if (data && data.entities && data.entities[0]) {
|
|
283
|
+
queriedCode = data.entities[0].code;
|
|
284
|
+
}
|
|
285
|
+
return queriedCode;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
static async requestCommonLtmplQueryTop(
|
|
289
|
+
serverKey: string,
|
|
290
|
+
sourceId: string,
|
|
291
|
+
condition,
|
|
292
|
+
url
|
|
293
|
+
) {
|
|
294
|
+
if (!sourceId) {
|
|
295
|
+
message.error("SourceId is undefined!", 5);
|
|
296
|
+
} else {
|
|
297
|
+
let res = await Super.super({
|
|
298
|
+
url: url,
|
|
299
|
+
serverKey,
|
|
300
|
+
method: "GET",
|
|
301
|
+
query: { ...condition, sourceId },
|
|
302
|
+
});
|
|
303
|
+
return res;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
static async requestSelectedData(serverKey: string, sourceId: string, codes) {
|
|
308
|
+
if (!codes) {
|
|
309
|
+
message.warning(translate("${没有选择实体}"));
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
let url = `/v3/field-group/data/selected`;
|
|
313
|
+
|
|
314
|
+
let res = await Super.super({
|
|
315
|
+
url: url,
|
|
316
|
+
serverKey,
|
|
317
|
+
query: { codes, sourceId },
|
|
318
|
+
method: "GET",
|
|
319
|
+
});
|
|
320
|
+
if (res.status === "success") {
|
|
321
|
+
return res.entities;
|
|
322
|
+
} else {
|
|
323
|
+
message.error(translate("${没有找到实体}!"), 5);
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
static isForeignLanguageMode() {
|
|
329
|
+
if (translate("${保存}") == "保存") {
|
|
330
|
+
return false;
|
|
331
|
+
} else {
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
static async requestVersionList(serverKey: string, sourceId: string, code, pageNo?: number) {
|
|
337
|
+
let res = await Super.super({
|
|
338
|
+
url: `/v3/dtmpl/data/versions`,
|
|
339
|
+
serverKey,
|
|
340
|
+
query: {
|
|
341
|
+
pageNo: pageNo ? pageNo : 1,
|
|
342
|
+
sourceId,
|
|
343
|
+
code,
|
|
344
|
+
},
|
|
345
|
+
method: "GET",
|
|
346
|
+
});
|
|
347
|
+
return res.versions;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
static async requestFieldVersionList(
|
|
351
|
+
serverKey: string,
|
|
352
|
+
sourceId: string,
|
|
353
|
+
code
|
|
354
|
+
) {
|
|
355
|
+
let res = await Super.super({
|
|
356
|
+
url: `/v3/dtmpl/field-data/versions`,
|
|
357
|
+
serverKey,
|
|
358
|
+
query: {
|
|
359
|
+
pageNo: 1,
|
|
360
|
+
sourceId,
|
|
361
|
+
code,
|
|
362
|
+
},
|
|
363
|
+
method: "GET",
|
|
364
|
+
});
|
|
365
|
+
return res.versions;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static async requestCommonDtmplData(
|
|
369
|
+
serverKey: string,
|
|
370
|
+
sourceId: string,
|
|
371
|
+
code,
|
|
372
|
+
versionId,
|
|
373
|
+
url
|
|
374
|
+
) {
|
|
375
|
+
let res = await Super.super({
|
|
376
|
+
url,
|
|
377
|
+
serverKey,
|
|
378
|
+
query: {
|
|
379
|
+
code,
|
|
380
|
+
versionId,
|
|
381
|
+
sourceId,
|
|
382
|
+
},
|
|
383
|
+
method: "GET",
|
|
384
|
+
});
|
|
385
|
+
if (res?.status === "success") {
|
|
386
|
+
return { sourceId, ...res.entity };
|
|
387
|
+
} else {
|
|
388
|
+
//message.error(translate("${实体不存在}!"),5);
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static async requestDtmplData(
|
|
394
|
+
serverKey: string,
|
|
395
|
+
sourceId: string,
|
|
396
|
+
code,
|
|
397
|
+
versionId
|
|
398
|
+
) {
|
|
399
|
+
let url = `/v3/dtmpl/data`;
|
|
400
|
+
return await this.requestCommonDtmplData(
|
|
401
|
+
serverKey,
|
|
402
|
+
sourceId,
|
|
403
|
+
code,
|
|
404
|
+
versionId,
|
|
405
|
+
url
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
static async getDtmplData(
|
|
410
|
+
dtmplConfig: DtmplConfig,
|
|
411
|
+
serverKey: string,
|
|
412
|
+
sourceId: string,
|
|
413
|
+
code
|
|
414
|
+
) {
|
|
415
|
+
let dtmplData_;
|
|
416
|
+
if (dtmplConfig && dtmplConfig.dynamic) {
|
|
417
|
+
dtmplData_ = dtmplConfig.entity;
|
|
418
|
+
}
|
|
419
|
+
if (!dtmplData_) {
|
|
420
|
+
dtmplData_ = await this.requestDtmplData(serverKey, sourceId, code, null);
|
|
421
|
+
}
|
|
422
|
+
return dtmplData_;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
static async requestMstrucDtmplData(
|
|
426
|
+
serverKey: string,
|
|
427
|
+
sourceId: string,
|
|
428
|
+
code,
|
|
429
|
+
versionId
|
|
430
|
+
) {
|
|
431
|
+
let url = `/v3/mstruc/dtmpl/data`;
|
|
432
|
+
return await this.requestCommonDtmplData(
|
|
433
|
+
serverKey,
|
|
434
|
+
sourceId,
|
|
435
|
+
code,
|
|
436
|
+
versionId,
|
|
437
|
+
url
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
static async requestViewDtmplData(
|
|
442
|
+
serverKey: string,
|
|
443
|
+
sourceId: string,
|
|
444
|
+
code,
|
|
445
|
+
versionId
|
|
446
|
+
) {
|
|
447
|
+
let url = `/v3/view-dtmpl/data`;
|
|
448
|
+
return await this.requestCommonDtmplData(
|
|
449
|
+
serverKey,
|
|
450
|
+
sourceId,
|
|
451
|
+
code,
|
|
452
|
+
versionId,
|
|
453
|
+
url
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
static async requestMstrucViewDtmplData(
|
|
458
|
+
serverKey: string,
|
|
459
|
+
sourceId,
|
|
460
|
+
code,
|
|
461
|
+
versionId
|
|
462
|
+
) {
|
|
463
|
+
let url = `/v3/mstruc/view-dtmpl/data`;
|
|
464
|
+
return await this.requestCommonDtmplData(
|
|
465
|
+
serverKey,
|
|
466
|
+
sourceId,
|
|
467
|
+
code,
|
|
468
|
+
versionId,
|
|
469
|
+
url
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
static async postCommonDtmplData(
|
|
474
|
+
serverKey: string,
|
|
475
|
+
sourceId: string,
|
|
476
|
+
formDataObj,
|
|
477
|
+
message,
|
|
478
|
+
url
|
|
479
|
+
) {
|
|
480
|
+
const formData = new FormData();
|
|
481
|
+
for (let k in formDataObj) {
|
|
482
|
+
if (!k.startsWith("$virtual")) {
|
|
483
|
+
formData.append(
|
|
484
|
+
k,
|
|
485
|
+
formDataObj[k] || formDataObj[k] == 0 ? formDataObj[k] : ""
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
formData.append("sourceId", sourceId.toString());
|
|
490
|
+
let res = await Super.super(
|
|
491
|
+
{
|
|
492
|
+
url,
|
|
493
|
+
serverKey,
|
|
494
|
+
data: formData,
|
|
495
|
+
method: "POST",
|
|
496
|
+
},
|
|
497
|
+
"formdata"
|
|
498
|
+
);
|
|
499
|
+
let code = null;
|
|
500
|
+
if (res) {
|
|
501
|
+
if (res.status === "success") {
|
|
502
|
+
if (message) {
|
|
503
|
+
if (res.message) {
|
|
504
|
+
message.warning(translate("${保存成功}!") + res.message, 4);
|
|
505
|
+
} else {
|
|
506
|
+
message.success(translate("${保存成功}!"), 1);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
code = res.entityCode ? res.entityCode : res.code;
|
|
510
|
+
}
|
|
511
|
+
// else {
|
|
512
|
+
// if (message) {
|
|
513
|
+
// message.error("保存失败");
|
|
514
|
+
// }
|
|
515
|
+
// }
|
|
516
|
+
} else {
|
|
517
|
+
if (message) {
|
|
518
|
+
message.error(translate("${保存失败}!"), 5);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return { code, status: res ? res.status : "error" };
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
static async postDtmplData(
|
|
525
|
+
serverKey: string,
|
|
526
|
+
sourceId: string,
|
|
527
|
+
formDataObj,
|
|
528
|
+
message
|
|
529
|
+
) {
|
|
530
|
+
let url = `/v3/dtmpl/data`;
|
|
531
|
+
return await this.postCommonDtmplData(
|
|
532
|
+
serverKey,
|
|
533
|
+
sourceId,
|
|
534
|
+
formDataObj,
|
|
535
|
+
message,
|
|
536
|
+
url
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
static async postLtmplData(
|
|
541
|
+
serverKey: string,
|
|
542
|
+
sourceId: string,
|
|
543
|
+
formDataObj,
|
|
544
|
+
message
|
|
545
|
+
) {
|
|
546
|
+
let url = `/v3/ltmpl/data`;
|
|
547
|
+
return await this.postCommonDtmplData(
|
|
548
|
+
serverKey,
|
|
549
|
+
sourceId,
|
|
550
|
+
formDataObj,
|
|
551
|
+
message,
|
|
552
|
+
url
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
static async postLtmplMultiData(
|
|
557
|
+
serverKey: string,
|
|
558
|
+
sourceId: string,
|
|
559
|
+
formDataObj,
|
|
560
|
+
message
|
|
561
|
+
) {
|
|
562
|
+
let url = `/v3/ltmpl/multi-data`;
|
|
563
|
+
return await this.postCommonDtmplData(
|
|
564
|
+
serverKey,
|
|
565
|
+
sourceId,
|
|
566
|
+
formDataObj,
|
|
567
|
+
message,
|
|
568
|
+
url
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
static async postMstrucDtmplData(
|
|
573
|
+
serverKey: string,
|
|
574
|
+
sourceId: string,
|
|
575
|
+
formDataObj,
|
|
576
|
+
message
|
|
577
|
+
) {
|
|
578
|
+
let url = `/v3/mstruc/dtmpl/data`;
|
|
579
|
+
return await this.postCommonDtmplData(
|
|
580
|
+
serverKey,
|
|
581
|
+
sourceId,
|
|
582
|
+
formDataObj,
|
|
583
|
+
message,
|
|
584
|
+
url
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
static postFileAction(serverKey: string, file) {
|
|
589
|
+
return Units.joinPath(Units.api(serverKey), "/v3/upload");
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// static async postFile(formData, message) {
|
|
593
|
+
// let res = await Super.super({
|
|
594
|
+
// url: `/v3/upload`,
|
|
595
|
+
// data: formData,
|
|
596
|
+
// method: 'POST'
|
|
597
|
+
// }, 'formdata')
|
|
598
|
+
// let fileKey = null;
|
|
599
|
+
// if (res) {
|
|
600
|
+
// if (res.status === "success") {
|
|
601
|
+
// if (message) {
|
|
602
|
+
// message.success("上传成功! ")
|
|
603
|
+
// }
|
|
604
|
+
// fileKey = res.fileKey;
|
|
605
|
+
// }
|
|
606
|
+
// } else {
|
|
607
|
+
// if (message) {
|
|
608
|
+
// message.error("上传失败!");
|
|
609
|
+
// }
|
|
610
|
+
// }
|
|
611
|
+
// return fileKey;
|
|
612
|
+
// }
|
|
613
|
+
|
|
614
|
+
static async requestL2LtmplQueryKey(serverKey: string, sourceId, condition) {
|
|
615
|
+
let url = `v3/l2/ltmpl/query/key`;
|
|
616
|
+
let res = await Super.super({
|
|
617
|
+
url,
|
|
618
|
+
serverKey,
|
|
619
|
+
method: "GET",
|
|
620
|
+
query: { ...condition, sourceId },
|
|
621
|
+
});
|
|
622
|
+
return res;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
static async requestLtmplCount(serverKey: string, sourceId) {
|
|
626
|
+
let url = `/v3/ltmpl/data/count`;
|
|
627
|
+
let res = await Super.super({
|
|
628
|
+
url,
|
|
629
|
+
serverKey,
|
|
630
|
+
query: { sourceId },
|
|
631
|
+
method: "GET",
|
|
632
|
+
});
|
|
633
|
+
return res.count;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
static async requestQueryData(
|
|
637
|
+
serverKey: string,
|
|
638
|
+
queryKey: string,
|
|
639
|
+
pageInfo: PageInfo
|
|
640
|
+
) {
|
|
641
|
+
let res = await Super.super({
|
|
642
|
+
url: `/v3/ltmpl/query/data`,
|
|
643
|
+
serverKey,
|
|
644
|
+
method: "GET",
|
|
645
|
+
query: { queryKey, ...pageInfo },
|
|
646
|
+
});
|
|
647
|
+
return res;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
static getCodesOfSelectedRows(selectedRows: SelectedRow[]) {
|
|
651
|
+
let codes: string[] = [];
|
|
652
|
+
if (!selectedRows || selectedRows.length < 1) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
for (let item of selectedRows) {
|
|
657
|
+
if (item.code) {
|
|
658
|
+
codes.push(item.code);
|
|
659
|
+
} else {
|
|
660
|
+
message.error(translate("${没找到所选数据的Code}!!"), 5);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (codes.length < 1) {
|
|
665
|
+
message.error(translate("${没找到所选数据的Code}!!"), 5);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return codes;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
static async deleteData(
|
|
672
|
+
serverKey: string,
|
|
673
|
+
sourceId,
|
|
674
|
+
selectedRows: SelectedRow[],
|
|
675
|
+
mainCode?
|
|
676
|
+
) {
|
|
677
|
+
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
678
|
+
return await this.deleteByCode(serverKey, sourceId, codes, mainCode);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
static async deleteByCode(
|
|
682
|
+
serverKey: string,
|
|
683
|
+
sourceId,
|
|
684
|
+
codes: string[],
|
|
685
|
+
mainCode?
|
|
686
|
+
) {
|
|
687
|
+
let res = await Super.super({
|
|
688
|
+
url: `/v3/ltmpl/data`,
|
|
689
|
+
serverKey,
|
|
690
|
+
data: {
|
|
691
|
+
codes,
|
|
692
|
+
sourceId,
|
|
693
|
+
mainCode,
|
|
694
|
+
},
|
|
695
|
+
method: "DELETE",
|
|
696
|
+
});
|
|
697
|
+
if (res && res.status == "success") {
|
|
698
|
+
message.success(translate("${删除成功}"), 1);
|
|
699
|
+
return true;
|
|
700
|
+
} else {
|
|
701
|
+
message.error(translate("${删除失败}"), 3);
|
|
702
|
+
//console.log("删除失败消息",res.message);
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
static async requestQueryAggregates(serverKey: string, queryKey: string) {
|
|
708
|
+
let res = await Super.super({
|
|
709
|
+
url: `/v3/ltmpl/query/count`,
|
|
710
|
+
serverKey,
|
|
711
|
+
method: "GET",
|
|
712
|
+
query: { queryKey },
|
|
713
|
+
});
|
|
714
|
+
return res;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
static async doPostRequest(serverKey: string, url: string, params?: object) {
|
|
718
|
+
let res = await Super.super({
|
|
719
|
+
url,
|
|
720
|
+
serverKey,
|
|
721
|
+
method: "POST",
|
|
722
|
+
data: { ...params },
|
|
723
|
+
});
|
|
724
|
+
return res;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
static async doGetRequest(serverKey: string, url: string, params?: object) {
|
|
728
|
+
let res = await Super.super({
|
|
729
|
+
url,
|
|
730
|
+
serverKey,
|
|
731
|
+
method: "GET",
|
|
732
|
+
query: { ...params },
|
|
733
|
+
});
|
|
734
|
+
return res;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
static async requestChartData(
|
|
738
|
+
serverKey: string,
|
|
739
|
+
sourceId: string,
|
|
740
|
+
params?: object
|
|
741
|
+
) {
|
|
742
|
+
let res = await Super.super({
|
|
743
|
+
url: `/v3/chart/data`,
|
|
744
|
+
serverKey,
|
|
745
|
+
method: "GET",
|
|
746
|
+
query: { sourceId, ...params },
|
|
747
|
+
});
|
|
748
|
+
return res;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
static async requestCharMultitData(
|
|
752
|
+
serverKey: string,
|
|
753
|
+
dataSourceConfigs: string
|
|
754
|
+
) {
|
|
755
|
+
let res = await Super.super({
|
|
756
|
+
url: `/v3/chart/multi-data`,
|
|
757
|
+
serverKey,
|
|
758
|
+
method: "GET",
|
|
759
|
+
query: { dataSourceConfigs },
|
|
760
|
+
});
|
|
761
|
+
return res;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
static async requestCharWSConfig(
|
|
765
|
+
serverKey: string,
|
|
766
|
+
sourceIds: string[]
|
|
767
|
+
) {
|
|
768
|
+
let res = await Super.super({
|
|
769
|
+
url: `/v3/chart/ws/config`,
|
|
770
|
+
serverKey,
|
|
771
|
+
method: "GET",
|
|
772
|
+
query: { sourceIds },
|
|
773
|
+
});
|
|
774
|
+
return res;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
static async postActions(
|
|
778
|
+
serverKey: string,
|
|
779
|
+
actionId: string,
|
|
780
|
+
selectedRows: SelectedRow[],
|
|
781
|
+
actionDataObj?: Object
|
|
782
|
+
) {
|
|
783
|
+
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
784
|
+
const formData = new FormData();
|
|
785
|
+
for (let k in actionDataObj) {
|
|
786
|
+
formData.append(k, actionDataObj[k] ? actionDataObj[k] : "");
|
|
787
|
+
}
|
|
788
|
+
formData.append("sourceId", actionId.toString());
|
|
789
|
+
formData.append("codes", codes.join(","));
|
|
790
|
+
let res = await Super.super(
|
|
791
|
+
{
|
|
792
|
+
url: `/v3/action`,
|
|
793
|
+
serverKey,
|
|
794
|
+
data: formData,
|
|
795
|
+
method: "POST",
|
|
796
|
+
},
|
|
797
|
+
"formdata",
|
|
798
|
+
null
|
|
799
|
+
);
|
|
800
|
+
return res;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
static async increCalc(serverKey: string, sourceId: string, params = {}) {
|
|
805
|
+
let res = await Super.super({
|
|
806
|
+
url: `/v3/stat/increcalc`,
|
|
807
|
+
serverKey,
|
|
808
|
+
method: "POST",
|
|
809
|
+
data: { ...params, sourceId },
|
|
810
|
+
});
|
|
811
|
+
if (res && res.status === "success") {
|
|
812
|
+
message.success(translate("${统计成功}"), 1);
|
|
813
|
+
} else {
|
|
814
|
+
message.error(translate("${统计失败}"));
|
|
815
|
+
}
|
|
816
|
+
return res;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
static async saveRatmplSelectCodes(
|
|
820
|
+
serverKey: string,
|
|
821
|
+
sourceId: string,
|
|
822
|
+
mainCode,
|
|
823
|
+
codes: string[]
|
|
824
|
+
) {
|
|
825
|
+
let res = await Super.super({
|
|
826
|
+
url: `/v3/ratmpl-select/data`,
|
|
827
|
+
serverKey,
|
|
828
|
+
method: "POST",
|
|
829
|
+
data: { codes, mainCode, sourceId },
|
|
830
|
+
});
|
|
831
|
+
if (res && res.status != "success") {
|
|
832
|
+
message.error(translate("${" + res.message + "}"));
|
|
833
|
+
}
|
|
834
|
+
return res;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
static async doCopy(
|
|
838
|
+
serverKey: string,
|
|
839
|
+
sourceId: string,
|
|
840
|
+
code: string,
|
|
841
|
+
copyRelation?,
|
|
842
|
+
copyOpp2One?
|
|
843
|
+
) {
|
|
844
|
+
let res = await Super.super(
|
|
845
|
+
{
|
|
846
|
+
url: `/v3/mstruc/copy-data`,
|
|
847
|
+
serverKey,
|
|
848
|
+
method: "POST",
|
|
849
|
+
query: {
|
|
850
|
+
sourceId,
|
|
851
|
+
code,
|
|
852
|
+
copyRelation,
|
|
853
|
+
copyOpp2One,
|
|
854
|
+
},
|
|
855
|
+
},
|
|
856
|
+
null,
|
|
857
|
+
null
|
|
858
|
+
);
|
|
859
|
+
if (res && res.status == "success") {
|
|
860
|
+
if (res.message) {
|
|
861
|
+
message.info(res.message, 4);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return res.entityCode;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// static downloadDetailExcel(sourceId, entityCode) {
|
|
868
|
+
// const hydrocarbonToken = Units.hydrocarbonToken();
|
|
869
|
+
// let url = Units.joinPath(Units.api(), `/v3/dtmpl/excel`)+`?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
|
|
870
|
+
// Units.downloadFile(url, "详情");
|
|
871
|
+
// }
|
|
872
|
+
|
|
873
|
+
static async queryCode(
|
|
874
|
+
sourceId: string,
|
|
875
|
+
codeSource: CodeSource,
|
|
876
|
+
serverKey?: string
|
|
877
|
+
) {
|
|
878
|
+
let queriedCode = undefined;
|
|
879
|
+
if (codeSource) {
|
|
880
|
+
if (codeSource == "listop") {
|
|
881
|
+
queriedCode = await this.queryTop1(serverKey, sourceId);
|
|
882
|
+
if (!queriedCode) {
|
|
883
|
+
queriedCode = "bad-code";
|
|
884
|
+
}
|
|
885
|
+
} else if (codeSource == "listop-new") {
|
|
886
|
+
queriedCode = await this.queryTop1(serverKey, sourceId);
|
|
887
|
+
} else if (codeSource == "new") {
|
|
888
|
+
queriedCode = null;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return queriedCode;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
static download(serverKey: string, path) {
|
|
895
|
+
let vars = path.split("/");
|
|
896
|
+
let fileName = vars[vars.length - 1];
|
|
897
|
+
this.downloadDir(this.getFileUrl(serverKey, path), fileName);
|
|
898
|
+
// let vars = path.split("/");
|
|
899
|
+
// let fileName = vars[vars.length - 1];
|
|
900
|
+
// Units.downloadFile(
|
|
901
|
+
// this.getFileUrl(serverKey, path) + `&disposition=attachment`,
|
|
902
|
+
// fileName
|
|
903
|
+
// );
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
static downloadDir(path, fileName) {
|
|
907
|
+
// let fileName = this.getFileNameFrom(path);
|
|
908
|
+
Units.downloadFile(path + `&disposition=attachment`, fileName);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
static openfile(serverKey: string, path, toolbar) {
|
|
912
|
+
let vars = path.split("/");
|
|
913
|
+
let fileName = vars[vars.length - 1];
|
|
914
|
+
this.openfileDir(fileName, this.getFileUrl(serverKey, path), toolbar);
|
|
915
|
+
// Units.openFile(this.getFileUrl(serverKey, path), fileName, toolbar);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
static getFileNameFrom(path) {
|
|
919
|
+
if (!path) {
|
|
920
|
+
return undefined;
|
|
921
|
+
}
|
|
922
|
+
let vars = path.split("/");
|
|
923
|
+
let fileName = vars[vars.length - 1];
|
|
924
|
+
return fileName;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
static getFileSuffixFrom(fileName) {
|
|
928
|
+
if (!fileName) {
|
|
929
|
+
return undefined;
|
|
930
|
+
}
|
|
931
|
+
let ss = fileName.split(".");
|
|
932
|
+
if (ss.length > 1) {
|
|
933
|
+
return ss.pop();
|
|
934
|
+
} else {
|
|
935
|
+
return undefined;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
static openfileDir(path, fileName, toolbar) {
|
|
940
|
+
//let fileName = this.getFileNameFrom(path);
|
|
941
|
+
Units.openFile(path, fileName, toolbar);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
static getFileUrl(serverKey: string, path: string) {
|
|
945
|
+
const hydrocarbonToken = Units.serverHydrocarbonToken(serverKey);
|
|
946
|
+
const programCode = Units.programCode(serverKey);
|
|
947
|
+
const applicationCode = Units.applicationCode(serverKey);
|
|
948
|
+
let root;
|
|
949
|
+
let url;
|
|
950
|
+
//判断是否为全URL
|
|
951
|
+
if (path?.startsWith("http") || path?.startsWith("HTTP")) {
|
|
952
|
+
root = path;
|
|
953
|
+
if (path.indexOf("?") > 0) {
|
|
954
|
+
url = root +
|
|
955
|
+
`&@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
956
|
+
} else {
|
|
957
|
+
url = root +
|
|
958
|
+
`?@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
959
|
+
}
|
|
960
|
+
} else {
|
|
961
|
+
root = Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files", path));
|
|
962
|
+
url = root +
|
|
963
|
+
`?@token=${hydrocarbonToken}&@programToken=${programCode}&@applicationToken=${applicationCode}`;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
let encodeUri = encodeURI(url);
|
|
967
|
+
return encodeUri;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
static async loadFileTxt(serverKey: string, path) {
|
|
972
|
+
let res = await Super.super({
|
|
973
|
+
url: encodeURI(Units.joinPath("/v3/files/text", path)),
|
|
974
|
+
serverKey,
|
|
975
|
+
method: "GET",
|
|
976
|
+
});
|
|
977
|
+
return res.text;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
static async requestBlocks(
|
|
982
|
+
l2MenuId: string,
|
|
983
|
+
blockId: string,
|
|
984
|
+
programCode?: string,
|
|
985
|
+
applicationCode?: string
|
|
986
|
+
): Promise<MenuConfigAPIType> {
|
|
987
|
+
let url = `/v3/menu/blocks`;
|
|
988
|
+
let res = await Super.super({
|
|
989
|
+
url: url,
|
|
990
|
+
method: "GET",
|
|
991
|
+
header: { programCode, applicationCode },
|
|
992
|
+
query: {
|
|
993
|
+
l2MenuId,
|
|
994
|
+
blockId,
|
|
995
|
+
},
|
|
996
|
+
});
|
|
997
|
+
return res;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
static async requestBlockMenuAuths() {
|
|
1001
|
+
let url = `/v3/menu/block-menu-auths`;
|
|
1002
|
+
let res = await Super.super({
|
|
1003
|
+
url: url,
|
|
1004
|
+
method: "GET",
|
|
1005
|
+
query: {},
|
|
1006
|
+
});
|
|
1007
|
+
return res?.blocks;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
static async requestRoleAuths(roleCode: string) {
|
|
1011
|
+
let url = `/v3/auth/role-auths`;
|
|
1012
|
+
let res = await Super.super({
|
|
1013
|
+
url: url,
|
|
1014
|
+
method: "GET",
|
|
1015
|
+
query: {
|
|
1016
|
+
roleCode,
|
|
1017
|
+
},
|
|
1018
|
+
});
|
|
1019
|
+
return res;
|
|
1020
|
+
}
|
|
1021
|
+
static async postRoleAuths(roleCode: string, auths: string[]) {
|
|
1022
|
+
let url = `/v3/auth/role-auths`;
|
|
1023
|
+
let res = await Super.super({
|
|
1024
|
+
url: url,
|
|
1025
|
+
method: "POST",
|
|
1026
|
+
query: {
|
|
1027
|
+
roleCode,
|
|
1028
|
+
auths,
|
|
1029
|
+
},
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
return res;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
static async logout() {
|
|
1036
|
+
Super.super({
|
|
1037
|
+
url: "/v3/auth/token",
|
|
1038
|
+
method: "DELETE",
|
|
1039
|
+
}).then((res) => {
|
|
1040
|
+
Units.toLogin();
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
static async logout2() {
|
|
1045
|
+
return Super.super({
|
|
1046
|
+
url: "/v3/auth/token",
|
|
1047
|
+
method: "DELETE",
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
static async resetPassword(
|
|
1052
|
+
serverKey: string,
|
|
1053
|
+
oPassword: string,
|
|
1054
|
+
nPassword: string,
|
|
1055
|
+
pubkey
|
|
1056
|
+
) {
|
|
1057
|
+
let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
|
|
1058
|
+
let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
|
|
1059
|
+
let res = await Super.super({
|
|
1060
|
+
url: "/v3/auth/password",
|
|
1061
|
+
serverKey,
|
|
1062
|
+
query: {
|
|
1063
|
+
oldPassword,
|
|
1064
|
+
newPassword,
|
|
1065
|
+
},
|
|
1066
|
+
method: "POST",
|
|
1067
|
+
});
|
|
1068
|
+
|
|
1069
|
+
return res;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
static async resetPassword2(
|
|
1073
|
+
serverKey: string, userName: string,
|
|
1074
|
+
oPassword: string,
|
|
1075
|
+
nPassword: string,
|
|
1076
|
+
pubkey
|
|
1077
|
+
) {
|
|
1078
|
+
let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
|
|
1079
|
+
let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
|
|
1080
|
+
let res = await Super.super({
|
|
1081
|
+
url: "/v3/auth/password2",
|
|
1082
|
+
serverKey,
|
|
1083
|
+
query: {
|
|
1084
|
+
userName,
|
|
1085
|
+
oldPassword,
|
|
1086
|
+
newPassword,
|
|
1087
|
+
},
|
|
1088
|
+
method: "POST",
|
|
1089
|
+
});
|
|
1090
|
+
|
|
1091
|
+
return res;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
static async getContextSourceConfig() {
|
|
1095
|
+
let res = await Super.super({
|
|
1096
|
+
url: "/v3/context-source-config",
|
|
1097
|
+
method: "GET",
|
|
1098
|
+
});
|
|
1099
|
+
if (res) {
|
|
1100
|
+
return res.config;
|
|
1101
|
+
} else {
|
|
1102
|
+
return null;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
static async getContextSourceValue() {
|
|
1107
|
+
let res = await Super.super({
|
|
1108
|
+
url: "/v3/auth/context-source-value",
|
|
1109
|
+
method: "GET",
|
|
1110
|
+
});
|
|
1111
|
+
return res ? res.value : null;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
static async loginServer(serverKey: string, username: string, password: string) {
|
|
1115
|
+
let pubkey = await this.getRasPubkey(serverKey);
|
|
1116
|
+
if (pubkey) {
|
|
1117
|
+
let json = { username, password };
|
|
1118
|
+
let res = await this.login(json, null, null, pubkey, null, serverKey);
|
|
1119
|
+
if (res.status == "success") {
|
|
1120
|
+
Units.setServerHydrocarbonToken(serverKey, res.token);
|
|
1121
|
+
return res;
|
|
1122
|
+
} else {
|
|
1123
|
+
return { status: "error", message: "登陆失败" }
|
|
1124
|
+
}
|
|
1125
|
+
} else {
|
|
1126
|
+
return { status: "error", message: "登陆失败" }
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
static async login(
|
|
1131
|
+
json,
|
|
1132
|
+
kaptchaToken,
|
|
1133
|
+
kaptchaText,
|
|
1134
|
+
pubkey,
|
|
1135
|
+
programCode?: string,
|
|
1136
|
+
serverKey?: string,
|
|
1137
|
+
applicationCode?: string
|
|
1138
|
+
) {
|
|
1139
|
+
let datetime = dayjs(new Date())
|
|
1140
|
+
.tz("Europe/London")
|
|
1141
|
+
.format("YYYY-MM-DD HH:mm:ss");
|
|
1142
|
+
json["datetime"] = datetime;
|
|
1143
|
+
|
|
1144
|
+
let userInfo = EncryptUtils.rsaEncrypt(JSON.stringify(json), pubkey);
|
|
1145
|
+
|
|
1146
|
+
let res = await Super.super({
|
|
1147
|
+
url: "/v3/auth/hctoken",
|
|
1148
|
+
serverKey,
|
|
1149
|
+
header: { programCode, applicationCode },
|
|
1150
|
+
query: {
|
|
1151
|
+
userInfo,
|
|
1152
|
+
kaptchaToken,
|
|
1153
|
+
kaptchaText,
|
|
1154
|
+
},
|
|
1155
|
+
method: "GET",
|
|
1156
|
+
});
|
|
1157
|
+
if (res.passwordState) {
|
|
1158
|
+
if (res.passwordState == "expiry") {
|
|
1159
|
+
message.warning(translate("${" + res.message + "}"), 10);
|
|
1160
|
+
} else if (res.passwordState == "expiried") {
|
|
1161
|
+
message.error(translate("${" + res.message + "}"), 10)
|
|
1162
|
+
} else if (res.passwordState == "restricted") {
|
|
1163
|
+
message.error(translate("${" + res.message + "}"), 15)
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
return { status: res.status, token: res.token };
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
static async setContext(json) {
|
|
1170
|
+
const formData = new FormData();
|
|
1171
|
+
formData.append("context", JSON.stringify(json));
|
|
1172
|
+
let res = await Super.super(
|
|
1173
|
+
{
|
|
1174
|
+
url: "/v3/auth/context",
|
|
1175
|
+
data: formData,
|
|
1176
|
+
method: "POST",
|
|
1177
|
+
},
|
|
1178
|
+
"formdata"
|
|
1179
|
+
);
|
|
1180
|
+
|
|
1181
|
+
if (res && res.status === "success") {
|
|
1182
|
+
window.location.hash = "#/home";
|
|
1183
|
+
}
|
|
1184
|
+
return res;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
static async getKaptchaToken(programCode?: string, applicationCode?: string) {
|
|
1188
|
+
let res = await Super.super({
|
|
1189
|
+
url: "/v3/auth/kaptcha",
|
|
1190
|
+
header: { programCode, applicationCode },
|
|
1191
|
+
method: "POST",
|
|
1192
|
+
});
|
|
1193
|
+
if (res && res.status === "success") {
|
|
1194
|
+
return res;
|
|
1195
|
+
} else {
|
|
1196
|
+
return null;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
static async getRasPubkey(serverKey?: string, programCode?: string, applicationCode?: string) {
|
|
1201
|
+
let res = await Super.super({
|
|
1202
|
+
url: "/v3/auth/ras-pubkey",
|
|
1203
|
+
header: { programCode, applicationCode },
|
|
1204
|
+
serverKey,
|
|
1205
|
+
method: "GET",
|
|
1206
|
+
});
|
|
1207
|
+
if (res && res.status === "success") {
|
|
1208
|
+
return res.rasPubkey;
|
|
1209
|
+
} else {
|
|
1210
|
+
return null;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
static async getUser(programCode?: string, hydrocarbonToken?: string, applicationCode?: string) {
|
|
1215
|
+
let res = await Super.super({
|
|
1216
|
+
header: { programCode, hydrocarbonToken, applicationCode },
|
|
1217
|
+
url: "/v3/current-user",
|
|
1218
|
+
});
|
|
1219
|
+
return res ? res.user : null;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
static async requestFastMenu() {
|
|
1223
|
+
let url = `/v3/menu/fast-menu`;
|
|
1224
|
+
let res = await Super.super({
|
|
1225
|
+
url: url,
|
|
1226
|
+
method: "GET",
|
|
1227
|
+
});
|
|
1228
|
+
return res ? res.fastMenu : null;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
static async reload() {
|
|
1232
|
+
let url = `/v3/tmpl/reload`;
|
|
1233
|
+
let res = await Super.super({
|
|
1234
|
+
url: url,
|
|
1235
|
+
method: "GET",
|
|
1236
|
+
});
|
|
1237
|
+
return res;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
static async getAllLang(serverKey?: string) {
|
|
1241
|
+
let url = "/v3/languages";
|
|
1242
|
+
const data = {
|
|
1243
|
+
url,
|
|
1244
|
+
method: "GET",
|
|
1245
|
+
};
|
|
1246
|
+
if (serverKey !== undefined) data["serverKey"] = serverKey;
|
|
1247
|
+
let res = await Super.super(data);
|
|
1248
|
+
return res;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
static async getLocale(lang, serverKey?: string) {
|
|
1254
|
+
let url = "/v3/multilingual";
|
|
1255
|
+
const data = {
|
|
1256
|
+
url: `${url}?language=${lang}`,
|
|
1257
|
+
method: "GET",
|
|
1258
|
+
};
|
|
1259
|
+
if (serverKey !== undefined) data["serverKey"] = serverKey;
|
|
1260
|
+
let res = await Super.super(data);
|
|
1261
|
+
return res;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
static async initProgramConfig(ProgramConfigJson) {
|
|
1267
|
+
//设置项目配置信息
|
|
1268
|
+
if (ProgramConfigJson["programCode"]) {
|
|
1269
|
+
ProgramConfig.setProgramCode(ProgramConfigJson["programCode"]);
|
|
1270
|
+
}
|
|
1271
|
+
if (ProgramConfigJson["applicationCode"]) {
|
|
1272
|
+
ProgramConfig.setApplicationCode(ProgramConfigJson["applicationCode"]);
|
|
1273
|
+
}
|
|
1274
|
+
if (ProgramConfigJson["hydrocarbonServer"]) {
|
|
1275
|
+
ProgramConfig.setHydrocarbonServer(
|
|
1276
|
+
ProgramConfigJson["hydrocarbonServer"]
|
|
1277
|
+
);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
//注册扩展服务器
|
|
1281
|
+
if (ProgramConfigJson["extendServer"]) {
|
|
1282
|
+
let extend = ProgramConfigJson["extendServer"];
|
|
1283
|
+
if (typeof extend == "object") {
|
|
1284
|
+
let extendServers = [];
|
|
1285
|
+
if (Array.isArray(extend)) {
|
|
1286
|
+
extendServers = extend;
|
|
1287
|
+
} else {
|
|
1288
|
+
extendServers.push(extend);
|
|
1289
|
+
}
|
|
1290
|
+
ProgramConfig.putExtendServers(extendServers);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
ProgramConfig.setProgramName(ProgramConfigJson["programName"]);
|
|
1295
|
+
ProgramConfig.setProgramName_sub(ProgramConfigJson["programName_sub"]);
|
|
1296
|
+
ProgramConfig.setProgramName_NavLeft(
|
|
1297
|
+
ProgramConfigJson["programName_NavLeft"]
|
|
1298
|
+
);
|
|
1299
|
+
ProgramConfig.setProgramName_Logo(ProgramConfigJson["programName_Logo"]);
|
|
1300
|
+
ProgramConfig.setThemes(ProgramConfigJson["themes"]);
|
|
1301
|
+
ProgramConfig.setDefaultTheme(ProgramConfigJson["defaultTheme"]);
|
|
1302
|
+
|
|
1303
|
+
let result = await Super.getProramConfig();
|
|
1304
|
+
|
|
1305
|
+
if (result) {
|
|
1306
|
+
//console.log('result',result)
|
|
1307
|
+
//先放入programCode
|
|
1308
|
+
ProgramConfig.setProgramCode(result.programCode);
|
|
1309
|
+
ProgramConfig.setApplicationCode(result.applicationCode);
|
|
1310
|
+
ProgramConfig.setHydrocarbonServer(result.hydrocarbonServer);
|
|
1311
|
+
ProgramConfig.setProgramName(result.programName);
|
|
1312
|
+
ProgramConfig.setProgramName_sub(result.programName_sub);
|
|
1313
|
+
ProgramConfig.setProgramName_NavLeft(result.programName_NavLeft);
|
|
1314
|
+
ProgramConfig.setProgramName_Logo(result.programName_Logo);
|
|
1315
|
+
ProgramConfig.setThemes(result.themes);
|
|
1316
|
+
ProgramConfig.setDefaultTheme(result.defaultTheme);
|
|
1317
|
+
//注册扩展服务器
|
|
1318
|
+
if (result.extendServer) {
|
|
1319
|
+
let extend = result.extendServer;
|
|
1320
|
+
if (typeof extend == "object") {
|
|
1321
|
+
let extendServers = [];
|
|
1322
|
+
if (Array.isArray(extend)) {
|
|
1323
|
+
extendServers = extend;
|
|
1324
|
+
} else {
|
|
1325
|
+
extendServers.push(extend);
|
|
1326
|
+
}
|
|
1327
|
+
ProgramConfig.putExtendServers(extendServers);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
static async requestDDpageData(ddpageId: string) {
|
|
1334
|
+
let res = await Super.super({
|
|
1335
|
+
url: "/v3/ddpage/data",
|
|
1336
|
+
method: "GET",
|
|
1337
|
+
query: {
|
|
1338
|
+
ddpageId,
|
|
1339
|
+
},
|
|
1340
|
+
});
|
|
1341
|
+
return res;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
static async ssoTokenLogin(json: { username: string, ssoToken: string }, programCode?: string, serverKey?: string, applicationCode?: string) {
|
|
1345
|
+
let res = await Super.super({
|
|
1346
|
+
url: "/v3/auth/sso/token",
|
|
1347
|
+
serverKey,
|
|
1348
|
+
header: { programCode, applicationCode },
|
|
1349
|
+
query: json,
|
|
1350
|
+
method: "GET",
|
|
1351
|
+
});
|
|
1352
|
+
return res;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
static async getThemeConfig(serverKey?: string, programCode?: string, applicationCode?: string) {
|
|
1356
|
+
let res = await Super.super({
|
|
1357
|
+
url: "/v3/theme-config",
|
|
1358
|
+
header: { programCode, applicationCode },
|
|
1359
|
+
serverKey,
|
|
1360
|
+
method: "GET",
|
|
1361
|
+
});
|
|
1362
|
+
if (res && res.status === "success") {
|
|
1363
|
+
return res;
|
|
1364
|
+
} else {
|
|
1365
|
+
return null;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
// 获取列表页统计数据
|
|
1370
|
+
static async getLtmplDataGroupCount(sourceId: string) {
|
|
1371
|
+
let res = await Super.super({
|
|
1372
|
+
url: "v3/ltmpl/data/group-count",
|
|
1373
|
+
method: "GET",
|
|
1374
|
+
query: { sourceId }
|
|
1375
|
+
});
|
|
1376
|
+
if (res?.status === "success") {
|
|
1377
|
+
return res["group-aggregates"] || [];
|
|
1378
|
+
} else {
|
|
1379
|
+
return [];
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// 设置页面默认配置
|
|
1384
|
+
static async setPageConfigDefault(name: string, menuCode: string, content: string) {
|
|
1385
|
+
let res = await Super.super({
|
|
1386
|
+
url: `/v3/devops/page-config/default`,
|
|
1387
|
+
method: "POST",
|
|
1388
|
+
data: { name, menuCode, content },
|
|
1389
|
+
});
|
|
1390
|
+
if (res?.status === "success") {
|
|
1391
|
+
message.success(translate("${保存成功}"), 1);
|
|
1392
|
+
return true;
|
|
1393
|
+
} else {
|
|
1394
|
+
message.error(translate("${保存失败}"), 3);
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
// 获取页面默认配置
|
|
1400
|
+
static async getPageConfigDefault() {
|
|
1401
|
+
let res = await Super.super({
|
|
1402
|
+
url: `/v3/devops/page-config/default`,
|
|
1403
|
+
method: "GET",
|
|
1404
|
+
});
|
|
1405
|
+
if (res?.status === "success") {
|
|
1406
|
+
message.success(translate("${拉取成功}"), 1);
|
|
1407
|
+
return res.configs;
|
|
1408
|
+
} else {
|
|
1409
|
+
message.error(translate("${拉取失败}"), 3);
|
|
1410
|
+
return null;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
static async deletePageConfigDefault(menuCode: string) {
|
|
1415
|
+
let res = await Super.super({
|
|
1416
|
+
url: `/v3/devops/page-config/default`,
|
|
1417
|
+
data: { menuCode },
|
|
1418
|
+
method: "DELETE",
|
|
1419
|
+
});
|
|
1420
|
+
if (res?.status === "success") {
|
|
1421
|
+
message.success(translate("${删除成功}"), 1);
|
|
1422
|
+
return true;
|
|
1423
|
+
} else {
|
|
1424
|
+
message.error(translate("${删除失败}"), 3);
|
|
1425
|
+
return false;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
// 设置页面用户自定义配置
|
|
1430
|
+
static async setPageConfigCommon(name: string, menuCode: string, content: string, configCode?: string) {
|
|
1431
|
+
let res = await Super.super({
|
|
1432
|
+
url: `/v3/devops/page-config/common`,
|
|
1433
|
+
method: "POST",
|
|
1434
|
+
data: { name, menuCode, content, configCode },
|
|
1435
|
+
});
|
|
1436
|
+
if (res?.status === "success") {
|
|
1437
|
+
message.success(translate("${保存成功}"), 1);
|
|
1438
|
+
return true;
|
|
1439
|
+
} else {
|
|
1440
|
+
message.error(translate("${保存失败}"), 3);
|
|
1441
|
+
return false;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
// 获取用户页面自定义配置
|
|
1446
|
+
static async getPageConfigCommon(menuCode?: string) {
|
|
1447
|
+
let res = await Super.super({
|
|
1448
|
+
url: `/v3/devops/page-config/common`,
|
|
1449
|
+
method: "GET",
|
|
1450
|
+
query: { menuCode }
|
|
1451
|
+
});
|
|
1452
|
+
if (res?.status === "success") {
|
|
1453
|
+
return res.configs;
|
|
1454
|
+
} else {
|
|
1455
|
+
return null;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
static async deletePageConfigCommon(configCode: string) {
|
|
1460
|
+
let res = await Super.super({
|
|
1461
|
+
url: `/v3/devops/page-config/common`,
|
|
1462
|
+
data: { configCode },
|
|
1463
|
+
method: "DELETE",
|
|
1464
|
+
});
|
|
1465
|
+
if (res?.status === "success") {
|
|
1466
|
+
message.success(translate("${删除成功}"), 1);
|
|
1467
|
+
return true;
|
|
1468
|
+
} else {
|
|
1469
|
+
message.error(translate("${删除失败}"), 3);
|
|
1470
|
+
return false;
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
// 请求用户我的菜单
|
|
1475
|
+
static async getQuickMenu() {
|
|
1476
|
+
let res = await Super.super({
|
|
1477
|
+
url: `/v3/devops/menu-config/quick-menu`,
|
|
1478
|
+
method: "GET",
|
|
1479
|
+
});
|
|
1480
|
+
if (res?.status === "success") {
|
|
1481
|
+
return res.configs;
|
|
1482
|
+
} else {
|
|
1483
|
+
return null;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
// 添加用户我的菜单
|
|
1488
|
+
static async postQuickMenu(menuCodes: string[]) {
|
|
1489
|
+
let res = await Super.super({
|
|
1490
|
+
url: `/v3/devops/menu-config/quick-menu`,
|
|
1491
|
+
method: "POST",
|
|
1492
|
+
data: { menuCodes },
|
|
1493
|
+
});
|
|
1494
|
+
if (res?.status === "success") {
|
|
1495
|
+
message.success(translate("${保存成功}"), 1);
|
|
1496
|
+
return true;
|
|
1497
|
+
} else {
|
|
1498
|
+
message.error(translate("${保存失败}"), 3);
|
|
1499
|
+
return false;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
// 删除用户我的菜单
|
|
1504
|
+
static async deleteQuickMenu(menuCode: string) {
|
|
1505
|
+
let res = await Super.super({
|
|
1506
|
+
url: `/v3/devops/menu-config/quick-menu`,
|
|
1507
|
+
data: { menuCode },
|
|
1508
|
+
method: "DELETE",
|
|
1509
|
+
});
|
|
1510
|
+
if (res?.status === "success") {
|
|
1511
|
+
message.success(translate("${删除成功}"), 1);
|
|
1512
|
+
return true;
|
|
1513
|
+
} else {
|
|
1514
|
+
message.error(translate("${删除失败}"), 3);
|
|
1515
|
+
return false;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
// ws发送消息
|
|
1520
|
+
// data:{ message: "测试数据", destination: "/user/queue/dashboard" }
|
|
1521
|
+
static async wsPush(hydrocarbonToken, data) {
|
|
1522
|
+
const res = await Super.super({
|
|
1523
|
+
url: `/v3/ws-push/${hydrocarbonToken}`,
|
|
1524
|
+
data,
|
|
1525
|
+
method: "POST",
|
|
1526
|
+
});
|
|
1527
|
+
if (res.code === 200) {
|
|
1528
|
+
message.success(translate("${已发送}"));
|
|
1529
|
+
} else {
|
|
1530
|
+
message.error(translate("${发送失败}"), 3);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
static async wsPushTopic(hydrocarbonToken, data) {
|
|
1535
|
+
const res = await Super.super({
|
|
1536
|
+
url: `/v3/ws-push-topic/${hydrocarbonToken}`,
|
|
1537
|
+
data,
|
|
1538
|
+
method: "POST",
|
|
1539
|
+
});
|
|
1540
|
+
if (res.code === 200) {
|
|
1541
|
+
message.success(translate("${已发送}"));
|
|
1542
|
+
} else {
|
|
1543
|
+
message.error(translate("${发送失败}"), 3);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
// 请求2D图组件
|
|
1548
|
+
static async get2DComponent(groups: string[]) {
|
|
1549
|
+
let { status, ...res } = await Super.super({
|
|
1550
|
+
url: `/v3/component/2d-config`,
|
|
1551
|
+
method: "GET",
|
|
1552
|
+
query: { groups }
|
|
1553
|
+
});
|
|
1554
|
+
if (status === "success") {
|
|
1555
|
+
return res;
|
|
1556
|
+
} else {
|
|
1557
|
+
return {};
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
// 保存2D图
|
|
1562
|
+
static async postDiagram2DConfig(recordCode: string, content: string) {
|
|
1563
|
+
let res = await Super.super({
|
|
1564
|
+
url: `/v3/devops/diagram-2d-config`,
|
|
1565
|
+
method: "POST",
|
|
1566
|
+
data: { recordCode, content },
|
|
1567
|
+
});
|
|
1568
|
+
if (res?.status === "success") {
|
|
1569
|
+
message.success(translate("${保存成功}"), 1);
|
|
1570
|
+
return true;
|
|
1571
|
+
} else {
|
|
1572
|
+
message.error(translate("${保存失败}"), 3);
|
|
1573
|
+
return false;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// 查询2D图
|
|
1578
|
+
static async getDiagram2DConfig(recordCode: string) {
|
|
1579
|
+
let res = await Super.super({
|
|
1580
|
+
url: `/v3/devops/diagram-2d-config`,
|
|
1581
|
+
method: "GET",
|
|
1582
|
+
query: { recordCode }
|
|
1583
|
+
});
|
|
1584
|
+
if (res?.status === "success") {
|
|
1585
|
+
return res?.configs || [];
|
|
1586
|
+
} else {
|
|
1587
|
+
return [];
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
}
|