@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,890 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* TfUpload v2 表单附件组件
|
|
4
|
-
* 与 TfFileUpload(字段附件紧凑 Chip)不同,本组件用于表单级附件区。
|
|
5
|
-
* v2:统一 Card Header 操作、上传 Modal、分组管理 Modal、审批 Drawer、文件行更多菜单。
|
|
6
|
-
*/
|
|
7
|
-
import { computed, reactive, ref, watch, onUnmounted } from 'vue'
|
|
8
|
-
import { cn } from '../../../../../lib/utils'
|
|
9
|
-
import type {
|
|
10
|
-
UploadApprovalRecord,
|
|
11
|
-
UploadApprovalStatus,
|
|
12
|
-
UploadEmits,
|
|
13
|
-
UploadFileItem,
|
|
14
|
-
UploadGroup,
|
|
15
|
-
UploadGroupChange,
|
|
16
|
-
UploadProps,
|
|
17
|
-
UploadSlots,
|
|
18
|
-
AiConfig
|
|
19
|
-
} from './upload'
|
|
20
|
-
import { useAiStateMachine } from '../../../../../src/composables/use-ai-state-machine'
|
|
21
|
-
import type { AiState } from '../../../../../src/composables/use-ai-state-machine'
|
|
22
|
-
|
|
23
|
-
const props = withDefaults(defineProps<UploadProps>(), {
|
|
24
|
-
modelValue: () => [],
|
|
25
|
-
groups: () => [],
|
|
26
|
-
multiple: true,
|
|
27
|
-
accept: '*',
|
|
28
|
-
maxCount: undefined,
|
|
29
|
-
maxSize: undefined,
|
|
30
|
-
disabled: false,
|
|
31
|
-
showUploadDate: true,
|
|
32
|
-
showFileType: true,
|
|
33
|
-
showProgress: true,
|
|
34
|
-
buttonText: '上传附件',
|
|
35
|
-
cardTitle: '表单附件',
|
|
36
|
-
cardDescription: '统一管理本表单的附件、分组与审批状态',
|
|
37
|
-
showSummary: true,
|
|
38
|
-
uploadTargetGroupKey: undefined,
|
|
39
|
-
showUploadTargetSelector: true,
|
|
40
|
-
editableGroups: false,
|
|
41
|
-
allowMoveBetweenGroups: false,
|
|
42
|
-
defaultGroupLabel: '新分组',
|
|
43
|
-
approval: false,
|
|
44
|
-
groupApproval: false,
|
|
45
|
-
pendingGroupChanges: () => [],
|
|
46
|
-
currentUser: '当前用户',
|
|
47
|
-
showApprovalHistory: false
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const emit = defineEmits<UploadEmits>()
|
|
51
|
-
defineSlots<UploadSlots>()
|
|
52
|
-
|
|
53
|
-
const UNGROUPED_KEY = '__ungrouped__'
|
|
54
|
-
const inputRef = ref<HTMLInputElement | null>(null)
|
|
55
|
-
const visibleError = ref('')
|
|
56
|
-
const deleteGroupError = ref('')
|
|
57
|
-
|
|
58
|
-
const uploadModalOpen = ref(false)
|
|
59
|
-
const stagedFiles = ref<UploadFileItem[]>([])
|
|
60
|
-
const stagedDefaultGroupKey = ref(props.uploadTargetGroupKey ?? '')
|
|
61
|
-
|
|
62
|
-
const groupModalOpen = ref(false)
|
|
63
|
-
const groupDraftMode = ref<'add' | 'edit'>('add')
|
|
64
|
-
const editingGroupKey = ref<string | null>(null)
|
|
65
|
-
const groupFormKey = ref('')
|
|
66
|
-
const groupFormLabel = ref('')
|
|
67
|
-
const groupFormDescription = ref('')
|
|
68
|
-
const groupFormAccept = ref('')
|
|
69
|
-
const groupFormMaxCount = ref('')
|
|
70
|
-
const groupFormError = ref('')
|
|
71
|
-
const groupDraftNotice = ref('')
|
|
72
|
-
const savedGroupDrafts = ref<Array<{ mode: 'add' | 'edit'; group: UploadGroup; oldGroup?: UploadGroup }>>([])
|
|
73
|
-
|
|
74
|
-
const approvalDrawerOpen = ref(false)
|
|
75
|
-
const completedGroupChanges = ref<UploadGroupChange[]>([])
|
|
76
|
-
const approvalComments = reactive<Record<string, string>>({})
|
|
77
|
-
const openMoreFileId = ref<string | null>(null)
|
|
78
|
-
|
|
79
|
-
const fileList = computed(() => props.modelValue ?? [])
|
|
80
|
-
const internalGroups = ref<UploadGroup[]>([...(props.groups ?? [])])
|
|
81
|
-
const localPendingGroupChanges = ref<UploadGroupChange[]>([...(props.pendingGroupChanges ?? [])])
|
|
82
|
-
const localUploadTargetGroupKey = ref(props.uploadTargetGroupKey ?? '')
|
|
83
|
-
|
|
84
|
-
watch(() => props.groups, groups => { internalGroups.value = [...(groups ?? [])] }, { deep: true })
|
|
85
|
-
watch(() => props.pendingGroupChanges, changes => { localPendingGroupChanges.value = [...(changes ?? [])] }, { deep: true })
|
|
86
|
-
watch(() => props.uploadTargetGroupKey, key => {
|
|
87
|
-
localUploadTargetGroupKey.value = key ?? ''
|
|
88
|
-
stagedDefaultGroupKey.value = key ?? ''
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
const activeGroups = computed(() => internalGroups.value)
|
|
92
|
-
const hasGroups = computed(() => activeGroups.value.length > 0)
|
|
93
|
-
const totalMaxedOut = computed(() => props.maxCount != null && fileList.value.length >= props.maxCount)
|
|
94
|
-
const effectiveGroupApproval = computed(() => props.groupApproval || props.approval)
|
|
95
|
-
const pendingGroups = computed(() => localPendingGroupChanges.value.filter(change => change.status === 'pending'))
|
|
96
|
-
const pendingFileCount = computed(() => fileList.value.filter(file => file.approvalStatus === 'pending').length)
|
|
97
|
-
const errorFileCount = computed(() => fileList.value.filter(file => file.status === 'error').length)
|
|
98
|
-
const pendingTotalCount = computed(() => pendingFileCount.value + pendingGroups.value.length)
|
|
99
|
-
const uploadTargetKey = computed(() => props.uploadTargetGroupKey ?? localUploadTargetGroupKey.value)
|
|
100
|
-
|
|
101
|
-
const ungroupedGroup = computed<UploadGroup | null>(() => {
|
|
102
|
-
if (!hasGroups.value) return null
|
|
103
|
-
return fileList.value.some(file => !file.groupKey)
|
|
104
|
-
? { key: UNGROUPED_KEY, label: '未分组', description: '未指定分组的附件' }
|
|
105
|
-
: null
|
|
106
|
-
})
|
|
107
|
-
const displayGroups = computed(() => {
|
|
108
|
-
const groups = [...activeGroups.value]
|
|
109
|
-
if (ungroupedGroup.value) groups.push(ungroupedGroup.value)
|
|
110
|
-
return groups
|
|
111
|
-
})
|
|
112
|
-
const flatListGroup: UploadGroup = { key: UNGROUPED_KEY, label: '附件列表', description: '未启用分组时的表单附件' }
|
|
113
|
-
|
|
114
|
-
const CATEGORY_LABEL: Record<NonNullable<UploadFileItem['category']>, string> = {
|
|
115
|
-
pdf: 'PDF', word: 'Word', excel: 'Excel', image: '图片', zip: '压缩包', other: '其他'
|
|
116
|
-
}
|
|
117
|
-
const CATEGORY_DOT: Record<NonNullable<UploadFileItem['category']>, string> = {
|
|
118
|
-
pdf: 'var(--tf-color-filetype-pdf)', word: 'var(--tf-color-filetype-word)', excel: 'var(--tf-color-filetype-excel)', image: 'var(--tf-color-filetype-image)', zip: 'var(--tf-color-filetype-zip)', other: 'var(--tf-color-filetype-default)'
|
|
119
|
-
}
|
|
120
|
-
const APPROVAL_STATUS_LABEL: Record<UploadApprovalStatus, string> = {
|
|
121
|
-
draft: '草稿', pending: '待审批', approved: '已通过', rejected: '已驳回', supplement_required: '需补充'
|
|
122
|
-
}
|
|
123
|
-
const APPROVAL_STATUS_COLOR: Record<UploadApprovalStatus, string> = {
|
|
124
|
-
draft: 'var(--tf-color-upload-draft)', pending: 'var(--tf-color-upload-pending)', approved: 'var(--tf-color-upload-approved)', rejected: 'var(--tf-color-upload-rejected)', supplement_required: 'var(--tf-color-upload-supplement)'
|
|
125
|
-
}
|
|
126
|
-
const GROUP_CHANGE_LABEL = { add: '新增分组', edit: '编辑分组' }
|
|
127
|
-
|
|
128
|
-
function setVisibleError(message: string) { visibleError.value = message }
|
|
129
|
-
function createError(message: string): Error { return new Error(message) }
|
|
130
|
-
function emitError(message: string, error?: Error) {
|
|
131
|
-
const err = error ?? createError(message)
|
|
132
|
-
console.warn('[TfUpload]', err)
|
|
133
|
-
setVisibleError(message)
|
|
134
|
-
emit('error', err)
|
|
135
|
-
}
|
|
136
|
-
function warnUi(message: string) {
|
|
137
|
-
console.warn('[TfUpload]', message)
|
|
138
|
-
setVisibleError(message)
|
|
139
|
-
}
|
|
140
|
-
function getExtension(name: string): string { return name.includes('.') ? name.split('.').pop()?.toLowerCase() ?? '' : '' }
|
|
141
|
-
function inferCategoryByNameAndType(name: string, type = ''): UploadFileItem['category'] {
|
|
142
|
-
const ext = getExtension(name); const mime = type.toLowerCase()
|
|
143
|
-
if (ext === 'pdf' || mime.includes('pdf')) return 'pdf'
|
|
144
|
-
if (['doc', 'docx'].includes(ext) || mime.includes('word') || mime.includes('document')) return 'word'
|
|
145
|
-
if (['xls', 'xlsx', 'csv'].includes(ext) || mime.includes('sheet') || mime.includes('excel') || mime.includes('csv')) return 'excel'
|
|
146
|
-
if (['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'svg'].includes(ext) || mime.startsWith('image/')) return 'image'
|
|
147
|
-
if (['zip', 'rar', '7z', 'tar', 'gz'].includes(ext) || mime.includes('zip') || mime.includes('rar') || mime.includes('compressed')) return 'zip'
|
|
148
|
-
return 'other'
|
|
149
|
-
}
|
|
150
|
-
function inferTypeByNameAndType(name: string, type = ''): string {
|
|
151
|
-
if (type) return type
|
|
152
|
-
const ext = getExtension(name)
|
|
153
|
-
const typeMap: Record<string, string> = {
|
|
154
|
-
pdf: 'application/pdf', doc: 'application/msword', docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
155
|
-
xls: 'application/vnd.ms-excel', xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', csv: 'text/csv',
|
|
156
|
-
jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', gif: 'image/gif', webp: 'image/webp', zip: 'application/zip', rar: 'application/vnd.rar', txt: 'text/plain'
|
|
157
|
-
}
|
|
158
|
-
return typeMap[ext] ?? 'application/octet-stream'
|
|
159
|
-
}
|
|
160
|
-
function getFileCategory(file: UploadFileItem): NonNullable<UploadFileItem['category']> { return file.category ?? inferCategoryByNameAndType(file.name, file.type) ?? 'other' }
|
|
161
|
-
function getTypeLabel(file: UploadFileItem): string { return CATEGORY_LABEL[getFileCategory(file)] }
|
|
162
|
-
function getDotColor(file: UploadFileItem): string { return CATEGORY_DOT[getFileCategory(file)] }
|
|
163
|
-
function pad(value: number): string { return String(value).padStart(2, '0') }
|
|
164
|
-
function formatNow(): string {
|
|
165
|
-
const date = new Date()
|
|
166
|
-
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`
|
|
167
|
-
}
|
|
168
|
-
function formatUploadDate(value?: string | Date): string {
|
|
169
|
-
if (!value) return ''
|
|
170
|
-
if (typeof value === 'string' && /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(value)) return value
|
|
171
|
-
const date = value instanceof Date ? value : new Date(value)
|
|
172
|
-
if (Number.isNaN(date.getTime())) return ''
|
|
173
|
-
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`
|
|
174
|
-
}
|
|
175
|
-
function formatFileSize(bytes: number): string { return bytes < 1024 ? `${bytes}B` : bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)}KB` : `${(bytes / 1024 / 1024).toFixed(1)}MB` }
|
|
176
|
-
function statusLabel(status?: UploadFileItem['status']): string {
|
|
177
|
-
return ({ ready: '待上传', uploading: '上传中', done: '已完成', error: '失败' } as Record<NonNullable<UploadFileItem['status']>, string>)[status ?? 'ready']
|
|
178
|
-
}
|
|
179
|
-
function getGroupFiles(groupKey: string): UploadFileItem[] {
|
|
180
|
-
if (groupKey === UNGROUPED_KEY) return hasGroups.value ? fileList.value.filter(file => !file.groupKey) : fileList.value
|
|
181
|
-
return fileList.value.filter(file => file.groupKey === groupKey)
|
|
182
|
-
}
|
|
183
|
-
function getGlobalIndex(file: UploadFileItem): number { return fileList.value.indexOf(file) }
|
|
184
|
-
function getUploadTargetGroup(groupKey = stagedDefaultGroupKey.value): UploadGroup | undefined { return activeGroups.value.find(group => group.key === groupKey) }
|
|
185
|
-
function getUploadAccept(): string { return getUploadTargetGroup()?.accept ?? props.accept }
|
|
186
|
-
function isGroupMaxedOut(group: UploadGroup): boolean { return group.key !== UNGROUPED_KEY && group.maxCount != null && getGroupFiles(group.key).length >= group.maxCount }
|
|
187
|
-
function isUploadDisabled(): boolean {
|
|
188
|
-
const targetGroup = getUploadTargetGroup(uploadTargetKey.value)
|
|
189
|
-
return props.disabled || totalMaxedOut.value || !!targetGroup?.disabled || (targetGroup?.maxCount != null && getGroupFiles(targetGroup.key).length >= targetGroup.maxCount)
|
|
190
|
-
}
|
|
191
|
-
function validateFiles(files: File[], groupKey?: string, stagedExisting = stagedFiles.value): boolean {
|
|
192
|
-
visibleError.value = ''
|
|
193
|
-
if (props.maxCount != null && fileList.value.length + stagedExisting.length + files.length > props.maxCount) {
|
|
194
|
-
const message = `附件数量超出限制,最多允许 ${props.maxCount} 个文件`
|
|
195
|
-
warnUi(message); emit('exceed', { type: 'count', message, groupKey }); return false
|
|
196
|
-
}
|
|
197
|
-
const group = activeGroups.value.find(item => item.key === groupKey)
|
|
198
|
-
if (group?.maxCount != null) {
|
|
199
|
-
const stagedInGroup = stagedExisting.filter(file => file.groupKey === group.key).length
|
|
200
|
-
if (getGroupFiles(group.key).length + stagedInGroup + files.length > group.maxCount) {
|
|
201
|
-
const message = `分组「${group.label}」附件数量超出限制,最多允许 ${group.maxCount} 个文件`
|
|
202
|
-
warnUi(message); emit('exceed', { type: 'count', message, groupKey }); return false
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
if (props.maxSize != null) {
|
|
206
|
-
const maxBytes = props.maxSize * 1024 * 1024
|
|
207
|
-
const invalid = files.find(file => file.size > maxBytes)
|
|
208
|
-
if (invalid) {
|
|
209
|
-
const message = `文件「${invalid.name}」超出大小限制,最大允许 ${props.maxSize}MB`
|
|
210
|
-
emit('exceed', { type: 'size', message, groupKey }); emitError(message); return false
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return true
|
|
214
|
-
}
|
|
215
|
-
function normalizeFiles(files: File[], groupKey?: string): UploadFileItem[] {
|
|
216
|
-
const normalizedGroupKey = groupKey === UNGROUPED_KEY || !groupKey ? undefined : groupKey
|
|
217
|
-
return files.map(file => ({
|
|
218
|
-
id: `${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
219
|
-
name: file.name,
|
|
220
|
-
size: file.size,
|
|
221
|
-
type: inferTypeByNameAndType(file.name, file.type),
|
|
222
|
-
category: inferCategoryByNameAndType(file.name, file.type),
|
|
223
|
-
groupKey: normalizedGroupKey,
|
|
224
|
-
uploadedAt: formatNow(),
|
|
225
|
-
status: 'done',
|
|
226
|
-
progress: 100,
|
|
227
|
-
raw: file
|
|
228
|
-
}))
|
|
229
|
-
}
|
|
230
|
-
function openUploadModal() {
|
|
231
|
-
if (props.disabled) return
|
|
232
|
-
visibleError.value = ''
|
|
233
|
-
stagedDefaultGroupKey.value = uploadTargetKey.value || ''
|
|
234
|
-
stagedFiles.value = []
|
|
235
|
-
uploadModalOpen.value = true
|
|
236
|
-
}
|
|
237
|
-
function cancelUploadModal() {
|
|
238
|
-
stagedFiles.value = []
|
|
239
|
-
uploadModalOpen.value = false
|
|
240
|
-
if (inputRef.value) inputRef.value.value = ''
|
|
241
|
-
}
|
|
242
|
-
function triggerFileInput() {
|
|
243
|
-
if (isUploadDisabled()) return
|
|
244
|
-
if (inputRef.value) inputRef.value.accept = getUploadAccept()
|
|
245
|
-
inputRef.value?.click()
|
|
246
|
-
}
|
|
247
|
-
function handleInputChange(event: Event) {
|
|
248
|
-
try {
|
|
249
|
-
const input = event.target as HTMLInputElement
|
|
250
|
-
const files = input.files ? Array.from(input.files) : []
|
|
251
|
-
if (!files.length) return
|
|
252
|
-
const selected = props.multiple ? files : files.slice(0, 1)
|
|
253
|
-
const targetKey = stagedDefaultGroupKey.value || undefined
|
|
254
|
-
if (!validateFiles(selected, targetKey)) return
|
|
255
|
-
stagedFiles.value = [...stagedFiles.value, ...normalizeFiles(selected, targetKey)]
|
|
256
|
-
input.value = ''
|
|
257
|
-
} catch (error) { emitError('读取附件失败,请重新选择文件', error as Error) }
|
|
258
|
-
}
|
|
259
|
-
function updateStagedDefaultGroupKey(key: string) {
|
|
260
|
-
stagedDefaultGroupKey.value = key
|
|
261
|
-
localUploadTargetGroupKey.value = key
|
|
262
|
-
emit('update:uploadTargetGroupKey', key)
|
|
263
|
-
}
|
|
264
|
-
function updateStagedFileGroup(index: number, key: string) {
|
|
265
|
-
stagedFiles.value = stagedFiles.value.map((file, currentIndex) => currentIndex === index ? { ...file, groupKey: key === UNGROUPED_KEY || !key ? undefined : key } : file)
|
|
266
|
-
}
|
|
267
|
-
function removeStagedFile(index: number) {
|
|
268
|
-
stagedFiles.value = stagedFiles.value.filter((_, currentIndex) => currentIndex !== index)
|
|
269
|
-
}
|
|
270
|
-
function confirmUpload() {
|
|
271
|
-
if (props.disabled || !stagedFiles.value.length) return
|
|
272
|
-
const updated = [...fileList.value, ...stagedFiles.value]
|
|
273
|
-
emit('update:modelValue', updated); emit('change', updated)
|
|
274
|
-
stagedFiles.value = []
|
|
275
|
-
uploadModalOpen.value = false
|
|
276
|
-
}
|
|
277
|
-
function handleRemove(file: UploadFileItem, index: number) {
|
|
278
|
-
if (props.disabled) return
|
|
279
|
-
const updated = fileList.value.filter((_, currentIndex) => currentIndex !== index)
|
|
280
|
-
emit('update:modelValue', updated); emit('change', updated); emit('remove', { file, index, groupKey: file.groupKey })
|
|
281
|
-
openMoreFileId.value = null
|
|
282
|
-
}
|
|
283
|
-
function handlePreview(file: UploadFileItem, index: number) {
|
|
284
|
-
try { emit('preview', { file, index, groupKey: file.groupKey }); if (file.url) window.open(file.url, '_blank') }
|
|
285
|
-
catch (error) { emitError(`预览「${file.name}」失败`, error as Error) }
|
|
286
|
-
}
|
|
287
|
-
function handleDownload(file: UploadFileItem, index: number) {
|
|
288
|
-
try {
|
|
289
|
-
emit('download', { file, index, groupKey: file.groupKey })
|
|
290
|
-
if (!file.url) return
|
|
291
|
-
const a = document.createElement('a'); a.href = file.url; a.download = file.name; a.click()
|
|
292
|
-
} catch (error) { emitError(`下载「${file.name}」失败`, error as Error) }
|
|
293
|
-
}
|
|
294
|
-
function fileIdentity(file: UploadFileItem, index: number) { return file.id ?? `${file.name}-${index}` }
|
|
295
|
-
function toggleMore(file: UploadFileItem, index: number) {
|
|
296
|
-
const id = fileIdentity(file, index)
|
|
297
|
-
openMoreFileId.value = openMoreFileId.value === id ? null : id
|
|
298
|
-
}
|
|
299
|
-
function isMoreOpen(file: UploadFileItem, index: number) { return openMoreFileId.value === fileIdentity(file, index) }
|
|
300
|
-
|
|
301
|
-
function openGroupModal() {
|
|
302
|
-
groupModalOpen.value = true
|
|
303
|
-
groupFormError.value = ''
|
|
304
|
-
groupDraftNotice.value = ''
|
|
305
|
-
if (!groupFormKey.value) resetGroupDraft('add')
|
|
306
|
-
}
|
|
307
|
-
function closeGroupModal() { groupModalOpen.value = false }
|
|
308
|
-
function resetGroupDraft(mode: 'add' | 'edit' = 'add', group?: UploadGroup) {
|
|
309
|
-
groupDraftMode.value = mode
|
|
310
|
-
editingGroupKey.value = mode === 'edit' ? group?.key ?? null : null
|
|
311
|
-
groupFormKey.value = group?.key ?? ''
|
|
312
|
-
groupFormLabel.value = group?.label ?? (mode === 'add' ? props.defaultGroupLabel : '')
|
|
313
|
-
groupFormDescription.value = group?.description ?? ''
|
|
314
|
-
groupFormAccept.value = group?.accept ?? ''
|
|
315
|
-
groupFormMaxCount.value = group?.maxCount != null ? String(group.maxCount) : ''
|
|
316
|
-
groupFormError.value = ''
|
|
317
|
-
groupDraftNotice.value = ''
|
|
318
|
-
}
|
|
319
|
-
function editGroupDraft(group: UploadGroup) { resetGroupDraft('edit', group) }
|
|
320
|
-
function buildGroupDraft(): { mode: 'add' | 'edit'; group: UploadGroup; oldGroup?: UploadGroup } | null {
|
|
321
|
-
groupFormError.value = ''
|
|
322
|
-
if (!groupFormKey.value.trim()) { groupFormError.value = '分组标识不能为空'; return null }
|
|
323
|
-
if (!groupFormLabel.value.trim()) { groupFormError.value = '分组名称不能为空'; return null }
|
|
324
|
-
const maxCount = groupFormMaxCount.value.trim() ? Number(groupFormMaxCount.value) : undefined
|
|
325
|
-
if (maxCount != null && (!Number.isFinite(maxCount) || maxCount < 1)) { groupFormError.value = '最大数量必须是大于 0 的数字'; return null }
|
|
326
|
-
const group: UploadGroup = {
|
|
327
|
-
key: groupFormKey.value.trim(),
|
|
328
|
-
label: groupFormLabel.value.trim(),
|
|
329
|
-
description: groupFormDescription.value.trim() || undefined,
|
|
330
|
-
accept: groupFormAccept.value.trim() || undefined,
|
|
331
|
-
maxCount
|
|
332
|
-
}
|
|
333
|
-
const oldGroup = groupDraftMode.value === 'edit' ? activeGroups.value.find(g => g.key === editingGroupKey.value) : undefined
|
|
334
|
-
return { mode: groupDraftMode.value, group, oldGroup }
|
|
335
|
-
}
|
|
336
|
-
function saveGroupDraft() {
|
|
337
|
-
const draft = buildGroupDraft()
|
|
338
|
-
if (!draft) return false
|
|
339
|
-
savedGroupDrafts.value = [...savedGroupDrafts.value, draft]
|
|
340
|
-
groupDraftNotice.value = `已保存草稿:${draft.group.label}`
|
|
341
|
-
return true
|
|
342
|
-
}
|
|
343
|
-
function emitPendingChanges(changes: UploadGroupChange[]) {
|
|
344
|
-
localPendingGroupChanges.value = changes
|
|
345
|
-
emit('update:pendingGroupChanges', changes)
|
|
346
|
-
}
|
|
347
|
-
function createGroupChange(type: 'add' | 'edit', group: UploadGroup, oldGroup?: UploadGroup): UploadGroupChange {
|
|
348
|
-
return {
|
|
349
|
-
id: `${type}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
350
|
-
type,
|
|
351
|
-
group,
|
|
352
|
-
oldGroup,
|
|
353
|
-
status: 'pending',
|
|
354
|
-
applicant: props.currentUser ?? '当前用户',
|
|
355
|
-
appliedAt: formatNow()
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
function applyDraftDirectly(draft: { mode: 'add' | 'edit'; group: UploadGroup; oldGroup?: UploadGroup }) {
|
|
359
|
-
if (draft.mode === 'edit') {
|
|
360
|
-
emit('group-edit', { oldKey: draft.oldGroup?.key ?? draft.group.key, group: draft.group })
|
|
361
|
-
const updatedGroups = [...activeGroups.value]
|
|
362
|
-
const idx = updatedGroups.findIndex(g => g.key === (draft.oldGroup?.key ?? draft.group.key))
|
|
363
|
-
if (idx >= 0) updatedGroups[idx] = { ...updatedGroups[idx], ...draft.group }
|
|
364
|
-
else updatedGroups.push(draft.group)
|
|
365
|
-
internalGroups.value = updatedGroups; emit('update:groups', updatedGroups)
|
|
366
|
-
return
|
|
367
|
-
}
|
|
368
|
-
emit('group-add', draft.group)
|
|
369
|
-
const updatedGroups = [...activeGroups.value, draft.group]
|
|
370
|
-
internalGroups.value = updatedGroups; emit('update:groups', updatedGroups)
|
|
371
|
-
}
|
|
372
|
-
function submitGroupDraft(draft: { mode: 'add' | 'edit'; group: UploadGroup; oldGroup?: UploadGroup }) {
|
|
373
|
-
if (effectiveGroupApproval.value) {
|
|
374
|
-
const change = createGroupChange(draft.mode, draft.group, draft.oldGroup)
|
|
375
|
-
if (draft.mode === 'add') emit('group-add', draft.group)
|
|
376
|
-
else emit('group-edit', { oldKey: draft.oldGroup?.key ?? draft.group.key, group: draft.group })
|
|
377
|
-
emitPendingChanges([...localPendingGroupChanges.value, change]); emit('group-change-submit', change)
|
|
378
|
-
} else {
|
|
379
|
-
applyDraftDirectly(draft)
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function submitCurrentGroupDraft() {
|
|
383
|
-
const drafts = [...savedGroupDrafts.value]
|
|
384
|
-
const current = buildGroupDraft()
|
|
385
|
-
if (current) drafts.push(current)
|
|
386
|
-
if (!drafts.length) return
|
|
387
|
-
drafts.forEach(submitGroupDraft)
|
|
388
|
-
savedGroupDrafts.value = []
|
|
389
|
-
groupDraftNotice.value = effectiveGroupApproval.value ? '已提交审批,审批通过后生效' : '分组已更新'
|
|
390
|
-
}
|
|
391
|
-
function addAnotherGroupDraft() {
|
|
392
|
-
const draft = buildGroupDraft()
|
|
393
|
-
if (!draft) return
|
|
394
|
-
submitGroupDraft(draft)
|
|
395
|
-
resetGroupDraft('add')
|
|
396
|
-
groupFormLabel.value = ''
|
|
397
|
-
groupDraftNotice.value = '已生成待审批变更,可继续新增'
|
|
398
|
-
}
|
|
399
|
-
function removeGroup(groupKey: string) {
|
|
400
|
-
deleteGroupError.value = ''
|
|
401
|
-
const groupFiles = getGroupFiles(groupKey)
|
|
402
|
-
if (groupFiles.length > 0) {
|
|
403
|
-
const group = activeGroups.value.find(g => g.key === groupKey)
|
|
404
|
-
deleteGroupError.value = `分组「${group?.label ?? groupKey}」内有 ${groupFiles.length} 个文件,无法删除`
|
|
405
|
-
console.warn('[TfUpload]', deleteGroupError.value); return
|
|
406
|
-
}
|
|
407
|
-
emit('group-remove', groupKey)
|
|
408
|
-
internalGroups.value = activeGroups.value.filter(g => g.key !== groupKey)
|
|
409
|
-
emit('update:groups', internalGroups.value)
|
|
410
|
-
}
|
|
411
|
-
function applyGroupChangeToGroups(change: UploadGroupChange): UploadGroup[] {
|
|
412
|
-
if (change.type === 'add') return [...activeGroups.value, change.group]
|
|
413
|
-
const oldKey = change.oldGroup?.key ?? change.group.key
|
|
414
|
-
const updatedGroups = [...activeGroups.value]
|
|
415
|
-
const idx = updatedGroups.findIndex(g => g.key === oldKey)
|
|
416
|
-
if (idx >= 0) updatedGroups[idx] = { ...updatedGroups[idx], ...change.group }
|
|
417
|
-
else updatedGroups.push(change.group)
|
|
418
|
-
if (oldKey !== change.group.key) {
|
|
419
|
-
const updatedFiles = fileList.value.map(f => f.groupKey === oldKey ? { ...f, groupKey: change.group.key } : f)
|
|
420
|
-
emit('update:modelValue', updatedFiles); emit('change', updatedFiles)
|
|
421
|
-
}
|
|
422
|
-
return updatedGroups
|
|
423
|
-
}
|
|
424
|
-
function approveGroupChange(change: UploadGroupChange) {
|
|
425
|
-
const approved: UploadGroupChange = { ...change, status: 'approved', approver: props.currentUser ?? '当前用户', approvedAt: formatNow() }
|
|
426
|
-
const updatedGroups = applyGroupChangeToGroups(approved)
|
|
427
|
-
internalGroups.value = updatedGroups; emit('update:groups', updatedGroups)
|
|
428
|
-
completedGroupChanges.value = [approved, ...completedGroupChanges.value]
|
|
429
|
-
emitPendingChanges(localPendingGroupChanges.value.filter(item => item.id !== change.id))
|
|
430
|
-
emit('group-change-approve', approved)
|
|
431
|
-
}
|
|
432
|
-
function rejectGroupChange(change: UploadGroupChange) {
|
|
433
|
-
const rejected: UploadGroupChange = { ...change, status: 'rejected', approver: props.currentUser ?? '当前用户', approvedAt: formatNow() }
|
|
434
|
-
completedGroupChanges.value = [rejected, ...completedGroupChanges.value]
|
|
435
|
-
emitPendingChanges(localPendingGroupChanges.value.filter(item => item.id !== change.id))
|
|
436
|
-
emit('group-change-reject', rejected)
|
|
437
|
-
}
|
|
438
|
-
function moveFileToGroup(file: UploadFileItem, toGroupKey: string) {
|
|
439
|
-
const fromGroupKey = file.groupKey
|
|
440
|
-
const updatedFiles = fileList.value.map(f => f.id === file.id ? { ...f, groupKey: toGroupKey === UNGROUPED_KEY ? undefined : toGroupKey } : f)
|
|
441
|
-
emit('update:modelValue', updatedFiles); emit('change', updatedFiles); emit('move', { file, fromGroupKey, toGroupKey })
|
|
442
|
-
openMoreFileId.value = null
|
|
443
|
-
}
|
|
444
|
-
function createApprovalRecord(action: UploadApprovalRecord['action'], comment?: string): UploadApprovalRecord {
|
|
445
|
-
return { id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, action, operator: props.currentUser ?? '当前用户', operatedAt: formatNow(), comment }
|
|
446
|
-
}
|
|
447
|
-
function updateFileAndEmit(file: UploadFileItem, updates: Partial<UploadFileItem>) {
|
|
448
|
-
const updatedFiles = fileList.value.map(f => f.id === file.id ? { ...f, ...updates } : f)
|
|
449
|
-
emit('update:modelValue', updatedFiles); emit('change', updatedFiles)
|
|
450
|
-
}
|
|
451
|
-
function getApprovalComment(file: UploadFileItem): string { return approvalComments[file.id ?? file.name] ?? '' }
|
|
452
|
-
function setApprovalComment(file: UploadFileItem, comment: string) { approvalComments[file.id ?? file.name] = comment }
|
|
453
|
-
function handleApprovalSubmit(file: UploadFileItem) {
|
|
454
|
-
const record = createApprovalRecord('submit')
|
|
455
|
-
updateFileAndEmit(file, { approvalStatus: 'pending', approvalHistory: [...(file.approvalHistory ?? []), record] })
|
|
456
|
-
emit('approval-submit', { ...file, approvalStatus: 'pending' })
|
|
457
|
-
openMoreFileId.value = null
|
|
458
|
-
}
|
|
459
|
-
function handleApprovalApprove(file: UploadFileItem) {
|
|
460
|
-
const comment = getApprovalComment(file) || undefined
|
|
461
|
-
const record = createApprovalRecord('approve', comment)
|
|
462
|
-
updateFileAndEmit(file, { approvalStatus: 'approved', approver: props.currentUser ?? '当前用户', approvedAt: formatNow(), approvalComment: comment, approvalHistory: [...(file.approvalHistory ?? []), record] })
|
|
463
|
-
emit('approval-approve', { file, comment }); if (file.id) approvalComments[file.id] = ''
|
|
464
|
-
openMoreFileId.value = null
|
|
465
|
-
}
|
|
466
|
-
function handleApprovalReject(file: UploadFileItem) {
|
|
467
|
-
const comment = getApprovalComment(file) || undefined
|
|
468
|
-
const record = createApprovalRecord('reject', comment)
|
|
469
|
-
updateFileAndEmit(file, { approvalStatus: 'rejected', approvalComment: comment, approvalHistory: [...(file.approvalHistory ?? []), record] })
|
|
470
|
-
emit('approval-reject', { file, comment }); if (file.id) approvalComments[file.id] = ''
|
|
471
|
-
openMoreFileId.value = null
|
|
472
|
-
}
|
|
473
|
-
function handleApprovalSupplement(file: UploadFileItem) {
|
|
474
|
-
const comment = getApprovalComment(file) || undefined
|
|
475
|
-
const record = createApprovalRecord('request_supplement', comment)
|
|
476
|
-
updateFileAndEmit(file, { approvalStatus: 'supplement_required', approvalComment: comment, approvalHistory: [...(file.approvalHistory ?? []), record] })
|
|
477
|
-
emit('approval-supplement', { file, comment }); if (file.id) approvalComments[file.id] = ''
|
|
478
|
-
openMoreFileId.value = null
|
|
479
|
-
}
|
|
480
|
-
function formatApprovalActionLabel(action: UploadApprovalRecord['action']): string {
|
|
481
|
-
return ({ submit: '提交审批', approve: '通过', reject: '驳回', request_supplement: '要求补充' } as Record<UploadApprovalRecord['action'], string>)[action]
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// ============== AI 状态机集成 ==============
|
|
485
|
-
const aiEnabled = computed(() => !!props.ai)
|
|
486
|
-
const preset = computed(() => props.ai?.preset ?? 'complete')
|
|
487
|
-
|
|
488
|
-
const defaultLabels = computed(() => {
|
|
489
|
-
switch (preset.value) {
|
|
490
|
-
case 'check':
|
|
491
|
-
return { trigger: 'AI 质量检测', retry: '重新检测', confirm: '✓ 确认结果' }
|
|
492
|
-
case 'validate':
|
|
493
|
-
return { trigger: 'AI 校验附件', retry: '重新校验', confirm: '✓ 确认结果' }
|
|
494
|
-
case 'complete':
|
|
495
|
-
default:
|
|
496
|
-
return { trigger: 'AI 分类建议', retry: '重新建议', confirm: '✓ 应用' }
|
|
497
|
-
}
|
|
498
|
-
})
|
|
499
|
-
|
|
500
|
-
const triggerLabel = computed(() => props.ai?.triggerLabel ?? defaultLabels.value.trigger)
|
|
501
|
-
const retryLabel = computed(() => props.ai?.retryLabel ?? defaultLabels.value.retry)
|
|
502
|
-
const confirmLabel = computed(() => props.ai?.confirmLabel ?? defaultLabels.value.confirm)
|
|
503
|
-
|
|
504
|
-
const ai = useAiStateMachine({
|
|
505
|
-
needConfirm: props.ai?.needConfirm ?? true,
|
|
506
|
-
errorRate: props.ai?.errorRate ?? 0,
|
|
507
|
-
runningDuration: props.ai?.runningDuration ?? 1500,
|
|
508
|
-
autoReset: props.ai?.autoReset ?? 0
|
|
509
|
-
})
|
|
510
|
-
|
|
511
|
-
const aiStateLabels: Record<AiState, string> = {
|
|
512
|
-
idle: '空闲', running: 'AI 处理中', confirming: '⚠ 等待确认', done: '✓ 已完成', error: '✗ 失败'
|
|
513
|
-
}
|
|
514
|
-
const aiStateClasses: Record<AiState, string> = {
|
|
515
|
-
idle: 'tf-form-ai-state--idle', running: 'bg-[var(--info-50)] text-[var(--info-600)] animate-pulse',
|
|
516
|
-
confirming: 'bg-[var(--warning-50)] text-[var(--warning-700)]', done: 'bg-[var(--success-50)] text-[var(--success-700)]', error: 'bg-[var(--error-50)] text-[var(--error-600)]'
|
|
517
|
-
}
|
|
518
|
-
const aiStateLabel = computed(() => aiStateLabels[ai.state.value])
|
|
519
|
-
const aiStateClass = computed(() => aiStateClasses[ai.state.value])
|
|
520
|
-
|
|
521
|
-
const currentTriggerLabel = computed(() => {
|
|
522
|
-
const s = ai.state.value
|
|
523
|
-
if (s === 'error') return retryLabel.value
|
|
524
|
-
if (s === 'done') return retryLabel.value
|
|
525
|
-
return triggerLabel.value
|
|
526
|
-
})
|
|
527
|
-
|
|
528
|
-
const defaultApply = (result: any, current: UploadFileItem[]): UploadFileItem[] => {
|
|
529
|
-
if (result == null) return current
|
|
530
|
-
if (Array.isArray(result)) return result
|
|
531
|
-
if (typeof result.files === 'object' && Array.isArray(result.files)) return result.files
|
|
532
|
-
return current
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const applyAndConfirm = () => {
|
|
536
|
-
const result = ai.result.value
|
|
537
|
-
const applyFn = props.ai?.applyResult ?? defaultApply
|
|
538
|
-
const next = applyFn(result, fileList.value)
|
|
539
|
-
if (next !== fileList.value) {
|
|
540
|
-
emit('update:modelValue', next)
|
|
541
|
-
emit('change', next)
|
|
542
|
-
}
|
|
543
|
-
ai.confirm()
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
const handleAiTrigger = () => {
|
|
547
|
-
if (typeof props.ai?.onTrigger === 'function') {
|
|
548
|
-
ai.trigger(() => props.ai!.onTrigger(fileList.value))
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
let aiWatchTimer: ReturnType<typeof setTimeout> | null = null
|
|
553
|
-
const clearAiWatchTimer = () => {
|
|
554
|
-
if (aiWatchTimer) { clearTimeout(aiWatchTimer); aiWatchTimer = null }
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
watch(
|
|
558
|
-
() => [aiEnabled.value, props.ai?.mode, fileList.value] as const,
|
|
559
|
-
([enabled, mode]) => {
|
|
560
|
-
if (!enabled || mode !== 'watch') return
|
|
561
|
-
if (ai.busy.value) return
|
|
562
|
-
clearAiWatchTimer()
|
|
563
|
-
aiWatchTimer = setTimeout(() => { handleAiTrigger() }, 600)
|
|
564
|
-
}
|
|
565
|
-
)
|
|
566
|
-
|
|
567
|
-
watch(
|
|
568
|
-
() => ai.state.value,
|
|
569
|
-
(s) => {
|
|
570
|
-
if (!aiEnabled.value) return
|
|
571
|
-
emit('ai-state-change', s, ai.result.value, ai.error.value)
|
|
572
|
-
}
|
|
573
|
-
)
|
|
574
|
-
|
|
575
|
-
onUnmounted(() => { clearAiWatchTimer() })
|
|
576
|
-
</script>
|
|
577
|
-
|
|
578
|
-
<template>
|
|
579
|
-
<div class="tf-upload tf-upload-card tf-form-control">
|
|
580
|
-
<div class="tf-upload__card-header">
|
|
581
|
-
<div class="tf-upload__card-title-area">
|
|
582
|
-
<h3 class="tf-upload__card-title">{{ cardTitle }}</h3>
|
|
583
|
-
<p v-if="cardDescription" class="tf-upload__card-desc">{{ cardDescription }}</p>
|
|
584
|
-
<div v-if="showSummary" class="tf-upload__summary" aria-label="附件汇总">
|
|
585
|
-
<span class="tf-upload__summary-item">共 {{ fileList.length }} 个附件</span>
|
|
586
|
-
<span class="tf-upload__summary-item">待审批 {{ pendingTotalCount }} 项</span>
|
|
587
|
-
<span class="tf-upload__summary-item" :class="{ 'tf-upload__summary-item--danger': errorFileCount > 0 }">异常 {{ errorFileCount }} 项</span>
|
|
588
|
-
</div>
|
|
589
|
-
</div>
|
|
590
|
-
<div class="tf-upload__header-actions" aria-label="表单附件统一操作区">
|
|
591
|
-
<button type="button" class="tf-upload__button tf-upload__button--primary tf-upload__global-upload" :disabled="isUploadDisabled()" @click="openUploadModal">
|
|
592
|
-
{{ buttonText }}
|
|
593
|
-
</button>
|
|
594
|
-
<button type="button" class="tf-upload__button tf-upload__manage-groups" :disabled="disabled" @click="openGroupModal">管理分组</button>
|
|
595
|
-
<button type="button" class="tf-upload__button tf-upload__approval-entry" @click="approvalDrawerOpen = true">
|
|
596
|
-
审批记录 <span class="tf-upload__badge">{{ pendingTotalCount }}</span>
|
|
597
|
-
</button>
|
|
598
|
-
</div>
|
|
599
|
-
<!-- AI 状态栏 -->
|
|
600
|
-
<div
|
|
601
|
-
v-if="aiEnabled"
|
|
602
|
-
class="tf-upload__ai-bar flex items-center gap-2 mt-1.5 text-[10px] h-5 w-full"
|
|
603
|
-
>
|
|
604
|
-
<span class="flex items-center gap-2 min-w-0 flex-1 h-5">
|
|
605
|
-
<span :class="cn('px-2 py-0.5 rounded-full font-medium whitespace-nowrap shrink-0 inline-flex items-center leading-none h-5', aiStateClass)">
|
|
606
|
-
{{ aiStateLabel }}
|
|
607
|
-
</span>
|
|
608
|
-
<span v-if="ai.state.value === 'error' && ai.error.value" class="text-[var(--tf-color-error)] truncate min-w-0" :title="ai.error.value">
|
|
609
|
-
{{ ai.error.value }}
|
|
610
|
-
</span>
|
|
611
|
-
</span>
|
|
612
|
-
<span class="flex items-center gap-1.5 shrink-0 h-5">
|
|
613
|
-
<button
|
|
614
|
-
v-if="ai.state.value === 'idle' || ai.state.value === 'error' || ai.state.value === 'done'"
|
|
615
|
-
type="button"
|
|
616
|
-
:disabled="disabled"
|
|
617
|
-
class="px-2 py-0.5 rounded tf-form-ai-action--primary disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
618
|
-
@click="handleAiTrigger"
|
|
619
|
-
>
|
|
620
|
-
{{ currentTriggerLabel }}
|
|
621
|
-
</button>
|
|
622
|
-
<button
|
|
623
|
-
v-else-if="ai.state.value === 'confirming'"
|
|
624
|
-
type="button"
|
|
625
|
-
:disabled="disabled"
|
|
626
|
-
class="px-2 py-0.5 rounded tf-form-ai-action--success disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
627
|
-
@click="applyAndConfirm"
|
|
628
|
-
>
|
|
629
|
-
{{ confirmLabel }}
|
|
630
|
-
</button>
|
|
631
|
-
<button
|
|
632
|
-
v-else-if="ai.state.value === 'running'"
|
|
633
|
-
type="button"
|
|
634
|
-
:disabled="disabled"
|
|
635
|
-
class="px-2 py-0.5 rounded tf-form-ai-action--neutral disabled:opacity-50 disabled:cursor-not-allowed transition inline-flex items-center leading-none h-5"
|
|
636
|
-
@click="ai.reset()"
|
|
637
|
-
>
|
|
638
|
-
取消
|
|
639
|
-
</button>
|
|
640
|
-
</span>
|
|
641
|
-
</div>
|
|
642
|
-
</div>
|
|
643
|
-
|
|
644
|
-
<div class="tf-upload__card-body">
|
|
645
|
-
<template v-if="hasGroups">
|
|
646
|
-
<div class="tf-upload__groups">
|
|
647
|
-
<section v-for="group in displayGroups" :key="group.key" class="tf-upload__group">
|
|
648
|
-
<div class="tf-upload__group-head">
|
|
649
|
-
<div class="tf-upload__group-head-left">
|
|
650
|
-
<div class="tf-upload__group-title"><span>{{ group.label }}</span><span class="tf-upload__count">{{ getGroupFiles(group.key).length }} 个</span></div>
|
|
651
|
-
<p v-if="group.description" class="tf-upload__group-desc">{{ group.description }}</p>
|
|
652
|
-
</div>
|
|
653
|
-
</div>
|
|
654
|
-
<div v-if="getGroupFiles(group.key).length" class="tf-upload__list" role="list">
|
|
655
|
-
<div v-for="file in getGroupFiles(group.key)" :key="fileIdentity(file, getGlobalIndex(file))" class="tf-upload__file" role="listitem">
|
|
656
|
-
<slot name="file" :file="file" :index="getGlobalIndex(file)">
|
|
657
|
-
<span class="tf-upload__dot" :style="{ backgroundColor: getDotColor(file) }"></span>
|
|
658
|
-
<div class="tf-upload__file-main">
|
|
659
|
-
<div class="tf-upload__file-row">
|
|
660
|
-
<span class="tf-upload__file-name">{{ file.name }}</span>
|
|
661
|
-
<span class="tf-upload__status" :class="`tf-upload__status--${file.status ?? 'ready'}`">{{ statusLabel(file.status) }}</span>
|
|
662
|
-
<span v-if="approval && file.approvalStatus" class="tf-upload__approval-badge" :style="{ backgroundColor: APPROVAL_STATUS_COLOR[file.approvalStatus] + '20', color: APPROVAL_STATUS_COLOR[file.approvalStatus], borderColor: APPROVAL_STATUS_COLOR[file.approvalStatus] }">{{ APPROVAL_STATUS_LABEL[file.approvalStatus] }}</span>
|
|
663
|
-
</div>
|
|
664
|
-
<div class="tf-upload__meta">
|
|
665
|
-
<span v-if="showFileType" class="tf-upload__type">{{ getTypeLabel(file) }}</span>
|
|
666
|
-
<span>{{ formatFileSize(file.size) }}</span>
|
|
667
|
-
<span v-if="showUploadDate && formatUploadDate(file.uploadedAt)">{{ formatUploadDate(file.uploadedAt) }}</span>
|
|
668
|
-
</div>
|
|
669
|
-
<div v-if="showProgress && file.status === 'uploading'" class="tf-upload__progress"><div class="tf-upload__progress-bar" :style="{ width: `${file.progress ?? 0}%` }"></div></div>
|
|
670
|
-
<p v-if="file.status === 'error' && file.errorMessage" class="tf-upload__file-error">{{ file.errorMessage }}</p>
|
|
671
|
-
<input v-if="approval && file.approvalStatus === 'pending'" class="tf-upload__comment-input tf-upload__comment-input--inline" placeholder="审批意见..." :value="getApprovalComment(file)" @input="setApprovalComment(file, ($event.target as HTMLInputElement).value)" />
|
|
672
|
-
<div v-if="approval && showApprovalHistory && file.approvalHistory && file.approvalHistory.length" class="tf-upload__approval-history">
|
|
673
|
-
<div v-for="record in file.approvalHistory" :key="record.id" class="tf-upload__approval-record"><span class="tf-upload__approval-record-action">{{ formatApprovalActionLabel(record.action) }}</span><span>{{ record.operator }}</span><span>{{ formatUploadDate(record.operatedAt) }}</span><span v-if="record.comment">:{{ record.comment }}</span></div>
|
|
674
|
-
</div>
|
|
675
|
-
</div>
|
|
676
|
-
<div class="tf-upload__actions">
|
|
677
|
-
<button type="button" class="tf-upload__action" :aria-label="`预览 ${file.name}`" @click="handlePreview(file, getGlobalIndex(file))">预览</button>
|
|
678
|
-
<button type="button" class="tf-upload__action" :aria-label="`下载 ${file.name}`" @click="handleDownload(file, getGlobalIndex(file))">下载</button>
|
|
679
|
-
<div class="tf-upload__more-wrap">
|
|
680
|
-
<button type="button" class="tf-upload__action tf-upload__more-button" :aria-label="`更多 ${file.name}`" @click="toggleMore(file, getGlobalIndex(file))">更多</button>
|
|
681
|
-
<div v-if="isMoreOpen(file, getGlobalIndex(file))" class="tf-upload__more-menu">
|
|
682
|
-
<div v-if="allowMoveBetweenGroups" class="tf-upload__more-section">
|
|
683
|
-
<div class="tf-upload__more-title">移动到分组</div>
|
|
684
|
-
<button v-for="g in displayGroups" :key="g.key" type="button" class="tf-upload__more-item" :disabled="g.key === (file.groupKey ?? UNGROUPED_KEY)" @click="moveFileToGroup(file, g.key)">{{ g.label }}</button>
|
|
685
|
-
</div>
|
|
686
|
-
<template v-if="approval">
|
|
687
|
-
<button v-if="file.approvalStatus === undefined || file.approvalStatus === 'draft'" type="button" class="tf-upload__more-item" :aria-label="`提交审批 ${file.name}`" @click="handleApprovalSubmit(file)">提交审批</button>
|
|
688
|
-
<template v-if="file.approvalStatus === 'pending'">
|
|
689
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--success" :aria-label="`通过 ${file.name}`" @click="handleApprovalApprove(file)">通过</button>
|
|
690
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--danger" :aria-label="`驳回 ${file.name}`" @click="handleApprovalReject(file)">驳回</button>
|
|
691
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--warning" :aria-label="`要求补充 ${file.name}`" @click="handleApprovalSupplement(file)">要求补充</button>
|
|
692
|
-
</template>
|
|
693
|
-
<span v-if="file.approvalStatus === 'approved'" class="tf-upload__approval-done">已通过</span>
|
|
694
|
-
<span v-if="file.approvalStatus === 'rejected'" class="tf-upload__approval-done">已驳回</span>
|
|
695
|
-
<span v-if="file.approvalStatus === 'supplement_required'" class="tf-upload__approval-done">需补充</span>
|
|
696
|
-
</template>
|
|
697
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--danger" :disabled="disabled" :aria-label="`删除 ${file.name}`" @click="handleRemove(file, getGlobalIndex(file))">删除</button>
|
|
698
|
-
</div>
|
|
699
|
-
</div>
|
|
700
|
-
</div>
|
|
701
|
-
</slot>
|
|
702
|
-
</div>
|
|
703
|
-
</div>
|
|
704
|
-
<p v-else class="tf-upload__empty">暂无附件</p>
|
|
705
|
-
<p v-if="isGroupMaxedOut(group)" class="tf-upload__limit">本组最多上传 {{ group.maxCount }} 个附件</p>
|
|
706
|
-
</section>
|
|
707
|
-
</div>
|
|
708
|
-
</template>
|
|
709
|
-
|
|
710
|
-
<template v-else>
|
|
711
|
-
<section class="tf-upload__group tf-upload__group--plain">
|
|
712
|
-
<div class="tf-upload__group-head">
|
|
713
|
-
<div class="tf-upload__group-head-left">
|
|
714
|
-
<div class="tf-upload__group-title"><span>{{ flatListGroup.label }}</span><span class="tf-upload__count">{{ fileList.length }} 个</span></div>
|
|
715
|
-
<p class="tf-upload__group-desc">{{ flatListGroup.description }}</p>
|
|
716
|
-
</div>
|
|
717
|
-
</div>
|
|
718
|
-
<div v-if="fileList.length" class="tf-upload__list tf-upload__list--plain" role="list" aria-label="附件列表">
|
|
719
|
-
<div v-for="(file, index) in fileList" :key="fileIdentity(file, index)" class="tf-upload__file" role="listitem">
|
|
720
|
-
<slot name="file" :file="file" :index="index">
|
|
721
|
-
<span class="tf-upload__dot" :style="{ backgroundColor: getDotColor(file) }"></span>
|
|
722
|
-
<div class="tf-upload__file-main">
|
|
723
|
-
<div class="tf-upload__file-row">
|
|
724
|
-
<span class="tf-upload__file-name">{{ file.name }}</span>
|
|
725
|
-
<span class="tf-upload__status" :class="`tf-upload__status--${file.status ?? 'ready'}`">{{ statusLabel(file.status) }}</span>
|
|
726
|
-
<span v-if="approval && file.approvalStatus" class="tf-upload__approval-badge" :style="{ backgroundColor: APPROVAL_STATUS_COLOR[file.approvalStatus] + '20', color: APPROVAL_STATUS_COLOR[file.approvalStatus], borderColor: APPROVAL_STATUS_COLOR[file.approvalStatus] }">{{ APPROVAL_STATUS_LABEL[file.approvalStatus] }}</span>
|
|
727
|
-
</div>
|
|
728
|
-
<div class="tf-upload__meta"><span v-if="showFileType" class="tf-upload__type">{{ getTypeLabel(file) }}</span><span>{{ formatFileSize(file.size) }}</span><span v-if="showUploadDate && formatUploadDate(file.uploadedAt)">{{ formatUploadDate(file.uploadedAt) }}</span></div>
|
|
729
|
-
<div v-if="showProgress && file.status === 'uploading'" class="tf-upload__progress"><div class="tf-upload__progress-bar" :style="{ width: `${file.progress ?? 0}%` }"></div></div>
|
|
730
|
-
<p v-if="file.status === 'error' && file.errorMessage" class="tf-upload__file-error">{{ file.errorMessage }}</p>
|
|
731
|
-
<input v-if="approval && file.approvalStatus === 'pending'" class="tf-upload__comment-input tf-upload__comment-input--inline" placeholder="审批意见..." :value="getApprovalComment(file)" @input="setApprovalComment(file, ($event.target as HTMLInputElement).value)" />
|
|
732
|
-
<div v-if="approval && showApprovalHistory && file.approvalHistory && file.approvalHistory.length" class="tf-upload__approval-history">
|
|
733
|
-
<div v-for="record in file.approvalHistory" :key="record.id" class="tf-upload__approval-record"><span class="tf-upload__approval-record-action">{{ formatApprovalActionLabel(record.action) }}</span><span>{{ record.operator }}</span><span>{{ formatUploadDate(record.operatedAt) }}</span><span v-if="record.comment">:{{ record.comment }}</span></div>
|
|
734
|
-
</div>
|
|
735
|
-
</div>
|
|
736
|
-
<div class="tf-upload__actions">
|
|
737
|
-
<button type="button" class="tf-upload__action" :aria-label="`预览 ${file.name}`" @click="handlePreview(file, index)">预览</button>
|
|
738
|
-
<button type="button" class="tf-upload__action" :aria-label="`下载 ${file.name}`" @click="handleDownload(file, index)">下载</button>
|
|
739
|
-
<div class="tf-upload__more-wrap">
|
|
740
|
-
<button type="button" class="tf-upload__action tf-upload__more-button" :aria-label="`更多 ${file.name}`" @click="toggleMore(file, index)">更多</button>
|
|
741
|
-
<div v-if="isMoreOpen(file, index)" class="tf-upload__more-menu">
|
|
742
|
-
<template v-if="approval">
|
|
743
|
-
<button v-if="file.approvalStatus === undefined || file.approvalStatus === 'draft'" type="button" class="tf-upload__more-item" :aria-label="`提交审批 ${file.name}`" @click="handleApprovalSubmit(file)">提交审批</button>
|
|
744
|
-
<template v-if="file.approvalStatus === 'pending'">
|
|
745
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--success" :aria-label="`通过 ${file.name}`" @click="handleApprovalApprove(file)">通过</button>
|
|
746
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--danger" :aria-label="`驳回 ${file.name}`" @click="handleApprovalReject(file)">驳回</button>
|
|
747
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--warning" :aria-label="`要求补充 ${file.name}`" @click="handleApprovalSupplement(file)">要求补充</button>
|
|
748
|
-
</template>
|
|
749
|
-
<span v-if="file.approvalStatus === 'approved'" class="tf-upload__approval-done">已通过</span>
|
|
750
|
-
<span v-if="file.approvalStatus === 'rejected'" class="tf-upload__approval-done">已驳回</span>
|
|
751
|
-
<span v-if="file.approvalStatus === 'supplement_required'" class="tf-upload__approval-done">需补充</span>
|
|
752
|
-
</template>
|
|
753
|
-
<button type="button" class="tf-upload__more-item tf-upload__more-item--danger" :disabled="disabled" :aria-label="`删除 ${file.name}`" @click="handleRemove(file, index)">删除</button>
|
|
754
|
-
</div>
|
|
755
|
-
</div>
|
|
756
|
-
</div>
|
|
757
|
-
</slot>
|
|
758
|
-
</div>
|
|
759
|
-
</div>
|
|
760
|
-
<p v-else class="tf-upload__empty tf-upload__empty--plain">暂无附件</p>
|
|
761
|
-
</section>
|
|
762
|
-
</template>
|
|
763
|
-
</div>
|
|
764
|
-
|
|
765
|
-
<div v-if="visibleError || totalMaxedOut || deleteGroupError" class="tf-upload__card-footer">
|
|
766
|
-
<div v-if="visibleError" class="tf-upload__error" role="alert">{{ visibleError }}</div>
|
|
767
|
-
<div v-if="deleteGroupError" class="tf-upload__error" role="alert">{{ deleteGroupError }}</div>
|
|
768
|
-
<p v-if="totalMaxedOut" class="tf-upload__limit">最多上传 {{ maxCount }} 个附件</p>
|
|
769
|
-
</div>
|
|
770
|
-
|
|
771
|
-
<div v-if="uploadModalOpen" class="tf-upload__overlay" role="dialog" aria-modal="true" aria-label="上传附件 Modal">
|
|
772
|
-
<div class="tf-upload__modal tf-upload__upload-modal">
|
|
773
|
-
<div class="tf-upload__modal-header">
|
|
774
|
-
<div><h4>上传附件</h4><p>先选择文件和归属分组,确认后才写入表单附件。</p></div>
|
|
775
|
-
<button type="button" class="tf-upload__icon-button" aria-label="关闭上传附件" @click="cancelUploadModal">×</button>
|
|
776
|
-
</div>
|
|
777
|
-
<div class="tf-upload__modal-body">
|
|
778
|
-
<div class="tf-upload__picker">
|
|
779
|
-
<button type="button" class="tf-upload__button" :disabled="isUploadDisabled()" @click="triggerFileInput">{{ stagedFiles.length ? '继续添加' : '选择文件' }}</button>
|
|
780
|
-
<span class="tf-upload__picker-tip">{{ stagedFiles.length ? `已暂存 ${stagedFiles.length} 个文件` : '尚未选择文件' }}</span>
|
|
781
|
-
</div>
|
|
782
|
-
<div v-if="stagedFiles.length" class="tf-upload__staged-list">
|
|
783
|
-
<div v-for="(file, index) in stagedFiles" :key="file.id" class="tf-upload__staged-item">
|
|
784
|
-
<span class="tf-upload__dot" :style="{ backgroundColor: getDotColor(file) }"></span>
|
|
785
|
-
<div class="tf-upload__file-main"><strong>{{ file.name }}</strong><div class="tf-upload__meta">{{ formatFileSize(file.size) }} / {{ getTypeLabel(file) }}</div></div>
|
|
786
|
-
<select v-if="hasGroups" class="tf-upload__target-select tf-upload__staged-group" :value="file.groupKey ?? ''" @change="updateStagedFileGroup(index, ($event.target as HTMLSelectElement).value)">
|
|
787
|
-
<option value="">未分组</option>
|
|
788
|
-
<option v-for="group in activeGroups" :key="group.key" :value="group.key" :disabled="group.disabled">{{ group.label }}</option>
|
|
789
|
-
</select>
|
|
790
|
-
<button type="button" class="tf-upload__action tf-upload__action--danger" :aria-label="`移除暂存 ${file.name}`" @click="removeStagedFile(index)">移除</button>
|
|
791
|
-
</div>
|
|
792
|
-
</div>
|
|
793
|
-
<p v-else class="tf-upload__empty">Modal 内选择文件后仅进入暂存列表,不会立即更新 modelValue。</p>
|
|
794
|
-
<div v-if="visibleError" class="tf-upload__error" role="alert">{{ visibleError }}</div>
|
|
795
|
-
</div>
|
|
796
|
-
<div class="tf-upload__modal-footer">
|
|
797
|
-
<button type="button" class="tf-upload__button" @click="cancelUploadModal">取消</button>
|
|
798
|
-
<button type="button" class="tf-upload__button tf-upload__button--primary tf-upload__confirm-upload" :disabled="!stagedFiles.length || disabled" @click="confirmUpload">确认上传</button>
|
|
799
|
-
</div>
|
|
800
|
-
</div>
|
|
801
|
-
</div>
|
|
802
|
-
|
|
803
|
-
<div v-if="groupModalOpen" class="tf-upload__overlay" role="dialog" aria-modal="true" aria-label="管理分组 Modal">
|
|
804
|
-
<div class="tf-upload__modal tf-upload__group-modal">
|
|
805
|
-
<div class="tf-upload__modal-header">
|
|
806
|
-
<div><h4>管理分组</h4><p>新增/编辑分组可先保存草稿;提交审批后按配置生效。</p></div>
|
|
807
|
-
<button type="button" class="tf-upload__icon-button" aria-label="关闭管理分组" @click="closeGroupModal">×</button>
|
|
808
|
-
</div>
|
|
809
|
-
<div class="tf-upload__modal-body tf-upload__group-manager">
|
|
810
|
-
<div class="tf-upload__group-list-panel">
|
|
811
|
-
<div class="tf-upload__panel-title">现有分组</div>
|
|
812
|
-
<button type="button" class="tf-upload__button tf-upload__button--small" @click="resetGroupDraft('add')">新增分组</button>
|
|
813
|
-
<div v-if="activeGroups.length" class="tf-upload__group-list">
|
|
814
|
-
<div v-for="group in activeGroups" :key="group.key" class="tf-upload__group-list-item">
|
|
815
|
-
<div><strong>{{ group.label }}</strong><span>{{ group.key }}</span><p v-if="group.description">{{ group.description }}</p></div>
|
|
816
|
-
<div class="tf-upload__group-list-actions">
|
|
817
|
-
<button type="button" class="tf-upload__action" aria-label="编辑分组" @click="editGroupDraft(group)">编辑</button>
|
|
818
|
-
<button v-if="group.removable !== false" type="button" class="tf-upload__action tf-upload__action--danger" aria-label="删除分组" @click="removeGroup(group.key)">删除</button>
|
|
819
|
-
</div>
|
|
820
|
-
</div>
|
|
821
|
-
</div>
|
|
822
|
-
<p v-else class="tf-upload__empty">暂无分组</p>
|
|
823
|
-
</div>
|
|
824
|
-
<div class="tf-upload__group-form">
|
|
825
|
-
<div class="tf-upload__group-form-title">{{ groupDraftMode === 'edit' ? '编辑分组' : '新增分组' }}{{ effectiveGroupApproval ? '(审批通过后生效)' : '' }}</div>
|
|
826
|
-
<label class="tf-upload__field"><span>标识</span><input class="tf-upload__group-form-input tf-upload__group-key-input" v-model="groupFormKey" placeholder="如:contract" :disabled="groupDraftMode === 'edit'" /></label>
|
|
827
|
-
<label class="tf-upload__field"><span>名称</span><input class="tf-upload__group-form-input tf-upload__group-label-input" v-model="groupFormLabel" placeholder="如:合同附件" /></label>
|
|
828
|
-
<label class="tf-upload__field"><span>说明</span><input class="tf-upload__group-form-input tf-upload__group-description-input" v-model="groupFormDescription" placeholder="可选" /></label>
|
|
829
|
-
<label class="tf-upload__field"><span>允许类型</span><input class="tf-upload__group-form-input tf-upload__group-accept-input" v-model="groupFormAccept" placeholder="如:.pdf,.docx 或 image/*" /></label>
|
|
830
|
-
<label class="tf-upload__field"><span>最大数量</span><input class="tf-upload__group-form-input tf-upload__group-max-count-input" v-model="groupFormMaxCount" placeholder="可选,如:5" /></label>
|
|
831
|
-
<div v-if="groupFormError" class="tf-upload__error" role="alert">{{ groupFormError }}</div>
|
|
832
|
-
<div v-if="deleteGroupError" class="tf-upload__error" role="alert">{{ deleteGroupError }}</div>
|
|
833
|
-
<div v-if="groupDraftNotice" class="tf-upload__notice">{{ groupDraftNotice }}</div>
|
|
834
|
-
<div class="tf-upload__group-form-actions">
|
|
835
|
-
<button type="button" class="tf-upload__button tf-upload__button--small" @click="saveGroupDraft">保存草稿</button>
|
|
836
|
-
<button type="button" class="tf-upload__button tf-upload__button--small tf-upload__add-another" @click="addAnotherGroupDraft">连续新增</button>
|
|
837
|
-
<button type="button" class="tf-upload__button tf-upload__button--small tf-upload__button--primary tf-upload__submit-group-approval" @click="submitCurrentGroupDraft">提交审批</button>
|
|
838
|
-
</div>
|
|
839
|
-
</div>
|
|
840
|
-
</div>
|
|
841
|
-
<div class="tf-upload__modal-footer"><button type="button" class="tf-upload__button" @click="closeGroupModal">关闭</button></div>
|
|
842
|
-
</div>
|
|
843
|
-
</div>
|
|
844
|
-
|
|
845
|
-
<div v-if="approvalDrawerOpen" class="tf-upload__drawer-mask" role="dialog" aria-modal="true" aria-label="审批记录 Drawer">
|
|
846
|
-
<aside class="tf-upload__drawer">
|
|
847
|
-
<div class="tf-upload__drawer-header">
|
|
848
|
-
<div><h4>审批记录</h4><p>查看待审批与已完成的分组变更。</p></div>
|
|
849
|
-
<button type="button" class="tf-upload__icon-button" aria-label="关闭审批记录" @click="approvalDrawerOpen = false">×</button>
|
|
850
|
-
</div>
|
|
851
|
-
<div class="tf-upload__drawer-body">
|
|
852
|
-
<section class="tf-upload__approval-section">
|
|
853
|
-
<h5>待审批</h5>
|
|
854
|
-
<div v-if="pendingGroups.length" class="tf-upload__pending-groups" aria-label="待审批分组变更">
|
|
855
|
-
<div v-for="change in pendingGroups" :key="change.id" class="tf-upload__pending-item">
|
|
856
|
-
<div>
|
|
857
|
-
<span class="tf-upload__pending-type">{{ GROUP_CHANGE_LABEL[change.type] }}</span>
|
|
858
|
-
<strong>{{ change.group.label }}</strong>
|
|
859
|
-
<span class="tf-upload__pending-meta">{{ change.group.key }} / {{ change.applicant || '当前用户' }} / {{ formatUploadDate(change.appliedAt) }}</span>
|
|
860
|
-
<p v-if="change.comment" class="tf-upload__pending-desc">{{ change.comment }}</p>
|
|
861
|
-
<p v-else-if="change.group.description" class="tf-upload__pending-desc">{{ change.group.description }}</p>
|
|
862
|
-
</div>
|
|
863
|
-
<div class="tf-upload__pending-actions">
|
|
864
|
-
<button type="button" class="tf-upload__action tf-upload__action--success" :aria-label="`通过分组变更 ${change.group.label}`" @click="approveGroupChange(change)">通过</button>
|
|
865
|
-
<button type="button" class="tf-upload__action tf-upload__action--danger" :aria-label="`驳回分组变更 ${change.group.label}`" @click="rejectGroupChange(change)">驳回</button>
|
|
866
|
-
</div>
|
|
867
|
-
</div>
|
|
868
|
-
</div>
|
|
869
|
-
<p v-else class="tf-upload__empty">暂无待审批变更</p>
|
|
870
|
-
</section>
|
|
871
|
-
<section class="tf-upload__approval-section">
|
|
872
|
-
<h5>已完成</h5>
|
|
873
|
-
<div v-if="completedGroupChanges.length" class="tf-upload__completed-list">
|
|
874
|
-
<div v-for="change in completedGroupChanges" :key="`${change.id}-${change.status}`" class="tf-upload__completed-item">
|
|
875
|
-
{{ GROUP_CHANGE_LABEL[change.type] }} / {{ change.group.label }} / {{ change.status === 'approved' ? '已通过' : '已驳回' }} / {{ change.approver }} / {{ formatUploadDate(change.approvedAt) }}
|
|
876
|
-
</div>
|
|
877
|
-
</div>
|
|
878
|
-
<p v-else class="tf-upload__empty">暂无已完成记录</p>
|
|
879
|
-
</section>
|
|
880
|
-
</div>
|
|
881
|
-
</aside>
|
|
882
|
-
</div>
|
|
883
|
-
|
|
884
|
-
<input ref="inputRef" type="file" class="tf-upload__input" :accept="getUploadAccept()" :multiple="multiple" :disabled="disabled" @change="handleInputChange" />
|
|
885
|
-
</div>
|
|
886
|
-
</template>
|
|
887
|
-
|
|
888
|
-
<style scoped>
|
|
889
|
-
@import '../styles/upload.css';
|
|
890
|
-
</style>
|