@farris/ui-vue 1.7.1 → 1.7.2-beta.2
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/components/accordion/index.esm.js +312 -61
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +1492 -59
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +752 -8
- package/components/binding-selector/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/button-group/index.esm.js +266 -110
- package/components/button-group/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +344 -341
- package/components/calendar/index.umd.cjs +3 -3
- package/components/code-editor/index.esm.js +237 -169
- package/components/code-editor/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +302 -299
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/color-picker/index.esm.js +812 -502
- package/components/color-picker/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +329 -292
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +355 -174
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +294 -291
- package/components/comment/index.umd.cjs +6 -6
- package/components/common/index.esm.js +1 -1
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +4390 -2708
- package/components/component/index.umd.cjs +8 -1
- package/components/condition/index.esm.js +3140 -487
- package/components/condition/index.umd.cjs +8 -1
- package/components/data-grid/index.esm.js +4 -2
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +1859 -1832
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1 -1
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3731 -2717
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +417 -405
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dropdown/index.esm.js +373 -124
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1245 -1895
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +275 -271
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +529 -450
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +1 -1
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +2613 -1544
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.css +1 -1
- package/components/expression-editor/index.esm.js +7376 -2
- package/components/expression-editor/index.umd.cjs +427 -1
- package/components/fieldset/index.esm.js +1 -1
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +423 -415
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.css +1 -1
- package/components/filter-condition-editor/index.esm.js +9049 -425
- package/components/filter-condition-editor/index.umd.cjs +427 -1
- package/components/html-template/index.esm.js +33 -36
- package/components/html-template/index.umd.cjs +1 -1
- package/components/image/index.esm.js +364 -355
- package/components/image/index.umd.cjs +2 -2
- package/components/image-cropper/index.esm.js +615 -361
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/json-editor/index.esm.js +325 -247
- package/components/json-editor/index.umd.cjs +1 -1
- package/components/language-textbox/index.esm.js +411 -409
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/layout/index.esm.js +549 -163
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +837 -39
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +427 -646
- package/components/list-view/index.umd.cjs +6 -6
- package/components/lookup/index.esm.js +3624 -3625
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5 -3
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/menu-lookup/index.esm.js +577 -536
- package/components/menu-lookup/index.umd.cjs +6 -6
- package/components/nav/index.esm.js +311 -31
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +1641 -189
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +82 -82
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1196 -851
- package/components/order/index.umd.cjs +6 -6
- package/components/page-footer/index.esm.js +331 -48
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +110 -116
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +509 -232
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +353 -148
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +157 -153
- package/components/property-editor/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +1817 -854
- package/components/property-panel/index.umd.cjs +12 -5
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +6858 -3984
- package/components/query-solution/index.umd.cjs +13 -6
- package/components/response-layout/index.esm.js +1 -1
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +2448 -2222
- package/components/schema-selector/index.umd.cjs +7 -7
- package/components/search-box/index.esm.js +244 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +212 -209
- package/components/section/index.umd.cjs +2 -2
- package/components/smoke-detector/index.esm.js +179 -8
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.css +1 -0
- package/components/sort-condition-editor/index.esm.js +9493 -4
- package/components/sort-condition-editor/index.umd.cjs +427 -1
- package/components/splitter/index.esm.js +1172 -142
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +47 -48
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +490 -419
- package/components/tabs/index.umd.cjs +1 -1
- package/components/text/index.esm.js +217 -73
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +29 -27
- package/components/textarea/index.umd.cjs +2 -2
- package/components/transfer/index.esm.js +760 -543
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +129 -128
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +320 -153
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +1112 -607
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +359 -106
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +222 -89
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +290 -199
- package/components/weather/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +5301 -4507
- package/designer/data-grid/index.umd.cjs +17 -10
- package/designer/drawer/index.esm.js +626 -615
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +2043 -1290
- package/designer/dynamic-form/index.umd.cjs +8 -1
- package/designer/farris-designer.all.esm.js +14263 -12505
- package/designer/farris-designer.all.umd.cjs +16 -16
- package/designer/list-view/index.esm.js +327 -327
- package/designer/list-view/index.umd.cjs +3 -3
- package/designer/modal/index.esm.js +29 -137
- package/designer/modal/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +238 -232
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +178 -171
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/response-toolbar/index.esm.js +1 -1
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +1 -6
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +3431 -2493
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +195 -188
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +822 -464
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +77525 -74884
- package/farris.all.umd.cjs +93 -93
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/accordion/src/accordion.props.d.ts +1 -0
- package/types/accordion/src/components/accordion-item.props.d.ts +1 -0
- package/types/avatar/src/avatar.props.d.ts +1 -0
- package/types/binding-selector/index.d.ts +54 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +1 -0
- package/types/button-group/index.d.ts +0 -15
- package/types/button-group/src/button-group.props.d.ts +1 -0
- package/types/code-editor/index.d.ts +1 -0
- package/types/code-editor/src/code-textbox.component.d.ts +6 -6
- package/types/code-editor/src/code-textbox.props.d.ts +2 -0
- package/types/color-picker/index.d.ts +15 -0
- package/types/color-picker/src/color-picker.props.d.ts +1 -0
- package/types/combo-list/src/composition/use-data-source.d.ts +2 -1
- package/types/combo-tree/src/combo-tree.props.d.ts +1 -0
- package/types/component/index.d.ts +2 -0
- package/types/component/src/component.props.d.ts +8 -0
- package/types/components.d.ts +8 -1
- package/types/condition/index.d.ts +55 -0
- package/types/condition/src/composition/condition-value/dropdown-value.d.ts +4 -0
- package/types/data-view/composition/types.d.ts +1 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +24 -0
- package/types/designer-toolbox/index.d.ts +3 -0
- package/types/designer-toolbox/src/toolbox.component.d.ts +14 -0
- package/types/designer-toolbox/src/toolbox.props.d.ts +29 -0
- package/types/designer-toolbox/src/types.d.ts +21 -0
- package/types/designer.d.ts +13 -0
- package/types/dropdown/index.d.ts +6 -27
- package/types/dropdown/src/dropdown.item.component.d.ts +1 -1
- package/types/dropdown/src/dropdown.props.d.ts +1 -0
- package/types/dynamic-form/designer.d.ts +1 -4
- package/types/dynamic-form/index.d.ts +6 -11
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -3
- package/types/dynamic-form/src/designer/dynamic-form.design.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form.design.props.d.ts +14 -0
- package/types/dynamic-form/src/designer/use-dynamic-form-rules.d.ts +2 -0
- package/types/dynamic-form/src/dynamic-form.component.d.ts +8 -0
- package/types/dynamic-form/src/response-form.props.d.ts +13 -1
- package/types/dynamic-form/src/schema/response-form-schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -0
- package/types/dynamic-resolver/index.d.ts +0 -3
- package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver-design.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/property-config/use-property-config-resolver.d.ts +2 -2
- package/types/dynamic-resolver/src/resolver/schema/schema-resolver-design.d.ts +1 -1
- package/types/dynamic-resolver/src/resolver/schema/schema-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/types.d.ts +1 -0
- package/types/dynamic-view/index.d.ts +43 -3
- package/types/dynamic-view/src/components/maps.d.ts +110 -98
- package/types/dynamic-view/src/composition/index.d.ts +5 -0
- package/types/dynamic-view/src/composition/use-utils.d.ts +12 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +6 -6
- package/types/{binding-selector/designer.d.ts → expression-editor/index.d.ts} +6 -6
- package/types/filter-condition-editor/index.d.ts +9 -0
- package/types/filter-condition-editor/src/components/filter-condition-grid.component.d.ts +12 -12
- package/types/filter-condition-editor/src/components/sort-editor-grid.component.d.ts +12 -12
- package/types/filter-condition-editor/src/filter-condition-editor.props.d.ts +1 -0
- package/types/flow-canvas/index.d.ts +3 -0
- package/types/flow-canvas/src/components/flow-node-item.component.d.ts +8 -0
- package/types/flow-canvas/src/components/flow-node-item.props.d.ts +3 -0
- package/types/flow-canvas/src/composition/types.d.ts +42 -0
- package/types/flow-canvas/src/composition/use-bezier-curve.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-connections.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-curve.d.ts +4 -0
- package/types/flow-canvas/src/composition/use-drawing-bezier.d.ts +2 -0
- package/types/flow-canvas/src/composition/use-drawing.d.ts +4 -0
- package/types/flow-canvas/src/flow-canvas.component.d.ts +8 -0
- package/types/flow-canvas/src/flow-canvas.props.d.ts +3 -0
- package/types/image-cropper/src/image-cropper.props.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/json-editor/src/json-editor.props.d.ts +1 -0
- package/types/language-textbox/index.d.ts +3 -3
- package/types/language-textbox/src/components/language-contents.component.d.ts +1 -1
- package/types/language-textbox/src/language-textbox.component.d.ts +1 -1
- package/types/layout/index.d.ts +0 -1
- package/types/layout/src/components/layout-pane.props.d.ts +1 -0
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +2 -0
- package/types/layout/src/designer/layout-pane.design.component.d.ts +8 -0
- package/types/layout/src/designer/layout-use-designer-rules.d.ts +2 -0
- package/types/layout/src/designer/layout.design.component.d.ts +8 -0
- package/types/layout/src/layout.props.d.ts +1 -0
- package/types/layout/src/schema/schema-mapper.d.ts +2 -0
- package/types/layout/src/schema/schema-resolver.d.ts +2 -0
- package/types/list-nav/index.d.ts +5 -24
- package/types/list-nav/src/designer/use-designer-rules.d.ts +2 -0
- package/types/list-nav/src/list-nav.props.d.ts +1 -0
- package/types/list-nav/src/property-config/list-nav.property-config.d.ts +8 -0
- package/types/list-nav/src/schema/schema-mapper.d.ts +2 -0
- package/types/list-nav/src/schema/schema-resolver.d.ts +2 -0
- package/types/list-view/index.d.ts +0 -1
- package/types/list-view/src/composition/use-draggable.d.ts +1 -1
- package/types/lookup/index.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/menu-lookup/src/menu-lookup.props.d.ts +1 -0
- package/types/modal/designer.d.ts +0 -2
- package/types/nav/index.d.ts +20 -24
- package/types/nav/src/nav.props.d.ts +1 -0
- package/types/number-range/src/number-range.props.d.ts +1 -0
- package/types/order/index.d.ts +5 -36
- package/types/order/src/designer/order.design.component.d.ts +1 -1
- package/types/order/src/order.props.d.ts +1 -0
- package/types/page-footer/index.d.ts +2 -0
- package/types/page-footer/src/page-footer.props.d.ts +1 -0
- package/types/pagination/index.d.ts +0 -15
- package/types/pagination/src/pagination.props.d.ts +1 -0
- package/types/progress/src/progress.props.d.ts +1 -0
- package/types/property-panel/src/property-panel.component.d.ts +3 -3
- package/types/query-solution/index.d.ts +2 -1
- package/types/radio-group/designer.d.ts +1 -2
- package/types/search-box/index.d.ts +17 -1
- package/types/search-box/src/search-box.props.d.ts +1 -0
- package/types/section/designer.d.ts +0 -1
- package/types/smoke-detector/index.d.ts +2 -0
- package/types/smoke-detector/src/smoke-detector.props.d.ts +1 -0
- package/types/sort-condition-editor/index.d.ts +7 -2
- package/types/sort-condition-editor/src/sort-condition-editor.props.d.ts +1 -0
- package/types/splitter/index.d.ts +0 -1
- package/types/splitter/src/components/splitter-pane.props.d.ts +1 -0
- package/types/splitter/src/splitter.props.d.ts +1 -0
- package/types/tabs/designer.d.ts +0 -1
- package/types/tabs/index.d.ts +1 -0
- package/types/text/index.d.ts +20 -24
- package/types/text/src/text.props.d.ts +1 -0
- package/types/transfer/src/transfer.props.d.ts +1 -0
- package/types/tree-view/src/tree-view.props.d.ts +1 -0
- package/types/uploader/src/uploader.props.d.ts +1 -0
- package/types/verify-detail/index.d.ts +5 -58
- package/types/verify-detail/src/designer/verify-detail.design.component.d.ts +8 -8
- package/types/verify-detail/src/verify-detail.props.d.ts +1 -0
- package/types/video/index.d.ts +20 -24
- package/types/video/src/video.props.d.ts +1 -0
- package/components/dynamic-form/index.css +0 -1
- package/designer/accordion/index.esm.js +0 -257
- package/designer/accordion/index.umd.cjs +0 -1
- package/designer/avatar/index.esm.js +0 -1460
- package/designer/avatar/index.umd.cjs +0 -1
- package/designer/binding-selector/index.esm.js +0 -792
- package/designer/binding-selector/index.umd.cjs +0 -1
- package/designer/button-group/index.esm.js +0 -282
- package/designer/button-group/index.umd.cjs +0 -1
- package/designer/code-editor/index.esm.js +0 -75
- package/designer/code-editor/index.umd.cjs +0 -1
- package/designer/color-picker/index.esm.js +0 -1096
- package/designer/color-picker/index.umd.cjs +0 -1
- package/designer/combo-list/index.esm.js +0 -1095
- package/designer/combo-list/index.umd.cjs +0 -1
- package/designer/combo-tree/index.esm.js +0 -186
- package/designer/combo-tree/index.umd.cjs +0 -1
- package/designer/component/index.css +0 -1
- package/designer/component/index.esm.js +0 -5002
- package/designer/component/index.umd.cjs +0 -1
- package/designer/condition/index.esm.js +0 -1899
- package/designer/condition/index.umd.cjs +0 -1
- package/designer/dropdown/index.esm.js +0 -261
- package/designer/dropdown/index.umd.cjs +0 -1
- package/designer/expression-editor/index.css +0 -1
- package/designer/expression-editor/index.esm.js +0 -7006
- package/designer/expression-editor/index.umd.cjs +0 -427
- package/designer/filter-condition-editor/index.css +0 -1
- package/designer/filter-condition-editor/index.esm.js +0 -4795
- package/designer/filter-condition-editor/index.umd.cjs +0 -1
- package/designer/html-template/index.esm.js +0 -718
- package/designer/html-template/index.umd.cjs +0 -1
- package/designer/image-cropper/index.esm.js +0 -765
- package/designer/image-cropper/index.umd.cjs +0 -1
- package/designer/json-editor/index.esm.js +0 -83
- package/designer/json-editor/index.umd.cjs +0 -1
- package/designer/language-textbox/index.esm.js +0 -783
- package/designer/language-textbox/index.umd.cjs +0 -8
- package/designer/layout/index.esm.js +0 -430
- package/designer/layout/index.umd.cjs +0 -1
- package/designer/list-nav/index.esm.js +0 -802
- package/designer/list-nav/index.umd.cjs +0 -1
- package/designer/lookup/index.esm.js +0 -2083
- package/designer/lookup/index.umd.cjs +0 -1
- package/designer/menu-lookup/index.esm.js +0 -46
- package/designer/menu-lookup/index.umd.cjs +0 -1
- package/designer/nav/index.esm.js +0 -284
- package/designer/nav/index.umd.cjs +0 -1
- package/designer/number-range/index.esm.js +0 -1616
- package/designer/number-range/index.umd.cjs +0 -1
- package/designer/order/index.css +0 -1
- package/designer/order/index.esm.js +0 -2196
- package/designer/order/index.umd.cjs +0 -18
- package/designer/page-footer/index.esm.js +0 -290
- package/designer/page-footer/index.umd.cjs +0 -1
- package/designer/page-header/index.esm.js +0 -1003
- package/designer/page-header/index.umd.cjs +0 -1
- package/designer/pagination/index.esm.js +0 -591
- package/designer/pagination/index.umd.cjs +0 -1
- package/designer/progress/index.esm.js +0 -213
- package/designer/progress/index.umd.cjs +0 -1
- package/designer/search-box/index.esm.js +0 -245
- package/designer/search-box/index.umd.cjs +0 -1
- package/designer/smoke-detector/index.css +0 -1
- package/designer/smoke-detector/index.esm.js +0 -178
- package/designer/smoke-detector/index.umd.cjs +0 -1
- package/designer/sort-condition-editor/index.esm.js +0 -138
- package/designer/sort-condition-editor/index.umd.cjs +0 -1
- package/designer/splitter/index.esm.js +0 -1120
- package/designer/splitter/index.umd.cjs +0 -1
- package/designer/step/index.esm.js +0 -226
- package/designer/step/index.umd.cjs +0 -1
- package/designer/text/index.esm.js +0 -147
- package/designer/text/index.umd.cjs +0 -1
- package/designer/transfer/index.esm.js +0 -254
- package/designer/transfer/index.umd.cjs +0 -1
- package/designer/tree-view/index.esm.js +0 -313
- package/designer/tree-view/index.umd.cjs +0 -1
- package/designer/uploader/index.esm.js +0 -1190
- package/designer/uploader/index.umd.cjs +0 -2
- package/designer/verify-detail/index.esm.js +0 -258
- package/designer/verify-detail/index.umd.cjs +0 -1
- package/designer/video/index.esm.js +0 -136
- package/designer/video/index.umd.cjs +0 -1
- package/designer/weather/index.css +0 -1
- package/designer/weather/index.esm.js +0 -6244
- package/designer/weather/index.umd.cjs +0 -14
- package/types/accordion/designer.d.ts +0 -44
- package/types/avatar/designer.d.ts +0 -29
- package/types/button-group/designer.d.ts +0 -29
- package/types/code-editor/designer.d.ts +0 -5
- package/types/color-picker/designer.d.ts +0 -29
- package/types/combo-list/designer.d.ts +0 -29
- package/types/combo-list/src/designer/combo-list.design.props.d.ts +0 -6
- package/types/combo-tree/designer.d.ts +0 -5
- package/types/component/designer.d.ts +0 -35
- package/types/condition/designer.d.ts +0 -56
- package/types/dropdown/designer.d.ts +0 -6
- package/types/dynamic-form/src/composition/use-input-type-resolver.d.ts +0 -11
- package/types/expression-editor/designer.d.ts +0 -9
- package/types/filter-condition-editor/designer.d.ts +0 -10
- package/types/html-template/designer.d.ts +0 -31
- package/types/html-template/src/designer/html-template.design.props.d.ts +0 -9
- package/types/image-cropper/designer.d.ts +0 -4
- package/types/json-editor/designer.d.ts +0 -5
- package/types/menu-lookup/designer.d.ts +0 -5
- package/types/nav/designer.d.ts +0 -6
- package/types/number-range/designer.d.ts +0 -29
- package/types/order/designer.d.ts +0 -6
- package/types/page-footer/designer.d.ts +0 -6
- package/types/page-header/src/designer/page-header.design.props.d.ts +0 -20
- package/types/pagination/designer.d.ts +0 -29
- package/types/progress/designer.d.ts +0 -29
- package/types/search-box/designer.d.ts +0 -52
- package/types/smoke-detector/designer.d.ts +0 -6
- package/types/sort-condition-editor/designer.d.ts +0 -9
- package/types/splitter/designer.d.ts +0 -32
- package/types/step/designer.d.ts +0 -6
- package/types/text/designer.d.ts +0 -6
- package/types/transfer/designer.d.ts +0 -35
- package/types/tree-view/designer.d.ts +0 -29
- package/types/uploader/designer.d.ts +0 -141
- package/types/verify-detail/designer.d.ts +0 -6
- package/types/video/designer.d.ts +0 -6
- /package/{designer → components}/condition/index.css +0 -0
- /package/{designer → components}/uploader/index.css +0 -0
- /package/types/{dynamic-form/src/component/form-control/form-control.component.d.ts → list-nav/src/designer/list-nav.design.component.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../notify/index.umd.js"),require("../tree-view/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../input-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js"),require("../../designer/dynamic-form/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js","../notify/index.umd.js","../tree-view/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../input-group/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js","../../designer/dynamic-form/index.umd.js"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W["events-editor"]={},W.Vue,W.dynamicResolver,W.LodashES,W.common,W.designerCanvas,W.notify,W.treeView,W.schemaSelector,W.modal,W.FInputGroup,W.ComboList,W.FEventParameter,W.designer))})(this,function(W,e,ue,q,me,Oe,ae,Re,qe,_e,Ue,ze,ke,Ge){"use strict";const He=new Map([["appearance",ue.resolveAppearance]]);function We(n,x,V){return x}const Ke={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}},viewSourceHandle:{description:"",type:"function",default:null}},required:["id","type"]},Je={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},je=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],Fe={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:je,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:je,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},Ae=ue.createPropsResolver(Fe,Ke,He,We,Je);function $e(){function n(V,b){const d=[{controllerId:"45be24f9-c1f7-44f7-b447-fe2ada458a61",controllerLabel:"AdvancedListCardController",controllerName:"高级列卡控制器",commands:[{name:"增加子表数据",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"},{name:"插入数据",id:"3208b00c-543d-c050-3c54-081715972dda",handlerName:"Insert"},{name:"查询从表数据(分页)",id:"b60b7754-35cf-7eaa-0f1d-bc5e5d61c0bc",handlerName:"queryChild"},{name:"批量删除子表",id:"378fcd7d-ce91-c052-5947-d60ecdb38df9",handlerName:"batchDelete"},{name:"移动数据",id:"fcac5d5e-2367-2b61-a82a-f8e874e8efc0",handlerName:"move"},{name:"打开批量编辑界面",id:"8d8b05d6-2d22-b0b7-7cb8-51bbb8cd8a18",handlerName:"openBatchEditDialog"}]},{controllerId:"d7ce1ba6-49c7-4a27-805f-f78f42e72725",controllerLabel:"EditableListController",controllerName:"可编辑列表控制器",commands:[{name:"打开批量编辑界面",id:"c3831e36-27d1-1c98-dd60-30e2d7ec04d2",handlerName:"openBatchEditDialog"},{name:"加载列表数据",id:"f80e026b-bd9b-002b-d2aa-52c44a633bec",handlerName:"Load"}]},{controllerId:"8fe977a1-2b32-4f0f-a6b3-2657c4d03574",controllerLabel:"TreeCardController",controllerName:"树卡控制器",commands:[{name:"新增子表数据",id:"21b0c3af-3caf-b11d-2360-d9af20016501",handlerName:"AddItem"},{name:"删除子表数据",id:"113f1d77-65a4-63bf-3973-80dd15f294d1",handlerName:"RemoveItem"},{name:"批量删除子表",id:"bf13585c-a8f3-384b-356c-bd8bf06751c4",handlerName:"batchDelete"}]},{controllerId:"8d21e69c-70b3-44f6-88b5-fd6a8d3ce11b",controllerLabel:"PopController",controllerName:"弹出控制器",commands:[{name:"新增子表数据",id:"d6933772-8047-9bde-220b-449481883142",handlerName:"AddItem"},{name:"删除子表数据",id:"03c233eb-e39e-8e34-6809-ee4ab3a0d97c",handlerName:"RemoveItem"},{name:"加载并新增",id:"6882ab4a-9c23-8d59-6aac-de891eae20d2",handlerName:"LoadAndAdd"}]},{controllerId:"43f68561-eae4-4495-b318-d629615523f8",controllerLabel:"BatchEditCommands",controlleName:"批量编辑控制器",commands:[{name:"打开批量编辑界面",id:"a659aaba-daa4-3c07-8b26-164b01726022",handlerName:"openBatchEditDialog"},{name:"复制行",id:"d5f67e0a-767d-a238-5ad4-b1285476c16f",handlerName:"copyRow"},{name:"复制行",id:"229d2dd3-2fe7-f06a-b705-cfa0fc711614",handlerName:"clone"}]},{controllerId:"c121742e-6028-48bf-817c-1dda7fb098df",controllerLabel:"AdvancedListCardWithSidebarController",controllerName:"高级列卡控制器(侧边栏)",commands:[{name:"增加子表数据(侧边栏)",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据(侧边栏)",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"}]},{controllerId:"8172a979-2c80-4637-ace7-b13074d3f393",controllerLabel:"CardController",controllerName:"卡片控制器",commands:[{name:"新增子表数据",id:"6f987222-ebe2-0f3c-1594-a12408b22801",handlerName:"AddItem"},{name:"删除子表数据",id:"0cdeddcc-8332-f13f-be96-b5eeac84a334",handlerName:"RemoveItem"},{name:"插入数据",id:"2666b526-a1b2-f268-1629-b1b95b71c8dd",handlerName:"Insert"},{name:"打开批量编辑界面",id:"8104dd8e-bb27-a659-ff7c-a0321523f727",handlerName:"openBatchEditDialog"},{name:"新增子节点(子表树)",id:"bbd11957-de2a-c727-11d6-64788c4b0fa8",handlerName:"addSubChild"},{name:"删除子表树节点",id:"c8c9f652-ba52-3a9b-5eb9-dadd42c832cd",handlerName:"RemoveTreeItem"},{name:"批量删除子表",id:"e96857fa-1617-fd92-8a05-5c684e0819a1",handlerName:"batchDelete"}]},{controllerId:"31c1022c-ab40-4e8d-bc31-85d539f1d36c",controllerLabel:"FileController",controllerName:"文件控制器",commands:[{name:"批量删除文件数据",id:"d5bf021b-1aa4-06fe-3236-188fd218f4f7",handlerName:"removeFileRows"}]},{controllerId:"2eb7bbd1-fabd-4d0f-991d-7242f53225b1",controllerLabel:"AttachmentController",controllerName:"附件控制器",commands:[{name:"上传并更新行",id:"2a84e28f-7202-d858-1466-748a8040c1f9",handlerName:"UploadAndUpdateRow"},{name:"通过属性名上传并更新行",id:"0f98c9b8-a01b-55d4-3115-269a73f7ccff",handlerName:"uploadAndUpdateRowWithPropertyName"},{name:"移除版本附件行",id:"b441b6a7-9e13-9f75-77a2-10b2c1f7ef26",handlerName:"RemoveAttachmentItem"},{name:"上传并批量新增行",id:"e6fc25ca-853b-0b2d-76c9-a1f7a253679b",handlerName:"UploadAndBatchAddRows"},{name:"通过属性名上传并批量更新行",id:"e00b70db-9de3-8e3e-eb59-1c550a255fec",handlerName:"uploadAndBatchAddRowsWithPropertyName"}]},{controllerId:"e353b4e9-e073-4e18-b9f7-ec4cc8ac72b1",controllerLabel:"PrintService",controllerName:"打印控制器",commands:[{name:"根据数据条件批量打印",id:"774fa275-2da1-e927-e8bf-d27d9886a168",handlerName:"printMulti"}]},{controllerId:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",controllerLabel:"ListController",controllerName:"列表控制器",commands:[{name:"加载数据",id:"86c9f281-e5bc-5d5c-1b86-d1e17ab2e850",handlerName:"Load"}]},{controllerId:"7c48ef46-339c-42d4-8365-a21236c63044",controllerLabel:"ListCardController",controllerName:"列卡控制器",commands:[{name:"加载列表数据",id:"e573d6a2-8261-9ad4-c9f1-2e59af53302d",handlerName:"loadList"}]},{controllerId:"26436aa8-88a7-4aee-bf0b-9843c1e8afbf",controllerLabel:"ListListController",controllerName:"双列表控制器",commands:[{name:"加载导航列表数据",id:"f7dd2c84-7abd-d4bf-6b31-71d96035c034",handlerName:"LoadNavList"}]}];let v=-1;const L=d.findIndex(w=>V===w.controllerId);return L!==-1&&(v=d[L].commands.findIndex(w=>b===w.handlerName)),v!==-1}function x(V,b,d){const v=n(V.controllerName.id,b.handlerName);return d.componentLists.length!==0&&v&&(b.hasPath=!0,b.targetComponent=b.targetComponent||d.componentLists[0].componentId,b.componentLists=q.cloneDeep(d.componentLists)),b}return{isContextDependent:n,setComponentLists:x}}var oe=(n=>(n.Frame="frame",n.dataGrid="data-grid",n.listView="list-view",n.form="form",n.uploader="uploader",n.calendar="calendar",n.page="page",n))(oe||{});function Ye(n,x){const V=e.inject("designerContext"),b=V&&V.dgControl?V.dgControl:Oe.DgControl,d=e.ref(""),v=e.ref("");function L(a){var r,h,E,t;let u="controlIcon fd-i-Family ",s="";switch(a==null?void 0:a.type){case"form-group":{s=((r=b[a.type])==null?void 0:r.icon)||((h=a.editor)==null?void 0:h.type)||"",(E=b[a.editor.type])!=null&&E.icon&&(s=b[a.editor.type].icon);break}default:s=((t=b[a.type])==null?void 0:t.icon)||a.type}const i=`fd_pc-${s}`;return u+=i,u}function w(a,u){var r;let s=a.id;const i=u==null?void 0:u.contents;if((u==null?void 0:u.type)==="splitter"&&i&&i.length===2){const h=u.direction!=="column";a.id===((r=i[0])==null?void 0:r.id)?s=h?"左侧区域":"上方区域":s=h?"右侧区域":"下方区域"}return s}function B(a){if(a.isLikeCardContainer)return"区块";const u=a.appearance&&a.appearance.class||"",s=u.split(" ");return a.id==="page-header"&&u&&u==="f-page-header"?"页头":s.includes("f-page-header-base")?"页头容器":s.includes("f-page-header-extend")?"页头扩展容器":s.includes("f-title")?"标题容器":s.includes("f-page")?"根容器":s.includes("f-page-main")?"内容区域":s.includes("f-scrollspy-content")&&a.isScrollspyContainer?"滚动监听容器":s.includes("f-grid-is-sub")?"表格容器":s.includes("f-filter-container")?"筛选条容器":"容器"}function k(a){const{componentType:u}=a;switch(u){case oe.Frame:return"根组件";case oe.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(a,i=>i.type===(b["tree-grid"]&&b["tree-grid"].type)))?"树表格组件":"表格组件";case oe.uploader:return"附件组件";case oe.listView:return"列表视图组件";case oe.form:return"卡片组件";case oe.calendar:return"日历组件";case oe.page:return a.name||"页面";default:return"组件"}}function C(a,u){const s=a.name||a.text||a.label||a.title||a.mainTitle;if(a.type!=="component"&&s&&typeof s=="string")return s.trim();switch(a.type){case"content-container":return B(a);case"splitter-pane":return w(a,u);case"component":return k(a);default:return b[a.type]&&b[a.type].name||a.id}}function F(a,u){const s=a.length?a[0]:null;if(!s)return;v.value="",d.value=s.originalId;const i=s?`${s.originalId}-design-item`:"",r=document.getElementById(i);r&&r.click(),x.emit("selectionChanged",s)}function f(a){if(!a)return;const u=`${a}-design-item`,s=document.getElementById(u);s&&s.click()}return{getIcon:L,getTitle:C,onChanged:F,currentSelectedNodeId:d,currentSelectedOutsideNodeId:v,triggerOutsideClick:f}}function Qe(n,x){const{getIcon:V,getTitle:b}=x;function d(C,F,f,a,u){var i;const s=(i=n.data.module)==null?void 0:i.components.find(r=>r.id===C.component);s&&v([s],F,f,a,u)}function v(C,F,f,a,u){return C.forEach(s=>{if(s.type==="component"&&(u=s.id),s.type==="component-ref"){d(s,F,f,a,u);return}const i={originalId:s.id,layer:f,originalParent:a==null?void 0:a.id,componentId:u,name:b(s,a),type:s.type,controlIcon:V(s),rawSchema:s};F.push(q.cloneDeep(i)),(s.contents||s.buttons)&&v(s.contents||s.buttons,F,f+1,s,u)}),F}function L(C){const F=[],f=C.find(i=>i.layer===0);C=C.filter(i=>i.layer!==0),F.push(f);let a=f.originalId,u=0,s=1e3;for(;C.length!==0||s===0;){const i=C.find(r=>r.originalParent===a);i?(F.push(i),a=i.originalId,C=C.filter(r=>r.originalId!==a),u=0):(u-=1,a=F.slice(u)[0].originalId),s-=1}return F}function w(C){return C.forEach((F,f)=>{F.id=(f+1).toString()}),C.forEach(F=>{var f;F.parent=((f=C.find(a=>a.originalId===F.originalParent))==null?void 0:f.id)||""}),C.forEach(F=>{F.hasChildren=C.findIndex(f=>f.parent===F.id)>0}),C}function B(C){const F={originalId:n.data.module.id,layer:0,originalParent:null,name:"页面",type:"module",controlIcon:"controlIcon fd-i-Family fd_pc-module",rawSchema:n.data.module},f=[];return C.forEach(a=>{a[0].originalParent=F.originalId,f.push(...a)}),f.unshift(F),f}function k(){const C=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!C.value)return;const F=[];C.value.forEach(s=>{if(s){const i=[];i.push(s);const E=v(i,[],1,null,s.id);F.push(E)}});const f=B(F),a=L(f);return w(a)}return{getData:k}}function le(n){const x=e.inject("sourceOutlineData")||[],V=e.ref(),b=e.ref(!1),d=e.ref([]),v=e.ref();function L(i,r,h,E){var t,R,_,T;return{id:me.useGuid().guid(),source:E||{formId:(t=i.sourceCommunication)==null?void 0:t.formId,formCode:(R=i.sourceCommunication)==null?void 0:R.formCode,componentId:(_=i.sourceCommunication)==null?void 0:_.componentId,externalContainerId:(T=i.sourceCommunication)==null?void 0:T.externalContainerId,event:r||"onCommunication"},target:{formId:(h==null?void 0:h.formId)||"",formCode:(h==null?void 0:h.formCode)||"",externalContainerId:(h==null?void 0:h.externalContainerId)||"",commandCode:(h==null?void 0:h.commandCode)||"",commandViewmodelId:(h==null?void 0:h.commandViewmodelId)||""},paramMappings:[]}}function w(i){var r,h;(r=i==null?void 0:i.communication)!=null&&r.length&&((h=i==null?void 0:i.communication)==null||h.map(E=>{var t,R;if(E!=null&&E.id&&!((t=E==null?void 0:E.source)!=null&&t.componentId)){const _=(R=n.getFormSchema().module.communications)==null?void 0:R.find(T=>T.id===(E==null?void 0:E.id));_&&Object.assign(E,_)}}))}function B(i){const r=n.getFormSchema(),{communications:h}=r.module;h||(r.module.communications=[]);const E=r.module.communications.findIndex(t=>t.id===i.id);E===-1?r.module.communications.push(i):Object.assign(r.module.communications[E],i)}function k(i){var r;if((r=i==null?void 0:i.communication)!=null&&r.length){const h=n.getFormSchema();i.communication.map(E=>{h.module.communications&&E&&(h.module.communications=h.module.communications.filter(t=>t.id!==E.id))}),i.communication=[]}}function C(i){var h;const r=n.getFormSchema();i&&((h=r.module.communications)!=null&&h.length)&&(r.module.communications=r.module.communications.filter(E=>E.id!==i))}function F(i,r,h){const E=Ye(i,r),t=n.externalFormSchema.get(h);if(t!=null&&t.content){const R={data:t.content},{getData:_}=Qe(R,E);return _()}return[]}function f(i){var h;if(!((h=i==null?void 0:i.source)!=null&&h.componentId)){b.value=!1;return}const r=x.find(E=>E.originalId===i.source.componentId);r?(b.value=!1,V.value=r):(b.value=!0,V.value={id:i.source.componentId})}function a(i){var t,R,_,T;d.value=[];const r=(t=V.value)==null?void 0:t.rawSchema;if(!r){v.value=null;return}const h=r.type==="form-group"&&r.editor?r.editor.type:r.type,E=(R=ue.schemaMap[h])==null?void 0:R.events;E&&Object.keys(E).forEach(p=>{d.value.push({eventCode:p,eventName:E[p]})}),(_=i.source)!=null&&_.event&&((T=d.value)!=null&&T.length)&&(v.value=d.value.find(p=>{var y;return p.eventCode===((y=i.source)==null?void 0:y.event)}))}function u(i){var E,t,R,_,T,p,y,l;if(!(i!=null&&i.length))return;f(i[0]),a(i[0]);let r="",h="";return b.value?r=`${((E=i[0].source)==null?void 0:E.componentId)||""}-${((t=i[0].source)==null?void 0:t.event)||""}`:(r=(R=V.value)==null?void 0:R.name,r&&((_=v.value)!=null&&_.eventName)&&(r+=`-${(T=v.value)==null?void 0:T.eventName}`),h=`${(p=V.value)==null?void 0:p.name} (${(y=V.value)==null?void 0:y.originalId})`,h=`${h}
|
|
2
|
-
${(l=v.value)==null?void 0:l.eventName} (${v.value.eventCode})`),{title:r,titleTip:h,isControlInvalid:b.value}}function s(i){var r;if((r=i==null?void 0:i.communication)!=null&&r.length){const h=i==null?void 0:i.communication[0];return h==null?void 0:h.source}}return{createNewCommunication:L,resolveCommunication:w,clearAllCommunication:k,clearCommunicationById:C,saveCommunication:B,assembleSourceOutline:F,resolveSourceControlEventTitle:u,resolveCommunicationSource:s}}function Xe(n,x,V){const b=e.ref([]),{boundEvents:d,unBoundEvent:v}=x;function L(f){var u,s;return{event:{label:(u=f.boundEvents)==null?void 0:u.label,name:(s=f.boundEvents)==null?void 0:s.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:q.cloneDeep(f.command),controller:q.cloneDeep(f.controller),communication:f.communication}}function w(){var f;b.value=(f=d.value)==null?void 0:f.map(a=>L(a))}function B(f,a){const s=L({boundEvents:f,command:null,controller:{id:"",name:"",label:""},communication:a?[a]:[]});if(a){s.showSwitch[0].showSwitchNumber=2,s.showSwitch[0].showSection[2][2]=!1,s.showSwitch[0].showSection[2][3]=!1,s.needSelectCommunicationCommand=!0,b.value.unshift(s);return}f&&(s.showSwitch[0].showSwitchNumber=1,s.showSwitch[0].showSection[2][3]=!0,b.value.unshift(s))}function k(){var f;(f=b.value)==null||f.forEach(a=>{a.showSwitch.forEach(u=>{u.showSection[2][3]=!1}),a.shouldShowCommunicationPanel=!1})}function C(f){b.value[f].showSwitch.forEach(a=>{a.showSection[2][3]=!a.showSection[2][3]})}function F(f){if(f>=0&&f<=b.value.length-1){const a=b.value[f];v(a.event),b.value.splice(f,1);const{clearAllCommunication:u}=le(n);u(a)}}return{addNewInteraction:B,collapseInteractions:k,deleteInteracton:F,toggleMethodInInteraction:C,interactions:b,loadInteractions:w}}function Ze(n){const x=e.ref([]),V=e.ref([]),b=e.ref([]),{isContextDependent:d}=$e();function v(){const{allComponentList:f}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(a=>{a.controllerList.forEach(u=>{if(u.targetComponent){const s=f.find(r=>r.componentId===u.targetComponent);if((s?s.viewModelId:void 0)===n.value.viewModelId)u.hasPath=!1;else{const r=d(a.controllerName.id,u.handlerName);u.hasPath=r?!0:u.hasPath,u.componentLists=r?q.cloneDeep(n.value.componentLists):u.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(a=>{var u;if((u=a.command)!=null&&u.targetComponent){const s=f.find(r=>{var h;return r.componentId===(((h=a.command)==null?void 0:h.targetComponent)||"")});if((s?s.viewModelId:void 0)===n.value.viewModelId)a.command.hasPath=!1;else{const r=d(a.controller.id,a.command.handlerName);a.command.hasPath=r?!0:a.command.hasPath,a.command.componentLists=r?q.cloneDeep(n.value.componentLists):a.command.componentLists}}})}function L(){const f=V.value.reduce((u,s)=>(u.set(s.boundEvents.label,!0),u),new Map);return x.value.filter(u=>!f.has(u.label))}function w(){var a;const f=((a=V.value)==null?void 0:a.length)>0;b.value=f?L():x.value}function B(){v(),x.value=n.value.events,V.value=n.value.boundEventsList,w()}function k(f){b.value=b.value.filter(a=>a.label!==f.label)}function C(f){V.value=V.value.filter(a=>a.boundEvents.label!==f.label),w()}function F(){var u;const f=(u=n.value)==null?void 0:u.getEventList(),{events:a}=f;f&&(n.value.events=q.cloneDeep(a),n.value.boundEventsList=f.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(s){return a.find(i=>i.label===s.boundEvents.label)}))}return{allEvents:x,boundEvents:V,candidateEvents:b,excludeFromCandidates:k,loadEvents:B,resetBoundEvents:F,unBoundEvent:C}}const en={sourceCommunication:{type:Object,default:{}}},nn={events:{type:Array,default:[]}},on=e.defineComponent({name:"FEventList",props:nn,emits:["click"],setup(n,x){const V=e.ref(n.events);function b(v){x.emit("click",v)}function d(v){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>b(v),class:"f-page-events-editor-first-bound-event-name"},[v.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[V.value.map(v=>d(v))])}}),re={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},tn=e.defineComponent({name:"FSelectSourceControl",props:re,emits:["selectSourceEvent","deleteControl"],setup(n,x){const V=e.inject("useFormSchema"),{createNewCommunication:b}=le(V),d=e.ref();d.value=b(n);const v=e.ref([{field:"name",title:"",dataType:"string"}]),L=e.ref([]),w=e.ref(),B=e.ref(),k=e.ref(!0),C=e.ref(!1),F=e.ref([]),f=e.ref(),a=e.ref(!0),u=e.ref(!1);function s(){const p=e.inject("sourceOutlineData");L.value=p||[],B.value.updateDataSource(L.value)}function i(){var y,l,o;if(!((l=(y=d.value)==null?void 0:y.source)!=null&&l.componentId)){u.value=!1;return}const p=(o=L.value)==null?void 0:o.find(c=>c.originalId===d.value.source.componentId);p?(B.value.selectItemById(p.id),u.value=!1):(u.value=!0,w.value={id:d.value.source.componentId})}function r(){var p,y,l;(y=(p=d.value)==null?void 0:p.source)!=null&&y.event&&((l=F.value)!=null&&l.length)&&(f.value=F.value.find(o=>{var c,g;return o.eventCode===((g=(c=d.value)==null?void 0:c.source)==null?void 0:g.event)}))}e.onMounted(()=>{s(),i(),r(),a.value=!1});function h(){var o;F.value=[];const p=w.value.rawSchema,y=p.type==="form-group"&&p.editor?p.editor.type:p.type,l=(o=ue.schemaMap[y])==null?void 0:o.events;l&&Object.keys(l).forEach(c=>{F.value.push({eventCode:c,eventName:l[c]})})}function E(p){k.value=!1,u.value=!1;const y=w.value!==p[0];y&&(w.value=p[0],h()),a.value||(C.value=!0),!a.value&&y&&(f.value=null)}const t=e.computed(()=>({"item-list":!0,"d-none":!k.value})),R=e.computed(()=>p=>{var y;return{item:!0,selected:((y=f.value)==null?void 0:y.eventCode)===p}});function _(p){var y;k.value=!1,C.value=!1,f.value=p,d.value.source.componentId=w.value.rawSchema.id,d.value.source.event=(y=f.value)==null?void 0:y.eventCode,x.emit("selectSourceEvent",d.value)}const T=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:u.value}));return()=>e.createVNode("div",{class:T.value},[e.createVNode("div",{class:t.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(Re.FTreeView,{ref:B,data:L.value,columns:v.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!0,iconField:"controlIcon",onSelectionChange:E},null)]),C.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),F.value.map(p=>e.createVNode("span",{class:R.value(p.eventCode),onClick:()=>_(p)},[p.eventName]))])])])}}),an=e.defineComponent({name:"FInteractionButton",props:en,emits:["clickEventItem","selectSourceControl"],setup(n,x){const V=new ae.FNotifyService,b=e.inject("useEventsComposition"),d=e.inject("useInteractionCompostion"),{candidateEvents:v}=b,{collapseInteractions:L}=d,w=e.ref(!1),B=e.ref(!1);function k(u){v.value=v.value.filter(s=>s.label!==u.label)}function C(){var u;(u=n.sourceCommunication)!=null&&u.needSelectSourceControl?B.value=!B.value:w.value=!w.value}function F(u){C(),k(u),x.emit("clickEventItem",u)}function f(){var u;if(!((u=n.sourceCommunication)!=null&&u.needSelectSourceControl)&&v.value.length===0){V.info({position:"top-center",message:"事件已全部绑定"});return}L(),C()}function a(u){B.value=!1,x.emit("selectSourceControl",u)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:f},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),w.value&&e.createVNode(on,{events:v.value,onClick:F},null),B.value&&e.createVNode(tn,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:a},null)])}}),cn={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]},sourceCommunication:{type:Object,default:{}},viewSourceHandle:{type:Function,default:()=>{}},haveBoundCommand:{Type:Boolean,default:!1}},ln={newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundCommand:{Type:Boolean,default:!1},controllers:{type:Array,default:[]},iteractionDisplayOrder:{Type:Number,default:0},event:{Type:Object},sourceCommunication:{type:Object,default:{}}},rn={controllers:{type:Array,default:[]}},dn=e.defineComponent({name:"FCommandList",props:rn,emits:["selectMethod"],setup(n,x){function V(w){return w.controllerList.length!==0}function b(w){return V(w)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:w.controllerName.name},[w.controllerName.name])])}function d(w,B){x.emit("selectMethod",{method:w,controller:B})}function v(w){return w.controllerList.map(B=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>d(B,w)},[e.createVNode("div",{class:"f-page-internals-command-name",title:B.label},[B.name])]))}function L(w){return e.createVNode("div",null,[b(w),v(w)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(w=>L(w))])}}),sn={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},un=e.defineComponent({name:"FBoundEventSelector",props:sn,emits:["cancel","submit"],setup(n,x){var P,$;const V=e.ref(),b=e.ref([]),d=e.ref('<i class="f-icon f-icon-search"></i>'),v=n.useFormSchema.getFormMetadataBasicInfo(),L=e.ref(""),w=e.ref(),B=((P=n.sourceCommunication)==null?void 0:P.unSupportedEventCodes)||[],k=e.ref(!B.includes(n.event.label)&&(($=n.useFormSchema.externalFormSchema)==null?void 0:$.size)>0),C=e.ref(),F=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const m=n.getEventPath();V.value=m.viewModelDisplay;const{actionWithPath:M}=m;M.forEach(I=>{I.sourceComponent.map.forEach(A=>{A.active=!1,A.hide=!1})}),b.value=q.cloneDeep(M)}});function f(m=""){m=m.replace(/ /g,"").replace(/>/g,"").toLowerCase(),m===""&&(m=" "),b.value.forEach(M=>{const I=M.path;M.sourceComponent.map.forEach(A=>{const U=A.command.name,J=A.event.name,N=A.command.label;`${I}${U}${J}${N}`.toLowerCase().includes(m)?A.hide=!1:A.hide=!0})})}function a(m=""){m=m.replace(/ /g,"").replace(/>/g,"").toLowerCase(),F.value.forEach(M=>{if(!M.isCommandNode)return;const I=M.name||"",A=M.code||"",U=M.viewmodelName||"",J=`${I}${A}${U}`.toLowerCase();m&&!J.includes(m)?M.hide=!0:M.hide=!1})}function u(m=""){!C.value||C.value.id===v.id?f(m):a(m)}function s(){const m=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(Ue,{updateOn:"change",groupText:d.value,modelValue:L.value,"onUpdate:modelValue":M=>L.value=M,onChange:u,placeholder:"请输入名称/编号/路径搜索"},null)])]);return k.value?e.createVNode("div",{class:"f-navSelector-header"},[e.createVNode("div",{class:"f-navSelector-recommand"},[e.createVNode("div",{class:"f-navSelector-recommand-text"},[e.createTextVNode("方法列表")])]),e.createVNode("div",{class:"f-navSelector-remainder"},[e.createVNode("div",{class:"f-vm-search"},[m])])]):m}function i(m){return{"f-vm-item":!0,"f-vm-item-focus":m.active}}function r(m,M){let I=0;b.value.forEach(A=>{A.sourceComponent.map.forEach(U=>{!U.command.isInvalid&&m.controller.id===U.controller.id&&m.command.id===U.command.id&&m.event.label===U.event.label&&M.sourceComponent.id===A.sourceComponent.id?(m.active=!m.active,w.value=q.cloneDeep(m)):(U.command.isInvalid&&m.controller.id===U.controller.id&&m.command.id===U.command.id&&m.event.label===U.event.label&&M.sourceComponent.id===A.sourceComponent.id&&(I++,I===1&&(new ae.FNotifyService().info({position:"top-center",message:"该方法已失效"}),w.value=null)),U.active=!1)})})}function h(m){return{"f-event-func":!m.command.isInvalid,"f-event-func-invalid":m.command.isInvalid}}function E(m){return m.sourceComponent.map.filter(M=>!M.hide).map(M=>{if(!M.command.isInvalid)return e.createVNode("div",{class:i(M),onClick:()=>r(M,m)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size:10px;color:#30B471;"},[e.createTextVNode(" ")])]),e.createVNode("div",{class:h(M)},[M.command.name,e.createTextVNode("("),M.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[m.path,M.event.name])])})}function t(){return b.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[b.value.map(m=>E(m))]):e.createVNode("div",{class:"f-list-view-emptydata",style:"height: 360px;position: relative;"},[e.createVNode("div",{class:"f-datagrid-norecords"},[e.createVNode("div",{class:"f-datagrid-norecords-content"},[e.createTextVNode(" 暂无数据")])])])}function R(){x.emit("cancel")}function _(){if(!w.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}x.emit("submit",{selectedCommand:w.value,selectedForm:C.value})}function T(){const m=n.useFormSchema.externalFormSchema,M=[];return M.push({containerId:"",id:v.id,code:v.code,name:v.name}),Array.from(m.keys()).forEach(I=>{const A=m.get(I);M.push({containerId:I,id:A.id,code:A.code,name:A.name})}),M}const p=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":k.value}));function y(m){var U,J;const{viewmodels:M,components:I}=m.module;if((M==null?void 0:M.length)===0||(I==null?void 0:I.length)===0)return[];F.value=[];const A=(J=(U=n.sourceCommunication)==null?void 0:U.parameterData)==null?void 0:J.getViewModelName;M.forEach(N=>{if(!N||!N.commands||N.commands.length===0)return[];const z=I.find(ee=>ee.viewModel===N.id),K=A&&z?A(z,N.name,m):"";F.value.push({id:N.id,code:N.code,name:K||N.name}),N.commands.forEach(ee=>{ee.isInvalid||F.value.push({...ee,viewmodelId:N.id,viewmodelName:K||N.name,isCommandNode:!0})})})}function l(m){var M,I,A;if(!(m.id===C.value.id&&m.containerId===C.value.containerId))if(C.value=m,L.value="",w.value=null,C.value.id!==v.id){const U=(I=n.useFormSchema.externalFormSchema)==null?void 0:I.get((M=C.value)==null?void 0:M.containerId);(A=U==null?void 0:U.content)!=null&&A.module&&y(U.content)}else b.value.map(U=>{U.sourceComponent.map.map(J=>{J.hide=!1,J.active=!1})})}function o(){const m=T();C.value||(C.value=m[0]);const M=e.computed(()=>I=>{var A;return{"f-list-view-group-item":!0,"f-listview-active":I.id===((A=C.value)==null?void 0:A.id)&&I.containerId===C.value.containerId}});return e.createVNode("div",{class:"f-page-nav"},[e.createVNode("div",{class:"f-list-view"},[e.createVNode("div",{class:"f-list-view-content"},[e.createVNode("ul",{class:"f-list-view-group",style:"list-style: none;"},[m.map(I=>{let A=I.name;return I.containerId&&(A+=`, 所属外部容器:${I.containerId}`),e.createVNode("li",{class:M.value(I),onClick:()=>l(I)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:A},[I.name])])])})])])])])}function c(m){F.value.map(M=>M.active=!1),m.active=!0,w.value=m}function g(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[F.value.filter(m=>!m.hide).map(m=>{if(m.isCommandNode)return e.createVNode("div",{class:i(m),onClick:()=>c(m)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size: 10px; color: rgb(48, 180, 113);"},null)]),e.createVNode("div",{class:"f-event-func"},[m.name,e.createTextVNode("("),m.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[m.viewmodelName])])})])}return()=>e.createVNode("div",{class:p.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[k.value?o():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[s(),!C.value||C.value.id===v.id?t():g()])]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:R},[e.createTextVNode("取消")]),e.createVNode("button",{type:"button",class:"btn btn-primary",onClick:_},[e.createTextVNode("确定")])])])}}),mn=e.defineComponent({name:"FCommandSource",props:ln,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,x){const V=e.inject("useMethodsComposition"),b=e.inject("useFormCommand"),d=new ae.FNotifyService,{checkIfNewControllerExists:v,addNewController:L}=V,w=e.ref(n.controllers),B=e.inject("useFormSchema"),k=e.inject(_e.F_MODAL_SERVICE_TOKEN);let C,F;const f=e.ref(!1);e.onMounted(()=>{f.value=B.externalFormSchema.size>0});function a(c,g,P){if(L(c),c.Commands){const $=b.getInternalControllerFromControllerMetadata(c,g,P);v($)&&d.info({position:"top-center",message:"该控制器已存在"})}}async function u(c){b.getSupportedControllerMetadata(c).then(g=>{g&&a(g.controller,g.code,g.nameSpace)}).finally(()=>{C&&C.destroy&&C.destroy()})}function s(c){C&&C.destroy&&C.destroy()}function i(){const c={formBasicInfo:B==null?void 0:B.getFormMetadataBasicInfo()};return e.createVNode(qe.FSchemaSelector,{injectSymbolToken:me.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:c,showFooter:!0,onCancel:s,onSubmit:u},null)}function r(){C=k.open({title:"选择控制器",width:950,render:i,showButtons:!1})}function h(){x.emit("newFunctionChanged")}function E(){F&&F.destroy&&F.destroy()}function t(c){const{selectedCommand:g,selectedForm:P}=c;!P||(P==null?void 0:P.id)===B.getFormMetadataBasicInfo().id?(V.selectBoundCommand(g,n.iteractionDisplayOrder),x.emit("selectBoundMethod")):x.emit("addCommunication",c),E()}function R(){const{getEventPath:c}=V;return e.createVNode(un,{getEventPath:c,notifyService:d,useFormSchema:B,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:E,onSubmit:t},null)}function _(){F=k.open({title:"已有方法",width:950,height:500,fitContent:!1,render:R,showButtons:!1,enableEsc:!1,draggable:!0})}function T(){x.emit("close",null)}function p(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function y(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>r()},[e.createTextVNode("引入控制器")])]),e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>h()},[e.createTextVNode("添加新方法")])]),(n.haveBoundCommand||f.value)&&e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>_()},[e.createTextVNode("已有方法")])])])}function l(c){x.emit("selectMethod",c)}function o(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(dn,{controllers:w.value,onSelectMethod:l},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[o(),p(),y(),p(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:T},[e.createTextVNode("取消")])])])}}),fn={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},hn=e.defineComponent({name:"FParameterEditor",props:fn,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,x){const V=new ae.FNotifyService,b=e.inject("FMessageBoxService"),d=e.ref(q.cloneDeep(n.command)),v=e.ref(n.controller),L=e.ref(0),w=e.computed(()=>d.value.id==="abandoned"),B=e.computed(()=>d.value.id==="deleted"),k=e.computed(()=>n.showDeleteIcon),C=e.computed(()=>d.value!==null),F=e.inject("useMethodsComposition"),f=e.ref(n.showParameter),a=e.inject("useFormSchema"),u=e.computed(()=>d.value.componentLists&&d.value.hasPath),s=e.computed(()=>{const N=d.value.id!=="abandoned"&&d.value.id!=="deleted",z=u.value,K=d.value.property&&d.value.property.length>0;return N&&(z||K)});function i(){const{targetComponent:N}=d.value;let z="";return d.value.componentLists&&d.value.componentLists.forEach(K=>{if(K.componentId===N){z=K.viewModelId;return}}),z}const r=e.ref(i()),h=e.computed(()=>d.value.targetComponent||"");function E(){V.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function t(){return e.createVNode("div",{title:"方法已被移除,请重新绑定",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>E()},null)}function R(){V.info({position:"top-center",message:"方法已失效,请重新绑定"})}function _(){return e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>R()},null)}function T(N){f.value=!f.value}function p(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>T(L.value)},null)}function y(N,z){d.value.targetComponent=N[0].componentId,x.emit("targetChange",d.value)}function l(){const N=e.reactive({content:"将此方法添加到指定的组件",placement:"top"});return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent"},[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-topic"},[e.createTextVNode("挂载到目标组件"),e.withDirectives(e.createVNode("span",{class:"farris-label-tips ml-2"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),N]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(ze,{modelValue:r.value,"onUpdate:modelValue":z=>r.value=z,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:d.value.componentLists,editable:!1,onChange:y},null)])])])}function o(N,z){z.value=N}function c(){x.emit("change",d.value)}function g(){let N="";return h.value?N=a.getViewModelIdByComponentId(h.value):N=F.getViewModeId(),N}function P(N,z){var he,ve,Ce,ge,ie,de,S,D,j,O,G,Y,Q,X,Z,pe,be,we,te,Ne,Se;const K=g(),Ee=a.getViewModelById(K).commands.find(H=>{var ne;return(H==null?void 0:H.id)===((ne=n.command)==null?void 0:ne.id)}),Pe=e.reactive(N.context.data),{assembleSchemaFieldsByComponent:ye,assembleOutline:Me,assembleStateVariables:xe,assembleSchemaFieldsUnderBoundEntity:Ie,getEditor:Le}=N.context.generalData,{designerMode:Be}=a,Te=H=>{o(H,N),c()},De=H=>{var ne,se,ce,Ve;return((Ve=(ce=(se=(ne=N==null?void 0:N.origin)==null?void 0:ne.controlSource)==null?void 0:se.context)==null?void 0:ce.data)==null?void 0:Ve.value)===":Entity"||H.raw.children&&H.raw.children.length&&(H.disabled=!0),H};return e.createVNode(ke,{readonly:Be==="PC_RTC"&&!z.isRtcCommand,defaultValue:N==null?void 0:N.origin.defaultValue,modelValue:N.value,"onUpdate:modelValue":H=>N.value=H,data:Pe,editor:Le(N.value,N,Ee,K,Te),fieldData:ye(),formData:Me(),varData:xe(),activeViewModelFieldData:Ie(h.value),editorControlSource:(he=N==null?void 0:N.origin)==null?void 0:he.controlSource,customRowStatus:De,idField:((ie=(ge=(Ce=(ve=N==null?void 0:N.origin)==null?void 0:ve.controlSource)==null?void 0:Ce.context)==null?void 0:ge.data)==null?void 0:ie.value)===":Entity"?"bindTo":((j=(D=(S=(de=N==null?void 0:N.origin)==null?void 0:de.controlSource)==null?void 0:S.context)==null?void 0:D.valueField)==null?void 0:j.value)||((Q=(Y=(G=(O=N==null?void 0:N.origin)==null?void 0:O.controlSource)==null?void 0:G.context)==null?void 0:Y.idField)==null?void 0:Q.value)||"id",textField:((be=(pe=(Z=(X=N==null?void 0:N.origin)==null?void 0:X.controlSource)==null?void 0:Z.context)==null?void 0:pe.textField)==null?void 0:be.value)||"label",editable:(Se=(Ne=(te=(we=N==null?void 0:N.origin)==null?void 0:we.controlSource)==null?void 0:te.context)==null?void 0:Ne.editable)==null?void 0:Se.value,onConfirm:H=>{o(H,N),c()},onValueChange:H=>{var ne,se;if(((ne=N.origin)==null?void 0:ne.Code)==="lookupId"){const ce=(se=d.value.property)==null?void 0:se.find(Ve=>Ve.name==="mappingFields");ce&&ce.value&&(ce.value="")}o(H,N),c()}},null)}function $(){var N;return(N=d.value.property)==null?void 0:N.map((z,K)=>{const ee=e.reactive({content:z.description,placement:"top"});return e.createVNode("div",{key:z.name+K},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[z.shownName,z.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),ee]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[P(z,d.value)])])})}function m(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[u.value&&l(),$()])}function M(N){N.stopPropagation(),x.emit("viewSource",{command:d.value,event:N})}function I(){b.question(`确定删除命令【${d.value.name}】吗?`,"",()=>{x.emit("deleteCommand")})}function A(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:N=>I()},null)}const U=e.computed(()=>{var N;return{cursor:w.value||v.value.isCommon||((N=v.value)==null?void 0:N.label.indexOf(a==null?void 0:a.getModule().code))===-1?"default":"pointer"}});function J(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",style:U.value,title:d.value.label,onDblclick:M},[d.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[w.value&&t(),B.value&&_(),s.value&&p(),k.value&&A()])]),f.value&&m()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[C.value&&J()])}}),vn=e.defineComponent({name:"FSelectParameters",props:re,emits:["changed"],setup(n,x){var l;const V=new ae.FNotifyService;V.globalConfig={position:"top-center"};const b=e.inject("FMessageBoxService"),d=e.ref(n.communication),v=e.ref(((l=d.value)==null?void 0:l.paramMappings)||[]),L=e.inject("useFormSchema"),w=L.getFormMetadataBasicInfo(),B=e.ref([]),k=e.ref([]),C=e.ref({}),F=e.ref({}),f=e.computed(()=>o=>{let c="",g="";if(o.sourceValue&&o.targetVariable){const P=k.value.find($=>$.statePath===`${o.targetVariableViewModelId}.${o.targetVariable}`);P&&P.name?(F.value[o.targetVariable]=!1,c=`${o.sourceValue}--->${P.name}`,g=`将 ${o.sourceValue} 赋值给 ${P.name}`):(F.value[o.targetVariable]=!0,c=`${o.sourceValue}--->${o.targetVariable}`,g=`将 ${o.sourceValue} 赋值给 ${o.targetVariable}`)}return{displayText:c,displayTextTip:g}});e.watch(()=>n.communication,o=>{d.value=o,v.value=d.value.paramMappings||[]},{deep:!0});function a(){var c;const o=v.value.length||0;v.value.length&&(v.value=v.value.filter(g=>!(!g.sourceValue&&!g.targetVariable))),d.value.paramMappings=v.value,o!==((c=d.value.paramMappings)==null?void 0:c.length)&&x.emit("changed")}e.onUnmounted(()=>{a()});function u(o){var m,M;const{viewmodels:c,components:g}=o.module;if((c==null?void 0:c.length)===0||(g==null?void 0:g.length)===0)return[];const P=[];k.value=[];const $=(M=(m=n.sourceCommunication)==null?void 0:m.parameterData)==null?void 0:M.getViewModelName;return c.forEach(I=>{if(!I||!I.states||I.states.length===0)return[];const A=[],U=g.find(z=>z.viewModel===I.id),J=$&&U?$(U,I.name,o):"";I.states.forEach(z=>{const K={...z,statePath:I.id+"."+z.code};A.push({data:K,children:[]}),k.value.push(K)});const N={data:{id:I.id,code:I.code,name:J||I.name,statePath:I.id},children:A};P.push(N)}),P}function s(){var o,c;if(!((o=d.value)!=null&&o.target.formId))return[];if(d.value.target.formId===w.id)B.value=u(L.getFormSchema());else{const g=L.externalFormSchema.get(d.value.target.externalContainerId);(c=g==null?void 0:g.content)!=null&&c.module&&(B.value=u(g==null?void 0:g.content))}}function i(){Object.keys(C.value).forEach(o=>{C.value[o]=!1})}function r(){i();const o=me.useGuid().guid();v.value.push({id:o,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),d.value.paramMappings=v.value,C.value[o]=!0}function h(o,c,g){o.stopPropagation();function P(){v.value=v.value.filter($=>$.id!==c.id),d.value.paramMappings=v.value,i(),x.emit("changed")}g?b.question(`确定删除参数【${g}】吗?`,"",()=>{P()}):P()}function E(o){C.value[o.id]||(i(),C.value[o.id]=!0)}function t(o,c){if(!c.sourceValue){V.warning("请选择源参数");return}if(!c.targetVariable){V.warning("请选择目标参数");return}C.value[o.id]=!1,Object.assign(o,c),delete o.statePath,x.emit("changed")}function R(o){C.value[o.id]=!1,!o.sourceValue&&!o.targetVariable&&!o.targetVariableViewModelId&&(v.value=v.value.filter(c=>c.id!==o.id),d.value.paramMappings=v.value,x.emit("changed"))}e.onMounted(()=>{s()}),e.watch(()=>n.communication,o=>{s()},{deep:!0});function _(o,c,g){var P;if((P=g.newValue)!=null&&P.length){const{statePath:$}=g.newValue[0];if(($==null?void 0:$.indexOf("."))>0){const m=$.split(".");c.targetVariableViewModelId=m[0],c.targetVariable=m[1]}}}function T(o){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:B.value,editable:!1,enableClear:!1,customRowStatus:c=>c.raw.parent?(v.value.find(P=>P.id!==o.id&&`${P.targetVariableViewModelId}.${P.targetVariable}`===c.raw.statePath)&&(c.disabled=!0),c):(c.disabled=!0,c)}}function p(o){const c=q.cloneDeep(o);c.statePath=`${c.targetVariableViewModelId}.${c.targetVariable}`;const g=T(o);let P=L.getFormSchema();if(d.value.source.formId!==w.id){const I=L.externalFormSchema.get(d.value.source.externalContainerId);I!=null&&I.content&&(P=I==null?void 0:I.content)}const{assembleSchemaFieldsByComponent:$,assembleOutline:m,assembleStateVariables:M}=n.sourceCommunication.parameterData;return e.createVNode("div",{class:"param-panel"},[e.createVNode("div",{class:"col-12"},[e.createVNode("div",{class:"farris-group-wrap"},[e.createVNode("div",{class:"form-group farris-form-group"},[e.createVNode("label",{class:"col-form-label",title:"源参数"},[e.createVNode("span",{class:"farris-label-text"},[e.createTextVNode("源参数")])])])])]),e.createVNode(ke,{class:"col-12 mb-2",modelValue:c.sourceValue,"onUpdate:modelValue":I=>c.sourceValue=I,fieldData:$(P),formData:m(P),varData:M(P),editorType:"Default",editable:!0},null),e.createVNode(Ge.FDynamicFormGroup,{label:"目标参数",modelValue:c.statePath,"onUpdate:modelValue":I=>c.statePath=I,customClass:"col-12 mb-2",editor:g,onChange:(I,A)=>_(I,c,A)},null),e.createVNode("div",{class:"d-flex justify-content-end"},[e.createVNode("button",{class:"btn btn-secondary mr-2",onClick:()=>R(o)},[e.createTextVNode("取消")]),e.createVNode("button",{class:"btn btn-primary",onClick:()=>t(o,c)},[e.createTextVNode("确定")])])])}x.expose({addParameter:r,closeAllParameterPanel:i});const y=e.computed(()=>o=>({"param-container":!0,"ml-3":!0,invalid:o}));return()=>v.value.length?v.value.map(o=>{const{displayText:c,displayTextTip:g}=f.value(o),P=F.value[o.targetVariable];return e.createVNode("div",{class:y.value(P)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:g,onClick:()=>E(o)},[c||"请配置参数"]),P?e.createVNode("span",{title:"目标参数已失效,请重新选择"},[e.createVNode("i",{class:"f-icon f-icon-flowline-warning text-danger text-tip"},null)]):"",e.createVNode("div",{class:"remove-icon"},[e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除参数",onClick:$=>h($,o,c)},null)])]),C.value[o.id]?p(o):""])}):""}}),Cn=e.defineComponent({name:"FCommunicationCommandItem",props:re,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const V=e.ref(n.communication),b=e.inject("FMessageBoxService"),d=e.inject("useFormSchema"),v=d.getFormMetadataBasicInfo(),L=e.ref([]),w=e.ref(),B=e.ref(!1),k=e.ref([]),C=e.ref(),F=e.ref(!1),f=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),a=e.computed(()=>{var l,o,c,g;if(!w.value)return"";const p=((l=w.value)==null?void 0:l.name)||((o=w.value)==null?void 0:o.code)||"",y=((c=C.value)==null?void 0:c.name)||((g=C.value)==null?void 0:g.code)||"";return`${p}-${y}`}),u=e.computed(()=>{var g,P,$,m,M,I;if(!w.value)return"";const p=((g=w.value)==null?void 0:g.name)||((P=w.value)==null?void 0:P.code)||"",y=(($=C.value)==null?void 0:$.name)||((m=C.value)==null?void 0:m.code)||"",l=((M=w.value)==null?void 0:M.code)||"",o=((I=C.value)==null?void 0:I.code)||"",c=w.value.containerId?`, 所属外部容器: ${w.value.containerId}`:"";return`${p} (${l}${c})
|
|
3
|
-
${y} (${o})`}),s=e.computed(()=>B.value?"目标表单已失效,请删除当前方法。":F.value?"目标命令已失效,请删除当前方法。":"");function i(){var p,y;if((y=(p=V.value)==null?void 0:p.target)!=null&&y.formId){const l=L.value.find(o=>o.id===V.value.target.formId&&o.containerId===V.value.target.externalContainerId);B.value=!l,w.value=l||{containerId:V.value.target.externalContainerId,id:V.value.target.formId,code:V.value.target.formCode}}else B.value=!1}function r(){var y,l;const p=d.externalFormSchema;Array.from(p.keys()).forEach(o=>{var g,P;const c=p.get(o);((P=(g=V.value)==null?void 0:g.source)==null?void 0:P.externalContainerId)!==o&&L.value.push({containerId:o,id:c.id,code:c.code,name:c.name})}),((l=(y=V.value)==null?void 0:y.source)==null?void 0:l.formId)!==v.id&&L.value.unshift({containerId:"",id:v.id,code:v.code,name:v.name}),i()}function h(){var p,y;if((y=(p=V.value)==null?void 0:p.target)!=null&&y.commandCode){const{commandCode:l,commandViewmodelId:o}=V.value.target,c=k.value.find(g=>g.code===l&&g.viewmodelId===o);C.value=c||{code:V.value.target.commandCode},F.value=!c}else C.value=null,F.value=!1}function E(p){var c,g;const{viewmodels:y,components:l}=p.module;if((y==null?void 0:y.length)===0||(l==null?void 0:l.length)===0)return[];k.value=[];const o=(g=(c=n.sourceCommunication)==null?void 0:c.parameterData)==null?void 0:g.getViewModelName;y.forEach(P=>{if(!P||!P.commands||P.commands.length===0)return[];const $=l.find(M=>M.viewModel===P.id),m=o&&$?o($,P.name,p):"";k.value.push({id:P.id,code:P.code,name:m||P.name}),P.commands.forEach(M=>{M.isInvalid||k.value.push({...M,viewmodelId:P.id,isCommandNode:!0})})})}function t(){var p,y,l;if(!((p=w.value)!=null&&p.id))return[];if(w.value.id===v.id)E(d.getFormSchema());else{const o=d.externalFormSchema.get((y=w.value)==null?void 0:y.containerId);(l=o==null?void 0:o.content)!=null&&l.module&&E(o.content)}h()}e.onMounted(()=>{r(),t()}),e.watch(()=>n.communication,p=>{f.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,i(),t()},{deep:!0});function R(){x.emit("addParameter")}function _(){b.question(`确定删除命令【${a.value}】吗?`,"",()=>{x.emit("deleteCommand")})}function T(){x.emit("toggleParameterPanel")}return()=>e.createVNode("div",{class:"form-container position-relative"},[a.value&&e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:u.value},[a.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[B.value||F.value?e.createVNode("div",null,[e.createVNode("span",{title:s.value},[e.createVNode("i",{class:"ml-2 f-icon f-icon-flowline-warning text-danger text-tip"},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:p=>_()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:R},null),f.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>T()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:p=>_()},null)])])])])}}),gn=e.defineComponent({name:"FCombineForm",props:re,emits:["changed","deleteCommand","addCommand"],setup(n,x){const V=e.inject("useFormSchema"),{saveCommunication:b}=le(V),d=e.ref(n.communication),v=e.computed(()=>{var i,r,h,E;return((r=(i=d.value)==null?void 0:i.source)==null?void 0:r.componentId)&&((E=(h=d.value)==null?void 0:h.source)==null?void 0:E.event)}),L=e.ref(!0),w=e.ref(!0),B=e.ref(),k=e.ref();function C(){b(d.value),x.emit("changed",d.value)}function F(){B.value&&B.value.addParameter(),w.value=!1}function f(){x.emit("deleteCommand")}function a(){w.value=!w.value}const u=e.computed(()=>({"d-none":w.value}));function s(){B.value&&B.value.closeAllParameterPanel()}return x.expose({closeAllParameterPanel:s}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[v.value&&e.createVNode(e.Fragment,null,[e.createVNode(Cn,{ref:k,communication:d.value,sourceCommunication:n.sourceCommunication,onAddParameter:F,onDeleteCommand:f,onToggleParameterPanel:a},null),L.value&&e.createVNode("div",{class:u.value},[e.createVNode(vn,{ref:B,communication:d.value,onChanged:C,sourceCommunication:n.sourceCommunication},null)])])])}}),pn=e.defineComponent({name:"FSelectCommunicationCommand",props:re,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const V=e.inject("useFormSchema"),b=V.getFormMetadataBasicInfo(),d=e.ref([]),v=e.ref(),L=e.ref([]),w=e.ref(),B=e.ref(!0),k=e.ref(!1);function C(){var h;const r=V.externalFormSchema;Array.from(r.keys()).forEach(E=>{var R;const t=r.get(E);((R=n.sourceCommunication)==null?void 0:R.externalContainerId)!==E&&d.value.push({containerId:E,id:t.id,code:t.code,name:t.name})}),((h=n.sourceCommunication)==null?void 0:h.formId)!==b.id&&d.value.unshift({containerId:"",id:b.id,code:b.code,name:b.name})}function F(r){var R,_;const{viewmodels:h,components:E}=r.module;if((h==null?void 0:h.length)===0||(E==null?void 0:E.length)===0)return[];L.value=[];const t=(_=(R=n.sourceCommunication)==null?void 0:R.parameterData)==null?void 0:_.getViewModelName;h.forEach(T=>{if(!T||!T.commands||T.commands.length===0)return[];const p=E.find(l=>l.viewModel===T.id),y=t&&p?t(p,T.name,r):"";L.value.push({id:T.id,code:T.code,name:y||T.name}),T.commands.forEach(l=>{l.isInvalid||L.value.push({...l,viewmodelId:T.id,isCommandNode:!0})})})}function f(){var r,h,E;if(!((r=v.value)!=null&&r.id))return[];if(v.value.id===b.id)F(V.getFormSchema());else{const t=V.externalFormSchema.get((h=v.value)==null?void 0:h.containerId);(E=t==null?void 0:t.content)!=null&&E.module&&F(t.content)}}e.onMounted(()=>{C(),f()});function a(r){v.value=r,B.value=!1,k.value=!0,f()}const u=e.computed(()=>r=>{var h,E;return{item:!0,selected:((h=v.value)==null?void 0:h.id)===r.id&&((E=v.value)==null?void 0:E.containerId)===r.containerId}}),s=e.computed(()=>r=>{var h;return{item:!0,selected:((h=w.value)==null?void 0:h.id)===r.id,"pl-4":r.isCommandNode,disabled:!r.isCommandNode}});function i(r){r.isCommandNode&&(k.value=!1,w.value=r,x.emit("selectCommand",{targetForm:v.value,targetCommand:r}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[B.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),d.value.map(r=>e.createVNode("span",{class:u.value(r),onClick:()=>a(r),title:r.containerId?`所属外部容器:${r.containerId}`:"当前页面"},[r.name]))]),k.value?e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标命令")]),L.value.map(r=>e.createVNode("span",{class:s.value(r),title:r.code,onClick:()=>i(r)},[r.name]))]):""])}}),bn=e.defineComponent({name:"FInteractionItem",props:cn,emits:["addAction","delete","toggle"],setup(n,x){var ie,de;const{guid:V}=me.useGuid(),b=e.inject("FMessageBoxService"),d=e.inject("useMethodsComposition"),{toggleSelectingMethod:v,emitFinalState:L,getViewModeId:w,getMethodsOnViewModel:B,getComponentList:k,updateTarget:C,updateCommandHasPath:F}=d,f=e.inject("useFormSchema"),{clearCommunicationById:a,resolveSourceControlEventTitle:u,resolveCommunication:s,createNewCommunication:i,saveCommunication:r,resolveCommunicationSource:h}=le(f),E=e.ref(n.controllers),t=e.ref(n.interaction),R=e.ref(!1),_=e.computed(()=>{const S=t.value.showSwitch[0];return S.showSection[S.showSwitchNumber][2]}),T=e.ref(n.sourceCommunication.needSelectSourceControl);t.value.shouldShowCommunicationPanel=t.value.shouldShowCommunicationPanel===!1?!1:!!((de=(ie=t.value)==null?void 0:ie.communication)!=null&&de.length)||T.value;const p=e.computed(()=>{var O;const S=!!((O=t.value.command)!=null&&O.id),D=t.value.showSwitch[0],j=D.showSection[D.showSwitchNumber][3];return S&&j}),y=e.ref(t.value.needSelectCommunicationCommand||!1),l=e.ref(),o=e.ref(),c=e.ref(!1),g=e.ref(),P=e.ref([]);function $(){if(T.value){const S=u(t.value.communication);if(S){const{title:D,titleTip:j,isControlInvalid:O}=S;l.value=D,o.value=O?"源表单或事件已失效,请删除":j||D,c.value=O}}else o.value=t.value.event.label,l.value=t.value.event.name}e.onBeforeMount(()=>{s(t.value),$(),g.value=h(t.value)||n.sourceCommunication});const m=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":p.value||t.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!p.value&&!t.value.shouldShowCommunicationPanel}));function M(){var j,O;let S=(j=t.value.command)!=null&&j.id?1:0;S=S+(((O=t.value.communication)==null?void 0:O.length)||0);const D=`确定删除【${l.value}】吗?`;b.question(D,"",()=>{x.emit("delete",n.displayOrder)})}function I(){var O;const S=t.value.showSwitch[0],D=!!((O=t.value.command)!=null&&O.id);t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!t.value.shouldShowCommunicationPanel),D&&(S.showSection[S.showSwitchNumber][3]=!S.showSection[S.showSwitchNumber][3],x.emit("toggle",n.displayOrder))}function A(){var O,G;const S=!!((O=t.value.command)!=null&&O.id),D=t.value.communication&&t.value.communication.length>0;if(T.value){y.value=!y.value,(G=P.value)!=null&&G.length&&P.value.map(Y=>{Y.closeAllParameterPanel()});return}D&&(t.value.shouldShowCommunicationPanel=!t.value.shouldShowCommunicationPanel);const j=t.value.showSwitch[0];v(j,S),x.emit("addAction",n.displayOrder)}function U(S){const D=t.value.communication!==void 0;S===null&&t.value.command===null&&!D&&x.emit("delete",n.displayOrder),t.value.communication&&(t.value.shouldShowCommunicationPanel=_.value);const j=t.value.showSwitch[0];v(j,D)}function J(S,D,j){let O=`${D}${j}${S}`,G=-1;const Y=B();for(;G===-1;){let Q=!1;for(let X=0;X<Y.length;X++)Y[X].controllerList.forEach(Z=>{Z.label||Z.label===""?Q=Z.label.toLowerCase()===O.toLowerCase()?!0:Q:Q=!1});if(Q)S+=1,O=`${D}${j}${S}`;else{G=0;break}}return{newName:O,suffix:S}}function N(S){const{method:D,controller:j}=S,{label:O,handlerName:G,property:Y,componentLists:Q,hasPath:X}=D,Z=w().replace(/-/g,"").replace("component","").replace("viewmodel",""),pe=O.slice(0,1).toUpperCase()+O.slice(1),{newName:be,suffix:we}=J(1,Z,pe),{controllerName:te}=j,Ne=te.id,Se={id:V(),label:be,name:`${D.name}${we}`,handlerName:G,hasPath:X,cmpId:Ne,property:Y,componentLists:Q};t.value.command=F(j,Se),t.value.command&&f.designerMode==="PC_RTC"&&(t.value.command.isRtcCommand=!0),t.value.controller={id:te.id,label:te.label,name:te.name,isCommon:te.isCommon};const H=t.value.showSwitch[0];H.showSwitchNumber=2,H.showSection[H.showSwitchNumber][2]=!1,H.showSection[H.showSwitchNumber][3]=!0,R.value=!0,t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!0),L(!1,null)}function z(){t.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRtcCommand:f.designerMode==="PC_RTC"?!0:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},t.value.controller={label:"",name:"",id:""},L(!0,t.value.event);const S=t.value.showSwitch[0];v(S,!0)}function K(S,D){var G;if(t.value.communication||(t.value.communication=[]),t.value.communication.find(Y=>{var Q,X,Z;return((Q=Y.target)==null?void 0:Q.formId)===S.formId&&((X=Y.target)==null?void 0:X.externalContainerId)===S.externalContainerId&&((Z=Y.target)==null?void 0:Z.commandCode)===S.commandCode})){new ae.FNotifyService().info({position:"top-center",message:"方法已存在,请勿重复添加。"});return}let O;t.value.communication.length===1&&!((G=t.value.communication[0].target)!=null&&G.formId)?(Object.assign(t.value.communication[0].target,S),O=t.value.communication[0]):(O=i(n,t.value.event.label,S,D),t.value.communication.push(O)),L(!1,null),r(O)}function ee(S){var j;const D=t.value.showSwitch[0];if(D.showSection[D.showSwitchNumber][2]=!1,(j=t.value.command)!=null&&j.id&&(D.showSection[D.showSwitchNumber][3]=!0),t.value.shouldShowCommunicationPanel=!0,S){const{selectedCommand:O,selectedForm:G}=S,Y={formId:(G==null?void 0:G.id)||"",formCode:(G==null?void 0:G.code)||"",externalContainerId:(G==null?void 0:G.containerId)||"",commandCode:(O==null?void 0:O.code)||"",commandViewmodelId:(O==null?void 0:O.viewmodelId)||""};K(Y)}}function Ee(){const S=t.value.showSwitch[0];S.showSwitchNumber=2,S.showSection[S.showSwitchNumber][2]=!1,S.showSection[S.showSwitchNumber][3]=!0,R.value=!1,t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!0),L(!1,null)}function Pe(){return e.createVNode(mn,{controllers:E.value,sourceCommunication:n.sourceCommunication,onClose:U,onSelectMethod:N,onNewFunctionChanged:()=>z(),onAddCommunication:ee,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:Ee,event:t.value.event},null)}function ye(){const S=t.value.showSwitch[0];S.showSection[S.showSwitchNumber][3]=!1}function Me(S){t.value.command=q.cloneDeep(S),L(!1,null)}function xe(S){S.componentLists=k(),C(S),t.value.command=q.cloneDeep(S),L(!1,null)}function Ie(S){var j;const{controller:D}=t.value;D.isCommon||(j=n.viewSourceHandle)==null||j.call(n,{...S,...t.value})}function Le(){t.value.command=null,L(!1,null)}function Be(){return e.createVNode(hn,{command:t.value.command,controller:t.value.controller,showParameter:R.value,showDeleteIcon:t.value.communication&&t.value.communication.length>0,onConfirm:()=>ye(),onChange:S=>Me(S),onTargetChange:S=>xe(S),onViewSource:S=>Ie(S),onDeleteCommand:Le},null)}function Te(S,D){t.value.communication&&t.value.communication.length>D&&(t.value.communication[D]=S,L(!1,null))}function De(S,D){var j;t.value.communication&&t.value.communication.length>D&&(t.value.communication.splice(D,1),a(S.id),t.value.communication.length===0&&!((j=t.value.command)!=null&&j.id)?x.emit("delete",n.displayOrder):L(!1,null))}function he(S,D){const{source:j,target:O}=S;K(O,j),t.value.shouldShowCommunicationPanel=!0}function ve(S,D){return e.createVNode(gn,{ref:j=>{j&&(P.value[D]=j)},communication:S,event:t.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:j=>Te(j,D),onDeleteCommand:()=>De(S,D),onAddCommand:j=>he(j)},null)}function Ce(S){const{targetForm:D,targetCommand:j}=S,O={formId:D.id,formCode:D.code,externalContainerId:D.containerId,commandCode:j.code,commandViewmodelId:j.viewmodelId};K(O,g.value),t.value.shouldShowCommunicationPanel=!0,y.value=!1,t.value.needSelectCommunicationCommand=!1}function ge(){return e.createVNode(pn,{sourceCommunication:n.sourceCommunication,onSelectCommand:S=>Ce(S)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:o.value},[l.value]),!c.value&&e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:m.value,style:"font-size: 10px;",onClick:I},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:M},null),!c.value&&e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:A},null),c.value&&e.createVNode("div",{class:"f-icon f-icon-flowline-warning text-danger text-tip",title:"源表单或事件已失效,请删除",style:"float:right; font-size: 13px; margin:8px;"},null)]),_.value&&Pe(),y.value&&ge(),p.value&&Be(),!c.value&&t.value.shouldShowCommunicationPanel&&t.value.communication&&t.value.communication.length>0?t.value.communication.map((S,D)=>ve(S,D)):""])}});function wn(n,x,V){const{interactions:b}=x,{setComponentLists:d}=$e(),v=e.ref(n.value.internalCommandList);function L(l){b.value[l].showSwitch=[],b.value[l].showSwitch.push(q.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),b.value=q.cloneDeep(b.value)}function w(l){var c;const o=[];return(c=n.value.newController)==null||c.forEach(g=>{l.forEach(P=>{g.Code===P.controller.label&&o.push(q.cloneDeep(g))})}),o}function B(l){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(o=>{l.forEach(c=>{var g,P,$,m;if(o.command.id===((g=c.command)==null?void 0:g.id)){o.command.params=q.cloneDeep((P=c.command)==null?void 0:P.property);const M=($=c.command)==null?void 0:$.targetComponent;(m=c.command)==null||m.componentLists.forEach(I=>{o.targetComponent=I.componentId===M?{id:I.componentId,viewModelId:I.viewModelId}:o.targetComponent})}})}),n.value.repititionCommand}function k(l=!1,o=null){var m;n.value.newFuncEvents=o?q.cloneDeep(o):null,n.value.isAddControllerMethod=l;const c=[],g=q.cloneDeep(n.value.internalCommandList);b.value.map(M=>{const I=q.cloneDeep(M.controller),A=q.cloneDeep(M.command),U=q.cloneDeep(M.event),J=q.cloneDeep(M.communication),N={controller:I,command:A,boundEvents:U,communication:J};c.push(q.cloneDeep(N))});const P=(m=n.value.newController)!=null&&m.length&&c.length?q.cloneDeep(w(c)):[];n.value.repititionCommand&&(n.value.repititionCommand=B(c));const $={viewModelId:n.value.viewModelId,savedCommand:q.cloneDeep(n.value.viewModel),boundEventsList:q.cloneDeep(c),events:q.cloneDeep(n.value.events),internalCommandList:q.cloneDeep(g),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:q.cloneDeep(P),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};V.emit("savedCommandListChanged",$)}function C(l){l.showSection[l.showSwitchNumber][2]=!0}function F(l){l.showSection[l.showSwitchNumber][2]=!1}function f(l){l.showSection[l.showSwitchNumber][3]=!0}function a(l){l.showSection[l.showSwitchNumber][3]=!1}function u(l,o=!1){l.showSection[l.showSwitchNumber][2]?(F(l),o&&f(l)):(C(l),o&&a(l))}function s(){return n.value.componentLists}function i(l){n.value.viewModel.forEach(o=>{for(let c=0;c<o.controllerList.length;c++)o.controllerList[c].label===l.label&&(o.controllerList[c]=q.cloneDeep(l))})}function r(){return n.value.viewModelId}function h(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function E(l,o){return d(l,o,n.value)}function t(l){n.value.newController=n.value.newController||[],n.value.newController.push(q.cloneDeep(l));const o=n.value.newController;for(let c=0;c<o.length;c++)for(let g=c+1;g<o.length;g++)o[c].Id===o[g].Id&&(o.splice(g,1),g--)}function R(l){let o=!1;return n.value.internalCommandList.forEach(c=>{if(c.controllerName.label===l.controllerName.label){o=!0;return}}),o||n.value.internalCommandList.push(l),o}function _(){var l;if((l=n.value)!=null&&l.getEventPath)return n.value.getEventPath()}function T(l,o){b.value.forEach(c=>{var g;((g=c.command)==null?void 0:g.label)===o.label&&(c.command=o)})}function p(l,o){T(l,o)}function y(l,o){const c=b.value[o];l.event=l.event.label?l.event:q.cloneDeep(c.event);let g=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(m=>{m.command.id===l.command.id&&m.event.label===l.event.label&&m.targetComponent.viewModelId===l.targetComponent.viewModelId&&(g=!0),m.command.id===l.command.id&&m.event.label===l.event.label&&m.targetComponent.viewModelId!==l.targetComponent.viewModelId&&(m=q.cloneDeep(l))}),g||n.value.repititionCommand.push(q.cloneDeep(l));let P={id:l.command.id,label:l.command.label,name:l.command.name,handlerName:l.command.handlerName,cmpId:l.controller.id,componentLists:[],hasPath:!1,targetComponent:l.targetComponent.id,property:q.cloneDeep(l.command.params),shortcut:{},isRtcCommand:l.command.isRtcCommand,isNewGenerated:l.command.isNewGenerated||!1,isInvalid:!1};const $={controllerName:l.controller};P=d($,P,n.value),c.command=q.cloneDeep(P),c.controller=q.cloneDeep(l.controller),p(c,P)}return{controllers:v,onClosed:L,emitFinalState:k,toggleSelectingMethod:u,getViewModeId:r,getComponentList:s,updateTarget:i,updateCommandHasPath:E,addNewController:t,checkIfNewControllerExists:R,getMethodsOnViewModel:h,getEventPath:_,selectBoundCommand:y}}const fe=e.defineComponent({name:"FEventsEditor",props:Fe,emits:["savedCommandListChanged"],setup(n,x){const V=e.ref(n.initialData),b=e.inject("designer-host-service"),d=Ze(V),{loadEvents:v,resetBoundEvents:L}=d,w=e.inject("useFormSchema"),B=Xe(w,d),{addNewInteraction:k,deleteInteracton:C,interactions:F,loadInteractions:f}=B,a=wn(V,B,x),{emitFinalState:u,controllers:s}=a;e.provide("useEventsComposition",d),e.provide("useInteractionCompostion",B),e.provide("useMethodsComposition",a);function i(){V.value.isAddControllerMethod=!1}function r(){var p,y;const T=(y=(p=V.value)==null?void 0:p.sourceCommunication)==null?void 0:y.externalContainerId;if(T){const{assembleSourceOutline:l}=le(w),o=l(b,x,T);e.provide("sourceOutlineData",o)}}e.onMounted(()=>{i(),L(),v(),f(),r()});function h(T){C(T),u(!1,null)}function E(T,p){const y=T.showSwitch[0],l=y.showSection[y.showSwitchNumber][3];let o=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?o=!0:o=!1),e.createVNode(bn,{key:`${p}`,controllers:s.value,interaction:T,displayOrder:p,collapsed:l,onDelete:h,sourceCommunication:V.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:o},null)}function t(){var T;return(T=F.value)==null?void 0:T.map((p,y)=>{var o;let l=p.event.label;return(o=p.communication)!=null&&o.length&&(l=`${p.communication.map(g=>g.id).join("-")}_${l}`),e.createVNode("div",{class:"events-display-order",key:`${l}_${y}`},[E(p,y)])})}function R(T){k(T)}function _(T){const p=T.source;if(F.value.find(l=>{var o;if((o=l.communication)!=null&&o.length&&l.communication.find(g=>{var P,$,m;return((P=g.source)==null?void 0:P.formId)===p.formId&&(($=g.source)==null?void 0:$.componentId)===p.componentId&&((m=g.source)==null?void 0:m.event)===p.event}))return!0})){new ae.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}k({label:"onCommunication",name:"组件通讯"},T)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(an,{sourceCommunication:V.value.sourceCommunication,onClickEventItem:R,onSelectSourceControl:_},null),t()])])}}),Nn={install(n){n.component(fe.name,fe)},register(n,x,V,b){n["events-editor"]=fe,x["events-editor"]=Ae}};W.FEventsEditor=fe,W.default=Nn,W.eventsEditorProps=Fe,W.propsResolver=Ae,Object.defineProperties(W,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(F,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../notify/index.umd.js"),require("../tree-view/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../input-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js"),require("../locale/index.umd.js"),require("../dynamic-view/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js","../notify/index.umd.js","../tree-view/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../input-group/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js","../locale/index.umd.js","../dynamic-view/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../property-panel/index.umd.js"],e):(F=typeof globalThis<"u"?globalThis:F||self,e(F["events-editor"]={},F.Vue,F.dynamicResolver,F.LodashES,F.common,F.designerCanvas,F.notify,F.FTreeview,F.FSchemaSelector,F.modal,F.FInputGroup,F.FComboList,F.FEventParameter,F.locale,F.dynamicView,F.FAccordion,F.FAvatar,F.FButtonEdit,F.FButtonGroup,F.FCalendar,F.FCapsule,F.FCheckbox,F.FCheckboxGroup,F.FComboTree,F.FComponent,F.FColorPicker,F.FContentContainer,F.FDatePicker,F.FDataGrid,F.FDropdown,F.FDynamicForm$1,F.FEventsEditor$1,F.FFilterBar,F.FFieldSelector,F.FBindingSelector,F.FImageCropper,F.FInputGroup$1,F.FLayout,F.FListNav,F.FListView,F.FLookup,F.FMappingEditor,F.FNav,F.FNumberRange,F.FNumberSpinner,F.FOrder,F.FPageHeader,F.FPageFooter,F.FPagination,F.FProgress,F.FQuerySolution,F.FRadioGroup,F.FRate,F.FResponseToolbar,F.FResponseLayout,F.FResponseLayoutEditorSetting,F.FSearchBox,F.FSection,F.FSmokeDetector,F.FSplitter,F.FStep,F.FSwitch,F.FTabs,F.FTags,F.FText,F.FTimePicker,F.FTransfer,F.FUploader,F.FVerifyDetail,F.FVideo,F.FTextArea,F.FTreeGrid,F.FFilterConditionEditor,F.FFieldset,F.FSortConditionEditor,F.FMenuLookup,F.FDrawer,F.FJsonEditor,F.FPropertyEditor,F.FExpressionEditor,F.FCodeEditor,F.FHtmlTemplate,F.FCollectionPropertyEditor,F.FModal,F.FExternalContainer,F.FLanguageTextbox,F.FImage,F.FComment))})(this,function(F,e,ne,K,ce,rn,ge,He,ze,cn,ln,We,De,Ke,me,sn,dn,un,mn,fn,pn,Je,Qe,hn,gn,vn,Cn,bn,Nn,yn,wn,Vn,Fn,Sn,xn,jn,En,Pn,Mn,Tn,Bn,Ln,kn,In,$n,Dn,qn,On,An,Rn,Un,Gn,_n,Hn,zn,Wn,Kn,Jn,Qn,Yn,Xn,Zn,et,nt,tt,ot,at,rt,it,ct,lt,st,dt,ut,mt,ft,pt,ht,gt,vt,Ct,bt,Nt,yt,wt,Vt,Ft,St){"use strict";var ho=Object.defineProperty;var go=(F,e,ne)=>e in F?ho(F,e,{enumerable:!0,configurable:!0,writable:!0,value:ne}):F[e]=ne;var $e=(F,e,ne)=>go(F,typeof e!="symbol"?e+"":e,ne);const xt=new Map([["appearance",ne.resolveAppearance]]);function jt(n,l,c){return l}const Et={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}},viewSourceHandle:{description:"",type:"function",default:null}},required:["id","type"]},Pt={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},Ye=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],qe={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:Ye,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:Ye,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},Xe=ne.createPropsResolver(qe,Et,xt,jt,Pt);function Ze(){function n(c,s){const t=[{controllerId:"45be24f9-c1f7-44f7-b447-fe2ada458a61",controllerLabel:"AdvancedListCardController",controllerName:"高级列卡控制器",commands:[{name:"增加子表数据",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"},{name:"插入数据",id:"3208b00c-543d-c050-3c54-081715972dda",handlerName:"Insert"},{name:"查询从表数据(分页)",id:"b60b7754-35cf-7eaa-0f1d-bc5e5d61c0bc",handlerName:"queryChild"},{name:"批量删除子表",id:"378fcd7d-ce91-c052-5947-d60ecdb38df9",handlerName:"batchDelete"},{name:"移动数据",id:"fcac5d5e-2367-2b61-a82a-f8e874e8efc0",handlerName:"move"},{name:"打开批量编辑界面",id:"8d8b05d6-2d22-b0b7-7cb8-51bbb8cd8a18",handlerName:"openBatchEditDialog"}]},{controllerId:"d7ce1ba6-49c7-4a27-805f-f78f42e72725",controllerLabel:"EditableListController",controllerName:"可编辑列表控制器",commands:[{name:"打开批量编辑界面",id:"c3831e36-27d1-1c98-dd60-30e2d7ec04d2",handlerName:"openBatchEditDialog"},{name:"加载列表数据",id:"f80e026b-bd9b-002b-d2aa-52c44a633bec",handlerName:"Load"}]},{controllerId:"8fe977a1-2b32-4f0f-a6b3-2657c4d03574",controllerLabel:"TreeCardController",controllerName:"树卡控制器",commands:[{name:"新增子表数据",id:"21b0c3af-3caf-b11d-2360-d9af20016501",handlerName:"AddItem"},{name:"删除子表数据",id:"113f1d77-65a4-63bf-3973-80dd15f294d1",handlerName:"RemoveItem"},{name:"批量删除子表",id:"bf13585c-a8f3-384b-356c-bd8bf06751c4",handlerName:"batchDelete"}]},{controllerId:"8d21e69c-70b3-44f6-88b5-fd6a8d3ce11b",controllerLabel:"PopController",controllerName:"弹出控制器",commands:[{name:"新增子表数据",id:"d6933772-8047-9bde-220b-449481883142",handlerName:"AddItem"},{name:"删除子表数据",id:"03c233eb-e39e-8e34-6809-ee4ab3a0d97c",handlerName:"RemoveItem"},{name:"加载并新增",id:"6882ab4a-9c23-8d59-6aac-de891eae20d2",handlerName:"LoadAndAdd"}]},{controllerId:"43f68561-eae4-4495-b318-d629615523f8",controllerLabel:"BatchEditCommands",controlleName:"批量编辑控制器",commands:[{name:"打开批量编辑界面",id:"a659aaba-daa4-3c07-8b26-164b01726022",handlerName:"openBatchEditDialog"},{name:"复制行",id:"d5f67e0a-767d-a238-5ad4-b1285476c16f",handlerName:"copyRow"},{name:"复制行",id:"229d2dd3-2fe7-f06a-b705-cfa0fc711614",handlerName:"clone"}]},{controllerId:"c121742e-6028-48bf-817c-1dda7fb098df",controllerLabel:"AdvancedListCardWithSidebarController",controllerName:"高级列卡控制器(侧边栏)",commands:[{name:"增加子表数据(侧边栏)",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据(侧边栏)",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"}]},{controllerId:"8172a979-2c80-4637-ace7-b13074d3f393",controllerLabel:"CardController",controllerName:"卡片控制器",commands:[{name:"新增子表数据",id:"6f987222-ebe2-0f3c-1594-a12408b22801",handlerName:"AddItem"},{name:"删除子表数据",id:"0cdeddcc-8332-f13f-be96-b5eeac84a334",handlerName:"RemoveItem"},{name:"插入数据",id:"2666b526-a1b2-f268-1629-b1b95b71c8dd",handlerName:"Insert"},{name:"打开批量编辑界面",id:"8104dd8e-bb27-a659-ff7c-a0321523f727",handlerName:"openBatchEditDialog"},{name:"新增子节点(子表树)",id:"bbd11957-de2a-c727-11d6-64788c4b0fa8",handlerName:"addSubChild"},{name:"删除子表树节点",id:"c8c9f652-ba52-3a9b-5eb9-dadd42c832cd",handlerName:"RemoveTreeItem"},{name:"批量删除子表",id:"e96857fa-1617-fd92-8a05-5c684e0819a1",handlerName:"batchDelete"}]},{controllerId:"31c1022c-ab40-4e8d-bc31-85d539f1d36c",controllerLabel:"FileController",controllerName:"文件控制器",commands:[{name:"批量删除文件数据",id:"d5bf021b-1aa4-06fe-3236-188fd218f4f7",handlerName:"removeFileRows"}]},{controllerId:"2eb7bbd1-fabd-4d0f-991d-7242f53225b1",controllerLabel:"AttachmentController",controllerName:"附件控制器",commands:[{name:"上传并更新行",id:"2a84e28f-7202-d858-1466-748a8040c1f9",handlerName:"UploadAndUpdateRow"},{name:"通过属性名上传并更新行",id:"0f98c9b8-a01b-55d4-3115-269a73f7ccff",handlerName:"uploadAndUpdateRowWithPropertyName"},{name:"移除版本附件行",id:"b441b6a7-9e13-9f75-77a2-10b2c1f7ef26",handlerName:"RemoveAttachmentItem"},{name:"上传并批量新增行",id:"e6fc25ca-853b-0b2d-76c9-a1f7a253679b",handlerName:"UploadAndBatchAddRows"},{name:"通过属性名上传并批量更新行",id:"e00b70db-9de3-8e3e-eb59-1c550a255fec",handlerName:"uploadAndBatchAddRowsWithPropertyName"}]},{controllerId:"e353b4e9-e073-4e18-b9f7-ec4cc8ac72b1",controllerLabel:"PrintService",controllerName:"打印控制器",commands:[{name:"根据数据条件批量打印",id:"774fa275-2da1-e927-e8bf-d27d9886a168",handlerName:"printMulti"}]},{controllerId:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",controllerLabel:"ListController",controllerName:"列表控制器",commands:[{name:"加载数据",id:"86c9f281-e5bc-5d5c-1b86-d1e17ab2e850",handlerName:"Load"}]},{controllerId:"7c48ef46-339c-42d4-8365-a21236c63044",controllerLabel:"ListCardController",controllerName:"列卡控制器",commands:[{name:"加载列表数据",id:"e573d6a2-8261-9ad4-c9f1-2e59af53302d",handlerName:"loadList"}]},{controllerId:"26436aa8-88a7-4aee-bf0b-9843c1e8afbf",controllerLabel:"ListListController",controllerName:"双列表控制器",commands:[{name:"加载导航列表数据",id:"f7dd2c84-7abd-d4bf-6b31-71d96035c034",handlerName:"LoadNavList"}]}];let u=-1;const V=t.findIndex(C=>c===C.controllerId);return V!==-1&&(u=t[V].commands.findIndex(C=>s===C.handlerName)),u!==-1}function l(c,s,t){const u=n(c.controllerName.id,s.handlerName);return t.componentLists.length!==0&&u&&(s.hasPath=!0,s.targetComponent=s.targetComponent||t.componentLists[0].componentId,s.componentLists=K.cloneDeep(t.componentLists)),s}return{isContextDependent:n,setComponentLists:l}}var pe=(n=>(n.Frame="frame",n.dataGrid="data-grid",n.listView="list-view",n.form="form",n.uploader="uploader",n.calendar="calendar",n.page="page",n))(pe||{});function Mt(n,l){const c=e.inject("designerContext"),s=c&&c.dgControl?c.dgControl:rn.DgControl,t=e.ref(""),u=e.ref("");function V(i){var f,h,S,a;let v="controlIcon fd-i-Family ",N="";switch(i==null?void 0:i.type){case"form-group":{N=((f=s[i.type])==null?void 0:f.icon)||((h=i.editor)==null?void 0:h.type)||"",(S=s[i.editor.type])!=null&&S.icon&&(N=s[i.editor.type].icon);break}default:N=((a=s[i.type])==null?void 0:a.icon)||i.type}const g=`fd_pc-${N}`;return v+=g,v}function C(i,v){var f;let N=i.id;const g=v==null?void 0:v.contents;if((v==null?void 0:v.type)==="splitter"&&g&&g.length===2){const h=v.direction!=="column";i.id===((f=g[0])==null?void 0:f.id)?N=h?"左侧区域":"上方区域":N=h?"右侧区域":"下方区域"}return N}function k(i){if(i.isLikeCardContainer)return"区块";const v=i.appearance&&i.appearance.class||"",N=v.split(" ");return i.id==="page-header"&&v&&v==="f-page-header"?"页头":N.includes("f-page-header-base")?"页头容器":N.includes("f-page-header-extend")?"页头扩展容器":N.includes("f-title")?"标题容器":N.includes("f-page")?"根容器":N.includes("f-page-main")?"内容区域":N.includes("f-scrollspy-content")&&i.isScrollspyContainer?"滚动监听容器":N.includes("f-grid-is-sub")?"表格容器":N.includes("f-filter-container")?"筛选条容器":"容器"}function D(i){const{componentType:v}=i;switch(v){case pe.Frame:return"根组件";case pe.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(i,g=>g.type===(s["tree-grid"]&&s["tree-grid"].type)))?"树表格组件":"表格组件";case pe.uploader:return"附件组件";case pe.listView:return"列表视图组件";case pe.form:return"卡片组件";case pe.calendar:return"日历组件";case pe.page:return i.name||"页面";default:return"组件"}}function y(i,v){const N=i.name||i.text||i.label||i.title||i.mainTitle;if(i.type!=="component"&&N&&typeof N=="string")return N.trim();switch(i.type){case"content-container":return k(i);case"splitter-pane":return C(i,v);case"component":return D(i);default:return s[i.type]&&s[i.type].name||i.id}}function x(i,v){const N=i.length?i[0]:null;if(!N)return;u.value="",t.value=N.originalId;const g=N?`${N.originalId}-design-item`:"",f=document.getElementById(g);f&&f.click(),l.emit("selectionChanged",N)}function p(i){if(!i)return;const v=`${i}-design-item`,N=document.getElementById(v);N&&N.click()}return{getIcon:V,getTitle:y,onChanged:x,currentSelectedNodeId:t,currentSelectedOutsideNodeId:u,triggerOutsideClick:p}}function Tt(n,l){const{getIcon:c,getTitle:s}=l;function t(y,x,p,i,v){var g;const N=(g=n.data.module)==null?void 0:g.components.find(f=>f.id===y.component);N&&u([N],x,p,i,v)}function u(y,x,p,i,v){return y.forEach(N=>{if(N.type==="component"&&(v=N.id),N.type==="component-ref"){t(N,x,p,i,v);return}const g={originalId:N.id,layer:p,originalParent:i==null?void 0:i.id,componentId:v,name:s(N,i),type:N.type,controlIcon:c(N),rawSchema:N};x.push(K.cloneDeep(g)),(N.contents||N.buttons)&&u(N.contents||N.buttons,x,p+1,N,v)}),x}function V(y){const x=[],p=y.find(g=>g.layer===0);y=y.filter(g=>g.layer!==0),x.push(p);let i=p.originalId,v=0,N=1e3;for(;y.length!==0||N===0;){const g=y.find(f=>f.originalParent===i);g?(x.push(g),i=g.originalId,y=y.filter(f=>f.originalId!==i),v=0):(v-=1,i=x.slice(v)[0].originalId),N-=1}return x}function C(y){return y.forEach((x,p)=>{x.id=(p+1).toString()}),y.forEach(x=>{var p;x.parent=((p=y.find(i=>i.originalId===x.originalParent))==null?void 0:p.id)||""}),y.forEach(x=>{x.hasChildren=y.findIndex(p=>p.parent===x.id)>0}),y}function k(y){const x={originalId:n.data.module.id,layer:0,originalParent:null,name:"页面",type:"module",controlIcon:"controlIcon fd-i-Family fd_pc-module",rawSchema:n.data.module},p=[];return y.forEach(i=>{i[0].originalParent=x.originalId,p.push(...i)}),p.unshift(x),p}function D(){const y=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!y.value)return;const x=[];y.value.forEach(N=>{if(N){const g=[];g.push(N);const S=u(g,[],1,null,N.id);x.push(S)}});const p=k(x),i=V(p);return C(i)}return{getData:D}}function Ce(n){const l=e.inject("sourceOutlineData")||[],c=e.ref(),s=e.ref(!1),t=e.ref([]),u=e.ref();function V(g,f,h,S){var a,G,z,U;return{id:ce.useGuid().guid(),source:S||{formId:(a=g.sourceCommunication)==null?void 0:a.formId,formCode:(G=g.sourceCommunication)==null?void 0:G.formCode,componentId:(z=g.sourceCommunication)==null?void 0:z.componentId,externalContainerId:(U=g.sourceCommunication)==null?void 0:U.externalContainerId,event:f||"onCommunication"},target:{formId:(h==null?void 0:h.formId)||"",formCode:(h==null?void 0:h.formCode)||"",externalContainerId:(h==null?void 0:h.externalContainerId)||"",commandCode:(h==null?void 0:h.commandCode)||"",commandViewmodelId:(h==null?void 0:h.commandViewmodelId)||""},paramMappings:[]}}function C(g){var f,h;(f=g==null?void 0:g.communication)!=null&&f.length&&((h=g==null?void 0:g.communication)==null||h.map(S=>{var a,G;if(S!=null&&S.id&&!((a=S==null?void 0:S.source)!=null&&a.componentId)){const z=(G=n.getFormSchema().module.communications)==null?void 0:G.find(U=>U.id===(S==null?void 0:S.id));z&&Object.assign(S,z)}}))}function k(g){const f=n.getFormSchema(),{communications:h}=f.module;h||(f.module.communications=[]);const S=f.module.communications.findIndex(a=>a.id===g.id);S===-1?f.module.communications.push(g):Object.assign(f.module.communications[S],g)}function D(g){var f;if((f=g==null?void 0:g.communication)!=null&&f.length){const h=n.getFormSchema();g.communication.map(S=>{h.module.communications&&S&&(h.module.communications=h.module.communications.filter(a=>a.id!==S.id))}),g.communication=[]}}function y(g){var h;const f=n.getFormSchema();g&&((h=f.module.communications)!=null&&h.length)&&(f.module.communications=f.module.communications.filter(S=>S.id!==g))}function x(g,f,h){const S=Mt(g,f),a=n.externalFormSchema.get(h);if(a!=null&&a.content){const G={data:a.content},{getData:z}=Tt(G,S);return z()}return[]}function p(g){var h;if(!((h=g==null?void 0:g.source)!=null&&h.componentId)){s.value=!1;return}const f=l.find(S=>S.originalId===g.source.componentId);f?(s.value=!1,c.value=f):(s.value=!0,c.value={id:g.source.componentId})}function i(g){var a,G,z,U;t.value=[];const f=(a=c.value)==null?void 0:a.rawSchema;if(!f){u.value=null;return}const h=f.type==="form-group"&&f.editor?f.editor.type:f.type,S=(G=ne.schemaMap[h])==null?void 0:G.events;S&&Object.keys(S).forEach(j=>{t.value.push({eventCode:j,eventName:S[j]})}),(z=g.source)!=null&&z.event&&((U=t.value)!=null&&U.length)&&(u.value=t.value.find(j=>{var O;return j.eventCode===((O=g.source)==null?void 0:O.event)}))}function v(g){var S,a,G,z,U,j,O,m;if(!(g!=null&&g.length))return;p(g[0]),i(g[0]);let f="",h="";return s.value?f=`${((S=g[0].source)==null?void 0:S.componentId)||""}-${((a=g[0].source)==null?void 0:a.event)||""}`:(f=(G=c.value)==null?void 0:G.name,f&&((z=u.value)!=null&&z.eventName)&&(f+=`-${(U=u.value)==null?void 0:U.eventName}`),h=`${(j=c.value)==null?void 0:j.name} (${(O=c.value)==null?void 0:O.originalId})`,h=`${h}
|
|
2
|
+
${(m=u.value)==null?void 0:m.eventName} (${u.value.eventCode})`),{title:f,titleTip:h,isControlInvalid:s.value}}function N(g){var f;if((f=g==null?void 0:g.communication)!=null&&f.length){const h=g==null?void 0:g.communication[0];return h==null?void 0:h.source}}return{createNewCommunication:V,resolveCommunication:C,clearAllCommunication:D,clearCommunicationById:y,saveCommunication:k,assembleSourceOutline:x,resolveSourceControlEventTitle:v,resolveCommunicationSource:N}}function Bt(n,l,c){const s=e.ref([]),{boundEvents:t,unBoundEvent:u}=l;function V(p){var v,N;return{event:{label:(v=p.boundEvents)==null?void 0:v.label,name:(N=p.boundEvents)==null?void 0:N.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:K.cloneDeep(p.command),controller:K.cloneDeep(p.controller),communication:p.communication}}function C(){var p;s.value=(p=t.value)==null?void 0:p.map(i=>V(i))}function k(p,i){const N=V({boundEvents:p,command:null,controller:{id:"",name:"",label:""},communication:i?[i]:[]});if(i){N.showSwitch[0].showSwitchNumber=2,N.showSwitch[0].showSection[2][2]=!1,N.showSwitch[0].showSection[2][3]=!1,N.needSelectCommunicationCommand=!0,s.value.unshift(N);return}p&&(N.showSwitch[0].showSwitchNumber=1,N.showSwitch[0].showSection[2][3]=!0,s.value.unshift(N))}function D(){var p;(p=s.value)==null||p.forEach(i=>{i.showSwitch.forEach(v=>{v.showSection[2][3]=!1}),i.shouldShowCommunicationPanel=!1})}function y(p){s.value[p].showSwitch.forEach(i=>{i.showSection[2][3]=!i.showSection[2][3]})}function x(p){if(p>=0&&p<=s.value.length-1){const i=s.value[p];u(i.event),s.value.splice(p,1);const{clearAllCommunication:v}=Ce(n);v(i)}}return{addNewInteraction:k,collapseInteractions:D,deleteInteracton:x,toggleMethodInInteraction:y,interactions:s,loadInteractions:C}}function Lt(n){const l=e.ref([]),c=e.ref([]),s=e.ref([]),{isContextDependent:t}=Ze();function u(){const{allComponentList:p}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(i=>{i.controllerList.forEach(v=>{if(v.targetComponent){const N=p.find(f=>f.componentId===v.targetComponent);if((N?N.viewModelId:void 0)===n.value.viewModelId)v.hasPath=!1;else{const f=t(i.controllerName.id,v.handlerName);v.hasPath=f?!0:v.hasPath,v.componentLists=f?K.cloneDeep(n.value.componentLists):v.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(i=>{var v;if((v=i.command)!=null&&v.targetComponent){const N=p.find(f=>{var h;return f.componentId===(((h=i.command)==null?void 0:h.targetComponent)||"")});if((N?N.viewModelId:void 0)===n.value.viewModelId)i.command.hasPath=!1;else{const f=t(i.controller.id,i.command.handlerName);i.command.hasPath=f?!0:i.command.hasPath,i.command.componentLists=f?K.cloneDeep(n.value.componentLists):i.command.componentLists}}})}function V(){const p=c.value.reduce((v,N)=>(v.set(N.boundEvents.label,!0),v),new Map);return l.value.filter(v=>!p.has(v.label))}function C(){var i;const p=((i=c.value)==null?void 0:i.length)>0;s.value=p?V():l.value}function k(){u(),l.value=n.value.events,c.value=n.value.boundEventsList,C()}function D(p){s.value=s.value.filter(i=>i.label!==p.label)}function y(p){c.value=c.value.filter(i=>i.boundEvents.label!==p.label),C()}function x(){var v;const p=(v=n.value)==null?void 0:v.getEventList(),{events:i}=p;p&&(n.value.events=K.cloneDeep(i),n.value.boundEventsList=p.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(N){return i.find(g=>g.label===N.boundEvents.label)}))}return{allEvents:l,boundEvents:c,candidateEvents:s,excludeFromCandidates:D,loadEvents:k,resetBoundEvents:x,unBoundEvent:y}}const kt={sourceCommunication:{type:Object,default:{}}},It={events:{type:Array,default:[]}},$t=e.defineComponent({name:"FEventList",props:It,emits:["click"],setup(n,l){const c=e.ref(n.events);function s(u){l.emit("click",u)}function t(u){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>s(u),class:"f-page-events-editor-first-bound-event-name"},[u.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[c.value.map(u=>t(u))])}}),be={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},Dt=e.defineComponent({name:"FSelectSourceControl",props:be,emits:["selectSourceEvent","deleteControl"],setup(n,l){const c=e.inject("useFormSchema"),{createNewCommunication:s}=Ce(c),t=e.ref();t.value=s(n);const u=e.ref([{field:"name",title:"",dataType:"string"}]),V=e.ref([]),C=e.ref(),k=e.ref(),D=e.ref(!0),y=e.ref(!1),x=e.ref([]),p=e.ref(),i=e.ref(!0),v=e.ref(!1);function N(){const j=e.inject("sourceOutlineData");V.value=j||[],k.value.updateDataSource(V.value)}function g(){var O,m,r;if(!((m=(O=t.value)==null?void 0:O.source)!=null&&m.componentId)){v.value=!1;return}const j=(r=V.value)==null?void 0:r.find(d=>d.originalId===t.value.source.componentId);j?(k.value.selectItemById(j.id),v.value=!1):(v.value=!0,C.value={id:t.value.source.componentId})}function f(){var j,O,m;(O=(j=t.value)==null?void 0:j.source)!=null&&O.event&&((m=x.value)!=null&&m.length)&&(p.value=x.value.find(r=>{var d,b;return r.eventCode===((b=(d=t.value)==null?void 0:d.source)==null?void 0:b.event)}))}e.onMounted(()=>{N(),g(),f(),i.value=!1});function h(){var r;x.value=[];const j=C.value.rawSchema,O=j.type==="form-group"&&j.editor?j.editor.type:j.type,m=(r=ne.schemaMap[O])==null?void 0:r.events;m&&Object.keys(m).forEach(d=>{x.value.push({eventCode:d,eventName:m[d]})})}function S(j){D.value=!1,v.value=!1;const O=C.value!==j[0];O&&(C.value=j[0],h()),i.value||(y.value=!0),!i.value&&O&&(p.value=null)}const a=e.computed(()=>({"item-list":!0,"d-none":!D.value})),G=e.computed(()=>j=>{var O;return{item:!0,selected:((O=p.value)==null?void 0:O.eventCode)===j}});function z(j){var O;D.value=!1,y.value=!1,p.value=j,t.value.source.componentId=C.value.rawSchema.id,t.value.source.event=(O=p.value)==null?void 0:O.eventCode,l.emit("selectSourceEvent",t.value)}const U=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:v.value}));return()=>e.createVNode("div",{class:U.value},[e.createVNode("div",{class:a.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(He.FTreeView,{ref:k,data:V.value,columns:u.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!0,iconField:"controlIcon",onSelectionChange:S},null)]),y.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),x.value.map(j=>e.createVNode("span",{class:G.value(j.eventCode),onClick:()=>z(j)},[j.eventName]))])])])}}),qt=e.defineComponent({name:"FInteractionButton",props:kt,emits:["clickEventItem","selectSourceControl"],setup(n,l){const c=new ge.FNotifyService,s=e.inject("useEventsComposition"),t=e.inject("useInteractionCompostion"),{candidateEvents:u}=s,{collapseInteractions:V}=t,C=e.ref(!1),k=e.ref(!1);function D(v){u.value=u.value.filter(N=>N.label!==v.label)}function y(){var v;(v=n.sourceCommunication)!=null&&v.needSelectSourceControl?k.value=!k.value:C.value=!C.value}function x(v){y(),D(v),l.emit("clickEventItem",v)}function p(){var v;if(!((v=n.sourceCommunication)!=null&&v.needSelectSourceControl)&&u.value.length===0){c.info({position:"top-center",message:"事件已全部绑定"});return}V(),y()}function i(v){k.value=!1,l.emit("selectSourceControl",v)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:p},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),C.value&&e.createVNode($t,{events:u.value,onClick:x},null),k.value&&e.createVNode(Dt,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:i},null)])}}),Ot={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]},sourceCommunication:{type:Object,default:{}},viewSourceHandle:{type:Function,default:()=>{}},haveBoundCommand:{Type:Boolean,default:!1}},At={newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundCommand:{Type:Boolean,default:!1},controllers:{type:Array,default:[]},iteractionDisplayOrder:{Type:Number,default:0},event:{Type:Object},sourceCommunication:{type:Object,default:{}}},Rt={controllers:{type:Array,default:[]}},Ut=e.defineComponent({name:"FCommandList",props:Rt,emits:["selectMethod"],setup(n,l){function c(C){return C.controllerList.length!==0}function s(C){return c(C)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:C.controllerName.name},[C.controllerName.name])])}function t(C,k){l.emit("selectMethod",{method:C,controller:k})}function u(C){return C.controllerList.map(k=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>t(k,C)},[e.createVNode("div",{class:"f-page-internals-command-name",title:k.label},[k.name])]))}function V(C){return e.createVNode("div",null,[s(C),u(C)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(C=>V(C))])}}),Gt={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},_t=e.defineComponent({name:"FBoundEventSelector",props:Gt,emits:["cancel","submit"],setup(n,l){var P,R;const c=e.ref(),s=e.ref([]),t=e.ref('<i class="f-icon f-icon-search"></i>'),u=n.useFormSchema.getFormMetadataBasicInfo(),V=e.ref(""),C=e.ref(),k=((P=n.sourceCommunication)==null?void 0:P.unSupportedEventCodes)||[],D=e.ref(!k.includes(n.event.label)&&((R=n.useFormSchema.externalFormSchema)==null?void 0:R.size)>0),y=e.ref(),x=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const w=n.getEventPath();c.value=w.viewModelDisplay;const{actionWithPath:q}=w;q.forEach(o=>{o.sourceComponent.map.forEach(B=>{B.active=!1,B.hide=!1})}),s.value=K.cloneDeep(q)}});function p(w=""){w=w.replace(/ /g,"").replace(/>/g,"").toLowerCase(),w===""&&(w=" "),s.value.forEach(q=>{const o=q.path;q.sourceComponent.map.forEach(B=>{const A=B.command.name,H=B.event.name,E=B.command.label;`${o}${A}${H}${E}`.toLowerCase().includes(w)?B.hide=!1:B.hide=!0})})}function i(w=""){w=w.replace(/ /g,"").replace(/>/g,"").toLowerCase(),x.value.forEach(q=>{if(!q.isCommandNode)return;const o=q.name||"",B=q.code||"",A=q.viewmodelName||"",H=`${o}${B}${A}`.toLowerCase();w&&!H.includes(w)?q.hide=!0:q.hide=!1})}function v(w=""){!y.value||y.value.id===u.id?p(w):i(w)}function N(){const w=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(ln,{updateOn:"change",groupText:t.value,modelValue:V.value,"onUpdate:modelValue":q=>V.value=q,onChange:v,placeholder:"请输入名称/编号/路径搜索"},null)])]);return D.value?e.createVNode("div",{class:"f-navSelector-header"},[e.createVNode("div",{class:"f-navSelector-recommand"},[e.createVNode("div",{class:"f-navSelector-recommand-text"},[e.createTextVNode("方法列表")])]),e.createVNode("div",{class:"f-navSelector-remainder"},[e.createVNode("div",{class:"f-vm-search"},[w])])]):w}function g(w){return{"f-vm-item":!0,"f-vm-item-focus":w.active}}function f(w,q){let o=0;s.value.forEach(B=>{B.sourceComponent.map.forEach(A=>{!A.command.isInvalid&&w.controller.id===A.controller.id&&w.command.id===A.command.id&&w.event.label===A.event.label&&q.sourceComponent.id===B.sourceComponent.id?(w.active=!w.active,C.value=K.cloneDeep(w)):(A.command.isInvalid&&w.controller.id===A.controller.id&&w.command.id===A.command.id&&w.event.label===A.event.label&&q.sourceComponent.id===B.sourceComponent.id&&(o++,o===1&&(new ge.FNotifyService().info({position:"top-center",message:"该方法已失效"}),C.value=null)),A.active=!1)})})}function h(w){return{"f-event-func":!w.command.isInvalid,"f-event-func-invalid":w.command.isInvalid}}function S(w){return w.sourceComponent.map.filter(q=>!q.hide).map(q=>{if(!q.command.isInvalid)return e.createVNode("div",{class:g(q),onClick:()=>f(q,w)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size:10px;color:#30B471;"},[e.createTextVNode(" ")])]),e.createVNode("div",{class:h(q)},[q.command.name,e.createTextVNode("("),q.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[w.path,q.event.name])])})}function a(){return s.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[s.value.map(w=>S(w))]):e.createVNode("div",{class:"f-list-view-emptydata",style:"height: 360px;position: relative;"},[e.createVNode("div",{class:"f-datagrid-norecords"},[e.createVNode("div",{class:"f-datagrid-norecords-content"},[e.createTextVNode(" 暂无数据")])])])}function G(){l.emit("cancel")}function z(){if(!C.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}l.emit("submit",{selectedCommand:C.value,selectedForm:y.value})}function U(){const w=n.useFormSchema.externalFormSchema,q=[];return q.push({containerId:"",id:u.id,code:u.code,name:u.name}),Array.from(w.keys()).forEach(o=>{const B=w.get(o);q.push({containerId:o,id:B.id,code:B.code,name:B.name})}),q}const j=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":D.value}));function O(w){var A,H;const{viewmodels:q,components:o}=w.module;if((q==null?void 0:q.length)===0||(o==null?void 0:o.length)===0)return[];x.value=[];const B=(H=(A=n.sourceCommunication)==null?void 0:A.parameterData)==null?void 0:H.getViewModelName;q.forEach(E=>{if(!E||!E.commands||E.commands.length===0)return[];const J=o.find(ee=>ee.viewModel===E.id),Y=B&&J?B(J,E.name,w):"";x.value.push({id:E.id,code:E.code,name:Y||E.name}),E.commands.forEach(ee=>{ee.isInvalid||x.value.push({...ee,viewmodelId:E.id,viewmodelName:Y||E.name,isCommandNode:!0})})})}function m(w){var q,o,B;if(!(w.id===y.value.id&&w.containerId===y.value.containerId))if(y.value=w,V.value="",C.value=null,y.value.id!==u.id){const A=(o=n.useFormSchema.externalFormSchema)==null?void 0:o.get((q=y.value)==null?void 0:q.containerId);(B=A==null?void 0:A.content)!=null&&B.module&&O(A.content)}else s.value.map(A=>{A.sourceComponent.map.map(H=>{H.hide=!1,H.active=!1})})}function r(){const w=U();y.value||(y.value=w[0]);const q=e.computed(()=>o=>{var B;return{"f-list-view-group-item":!0,"f-listview-active":o.id===((B=y.value)==null?void 0:B.id)&&o.containerId===y.value.containerId}});return e.createVNode("div",{class:"f-page-nav"},[e.createVNode("div",{class:"f-list-view"},[e.createVNode("div",{class:"f-list-view-content"},[e.createVNode("ul",{class:"f-list-view-group",style:"list-style: none;"},[w.map(o=>{let B=o.name;return o.containerId&&(B+=`, 所属外部容器:${o.containerId}`),e.createVNode("li",{class:q.value(o),onClick:()=>m(o)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:B},[o.name])])])})])])])])}function d(w){x.value.map(q=>q.active=!1),w.active=!0,C.value=w}function b(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[x.value.filter(w=>!w.hide).map(w=>{if(w.isCommandNode)return e.createVNode("div",{class:g(w),onClick:()=>d(w)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size: 10px; color: rgb(48, 180, 113);"},null)]),e.createVNode("div",{class:"f-event-func"},[w.name,e.createTextVNode("("),w.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[w.viewmodelName])])})])}return()=>e.createVNode("div",{class:j.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[D.value?r():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[N(),!y.value||y.value.id===u.id?a():b()])]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:G},[e.createTextVNode("取消")]),e.createVNode("button",{type:"button",class:"btn btn-primary",onClick:z},[e.createTextVNode("确定")])])])}}),Ht=e.defineComponent({name:"FCommandSource",props:At,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,l){const c=e.inject("useMethodsComposition"),s=e.inject("useFormCommand"),t=new ge.FNotifyService,{checkIfNewControllerExists:u,addNewController:V}=c,C=e.ref(n.controllers),k=e.inject("useFormSchema"),D=e.inject(cn.F_MODAL_SERVICE_TOKEN);let y,x;const p=e.ref(!1);e.onMounted(()=>{p.value=k.externalFormSchema.size>0});function i(d,b,P){if(V(d),d.Commands){const R=s.getInternalControllerFromControllerMetadata(d,b,P);u(R)&&t.info({position:"top-center",message:"该控制器已存在"})}}async function v(d){s.getSupportedControllerMetadata(d).then(b=>{b&&i(b.controller,b.code,b.nameSpace)}).finally(()=>{y&&y.destroy&&y.destroy()})}function N(d){y&&y.destroy&&y.destroy()}function g(){const d={formBasicInfo:k==null?void 0:k.getFormMetadataBasicInfo()};return e.createVNode(ze.FSchemaSelector,{injectSymbolToken:ce.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:d,showFooter:!0,onCancel:N,onSubmit:v},null)}function f(){y=D.open({title:"选择控制器",width:950,render:g,showButtons:!1})}function h(){l.emit("newFunctionChanged")}function S(){x&&x.destroy&&x.destroy()}function a(d){const{selectedCommand:b,selectedForm:P}=d;!P||(P==null?void 0:P.id)===k.getFormMetadataBasicInfo().id?(c.selectBoundCommand(b,n.iteractionDisplayOrder),l.emit("selectBoundMethod")):l.emit("addCommunication",d),S()}function G(){const{getEventPath:d}=c;return e.createVNode(_t,{getEventPath:d,notifyService:t,useFormSchema:k,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:S,onSubmit:a},null)}function z(){x=D.open({title:"已有方法",width:950,height:500,fitContent:!1,render:G,showButtons:!1,enableEsc:!1,draggable:!0})}function U(){l.emit("close",null)}function j(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function O(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>f()},[e.createTextVNode("引入控制器")])]),e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>h()},[e.createTextVNode("添加新方法")])]),(n.haveBoundCommand||p.value)&&e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>z()},[e.createTextVNode("已有方法")])])])}function m(d){l.emit("selectMethod",d)}function r(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(Ut,{controllers:C.value,onSelectMethod:m},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[r(),j(),O(),j(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:U},[e.createTextVNode("取消")])])])}}),zt={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},Wt=e.defineComponent({name:"FParameterEditor",props:zt,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,l){const c=new ge.FNotifyService,s=e.inject("FMessageBoxService"),t=e.ref(K.cloneDeep(n.command)),u=e.ref(n.controller),V=e.ref(0),C=e.computed(()=>t.value.id==="abandoned"),k=e.computed(()=>t.value.id==="deleted"),D=e.computed(()=>n.showDeleteIcon),y=e.computed(()=>t.value!==null),x=e.inject("useMethodsComposition"),p=e.ref(n.showParameter),i=e.inject("useFormSchema"),v=e.computed(()=>t.value.componentLists&&t.value.hasPath),N=e.computed(()=>{const E=t.value.id!=="abandoned"&&t.value.id!=="deleted",J=v.value,Y=t.value.property&&t.value.property.length>0;return E&&(J||Y)});function g(){const{targetComponent:E}=t.value;let J="";return t.value.componentLists&&t.value.componentLists.forEach(Y=>{if(Y.componentId===E){J=Y.viewModelId;return}}),J}const f=e.ref(g()),h=e.computed(()=>t.value.targetComponent||"");function S(){c.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function a(){return e.createVNode("div",{title:"方法已被移除,请重新绑定",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>S()},null)}function G(){c.info({position:"top-center",message:"方法已失效,请重新绑定"})}function z(){return e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>G()},null)}function U(E){p.value=!p.value}function j(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>U(V.value)},null)}function O(E,J){t.value.targetComponent=E[0].componentId,l.emit("targetChange",t.value)}function m(){const E=e.reactive({content:"将此方法添加到指定的组件",placement:"top"});return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent"},[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-topic"},[e.createTextVNode("挂载到目标组件"),e.withDirectives(e.createVNode("span",{class:"farris-label-tips ml-2"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),E]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(We,{modelValue:f.value,"onUpdate:modelValue":J=>f.value=J,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:t.value.componentLists,editable:!1,onChange:O},null)])])])}function r(E,J){J.value=E}function d(){l.emit("change",t.value)}function b(){let E="";return h.value?E=i.getViewModelIdByComponentId(h.value):E=x.getViewModeId(),E}function P(E,J){var xe,je,Ee,Pe,Ne,ye,I,_,W,Q,X,oe,le,de,ue,Me,Te,Be,he,Le,ke;const Y=b(),ie=i.getViewModelById(Y).commands.find(Z=>{var fe;return(Z==null?void 0:Z.id)===((fe=n.command)==null?void 0:fe.id)}),se=e.reactive(E.context.data),{assembleSchemaFieldsByComponent:te,assembleOutline:ae,assembleStateVariables:re,assembleSchemaFieldsUnderBoundEntity:Ae,getEditor:Re}=E.context.generalData,{designerMode:Ue}=i,Ge=Z=>{r(Z,E),d()},_e=Z=>{var fe,we,ve,Ie;return((Ie=(ve=(we=(fe=E==null?void 0:E.origin)==null?void 0:fe.controlSource)==null?void 0:we.context)==null?void 0:ve.data)==null?void 0:Ie.value)===":Entity"||Z.raw.children&&Z.raw.children.length&&(Z.disabled=!0),Z};return e.createVNode(De,{readonly:Ue==="PC_RTC"&&!J.isRtcCommand,defaultValue:E==null?void 0:E.origin.defaultValue,modelValue:E.value,"onUpdate:modelValue":Z=>E.value=Z,data:se,editor:Re(E.value,E,ie,Y,Ge),fieldData:te(),formData:ae(),varData:re(),activeViewModelFieldData:Ae(h.value),editorControlSource:(xe=E==null?void 0:E.origin)==null?void 0:xe.controlSource,customRowStatus:_e,idField:((Ne=(Pe=(Ee=(je=E==null?void 0:E.origin)==null?void 0:je.controlSource)==null?void 0:Ee.context)==null?void 0:Pe.data)==null?void 0:Ne.value)===":Entity"?"bindTo":((W=(_=(I=(ye=E==null?void 0:E.origin)==null?void 0:ye.controlSource)==null?void 0:I.context)==null?void 0:_.valueField)==null?void 0:W.value)||((le=(oe=(X=(Q=E==null?void 0:E.origin)==null?void 0:Q.controlSource)==null?void 0:X.context)==null?void 0:oe.idField)==null?void 0:le.value)||"id",textField:((Te=(Me=(ue=(de=E==null?void 0:E.origin)==null?void 0:de.controlSource)==null?void 0:ue.context)==null?void 0:Me.textField)==null?void 0:Te.value)||"label",editable:(ke=(Le=(he=(Be=E==null?void 0:E.origin)==null?void 0:Be.controlSource)==null?void 0:he.context)==null?void 0:Le.editable)==null?void 0:ke.value,onConfirm:Z=>{r(Z,E),d()},onValueChange:Z=>{var fe,we;if(((fe=E.origin)==null?void 0:fe.Code)==="lookupId"){const ve=(we=t.value.property)==null?void 0:we.find(Ie=>Ie.name==="mappingFields");ve&&ve.value&&(ve.value="")}r(Z,E),d()}},null)}function R(){var E;return(E=t.value.property)==null?void 0:E.map((J,Y)=>{const ee=e.reactive({content:J.description,placement:"top"});return e.createVNode("div",{key:J.name+Y},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[J.shownName,J.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),ee]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[P(J,t.value)])])})}function w(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[v.value&&m(),R()])}function q(E){E.stopPropagation(),l.emit("viewSource",{command:t.value,event:E})}function o(){s.question(`确定删除命令【${t.value.name}】吗?`,"",()=>{l.emit("deleteCommand")})}function B(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:E=>o()},null)}const A=e.computed(()=>{var E;return{cursor:C.value||u.value.isCommon||((E=u.value)==null?void 0:E.label.indexOf(i==null?void 0:i.getModule().code))===-1?"default":"pointer"}});function H(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",style:A.value,title:t.value.label,onDblclick:q},[t.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[C.value&&a(),k.value&&z(),N.value&&j(),D.value&&B()])]),p.value&&w()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[y.value&&H()])}}),Kt="root-viewmodel";class Jt{constructor(l,c){$e(this,"formSchemaUtils");$e(this,"controlCreatorUtils");$e(this,"designViewModelUtils");this.resolver=l,this.designerHostService=c,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(l){const c=this.createComponentRefNode(l),s=this.createComponentNode(l),t=this.createViewModeNode(l),u=this.formSchemaUtils.getFormSchema();return u.module.viewmodels.push(t),u.module.components.push(s),this.designViewModelUtils.assembleDesignViewModel(),c}createComponentRefNode(l){const c=this.resolver.getSchemaByType("component-ref");return Object.assign(c,{id:`${l.componentId}-component-ref`,component:`${l.componentId}-component`}),c}createComponentNode(l){const c=this.resolver.getSchemaByType("component"),s=this.createFormComponentContents(l);return Object.assign(c,{id:`${l.componentId}-component`,viewModel:`${l.componentId}-component-viewmodel`,componentType:l.componentType,appearance:{class:this.getFormComponentClass(l)},formColumns:l.formColumns,contents:s}),c}getFormComponentClass(l){var s,t;const{templateId:c}=this.formSchemaUtils.getFormSchema().module;if(c==="double-list-in-tab-template"&&((t=(s=l.parentComponentInstance)==null?void 0:s.schema)==null?void 0:t.type)==="tab-page"){const u=l.parentComponentInstance.parent&&l.parentComponentInstance.parent.schema;if((u==null?void 0:u.type)==="tabs"&&(u==null?void 0:u.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(l){var C,k;const c=this.resolver.getSchemaByType("section");Object.assign(c,{id:l.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:l.componentName});const s=this.resolver.getSchemaByType("response-form"),t=[];Object.assign(s,{id:l.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:t,controlsInline:!0}),c.contents=[s];const{selectedFields:u}=l;u==null||u.forEach(D=>{if(D.$type===ce.FormSchemaEntityField$Type.SimpleField){const y=K.cloneDeep(D),x=this.resolveControlClassByFormColumns(l),p=this.controlCreatorUtils.setFormFieldProperty(y,"",x);p&&t.push(p)}});const{templateId:V}=this.formSchemaUtils.getFormSchema().module;if(V==="double-list-in-tab-template"&&((k=(C=l.parentComponentInstance)==null?void 0:C.schema)==null?void 0:k.type)==="tab-page"){const D=l.parentComponentInstance.parent&&l.parentComponentInstance.parent.schema;(D==null?void 0:D.type)==="tabs"&&(D==null?void 0:D.fill)===!0&&(c.appearance.class="f-section-grid f-section-in-main px-0 pt-0",c.fill=!0)}return[c]}resolveControlClassByFormColumns(l){let c="";switch(l.formColumns){case 1:{c="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{c="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{c="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{c="col-12 col-md-6 col-xl-3 col-el-2";break}}return c}createViewModeNode(l){return{id:`${l.componentId}-component-viewmodel`,code:`${l.componentId}-component-viewmodel`,name:l.componentName,bindTo:l.bindTo,parent:Kt,fields:this.assembleViewModelFields(l),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(l){const c=[],{selectedFields:s}=l;return s==null||s.forEach(t=>{if(t.$type===ce.FormSchemaEntityField$Type.SimpleField){let u="blur";const V=t.type.name;(V===ce.FormSchemaEntityFieldTypeName.Enum||V===ce.FormSchemaEntityFieldTypeName.Boolean)&&(u="change"),c.push({type:"Form",id:t.id,fieldName:t.bindingField,groupId:null,groupName:null,updateOn:u,fieldSchema:{}})}}),c}}function en(n,l,c,s){var u,V,C,k,D,y;const t=c.parentComponentInstance;if(t&&s){const x=(u=t.schema)==null?void 0:u.type,i={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((V=c.bindingSourceContext)==null?void 0:V.entityTitle)||((k=(C=c.bindingSourceContext)==null?void 0:C.bindingEntity)==null?void 0:k.name)||"标题",componentType:"form",formColumns:x==="splitter-pane"?1:4,parentContainerId:t.schema.id,parentComponentInstance:t,bindTo:((D=c.bindingSourceContext)==null?void 0:D.bindTo)||"/",selectedFields:(y=c.bindingSourceContext)==null?void 0:y.bindingEntityFields};return new Jt(n,s).createComponent(i)}else return l}const Qt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"},formType:{description:"",type:"string",default:"static"}},required:["id","type","contents"]},nn=new Map([["appearance",ne.resolveAppearance]]),Yt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dynamic-form.schema.json",title:"dynamic-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"dynamic-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},formType:{description:"",type:"string",default:"dynamic"},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"}},required:["id","type","contents"]},Ve={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0},fields:{type:Array,default:[]},formData:{type:Object,default:null},layout:{type:String,default:"col-12 col-md-6 col-xl-3 col-el-2"}},Xt=Object.assign({},Ve,{canRenderForm:{type:Boolean,default:!0},callback:{type:Function}});ne.createPropsResolver(Ve,Qt,nn,en),ne.createPropsResolver(Ve,Yt,nn,en);const Fe=e.defineComponent({name:"FDynamicForm",props:Xt,emits:["update:modelValue","event"],setup(n,l){const c=e.ref(n.fields),s=new Map,t=e.ref(n.callback);me.loadRegister();const u=me.useComponentManager(),V=e.ref(n.formData||{}),C=me.useBindingData(V,l);me.useEntityState(c.value).setup();const D=new Map,y=e.ref(n.canRenderForm),{mergeArray:x,resolveCallbacks:p,resolveEvents:i}=me.useDynamicViewUtils(),v=e.computed(()=>{const o=Ke.LocaleService.getLocale(),B=n.fields&&n.fields.length>0,A={"f-form-layout":B,"farris-form":B};return n.adaptForLanguage&&o&&(A["farris-form-controls-inline"]=o!=="en"),ce.getCustomClass(A,n.customClass)});function N(){function o(B,A){const{id:H}=B||{},{field:E}=B.binding||{};return{modelValue:A.getValue(H),"onUpdate:modelValue":J=>{A.setValue(H,E||H,J)}}}return{resolve:o}}function g(o){const B=N();return C.getValue(o.id)===void 0&&Object.hasOwnProperty.call(o,"modelValue")&&C.setValue(o.id,void 0,o.modelValue),B.resolve(o,C)}function f(o){const B={};return o&&Object.entries(o).forEach(([A,H])=>{B[A]=()=>Array.isArray(H)?H.map(E=>G(E)):G(H)}),B}function h(o){return o.type?o.type:o.fields?"fieldset":"form-group"}function S(o){const B=h(o);let A=o.customClass;A||(A=B==="form-group"?n.layout:"col-12 px-0");const{fields:H,customClass:E,...J}=o,Y={...i(o,l,B)},ee={...p(o,t,B)};return{props:{...{...J,customClass:A,...g(o)},key:o.id,ref:te=>{if(te&&o.id&&!u.has(o.id)){u.register(o.id,te);const ae={token:o.id,name:"component:ready",type:h(o),payloads:[e.ref(te)],schema:o};l.emit("event",ae)}},onVnodeUnmounted:te=>{if(o.id&&u.has(o.id)){u.remove(o.id);const ae={token:o.id,name:"component:unmounted",type:h(o),payloads:[te],schema:o};l.emit("event",ae)}}},eventProps:Y,callbackProps:ee}}function a(o,B){return Array.isArray(o)?o.map(A=>B(A)):B(o)}function G(o,B){var ee;const A=h(o),H=me.componentMap[A];if(o.id&&s.set(o.id,o),!H)return null;const E=()=>o.fields?o.fields.map(ie=>G(ie)):null,J=(ie,se,te)=>{let ae;return te&&te.length>0?ae=e.createVNode(ie,{...se},te):ae=e.createVNode(ie,{...se},null),ae},Y=((ee=D.get(o.id))==null?void 0:ee.props)||{};return o.fields&&o.fields.length>0?J(H,Y,[E()]):o.slots?J(H,Y,[...Object.values(f(o.slots))]):J(H,Y)}function z(o){const B=h(o);if(!me.componentMap[B])return;const{props:H,eventProps:E,callbackProps:J}=S(o),Y=me.resolverMap[B],ee=Y?Y.editorResolver:null,{componentEventProps:ie,editorEventProps:se}=E,{componentCallbackProps:te,editorCallbackProps:ae}=J;if(ie&&Object.keys(ie).length>0&&Object.assign(H,ie),te&&Object.keys(te).length>0&&Object.assign(H,te),ee&&se&&Object.keys(se).length>0){const re=ee.resolve(o);Object.assign(re,se)}if(ee&&ae&&Object.keys(ae).length>0){const re=ee.resolve(o);Object.assign(re,ae)}if(H&&Object.keys(H).length>0){const re=D.get(o.id);re?K.merge(re==null?void 0:re.props,H):D.set(o.id,e.reactive({props:H}))}!o.fields||!Array.isArray(o.fields)||o.fields.forEach(re=>z(re))}function U(o){const B=h(o);me.componentMap[B]&&(j(o),!(!o.fields||!Array.isArray(o.fields))&&o.fields.forEach(H=>U(H)))}function j(o){const B=g(o);if(B&&Object.keys(B).length>0){const A=D.get(o.id);if(!A)D.set(o.id,e.reactive({props:B}));else{const H={...A==null?void 0:A.props};Object.keys(B).forEach(E=>{H[E]=B[E]}),Object.assign(A==null?void 0:A.props,H)}}}e.onMounted(()=>{}),e.watch(()=>n.formData,o=>{V.value=o}),e.watch(()=>V.value,o=>{a(c.value,U)},{deep:!0});function O(o){o&&a(c.value,z)}e.watch(()=>n.fields,o=>{s.clear(),u.clear(),V.value=n.formData||{},D.clear(),c.value=o,O(o)}),O(n.fields);function m(o){o.$forceUpdate&&o.$forceUpdate()}function r(o){return C.getValue(o)}function d(){return V.value}function b(o,B){C.setValue(o,void 0,B);const A=s.get(o);A&&j(A)}function P(o){var B;return(B=D.get(o))==null?void 0:B.props}function R(o,B){const A=D.get(o);K.mergeWith(A==null?void 0:A.props,B,x)}l.expose({componentManager:u,rerender:m,getProps:P,setProps:R,getControlValue:r,setControlValue:b,getValues:d});function w(){return y.value&&e.withDirectives(e.createVNode("div",{class:v.value,style:n.customStyle},[l.slots.default&&l.slots.default(),c.value&&c.value.length>0&&a(c.value,G)]),[[e.resolveDirective("area-response")]])}function q(){return!y.value&&c.value&&c.value.length>0&&a(c.value,G)}return()=>n.visible?w()||q():null}}),tn=e.defineComponent({name:"FResponseForm",props:Ve,emits:[],setup(n,l){var x;const c=e.ref(),s=e.ref(),t=e.computed(()=>{const p=Ke.LocaleService.getLocale(),i=n.fields&&n.fields.length>0,v={"drag-container":!0,"f-form-layout":i,"farris-form":i};return n.adaptForLanguage&&p&&(v["farris-form-controls-inline"]=p!=="en"),ce.getCustomClass(v,n.customClass)}),u=(x=s.value)==null?void 0:x.componentManager;function V(p){s.value.render(p)}function C(p){return s.value.getControlValue(p)}function k(p,i){s.value.setControlValue(p,i)}function D(p){return s.value.getProps(p)}function y(p,i){s.value.setProps(p,i)}return l.expose({componentManager:u,rerender:V,getProps:D,setProps:y,getControlValue:C,setControlValue:k}),()=>n.visible&&e.withDirectives(e.createVNode("div",{ref:c,class:t.value,style:n.customStyle},[l.slots.default&&l.slots.default(),n.fields&&n.fields.length>0&&e.createVNode(Fe,{ref:s,fields:n.fields,canRenderForm:!1,formData:n.formData,layout:n.layout},null)]),[[e.resolveDirective("area-response")]])}}),Zt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number],default:null},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1}},eo={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"}},no=e.defineComponent({name:"FDynamicFormLabel",props:eo,emits:[],setup(n,l){e.ref(n.title||n.text);const c=e.ref(n.required),s=e.ref(n.text),t=e.ref(n.valid),u=e.ref(n.inValidTip);e.watch(()=>n.text,()=>{s.value=n.text}),e.watch(()=>n.required,(y,x)=>{y!==x&&(c.value=y)}),e.watch([()=>n.valid,()=>n.inValidTip],([y,x])=>{t.value=y,u.value=x});const V=e.computed(()=>t.value?s.value:u.value),C=e.computed(()=>t.value?"":"color:red"),k=e.computed(()=>({"col-form-label":!0,"f-width-auto":c.value&&(n.showType==="none"||!s.value)})),D=e.computed(()=>n.showType==="force-none"?!1:n.showType==="reserve-space"||c.value||!!s.value&&n.showType!=="none");return()=>D.value&&e.createVNode("label",{class:k.value,title:V.value,style:C.value},[!t.value&&e.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:u.value},null),e.createVNode("span",{class:"farris-label-text"},[c.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),n.showType==="visible"&&s.value])])}}),{globalStorageKey:to}=ce.useThirdComponent(),M={},T={},L={},$={};async function oo(){{const n={schemaMap:ne.schemaMap,propertyConfigSchemaMap:ne.propertyConfigSchemaMap,propertyEffectMap:ne.propertyEffectMap,schemaResolverMap:ne.schemaResolverMap};dn.register(M,T,L,$),sn.register(M,T,L,$),un.register(M,T,L,$),mn.register(M,T,L,$),fn.register(M,T,L,$,n),pn.register(M,T,L,$),Je.register(M,T,L,$,n),Qe.register(M,T,L,$,n),Je.register(M,T,L,$,n),Qe.register(M,T,L,$,n),We.register(M,T,L,$,n),hn.register(M,T,L,$),gn.register(M,T,L,$),Cn.register(M,T,L,$,n),vn.register(M,T,L,$),bn.register(M,T,L,$,n),Nn.register(M,T,L,$,n),yn.register(M,T,L,$),wn.register(M,T,L,$,n),Vn.register(M,T,L,$),vt.register(M,T,L,$),Fn.register(M,T,L,$),Sn.register(M,T,L,$),dt.register(M,T,L,$),jn.register(M,T,L,$),En.register(M,T,L,$,n),Pn.register(M,T,L,$,n),Tn.register(M,T,L,$,n),Mn.register(M,T,L,$),Bn.register(M,T,L,$,n),Ln.register(M,T,L,$),kn.register(M,T,L,$),In.register(M,T,L,$),$n.register(M,T,L,$,n),Dn.register(M,T,L,$),qn.register(M,T,L,$,n),On.register(M,T,L,$),An.register(M,T,L,$),Rn.register(M,T,L,$),Un.register(M,T,L,$,n),Gn.register(M,T,L,$,n),_n.register(M,T,L,$),zn.register(M,T,L,$,n),Wn.register(M,T,L,$),Hn.register(M,T,L,$),ze.register(M,T,L),Kn.register(M,T,L,$),Jn.register(M,T,L,$,n),Qn.register(M,T,L,$),Yn.register(M,T,L,$),Xn.register(M,T,L,$),Zn.register(M,T,L,$,n),mt.register(M,T,L,$),et.register(M,T,L,$,n),nt.register(M,T,L,$),tt.register(M,T,L,$),ot.register(M,T,L,$,n),at.register(M,T,L,$),He.register(M,T,L,$),it.register(M,T,L,$),rt.register(M,T,L,$),ct.register(M,T,L,$),lt.register(M,T,L,$,n),st.register(M,T,L,$),xn.register(M,T,L,$),De.register(M,T,L,$),ut.register(M,T,L,$,n),ft.register(M,T,L,$),pt.register(M,T,L,$),ht.register(M,T,L,$),gt.register(M,T,L,$),Ct.register(M,T,L,$),bt.register(M,T,L,$,n),Nt.register(M,T,L,$),yt.register(M,T,L,$),wt.register(M,T,L,$),Vt.register(M,T,L,$,n),Ft.register(M,T,L,$,n),St.register(M,T,L,$);const l=window[to];if(l)for(const c in l)l[c].createPropsResolver=ne.createPropsResolver,l[c].register(M,T,L)}}function on(){oo();function n(V){const C=M[V];if(!C)throw new Error(`Could not find the editor of type '${V}'`);return C}function l(V,C){const k=T[V];return k?k(C):{}}function c(V){switch(V){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function s(V){switch(V){case"combo-list":case"input-group":case"textarea":return"onClear"}}function t(V){switch(V){case"input-group":case"textarea":return"onMousedownEvent"}}function u(V){switch(V){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:l,resolveEditorType:n,getChangeFunctionName:c,getClearFunctionName:s,getMousedownFunctionName:t,getMouseupFunctionName:u}}const ao={errors:{type:Object,default:null}},ro=e.defineComponent({name:"FValidationMessage",props:ao,emits:[],setup(n,l){const c=e.ref(n.errors);e.watch(()=>n.errors,u=>{c.value=u});const s=e.ref(!0),t=e.computed(()=>{if(c.value){const u=Object.keys(c.value).map(V=>{var C;return(C=c.value[V])==null?void 0:C.name});return u.length?u.join(" "):""}return""});return()=>t.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>s.value=!s.value},[!s.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),s.value&&e.createVNode("span",{class:"f-feedback-message"},[t.value])])}}),Oe=e.defineComponent({name:"FDynamicFormGroup",props:Zt,emits:["change","update:modelValue"],setup(n,l){var d;const c=e.ref(n.id),s=e.ref(n.customClass),t=e.ref(n.editor),u=e.ref(n.label),V=e.ref(n.modelValue),C=e.ref(n.readonly),k=e.ref(((d=n.editor)==null?void 0:d.required)||n.required),D=e.ref(n.showLabel),y=e.ref(n.visible);e.ref(n.type);const x=e.ref(),p=e.ref(n.errors),i=ce.isMobilePhone(),v=e.ref(n.editor.type||"input-group"),N=e.computed(()=>D.value?n.showLabelType:"none"),{resolveEditorProps:g,resolveEditorType:f,getChangeFunctionName:h,getClearFunctionName:S}=on(),a=e.computed(()=>{const b={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":C.value,"form-group--in-mobile":i};return b["form-group--has-"+v.value]=!0,b}),G=e.computed(()=>{if(n.fill)return{maxWidth:"none"}});function z(b,P,R){V.value=P!==void 0?P:b,l.emit("update:modelValue",V.value),l.emit("change",V.value,{newValue:b,newModelValue:P,parameters:R})}function U(){l.emit("update:modelValue","")}function j(b){return(...P)=>{U(),typeof b=="function"&&b(...P)}}function O(b){return(P,R,w)=>{z(P,R,w),typeof b=="function"&&b(P,R,w)}}const m=e.computed(()=>{const b=t.value.type||"input-group",P=f(b),R=g(b,t.value),w=h(b),q=S(t.value.type);return q&&(R[q]=j(R[q])),w&&(R[w]=O(R[w])),(R.id==null||R.id==="")&&(R.id=c.value),b==="number-range"&&t.value.onBeginValueChange&&typeof t.value.onBeginValueChange=="function"?(t.value.onBeginValueChange&&typeof t.value.onBeginValueChange=="function"&&(R.onBeginValueChange=t.value.onBeginValueChange),t.value.onEndValueChange&&typeof t.value.onEndValueChange=="function"&&(R.onEndValueChange=t.value.onEndValueChange)):b==="lookup"&&t.value["onUpdate:idValue"]&&typeof t.value["onUpdate:idValue"]=="function"?(R["onUpdate:idValue"]=t.value["onUpdate:idValue"],R.id=c.value):b==="collection-property-editor"&&t.value.onSelectionChange&&typeof t.value.onSelectionChange=="function"?R.onSelectionChange=t.value.onSelectionChange:b==="property-editor"&&(R.onBeforeOpenVariables=t.value.onBeforeOpenVariables),()=>e.createVNode(P,e.mergeProps({ref:x},R,{modelValue:V.value,"onUpdate:modelValue":o=>V.value=o}),l.slots)});function r(){return e.createVNode(ro,{id:`${c.value}-validation-message`,errors:p.value},null)}return e.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([b,P,R,w,q,o,B,A,H,E])=>{var J;c.value=b,s.value=P,t.value=R,u.value=w,V.value=q,C.value=o,k.value=((J=t.value)==null?void 0:J.required)||B,D.value=A,y.value=H,p.value=E}),l.expose({editorRef:x}),()=>y.value&&e.createVNode("div",{id:`${c.value}-form-group`,class:s.value,style:n.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:G.value},[e.createVNode("div",{class:a.value},[e.createVNode(no,{id:`${c.value}-lable`,showType:N.value,required:k.value,text:u.value,title:u.value},null),e.createVNode("div",{class:"farris-input-wrap"},[m.value(),r()])])])])}}),io={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},an=e.defineComponent({name:"FDynamicFormInput",props:io,emits:["change","update:modelValue","mousedown","mouseup"],setup(n,l){const c=e.ref(n.id),s=e.ref(n.editor),t=e.ref(n.modelValue),{resolveEditorProps:u,resolveEditorType:V,getChangeFunctionName:C,getMousedownFunctionName:k,getMouseupFunctionName:D,getClearFunctionName:y}=on();function x(h,S,a){t.value=S!==void 0?S:h,l.emit("update:modelValue",t.value),l.emit("change",t.value,{newValue:h,newModelValue:S,parameters:a})}function p(h){l.emit("mousedown",h)}function i(h){l.emit("mouseup",h)}function v(){l.emit("update:modelValue","")}function N(h){return(...S)=>{v(),typeof h=="function"&&h(...S)}}function g(h){return(S,a,G)=>{x(S,a,G),typeof h=="function"&&h(S,a,G)}}const f=e.computed(()=>{const h=V(s.value.type),S=u(s.value.type,s.value);S.focusOnCreated=n.focusOnCreated,S.selectOnCreated=n.selectOnCreated;const a=C(s.value.type),G=y(s.value.type);G&&(S[G]=N(S[G])),a&&(S[a]=g(S[a]));const z=k(s.value.type);S[z]=p;const U=D(s.value.type);return S[U]=i,S.id=c.value,()=>e.createVNode(h,e.mergeProps(S,{modelValue:t.value,"onUpdate:modelValue":j=>t.value=j}),null)});return e.watch([()=>n.id,()=>n.editor,()=>n.modelValue],([h,S,a])=>{c.value=h,s.value=S,t.value=a}),()=>f.value()}});Fe.install=n=>{n.component(tn.name,tn).component(an.name,an).component(Fe.name,Fe).component(Oe.name,Oe)};const co=e.defineComponent({name:"FSelectParameters",props:be,emits:["changed"],setup(n,l){var m;const c=new ge.FNotifyService;c.globalConfig={position:"top-center"};const s=e.inject("FMessageBoxService"),t=e.ref(n.communication),u=e.ref(((m=t.value)==null?void 0:m.paramMappings)||[]),V=e.inject("useFormSchema"),C=V.getFormMetadataBasicInfo(),k=e.ref([]),D=e.ref([]),y=e.ref({}),x=e.ref({}),p=e.computed(()=>r=>{let d="",b="";if(r.sourceValue&&r.targetVariable){const P=D.value.find(R=>R.statePath===`${r.targetVariableViewModelId}.${r.targetVariable}`);P&&P.name?(x.value[r.targetVariable]=!1,d=`${r.sourceValue}--->${P.name}`,b=`将 ${r.sourceValue} 赋值给 ${P.name}`):(x.value[r.targetVariable]=!0,d=`${r.sourceValue}--->${r.targetVariable}`,b=`将 ${r.sourceValue} 赋值给 ${r.targetVariable}`)}return{displayText:d,displayTextTip:b}});e.watch(()=>n.communication,r=>{t.value=r,u.value=t.value.paramMappings||[]},{deep:!0});function i(){var d;const r=u.value.length||0;u.value.length&&(u.value=u.value.filter(b=>!(!b.sourceValue&&!b.targetVariable))),t.value.paramMappings=u.value,r!==((d=t.value.paramMappings)==null?void 0:d.length)&&l.emit("changed")}e.onUnmounted(()=>{i()});function v(r){var w,q;const{viewmodels:d,components:b}=r.module;if((d==null?void 0:d.length)===0||(b==null?void 0:b.length)===0)return[];const P=[];D.value=[];const R=(q=(w=n.sourceCommunication)==null?void 0:w.parameterData)==null?void 0:q.getViewModelName;return d.forEach(o=>{if(!o||!o.states||o.states.length===0)return[];const B=[],A=b.find(J=>J.viewModel===o.id),H=R&&A?R(A,o.name,r):"";o.states.forEach(J=>{const Y={...J,statePath:o.id+"."+J.code};B.push({data:Y,children:[]}),D.value.push(Y)});const E={data:{id:o.id,code:o.code,name:H||o.name,statePath:o.id},children:B};P.push(E)}),P}function N(){var r,d;if(!((r=t.value)!=null&&r.target.formId))return[];if(t.value.target.formId===C.id)k.value=v(V.getFormSchema());else{const b=V.externalFormSchema.get(t.value.target.externalContainerId);(d=b==null?void 0:b.content)!=null&&d.module&&(k.value=v(b==null?void 0:b.content))}}function g(){Object.keys(y.value).forEach(r=>{y.value[r]=!1})}function f(){g();const r=ce.useGuid().guid();u.value.push({id:r,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),t.value.paramMappings=u.value,y.value[r]=!0}function h(r,d,b){r.stopPropagation();function P(){u.value=u.value.filter(R=>R.id!==d.id),t.value.paramMappings=u.value,g(),l.emit("changed")}b?s.question(`确定删除参数【${b}】吗?`,"",()=>{P()}):P()}function S(r){y.value[r.id]||(g(),y.value[r.id]=!0)}function a(r,d){if(!d.sourceValue){c.warning("请选择源参数");return}if(!d.targetVariable){c.warning("请选择目标参数");return}y.value[r.id]=!1,Object.assign(r,d),delete r.statePath,l.emit("changed")}function G(r){y.value[r.id]=!1,!r.sourceValue&&!r.targetVariable&&!r.targetVariableViewModelId&&(u.value=u.value.filter(d=>d.id!==r.id),t.value.paramMappings=u.value,l.emit("changed"))}e.onMounted(()=>{N()}),e.watch(()=>n.communication,r=>{N()},{deep:!0});function z(r,d,b){var P;if((P=b.newValue)!=null&&P.length){const{statePath:R}=b.newValue[0];if((R==null?void 0:R.indexOf("."))>0){const w=R.split(".");d.targetVariableViewModelId=w[0],d.targetVariable=w[1]}}}function U(r){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:k.value,editable:!1,enableClear:!1,customRowStatus:d=>d.raw.parent?(u.value.find(P=>P.id!==r.id&&`${P.targetVariableViewModelId}.${P.targetVariable}`===d.raw.statePath)&&(d.disabled=!0),d):(d.disabled=!0,d)}}function j(r){const d=K.cloneDeep(r);d.statePath=`${d.targetVariableViewModelId}.${d.targetVariable}`;const b=U(r);let P=V.getFormSchema();if(t.value.source.formId!==C.id){const o=V.externalFormSchema.get(t.value.source.externalContainerId);o!=null&&o.content&&(P=o==null?void 0:o.content)}const{assembleSchemaFieldsByComponent:R,assembleOutline:w,assembleStateVariables:q}=n.sourceCommunication.parameterData;return e.createVNode("div",{class:"param-panel"},[e.createVNode("div",{class:"col-12"},[e.createVNode("div",{class:"farris-group-wrap"},[e.createVNode("div",{class:"form-group farris-form-group"},[e.createVNode("label",{class:"col-form-label",title:"源参数"},[e.createVNode("span",{class:"farris-label-text"},[e.createTextVNode("源参数")])])])])]),e.createVNode(De,{class:"col-12 mb-2",modelValue:d.sourceValue,"onUpdate:modelValue":o=>d.sourceValue=o,fieldData:R(P),formData:w(P),varData:q(P),editorType:"Default",editable:!0},null),e.createVNode(Oe,{label:"目标参数",modelValue:d.statePath,"onUpdate:modelValue":o=>d.statePath=o,customClass:"col-12 mb-2",editor:b,onChange:(o,B)=>z(o,d,B)},null),e.createVNode("div",{class:"d-flex justify-content-end"},[e.createVNode("button",{class:"btn btn-secondary mr-2",onClick:()=>G(r)},[e.createTextVNode("取消")]),e.createVNode("button",{class:"btn btn-primary",onClick:()=>a(r,d)},[e.createTextVNode("确定")])])])}l.expose({addParameter:f,closeAllParameterPanel:g});const O=e.computed(()=>r=>({"param-container":!0,"ml-3":!0,invalid:r}));return()=>u.value.length?u.value.map(r=>{const{displayText:d,displayTextTip:b}=p.value(r),P=x.value[r.targetVariable];return e.createVNode("div",{class:O.value(P)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:b,onClick:()=>S(r)},[d||"请配置参数"]),P?e.createVNode("span",{title:"目标参数已失效,请重新选择"},[e.createVNode("i",{class:"f-icon f-icon-flowline-warning text-danger text-tip"},null)]):"",e.createVNode("div",{class:"remove-icon"},[e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除参数",onClick:R=>h(R,r,d)},null)])]),y.value[r.id]?j(r):""])}):""}}),lo=e.defineComponent({name:"FCommunicationCommandItem",props:be,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,l){const c=e.ref(n.communication),s=e.inject("FMessageBoxService"),t=e.inject("useFormSchema"),u=t.getFormMetadataBasicInfo(),V=e.ref([]),C=e.ref(),k=e.ref(!1),D=e.ref([]),y=e.ref(),x=e.ref(!1),p=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),i=e.computed(()=>{var m,r,d,b;if(!C.value)return"";const j=((m=C.value)==null?void 0:m.name)||((r=C.value)==null?void 0:r.code)||"",O=((d=y.value)==null?void 0:d.name)||((b=y.value)==null?void 0:b.code)||"";return`${j}-${O}`}),v=e.computed(()=>{var b,P,R,w,q,o;if(!C.value)return"";const j=((b=C.value)==null?void 0:b.name)||((P=C.value)==null?void 0:P.code)||"",O=((R=y.value)==null?void 0:R.name)||((w=y.value)==null?void 0:w.code)||"",m=((q=C.value)==null?void 0:q.code)||"",r=((o=y.value)==null?void 0:o.code)||"",d=C.value.containerId?`, 所属外部容器: ${C.value.containerId}`:"";return`${j} (${m}${d})
|
|
3
|
+
${O} (${r})`}),N=e.computed(()=>k.value?"目标表单已失效,请删除当前方法。":x.value?"目标命令已失效,请删除当前方法。":"");function g(){var j,O;if((O=(j=c.value)==null?void 0:j.target)!=null&&O.formId){const m=V.value.find(r=>r.id===c.value.target.formId&&r.containerId===c.value.target.externalContainerId);k.value=!m,C.value=m||{containerId:c.value.target.externalContainerId,id:c.value.target.formId,code:c.value.target.formCode}}else k.value=!1}function f(){var O,m;const j=t.externalFormSchema;Array.from(j.keys()).forEach(r=>{var b,P;const d=j.get(r);((P=(b=c.value)==null?void 0:b.source)==null?void 0:P.externalContainerId)!==r&&V.value.push({containerId:r,id:d.id,code:d.code,name:d.name})}),((m=(O=c.value)==null?void 0:O.source)==null?void 0:m.formId)!==u.id&&V.value.unshift({containerId:"",id:u.id,code:u.code,name:u.name}),g()}function h(){var j,O;if((O=(j=c.value)==null?void 0:j.target)!=null&&O.commandCode){const{commandCode:m,commandViewmodelId:r}=c.value.target,d=D.value.find(b=>b.code===m&&b.viewmodelId===r);y.value=d||{code:c.value.target.commandCode},x.value=!d}else y.value=null,x.value=!1}function S(j){var d,b;const{viewmodels:O,components:m}=j.module;if((O==null?void 0:O.length)===0||(m==null?void 0:m.length)===0)return[];D.value=[];const r=(b=(d=n.sourceCommunication)==null?void 0:d.parameterData)==null?void 0:b.getViewModelName;O.forEach(P=>{if(!P||!P.commands||P.commands.length===0)return[];const R=m.find(q=>q.viewModel===P.id),w=r&&R?r(R,P.name,j):"";D.value.push({id:P.id,code:P.code,name:w||P.name}),P.commands.forEach(q=>{q.isInvalid||D.value.push({...q,viewmodelId:P.id,isCommandNode:!0})})})}function a(){var j,O,m;if(!((j=C.value)!=null&&j.id))return[];if(C.value.id===u.id)S(t.getFormSchema());else{const r=t.externalFormSchema.get((O=C.value)==null?void 0:O.containerId);(m=r==null?void 0:r.content)!=null&&m.module&&S(r.content)}h()}e.onMounted(()=>{f(),a()}),e.watch(()=>n.communication,j=>{p.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,g(),a()},{deep:!0});function G(){l.emit("addParameter")}function z(){s.question(`确定删除命令【${i.value}】吗?`,"",()=>{l.emit("deleteCommand")})}function U(){l.emit("toggleParameterPanel")}return()=>e.createVNode("div",{class:"form-container position-relative"},[i.value&&e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:v.value},[i.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[k.value||x.value?e.createVNode("div",null,[e.createVNode("span",{title:N.value},[e.createVNode("i",{class:"ml-2 f-icon f-icon-flowline-warning text-danger text-tip"},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:j=>z()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:G},null),p.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>U()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:j=>z()},null)])])])])}}),so=e.defineComponent({name:"FCombineForm",props:be,emits:["changed","deleteCommand","addCommand"],setup(n,l){const c=e.inject("useFormSchema"),{saveCommunication:s}=Ce(c),t=e.ref(n.communication),u=e.computed(()=>{var g,f,h,S;return((f=(g=t.value)==null?void 0:g.source)==null?void 0:f.componentId)&&((S=(h=t.value)==null?void 0:h.source)==null?void 0:S.event)}),V=e.ref(!0),C=e.ref(!0),k=e.ref(),D=e.ref();function y(){s(t.value),l.emit("changed",t.value)}function x(){k.value&&k.value.addParameter(),C.value=!1}function p(){l.emit("deleteCommand")}function i(){C.value=!C.value}const v=e.computed(()=>({"d-none":C.value}));function N(){k.value&&k.value.closeAllParameterPanel()}return l.expose({closeAllParameterPanel:N}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[u.value&&e.createVNode(e.Fragment,null,[e.createVNode(lo,{ref:D,communication:t.value,sourceCommunication:n.sourceCommunication,onAddParameter:x,onDeleteCommand:p,onToggleParameterPanel:i},null),V.value&&e.createVNode("div",{class:v.value},[e.createVNode(co,{ref:k,communication:t.value,onChanged:y,sourceCommunication:n.sourceCommunication},null)])])])}}),uo=e.defineComponent({name:"FSelectCommunicationCommand",props:be,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,l){const c=e.inject("useFormSchema"),s=c.getFormMetadataBasicInfo(),t=e.ref([]),u=e.ref(),V=e.ref([]),C=e.ref(),k=e.ref(!0),D=e.ref(!1);function y(){var h;const f=c.externalFormSchema;Array.from(f.keys()).forEach(S=>{var G;const a=f.get(S);((G=n.sourceCommunication)==null?void 0:G.externalContainerId)!==S&&t.value.push({containerId:S,id:a.id,code:a.code,name:a.name})}),((h=n.sourceCommunication)==null?void 0:h.formId)!==s.id&&t.value.unshift({containerId:"",id:s.id,code:s.code,name:s.name})}function x(f){var G,z;const{viewmodels:h,components:S}=f.module;if((h==null?void 0:h.length)===0||(S==null?void 0:S.length)===0)return[];V.value=[];const a=(z=(G=n.sourceCommunication)==null?void 0:G.parameterData)==null?void 0:z.getViewModelName;h.forEach(U=>{if(!U||!U.commands||U.commands.length===0)return[];const j=S.find(m=>m.viewModel===U.id),O=a&&j?a(j,U.name,f):"";V.value.push({id:U.id,code:U.code,name:O||U.name}),U.commands.forEach(m=>{m.isInvalid||V.value.push({...m,viewmodelId:U.id,isCommandNode:!0})})})}function p(){var f,h,S;if(!((f=u.value)!=null&&f.id))return[];if(u.value.id===s.id)x(c.getFormSchema());else{const a=c.externalFormSchema.get((h=u.value)==null?void 0:h.containerId);(S=a==null?void 0:a.content)!=null&&S.module&&x(a.content)}}e.onMounted(()=>{y(),p()});function i(f){u.value=f,k.value=!1,D.value=!0,p()}const v=e.computed(()=>f=>{var h,S;return{item:!0,selected:((h=u.value)==null?void 0:h.id)===f.id&&((S=u.value)==null?void 0:S.containerId)===f.containerId}}),N=e.computed(()=>f=>{var h;return{item:!0,selected:((h=C.value)==null?void 0:h.id)===f.id,"pl-4":f.isCommandNode,disabled:!f.isCommandNode}});function g(f){f.isCommandNode&&(D.value=!1,C.value=f,l.emit("selectCommand",{targetForm:u.value,targetCommand:f}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[k.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),t.value.map(f=>e.createVNode("span",{class:v.value(f),onClick:()=>i(f),title:f.containerId?`所属外部容器:${f.containerId}`:"当前页面"},[f.name]))]),D.value?e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标命令")]),V.value.map(f=>e.createVNode("span",{class:N.value(f),title:f.code,onClick:()=>g(f)},[f.name]))]):""])}}),mo=e.defineComponent({name:"FInteractionItem",props:Ot,emits:["addAction","delete","toggle"],setup(n,l){var Ne,ye;const{guid:c}=ce.useGuid(),s=e.inject("FMessageBoxService"),t=e.inject("useMethodsComposition"),{toggleSelectingMethod:u,emitFinalState:V,getViewModeId:C,getMethodsOnViewModel:k,getComponentList:D,updateTarget:y,updateCommandHasPath:x}=t,p=e.inject("useFormSchema"),{clearCommunicationById:i,resolveSourceControlEventTitle:v,resolveCommunication:N,createNewCommunication:g,saveCommunication:f,resolveCommunicationSource:h}=Ce(p),S=e.ref(n.controllers),a=e.ref(n.interaction),G=e.ref(!1),z=e.computed(()=>{const I=a.value.showSwitch[0];return I.showSection[I.showSwitchNumber][2]}),U=e.ref(n.sourceCommunication.needSelectSourceControl);a.value.shouldShowCommunicationPanel=a.value.shouldShowCommunicationPanel===!1?!1:!!((ye=(Ne=a.value)==null?void 0:Ne.communication)!=null&&ye.length)||U.value;const j=e.computed(()=>{var Q;const I=!!((Q=a.value.command)!=null&&Q.id),_=a.value.showSwitch[0],W=_.showSection[_.showSwitchNumber][3];return I&&W}),O=e.ref(a.value.needSelectCommunicationCommand||!1),m=e.ref(),r=e.ref(),d=e.ref(!1),b=e.ref(),P=e.ref([]);function R(){if(U.value){const I=v(a.value.communication);if(I){const{title:_,titleTip:W,isControlInvalid:Q}=I;m.value=_,r.value=Q?"源表单或事件已失效,请删除":W||_,d.value=Q}}else r.value=a.value.event.label,m.value=a.value.event.name}e.onBeforeMount(()=>{N(a.value),R(),b.value=h(a.value)||n.sourceCommunication});const w=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":j.value||a.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!j.value&&!a.value.shouldShowCommunicationPanel}));function q(){var W,Q;let I=(W=a.value.command)!=null&&W.id?1:0;I=I+(((Q=a.value.communication)==null?void 0:Q.length)||0);const _=`确定删除【${m.value}】吗?`;s.question(_,"",()=>{l.emit("delete",n.displayOrder)})}function o(){var Q;const I=a.value.showSwitch[0],_=!!((Q=a.value.command)!=null&&Q.id);a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!a.value.shouldShowCommunicationPanel),_&&(I.showSection[I.showSwitchNumber][3]=!I.showSection[I.showSwitchNumber][3],l.emit("toggle",n.displayOrder))}function B(){var Q,X;const I=!!((Q=a.value.command)!=null&&Q.id),_=a.value.communication&&a.value.communication.length>0;if(U.value){O.value=!O.value,(X=P.value)!=null&&X.length&&P.value.map(oe=>{oe.closeAllParameterPanel()});return}_&&(a.value.shouldShowCommunicationPanel=!a.value.shouldShowCommunicationPanel);const W=a.value.showSwitch[0];u(W,I),l.emit("addAction",n.displayOrder)}function A(I){const _=a.value.communication!==void 0;I===null&&a.value.command===null&&!_&&l.emit("delete",n.displayOrder),a.value.communication&&(a.value.shouldShowCommunicationPanel=z.value);const W=a.value.showSwitch[0];u(W,_)}function H(I,_,W){let Q=`${_}${W}${I}`,X=-1;const oe=k();for(;X===-1;){let le=!1;for(let de=0;de<oe.length;de++)oe[de].controllerList.forEach(ue=>{ue.label||ue.label===""?le=ue.label.toLowerCase()===Q.toLowerCase()?!0:le:le=!1});if(le)I+=1,Q=`${_}${W}${I}`;else{X=0;break}}return{newName:Q,suffix:I}}function E(I){const{method:_,controller:W}=I,{label:Q,handlerName:X,property:oe,componentLists:le,hasPath:de}=_,ue=C().replace(/-/g,"").replace("component","").replace("viewmodel",""),Me=Q.slice(0,1).toUpperCase()+Q.slice(1),{newName:Te,suffix:Be}=H(1,ue,Me),{controllerName:he}=W,Le=he.id,ke={id:c(),label:Te,name:`${_.name}${Be}`,handlerName:X,hasPath:de,cmpId:Le,property:oe,componentLists:le};a.value.command=x(W,ke),a.value.command&&p.designerMode==="PC_RTC"&&(a.value.command.isRtcCommand=!0),a.value.controller={id:he.id,label:he.label,name:he.name,isCommon:he.isCommon};const Z=a.value.showSwitch[0];Z.showSwitchNumber=2,Z.showSection[Z.showSwitchNumber][2]=!1,Z.showSection[Z.showSwitchNumber][3]=!0,G.value=!0,a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!0),V(!1,null)}function J(){a.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRtcCommand:p.designerMode==="PC_RTC"?!0:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},a.value.controller={label:"",name:"",id:""},V(!0,a.value.event);const I=a.value.showSwitch[0];u(I,!0)}function Y(I,_){var X;if(a.value.communication||(a.value.communication=[]),a.value.communication.find(oe=>{var le,de,ue;return((le=oe.target)==null?void 0:le.formId)===I.formId&&((de=oe.target)==null?void 0:de.externalContainerId)===I.externalContainerId&&((ue=oe.target)==null?void 0:ue.commandCode)===I.commandCode})){new ge.FNotifyService().info({position:"top-center",message:"方法已存在,请勿重复添加。"});return}let Q;a.value.communication.length===1&&!((X=a.value.communication[0].target)!=null&&X.formId)?(Object.assign(a.value.communication[0].target,I),Q=a.value.communication[0]):(Q=g(n,a.value.event.label,I,_),a.value.communication.push(Q)),V(!1,null),f(Q)}function ee(I){var W;const _=a.value.showSwitch[0];if(_.showSection[_.showSwitchNumber][2]=!1,(W=a.value.command)!=null&&W.id&&(_.showSection[_.showSwitchNumber][3]=!0),a.value.shouldShowCommunicationPanel=!0,I){const{selectedCommand:Q,selectedForm:X}=I,oe={formId:(X==null?void 0:X.id)||"",formCode:(X==null?void 0:X.code)||"",externalContainerId:(X==null?void 0:X.containerId)||"",commandCode:(Q==null?void 0:Q.code)||"",commandViewmodelId:(Q==null?void 0:Q.viewmodelId)||""};Y(oe)}}function ie(){const I=a.value.showSwitch[0];I.showSwitchNumber=2,I.showSection[I.showSwitchNumber][2]=!1,I.showSection[I.showSwitchNumber][3]=!0,G.value=!1,a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!0),V(!1,null)}function se(){return e.createVNode(Ht,{controllers:S.value,sourceCommunication:n.sourceCommunication,onClose:A,onSelectMethod:E,onNewFunctionChanged:()=>J(),onAddCommunication:ee,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:ie,event:a.value.event},null)}function te(){const I=a.value.showSwitch[0];I.showSection[I.showSwitchNumber][3]=!1}function ae(I){a.value.command=K.cloneDeep(I),V(!1,null)}function re(I){I.componentLists=D(),y(I),a.value.command=K.cloneDeep(I),V(!1,null)}function Ae(I){var W;const{controller:_}=a.value;_.isCommon||(W=n.viewSourceHandle)==null||W.call(n,{...I,...a.value})}function Re(){a.value.command=null,V(!1,null)}function Ue(){return e.createVNode(Wt,{command:a.value.command,controller:a.value.controller,showParameter:G.value,showDeleteIcon:a.value.communication&&a.value.communication.length>0,onConfirm:()=>te(),onChange:I=>ae(I),onTargetChange:I=>re(I),onViewSource:I=>Ae(I),onDeleteCommand:Re},null)}function Ge(I,_){a.value.communication&&a.value.communication.length>_&&(a.value.communication[_]=I,V(!1,null))}function _e(I,_){var W;a.value.communication&&a.value.communication.length>_&&(a.value.communication.splice(_,1),i(I.id),a.value.communication.length===0&&!((W=a.value.command)!=null&&W.id)?l.emit("delete",n.displayOrder):V(!1,null))}function xe(I,_){const{source:W,target:Q}=I;Y(Q,W),a.value.shouldShowCommunicationPanel=!0}function je(I,_){return e.createVNode(so,{ref:W=>{W&&(P.value[_]=W)},communication:I,event:a.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:W=>Ge(W,_),onDeleteCommand:()=>_e(I,_),onAddCommand:W=>xe(W)},null)}function Ee(I){const{targetForm:_,targetCommand:W}=I,Q={formId:_.id,formCode:_.code,externalContainerId:_.containerId,commandCode:W.code,commandViewmodelId:W.viewmodelId};Y(Q,b.value),a.value.shouldShowCommunicationPanel=!0,O.value=!1,a.value.needSelectCommunicationCommand=!1}function Pe(){return e.createVNode(uo,{sourceCommunication:n.sourceCommunication,onSelectCommand:I=>Ee(I)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:r.value},[m.value]),!d.value&&e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:w.value,style:"font-size: 10px;",onClick:o},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:q},null),!d.value&&e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:B},null),d.value&&e.createVNode("div",{class:"f-icon f-icon-flowline-warning text-danger text-tip",title:"源表单或事件已失效,请删除",style:"float:right; font-size: 13px; margin:8px;"},null)]),z.value&&se(),O.value&&Pe(),j.value&&Ue(),!d.value&&a.value.shouldShowCommunicationPanel&&a.value.communication&&a.value.communication.length>0?a.value.communication.map((I,_)=>je(I,_)):""])}});function fo(n,l,c){const{interactions:s}=l,{setComponentLists:t}=Ze(),u=e.ref(n.value.internalCommandList);function V(m){s.value[m].showSwitch=[],s.value[m].showSwitch.push(K.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),s.value=K.cloneDeep(s.value)}function C(m){var d;const r=[];return(d=n.value.newController)==null||d.forEach(b=>{m.forEach(P=>{b.Code===P.controller.label&&r.push(K.cloneDeep(b))})}),r}function k(m){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(r=>{m.forEach(d=>{var b,P,R,w;if(r.command.id===((b=d.command)==null?void 0:b.id)){r.command.params=K.cloneDeep((P=d.command)==null?void 0:P.property);const q=(R=d.command)==null?void 0:R.targetComponent;(w=d.command)==null||w.componentLists.forEach(o=>{r.targetComponent=o.componentId===q?{id:o.componentId,viewModelId:o.viewModelId}:r.targetComponent})}})}),n.value.repititionCommand}function D(m=!1,r=null){var w;n.value.newFuncEvents=r?K.cloneDeep(r):null,n.value.isAddControllerMethod=m;const d=[],b=K.cloneDeep(n.value.internalCommandList);s.value.map(q=>{const o=K.cloneDeep(q.controller),B=K.cloneDeep(q.command),A=K.cloneDeep(q.event),H=K.cloneDeep(q.communication),E={controller:o,command:B,boundEvents:A,communication:H};d.push(K.cloneDeep(E))});const P=(w=n.value.newController)!=null&&w.length&&d.length?K.cloneDeep(C(d)):[];n.value.repititionCommand&&(n.value.repititionCommand=k(d));const R={viewModelId:n.value.viewModelId,savedCommand:K.cloneDeep(n.value.viewModel),boundEventsList:K.cloneDeep(d),events:K.cloneDeep(n.value.events),internalCommandList:K.cloneDeep(b),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:K.cloneDeep(P),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};c.emit("savedCommandListChanged",R)}function y(m){m.showSection[m.showSwitchNumber][2]=!0}function x(m){m.showSection[m.showSwitchNumber][2]=!1}function p(m){m.showSection[m.showSwitchNumber][3]=!0}function i(m){m.showSection[m.showSwitchNumber][3]=!1}function v(m,r=!1){m.showSection[m.showSwitchNumber][2]?(x(m),r&&p(m)):(y(m),r&&i(m))}function N(){return n.value.componentLists}function g(m){n.value.viewModel.forEach(r=>{for(let d=0;d<r.controllerList.length;d++)r.controllerList[d].label===m.label&&(r.controllerList[d]=K.cloneDeep(m))})}function f(){return n.value.viewModelId}function h(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function S(m,r){return t(m,r,n.value)}function a(m){n.value.newController=n.value.newController||[],n.value.newController.push(K.cloneDeep(m));const r=n.value.newController;for(let d=0;d<r.length;d++)for(let b=d+1;b<r.length;b++)r[d].Id===r[b].Id&&(r.splice(b,1),b--)}function G(m){let r=!1;return n.value.internalCommandList.forEach(d=>{if(d.controllerName.label===m.controllerName.label){r=!0;return}}),r||n.value.internalCommandList.push(m),r}function z(){var m;if((m=n.value)!=null&&m.getEventPath)return n.value.getEventPath()}function U(m,r){s.value.forEach(d=>{var b;((b=d.command)==null?void 0:b.label)===r.label&&(d.command=r)})}function j(m,r){U(m,r)}function O(m,r){const d=s.value[r];m.event=m.event.label?m.event:K.cloneDeep(d.event);let b=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(w=>{w.command.id===m.command.id&&w.event.label===m.event.label&&w.targetComponent.viewModelId===m.targetComponent.viewModelId&&(b=!0),w.command.id===m.command.id&&w.event.label===m.event.label&&w.targetComponent.viewModelId!==m.targetComponent.viewModelId&&(w=K.cloneDeep(m))}),b||n.value.repititionCommand.push(K.cloneDeep(m));let P={id:m.command.id,label:m.command.label,name:m.command.name,handlerName:m.command.handlerName,cmpId:m.controller.id,componentLists:[],hasPath:!1,targetComponent:m.targetComponent.id,property:K.cloneDeep(m.command.params),shortcut:{},isRtcCommand:m.command.isRtcCommand,isNewGenerated:m.command.isNewGenerated||!1,isInvalid:!1};const R={controllerName:m.controller};P=t(R,P,n.value),d.command=K.cloneDeep(P),d.controller=K.cloneDeep(m.controller),j(d,P)}return{controllers:u,onClosed:V,emitFinalState:D,toggleSelectingMethod:v,getViewModeId:f,getComponentList:N,updateTarget:g,updateCommandHasPath:S,addNewController:a,checkIfNewControllerExists:G,getMethodsOnViewModel:h,getEventPath:z,selectBoundCommand:O}}const Se=e.defineComponent({name:"FEventsEditor",props:qe,emits:["savedCommandListChanged"],setup(n,l){const c=e.ref(n.initialData),s=e.inject("designer-host-service"),t=Lt(c),{loadEvents:u,resetBoundEvents:V}=t,C=e.inject("useFormSchema"),k=Bt(C,t),{addNewInteraction:D,deleteInteracton:y,interactions:x,loadInteractions:p}=k,i=fo(c,k,l),{emitFinalState:v,controllers:N}=i;e.provide("useEventsComposition",t),e.provide("useInteractionCompostion",k),e.provide("useMethodsComposition",i);function g(){c.value.isAddControllerMethod=!1}function f(){var j,O;const U=(O=(j=c.value)==null?void 0:j.sourceCommunication)==null?void 0:O.externalContainerId;if(U){const{assembleSourceOutline:m}=Ce(C),r=m(s,l,U);e.provide("sourceOutlineData",r)}}e.onMounted(()=>{g(),V(),u(),p(),f()});function h(U){y(U),v(!1,null)}function S(U,j){const O=U.showSwitch[0],m=O.showSection[O.showSwitchNumber][3];let r=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?r=!0:r=!1),e.createVNode(mo,{key:`${j}`,controllers:N.value,interaction:U,displayOrder:j,collapsed:m,onDelete:h,sourceCommunication:c.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:r},null)}function a(){var U;return(U=x.value)==null?void 0:U.map((j,O)=>{var r;let m=j.event.label;return(r=j.communication)!=null&&r.length&&(m=`${j.communication.map(b=>b.id).join("-")}_${m}`),e.createVNode("div",{class:"events-display-order",key:`${m}_${O}`},[S(j,O)])})}function G(U){D(U)}function z(U){const j=U.source;if(x.value.find(m=>{var r;if((r=m.communication)!=null&&r.length&&m.communication.find(b=>{var P,R,w;return((P=b.source)==null?void 0:P.formId)===j.formId&&((R=b.source)==null?void 0:R.componentId)===j.componentId&&((w=b.source)==null?void 0:w.event)===j.event}))return!0})){new ge.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}D({label:"onCommunication",name:"组件通讯"},U)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(qt,{sourceCommunication:c.value.sourceCommunication,onClickEventItem:G,onSelectSourceControl:z},null),a()])])}}),po={install(n){n.component(Se.name,Se)},register(n,l,c,s){n["events-editor"]=Se,l["events-editor"]=Xe}};F.FEventsEditor=Se,F.default=po,F.eventsEditorProps=qe,F.propsResolver=Xe,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.expression-editor{border:1px solid #cccccc}.expression-editor .layout-border{border:1px solid #cccccc;border-top:0;border-bottom:0;box-shadow:none!important}.expression-editor .expression-left .search-bar{justify-content:center}.expression-editor .expression-left .layout-border{border:0}.expression-editor .functions-list .empty-message{color:#ccc;text-align:center;margin-top:10px;-webkit-user-select:none;user-select:none}.expression-editor .functions-list .functions-type{overflow:hidden;transition:all .2s ease-in}.expression-editor .functions-list .functions-type.open{max-height:1300px}.expression-editor .functions-list .functions-type.closed{max-height:28px}.expression-editor .functions-list .functions-type .functions-type-name{cursor:pointer;height:28px;line-height:28px;font-weight:700}.expression-editor .functions-list .functions-type .functions-type-name:hover{background:#e7f1ff;border-radius:6px}.expression-editor .functions-list .functions-type li{height:28px;line-height:28px;list-style:none}.expression-editor .functions-list .functions-type .functions-item{cursor:pointer}.expression-editor .functions-list .functions-type .functions-item.selected{background:#dae9ff;border-radius:6px}.expression-editor .functions-list .functions-type .functions-item:hover:not(.selected){background:#e7f1ff;border-radius:6px}.expression-editor .function-remark{resize:none;outline:none;background:#f4f4f4;border:1px solid #cbcbcb;border-left:0;border-bottom:0;border-right:0;color:#4682b4}.expression-editor .entity-variable ul{list-style:none}.expression-editor .entity-variable ul li.list-group{overflow:hidden;transition:all .2s ease-in}.expression-editor .entity-variable ul li.list-group.expand{max-height:calc(100% - 32px)}.expression-editor .entity-variable ul li.list-group.collapse{max-height:32px}.expression-editor .entity-variable ul li.list-group .title{cursor:pointer;border-bottom:1px solid #d9d9d9;justify-content:space-between;background:#f7f8fb;height:32px;min-height:32px;font-weight:700;line-height:32px}.expression-editor .entity-variable ul li.list-group .data-area{background-color:#fff}.expression-editor .monaco-editor .suggest-widget{z-index:9999!important}.expression-editor .fv-grid-row-selected .entity-field .d-none,.expression-editor .entity-field:hover .d-none{display:block!important}.expression-editor .expression-code-editor{position:fixed;z-index:201}.expression-editor .f-layout-horizontal-resize-proxy,.expression-editor .f-layout-vertical-resize-proxy{z-index:300!important}
|
|
1
|
+
@charset "UTF-8";.fade-enter-active,.fade-leave-active{transition:opacity .5s ease}.fade-enter-from,.fade-leave-to{opacity:0}.fv-resizable-handle{position:absolute;font-size:.1px;display:block;touch-action:none}.fv-resizable-handle:hover{background:transparent}.fv-resizable-handle.fv-resizable-n{cursor:n-resize;height:.4375rem;width:100%;top:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-e{cursor:e-resize;width:.4375rem;right:-.3125rem;height:100%;top:0}.fv-resizable-handle.fv-resizable-s{cursor:s-resize;height:.4375rem;width:100%;bottom:-.3125rem;left:0}.fv-resizable-handle.fv-resizable-w{cursor:w-resize;height:100%;width:.4375rem;left:-.3125rem;top:0}.fv-resizable-handle.fv-resizable-ne{cursor:ne-resize;width:.75rem;height:.75rem;right:1px;top:1px}.fv-resizable-handle.fv-resizable-se{cursor:se-resize;width:.75rem;height:.75rem;right:1px;bottom:1px}.fv-resizable-handle.fv-resizable-nw{cursor:nw-resize;width:.75rem;height:.75rem;left:1px;top:1px}.fv-resizable-handle.fv-resizable-sw{cursor:sw-resize;width:.75rem;height:.75rem;left:1px;bottom:1px}.expression-editor{border:1px solid #cccccc}.expression-editor .layout-border{border:1px solid #cccccc;border-top:0;border-bottom:0;box-shadow:none!important}.expression-editor .expression-left .search-bar{justify-content:center}.expression-editor .expression-left .layout-border{border:0}.expression-editor .functions-list .empty-message{color:#ccc;text-align:center;margin-top:10px;-webkit-user-select:none;user-select:none}.expression-editor .functions-list .functions-type{overflow:hidden;transition:all .2s ease-in}.expression-editor .functions-list .functions-type.open{max-height:1300px}.expression-editor .functions-list .functions-type.closed{max-height:28px}.expression-editor .functions-list .functions-type .functions-type-name{cursor:pointer;height:28px;line-height:28px;font-weight:700}.expression-editor .functions-list .functions-type .functions-type-name:hover{background:#e7f1ff;border-radius:6px}.expression-editor .functions-list .functions-type li{height:28px;line-height:28px;list-style:none}.expression-editor .functions-list .functions-type .functions-item{cursor:pointer}.expression-editor .functions-list .functions-type .functions-item.selected{background:#dae9ff;border-radius:6px}.expression-editor .functions-list .functions-type .functions-item:hover:not(.selected){background:#e7f1ff;border-radius:6px}.expression-editor .function-remark{resize:none;outline:none;background:#f4f4f4;border:1px solid #cbcbcb;border-left:0;border-bottom:0;border-right:0;color:#4682b4}.expression-editor .entity-variable ul{list-style:none}.expression-editor .entity-variable ul li.list-group{overflow:hidden;transition:all .2s ease-in}.expression-editor .entity-variable ul li.list-group.expand{max-height:calc(100% - 32px)}.expression-editor .entity-variable ul li.list-group.collapse{max-height:32px}.expression-editor .entity-variable ul li.list-group .title{cursor:pointer;border-bottom:1px solid #d9d9d9;justify-content:space-between;background:#f7f8fb;height:32px;min-height:32px;font-weight:700;line-height:32px}.expression-editor .entity-variable ul li.list-group .data-area{background-color:#fff}.expression-editor .monaco-editor .suggest-widget{z-index:9999!important}.expression-editor .fv-grid-row-selected .entity-field .d-none,.expression-editor .entity-field:hover .d-none{display:block!important}.expression-editor .expression-code-editor{position:fixed;z-index:201}.expression-editor .f-layout-horizontal-resize-proxy,.expression-editor .f-layout-vertical-resize-proxy{z-index:300!important}
|