cabloy 5.1.65 → 5.1.67
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/.claude/skills/cabloy-resource-field-update/SKILL.md +6 -0
- package/CHANGELOG.md +55 -0
- package/cabloy-docs/.vitepress/config.mjs +1 -1
- package/cabloy-docs/backend/crud-workflow.md +33 -0
- package/cabloy-docs/backend/master-detail-workflow.md +149 -0
- package/cabloy-docs/frontend/bean-scene-authoring.md +1 -1
- package/cabloy-docs/frontend/cli.md +12 -1
- package/cabloy-docs/frontend/command-scene-authoring.md +12 -1
- package/cabloy-docs/frontend/component-guide.md +10 -0
- package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +69 -7
- package/cabloy-docs/frontend/table-cell-cookbook.md +10 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +83 -2
- package/cabloy-docs/reference/bean-scene-boilerplates.md +9 -4
- package/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/src/lib/local.helper.ts +38 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoBaseName%>.tsx_ +18 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoMutateName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoResItemName%>.tsx_ +60 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoViewName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/package.json +2 -2
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.bean.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +3 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.suite.ts +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.test.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.asset.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.config.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.constant.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.error.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.lib.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.locale.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.main.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.monkey.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.static.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.types.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crud.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudBasic.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudStart.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.masterDetail.ts +699 -0
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/vona/packages-cli/cli-set-api/src/lib/beans.ts +2 -0
- package/vona/packages-cli/cli-set-api/src/lib/command/tools.masterDetail.ts +78 -0
- package/vona/packages-cli/cli-set-api/src/lib/commands.ts +2 -0
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/mappedClass/type.ts +1 -0
- package/vona/packages-vona/vona-core/src/lib/mappedClass/utils.ts +36 -14
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +35 -11
- package/vona/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-base/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-index/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-user/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +232 -3
- package/vona/src/suite/a-training/modules/training-record/src/bean/ssrMenu.record.ts +29 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/controller/record.ts +59 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectBase.tsx +18 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectMutate.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectResItem.tsx +60 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectView.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordCreate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectReq.tsx +38 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectRes.tsx +11 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectResItem.tsx +39 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordUpdate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordView.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +23 -6
- package/vona/src/suite/a-training/modules/training-record/src/model/record.ts +15 -2
- package/vona/src/suite/a-training/modules/training-record/src/service/record.ts +50 -0
- package/vona/src/suite/a-training/modules/training-record/test/record.test.ts +138 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/index.ts +198 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/en-us.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/zh-cn.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/entity/subject.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/model/subject.ts +10 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.json +7 -0
- package/vona/src/suite/a-training/modules/training-student/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +17 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +12 -17
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +26 -5
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +12 -14
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +6 -4
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +3 -6
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +2 -4
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +22 -5
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +69 -15
- package/vona/src/suite/a-training/package.json +1 -0
- package/vona/src/suite/a-training/tsconfig.json +3 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/package.json +1 -1
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/package.json +2 -2
- package/vona/src/suite-vendor/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-body/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-caching/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-election/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-error/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-event/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-index/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-locale/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-meta/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-onion/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/const/decorator.ts +3 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/makeSchemaLikes.ts +21 -17
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/utils.ts +44 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +6 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +13 -4
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/utils.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +37 -16
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-play/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-queue/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-validation/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-vona/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/bean.ts +26 -5
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-zod/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateDetailsActionBulk/controller.tsx_ +31 -0
- package/zova/packages-cli/cli-set-front/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +21 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +3 -3
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.bean.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.mock.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +3 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.suite.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.asset.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.config.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.constant.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.error.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.icon.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.lib.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.locale.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.main.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.mainSys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkey.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkeySys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.types.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.config.ts +1 -4
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +2 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentEmits.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentGeneric.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentModel.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentProps.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentSlots.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageParams.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageQuery.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.renameComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreateComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreatePage.ts +2 -6
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +695 -791
- package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
- package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
- package/zova/src/suite/a-training/modules/training-student/package.json +3 -2
- package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/bean/behavior.appModal.tsx +131 -13
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/config.ts +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/service/appModal.ts +23 -5
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/appModal.ts +30 -4
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockForm.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +149 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/command.delete.tsx +47 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionDelete.tsx +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionOperationsRow.tsx +44 -6
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionUpdate.tsx +73 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionView.tsx +64 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.lineNumber.tsx +30 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +29 -5
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +28 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockForm/controller.tsx +53 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockTable/controller.tsx +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockToolbarBulk/controller.tsx +3 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +24 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/en-us.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/utils.ts +12 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/service/detail.tsx +172 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/detail.ts +18 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +11 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/dialogForm.ts +22 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/index.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-form/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-resource/package.json +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/component/formFieldResourcePicker.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/index.ts +103 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/bean/tableCell.resourcePicker.tsx +46 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/component/formFieldResourcePicker/controller.tsx +157 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -1
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +2 -2
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/entry/controller.tsx +1 -2
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/command/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandBulk/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandDetailsRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +20 -0
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +4 -3
- package/zova/src/suite-vendor/a-zova/modules/a-command/src/types/command.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useQuery.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/lib/schema.ts +20 -4
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/model/sdk.ts +4 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detail.ts +10 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/details.ts +4 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/index.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/rest.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-table/cli/detailsActionRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +24 -0
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +4 -3
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/package.json +26 -26
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DtoRecordCreate,
|
|
3
|
+
DtoRecordSelectRes,
|
|
4
|
+
DtoRecordUpdate,
|
|
5
|
+
} from 'vona-module-training-record';
|
|
6
|
+
import type { DtoStudentCreate } from 'vona-module-training-student';
|
|
7
|
+
|
|
8
|
+
import assert from 'node:assert';
|
|
9
|
+
import { describe, it } from 'node:test';
|
|
10
|
+
import { app } from 'vona-mock';
|
|
11
|
+
|
|
12
|
+
describe('record.test.ts', () => {
|
|
13
|
+
it('action:record', async () => {
|
|
14
|
+
await app.bean.executor.mockCtx(async () => {
|
|
15
|
+
const studentData: DtoStudentCreate = {
|
|
16
|
+
name: '__Student__',
|
|
17
|
+
description: 'This is a student for record test',
|
|
18
|
+
mobile: '13812345678',
|
|
19
|
+
level: 1,
|
|
20
|
+
trainingRecords: [],
|
|
21
|
+
};
|
|
22
|
+
const recordData = {
|
|
23
|
+
studentId: 0 as any,
|
|
24
|
+
name: '__Record__',
|
|
25
|
+
score: 88,
|
|
26
|
+
description: 'This is a record',
|
|
27
|
+
trainingRecordSubjects: [
|
|
28
|
+
{
|
|
29
|
+
name: '__Math__',
|
|
30
|
+
score: 95,
|
|
31
|
+
description: 'Math subject',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
} as any as DtoRecordCreate;
|
|
35
|
+
await app.bean.passport.signinMock();
|
|
36
|
+
const studentId = await app.bean.executor.performAction('post', '/training/student', {
|
|
37
|
+
body: studentData,
|
|
38
|
+
});
|
|
39
|
+
recordData.studentId = studentId;
|
|
40
|
+
const recordId = await app.bean.executor.performAction('post', '/training/record', {
|
|
41
|
+
body: recordData,
|
|
42
|
+
});
|
|
43
|
+
assert.equal(!!recordId, true);
|
|
44
|
+
|
|
45
|
+
const selectRes: DtoRecordSelectRes = await app.bean.executor.performAction(
|
|
46
|
+
'get',
|
|
47
|
+
'/training/record',
|
|
48
|
+
);
|
|
49
|
+
const recordItem = selectRes.list.find(item => String(item.id) === String(recordId));
|
|
50
|
+
assert.equal(!!recordItem, true);
|
|
51
|
+
assert.equal(recordItem!.name, recordData.name);
|
|
52
|
+
assert.equal(String(recordItem!.studentId), String(studentId));
|
|
53
|
+
|
|
54
|
+
let record: any = await app.bean.executor.performAction('get', '/training/record/:id', {
|
|
55
|
+
params: { id: recordId },
|
|
56
|
+
});
|
|
57
|
+
const recordSubject = record.trainingRecordSubjects?.[0];
|
|
58
|
+
assert.equal(record.name, recordData.name);
|
|
59
|
+
assert.equal(String(record.studentId), String(studentId));
|
|
60
|
+
assert.equal(record.trainingRecordSubjects?.length, 1);
|
|
61
|
+
assert.equal(recordSubject?.name, '__Math__');
|
|
62
|
+
assert.equal(recordSubject?.score, 95);
|
|
63
|
+
|
|
64
|
+
let student: any = await app.bean.executor.performAction('get', '/training/student/:id', {
|
|
65
|
+
params: { id: studentId },
|
|
66
|
+
});
|
|
67
|
+
let studentRecord = student.trainingRecords?.find(
|
|
68
|
+
(item: any) => String(item.id) === String(recordId),
|
|
69
|
+
);
|
|
70
|
+
assert.equal(!!studentRecord, true);
|
|
71
|
+
assert.equal(studentRecord?.trainingRecordSubjects?.length, 1);
|
|
72
|
+
|
|
73
|
+
const dataUpdate = {
|
|
74
|
+
studentId,
|
|
75
|
+
name: '__RecordNew__',
|
|
76
|
+
score: 89,
|
|
77
|
+
description: 'This is an updated record',
|
|
78
|
+
trainingRecordSubjects: [
|
|
79
|
+
{
|
|
80
|
+
id: recordSubject.id,
|
|
81
|
+
name: '__MathNew__',
|
|
82
|
+
score: 96,
|
|
83
|
+
description: 'Updated math subject',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: '__English__',
|
|
87
|
+
score: 87,
|
|
88
|
+
description: 'English subject',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
} as any as DtoRecordUpdate;
|
|
92
|
+
await app.bean.executor.performAction('patch', '/training/record/:id', {
|
|
93
|
+
params: { id: recordId },
|
|
94
|
+
body: dataUpdate,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
record = await app.bean.executor.performAction('get', '/training/record/:id', {
|
|
98
|
+
params: { id: recordId },
|
|
99
|
+
});
|
|
100
|
+
const [updatedMathSubject, updatedEnglishSubject] = record.trainingRecordSubjects ?? [];
|
|
101
|
+
assert.equal(record.name, dataUpdate.name);
|
|
102
|
+
assert.equal(record.score, dataUpdate.score);
|
|
103
|
+
assert.equal(record.trainingRecordSubjects?.length, 2);
|
|
104
|
+
assert.equal(updatedMathSubject?.name, '__MathNew__');
|
|
105
|
+
assert.equal(updatedMathSubject?.score, 96);
|
|
106
|
+
assert.equal(updatedEnglishSubject?.name, '__English__');
|
|
107
|
+
assert.equal(updatedEnglishSubject?.score, 87);
|
|
108
|
+
|
|
109
|
+
student = await app.bean.executor.performAction('get', '/training/student/:id', {
|
|
110
|
+
params: { id: studentId },
|
|
111
|
+
});
|
|
112
|
+
studentRecord = student.trainingRecords?.find(
|
|
113
|
+
(item: any) => String(item.id) === String(recordId),
|
|
114
|
+
);
|
|
115
|
+
assert.equal(studentRecord?.name, dataUpdate.name);
|
|
116
|
+
assert.equal(studentRecord?.trainingRecordSubjects?.length, 2);
|
|
117
|
+
|
|
118
|
+
await app.bean.executor.performAction('delete', '/training/record/:id', {
|
|
119
|
+
params: { id: recordId },
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
record = await app.bean.executor.performAction('get', '/training/record/:id', {
|
|
123
|
+
params: { id: recordId },
|
|
124
|
+
});
|
|
125
|
+
assert.equal(record, undefined);
|
|
126
|
+
|
|
127
|
+
student = await app.bean.executor.performAction('get', '/training/student/:id', {
|
|
128
|
+
params: { id: studentId },
|
|
129
|
+
});
|
|
130
|
+
studentRecord = student.trainingRecords?.find(
|
|
131
|
+
(item: any) => String(item.id) === String(recordId),
|
|
132
|
+
);
|
|
133
|
+
assert.equal(studentRecord, undefined);
|
|
134
|
+
|
|
135
|
+
await app.bean.passport.signout();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vona-module-training-recordsubject",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Vona Module"
|
|
7
|
+
],
|
|
8
|
+
"author": "",
|
|
9
|
+
"files": [
|
|
10
|
+
"assets",
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": [
|
|
18
|
+
"./src/index.ts",
|
|
19
|
+
"./dist/index.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"import": "./src/index.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
28
|
+
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
29
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
30
|
+
"prepack": "clean-package",
|
|
31
|
+
"postpack": "clean-package restore"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"clean-package": "^2.2.0",
|
|
36
|
+
"rimraf": "^6.1.3"
|
|
37
|
+
},
|
|
38
|
+
"clean-package": {
|
|
39
|
+
"indent": 2,
|
|
40
|
+
"remove": [
|
|
41
|
+
"clean-package",
|
|
42
|
+
"devDependencies",
|
|
43
|
+
"exports.\\..import"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"title": "training-recordsubject",
|
|
47
|
+
"vonaModule": {
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"a-vona": "5.0.0"
|
|
50
|
+
},
|
|
51
|
+
"fileVersion": 1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
import type { TypeEntityMeta,TypeModelsClassLikeGeneral,TypeSymbolKeyFieldsMore } from 'vona-module-a-orm';
|
|
3
|
+
import type { TypeEntityOptionsFields } from 'vona-module-a-openapi';
|
|
4
|
+
import type { TableIdentity } from 'table-identity';
|
|
5
|
+
/** entity: begin */
|
|
6
|
+
export * from '../entity/subject.tsx';
|
|
7
|
+
import type { IEntityOptionsSubject } from '../entity/subject.tsx';
|
|
8
|
+
import 'vona-module-a-orm';
|
|
9
|
+
declare module 'vona-module-a-orm' {
|
|
10
|
+
|
|
11
|
+
export interface IEntityRecord {
|
|
12
|
+
'training-recordsubject:subject': IEntityOptionsSubject;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
declare module 'vona-module-training-recordsubject' {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
/** entity: end */
|
|
21
|
+
/** entity: begin */
|
|
22
|
+
import type { EntitySubject } from '../entity/subject.tsx';
|
|
23
|
+
export interface IModuleEntity {
|
|
24
|
+
'subject': EntitySubjectMeta;
|
|
25
|
+
}
|
|
26
|
+
/** entity: end */
|
|
27
|
+
/** entity: begin */
|
|
28
|
+
export type EntitySubjectTableName = 'trainingRecordSubject';
|
|
29
|
+
export type EntitySubjectMeta=TypeEntityMeta<EntitySubject,EntitySubjectTableName>;
|
|
30
|
+
declare module 'vona-module-a-orm' {
|
|
31
|
+
export interface ITableRecord {
|
|
32
|
+
'trainingRecordSubject': EntitySubjectMeta;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
declare module 'vona-module-training-recordsubject' {
|
|
36
|
+
|
|
37
|
+
export interface IEntityOptionsSubject {
|
|
38
|
+
fields?: TypeEntityOptionsFields<EntitySubject, IEntityOptionsSubject[TypeSymbolKeyFieldsMore]>;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** entity: end */
|
|
42
|
+
/** model: begin */
|
|
43
|
+
export * from '../model/subject.ts';
|
|
44
|
+
import type { IModelOptionsSubject } from '../model/subject.ts';
|
|
45
|
+
import 'vona-module-a-orm';
|
|
46
|
+
declare module 'vona-module-a-orm' {
|
|
47
|
+
|
|
48
|
+
export interface IModelRecord {
|
|
49
|
+
'training-recordsubject:subject': IModelOptionsSubject;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
declare module 'vona-module-training-recordsubject' {
|
|
55
|
+
|
|
56
|
+
export interface ModelSubject {
|
|
57
|
+
/** @internal */
|
|
58
|
+
get scope(): ScopeModuleTrainingRecordsubject;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ModelSubject {
|
|
62
|
+
get $beanFullName(): 'training-recordsubject.model.subject';
|
|
63
|
+
get $onionName(): 'training-recordsubject:subject';
|
|
64
|
+
get $onionOptions(): IModelOptionsSubject;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** model: end */
|
|
68
|
+
/** model: begin */
|
|
69
|
+
import type { ModelSubject } from '../model/subject.ts';
|
|
70
|
+
export interface IModuleModel {
|
|
71
|
+
'subject': ModelSubject;
|
|
72
|
+
}
|
|
73
|
+
/** model: end */
|
|
74
|
+
/** model: begin */
|
|
75
|
+
|
|
76
|
+
import 'vona';
|
|
77
|
+
declare module 'vona' {
|
|
78
|
+
export interface IBeanRecordGeneral {
|
|
79
|
+
'training-recordsubject.model.subject': ModelSubject;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** model: end */
|
|
83
|
+
/** model: begin */
|
|
84
|
+
import type { IModelGetOptions, IModelMethodOptions, IModelSelectParams, TypeModelSelectAndCount, TypeModelRelationResult, TypeModelWhere, IModelInsertOptions, TypeModelMutateRelationData, IModelDeleteOptions, IModelUpdateOptions, IModelMutateOptions, IModelSelectCountParams, IModelIncrementParams, IModelSelectAggrParams, TypeModelAggrRelationResult, IModelSelectGroupParams, TypeModelGroupRelationResult } from 'vona-module-a-orm';
|
|
85
|
+
import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from 'vona-module-a-orm';
|
|
86
|
+
declare module 'vona-module-training-recordsubject' {
|
|
87
|
+
|
|
88
|
+
export interface ModelSubject {
|
|
89
|
+
[SymbolKeyEntity]: EntitySubject;
|
|
90
|
+
[SymbolKeyEntityMeta]: EntitySubjectMeta;
|
|
91
|
+
[SymbolKeyModelOptions]: IModelOptionsSubject;
|
|
92
|
+
get<T extends IModelGetOptions<EntitySubject,ModelSubject>>(where: TypeModelWhere<EntitySubject>, options?: T): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T> | undefined>;
|
|
93
|
+
mget<T extends IModelGetOptions<EntitySubject,ModelSubject>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T>[]>;
|
|
94
|
+
selectAndCount<T extends IModelSelectParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntitySubject, ModelSubject, T>>;
|
|
95
|
+
select<T extends IModelSelectParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T>[]>;
|
|
96
|
+
insert<T extends IModelInsertOptions<EntitySubject,ModelSubject>>(data?: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>, options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T, true>>;
|
|
97
|
+
insertBulk<T extends IModelInsertOptions<EntitySubject,ModelSubject>>(items: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>[], options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T, true>[]>;
|
|
98
|
+
update<T extends IModelUpdateOptions<EntitySubject,ModelSubject>>(data: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>, options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T>>;
|
|
99
|
+
updateBulk<T extends IModelUpdateOptions<EntitySubject,ModelSubject>>(items: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>[], options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T>[]>;
|
|
100
|
+
delete<T extends IModelDeleteOptions<EntitySubject,ModelSubject>>(where?: TypeModelWhere<EntitySubject>, options?: T): Promise<void>;
|
|
101
|
+
deleteBulk<T extends IModelDeleteOptions<EntitySubject,ModelSubject>>(ids: TableIdentity[], options?: T): Promise<void>;
|
|
102
|
+
mutate<T extends IModelMutateOptions<EntitySubject,ModelSubject>>(data?: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>, options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T>>;
|
|
103
|
+
mutateBulk<T extends IModelMutateOptions<EntitySubject,ModelSubject>>(items: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>[], options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T>[]>;
|
|
104
|
+
count<T extends IModelSelectCountParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<string | undefined>;
|
|
105
|
+
increment<T extends IModelIncrementParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
106
|
+
decrement<T extends IModelIncrementParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
107
|
+
aggregate<T extends IModelSelectAggrParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
108
|
+
group<T extends IModelSelectGroupParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntitySubject, T>[]>;
|
|
109
|
+
getById<T extends IModelGetOptions<EntitySubject,ModelSubject>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T> | undefined>;
|
|
110
|
+
updateById<T extends IModelUpdateOptions<EntitySubject,ModelSubject>>(id: TableIdentity, data: TypeModelMutateRelationData<EntitySubject,ModelSubject, T>, options?: T): Promise<TypeModelMutateRelationData<EntitySubject,ModelSubject, T>>;
|
|
111
|
+
deleteById<T extends IModelDeleteOptions<EntitySubject,ModelSubject>>(id: TableIdentity, options?: T): Promise<void>;
|
|
112
|
+
getByName<T extends IModelGetOptions<EntitySubject,ModelSubject>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T> | undefined>;
|
|
113
|
+
getByNameEqI<T extends IModelGetOptions<EntitySubject,ModelSubject>>(name?: string, options?: T): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T> | undefined>;
|
|
114
|
+
selectByName<T extends IModelSelectParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T>[]>;
|
|
115
|
+
selectByNameEqI<T extends IModelSelectParams<EntitySubject,ModelSubject,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(name?: string, params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntitySubject, ModelSubject, T>[]>;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
declare module 'vona-module-a-orm' {
|
|
119
|
+
export interface IModelClassRecord {
|
|
120
|
+
'training-recordsubject:subject': ModelSubject;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** model: end */
|
|
124
|
+
/** meta: begin */
|
|
125
|
+
export * from '../bean/meta.index.ts';
|
|
126
|
+
export * from '../bean/meta.version.ts';
|
|
127
|
+
import type { IMetaOptionsIndex } from 'vona-module-a-index';
|
|
128
|
+
import 'vona-module-a-meta';
|
|
129
|
+
declare module 'vona-module-a-meta' {
|
|
130
|
+
|
|
131
|
+
export interface IMetaRecord {
|
|
132
|
+
'training-recordsubject:index': IMetaOptionsIndex;
|
|
133
|
+
'training-recordsubject:version': never;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
declare module 'vona-module-training-recordsubject' {
|
|
139
|
+
|
|
140
|
+
export interface MetaIndex {
|
|
141
|
+
/** @internal */
|
|
142
|
+
get scope(): ScopeModuleTrainingRecordsubject;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface MetaIndex {
|
|
146
|
+
get $beanFullName(): 'training-recordsubject.meta.index';
|
|
147
|
+
get $onionName(): 'training-recordsubject:index';
|
|
148
|
+
get $onionOptions(): IMetaOptionsIndex;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface MetaVersion {
|
|
152
|
+
/** @internal */
|
|
153
|
+
get scope(): ScopeModuleTrainingRecordsubject;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface MetaVersion {
|
|
157
|
+
get $beanFullName(): 'training-recordsubject.meta.version';
|
|
158
|
+
get $onionName(): 'training-recordsubject:version';
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** meta: end */
|
|
163
|
+
/** locale: begin */
|
|
164
|
+
import { locales } from './locales.ts';
|
|
165
|
+
/** locale: end */
|
|
166
|
+
/** scope: begin */
|
|
167
|
+
import { BeanScopeBase, type BeanScopeUtil, type TypeModuleLocales, type TypeLocaleBase } from 'vona';
|
|
168
|
+
import { Scope } from 'vona-module-a-bean';
|
|
169
|
+
|
|
170
|
+
@Scope()
|
|
171
|
+
export class ScopeModuleTrainingRecordsubject extends BeanScopeBase {}
|
|
172
|
+
|
|
173
|
+
export interface ScopeModuleTrainingRecordsubject {
|
|
174
|
+
util: BeanScopeUtil;
|
|
175
|
+
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
176
|
+
entity: IModuleEntity;
|
|
177
|
+
model: IModuleModel;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
import 'vona';
|
|
181
|
+
declare module 'vona' {
|
|
182
|
+
export interface IBeanScopeRecord {
|
|
183
|
+
'training-recordsubject': ScopeModuleTrainingRecordsubject;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface IBeanScopeContainer {
|
|
187
|
+
trainingRecordsubject: ScopeModuleTrainingRecordsubject;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
export interface IBeanScopeLocale {
|
|
193
|
+
'training-recordsubject': (typeof locales)[TypeLocaleBase];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
/** scope: end */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TypeLocaleBase } from 'vona';
|
|
2
|
+
|
|
3
|
+
import { $makeLocaleMagic } from 'vona';
|
|
4
|
+
|
|
5
|
+
import locale_en_us from '../config/locale/en-us.ts';
|
|
6
|
+
import locale_zh_cn from '../config/locale/zh-cn.ts';
|
|
7
|
+
|
|
8
|
+
export const locales = {
|
|
9
|
+
'en-us': locale_en_us,
|
|
10
|
+
'zh-cn': locale_zh_cn,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
14
|
+
key: K,
|
|
15
|
+
...args: any[]
|
|
16
|
+
): any {
|
|
17
|
+
return $makeLocaleMagic(`training-recordsubject::${key}`, ...args);
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IMetaOptionsIndex } from 'vona-module-a-index';
|
|
2
|
+
|
|
3
|
+
import { BeanBase } from 'vona';
|
|
4
|
+
import { Meta } from 'vona-module-a-meta';
|
|
5
|
+
import { $tableColumns } from 'vona-module-a-ormutils';
|
|
6
|
+
|
|
7
|
+
@Meta<IMetaOptionsIndex>({
|
|
8
|
+
indexes: {
|
|
9
|
+
...$tableColumns('trainingRecordSubject', 'recordId'),
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class MetaIndex extends BeanBase {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IMetaVersionUpdate, IMetaVersionUpdateOptions } from 'vona-module-a-version';
|
|
2
|
+
|
|
3
|
+
import { BeanBase } from 'vona';
|
|
4
|
+
import { Meta } from 'vona-module-a-meta';
|
|
5
|
+
|
|
6
|
+
@Meta()
|
|
7
|
+
export class MetaVersion extends BeanBase implements IMetaVersionUpdate {
|
|
8
|
+
async update(options: IMetaVersionUpdateOptions) {
|
|
9
|
+
if (options.version === 1) {
|
|
10
|
+
const entitySubject = this.scope.entity.subject;
|
|
11
|
+
await this.bean.model.createTable(entitySubject.$table, table => {
|
|
12
|
+
table.comment(entitySubject.$comment.$table);
|
|
13
|
+
table.basicFields();
|
|
14
|
+
table.tableIdentity(entitySubject.recordId).comment(entitySubject.$comment.recordId);
|
|
15
|
+
table.string(entitySubject.name, 50).comment(entitySubject.$comment.name);
|
|
16
|
+
table.integer(entitySubject.score).comment(entitySubject.$comment.score);
|
|
17
|
+
table.string(entitySubject.description, 255).comment(entitySubject.$comment.description);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
3
|
+
|
|
4
|
+
import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
|
|
5
|
+
import { Entity, EntityBase } from 'vona-module-a-orm';
|
|
6
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
|
+
|
|
8
|
+
import { $locale } from '../.metadata/locales.ts';
|
|
9
|
+
|
|
10
|
+
export interface IEntityOptionsSubject extends IDecoratorEntityOptions {}
|
|
11
|
+
|
|
12
|
+
@Entity<IEntityOptionsSubject>('trainingRecordSubject', {
|
|
13
|
+
openapi: { title: $locale('TrainingRecordSubject') },
|
|
14
|
+
fields: {
|
|
15
|
+
id: $makeMetadata(ZovaRender.order(1, 'core')),
|
|
16
|
+
iid: $makeMetadata(ZovaRender.visible(false)),
|
|
17
|
+
deleted: $makeMetadata(ZovaRender.visible(false)),
|
|
18
|
+
createdAt: $makeMetadata(
|
|
19
|
+
ZovaRender.order(-2, 'max'),
|
|
20
|
+
ZovaRender.field('basic-date:formFieldDate'),
|
|
21
|
+
ZovaRender.cell('basic-date:date'),
|
|
22
|
+
),
|
|
23
|
+
updatedAt: $makeMetadata(
|
|
24
|
+
ZovaRender.order(-1, 'max'),
|
|
25
|
+
ZovaRender.field('basic-date:formFieldDate'),
|
|
26
|
+
ZovaRender.cell('basic-date:date'),
|
|
27
|
+
),
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
export class EntitySubject extends EntityBase {
|
|
31
|
+
@Api.field(v.required(), ZovaRender.visible(false))
|
|
32
|
+
recordId: TableIdentity;
|
|
33
|
+
|
|
34
|
+
@Api.field(v.title($locale('Name')), v.required(), v.min(2), ZovaRender.order(1))
|
|
35
|
+
name: string;
|
|
36
|
+
|
|
37
|
+
@Api.field(v.title($locale('Score')), v.optional(), ZovaRender.order(2))
|
|
38
|
+
score?: number;
|
|
39
|
+
|
|
40
|
+
@Api.field(v.title($locale('Description')), v.optional(), ZovaRender.order(3))
|
|
41
|
+
description?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDecoratorModelOptions } from 'vona-module-a-orm';
|
|
2
|
+
|
|
3
|
+
import { BeanModelBase, Model } from 'vona-module-a-orm';
|
|
4
|
+
|
|
5
|
+
import { EntitySubject } from '../entity/subject.tsx';
|
|
6
|
+
|
|
7
|
+
export interface IModelOptionsSubject extends IDecoratorModelOptions<EntitySubject> {}
|
|
8
|
+
|
|
9
|
+
@Model<IModelOptionsSubject>({ entity: EntitySubject })
|
|
10
|
+
export class ModelSubject extends BeanModelBase<EntitySubject> {}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/vona.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
29
29
|
"prepublishOnly": "npm run tsc:publish",
|
|
30
30
|
"prepack": "clean-package",
|
|
31
|
-
"postpack": "clean-package restore
|
|
31
|
+
"postpack": "clean-package restore"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"devDependencies": {
|
|
@@ -12,5 +12,12 @@ export default {
|
|
|
12
12
|
LevelTitle: 'Level Title',
|
|
13
13
|
DescriptionLength: 'Description Length',
|
|
14
14
|
ForceDelete: 'Force Delete',
|
|
15
|
-
TrainingRecords: 'Training Records',
|
|
15
|
+
TrainingRecords: 'Student Training Records',
|
|
16
|
+
AddTrainingRecord: 'Add Student Training Record',
|
|
17
|
+
EditTrainingRecord: 'Edit Student Training Record',
|
|
18
|
+
ViewTrainingRecord: 'View Student Training Record',
|
|
19
|
+
TrainingRecordSubjects: 'Student Training Record Details',
|
|
20
|
+
AddTrainingRecordSubject: 'Add Student Training Record Detail',
|
|
21
|
+
EditTrainingRecordSubject: 'Edit Student Training Record Detail',
|
|
22
|
+
ViewTrainingRecordSubject: 'View Student Training Record Detail',
|
|
16
23
|
};
|
|
@@ -12,5 +12,12 @@ export default {
|
|
|
12
12
|
LevelTitle: '阶段名称',
|
|
13
13
|
DescriptionLength: '描述长度',
|
|
14
14
|
ForceDelete: '强制删除',
|
|
15
|
-
TrainingRecords: '
|
|
15
|
+
TrainingRecords: '学生培训记录',
|
|
16
|
+
AddTrainingRecord: '添加学生培训记录',
|
|
17
|
+
EditTrainingRecord: '编辑学生培训记录',
|
|
18
|
+
ViewTrainingRecord: '查看学生培训记录',
|
|
19
|
+
TrainingRecordSubjects: '学生培训记录明细',
|
|
20
|
+
AddTrainingRecordSubject: '添加学生培训记录明细',
|
|
21
|
+
EditTrainingRecordSubject: '编辑学生培训记录明细',
|
|
22
|
+
ViewTrainingRecordSubject: '查看学生培训记录明细',
|
|
16
23
|
};
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
|
|
3
|
+
import { $makeMetadata, v } from 'vona-module-a-openapiutils';
|
|
3
4
|
import { $Dto } from 'vona-module-a-orm';
|
|
4
5
|
import { Dto } from 'vona-module-a-web';
|
|
5
6
|
import { ModelRecord } from 'vona-module-training-record';
|
|
7
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
8
|
+
|
|
9
|
+
import { $locale } from '../.metadata/locales.ts';
|
|
6
10
|
|
|
7
11
|
export interface IDtoOptionsDetailRecordBase extends IDecoratorDtoOptions {}
|
|
8
12
|
|
|
9
|
-
@Dto<IDtoOptionsDetailRecordBase>(
|
|
13
|
+
@Dto<IDtoOptionsDetailRecordBase>({
|
|
14
|
+
fields: {
|
|
15
|
+
id: $makeMetadata(ZovaRender.visible(false)),
|
|
16
|
+
trainingRecordSubjects: $makeMetadata(
|
|
17
|
+
v.title($locale('TrainingRecordSubjects')),
|
|
18
|
+
ZovaRender.order(4),
|
|
19
|
+
ZovaRender.field('basic-details:formFieldDetails'),
|
|
20
|
+
v.optional(),
|
|
21
|
+
),
|
|
22
|
+
},
|
|
23
|
+
})
|
|
10
24
|
export class DtoDetailRecordBase extends $Dto.get(() => ModelRecord, {
|
|
11
|
-
columns: ['id', 'name', 'score', 'description'],
|
|
25
|
+
columns: ['id', 'deleted', 'name', 'score', 'description'],
|
|
26
|
+
include: { trainingRecordSubjects: true },
|
|
12
27
|
}) {}
|