yc-agent-ui 1.2.7 → 1.2.10
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/es/components/chart/src/chart-card.vue.d.ts +21 -21
- package/es/components/chart/src/chart-container.vue.d.ts +2 -2
- package/es/components/chart/src/metric-card.vue.d.ts +1 -1
- package/es/components/data-table/src/data-table.vue.d.ts +10 -10
- package/es/components/descriptions/index.d.ts +9 -9
- package/es/components/descriptions/src/index.vue.d.ts +3 -3
- package/es/components/dialog/index.d.ts +6 -6
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +10 -10
- package/es/components/dialog-form/src/index.vue.d.ts +6 -6
- package/es/components/display-item/index.d.ts +12 -12
- package/es/components/display-item/src/index.vue.d.ts +12 -12
- package/es/components/drawer-form/index.d.ts +19 -19
- package/es/components/drawer-form/src/index.vue.d.ts +9 -9
- package/es/components/form/index.d.ts +45 -45
- package/es/components/form/src/form-content.vue.d.ts +18 -18
- package/es/components/form/src/index.vue.d.ts +21 -21
- package/es/components/form-item/index.d.ts +43 -43
- package/es/components/form-item/src/index.vue.d.ts +18 -18
- package/es/components/input-tag/index.d.ts +3 -3
- package/es/components/input-tag/src/index.vue.d.ts +3 -3
- package/es/components/page/index.d.ts +1160 -1160
- package/es/components/page/src/index.vue.d.ts +391 -391
- package/es/components/pagination/index.d.ts +3 -3
- package/es/components/pagination/src/index.vue.d.ts +1 -1
- package/es/components/radio/index.d.ts +5 -5
- package/es/components/radio/src/index.vue.d.ts +5 -5
- package/es/components/render/index.d.ts +1 -1
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +308 -308
- package/es/components/search/src/index.vue.d.ts +106 -106
- package/es/components/table/index.d.ts +18 -18
- package/es/components/table/src/index.vue.d.ts +2 -2
- package/es/components/table/src/table-action-bar.vue.d.ts +2 -2
- package/es/components/table/src/table-column.vue.d.ts +24 -24
- package/es/components/utils/index.d.ts +3 -3
- package/es/components/virtual-table/index.d.ts +13 -13
- package/es/components/virtual-table/src/index.vue.d.ts +4 -4
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +2 -2
- package/es/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/select.vue.d.ts +5 -5
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +2 -2
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +3 -3
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
- package/es/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
- package/es/components/yc-controls/src/segmented.vue.d.ts +1 -1
- package/es/components/yc-coss-table/src/coss-table.vue.d.ts +6 -6
- package/es/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
- package/es/components/yc-coss-table/src/table.vue.d.ts +1 -1
- package/es/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
- package/es/components/yc-display-cards/index.d.ts +221 -5
- package/es/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
- package/es/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
- package/es/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
- package/es/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
- package/es/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
- package/es/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
- package/es/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
- package/es/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
- package/es/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
- package/es/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
- package/es/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
- package/es/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
- package/es/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
- package/es/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
- package/es/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
- package/es/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
- package/es/components/yc-display-cards/src/form-card.vue.d.ts +7 -3
- package/es/components/yc-display-cards/src/table-card.vue.d.ts +2 -3
- package/es/components/yc-display-cards/src/types.d.ts +190 -0
- package/es/components/yc-feedback/src/banner.vue.d.ts +1 -1
- package/es/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
- package/es/components/yc-gradient-card/src/index.vue.d.ts +2 -2
- package/es/components/yc-input/src/input.vue.d.ts +5 -5
- package/es/components/yc-input/src/money-input.vue.d.ts +4 -4
- package/es/components/yc-input/src/stepper-input.vue.d.ts +3 -3
- package/es/components/yc-input/src/textarea.vue.d.ts +3 -3
- package/es/components/yc-input-otp/src/index.vue.d.ts +3 -3
- package/es/components/yc-pagination/src/index.vue.d.ts +2 -2
- package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
- package/es/components/yc-plus-page/src/index.vue.d.ts +1180 -1180
- package/es/components/yc-plus-tree/src/index.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/device-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/order-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/property-table.vue.d.ts +8 -8
- package/es/components/yc-questionnaire/src/index.vue.d.ts +1 -1
- package/es/components/yc-select-v2/src/index.vue.d.ts +4 -4
- package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/es/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/es/hooks/usePlusFormReset.d.ts +168 -168
- package/es/index.css +29 -16
- package/es/index.mjs +3 -1
- package/es/packages/components/index.mjs +3 -1
- package/es/packages/components/yc-display-cards/capability.mjs +57 -1
- package/es/packages/components/yc-display-cards/index.mjs +31 -1
- package/es/packages/components/yc-display-cards/src/card-renderer.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/card-renderer2.vue.mjs +295 -0
- package/es/packages/components/yc-display-cards/src/detail-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/detail-card2.vue.mjs +28 -94
- package/es/packages/components/yc-display-cards/src/elements/action-bar.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/action-bar2.vue.mjs +38 -0
- package/es/packages/components/yc-display-cards/src/elements/card-shell.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/card-shell2.vue.mjs +85 -0
- package/es/packages/components/yc-display-cards/src/elements/choice-group.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/choice-group2.vue.mjs +57 -0
- package/es/packages/components/yc-display-cards/src/elements/data-table.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/data-table2.vue.mjs +184 -0
- package/es/packages/components/yc-display-cards/src/elements/field-control.vue.mjs +5 -0
- package/es/packages/components/yc-display-cards/src/elements/field-control2.vue.mjs +92 -0
- package/es/packages/components/yc-display-cards/src/elements/field-utils.mjs +121 -0
- package/es/packages/components/yc-display-cards/src/elements/form-field.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/form-field2.vue.mjs +68 -0
- package/es/packages/components/yc-display-cards/src/elements/inline-alert.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/inline-alert2.vue.mjs +29 -0
- package/es/packages/components/yc-display-cards/src/elements/input.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/input2.vue.mjs +142 -0
- package/es/packages/components/yc-display-cards/src/elements/kv-list.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/kv-list2.vue.mjs +63 -0
- package/es/packages/components/yc-display-cards/src/elements/metric-grid.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/metric-grid2.vue.mjs +97 -0
- package/es/packages/components/yc-display-cards/src/elements/status-tag.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/status-tag2.vue.mjs +25 -0
- package/es/packages/components/yc-display-cards/src/elements/switch.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/switch2.vue.mjs +35 -0
- package/es/packages/components/yc-display-cards/src/elements/upload.vue.mjs +6 -0
- package/es/packages/components/yc-display-cards/src/elements/upload2.vue.mjs +196 -0
- package/es/packages/components/yc-display-cards/src/elements/use-card-form.mjs +80 -0
- package/es/packages/components/yc-display-cards/src/form-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/form-card2.vue.mjs +171 -783
- package/es/packages/components/yc-display-cards/src/metrics-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/metrics-card2.vue.mjs +19 -114
- package/es/packages/components/yc-display-cards/src/table-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/table-card2.vue.mjs +50 -232
- package/es/packages/components/yc-status-dialog/src/index.vue.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +20 -7
- package/index.js +2235 -1546
- package/index.min.css +19 -6
- package/index.min.js +37 -37
- package/index.min.mjs +36 -36
- package/index.mjs +2215 -1545
- package/lib/components/chart/src/chart-card.vue.d.ts +21 -21
- package/lib/components/chart/src/chart-container.vue.d.ts +2 -2
- package/lib/components/chart/src/metric-card.vue.d.ts +1 -1
- package/lib/components/data-table/src/data-table.vue.d.ts +10 -10
- package/lib/components/descriptions/index.d.ts +9 -9
- package/lib/components/descriptions/src/index.vue.d.ts +3 -3
- package/lib/components/dialog/index.d.ts +6 -6
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +10 -10
- package/lib/components/dialog-form/src/index.vue.d.ts +6 -6
- package/lib/components/display-item/index.d.ts +12 -12
- package/lib/components/display-item/src/index.vue.d.ts +12 -12
- package/lib/components/drawer-form/index.d.ts +19 -19
- package/lib/components/drawer-form/src/index.vue.d.ts +9 -9
- package/lib/components/form/index.d.ts +45 -45
- package/lib/components/form/src/form-content.vue.d.ts +18 -18
- package/lib/components/form/src/index.vue.d.ts +21 -21
- package/lib/components/form-item/index.d.ts +43 -43
- package/lib/components/form-item/src/index.vue.d.ts +18 -18
- package/lib/components/input-tag/index.d.ts +3 -3
- package/lib/components/input-tag/src/index.vue.d.ts +3 -3
- package/lib/components/page/index.d.ts +1160 -1160
- package/lib/components/page/src/index.vue.d.ts +391 -391
- package/lib/components/pagination/index.d.ts +3 -3
- package/lib/components/pagination/src/index.vue.d.ts +1 -1
- package/lib/components/radio/index.d.ts +5 -5
- package/lib/components/radio/src/index.vue.d.ts +5 -5
- package/lib/components/render/index.d.ts +1 -1
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +308 -308
- package/lib/components/search/src/index.vue.d.ts +106 -106
- package/lib/components/table/index.d.ts +18 -18
- package/lib/components/table/src/index.vue.d.ts +2 -2
- package/lib/components/table/src/table-action-bar.vue.d.ts +2 -2
- package/lib/components/table/src/table-column.vue.d.ts +24 -24
- package/lib/components/utils/index.d.ts +3 -3
- package/lib/components/virtual-table/index.d.ts +13 -13
- package/lib/components/virtual-table/src/index.vue.d.ts +4 -4
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +2 -2
- package/lib/components/yc-ai-chat/src/file-card.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/select.vue.d.ts +5 -5
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +2 -2
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +3 -3
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
- package/lib/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
- package/lib/components/yc-controls/src/segmented.vue.d.ts +1 -1
- package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +6 -6
- package/lib/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
- package/lib/components/yc-coss-table/src/table.vue.d.ts +1 -1
- package/lib/components/yc-date-picker/src/date-picker.vue.d.ts +1 -1
- package/lib/components/yc-display-cards/index.d.ts +221 -5
- package/lib/components/yc-display-cards/src/card-renderer.vue.d.ts +16 -0
- package/lib/components/yc-display-cards/src/elements/action-bar.vue.d.ts +12 -0
- package/lib/components/yc-display-cards/src/elements/card-shell.vue.d.ts +24 -0
- package/lib/components/yc-display-cards/src/elements/choice-group.vue.d.ts +14 -0
- package/lib/components/yc-display-cards/src/elements/data-table.vue.d.ts +10 -0
- package/lib/components/yc-display-cards/src/elements/field-control.vue.d.ts +22 -0
- package/lib/components/yc-display-cards/src/elements/field-utils.d.ts +16 -0
- package/lib/components/yc-display-cards/src/elements/form-field.vue.d.ts +18 -0
- package/lib/components/yc-display-cards/src/elements/inline-alert.vue.d.ts +14 -0
- package/lib/components/yc-display-cards/src/elements/input.vue.d.ts +20 -0
- package/lib/components/yc-display-cards/src/elements/kv-list.vue.d.ts +8 -0
- package/lib/components/yc-display-cards/src/elements/metric-grid.vue.d.ts +7 -0
- package/lib/components/yc-display-cards/src/elements/status-tag.vue.d.ts +6 -0
- package/lib/components/yc-display-cards/src/elements/switch.vue.d.ts +10 -0
- package/lib/components/yc-display-cards/src/elements/upload.vue.d.ts +17 -0
- package/lib/components/yc-display-cards/src/elements/use-card-form.d.ts +23 -0
- package/lib/components/yc-display-cards/src/form-card.vue.d.ts +7 -3
- package/lib/components/yc-display-cards/src/table-card.vue.d.ts +2 -3
- package/lib/components/yc-display-cards/src/types.d.ts +190 -0
- package/lib/components/yc-feedback/src/banner.vue.d.ts +1 -1
- package/lib/components/yc-feedback/src/key-value-list.vue.d.ts +1 -1
- package/lib/components/yc-gradient-card/src/index.vue.d.ts +2 -2
- package/lib/components/yc-input/src/input.vue.d.ts +5 -5
- package/lib/components/yc-input/src/money-input.vue.d.ts +4 -4
- package/lib/components/yc-input/src/stepper-input.vue.d.ts +3 -3
- package/lib/components/yc-input/src/textarea.vue.d.ts +3 -3
- package/lib/components/yc-input-otp/src/index.vue.d.ts +3 -3
- package/lib/components/yc-pagination/src/index.vue.d.ts +2 -2
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +8 -8
- package/lib/components/yc-plus-page/src/index.vue.d.ts +1180 -1180
- package/lib/components/yc-plus-tree/src/index.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/device-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/order-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/property-table.vue.d.ts +8 -8
- package/lib/components/yc-questionnaire/src/index.vue.d.ts +1 -1
- package/lib/components/yc-select-v2/src/index.vue.d.ts +4 -4
- package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/lib/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/lib/hooks/usePlusFormReset.d.ts +168 -168
- package/lib/index.css +28 -15
- package/lib/index.js +28 -7
- package/lib/packages/components/index.js +28 -7
- package/lib/packages/components/yc-display-cards/capability.js +56 -0
- package/lib/packages/components/yc-display-cards/index.js +49 -0
- package/lib/packages/components/yc-display-cards/src/card-renderer.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/card-renderer2.vue.js +299 -0
- package/lib/packages/components/yc-display-cards/src/detail-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/detail-card2.vue.js +27 -93
- package/lib/packages/components/yc-display-cards/src/elements/action-bar.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/action-bar2.vue.js +42 -0
- package/lib/packages/components/yc-display-cards/src/elements/card-shell.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/card-shell2.vue.js +89 -0
- package/lib/packages/components/yc-display-cards/src/elements/choice-group.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/choice-group2.vue.js +61 -0
- package/lib/packages/components/yc-display-cards/src/elements/data-table.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/data-table2.vue.js +188 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-control.vue.js +9 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-control2.vue.js +96 -0
- package/lib/packages/components/yc-display-cards/src/elements/field-utils.js +134 -0
- package/lib/packages/components/yc-display-cards/src/elements/form-field.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/form-field2.vue.js +72 -0
- package/lib/packages/components/yc-display-cards/src/elements/inline-alert.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/inline-alert2.vue.js +33 -0
- package/lib/packages/components/yc-display-cards/src/elements/input.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/input2.vue.js +146 -0
- package/lib/packages/components/yc-display-cards/src/elements/kv-list.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/kv-list2.vue.js +67 -0
- package/lib/packages/components/yc-display-cards/src/elements/metric-grid.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/metric-grid2.vue.js +101 -0
- package/lib/packages/components/yc-display-cards/src/elements/status-tag.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/status-tag2.vue.js +29 -0
- package/lib/packages/components/yc-display-cards/src/elements/switch.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/switch2.vue.js +39 -0
- package/lib/packages/components/yc-display-cards/src/elements/upload.vue.js +10 -0
- package/lib/packages/components/yc-display-cards/src/elements/upload2.vue.js +200 -0
- package/lib/packages/components/yc-display-cards/src/elements/use-card-form.js +82 -0
- package/lib/packages/components/yc-display-cards/src/form-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/form-card2.vue.js +170 -782
- package/lib/packages/components/yc-display-cards/src/metrics-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/metrics-card2.vue.js +18 -113
- package/lib/packages/components/yc-display-cards/src/table-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/table-card2.vue.js +49 -231
- package/lib/packages/components/yc-status-dialog/src/index.vue.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +20 -7
- package/theme-chalk/plus-dialog.css +1 -1
- package/theme-chalk/plus-yc-status-dialog.css +1 -1
- package/theme-chalk/src/dialog.scss +0 -6
- package/theme-chalk/src/index.scss +1 -2
- package/theme-chalk/src/yc-status-dialog.scss +2 -2
|
@@ -3,87 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var actionBar = require('./elements/action-bar.vue.js');
|
|
7
|
+
var cardShell = require('./elements/card-shell.vue.js');
|
|
8
|
+
var dataTable = require('./elements/data-table.vue.js');
|
|
9
|
+
var fieldControl_vue_vue_type_script_setup_true_lang = require('./elements/field-control2.vue.js');
|
|
10
|
+
var inlineAlert = require('./elements/inline-alert.vue.js');
|
|
11
|
+
var kvList = require('./elements/kv-list.vue.js');
|
|
12
|
+
var fieldUtils = require('./elements/field-utils.js');
|
|
13
|
+
var useCardForm = require('./elements/use-card-form.js');
|
|
6
14
|
|
|
7
|
-
const _hoisted_1 = {
|
|
8
|
-
const _hoisted_2 = { class: "yc-display-card__title-wrap yc-display-form-card__title-group" };
|
|
9
|
-
const _hoisted_3 = { class: "yc-display-form-card__titles" };
|
|
10
|
-
const _hoisted_4 = { class: "yc-display-card__title" };
|
|
11
|
-
const _hoisted_5 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "yc-display-card__subtitle"
|
|
14
|
-
};
|
|
15
|
-
const _hoisted_6 = {
|
|
15
|
+
const _hoisted_1 = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "yc-display-form-card__loading"
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const _hoisted_2 = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "yc-display-form-card__body"
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const _hoisted_3 = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "yc-display-form-card__grid"
|
|
26
26
|
};
|
|
27
|
-
const _hoisted_9 = { class: "yc-display-form-card__label" };
|
|
28
|
-
const _hoisted_10 = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "is-required"
|
|
31
|
-
};
|
|
32
|
-
const _hoisted_11 = ["value", "disabled", "onFocus", "onChange"];
|
|
33
|
-
const _hoisted_12 = { value: "" };
|
|
34
|
-
const _hoisted_13 = ["value"];
|
|
35
|
-
const _hoisted_14 = ["type", "value", "disabled", "onInput"];
|
|
36
|
-
const _hoisted_15 = ["step", "inputmode", "value", "disabled", "placeholder", "onInput"];
|
|
37
|
-
const _hoisted_16 = ["aria-checked", "disabled", "onClick"];
|
|
38
|
-
const _hoisted_17 = {
|
|
39
|
-
key: 4,
|
|
40
|
-
class: "yc-display-form-card__upload"
|
|
41
|
-
};
|
|
42
|
-
const _hoisted_18 = ["accept", "onChange"];
|
|
43
|
-
const _hoisted_19 = { class: "yc-display-form-card__upload-list" };
|
|
44
|
-
const _hoisted_20 = {
|
|
45
|
-
key: 0,
|
|
46
|
-
class: "yc-display-form-card__thumb"
|
|
47
|
-
};
|
|
48
|
-
const _hoisted_21 = ["src", "alt"];
|
|
49
|
-
const _hoisted_22 = ["onClick"];
|
|
50
|
-
const _hoisted_23 = {
|
|
51
|
-
key: 1,
|
|
52
|
-
class: "yc-display-form-card__file-chip"
|
|
53
|
-
};
|
|
54
|
-
const _hoisted_24 = { class: "yc-display-form-card__file-name" };
|
|
55
|
-
const _hoisted_25 = ["onClick"];
|
|
56
|
-
const _hoisted_26 = ["disabled", "onClick"];
|
|
57
|
-
const _hoisted_27 = { key: 0 };
|
|
58
|
-
const _hoisted_28 = { key: 1 };
|
|
59
|
-
const _hoisted_29 = ["value", "disabled", "placeholder", "onInput"];
|
|
60
|
-
const _hoisted_30 = ["value", "disabled", "placeholder", "onInput"];
|
|
61
|
-
const _hoisted_31 = { class: "yc-display-form-card__actions" };
|
|
62
|
-
const _hoisted_32 = ["disabled"];
|
|
63
|
-
const _hoisted_33 = ["disabled"];
|
|
64
|
-
const _hoisted_34 = {
|
|
65
|
-
key: 1,
|
|
66
|
-
class: "yc-display-form-card__alert is-error"
|
|
67
|
-
};
|
|
68
|
-
const _hoisted_35 = {
|
|
69
|
-
key: 2,
|
|
70
|
-
class: "yc-display-form-card__alert is-success"
|
|
71
|
-
};
|
|
72
|
-
const _hoisted_36 = {
|
|
73
|
-
key: 3,
|
|
74
|
-
class: "yc-display-form-card__result"
|
|
75
|
-
};
|
|
76
|
-
const _hoisted_37 = {
|
|
77
|
-
key: 0,
|
|
78
|
-
class: "yc-display-form-card__table-wrap"
|
|
79
|
-
};
|
|
80
|
-
const _hoisted_38 = { class: "yc-display-form-card__table" };
|
|
81
|
-
const _hoisted_39 = {
|
|
82
|
-
key: 1,
|
|
83
|
-
class: "yc-display-form-card__kv"
|
|
84
|
-
};
|
|
85
|
-
const _hoisted_40 = { class: "yc-display-form-card__kv-label" };
|
|
86
|
-
const _hoisted_41 = { class: "yc-display-form-card__kv-value" };
|
|
87
27
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
88
28
|
...{ name: "YcDisplayFormCard" },
|
|
89
29
|
__name: "form-card",
|
|
@@ -99,9 +39,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
99
39
|
compact: { type: Boolean, default: false },
|
|
100
40
|
skillName: { default: "" },
|
|
101
41
|
executeAction: { type: Function, default: void 0 },
|
|
102
|
-
uploadFile: { type: Function, default: void 0 }
|
|
42
|
+
uploadFile: { type: Function, default: void 0 },
|
|
43
|
+
submitReply: { type: Function, default: void 0 },
|
|
44
|
+
inlineFeedback: { type: Boolean, default: true }
|
|
103
45
|
},
|
|
104
|
-
emits: ["action"],
|
|
46
|
+
emits: ["action", "feedback"],
|
|
105
47
|
setup(__props, { emit: __emit }) {
|
|
106
48
|
const props = __props;
|
|
107
49
|
const emit = __emit;
|
|
@@ -109,801 +51,247 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
109
51
|
const schemaReadOnly = vue.ref(null);
|
|
110
52
|
const loadedFields = vue.ref([]);
|
|
111
53
|
const loadingSchema = vue.ref(false);
|
|
54
|
+
const loadingOptions = vue.ref({});
|
|
112
55
|
const executing = vue.ref(false);
|
|
56
|
+
const replySent = vue.ref(false);
|
|
113
57
|
const errorMessage = vue.ref("");
|
|
114
|
-
const
|
|
58
|
+
const successMessage = vue.ref("");
|
|
115
59
|
const resultData = vue.ref(null);
|
|
116
60
|
const hasExecuted = vue.ref(false);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
61
|
+
const form = useCardForm.useCardForm(
|
|
62
|
+
vue.computed(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
return ((_a = props.fields) == null ? void 0 : _a.length) ? props.fields : loadedFields.value;
|
|
65
|
+
}),
|
|
66
|
+
vue.computed(() => props.values)
|
|
67
|
+
);
|
|
124
68
|
const resolvedMode = vue.computed(() => {
|
|
125
|
-
if (props.mode
|
|
126
|
-
if (props.mode === "submit") return "submit";
|
|
127
|
-
if (props.mode === "query") return "query";
|
|
69
|
+
if (props.mode) return props.mode;
|
|
128
70
|
return schemaReadOnly.value === false ? "submit" : "query";
|
|
129
71
|
});
|
|
130
|
-
const cardTitle = vue.computed(
|
|
131
|
-
var _a;
|
|
132
|
-
if ((_a = props.title) == null ? void 0 : _a.trim()) return props.title.trim();
|
|
133
|
-
if (schemaTitle.value) return schemaTitle.value;
|
|
134
|
-
return props.skillName || "\u4E1A\u52A1\u8868\u5355";
|
|
135
|
-
});
|
|
136
|
-
const cardSubtitle = vue.computed(
|
|
72
|
+
const cardTitle = vue.computed(
|
|
137
73
|
() => {
|
|
138
74
|
var _a;
|
|
139
|
-
return ((_a = props.
|
|
75
|
+
return ((_a = props.title) == null ? void 0 : _a.trim()) || schemaTitle.value || props.skillName || "\u4E1A\u52A1\u8868\u5355";
|
|
140
76
|
}
|
|
141
77
|
);
|
|
142
|
-
const resolvedSubmitLabel = vue.computed(() => {
|
|
143
|
-
var _a;
|
|
144
|
-
if ((_a = props.submitLabel) == null ? void 0 : _a.trim()) return props.submitLabel.trim();
|
|
145
|
-
return resolvedMode.value === "query" ? "\u67E5\u8BE2" : "\u63D0\u4EA4";
|
|
146
|
-
});
|
|
147
78
|
const canExecute = vue.computed(
|
|
148
79
|
() => {
|
|
149
80
|
var _a;
|
|
150
81
|
return resolvedMode.value === "reply" ? !replySent.value : Boolean(((_a = props.operation) == null ? void 0 : _a.trim()) && props.executeAction);
|
|
151
82
|
}
|
|
152
83
|
);
|
|
153
|
-
|
|
154
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
155
|
-
}
|
|
156
|
-
function normalizeInlineOptions(raw) {
|
|
84
|
+
const actions = vue.computed(() => {
|
|
157
85
|
var _a;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return options.length ? options : void 0;
|
|
171
|
-
}
|
|
172
|
-
const inlineFields = vue.computed(() => {
|
|
173
|
-
if (!Array.isArray(props.fields)) return [];
|
|
174
|
-
return props.fields.filter((item) => Boolean(item) && typeof item === "object" && Boolean(item.name)).map((item) => {
|
|
175
|
-
var _a;
|
|
176
|
-
return {
|
|
177
|
-
...item,
|
|
178
|
-
name: String(item.name),
|
|
179
|
-
label: String((_a = item.label) != null ? _a : item.name),
|
|
180
|
-
visible: item.visible !== false
|
|
181
|
-
};
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
const visibleFields = vue.computed(() => {
|
|
185
|
-
const source = inlineFields.value.length > 0 ? inlineFields.value : loadedFields.value;
|
|
186
|
-
return source.filter((field) => field.visible !== false);
|
|
86
|
+
return [
|
|
87
|
+
{
|
|
88
|
+
key: "submit",
|
|
89
|
+
label: ((_a = props.submitLabel) == null ? void 0 : _a.trim()) || (resolvedMode.value === "query" ? "\u67E5\u8BE2" : "\u63D0\u4EA4"),
|
|
90
|
+
primary: true,
|
|
91
|
+
disabled: !canExecute.value
|
|
92
|
+
},
|
|
93
|
+
{ key: "reset", label: "\u91CD\u7F6E", disabled: replySent.value }
|
|
94
|
+
];
|
|
187
95
|
});
|
|
188
|
-
function isSelectField(field) {
|
|
189
|
-
var _a, _b;
|
|
190
|
-
return Boolean(
|
|
191
|
-
field.widget === "select" || field.options_operation || ((_a = field.options) == null ? void 0 : _a.length) || ((_b = field.enum) == null ? void 0 : _b.length)
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
function isDateField(field) {
|
|
195
|
-
return field.widget === "date" || field.widget === "datetime";
|
|
196
|
-
}
|
|
197
|
-
function isNumberField(field) {
|
|
198
|
-
return field.type === "number" || field.type === "integer";
|
|
199
|
-
}
|
|
200
|
-
function isUploadField(field) {
|
|
201
|
-
return field.widget === "image" || field.widget === "file";
|
|
202
|
-
}
|
|
203
|
-
function extractArray(obj) {
|
|
204
|
-
for (const key of ["data", "rows", "items", "list", "records"]) {
|
|
205
|
-
if (Array.isArray(obj[key])) return obj[key];
|
|
206
|
-
}
|
|
207
|
-
return null;
|
|
208
|
-
}
|
|
209
96
|
const resultRows = vue.computed(() => {
|
|
210
97
|
if (!hasExecuted.value || resultData.value == null) return null;
|
|
211
|
-
const raw = Array.isArray(resultData.value) ? resultData.value :
|
|
212
|
-
|
|
213
|
-
return raw.filter((item) => isObject(item));
|
|
98
|
+
const raw = Array.isArray(resultData.value) ? resultData.value : fieldUtils.isPlainObject(resultData.value) ? fieldUtils.extractRows(resultData.value) : null;
|
|
99
|
+
return raw ? raw.filter(fieldUtils.isPlainObject) : null;
|
|
214
100
|
});
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
if (!(
|
|
218
|
-
return Object.
|
|
101
|
+
const resultEntries = vue.computed(() => {
|
|
102
|
+
if (!hasExecuted.value || resultRows.value || resultData.value == null) return [];
|
|
103
|
+
if (!fieldUtils.isPlainObject(resultData.value)) return [{ label: "\u7ED3\u679C", value: String(resultData.value) }];
|
|
104
|
+
return Object.entries(resultData.value).filter(([, val]) => val === null || ["string", "number", "boolean"].includes(typeof val)).map(([label, val]) => ({ label, value: val === null ? "-" : String(val) }));
|
|
219
105
|
});
|
|
220
|
-
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (!isObject(resultData.value)) {
|
|
225
|
-
return [{ label: "\u7ED3\u679C", value: String(resultData.value) }];
|
|
226
|
-
}
|
|
227
|
-
return Object.entries(resultData.value).filter(
|
|
228
|
-
([, val]) => val === null || ["string", "number", "boolean"].includes(typeof val)
|
|
229
|
-
).map(([key, val]) => ({
|
|
230
|
-
label: key,
|
|
231
|
-
value: val === null ? "-" : String(val)
|
|
232
|
-
}));
|
|
233
|
-
});
|
|
234
|
-
function initPrefilledValues() {
|
|
235
|
-
if (isObject(props.values)) {
|
|
236
|
-
for (const [k, v] of Object.entries(props.values)) {
|
|
237
|
-
formValues[k] = v;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
function extractSelectOptions(data, labelKey, valueKey) {
|
|
242
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
243
|
-
const rows = Array.isArray(data) ? data : isObject(data) ? (_a = extractArray(data)) != null ? _a : [] : [];
|
|
244
|
-
const options = [];
|
|
245
|
-
for (const row of rows) {
|
|
246
|
-
if (typeof row === "string" || typeof row === "number") {
|
|
247
|
-
options.push({ label: String(row), value: row });
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
if (!isObject(row)) continue;
|
|
251
|
-
const rawVal = (_g = (_f = (_e = (_d = (_c = (_b = valueKey && row[valueKey] !== void 0 ? row[valueKey] : void 0) != null ? _b : row.id) != null ? _c : row.value) != null ? _d : row.code) != null ? _e : row.key) != null ? _f : row.projectId) != null ? _g : row.name;
|
|
252
|
-
const rawLabel = (_l = (_k = (_j = (_i = (_h = labelKey && row[labelKey] !== void 0 ? row[labelKey] : void 0) != null ? _h : row.name) != null ? _i : row.label) != null ? _j : row.title) != null ? _k : row.projectName) != null ? _l : rawVal;
|
|
253
|
-
if (rawVal === void 0 || rawVal === null) continue;
|
|
254
|
-
options.push({
|
|
255
|
-
label: String(rawLabel != null ? rawLabel : rawVal),
|
|
256
|
-
value: typeof rawVal === "string" || typeof rawVal === "number" || typeof rawVal === "boolean" ? rawVal : String(rawVal)
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
return options;
|
|
106
|
+
function report(feedback) {
|
|
107
|
+
if (feedback.type === "success") successMessage.value = feedback.message;
|
|
108
|
+
else errorMessage.value = feedback.message;
|
|
109
|
+
emit("feedback", feedback);
|
|
260
110
|
}
|
|
261
111
|
async function loadFieldOptions(field) {
|
|
262
112
|
const op = field.options_operation;
|
|
263
|
-
if (!op || !props.executeAction || remoteOptions[field.name] || loadingOptions[field.name]) {
|
|
113
|
+
if (!op || !props.executeAction || form.remoteOptions[field.name] || loadingOptions.value[field.name]) {
|
|
264
114
|
return;
|
|
265
115
|
}
|
|
266
|
-
loadingOptions[field.name] = true;
|
|
116
|
+
loadingOptions.value[field.name] = true;
|
|
267
117
|
try {
|
|
268
118
|
const res = await props.executeAction({ operation: op, mode: "options" });
|
|
269
|
-
remoteOptions[field.name] =
|
|
119
|
+
form.remoteOptions[field.name] = fieldUtils.extractOptions(
|
|
270
120
|
res.data,
|
|
271
121
|
field.option_label_key,
|
|
272
122
|
field.option_value_key
|
|
273
123
|
);
|
|
274
124
|
} catch (e) {
|
|
275
|
-
remoteOptions[field.name] = [];
|
|
125
|
+
form.remoteOptions[field.name] = [];
|
|
276
126
|
} finally {
|
|
277
|
-
loadingOptions[field.name] = false;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
function fieldOptions(field) {
|
|
281
|
-
var _a;
|
|
282
|
-
if ((_a = remoteOptions[field.name]) == null ? void 0 : _a.length) {
|
|
283
|
-
return remoteOptions[field.name];
|
|
284
|
-
}
|
|
285
|
-
const inline = normalizeInlineOptions(field.options);
|
|
286
|
-
if (inline == null ? void 0 : inline.length) return inline;
|
|
287
|
-
if (Array.isArray(field.enum) && field.enum.length > 0) {
|
|
288
|
-
return field.enum.map((item) => ({
|
|
289
|
-
label: String(item),
|
|
290
|
-
value: typeof item === "string" || typeof item === "number" || typeof item === "boolean" ? item : String(item)
|
|
291
|
-
}));
|
|
292
|
-
}
|
|
293
|
-
return [];
|
|
294
|
-
}
|
|
295
|
-
function handleSelectChange(field, event) {
|
|
296
|
-
var _a;
|
|
297
|
-
const select = event.target;
|
|
298
|
-
const raw = (_a = select == null ? void 0 : select.value) != null ? _a : "";
|
|
299
|
-
if (raw === "") {
|
|
300
|
-
formValues[field.name] = void 0;
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const matched = fieldOptions(field).find((opt) => String(opt.value) === raw);
|
|
304
|
-
formValues[field.name] = matched ? matched.value : raw;
|
|
305
|
-
}
|
|
306
|
-
function handleNumberInput(field, event) {
|
|
307
|
-
var _a;
|
|
308
|
-
const input = event.target;
|
|
309
|
-
const raw = (_a = input == null ? void 0 : input.value) != null ? _a : "";
|
|
310
|
-
if (raw.trim() === "") {
|
|
311
|
-
formValues[field.name] = void 0;
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const num = Number(raw);
|
|
315
|
-
formValues[field.name] = Number.isNaN(num) ? raw : num;
|
|
316
|
-
}
|
|
317
|
-
function formatDateInputValue(field, value) {
|
|
318
|
-
if (value === void 0 || value === null) return "";
|
|
319
|
-
const text = String(value);
|
|
320
|
-
if (field.widget === "datetime") {
|
|
321
|
-
return text.replace(" ", "T").slice(0, 16);
|
|
127
|
+
loadingOptions.value[field.name] = false;
|
|
322
128
|
}
|
|
323
|
-
return text.slice(0, 10);
|
|
324
|
-
}
|
|
325
|
-
function handleDateInput(field, event) {
|
|
326
|
-
var _a;
|
|
327
|
-
const input = event.target;
|
|
328
|
-
const raw = (_a = input == null ? void 0 : input.value) != null ? _a : "";
|
|
329
|
-
if (!raw) {
|
|
330
|
-
formValues[field.name] = void 0;
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
formValues[field.name] = field.widget === "datetime" ? raw.replace("T", " ") : raw;
|
|
334
129
|
}
|
|
335
130
|
async function loadSchemaIfNeeded() {
|
|
336
|
-
var _a, _b, _c;
|
|
337
|
-
if (
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
loadingSchema.value = true;
|
|
345
|
-
try {
|
|
346
|
-
const res = await props.executeAction({
|
|
347
|
-
operation: props.operation.trim(),
|
|
348
|
-
mode: "schema",
|
|
349
|
-
schema_only: true
|
|
350
|
-
});
|
|
351
|
-
schemaTitle.value = res.title || "";
|
|
352
|
-
schemaReadOnly.value = (_b = res.read_only) != null ? _b : null;
|
|
353
|
-
loadedFields.value = (_c = res.fields) != null ? _c : [];
|
|
354
|
-
for (const f of loadedFields.value) {
|
|
355
|
-
if (f.options_operation) void loadFieldOptions(f);
|
|
356
|
-
}
|
|
357
|
-
} catch (err) {
|
|
358
|
-
errorMessage.value = err instanceof Error ? err.message : "\u52A0\u8F7D\u8868\u5355\u5B57\u6BB5\u5B9A\u4E49\u5931\u8D25";
|
|
359
|
-
} finally {
|
|
360
|
-
loadingSchema.value = false;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function setFileInputRef(fieldName, el) {
|
|
364
|
-
if (el instanceof HTMLInputElement) {
|
|
365
|
-
fileInputRefs.set(fieldName, el);
|
|
366
|
-
} else {
|
|
367
|
-
fileInputRefs.delete(fieldName);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
function triggerFileSelect(fieldName) {
|
|
371
|
-
var _a;
|
|
372
|
-
if (replySent.value || uploadingFields[fieldName]) return;
|
|
373
|
-
(_a = fileInputRefs.get(fieldName)) == null ? void 0 : _a.click();
|
|
374
|
-
}
|
|
375
|
-
function syncUploadFormValue(fieldName) {
|
|
376
|
-
var _a;
|
|
377
|
-
const items = (_a = uploadedFiles[fieldName]) != null ? _a : [];
|
|
378
|
-
formValues[fieldName] = items.length ? items.map((item) => item.attachment.fileName) : void 0;
|
|
379
|
-
}
|
|
380
|
-
async function createImagePreview(file) {
|
|
381
|
-
if (typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
|
|
382
|
-
return { previewUrl: URL.createObjectURL(file), isObjectUrl: true };
|
|
383
|
-
}
|
|
384
|
-
if (typeof FileReader !== "undefined") {
|
|
385
|
-
return new Promise((resolve) => {
|
|
386
|
-
const reader = new FileReader();
|
|
387
|
-
reader.onload = () => {
|
|
388
|
-
resolve({
|
|
389
|
-
previewUrl: typeof reader.result === "string" ? reader.result : void 0,
|
|
390
|
-
isObjectUrl: false
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
reader.onerror = () => resolve({});
|
|
394
|
-
reader.readAsDataURL(file);
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
return {};
|
|
398
|
-
}
|
|
399
|
-
async function handleFileInputChange(field, event) {
|
|
400
|
-
const input = event.target;
|
|
401
|
-
const files = (input == null ? void 0 : input.files) ? Array.from(input.files) : [];
|
|
402
|
-
if (input) input.value = "";
|
|
403
|
-
if (!files.length) return;
|
|
404
|
-
if (!props.uploadFile) {
|
|
405
|
-
errorMessage.value = "\u5F53\u524D\u9875\u9762\u672A\u914D\u7F6E\u8868\u5355\u4E0A\u4F20\u80FD\u529B\uFF0C\u8BF7\u5728\u4E0B\u65B9\u8F93\u5165\u6846\u76F4\u63A5\u53D1\u9001\u56FE\u7247";
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
errorMessage.value = "";
|
|
409
|
-
uploadingFields[field.name] = true;
|
|
410
|
-
if (!uploadedFiles[field.name]) uploadedFiles[field.name] = [];
|
|
411
|
-
try {
|
|
412
|
-
for (const file of files) {
|
|
413
|
-
const attachment = await props.uploadFile(file);
|
|
414
|
-
const isImage = field.widget === "image" || file.type.startsWith("image/");
|
|
415
|
-
const preview = isImage ? await createImagePreview(file) : {};
|
|
416
|
-
uploadedFiles[field.name].push({
|
|
417
|
-
attachment,
|
|
418
|
-
previewUrl: preview.previewUrl,
|
|
419
|
-
isObjectUrl: preview.isObjectUrl
|
|
131
|
+
var _a, _b, _c, _d;
|
|
132
|
+
if (!((_a = props.fields) == null ? void 0 : _a.length) && ((_b = props.operation) == null ? void 0 : _b.trim()) && props.executeAction) {
|
|
133
|
+
loadingSchema.value = true;
|
|
134
|
+
try {
|
|
135
|
+
const res = await props.executeAction({
|
|
136
|
+
operation: props.operation.trim(),
|
|
137
|
+
mode: "schema",
|
|
138
|
+
schema_only: true
|
|
420
139
|
});
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
function removeUploadedItem(fieldName, index) {
|
|
430
|
-
if (replySent.value) return;
|
|
431
|
-
const list = uploadedFiles[fieldName];
|
|
432
|
-
if (!list) return;
|
|
433
|
-
const [removed] = list.splice(index, 1);
|
|
434
|
-
if ((removed == null ? void 0 : removed.previewUrl) && removed.isObjectUrl && typeof URL !== "undefined" && typeof URL.revokeObjectURL === "function") {
|
|
435
|
-
URL.revokeObjectURL(removed.previewUrl);
|
|
436
|
-
}
|
|
437
|
-
syncUploadFormValue(fieldName);
|
|
438
|
-
}
|
|
439
|
-
function collectUploadedAttachments() {
|
|
440
|
-
const result = [];
|
|
441
|
-
for (const field of inlineFields.value) {
|
|
442
|
-
if (!isUploadField(field)) continue;
|
|
443
|
-
const list = uploadedFiles[field.name];
|
|
444
|
-
if (list == null ? void 0 : list.length) {
|
|
445
|
-
for (const item of list) result.push(item.attachment);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
return result;
|
|
449
|
-
}
|
|
450
|
-
function isBlank(value) {
|
|
451
|
-
if (Array.isArray(value)) return value.length === 0;
|
|
452
|
-
return value === void 0 || value === null || String(value).trim() === "";
|
|
453
|
-
}
|
|
454
|
-
function displayValue(field, value) {
|
|
455
|
-
var _a;
|
|
456
|
-
if (isUploadField(field)) {
|
|
457
|
-
const items = (_a = uploadedFiles[field.name]) != null ? _a : [];
|
|
458
|
-
if (items.length) {
|
|
459
|
-
return `\u5DF2\u968F\u6D88\u606F\u4E0A\u4F20 ${items.length} \u4E2A\u9644\u4EF6\uFF08${items.map((item) => item.attachment.fileName).join("\u3001")}\uFF09`;
|
|
140
|
+
schemaTitle.value = res.title || "";
|
|
141
|
+
schemaReadOnly.value = (_c = res.read_only) != null ? _c : null;
|
|
142
|
+
loadedFields.value = (_d = res.fields) != null ? _d : [];
|
|
143
|
+
} catch (err) {
|
|
144
|
+
report({ type: "error", message: err instanceof Error ? err.message : "\u52A0\u8F7D\u8868\u5355\u5B57\u6BB5\u5B9A\u4E49\u5931\u8D25" });
|
|
145
|
+
} finally {
|
|
146
|
+
loadingSchema.value = false;
|
|
460
147
|
}
|
|
461
148
|
}
|
|
462
|
-
const
|
|
463
|
-
if (!option || option.label === String(value)) return String(value);
|
|
464
|
-
return `${option.label}\uFF08${String(value)}\uFF09`;
|
|
149
|
+
for (const field of form.visibleFields.value) void loadFieldOptions(field);
|
|
465
150
|
}
|
|
466
|
-
function
|
|
151
|
+
async function submit() {
|
|
467
152
|
var _a;
|
|
468
|
-
const prefix = ((_a = props.replyPrefix) == null ? void 0 : _a.trim()) ? props.replyPrefix.trim() : `\u8BF7\u6309\u4EE5\u4E0B\u4FE1\u606F${cardTitle.value}`;
|
|
469
|
-
const lines = [];
|
|
470
|
-
for (const field of inlineFields.value) {
|
|
471
|
-
const value = formValues[field.name];
|
|
472
|
-
if (isBlank(value)) continue;
|
|
473
|
-
lines.push(`${field.label || field.name}\uFF1A${displayValue(field, value)}`);
|
|
474
|
-
}
|
|
475
|
-
return [`${prefix}\uFF1A`, ...lines].join("\n");
|
|
476
|
-
}
|
|
477
|
-
async function handleExecute() {
|
|
478
153
|
if (!canExecute.value || executing.value) return;
|
|
479
154
|
errorMessage.value = "";
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
155
|
+
successMessage.value = "";
|
|
156
|
+
const invalid = form.validate();
|
|
157
|
+
if (invalid) {
|
|
158
|
+
report({ type: "validation", message: invalid.message, field: invalid.field });
|
|
483
159
|
return;
|
|
484
160
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
161
|
+
if (resolvedMode.value === "reply") {
|
|
162
|
+
const attachments = form.attachments();
|
|
163
|
+
const text = form.replyText(((_a = props.replyPrefix) == null ? void 0 : _a.trim()) || `\u8BF7\u6309\u4EE5\u4E0B\u4FE1\u606F${cardTitle.value}`);
|
|
164
|
+
if (!props.submitReply) {
|
|
165
|
+
replySent.value = true;
|
|
166
|
+
if (attachments.length) emit("action", text, attachments);
|
|
167
|
+
else emit("action", text);
|
|
489
168
|
return;
|
|
490
169
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
170
|
+
executing.value = true;
|
|
171
|
+
try {
|
|
172
|
+
const res = await props.submitReply({
|
|
173
|
+
text,
|
|
174
|
+
attachments: attachments.length ? attachments : void 0,
|
|
175
|
+
values: { ...form.values }
|
|
176
|
+
});
|
|
177
|
+
if (res.ok) {
|
|
178
|
+
replySent.value = true;
|
|
179
|
+
report({ type: "success", message: res.message || `${cardTitle.value}\u5904\u7406\u6210\u529F` });
|
|
180
|
+
} else {
|
|
181
|
+
form.appendFields(res.missingFields);
|
|
182
|
+
report({ type: "error", message: res.message || "\u4FE1\u606F\u4E0D\u5B8C\u6574\u6216\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u8865\u5145\u540E\u91CD\u65B0\u63D0\u4EA4" });
|
|
183
|
+
}
|
|
184
|
+
} catch (err) {
|
|
185
|
+
report({ type: "error", message: err instanceof Error ? err.message : "\u63D0\u4EA4\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" });
|
|
186
|
+
} finally {
|
|
187
|
+
executing.value = false;
|
|
500
188
|
}
|
|
501
189
|
return;
|
|
502
190
|
}
|
|
503
191
|
if (!props.executeAction) return;
|
|
504
192
|
executing.value = true;
|
|
505
193
|
try {
|
|
506
|
-
const
|
|
507
|
-
for (const [
|
|
508
|
-
if (!
|
|
509
|
-
payload[k] = v;
|
|
510
|
-
}
|
|
194
|
+
const values = {};
|
|
195
|
+
for (const [key, value] of Object.entries(form.values)) {
|
|
196
|
+
if (!fieldUtils.isBlankValue(value)) values[key] = value;
|
|
511
197
|
}
|
|
512
198
|
const res = await props.executeAction({
|
|
513
199
|
operation: props.operation.trim(),
|
|
514
200
|
mode: resolvedMode.value,
|
|
515
|
-
values
|
|
201
|
+
values
|
|
516
202
|
});
|
|
517
203
|
hasExecuted.value = true;
|
|
518
204
|
resultData.value = res.data;
|
|
519
205
|
if (resolvedMode.value === "submit") {
|
|
520
|
-
|
|
206
|
+
report({ type: "success", message: `${cardTitle.value}\u5DF2\u63D0\u4EA4\u6210\u529F` });
|
|
521
207
|
}
|
|
522
208
|
} catch (err) {
|
|
523
|
-
|
|
209
|
+
report({ type: "error", message: err instanceof Error ? err.message : "\u64CD\u4F5C\u6267\u884C\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165\u6761\u4EF6" });
|
|
524
210
|
} finally {
|
|
525
211
|
executing.value = false;
|
|
526
212
|
}
|
|
527
213
|
}
|
|
528
|
-
function
|
|
529
|
-
if (
|
|
214
|
+
function handleAction(key) {
|
|
215
|
+
if (key === "submit") {
|
|
216
|
+
void submit();
|
|
530
217
|
return;
|
|
531
218
|
}
|
|
532
|
-
|
|
533
|
-
for (const item of list) {
|
|
534
|
-
if (item.previewUrl && item.isObjectUrl) URL.revokeObjectURL(item.previewUrl);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function handleReset() {
|
|
539
|
-
for (const key of Object.keys(formValues)) {
|
|
540
|
-
delete formValues[key];
|
|
541
|
-
}
|
|
542
|
-
revokeAllUploadPreviews();
|
|
543
|
-
for (const key of Object.keys(uploadedFiles)) {
|
|
544
|
-
delete uploadedFiles[key];
|
|
545
|
-
}
|
|
546
|
-
initPrefilledValues();
|
|
219
|
+
form.reset();
|
|
547
220
|
errorMessage.value = "";
|
|
548
|
-
if (!replySent.value)
|
|
221
|
+
if (!replySent.value) successMessage.value = "";
|
|
549
222
|
}
|
|
550
|
-
vue.watch(
|
|
551
|
-
() => props.values,
|
|
552
|
-
() => {
|
|
553
|
-
initPrefilledValues();
|
|
554
|
-
},
|
|
555
|
-
{ immediate: true, deep: true }
|
|
556
|
-
);
|
|
557
223
|
vue.onMounted(() => {
|
|
558
224
|
void loadSchemaIfNeeded();
|
|
559
225
|
});
|
|
560
|
-
vue.onBeforeUnmount(() => {
|
|
561
|
-
revokeAllUploadPreviews();
|
|
562
|
-
});
|
|
563
226
|
return (_ctx, _cache) => {
|
|
564
227
|
var _a;
|
|
565
|
-
return vue.openBlock(), vue.
|
|
566
|
-
"
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
/* CACHED */
|
|
579
|
-
)),
|
|
580
|
-
vue.createElementVNode("div", _hoisted_3, [
|
|
581
|
-
vue.createElementVNode(
|
|
582
|
-
"div",
|
|
583
|
-
_hoisted_4,
|
|
584
|
-
vue.toDisplayString(cardTitle.value),
|
|
585
|
-
1
|
|
586
|
-
/* TEXT */
|
|
587
|
-
),
|
|
588
|
-
cardSubtitle.value ? (vue.openBlock(), vue.createElementBlock(
|
|
589
|
-
"div",
|
|
590
|
-
_hoisted_5,
|
|
591
|
-
vue.toDisplayString(cardSubtitle.value),
|
|
592
|
-
1
|
|
593
|
-
/* TEXT */
|
|
594
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
595
|
-
])
|
|
596
|
-
]),
|
|
597
|
-
vue.createElementVNode(
|
|
598
|
-
"span",
|
|
599
|
-
{
|
|
600
|
-
class: vue.normalizeClass(["yc-display-form-card__badge", resolvedMode.value === "query" ? "is-query" : "is-form"])
|
|
601
|
-
},
|
|
602
|
-
vue.toDisplayString(resolvedMode.value === "query" ? "\u7B5B\u9009\u67E5\u8BE2" : "\u4E1A\u52A1\u8868\u5355"),
|
|
603
|
-
3
|
|
604
|
-
/* TEXT, CLASS */
|
|
605
|
-
)
|
|
606
|
-
]),
|
|
607
|
-
loadingSchema.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, " \u6B63\u5728\u52A0\u8F7D\u8868\u5355\u914D\u7F6E\u2026 ")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
608
|
-
visibleFields.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
609
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
610
|
-
vue.Fragment,
|
|
611
|
-
null,
|
|
612
|
-
vue.renderList(visibleFields.value, (field) => {
|
|
613
|
-
var _a2, _b, _c, _d, _e;
|
|
614
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
615
|
-
"div",
|
|
616
|
-
{
|
|
617
|
-
key: field.name,
|
|
618
|
-
class: vue.normalizeClass(["yc-display-form-card__field", {
|
|
619
|
-
"is-full-row": field.widget === "textarea" || isUploadField(field)
|
|
620
|
-
}])
|
|
621
|
-
},
|
|
622
|
-
[
|
|
623
|
-
vue.createElementVNode("label", _hoisted_9, [
|
|
624
|
-
field.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_10, "*")) : vue.createCommentVNode("v-if", true),
|
|
625
|
-
vue.createTextVNode(
|
|
626
|
-
" " + vue.toDisplayString(field.label || field.name),
|
|
627
|
-
1
|
|
628
|
-
/* TEXT */
|
|
629
|
-
)
|
|
630
|
-
]),
|
|
631
|
-
isSelectField(field) ? (vue.openBlock(), vue.createElementBlock("select", {
|
|
632
|
-
key: 0,
|
|
633
|
-
value: (_a2 = formValues[field.name]) != null ? _a2 : "",
|
|
634
|
-
disabled: replySent.value,
|
|
635
|
-
class: "yc-display-form-card__control yc-display-form-card__select",
|
|
636
|
-
onFocus: ($event) => loadFieldOptions(field),
|
|
637
|
-
onChange: (event) => handleSelectChange(field, event)
|
|
638
|
-
}, [
|
|
639
|
-
vue.createElementVNode(
|
|
640
|
-
"option",
|
|
641
|
-
_hoisted_12,
|
|
642
|
-
vue.toDisplayString(loadingOptions[field.name] ? "\u52A0\u8F7D\u9009\u9879\u4E2D\u2026" : `\u8BF7\u9009\u62E9${field.label || field.name}`),
|
|
643
|
-
1
|
|
644
|
-
/* TEXT */
|
|
645
|
-
),
|
|
646
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
647
|
-
vue.Fragment,
|
|
648
|
-
null,
|
|
649
|
-
vue.renderList(fieldOptions(field), (opt) => {
|
|
650
|
-
return vue.openBlock(), vue.createElementBlock("option", {
|
|
651
|
-
key: String(opt.value),
|
|
652
|
-
value: String(opt.value)
|
|
653
|
-
}, vue.toDisplayString(opt.label), 9, _hoisted_13);
|
|
654
|
-
}),
|
|
655
|
-
128
|
|
656
|
-
/* KEYED_FRAGMENT */
|
|
657
|
-
))
|
|
658
|
-
], 40, _hoisted_11)) : isDateField(field) ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
659
|
-
key: 1,
|
|
660
|
-
type: field.widget === "datetime" ? "datetime-local" : "date",
|
|
661
|
-
value: formatDateInputValue(field, formValues[field.name]),
|
|
662
|
-
disabled: replySent.value,
|
|
663
|
-
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
664
|
-
onInput: (event) => handleDateInput(field, event)
|
|
665
|
-
}, null, 40, _hoisted_14)) : isNumberField(field) ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
666
|
-
key: 2,
|
|
667
|
-
type: "number",
|
|
668
|
-
step: field.type === "integer" ? "1" : "any",
|
|
669
|
-
inputmode: field.type === "integer" ? "numeric" : "decimal",
|
|
670
|
-
value: (_b = formValues[field.name]) != null ? _b : "",
|
|
671
|
-
disabled: replySent.value,
|
|
672
|
-
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
673
|
-
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
674
|
-
onInput: (event) => handleNumberInput(field, event)
|
|
675
|
-
}, null, 40, _hoisted_15)) : field.type === "boolean" ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
676
|
-
key: 3,
|
|
677
|
-
type: "button",
|
|
678
|
-
role: "switch",
|
|
679
|
-
"aria-checked": Boolean(formValues[field.name]),
|
|
680
|
-
disabled: replySent.value,
|
|
681
|
-
class: vue.normalizeClass(["yc-display-form-card__switch", { "is-checked": Boolean(formValues[field.name]) }]),
|
|
682
|
-
onClick: ($event) => formValues[field.name] = !formValues[field.name]
|
|
683
|
-
}, [..._cache[1] || (_cache[1] = [
|
|
684
|
-
vue.createElementVNode(
|
|
685
|
-
"span",
|
|
686
|
-
{ class: "yc-display-form-card__switch-thumb" },
|
|
687
|
-
null,
|
|
688
|
-
-1
|
|
689
|
-
/* CACHED */
|
|
690
|
-
)
|
|
691
|
-
])], 10, _hoisted_16)) : isUploadField(field) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
|
|
692
|
-
vue.createElementVNode("input", {
|
|
693
|
-
ref_for: true,
|
|
694
|
-
ref: (el) => setFileInputRef(field.name, el),
|
|
695
|
-
type: "file",
|
|
696
|
-
multiple: "",
|
|
697
|
-
accept: field.widget === "image" ? "image/*" : void 0,
|
|
698
|
-
class: "yc-display-form-card__upload-input",
|
|
699
|
-
onChange: (event) => handleFileInputChange(field, event)
|
|
700
|
-
}, null, 40, _hoisted_18),
|
|
701
|
-
vue.createElementVNode("div", _hoisted_19, [
|
|
702
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
703
|
-
vue.Fragment,
|
|
704
|
-
null,
|
|
705
|
-
vue.renderList((_c = uploadedFiles[field.name]) != null ? _c : [], (item, idx) => {
|
|
706
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
707
|
-
vue.Fragment,
|
|
708
|
-
{
|
|
709
|
-
key: `${item.attachment.fileRef || item.attachment.fileName}-${idx}`
|
|
710
|
-
},
|
|
711
|
-
[
|
|
712
|
-
item.previewUrl ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20, [
|
|
713
|
-
vue.createElementVNode("img", {
|
|
714
|
-
src: item.previewUrl,
|
|
715
|
-
alt: item.attachment.fileName
|
|
716
|
-
}, null, 8, _hoisted_21),
|
|
717
|
-
!replySent.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
718
|
-
key: 0,
|
|
719
|
-
type: "button",
|
|
720
|
-
class: "yc-display-form-card__thumb-remove",
|
|
721
|
-
title: "\u79FB\u9664",
|
|
722
|
-
onClick: ($event) => removeUploadedItem(field.name, idx)
|
|
723
|
-
}, " \xD7 ", 8, _hoisted_22)) : vue.createCommentVNode("v-if", true)
|
|
724
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
|
|
725
|
-
vue.createElementVNode(
|
|
726
|
-
"span",
|
|
727
|
-
_hoisted_24,
|
|
728
|
-
vue.toDisplayString(item.attachment.fileName),
|
|
729
|
-
1
|
|
730
|
-
/* TEXT */
|
|
731
|
-
),
|
|
732
|
-
!replySent.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
733
|
-
key: 0,
|
|
734
|
-
type: "button",
|
|
735
|
-
class: "yc-display-form-card__file-remove",
|
|
736
|
-
title: "\u79FB\u9664",
|
|
737
|
-
onClick: ($event) => removeUploadedItem(field.name, idx)
|
|
738
|
-
}, " \xD7 ", 8, _hoisted_25)) : vue.createCommentVNode("v-if", true)
|
|
739
|
-
]))
|
|
740
|
-
],
|
|
741
|
-
64
|
|
742
|
-
/* STABLE_FRAGMENT */
|
|
743
|
-
);
|
|
744
|
-
}),
|
|
745
|
-
128
|
|
746
|
-
/* KEYED_FRAGMENT */
|
|
747
|
-
)),
|
|
748
|
-
!replySent.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
749
|
-
key: 0,
|
|
750
|
-
type: "button",
|
|
751
|
-
class: vue.normalizeClass(["yc-display-form-card__upload-trigger", {
|
|
752
|
-
"is-image": field.widget === "image",
|
|
753
|
-
"is-loading": Boolean(uploadingFields[field.name])
|
|
754
|
-
}]),
|
|
755
|
-
disabled: Boolean(uploadingFields[field.name]),
|
|
756
|
-
onClick: ($event) => triggerFileSelect(field.name)
|
|
757
|
-
}, [
|
|
758
|
-
uploadingFields[field.name] ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_27, "\u4E0A\u4F20\u4E2D\u2026")) : (vue.openBlock(), vue.createElementBlock(
|
|
759
|
-
"span",
|
|
760
|
-
_hoisted_28,
|
|
761
|
-
vue.toDisplayString(field.widget === "image" ? "+ \u4E0A\u4F20\u56FE\u7247" : "+ \u4E0A\u4F20\u9644\u4EF6"),
|
|
762
|
-
1
|
|
763
|
-
/* TEXT */
|
|
764
|
-
))
|
|
765
|
-
], 10, _hoisted_26)) : vue.createCommentVNode("v-if", true)
|
|
766
|
-
])
|
|
767
|
-
])) : field.widget === "textarea" ? (vue.openBlock(), vue.createElementBlock("textarea", {
|
|
768
|
-
key: 5,
|
|
769
|
-
rows: "3",
|
|
770
|
-
value: String((_d = formValues[field.name]) != null ? _d : ""),
|
|
771
|
-
disabled: replySent.value,
|
|
772
|
-
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
773
|
-
class: "yc-display-form-card__control yc-display-form-card__textarea",
|
|
774
|
-
onInput: (event) => formValues[field.name] = event.target.value
|
|
775
|
-
}, null, 40, _hoisted_29)) : (vue.openBlock(), vue.createElementBlock("input", {
|
|
776
|
-
key: 6,
|
|
777
|
-
type: "text",
|
|
778
|
-
value: String((_e = formValues[field.name]) != null ? _e : ""),
|
|
779
|
-
disabled: replySent.value,
|
|
780
|
-
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
781
|
-
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
782
|
-
onInput: (event) => formValues[field.name] = event.target.value
|
|
783
|
-
}, null, 40, _hoisted_30))
|
|
784
|
-
],
|
|
785
|
-
2
|
|
786
|
-
/* CLASS */
|
|
787
|
-
);
|
|
788
|
-
}),
|
|
789
|
-
128
|
|
790
|
-
/* KEYED_FRAGMENT */
|
|
791
|
-
))
|
|
792
|
-
])) : vue.createCommentVNode("v-if", true),
|
|
793
|
-
vue.createElementVNode("div", _hoisted_31, [
|
|
794
|
-
vue.createElementVNode("button", {
|
|
795
|
-
type: "button",
|
|
796
|
-
class: "yc-display-form-card__btn is-primary",
|
|
797
|
-
disabled: !canExecute.value || executing.value,
|
|
798
|
-
onClick: handleExecute
|
|
799
|
-
}, vue.toDisplayString(executing.value ? "\u5904\u7406\u4E2D\u2026" : resolvedSubmitLabel.value), 9, _hoisted_32),
|
|
800
|
-
vue.createElementVNode("button", {
|
|
801
|
-
type: "button",
|
|
802
|
-
class: "yc-display-form-card__btn is-default",
|
|
803
|
-
disabled: executing.value || replySent.value,
|
|
804
|
-
onClick: handleReset
|
|
805
|
-
}, " \u91CD\u7F6E ", 8, _hoisted_33)
|
|
806
|
-
]),
|
|
807
|
-
errorMessage.value ? (vue.openBlock(), vue.createElementBlock(
|
|
808
|
-
"div",
|
|
809
|
-
_hoisted_34,
|
|
810
|
-
vue.toDisplayString(errorMessage.value),
|
|
811
|
-
1
|
|
812
|
-
/* TEXT */
|
|
813
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
814
|
-
submitReceipt.value ? (vue.openBlock(), vue.createElementBlock(
|
|
815
|
-
"div",
|
|
816
|
-
_hoisted_35,
|
|
817
|
-
vue.toDisplayString(submitReceipt.value),
|
|
818
|
-
1
|
|
819
|
-
/* TEXT */
|
|
820
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
821
|
-
hasExecuted.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_36, [
|
|
822
|
-
((_a = resultRows.value) == null ? void 0 : _a.length) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_37, [
|
|
823
|
-
vue.createElementVNode("table", _hoisted_38, [
|
|
824
|
-
vue.createElementVNode("thead", null, [
|
|
825
|
-
vue.createElementVNode("tr", null, [
|
|
826
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
827
|
-
vue.Fragment,
|
|
828
|
-
null,
|
|
829
|
-
vue.renderList(resultColumns.value, (col) => {
|
|
830
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
831
|
-
"th",
|
|
832
|
-
{ key: col },
|
|
833
|
-
vue.toDisplayString(col),
|
|
834
|
-
1
|
|
835
|
-
/* TEXT */
|
|
836
|
-
);
|
|
837
|
-
}),
|
|
838
|
-
128
|
|
839
|
-
/* KEYED_FRAGMENT */
|
|
840
|
-
))
|
|
841
|
-
])
|
|
842
|
-
]),
|
|
843
|
-
vue.createElementVNode("tbody", null, [
|
|
844
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
845
|
-
vue.Fragment,
|
|
846
|
-
null,
|
|
847
|
-
vue.renderList(resultRows.value, (row, rIdx) => {
|
|
848
|
-
return vue.openBlock(), vue.createElementBlock("tr", { key: rIdx }, [
|
|
849
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
850
|
-
vue.Fragment,
|
|
851
|
-
null,
|
|
852
|
-
vue.renderList(resultColumns.value, (col) => {
|
|
853
|
-
var _a2;
|
|
854
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
855
|
-
"td",
|
|
856
|
-
{ key: col },
|
|
857
|
-
vue.toDisplayString((_a2 = row[col]) != null ? _a2 : "\u2014"),
|
|
858
|
-
1
|
|
859
|
-
/* TEXT */
|
|
860
|
-
);
|
|
861
|
-
}),
|
|
862
|
-
128
|
|
863
|
-
/* KEYED_FRAGMENT */
|
|
864
|
-
))
|
|
865
|
-
]);
|
|
866
|
-
}),
|
|
867
|
-
128
|
|
868
|
-
/* KEYED_FRAGMENT */
|
|
869
|
-
))
|
|
870
|
-
])
|
|
871
|
-
])
|
|
872
|
-
])) : resultDetailEntries.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
|
|
228
|
+
return vue.openBlock(), vue.createBlock(cardShell.default, {
|
|
229
|
+
class: vue.normalizeClass(["yc-display-form-card", { "is-compact": __props.compact }]),
|
|
230
|
+
title: cardTitle.value,
|
|
231
|
+
subtitle: (_a = __props.subtitle) == null ? void 0 : _a.trim(),
|
|
232
|
+
badge: resolvedMode.value === "query" ? { text: "\u7B5B\u9009\u67E5\u8BE2", tone: "neutral" } : { text: "\u4E1A\u52A1\u8868\u5355", tone: "primary" },
|
|
233
|
+
accent: "",
|
|
234
|
+
compact: __props.compact
|
|
235
|
+
}, {
|
|
236
|
+
default: vue.withCtx(() => {
|
|
237
|
+
var _a2;
|
|
238
|
+
return [
|
|
239
|
+
loadingSchema.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, "\u6B63\u5728\u52A0\u8F7D\u8868\u5355\u914D\u7F6E\u2026")) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
240
|
+
vue.unref(form).visibleFields.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
873
241
|
(vue.openBlock(true), vue.createElementBlock(
|
|
874
242
|
vue.Fragment,
|
|
875
243
|
null,
|
|
876
|
-
vue.renderList(
|
|
877
|
-
return vue.openBlock(), vue.
|
|
878
|
-
key:
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
vue.
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
1
|
|
893
|
-
/* TEXT */
|
|
894
|
-
)
|
|
895
|
-
]);
|
|
244
|
+
vue.renderList(vue.unref(form).visibleFields.value, (field) => {
|
|
245
|
+
return vue.openBlock(), vue.createBlock(fieldControl_vue_vue_type_script_setup_true_lang.default, {
|
|
246
|
+
key: field.name,
|
|
247
|
+
field,
|
|
248
|
+
"model-value": vue.unref(form).values[field.name],
|
|
249
|
+
options: vue.unref(form).optionsOf(field),
|
|
250
|
+
"loading-options": Boolean(loadingOptions.value[field.name]),
|
|
251
|
+
disabled: replySent.value,
|
|
252
|
+
error: vue.unref(form).errors[field.name],
|
|
253
|
+
hint: vue.unref(form).appendedNames.value.has(field.name) ? "\u9700\u8865\u5145" : "",
|
|
254
|
+
"upload-file": __props.uploadFile,
|
|
255
|
+
"onUpdate:modelValue": (value) => vue.unref(form).setValue(field.name, value),
|
|
256
|
+
onFocus: ($event) => loadFieldOptions(field),
|
|
257
|
+
onBlur: ($event) => vue.unref(form).values[field.name] !== void 0 && vue.unref(form).validateField(field),
|
|
258
|
+
onUploadError: (message) => report({ type: "upload-error", message, field: field.name })
|
|
259
|
+
}, null, 8, ["field", "model-value", "options", "loading-options", "disabled", "error", "hint", "upload-file", "onUpdate:modelValue", "onFocus", "onBlur", "onUploadError"]);
|
|
896
260
|
}),
|
|
897
261
|
128
|
|
898
262
|
/* KEYED_FRAGMENT */
|
|
899
263
|
))
|
|
900
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
264
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
265
|
+
vue.createVNode(actionBar.default, {
|
|
266
|
+
items: actions.value,
|
|
267
|
+
"loading-key": executing.value ? "submit" : "",
|
|
268
|
+
onClick: handleAction
|
|
269
|
+
}, null, 8, ["items", "loading-key"]),
|
|
270
|
+
__props.inlineFeedback && errorMessage.value ? (vue.openBlock(), vue.createBlock(inlineAlert.default, {
|
|
271
|
+
key: 1,
|
|
272
|
+
tone: "error",
|
|
273
|
+
text: errorMessage.value
|
|
274
|
+
}, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
|
|
275
|
+
__props.inlineFeedback && successMessage.value ? (vue.openBlock(), vue.createBlock(inlineAlert.default, {
|
|
276
|
+
key: 2,
|
|
277
|
+
tone: "success",
|
|
278
|
+
text: successMessage.value
|
|
279
|
+
}, null, 8, ["text"])) : vue.createCommentVNode("v-if", true),
|
|
280
|
+
((_a2 = resultRows.value) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(dataTable.default, {
|
|
281
|
+
key: 3,
|
|
282
|
+
rows: resultRows.value,
|
|
283
|
+
bordered: ""
|
|
284
|
+
}, null, 8, ["rows"])) : resultEntries.value.length ? (vue.openBlock(), vue.createBlock(kvList.default, {
|
|
285
|
+
key: 4,
|
|
286
|
+
items: resultEntries.value,
|
|
287
|
+
bordered: ""
|
|
288
|
+
}, null, 8, ["items"])) : vue.createCommentVNode("v-if", true)
|
|
289
|
+
]))
|
|
290
|
+
];
|
|
291
|
+
}),
|
|
292
|
+
_: 1
|
|
293
|
+
/* STABLE */
|
|
294
|
+
}, 8, ["class", "title", "subtitle", "badge", "compact"]);
|
|
907
295
|
};
|
|
908
296
|
}
|
|
909
297
|
});
|