@tongfun/ui 0.0.1-alpha.2 → 0.0.1-alpha.4
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/agent-schema/index.d.ts +12 -0
- package/dist/agent-schema/index.js +33 -0
- package/dist/agent-schema/types.d.ts +27 -0
- package/dist/formula/index.d.ts +17 -0
- package/dist/formula/types.d.ts +136 -0
- package/dist/index.d.ts +167 -0
- package/dist/index.js +156550 -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 +42625 -0
- package/{packages/ui/lowcode-agent/types.ts → dist/lowcode-agent/types.d.ts} +312 -312
- package/dist/skill/golden-examples/dashboard-workbench.md +224 -0
- package/dist/skill/golden-examples/form-create.md +227 -0
- package/dist/skill/golden-examples/management-list.md +264 -0
- package/dist/skill/golden-examples/new-document.md +748 -0
- package/dist/skill/tongfun-ui-skill.json +470 -0
- package/dist/skill/tongfun-ui-skill.md +297 -0
- package/dist/style.css +1 -0
- package/package.json +16 -2
- 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
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
# Golden Example: 新建单据页
|
|
2
|
+
|
|
3
|
+
## 场景
|
|
4
|
+
|
|
5
|
+
用于采购合同、销售订单、费用报销、入库单、付款申请等标准 BOS 单据创建页面。这个示例要求保持 `NewDocumentDemo.vue` 的企业后台单据风格:左侧是单据目录和完成进度,右侧是多个 `TfCard` 表单分区,点击目录可平滑定位到对应卡片。
|
|
6
|
+
|
|
7
|
+
本示例只保留基础功能链路:
|
|
8
|
+
|
|
9
|
+
- 左侧单据目录。
|
|
10
|
+
- 左侧总进度 / 必填进度。
|
|
11
|
+
- 右侧 `TfCard` 分区。
|
|
12
|
+
- 目录点击与右侧卡片滚动联动。
|
|
13
|
+
- 校验失败时定位到第一个未完成分区,并短暂高亮。
|
|
14
|
+
|
|
15
|
+
## Generation Contract
|
|
16
|
+
|
|
17
|
+
Agent 生成 `new-document` 页面时必须遵守以下机器可读 contract。平台可以从 `@tongfun/ui/skill.json` 读取同结构配置;Markdown 中保留这一份是为了让模型直接阅读示例时也不会退化成普通表单页。
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"id": "new-document",
|
|
22
|
+
"title": "新建单据页面",
|
|
23
|
+
"intent": {
|
|
24
|
+
"keywords": [
|
|
25
|
+
"单据",
|
|
26
|
+
"新建单据",
|
|
27
|
+
"新增单据",
|
|
28
|
+
"创建单据",
|
|
29
|
+
"合同",
|
|
30
|
+
"采购合同",
|
|
31
|
+
"销售合同",
|
|
32
|
+
"采购单",
|
|
33
|
+
"销售单",
|
|
34
|
+
"付款申请",
|
|
35
|
+
"报销",
|
|
36
|
+
"document",
|
|
37
|
+
"bill",
|
|
38
|
+
"contract"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"generationContract": {
|
|
42
|
+
"requiredComponents": [
|
|
43
|
+
"TfPageHeader",
|
|
44
|
+
"TfSidebarLayout",
|
|
45
|
+
"TfSideNav",
|
|
46
|
+
"TfProgress",
|
|
47
|
+
"TfStack",
|
|
48
|
+
"TfCard",
|
|
49
|
+
"TfForm",
|
|
50
|
+
"TfFormLayout"
|
|
51
|
+
],
|
|
52
|
+
"recommendedComponents": [
|
|
53
|
+
"TfFormInput",
|
|
54
|
+
"TfFormSelect",
|
|
55
|
+
"TfFormDatePicker",
|
|
56
|
+
"TfFormTextarea",
|
|
57
|
+
"TfButton",
|
|
58
|
+
"TfAlert",
|
|
59
|
+
"TfTag"
|
|
60
|
+
],
|
|
61
|
+
"minimumComponents": {
|
|
62
|
+
"TfCard": 3
|
|
63
|
+
},
|
|
64
|
+
"layoutMustInclude": [
|
|
65
|
+
"left-sidebar-progress-navigation",
|
|
66
|
+
"right-multi-section-cards"
|
|
67
|
+
],
|
|
68
|
+
"forbiddenStructures": [
|
|
69
|
+
"plain-single-card-form",
|
|
70
|
+
"single-section-large-form",
|
|
71
|
+
"marketing-hero-layout"
|
|
72
|
+
],
|
|
73
|
+
"requiredBehaviors": [
|
|
74
|
+
"section-navigation-scroll",
|
|
75
|
+
"section-progress",
|
|
76
|
+
"required-field-progress",
|
|
77
|
+
"validate-before-save",
|
|
78
|
+
"validation-failure-scroll-to-first-invalid-section"
|
|
79
|
+
],
|
|
80
|
+
"stateModel": [
|
|
81
|
+
"form",
|
|
82
|
+
"sections",
|
|
83
|
+
"activeSection",
|
|
84
|
+
"sideNavItems",
|
|
85
|
+
"totalProgress",
|
|
86
|
+
"requiredProgress",
|
|
87
|
+
"saving",
|
|
88
|
+
"notice"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 推荐结构
|
|
95
|
+
|
|
96
|
+
1. `TfPageHeader`:页面标题、单据编号、返回、暂存、提交。
|
|
97
|
+
2. `TfAlert`:页面提示或校验反馈。
|
|
98
|
+
3. `TfSidebarLayout`:形成左目录 + 右内容的单据布局。
|
|
99
|
+
4. 左侧 `TfCard` + `TfProgress`:展示总进度和必填进度。
|
|
100
|
+
5. 左侧 `TfSideNav`:展示单据目录、每个分区完成状态和百分比。
|
|
101
|
+
6. 右侧 `TfStack`:纵向排列多个 `TfCard`。
|
|
102
|
+
7. 每个分区 `TfCard` 必须有稳定 `id`,用于 `scrollIntoView`。
|
|
103
|
+
8. 每个 `TfCard` 内部用 `TfFormLayout` + `TfFormXxx` 字段组件。
|
|
104
|
+
|
|
105
|
+
## 推荐组件
|
|
106
|
+
|
|
107
|
+
- `TfPageHeader`
|
|
108
|
+
- `TfSidebarLayout`
|
|
109
|
+
- `TfSideNav`
|
|
110
|
+
- `TfCard`
|
|
111
|
+
- `TfProgress`
|
|
112
|
+
- `TfStack`
|
|
113
|
+
- `TfForm`
|
|
114
|
+
- `TfFormLayout`
|
|
115
|
+
- `TfFormInput`
|
|
116
|
+
- `TfFormSelect`
|
|
117
|
+
- `TfFormDatePicker`
|
|
118
|
+
- `TfFormTextarea`
|
|
119
|
+
- `TfButton`
|
|
120
|
+
- `TfAlert`
|
|
121
|
+
- `TfTag`
|
|
122
|
+
|
|
123
|
+
## 可替换区域
|
|
124
|
+
|
|
125
|
+
- `sections` 可替换为当前业务对象的分区。
|
|
126
|
+
- `form` 可替换为当前实体字段模型。
|
|
127
|
+
- `requiredMap` 可由实体字段元数据自动生成。
|
|
128
|
+
- `TfCard` 内字段可由低代码平台拖入 `TfFormInput`、`TfFormSelect` 等字段组件。
|
|
129
|
+
- 保存、提交、AI 识别等按钮逻辑可在业务壳子里扩展。
|
|
130
|
+
|
|
131
|
+
## 不建议改动区域
|
|
132
|
+
|
|
133
|
+
- 左侧目录 + 右侧卡片的整体布局。
|
|
134
|
+
- `section.id` 与右侧 `TfCard id` 一一对应。
|
|
135
|
+
- 目录点击必须只做定位,不要重新挂载右侧内容。
|
|
136
|
+
- 校验失败时必须定位到第一个缺失字段所在分区。
|
|
137
|
+
- 进度应由字段完成情况计算,不要写死。
|
|
138
|
+
- 不要把所有字段放在一个大卡片中。
|
|
139
|
+
|
|
140
|
+
## 状态覆盖
|
|
141
|
+
|
|
142
|
+
- active:当前目录项。
|
|
143
|
+
- progress:总进度、必填进度、分区进度。
|
|
144
|
+
- pending:分区未开始。
|
|
145
|
+
- doing:分区部分完成。
|
|
146
|
+
- done:分区已完成。
|
|
147
|
+
- error:提交校验失败时高亮未完成分区。
|
|
148
|
+
- collapsed-summary:卡片折叠后展示关键摘要。
|
|
149
|
+
- disabled:保存/提交中禁用按钮和表单。
|
|
150
|
+
|
|
151
|
+
## Vue SFC 示例代码
|
|
152
|
+
|
|
153
|
+
```vue
|
|
154
|
+
<template>
|
|
155
|
+
<div class="space-y-3">
|
|
156
|
+
<TfPageHeader
|
|
157
|
+
title="新建采购合同"
|
|
158
|
+
subtitle="编号 CT-20260702-0001 · 版本 V0.1 · 建材采购标准合同"
|
|
159
|
+
description="按分区录入合同主数据、供应商、采购方、价格和交付条款"
|
|
160
|
+
bordered
|
|
161
|
+
>
|
|
162
|
+
<template #actions>
|
|
163
|
+
<TfButton :disabled="busy" @click="handleBack">返回</TfButton>
|
|
164
|
+
<TfButton :loading="saving" @click="handleSaveDraft">暂存</TfButton>
|
|
165
|
+
<TfButton type="primary" :loading="submitting" @click="handleSubmit">提交</TfButton>
|
|
166
|
+
</template>
|
|
167
|
+
</TfPageHeader>
|
|
168
|
+
|
|
169
|
+
<TfAlert
|
|
170
|
+
v-if="notice"
|
|
171
|
+
class="mb-3"
|
|
172
|
+
:type="notice.type"
|
|
173
|
+
:title="notice.title"
|
|
174
|
+
:description="notice.description"
|
|
175
|
+
closable
|
|
176
|
+
@close="notice = null"
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
<TfForm :model="form" :disabled="busy">
|
|
180
|
+
<TfSidebarLayout
|
|
181
|
+
surface="card"
|
|
182
|
+
surface-tone="white"
|
|
183
|
+
sidebar-width="208px"
|
|
184
|
+
gap="md"
|
|
185
|
+
:show-divider="false"
|
|
186
|
+
:show-surface-border="false"
|
|
187
|
+
:full-height="false"
|
|
188
|
+
sticky-sidebar
|
|
189
|
+
>
|
|
190
|
+
<template #sidebar>
|
|
191
|
+
<TfStack gap="sm">
|
|
192
|
+
<TfCard padding="sm" shadow="sm" radius="lg" title="完成进度">
|
|
193
|
+
<TfStack gap="xs">
|
|
194
|
+
<TfProgress
|
|
195
|
+
:percentage="totalProgress"
|
|
196
|
+
type="primary"
|
|
197
|
+
size="sm"
|
|
198
|
+
:format="() => `总进度 ${totalProgress}%`"
|
|
199
|
+
/>
|
|
200
|
+
<TfProgress
|
|
201
|
+
:percentage="requiredProgress"
|
|
202
|
+
type="success"
|
|
203
|
+
size="sm"
|
|
204
|
+
:format="() => `必填进度 ${requiredProgress}%`"
|
|
205
|
+
/>
|
|
206
|
+
</TfStack>
|
|
207
|
+
</TfCard>
|
|
208
|
+
|
|
209
|
+
<TfSideNav
|
|
210
|
+
:items="sideNavItems"
|
|
211
|
+
:model-value="activeSection"
|
|
212
|
+
title="单据目录"
|
|
213
|
+
@update:model-value="scrollToSection"
|
|
214
|
+
@select="item => scrollToSection(item.id)"
|
|
215
|
+
/>
|
|
216
|
+
</TfStack>
|
|
217
|
+
</template>
|
|
218
|
+
|
|
219
|
+
<template #main>
|
|
220
|
+
<TfStack gap="md">
|
|
221
|
+
<TfCard
|
|
222
|
+
v-for="section in sections"
|
|
223
|
+
:id="section.id"
|
|
224
|
+
:key="section.id"
|
|
225
|
+
shadow="md"
|
|
226
|
+
compact
|
|
227
|
+
collapsible
|
|
228
|
+
radius="lg"
|
|
229
|
+
header-style="gradient"
|
|
230
|
+
:tone="cardTone(section.id)"
|
|
231
|
+
:collapsed-summary="section.summary()"
|
|
232
|
+
:class="{ 'tf-new-document-section--highlight': highlightedSection === section.id }"
|
|
233
|
+
>
|
|
234
|
+
<template #title>
|
|
235
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
236
|
+
<span>{{ section.title }}</span>
|
|
237
|
+
<span :class="sectionMetaClass(section.id)">
|
|
238
|
+
{{ sectionHeader(section.id) }}
|
|
239
|
+
</span>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
|
|
243
|
+
<template #actions>
|
|
244
|
+
<TfTag size="sm" variant="light" :type="sectionTagType(section.id)">
|
|
245
|
+
{{ sectionStatusText(section.id) }}
|
|
246
|
+
</TfTag>
|
|
247
|
+
</template>
|
|
248
|
+
|
|
249
|
+
<component :is="section.component" />
|
|
250
|
+
</TfCard>
|
|
251
|
+
</TfStack>
|
|
252
|
+
</template>
|
|
253
|
+
</TfSidebarLayout>
|
|
254
|
+
</TfForm>
|
|
255
|
+
</div>
|
|
256
|
+
</template>
|
|
257
|
+
|
|
258
|
+
<script setup lang="ts">
|
|
259
|
+
import { computed, defineComponent, h, nextTick, reactive, ref } from 'vue'
|
|
260
|
+
import {
|
|
261
|
+
TfAlert,
|
|
262
|
+
TfButton,
|
|
263
|
+
TfCard,
|
|
264
|
+
TfForm,
|
|
265
|
+
TfFormDatePicker,
|
|
266
|
+
TfFormInput,
|
|
267
|
+
TfFormLayout,
|
|
268
|
+
TfFormSelect,
|
|
269
|
+
TfFormTextarea,
|
|
270
|
+
TfPageHeader,
|
|
271
|
+
TfProgress,
|
|
272
|
+
TfSidebarLayout,
|
|
273
|
+
TfSideNav,
|
|
274
|
+
TfStack,
|
|
275
|
+
TfTag
|
|
276
|
+
} from '@tongfun/ui'
|
|
277
|
+
|
|
278
|
+
type NoticeType = 'info' | 'success' | 'warning' | 'error'
|
|
279
|
+
type SectionStatus = 'done' | 'doing' | 'pending' | 'error'
|
|
280
|
+
type SectionTone = 'success' | 'warning' | 'empty' | 'danger'
|
|
281
|
+
type CardTone = 'default' | 'primary' | 'success' | 'warning' | 'error'
|
|
282
|
+
|
|
283
|
+
interface Notice {
|
|
284
|
+
type: NoticeType
|
|
285
|
+
title: string
|
|
286
|
+
description: string
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
interface ContractForm {
|
|
290
|
+
contractName: string
|
|
291
|
+
contractCode: string
|
|
292
|
+
contractType: string
|
|
293
|
+
signDate: string
|
|
294
|
+
projectName: string
|
|
295
|
+
supplierName: string
|
|
296
|
+
supplierCredit: string
|
|
297
|
+
supplierContact: string
|
|
298
|
+
buyerName: string
|
|
299
|
+
purchaseOrg: string
|
|
300
|
+
buyerEmployee: string
|
|
301
|
+
currency: string
|
|
302
|
+
settlementCycle: string
|
|
303
|
+
invoiceType: string
|
|
304
|
+
priceMode: string
|
|
305
|
+
deliveryPlace: string
|
|
306
|
+
deliveryMethod: string
|
|
307
|
+
deliveryWindow: string
|
|
308
|
+
paymentTerms: string
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
type FormKey = keyof ContractForm
|
|
312
|
+
|
|
313
|
+
interface SectionRequiredField {
|
|
314
|
+
key: FormKey
|
|
315
|
+
label: string
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface SectionConfig {
|
|
319
|
+
id: string
|
|
320
|
+
title: string
|
|
321
|
+
description: string
|
|
322
|
+
requiredFields: SectionRequiredField[]
|
|
323
|
+
component: ReturnType<typeof defineComponent>
|
|
324
|
+
summary: () => { label: string; value: string }[]
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const activeSection = ref('basic')
|
|
328
|
+
const highlightedSection = ref('')
|
|
329
|
+
const saving = ref(false)
|
|
330
|
+
const submitting = ref(false)
|
|
331
|
+
const notice = ref<Notice | null>({
|
|
332
|
+
type: 'info',
|
|
333
|
+
title: '单据已初始化',
|
|
334
|
+
description: '左侧目录会根据右侧卡片必填字段完成情况自动更新。'
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
const form = reactive<ContractForm>({
|
|
338
|
+
contractName: '',
|
|
339
|
+
contractCode: '',
|
|
340
|
+
contractType: '',
|
|
341
|
+
signDate: '',
|
|
342
|
+
projectName: '',
|
|
343
|
+
supplierName: '',
|
|
344
|
+
supplierCredit: '',
|
|
345
|
+
supplierContact: '',
|
|
346
|
+
buyerName: '',
|
|
347
|
+
purchaseOrg: '',
|
|
348
|
+
buyerEmployee: '',
|
|
349
|
+
currency: '',
|
|
350
|
+
settlementCycle: '',
|
|
351
|
+
invoiceType: '',
|
|
352
|
+
priceMode: '',
|
|
353
|
+
deliveryPlace: '',
|
|
354
|
+
deliveryMethod: '',
|
|
355
|
+
deliveryWindow: '',
|
|
356
|
+
paymentTerms: ''
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
const busy = computed(() => saving.value || submitting.value)
|
|
360
|
+
|
|
361
|
+
const contractTypeOptions = [
|
|
362
|
+
{ label: '框架采购合同', value: 'framework' },
|
|
363
|
+
{ label: '单次采购合同', value: 'single' },
|
|
364
|
+
{ label: '补充协议', value: 'supplement' }
|
|
365
|
+
]
|
|
366
|
+
|
|
367
|
+
const currencyOptions = [{ label: '人民币 CNY', value: 'CNY' }]
|
|
368
|
+
const settlementOptions = [
|
|
369
|
+
{ label: '月结', value: 'monthly' },
|
|
370
|
+
{ label: '按批次结算', value: 'batch' }
|
|
371
|
+
]
|
|
372
|
+
const invoiceOptions = [
|
|
373
|
+
{ label: '13% 增值税专票', value: 'vat13' },
|
|
374
|
+
{ label: '普通发票', value: 'normal' }
|
|
375
|
+
]
|
|
376
|
+
const priceModeOptions = [
|
|
377
|
+
{ label: '浮动价', value: 'floating' },
|
|
378
|
+
{ label: '固定单价', value: 'fixed' }
|
|
379
|
+
]
|
|
380
|
+
|
|
381
|
+
const sections = computed<SectionConfig[]>(() => [
|
|
382
|
+
{
|
|
383
|
+
id: 'basic',
|
|
384
|
+
title: '基本信息',
|
|
385
|
+
description: '合同主数据、项目、签约日期等',
|
|
386
|
+
requiredFields: [
|
|
387
|
+
{ key: 'contractName', label: '合同名称' },
|
|
388
|
+
{ key: 'contractCode', label: '合同编号' },
|
|
389
|
+
{ key: 'contractType', label: '合同类型' },
|
|
390
|
+
{ key: 'signDate', label: '签约日期' },
|
|
391
|
+
{ key: 'projectName', label: '项目名称' }
|
|
392
|
+
],
|
|
393
|
+
component: BasicSection,
|
|
394
|
+
summary: () => [
|
|
395
|
+
{ label: '合同', value: form.contractName },
|
|
396
|
+
{ label: '编号', value: form.contractCode },
|
|
397
|
+
{ label: '项目', value: form.projectName }
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: 'supplier',
|
|
402
|
+
title: '供应商信息',
|
|
403
|
+
description: '供应单位资质与联系人',
|
|
404
|
+
requiredFields: [
|
|
405
|
+
{ key: 'supplierName', label: '供应商名称' },
|
|
406
|
+
{ key: 'supplierCredit', label: '统一社会信用代码' },
|
|
407
|
+
{ key: 'supplierContact', label: '联系人' }
|
|
408
|
+
],
|
|
409
|
+
component: SupplierSection,
|
|
410
|
+
summary: () => [
|
|
411
|
+
{ label: '供应商', value: form.supplierName },
|
|
412
|
+
{ label: '联系人', value: form.supplierContact }
|
|
413
|
+
]
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: 'buyer',
|
|
417
|
+
title: '采购方信息',
|
|
418
|
+
description: '采购主体、组织与经办人',
|
|
419
|
+
requiredFields: [
|
|
420
|
+
{ key: 'buyerName', label: '采购方名称' },
|
|
421
|
+
{ key: 'purchaseOrg', label: '采购组织' },
|
|
422
|
+
{ key: 'buyerEmployee', label: '采购员' }
|
|
423
|
+
],
|
|
424
|
+
component: BuyerSection,
|
|
425
|
+
summary: () => [
|
|
426
|
+
{ label: '采购方', value: form.buyerName },
|
|
427
|
+
{ label: '采购员', value: form.buyerEmployee }
|
|
428
|
+
]
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: 'pricing',
|
|
432
|
+
title: '价格结算',
|
|
433
|
+
description: '币种、发票、结算周期与价格机制',
|
|
434
|
+
requiredFields: [
|
|
435
|
+
{ key: 'currency', label: '币种' },
|
|
436
|
+
{ key: 'settlementCycle', label: '结算周期' },
|
|
437
|
+
{ key: 'invoiceType', label: '发票类型' },
|
|
438
|
+
{ key: 'priceMode', label: '价格模式' }
|
|
439
|
+
],
|
|
440
|
+
component: PricingSection,
|
|
441
|
+
summary: () => [
|
|
442
|
+
{ label: '币种', value: form.currency },
|
|
443
|
+
{ label: '结算', value: form.settlementCycle }
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
id: 'delivery',
|
|
448
|
+
title: '交付条款',
|
|
449
|
+
description: '交付地点、方式、窗口期',
|
|
450
|
+
requiredFields: [
|
|
451
|
+
{ key: 'deliveryPlace', label: '交付地点' },
|
|
452
|
+
{ key: 'deliveryMethod', label: '交付方式' },
|
|
453
|
+
{ key: 'deliveryWindow', label: '交付窗口' }
|
|
454
|
+
],
|
|
455
|
+
component: DeliverySection,
|
|
456
|
+
summary: () => [
|
|
457
|
+
{ label: '地点', value: form.deliveryPlace },
|
|
458
|
+
{ label: '方式', value: form.deliveryMethod }
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: 'payment',
|
|
463
|
+
title: '付款条款',
|
|
464
|
+
description: '付款节点、发票校验、账期规则',
|
|
465
|
+
requiredFields: [
|
|
466
|
+
{ key: 'paymentTerms', label: '付款条款' }
|
|
467
|
+
],
|
|
468
|
+
component: PaymentSection,
|
|
469
|
+
summary: () => [
|
|
470
|
+
{ label: '付款', value: form.paymentTerms }
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
])
|
|
474
|
+
|
|
475
|
+
const BasicSection = defineComponent({
|
|
476
|
+
name: 'BasicSection',
|
|
477
|
+
setup() {
|
|
478
|
+
return () => h(TfFormLayout, { columns: 6, density: 'compact' }, () => [
|
|
479
|
+
h(TfFormInput, { modelValue: form.contractName, 'onUpdate:modelValue': (value: string) => form.contractName = value, label: '合同名称', size: 'sm', required: true, span: 2 }),
|
|
480
|
+
h(TfFormInput, { modelValue: form.contractCode, 'onUpdate:modelValue': (value: string) => form.contractCode = value, label: '合同编号', size: 'sm', required: true }),
|
|
481
|
+
h(TfFormSelect, { modelValue: form.contractType, 'onUpdate:modelValue': (value: string) => form.contractType = value, label: '合同类型', options: contractTypeOptions, size: 'sm', required: true }),
|
|
482
|
+
h(TfFormDatePicker, { modelValue: form.signDate, 'onUpdate:modelValue': (value: string) => form.signDate = value, label: '签约日期', size: 'sm', required: true }),
|
|
483
|
+
h(TfFormInput, { modelValue: form.projectName, 'onUpdate:modelValue': (value: string) => form.projectName = value, label: '项目名称', size: 'sm', required: true, span: 2 })
|
|
484
|
+
])
|
|
485
|
+
}
|
|
486
|
+
})
|
|
487
|
+
|
|
488
|
+
const SupplierSection = defineComponent({
|
|
489
|
+
name: 'SupplierSection',
|
|
490
|
+
setup() {
|
|
491
|
+
return () => h(TfFormLayout, { columns: 6, density: 'compact' }, () => [
|
|
492
|
+
h(TfFormInput, { modelValue: form.supplierName, 'onUpdate:modelValue': (value: string) => form.supplierName = value, label: '供应商名称', size: 'sm', required: true, span: 2 }),
|
|
493
|
+
h(TfFormInput, { modelValue: form.supplierCredit, 'onUpdate:modelValue': (value: string) => form.supplierCredit = value, label: '统一社会信用代码', size: 'sm', required: true }),
|
|
494
|
+
h(TfFormInput, { modelValue: form.supplierContact, 'onUpdate:modelValue': (value: string) => form.supplierContact = value, label: '联系人', size: 'sm', required: true })
|
|
495
|
+
])
|
|
496
|
+
}
|
|
497
|
+
})
|
|
498
|
+
|
|
499
|
+
const BuyerSection = defineComponent({
|
|
500
|
+
name: 'BuyerSection',
|
|
501
|
+
setup() {
|
|
502
|
+
return () => h(TfFormLayout, { columns: 6, density: 'compact' }, () => [
|
|
503
|
+
h(TfFormInput, { modelValue: form.buyerName, 'onUpdate:modelValue': (value: string) => form.buyerName = value, label: '采购方名称', size: 'sm', required: true, span: 2 }),
|
|
504
|
+
h(TfFormInput, { modelValue: form.purchaseOrg, 'onUpdate:modelValue': (value: string) => form.purchaseOrg = value, label: '采购组织', size: 'sm', required: true }),
|
|
505
|
+
h(TfFormInput, { modelValue: form.buyerEmployee, 'onUpdate:modelValue': (value: string) => form.buyerEmployee = value, label: '采购员', size: 'sm', required: true })
|
|
506
|
+
])
|
|
507
|
+
}
|
|
508
|
+
})
|
|
509
|
+
|
|
510
|
+
const PricingSection = defineComponent({
|
|
511
|
+
name: 'PricingSection',
|
|
512
|
+
setup() {
|
|
513
|
+
return () => h(TfFormLayout, { columns: 6, density: 'compact' }, () => [
|
|
514
|
+
h(TfFormSelect, { modelValue: form.currency, 'onUpdate:modelValue': (value: string) => form.currency = value, label: '币种', options: currencyOptions, size: 'sm', required: true }),
|
|
515
|
+
h(TfFormSelect, { modelValue: form.settlementCycle, 'onUpdate:modelValue': (value: string) => form.settlementCycle = value, label: '结算周期', options: settlementOptions, size: 'sm', required: true }),
|
|
516
|
+
h(TfFormSelect, { modelValue: form.invoiceType, 'onUpdate:modelValue': (value: string) => form.invoiceType = value, label: '发票类型', options: invoiceOptions, size: 'sm', required: true }),
|
|
517
|
+
h(TfFormSelect, { modelValue: form.priceMode, 'onUpdate:modelValue': (value: string) => form.priceMode = value, label: '价格模式', options: priceModeOptions, size: 'sm', required: true })
|
|
518
|
+
])
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
const DeliverySection = defineComponent({
|
|
523
|
+
name: 'DeliverySection',
|
|
524
|
+
setup() {
|
|
525
|
+
return () => h(TfFormLayout, { columns: 6, density: 'compact' }, () => [
|
|
526
|
+
h(TfFormInput, { modelValue: form.deliveryPlace, 'onUpdate:modelValue': (value: string) => form.deliveryPlace = value, label: '交付地点', size: 'sm', required: true }),
|
|
527
|
+
h(TfFormInput, { modelValue: form.deliveryMethod, 'onUpdate:modelValue': (value: string) => form.deliveryMethod = value, label: '交付方式', size: 'sm', required: true }),
|
|
528
|
+
h(TfFormTextarea, { modelValue: form.deliveryWindow, 'onUpdate:modelValue': (value: string) => form.deliveryWindow = value, label: '交付窗口', size: 'sm', required: true, rows: 2, span: 'full' })
|
|
529
|
+
])
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
const PaymentSection = defineComponent({
|
|
534
|
+
name: 'PaymentSection',
|
|
535
|
+
setup() {
|
|
536
|
+
return () => h(TfFormLayout, { columns: 1, density: 'compact' }, () => [
|
|
537
|
+
h(TfFormTextarea, { modelValue: form.paymentTerms, 'onUpdate:modelValue': (value: string) => form.paymentTerms = value, label: '付款条款', size: 'sm', required: true, rows: 3, span: 'full' })
|
|
538
|
+
])
|
|
539
|
+
}
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
const sectionProgressMap = computed(() => {
|
|
543
|
+
const result: Record<string, { done: number; total: number; percent: number; status: SectionStatus }> = {}
|
|
544
|
+
|
|
545
|
+
for (const section of sections.value) {
|
|
546
|
+
const total = section.requiredFields.length
|
|
547
|
+
const done = section.requiredFields.filter(field => isFilled(form[field.key])).length
|
|
548
|
+
const percent = total ? Math.round(done / total * 100) : 100
|
|
549
|
+
const status: SectionStatus = highlightedSection.value === section.id && percent < 100
|
|
550
|
+
? 'error'
|
|
551
|
+
: percent === 100
|
|
552
|
+
? 'done'
|
|
553
|
+
: percent > 0
|
|
554
|
+
? 'doing'
|
|
555
|
+
: 'pending'
|
|
556
|
+
|
|
557
|
+
result[section.id] = { done, total, percent, status }
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return result
|
|
561
|
+
})
|
|
562
|
+
|
|
563
|
+
const sideNavItems = computed(() => sections.value.map(section => {
|
|
564
|
+
const progress = sectionProgress(section.id)
|
|
565
|
+
return {
|
|
566
|
+
id: section.id,
|
|
567
|
+
label: section.title,
|
|
568
|
+
status: progress.status,
|
|
569
|
+
percent: progress.percent,
|
|
570
|
+
highlighted: highlightedSection.value === section.id && progress.percent < 100
|
|
571
|
+
}
|
|
572
|
+
}))
|
|
573
|
+
|
|
574
|
+
const completedRequiredCount = computed(() => {
|
|
575
|
+
return Object.values(sectionProgressMap.value).reduce((sum, item) => sum + item.done, 0)
|
|
576
|
+
})
|
|
577
|
+
|
|
578
|
+
const totalRequiredCount = computed(() => {
|
|
579
|
+
return sections.value.reduce((sum, section) => sum + section.requiredFields.length, 0)
|
|
580
|
+
})
|
|
581
|
+
|
|
582
|
+
const requiredProgress = computed(() => {
|
|
583
|
+
if (!totalRequiredCount.value) return 100
|
|
584
|
+
return Math.round(completedRequiredCount.value / totalRequiredCount.value * 100)
|
|
585
|
+
})
|
|
586
|
+
|
|
587
|
+
const totalProgress = computed(() => {
|
|
588
|
+
return Math.min(100, Math.round(requiredProgress.value * 0.86 + 14))
|
|
589
|
+
})
|
|
590
|
+
|
|
591
|
+
function sectionProgress(id: string) {
|
|
592
|
+
return sectionProgressMap.value[id] || { done: 0, total: 0, percent: 100, status: 'done' as SectionStatus }
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function sectionHeader(id: string) {
|
|
596
|
+
const progress = sectionProgress(id)
|
|
597
|
+
return progress.total ? `必填 ${progress.done}/${progress.total}` : '辅助信息'
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function sectionTone(id: string): SectionTone {
|
|
601
|
+
const progress = sectionProgress(id)
|
|
602
|
+
if (highlightedSection.value === id && progress.percent < 100) return 'danger'
|
|
603
|
+
if (progress.percent === 100) return 'success'
|
|
604
|
+
if (progress.percent > 0) return 'warning'
|
|
605
|
+
return 'empty'
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function cardTone(id: string): CardTone {
|
|
609
|
+
const tone = sectionTone(id)
|
|
610
|
+
if (tone === 'danger') return 'error'
|
|
611
|
+
if (tone === 'success') return 'success'
|
|
612
|
+
if (tone === 'warning') return 'warning'
|
|
613
|
+
return 'default'
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
function sectionTagType(id: string) {
|
|
617
|
+
const progress = sectionProgress(id)
|
|
618
|
+
if (progress.status === 'error') return 'danger'
|
|
619
|
+
if (progress.status === 'done') return 'success'
|
|
620
|
+
if (progress.status === 'doing') return 'warning'
|
|
621
|
+
return 'default'
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
function sectionStatusText(id: string) {
|
|
625
|
+
const progress = sectionProgress(id)
|
|
626
|
+
if (progress.status === 'error') return '待完善'
|
|
627
|
+
if (progress.status === 'done') return '已完成'
|
|
628
|
+
if (progress.status === 'doing') return '进行中'
|
|
629
|
+
return '未开始'
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function sectionMetaClass(id: string) {
|
|
633
|
+
const tone = sectionTone(id)
|
|
634
|
+
const base = 'rounded-full border px-2 py-0.5 text-xs font-semibold'
|
|
635
|
+
if (tone === 'danger') return `${base} border-[var(--error-200)] bg-[var(--error-50)] text-[var(--tf-color-error)]`
|
|
636
|
+
if (tone === 'success') return `${base} border-[var(--success-200)] bg-[var(--success-50)] text-[var(--tf-color-success)]`
|
|
637
|
+
if (tone === 'warning') return `${base} border-[var(--warning-200)] bg-[var(--warning-50)] text-[var(--tf-color-warning)]`
|
|
638
|
+
return `${base} border-[var(--tf-color-border)] bg-[var(--neutral-50)] text-[var(--tf-color-text-secondary)]`
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
function isFilled(value: unknown) {
|
|
642
|
+
return value !== undefined && value !== null && String(value).trim() !== ''
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function collectMissingItems() {
|
|
646
|
+
const missing: { sectionId: string; sectionTitle: string; fieldLabel: string }[] = []
|
|
647
|
+
|
|
648
|
+
for (const section of sections.value) {
|
|
649
|
+
for (const field of section.requiredFields) {
|
|
650
|
+
if (!isFilled(form[field.key])) {
|
|
651
|
+
missing.push({
|
|
652
|
+
sectionId: section.id,
|
|
653
|
+
sectionTitle: section.title,
|
|
654
|
+
fieldLabel: field.label
|
|
655
|
+
})
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return missing
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function scrollToSection(id: string, highlight = false) {
|
|
664
|
+
activeSection.value = id
|
|
665
|
+
if (highlight) highlightedSection.value = id
|
|
666
|
+
|
|
667
|
+
nextTick(() => {
|
|
668
|
+
document.getElementById(id)?.scrollIntoView({
|
|
669
|
+
behavior: 'smooth',
|
|
670
|
+
block: 'start'
|
|
671
|
+
})
|
|
672
|
+
})
|
|
673
|
+
|
|
674
|
+
if (highlight) {
|
|
675
|
+
window.setTimeout(() => {
|
|
676
|
+
if (highlightedSection.value === id) highlightedSection.value = ''
|
|
677
|
+
}, 2600)
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
function handleBack() {
|
|
682
|
+
notice.value = {
|
|
683
|
+
type: 'info',
|
|
684
|
+
title: '返回',
|
|
685
|
+
description: '业务项目中这里通常返回单据列表。'
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
async function handleSaveDraft() {
|
|
690
|
+
saving.value = true
|
|
691
|
+
try {
|
|
692
|
+
await new Promise(resolve => window.setTimeout(resolve, 500))
|
|
693
|
+
notice.value = {
|
|
694
|
+
type: 'success',
|
|
695
|
+
title: '暂存成功',
|
|
696
|
+
description: `当前必填进度 ${requiredProgress.value}%。`
|
|
697
|
+
}
|
|
698
|
+
} finally {
|
|
699
|
+
saving.value = false
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
async function handleSubmit() {
|
|
704
|
+
const missing = collectMissingItems()
|
|
705
|
+
|
|
706
|
+
if (missing.length) {
|
|
707
|
+
const first = missing[0]
|
|
708
|
+
notice.value = {
|
|
709
|
+
type: 'error',
|
|
710
|
+
title: `还有 ${missing.length} 项必填未完成`,
|
|
711
|
+
description: `请先完善“${first.sectionTitle} - ${first.fieldLabel}”。左侧目录已标红,并已自动定位到该分区。`
|
|
712
|
+
}
|
|
713
|
+
scrollToSection(first.sectionId, true)
|
|
714
|
+
return
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
submitting.value = true
|
|
718
|
+
try {
|
|
719
|
+
await new Promise(resolve => window.setTimeout(resolve, 600))
|
|
720
|
+
notice.value = {
|
|
721
|
+
type: 'success',
|
|
722
|
+
title: '提交成功',
|
|
723
|
+
description: '必填校验全部通过,单据已进入下一流程节点。'
|
|
724
|
+
}
|
|
725
|
+
} finally {
|
|
726
|
+
submitting.value = false
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
</script>
|
|
730
|
+
|
|
731
|
+
<style scoped>
|
|
732
|
+
.tf-new-document-section--highlight {
|
|
733
|
+
outline: 2px solid var(--tf-color-error);
|
|
734
|
+
outline-offset: 2px;
|
|
735
|
+
}
|
|
736
|
+
</style>
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
## 设计说明
|
|
740
|
+
|
|
741
|
+
- 这个示例完全围绕 `NewDocumentDemo.vue` 的核心布局:左侧目录和右侧分区卡片。
|
|
742
|
+
- 左侧目录的数据不手写状态,而是从右侧分区的必填字段完成度计算。
|
|
743
|
+
- `section.id` 是联动核心,必须同时用于 `TfSideNav.items[].id` 和右侧 `TfCard id`。
|
|
744
|
+
- 点击目录只滚动定位,不切换路由、不卸载卡片,避免表单状态丢失。
|
|
745
|
+
- 提交时先收集缺失字段,再定位到第一个未完成分区。
|
|
746
|
+
- 高亮只做短暂视觉提示,避免长期错误态干扰用户。
|
|
747
|
+
- `TfFormLayout` 使用紧凑密度和多列布局,保持企业后台单据页的信息密度。
|
|
748
|
+
- Tailwind 只用于布局和少量状态 class,颜色使用 `--tf-*` tokens。
|