cabloy 5.1.66 → 5.1.68
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 +28 -0
- package/package.json +1 -1
- 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/package.json +2 -2
- package/vona/packages-utils/zod-query/package.json +1 -1
- package/vona/packages-utils/zod-query/src/lib/query.ts +4 -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-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +777 -840
- package/vona/pnpm-workspace.yaml +1 -1
- 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/meta.version.ts +4 -1
- 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 +14 -3
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +14 -3
- 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 +39 -7
- 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 +162 -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/.metadata/index.ts +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +9 -5
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +9 -5
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +20 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +11 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +11 -2
- 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/entity/student.tsx +3 -1
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +9 -1
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +17 -5
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +88 -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-orm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +4 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +5 -3
- 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 +5 -0
- 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-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 +2 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/pnpm-lock.yaml +186 -142
- package/zova/pnpm-workspace.yaml +1 -1
- 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 +1 -1
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +52 -24
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +860 -307
- 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-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-date/src/.metadata/component/date.ts +61 -0
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/.metadata/index.ts +17 -4
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/component/date/controller.tsx +44 -0
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/component/formFieldDate/controller.tsx +49 -9
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/lib/utils.ts +60 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/src/types/date.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +1 -1
- 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/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/package.json +2 -2
- 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-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 +2 -2
- 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-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/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +3 -3
- 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,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,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
Description: 'Description',
|
|
3
|
+
Operations: 'Operations',
|
|
4
|
+
Subject: 'Subject',
|
|
5
|
+
SubjectName: 'Subject Name',
|
|
6
|
+
SubjectScore: 'Subject Score',
|
|
7
|
+
TrainingRecord: 'Student Training Record',
|
|
8
|
+
TrainingRecordSubject: 'Student Training Record Detail',
|
|
9
|
+
};
|
|
@@ -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('SubjectName')), v.required(), v.min(2), ZovaRender.order(1))
|
|
35
|
+
name: string;
|
|
36
|
+
|
|
37
|
+
@Api.field(v.title($locale('SubjectScore')), v.required(), 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": {
|
|
@@ -86,7 +86,7 @@ import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from 'von
|
|
|
86
86
|
declare module 'vona-module-training-student' {
|
|
87
87
|
export interface IModelOptionsStudent {
|
|
88
88
|
relations: {
|
|
89
|
-
trainingRecords: IModelRelationHasMany<'training-record:record', 'studentId', false, 'id'|'name'|'
|
|
89
|
+
trainingRecords: IModelRelationHasMany<'training-record:record', 'studentId', false, 'id'|'name'|'subjectCount'|'totalScore'|'averageScore'|'trainingTime'|'description', undefined, undefined, undefined>;
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
export interface ModelStudent {
|
|
@@ -5,15 +5,19 @@ export default {
|
|
|
5
5
|
LevelBeginner: 'Foundation Track',
|
|
6
6
|
LevelIntermediate: 'Progress Track',
|
|
7
7
|
Mobile: 'Mobile',
|
|
8
|
-
Name: 'Name',
|
|
9
8
|
Operations: 'Operations',
|
|
10
9
|
Student: 'Student',
|
|
10
|
+
StudentName: 'Student Name',
|
|
11
11
|
Summary: 'Summary',
|
|
12
12
|
LevelTitle: 'Level Title',
|
|
13
13
|
DescriptionLength: 'Description Length',
|
|
14
14
|
ForceDelete: 'Force Delete',
|
|
15
|
-
TrainingRecords: 'Training Records',
|
|
16
|
-
AddTrainingRecord: 'Add Training Record',
|
|
17
|
-
EditTrainingRecord: 'Edit Training Record',
|
|
18
|
-
ViewTrainingRecord: 'View Training Record',
|
|
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',
|
|
19
23
|
};
|
|
@@ -5,15 +5,19 @@ export default {
|
|
|
5
5
|
LevelBeginner: '基础班',
|
|
6
6
|
LevelIntermediate: '提升班',
|
|
7
7
|
Mobile: '手机号',
|
|
8
|
-
Name: '名称',
|
|
9
8
|
Operations: '操作',
|
|
10
9
|
Student: '学生',
|
|
10
|
+
StudentName: '学生姓名',
|
|
11
11
|
Summary: '摘要',
|
|
12
12
|
LevelTitle: '阶段名称',
|
|
13
13
|
DescriptionLength: '描述长度',
|
|
14
14
|
ForceDelete: '强制删除',
|
|
15
|
-
TrainingRecords: '
|
|
16
|
-
AddTrainingRecord: '
|
|
17
|
-
EditTrainingRecord: '
|
|
18
|
-
ViewTrainingRecord: '
|
|
15
|
+
TrainingRecords: '学生培训记录',
|
|
16
|
+
AddTrainingRecord: '添加学生培训记录',
|
|
17
|
+
EditTrainingRecord: '编辑学生培训记录',
|
|
18
|
+
ViewTrainingRecord: '查看学生培训记录',
|
|
19
|
+
TrainingRecordSubjects: '学生培训记录明细',
|
|
20
|
+
AddTrainingRecordSubject: '添加学生培训记录明细',
|
|
21
|
+
EditTrainingRecordSubject: '编辑学生培训记录明细',
|
|
22
|
+
ViewTrainingRecordSubject: '查看学生培训记录明细',
|
|
19
23
|
};
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
|
|
3
|
-
import { $makeMetadata } from 'vona-module-a-openapiutils';
|
|
3
|
+
import { $makeMetadata, v } from 'vona-module-a-openapiutils';
|
|
4
4
|
import { $Dto } from 'vona-module-a-orm';
|
|
5
5
|
import { Dto } from 'vona-module-a-web';
|
|
6
6
|
import { ModelRecord } from 'vona-module-training-record';
|
|
7
7
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
8
8
|
|
|
9
|
+
import { $locale } from '../.metadata/locales.ts';
|
|
10
|
+
|
|
9
11
|
export interface IDtoOptionsDetailRecordBase extends IDecoratorDtoOptions {}
|
|
10
12
|
|
|
11
13
|
@Dto<IDtoOptionsDetailRecordBase>({
|
|
12
14
|
fields: {
|
|
13
15
|
id: $makeMetadata(ZovaRender.visible(false)),
|
|
16
|
+
trainingRecordSubjects: $makeMetadata(
|
|
17
|
+
v.title($locale('TrainingRecordSubjects')),
|
|
18
|
+
ZovaRender.order(8),
|
|
19
|
+
ZovaRender.field('basic-details:formFieldDetails'),
|
|
20
|
+
v.optional(),
|
|
21
|
+
),
|
|
14
22
|
},
|
|
15
23
|
})
|
|
16
24
|
export class DtoDetailRecordBase extends $Dto.get(() => ModelRecord, {
|
|
17
|
-
columns: [
|
|
25
|
+
columns: [
|
|
26
|
+
'id',
|
|
27
|
+
'deleted',
|
|
28
|
+
'name',
|
|
29
|
+
'subjectCount',
|
|
30
|
+
'totalScore',
|
|
31
|
+
'averageScore',
|
|
32
|
+
'trainingTime',
|
|
33
|
+
'description',
|
|
34
|
+
],
|
|
35
|
+
include: { trainingRecordSubjects: true },
|
|
18
36
|
}) {}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
|
|
3
|
+
import { Api, 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
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DtoDetailRecordSubjectMutate,
|
|
8
|
+
DtoDetailRecordSubjectResItem,
|
|
9
|
+
ModelRecord,
|
|
10
|
+
} from 'vona-module-training-record';
|
|
6
11
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
12
|
|
|
8
13
|
import { DtoDetailRecordBase } from './detailRecordBase.tsx';
|
|
@@ -14,4 +19,8 @@ export interface IDtoOptionsDetailRecordMutate extends IDecoratorDtoOptions {}
|
|
|
14
19
|
})
|
|
15
20
|
export class DtoDetailRecordMutate extends $Dto.mutate(() => ModelRecord, {
|
|
16
21
|
dtoClass: DtoDetailRecordBase,
|
|
17
|
-
|
|
22
|
+
include: { trainingRecordSubjects: { dtoClass: DtoDetailRecordSubjectMutate } },
|
|
23
|
+
}) {
|
|
24
|
+
@Api.field(ZovaRender.visible(false), v.optional(), v.array(DtoDetailRecordSubjectResItem))
|
|
25
|
+
_trainingRecordSubjects?: DtoDetailRecordSubjectResItem[];
|
|
26
|
+
}
|
|
@@ -37,6 +37,7 @@ export interface IDtoOptionsDetailRecordResItem extends IDecoratorDtoOptions {}
|
|
|
37
37
|
})
|
|
38
38
|
export class DtoDetailRecordResItem extends $Dto.get(() => ModelRecord, {
|
|
39
39
|
dtoClass: DtoDetailRecordBase,
|
|
40
|
+
include: { trainingRecordSubjects: false },
|
|
40
41
|
}) {
|
|
41
42
|
@Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('basic-details:lineNumber'))
|
|
42
43
|
_lineNumber?: number;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
|
|
3
|
+
import { Api, 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
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DtoDetailRecordSubjectResItem,
|
|
8
|
+
DtoDetailRecordSubjectView,
|
|
9
|
+
ModelRecord,
|
|
10
|
+
} from 'vona-module-training-record';
|
|
6
11
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
12
|
|
|
8
13
|
import { DtoDetailRecordBase } from './detailRecordBase.tsx';
|
|
@@ -14,4 +19,8 @@ export interface IDtoOptionsDetailRecordView extends IDecoratorDtoOptions {}
|
|
|
14
19
|
})
|
|
15
20
|
export class DtoDetailRecordView extends $Dto.get(() => ModelRecord, {
|
|
16
21
|
dtoClass: DtoDetailRecordBase,
|
|
17
|
-
|
|
22
|
+
include: { trainingRecordSubjects: { dtoClass: DtoDetailRecordSubjectView } },
|
|
23
|
+
}) {
|
|
24
|
+
@Api.field(ZovaRender.visible(false), v.optional(), v.array(DtoDetailRecordSubjectResItem))
|
|
25
|
+
_trainingRecordSubjects?: DtoDetailRecordSubjectResItem[];
|
|
26
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
|
2
2
|
|
|
3
3
|
import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
|
|
4
4
|
import { Entity, EntityBase } from 'vona-module-a-orm';
|
|
5
|
+
import z from 'zod';
|
|
5
6
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
6
7
|
|
|
7
8
|
import { $locale } from '../.metadata/locales.ts';
|
|
@@ -34,7 +35,7 @@ export interface IEntityOptionsStudent extends IDecoratorEntityOptions {}
|
|
|
34
35
|
})
|
|
35
36
|
export class EntityStudent extends EntityBase {
|
|
36
37
|
@Api.field(
|
|
37
|
-
v.title($locale('
|
|
38
|
+
v.title($locale('StudentName')),
|
|
38
39
|
v.required(),
|
|
39
40
|
v.min(2),
|
|
40
41
|
ZovaRender.order(1),
|
|
@@ -75,6 +76,7 @@ export class EntityStudent extends EntityBase {
|
|
|
75
76
|
}),
|
|
76
77
|
// Tutorial 4 custom table cell renderer example used by the current implementation.
|
|
77
78
|
ZovaRender.cell('training-student:level', { items: studentLevelItems }),
|
|
79
|
+
z.union([z.literal(1), z.literal(2), z.literal(3)]),
|
|
78
80
|
)
|
|
79
81
|
level: number;
|
|
80
82
|
}
|
|
@@ -10,7 +10,15 @@ export interface IModelOptionsStudent extends IDecoratorModelOptions<EntityStude
|
|
|
10
10
|
entity: EntityStudent,
|
|
11
11
|
relations: {
|
|
12
12
|
trainingRecords: $relation.hasMany('training-record:record', 'studentId', {
|
|
13
|
-
columns: [
|
|
13
|
+
columns: [
|
|
14
|
+
'id',
|
|
15
|
+
'name',
|
|
16
|
+
'subjectCount',
|
|
17
|
+
'totalScore',
|
|
18
|
+
'averageScore',
|
|
19
|
+
'trainingTime',
|
|
20
|
+
'description',
|
|
21
|
+
],
|
|
14
22
|
}),
|
|
15
23
|
},
|
|
16
24
|
})
|
|
@@ -12,10 +12,18 @@ import type { DtoStudentView } from '../dto/studentView.tsx';
|
|
|
12
12
|
import type { EntityStudent } from '../entity/student.tsx';
|
|
13
13
|
import type { ModelStudent } from '../model/student.ts';
|
|
14
14
|
|
|
15
|
+
function getStudentRecordSubjectsInclude(): {
|
|
16
|
+
trainingRecords: { include: { trainingRecordSubjects: true } };
|
|
17
|
+
} {
|
|
18
|
+
return { trainingRecords: { include: { trainingRecordSubjects: true } } };
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
@Service()
|
|
16
22
|
export class ServiceStudent extends BeanBase {
|
|
17
23
|
async create(student: DtoStudentCreate): Promise<EntityStudent> {
|
|
18
|
-
return await this.scope.model.student.insert(student, {
|
|
24
|
+
return await this.scope.model.student.insert(student, {
|
|
25
|
+
include: getStudentRecordSubjectsInclude(),
|
|
26
|
+
});
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
async select(params?: IQueryParams<ModelStudent>): Promise<DtoStudentSelectRes> {
|
|
@@ -23,12 +31,14 @@ export class ServiceStudent extends BeanBase {
|
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
async view(id: TableIdentity): Promise<DtoStudentView | undefined> {
|
|
26
|
-
return await this.scope.model.student.getById(id, {
|
|
34
|
+
return await this.scope.model.student.getById(id, {
|
|
35
|
+
include: getStudentRecordSubjectsInclude(),
|
|
36
|
+
});
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
async update(id: TableIdentity, student: DtoStudentUpdate) {
|
|
30
40
|
return await this.scope.model.student.updateById(id, student, {
|
|
31
|
-
include:
|
|
41
|
+
include: getStudentRecordSubjectsInclude(),
|
|
32
42
|
});
|
|
33
43
|
}
|
|
34
44
|
|
|
@@ -50,13 +60,15 @@ export class ServiceStudent extends BeanBase {
|
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
async delete(id: TableIdentity) {
|
|
53
|
-
return await this.scope.model.student.deleteById(id, {
|
|
63
|
+
return await this.scope.model.student.deleteById(id, {
|
|
64
|
+
include: getStudentRecordSubjectsInclude(),
|
|
65
|
+
});
|
|
54
66
|
}
|
|
55
67
|
|
|
56
68
|
async deleteForce(id: TableIdentity) {
|
|
57
69
|
return await this.scope.model.student.deleteById(id, {
|
|
58
70
|
disableDeleted: true,
|
|
59
|
-
include:
|
|
71
|
+
include: getStudentRecordSubjectsInclude(),
|
|
60
72
|
});
|
|
61
73
|
}
|
|
62
74
|
}
|