@tongfun/ui 0.0.1-alpha.2 → 0.0.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +116 -0
- package/dist/index.js +139842 -0
- package/dist/lowcode-agent/icons.d.ts +11 -0
- package/dist/lowcode-agent/icons.js +134 -0
- package/{packages/ui/lowcode-agent/index.ts → dist/lowcode-agent/index.d.ts} +1 -2
- package/dist/lowcode-agent/index.js +37008 -0
- package/dist/style.css +1 -0
- package/package.json +91 -85
- package/.claude/settings.local.json +0 -7
- package/.hermes/plans/datapicker-object-mode.md +0 -57
- package/.hermes/plans/design-spec-fusion-5175-v2.md +0 -146
- package/.hermes/plans/design-spec-fusion-5175.md +0 -88
- package/.hermes/plans/file-upload-chip-redesign.md +0 -66
- package/.hermes/plans/form-image-upload-modelvalue-fix.md +0 -38
- package/.hermes/plans/form-layout-responsive-span-plan.md +0 -137
- package/.hermes/plans/global-audit-report.md +0 -728
- package/.hermes/plans/global-audit-report.v1.md +0 -604
- package/.hermes/plans/global-audit-report.v3.md +0 -777
- package/.hermes/plans/image-file-erp-redesign.md +0 -173
- package/.hermes/plans/location-picker-baidu-modal.md +0 -173
- package/.hermes/plans/new-document-3b-color-componentization-plan.md +0 -155
- package/.hermes/plans/new-document-form-layout-rebuild-plan.md +0 -150
- package/.hermes/plans/new-document-fullwidth-3col-plan.md +0 -177
- package/.hermes/plans/picker-quick-options-range-mode.md +0 -143
- package/.hermes/plans/region-picker-mock-contract.md +0 -202
- package/.hermes/plans/zero-div-component-contracts.md +0 -466
- package/components.json +0 -19
- package/docs/DEVELOPMENT.md +0 -315
- package/docs/PRD.md +0 -170
- package/docs/ai-api-layering.md +0 -141
- package/docs/anchor-component-plan.md +0 -165
- package/docs/components-analysis.md +0 -2911
- package/docs/demo-scan-report.md +0 -142
- package/docs/editable-table-research.md +0 -8
- package/docs/form-panorama-plan.md +0 -141
- package/docs/lowcode-agent-component-registry.sample.json +0 -36364
- package/docs/tf-form-table-modification-plan.md +0 -503
- package/docs/token-compliance-audit-report.md +0 -542
- package/env.d.ts +0 -5
- package/eslint.config.js +0 -66
- package/packages/ui/__tests__/package-exports.test.ts +0 -23
- package/packages/ui/components/affix/README.md +0 -78
- package/packages/ui/components/affix/__tests__/affix.test.ts +0 -204
- package/packages/ui/components/affix/index.ts +0 -13
- package/packages/ui/components/affix/src/affix.vue +0 -216
- package/packages/ui/components/affix/src/types.ts +0 -47
- package/packages/ui/components/affix/styles/affix.css +0 -17
- package/packages/ui/components/ai-overlay/README.md +0 -180
- package/packages/ui/components/ai-overlay/__tests__/ai-action-menu.test.ts +0 -133
- package/packages/ui/components/ai-overlay/__tests__/ai-overlay.test.ts +0 -117
- package/packages/ui/components/ai-overlay/index.ts +0 -32
- package/packages/ui/components/ai-overlay/src/ai-action-menu-types.ts +0 -22
- package/packages/ui/components/ai-overlay/src/ai-action-menu.vue +0 -200
- package/packages/ui/components/ai-overlay/src/ai-overlay.vue +0 -329
- package/packages/ui/components/ai-overlay/src/types.ts +0 -84
- package/packages/ui/components/ai-overlay/styles/ai-overlay.css +0 -306
- package/packages/ui/components/ai-state-flow/README.md +0 -111
- package/packages/ui/components/ai-state-flow/__tests__/ai-state-flow.test.ts +0 -69
- package/packages/ui/components/ai-state-flow/ai-state-flow.ts +0 -16
- package/packages/ui/components/ai-state-flow/ai-state-flow.vue +0 -67
- package/packages/ui/components/ai-state-flow/index.ts +0 -24
- package/packages/ui/components/ai-state-flow/styles/ai-state-flow.css +0 -144
- package/packages/ui/components/alert/README.md +0 -83
- package/packages/ui/components/alert/__tests__/alert.test.ts +0 -155
- package/packages/ui/components/alert/index.ts +0 -13
- package/packages/ui/components/alert/src/alert.ts +0 -90
- package/packages/ui/components/alert/src/alert.vue +0 -87
- package/packages/ui/components/alert/styles/alert.css +0 -158
- package/packages/ui/components/anchor/README.md +0 -50
- package/packages/ui/components/anchor/__tests__/anchor.test.ts +0 -284
- package/packages/ui/components/anchor/index.ts +0 -13
- package/packages/ui/components/anchor/src/anchor.vue +0 -94
- package/packages/ui/components/anchor/src/types.ts +0 -55
- package/packages/ui/components/anchor/src/use-anchor.ts +0 -253
- package/packages/ui/components/anchor/styles/anchor.css +0 -90
- package/packages/ui/components/avatar/README.md +0 -118
- package/packages/ui/components/avatar/__tests__/avatar.test.ts +0 -83
- package/packages/ui/components/avatar/index.ts +0 -12
- package/packages/ui/components/avatar/src/avatar.ts +0 -62
- package/packages/ui/components/avatar/src/avatar.vue +0 -106
- package/packages/ui/components/back-top/README.md +0 -63
- package/packages/ui/components/back-top/__tests__/back-top.test.ts +0 -215
- package/packages/ui/components/back-top/index.ts +0 -13
- package/packages/ui/components/back-top/src/back-top.ts +0 -51
- package/packages/ui/components/back-top/src/back-top.vue +0 -104
- package/packages/ui/components/back-top/styles/back-top.css +0 -24
- package/packages/ui/components/badge/README.md +0 -71
- package/packages/ui/components/badge/__tests__/badge.test.ts +0 -142
- package/packages/ui/components/badge/index.ts +0 -13
- package/packages/ui/components/badge/src/badge.ts +0 -64
- package/packages/ui/components/badge/src/badge.vue +0 -76
- package/packages/ui/components/badge/styles/badge.css +0 -45
- package/packages/ui/components/batch-action-button/README.md +0 -68
- package/packages/ui/components/batch-action-button/__tests__/batch-action-button.test.ts +0 -30
- package/packages/ui/components/batch-action-button/index.ts +0 -11
- package/packages/ui/components/batch-action-button/src/batch-action-button.vue +0 -59
- package/packages/ui/components/batch-action-button/src/types.ts +0 -9
- package/packages/ui/components/breadcrumb/README.md +0 -115
- package/packages/ui/components/breadcrumb/__tests__/breadcrumb.test.ts +0 -168
- package/packages/ui/components/breadcrumb/index.ts +0 -13
- package/packages/ui/components/breadcrumb/src/breadcrumb.ts +0 -60
- package/packages/ui/components/breadcrumb/src/breadcrumb.vue +0 -86
- package/packages/ui/components/business/document/action-header/index.ts +0 -14
- package/packages/ui/components/business/document/action-header/src/context.ts +0 -10
- package/packages/ui/components/business/document/action-header/src/document-action-header.vue +0 -296
- package/packages/ui/components/business/document/action-header/src/types.ts +0 -100
- package/packages/ui/components/business/document/ai-toolbar/index.ts +0 -12
- package/packages/ui/components/business/document/ai-toolbar/src/document-ai-toolbar.vue +0 -72
- package/packages/ui/components/business/document/form-page/index.ts +0 -16
- package/packages/ui/components/business/document/form-page/src/composables/use-document-ai-toolbar.ts +0 -37
- package/packages/ui/components/business/document/form-page/src/composables/use-document-layout-mode.ts +0 -24
- package/packages/ui/components/business/document/form-page/src/composables/use-document-recognition.ts +0 -55
- package/packages/ui/components/business/document/form-page/src/composables/use-document-save.ts +0 -243
- package/packages/ui/components/business/document/form-page/src/composables/use-document-sections.ts +0 -234
- package/packages/ui/components/business/document/form-page/src/context.ts +0 -15
- package/packages/ui/components/business/document/form-page/src/document-form-page.vue +0 -251
- package/packages/ui/components/business/document/form-page/src/document-section-card.vue +0 -187
- package/packages/ui/components/business/document/form-page/src/types.ts +0 -245
- package/packages/ui/components/business/document/form-page/styles/document-form-page.css +0 -40
- package/packages/ui/components/business/enum-select/index.ts +0 -18
- package/packages/ui/components/business/enum-select/src/enum-select.vue +0 -171
- package/packages/ui/components/business/enum-select/src/types.ts +0 -33
- package/packages/ui/components/button/README.md +0 -155
- package/packages/ui/components/button/__tests__/button.test.ts +0 -261
- package/packages/ui/components/button/index.ts +0 -14
- package/packages/ui/components/button/src/button.ts +0 -168
- package/packages/ui/components/button/src/button.vue +0 -341
- package/packages/ui/components/button/styles/button.css +0 -149
- package/packages/ui/components/carousel/README.md +0 -48
- package/packages/ui/components/carousel/__tests__/carousel.test.ts +0 -82
- package/packages/ui/components/carousel/index.ts +0 -11
- package/packages/ui/components/carousel/src/carousel.ts +0 -38
- package/packages/ui/components/carousel/src/carousel.vue +0 -101
- package/packages/ui/components/carousel/styles/carousel.css +0 -40
- package/packages/ui/components/chart/README.md +0 -120
- package/packages/ui/components/chart/__tests__/chart.test.ts +0 -86
- package/packages/ui/components/chart/__tests__/simple-charts.test.ts +0 -130
- package/packages/ui/components/chart/index.ts +0 -22
- package/packages/ui/components/chart/src/bar-chart.vue +0 -83
- package/packages/ui/components/chart/src/chart.ts +0 -135
- package/packages/ui/components/chart/src/chart.vue +0 -147
- package/packages/ui/components/chart/src/donut-chart.vue +0 -96
- package/packages/ui/components/chart/src/line-chart.vue +0 -101
- package/packages/ui/components/chart/src/metric-grid.vue +0 -55
- package/packages/ui/components/chart/src/types.ts +0 -91
- package/packages/ui/components/chart/src/utils.ts +0 -68
- package/packages/ui/components/chart/styles/bar-chart.css +0 -134
- package/packages/ui/components/chart/styles/chart.css +0 -48
- package/packages/ui/components/chart/styles/donut-chart.css +0 -114
- package/packages/ui/components/chart/styles/line-chart.css +0 -61
- package/packages/ui/components/chart/styles/metric-grid.css +0 -115
- package/packages/ui/components/code-block/README.md +0 -56
- package/packages/ui/components/code-block/__tests__/code-block.test.ts +0 -166
- package/packages/ui/components/code-block/index.ts +0 -13
- package/packages/ui/components/code-block/src/code-block.vue +0 -216
- package/packages/ui/components/code-block/src/types.ts +0 -31
- package/packages/ui/components/code-block/styles/code-block.css +0 -192
- package/packages/ui/components/data-grid/CellRendererActions.vue +0 -77
- package/packages/ui/components/data-grid/CellRendererButton.vue +0 -51
- package/packages/ui/components/data-grid/CellRendererCsCheckbox.vue +0 -16
- package/packages/ui/components/data-grid/CellRendererCsInput.vue +0 -29
- package/packages/ui/components/data-grid/CellRendererCsSelect.vue +0 -19
- package/packages/ui/components/data-grid/CellRendererInput.vue +0 -120
- package/packages/ui/components/data-grid/CellRendererText.vue +0 -94
- package/packages/ui/components/data-grid/ColumnSettings.vue +0 -40
- package/packages/ui/components/data-grid/ColumnSettingsDialog.vue +0 -367
- package/packages/ui/components/data-grid/DataGrid.vue +0 -850
- package/packages/ui/components/data-grid/DataGridFilter.vue +0 -242
- package/packages/ui/components/data-grid/column-settings-api.ts +0 -62
- package/packages/ui/components/data-grid/index.ts +0 -29
- package/packages/ui/components/data-grid/props.ts +0 -246
- package/packages/ui/components/data-grid/variants.ts +0 -26
- package/packages/ui/components/divider/README.md +0 -84
- package/packages/ui/components/divider/__tests__/divider.test.ts +0 -105
- package/packages/ui/components/divider/index.ts +0 -13
- package/packages/ui/components/divider/src/divider.ts +0 -50
- package/packages/ui/components/divider/src/divider.vue +0 -76
- package/packages/ui/components/divider/styles/divider.css +0 -65
- package/packages/ui/components/drawer/README.md +0 -90
- package/packages/ui/components/drawer/__tests__/drawer.test.ts +0 -218
- package/packages/ui/components/drawer/index.ts +0 -13
- package/packages/ui/components/drawer/src/drawer.ts +0 -88
- package/packages/ui/components/drawer/src/drawer.vue +0 -157
- package/packages/ui/components/drawer/styles/drawer.css +0 -164
- package/packages/ui/components/dropdown/README.md +0 -51
- package/packages/ui/components/dropdown/__tests__/dropdown.test.ts +0 -143
- package/packages/ui/components/dropdown/index.ts +0 -11
- package/packages/ui/components/dropdown/src/dropdown.ts +0 -47
- package/packages/ui/components/dropdown/src/dropdown.vue +0 -75
- package/packages/ui/components/dropdown/styles/dropdown.css +0 -16
- package/packages/ui/components/dropdown-button/README.md +0 -78
- package/packages/ui/components/dropdown-button/__tests__/dropdown-button.test.ts +0 -75
- package/packages/ui/components/dropdown-button/index.ts +0 -11
- package/packages/ui/components/dropdown-button/src/dropdown-button-menu-items.vue +0 -79
- package/packages/ui/components/dropdown-button/src/dropdown-button.vue +0 -152
- package/packages/ui/components/dropdown-button/src/types.ts +0 -98
- package/packages/ui/components/dropdown-button/styles/dropdown-button.css +0 -171
- package/packages/ui/components/empty/README.md +0 -48
- package/packages/ui/components/empty/__tests__/empty.test.ts +0 -37
- package/packages/ui/components/empty/index.ts +0 -13
- package/packages/ui/components/empty/src/empty.vue +0 -73
- package/packages/ui/components/empty/src/types.ts +0 -32
- package/packages/ui/components/empty/styles/empty.css +0 -69
- package/packages/ui/components/error/README.md +0 -44
- package/packages/ui/components/error/__tests__/error.test.ts +0 -34
- package/packages/ui/components/error/index.ts +0 -13
- package/packages/ui/components/error/src/error.vue +0 -65
- package/packages/ui/components/error/src/types.ts +0 -28
- package/packages/ui/components/error/styles/error.css +0 -69
- package/packages/ui/components/filter-button/README.md +0 -68
- package/packages/ui/components/filter-button/__tests__/filter-button.test.ts +0 -30
- package/packages/ui/components/filter-button/index.ts +0 -11
- package/packages/ui/components/filter-button/src/filter-button.vue +0 -59
- package/packages/ui/components/filter-button/src/types.ts +0 -9
- package/packages/ui/components/form/README.md +0 -750
- package/packages/ui/components/form/__tests__/form-ai-registry-integration.test.ts +0 -214
- package/packages/ui/components/form/__tests__/form-field.test.ts +0 -377
- package/packages/ui/components/form/__tests__/form-item-ai-actions.test.ts +0 -299
- package/packages/ui/components/form/__tests__/form-item.test.ts +0 -110
- package/packages/ui/components/form/__tests__/form-wrapper-reject-forward.test.ts +0 -269
- package/packages/ui/components/form/__tests__/form.test.ts +0 -148
- package/packages/ui/components/form/base/cascader/README.md +0 -75
- package/packages/ui/components/form/base/cascader/__tests__/ai-capability.test.ts +0 -507
- package/packages/ui/components/form/base/cascader/__tests__/cascader.test.ts +0 -203
- package/packages/ui/components/form/base/cascader/index.ts +0 -14
- package/packages/ui/components/form/base/cascader/src/cascader.vue +0 -505
- package/packages/ui/components/form/base/cascader/src/types.ts +0 -168
- package/packages/ui/components/form/base/cascader/styles/cascader.css +0 -186
- package/packages/ui/components/form/base/checkbox/README.md +0 -110
- package/packages/ui/components/form/base/checkbox/__tests__/ai-capability.test.ts +0 -465
- package/packages/ui/components/form/base/checkbox/__tests__/checkbox.test.ts +0 -98
- package/packages/ui/components/form/base/checkbox/__tests__/group-integration.test.ts +0 -192
- package/packages/ui/components/form/base/checkbox/index.ts +0 -18
- package/packages/ui/components/form/base/checkbox/src/checkbox-group.vue +0 -311
- package/packages/ui/components/form/base/checkbox/src/checkbox.ts +0 -210
- package/packages/ui/components/form/base/checkbox/src/checkbox.vue +0 -368
- package/packages/ui/components/form/base/checkbox/styles/checkbox.css +0 -24
- package/packages/ui/components/form/base/data-picker/README.md +0 -192
- package/packages/ui/components/form/base/data-picker/__tests__/ai-capability.test.ts +0 -566
- package/packages/ui/components/form/base/data-picker/__tests__/data-picker.test.ts +0 -628
- package/packages/ui/components/form/base/data-picker/index.ts +0 -23
- package/packages/ui/components/form/base/data-picker/src/data-picker.ts +0 -192
- package/packages/ui/components/form/base/data-picker/src/data-picker.vue +0 -1267
- package/packages/ui/components/form/base/data-picker/styles/data-picker.css +0 -174
- package/packages/ui/components/form/base/date-picker/README.md +0 -94
- package/packages/ui/components/form/base/date-picker/__tests__/ai-capability.test.ts +0 -462
- package/packages/ui/components/form/base/date-picker/__tests__/date-picker.test.ts +0 -115
- package/packages/ui/components/form/base/date-picker/index.ts +0 -13
- package/packages/ui/components/form/base/date-picker/src/date-picker.ts +0 -212
- package/packages/ui/components/form/base/date-picker/src/date-picker.vue +0 -871
- package/packages/ui/components/form/base/date-picker/styles/date-picker.css +0 -210
- package/packages/ui/components/form/base/datetime-picker/README.md +0 -197
- package/packages/ui/components/form/base/datetime-picker/__tests__/ai-capability.test.ts +0 -368
- package/packages/ui/components/form/base/datetime-picker/__tests__/datetime-picker.test.ts +0 -445
- package/packages/ui/components/form/base/datetime-picker/index.ts +0 -13
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.ts +0 -149
- package/packages/ui/components/form/base/datetime-picker/src/datetime-picker.vue +0 -1158
- package/packages/ui/components/form/base/datetime-picker/styles/datetime-picker.css +0 -570
- package/packages/ui/components/form/base/file-upload/README.md +0 -73
- package/packages/ui/components/form/base/file-upload/__tests__/ai-capability.test.ts +0 -223
- package/packages/ui/components/form/base/file-upload/__tests__/file-upload.spec.ts +0 -199
- package/packages/ui/components/form/base/file-upload/index.ts +0 -11
- package/packages/ui/components/form/base/file-upload/src/file-upload.ts +0 -95
- package/packages/ui/components/form/base/file-upload/src/file-upload.vue +0 -451
- package/packages/ui/components/form/base/file-upload/styles/file-upload.css +0 -57
- package/packages/ui/components/form/base/image-upload/README.md +0 -70
- package/packages/ui/components/form/base/image-upload/__tests__/ai-capability.test.ts +0 -149
- package/packages/ui/components/form/base/image-upload/__tests__/image-upload.spec.ts +0 -282
- package/packages/ui/components/form/base/image-upload/index.ts +0 -11
- package/packages/ui/components/form/base/image-upload/src/image-upload.ts +0 -76
- package/packages/ui/components/form/base/image-upload/src/image-upload.vue +0 -657
- package/packages/ui/components/form/base/index.ts +0 -24
- package/packages/ui/components/form/base/input/README.md +0 -63
- package/packages/ui/components/form/base/input/__tests__/ai-capability.test.ts +0 -143
- package/packages/ui/components/form/base/input/__tests__/input.test.ts +0 -195
- package/packages/ui/components/form/base/input/index.ts +0 -37
- package/packages/ui/components/form/base/input/src/input.ts +0 -104
- package/packages/ui/components/form/base/input/src/input.vue +0 -384
- package/packages/ui/components/form/base/input/styles/input.css +0 -198
- package/packages/ui/components/form/base/location-picker/README.md +0 -92
- package/packages/ui/components/form/base/location-picker/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/location-picker/__tests__/location-picker.test.ts +0 -161
- package/packages/ui/components/form/base/location-picker/index.ts +0 -13
- package/packages/ui/components/form/base/location-picker/src/location-picker.ts +0 -99
- package/packages/ui/components/form/base/location-picker/src/location-picker.vue +0 -558
- package/packages/ui/components/form/base/radio/README.md +0 -95
- package/packages/ui/components/form/base/radio/__tests__/ai-capability.test.ts +0 -578
- package/packages/ui/components/form/base/radio/__tests__/group-integration.test.ts +0 -191
- package/packages/ui/components/form/base/radio/__tests__/radio.test.ts +0 -64
- package/packages/ui/components/form/base/radio/index.ts +0 -18
- package/packages/ui/components/form/base/radio/src/radio-group.vue +0 -270
- package/packages/ui/components/form/base/radio/src/radio.ts +0 -154
- package/packages/ui/components/form/base/radio/src/radio.vue +0 -141
- package/packages/ui/components/form/base/radio/styles/radio.css +0 -12
- package/packages/ui/components/form/base/region-picker/README.md +0 -166
- package/packages/ui/components/form/base/region-picker/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/region-picker/__tests__/region-picker.spec.ts +0 -556
- package/packages/ui/components/form/base/region-picker/index.ts +0 -19
- package/packages/ui/components/form/base/region-picker/src/region-picker.ts +0 -333
- package/packages/ui/components/form/base/region-picker/src/region-picker.vue +0 -552
- package/packages/ui/components/form/base/select/README.md +0 -66
- package/packages/ui/components/form/base/select/__tests__/ai-capability.test.ts +0 -463
- package/packages/ui/components/form/base/select/__tests__/select.test.ts +0 -167
- package/packages/ui/components/form/base/select/index.ts +0 -15
- package/packages/ui/components/form/base/select/src/select.ts +0 -173
- package/packages/ui/components/form/base/select/src/select.vue +0 -534
- package/packages/ui/components/form/base/select/styles/select.css +0 -206
- package/packages/ui/components/form/base/signature/README.md +0 -96
- package/packages/ui/components/form/base/signature/__tests__/ai-capability.test.ts +0 -147
- package/packages/ui/components/form/base/signature/__tests__/signature.spec.ts +0 -156
- package/packages/ui/components/form/base/signature/index.ts +0 -14
- package/packages/ui/components/form/base/signature/src/signature.ts +0 -100
- package/packages/ui/components/form/base/signature/src/signature.vue +0 -871
- package/packages/ui/components/form/base/switch/README.md +0 -102
- package/packages/ui/components/form/base/switch/__tests__/ai-capability.test.ts +0 -545
- package/packages/ui/components/form/base/switch/__tests__/switch.test.ts +0 -105
- package/packages/ui/components/form/base/switch/index.ts +0 -12
- package/packages/ui/components/form/base/switch/src/switch.ts +0 -133
- package/packages/ui/components/form/base/switch/src/switch.vue +0 -385
- package/packages/ui/components/form/base/switch/styles/switch.css +0 -35
- package/packages/ui/components/form/base/text-area/README.md +0 -89
- package/packages/ui/components/form/base/text-area/__tests__/ai-capability.test.ts +0 -176
- package/packages/ui/components/form/base/text-area/__tests__/text-area.test.ts +0 -152
- package/packages/ui/components/form/base/text-area/index.ts +0 -37
- package/packages/ui/components/form/base/text-area/src/text-area.ts +0 -137
- package/packages/ui/components/form/base/text-area/src/text-area.vue +0 -405
- package/packages/ui/components/form/base/text-area/styles/text-area.css +0 -137
- package/packages/ui/components/form/base/time-picker/README.md +0 -75
- package/packages/ui/components/form/base/time-picker/__tests__/ai-capability.test.ts +0 -135
- package/packages/ui/components/form/base/time-picker/__tests__/time-picker.test.ts +0 -258
- package/packages/ui/components/form/base/time-picker/index.ts +0 -13
- package/packages/ui/components/form/base/time-picker/src/time-picker.ts +0 -141
- package/packages/ui/components/form/base/time-picker/src/time-picker.vue +0 -844
- package/packages/ui/components/form/base/time-picker/styles/time-picker.css +0 -124
- package/packages/ui/components/form/base/upload/README.md +0 -126
- package/packages/ui/components/form/base/upload/__tests__/ai-capability.test.ts +0 -145
- package/packages/ui/components/form/base/upload/__tests__/upload.spec.ts +0 -288
- package/packages/ui/components/form/base/upload/index.ts +0 -11
- package/packages/ui/components/form/base/upload/src/upload.ts +0 -171
- package/packages/ui/components/form/base/upload/src/upload.vue +0 -890
- package/packages/ui/components/form/base/upload/styles/upload.css +0 -116
- package/packages/ui/components/form/index.ts +0 -138
- package/packages/ui/components/form/items/form-array/README.md +0 -61
- package/packages/ui/components/form/items/form-array/__tests__/form-array.test.ts +0 -122
- package/packages/ui/components/form/items/form-array/index.ts +0 -2
- package/packages/ui/components/form/items/form-array/src/form-array.vue +0 -80
- package/packages/ui/components/form/items/form-array/src/types.ts +0 -27
- package/packages/ui/components/form/items/form-array/styles/form-array.css +0 -99
- package/packages/ui/components/form/items/form-cascader/README.md +0 -132
- package/packages/ui/components/form/items/form-cascader/__tests__/form-cascader.test.ts +0 -99
- package/packages/ui/components/form/items/form-cascader/index.ts +0 -1
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.ts +0 -7
- package/packages/ui/components/form/items/form-cascader/src/form-cascader.vue +0 -15
- package/packages/ui/components/form/items/form-checkbox/README.md +0 -121
- package/packages/ui/components/form/items/form-checkbox/__tests__/form-checkbox.test.ts +0 -93
- package/packages/ui/components/form/items/form-checkbox/index.ts +0 -1
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.ts +0 -7
- package/packages/ui/components/form/items/form-checkbox/src/form-checkbox.vue +0 -15
- package/packages/ui/components/form/items/form-data-picker/README.md +0 -111
- package/packages/ui/components/form/items/form-data-picker/__tests__/form-data-picker.test.ts +0 -98
- package/packages/ui/components/form/items/form-data-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.ts +0 -7
- package/packages/ui/components/form/items/form-data-picker/src/form-data-picker.vue +0 -17
- package/packages/ui/components/form/items/form-date-picker/README.md +0 -119
- package/packages/ui/components/form/items/form-date-picker/__tests__/form-date-picker.test.ts +0 -104
- package/packages/ui/components/form/items/form-date-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.ts +0 -7
- package/packages/ui/components/form/items/form-date-picker/src/form-date-picker.vue +0 -17
- package/packages/ui/components/form/items/form-datetime-picker/README.md +0 -112
- package/packages/ui/components/form/items/form-datetime-picker/__tests__/form-datetime-picker.test.ts +0 -105
- package/packages/ui/components/form/items/form-datetime-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.ts +0 -7
- package/packages/ui/components/form/items/form-datetime-picker/src/form-datetime-picker.vue +0 -17
- package/packages/ui/components/form/items/form-dynamic/README.md +0 -105
- package/packages/ui/components/form/items/form-dynamic/__tests__/form-dynamic.test.ts +0 -172
- package/packages/ui/components/form/items/form-dynamic/index.ts +0 -2
- package/packages/ui/components/form/items/form-dynamic/src/form-dynamic.vue +0 -222
- package/packages/ui/components/form/items/form-dynamic/src/types.ts +0 -63
- package/packages/ui/components/form/items/form-file-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-file-upload/__tests__/form-file-upload.test.ts +0 -99
- package/packages/ui/components/form/items/form-file-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.ts +0 -7
- package/packages/ui/components/form/items/form-file-upload/src/form-file-upload.vue +0 -15
- package/packages/ui/components/form/items/form-group/README.md +0 -57
- package/packages/ui/components/form/items/form-group/__tests__/form-group.test.ts +0 -108
- package/packages/ui/components/form/items/form-group/index.ts +0 -2
- package/packages/ui/components/form/items/form-group/src/form-group.vue +0 -85
- package/packages/ui/components/form/items/form-group/src/types.ts +0 -37
- package/packages/ui/components/form/items/form-group/styles/form-group.css +0 -92
- package/packages/ui/components/form/items/form-image-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-image-upload/__tests__/form-image-upload.test.ts +0 -109
- package/packages/ui/components/form/items/form-image-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.ts +0 -7
- package/packages/ui/components/form/items/form-image-upload/src/form-image-upload.vue +0 -37
- package/packages/ui/components/form/items/form-input/README.md +0 -110
- package/packages/ui/components/form/items/form-input/__tests__/form-input.test.ts +0 -87
- package/packages/ui/components/form/items/form-input/index.ts +0 -1
- package/packages/ui/components/form/items/form-input/src/form-input.ts +0 -7
- package/packages/ui/components/form/items/form-input/src/form-input.vue +0 -15
- package/packages/ui/components/form/items/form-location-picker/README.md +0 -119
- package/packages/ui/components/form/items/form-location-picker/__tests__/form-location-picker.test.ts +0 -98
- package/packages/ui/components/form/items/form-location-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.ts +0 -7
- package/packages/ui/components/form/items/form-location-picker/src/form-location-picker.vue +0 -15
- package/packages/ui/components/form/items/form-radio/README.md +0 -125
- package/packages/ui/components/form/items/form-radio/__tests__/form-radio.test.ts +0 -104
- package/packages/ui/components/form/items/form-radio/index.ts +0 -1
- package/packages/ui/components/form/items/form-radio/src/form-radio.ts +0 -7
- package/packages/ui/components/form/items/form-radio/src/form-radio.vue +0 -15
- package/packages/ui/components/form/items/form-region-picker/README.md +0 -111
- package/packages/ui/components/form/items/form-region-picker/__tests__/form-region-picker.test.ts +0 -95
- package/packages/ui/components/form/items/form-region-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.ts +0 -7
- package/packages/ui/components/form/items/form-region-picker/src/form-region-picker.vue +0 -15
- package/packages/ui/components/form/items/form-select/README.md +0 -117
- package/packages/ui/components/form/items/form-select/__tests__/form-select.test.ts +0 -80
- package/packages/ui/components/form/items/form-select/index.ts +0 -1
- package/packages/ui/components/form/items/form-select/src/form-select.ts +0 -7
- package/packages/ui/components/form/items/form-select/src/form-select.vue +0 -15
- package/packages/ui/components/form/items/form-signature/README.md +0 -89
- package/packages/ui/components/form/items/form-signature/__tests__/form-signature.test.ts +0 -109
- package/packages/ui/components/form/items/form-signature/index.ts +0 -1
- package/packages/ui/components/form/items/form-signature/src/form-signature.ts +0 -7
- package/packages/ui/components/form/items/form-signature/src/form-signature.vue +0 -15
- package/packages/ui/components/form/items/form-slider/README.md +0 -125
- package/packages/ui/components/form/items/form-slider/__tests__/form-slider.test.ts +0 -95
- package/packages/ui/components/form/items/form-slider/index.ts +0 -1
- package/packages/ui/components/form/items/form-slider/src/form-slider.ts +0 -7
- package/packages/ui/components/form/items/form-slider/src/form-slider.vue +0 -15
- package/packages/ui/components/form/items/form-subform/README.md +0 -71
- package/packages/ui/components/form/items/form-subform/__tests__/form-subform.test.ts +0 -116
- package/packages/ui/components/form/items/form-subform/index.ts +0 -2
- package/packages/ui/components/form/items/form-subform/src/form-subform.vue +0 -92
- package/packages/ui/components/form/items/form-subform/src/types.ts +0 -32
- package/packages/ui/components/form/items/form-subform/styles/form-subform.css +0 -127
- package/packages/ui/components/form/items/form-switch/README.md +0 -118
- package/packages/ui/components/form/items/form-switch/__tests__/form-switch.test.ts +0 -88
- package/packages/ui/components/form/items/form-switch/index.ts +0 -1
- package/packages/ui/components/form/items/form-switch/src/form-switch.ts +0 -7
- package/packages/ui/components/form/items/form-switch/src/form-switch.vue +0 -15
- package/packages/ui/components/form/items/form-table/OPTIMIZATION_REPORT.md +0 -205
- package/packages/ui/components/form/items/form-table/README.md +0 -144
- package/packages/ui/components/form/items/form-table/__tests__/form-table.test.ts +0 -373
- package/packages/ui/components/form/items/form-table/index.ts +0 -3
- package/packages/ui/components/form/items/form-table/src/column-filter-popover.vue +0 -149
- package/packages/ui/components/form/items/form-table/src/form-table.vue +0 -1315
- package/packages/ui/components/form/items/form-table/src/types.ts +0 -165
- package/packages/ui/components/form/items/form-table/styles/column-filter-popover.css +0 -138
- package/packages/ui/components/form/items/form-table/styles/form-table.css +0 -393
- package/packages/ui/components/form/items/form-textarea/README.md +0 -123
- package/packages/ui/components/form/items/form-textarea/__tests__/form-textarea.test.ts +0 -93
- package/packages/ui/components/form/items/form-textarea/index.ts +0 -1
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.ts +0 -7
- package/packages/ui/components/form/items/form-textarea/src/form-textarea.vue +0 -15
- package/packages/ui/components/form/items/form-time-picker/README.md +0 -117
- package/packages/ui/components/form/items/form-time-picker/__tests__/form-time-picker.test.ts +0 -105
- package/packages/ui/components/form/items/form-time-picker/index.ts +0 -1
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.ts +0 -7
- package/packages/ui/components/form/items/form-time-picker/src/form-time-picker.vue +0 -17
- package/packages/ui/components/form/items/form-upload/README.md +0 -92
- package/packages/ui/components/form/items/form-upload/__tests__/form-upload.test.ts +0 -137
- package/packages/ui/components/form/items/form-upload/index.ts +0 -1
- package/packages/ui/components/form/items/form-upload/src/form-upload.ts +0 -7
- package/packages/ui/components/form/items/form-upload/src/form-upload.vue +0 -15
- package/packages/ui/components/form/shared/types.ts +0 -82
- package/packages/ui/components/form/src/form-field.ts +0 -96
- package/packages/ui/components/form/src/form-field.vue +0 -404
- package/packages/ui/components/form/src/form-item.vue +0 -646
- package/packages/ui/components/form/src/form.ts +0 -11
- package/packages/ui/components/form/src/form.vue +0 -156
- package/packages/ui/components/form/src/types.ts +0 -337
- package/packages/ui/components/form/src/use-form-field.ts +0 -190
- package/packages/ui/components/form/styles/form-ai-actions.css +0 -41
- package/packages/ui/components/form/styles/form-field.css +0 -123
- package/packages/ui/components/form/styles/form-item-ai-status.css +0 -212
- package/packages/ui/components/form/styles/form-item.css +0 -218
- package/packages/ui/components/form/styles/form.css +0 -132
- package/packages/ui/components/form-ai-status/README.md +0 -86
- package/packages/ui/components/form-ai-status/__tests__/form-ai-status.test.ts +0 -183
- package/packages/ui/components/form-ai-status/index.ts +0 -12
- package/packages/ui/components/form-ai-status/src/form-ai-status.vue +0 -254
- package/packages/ui/components/form-ai-status/src/types.ts +0 -36
- package/packages/ui/components/form-ai-status/styles/form-ai-status.css +0 -238
- package/packages/ui/components/form-ai-toolbar/README.md +0 -100
- package/packages/ui/components/form-ai-toolbar/__tests__/form-ai-toolbar.test.ts +0 -344
- package/packages/ui/components/form-ai-toolbar/index.ts +0 -13
- package/packages/ui/components/form-ai-toolbar/src/form-ai-toolbar.vue +0 -598
- package/packages/ui/components/form-ai-toolbar/src/types.ts +0 -130
- package/packages/ui/components/form-ai-toolbar/styles/form-ai-toolbar.css +0 -281
- package/packages/ui/components/icon/README.md +0 -137
- package/packages/ui/components/icon/__tests__/icon.test.ts +0 -125
- package/packages/ui/components/icon/index.ts +0 -13
- package/packages/ui/components/icon/src/icon.ts +0 -67
- package/packages/ui/components/icon/src/icon.vue +0 -69
- package/packages/ui/components/icon/styles/icon.css +0 -41
- package/packages/ui/components/image-preview/README.md +0 -90
- package/packages/ui/components/image-preview/__tests__/image-preview.test.ts +0 -183
- package/packages/ui/components/image-preview/index.ts +0 -13
- package/packages/ui/components/image-preview/src/image-preview.vue +0 -71
- package/packages/ui/components/image-preview/src/index.ts +0 -11
- package/packages/ui/components/image-preview/src/preview-layer.vue +0 -90
- package/packages/ui/components/image-preview/src/types.ts +0 -63
- package/packages/ui/components/image-preview/styles/image-preview.css +0 -39
- package/packages/ui/components/layout/app-bar/README.md +0 -59
- package/packages/ui/components/layout/app-bar/__tests__/app-bar.test.ts +0 -124
- package/packages/ui/components/layout/app-bar/index.ts +0 -13
- package/packages/ui/components/layout/app-bar/src/app-bar.vue +0 -106
- package/packages/ui/components/layout/app-bar/src/types.ts +0 -43
- package/packages/ui/components/layout/app-bar/styles/app-bar.css +0 -175
- package/packages/ui/components/layout/card/README.md +0 -90
- package/packages/ui/components/layout/card/__tests__/card.test.ts +0 -321
- package/packages/ui/components/layout/card/index.ts +0 -13
- package/packages/ui/components/layout/card/src/card.vue +0 -210
- package/packages/ui/components/layout/card/src/types.ts +0 -79
- package/packages/ui/components/layout/card/styles/card.css +0 -334
- package/packages/ui/components/layout/container/README.md +0 -29
- package/packages/ui/components/layout/container/__tests__/container.test.ts +0 -74
- package/packages/ui/components/layout/container/index.ts +0 -13
- package/packages/ui/components/layout/container/src/container.vue +0 -35
- package/packages/ui/components/layout/container/src/types.ts +0 -15
- package/packages/ui/components/layout/container/styles/container.css +0 -50
- package/packages/ui/components/layout/detail-layout/README.md +0 -30
- package/packages/ui/components/layout/detail-layout/__tests__/detail-layout.test.ts +0 -75
- package/packages/ui/components/layout/detail-layout/index.ts +0 -13
- package/packages/ui/components/layout/detail-layout/src/detail-layout.vue +0 -53
- package/packages/ui/components/layout/detail-layout/src/types.ts +0 -22
- package/packages/ui/components/layout/detail-layout/styles/detail-layout.css +0 -71
- package/packages/ui/components/layout/form-layout/README.md +0 -59
- package/packages/ui/components/layout/form-layout/__tests__/form-layout.test.ts +0 -140
- package/packages/ui/components/layout/form-layout/index.ts +0 -13
- package/packages/ui/components/layout/form-layout/src/form-layout.vue +0 -93
- package/packages/ui/components/layout/form-layout/src/types.ts +0 -64
- package/packages/ui/components/layout/form-layout/styles/form-layout.css +0 -98
- package/packages/ui/components/layout/grid/README.md +0 -41
- package/packages/ui/components/layout/grid/__tests__/grid.test.ts +0 -77
- package/packages/ui/components/layout/grid/index.ts +0 -13
- package/packages/ui/components/layout/grid/src/grid.vue +0 -79
- package/packages/ui/components/layout/grid/src/types.ts +0 -44
- package/packages/ui/components/layout/grid/styles/grid.css +0 -46
- package/packages/ui/components/layout/hero/README.md +0 -59
- package/packages/ui/components/layout/hero/__tests__/hero.test.ts +0 -112
- package/packages/ui/components/layout/hero/index.ts +0 -13
- package/packages/ui/components/layout/hero/src/hero.vue +0 -143
- package/packages/ui/components/layout/hero/src/types.ts +0 -44
- package/packages/ui/components/layout/hero/styles/hero.css +0 -129
- package/packages/ui/components/layout/inline/README.md +0 -30
- package/packages/ui/components/layout/inline/__tests__/inline.test.ts +0 -154
- package/packages/ui/components/layout/inline/index.ts +0 -13
- package/packages/ui/components/layout/inline/src/inline.vue +0 -99
- package/packages/ui/components/layout/inline/src/types.ts +0 -23
- package/packages/ui/components/layout/inline/styles/inline.css +0 -150
- package/packages/ui/components/layout/master-detail/README.md +0 -36
- package/packages/ui/components/layout/master-detail/__tests__/master-detail.test.ts +0 -104
- package/packages/ui/components/layout/master-detail/index.ts +0 -13
- package/packages/ui/components/layout/master-detail/src/master-detail.vue +0 -72
- package/packages/ui/components/layout/master-detail/src/types.ts +0 -28
- package/packages/ui/components/layout/master-detail/styles/master-detail.css +0 -82
- package/packages/ui/components/layout/page/README.md +0 -35
- package/packages/ui/components/layout/page/__tests__/page.test.ts +0 -136
- package/packages/ui/components/layout/page/index.ts +0 -13
- package/packages/ui/components/layout/page/src/page.vue +0 -85
- package/packages/ui/components/layout/page/src/types.ts +0 -39
- package/packages/ui/components/layout/page/styles/page.css +0 -177
- package/packages/ui/components/layout/page-header/README.md +0 -39
- package/packages/ui/components/layout/page-header/__tests__/page-header.test.ts +0 -198
- package/packages/ui/components/layout/page-header/index.ts +0 -13
- package/packages/ui/components/layout/page-header/src/page-header.vue +0 -133
- package/packages/ui/components/layout/page-header/src/types.ts +0 -56
- package/packages/ui/components/layout/page-header/styles/page-header.css +0 -155
- package/packages/ui/components/layout/section/README.md +0 -40
- package/packages/ui/components/layout/section/__tests__/section.test.ts +0 -121
- package/packages/ui/components/layout/section/index.ts +0 -13
- package/packages/ui/components/layout/section/src/section.vue +0 -79
- package/packages/ui/components/layout/section/src/types.ts +0 -28
- package/packages/ui/components/layout/section/styles/section.css +0 -103
- package/packages/ui/components/layout/sidebar-layout/README.md +0 -60
- package/packages/ui/components/layout/sidebar-layout/__tests__/sidebar-layout.test.ts +0 -220
- package/packages/ui/components/layout/sidebar-layout/index.ts +0 -13
- package/packages/ui/components/layout/sidebar-layout/src/sidebar-layout.vue +0 -113
- package/packages/ui/components/layout/sidebar-layout/src/types.ts +0 -54
- package/packages/ui/components/layout/sidebar-layout/styles/sidebar-layout.css +0 -211
- package/packages/ui/components/layout/split/README.md +0 -40
- package/packages/ui/components/layout/split/__tests__/split.test.ts +0 -99
- package/packages/ui/components/layout/split/index.ts +0 -13
- package/packages/ui/components/layout/split/src/split.vue +0 -65
- package/packages/ui/components/layout/split/src/types.ts +0 -49
- package/packages/ui/components/layout/split/styles/split.css +0 -40
- package/packages/ui/components/layout/stack/README.md +0 -29
- package/packages/ui/components/layout/stack/__tests__/stack.test.ts +0 -66
- package/packages/ui/components/layout/stack/index.ts +0 -13
- package/packages/ui/components/layout/stack/src/stack.vue +0 -31
- package/packages/ui/components/layout/stack/src/types.ts +0 -14
- package/packages/ui/components/layout/stack/styles/stack.css +0 -61
- package/packages/ui/components/layout/state-container/README.md +0 -45
- package/packages/ui/components/layout/state-container/__tests__/state-container.test.ts +0 -123
- package/packages/ui/components/layout/state-container/index.ts +0 -13
- package/packages/ui/components/layout/state-container/src/state-container.vue +0 -72
- package/packages/ui/components/layout/state-container/src/types.ts +0 -46
- package/packages/ui/components/layout/state-container/styles/state-container.css +0 -71
- package/packages/ui/components/layout/toolbar/README.md +0 -34
- package/packages/ui/components/layout/toolbar/__tests__/toolbar.test.ts +0 -90
- package/packages/ui/components/layout/toolbar/index.ts +0 -13
- package/packages/ui/components/layout/toolbar/src/toolbar.vue +0 -50
- package/packages/ui/components/layout/toolbar/src/types.ts +0 -19
- package/packages/ui/components/layout/toolbar/styles/toolbar.css +0 -80
- package/packages/ui/components/loading/README.md +0 -39
- package/packages/ui/components/loading/__tests__/loading.test.ts +0 -37
- package/packages/ui/components/loading/index.ts +0 -13
- package/packages/ui/components/loading/src/loading.vue +0 -59
- package/packages/ui/components/loading/src/types.ts +0 -27
- package/packages/ui/components/loading/styles/loading.css +0 -59
- package/packages/ui/components/menu/README.md +0 -51
- package/packages/ui/components/menu/__tests__/menu.test.ts +0 -80
- package/packages/ui/components/menu/index.ts +0 -11
- package/packages/ui/components/menu/src/menu.ts +0 -49
- package/packages/ui/components/menu/src/menu.vue +0 -103
- package/packages/ui/components/menu/styles/menu.css +0 -19
- package/packages/ui/components/message/README.md +0 -69
- package/packages/ui/components/message/__tests__/message.test.ts +0 -98
- package/packages/ui/components/message/index.ts +0 -13
- package/packages/ui/components/message/src/message.ts +0 -87
- package/packages/ui/components/message/src/message.vue +0 -88
- package/packages/ui/components/message/styles/message.css +0 -70
- package/packages/ui/components/metric/README.md +0 -63
- package/packages/ui/components/metric/__tests__/metric.test.ts +0 -166
- package/packages/ui/components/metric/index.ts +0 -13
- package/packages/ui/components/metric/src/metric.vue +0 -107
- package/packages/ui/components/metric/src/types.ts +0 -50
- package/packages/ui/components/metric/styles/metric.css +0 -233
- package/packages/ui/components/modal/README.md +0 -91
- package/packages/ui/components/modal/__tests__/modal.test.ts +0 -145
- package/packages/ui/components/modal/index.ts +0 -13
- package/packages/ui/components/modal/src/modal.ts +0 -153
- package/packages/ui/components/modal/src/modal.vue +0 -234
- package/packages/ui/components/modal/styles/modal.css +0 -104
- package/packages/ui/components/more-action-button/README.md +0 -68
- package/packages/ui/components/more-action-button/__tests__/more-action-button.test.ts +0 -30
- package/packages/ui/components/more-action-button/index.ts +0 -11
- package/packages/ui/components/more-action-button/src/more-action-button.vue +0 -59
- package/packages/ui/components/more-action-button/src/types.ts +0 -9
- package/packages/ui/components/navigation/side-nav/README.md +0 -59
- package/packages/ui/components/navigation/side-nav/__tests__/side-nav.test.ts +0 -105
- package/packages/ui/components/navigation/side-nav/index.ts +0 -13
- package/packages/ui/components/navigation/side-nav/src/side-nav.vue +0 -147
- package/packages/ui/components/navigation/side-nav/src/types.ts +0 -50
- package/packages/ui/components/navigation/side-nav/styles/side-nav.css +0 -171
- package/packages/ui/components/notification/README.md +0 -82
- package/packages/ui/components/notification/__tests__/notification.test.ts +0 -150
- package/packages/ui/components/notification/index.ts +0 -30
- package/packages/ui/components/notification/src/notification.vue +0 -114
- package/packages/ui/components/notification/src/types.ts +0 -67
- package/packages/ui/components/notification/src/use-notification.ts +0 -136
- package/packages/ui/components/notification/styles/notification.css +0 -4
- package/packages/ui/components/pagination/README.md +0 -82
- package/packages/ui/components/pagination/__tests__/pagination.test.ts +0 -210
- package/packages/ui/components/pagination/index.ts +0 -13
- package/packages/ui/components/pagination/src/pagination.ts +0 -86
- package/packages/ui/components/pagination/src/pagination.vue +0 -270
- package/packages/ui/components/pagination/styles/pagination.css +0 -143
- package/packages/ui/components/progress/README.md +0 -132
- package/packages/ui/components/progress/__tests__/progress.test.ts +0 -81
- package/packages/ui/components/progress/index.ts +0 -12
- package/packages/ui/components/progress/src/progress.ts +0 -80
- package/packages/ui/components/progress/src/progress.vue +0 -202
- package/packages/ui/components/skeleton/README.md +0 -71
- package/packages/ui/components/skeleton/__tests__/skeleton.test.ts +0 -138
- package/packages/ui/components/skeleton/index.ts +0 -13
- package/packages/ui/components/skeleton/src/skeleton.ts +0 -46
- package/packages/ui/components/skeleton/src/skeleton.vue +0 -67
- package/packages/ui/components/skeleton/styles/skeleton.css +0 -75
- package/packages/ui/components/slider/README.md +0 -87
- package/packages/ui/components/slider/__tests__/ai-capability.test.ts +0 -469
- package/packages/ui/components/slider/__tests__/slider.test.ts +0 -235
- package/packages/ui/components/slider/index.ts +0 -26
- package/packages/ui/components/slider/src/slider.ts +0 -192
- package/packages/ui/components/slider/src/slider.vue +0 -504
- package/packages/ui/components/slider/src/use-slider.ts +0 -399
- package/packages/ui/components/slider/styles/slider.css +0 -344
- package/packages/ui/components/split-button/README.md +0 -71
- package/packages/ui/components/split-button/__tests__/split-button.test.ts +0 -32
- package/packages/ui/components/split-button/index.ts +0 -11
- package/packages/ui/components/split-button/src/split-button.vue +0 -69
- package/packages/ui/components/split-button/src/types.ts +0 -34
- package/packages/ui/components/split-button/styles/split-button.css +0 -15
- package/packages/ui/components/status-dot/README.md +0 -42
- package/packages/ui/components/status-dot/__tests__/status-dot.test.ts +0 -53
- package/packages/ui/components/status-dot/index.ts +0 -13
- package/packages/ui/components/status-dot/src/status-dot.vue +0 -39
- package/packages/ui/components/status-dot/src/types.ts +0 -23
- package/packages/ui/components/status-dot/styles/status-dot.css +0 -65
- package/packages/ui/components/steps/README.md +0 -101
- package/packages/ui/components/steps/__tests__/steps.test.ts +0 -261
- package/packages/ui/components/steps/index.ts +0 -15
- package/packages/ui/components/steps/src/step.vue +0 -99
- package/packages/ui/components/steps/src/steps.ts +0 -93
- package/packages/ui/components/steps/src/steps.vue +0 -143
- package/packages/ui/components/steps/styles/step.css +0 -116
- package/packages/ui/components/steps/styles/steps.css +0 -200
- package/packages/ui/components/table/README.md +0 -81
- package/packages/ui/components/table/__tests__/table.test.ts +0 -162
- package/packages/ui/components/table/index.ts +0 -13
- package/packages/ui/components/table/src/table.ts +0 -195
- package/packages/ui/components/table/src/table.vue +0 -453
- package/packages/ui/components/table/styles/table.css +0 -88
- package/packages/ui/components/tabs/README.md +0 -88
- package/packages/ui/components/tabs/__tests__/tabs.test.ts +0 -161
- package/packages/ui/components/tabs/index.ts +0 -19
- package/packages/ui/components/tabs/src/tab-pane.ts +0 -18
- package/packages/ui/components/tabs/src/tab-pane.vue +0 -11
- package/packages/ui/components/tabs/src/tabs-content.vue +0 -58
- package/packages/ui/components/tabs/src/tabs-list.vue +0 -36
- package/packages/ui/components/tabs/src/tabs-trigger.vue +0 -70
- package/packages/ui/components/tabs/src/tabs.ts +0 -94
- package/packages/ui/components/tabs/src/tabs.vue +0 -101
- package/packages/ui/components/tabs/src/types.ts +0 -126
- package/packages/ui/components/tabs/styles/tabs.css +0 -239
- package/packages/ui/components/tag/README.md +0 -67
- package/packages/ui/components/tag/__tests__/tag.test.ts +0 -222
- package/packages/ui/components/tag/index.ts +0 -13
- package/packages/ui/components/tag/src/tag.ts +0 -87
- package/packages/ui/components/tag/src/tag.vue +0 -163
- package/packages/ui/components/tag/styles/tag.css +0 -47
- package/packages/ui/components/timeline/README.md +0 -80
- package/packages/ui/components/timeline/__tests__/timeline.test.ts +0 -78
- package/packages/ui/components/timeline/index.ts +0 -15
- package/packages/ui/components/timeline/src/timeline-item.vue +0 -38
- package/packages/ui/components/timeline/src/timeline.ts +0 -76
- package/packages/ui/components/timeline/src/timeline.vue +0 -30
- package/packages/ui/components/timeline/styles/timeline-item.css +0 -49
- package/packages/ui/components/timeline/styles/timeline.css +0 -43
- package/packages/ui/components/tooltip/README.md +0 -134
- package/packages/ui/components/tooltip/__tests__/tooltip.test.ts +0 -125
- package/packages/ui/components/tooltip/index.ts +0 -12
- package/packages/ui/components/tooltip/src/tooltip.ts +0 -66
- package/packages/ui/components/tooltip/src/tooltip.vue +0 -189
- package/packages/ui/components/tree/README.md +0 -54
- package/packages/ui/components/tree/__tests__/tree.test.ts +0 -80
- package/packages/ui/components/tree/index.ts +0 -11
- package/packages/ui/components/tree/src/tree.ts +0 -51
- package/packages/ui/components/tree/src/tree.vue +0 -242
- package/packages/ui/components/tree/styles/tree.css +0 -31
- package/packages/ui/components/typography/README.md +0 -120
- package/packages/ui/components/typography/__tests__/typography.test.ts +0 -164
- package/packages/ui/components/typography/index.ts +0 -13
- package/packages/ui/components/typography/src/typography.ts +0 -95
- package/packages/ui/components/typography/src/typography.vue +0 -94
- package/packages/ui/components/typography/styles/typography.css +0 -47
- package/packages/ui/components/upload/README.md +0 -103
- package/packages/ui/components/upload/__tests__/upload.test.ts +0 -181
- package/packages/ui/components/upload/index.ts +0 -11
- package/packages/ui/components/upload/src/upload.ts +0 -92
- package/packages/ui/components/upload/src/upload.vue +0 -382
- package/packages/ui/components/upload/styles/upload.css +0 -283
- package/packages/ui/components/watermark/README.md +0 -94
- package/packages/ui/components/watermark/__tests__/watermark.test.ts +0 -252
- package/packages/ui/components/watermark/index.ts +0 -13
- package/packages/ui/components/watermark/src/index.ts +0 -13
- package/packages/ui/components/watermark/src/types.ts +0 -86
- package/packages/ui/components/watermark/src/use-watermark.ts +0 -132
- package/packages/ui/components/watermark/src/watermark.vue +0 -181
- package/packages/ui/components/watermark/styles/watermark.css +0 -27
- package/packages/ui/index.ts +0 -338
- package/packages/ui/lib/utils.ts +0 -6
- package/packages/ui/lowcode-agent/icons.ts +0 -148
- package/packages/ui/lowcode-agent/registry.json +0 -37004
- package/packages/ui/src/composables/__tests__/use-floating-popup.test.ts +0 -275
- package/packages/ui/src/composables/__tests__/use-form-ai-actions.test.ts +0 -101
- package/packages/ui/src/composables/__tests__/use-form-ai-registry.test.ts +0 -92
- package/packages/ui/src/composables/__tests__/use-form-ai.test.ts +0 -116
- package/packages/ui/src/composables/index.ts +0 -10
- package/packages/ui/src/composables/use-ai-state-machine.ts +0 -142
- package/packages/ui/src/composables/use-floating-popup.ts +0 -237
- package/packages/ui/src/composables/use-form-ai-registry.ts +0 -198
- package/packages/ui/src/composables/use-form-ai.ts +0 -280
- package/packages/ui/src/composables/useLightbox.ts +0 -51
- package/packages/ui/src/request/document.ts +0 -53
- package/packages/ui/src/request/enum.ts +0 -18
- package/packages/ui/src/request/index.ts +0 -4
- package/packages/ui/src/request/request.ts +0 -200
- package/packages/ui/src/request/types.ts +0 -27
- package/packages/ui/src/types/form-ai-registry.ts +0 -70
- package/packages/ui/src/types/form-ai.ts +0 -84
- package/packages/ui/src/utils/date-format.ts +0 -60
- package/packages/ui/styles/design-tokens.css +0 -383
- package/packages/ui/styles/tailwind.css +0 -76
- package/packages/ui/styles/tokens.css +0 -7
- package/playground/index.html +0 -12
- package/playground/postcss.config.cjs +0 -5
- package/playground/src/App.vue +0 -3
- package/playground/src/__tests__/__debug-input.test.ts +0 -29
- package/playground/src/__tests__/button-ai-confirm.test.ts +0 -41
- package/playground/src/__tests__/home-render.test.ts +0 -87
- package/playground/src/__tests__/icon-library.test.ts +0 -107
- package/playground/src/__tests__/input-ai-confirm.test.ts +0 -113
- package/playground/src/__tests__/textarea-ai-button.test.ts +0 -87
- package/playground/src/__tests__/textarea-wordlimit.test.ts +0 -66
- package/playground/src/chart-theme.ts +0 -22
- package/playground/src/components/AiStateFlow.vue +0 -59
- package/playground/src/components/ComponentShowcase.vue +0 -180
- package/playground/src/composables/useAiStateMachine.ts +0 -111
- package/playground/src/data/component-api.ts +0 -187
- package/playground/src/data/component-meta.ts +0 -84
- package/playground/src/layouts/DefaultLayout.vue +0 -318
- package/playground/src/main.ts +0 -18
- package/playground/src/router/index.ts +0 -101
- package/playground/src/views/AffixDemo.vue +0 -133
- package/playground/src/views/AiStateFlowDemo.vue +0 -170
- package/playground/src/views/AlertDemo.vue +0 -554
- package/playground/src/views/AnchorDemo.vue +0 -150
- package/playground/src/views/AppBarDemo.vue +0 -722
- package/playground/src/views/AvatarDemo.vue +0 -266
- package/playground/src/views/BackTopDemo.vue +0 -71
- package/playground/src/views/BadgeDemo.vue +0 -109
- package/playground/src/views/BatchActionButtonDemo.vue +0 -65
- package/playground/src/views/BreadcrumbDemo.vue +0 -248
- package/playground/src/views/ButtonDemo.vue +0 -344
- package/playground/src/views/CardDemo.vue +0 -254
- package/playground/src/views/CarouselDemo.vue +0 -158
- package/playground/src/views/CascaderDemo.vue +0 -425
- package/playground/src/views/ChartDemo.vue +0 -232
- package/playground/src/views/CheckboxDemo.vue +0 -339
- package/playground/src/views/DataGridDemo.vue +0 -518
- package/playground/src/views/DataPickerDemo.vue +0 -240
- package/playground/src/views/DatePickerDemo.vue +0 -292
- package/playground/src/views/DateTimePickerDemo.vue +0 -208
- package/playground/src/views/DesignSpecDemo.vue +0 -1647
- package/playground/src/views/DividerDemo.vue +0 -77
- package/playground/src/views/DocumentActionHeaderDemo.vue +0 -113
- package/playground/src/views/DocumentFormPageDemo.vue +0 -200
- package/playground/src/views/DrawerDemo.vue +0 -166
- package/playground/src/views/DropdownButtonDemo.vue +0 -74
- package/playground/src/views/DropdownDemo.vue +0 -306
- package/playground/src/views/EmptyDemo.vue +0 -104
- package/playground/src/views/ErrorDemo.vue +0 -111
- package/playground/src/views/FileUploadDemo.vue +0 -241
- package/playground/src/views/FilterButtonDemo.vue +0 -65
- package/playground/src/views/FormFieldAiDemo.vue +0 -364
- package/playground/src/views/FormFieldBasicDemo.vue +0 -174
- package/playground/src/views/FormFieldBusinessDemo.vue +0 -245
- package/playground/src/views/FormFieldDemo.vue +0 -178
- package/playground/src/views/FormFieldLayoutDemo.vue +0 -183
- package/playground/src/views/FormFieldValidationDemo.vue +0 -163
- package/playground/src/views/FormItemAiDemo.vue +0 -371
- package/playground/src/views/FormSelectDemo.vue +0 -519
- package/playground/src/views/FormUploadDemo.vue +0 -536
- package/playground/src/views/HeroDemo.vue +0 -836
- package/playground/src/views/Home.vue +0 -213
- package/playground/src/views/IconDemo.vue +0 -186
- package/playground/src/views/IconLibraryView.vue +0 -370
- package/playground/src/views/IconRenderTest.vue +0 -86
- package/playground/src/views/ImagePreviewDemo.vue +0 -368
- package/playground/src/views/ImageUploadDemo.vue +0 -199
- package/playground/src/views/InputDemo.vue +0 -348
- package/playground/src/views/LayoutDemo.vue +0 -946
- package/playground/src/views/LoadingDemo.vue +0 -95
- package/playground/src/views/LocationPickerDemo.vue +0 -218
- package/playground/src/views/MenuDemo.vue +0 -283
- package/playground/src/views/MessageDemo.vue +0 -201
- package/playground/src/views/MetricDemo.vue +0 -535
- package/playground/src/views/ModalDemo.vue +0 -291
- package/playground/src/views/MoreActionButtonDemo.vue +0 -65
- package/playground/src/views/NewDocumentDemo.vue +0 -973
- package/playground/src/views/NotificationDemo.vue +0 -255
- package/playground/src/views/PaginationDemo.vue +0 -292
- package/playground/src/views/ProgressDemo.vue +0 -356
- package/playground/src/views/RadioDemo.vue +0 -414
- package/playground/src/views/RegionPickerDemo.vue +0 -249
- package/playground/src/views/ScalingRulesDemo.vue +0 -333
- package/playground/src/views/SelectDemo.vue +0 -453
- package/playground/src/views/SideNavDemo.vue +0 -769
- package/playground/src/views/SignatureDemo.vue +0 -205
- package/playground/src/views/SkeletonDemo.vue +0 -109
- package/playground/src/views/SliderDemo.vue +0 -312
- package/playground/src/views/SplitButtonDemo.vue +0 -65
- package/playground/src/views/StatusDotDemo.vue +0 -131
- package/playground/src/views/StepsDemo.vue +0 -587
- package/playground/src/views/SwitchDemo.vue +0 -442
- package/playground/src/views/TableDemo.vue +0 -438
- package/playground/src/views/TabsDemo.vue +0 -246
- package/playground/src/views/TagDemo.vue +0 -113
- package/playground/src/views/TextAreaDemo.vue +0 -317
- package/playground/src/views/TimePickerDemo.vue +0 -291
- package/playground/src/views/TimelineDemo.vue +0 -133
- package/playground/src/views/TooltipDemo.vue +0 -102
- package/playground/src/views/TreeDemo.vue +0 -521
- package/playground/src/views/TypographyDemo.vue +0 -175
- package/playground/src/views/UploadDemo.vue +0 -331
- package/playground/src/views/WatermarkDemo.vue +0 -112
- package/playground/src/views/_mocks/new-document.mock.ts +0 -506
- package/playground/src/views/data/form-field-events-table.ts +0 -243
- package/playground/src/views/data/form-field-options.ts +0 -77
- package/playground/src/views/data/form-field-props-table.ts +0 -227
- package/playground/src/views/data/form-field-snippets.ts +0 -149
- package/playground/src/views/data/slider-snippets.ts +0 -100
- package/playground/src/views/inner/FormFieldEventsDoc.vue +0 -147
- package/playground/src/views/inner/FormFieldPropsDoc.vue +0 -138
- package/playground/vite.config.ts +0 -25
- package/pnpm-workspace.yaml +0 -3
- package/postcss.config.cjs +0 -5
- package/scripts/check-design-token-compliance.mjs +0 -223
- package/scripts/generate-package-dts.mjs +0 -105
- package/tsconfig.json +0 -35
- package/tsconfig.node.json +0 -13
- package/vite.config.ts +0 -68
- /package/{packages/ui/lowcode-agent/types.ts → dist/lowcode-agent/types.d.ts} +0 -0
|
@@ -1,2911 +0,0 @@
|
|
|
1
|
-
# 项目总览
|
|
2
|
-
|
|
3
|
-
## 项目定位
|
|
4
|
-
|
|
5
|
-
本项目是**砼方云鲲鹏产品的基础前端组件库**,面向低代码拖拽生成页面提供可复用物料。组件必须通用、参数化、可配置,不能服务单一页面硬编码;业务差异应通过 props、slots、事件、composables、Design Tokens 与低代码元数据表达。
|
|
6
|
-
|
|
7
|
-
## 技术栈
|
|
8
|
-
|
|
9
|
-
| 类别 | 技术 |
|
|
10
|
-
|------|------|
|
|
11
|
-
| 框架 | Vue 3 + TypeScript |
|
|
12
|
-
| 构建 | Vite 5 |
|
|
13
|
-
| 样式 | Tailwind CSS + CSS Variables / Design Tokens |
|
|
14
|
-
| UI 基座 | Reka UI (shadcn-vue) |
|
|
15
|
-
| 图表 | ECharts 6 |
|
|
16
|
-
| 图标 | Lucide icons |
|
|
17
|
-
| 测试 | Vitest + @vue/test-utils |
|
|
18
|
-
| 低代码元数据 | `@tongfun/ui/lowcode-agent` 独立入口 |
|
|
19
|
-
| 发布 | NPM 包 `@tongfun/ui` |
|
|
20
|
-
|
|
21
|
-
## 组件数量统计(当前扫描口径)
|
|
22
|
-
|
|
23
|
-
| 分类 | 数量 | 说明 |
|
|
24
|
-
|------|------|------|
|
|
25
|
-
| Form 基础控件 | 17 | 输入框、选择器、日期、开关等 |
|
|
26
|
-
| Form 复合项 | 23 | 数组输入、列表构建器、对象编辑器等 |
|
|
27
|
-
| Form 容器 | 5 | 分组、数组容器、对话框表单等 |
|
|
28
|
-
| Form 核心 | 3 | TfForm / TfFormItem / TfFormField |
|
|
29
|
-
| AI 增强 | 组件 + composables | TfAiOverlay / TfAiStateFlow / TfFormAiStatus / TfFormAiToolbar / Registry 等 |
|
|
30
|
-
| 通用 UI | 37 | 按钮、弹窗、标签、骨架屏等 |
|
|
31
|
-
| 布局 | 16 | 页面容器、网格、分栏等 |
|
|
32
|
-
| 导航 | 2 | TfSideNav + 布局侧栏 |
|
|
33
|
-
| **合计** | **约 90+ 组件/模块** | 可导出组件、AI 能力模块与组合式函数;数量随扫描口径变化 |
|
|
34
|
-
|
|
35
|
-
Playground 当前约 **70+ 演示路由/页面**,用于组件示例、组合场景与低代码物料验证。
|
|
36
|
-
|
|
37
|
-
## 使用方式
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
import { TfButton, useAiStateMachine } from '@tongfun/ui'
|
|
41
|
-
import '@tongfun/ui/style.css'
|
|
42
|
-
import registry from '@tongfun/ui/lowcode-agent'
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## AI 能力总览
|
|
46
|
-
|
|
47
|
-
- **字段级 AI**:`useAiStateMachine`、`useFormAi`、`TfAiOverlay`,支持字段旁 AI 生成/识别/检查/润色/翻译等动作,真实推理通过 resolver 注入。
|
|
48
|
-
- **表单级 AI**:`TfFormAiToolbar`、`TfFormAiStatus`、`useFormAiRegistry` / Registry,聚合字段状态并支持一键识别、批量应用、确认、检查、拒绝。
|
|
49
|
-
- **状态可视化**:`TfAiStateFlow` 展示 AI 状态流转。
|
|
50
|
-
- **顶层导出**:`useAiStateMachine`、`useFormAi`、`useFormAiRegistry` 均从 `@tongfun/ui` 导出;低代码元数据从 `@tongfun/ui/lowcode-agent` 导出。
|
|
51
|
-
|
|
52
|
-
## 目录结构
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
packages/ui/
|
|
56
|
-
├── components/
|
|
57
|
-
│ ├── form/
|
|
58
|
-
│ │ ├── base/ # 基础表单控件
|
|
59
|
-
│ │ ├── items/ # 复合表单项
|
|
60
|
-
│ │ └── src/ # 表单核心 (TfForm, TfFormItem, TfFormField)
|
|
61
|
-
│ ├── layout/ # 布局组件
|
|
62
|
-
│ ├── ai-overlay/ # 字段级 AI 浮动面板
|
|
63
|
-
│ ├── form-ai-status/ # 表单级 AI 状态聚合
|
|
64
|
-
│ ├── form-ai-toolbar/ # 表单级 AI 批量操作工具栏
|
|
65
|
-
│ └── ai-state-flow/ # AI 状态流程可视化
|
|
66
|
-
├── src/
|
|
67
|
-
│ ├── composables/ # useAiStateMachine / useFormAi / useFormAiRegistry 等
|
|
68
|
-
│ └── types/ # 共享类型定义
|
|
69
|
-
├── lowcode-agent/ # 低代码/AI 生成元数据独立入口
|
|
70
|
-
└── styles/ # Tailwind + CSS Variables / Design Tokens
|
|
71
|
-
|
|
72
|
-
playground/ # 约 70+ 演示路由/页面
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
# 设计令牌 (Design Tokens)
|
|
76
|
-
|
|
77
|
-
## Brand 品牌色
|
|
78
|
-
|
|
79
|
-
11 级色阶 (50–950),主色 brand-500=#1976C7,深色 brand-600=#085699:
|
|
80
|
-
|
|
81
|
-
| Token | 值 | 用途 |
|
|
82
|
-
|-------|-----|------|
|
|
83
|
-
| `--tf-color-brand-50` | #E6F0F9 | 最浅背景 |
|
|
84
|
-
| `--tf-color-brand-100` | #CCE1F3 | 浅背景 |
|
|
85
|
-
| `--tf-color-brand-200` | #99C4E7 | hover 态 |
|
|
86
|
-
| `--tf-color-brand-300` | #66A6DB | 禁用态 |
|
|
87
|
-
| `--tf-color-brand-400` | #3389CF | 辅助强调 |
|
|
88
|
-
| `--tf-color-brand-500` | #1976C7 | **主色** |
|
|
89
|
-
| `--tf-color-brand-600` | #085699 | 深色/hover |
|
|
90
|
-
| `--tf-color-brand-700` | #064780 | active 态 |
|
|
91
|
-
| `--tf-color-brand-800` | #053866 | 深背景 |
|
|
92
|
-
| `--tf-color-brand-900` | #042A4D | 最深文字 |
|
|
93
|
-
| `--tf-color-brand-950` | #020D1A | 最深背景 |
|
|
94
|
-
|
|
95
|
-
## AI 配色
|
|
96
|
-
|
|
97
|
-
9 级色阶 (50–900),主色 ai-400=#34BFA3(青绿色):
|
|
98
|
-
|
|
99
|
-
| Token | 值 | 用途 |
|
|
100
|
-
|-------|-----|------|
|
|
101
|
-
| `--tf-color-ai-50` | #e8f8f4 | AI 浅背景 |
|
|
102
|
-
| `--tf-color-ai-100` | #d1f1e9 | 悬浮 |
|
|
103
|
-
| `--tf-color-ai-200` | #a3e3d3 | 边框 |
|
|
104
|
-
| `--tf-color-ai-300` | #75d5bd | 图标 |
|
|
105
|
-
| `--tf-color-ai-400` | #34BFA3 | **AI 主色** |
|
|
106
|
-
| `--tf-color-ai-500` | #2eab92 | hover |
|
|
107
|
-
| `--tf-color-ai-600` | #279780 | active |
|
|
108
|
-
| `--tf-color-ai-700` | #1d7160 | 深色文字 |
|
|
109
|
-
| `--tf-color-ai-800` | #124b40 | 深背景 |
|
|
110
|
-
| `--tf-color-ai-900` | #093d38 | 最深 |
|
|
111
|
-
|
|
112
|
-
## 语义色
|
|
113
|
-
|
|
114
|
-
每种语义色包含 11 级色阶 (50–950):
|
|
115
|
-
|
|
116
|
-
| 语义 | 色系 | 用途 |
|
|
117
|
-
|------|------|------|
|
|
118
|
-
| Success | 绿色 (green) | 成功、通过、完成 |
|
|
119
|
-
| Warning | 琥珀色 (amber) | 警告、注意 |
|
|
120
|
-
| Error | 红色 (red) | 错误、危险、删除 |
|
|
121
|
-
| Info | 青色 (teal) | 信息、提示 |
|
|
122
|
-
| Neutral | 灰色 (gray) | 中性、禁用、占位 |
|
|
123
|
-
|
|
124
|
-
## 表单尺寸系统 (Form Size Tokens)
|
|
125
|
-
|
|
126
|
-
三档尺寸 (sm / md / lg),基于统一约束关系:
|
|
127
|
-
|
|
128
|
-
| Token | sm | md | lg | 说明 |
|
|
129
|
-
|-------|-----|-----|-----|------|
|
|
130
|
-
| `--tf-form-control-h` | 30px | 40px | 48px | 控件高度 |
|
|
131
|
-
| `--tf-form-label-h` | 28px | 32px | 36px | 标签高度 |
|
|
132
|
-
| `--tf-form-label-pb` | 6px | 8px | 10px | 标签底部间距 |
|
|
133
|
-
| `--tf-form-decor-h` | 20px | 24px | 28px | 装饰高度 |
|
|
134
|
-
| `--tf-form-decor-icon` | 14px | 16px | 18px | 装饰图标尺寸 |
|
|
135
|
-
|
|
136
|
-
> **约束公式**: `decor-h ≤ label-h - label-pb`,确保装饰元素不超出标签区域。
|
|
137
|
-
|
|
138
|
-
## 间距 (Spacing)
|
|
139
|
-
|
|
140
|
-
基于 0.25rem 递进:
|
|
141
|
-
|
|
142
|
-
| Token | 值 | 等效 px (16px 基准) |
|
|
143
|
-
|-------|-----|------|
|
|
144
|
-
| `xs` | 0.25rem | 4px |
|
|
145
|
-
| `sm` | 0.5rem | 8px |
|
|
146
|
-
| `md` | 1rem | 16px |
|
|
147
|
-
| `lg` | 1.5rem | 24px |
|
|
148
|
-
| `xl` | 2rem | 32px |
|
|
149
|
-
| `2xl` | 3rem | 48px |
|
|
150
|
-
|
|
151
|
-
## 圆角 (Border Radius)
|
|
152
|
-
|
|
153
|
-
| Token | 值 |
|
|
154
|
-
|-------|-----|
|
|
155
|
-
| `sm` | 0.5rem |
|
|
156
|
-
| `md` | 0.75rem |
|
|
157
|
-
| `lg` | 1rem |
|
|
158
|
-
| `full` | 9999px |
|
|
159
|
-
|
|
160
|
-
## 阴影 (Shadow)
|
|
161
|
-
|
|
162
|
-
四级阴影,带有品牌蓝色调:
|
|
163
|
-
|
|
164
|
-
| Token | 效果 |
|
|
165
|
-
|-------|------|
|
|
166
|
-
| `sm` | 浅阴影,卡片悬浮 |
|
|
167
|
-
| `md` | 标准阴影,弹窗 |
|
|
168
|
-
| `lg` | 深阴影,模态框 |
|
|
169
|
-
| `xl` | 最深阴影,抽屉 |
|
|
170
|
-
|
|
171
|
-
## 字体尺寸 (Font Sizes)
|
|
172
|
-
|
|
173
|
-
| Token | 值 |
|
|
174
|
-
|-------|-----|
|
|
175
|
-
| `3xs` | 0.5625rem |
|
|
176
|
-
| `2xs` | 0.625rem |
|
|
177
|
-
| `xs` | 0.75rem |
|
|
178
|
-
| `sm` | 0.875rem |
|
|
179
|
-
| `base` | 1rem |
|
|
180
|
-
| `lg` | 1.125rem |
|
|
181
|
-
| `xl` | 1.25rem |
|
|
182
|
-
| `2xl` | 1.5rem |
|
|
183
|
-
| `3xl` | 1.875rem |
|
|
184
|
-
| `4xl` | 2.25rem |
|
|
185
|
-
|
|
186
|
-
## 排版色彩 (Typography Colors)
|
|
187
|
-
|
|
188
|
-
| Token | 值 | 用途 |
|
|
189
|
-
|-------|-----|------|
|
|
190
|
-
| `--tf-color-text-primary` | #102033 | 主文本 |
|
|
191
|
-
| `--tf-color-text-secondary` | #4b6278 | 辅助文本 |
|
|
192
|
-
| `--tf-color-text-tertiary` | #71869a | 弱化文本 |
|
|
193
|
-
| `--tf-color-text-disabled` | #98a7b6 | 禁用文本 |
|
|
194
|
-
|
|
195
|
-
## 边框色 (Border Colors)
|
|
196
|
-
|
|
197
|
-
| Token | 值 | 用途 |
|
|
198
|
-
|-------|-----|------|
|
|
199
|
-
| `--tf-color-border` | #d8e2eb | 默认边框 |
|
|
200
|
-
| `--tf-color-border-light` | #e7eef5 | 浅边框 |
|
|
201
|
-
| `--tf-color-border-lighter` | #f1f5f9 | 最浅边框 |
|
|
202
|
-
|
|
203
|
-
## 背景色 (Background Colors)
|
|
204
|
-
|
|
205
|
-
| Token | 值 | 用途 |
|
|
206
|
-
|-------|-----|------|
|
|
207
|
-
| `--tf-color-bg` | #f7fafc | 默认背景 |
|
|
208
|
-
| `--tf-color-bg-page` | #eef5fa | 页面背景 |
|
|
209
|
-
| `--tf-color-bg-disabled` | #eef2f6 | 禁用背景 |
|
|
210
|
-
|
|
211
|
-
## 渐变 (Gradients)
|
|
212
|
-
|
|
213
|
-
| Token | 用途 |
|
|
214
|
-
|-------|------|
|
|
215
|
-
| `--tf-gradient-ai` | AI 功能渐变色 |
|
|
216
|
-
| `--tf-gradient-ai-soft` | AI 柔和渐变 |
|
|
217
|
-
| `--tf-gradient-brand` | 品牌渐变色 |
|
|
218
|
-
| `--tf-gradient-success` | 成功渐变 |
|
|
219
|
-
| `--tf-gradient-warning` | 警告渐变 |
|
|
220
|
-
| `--tf-gradient-info` | 信息渐变 |
|
|
221
|
-
| `--tf-gradient-neutral` | 中性渐变 |
|
|
222
|
-
|
|
223
|
-
## 暗色主题 (Dark Theme)
|
|
224
|
-
|
|
225
|
-
通过 CSS 选择器 `.dark` 或 `[data-theme='dark']` 激活,对所有上述令牌提供完整覆写。所有色彩、边框、背景、阴影令牌均有对应的暗色值。
|
|
226
|
-
|
|
227
|
-
# 布局组件 (Layout Components)
|
|
228
|
-
|
|
229
|
-
## TfPage — 页面容器
|
|
230
|
-
|
|
231
|
-
标准页面布局,提供标题栏、加载态、内边距控制与返回按钮支持。
|
|
232
|
-
|
|
233
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
234
|
-
|------|------|--------|------|
|
|
235
|
-
| `title` | `string` | — | 页面标题 |
|
|
236
|
-
| `description` | `string` | — | 页面描述 |
|
|
237
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
238
|
-
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | 内容区内边距 |
|
|
239
|
-
| `maxWidth` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'full'` | 最大宽度 |
|
|
240
|
-
| `back` | `boolean \| string` | — | 显示返回按钮,字符串作为按钮文字 |
|
|
241
|
-
|
|
242
|
-
**Events**: `back` — 点击返回按钮时触发
|
|
243
|
-
|
|
244
|
-
**Slots**: `default` (内容区), `header` (标题区自定义), `actions` (操作区)
|
|
245
|
-
|
|
246
|
-
**示例**:
|
|
247
|
-
```html
|
|
248
|
-
<TfPage title="用户管理" description="管理系统用户及其权限" back>
|
|
249
|
-
<template #actions>
|
|
250
|
-
<TfButton>新建用户</TfButton>
|
|
251
|
-
</template>
|
|
252
|
-
页面主内容
|
|
253
|
-
</TfPage>
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## TfCard — 卡片容器
|
|
257
|
-
|
|
258
|
-
通用卡片组件,支持边框、阴影、悬浮效果、封面图和加载态。
|
|
259
|
-
|
|
260
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
261
|
-
|------|------|--------|------|
|
|
262
|
-
| `title` | `string` | — | 卡片标题 |
|
|
263
|
-
| `description` | `string` | — | 卡片描述 |
|
|
264
|
-
| `bordered` | `boolean` | `true` | 是否显示边框 |
|
|
265
|
-
| `shadow` | `'none' \| 'sm' \| 'md'` | `'none'` | 阴影级别 |
|
|
266
|
-
| `hoverable` | `boolean` | `false` | 悬浮时提升阴影 |
|
|
267
|
-
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | 内容区内边距 |
|
|
268
|
-
| `compact` | `boolean` | `false` | 紧凑模式 |
|
|
269
|
-
| `radius` | `'sm' \| 'md' \| 'lg'` | `'md'` | 圆角大小 |
|
|
270
|
-
| `loading` | `boolean` | `false` | 加载骨架屏 |
|
|
271
|
-
| `clickable` | `boolean` | `false` | 点击态光标 |
|
|
272
|
-
|
|
273
|
-
**Events**: `click`
|
|
274
|
-
|
|
275
|
-
**Slots**: `default`, `header`, `cover`, `actions`, `footer`
|
|
276
|
-
|
|
277
|
-
**示例**:
|
|
278
|
-
```html
|
|
279
|
-
<TfCard title="数据概览" description="本月核心指标" hoverable shadow="sm">
|
|
280
|
-
<TfInline gap="lg">
|
|
281
|
-
<TfStat label="营收" value="¥128,000" />
|
|
282
|
-
<TfStat label="订单" value="3,421" />
|
|
283
|
-
</TfInline>
|
|
284
|
-
</TfCard>
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
## TfStack — 垂直堆叠
|
|
288
|
-
|
|
289
|
-
纵向弹性布局,控制子元素间距与对齐。
|
|
290
|
-
|
|
291
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
292
|
-
|------|------|--------|------|
|
|
293
|
-
| `gap` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | 子元素间距 |
|
|
294
|
-
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | `'stretch'` | 交叉轴对齐 |
|
|
295
|
-
| `justify` | `'start' \| 'center' \| 'end' \| 'between' \| 'around'` | `'start'` | 主轴对齐 |
|
|
296
|
-
| `as` | `string` | `'div'` | 渲染标签 |
|
|
297
|
-
|
|
298
|
-
**Slots**: `default`
|
|
299
|
-
|
|
300
|
-
**示例**:
|
|
301
|
-
```html
|
|
302
|
-
<TfStack gap="md" align="start">
|
|
303
|
-
<TfCard>第一项</TfCard>
|
|
304
|
-
<TfCard>第二项</TfCard>
|
|
305
|
-
</TfStack>
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## TfInline — 水平行内
|
|
309
|
-
|
|
310
|
-
横向弹性布局,支持自动换行。
|
|
311
|
-
|
|
312
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
313
|
-
|------|------|--------|------|
|
|
314
|
-
| `gap` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | 子元素间距 |
|
|
315
|
-
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | `'center'` | 交叉轴对齐 |
|
|
316
|
-
| `justify` | `'start' \| 'center' \| 'end' \| 'between' \| 'around'` | `'start'` | 主轴对齐 |
|
|
317
|
-
| `wrap` | `boolean` | `true` | 是否换行 |
|
|
318
|
-
| `as` | `string` | `'div'` | 渲染标签 |
|
|
319
|
-
|
|
320
|
-
**Slots**: `default`
|
|
321
|
-
|
|
322
|
-
**示例**:
|
|
323
|
-
```html
|
|
324
|
-
<TfInline gap="sm" align="center" :wrap="true">
|
|
325
|
-
<TfBadge>标签A</TfBadge>
|
|
326
|
-
<TfBadge>标签B</TfBadge>
|
|
327
|
-
<TfBadge>标签C</TfBadge>
|
|
328
|
-
</TfInline>
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
## TfGrid — 响应式网格
|
|
332
|
-
|
|
333
|
-
CSS Grid 布局,支持断点响应式列数、自适应填充和统一间距。
|
|
334
|
-
|
|
335
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
336
|
-
|------|------|--------|------|
|
|
337
|
-
| `cols` | `number \| { base?, sm?, md?, lg?, xl? }` | `1` | 列数(响应式对象) |
|
|
338
|
-
| `gap` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | 网格间距 |
|
|
339
|
-
| `autoFit` | `boolean` | `false` | 启用 auto-fit 自动列宽 |
|
|
340
|
-
| `minItemWidth` | `string` | `'240px'` | autoFit 时最小列宽 |
|
|
341
|
-
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | `'stretch'` | 交叉轴对齐 |
|
|
342
|
-
| `as` | `string` | `'div'` | 渲染标签 |
|
|
343
|
-
|
|
344
|
-
**Slots**: `default`
|
|
345
|
-
|
|
346
|
-
**示例**:
|
|
347
|
-
```html
|
|
348
|
-
<TfGrid :cols="{ base: 1, md: 2, lg: 3 }" gap="md">
|
|
349
|
-
<TfCard v-for="item in items" :key="item.id" :title="item.name" />
|
|
350
|
-
</TfGrid>
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
## TfSection — 可折叠区块
|
|
354
|
-
|
|
355
|
-
带标题的分组区块,支持折叠/展开。
|
|
356
|
-
|
|
357
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
358
|
-
|------|------|--------|------|
|
|
359
|
-
| `title` | `string` | — | 区块标题 |
|
|
360
|
-
| `description` | `string` | — | 描述文字 |
|
|
361
|
-
| `collapsible` | `boolean` | `false` | 是否可折叠 |
|
|
362
|
-
| `defaultCollapsed` | `boolean` | `false` | 初始折叠状态 |
|
|
363
|
-
| `bordered` | `boolean` | `true` | 是否显示边框 |
|
|
364
|
-
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | 内边距 |
|
|
365
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
366
|
-
| `level` | `number (1-6)` | `3` | 标题层级 |
|
|
367
|
-
|
|
368
|
-
**Events**: `collapse` — 折叠状态变化
|
|
369
|
-
|
|
370
|
-
**Slots**: `default`, `title`, `description`, `actions`
|
|
371
|
-
|
|
372
|
-
**示例**:
|
|
373
|
-
```html
|
|
374
|
-
<TfSection title="高级设置" description="可选配置项" collapsible>
|
|
375
|
-
高级配置表单内容
|
|
376
|
-
</TfSection>
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
## TfSplit — 左右分栏
|
|
380
|
-
|
|
381
|
-
水平左右分栏布局,支持拖拽调整宽度和折叠。
|
|
382
|
-
|
|
383
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
384
|
-
|------|------|--------|------|
|
|
385
|
-
| `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` | 分割方向 |
|
|
386
|
-
| `leftWidth` | `string` | `'280px'` | 左侧宽度 |
|
|
387
|
-
| `rightWidth` | `string` | — | 右侧宽度 |
|
|
388
|
-
| `gap` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | 间距 |
|
|
389
|
-
| `resizable` | `boolean` | `false` | 是否可拖拽调整 |
|
|
390
|
-
| `collapsible` | `boolean` | `false` | 左侧是否可折叠 |
|
|
391
|
-
|
|
392
|
-
**Slots**: `default`, `left`, `right`
|
|
393
|
-
|
|
394
|
-
**示例**:
|
|
395
|
-
```html
|
|
396
|
-
<TfSplit leftWidth="300px" resizable>
|
|
397
|
-
<template #left>
|
|
398
|
-
<TfSideNav :items="navItems" />
|
|
399
|
-
</template>
|
|
400
|
-
<template #right>
|
|
401
|
-
主内容区域
|
|
402
|
-
</template>
|
|
403
|
-
</TfSplit>
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
## TfContainer — 内容容器
|
|
407
|
-
|
|
408
|
-
居中内容包裹器,提供预设最大宽度。
|
|
409
|
-
|
|
410
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
411
|
-
|------|------|--------|------|
|
|
412
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'lg'` | 最大宽度 (640/768/1024/1280px) |
|
|
413
|
-
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | `'md'` | 内边距 |
|
|
414
|
-
| `centered` | `boolean` | `true` | 是否水平居中 |
|
|
415
|
-
| `fluid` | `boolean` | `false` | 无最大宽度限制 |
|
|
416
|
-
| `as` | `string` | `'div'` | 渲染标签 |
|
|
417
|
-
|
|
418
|
-
**Slots**: `default`
|
|
419
|
-
|
|
420
|
-
**示例**:
|
|
421
|
-
```html
|
|
422
|
-
<TfContainer size="md" centered>
|
|
423
|
-
<TfCard>居中且最大宽度 768px 的内容</TfCard>
|
|
424
|
-
</TfContainer>
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
## TfFormLayout — 表单网格布局
|
|
428
|
-
|
|
429
|
-
表单专用网格容器,控制标签宽度、对齐方式和布局方向。
|
|
430
|
-
|
|
431
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
432
|
-
|------|------|--------|------|
|
|
433
|
-
| `labelWidth` | `string` | — | 标签列宽 |
|
|
434
|
-
| `labelAlign` | `'left' \| 'right'` | `'right'` | 标签对齐 |
|
|
435
|
-
| `layout` | `'vertical' \| 'horizontal' \| 'inline'` | `'vertical'` | 布局方向 |
|
|
436
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
437
|
-
| `disabled` | `boolean` | `false` | 全局禁用 |
|
|
438
|
-
| `colon` | `boolean` | `false` | 标签后加冒号 |
|
|
439
|
-
|
|
440
|
-
**Slots**: `default`
|
|
441
|
-
|
|
442
|
-
**示例**:
|
|
443
|
-
```html
|
|
444
|
-
<TfFormLayout layout="horizontal" labelWidth="120px" :colon="true">
|
|
445
|
-
<TfFormItem label="姓名">
|
|
446
|
-
<TfInput v-model="name" />
|
|
447
|
-
</TfFormItem>
|
|
448
|
-
<TfFormItem label="邮箱">
|
|
449
|
-
<TfInput v-model="email" />
|
|
450
|
-
</TfFormItem>
|
|
451
|
-
</TfFormLayout>
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
## TfSidebarLayout — 侧边栏布局
|
|
455
|
-
|
|
456
|
-
企业级三栏布局(侧栏—主内容—右侧栏),支持折叠与粘性定位。
|
|
457
|
-
|
|
458
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
459
|
-
|------|------|--------|------|
|
|
460
|
-
| `sidebarWidth` | `string` | `'240px'` | 侧栏展开宽度 |
|
|
461
|
-
| `collapsedWidth` | `string` | `'64px'` | 侧栏折叠宽度 |
|
|
462
|
-
| `collapsed` | `boolean` | `false` | 是否折叠 |
|
|
463
|
-
| `collapsible` | `boolean` | `false` | 允许折叠切换 |
|
|
464
|
-
| `position` | `'left' \| 'right'` | `'left'` | 侧栏位置 |
|
|
465
|
-
| `fullHeight` | `boolean` | `true` | 全高度布局 |
|
|
466
|
-
| `rightWidth` | `string` | — | 右侧栏宽度 |
|
|
467
|
-
| `stickySidebar` | `boolean` | `true` | 侧栏粘性定位 |
|
|
468
|
-
|
|
469
|
-
**Events**: `update:collapsed`
|
|
470
|
-
|
|
471
|
-
**Slots**: `sidebar`, `default`, `right`
|
|
472
|
-
|
|
473
|
-
**示例**:
|
|
474
|
-
```html
|
|
475
|
-
<TfSidebarLayout v-model:collapsed="collapsed" collapsible>
|
|
476
|
-
<template #sidebar>
|
|
477
|
-
<TfSideNav :items="nav" />
|
|
478
|
-
</template>
|
|
479
|
-
主要内容
|
|
480
|
-
</TfSidebarLayout>
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
## TfMasterDetail — 主从布局
|
|
484
|
-
|
|
485
|
-
经典 Master-Detail 模式,左侧列表 + 右侧详情,支持拖拽和折叠。
|
|
486
|
-
|
|
487
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
488
|
-
|------|------|--------|------|
|
|
489
|
-
| `masterWidth` | `string` | `'320px'` | 主面板宽度 |
|
|
490
|
-
| `detailMinWidth` | `string` | — | 详情面板最小宽度 |
|
|
491
|
-
| `resizable` | `boolean` | `false` | 可拖拽调整分割 |
|
|
492
|
-
| `collapsible` | `boolean` | `false` | 主面板可折叠 |
|
|
493
|
-
| `defaultCollapsed` | `boolean` | `false` | 默认折叠 |
|
|
494
|
-
|
|
495
|
-
**Slots**: `master`, `detail`, `empty`
|
|
496
|
-
|
|
497
|
-
**示例**:
|
|
498
|
-
```html
|
|
499
|
-
<TfMasterDetail masterWidth="320px" resizable>
|
|
500
|
-
<template #master>
|
|
501
|
-
<TfList :items="items" />
|
|
502
|
-
</template>
|
|
503
|
-
<template #detail>
|
|
504
|
-
<TfPage :title="selected.name">详情内容</TfPage>
|
|
505
|
-
</template>
|
|
506
|
-
<template #empty>
|
|
507
|
-
<TfEmpty description="请选择一个项目" />
|
|
508
|
-
</template>
|
|
509
|
-
</TfMasterDetail>
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
## TfDetailLayout — 详情页布局
|
|
513
|
-
|
|
514
|
-
详情页面专用布局,提供页头、侧栏和操作区。
|
|
515
|
-
|
|
516
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
517
|
-
|------|------|--------|------|
|
|
518
|
-
| `title` | `string` | — | 详情标题 |
|
|
519
|
-
| `back` | `boolean \| string` | — | 显示返回按钮 |
|
|
520
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
521
|
-
|
|
522
|
-
**Events**: `back`
|
|
523
|
-
|
|
524
|
-
**Slots**: `default`, `header`, `sidebar`, `actions`
|
|
525
|
-
|
|
526
|
-
**示例**:
|
|
527
|
-
```html
|
|
528
|
-
<TfDetailLayout title="订单详情 #2024-001" back :loading="loading">
|
|
529
|
-
<template #actions>
|
|
530
|
-
<TfButton>编辑</TfButton>
|
|
531
|
-
</template>
|
|
532
|
-
订单详细信息
|
|
533
|
-
</TfDetailLayout>
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
## TfHero — Hero 横幅
|
|
537
|
-
|
|
538
|
-
视觉冲击力强的 Hero 区域,支持 AI/品牌渐变和图标。
|
|
539
|
-
|
|
540
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
541
|
-
|------|------|--------|------|
|
|
542
|
-
| `gradient` | `'ai' \| 'brand' \| 'success' \| 'warning' \| 'neutral'` | `'ai'` | 渐变主题 |
|
|
543
|
-
| `icon` | `string` | — | Lucide 图标名 |
|
|
544
|
-
| `eyebrow` | `string` | — | 眉题文字 |
|
|
545
|
-
| `title` | `string` | — | 主标题 |
|
|
546
|
-
| `description` | `string` | — | 描述 |
|
|
547
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
548
|
-
| `align` | `'start' \| 'center'` | `'center'` | 对齐方式 |
|
|
549
|
-
| `class` | `string` | — | 自定义 CSS 类 |
|
|
550
|
-
|
|
551
|
-
**Slots**: `default`, `actions`
|
|
552
|
-
|
|
553
|
-
**示例**:
|
|
554
|
-
```html
|
|
555
|
-
<TfHero gradient="brand" icon="truck" title="运输调度" eyebrow="生产管理"
|
|
556
|
-
description="实时跟踪运输任务状态">
|
|
557
|
-
<template #actions>
|
|
558
|
-
<TfButton>新建任务</TfButton>
|
|
559
|
-
</template>
|
|
560
|
-
</TfHero>
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
## TfPageHeader — 页面标题栏
|
|
564
|
-
|
|
565
|
-
可复用的页面标题栏组件,支持粘性定位和返回按钮。
|
|
566
|
-
|
|
567
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
568
|
-
|------|------|--------|------|
|
|
569
|
-
| `title` | `string` | — | 页面标题 |
|
|
570
|
-
| `description` | `string` | — | 描述 |
|
|
571
|
-
| `sticky` | `boolean` | `false` | 粘性定位 |
|
|
572
|
-
| `bordered` | `boolean` | `true` | 底部边框 |
|
|
573
|
-
| `back` | `boolean \| string` | — | 返回按钮 |
|
|
574
|
-
|
|
575
|
-
**Events**: `back`
|
|
576
|
-
|
|
577
|
-
**Slots**: `default`, `title`, `description`, `actions`
|
|
578
|
-
|
|
579
|
-
**示例**:
|
|
580
|
-
```html
|
|
581
|
-
<TfPageHeader title="项目设置" description="管理项目基本配置" sticky>
|
|
582
|
-
<template #actions>
|
|
583
|
-
<TfButton>保存</TfButton>
|
|
584
|
-
</template>
|
|
585
|
-
</TfPageHeader>
|
|
586
|
-
```
|
|
587
|
-
|
|
588
|
-
## TfAppBar — 应用顶栏
|
|
589
|
-
|
|
590
|
-
应用级顶部导航栏,支持品牌标识、搜索和用户操作。
|
|
591
|
-
|
|
592
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
593
|
-
|------|------|--------|------|
|
|
594
|
-
| `brandIcon` | `string` | — | 品牌图标 (Lucide) |
|
|
595
|
-
| `brandText` | `string` | — | 品牌文字 |
|
|
596
|
-
| `searchPlaceholder` | `string` | — | 搜索框占位 |
|
|
597
|
-
| `searchShortcut` | `string` | `'⌘ K'` | 搜索快捷键提示 |
|
|
598
|
-
| `sticky` | `boolean` | `true` | 粘性定位 |
|
|
599
|
-
| `bordered` | `boolean` | `true` | 底部边框 |
|
|
600
|
-
| `rounded` | `boolean` | `true` | 圆角 |
|
|
601
|
-
|
|
602
|
-
**Events**: `search` — 搜索输入变化
|
|
603
|
-
|
|
604
|
-
**Slots**: `brand`, `search`, `actions`, `user`
|
|
605
|
-
|
|
606
|
-
**示例**:
|
|
607
|
-
```html
|
|
608
|
-
<TfAppBar brandIcon="box" brandText="Admin Pro" searchPlaceholder="搜索...">
|
|
609
|
-
<template #user>
|
|
610
|
-
<TfAvatar name="张三" />
|
|
611
|
-
</template>
|
|
612
|
-
</TfAppBar>
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
## TfToolbar — 工具栏
|
|
616
|
-
|
|
617
|
-
操作按钮工具栏,支持左中右分区和紧凑密度。
|
|
618
|
-
|
|
619
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
620
|
-
|------|------|--------|------|
|
|
621
|
-
| `sticky` | `boolean` | `false` | 粘性定位 |
|
|
622
|
-
| `wrap` | `boolean` | `true` | 按钮换行 |
|
|
623
|
-
| `density` | `'compact' \| 'default' \| 'comfortable'` | `'default'` | 密度 |
|
|
624
|
-
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | `'center'` | 对齐 |
|
|
625
|
-
|
|
626
|
-
**Slots**: `default`, `left`, `center`, `right`
|
|
627
|
-
|
|
628
|
-
**示例**:
|
|
629
|
-
```html
|
|
630
|
-
<TfToolbar>
|
|
631
|
-
<template #left>
|
|
632
|
-
<TfButton>新建</TfButton>
|
|
633
|
-
<TfButton>导入</TfButton>
|
|
634
|
-
</template>
|
|
635
|
-
<template #right>
|
|
636
|
-
<TfButton variant="outline">导出</TfButton>
|
|
637
|
-
</template>
|
|
638
|
-
</TfToolbar>
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
## TfStateContainer — 状态容器
|
|
642
|
-
|
|
643
|
-
统一处理加载、错误、空数据和正常内容的展示切换。
|
|
644
|
-
|
|
645
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
646
|
-
|------|------|--------|------|
|
|
647
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
648
|
-
| `error` | `string \| boolean` | `false` | 错误信息或标识 |
|
|
649
|
-
| `empty` | `boolean` | `false` | 空数据状态 |
|
|
650
|
-
| `emptyText` | `string` | `'暂无数据'` | 空状态文案 |
|
|
651
|
-
| `loadingText` | `string` | `'加载中...'` | 加载文案 |
|
|
652
|
-
| `retryText` | `string` | `'重试'` | 重试按钮文案 |
|
|
653
|
-
|
|
654
|
-
**Events**: `retry` — 点击重试
|
|
655
|
-
|
|
656
|
-
**Slots**: `default` (正常), `loading`, `error`, `empty`
|
|
657
|
-
|
|
658
|
-
**示例**:
|
|
659
|
-
```html
|
|
660
|
-
<TfStateContainer :loading="isLoading" :error="errorMsg">
|
|
661
|
-
<TfDataTable :data="list" :columns="columns" />
|
|
662
|
-
</TfStateContainer>
|
|
663
|
-
```
|
|
664
|
-
|
|
665
|
-
## TfSideNav — 侧边导航
|
|
666
|
-
|
|
667
|
-
侧边栏导航菜单,支持多级嵌套、折叠手风琴和主题定制。
|
|
668
|
-
|
|
669
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
670
|
-
|------|------|--------|------|
|
|
671
|
-
| `items` | `NavItem[]` | `[]` | 导航项数组 |
|
|
672
|
-
| `collapsed` | `boolean` | `false` | 侧栏折叠 |
|
|
673
|
-
| `accordion` | `boolean` | `false` | 手风琴模式(只展开一个) |
|
|
674
|
-
| `theme` | `string` | — | 主题 |
|
|
675
|
-
| `indent` | `number` | `20` | 子级缩进 px |
|
|
676
|
-
|
|
677
|
-
**Slots**: `default`, `item`, `icon`, `title`
|
|
678
|
-
|
|
679
|
-
**示例**:
|
|
680
|
-
```html
|
|
681
|
-
<TfSideNav :items="navItems" :collapsed="collapsed" accordion />
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
# AI 增强组件 (AI Components)
|
|
685
|
-
|
|
686
|
-
## 架构概览
|
|
687
|
-
|
|
688
|
-
AI 增强组件围绕 **"智能识别 → 状态确认 → 批量应用"** 的工作流设计,核心流程如下:
|
|
689
|
-
|
|
690
|
-
```
|
|
691
|
-
TfFormAiToolbar (批量操作层)
|
|
692
|
-
├─ recognizeAll() ──── 触发全量 AI 识别
|
|
693
|
-
├─ applyAll() ─────── 一键应用所有建议
|
|
694
|
-
├─ confirmAll() ───── 批量确认
|
|
695
|
-
└─ checkAll()/rejectAll() ─ 全选/全拒
|
|
696
|
-
|
|
697
|
-
TfFormAiStatus (状态聚合层)
|
|
698
|
-
└─ 显示每个字段的 AI 状态 (idle/loading/done/confirmed/error)
|
|
699
|
-
|
|
700
|
-
TfAiOverlay (交互浮层)
|
|
701
|
-
└─ 单字段 AI 建议的确认/拒绝面板
|
|
702
|
-
|
|
703
|
-
TfAiStateFlow (可视化层)
|
|
704
|
-
└─ 5 步流程可视化
|
|
705
|
-
```
|
|
706
|
-
|
|
707
|
-
---
|
|
708
|
-
|
|
709
|
-
## TfAiOverlay — AI 浮动面板
|
|
710
|
-
|
|
711
|
-
核心 AI 交互浮层,在表单字段旁弹出,展示 AI 建议结果并等待用户确认。
|
|
712
|
-
|
|
713
|
-
### AiState 状态机
|
|
714
|
-
|
|
715
|
-
| 状态 | 说明 |
|
|
716
|
-
|------|------|
|
|
717
|
-
| `idle` | 初始/空闲 |
|
|
718
|
-
| `loading` | 请求中(显示加载动画) |
|
|
719
|
-
| `streaming` | 流式返回中(逐字显示) |
|
|
720
|
-
| `confirming` | 等待用户确认(显示确认/拒绝按钮) |
|
|
721
|
-
| `done` | 已完成(显示最终结果) |
|
|
722
|
-
| `error` | 出错(显示错误信息和重试) |
|
|
723
|
-
|
|
724
|
-
### Props
|
|
725
|
-
|
|
726
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
727
|
-
|------|------|--------|------|
|
|
728
|
-
| `open` | `boolean` | `false` | 是否显示浮层 |
|
|
729
|
-
| `anchor` | `HTMLElement \| null` | — | 锚点元素(浮层定位目标) |
|
|
730
|
-
| `state` | `AiState` | `'idle'` | 当前 AI 状态 |
|
|
731
|
-
| `result` | `string` | — | AI 返回结果 |
|
|
732
|
-
| `error` | `string` | — | 错误信息 |
|
|
733
|
-
| `placement` | `Placement` | `'bottom-start'` | 浮层弹出位置 |
|
|
734
|
-
| `offset` | `number` | `8` | 距锚点偏移 px |
|
|
735
|
-
| `width` | `number` | `360` | 浮层宽度(compact 时为 240) |
|
|
736
|
-
| `maxHeight` | `string` | `'60vh'` | 最大高度 |
|
|
737
|
-
| `confirmLabel` | `string` | — | 确认按钮文案 |
|
|
738
|
-
| `rejectLabel` | `string` | — | 拒绝按钮文案 |
|
|
739
|
-
| `compact` | `boolean` | `false` | 紧凑模式(小宽度) |
|
|
740
|
-
| `zIndex` | `number` | — | 自定义层级 |
|
|
741
|
-
|
|
742
|
-
> **Placement**: `'bottom-start'` | `'bottom-end'` | `'top-start'` | `'top-end'` | `'right-start'` | `'left-start'`
|
|
743
|
-
|
|
744
|
-
### Events
|
|
745
|
-
|
|
746
|
-
| 事件 | 参数 | 说明 |
|
|
747
|
-
|------|------|------|
|
|
748
|
-
| `confirm` | — | 用户点击确认 |
|
|
749
|
-
| `reject` | — | 用户点击拒绝 |
|
|
750
|
-
| `ask` | `(question: string)` | 用户提交追问 |
|
|
751
|
-
|
|
752
|
-
### Slots
|
|
753
|
-
|
|
754
|
-
| 插槽 | 说明 |
|
|
755
|
-
|------|------|
|
|
756
|
-
| `input` | 自定义输入区(追问输入框) |
|
|
757
|
-
| `actions` | 自定义操作按钮 |
|
|
758
|
-
| `result` | 自定义结果展示 |
|
|
759
|
-
|
|
760
|
-
### 示例
|
|
761
|
-
```html
|
|
762
|
-
<TfAiOverlay
|
|
763
|
-
:open="aiOpen"
|
|
764
|
-
:anchor="fieldRef"
|
|
765
|
-
:state="aiState"
|
|
766
|
-
:result="aiResult"
|
|
767
|
-
placement="bottom-start"
|
|
768
|
-
@confirm="handleConfirm"
|
|
769
|
-
@reject="handleReject"
|
|
770
|
-
/>
|
|
771
|
-
```
|
|
772
|
-
|
|
773
|
-
---
|
|
774
|
-
|
|
775
|
-
## TfAiStateFlow — AI 流程可视化
|
|
776
|
-
|
|
777
|
-
5 步状态可视化指示器,展示当前 AI 处理进度。
|
|
778
|
-
|
|
779
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
780
|
-
|------|------|--------|------|
|
|
781
|
-
| `state` | `'idle' \| 'running' \| 'confirming' \| 'done' \| 'error'` | `'idle'` | 当前步骤状态 |
|
|
782
|
-
| `result` | `string` | — | 完成时显示的结果 |
|
|
783
|
-
| `error` | `string` | — | 错误信息 |
|
|
784
|
-
|
|
785
|
-
**Slots**: `default`
|
|
786
|
-
|
|
787
|
-
**流程步骤**:
|
|
788
|
-
|
|
789
|
-
```
|
|
790
|
-
idle → running → confirming → done
|
|
791
|
-
↘ error
|
|
792
|
-
```
|
|
793
|
-
|
|
794
|
-
### 示例
|
|
795
|
-
```html
|
|
796
|
-
<TfAiStateFlow state="running" />
|
|
797
|
-
<TfAiStateFlow state="done" result="已识别 12 个字段" />
|
|
798
|
-
<TfAiStateFlow state="error" error="网络超时" />
|
|
799
|
-
```
|
|
800
|
-
|
|
801
|
-
---
|
|
802
|
-
|
|
803
|
-
## TfFormAiStatus — 表单 AI 状态聚合
|
|
804
|
-
|
|
805
|
-
在表单级别聚合展示各字段的 AI 识别状态,支持展开查看详情。
|
|
806
|
-
|
|
807
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
808
|
-
|------|------|--------|------|
|
|
809
|
-
| `layout` | `'inline' \| 'stack'` | `'inline'` | 布局模式 |
|
|
810
|
-
| `show` | `FormAiStatusKey[]` | — | 过滤显示的状态类型 |
|
|
811
|
-
| `expandable` | `boolean` | `false` | 是否可展开详情 |
|
|
812
|
-
| `compact` | `boolean` | `false` | 紧凑模式 |
|
|
813
|
-
| `labels` | `Record<string, string>` | — | 自定义状态标签映射 |
|
|
814
|
-
|
|
815
|
-
**Events**: `click-status` (点击状态), `click-field` (点击字段名,定位到对应字段)
|
|
816
|
-
|
|
817
|
-
> **FormAiStatusKey**: `'loading' | 'done' | 'confirmed' | 'error' | 'pending' | 'rejected'`
|
|
818
|
-
|
|
819
|
-
### 示例
|
|
820
|
-
```html
|
|
821
|
-
<TfFormAiStatus
|
|
822
|
-
layout="stack"
|
|
823
|
-
:show="['loading', 'done', 'error']"
|
|
824
|
-
expandable
|
|
825
|
-
@click-field="scrollToField"
|
|
826
|
-
/>
|
|
827
|
-
```
|
|
828
|
-
|
|
829
|
-
---
|
|
830
|
-
|
|
831
|
-
## TfFormAiToolbar — 批量 AI 操作工具栏
|
|
832
|
-
|
|
833
|
-
提供表单级批量 AI 操作:全量识别、一键应用、批量确认/拒绝。
|
|
834
|
-
|
|
835
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
836
|
-
|------|------|--------|------|
|
|
837
|
-
| `onRecognize` | `() => Promise<void>` | — | 触发识别回调 |
|
|
838
|
-
| `loading` | `boolean` | `false` | 全局加载 |
|
|
839
|
-
| `disabled` | `boolean` | `false` | 全局禁用 |
|
|
840
|
-
|
|
841
|
-
### 暴露方法 (通过 template ref)
|
|
842
|
-
|
|
843
|
-
| 方法 | 说明 |
|
|
844
|
-
|------|------|
|
|
845
|
-
| `recognizeAll()` | 触发全量识别 |
|
|
846
|
-
| `applyAll()` | 一键应用所有 AI 建议 |
|
|
847
|
-
| `confirmAll()` | 批量确认所有 |
|
|
848
|
-
| `checkAll()` | 全选所有建议 |
|
|
849
|
-
| `rejectAll()` | 全拒所有建议 |
|
|
850
|
-
|
|
851
|
-
### 示例
|
|
852
|
-
```html
|
|
853
|
-
<TfFormAiToolbar
|
|
854
|
-
:onRecognize="handleRecognize"
|
|
855
|
-
ref="aiToolbar"
|
|
856
|
-
/>
|
|
857
|
-
|
|
858
|
-
<!-- 编程式调用 -->
|
|
859
|
-
<script setup>
|
|
860
|
-
const aiToolbar = ref()
|
|
861
|
-
await aiToolbar.value.recognizeAll()
|
|
862
|
-
await aiToolbar.value.applyAll()
|
|
863
|
-
</script>
|
|
864
|
-
```
|
|
865
|
-
|
|
866
|
-
---
|
|
867
|
-
|
|
868
|
-
## AI 交互流程(完整示例)
|
|
869
|
-
|
|
870
|
-
```html
|
|
871
|
-
<template>
|
|
872
|
-
<TfForm ref="formRef">
|
|
873
|
-
<!-- 步骤 1: 显示 AI 状态聚合 -->
|
|
874
|
-
<TfFormAiStatus expandable @click-field="scrollToField" />
|
|
875
|
-
|
|
876
|
-
<!-- 步骤 2: 批量操作工具栏 -->
|
|
877
|
-
<TfFormAiToolbar
|
|
878
|
-
ref="aiToolbar"
|
|
879
|
-
:onRecognize="handleRecognize"
|
|
880
|
-
/>
|
|
881
|
-
|
|
882
|
-
<!-- 表单内容 -->
|
|
883
|
-
<TfFormItem label="公司名称" name="companyName">
|
|
884
|
-
<TfInput v-model="form.companyName" ref="companyRef" />
|
|
885
|
-
</TfFormItem>
|
|
886
|
-
|
|
887
|
-
<!-- 步骤 3: AI 浮层 — 字段级确认 -->
|
|
888
|
-
<TfAiOverlay
|
|
889
|
-
:open="aiOverlay.open"
|
|
890
|
-
:anchor="aiOverlay.anchor"
|
|
891
|
-
:state="aiOverlay.state"
|
|
892
|
-
:result="aiOverlay.result"
|
|
893
|
-
@confirm="onFieldConfirm"
|
|
894
|
-
@reject="onFieldReject"
|
|
895
|
-
/>
|
|
896
|
-
</TfForm>
|
|
897
|
-
</template>
|
|
898
|
-
```
|
|
899
|
-
|
|
900
|
-
> 完整数据流: `TfFormAiToolbar.recognizeAll()` → 各字段并行请求 AI → 状态汇总到 `TfFormAiStatus` → 用户逐字段通过 `TfAiOverlay` 确认/拒绝 → `TfFormAiToolbar.applyAll()` 批量生效
|
|
901
|
-
|
|
902
|
-
---
|
|
903
|
-
|
|
904
|
-
# 砼方企业 AI 组件库 - 通用 UI 组件分析
|
|
905
|
-
|
|
906
|
-
> 文档类型:通用 UI 组件完整清单
|
|
907
|
-
> 组件数量:37 个(非表单、非布局类)
|
|
908
|
-
> 技术栈:Vue 3 + TypeScript + Tailwind CSS + Lucide Icons + ECharts
|
|
909
|
-
|
|
910
|
-
---
|
|
911
|
-
|
|
912
|
-
## 组件总览
|
|
913
|
-
|
|
914
|
-
| 分类 | 组件列表 |
|
|
915
|
-
|------|---------|
|
|
916
|
-
| 基础输入/展示 | button, icon, typography, tag, badge, status-dot |
|
|
917
|
-
| 导航 | dropdown, menu, tree, tabs, breadcrumb, steps, pagination, anchor |
|
|
918
|
-
| 反馈 | alert, modal, drawer, notification, message, progress, skeleton |
|
|
919
|
-
| 数据展示 | table, chart, code-block, metric, timeline, empty, image-preview |
|
|
920
|
-
| 工具 | tooltip, divider, back-top |
|
|
921
|
-
| 复合组件 | upload, carousel, slider |
|
|
922
|
-
| 覆盖/辅助 | watermark, affix, avatar |
|
|
923
|
-
|
|
924
|
-
---
|
|
925
|
-
|
|
926
|
-
## 一、基础输入/展示组件
|
|
927
|
-
|
|
928
|
-
### 1. TfButton 按钮
|
|
929
|
-
|
|
930
|
-
触发操作的命令式入口。支持多种语义类型、尺寸和 AI 增强状态。
|
|
931
|
-
|
|
932
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
933
|
-
|------|------|--------|------|
|
|
934
|
-
| `type` | `'primary' \| 'success' \| 'warning' \| 'error' \| 'default'` | `'default'` | 按钮语义类型 |
|
|
935
|
-
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | 按钮尺寸 |
|
|
936
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
937
|
-
| `loading` | `boolean` | `false` | 加载中,阻止点击 |
|
|
938
|
-
| `plain` | `boolean` | `false` | 朴素按钮,背景透明 |
|
|
939
|
-
| `round` | `boolean` | `false` | 胶囊圆角 |
|
|
940
|
-
| `circle` | `boolean` | `false` | 圆形按钮 |
|
|
941
|
-
| `ai` | `boolean` | `false` | 启用 AI 增强视觉 |
|
|
942
|
-
| `aiStatus` | `'idle' \| 'running' \| 'confirming' \| 'done' \| 'error'` | `'idle'` | AI 执行状态 |
|
|
943
|
-
| `class` | `string` | `''` | 自定义类名 |
|
|
944
|
-
|
|
945
|
-
| 事件 | 参数 | 说明 |
|
|
946
|
-
|------|------|------|
|
|
947
|
-
| `click` | `event: MouseEvent` | 点击事件 |
|
|
948
|
-
| `focus` | `event: FocusEvent` | 获得焦点 |
|
|
949
|
-
| `blur` | `event: FocusEvent` | 失去焦点 |
|
|
950
|
-
|
|
951
|
-
| 插槽 | 说明 |
|
|
952
|
-
|------|------|
|
|
953
|
-
| `default` | 按钮文本 |
|
|
954
|
-
| `icon` | 前置图标 |
|
|
955
|
-
|
|
956
|
-
```vue
|
|
957
|
-
<TfButton type="primary" size="large">提交</TfButton>
|
|
958
|
-
<TfButton loading>加载中</TfButton>
|
|
959
|
-
<TfButton ai ai-status="running">AI 分析中</TfButton>
|
|
960
|
-
```
|
|
961
|
-
|
|
962
|
-
### 2. TfIcon 图标
|
|
963
|
-
|
|
964
|
-
基于 Lucide 图标库的统一图标组件,支持旋转、自旋动画和 AI 图标。
|
|
965
|
-
|
|
966
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
967
|
-
|------|------|--------|------|
|
|
968
|
-
| `icon` | `Lucide Component` | - | Lucide 图标组件 |
|
|
969
|
-
| `size` | `'small'(12) \| 'medium'(16) \| 'large'(20) \| number` | `'medium'` | 图标尺寸 |
|
|
970
|
-
| `color` | `string` | - | 自定义颜色 |
|
|
971
|
-
| `rotate` | `0 \| 90 \| 180 \| 270` | `0` | 旋转角度 |
|
|
972
|
-
| `spin` | `boolean` | `false` | 旋转动画 |
|
|
973
|
-
| `ai` | `boolean` | `false` | 渲染内置 Bot 图标 |
|
|
974
|
-
| `class` | `string` | `''` | 自定义类名 |
|
|
975
|
-
|
|
976
|
-
| 插槽 | 说明 |
|
|
977
|
-
|------|------|
|
|
978
|
-
| `default` | 自定义 SVG/字符/Emoji 回退 |
|
|
979
|
-
|
|
980
|
-
```vue
|
|
981
|
-
<TfIcon :icon="Bot" :size="24" color="#085699" />
|
|
982
|
-
<TfIcon :icon="Loader2" spin color="#34BFA3" />
|
|
983
|
-
<TfIcon ai :size="24" />
|
|
984
|
-
```
|
|
985
|
-
|
|
986
|
-
### 3. TfTypography 排版
|
|
987
|
-
|
|
988
|
-
统一文本排版组件,支持标题、段落、行内文本及语义颜色和溢出省略。
|
|
989
|
-
|
|
990
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
991
|
-
|------|------|--------|------|
|
|
992
|
-
| `variant` | `'title' \| 'text' \| 'paragraph'` | `'paragraph'` | 排版类型 |
|
|
993
|
-
| `level` | `1 \| 2 \| 3 \| 4 \| 5` | `1` | 标题层级(variant='title') |
|
|
994
|
-
| `type` | `'default' \| 'secondary' \| 'success' \| 'warning' \| 'error'` | `'default'` | 语义颜色 |
|
|
995
|
-
| `tag` | `string` | - | 自定义 HTML 标签 |
|
|
996
|
-
| `disabled` | `boolean` | `false` | 禁用样式 |
|
|
997
|
-
| `strong` | `boolean` | `false` | 加粗 |
|
|
998
|
-
| `italic` | `boolean` | `false` | 斜体 |
|
|
999
|
-
| `underline` | `boolean` | `false` | 下划线 |
|
|
1000
|
-
| `delete` | `boolean` | `false` | 删除线 |
|
|
1001
|
-
| `code` | `boolean` | `false` | 代码样式 |
|
|
1002
|
-
| `mark` | `boolean` | `false` | 高亮标记 |
|
|
1003
|
-
| `ellipsis` | `boolean \| number` | `false` | 文本省略(true=单行,number=多行) |
|
|
1004
|
-
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | 文本对齐 |
|
|
1005
|
-
| `ai` | `boolean` | `false` | 展示 AI 徽标 |
|
|
1006
|
-
| `aiLabel` | `string` | `'AI'` | AI 徽标文案 |
|
|
1007
|
-
| `class` | `string` | `''` | 自定义类名 |
|
|
1008
|
-
|
|
1009
|
-
| 插槽 | 说明 |
|
|
1010
|
-
|------|------|
|
|
1011
|
-
| `default` | 文本内容 |
|
|
1012
|
-
|
|
1013
|
-
```vue
|
|
1014
|
-
<TfTypography variant="title" :level="3" strong>标题</TfTypography>
|
|
1015
|
-
<TfTypography type="success">成功信息</TfTypography>
|
|
1016
|
-
<TfTypography ai ai-label="AI 建议">推荐配比方案</TfTypography>
|
|
1017
|
-
### 4. TfTag 标签
|
|
1018
|
-
|
|
1019
|
-
用于标记、分类或筛选的小型标签。
|
|
1020
|
-
|
|
1021
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1022
|
-
|------|------|--------|------|
|
|
1023
|
-
| `type` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'error' \| 'info'` | `'default'` | 标签语义类型 |
|
|
1024
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 标签尺寸 |
|
|
1025
|
-
| `closable` | `boolean` | `false` | 是否可关闭 |
|
|
1026
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1027
|
-
| `round` | `boolean` | `false` | 圆角胶囊样式 |
|
|
1028
|
-
| `bordered` | `boolean` | `false` | 是否显示边框 |
|
|
1029
|
-
| `icon` | `Component` | - | 前置图标 |
|
|
1030
|
-
|
|
1031
|
-
| 事件 | 参数 | 说明 |
|
|
1032
|
-
|------|------|------|
|
|
1033
|
-
| `close` | - | 关闭时触发 |
|
|
1034
|
-
|
|
1035
|
-
| 插槽 | 说明 |
|
|
1036
|
-
|------|------|
|
|
1037
|
-
| `default` | 标签内容 |
|
|
1038
|
-
|
|
1039
|
-
```vue
|
|
1040
|
-
<TfTag type="primary">砼方蓝</TfTag>
|
|
1041
|
-
<TfTag type="success" closable @close="onRemove">AI 建议</TfTag>
|
|
1042
|
-
<TfTag round bordered>胶囊标签</TfTag>
|
|
1043
|
-
```
|
|
1044
|
-
|
|
1045
|
-
### 5. TfBadge 徽标
|
|
1046
|
-
|
|
1047
|
-
在元素右上角展示数字或状态点的徽标组件。
|
|
1048
|
-
|
|
1049
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1050
|
-
|------|------|--------|------|
|
|
1051
|
-
| `value` | `string \| number` | - | 徽标数值 |
|
|
1052
|
-
| `max` | `number` | `99` | 最大值,超出显示 `{max}+` |
|
|
1053
|
-
| `dot` | `boolean` | `false` | 仅显示小圆点 |
|
|
1054
|
-
| `type` | `'primary' \| 'success' \| 'warning' \| 'error' \| 'info'` | `'error'` | 徽标颜色类型 |
|
|
1055
|
-
| `hidden` | `boolean` | `false` | 是否隐藏 |
|
|
1056
|
-
| `offset` | `[number, number]` | - | 位置偏移 `[x, y]` |
|
|
1057
|
-
| `showZero` | `boolean` | `false` | value=0 时是否显示 |
|
|
1058
|
-
|
|
1059
|
-
| 插槽 | 说明 |
|
|
1060
|
-
|------|------|
|
|
1061
|
-
| `default` | 被标记的元素 |
|
|
1062
|
-
| `content` | 自定义徽标内容 |
|
|
1063
|
-
|
|
1064
|
-
```vue
|
|
1065
|
-
<TfBadge :value="5"><TfIcon :icon="Bell" /></TfBadge>
|
|
1066
|
-
<TfBadge dot type="success">在线</TfBadge>
|
|
1067
|
-
<TfBadge :value="150" :max="99" />
|
|
1068
|
-
```
|
|
1069
|
-
|
|
1070
|
-
### 6. TfStatusDot 状态点
|
|
1071
|
-
|
|
1072
|
-
用于展示在线状态、运行状态的小圆点组件。
|
|
1073
|
-
|
|
1074
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1075
|
-
|------|------|--------|------|
|
|
1076
|
-
| `status` | `'online' \| 'offline' \| 'away' \| 'busy' \| 'idle'` | `'offline'` | 状态类型 |
|
|
1077
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 圆点尺寸 |
|
|
1078
|
-
| `pulse` | `boolean` | `false` | 脉冲动画 |
|
|
1079
|
-
| `label` | `string` | - | 状态文本标签 |
|
|
1080
|
-
|
|
1081
|
-
| 插槽 | 说明 |
|
|
1082
|
-
|------|------|
|
|
1083
|
-
| `default` | 自定义标签文本 |
|
|
1084
|
-
|
|
1085
|
-
```vue
|
|
1086
|
-
<TfStatusDot status="online" pulse label="运行中" />
|
|
1087
|
-
<TfStatusDot status="busy" label="忙碌" />
|
|
1088
|
-
<TfStatusDot status="offline" label="离线" />
|
|
1089
|
-
```
|
|
1090
|
-
|
|
1091
|
-
---
|
|
1092
|
-
|
|
1093
|
-
## 二、导航组件
|
|
1094
|
-
|
|
1095
|
-
### 7. TfDropdown 下拉菜单
|
|
1096
|
-
|
|
1097
|
-
在触发元素附近弹出的浮层菜单。
|
|
1098
|
-
|
|
1099
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1100
|
-
|------|------|--------|------|
|
|
1101
|
-
| `modelValue` | `boolean` | `false` | v-model 控制显隐 |
|
|
1102
|
-
| `placement` | `string` | `'bottom'` | 弹出位置 |
|
|
1103
|
-
| `trigger` | `'click' \| 'hover'` | `'click'` | 触发方式 |
|
|
1104
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1105
|
-
| `offset` | `number` | - | 偏移距离 |
|
|
1106
|
-
| `teleport` | `boolean` | `true` | 传送至 body |
|
|
1107
|
-
|
|
1108
|
-
| 事件 | 参数 | 说明 |
|
|
1109
|
-
|------|------|------|
|
|
1110
|
-
| `update:modelValue` | `boolean` | 显隐变更 |
|
|
1111
|
-
|
|
1112
|
-
| 插槽 | 说明 |
|
|
1113
|
-
|------|------|
|
|
1114
|
-
| `default` | 触发元素 |
|
|
1115
|
-
| `content` | 下拉内容 |
|
|
1116
|
-
|
|
1117
|
-
```vue
|
|
1118
|
-
<TfDropdown v-model="open" trigger="hover">
|
|
1119
|
-
<TfButton>操作</TfButton>
|
|
1120
|
-
<template #content>
|
|
1121
|
-
<div>编辑 / 删除</div>
|
|
1122
|
-
</template>
|
|
1123
|
-
</TfDropdown>
|
|
1124
|
-
```
|
|
1125
|
-
|
|
1126
|
-
### 8. TfMenu 导航菜单
|
|
1127
|
-
|
|
1128
|
-
垂直或水平排列的导航菜单,支持选中、展开、折叠。
|
|
1129
|
-
|
|
1130
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1131
|
-
|------|------|--------|------|
|
|
1132
|
-
| `items` | `MenuItem[]` | `[]` | 菜单项数据 |
|
|
1133
|
-
| `mode` | `'vertical' \| 'horizontal'` | `'vertical'` | 排列方向 |
|
|
1134
|
-
| `collapsed` | `boolean` | `false` | 是否折叠 |
|
|
1135
|
-
| `selectedKeys` | `string[]` | `[]` | 当前选中项 key |
|
|
1136
|
-
| `openKeys` | `string[]` | `[]` | 当前展开子菜单 key |
|
|
1137
|
-
| `theme` | `string` | - | 主题色 |
|
|
1138
|
-
| `inlineIndent` | `number` | `24` | 内联缩进像素 |
|
|
1139
|
-
|
|
1140
|
-
| 事件 | 参数 | 说明 |
|
|
1141
|
-
|------|------|------|
|
|
1142
|
-
| `select` | `(key: string)` | 菜单项选中 |
|
|
1143
|
-
| `open` | `(key: string)` | 子菜单展开 |
|
|
1144
|
-
| `close` | `(key: string)` | 子菜单收起 |
|
|
1145
|
-
|
|
1146
|
-
| 插槽 | 说明 |
|
|
1147
|
-
|------|------|
|
|
1148
|
-
| `default` | 自定义菜单内容 |
|
|
1149
|
-
|
|
1150
|
-
```vue
|
|
1151
|
-
<TfMenu :items="menuItems" mode="horizontal" :selectedKeys="['home']" />
|
|
1152
|
-
### 9. TfTree 树形控件
|
|
1153
|
-
|
|
1154
|
-
层级结构数据的树形展示与交互,支持展开、选中、勾选、拖拽。
|
|
1155
|
-
|
|
1156
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1157
|
-
|------|------|--------|------|
|
|
1158
|
-
| `data` | `TreeNode[]` | `[]` | 树节点数据 |
|
|
1159
|
-
| `expandedKeys` | `string[]` | `[]` | 展开节点 key |
|
|
1160
|
-
| `checkedKeys` | `string[]` | `[]` | 勾选节点 key |
|
|
1161
|
-
| `selectedKeys` | `string[]` | `[]` | 选中节点 key |
|
|
1162
|
-
| `checkable` | `boolean` | `false` | 是否显示复选框 |
|
|
1163
|
-
| `draggable` | `boolean` | `false` | 是否可拖拽 |
|
|
1164
|
-
| `filter` | `(node) => boolean` | - | 节点过滤函数 |
|
|
1165
|
-
| `loadData` | `function` | - | 异步加载子节点 |
|
|
1166
|
-
| `showLine` | `boolean` | `false` | 是否显示连接线 |
|
|
1167
|
-
|
|
1168
|
-
| 事件 | 参数 | 说明 |
|
|
1169
|
-
|------|------|------|
|
|
1170
|
-
| `expand` | `(key: string)` | 节点展开 |
|
|
1171
|
-
| `check` | `(keys: string[])` | 勾选变更 |
|
|
1172
|
-
| `select` | `(key: string)` | 节点选中 |
|
|
1173
|
-
| `drop` | `(info: DropInfo)` | 拖拽释放 |
|
|
1174
|
-
|
|
1175
|
-
| 插槽 | 说明 |
|
|
1176
|
-
|------|------|
|
|
1177
|
-
| `default` | 自定义树内容 |
|
|
1178
|
-
| `title` | 自定义节点标题 |
|
|
1179
|
-
|
|
1180
|
-
```vue
|
|
1181
|
-
<TfTree :data="treeData" checkable :expandedKeys="expanded" @check="onCheck" />
|
|
1182
|
-
<TfTree :data="orgData" draggable @drop="onDrop" />
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
### 10. TfTabs 标签页
|
|
1186
|
-
|
|
1187
|
-
在同一区域切换展示不同内容的面板。
|
|
1188
|
-
|
|
1189
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1190
|
-
|------|------|--------|------|
|
|
1191
|
-
| `modelValue` | `string` | - | v-model 当前激活 tab |
|
|
1192
|
-
| `type` | `'line' \| 'card' \| 'segment'` | `'line'` | 标签页样式 |
|
|
1193
|
-
| `size` | `string` | - | 标签尺寸 |
|
|
1194
|
-
| `position` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | 标签位置 |
|
|
1195
|
-
| `closable` | `boolean` | `false` | 是否可关闭 |
|
|
1196
|
-
| `addable` | `boolean` | `false` | 是否可新增 |
|
|
1197
|
-
| `scrollable` | `boolean` | `false` | 是否可滚动 |
|
|
1198
|
-
|
|
1199
|
-
| 事件 | 参数 | 说明 |
|
|
1200
|
-
|------|------|------|
|
|
1201
|
-
| `update:modelValue` | `string` | 切换 tab |
|
|
1202
|
-
| `close` | `(key: string)` | 关闭 tab |
|
|
1203
|
-
| `add` | - | 新增 tab |
|
|
1204
|
-
|
|
1205
|
-
| 插槽 | 说明 |
|
|
1206
|
-
|------|------|
|
|
1207
|
-
| `default` | tab 面板内容 |
|
|
1208
|
-
|
|
1209
|
-
```vue
|
|
1210
|
-
<TfTabs v-model="activeTab" type="segment">
|
|
1211
|
-
<TfTabPane key="info" label="基本信息">...</TfTabPane>
|
|
1212
|
-
<TfTabPane key="ai" label="AI 分析">...</TfTabPane>
|
|
1213
|
-
</TfTabs>
|
|
1214
|
-
```
|
|
1215
|
-
|
|
1216
|
-
### 11. TfBreadcrumb 面包屑
|
|
1217
|
-
|
|
1218
|
-
显示当前页面在层级结构中的位置导航。
|
|
1219
|
-
|
|
1220
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1221
|
-
|------|------|--------|------|
|
|
1222
|
-
| `items` | `{label, to?, icon?}[]` | `[]` | 面包屑项数据 |
|
|
1223
|
-
| `separator` | `string` | `'/'` | 分隔符 |
|
|
1224
|
-
|
|
1225
|
-
| 事件 | 参数 | 说明 |
|
|
1226
|
-
|------|------|------|
|
|
1227
|
-
| `click` | `(item, index)` | 点击面包屑项 |
|
|
1228
|
-
|
|
1229
|
-
| 插槽 | 说明 |
|
|
1230
|
-
|------|------|
|
|
1231
|
-
| `default` | 自定义内容 |
|
|
1232
|
-
| `separator` | 自定义分隔符 |
|
|
1233
|
-
|
|
1234
|
-
```vue
|
|
1235
|
-
<TfBreadcrumb :items="[{label:'首页',to:'/'},{label:'任务详情'}]" />
|
|
1236
|
-
<TfBreadcrumb :items="crumbs" separator=">">
|
|
1237
|
-
<template #separator>→</template>
|
|
1238
|
-
</TfBreadcrumb>
|
|
1239
|
-
```
|
|
1240
|
-
|
|
1241
|
-
### 12. TfPagination 分页
|
|
1242
|
-
|
|
1243
|
-
数据分页浏览控件,支持页码切换、每页条数调整、快速跳转。
|
|
1244
|
-
|
|
1245
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1246
|
-
|------|------|--------|------|
|
|
1247
|
-
| `modelValue` | `number` | `1` | v-model 当前页码 |
|
|
1248
|
-
| `total` | `number` | `0` | 数据总数 |
|
|
1249
|
-
| `pageSize` | `number` | `10` | 每页条数 |
|
|
1250
|
-
| `pageSizeOptions` | `number[]` | - | 每页条数选项 |
|
|
1251
|
-
| `showSizeChanger` | `boolean` | `false` | 显示条数切换器 |
|
|
1252
|
-
| `showTotal` | `boolean` | `false` | 显示总数 |
|
|
1253
|
-
| `showJumper` | `boolean` | `false` | 显示快速跳转 |
|
|
1254
|
-
| `size` | `string` | - | 分页尺寸 |
|
|
1255
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1256
|
-
| `simple` | `boolean` | `false` | 简洁模式 |
|
|
1257
|
-
|
|
1258
|
-
| 事件 | 参数 | 说明 |
|
|
1259
|
-
|------|------|------|
|
|
1260
|
-
| `update:modelValue` | `number` | 页码变更 |
|
|
1261
|
-
| `pageSizeChange` | `number` | 每页条数变更 |
|
|
1262
|
-
| `change` | `(page, pageSize)` | 页码或条数变更 |
|
|
1263
|
-
|
|
1264
|
-
```vue
|
|
1265
|
-
<TfPagination v-model="page" :total="200" :pageSize="20" showJumper />
|
|
1266
|
-
<TfPagination simple v-model="page" :total="50" />
|
|
1267
|
-
```
|
|
1268
|
-
|
|
1269
|
-
### 13. TfAnchor 锚点
|
|
1270
|
-
|
|
1271
|
-
页面内跳转的锚点导航,自动高亮当前滚动位置对应的标题。
|
|
1272
|
-
|
|
1273
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1274
|
-
|------|------|--------|------|
|
|
1275
|
-
| `items` | `{key, href, title}[]` | `[]` | 锚点项数据 |
|
|
1276
|
-
| `offsetTop` | `number` | `0` | 距离顶部偏移 |
|
|
1277
|
-
| `bounds` | `number` | - | 锚点区域边界 |
|
|
1278
|
-
| `scrollContainer` | `string \| HTMLElement` | - | 滚动容器 |
|
|
1279
|
-
|
|
1280
|
-
| 事件 | 参数 | 说明 |
|
|
1281
|
-
|------|------|------|
|
|
1282
|
-
| `change` | `(key: string)` | 锚点变更 |
|
|
1283
|
-
| `click` | `(item, event)` | 点击锚点 |
|
|
1284
|
-
```
|
|
1285
|
-
|
|
1286
|
-
## 三、反馈组件
|
|
1287
|
-
|
|
1288
|
-
### 14. TfAlert 警告提示
|
|
1289
|
-
|
|
1290
|
-
展示重要提示信息的横幅组件,支持多种语义类型。
|
|
1291
|
-
|
|
1292
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1293
|
-
|------|------|--------|------|
|
|
1294
|
-
| `type` | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | 提示语义类型 |
|
|
1295
|
-
| `title` | `string` | - | 提示标题 |
|
|
1296
|
-
| `closable` | `boolean` | `false` | 是否可关闭 |
|
|
1297
|
-
| `showIcon` | `boolean` | `false` | 是否显示图标 |
|
|
1298
|
-
| `banner` | `boolean` | `false` | 顶部公告横幅模式 |
|
|
1299
|
-
|
|
1300
|
-
| 事件 | 参数 | 说明 |
|
|
1301
|
-
|------|------|------|
|
|
1302
|
-
| `close` | - | 关闭时触发 |
|
|
1303
|
-
|
|
1304
|
-
| 插槽 | 说明 |
|
|
1305
|
-
|------|------|
|
|
1306
|
-
| `default` | 提示内容 |
|
|
1307
|
-
| `title` | 自定义标题 |
|
|
1308
|
-
| `icon` | 自定义图标 |
|
|
1309
|
-
| `action` | 自定义操作区 |
|
|
1310
|
-
|
|
1311
|
-
```vue
|
|
1312
|
-
<TfAlert type="success" title="操作成功" showIcon />
|
|
1313
|
-
<TfAlert type="warning" closable @close="onClose">配比偏差超过阈值,请人工复核</TfAlert>
|
|
1314
|
-
```
|
|
1315
|
-
|
|
1316
|
-
### 15. TfModal 对话框
|
|
1317
|
-
|
|
1318
|
-
模态弹窗,用于重要信息确认或表单填写。
|
|
1319
|
-
|
|
1320
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1321
|
-
|------|------|--------|------|
|
|
1322
|
-
| `open` | `boolean` | `false` | v-model 控制显隐 |
|
|
1323
|
-
| `title` | `string` | - | 弹窗标题 |
|
|
1324
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | `'md'` | 弹窗尺寸 |
|
|
1325
|
-
| `closable` | `boolean` | `true` | 是否显示关闭按钮 |
|
|
1326
|
-
| `maskClosable` | `boolean` | `true` | 点击遮罩是否关闭 |
|
|
1327
|
-
| `footer` | `null \| VNode` | - | 底部操作区(null 隐藏) |
|
|
1328
|
-
| `centered` | `boolean` | `false` | 是否垂直居中 |
|
|
1329
|
-
| `destroyOnClose` | `boolean` | `false` | 关闭后销毁内容 |
|
|
1330
|
-
|
|
1331
|
-
| 事件 | 参数 | 说明 |
|
|
1332
|
-
|------|------|------|
|
|
1333
|
-
| `confirm` | - | 确认回调 |
|
|
1334
|
-
| `cancel` | - | 取消回调 |
|
|
1335
|
-
| `close` | - | 关闭回调 |
|
|
1336
|
-
|
|
1337
|
-
| 插槽 | 说明 |
|
|
1338
|
-
|------|------|
|
|
1339
|
-
| `default` | 弹窗内容 |
|
|
1340
|
-
| `header` | 自定义头部 |
|
|
1341
|
-
| `footer` | 自定义底部 |
|
|
1342
|
-
|
|
1343
|
-
```vue
|
|
1344
|
-
<TfModal v-model:open="visible" title="AI 配比建议" @confirm="onConfirm">
|
|
1345
|
-
<p>AI 建议将水胶比调整为 0.38,是否采纳?</p>
|
|
1346
|
-
</TfModal>
|
|
1347
|
-
```
|
|
1348
|
-
|
|
1349
|
-
### 16. TfDrawer 抽屉
|
|
1350
|
-
|
|
1351
|
-
从屏幕边缘滑出的浮层面板,用于信息展示或表单编辑。
|
|
1352
|
-
|
|
1353
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1354
|
-
|------|------|--------|------|
|
|
1355
|
-
| `open` | `boolean` | `false` | v-model 控制显隐 |
|
|
1356
|
-
| `title` | `string` | - | 抽屉标题 |
|
|
1357
|
-
| `placement` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 滑出方向 |
|
|
1358
|
-
| `size` | `string \| number` | - | 抽屉尺寸 |
|
|
1359
|
-
| `closable` | `boolean` | `true` | 是否显示关闭按钮 |
|
|
1360
|
-
| `maskClosable` | `boolean` | `true` | 点击遮罩是否关闭 |
|
|
1361
|
-
| `destroyOnClose` | `boolean` | `false` | 关闭后销毁内容 |
|
|
1362
|
-
| `showMask` | `boolean` | `true` | 是否显示遮罩 |
|
|
1363
|
-
|
|
1364
|
-
| 事件 | 参数 | 说明 |
|
|
1365
|
-
|------|------|------|
|
|
1366
|
-
| `close` | - | 关闭回调 |
|
|
1367
|
-
|
|
1368
|
-
| 插槽 | 说明 |
|
|
1369
|
-
|------|------|
|
|
1370
|
-
| `default` | 抽屉内容 |
|
|
1371
|
-
| `header` | 自定义头部 |
|
|
1372
|
-
| `footer` | 自定义底部 |
|
|
1373
|
-
|
|
1374
|
-
```vue
|
|
1375
|
-
<TfDrawer v-model:open="detailVisible" title="任务详情" placement="right" size="lg">
|
|
1376
|
-
<TaskDetail :id="taskId" />
|
|
1377
|
-
</TfDrawer>
|
|
1378
|
-
```
|
|
1379
|
-
|
|
1380
|
-
### 17. TfNotification 通知提醒
|
|
1381
|
-
|
|
1382
|
-
从屏幕角落弹出的全局通知,通过命令式 API 调用。
|
|
1383
|
-
|
|
1384
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1385
|
-
|------|------|--------|------|
|
|
1386
|
-
| `title` | `string` | - | 通知标题 |
|
|
1387
|
-
| `content` | `string` | - | 通知内容 |
|
|
1388
|
-
| `type` | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | 通知类型 |
|
|
1389
|
-
| `duration` | `number` | `4500` | 自动关闭毫秒(0=不关闭) |
|
|
1390
|
-
| `placement` | `string` | `'topRight'` | 弹出位置 |
|
|
1391
|
-
| `closable` | `boolean` | `true` | 是否可手动关闭 |
|
|
1392
|
-
|
|
1393
|
-
**调用方式**(命令式):
|
|
1394
|
-
|
|
1395
|
-
```ts
|
|
1396
|
-
Notification.open({
|
|
1397
|
-
title: 'AI 分析完成',
|
|
1398
|
-
content: '配比优化方案已生成',
|
|
1399
|
-
type: 'success',
|
|
1400
|
-
duration: 5000
|
|
1401
|
-
})
|
|
1402
|
-
```
|
|
1403
|
-
|
|
1404
|
-
### 18. TfMessage 全局消息
|
|
1405
|
-
|
|
1406
|
-
轻量级全局消息提示,通过命令式 API 快捷调用。
|
|
1407
|
-
|
|
1408
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1409
|
-
|------|------|--------|------|
|
|
1410
|
-
| `content` | `string` | - | 消息内容 |
|
|
1411
|
-
| `type` | `'info' \| 'success' \| 'warning' \| 'error' \| 'loading'` | `'info'` | 消息类型 |
|
|
1412
|
-
| `duration` | `number` | `3000` | 自动关闭毫秒 |
|
|
1413
|
-
| `closable` | `boolean` | `false` | 是否可关闭 |
|
|
1414
|
-
|
|
1415
|
-
**调用方式**(命令式):
|
|
1416
|
-
|
|
1417
|
-
```ts
|
|
1418
|
-
Message.success('保存成功')
|
|
1419
|
-
Message.error('网络异常,请重试')
|
|
1420
|
-
Message.loading('AI 正在计算中...')
|
|
1421
|
-
```
|
|
1422
|
-
|
|
1423
|
-
### 19. TfProgress 进度条
|
|
1424
|
-
|
|
1425
|
-
展示操作或任务的完成进度,支持线形、圆形和仪表盘。
|
|
1426
|
-
|
|
1427
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1428
|
-
|------|------|--------|------|
|
|
1429
|
-
| `percentage` | `number` | `0` | 当前百分比 |
|
|
1430
|
-
| `type` | `'line' \| 'circle' \| 'dashboard'` | `'line'` | 进度条类型 |
|
|
1431
|
-
| `strokeWidth` | `number` | `6` | 进度条线宽 |
|
|
1432
|
-
| `status` | `'success' \| 'exception' \| 'warning'` | - | 进度状态 |
|
|
1433
|
-
| `showInfo` | `boolean` | `true` | 是否显示百分比文字 |
|
|
1434
|
-
| `strokeColor` | `string \| object` | - | 进度条颜色 |
|
|
1435
|
-
| `width` | `number` | `120` | 圆形宽度(circle 模式) |
|
|
1436
|
-
| `gapDegree` | `number` | - | 仪表盘缺口角度 |
|
|
1437
|
-
| `gapPosition` | `string` | - | 仪表盘缺口位置 |
|
|
1438
|
-
|
|
1439
|
-
| 插槽 | 说明 |
|
|
1440
|
-
|------|------|
|
|
1441
|
-
| `default` | 自定义文本 |
|
|
1442
|
-
|
|
1443
|
-
```vue
|
|
1444
|
-
<TfProgress :percentage="72" status="success" />
|
|
1445
|
-
<TfProgress type="circle" :percentage="85" :strokeWidth="10" />
|
|
1446
|
-
<TfProgress type="dashboard" :percentage="60" :gapDegree="75" />
|
|
1447
|
-
```
|
|
1448
|
-
|
|
1449
|
-
### 20. TfSkeleton 骨架屏
|
|
1450
|
-
|
|
1451
|
-
在数据加载期间展示占位骨架,减少页面抖动。
|
|
1452
|
-
|
|
1453
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1454
|
-
|------|------|--------|------|
|
|
1455
|
-
| `loading` | `boolean` | `true` | 是否显示骨架 |
|
|
1456
|
-
| `animated` | `boolean` | `true` | 是否动画 |
|
|
1457
|
-
| `avatar` | `boolean \| object` | `false` | 显示头像占位 |
|
|
1458
|
-
| `paragraph` | `{rows: number, width: string\|string[]}` | `{rows:3}` | 段落占位 |
|
|
1459
|
-
| `title` | `{width: string}` | `{width:'60%'}` | 标题占位 |
|
|
1460
|
-
|
|
1461
|
-
| 插槽 | 说明 |
|
|
1462
|
-
|------|------|
|
|
1463
|
-
| `default` | 加载完成后显示的内容 |
|
|
1464
|
-
|
|
1465
|
-
```vue
|
|
1466
|
-
<TfSkeleton :loading="loading" :paragraph="{rows:4}" avatar>
|
|
1467
|
-
<TaskCard :data="task" />
|
|
1468
|
-
</TfSkeleton>
|
|
1469
|
-
```
|
|
1470
|
-
|
|
1471
|
-
## 四、数据展示组件
|
|
1472
|
-
|
|
1473
|
-
### 21. TfTable 表格
|
|
1474
|
-
|
|
1475
|
-
数据表格的核心展示组件,支持排序、筛选、选择、展开、虚拟滚动。
|
|
1476
|
-
|
|
1477
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1478
|
-
|------|------|--------|------|
|
|
1479
|
-
| `data` | `object[]` | `[]` | 表格数据 |
|
|
1480
|
-
| `columns` | `TableColumn[]` | `[]` | 列配置 |
|
|
1481
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
1482
|
-
| `empty` | `string` | - | 空数据提示 |
|
|
1483
|
-
| `bordered` | `boolean` | `false` | 是否显示边框 |
|
|
1484
|
-
| `striped` | `boolean` | `false` | 斑马纹 |
|
|
1485
|
-
| `hover` | `boolean` | `true` | 悬停高亮 |
|
|
1486
|
-
| `size` | `string` | - | 表格尺寸 |
|
|
1487
|
-
| `pagination` | `boolean \| object` | `false` | 分页配置 |
|
|
1488
|
-
| `rowKey` | `string` | - | 行唯一标识字段 |
|
|
1489
|
-
| `rowSelection` | `object` | - | 行选择配置 |
|
|
1490
|
-
| `expandable` | `object` | - | 行展开配置 |
|
|
1491
|
-
| `sortCompare` | `function` | - | 自定义排序函数 |
|
|
1492
|
-
| `filter` | `object` | - | 列筛选配置 |
|
|
1493
|
-
| `virtualScroll` | `boolean` | `false` | 虚拟滚动 |
|
|
1494
|
-
| `maxHeight` | `number` | - | 最大高度 |
|
|
1495
|
-
|
|
1496
|
-
| 事件 | 参数 | 说明 |
|
|
1497
|
-
|------|------|------|
|
|
1498
|
-
| `rowClick` | `(row, event)` | 行点击 |
|
|
1499
|
-
| `selectionChange` | `(selectedRows)` | 选中行变更 |
|
|
1500
|
-
| `sortChange` | `(sortInfo)` | 排序变更 |
|
|
1501
|
-
| `filterChange` | `(filters)` | 筛选变更 |
|
|
1502
|
-
|
|
1503
|
-
| 插槽 | 说明 |
|
|
1504
|
-
|------|------|
|
|
1505
|
-
| `default` | 自定义表格 |
|
|
1506
|
-
| `empty` | 空数据展示 |
|
|
1507
|
-
| `loading` | 加载中展示 |
|
|
1508
|
-
| `[columnSlot]` | 动态列自定义插槽 |
|
|
1509
|
-
|
|
1510
|
-
```vue
|
|
1511
|
-
<TfTable :data="tasks" :columns="columns" :pagination="{pageSize:20}" striped hover />
|
|
1512
|
-
<TfTable :data="largeData" virtualScroll :maxHeight="400" :rowKey="'id'" />
|
|
1513
|
-
```
|
|
1514
|
-
|
|
1515
|
-
### 22. TfChart 图表
|
|
1516
|
-
|
|
1517
|
-
基于 ECharts 的图表组件,支持所有 ECharts 图表类型和主题配置。
|
|
1518
|
-
|
|
1519
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1520
|
-
|------|------|--------|------|
|
|
1521
|
-
| `options` | `EChartsOption` | - | ECharts 配置项 |
|
|
1522
|
-
| `theme` | `string` | - | 主题名称 |
|
|
1523
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
1524
|
-
| `autoresize` | `boolean` | `true` | 窗口变化自动重绘 |
|
|
1525
|
-
| `height` | `string \| number` | - | 图表高度 |
|
|
1526
|
-
| `width` | `string \| number` | - | 图表宽度 |
|
|
1527
|
-
| `group` | `string` | - | 图表联动分组 |
|
|
1528
|
-
| `initOptions` | `object` | - | ECharts init 选项 |
|
|
1529
|
-
|
|
1530
|
-
| 事件 | 参数 | 说明 |
|
|
1531
|
-
|------|------|------|
|
|
1532
|
-
| `chartReady` | `(chartInstance)` | 图表实例就绪 |
|
|
1533
|
-
| `chartClick` | `(params)` | 图表点击 |
|
|
1534
|
-
| `chartDblClick` | `(params)` | 图表双击 |
|
|
1535
|
-
|
|
1536
|
-
```vue
|
|
1537
|
-
<TfChart :options="lineOptions" :height="400" @chartClick="onClick" />
|
|
1538
|
-
<TfChart :options="pieOptions" theme="dark" autoresize />
|
|
1539
|
-
```
|
|
1540
|
-
|
|
1541
|
-
### 23. TfCodeBlock 代码块
|
|
1542
|
-
|
|
1543
|
-
代码高亮展示组件,支持语法高亮、行号、复制、折叠。
|
|
1544
|
-
|
|
1545
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1546
|
-
|------|------|--------|------|
|
|
1547
|
-
| `code` | `string` | - | 代码内容 |
|
|
1548
|
-
| `language` | `string` | - | 编程语言 |
|
|
1549
|
-
| `showLineNumbers` | `boolean` | `true` | 是否显示行号 |
|
|
1550
|
-
| `maxHeight` | `number` | - | 最大高度 |
|
|
1551
|
-
| `collapsible` | `boolean` | `false` | 是否可折叠 |
|
|
1552
|
-
| `collapsedHeight` | `number` | `200` | 折叠后高度 |
|
|
1553
|
-
| `copyable` | `boolean` | `true` | 是否可复制 |
|
|
1554
|
-
| `title` | `string` | - | 代码块标题 |
|
|
1555
|
-
| `theme` | `'light' \| 'dark'` | `'light'` | 主题 |
|
|
1556
|
-
|
|
1557
|
-
| 事件 | 参数 | 说明 |
|
|
1558
|
-
|------|------|------|
|
|
1559
|
-
| `copy` | `(code: string)` | 复制成功 |
|
|
1560
|
-
|
|
1561
|
-
```vue
|
|
1562
|
-
<TfCodeBlock language="typescript" :code="tsCode" copyable title="config.ts" />
|
|
1563
|
-
### 24. TfMetric 指标卡
|
|
1564
|
-
|
|
1565
|
-
展示核心指标数值的卡片组件,支持趋势指示和加载状态。
|
|
1566
|
-
|
|
1567
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1568
|
-
|------|------|--------|------|
|
|
1569
|
-
| `value` | `string \| number` | - | 指标数值 |
|
|
1570
|
-
| `label` | `string` | - | 指标标签 |
|
|
1571
|
-
| `prefix` | `string` | - | 数值前缀 |
|
|
1572
|
-
| `suffix` | `string` | - | 数值后缀 |
|
|
1573
|
-
| `trend` | `'up' \| 'down' \| 'flat'` | - | 趋势方向 |
|
|
1574
|
-
| `trendValue` | `string \| number` | - | 趋势数值 |
|
|
1575
|
-
| `precision` | `number` | - | 小数精度 |
|
|
1576
|
-
| `format` | `string` | - | 格式化模板 |
|
|
1577
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
1578
|
-
|
|
1579
|
-
```vue
|
|
1580
|
-
<TfMetric value="1,286" label="今日产量(m³)" trend="up" trendValue="12.5%" />
|
|
1581
|
-
<TfMetric :value="98.5" label="质量合格率" suffix="%" trend="flat" />
|
|
1582
|
-
```
|
|
1583
|
-
|
|
1584
|
-
### 25. TfTimeline 时间轴
|
|
1585
|
-
|
|
1586
|
-
按时间顺序垂直展示事件信息流。
|
|
1587
|
-
|
|
1588
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1589
|
-
|------|------|--------|------|
|
|
1590
|
-
| `items` | `{time, title, content?, type?, color?}[]` | `[]` | 时间轴项 |
|
|
1591
|
-
| `mode` | `'left' \| 'right' \| 'alternate'` | `'left'` | 内容排列方式 |
|
|
1592
|
-
| `pending` | `boolean \| string` | `false` | 是否有待处理项 |
|
|
1593
|
-
|
|
1594
|
-
| 插槽 | 说明 |
|
|
1595
|
-
|------|------|
|
|
1596
|
-
| `default` | 自定义内容 |
|
|
1597
|
-
| `dot` | 自定义节点 |
|
|
1598
|
-
|
|
1599
|
-
```vue
|
|
1600
|
-
<TfTimeline :items="[{time:'09:00',title:'开始生产',type:'success'},{time:'11:30',title:'取样检测',content:'坍落度 180mm'}]" />
|
|
1601
|
-
<TfTimeline :items="events" mode="alternate" pending="等待 AI 复核..." />
|
|
1602
|
-
```
|
|
1603
|
-
|
|
1604
|
-
### 26. TfEmpty 空状态
|
|
1605
|
-
|
|
1606
|
-
数据为空时的占位展示,支持自定义图片和描述。
|
|
1607
|
-
|
|
1608
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1609
|
-
|------|------|--------|------|
|
|
1610
|
-
| `image` | `string` | - | 自定义图片 URL |
|
|
1611
|
-
| `description` | `string` | `'暂无数据'` | 描述文字 |
|
|
1612
|
-
| `size` | `string` | - | 空状态尺寸 |
|
|
1613
|
-
|
|
1614
|
-
| 插槽 | 说明 |
|
|
1615
|
-
|------|------|
|
|
1616
|
-
| `default` | 自定义操作区 |
|
|
1617
|
-
| `image` | 自定义图片 |
|
|
1618
|
-
| `description` | 自定义描述 |
|
|
1619
|
-
|
|
1620
|
-
```vue
|
|
1621
|
-
<TfEmpty description="暂无配比方案" />
|
|
1622
|
-
<TfEmpty>
|
|
1623
|
-
<TfButton type="primary">新建方案</TfButton>
|
|
1624
|
-
</TfEmpty>
|
|
1625
|
-
```
|
|
1626
|
-
|
|
1627
|
-
### 27. TfImagePreview 图片预览
|
|
1628
|
-
|
|
1629
|
-
图片放大预览组件,支持多图切换、缩放、旋转。
|
|
1630
|
-
|
|
1631
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1632
|
-
|------|------|--------|------|
|
|
1633
|
-
| `src` | `string` | - | 当前预览图片 |
|
|
1634
|
-
| `previewSrcList` | `string[]` | - | 预览图片列表 |
|
|
1635
|
-
| `initialIndex` | `number` | `0` | 初始预览索引 |
|
|
1636
|
-
| `zoom` | `number` | `1` | 缩放比例 |
|
|
1637
|
-
| `infinite` | `boolean` | `true` | 是否循环切换 |
|
|
1638
|
-
| `maskClosable` | `boolean` | `true` | 点击遮罩关闭 |
|
|
1639
|
-
| `closeOnEsc` | `boolean` | `true` | ESC 键关闭 |
|
|
1640
|
-
|
|
1641
|
-
| 事件 | 参数 | 说明 |
|
|
1642
|
-
|------|------|------|
|
|
1643
|
-
| `close` | - | 关闭回调 |
|
|
1644
|
-
| `change` | `(index: number)` | 切换图片 |
|
|
1645
|
-
|
|
1646
|
-
| 插槽 | 说明 |
|
|
1647
|
-
|------|------|
|
|
1648
|
-
| `default` | 触发预览的元素 |
|
|
1649
|
-
| `toolbar` | 自定义工具栏 |
|
|
1650
|
-
|
|
1651
|
-
```vue
|
|
1652
|
-
<TfImagePreview :previewSrcList="images" :initialIndex="0" />
|
|
1653
|
-
<TfImagePreview :src="reportUrl" zoom="1.5" @close="onClose" />
|
|
1654
|
-
```
|
|
1655
|
-
|
|
1656
|
-
---
|
|
1657
|
-
|
|
1658
|
-
## 五、工具组件
|
|
1659
|
-
|
|
1660
|
-
### 28. TfTooltip 文字提示
|
|
1661
|
-
|
|
1662
|
-
鼠标悬停时展示提示信息的浮层。
|
|
1663
|
-
|
|
1664
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1665
|
-
|------|------|--------|------|
|
|
1666
|
-
| `content` | `string` | - | 提示内容 |
|
|
1667
|
-
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right' (+ '-start'/'-end')` | `'top'` | 弹出位置 |
|
|
1668
|
-
| `trigger` | `'hover' \| 'click'` | `'hover'` | 触发方式 |
|
|
1669
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1670
|
-
| `delay` | `number` | - | 延迟显示毫秒 |
|
|
1671
|
-
| `offset` | `number` | - | 偏移距离 |
|
|
1672
|
-
|
|
1673
|
-
| 插槽 | 说明 |
|
|
1674
|
-
|------|------|
|
|
1675
|
-
| `default` | 触发元素 |
|
|
1676
|
-
| `content` | 自定义提示内容 |
|
|
1677
|
-
|
|
1678
|
-
```vue
|
|
1679
|
-
<TfTooltip content="配比自动优化建议">
|
|
1680
|
-
<TfIcon :icon="HelpCircle" />
|
|
1681
|
-
</TfTooltip>
|
|
1682
|
-
```
|
|
1683
|
-
|
|
1684
|
-
### 29. TfDivider 分割线
|
|
1685
|
-
|
|
1686
|
-
内容区域的分割线,支持文字和方向。
|
|
1687
|
-
|
|
1688
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1689
|
-
|------|------|--------|------|
|
|
1690
|
-
| `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` | 分割方向 |
|
|
1691
|
-
| `contentPosition` | `'left' \| 'center' \| 'right'` | `'center'` | 文字位置 |
|
|
1692
|
-
| `dashed` | `boolean` | `false` | 是否虚线 |
|
|
1693
|
-
| `plain` | `boolean` | `false` | 文字是否朴素样式 |
|
|
1694
|
-
|
|
1695
|
-
| 插槽 | 说明 |
|
|
1696
|
-
|------|------|
|
|
1697
|
-
| `default` | 分割线文字 |
|
|
1698
|
-
|
|
1699
|
-
```vue
|
|
1700
|
-
<TfDivider contentPosition="left">基本信息</TfDivider>
|
|
1701
|
-
<TfDivider dashed />
|
|
1702
|
-
```
|
|
1703
|
-
|
|
1704
|
-
### 30. TfBackTop 回到顶部
|
|
1705
|
-
|
|
1706
|
-
长页面中快速返回顶部的浮动按钮。
|
|
1707
|
-
|
|
1708
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1709
|
-
|------|------|--------|------|
|
|
1710
|
-
| `visibilityHeight` | `number` | `200` | 显示阈值(滚动像素) |
|
|
1711
|
-
| `target` | `string \| HTMLElement` | - | 滚动目标容器 |
|
|
1712
|
-
| `right` | `number` | - | 距右边距 |
|
|
1713
|
-
| `bottom` | `number` | - | 距底边距 |
|
|
1714
|
-
|
|
1715
|
-
| 事件 | 参数 | 说明 |
|
|
1716
|
-
|------|------|------|
|
|
1717
|
-
| `click` | - | 点击回调 |
|
|
1718
|
-
|
|
1719
|
-
```vue
|
|
1720
|
-
<TfBackTop :visibilityHeight="300" :right="40" :bottom="40" />
|
|
1721
|
-
```
|
|
1722
|
-
|
|
1723
|
-
---
|
|
1724
|
-
|
|
1725
|
-
## 六、复合组件
|
|
1726
|
-
|
|
1727
|
-
### 31. TfUpload 上传
|
|
1728
|
-
|
|
1729
|
-
文件上传组件,支持拖拽、多选、分组、自动上传。
|
|
1730
|
-
|
|
1731
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1732
|
-
|------|------|--------|------|
|
|
1733
|
-
| `modelValue` | `UploadFile[]` | `[]` | v-model 文件列表 |
|
|
1734
|
-
| `groups` | `UploadGroup[]` | - | 上传分组配置 |
|
|
1735
|
-
| `multiple` | `boolean` | `false` | 是否多选 |
|
|
1736
|
-
| `accept` | `string` | - | 接受文件类型 |
|
|
1737
|
-
| `maxCount` | `number` | - | 最大文件数 |
|
|
1738
|
-
| `maxSize` | `number` | - | 单文件最大大小 |
|
|
1739
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1740
|
-
| `drag` | `boolean` | `false` | 是否拖拽上传 |
|
|
1741
|
-
| `autoUpload` | `boolean` | `true` | 是否自动上传 |
|
|
1742
|
-
| `listType` | `string` | - | 文件列表样式 |
|
|
1743
|
-
| `directory` | `boolean` | `false` | 是否上传目录 |
|
|
1744
|
-
| `headers` | `object` | - | 上传请求头 |
|
|
1745
|
-
| `action` | `string` | - | 上传 URL |
|
|
1746
|
-
| `data` | `object` | - | 附加参数 |
|
|
1747
|
-
| `name` | `string` | `'file'` | 文件字段名 |
|
|
1748
|
-
| `withCredentials` | `boolean` | `false` | 是否携带 cookie |
|
|
1749
|
-
|
|
1750
|
-
| 事件 | 参数 | 说明 |
|
|
1751
|
-
|------|------|------|
|
|
1752
|
-
| `change` | `(files)` | 文件变更 |
|
|
1753
|
-
| `exceed` | `(files)` | 超出数量限制 |
|
|
1754
|
-
| `preview` | `(file)` | 预览文件 |
|
|
1755
|
-
| `remove` | `(file)` | 移除文件 |
|
|
1756
|
-
| `success` | `(response, file)` | 上传成功 |
|
|
1757
|
-
| `error` | `(error, file)` | 上传失败 |
|
|
1758
|
-
|
|
1759
|
-
| 插槽 | 说明 |
|
|
1760
|
-
|------|------|
|
|
1761
|
-
| `default` | 上传触发区域 |
|
|
1762
|
-
| `trigger` | 自定义触发按钮 |
|
|
1763
|
-
| `fileList` | 自定义文件列表 |
|
|
1764
|
-
| `file` | 自定义文件项 |
|
|
1765
|
-
|
|
1766
|
-
```vue
|
|
1767
|
-
<TfUpload v-model="files" :action="uploadUrl" multiple drag :maxCount="10" />
|
|
1768
|
-
<TfUpload :groups="groups" accept=".pdf,.xlsx" @success="onSuccess" />
|
|
1769
|
-
```
|
|
1770
|
-
|
|
1771
|
-
### 32. TfCarousel 走马灯
|
|
1772
|
-
|
|
1773
|
-
轮播展示图片或内容的走马灯组件。
|
|
1774
|
-
|
|
1775
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1776
|
-
|------|------|--------|------|
|
|
1777
|
-
| `slides` | `object[]` | `[]` | 幻灯片数据 |
|
|
1778
|
-
| `autoplay` | `number` | `3000` | 自动播放间隔(ms, 0=停用) |
|
|
1779
|
-
| `loop` | `boolean` | `true` | 是否循环播放 |
|
|
1780
|
-
| `navigation` | `'arrows' \| 'dots' \| boolean` | `true` | 导航控件 |
|
|
1781
|
-
| `effect` | `'slide' \| 'fade'` | `'slide'` | 切换效果 |
|
|
1782
|
-
| `slidesPerView` | `number` | `1` | 每屏显示数量 |
|
|
1783
|
-
| `gap` | `number` | `0` | 幻灯片间距 |
|
|
1784
|
-
|
|
1785
|
-
| 插槽 | 说明 |
|
|
1786
|
-
|------|------|
|
|
1787
|
-
| `default` | 自定义幻灯片内容 |
|
|
1788
|
-
|
|
1789
|
-
```vue
|
|
1790
|
-
<TfCarousel :slides="banners" autoplay navigation="dots" loop />
|
|
1791
|
-
<TfCarousel :slides="images" effect="fade" :autoplay="0" />
|
|
1792
|
-
```
|
|
1793
|
-
|
|
1794
|
-
### 33. TfSlider 滑动输入条
|
|
1795
|
-
|
|
1796
|
-
通过滑动选择数值范围的输入组件。
|
|
1797
|
-
|
|
1798
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1799
|
-
|------|------|--------|------|
|
|
1800
|
-
| `modelValue` | `number \| [number, number]` | `0` | v-model 值 |
|
|
1801
|
-
| `min` | `number` | `0` | 最小值 |
|
|
1802
|
-
| `max` | `number` | `100` | 最大值 |
|
|
1803
|
-
| `step` | `number` | `1` | 步长 |
|
|
1804
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
1805
|
-
| `tooltip` | `boolean` | `true` | 是否显示提示 |
|
|
1806
|
-
| `range` | `boolean` | `false` | 范围选择模式 |
|
|
1807
|
-
| `vertical` | `boolean` | `false` | 垂直模式 |
|
|
1808
|
-
| `marks` | `{key: label} \| number[]` | - | 刻度标记 |
|
|
1809
|
-
| `dots` | `boolean` | `false` | 是否显示刻度点 |
|
|
1810
|
-
|
|
1811
|
-
| 事件 | 参数 | 说明 |
|
|
1812
|
-
|------|------|------|
|
|
1813
|
-
| `update:modelValue` | `number` | 值变更 |
|
|
1814
|
-
| `change` | `number` | 变更完成 |
|
|
1815
|
-
|
|
1816
|
-
```vue
|
|
1817
|
-
<TfSlider v-model="strength" :min="20" :max="60" :marks="{20:'C20',40:'C40',60:'C60'}" />
|
|
1818
|
-
<TfSlider v-model="range" range :min="0" :max="100" />
|
|
1819
|
-
```
|
|
1820
|
-
|
|
1821
|
-
---
|
|
1822
|
-
|
|
1823
|
-
## 七、覆盖/辅助组件
|
|
1824
|
-
|
|
1825
|
-
### 34. TfWatermark 水印
|
|
1826
|
-
|
|
1827
|
-
给页面或区域添加文字或图片水印。
|
|
1828
|
-
|
|
1829
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1830
|
-
|------|------|--------|------|
|
|
1831
|
-
| `content` | `string` | - | 水印文字或图片 URL |
|
|
1832
|
-
| `width` | `number` | - | 水印宽度 |
|
|
1833
|
-
| `height` | `number` | - | 水印高度 |
|
|
1834
|
-
| `rotate` | `number` | `-22` | 旋转角度 |
|
|
1835
|
-
| `opacity` | `number` | `0.15` | 透明度 |
|
|
1836
|
-
| `gap` | `[number, number]` | `[100, 100]` | 水印间距 |
|
|
1837
|
-
| `offset` | `[number, number]` | - | 偏移量 |
|
|
1838
|
-
| `font` | `{color, fontSize, fontFamily}` | - | 字体配置 |
|
|
1839
|
-
| `fullscreen` | `boolean` | `false` | 是否全屏水印 |
|
|
1840
|
-
| `zIndex` | `number` | - | 层级 |
|
|
1841
|
-
|
|
1842
|
-
```vue
|
|
1843
|
-
<TfWatermark content="砼方集团" :rotate="-30" font="{color:'#085699'}">
|
|
1844
|
-
<ReportContent />
|
|
1845
|
-
</TfWatermark>
|
|
1846
|
-
```
|
|
1847
|
-
|
|
1848
|
-
### 35. TfAffix 固钉
|
|
1849
|
-
|
|
1850
|
-
将元素固定在视窗特定位置,滚动时保持可见。
|
|
1851
|
-
|
|
1852
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1853
|
-
|------|------|--------|------|
|
|
1854
|
-
| `offsetTop` | `number` | - | 距顶部偏移触发固定 |
|
|
1855
|
-
| `offsetBottom` | `number` | - | 距底部偏移触发固定 |
|
|
1856
|
-
| `target` | `string \| HTMLElement` | - | 滚动目标容器 |
|
|
1857
|
-
| `zIndex` | `number` | - | 层级 |
|
|
1858
|
-
|
|
1859
|
-
| 事件 | 参数 | 说明 |
|
|
1860
|
-
|------|------|------|
|
|
1861
|
-
| `change` | `(fixed: boolean)` | 固定状态变更 |
|
|
1862
|
-
|
|
1863
|
-
| 插槽 | 说明 |
|
|
1864
|
-
|------|------|
|
|
1865
|
-
| `default` | 需要固定的元素 |
|
|
1866
|
-
|
|
1867
|
-
```vue
|
|
1868
|
-
<TfAffix :offsetTop="64">
|
|
1869
|
-
<TfTabs v-model="tab">...</TfTabs>
|
|
1870
|
-
</TfAffix>
|
|
1871
|
-
```
|
|
1872
|
-
|
|
1873
|
-
### 36. TfAvatar 头像
|
|
1874
|
-
|
|
1875
|
-
用户头像展示组件,支持图片、图标和文字回退。
|
|
1876
|
-
|
|
1877
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1878
|
-
|------|------|--------|------|
|
|
1879
|
-
| `src` | `string` | - | 头像图片 URL |
|
|
1880
|
-
| `alt` | `string` | - | 图片 alt 文本 |
|
|
1881
|
-
| `size` | `'sm' \| 'md' \| 'lg' \| number` | `'md'` | 头像尺寸 |
|
|
1882
|
-
| `shape` | `'circle' \| 'square'` | `'circle'` | 头像形状 |
|
|
1883
|
-
| `icon` | `Component` | - | 图标组件回退 |
|
|
1884
|
-
| `bg` | `string` | - | 背景色 |
|
|
1885
|
-
| `color` | `string` | - | 文字颜色 |
|
|
1886
|
-
| `fallback` | `string` | - | 图片加载失败回退文字 |
|
|
1887
|
-
|
|
1888
|
-
| 插槽 | 说明 |
|
|
1889
|
-
|------|------|
|
|
1890
|
-
| `default` | 自定义文字回退 |
|
|
1891
|
-
|
|
1892
|
-
```vue
|
|
1893
|
-
<TfAvatar src="/avatars/user.png" size="lg" />
|
|
1894
|
-
<TfAvatar fallback="AI" bg="#34BFA3" color="#fff" />
|
|
1895
|
-
<TfAvatar shape="square" :icon="Building" bg="#085699" />
|
|
1896
|
-
```
|
|
1897
|
-
|
|
1898
|
-
### 37. TfSteps 步骤条
|
|
1899
|
-
|
|
1900
|
-
引导用户按流程完成任务的步骤导航组件。
|
|
1901
|
-
|
|
1902
|
-
| 属性 | 类型 | 默认值 | 说明 |
|
|
1903
|
-
|------|------|--------|------|
|
|
1904
|
-
| `modelValue` | `number` | `0` | v-model 当前步骤索引 |
|
|
1905
|
-
| `items` | `{title, description?, icon?}[]` | `[]` | 步骤项数据 |
|
|
1906
|
-
| `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` | 步骤条方向 |
|
|
1907
|
-
| `size` | `'sm' \| 'md'` | `'md'` | 步骤条尺寸 |
|
|
1908
|
-
| `clickable` | `boolean` | `false` | 是否可点击切换 |
|
|
1909
|
-
|
|
1910
|
-
| 事件 | 参数 | 说明 |
|
|
1911
|
-
|------|------|------|
|
|
1912
|
-
| `update:modelValue` | `number` | 步骤变更 |
|
|
1913
|
-
| `click` | `(index: number)` | 点击步骤 |
|
|
1914
|
-
|
|
1915
|
-
| 插槽 | 说明 |
|
|
1916
|
-
|------|------|
|
|
1917
|
-
| `default` | 步骤内容区 |
|
|
1918
|
-
| `title` | 自定义标题 |
|
|
1919
|
-
| `description` | 自定义描述 |
|
|
1920
|
-
|
|
1921
|
-
```vue
|
|
1922
|
-
<TfSteps v-model="step" :items="[
|
|
1923
|
-
{title:'配比设计', description:'AI 生成初始方案'},
|
|
1924
|
-
{title:'人工复核', description:'确认调整参数'},
|
|
1925
|
-
{title:'下发执行', description:'推送至生产系统'}
|
|
1926
|
-
]" />
|
|
1927
|
-
```
|
|
1928
|
-
|
|
1929
|
-
---
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
---
|
|
1937
|
-
|
|
1938
|
-
# 表单系统组件分析
|
|
1939
|
-
|
|
1940
|
-
> 组件库:enterprise-ui-kit | 框架:Vue 3 + TypeScript | 场景:低代码平台
|
|
1941
|
-
|
|
1942
|
-
## 目录
|
|
1943
|
-
|
|
1944
|
-
1. [表单核心 (Form Core)](#一表单核心-form-core)
|
|
1945
|
-
- 1.1 TfForm — 表单容器
|
|
1946
|
-
- 1.2 TfFormItem — 表单项包装器
|
|
1947
|
-
- 1.3 TfFormField — 快速字段组件
|
|
1948
|
-
2. [基础控件 (Base Controls)](#二基础控件-base-controls--17-个) — 17 个
|
|
1949
|
-
- 2.1 输入类:input / textarea / select / cascader
|
|
1950
|
-
- 2.2 选择类:checkbox / radio / switch
|
|
1951
|
-
- 2.3 日期时间:date-picker / time-picker / datetime-picker / data-picker
|
|
1952
|
-
- 2.4 滑块与上传:slider / upload
|
|
1953
|
-
- 2.5 文件图片签名:file-upload / image-upload / signature
|
|
1954
|
-
- 2.6 地理位置:region-picker / location-picker
|
|
1955
|
-
3. [复合组件 (Form Items)](#三复合组件-form-items--23-个) — 23 个
|
|
1956
|
-
- 3.1 A 级(完整 AI):form-input / form-textarea / form-select / form-cascader / form-date-picker
|
|
1957
|
-
- 3.2 B 级(完整 AI):form-datetime-picker / form-data-picker / form-time-picker / form-region-picker
|
|
1958
|
-
- 3.3 C 级(仅 aiBadge):form-checkbox / form-radio / form-switch / form-slider / form-upload / form-image-upload / form-file-upload / form-signature / form-location-picker
|
|
1959
|
-
- 3.4 通用 Props 速查
|
|
1960
|
-
4. [表单容器 (Form Containers)](#四表单容器-form-containers--5-个) — 5 个
|
|
1961
|
-
- 4.1 TfFormGroup / 4.2 TfFormArray / 4.3 TfSubForm / 4.4 TfDynamicForm / 4.5 TfFormTable
|
|
1962
|
-
5. [AI 增强体系](#五ai-增强体系)
|
|
1963
|
-
- 5.1 五层架构 / 5.2 状态机 / 5.3-5.5 分层说明 / 5.6 范式演进
|
|
1964
|
-
6. [AI 组件](#六ai-组件) — 3 个
|
|
1965
|
-
- 6.1 TfFormAiStatus / 6.2 TfFormAiToolbar / 6.3 TfAiOverlay
|
|
1966
|
-
7. [附录:组件索引](#附录组件索引)
|
|
1967
|
-
|
|
1968
|
-
## 一、表单核心 (Form Core)
|
|
1969
|
-
|
|
1970
|
-
表单核心由三个组件构成:`TfForm`(表单容器)、`TfFormItem`(表单项包装器)、`TfFormField`(快速字段组件)。三者形成完整的表单数据收集、校验与布局体系。
|
|
1971
|
-
|
|
1972
|
-
### 1.1 TfForm — 表单容器
|
|
1973
|
-
|
|
1974
|
-
接收 `model` 数据对象与 `rules` 校验规则,统一管理所有子级 `TfFormItem` 的布局、尺寸、禁用状态等。
|
|
1975
|
-
|
|
1976
|
-
**Props**
|
|
1977
|
-
|
|
1978
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
1979
|
-
|------|------|--------|------|
|
|
1980
|
-
| `model` | `Record<string, any>` | — | 表单数据对象(**必填**) |
|
|
1981
|
-
| `layout` | `'horizontal' \| 'vertical' \| 'inline'` | `'horizontal'` | 表单布局方向 |
|
|
1982
|
-
| `labelWidth` | `string` | — | 标签宽度,如 `'120px'` |
|
|
1983
|
-
| `labelAlign` | `'left' \| 'right'` | `'right'` | 标签对齐方式 |
|
|
1984
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 全局尺寸 |
|
|
1985
|
-
| `disabled` | `boolean` | `false` | 全局禁用 |
|
|
1986
|
-
| `colon` | `boolean` | `false` | 标签后是否显示冒号 |
|
|
1987
|
-
| `rules` | `Record<string, Rule[]>` | — | 校验规则对象,key 对应 model 的字段名 |
|
|
1988
|
-
|
|
1989
|
-
**Events**
|
|
1990
|
-
|
|
1991
|
-
| 事件名 | 参数 | 说明 |
|
|
1992
|
-
|--------|------|------|
|
|
1993
|
-
| `submit` | `(values: Record<string, any>)` | 表单校验通过后触发 |
|
|
1994
|
-
| `validate` | `(errors: Record<string, any>)` | 表单校验完成时触发 |
|
|
1995
|
-
| `reset` | — | 表单重置时触发 |
|
|
1996
|
-
|
|
1997
|
-
**使用示例**
|
|
1998
|
-
|
|
1999
|
-
```vue
|
|
2000
|
-
<template>
|
|
2001
|
-
<TfForm
|
|
2002
|
-
:model="formData"
|
|
2003
|
-
:rules="rules"
|
|
2004
|
-
layout="vertical"
|
|
2005
|
-
label-width="100px"
|
|
2006
|
-
@submit="handleSubmit"
|
|
2007
|
-
>
|
|
2008
|
-
<TfFormItem prop="name" label="姓名" required />
|
|
2009
|
-
<TfFormItem prop="email" label="邮箱" required />
|
|
2010
|
-
</TfForm>
|
|
2011
|
-
</template>
|
|
2012
|
-
```
|
|
2013
|
-
|
|
2014
|
-
### 1.2 TfFormItem — 表单项包装器
|
|
2015
|
-
|
|
2016
|
-
包装任意表单控件,提供标签、校验、提示、AI 增强等能力。根据是否支持 AI 分为两套属性接口:
|
|
2017
|
-
|
|
2018
|
-
- **FormItemBaseProps**:基础属性,所有 form-item 通用
|
|
2019
|
-
- **FormItemAiCapableProps**:继承基础属性,增加 AI 相关属性
|
|
2020
|
-
|
|
2021
|
-
**基础 Props(FormItemBaseProps)**
|
|
2022
|
-
|
|
2023
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2024
|
-
|------|------|--------|------|
|
|
2025
|
-
| `prop` | `string` | — | 对应 `model` 中的字段名 |
|
|
2026
|
-
| `label` | `string` | — | 标签文本 |
|
|
2027
|
-
| `labelWidth` | `string` | — | 标签宽度(覆盖 TfForm 的全局设置) |
|
|
2028
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | — | 尺寸(覆盖全局) |
|
|
2029
|
-
| `required` | `boolean` | `false` | 是否必填(红色星号) |
|
|
2030
|
-
| `error` | `string` | — | 错误提示信息 |
|
|
2031
|
-
| `tip` | `string` | — | 辅助提示文字 |
|
|
2032
|
-
| `aiBadge` | `boolean` | `false` | 是否显示 AI 能力徽章 |
|
|
2033
|
-
| `span` | `number \| 'full' \| {base?,sm?,md?,lg?,xl?}` | — | 栅格跨度(响应式) |
|
|
2034
|
-
| `layout` | `'vertical' \| 'horizontal'` | — | 单项布局方向 |
|
|
2035
|
-
|
|
2036
|
-
**AI 扩展 Props(FormItemAiCapableProps extends FormItemBaseProps)**
|
|
2037
|
-
|
|
2038
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2039
|
-
|------|------|--------|------|
|
|
2040
|
-
| `ai` | `boolean` | `false` | 是否启用 AI 能力 |
|
|
2041
|
-
| `aiPrompt` | `string` | — | 自定义 AI Prompt |
|
|
2042
|
-
| `aiResolver` | `(input: string) => Promise<any>` | — | 自定义 AI 解析器 |
|
|
2043
|
-
| `aiPlacement` | `string` | — | AI 浮层弹出位置 |
|
|
2044
|
-
| `aiOverlayWidth` | `number \| string` | — | AI 浮层宽度 |
|
|
2045
|
-
| `aiNeedConfirm` | `boolean` | — | AI 结果是否需要用户确认 |
|
|
2046
|
-
| `aiMockDuration` | `number` | — | 模拟 AI 响应时长(ms) |
|
|
2047
|
-
| `aiActions` | `AiAction[]` | — | AI 操作按钮列表 |
|
|
2048
|
-
| `aiField` | `string` | — | AI 关联字段名 |
|
|
2049
|
-
| `aiStatus` | `AiStatus` | — | AI 状态 |
|
|
2050
|
-
|
|
2051
|
-
**AI 能力分级**
|
|
2052
|
-
|
|
2053
|
-
组件按 AI 集成深度分为三级:
|
|
2054
|
-
|
|
2055
|
-
| 分级 | 数量 | 包含组件 | AI 能力 |
|
|
2056
|
-
|------|------|---------|---------|
|
|
2057
|
-
| **A 级** | 5 | form-input, form-textarea, form-select, form-cascader, form-date-picker | 完整 AI Overlay(7+ props) |
|
|
2058
|
-
| **B 级** | 4 | form-datetime-picker, form-data-picker, form-time-picker, form-region-picker | 完整 AI Overlay |
|
|
2059
|
-
| **C 级** | 9 | form-checkbox, form-radio, form-switch, form-slider, form-upload, form-image-upload, form-file-upload, form-signature, form-location-picker | 仅 aiBadge |
|
|
2060
|
-
|
|
2061
|
-
### 1.3 TfFormField — 快速字段组件
|
|
2062
|
-
|
|
2063
|
-
通过 `type` 属性快速切换 12 种内置控件类型,适用于动态表单场景,无需手动引入各个控件。
|
|
2064
|
-
|
|
2065
|
-
**支持的 type 值**:`input` / `textarea` / `password` / `search` / `number` / `select` / `checkbox` / `radio` / `switch` / `date-picker` / `cascader` / `slider`
|
|
2066
|
-
|
|
2067
|
-
**Props**
|
|
2068
|
-
|
|
2069
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2070
|
-
|------|------|--------|------|
|
|
2071
|
-
| `type` | `FormFieldType` | — | 字段控件类型(**必填**) |
|
|
2072
|
-
| `modelValue` | `any` | — | 绑定值 |
|
|
2073
|
-
| `label` | `string` | — | 标签文本 |
|
|
2074
|
-
| `required` | `boolean` | `false` | 是否必填 |
|
|
2075
|
-
| `disabled` | `boolean` | `false` | 是否禁用 |
|
|
2076
|
-
| `hidden` | `boolean` | `false` | 是否隐藏 |
|
|
2077
|
-
| `rules` | `Rule[]` | — | 校验规则 |
|
|
2078
|
-
| `showMessage` | `boolean` | `true` | 是否显示校验信息 |
|
|
2079
|
-
| `labelPosition` | `'top' \| 'left'` | `'left'` | 标签位置 |
|
|
2080
|
-
| `columnSpan` | `1 \| 2 \| 3` | `1` | 列跨度 |
|
|
2081
|
-
| `ai` | `boolean` | `false` | 是否启用 AI |
|
|
2082
|
-
| `aiPrompt` | `string` | — | AI Prompt |
|
|
2083
|
-
| `hint` | `string` | — | 提示信息 |
|
|
2084
|
-
| `options` | `SelectOption[]` | — | select/checkbox/radio 的选项 |
|
|
2085
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2086
|
-
|
|
2087
|
-
**Events**
|
|
2088
|
-
|
|
2089
|
-
| 事件名 | 参数 | 说明 |
|
|
2090
|
-
|--------|------|------|
|
|
2091
|
-
| `update:modelValue` | `(value: any)` | 值更新 |
|
|
2092
|
-
| `change` | `(value: any)` | 值变更 |
|
|
2093
|
-
| `blur` | `(event: FocusEvent)` | 失焦 |
|
|
2094
|
-
| `focus` | `(event: FocusEvent)` | 聚焦 |
|
|
2095
|
-
|
|
2096
|
-
**Slots**
|
|
2097
|
-
|
|
2098
|
-
| 插槽名 | 作用域 | 说明 |
|
|
2099
|
-
|--------|--------|------|
|
|
2100
|
-
| `label` | — | 自定义标签内容 |
|
|
2101
|
-
| `aiPanel` | — | 自定义 AI 面板 |
|
|
2102
|
-
| `error` | — | 自定义错误提示 |
|
|
2103
|
-
|
|
2104
|
-
**使用示例**
|
|
2105
|
-
|
|
2106
|
-
```vue
|
|
2107
|
-
<TfFormField
|
|
2108
|
-
type="input"
|
|
2109
|
-
v-model="username"
|
|
2110
|
-
label="用户名"
|
|
2111
|
-
required
|
|
2112
|
-
hint="请输入 3-20 位字符"
|
|
2113
|
-
/>
|
|
2114
|
-
|
|
2115
|
-
<TfFormField
|
|
2116
|
-
type="select"
|
|
2117
|
-
v-model="city"
|
|
2118
|
-
label="城市"
|
|
2119
|
-
:options="cityOptions"
|
|
2120
|
-
/>
|
|
2121
|
-
```
|
|
2122
|
-
|
|
2123
|
-
## 二、基础控件 (Base Controls) — 17 个
|
|
2124
|
-
|
|
2125
|
-
基础控件是表单字段的原子组件,每个控件独立可用,也可被 `TfFormItem` 或复合组件包装。所有控件均支持 `v-model` 双向绑定。
|
|
2126
|
-
|
|
2127
|
-
### 2.1 输入类控件
|
|
2128
|
-
|
|
2129
|
-
#### input — 文本输入框
|
|
2130
|
-
|
|
2131
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2132
|
-
|------|------|--------|------|
|
|
2133
|
-
| `modelValue` | `string \| number` | — | 绑定值 |
|
|
2134
|
-
| `type` | `'text' \| 'password' \| ...` | `'text'` | 原生 input type |
|
|
2135
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2136
|
-
| `status` | `'error' \| 'warning' \| 'success'` | — | 状态 |
|
|
2137
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2138
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2139
|
-
| `readonly` | `boolean` | `false` | 只读 |
|
|
2140
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2141
|
-
| `maxlength` | `number` | — | 最大字符数 |
|
|
2142
|
-
| `showWordLimit` | `boolean` | `false` | 显示字数统计 |
|
|
2143
|
-
| `ai` | `boolean` | `false` | 启用 AI |
|
|
2144
|
-
| `aiStatus` | `AiStatus` | — | AI 状态 |
|
|
2145
|
-
|
|
2146
|
-
**Events**:`update:modelValue` / `input` / `change` / `focus` / `blur` / `clear`
|
|
2147
|
-
|
|
2148
|
-
**Slots**:`prefix` / `suffix`
|
|
2149
|
-
|
|
2150
|
-
```vue
|
|
2151
|
-
<TfInput v-model="name" placeholder="请输入姓名" clearable maxlength="20" show-word-limit />
|
|
2152
|
-
```
|
|
2153
|
-
|
|
2154
|
-
#### textarea — 多行文本
|
|
2155
|
-
|
|
2156
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2157
|
-
|------|------|--------|------|
|
|
2158
|
-
| `modelValue` | `string` | — | 绑定值 |
|
|
2159
|
-
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | 尺寸 |
|
|
2160
|
-
| `status` | `'error' \| 'warning' \| 'success'` | — | 状态 |
|
|
2161
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2162
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2163
|
-
| `readonly` | `boolean` | `false` | 只读 |
|
|
2164
|
-
| `maxlength` | `number` | — | 最大字符数 |
|
|
2165
|
-
| `showWordLimit` | `boolean` | `false` | 字数统计 |
|
|
2166
|
-
| `rows` | `number` | `4` | 行数 |
|
|
2167
|
-
| `resize` | `'none' \| 'vertical' \| 'horizontal' \| 'both'` | `'none'` | 缩放方向 |
|
|
2168
|
-
|
|
2169
|
-
```vue
|
|
2170
|
-
<TfTextarea v-model="desc" placeholder="请输入描述" :rows="6" resize="vertical" />
|
|
2171
|
-
```
|
|
2172
|
-
|
|
2173
|
-
#### select — 下拉选择
|
|
2174
|
-
|
|
2175
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2176
|
-
|------|------|--------|------|
|
|
2177
|
-
| `modelValue` | `any \| any[]` | — | 绑定值 |
|
|
2178
|
-
| `options` | `SelectOption[]` | `[]` | 选项列表 |
|
|
2179
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2180
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2181
|
-
| `variant` | `'default' \| 'outline' \| 'filled'` | `'default'` | 风格变体 |
|
|
2182
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2183
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2184
|
-
| `filterable` | `boolean` | `false` | 可搜索 |
|
|
2185
|
-
| `multiple` | `boolean` | `false` | 多选 |
|
|
2186
|
-
| `loading` | `boolean` | `false` | 加载状态 |
|
|
2187
|
-
|
|
2188
|
-
**Slots**:`option` / `empty` / `prefix`
|
|
2189
|
-
|
|
2190
|
-
```vue
|
|
2191
|
-
<TfSelect v-model="city" :options="cities" filterable clearable placeholder="请选择城市" />
|
|
2192
|
-
```
|
|
2193
|
-
|
|
2194
|
-
#### cascader — 级联选择
|
|
2195
|
-
|
|
2196
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2197
|
-
|------|------|--------|------|
|
|
2198
|
-
| `modelValue` | `any[]` | — | 绑定值(路径数组) |
|
|
2199
|
-
| `options` | `CascaderOption[]` | `[]` | 级联选项 |
|
|
2200
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2201
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2202
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2203
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2204
|
-
| `filterable` | `boolean` | `false` | 可搜索 |
|
|
2205
|
-
| `separator` | `string` | `'/'` | 路径分隔符 |
|
|
2206
|
-
|
|
2207
|
-
```vue
|
|
2208
|
-
<TfCascader v-model="region" :options="regionTree" placeholder="请选择地区" separator=" / " />
|
|
2209
|
-
```
|
|
2210
|
-
|
|
2211
|
-
### 2.2 选择类控件
|
|
2212
|
-
|
|
2213
|
-
#### checkbox — 复选框
|
|
2214
|
-
|
|
2215
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2216
|
-
|------|------|--------|------|
|
|
2217
|
-
| `modelValue` | `boolean \| any[]` | — | 绑定值 |
|
|
2218
|
-
| `checked` | `boolean` | `false` | 选中状态(单个) |
|
|
2219
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2220
|
-
| `indeterminate` | `boolean` | `false` | 半选状态 |
|
|
2221
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2222
|
-
|
|
2223
|
-
**Events**:`update:modelValue` / `change`
|
|
2224
|
-
|
|
2225
|
-
```vue
|
|
2226
|
-
<TfCheckbox v-model="agreed" size="md">同意用户协议</TfCheckbox>
|
|
2227
|
-
```
|
|
2228
|
-
|
|
2229
|
-
#### radio — 单选框
|
|
2230
|
-
|
|
2231
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2232
|
-
|------|------|--------|------|
|
|
2233
|
-
| `modelValue` | `any` | — | 绑定值 |
|
|
2234
|
-
| `checked` | `boolean` | `false` | 选中状态 |
|
|
2235
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2236
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2237
|
-
|
|
2238
|
-
**Events**:`update:modelValue` / `change`
|
|
2239
|
-
|
|
2240
|
-
```vue
|
|
2241
|
-
<TfRadio v-model="gender" value="male" size="md">男</TfRadio>
|
|
2242
|
-
<TfRadio v-model="gender" value="female" size="md">女</TfRadio>
|
|
2243
|
-
```
|
|
2244
|
-
|
|
2245
|
-
#### switch — 开关
|
|
2246
|
-
|
|
2247
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2248
|
-
|------|------|--------|------|
|
|
2249
|
-
| `modelValue` | `boolean` | — | 绑定值 |
|
|
2250
|
-
| `checked` | `boolean` | `false` | 开关状态 |
|
|
2251
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2252
|
-
| `loading` | `boolean` | `false` | 加载中 |
|
|
2253
|
-
|
|
2254
|
-
**Events**:`update:modelValue` / `change`
|
|
2255
|
-
|
|
2256
|
-
```vue
|
|
2257
|
-
<TfSwitch v-model="enabled" loading />
|
|
2258
|
-
```
|
|
2259
|
-
|
|
2260
|
-
### 2.3 日期时间类控件
|
|
2261
|
-
|
|
2262
|
-
#### date-picker — 日期选择器
|
|
2263
|
-
|
|
2264
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2265
|
-
|------|------|--------|------|
|
|
2266
|
-
| `modelValue` | `string \| Date` | — | 绑定值 |
|
|
2267
|
-
| `format` | `string` | `'YYYY-MM-DD'` | 日期格式 |
|
|
2268
|
-
| `type` | `'date' \| 'month' \| 'year'` | `'date'` | 选择类型 |
|
|
2269
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2270
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2271
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2272
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2273
|
-
|
|
2274
|
-
```vue
|
|
2275
|
-
<TfDatePicker v-model="birthday" format="YYYY-MM-DD" placeholder="选择日期" />
|
|
2276
|
-
```
|
|
2277
|
-
|
|
2278
|
-
#### time-picker — 时间选择器
|
|
2279
|
-
|
|
2280
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2281
|
-
|------|------|--------|------|
|
|
2282
|
-
| `modelValue` | `string` | — | 绑定值 |
|
|
2283
|
-
| `format` | `'HH:mm:ss' \| 'HH:mm'` | `'HH:mm:ss'` | 时间格式 |
|
|
2284
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2285
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2286
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2287
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2288
|
-
|
|
2289
|
-
```vue
|
|
2290
|
-
<TfTimePicker v-model="startTime" format="HH:mm" placeholder="选择时间" />
|
|
2291
|
-
```
|
|
2292
|
-
|
|
2293
|
-
#### datetime-picker — 日期时间选择器
|
|
2294
|
-
|
|
2295
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2296
|
-
|------|------|--------|------|
|
|
2297
|
-
| `modelValue` | `string` | — | 绑定值 |
|
|
2298
|
-
| `format` | `string` | `'YYYY-MM-DD HH:mm:ss'` | 日期时间格式 |
|
|
2299
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2300
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2301
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2302
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2303
|
-
|
|
2304
|
-
```vue
|
|
2305
|
-
<TfDatetimePicker v-model="appointment" placeholder="选择日期时间" />
|
|
2306
|
-
```
|
|
2307
|
-
|
|
2308
|
-
#### data-picker — 数据级联选择器
|
|
2309
|
-
|
|
2310
|
-
适用于动态数据源的多列选择(如省市区、组织架构)。
|
|
2311
|
-
|
|
2312
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2313
|
-
|------|------|--------|------|
|
|
2314
|
-
| `modelValue` | `any[]` | — | 绑定值 |
|
|
2315
|
-
| `columns` | `DataPickerColumn[]` | — | 列定义 |
|
|
2316
|
-
| `dataSource` | `Record[]` | — | 数据源 |
|
|
2317
|
-
| `valueKey` | `string` | `'id'` | 值字段 |
|
|
2318
|
-
| `labelKey` | `string` | `'name'` | 标签字段 |
|
|
2319
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2320
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2321
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2322
|
-
|
|
2323
|
-
```vue
|
|
2324
|
-
<TfDataPicker v-model="orgPath" :columns="orgColumns" :data-source="orgData" />
|
|
2325
|
-
```
|
|
2326
|
-
|
|
2327
|
-
### 2.4 滑块与上传
|
|
2328
|
-
|
|
2329
|
-
#### slider — 滑块
|
|
2330
|
-
|
|
2331
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2332
|
-
|------|------|--------|------|
|
|
2333
|
-
| `modelValue` | `number \| [number, number]` | — | 绑定值 |
|
|
2334
|
-
| `min` | `number` | `0` | 最小值 |
|
|
2335
|
-
| `max` | `number` | `100` | 最大值 |
|
|
2336
|
-
| `step` | `number` | `1` | 步长 |
|
|
2337
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2338
|
-
| `tooltip` | `boolean` | `true` | 显示提示 |
|
|
2339
|
-
| `range` | `boolean` | `false` | 范围选择 |
|
|
2340
|
-
| `vertical` | `boolean` | `false` | 垂直方向 |
|
|
2341
|
-
| `marks` | `Record<number, string>` | — | 刻度标记 |
|
|
2342
|
-
|
|
2343
|
-
```vue
|
|
2344
|
-
<TfSlider v-model="volume" :min="0" :max="100" :step="10" :marks="{0:'静音',50:'适中',100:'最大'}" />
|
|
2345
|
-
```
|
|
2346
|
-
|
|
2347
|
-
#### upload — 文件上传
|
|
2348
|
-
|
|
2349
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2350
|
-
|------|------|--------|------|
|
|
2351
|
-
| `modelValue` | `UploadFileItem[]` | — | 已上传文件列表 |
|
|
2352
|
-
| `groups` | `UploadGroup[]` | — | 分组配置 |
|
|
2353
|
-
| `multiple` | `boolean` | `false` | 多选 |
|
|
2354
|
-
| `accept` | `string` | — | 接受的文件类型 |
|
|
2355
|
-
| `maxCount` | `number` | — | 最大文件数 |
|
|
2356
|
-
| `maxSize` | `number` | — | 单文件最大体积 |
|
|
2357
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2358
|
-
| `drag` | `boolean` | `false` | 拖拽上传 |
|
|
2359
|
-
| `autoUpload` | `boolean` | `true` | 自动上传 |
|
|
2360
|
-
| `listType` | `'text' \| 'picture' \| 'picture-card'` | `'text'` | 文件列表样式 |
|
|
2361
|
-
|
|
2362
|
-
```vue
|
|
2363
|
-
<TfUpload v-model="files" drag multiple :max-count="5" :max-size="10*1024*1024" accept=".pdf,.doc" />
|
|
2364
|
-
```
|
|
2365
|
-
|
|
2366
|
-
### 2.5 文件、图片与签名
|
|
2367
|
-
|
|
2368
|
-
#### file-upload — 文件上传(简化版)
|
|
2369
|
-
|
|
2370
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2371
|
-
|------|------|--------|------|
|
|
2372
|
-
| `modelValue` | `File[]` | — | 绑定文件列表 |
|
|
2373
|
-
| `accept` | `string` | — | 接受的文件类型 |
|
|
2374
|
-
| `multiple` | `boolean` | `false` | 多选 |
|
|
2375
|
-
| `maxCount` | `number` | — | 最大文件数 |
|
|
2376
|
-
| `maxSize` | `number` | — | 单文件最大体积 |
|
|
2377
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2378
|
-
| `drag` | `boolean` | `false` | 拖拽上传 |
|
|
2379
|
-
|
|
2380
|
-
**Events**:`update:modelValue` / `change` / `exceed` / `remove`
|
|
2381
|
-
|
|
2382
|
-
```vue
|
|
2383
|
-
<TfFileUpload v-model="docs" accept=".pdf,.docx" :max-count="3" drag />
|
|
2384
|
-
```
|
|
2385
|
-
|
|
2386
|
-
#### image-upload — 图片上传
|
|
2387
|
-
|
|
2388
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2389
|
-
|------|------|--------|------|
|
|
2390
|
-
| `modelValue` | `ImageUploadModelValue` | — | 绑定值 |
|
|
2391
|
-
| `aspectRatio` | `number` | — | 裁剪宽高比 |
|
|
2392
|
-
| `maxSize` | `number` | — | 最大体积 |
|
|
2393
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2394
|
-
| `accept` | `string` | `'image/*'` | 图片类型 |
|
|
2395
|
-
|
|
2396
|
-
**Events**:`update:modelValue`
|
|
2397
|
-
|
|
2398
|
-
```vue
|
|
2399
|
-
<TfImageUpload v-model="avatar" :aspect-ratio="1" :max-size="2*1024*1024" />
|
|
2400
|
-
```
|
|
2401
|
-
|
|
2402
|
-
#### signature — 签名板
|
|
2403
|
-
|
|
2404
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2405
|
-
|------|------|--------|------|
|
|
2406
|
-
| `modelValue` | `SignatureModelValue` | — | 绑定值(base64 图片数据) |
|
|
2407
|
-
| `thumbnailWidth` | `number` | — | 缩略图宽度 |
|
|
2408
|
-
| `thumbnailHeight` | `number` | — | 缩略图高度 |
|
|
2409
|
-
| `canvasWidth` | `number` | `720` | 画布宽度 |
|
|
2410
|
-
| `canvasHeight` | `number` | `320` | 画布高度 |
|
|
2411
|
-
| `penColor` | `string` | `'#000'` | 笔触颜色 |
|
|
2412
|
-
| `lineWidth` | `number` | `2` | 笔触宽度 |
|
|
2413
|
-
|
|
2414
|
-
```vue
|
|
2415
|
-
<TfSignature v-model="sign" :canvas-width="800" :canvas-height="400" pen-color="#333" />
|
|
2416
|
-
```
|
|
2417
|
-
|
|
2418
|
-
### 2.6 地理位置控件
|
|
2419
|
-
|
|
2420
|
-
#### region-picker — 地区选择器
|
|
2421
|
-
|
|
2422
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2423
|
-
|------|------|--------|------|
|
|
2424
|
-
| `modelValue` | `RegionPickerModelValue` | — | 绑定值 `{province, city, district, addressDetail, fullAddress}` |
|
|
2425
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2426
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2427
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | 尺寸 |
|
|
2428
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2429
|
-
|
|
2430
|
-
```vue
|
|
2431
|
-
<TfRegionPicker v-model="address" placeholder="请选择省市区" clearable />
|
|
2432
|
-
```
|
|
2433
|
-
|
|
2434
|
-
#### location-picker — 地图选点
|
|
2435
|
-
|
|
2436
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2437
|
-
|------|------|--------|------|
|
|
2438
|
-
| `modelValue` | `LocationData \| null` | — | 绑定位置数据 |
|
|
2439
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2440
|
-
| `clearable` | `boolean` | `false` | 可清空 |
|
|
2441
|
-
| `placeholder` | `string` | — | 占位文本 |
|
|
2442
|
-
| `modalTitle` | `string` | `'选择位置'` | 弹窗标题 |
|
|
2443
|
-
|
|
2444
|
-
```vue
|
|
2445
|
-
<TfLocationPicker v-model="location" placeholder="点击选择地图位置" />
|
|
2446
|
-
```
|
|
2447
|
-
|
|
2448
|
-
---
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
## 三、复合组件 (Form Items) — 23 个
|
|
2456
|
-
|
|
2457
|
-
复合组件遵循统一模式:**`TfFormItem`(包装器) + 基础控件**,通过单层 Props 透传同时暴露 `TfFormItem` 的布局/校验/AI 能力与基础控件的业务属性。所有复合组件共享 `FormItemWrapperProps`(A/B 级)或 `FormItemBaseWrapperProps`(C 级)接口。
|
|
2458
|
-
|
|
2459
|
-
> **命名约定**:`form-{base-control-name}`,如 `form-input` = `TfFormItem` + `input`。
|
|
2460
|
-
|
|
2461
|
-
### 3.1 A 级组件(完整 AI Overlay,7+ AI props)— 5 个
|
|
2462
|
-
|
|
2463
|
-
#### form-input
|
|
2464
|
-
|
|
2465
|
-
`TfFormItem` + `input`,支持 AI 智能填充。
|
|
2466
|
-
|
|
2467
|
-
| 关键 Props | 类型 | 说明 |
|
|
2468
|
-
|-----------|------|------|
|
|
2469
|
-
| `modelValue` | `string \| number` | 绑定值 |
|
|
2470
|
-
| `type` | `string` | input type,默认 `'text'` |
|
|
2471
|
-
| `maxlength` | `number` | 最大字符数 |
|
|
2472
|
-
| `clearable` | `boolean` | 可清空 |
|
|
2473
|
-
| `ai` / `aiPrompt` / `aiPlacement` ... | — | 继承全部 AI props |
|
|
2474
|
-
|
|
2475
|
-
```vue
|
|
2476
|
-
<TfFormInput v-model="title" label="标题" required :maxlength="100" ai :ai-prompt="'帮我生成标题'" />
|
|
2477
|
-
```
|
|
2478
|
-
|
|
2479
|
-
#### form-textarea
|
|
2480
|
-
|
|
2481
|
-
`TfFormItem` + `textarea`,带字数统计的 AI 文本区。
|
|
2482
|
-
|
|
2483
|
-
| 关键 Props | 类型 | 说明 |
|
|
2484
|
-
|-----------|------|------|
|
|
2485
|
-
| `rows` | `number` | 行数,默认 `4` |
|
|
2486
|
-
| `maxlength` | `number` | 最大字符数 |
|
|
2487
|
-
| `showWordLimit` | `boolean` | 字数统计 |
|
|
2488
|
-
|
|
2489
|
-
```vue
|
|
2490
|
-
<TfFormTextarea v-model="desc" label="描述" :rows="6" :maxlength="500" show-word-limit ai />
|
|
2491
|
-
```
|
|
2492
|
-
|
|
2493
|
-
#### form-select
|
|
2494
|
-
|
|
2495
|
-
`TfFormItem` + `select`,支持搜索/多选/AI 推荐。
|
|
2496
|
-
|
|
2497
|
-
| 关键 Props | 类型 | 说明 |
|
|
2498
|
-
|-----------|------|------|
|
|
2499
|
-
| `options` | `SelectOption[]` | 选项列表 |
|
|
2500
|
-
| `multiple` | `boolean` | 多选 |
|
|
2501
|
-
| `filterable` | `boolean` | 可搜索 |
|
|
2502
|
-
|
|
2503
|
-
```vue
|
|
2504
|
-
<TfFormSelect v-model="category" label="分类" :options="categories" filterable ai />
|
|
2505
|
-
```
|
|
2506
|
-
|
|
2507
|
-
#### form-cascader
|
|
2508
|
-
|
|
2509
|
-
`TfFormItem` + `cascader`,AI 辅助级联路径选择。
|
|
2510
|
-
|
|
2511
|
-
| 关键 Props | 类型 | 说明 |
|
|
2512
|
-
|-----------|------|------|
|
|
2513
|
-
| `options` | `CascaderOption[]` | 级联选项 |
|
|
2514
|
-
| `separator` | `string` | 分隔符 |
|
|
2515
|
-
|
|
2516
|
-
```vue
|
|
2517
|
-
<TfFormCascader v-model="area" label="地区" :options="areaTree" separator=" / " ai />
|
|
2518
|
-
```
|
|
2519
|
-
|
|
2520
|
-
#### form-date-picker
|
|
2521
|
-
|
|
2522
|
-
`TfFormItem` + `date-picker`,AI 辅助日期选择。
|
|
2523
|
-
|
|
2524
|
-
| 关键 Props | 类型 | 说明 |
|
|
2525
|
-
|-----------|------|------|
|
|
2526
|
-
| `format` | `string` | 日期格式 |
|
|
2527
|
-
| `type` | `'date' \| 'month' \| 'year'` | 类型 |
|
|
2528
|
-
|
|
2529
|
-
```vue
|
|
2530
|
-
<TfFormDatePicker v-model="startDate" label="开始日期" ai :ai-prompt="'下周一'" />
|
|
2531
|
-
```
|
|
2532
|
-
|
|
2533
|
-
### 3.2 B 级组件(完整 AI Overlay)— 4 个
|
|
2534
|
-
|
|
2535
|
-
#### form-datetime-picker
|
|
2536
|
-
|
|
2537
|
-
`TfFormItem` + `datetime-picker`,AI 支持自然语言日期时间输入。
|
|
2538
|
-
|
|
2539
|
-
| 关键 Props | 类型 | 说明 |
|
|
2540
|
-
|-----------|------|------|
|
|
2541
|
-
| `format` | `string` | 格式,默认 `'YYYY-MM-DD HH:mm:ss'` |
|
|
2542
|
-
|
|
2543
|
-
```vue
|
|
2544
|
-
<TfFormDatetimePicker v-model="meeting" label="会议时间" ai :ai-prompt="'明天下午3点'" />
|
|
2545
|
-
```
|
|
2546
|
-
|
|
2547
|
-
#### form-data-picker
|
|
2548
|
-
|
|
2549
|
-
`TfFormItem` + `data-picker`,AI 辅助数据级联选择。
|
|
2550
|
-
|
|
2551
|
-
```vue
|
|
2552
|
-
<TfFormDataPicker v-model="org" label="部门" :columns="cols" :data-source="depts" ai />
|
|
2553
|
-
```
|
|
2554
|
-
|
|
2555
|
-
#### form-time-picker
|
|
2556
|
-
|
|
2557
|
-
`TfFormItem` + `time-picker`,AI 自然语言时间输入。
|
|
2558
|
-
|
|
2559
|
-
```vue
|
|
2560
|
-
<TfFormTimePicker v-model="alarm" label="提醒时间" format="HH:mm" ai />
|
|
2561
|
-
```
|
|
2562
|
-
|
|
2563
|
-
#### form-region-picker
|
|
2564
|
-
|
|
2565
|
-
`TfFormItem` + `region-picker`,AI 辅助地址补全。
|
|
2566
|
-
|
|
2567
|
-
```vue
|
|
2568
|
-
<TfFormRegionPicker v-model="addr" label="地址" ai :ai-prompt="'北京市朝阳区'" />
|
|
2569
|
-
```
|
|
2570
|
-
|
|
2571
|
-
### 3.3 C 级组件(仅 aiBadge)— 9 个
|
|
2572
|
-
|
|
2573
|
-
以下组件仅通过 `aiBadge` 显示 AI 能力标识,不搭载完整 AI Overlay:
|
|
2574
|
-
|
|
2575
|
-
| 组件名 | 构成 | 关键 Props |
|
|
2576
|
-
|--------|------|-----------|
|
|
2577
|
-
| `form-checkbox` | `TfFormItem` + `checkbox` | `indeterminate` |
|
|
2578
|
-
| `form-radio` | `TfFormItem` + `radio` | `value` |
|
|
2579
|
-
| `form-switch` | `TfFormItem` + `switch` | `loading` |
|
|
2580
|
-
| `form-slider` | `TfFormItem` + `slider` | `min`, `max`, `step`, `range`, `marks` |
|
|
2581
|
-
| `form-upload` | `TfFormItem` + `upload` | `multiple`, `accept`, `maxCount`, `maxSize`, `drag`, `listType` |
|
|
2582
|
-
| `form-image-upload` | `TfFormItem` + `image-upload` | `aspectRatio`, `maxSize` |
|
|
2583
|
-
| `form-file-upload` | `TfFormItem` + `file-upload` | `accept`, `maxCount`, `drag` |
|
|
2584
|
-
| `form-signature` | `TfFormItem` + `signature` | `canvasWidth`, `canvasHeight`, `penColor` |
|
|
2585
|
-
| `form-location-picker` | `TfFormItem` + `location-picker` | `modalTitle` |
|
|
2586
|
-
|
|
2587
|
-
**使用示例**(以 form-switch 和 form-slider 为例):
|
|
2588
|
-
|
|
2589
|
-
```vue
|
|
2590
|
-
<TfFormSwitch v-model="enabled" label="启用通知" ai-badge />
|
|
2591
|
-
<TfFormSlider v-model="volume" label="音量" :min="0" :max="100" :step="10" ai-badge />
|
|
2592
|
-
<TfFormUpload v-model="files" label="附件" multiple drag :max-count="5" ai-badge />
|
|
2593
|
-
<TfFormSignature v-model="sign" label="签名" :canvas-width="600" ai-badge />
|
|
2594
|
-
```
|
|
2595
|
-
|
|
2596
|
-
### 3.4 复合组件通用 Props 速查
|
|
2597
|
-
|
|
2598
|
-
所有 `form-*` 组件从 `TfFormItem` 继承以下公共属性:
|
|
2599
|
-
|
|
2600
|
-
| 属性 | 说明 |
|
|
2601
|
-
|------|------|
|
|
2602
|
-
| `prop` / `label` / `labelWidth` / `size` / `required` / `error` / `tip` | 标签与校验(同 TfFormItem) |
|
|
2603
|
-
| `span` | 栅格跨度 |
|
|
2604
|
-
| `layout` | `'vertical'` / `'horizontal'` |
|
|
2605
|
-
| `aiBadge` | AI 徽章(C 级) |
|
|
2606
|
-
| `ai` / `aiPrompt` / `aiPlacement` / `aiNeedConfirm` / `aiActions` ... | AI 能力(A/B 级) |
|
|
2607
|
-
|
|
2608
|
-
## 四、表单容器 (Form Containers) — 5 个
|
|
2609
|
-
|
|
2610
|
-
表单容器扩展了标准表单的交互维度:分组、动态数组、子表单、Schema 驱动、表格内编辑。
|
|
2611
|
-
|
|
2612
|
-
### 4.1 TfFormGroup — 表单分组
|
|
2613
|
-
|
|
2614
|
-
为表单项提供视觉分组、折叠控制与操作区。
|
|
2615
|
-
|
|
2616
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2617
|
-
|------|------|--------|------|
|
|
2618
|
-
| `title` | `string` | — | 分组标题 |
|
|
2619
|
-
| `description` | `string` | — | 分组描述 |
|
|
2620
|
-
| `collapsible` | `boolean` | `false` | 可折叠 |
|
|
2621
|
-
| `defaultCollapsed` | `boolean` | `false` | 默认折叠 |
|
|
2622
|
-
| `bordered` | `boolean` | `true` | 显示边框 |
|
|
2623
|
-
| `padding` | `boolean` | `true` | 显示内边距 |
|
|
2624
|
-
| `aiBadge` | `boolean` | `false` | AI 徽章 |
|
|
2625
|
-
|
|
2626
|
-
**Events**:`collapse(state: boolean)`
|
|
2627
|
-
|
|
2628
|
-
**Slots**:`default` / `title` / `description` / `actions`
|
|
2629
|
-
|
|
2630
|
-
```vue
|
|
2631
|
-
<TfFormGroup title="基本信息" collapsible bordered>
|
|
2632
|
-
<TfFormItem prop="name" label="姓名" />
|
|
2633
|
-
<TfFormItem prop="phone" label="电话" />
|
|
2634
|
-
<template #actions>
|
|
2635
|
-
<TfButton size="sm">编辑</TfButton>
|
|
2636
|
-
</template>
|
|
2637
|
-
</TfFormGroup>
|
|
2638
|
-
```
|
|
2639
|
-
|
|
2640
|
-
### 4.2 TfFormArray — 动态数组表单
|
|
2641
|
-
|
|
2642
|
-
管理可增删的动态表单项数组,适用于多行重复字段(如教育经历、家庭成员)。
|
|
2643
|
-
|
|
2644
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2645
|
-
|------|------|--------|------|
|
|
2646
|
-
| `modelValue` | `Record[]` | `[]` | 数组数据 |
|
|
2647
|
-
| `label` | `string` | — | 整体标签 |
|
|
2648
|
-
| `required` | `boolean` | `false` | 必填 |
|
|
2649
|
-
| `tip` | `string` | — | 提示文字 |
|
|
2650
|
-
| `error` | `string` | — | 错误信息 |
|
|
2651
|
-
| `aiBadge` | `boolean` | `false` | AI 徽章 |
|
|
2652
|
-
| `min` | `number` | `0` | 最小项数 |
|
|
2653
|
-
| `max` | `number` | `Infinity` | 最大项数 |
|
|
2654
|
-
| `disabled` | `boolean` | `false` | 全局禁用 |
|
|
2655
|
-
|
|
2656
|
-
**Events**:`update:modelValue` / `add(item)` / `remove(index)`
|
|
2657
|
-
|
|
2658
|
-
**Slots**:`default{item, index}` / `addButton` / `removeButton{index}`
|
|
2659
|
-
|
|
2660
|
-
```vue
|
|
2661
|
-
<TfFormArray v-model="experiences" label="工作经历" :min="1" :max="5">
|
|
2662
|
-
<template #default="{ item, index }">
|
|
2663
|
-
<TfFormInput v-model="item.company" label="公司" />
|
|
2664
|
-
<TfFormInput v-model="item.position" label="职位" />
|
|
2665
|
-
</template>
|
|
2666
|
-
</TfFormArray>
|
|
2667
|
-
```
|
|
2668
|
-
|
|
2669
|
-
### 4.3 TfSubForm — 子表单
|
|
2670
|
-
|
|
2671
|
-
嵌套对象数据的表单容器,支持折叠与独立布局。
|
|
2672
|
-
|
|
2673
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2674
|
-
|------|------|--------|------|
|
|
2675
|
-
| `modelValue` | `Record` | — | 子对象数据 |
|
|
2676
|
-
| `label` | `string` | — | 标签 |
|
|
2677
|
-
| `required` | `boolean` | `false` | 必填 |
|
|
2678
|
-
| `tip` | `string` | — | 提示 |
|
|
2679
|
-
| `error` | `string` | — | 错误 |
|
|
2680
|
-
| `aiBadge` | `boolean` | `false` | AI 徽章 |
|
|
2681
|
-
| `collapsible` | `boolean` | `false` | 可折叠 |
|
|
2682
|
-
| `defaultCollapsed` | `boolean` | `false` | 默认折叠 |
|
|
2683
|
-
| `bordered` | `boolean` | `true` | 边框 |
|
|
2684
|
-
| `padding` | `boolean` | `true` | 内边距 |
|
|
2685
|
-
| `disabled` | `boolean` | `false` | 禁用 |
|
|
2686
|
-
|
|
2687
|
-
**Events**:`update:modelValue` / `collapse(state)`
|
|
2688
|
-
|
|
2689
|
-
**Slots**:`default{value}` / `title` / `description` / `actions`
|
|
2690
|
-
|
|
2691
|
-
```vue
|
|
2692
|
-
<TfSubForm v-model="addressInfo" label="地址信息" collapsible bordered>
|
|
2693
|
-
<TfFormInput v-model="addressInfo.street" label="街道" />
|
|
2694
|
-
<TfFormInput v-model="addressInfo.zip" label="邮编" />
|
|
2695
|
-
</TfSubForm>
|
|
2696
|
-
```
|
|
2697
|
-
|
|
2698
|
-
### 4.4 TfDynamicForm — 动态 Schema 表单
|
|
2699
|
-
|
|
2700
|
-
基于 `DynamicFieldSchema[]` 渲染表单,适用于低代码/配置化场景。
|
|
2701
|
-
|
|
2702
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2703
|
-
|------|------|--------|------|
|
|
2704
|
-
| `modelValue` | `Record` | — | 表单数据 |
|
|
2705
|
-
| `schema` | `DynamicFieldSchema[]` | `[]` | 字段 Schema 数组 |
|
|
2706
|
-
| `layout` | `string` | — | 布局方向 |
|
|
2707
|
-
| `labelWidth` | `string` | — | 标签宽度 |
|
|
2708
|
-
| `labelAlign` | `string` | — | 标签对齐 |
|
|
2709
|
-
| `size` | `string` | — | 全局尺寸 |
|
|
2710
|
-
| `disabled` | `boolean` | `false` | 全局禁用 |
|
|
2711
|
-
| `colon` | `boolean` | `false` | 显示冒号 |
|
|
2712
|
-
|
|
2713
|
-
**Events**:`update:modelValue` / `submit` / `field-change`
|
|
2714
|
-
|
|
2715
|
-
**Slots**:`default` / `[fieldName]{value, field}`
|
|
2716
|
-
|
|
2717
|
-
```vue
|
|
2718
|
-
<TfDynamicForm
|
|
2719
|
-
v-model="formData"
|
|
2720
|
-
:schema="fieldSchema"
|
|
2721
|
-
layout="vertical"
|
|
2722
|
-
label-width="120px"
|
|
2723
|
-
@submit="handleSubmit"
|
|
2724
|
-
/>
|
|
2725
|
-
```
|
|
2726
|
-
|
|
2727
|
-
### 4.5 TfFormTable — 表格型子表单
|
|
2728
|
-
|
|
2729
|
-
以可编辑表格形式管理多行结构化数据,每行为一条记录,支持行列编辑。
|
|
2730
|
-
|
|
2731
|
-
核心能力:行内编辑、列筛选、行增删、批量操作。继承 `TfTable` 的列定义模式,同时每列可嵌入表单控件。
|
|
2732
|
-
|
|
2733
|
-
```vue
|
|
2734
|
-
<TfFormTable v-model="tableData" :columns="columns" editable>
|
|
2735
|
-
<template #actions="{ row, index }">
|
|
2736
|
-
<TfButton size="sm" @click="removeRow(index)">删除</TfButton>
|
|
2737
|
-
</template>
|
|
2738
|
-
</TfFormTable>
|
|
2739
|
-
```
|
|
2740
|
-
|
|
2741
|
-
## 五、AI 增强体系
|
|
2742
|
-
|
|
2743
|
-
表单 AI 体系采用 **5 层抽象架构**,从底层状态机到上层组件逐级封装,实现了"零代码改动即可获得 AI 能力"的设计目标。
|
|
2744
|
-
|
|
2745
|
-
### 5.1 五层架构
|
|
2746
|
-
|
|
2747
|
-
```
|
|
2748
|
-
┌──────────────────────────────────────────────────┐
|
|
2749
|
-
│ Layer 4: 18 个 form-* 透传层 │
|
|
2750
|
-
│ (zero code change — 自动继承 Layer 3 能力) │
|
|
2751
|
-
├──────────────────────────────────────────────────┤
|
|
2752
|
-
│ Layer 3: TfFormItem 集成点 │
|
|
2753
|
-
│ (aiBadge → clickable trigger → auto-mount │
|
|
2754
|
-
│ TfAiOverlay → state sync) │
|
|
2755
|
-
├──────────────────────────────────────────────────┤
|
|
2756
|
-
│ Layer 2: useFormAi composable │
|
|
2757
|
-
│ (state machine + resolver + onApply │
|
|
2758
|
-
│ + overlay auto show/hide) │
|
|
2759
|
-
├──────────────────────────────────────────────────┤
|
|
2760
|
-
│ Layer 1: TfAiOverlay │
|
|
2761
|
-
│ (Teleport to body, position:fixed, 6 placements)│
|
|
2762
|
-
├──────────────────────────────────────────────────┤
|
|
2763
|
-
│ Layer 0: useAiStateMachine │
|
|
2764
|
-
│ (6-state: idle/loading/streaming/done/error/ │
|
|
2765
|
-
│ confirming) │
|
|
2766
|
-
└──────────────────────────────────────────────────┘
|
|
2767
|
-
```
|
|
2768
|
-
|
|
2769
|
-
### 5.2 Layer 0:useAiStateMachine — 6 状态状态机
|
|
2770
|
-
|
|
2771
|
-
| 状态 | 含义 | 触发条件 |
|
|
2772
|
-
|------|------|---------|
|
|
2773
|
-
| `idle` | 空闲 | 初始状态 / 重置后 |
|
|
2774
|
-
| `loading` | 加载中 | 发起 AI 请求 |
|
|
2775
|
-
| `streaming` | 流式输出中 | 接收到首个 chunk |
|
|
2776
|
-
| `done` | 完成 | 请求成功返回结果 |
|
|
2777
|
-
| `error` | 错误 | 请求失败或超时 |
|
|
2778
|
-
| `confirming` | 待确认 | 结果需用户确认后写入 |
|
|
2779
|
-
|
|
2780
|
-
状态转换路径:`idle → loading → streaming → done → idle`(自动应用)或 `idle → loading → streaming → done → confirming → idle`(需确认)。
|
|
2781
|
-
|
|
2782
|
-
### 5.3 Layer 1:TfAiOverlay — 6 方位浮动面板
|
|
2783
|
-
|
|
2784
|
-
Teleport 到 `<body>`,`position: fixed` 定位,支持 `top` / `bottom` / `left` / `right` / `top-start` / `top-end` 共 6 种放置位置。
|
|
2785
|
-
|
|
2786
|
-
### 5.4 Layer 2:useFormAi — 表单 AI 组合函数
|
|
2787
|
-
|
|
2788
|
-
封装状态机 + 解析器调用 + `onApply` 回写逻辑 + Overlay 自动显隐。开发者可通过 `aiResolver` 注入自定义 AI 后端。
|
|
2789
|
-
|
|
2790
|
-
### 5.5 Layer 3-4:从 TfFormItem 到 form-*
|
|
2791
|
-
|
|
2792
|
-
- **Layer 3**:`TfFormItem` 检测 `ai` / `aiBadge` prop,自动渲染可点击的 AI 徽章,点击后挂载 `TfAiOverlay` 并连接状态机。
|
|
2793
|
-
- **Layer 4**:18 个 `form-*` 复合组件通过 Props 透传自动继承 Layer 3 的全部 AI 能力,无需额外代码。
|
|
2794
|
-
|
|
2795
|
-
### 5.6 AI 交互范式演进
|
|
2796
|
-
|
|
2797
|
-
**v1 基础**:单次 Prompt → 获取结果 → 用户确认 → 写入字段。
|
|
2798
|
-
|
|
2799
|
-
**v2 多操作(multi-action)**:通过 `aiActions` 数组提供 5 种内置操作键:
|
|
2800
|
-
|
|
2801
|
-
| 操作键 | 功能 |
|
|
2802
|
-
|--------|------|
|
|
2803
|
-
| `complete` | AI 补全填充 |
|
|
2804
|
-
| `recognize` | OCR / 语音识别 |
|
|
2805
|
-
| `check` | 数据校验 |
|
|
2806
|
-
| `polish` | 文案润色 |
|
|
2807
|
-
| `translate` | 多语言翻译 |
|
|
2808
|
-
|
|
2809
|
-
**v3 新范式**:8 状态状态机(`idle` / `enhanced` / `suggestion` / `issue-warn` / `issue-error` / `confirmed` / `rejected` / `modified`),引入"直接写入"(fill writes directly)和"校验结果入 Overlay"(check results in overlay)两种新模式。
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
## 六、AI 组件
|
|
2814
|
-
|
|
2815
|
-
3 个独立 AI 组件分别负责状态展示、批量操作工具栏与浮动交互面板。
|
|
2816
|
-
|
|
2817
|
-
### 6.1 TfFormAiStatus — 表单 AI 状态栏
|
|
2818
|
-
|
|
2819
|
-
展示表单全局 AI 状态摘要,支持状态筛选与字段级导航。
|
|
2820
|
-
|
|
2821
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2822
|
-
|------|------|--------|------|
|
|
2823
|
-
| `layout` | `'inline' \| 'stack'` | `'inline'` | 布局方向 |
|
|
2824
|
-
| `show` | `FormAiStatusKey[]` | — | 显示哪些状态类型 |
|
|
2825
|
-
| `expandable` | `boolean` | `true` | 可展开详情 |
|
|
2826
|
-
| `compact` | `boolean` | `false` | 紧凑模式 |
|
|
2827
|
-
| `labels` | `Record<string, string>` | — | 自定义状态标签 |
|
|
2828
|
-
|
|
2829
|
-
**Events**:`click-status(state)` / `click-field(fieldName)`
|
|
2830
|
-
|
|
2831
|
-
```vue
|
|
2832
|
-
<TfFormAiStatus
|
|
2833
|
-
:show="['suggestion', 'issue-warn', 'issue-error']"
|
|
2834
|
-
layout="inline"
|
|
2835
|
-
@click-field="scrollToField"
|
|
2836
|
-
/>
|
|
2837
|
-
```
|
|
2838
|
-
|
|
2839
|
-
### 6.2 TfFormAiToolbar — 批量 AI 操作工具栏
|
|
2840
|
-
|
|
2841
|
-
提供表单级别的批量 AI 能力,一次操作可影响所有启用了 AI 的字段。
|
|
2842
|
-
|
|
2843
|
-
| 关键方法 | 说明 |
|
|
2844
|
-
|---------|------|
|
|
2845
|
-
| `applyAll()` | 批量应用所有 AI 建议 |
|
|
2846
|
-
| `confirmAll()` | 批量确认 |
|
|
2847
|
-
| `checkAll()` | 批量校验 |
|
|
2848
|
-
| `rejectAll()` | 批量拒绝 |
|
|
2849
|
-
|
|
2850
|
-
**Events**:`onRecognize(callback)`
|
|
2851
|
-
|
|
2852
|
-
```vue
|
|
2853
|
-
<TfFormAiToolbar
|
|
2854
|
-
@apply-all="handleApplyAll"
|
|
2855
|
-
@check-all="handleCheckAll"
|
|
2856
|
-
@reject-all="handleRejectAll"
|
|
2857
|
-
/>
|
|
2858
|
-
```
|
|
2859
|
-
|
|
2860
|
-
### 6.3 TfAiOverlay — AI 交互浮层
|
|
2861
|
-
|
|
2862
|
-
以固定定位浮层承载 AI 输入、结果展示与确认操作。由 `TfFormItem` 内部自动管理生命周期,也可独立使用。
|
|
2863
|
-
|
|
2864
|
-
| 名称 | 类型 | 默认值 | 说明 |
|
|
2865
|
-
|------|------|--------|------|
|
|
2866
|
-
| `open` | `boolean` | `false` | 是否显示 |
|
|
2867
|
-
| `anchor` | `HTMLElement \| null` | — | 锚点元素 |
|
|
2868
|
-
| `state` | `AiState` | `'idle'` | 当前状态 |
|
|
2869
|
-
| `result` | `any` | — | AI 返回结果 |
|
|
2870
|
-
| `error` | `string` | — | 错误信息 |
|
|
2871
|
-
| `placement` | `string` | `'bottom'` | 弹出位置 |
|
|
2872
|
-
| `offset` | `number` | `8` | 偏移量(px) |
|
|
2873
|
-
| `width` | `number` | `360` | 浮层宽度(px) |
|
|
2874
|
-
| `maxHeight` | `string` | `'60vh'` | 最大高度 |
|
|
2875
|
-
| `confirmLabel` | `string` | `'应用'` | 确认按钮文案 |
|
|
2876
|
-
| `rejectLabel` | `string` | `'取消'` | 拒绝按钮文案 |
|
|
2877
|
-
| `compact` | `boolean` | `false` | 紧凑模式 |
|
|
2878
|
-
| `zIndex` | `number` | — | 层级 |
|
|
2879
|
-
|
|
2880
|
-
**Events**:`confirm` / `reject` / `ask(query)`
|
|
2881
|
-
|
|
2882
|
-
**Slots**:`input` / `actions` / `result`
|
|
2883
|
-
|
|
2884
|
-
```vue
|
|
2885
|
-
<TfAiOverlay
|
|
2886
|
-
:open="showAi"
|
|
2887
|
-
:anchor="inputRef"
|
|
2888
|
-
:state="aiState"
|
|
2889
|
-
:result="aiResult"
|
|
2890
|
-
placement="bottom"
|
|
2891
|
-
@confirm="handleAiConfirm"
|
|
2892
|
-
@reject="handleAiReject"
|
|
2893
|
-
>
|
|
2894
|
-
<template #input>
|
|
2895
|
-
<TfTextarea v-model="prompt" placeholder="描述你的需求..." />
|
|
2896
|
-
</template>
|
|
2897
|
-
</TfAiOverlay>
|
|
2898
|
-
```
|
|
2899
|
-
|
|
2900
|
-
## 附录:组件索引
|
|
2901
|
-
|
|
2902
|
-
| 分类 | 数量 | 组件列表 |
|
|
2903
|
-
|------|------|---------|
|
|
2904
|
-
| **表单核心** | 3 | `TfForm`, `TfFormItem`, `TfFormField` |
|
|
2905
|
-
| **基础控件** | 17 | `input`, `textarea`, `select`, `cascader`, `checkbox`, `radio`, `switch`, `date-picker`, `time-picker`, `datetime-picker`, `data-picker`, `slider`, `upload`, `file-upload`, `image-upload`, `signature`, `region-picker`, `location-picker` |
|
|
2906
|
-
| **复合组件** | 23 | `form-input`, `form-textarea`, `form-select`, `form-cascader`, `form-date-picker`, `form-datetime-picker`, `form-data-picker`, `form-time-picker`, `form-region-picker`, `form-checkbox`, `form-radio`, `form-switch`, `form-slider`, `form-upload`, `form-image-upload`, `form-file-upload`, `form-signature`, `form-location-picker`(+5 个 A 级实为 18 个核心) |
|
|
2907
|
-
| **表单容器** | 5 | `TfFormGroup`, `TfFormArray`, `TfSubForm`, `TfDynamicForm`, `TfFormTable` |
|
|
2908
|
-
| **AI 组件** | 3 | `TfFormAiStatus`, `TfFormAiToolbar`, `TfAiOverlay` |
|
|
2909
|
-
|
|
2910
|
-
> **总计**:48 个表单体系组件(3 核心 + 17 基础 + 23 复合 + 5 容器 + 3 AI),其中 18 个 `form-*` 复合组件按需透传 AI 能力。
|
|
2911
|
-
|