@ibiz-template/runtime 0.3.5 → 0.4.0
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/dist/index.esm.js +13148 -13278
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/out/config/global-config.d.ts +2 -0
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +4 -0
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +8 -3
- package/out/controller/control/chart/chart.controller.d.ts.map +1 -1
- package/out/controller/control/chart/chart.controller.js +0 -1
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts +7 -0
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +28 -2
- package/out/controller/control/form/form/form.controller.d.ts +10 -1
- package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
- package/out/controller/control/form/form/form.controller.js +21 -4
- package/out/controller/control/form/form-detail/form-button/form-button.controller.d.ts +0 -8
- package/out/controller/control/form/form-detail/form-button/form-button.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-button/form-button.controller.js +0 -10
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts +17 -0
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +22 -1
- package/out/controller/control/form/form-detail/form-druipart/form-druipart.controller.js +2 -2
- package/out/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.js +2 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +0 -16
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +1 -3
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts +103 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.d.ts.map +1 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.js +161 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.d.ts +40 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.d.ts.map +1 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.js +9 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.d.ts +52 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.d.ts.map +1 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.js +80 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts +89 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map +1 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js +179 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts +41 -72
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.js +53 -144
- package/out/controller/control/form/form-detail/form-mdctrl/index.d.ts +3 -11
- package/out/controller/control/form/form-detail/form-mdctrl/index.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/index.js +3 -11
- package/out/controller/control/form/search-form/search-form.controller.d.ts +45 -1
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +77 -8
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +2 -1
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/report-panel/generator/base-generator.d.ts +61 -0
- package/out/controller/control/report-panel/generator/base-generator.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/base-generator.js +50 -0
- package/out/controller/control/report-panel/generator/generator-factory.d.ts +20 -0
- package/out/controller/control/report-panel/generator/generator-factory.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/generator-factory.js +31 -0
- package/out/controller/control/report-panel/generator/user-generator.d.ts +26 -0
- package/out/controller/control/report-panel/generator/user-generator.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/user-generator.js +59 -0
- package/out/controller/control/report-panel/generator/user2-generator.d.ts +11 -0
- package/out/controller/control/report-panel/generator/user2-generator.d.ts.map +1 -0
- package/out/controller/control/report-panel/generator/user2-generator.js +10 -0
- package/out/controller/control/report-panel/index.d.ts +3 -0
- package/out/controller/control/report-panel/index.d.ts.map +1 -0
- package/out/controller/control/report-panel/index.js +2 -0
- package/out/controller/control/report-panel/report-panel.controller.d.ts +106 -0
- package/out/controller/control/report-panel/report-panel.controller.d.ts.map +1 -0
- package/out/controller/control/report-panel/report-panel.controller.js +144 -0
- package/out/controller/control/report-panel/report-panel.service.d.ts +21 -0
- package/out/controller/control/report-panel/report-panel.service.d.ts.map +1 -0
- package/out/controller/control/report-panel/report-panel.service.js +21 -0
- package/out/controller/control/wizard-panel/wizard-panel.controller.d.ts.map +1 -1
- package/out/controller/control/wizard-panel/wizard-panel.controller.js +6 -4
- package/out/install.d.ts.map +1 -1
- package/out/install.js +3 -1
- package/out/interface/common/i-global-config/i-global-config.d.ts +8 -0
- package/out/interface/common/i-global-config/i-global-config.d.ts.map +1 -1
- package/out/interface/common/i-global-config/i-global-form-config.d.ts +18 -0
- package/out/interface/common/i-global-config/i-global-form-config.d.ts.map +1 -0
- package/out/interface/common/i-global-config/i-global-form-config.js +1 -0
- package/out/interface/common/i-global-config/index.d.ts +1 -0
- package/out/interface/common/i-global-config/index.d.ts.map +1 -1
- package/out/interface/common/i-global-config/index.js +1 -0
- package/out/interface/controller/controller/control/i-report-panel.controller.d.ts +26 -0
- package/out/interface/controller/controller/control/i-report-panel.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-report-panel.controller.js +1 -0
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts +22 -0
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/event/control/i-report-panel.event.d.ts +67 -0
- package/out/interface/controller/event/control/i-report-panel.event.d.ts.map +1 -0
- package/out/interface/controller/event/control/i-report-panel.event.js +1 -0
- package/out/interface/controller/event/control/index.d.ts +1 -0
- package/out/interface/controller/event/control/index.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.js +1 -0
- package/out/interface/controller/event/view/i-report-view.event.d.ts +12 -0
- package/out/interface/controller/event/view/i-report-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-report-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-report-panel.state.d.ts +33 -0
- package/out/interface/controller/state/control/i-report-panel.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-report-panel.state.js +1 -0
- package/out/interface/controller/state/control/i-search-form.state.d.ts +30 -0
- package/out/interface/controller/state/control/i-search-form.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/interface/controller/state/view/i-report-view.state.d.ts +11 -0
- package/out/interface/controller/state/view/i-report-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-report-view.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/interface/provider/i-de-method.provider.d.ts +30 -0
- package/out/interface/provider/i-de-method.provider.d.ts.map +1 -0
- package/out/interface/provider/i-de-method.provider.js +1 -0
- package/out/interface/provider/index.d.ts +1 -0
- package/out/interface/provider/index.d.ts.map +1 -1
- package/out/model/form/form-detail.d.ts +9 -0
- package/out/model/form/form-detail.d.ts.map +1 -1
- package/out/model/form/form-detail.js +11 -0
- package/out/model/utils/util.d.ts +10 -1
- package/out/model/utils/util.d.ts.map +1 -1
- package/out/model/utils/util.js +16 -0
- package/out/register/helper/de-method-register.d.ts +23 -0
- package/out/register/helper/de-method-register.d.ts.map +1 -0
- package/out/register/helper/de-method-register.js +51 -0
- package/out/register/helper/index.d.ts +1 -0
- package/out/register/helper/index.d.ts.map +1 -1
- package/out/register/helper/index.js +1 -0
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +6 -4
- package/out/service/service/config/config.service.js +1 -1
- package/out/service/service/entity/de.service.d.ts +1 -1
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +11 -24
- package/out/service/service/entity/method/index.d.ts +8 -0
- package/out/service/service/entity/method/index.d.ts.map +1 -0
- package/out/service/service/entity/method/index.js +7 -0
- package/out/service/service/entity/method/provider/de-action-de-method.provider.d.ts +15 -0
- package/out/service/service/entity/method/provider/de-action-de-method.provider.d.ts.map +1 -0
- package/out/service/service/entity/method/provider/de-action-de-method.provider.js +14 -0
- package/out/service/service/entity/method/provider/fetch-de-method.provider.d.ts +15 -0
- package/out/service/service/entity/method/provider/fetch-de-method.provider.d.ts.map +1 -0
- package/out/service/service/entity/method/provider/fetch-de-method.provider.js +18 -0
- package/out/service/service/entity/method/provider/index.d.ts +8 -0
- package/out/service/service/entity/method/provider/index.d.ts.map +1 -0
- package/out/service/service/entity/method/provider/index.js +18 -0
- package/out/service/service/index.d.ts +1 -0
- package/out/service/service/index.d.ts.map +1 -1
- package/out/service/service/index.js +1 -0
- package/package.json +5 -5
- package/src/config/global-config.ts +6 -0
- package/src/controller/common/control/control.controller.ts +11 -5
- package/src/controller/control/chart/chart.controller.ts +0 -1
- package/src/controller/control/form/edit-form/edit-form.controller.ts +29 -2
- package/src/controller/control/form/form/form.controller.ts +28 -6
- package/src/controller/control/form/form-detail/form-button/form-button.controller.ts +0 -11
- package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +24 -1
- package/src/controller/control/form/form-detail/form-druipart/form-druipart.controller.ts +2 -2
- package/src/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.ts +2 -1
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +1 -21
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.ts +215 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.ts +43 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.ts +118 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts +204 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl.controller.ts +54 -183
- package/src/controller/control/form/form-detail/form-mdctrl/index.ts +3 -11
- package/src/controller/control/form/search-form/search-form.controller.ts +99 -9
- package/src/controller/control/grid/grid/grid.controller.ts +4 -1
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/report-panel/generator/base-generator.ts +74 -0
- package/src/controller/control/report-panel/generator/generator-factory.ts +35 -0
- package/src/controller/control/report-panel/generator/user-generator.ts +63 -0
- package/src/controller/control/report-panel/generator/user2-generator.ts +10 -0
- package/src/controller/control/report-panel/index.ts +2 -0
- package/src/controller/control/report-panel/report-panel.controller.ts +204 -0
- package/src/controller/control/report-panel/report-panel.service.ts +40 -0
- package/src/controller/control/wizard-panel/wizard-panel.controller.ts +6 -4
- package/src/install.ts +3 -0
- package/src/interface/common/i-global-config/i-global-config.ts +9 -0
- package/src/interface/common/i-global-config/i-global-form-config.ts +17 -0
- package/src/interface/common/i-global-config/index.ts +1 -0
- package/src/interface/controller/controller/control/i-report-panel.controller.ts +32 -0
- package/src/interface/controller/controller/control/i-search-form.controller.ts +25 -0
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/event/control/i-report-panel.event.ts +72 -0
- package/src/interface/controller/event/control/index.ts +1 -0
- package/src/interface/controller/event/view/i-report-view.event.ts +12 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/control/i-report-panel.state.ts +37 -0
- package/src/interface/controller/state/control/i-search-form.state.ts +34 -1
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/interface/controller/state/view/i-report-view.state.ts +10 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/interface/provider/i-de-method.provider.ts +35 -0
- package/src/interface/provider/index.ts +4 -0
- package/src/model/form/form-detail.ts +12 -0
- package/src/model/utils/util.ts +20 -0
- package/src/register/helper/de-method-register.ts +64 -0
- package/src/register/helper/index.ts +1 -0
- package/src/service/dto/method.dto.ts +6 -4
- package/src/service/service/config/config.service.ts +1 -1
- package/src/service/service/entity/de.service.ts +15 -26
- package/src/service/service/entity/method/index.ts +7 -0
- package/src/service/service/entity/method/provider/de-action-de-method.provider.ts +25 -0
- package/src/service/service/entity/method/provider/fetch-de-method.provider.ts +29 -0
- package/src/service/service/entity/method/provider/index.ts +19 -0
- package/src/service/service/index.ts +1 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.d.ts +0 -102
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.js +0 -135
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-control/form-mdctrl-control.controller.d.ts +0 -41
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-control/form-mdctrl-control.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-control/form-mdctrl-control.controller.js +0 -34
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.d.ts +0 -98
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.js +0 -112
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.d.ts +0 -136
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.js +0 -192
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.d.ts +0 -115
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.js +0 -154
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.d.ts +0 -98
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.js +0 -112
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts +0 -20
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.js +0 -44
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.d.ts +0 -42
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.js +0 -60
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts +0 -34
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.js +0 -38
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.d.ts +0 -75
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.js +0 -109
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.state.d.ts +0 -16
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.state.d.ts.map +0 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl.state.js +0 -18
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-content-type.controller.ts +0 -154
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-control/form-mdctrl-control.controller.ts +0 -56
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.controller.ts +0 -127
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.controller.ts +0 -228
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-grid/form-mdctrl-grid.controller.ts +0 -174
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.controller.ts +0 -127
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-item.controller.ts +0 -78
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.controller.ts +0 -65
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.controller.ts +0 -40
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.ts +0 -120
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl.state.ts +0 -16
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { RuntimeError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { createUUID } from 'qx-util';
|
|
3
|
+
import { calcDeCodeNameById } from '../../../../../model';
|
|
4
|
+
import { getControlProvider } from '../../../../../register';
|
|
5
|
+
import { FormMDCtrlFormState } from './form-mdctrl-form.state';
|
|
6
|
+
import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
7
|
+
/**
|
|
8
|
+
* 表单多数据部件(引用实体表单部件模型)控制器
|
|
9
|
+
* 类型是表单
|
|
10
|
+
*
|
|
11
|
+
* @author lxm
|
|
12
|
+
* @date 2023-11-09 04:32:02
|
|
13
|
+
* @export
|
|
14
|
+
* @class FormMDCtrlController
|
|
15
|
+
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
16
|
+
*/
|
|
17
|
+
export class FormMDCtrlFormController extends FormMDCtrlController {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* 表单控制器Map
|
|
22
|
+
* @author lxm
|
|
23
|
+
* @date 2023-11-11 08:03:56
|
|
24
|
+
*/
|
|
25
|
+
this.formMap = new Map();
|
|
26
|
+
}
|
|
27
|
+
createState() {
|
|
28
|
+
var _a;
|
|
29
|
+
return new FormMDCtrlFormState((_a = this.parent) === null || _a === void 0 ? void 0 : _a.state);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 初始化
|
|
33
|
+
*
|
|
34
|
+
* @author zk
|
|
35
|
+
* @date 2023-07-25 10:07:11
|
|
36
|
+
* @protected
|
|
37
|
+
* @return {*} {Promise<void>}
|
|
38
|
+
* @memberof FormMDCtrlController
|
|
39
|
+
*/
|
|
40
|
+
async onInit() {
|
|
41
|
+
super.onInit();
|
|
42
|
+
const { contentControl } = this.model;
|
|
43
|
+
// 初始化适配器
|
|
44
|
+
if (!contentControl) {
|
|
45
|
+
throw new RuntimeModelError(this.model, '多数据部件未配置内容部件');
|
|
46
|
+
}
|
|
47
|
+
// 修改自动保存
|
|
48
|
+
contentControl.enableAutoSave =
|
|
49
|
+
this.enableCreate || this.enableUpdate;
|
|
50
|
+
const controlProvider = await getControlProvider(contentControl);
|
|
51
|
+
if (controlProvider) {
|
|
52
|
+
this.formProvider = controlProvider;
|
|
53
|
+
}
|
|
54
|
+
const { appDataEntityId } = this.model.contentControl;
|
|
55
|
+
this.deName = calcDeCodeNameById(appDataEntityId);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 加载实体的数据
|
|
59
|
+
* @author lxm
|
|
60
|
+
* @date 2023-11-10 05:02:40
|
|
61
|
+
* @return {*} {Promise<void>}
|
|
62
|
+
*/
|
|
63
|
+
async fetchData() {
|
|
64
|
+
const { appDataEntityId } = this.model.contentControl;
|
|
65
|
+
const fetchAction = 'fetchdefault';
|
|
66
|
+
const res = await ibiz.hub
|
|
67
|
+
.getApp()
|
|
68
|
+
.deService.exec(appDataEntityId, fetchAction, this.context, this.params);
|
|
69
|
+
if (res.ok) {
|
|
70
|
+
this.state.items = res.data.map(item => {
|
|
71
|
+
const context = this.context.clone();
|
|
72
|
+
context[this.deName] = item.srfkey;
|
|
73
|
+
const params = Object.assign({}, this.params);
|
|
74
|
+
return {
|
|
75
|
+
id: item.srfkey,
|
|
76
|
+
context,
|
|
77
|
+
params,
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 表单状态变更通知
|
|
84
|
+
*
|
|
85
|
+
* @author lxm
|
|
86
|
+
* @date 2022-09-20 18:09:07
|
|
87
|
+
*/
|
|
88
|
+
async formStateNotify(state) {
|
|
89
|
+
await super.formStateNotify(state);
|
|
90
|
+
await this.fetchData();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 设置表单控制器
|
|
94
|
+
* @author lxm
|
|
95
|
+
* @date 2023-11-11 08:03:06
|
|
96
|
+
* @param {string} id
|
|
97
|
+
* @param {IEditFormController} controller
|
|
98
|
+
*/
|
|
99
|
+
setFormController(id, controller) {
|
|
100
|
+
this.formMap.set(id, controller);
|
|
101
|
+
controller.evt.on('onSaveSuccess', event => {
|
|
102
|
+
const formData = event.data[0];
|
|
103
|
+
const item = this.state.items.find(x => x.id === id);
|
|
104
|
+
// 创建之后更新上下文的主键
|
|
105
|
+
if (item) {
|
|
106
|
+
if (item.context[this.deName] !== formData.srfkey) {
|
|
107
|
+
item.context[this.deName] = formData.srfkey;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
this.updateFormItem();
|
|
111
|
+
});
|
|
112
|
+
controller.evt.on('onRemoveSuccess', () => {
|
|
113
|
+
this.updateFormItem();
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 删除数据
|
|
118
|
+
* @author lxm
|
|
119
|
+
* @date 2023-11-11 08:06:12
|
|
120
|
+
* @param {string} id
|
|
121
|
+
* @return {*} {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
async remove(id) {
|
|
124
|
+
const controller = this.formMap.get(id);
|
|
125
|
+
if (!controller) {
|
|
126
|
+
throw new RuntimeError(`没有找到对应${id}的表单控制器`);
|
|
127
|
+
}
|
|
128
|
+
await controller.remove();
|
|
129
|
+
const index = this.state.items.findIndex(item => item.id === id);
|
|
130
|
+
if (index !== -1) {
|
|
131
|
+
this.state.items.splice(index, 1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 新建一条数据
|
|
136
|
+
* @author lxm
|
|
137
|
+
* @date 2023-11-11 08:01:49
|
|
138
|
+
*/
|
|
139
|
+
create() {
|
|
140
|
+
const context = this.context.clone();
|
|
141
|
+
const params = Object.assign({}, this.params);
|
|
142
|
+
if (!this.state.items) {
|
|
143
|
+
this.state.items = [];
|
|
144
|
+
}
|
|
145
|
+
this.state.items.push({
|
|
146
|
+
id: createUUID(),
|
|
147
|
+
context,
|
|
148
|
+
params,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
refresh() {
|
|
152
|
+
this.fetchData();
|
|
153
|
+
}
|
|
154
|
+
async dataChangeNotify(names) {
|
|
155
|
+
await super.dataChangeNotify(names);
|
|
156
|
+
// 表单项更新的时候修改数据的时候需要刷新
|
|
157
|
+
if (names.includes(this.model.id)) {
|
|
158
|
+
this.refresh();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FormDetailState } from '../form-detail';
|
|
2
|
+
export interface MDCtrlFormItem {
|
|
3
|
+
/**
|
|
4
|
+
* 唯一标识
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2023-11-11 07:50:42
|
|
7
|
+
* @type {string}
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* 上下文
|
|
12
|
+
* @author lxm
|
|
13
|
+
* @date 2023-11-11 07:51:04
|
|
14
|
+
* @type {IContext}
|
|
15
|
+
*/
|
|
16
|
+
context: IContext;
|
|
17
|
+
/**
|
|
18
|
+
* 视图参数
|
|
19
|
+
* @author lxm
|
|
20
|
+
* @date 2023-11-11 07:51:11
|
|
21
|
+
* @type {IParams}
|
|
22
|
+
*/
|
|
23
|
+
params: IParams;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 表单多数据部件状态
|
|
27
|
+
* @return {*}
|
|
28
|
+
* @author: zhujiamin
|
|
29
|
+
* @Date: 2023-01-04 10:26:34
|
|
30
|
+
*/
|
|
31
|
+
export declare class FormMDCtrlFormState extends FormDetailState {
|
|
32
|
+
/**
|
|
33
|
+
* 每个表单绘制相关参数
|
|
34
|
+
* @author lxm
|
|
35
|
+
* @date 2023-11-11 07:51:40
|
|
36
|
+
* @type {MDCtrlFormItem[]}
|
|
37
|
+
*/
|
|
38
|
+
items?: MDCtrlFormItem[];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=form-mdctrl-form.state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-mdctrl-form.state.d.ts","sourceRoot":"","sources":["../../../../../../src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;OAKG;IACH,OAAO,EAAE,QAAQ,CAAC;IAElB;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,eAAe;IACtD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IControlProvider, IMDControlController } from '../../../../../interface';
|
|
2
|
+
import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
3
|
+
/**
|
|
4
|
+
* 表单多数据部件(引用实体多数据部件模型)控制器
|
|
5
|
+
* 类型是列表,卡片,表格时
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2023-11-09 04:32:02
|
|
9
|
+
* @export
|
|
10
|
+
* @class FormMDCtrlController
|
|
11
|
+
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormMDCtrlMDController extends FormMDCtrlController {
|
|
14
|
+
/**
|
|
15
|
+
* 多数据部件的适配器
|
|
16
|
+
*
|
|
17
|
+
* @author lxm
|
|
18
|
+
* @date 2022-08-24 20:08:07
|
|
19
|
+
* @type {{ [key: string]: IControlProvider }}
|
|
20
|
+
*/
|
|
21
|
+
mdProvider: IControlProvider;
|
|
22
|
+
/**
|
|
23
|
+
* 多数据部件控制器
|
|
24
|
+
* @author lxm
|
|
25
|
+
* @date 2023-11-10 03:30:34
|
|
26
|
+
* @type {IMDControlController}
|
|
27
|
+
*/
|
|
28
|
+
mdController: IMDControlController;
|
|
29
|
+
protected onInit(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* 设置多数据部件控制器
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2023-11-10 03:31:16
|
|
34
|
+
* @param {IMDControlController} controller
|
|
35
|
+
*/
|
|
36
|
+
setMDControl(controller: IMDControlController): void;
|
|
37
|
+
/**
|
|
38
|
+
* 删除多数据选中的数据
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2023-11-10 03:32:30
|
|
41
|
+
*/
|
|
42
|
+
remove(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 多数据新建一条数据
|
|
45
|
+
* @author lxm
|
|
46
|
+
* @date 2023-11-10 03:32:30
|
|
47
|
+
*/
|
|
48
|
+
create(): void;
|
|
49
|
+
refresh(): void;
|
|
50
|
+
dataChangeNotify(names: string[]): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=form-mdctrl-md.controller.d.ts.map
|
package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-mdctrl-md.controller.d.ts","sourceRoot":"","sources":["../../../../../../src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-md.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,oBAAoB;IAC9D;;;;;;OAMG;IACH,UAAU,EAAG,gBAAgB,CAAC;IAE9B;;;;;OAKG;IACH,YAAY,EAAG,oBAAoB,CAAC;cAEpB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAqBvC;;;;;OAKG;IACH,YAAY,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;IAYpD;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAId;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAWd,OAAO,IAAI,IAAI;IAIT,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAQvD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { mergeInLeft, ModelError, RuntimeModelError, } from '@ibiz-template/core';
|
|
2
|
+
import { getControlProvider } from '../../../../../register';
|
|
3
|
+
import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
4
|
+
/**
|
|
5
|
+
* 表单多数据部件(引用实体多数据部件模型)控制器
|
|
6
|
+
* 类型是列表,卡片,表格时
|
|
7
|
+
*
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-11-09 04:32:02
|
|
10
|
+
* @export
|
|
11
|
+
* @class FormMDCtrlController
|
|
12
|
+
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
13
|
+
*/
|
|
14
|
+
export class FormMDCtrlMDController extends FormMDCtrlController {
|
|
15
|
+
async onInit() {
|
|
16
|
+
await super.onInit();
|
|
17
|
+
const { contentControl } = this.model;
|
|
18
|
+
if (!contentControl) {
|
|
19
|
+
throw new RuntimeModelError(this.model, '多数据部件未配置内容部件');
|
|
20
|
+
}
|
|
21
|
+
// 把修改表格的模型,把行编辑打开,行新建看多数据部件的新建是否开启
|
|
22
|
+
if (contentControl.controlType === 'GRID') {
|
|
23
|
+
mergeInLeft(contentControl, {
|
|
24
|
+
enableRowEdit: this.enableCreate || this.enableUpdate,
|
|
25
|
+
enableRowNew: this.enableCreate,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const controlProvider = await getControlProvider(contentControl);
|
|
29
|
+
if (controlProvider) {
|
|
30
|
+
this.mdProvider = controlProvider;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 设置多数据部件控制器
|
|
35
|
+
* @author lxm
|
|
36
|
+
* @date 2023-11-10 03:31:16
|
|
37
|
+
* @param {IMDControlController} controller
|
|
38
|
+
*/
|
|
39
|
+
setMDControl(controller) {
|
|
40
|
+
this.mdController = controller;
|
|
41
|
+
// 多数据部件保存,删除之后触发表单项更新
|
|
42
|
+
controller.evt.on('onSaveSuccess', () => {
|
|
43
|
+
this.updateFormItem();
|
|
44
|
+
});
|
|
45
|
+
controller.evt.on('onRemoveSuccess', () => {
|
|
46
|
+
this.updateFormItem();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 删除多数据选中的数据
|
|
51
|
+
* @author lxm
|
|
52
|
+
* @date 2023-11-10 03:32:30
|
|
53
|
+
*/
|
|
54
|
+
remove() {
|
|
55
|
+
this.mdController.remove();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 多数据新建一条数据
|
|
59
|
+
* @author lxm
|
|
60
|
+
* @date 2023-11-10 03:32:30
|
|
61
|
+
*/
|
|
62
|
+
create() {
|
|
63
|
+
if (this.model.contentType === 'GRID') {
|
|
64
|
+
this.mdController.newRow();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new ModelError(this.model, `多数据部件类型${this.model.contentType}暂不支持添加数据`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
refresh() {
|
|
71
|
+
this.mdController.refresh();
|
|
72
|
+
}
|
|
73
|
+
async dataChangeNotify(names) {
|
|
74
|
+
await super.dataChangeNotify(names);
|
|
75
|
+
// 表单项更新的时候修改数据的时候需要刷新
|
|
76
|
+
if (names.includes(this.model.id)) {
|
|
77
|
+
this.refresh();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { IDEForm } from '@ibiz/model-core';
|
|
2
|
+
import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
3
|
+
/**
|
|
4
|
+
* 表单多数据部件(重复器)控制器
|
|
5
|
+
* 类型是重复器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2023-11-09 04:32:02
|
|
9
|
+
* @export
|
|
10
|
+
* @class FormMDCtrlController
|
|
11
|
+
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormMDCtrlRepeaterController extends FormMDCtrlController {
|
|
14
|
+
/**
|
|
15
|
+
* 名称
|
|
16
|
+
* @author lxm
|
|
17
|
+
* @date 2023-11-22 03:31:02
|
|
18
|
+
* @readonly
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
get name(): string;
|
|
22
|
+
/**
|
|
23
|
+
* 多数据重复器对应的表单里的值
|
|
24
|
+
*
|
|
25
|
+
* @author lxm
|
|
26
|
+
* @date 2022-08-24 22:08:25
|
|
27
|
+
* @readonly
|
|
28
|
+
* @type {unknown}
|
|
29
|
+
*/
|
|
30
|
+
get value(): IData[] | IData | null;
|
|
31
|
+
/**
|
|
32
|
+
* 重复器样式
|
|
33
|
+
* @author lxm
|
|
34
|
+
* @date 2023-11-09 05:03:20
|
|
35
|
+
* @type {('Grid' | 'MultiForm' | 'SingleForm')}
|
|
36
|
+
*/
|
|
37
|
+
repeaterStyle: 'Grid' | 'MultiForm' | 'SingleForm';
|
|
38
|
+
/**
|
|
39
|
+
* 重复器的值是否是单项数据类型,true为数组格式,反之为对象格式
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2023-11-09 05:09:19
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
*/
|
|
44
|
+
isSingleData: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 重复表单
|
|
47
|
+
* @author lxm
|
|
48
|
+
* @date 2023-11-22 02:28:13
|
|
49
|
+
* @type {IDEForm}
|
|
50
|
+
*/
|
|
51
|
+
repeatedForm: IDEForm;
|
|
52
|
+
protected onInit(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* 准备重复器表单模型
|
|
55
|
+
* @author lxm
|
|
56
|
+
* @date 2023-11-22 02:56:00
|
|
57
|
+
*/
|
|
58
|
+
prepareRepeatedForm(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 设置重复器数据(修改主表单里重复器对应属性)
|
|
61
|
+
* @author lxm
|
|
62
|
+
* @date 2023-11-22 06:07:04
|
|
63
|
+
* @param {(IData[] | IData | null)} value
|
|
64
|
+
*/
|
|
65
|
+
setValue(value: IData[] | IData | null): void;
|
|
66
|
+
/**
|
|
67
|
+
* 添加或创建一条数据
|
|
68
|
+
* @author lxm
|
|
69
|
+
* @date 2023-11-22 04:50:19
|
|
70
|
+
*/
|
|
71
|
+
create(): void;
|
|
72
|
+
/**
|
|
73
|
+
* 删除数据
|
|
74
|
+
* @author lxm
|
|
75
|
+
* @date 2023-11-22 08:53:42
|
|
76
|
+
* @param {number} index
|
|
77
|
+
*/
|
|
78
|
+
remove(index?: number): void;
|
|
79
|
+
/**
|
|
80
|
+
* 表单数据变更通知
|
|
81
|
+
*
|
|
82
|
+
* @author lxm
|
|
83
|
+
* @date 2023-11-24 04:37:03
|
|
84
|
+
* @param {string[]} names
|
|
85
|
+
* @return {*} {Promise<void>}
|
|
86
|
+
*/
|
|
87
|
+
dataChangeNotify(names: string[]): Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=form-mdctrl-repeater.controller.d.ts.map
|
package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-mdctrl-repeater.controller.d.ts","sourceRoot":"","sources":["../../../../../../src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;;;;GASG;AACH,qBAAa,4BAA6B,SAAQ,oBAAoB;IACpE;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;;;OAOG;IACH,IAAI,KAAK,IAAI,KAAK,EAAE,GAAG,KAAK,GAAG,IAAI,CAElC;IAED;;;;;OAKG;IACH,aAAa,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAe;IAEjE;;;;;OAKG;IACH,YAAY,EAAE,OAAO,CAAS;IAE9B;;;;;OAKG;IACH,YAAY,EAAG,OAAO,CAAC;cAEP,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BvC;;;;OAIG;IACH,mBAAmB,IAAI,IAAI;IA6B3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI;IAI7C;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAYd;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAa5B;;;;;;;OAOG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBvD"}
|
package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ModelError } from '@ibiz-template/core';
|
|
2
|
+
import { clone } from 'ramda';
|
|
3
|
+
import { FormMDCtrlController } from './form-mdctrl.controller';
|
|
4
|
+
/**
|
|
5
|
+
* 表单多数据部件(重复器)控制器
|
|
6
|
+
* 类型是重复器
|
|
7
|
+
*
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-11-09 04:32:02
|
|
10
|
+
* @export
|
|
11
|
+
* @class FormMDCtrlController
|
|
12
|
+
* @extends {FormDetailController<IDEFormMDCtrl>}
|
|
13
|
+
*/
|
|
14
|
+
export class FormMDCtrlRepeaterController extends FormMDCtrlController {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/**
|
|
18
|
+
* 重复器样式
|
|
19
|
+
* @author lxm
|
|
20
|
+
* @date 2023-11-09 05:03:20
|
|
21
|
+
* @type {('Grid' | 'MultiForm' | 'SingleForm')}
|
|
22
|
+
*/
|
|
23
|
+
this.repeaterStyle = 'MultiForm';
|
|
24
|
+
/**
|
|
25
|
+
* 重复器的值是否是单项数据类型,true为数组格式,反之为对象格式
|
|
26
|
+
* @author lxm
|
|
27
|
+
* @date 2023-11-09 05:09:19
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
*/
|
|
30
|
+
this.isSingleData = false;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 名称
|
|
34
|
+
* @author lxm
|
|
35
|
+
* @date 2023-11-22 03:31:02
|
|
36
|
+
* @readonly
|
|
37
|
+
* @type {string}
|
|
38
|
+
*/
|
|
39
|
+
get name() {
|
|
40
|
+
return this.model.id;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 多数据重复器对应的表单里的值
|
|
44
|
+
*
|
|
45
|
+
* @author lxm
|
|
46
|
+
* @date 2022-08-24 22:08:25
|
|
47
|
+
* @readonly
|
|
48
|
+
* @type {unknown}
|
|
49
|
+
*/
|
|
50
|
+
get value() {
|
|
51
|
+
return this.data[this.model.id];
|
|
52
|
+
}
|
|
53
|
+
async onInit() {
|
|
54
|
+
await super.onInit();
|
|
55
|
+
// 初始化样式类型和数据类型
|
|
56
|
+
switch (this.model.detailStyle) {
|
|
57
|
+
// 表单
|
|
58
|
+
case 'DEFAULT':
|
|
59
|
+
this.repeaterStyle = 'MultiForm';
|
|
60
|
+
this.isSingleData = false;
|
|
61
|
+
break;
|
|
62
|
+
// 表格
|
|
63
|
+
case 'STYLE2':
|
|
64
|
+
this.repeaterStyle = 'Grid';
|
|
65
|
+
this.isSingleData = false;
|
|
66
|
+
break;
|
|
67
|
+
// 1:1表单
|
|
68
|
+
case 'STYLE3':
|
|
69
|
+
this.repeaterStyle = 'SingleForm';
|
|
70
|
+
this.isSingleData = true;
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
throw new ModelError(this.model, `暂不支持重复器样式${this.model.detailStyle}`);
|
|
74
|
+
}
|
|
75
|
+
this.prepareRepeatedForm();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 准备重复器表单模型
|
|
79
|
+
* @author lxm
|
|
80
|
+
* @date 2023-11-22 02:56:00
|
|
81
|
+
*/
|
|
82
|
+
prepareRepeatedForm() {
|
|
83
|
+
const id = `${this.model.id}repeatedform`;
|
|
84
|
+
const tempForm = {
|
|
85
|
+
id,
|
|
86
|
+
codeName: id,
|
|
87
|
+
name: id,
|
|
88
|
+
deformPages: [
|
|
89
|
+
{
|
|
90
|
+
id: 'formpage1',
|
|
91
|
+
deformDetails: this.model.deformDetails,
|
|
92
|
+
detailType: 'FORMPAGE',
|
|
93
|
+
detailStyle: 'DEFAULT',
|
|
94
|
+
layout: this.model.layout,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
const copyFields = [
|
|
99
|
+
'appId',
|
|
100
|
+
'controlType',
|
|
101
|
+
'deformItemVRs',
|
|
102
|
+
];
|
|
103
|
+
copyFields.forEach(key => {
|
|
104
|
+
tempForm[key] = this.form.model[key];
|
|
105
|
+
});
|
|
106
|
+
this.repeatedForm = clone(tempForm);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 设置重复器数据(修改主表单里重复器对应属性)
|
|
110
|
+
* @author lxm
|
|
111
|
+
* @date 2023-11-22 06:07:04
|
|
112
|
+
* @param {(IData[] | IData | null)} value
|
|
113
|
+
*/
|
|
114
|
+
setValue(value) {
|
|
115
|
+
this.form.setDataValue(this.name, value);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 添加或创建一条数据
|
|
119
|
+
* @author lxm
|
|
120
|
+
* @date 2023-11-22 04:50:19
|
|
121
|
+
*/
|
|
122
|
+
create() {
|
|
123
|
+
if (this.isSingleData) {
|
|
124
|
+
this.setValue({});
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// 多数据,拷贝数组再添加新对象
|
|
128
|
+
let tempValue = this.value;
|
|
129
|
+
tempValue = tempValue ? [...tempValue] : [];
|
|
130
|
+
tempValue.push({});
|
|
131
|
+
this.setValue(tempValue);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 删除数据
|
|
136
|
+
* @author lxm
|
|
137
|
+
* @date 2023-11-22 08:53:42
|
|
138
|
+
* @param {number} index
|
|
139
|
+
*/
|
|
140
|
+
remove(index) {
|
|
141
|
+
if (this.isSingleData) {
|
|
142
|
+
// 单项数据的时候删除就是清空
|
|
143
|
+
this.setValue(null);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const newArr = this.value.filter((_, i) => {
|
|
147
|
+
return index !== i;
|
|
148
|
+
});
|
|
149
|
+
this.setValue(newArr);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 表单数据变更通知
|
|
153
|
+
*
|
|
154
|
+
* @author lxm
|
|
155
|
+
* @date 2023-11-24 04:37:03
|
|
156
|
+
* @param {string[]} names
|
|
157
|
+
* @return {*} {Promise<void>}
|
|
158
|
+
*/
|
|
159
|
+
async dataChangeNotify(names) {
|
|
160
|
+
await super.dataChangeNotify(names);
|
|
161
|
+
const { resetItemNames } = this.model;
|
|
162
|
+
// 重置项,变更时自己的值置空
|
|
163
|
+
let isReset = false;
|
|
164
|
+
if (resetItemNames && resetItemNames.length > 0) {
|
|
165
|
+
resetItemNames.forEach((resetItemName) => {
|
|
166
|
+
if (names.includes(resetItemName)) {
|
|
167
|
+
isReset = true;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (isReset) {
|
|
172
|
+
this.setValue(null);
|
|
173
|
+
}
|
|
174
|
+
// 自身对应属性变更时,触发表单项更新
|
|
175
|
+
if (names.includes(this.name)) {
|
|
176
|
+
await this.updateFormItem();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|