create-yss-spec 2.2.0 → 2.2.1
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/README.md +1 -1
- package/package.json +1 -1
- package/template/.agents/rules/yss-ai-skills.md +59 -0
- package/template/.agents/skills/.yss-skills-manifest.json +28 -0
- package/template/.agents/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.agents/skills/file-export-download/SKILL.md +160 -0
- package/template/.agents/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.agents/skills/formily-foundation/SKILL.md +176 -0
- package/template/.agents/skills/formily-foundation/references/examples.md +486 -0
- package/template/.agents/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.agents/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.agents/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.agents/skills/frontend-commit/SKILL.md +118 -0
- package/template/.agents/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.agents/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.agents/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.agents/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.agents/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.agents/skills/page-form-module/SKILL.md +168 -0
- package/template/.agents/skills/page-list-module/SKILL.md +137 -0
- package/template/.agents/skills/page-skeleton/SKILL.md +76 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.agents/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.agents/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.agents/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.agents/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.agents/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.agents/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.agents/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.agents/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.agents/skills/yss-components/SKILL.md +1 -1
- package/template/.agents/skills/yss-design-system/SKILL.md +1 -1
- package/template/.agents/skills/yss-formily/SKILL.md +233 -265
- package/template/.agents/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.agents/skills/yss-hook/SKILL.md +1 -1
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.agents/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.agents/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.agents/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.agents/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.agents/skills/yss-router/references/boundaries.md +1 -1
- package/template/.agents/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.agents/skills/yss-ui/SKILL.md +1 -1
- package/template/.agents/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.agents/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.agents/skills/ytable-usage/SKILL.md +251 -0
- package/template/.agents/skills/ytree-usage/SKILL.md +132 -0
- package/template/.claude/skills/.yss-skills-manifest.json +29 -0
- package/template/.claude/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.claude/skills/file-export-download/SKILL.md +160 -0
- package/template/.claude/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.claude/skills/formily-foundation/SKILL.md +176 -0
- package/template/.claude/skills/formily-foundation/references/examples.md +486 -0
- package/template/.claude/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.claude/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.claude/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.claude/skills/frontend-commit/SKILL.md +118 -0
- package/template/.claude/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.claude/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.claude/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.claude/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.claude/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.claude/skills/page-form-module/SKILL.md +168 -0
- package/template/.claude/skills/page-list-module/SKILL.md +137 -0
- package/template/.claude/skills/page-skeleton/SKILL.md +76 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.claude/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.claude/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.claude/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.claude/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.claude/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.claude/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.claude/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.claude/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.claude/skills/yss-components/SKILL.md +1 -1
- package/template/.claude/skills/yss-design-system/SKILL.md +1 -1
- package/template/.claude/skills/yss-formily/SKILL.md +233 -265
- package/template/.claude/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.claude/skills/yss-hook/SKILL.md +1 -1
- package/template/.claude/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.claude/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.claude/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.claude/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.claude/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.claude/skills/yss-router/references/boundaries.md +1 -1
- package/template/.claude/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.claude/skills/yss-ui/SKILL.md +1 -1
- package/template/.claude/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.claude/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.claude/skills/ytable-usage/SKILL.md +251 -0
- package/template/.claude/skills/ytree-usage/SKILL.md +132 -0
- package/template/.codex/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.codex/skills/file-export-download/SKILL.md +160 -0
- package/template/.codex/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.codex/skills/formily-foundation/SKILL.md +176 -0
- package/template/.codex/skills/formily-foundation/references/examples.md +486 -0
- package/template/.codex/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.codex/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.codex/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.codex/skills/frontend-commit/SKILL.md +118 -0
- package/template/.codex/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.codex/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.codex/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.codex/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.codex/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.codex/skills/page-form-module/SKILL.md +168 -0
- package/template/.codex/skills/page-list-module/SKILL.md +137 -0
- package/template/.codex/skills/page-skeleton/SKILL.md +76 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.codex/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.codex/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.codex/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.codex/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.codex/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.codex/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.codex/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.codex/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.codex/skills/yss-components/SKILL.md +1 -1
- package/template/.codex/skills/yss-design-system/SKILL.md +1 -1
- package/template/.codex/skills/yss-formily/SKILL.md +233 -265
- package/template/.codex/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.codex/skills/yss-hook/SKILL.md +1 -1
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.codex/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.codex/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.codex/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.codex/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.codex/skills/yss-router/references/boundaries.md +1 -1
- package/template/.codex/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.codex/skills/yss-ui/SKILL.md +1 -1
- package/template/.codex/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.codex/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.codex/skills/ytable-usage/SKILL.md +251 -0
- package/template/.codex/skills/ytree-usage/SKILL.md +132 -0
- package/template/.cursor/skills/.yss-skills-manifest.json +29 -0
- package/template/.cursor/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.cursor/skills/file-export-download/SKILL.md +160 -0
- package/template/.cursor/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.cursor/skills/formily-foundation/SKILL.md +176 -0
- package/template/.cursor/skills/formily-foundation/references/examples.md +486 -0
- package/template/.cursor/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.cursor/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.cursor/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.cursor/skills/frontend-commit/SKILL.md +118 -0
- package/template/.cursor/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.cursor/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.cursor/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.cursor/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.cursor/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.cursor/skills/page-form-module/SKILL.md +168 -0
- package/template/.cursor/skills/page-list-module/SKILL.md +137 -0
- package/template/.cursor/skills/page-skeleton/SKILL.md +76 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.cursor/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.cursor/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.cursor/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.cursor/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.cursor/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.cursor/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.cursor/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.cursor/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.cursor/skills/yss-components/SKILL.md +1 -1
- package/template/.cursor/skills/yss-design-system/SKILL.md +1 -1
- package/template/.cursor/skills/yss-formily/SKILL.md +233 -265
- package/template/.cursor/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.cursor/skills/yss-hook/SKILL.md +1 -1
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.cursor/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.cursor/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.cursor/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.cursor/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.cursor/skills/yss-router/references/boundaries.md +1 -1
- package/template/.cursor/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.cursor/skills/yss-ui/SKILL.md +1 -1
- package/template/.cursor/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.cursor/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.cursor/skills/ytable-usage/SKILL.md +251 -0
- package/template/.cursor/skills/ytree-usage/SKILL.md +132 -0
- package/template/.cursorrules +32 -0
- package/template/.hermes/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.hermes/skills/file-export-download/SKILL.md +160 -0
- package/template/.hermes/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.hermes/skills/formily-foundation/SKILL.md +176 -0
- package/template/.hermes/skills/formily-foundation/references/examples.md +486 -0
- package/template/.hermes/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.hermes/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.hermes/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.hermes/skills/frontend-commit/SKILL.md +118 -0
- package/template/.hermes/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.hermes/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.hermes/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.hermes/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.hermes/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.hermes/skills/page-form-module/SKILL.md +168 -0
- package/template/.hermes/skills/page-list-module/SKILL.md +137 -0
- package/template/.hermes/skills/page-skeleton/SKILL.md +76 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.hermes/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.hermes/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.hermes/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.hermes/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.hermes/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.hermes/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.hermes/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.hermes/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.hermes/skills/yss-components/SKILL.md +1 -1
- package/template/.hermes/skills/yss-design-system/SKILL.md +1 -1
- package/template/.hermes/skills/yss-formily/SKILL.md +233 -265
- package/template/.hermes/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.hermes/skills/yss-hook/SKILL.md +1 -1
- package/template/.hermes/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.hermes/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.hermes/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.hermes/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.hermes/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.hermes/skills/yss-router/references/boundaries.md +1 -1
- package/template/.hermes/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.hermes/skills/yss-ui/SKILL.md +1 -1
- package/template/.hermes/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.hermes/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.hermes/skills/ytable-usage/SKILL.md +251 -0
- package/template/.hermes/skills/ytree-usage/SKILL.md +132 -0
- package/template/.pi/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.pi/skills/file-export-download/SKILL.md +160 -0
- package/template/.pi/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.pi/skills/formily-foundation/SKILL.md +176 -0
- package/template/.pi/skills/formily-foundation/references/examples.md +486 -0
- package/template/.pi/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.pi/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.pi/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.pi/skills/frontend-commit/SKILL.md +118 -0
- package/template/.pi/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.pi/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.pi/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.pi/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.pi/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.pi/skills/page-form-module/SKILL.md +168 -0
- package/template/.pi/skills/page-list-module/SKILL.md +137 -0
- package/template/.pi/skills/page-skeleton/SKILL.md +76 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.pi/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.pi/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.pi/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.pi/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.pi/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.pi/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.pi/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.pi/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.pi/skills/yss-components/SKILL.md +1 -1
- package/template/.pi/skills/yss-design-system/SKILL.md +1 -1
- package/template/.pi/skills/yss-formily/SKILL.md +233 -265
- package/template/.pi/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.pi/skills/yss-hook/SKILL.md +1 -1
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.pi/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.pi/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.pi/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.pi/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.pi/skills/yss-router/references/boundaries.md +1 -1
- package/template/.pi/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.pi/skills/yss-ui/SKILL.md +1 -1
- package/template/.pi/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.pi/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.pi/skills/ytable-usage/SKILL.md +251 -0
- package/template/.pi/skills/ytree-usage/SKILL.md +132 -0
- package/template/.qoder/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.qoder/skills/file-export-download/SKILL.md +160 -0
- package/template/.qoder/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.qoder/skills/formily-foundation/SKILL.md +176 -0
- package/template/.qoder/skills/formily-foundation/references/examples.md +486 -0
- package/template/.qoder/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.qoder/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.qoder/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.qoder/skills/frontend-commit/SKILL.md +118 -0
- package/template/.qoder/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.qoder/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.qoder/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.qoder/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.qoder/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.qoder/skills/page-form-module/SKILL.md +168 -0
- package/template/.qoder/skills/page-list-module/SKILL.md +137 -0
- package/template/.qoder/skills/page-skeleton/SKILL.md +76 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.qoder/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.qoder/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.qoder/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.qoder/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.qoder/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.qoder/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.qoder/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.qoder/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.qoder/skills/yss-components/SKILL.md +1 -1
- package/template/.qoder/skills/yss-design-system/SKILL.md +1 -1
- package/template/.qoder/skills/yss-formily/SKILL.md +233 -265
- package/template/.qoder/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.qoder/skills/yss-hook/SKILL.md +1 -1
- package/template/.qoder/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.qoder/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.qoder/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.qoder/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.qoder/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.qoder/skills/yss-router/references/boundaries.md +1 -1
- package/template/.qoder/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.qoder/skills/yss-ui/SKILL.md +1 -1
- package/template/.qoder/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.qoder/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.qoder/skills/ytable-usage/SKILL.md +251 -0
- package/template/.qoder/skills/ytree-usage/SKILL.md +132 -0
- package/template/.trae/skills/.yss-skills-manifest.json +29 -0
- package/template/.trae/skills/component-selection-imports/SKILL.md +64 -0
- package/template/.trae/skills/file-export-download/SKILL.md +160 -0
- package/template/.trae/skills/file-export-download/agents/openai.yaml +4 -0
- package/template/.trae/skills/formily-foundation/SKILL.md +176 -0
- package/template/.trae/skills/formily-foundation/references/examples.md +486 -0
- package/template/.trae/skills/formily-linkage-effects/SKILL.md +167 -0
- package/template/.trae/skills/formily-mode-slot-detail/SKILL.md +137 -0
- package/template/.trae/skills/formily-step-flow/SKILL.md +194 -0
- package/template/.trae/skills/frontend-commit/SKILL.md +118 -0
- package/template/.trae/skills/frontend-commit/agents/openai.yaml +7 -0
- package/template/.trae/skills/frontend-commit/references/scope-and-examples.md +111 -0
- package/template/.trae/skills/java-backend-commit/SKILL.md +121 -0
- package/template/.trae/skills/java-backend-commit/agents/openai.yaml +7 -0
- package/template/.trae/skills/java-backend-commit/references/scope-and-examples.md +118 -0
- package/template/.trae/skills/page-form-module/SKILL.md +168 -0
- package/template/.trae/skills/page-list-module/SKILL.md +137 -0
- package/template/.trae/skills/page-skeleton/SKILL.md +76 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/constant.ts +34 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/hooks/useRuleConfig.ts +75 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/index.vue +107 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/schemas/ruleConfigSchema.ts +256 -0
- package/template/.trae/skills/page-skeleton/examples/AdvancedFormPage/style.less +30 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/constant.ts +28 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useQualityRuleList.ts +58 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/hooks/useRuleActions.ts +65 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/index.vue +91 -0
- package/template/.trae/skills/page-skeleton/examples/StandardListPage/style.less +49 -0
- package/template/.trae/skills/prototype-page-acceptance/SKILL.md +62 -0
- package/template/.trae/skills/theme-token-usage/SKILL.md +123 -0
- package/template/.trae/skills/theme-token-usage/agents/openai.yaml +4 -0
- package/template/.trae/skills/vue3-best-practices/SKILL.md +68 -0
- package/template/.trae/skills/yedit-table-usage/SKILL.md +227 -0
- package/template/.trae/skills/yss-api-integration/SKILL.md +12 -2
- package/template/.trae/skills/yss-components/SKILL.md +1 -1
- package/template/.trae/skills/yss-design-system/SKILL.md +1 -1
- package/template/.trae/skills/yss-formily/SKILL.md +233 -265
- package/template/.trae/skills/yss-frontend-scaffold-generator/SKILL.md +1 -1
- package/template/.trae/skills/yss-hook/SKILL.md +1 -1
- package/template/.trae/skills/yss-openapi-governance/SKILL.md +2 -2
- package/template/.trae/skills/yss-page-module-development/SKILL.md +12 -2
- package/template/.trae/skills/yss-page-module-development/references/component-map.md +34 -0
- package/template/.trae/skills/yss-page-module-development/references/hooks-map.md +11 -0
- package/template/.trae/skills/yss-page-module-development/references/utils-map.md +14 -0
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +62 -1
- package/template/.trae/skills/yss-router/references/boundaries.md +1 -1
- package/template/.trae/skills/yss-router/references/router-contract.yaml +6 -2
- package/template/.trae/skills/yss-ui/SKILL.md +1 -1
- package/template/.trae/skills/yss-use-table-height/SKILL.md +9 -0
- package/template/.trae/skills/yss-use-tree-height/SKILL.md +9 -0
- package/template/.trae/skills/ytable-usage/SKILL.md +251 -0
- package/template/.trae/skills/ytree-usage/SKILL.md +132 -0
- package/template/docs/agents/skill-migrations.md +16 -0
- package/template/docs/agents/skills-maintenance.md +1 -1
- package/template/docs/agents/yss-skill-registry.yaml +125 -25
- package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +4 -4
- package/template/docs/user-guide//347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +1 -1
- package/template/scripts/lib/scenario-checks.mjs +21 -0
- package/template/scripts/lib/skill-governance.mjs +50 -0
- package/template/scripts/lib/skill-registry.mjs +82 -5
- package/template/scripts/lib/skill-supply-chain.mjs +5 -1
- package/template/scripts/verify-skill-governance +10 -0
- package/template/scripts/verify-template +3 -2
- package/template/skills-lock.json +285 -29
- package/template.snapshot.json +4 -4
- package/template/.agents/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.agents/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-formily/references/examples.md +0 -65
- package/template/.claude/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.claude/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.claude/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.claude/skills/yss-formily/references/examples.md +0 -65
- package/template/.codex/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.codex/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-formily/references/examples.md +0 -65
- package/template/.cursor/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.cursor/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-formily/references/examples.md +0 -65
- package/template/.hermes/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.hermes/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.hermes/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.hermes/skills/yss-formily/references/examples.md +0 -65
- package/template/.pi/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.pi/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-formily/references/examples.md +0 -65
- package/template/.qoder/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.qoder/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.qoder/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.qoder/skills/yss-formily/references/examples.md +0 -65
- package/template/.trae/skills/high-fidelity-html-prototype/SKILL.md +0 -89
- package/template/.trae/skills/high-fidelity-html-prototype/agents/openai.yaml +0 -5
- package/template/.trae/skills/yss-formily/agents/openai.yaml +0 -5
- package/template/.trae/skills/yss-formily/references/examples.md +0 -65
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ npx create-yss-spec@latest --version
|
|
|
47
47
|
- init / sync 不把模板源治理笔记、wiki、审查证据、源仓 CI / Cloud 环境和公开发布清单写入项目实例;attach 会带上 `yss-public-skills.json` 供 `verify-template` 使用
|
|
48
48
|
- 空 gitlink / detached HEAD / git-submodule 挂载点 fail closed,`--force` 也不能覆盖
|
|
49
49
|
|
|
50
|
-
本次模板适配按 `2.2.
|
|
50
|
+
本次模板适配按 `2.2.1` 发布,绑定 `yss-spec-project-template@2375746`。`templateCommit` 会写入实例 metadata;“最新模板”指用户执行的 `npx create-yss-spec@latest` 所携带的最新已发布快照,CLI 运行时不会拉取模板仓库。实例会带上 YSS 前端技能叠加层(如 `ytable-usage`、`formily-foundation`、`yss-page-module-development`)、`.cursorrules` 与 `.agents/rules/yss-ai-skills.md`;审查临时目录 `docs/.scratch/` 与已退役的 `high-fidelity-html-prototype` 等独立入口不进入快照。
|
|
51
51
|
|
|
52
52
|
## 接管已有项目
|
|
53
53
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# YSS AI Skills Entry
|
|
6
|
+
|
|
7
|
+
本项目使用 YSS UI 业务页面开发规范。处理 Vue3 业务页面、CRUD、列表、表单、抽屉、YTable、YEditTable、YFormily、YTree、API 对接任务时,必须先读取匹配的 SKILL.md,再写计划或代码。
|
|
8
|
+
|
|
9
|
+
## Available Skills
|
|
10
|
+
|
|
11
|
+
- yss-page-module-development: .agents/skills/yss-page-module-development/SKILL.md
|
|
12
|
+
- theme-token-usage: .agents/skills/theme-token-usage/SKILL.md
|
|
13
|
+
- component-selection-imports: .agents/skills/component-selection-imports/SKILL.md
|
|
14
|
+
- page-skeleton: .agents/skills/page-skeleton/SKILL.md
|
|
15
|
+
- page-list-module: .agents/skills/page-list-module/SKILL.md
|
|
16
|
+
- page-form-module: .agents/skills/page-form-module/SKILL.md
|
|
17
|
+
- ytable-usage: .agents/skills/ytable-usage/SKILL.md
|
|
18
|
+
- yedit-table-usage: .agents/skills/yedit-table-usage/SKILL.md
|
|
19
|
+
- ytree-usage: .agents/skills/ytree-usage/SKILL.md
|
|
20
|
+
- prototype-page-acceptance: .agents/skills/prototype-page-acceptance/SKILL.md
|
|
21
|
+
- yss-api-integration: .agents/skills/yss-api-integration/SKILL.md
|
|
22
|
+
- file-export-download: .agents/skills/file-export-download/SKILL.md
|
|
23
|
+
- vue3-best-practices: .agents/skills/vue3-best-practices/SKILL.md
|
|
24
|
+
- frontend-commit: .agents/skills/frontend-commit/SKILL.md
|
|
25
|
+
- java-backend-commit: .agents/skills/java-backend-commit/SKILL.md
|
|
26
|
+
- yss-use-table-height: .agents/skills/yss-use-table-height/SKILL.md
|
|
27
|
+
- yss-use-tree-height: .agents/skills/yss-use-tree-height/SKILL.md
|
|
28
|
+
- yss-formily: .agents/skills/yss-formily/SKILL.md
|
|
29
|
+
- formily-foundation: .agents/skills/formily-foundation/SKILL.md
|
|
30
|
+
- formily-linkage-effects: .agents/skills/formily-linkage-effects/SKILL.md
|
|
31
|
+
- formily-mode-slot-detail: .agents/skills/formily-mode-slot-detail/SKILL.md
|
|
32
|
+
- formily-step-flow: .agents/skills/formily-step-flow/SKILL.md
|
|
33
|
+
|
|
34
|
+
## Mandatory Workflow
|
|
35
|
+
|
|
36
|
+
1. 页面/CRUD/列表/表单任务:先读 `.agents/skills/yss-page-module-development/SKILL.md`。
|
|
37
|
+
2. 新增或修改页面、组件、Less、内联样式、TS 渲染配置、SVG 色值:必须读 `.agents/skills/theme-token-usage/SKILL.md`。
|
|
38
|
+
3. 导出、报表、模板、附件、Excel、CSV、PDF、ZIP、Blob 下载任务:必须读 `.agents/skills/file-export-download/SKILL.md`。
|
|
39
|
+
4. 列表或表格任务:同时读 `.agents/skills/page-list-module/SKILL.md`、`.agents/skills/ytable-usage/SKILL.md`、`.agents/skills/yss-use-table-height/SKILL.md`。
|
|
40
|
+
5. 新增/编辑/查看/抽屉表单:同时读 `.agents/skills/yss-formily/SKILL.md`、`.agents/skills/page-form-module/SKILL.md`。
|
|
41
|
+
6. 可编辑表格、扩展属性、添加行/删除行:必须读 `.agents/skills/yedit-table-usage/SKILL.md`。
|
|
42
|
+
7. 用户给原型截图或旧项目路径:必须读 `.agents/skills/prototype-page-acceptance/SKILL.md`,先生成验收清单,再实现。
|
|
43
|
+
|
|
44
|
+
## Hard Stops
|
|
45
|
+
|
|
46
|
+
- 禁止使用 YTable 不存在的 `request`、`search-params` Props 和 `actionConfig.actions`;实例 `refresh()` 只刷新当前表格数据,不得当作远程重新查询。
|
|
47
|
+
- 标准列表必须使用 `:data`、`:columns`、`:loading`、`pageable`、`v-model:pagination`、`@page-change`。
|
|
48
|
+
- 表格主操作必须放入 `#toolbar-right`;只有确实需要列设置时才使用 `:toolbar-config="{ custom: true }"`。
|
|
49
|
+
- 业务列表查询区默认将查询/重置按钮放在 YFormily 外部独占一行并右对齐;`AutoButtonGroup + Submit + Reset` 仅用于纯 Formily 提交表单。
|
|
50
|
+
- 所有 YFormily 横向业务表单必须使用 `FormLayout(labelWidth, labelAlign: 'right') -> FormGrid -> 字段`,不得省略固定 label 宽度和右对齐。
|
|
51
|
+
- FormGrid 必须保持响应式:默认 `minColumns: 1`,通过 `maxColumns`、`minWidth` 控制宽屏列数;禁止 `minColumns` 等于 `maxColumns` 固定列数,除非用户明确要求不响应式。
|
|
52
|
+
- 抽屉/弹窗编辑表单默认 `labelWidth: 140`、`FormGrid { maxColumns: 2, minColumns: 1, minWidth: 320~360 }`;备注/长文本字段必须用 `gridSpan` 占满整行。
|
|
53
|
+
- 可编辑表格必须优先使用 `YEditTable`,禁止用 `a-table` 手搓。
|
|
54
|
+
- 抽屉表单必须有响应式宽度,查看态不显示保存按钮。
|
|
55
|
+
- 页面和组件禁止硬编码品牌色及 hover/active/selected/focus 色阶;主色透明态必须从真实动态 Token 派生,不得依赖未同步变量的固定色 fallback。
|
|
56
|
+
- 导出下载必须优先调用 `handleBlobResponse(res.data, res.headers)`;生成方法缺少 Blob 配置时,第二参数必须传 `{ responseType: 'blob' }`,禁止手改 Orval 生成文件。
|
|
57
|
+
- Orval 请求失败由 `mutator.ts` 统一提示并 reject;业务 Hook 禁止 `if (res?.success)` 冗余判断,也禁止在 `else`/`catch` 重复 `message.error`,除非请求显式跳过了全局处理。
|
|
58
|
+
- 调用 Orval API 前必须检查当前生成文件;存在具名导出时直接导入,只有工厂导出时在模块顶层创建一次实例,禁止猜测 `getApi()` 名称。
|
|
59
|
+
- 有截图/旧项目参考时,交付前必须逐项对照查询区、表格工具栏、分页高度、抽屉、label、字段控件类型。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "@yss/skills",
|
|
3
|
+
"mode": "copy",
|
|
4
|
+
"skills": [
|
|
5
|
+
"yss-page-module-development",
|
|
6
|
+
"theme-token-usage",
|
|
7
|
+
"component-selection-imports",
|
|
8
|
+
"page-skeleton",
|
|
9
|
+
"page-list-module",
|
|
10
|
+
"page-form-module",
|
|
11
|
+
"ytable-usage",
|
|
12
|
+
"yedit-table-usage",
|
|
13
|
+
"ytree-usage",
|
|
14
|
+
"prototype-page-acceptance",
|
|
15
|
+
"yss-api-integration",
|
|
16
|
+
"file-export-download",
|
|
17
|
+
"vue3-best-practices",
|
|
18
|
+
"frontend-commit",
|
|
19
|
+
"java-backend-commit",
|
|
20
|
+
"yss-use-table-height",
|
|
21
|
+
"yss-use-tree-height",
|
|
22
|
+
"yss-formily",
|
|
23
|
+
"formily-foundation",
|
|
24
|
+
"formily-linkage-effects",
|
|
25
|
+
"formily-mode-slot-detail",
|
|
26
|
+
"formily-step-flow"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: component-selection-imports
|
|
3
|
+
description: 指导 YSS UI 业务页面、CRUD、列表页、表单页和组件评审在编码前判定组件、Hook 与工具函数的真实导出来源;当需要在 @yss-ui/components、@yss-ui/hooks、@yss-ui/utils 与 ant-design-vue 之间选择,或需要排查虚构 Y 前缀组件、错误导入、Formily UI 边界时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 组件选择与导入
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 生成 YSS UI 业务页面前需要判定组件、Hook 或工具函数来源。
|
|
11
|
+
- 出现错误 Y 前缀、导入冲突、Formily UI 跨层或者组件是否已封装不明确。
|
|
12
|
+
|
|
13
|
+
## 不适用场景
|
|
14
|
+
|
|
15
|
+
- 只修改与 UI 导入无关的纯数据逻辑。
|
|
16
|
+
- 组件库内部组件开发;该场景应按组件开发规范处理内部依赖。
|
|
17
|
+
|
|
18
|
+
## 判定流程
|
|
19
|
+
|
|
20
|
+
1. 当前会话可用 yss-ui MCP 时,先用 `list_components` 确认组件、Hook 或 Utils 是否真实存在,再用 `get_component_docs` 确认名称、导出包、Props、Events 和 Slots,不只看 demo 标签名。
|
|
21
|
+
2. `get_component_docs` 未命中时,先用 `search_docs` 和 `list_components` 校正别名与归属,不得立即判定为未封装。
|
|
22
|
+
3. MCP 工具不可用、调用失败或校正后仍无结果时,读取当前上下文中的最新 `llms-full.txt`;上下文没有时读取 `http://192.168.164.27:3200/llms-full.txt`。
|
|
23
|
+
4. 必要时读取 `../yss-page-module-development/references/component-map.md`、`hooks-map.md`、`utils-map.md` 快速缩小范围;文档与当前项目依赖版本不一致时,最终以当前源码和可编译导出为准。
|
|
24
|
+
5. 已导出的 YSS 能力优先从 `@yss-ui/components`、`@yss-ui/hooks`、`@yss-ui/utils` 导入;确认未封装后才从 `ant-design-vue` 导入原组件。
|
|
25
|
+
6. 若文档与导出源码不一致,记录差异并按当前仓库可编译的导出处理,不猜测 API。
|
|
26
|
+
|
|
27
|
+
## 硬约束(禁止/必须)
|
|
28
|
+
|
|
29
|
+
- 业务层已封装组件必须从 `@yss-ui/components` 导入;可编辑表格必须优先使用 `YEditTable`,业务主表格必须优先使用 `YTable`。
|
|
30
|
+
- 当前公共导出包含 `YButton`、`YCard`、`YTable`、`YEditTable`、`YTree`、`YSplitPane`、`YFormily` 等;未导出 `YModal`、`YDrawer`、`YInput`、`YPopconfirm`,禁止臆造这些名称。
|
|
31
|
+
- 当前未封装的 `Modal`、`Drawer`、`Popconfirm`、`Input` 等从 `ant-design-vue` 导入。删除操作使用按钮附近的 `Popconfirm`,不默认使用居中 `Modal.confirm`。
|
|
32
|
+
- 业务层禁止导入 `@formily/antdv` 或 `@formily/antd*` UI 组件;使用 `YFormily` 提供的 Schema 与组件边界。
|
|
33
|
+
- 禁止因文档暂时不可达就把猜测的 `Y*` 组件改成 Ant Design Vue “先落地”。只能复用当前仓库已证明可用的导入,或明确报告待确认项。
|
|
34
|
+
- 接口错误提示由 `mutator.ts` 的响应拦截器统一处理。API Hook 不得在 `success === false` 分支或 `catch` 内重复调用 `message.error`;`message` 只用于非 API 错误的本地交互反馈或成功提示。
|
|
35
|
+
|
|
36
|
+
## 标准代码骨架
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import {
|
|
40
|
+
YButton,
|
|
41
|
+
YCard,
|
|
42
|
+
YEditTable,
|
|
43
|
+
YTable,
|
|
44
|
+
YTree,
|
|
45
|
+
YFormily,
|
|
46
|
+
type YEditTableColumn,
|
|
47
|
+
type YTableColumn,
|
|
48
|
+
} from '@yss-ui/components';
|
|
49
|
+
import { useLoading, useTableHeight, useTreeHeight } from '@yss-ui/hooks';
|
|
50
|
+
import { copyToClipboard, formatDate } from '@yss-ui/utils';
|
|
51
|
+
import { Drawer, Input, Modal, Popconfirm } from 'ant-design-vue';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 交付检查清单
|
|
55
|
+
|
|
56
|
+
- [ ] 每个关键导入都能在最新文档或包的 `src/index.ts` 中追溯。
|
|
57
|
+
- [ ] 未导出的 Y 前缀组件没有出现在业务代码中。
|
|
58
|
+
- [ ] 删除、表格、编辑表格和 Formily 导入边界符合项目约束。
|
|
59
|
+
- [ ] API Hook 中没有重复 `message.error`,异常仍由 `Promise.reject` 中断后续流程。
|
|
60
|
+
|
|
61
|
+
## 失败兜底策略
|
|
62
|
+
|
|
63
|
+
- MCP 与 `llms-full.txt` 都不可用时,用 CodeGraph/源码 `src/index.ts` 和当前项目已编译的相近页面交叉确认,不猜测导出。
|
|
64
|
+
- 文档与源码不一致时,优先保证当前仓库可编译,并在交付中明确标注文档差异。
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: file-export-download
|
|
3
|
+
description: 指导 Vue3 YSS UI 微应用实现文件导出、报表下载、模板下载和附件下载,覆盖 OpenAPI binary 响应、Orval 生成方法检查、responseType blob 兜底、Blob 响应类型、Content-Disposition 文件名、handleBlobResponse、loading 与错误处理;当需求出现导出、下载、Excel、CSV、PDF、ZIP、Blob 或文件流时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# YSS 文件导出下载 Skill
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 页面需要导出 Excel、CSV、PDF、ZIP、报表、密钥文件或其他二进制文件。
|
|
11
|
+
- 页面需要下载导入模板、附件或后端动态生成的文件。
|
|
12
|
+
- Orval 生成接口的返回值是 `Blob`,或业务调用需要配置 `responseType: 'blob'`。
|
|
13
|
+
- 代码正在手写 `URL.createObjectURL`、解析 `Content-Disposition`、拼接文件名或调用 `downloadFileStream`。
|
|
14
|
+
|
|
15
|
+
## 不适用场景
|
|
16
|
+
|
|
17
|
+
- 仅上传文件,不包含模板下载或导出流程。
|
|
18
|
+
- 下载公开静态 URL 且无需鉴权、请求参数和响应头文件名时,使用 `downloadFileFromUrl(url, fileName?)`。
|
|
19
|
+
- 浏览器只需要预览远程 PDF/图片,不触发文件保存。
|
|
20
|
+
|
|
21
|
+
## 必读依据
|
|
22
|
+
|
|
23
|
+
- 通用接口规则:`../yss-api-integration/SKILL.md`。
|
|
24
|
+
- 当前项目:`openapi/openapi.json`、Orval 配置、生成后的 API 方法和 `packages/src/api/mutator.ts`。
|
|
25
|
+
- YSS Utils 文件下载能力:按下方检索顺序核对 `handleBlobResponse` 和 `downloadBlob`。
|
|
26
|
+
|
|
27
|
+
## 文档检索
|
|
28
|
+
|
|
29
|
+
1. MCP 可用时,先用 `search_docs` 查询 `handleBlobResponse 文件下载 Content-Disposition`,并读取命中的 `downloadBlob(/utils/download)` 文档。该能力属于工具函数,不强制调用面向组件别名的 `get_component_docs`。
|
|
30
|
+
2. 搜索无结果时,调整关键词再次调用 `search_docs`;仅在 MCP 不可用、调用失败或仍无结果时,回退读取最新 `llms-full.txt` 的文件下载章节。文档版本与当前依赖不一致时,再核对 `packages/utils` 源码、CodeGraph 和真实导出。
|
|
31
|
+
|
|
32
|
+
## 决策流程
|
|
33
|
+
|
|
34
|
+
1. 在 OpenAPI 中定位导出接口,优先把成功响应声明为二进制媒体类型和 `format: binary`。
|
|
35
|
+
2. 重新生成 API 后检查生成方法,而不是凭接口名称判断:
|
|
36
|
+
- 已包含 `responseType: 'blob'`:业务调用不必重复传第二参数。
|
|
37
|
+
- 未包含 `responseType: 'blob'`:业务调用必须传第二参数 `{ responseType: 'blob' }`。
|
|
38
|
+
3. 检查 mutator 和全局错误处理器:Blob 成功响应必须保留 `{ data, headers }`;HTTP 4xx/5xx 的 Blob JSON 错误应由全局错误处理器解析并 reject。
|
|
39
|
+
4. 在业务 hook 中设置 loading、防重复点击,调用生成 API,再执行 `handleBlobResponse(res.data, res.headers)`。
|
|
40
|
+
5. 验证文件名、文件内容、错误响应和连续点击,不只验证浏览器出现了下载任务。
|
|
41
|
+
|
|
42
|
+
> OpenAPI 标准通过响应 `content` 和 `format: binary` 表达二进制,不直接使用 Axios 的 `responseType` 字段。最终以 Orval 生成方法是否含 `responseType: 'blob'` 为判断依据。
|
|
43
|
+
|
|
44
|
+
## 硬约束(禁止/必须)
|
|
45
|
+
|
|
46
|
+
- 必须优先导入 `import { handleBlobResponse } from '@yss-ui/utils';` 处理接口文件流。
|
|
47
|
+
- 必须调用 `handleBlobResponse(res.data, res.headers)`;它会自动兼容响应头大小写,并解析 RFC 5987 `filename*` 与普通 `filename`。
|
|
48
|
+
- 第三个 `hasUtf8Encoding` 参数已弃用,禁止继续传递。
|
|
49
|
+
- 生成方法缺少 Blob 配置时,必须在第二参数顶层传 `{ responseType: 'blob' }`;禁止放进 `headers`、请求 body 或查询参数。
|
|
50
|
+
- 生成方法已包含 Blob 配置时,禁止为“保险”重复传相同配置;先保持 OpenAPI 契约和生成产物正确。
|
|
51
|
+
- 禁止修改 Orval 生成文件补写 `responseType`,因为重新生成会覆盖;应修正 OpenAPI,或在业务调用第二参数临时兜底。
|
|
52
|
+
- 禁止依赖 URL 中包含 `download/export` 的请求拦截器猜测响应类型;接口可能不按该名称命名。
|
|
53
|
+
- 禁止在业务层重复实现 `getFileNameFromContentDisposition`、`downloadFileStream`、`URL.createObjectURL` 和 `<a download>` 流程。
|
|
54
|
+
- 必须保留响应头;只取 `res.data` 会丢失服务端文件名。
|
|
55
|
+
- Blob 接口失败时遵循全局 mutator 错误处理,禁止在 catch 中重复 `message.error`;成功下载后可提示 `message.success`。
|
|
56
|
+
- 当前模板 mutator 只能识别“已解析 JSON 对象”的 `success === false`,不会自动检测 HTTP 200 Blob 内的业务错误;发现该契约时必须先修正后端状态码或 mutator,禁止把解析逻辑复制到每个 Hook。
|
|
57
|
+
- 必须用独立 loading 状态防止重复导出,并在 `finally` 中恢复。
|
|
58
|
+
- 不得默认传 `skipBusinessError` 或 `skipErrorHandler`;只有明确需要业务自定义错误体验时才使用。
|
|
59
|
+
|
|
60
|
+
## OpenAPI 标准代码骨架
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"responses": {
|
|
65
|
+
"200": {
|
|
66
|
+
"description": "导出成功",
|
|
67
|
+
"headers": {
|
|
68
|
+
"Content-Disposition": {
|
|
69
|
+
"schema": { "type": "string" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"content": {
|
|
73
|
+
"application/octet-stream": {
|
|
74
|
+
"schema": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"format": "binary"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
根据文件类型可将媒体类型换成 `text/csv`、`application/pdf` 或 Excel 对应类型。跨域请求若读取不到文件名,后端还必须暴露 `Content-Disposition` 响应头。
|
|
86
|
+
|
|
87
|
+
## 标准代码骨架
|
|
88
|
+
|
|
89
|
+
### 生成方法已包含 responseType
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { ref } from 'vue';
|
|
93
|
+
import { handleBlobResponse } from '@yss-ui/utils';
|
|
94
|
+
import { downloadAccessSecret } from '@/api/generated/quality';
|
|
95
|
+
|
|
96
|
+
/** 微应用 mutator 返回的文件下载响应。 */
|
|
97
|
+
type BlobDownloadResponse = {
|
|
98
|
+
data: Blob;
|
|
99
|
+
headers: Record<string, string>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** 文件下载进行中状态。 */
|
|
103
|
+
const downloading = ref(false);
|
|
104
|
+
|
|
105
|
+
/** 下载密钥文件。 */
|
|
106
|
+
const downloadFile = async (key: string): Promise<void> => {
|
|
107
|
+
if (downloading.value) return;
|
|
108
|
+
|
|
109
|
+
downloading.value = true;
|
|
110
|
+
try {
|
|
111
|
+
const res = (await downloadAccessSecret(key)) as unknown as BlobDownloadResponse;
|
|
112
|
+
handleBlobResponse(res.data, res.headers);
|
|
113
|
+
} catch {
|
|
114
|
+
// mutator 已展示错误;此处只阻止 reject 继续向 UI 事件传播。
|
|
115
|
+
} finally {
|
|
116
|
+
downloading.value = false;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 生成方法缺少 responseType
|
|
122
|
+
|
|
123
|
+
只改调用行,其他流程保持一致:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
const res = (await downloadAccessSecret(key, {
|
|
127
|
+
responseType: 'blob',
|
|
128
|
+
})) as unknown as BlobDownloadResponse;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
若 mutator 与 Orval 返回类型已经准确声明为 `{ data: Blob; headers: ... }`,直接使用生成类型,删除不必要的类型断言。
|
|
132
|
+
|
|
133
|
+
## 响应约定
|
|
134
|
+
|
|
135
|
+
- 后端成功响应应返回真实文件流,并设置 `Content-Disposition: attachment; filename*=UTF-8''...`。
|
|
136
|
+
- mutator 对 Blob 成功响应返回 `{ data, headers }`,以便 `handleBlobResponse` 获取文件名。
|
|
137
|
+
- HTTP 错误的 Blob JSON 由全局错误处理器解析并 reject,业务 Hook 不重复解析或提示。
|
|
138
|
+
- HTTP 200 且 body 是 Blob 包装的业务错误时,当前模板不会自动 reject;必须修复契约或统一拦截器后再交付。
|
|
139
|
+
- `handleBlobResponse` 找不到文件名时会使用 `download`;应优先补齐后端响应头,而不是在每个页面手写解析逻辑。
|
|
140
|
+
|
|
141
|
+
## 交付检查清单
|
|
142
|
+
|
|
143
|
+
- [ ] 已检查 OpenAPI 二进制响应声明和 Orval 生成方法。
|
|
144
|
+
- [ ] 仅在生成方法缺少配置时,第二参数传入了 `{ responseType: 'blob' }`。
|
|
145
|
+
- [ ] 已从 `@yss-ui/utils` 导入并调用 `handleBlobResponse(res.data, res.headers)`。
|
|
146
|
+
- [ ] 未修改 Orval 生成文件,未重复实现文件名解析或浏览器下载逻辑。
|
|
147
|
+
- [ ] Blob 成功响应保留了 `data` 与 `headers`,类型断言只位于 API 边界。
|
|
148
|
+
- [ ] 已处理 loading、防重复点击和 `finally` 恢复。
|
|
149
|
+
- [ ] 未在 catch 中重复业务错误 Toast。
|
|
150
|
+
- [ ] 中文文件名、普通文件名和缺失文件名场景均已验证。
|
|
151
|
+
- [ ] HTTP 错误的 Blob JSON 会 reject;如存在 HTTP 200 Blob 业务错误契约,已修正后端状态码或 mutator。
|
|
152
|
+
- [ ] 下载文件可以正常打开,格式和内容与接口预期一致。
|
|
153
|
+
|
|
154
|
+
## 失败兜底策略
|
|
155
|
+
|
|
156
|
+
- 生成方法不支持第二参数时,先确认 Orval `options: true`;修正配置并重新生成,禁止手改生成文件。
|
|
157
|
+
- `res.headers` 为空时,检查 mutator 是否错误地只返回 `data`,以及后端/CORS 是否暴露 `Content-Disposition`。
|
|
158
|
+
- 下载到 JSON 错误文件时,先确认 HTTP 状态码:非 2xx 检查全局错误处理器,HTTP 200 检查后端契约并在 mutator 统一补齐;禁止把解析逻辑复制到每个业务 Hook。
|
|
159
|
+
- 文件名始终为 `download` 时,优先修复后端 `Content-Disposition`;无法改后端时再评估统一扩展 YSS 下载工具。
|
|
160
|
+
- 超大文件导致内存压力时,改用后端临时 URL、分片或流式下载方案,不强行把全部内容载入 Blob。
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: formily-foundation
|
|
3
|
+
description: 指导 YFormily 基础表单开发;当创建或修复普通单页表单、字段校验、提交链路、查询表单布局、scope 表达式或导入边界时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Formily Foundation Skill
|
|
7
|
+
|
|
8
|
+
## 触发条件
|
|
9
|
+
|
|
10
|
+
- 创建或改造 `YFormily` 基础表单(字段、校验、提交)。
|
|
11
|
+
- 修复表单导入路径、schema 层级、提交不触发等问题。
|
|
12
|
+
- 实现普通单页表单,不含复杂联动或详情插槽。
|
|
13
|
+
|
|
14
|
+
## 不适用场景
|
|
15
|
+
|
|
16
|
+
- 复杂联动、副作用、跨字段逻辑:使用 `../formily-linkage-effects/SKILL.md`。
|
|
17
|
+
- 查看态 detail 插槽和 mode 切换:使用 `../formily-mode-slot-detail/SKILL.md`。
|
|
18
|
+
- 分步表单:使用 `../formily-step-flow/SKILL.md`。
|
|
19
|
+
|
|
20
|
+
## 文档检索
|
|
21
|
+
|
|
22
|
+
1. 当前会话可用 yss-ui MCP 时,先用 `get_component_docs` 查询 `YFormily` 的基础 Props、Methods 与 Schema 边界;实现字段布局、提交或校验失败时,再用 `get_demo` 获取 `formily/basic`、`formily/grid`、`formily/submit-failed` 等官方 Demo。
|
|
23
|
+
2. MCP 查询未命中时先用 `search_docs/list_components` 校正名称;MCP 不可用、调用失败或校正后仍无结果时,才读取最新 `llms-full.txt`。若文档与当前项目依赖版本不一致,用当前源码和导出核验。
|
|
24
|
+
|
|
25
|
+
## 硬约束(禁止/必须)
|
|
26
|
+
|
|
27
|
+
- 业务生成代码统一从 `@yss-ui/components` 导入 `YFormily` 与 `ISchema`;`YssFormily` 仅作为历史兼容别名说明。
|
|
28
|
+
- 禁止业务层导入 `@formily/antdv`、`@formily/antd*` UI 组件。
|
|
29
|
+
- 必须使用三层结构:`FormLayout -> FormGrid -> 字段`,禁止字段直接挂在根节点或单独以 `FormGrid` 作为顶层布局。
|
|
30
|
+
- `Submit` 必须传 `onSubmit`,否则不触发表单提交。
|
|
31
|
+
- 标准业务列表/CRUD 查询区默认让 `YFormily` 只渲染字段;查询/重置按钮用外部 `YButton` 放在 `.xxx__search-actions`,由 hook 的 `handleSearch/handleReset` 控制分页重置和请求。
|
|
32
|
+
- `AutoButtonGroup -> Submit/Reset` 仅用于纯 Formily 表单提交,不作为业务列表查询区默认方案。
|
|
33
|
+
- 查询区禁止横向放“表单 + 按钮”后用大 `gap`、`align-items: flex-start` 或 `padding-top` 硬调位置;字段换行时按钮必须在搜索卡片右下角。
|
|
34
|
+
- 横向表单必须显式设置 `FormLayout` 的 `labelWidth` 和 `labelAlign: 'right'`,抽屉/弹窗场景尤其不能让 label 宽度自适应。
|
|
35
|
+
- `FormGrid` 默认保持响应式:`minColumns: 1`,通过 `maxColumns` 和 `minWidth` 控制宽屏列数;不要写 `minColumns: maxColumns` 固定列数,除非用户明确要求不响应式。
|
|
36
|
+
- 查询表单常用 `labelWidth: 100~120`、`FormGrid { maxColumns: 3 或 4, minColumns: 1, minWidth: 260~360 }`,按钮行在表单外部右下角;抽屉/弹窗编辑表单常用 `labelWidth: 140`、`FormGrid { maxColumns: 2, minColumns: 1, minWidth: 320~360 }`。
|
|
37
|
+
- 备注、说明等长字段必须用 `x-decorator-props.gridSpan` 占满整行,例如两列布局用 `gridSpan: 2`。
|
|
38
|
+
- 下拉选择器(`Select`, `TreeSelect`, `Radio.Group` 等)异步数据源必须通过 `enum` 或 `x-reactions` / `field.dataSource` 注入,严禁写入 `x-component-props.options`(会导致 Formily 首次挂载空数组且后续不更新,产生首次打开弹窗显示“暂无数据”的 Bug)。
|
|
39
|
+
- 事件表达式必须字符串化(`'{{ ... }}'`),并按组件语义使用事件名。
|
|
40
|
+
- 只使用源码已公开的 Props 和实例方法;当前没有 `show-button-group`、`detail-as`、`validate`、`reset`、`clearValidate` 等 YFormily API。
|
|
41
|
+
- Orval API 的网络错误及 `success === false` 业务错误已由 `mutator.ts` 统一 `message.error` 并 reject;提交 hook 禁止在 `else` 或 `catch` 中重复提示。
|
|
42
|
+
- 客户端校验提示使用 `onFormSubmitValidateFailed`;禁止在 `onFormSubmitFailed` 或 `Submit.onSubmitFailed` 中调用 `message.error`,它们也会捕获 `onSubmit` 内的 API reject。
|
|
43
|
+
- **Formily 表单校验规则(x-validator)防坑规范**:
|
|
44
|
+
- 必填文本字段必须声明 `whitespace: true`,即 `{ required: true, whitespace: true, message: '请输入xxx' }`,防止输入纯空格绕过前端校验。
|
|
45
|
+
- 自定义长度、格式和跨字段校验不得重复承担必填职责;函数式校验必须在空值时返回通过(如 `validator: (val) => { const str = (val || '').trim(); if (!str) return true; return validateContentLength(val) || true; }`),空值统一交由 `required` 报错,非空时才校验具体规则。
|
|
46
|
+
- 当前 YFormily 的 FormItem 适配层会在运行时归一化反馈:空值优先显示必填提示,非空值移除残留必填提示,多条相关消息只拼接一次。该兜底不替代正确的 Schema 校验职责拆分。
|
|
47
|
+
- 分步需求默认走 `formily-step-flow`,不在本 skill 内给 `FormStep` 方案。
|
|
48
|
+
|
|
49
|
+
## 标准代码骨架
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<script setup lang="ts">
|
|
53
|
+
import { YFormily, type ISchema } from '@yss-ui/components';
|
|
54
|
+
|
|
55
|
+
/** 表单保存回调 Props。 */
|
|
56
|
+
interface SaveFormProps {
|
|
57
|
+
onSave: (values: Record<string, any>) => Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** 表单保存回调。 */
|
|
61
|
+
const props = defineProps<SaveFormProps>();
|
|
62
|
+
|
|
63
|
+
/** 校验通过后提交表单数据。 */
|
|
64
|
+
const onSubmit = (values: Record<string, any>) => {
|
|
65
|
+
return props.onSave(values);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** 基础表单 Schema。 */
|
|
69
|
+
const schema: ISchema = {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
layout: {
|
|
73
|
+
type: 'void',
|
|
74
|
+
'x-component': 'FormLayout',
|
|
75
|
+
'x-component-props': { layout: 'horizontal', labelWidth: 120, labelAlign: 'right' },
|
|
76
|
+
properties: {
|
|
77
|
+
grid: {
|
|
78
|
+
type: 'void',
|
|
79
|
+
'x-component': 'FormGrid',
|
|
80
|
+
'x-component-props': { maxColumns: 3, minColumns: 1, minWidth: 260 },
|
|
81
|
+
properties: {
|
|
82
|
+
name: { type: 'string', title: '名称', 'x-decorator': 'FormItem', 'x-component': 'Input', required: true },
|
|
83
|
+
submit: {
|
|
84
|
+
type: 'void',
|
|
85
|
+
'x-component': 'Submit',
|
|
86
|
+
'x-content': '提交',
|
|
87
|
+
'x-component-props': { onSubmit: '{{ onSubmit }}' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<YFormily :schema="schema" :scope="{ onSubmit }" />
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 业务查询区布局
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<template>
|
|
106
|
+
<YCard class="demo-page__search-card" :padding="16">
|
|
107
|
+
<div class="demo-page__search-content">
|
|
108
|
+
<div class="demo-page__search-form">
|
|
109
|
+
<YFormily v-model="queryModel" :schema="searchSchema" />
|
|
110
|
+
</div>
|
|
111
|
+
<div class="demo-page__search-actions">
|
|
112
|
+
<YButton type="primary" @click="handleSearch">查询</YButton>
|
|
113
|
+
<YButton @click="handleReset">重置</YButton>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</YCard>
|
|
117
|
+
</template>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```less
|
|
121
|
+
.demo-page {
|
|
122
|
+
&__search-content {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
align-items: stretch;
|
|
126
|
+
gap: 16px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&__search-form {
|
|
130
|
+
width: 100%;
|
|
131
|
+
min-width: 0;
|
|
132
|
+
|
|
133
|
+
:deep(.ant-formily-form-item) {
|
|
134
|
+
margin-bottom: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:deep(.ant-formily-form-grid) {
|
|
138
|
+
width: 100%;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&__search-actions {
|
|
143
|
+
display: flex;
|
|
144
|
+
width: 100%;
|
|
145
|
+
flex: 0 0 auto;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: flex-end;
|
|
148
|
+
gap: 12px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## 交付检查清单
|
|
154
|
+
|
|
155
|
+
- [ ] 导入来源和组件边界正确。
|
|
156
|
+
- [ ] schema 三层结构完整。
|
|
157
|
+
- [ ] 横向表单有固定 `labelWidth` 且 label 右对齐。
|
|
158
|
+
- [ ] `FormGrid` 使用响应式列配置,未把 `minColumns` 固定成宽屏列数。
|
|
159
|
+
- [ ] `Submit` 提交链路可用,校验可触发。
|
|
160
|
+
- [ ] 只使用公开 Props/实例方法,未出现 `show-button-group`、`detail-as` 等旧式或虚构 API。
|
|
161
|
+
- [ ] 业务列表查询/重置按钮在外部 `.xxx__search-actions`,按钮行独占下一行并右对齐;缩窄后不会贴在第一行字段旁。
|
|
162
|
+
- [ ] label 宽度和右对齐已显式配置。
|
|
163
|
+
- [ ] 包含可运行 `initial-values` 或 `v-model` 示例。
|
|
164
|
+
- [ ] 未出现 `@formily/antdv` 业务层导入。
|
|
165
|
+
- [ ] API 失败仅由 `mutator.ts` 统一提示,业务 `else`/`catch` 未重复 `message.error`。
|
|
166
|
+
|
|
167
|
+
## 失败兜底策略
|
|
168
|
+
|
|
169
|
+
- 若提交不触发:先检查 `Submit.x-component-props.onSubmit`。
|
|
170
|
+
- 若字段不显示:先核对 `FormLayout/FormGrid/properties` 层级。
|
|
171
|
+
- 若 API 调用 reject:只恢复 loading 或回滚局部状态,不重复弹出错误提示。
|
|
172
|
+
- 若需求升级为联动/模式/分步:立即切换对应 skill,不在本 skill 内硬扩展。
|
|
173
|
+
|
|
174
|
+
## 参考
|
|
175
|
+
|
|
176
|
+
- 完整示例:`./references/examples.md`
|