cabloy 5.1.63 → 5.1.64
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +78 -2
- package/vona/src/suite/a-training/modules/training-record/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +198 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-record/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-record/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +7 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +7 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +48 -0
- package/vona/src/suite/a-training/modules/training-record/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-record/src/model/record.ts +10 -0
- package/vona/src/suite/a-training/modules/training-record/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-record/tsconfig.json +7 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +39 -3
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +12 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +31 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +41 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +16 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +4 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +4 -1
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +9 -2
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +1 -1
- package/vona/src/suite/a-training/package.json +1 -0
- package/vona/src/suite/a-training/tsconfig.json +3 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dto.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoGet.ts +3 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoMutate.ts +2 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGeneral.ts +3 -0
- 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/component/boilerplateBlockPage/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateBlockPageEntry/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateFormActionRow/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateFormField/controller.tsx_ +2 -1
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateTableActionBulk/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +22 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +1 -1
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/actionCreate.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetails.ts +34 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetailsToolbarBulk.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/formFieldDetails.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +116 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +42 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +114 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetailsToolbarBulk/controller.tsx +61 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +105 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/en-us.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/index.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +8 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/details.ts +7 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detailsActionBulk.ts +24 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/index.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/index.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/permissions.ts +6 -0
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable
|
|
2
|
-
import type { TypeEntityMeta,TypeModelsClassLikeGeneral,TypeSymbolKeyFieldsMore } from 'vona-module-a-orm';
|
|
2
|
+
import type { TypeEntityMeta,TypeModelsClassLikeGeneral,TypeSymbolKeyFieldsMore,IModelRelationHasMany } from 'vona-module-a-orm';
|
|
3
3
|
import type { TypeEntityOptionsFields,TypeControllerOptionsActions } from 'vona-module-a-openapi';
|
|
4
4
|
import type { TableIdentity } from 'table-identity';
|
|
5
5
|
/** entity: begin */
|
|
@@ -84,7 +84,11 @@ declare module 'vona' {
|
|
|
84
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
85
|
import { SymbolKeyEntity, SymbolKeyEntityMeta, SymbolKeyModelOptions } from 'vona-module-a-orm';
|
|
86
86
|
declare module 'vona-module-training-student' {
|
|
87
|
-
|
|
87
|
+
export interface IModelOptionsStudent {
|
|
88
|
+
relations: {
|
|
89
|
+
trainingRecords: IModelRelationHasMany<'training-record:record', 'studentId', false, 'id'|'name'|'score'|'description', undefined, undefined, undefined>;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
88
92
|
export interface ModelStudent {
|
|
89
93
|
[SymbolKeyEntity]: EntityStudent;
|
|
90
94
|
[SymbolKeyEntityMeta]: EntityStudentMeta;
|
|
@@ -202,6 +206,10 @@ declare module 'vona-module-training-student' {
|
|
|
202
206
|
}
|
|
203
207
|
/** meta: end */
|
|
204
208
|
/** dto: begin */
|
|
209
|
+
export * from '../dto/detailRecordBase.tsx';
|
|
210
|
+
export * from '../dto/detailRecordMutate.tsx';
|
|
211
|
+
export * from '../dto/detailRecordResItem.tsx';
|
|
212
|
+
export * from '../dto/detailRecordView.tsx';
|
|
205
213
|
export * from '../dto/studentCreate.tsx';
|
|
206
214
|
export * from '../dto/studentSelectReq.tsx';
|
|
207
215
|
export * from '../dto/studentSelectRes.tsx';
|
|
@@ -209,6 +217,10 @@ export * from '../dto/studentSelectResItem.tsx';
|
|
|
209
217
|
export * from '../dto/studentSummary.tsx';
|
|
210
218
|
export * from '../dto/studentUpdate.tsx';
|
|
211
219
|
export * from '../dto/studentView.tsx';
|
|
220
|
+
import type { IDtoOptionsDetailRecordBase } from '../dto/detailRecordBase.tsx';
|
|
221
|
+
import type { IDtoOptionsDetailRecordMutate } from '../dto/detailRecordMutate.tsx';
|
|
222
|
+
import type { IDtoOptionsDetailRecordResItem } from '../dto/detailRecordResItem.tsx';
|
|
223
|
+
import type { IDtoOptionsDetailRecordView } from '../dto/detailRecordView.tsx';
|
|
212
224
|
import type { IDtoOptionsStudentCreate } from '../dto/studentCreate.tsx';
|
|
213
225
|
import type { IDtoOptionsStudentSelectReq } from '../dto/studentSelectReq.tsx';
|
|
214
226
|
import type { IDtoOptionsStudentSelectRes } from '../dto/studentSelectRes.tsx';
|
|
@@ -220,7 +232,11 @@ import 'vona-module-a-web';
|
|
|
220
232
|
declare module 'vona-module-a-web' {
|
|
221
233
|
|
|
222
234
|
export interface IDtoRecord {
|
|
223
|
-
'training-student:
|
|
235
|
+
'training-student:detailRecordBase': IDtoOptionsDetailRecordBase;
|
|
236
|
+
'training-student:detailRecordMutate': IDtoOptionsDetailRecordMutate;
|
|
237
|
+
'training-student:detailRecordResItem': IDtoOptionsDetailRecordResItem;
|
|
238
|
+
'training-student:detailRecordView': IDtoOptionsDetailRecordView;
|
|
239
|
+
'training-student:studentCreate': IDtoOptionsStudentCreate;
|
|
224
240
|
'training-student:studentSelectReq': IDtoOptionsStudentSelectReq;
|
|
225
241
|
'training-student:studentSelectRes': IDtoOptionsStudentSelectRes;
|
|
226
242
|
'training-student:studentSelectResItem': IDtoOptionsStudentSelectResItem;
|
|
@@ -236,6 +252,10 @@ declare module 'vona-module-training-student' {
|
|
|
236
252
|
}
|
|
237
253
|
/** dto: end */
|
|
238
254
|
/** dto: begin */
|
|
255
|
+
import type { DtoDetailRecordBase } from '../dto/detailRecordBase.tsx';
|
|
256
|
+
import type { DtoDetailRecordMutate } from '../dto/detailRecordMutate.tsx';
|
|
257
|
+
import type { DtoDetailRecordResItem } from '../dto/detailRecordResItem.tsx';
|
|
258
|
+
import type { DtoDetailRecordView } from '../dto/detailRecordView.tsx';
|
|
239
259
|
import type { DtoStudentCreate } from '../dto/studentCreate.tsx';
|
|
240
260
|
import type { DtoStudentSelectReq } from '../dto/studentSelectReq.tsx';
|
|
241
261
|
import type { DtoStudentSelectRes } from '../dto/studentSelectRes.tsx';
|
|
@@ -245,6 +265,22 @@ import type { DtoStudentUpdate } from '../dto/studentUpdate.tsx';
|
|
|
245
265
|
import type { DtoStudentView } from '../dto/studentView.tsx';
|
|
246
266
|
declare module 'vona-module-training-student' {
|
|
247
267
|
|
|
268
|
+
export interface IDtoOptionsDetailRecordBase {
|
|
269
|
+
fields?: TypeEntityOptionsFields<DtoDetailRecordBase, IDtoOptionsDetailRecordBase[TypeSymbolKeyFieldsMore]>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface IDtoOptionsDetailRecordMutate {
|
|
273
|
+
fields?: TypeEntityOptionsFields<DtoDetailRecordMutate, IDtoOptionsDetailRecordMutate[TypeSymbolKeyFieldsMore]>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface IDtoOptionsDetailRecordResItem {
|
|
277
|
+
fields?: TypeEntityOptionsFields<DtoDetailRecordResItem, IDtoOptionsDetailRecordResItem[TypeSymbolKeyFieldsMore]>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export interface IDtoOptionsDetailRecordView {
|
|
281
|
+
fields?: TypeEntityOptionsFields<DtoDetailRecordView, IDtoOptionsDetailRecordView[TypeSymbolKeyFieldsMore]>;
|
|
282
|
+
}
|
|
283
|
+
|
|
248
284
|
export interface IDtoOptionsStudentCreate {
|
|
249
285
|
fields?: TypeEntityOptionsFields<DtoStudentCreate, IDtoOptionsStudentCreate[TypeSymbolKeyFieldsMore]>;
|
|
250
286
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { ModelRecord } from 'vona-module-training-record';
|
|
6
|
+
|
|
7
|
+
export interface IDtoOptionsDetailRecordBase extends IDecoratorDtoOptions {}
|
|
8
|
+
|
|
9
|
+
@Dto<IDtoOptionsDetailRecordBase>()
|
|
10
|
+
export class DtoDetailRecordBase extends $Dto.get(() => ModelRecord, {
|
|
11
|
+
columns: ['id', 'name', 'score', 'description'],
|
|
12
|
+
}) {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { ModelRecord } from 'vona-module-training-record';
|
|
6
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
|
+
|
|
8
|
+
import { DtoDetailRecordBase } from './detailRecordBase.tsx';
|
|
9
|
+
|
|
10
|
+
export interface IDtoOptionsDetailRecordMutate extends IDecoratorDtoOptions {}
|
|
11
|
+
|
|
12
|
+
@Dto<IDtoOptionsDetailRecordMutate>({
|
|
13
|
+
blocks: [
|
|
14
|
+
ZovaRender.block('basic-pageentry:blockPageEntry', {
|
|
15
|
+
blocks: [
|
|
16
|
+
ZovaRender.block('basic-pageentry:blockForm'),
|
|
17
|
+
ZovaRender.block('basic-pageentry:blockToolbarRow', {
|
|
18
|
+
actions: [
|
|
19
|
+
ZovaRender.formActionRow('basic-form:actionSubmit', {
|
|
20
|
+
permission: { actionInherit: 'update', formScene: ['create', 'edit'] },
|
|
21
|
+
}),
|
|
22
|
+
ZovaRender.formActionRow('basic-form:actionBack', { permission: { public: true } }),
|
|
23
|
+
],
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
})
|
|
29
|
+
export class DtoDetailRecordMutate extends $Dto.mutate(() => ModelRecord, {
|
|
30
|
+
dtoClass: DtoDetailRecordBase,
|
|
31
|
+
}) {}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { Api, v } from 'vona-module-a-openapiutils';
|
|
4
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
5
|
+
import { Dto } from 'vona-module-a-web';
|
|
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';
|
|
10
|
+
import { DtoDetailRecordBase } from './detailRecordBase.tsx';
|
|
11
|
+
|
|
12
|
+
export interface IDtoOptionsDetailRecordResItem extends IDecoratorDtoOptions {}
|
|
13
|
+
|
|
14
|
+
@Dto<IDtoOptionsDetailRecordResItem>({
|
|
15
|
+
blocks: [
|
|
16
|
+
ZovaRender.block('basic-details:blockDetails', {
|
|
17
|
+
blocks: [
|
|
18
|
+
ZovaRender.block('basic-details:blockDetailsToolbarBulk', {
|
|
19
|
+
actions: [ZovaRender.tableActionBulk('basic-table:actionCreate')],
|
|
20
|
+
}),
|
|
21
|
+
// ZovaRender.block('basic-page:blockTable'),
|
|
22
|
+
// ZovaRender.block('basic-page:blockPager'),
|
|
23
|
+
],
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
})
|
|
27
|
+
export class DtoDetailRecordResItem extends $Dto.get(() => ModelRecord, {
|
|
28
|
+
dtoClass: DtoDetailRecordBase,
|
|
29
|
+
}) {
|
|
30
|
+
@Api.field(
|
|
31
|
+
v.title($locale('Operations')),
|
|
32
|
+
ZovaRender.order(1, 'max'),
|
|
33
|
+
ZovaRender.cell('basic-table:actionOperationsRow', {
|
|
34
|
+
actions: [
|
|
35
|
+
ZovaRender.tableActionRow('basic-table:actionUpdate'),
|
|
36
|
+
ZovaRender.tableActionRow('basic-table:actionDelete'),
|
|
37
|
+
],
|
|
38
|
+
}),
|
|
39
|
+
)
|
|
40
|
+
_operationsRow?: unknown;
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { ModelRecord } from 'vona-module-training-record';
|
|
6
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
|
+
|
|
8
|
+
import { DtoDetailRecordBase } from './detailRecordBase.tsx';
|
|
9
|
+
|
|
10
|
+
export interface IDtoOptionsDetailRecordView extends IDecoratorDtoOptions {}
|
|
11
|
+
|
|
12
|
+
@Dto<IDtoOptionsDetailRecordView>({
|
|
13
|
+
blocks: [
|
|
14
|
+
ZovaRender.block('basic-pageentry:blockPageEntry', {
|
|
15
|
+
blocks: [
|
|
16
|
+
ZovaRender.block('basic-pageentry:blockForm'),
|
|
17
|
+
ZovaRender.block('basic-pageentry:blockToolbarRow', {
|
|
18
|
+
actions: [
|
|
19
|
+
ZovaRender.formActionRow('basic-form:actionBack', { permission: { public: true } }),
|
|
20
|
+
],
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
})
|
|
26
|
+
export class DtoDetailRecordView extends $Dto.get(() => ModelRecord, {
|
|
27
|
+
dtoClass: DtoDetailRecordBase,
|
|
28
|
+
}) {}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
|
|
3
|
+
import { $makeSchema, 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 { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
6
7
|
|
|
8
|
+
import { $locale } from '../.metadata/locales.ts';
|
|
7
9
|
import { ModelStudent } from '../model/student.ts';
|
|
10
|
+
import { DtoDetailRecordMutate } from './detailRecordMutate.tsx';
|
|
11
|
+
import { DtoDetailRecordResItem } from './detailRecordResItem.tsx';
|
|
8
12
|
|
|
9
13
|
export interface IDtoOptionsStudentCreate extends IDecoratorDtoOptions {}
|
|
10
14
|
|
|
@@ -24,5 +28,16 @@ export interface IDtoOptionsStudentCreate extends IDecoratorDtoOptions {}
|
|
|
24
28
|
],
|
|
25
29
|
}),
|
|
26
30
|
],
|
|
31
|
+
fields: {
|
|
32
|
+
trainingRecords: $makeSchema(
|
|
33
|
+
v.title($locale('TrainingRecords')),
|
|
34
|
+
ZovaRender.order(5),
|
|
35
|
+
ZovaRender.field('basic-details:formFieldDetails'),
|
|
36
|
+
v.optional(),
|
|
37
|
+
v.array(DtoDetailRecordResItem),
|
|
38
|
+
),
|
|
39
|
+
},
|
|
27
40
|
})
|
|
28
|
-
export class DtoStudentCreate extends $Dto.create(() => ModelStudent
|
|
41
|
+
export class DtoStudentCreate extends $Dto.create(() => ModelStudent, {
|
|
42
|
+
include: { trainingRecords: { dtoClass: DtoDetailRecordMutate } },
|
|
43
|
+
}) {}
|
|
@@ -5,6 +5,7 @@ import { Dto } from 'vona-module-a-web';
|
|
|
5
5
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
6
6
|
|
|
7
7
|
import { ModelStudent } from '../model/student.ts';
|
|
8
|
+
import { DtoDetailRecordMutate } from './detailRecordMutate.tsx';
|
|
8
9
|
|
|
9
10
|
export interface IDtoOptionsStudentUpdate extends IDecoratorDtoOptions {}
|
|
10
11
|
|
|
@@ -25,4 +26,6 @@ export interface IDtoOptionsStudentUpdate extends IDecoratorDtoOptions {}
|
|
|
25
26
|
}),
|
|
26
27
|
],
|
|
27
28
|
})
|
|
28
|
-
export class DtoStudentUpdate extends $Dto.update(() => ModelStudent
|
|
29
|
+
export class DtoStudentUpdate extends $Dto.update(() => ModelStudent, {
|
|
30
|
+
include: { trainingRecords: { dtoClass: DtoDetailRecordMutate } },
|
|
31
|
+
}) {}
|
|
@@ -5,6 +5,7 @@ import { Dto } from 'vona-module-a-web';
|
|
|
5
5
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
6
6
|
|
|
7
7
|
import { ModelStudent } from '../model/student.ts';
|
|
8
|
+
import { DtoDetailRecordView } from './detailRecordView.tsx';
|
|
8
9
|
|
|
9
10
|
export interface IDtoOptionsStudentView extends IDecoratorDtoOptions {}
|
|
10
11
|
|
|
@@ -22,4 +23,6 @@ export interface IDtoOptionsStudentView extends IDecoratorDtoOptions {}
|
|
|
22
23
|
}),
|
|
23
24
|
],
|
|
24
25
|
})
|
|
25
|
-
export class DtoStudentView extends $Dto.get(() => ModelStudent
|
|
26
|
+
export class DtoStudentView extends $Dto.get(() => ModelStudent, {
|
|
27
|
+
include: { trainingRecords: { dtoClass: DtoDetailRecordView } },
|
|
28
|
+
}) {}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { IDecoratorModelOptions } from 'vona-module-a-orm';
|
|
2
2
|
|
|
3
|
-
import { BeanModelBase, Model } from 'vona-module-a-orm';
|
|
3
|
+
import { $relation, BeanModelBase, Model } from 'vona-module-a-orm';
|
|
4
4
|
|
|
5
5
|
import { EntityStudent } from '../entity/student.tsx';
|
|
6
6
|
|
|
7
7
|
export interface IModelOptionsStudent extends IDecoratorModelOptions<EntityStudent> {}
|
|
8
8
|
|
|
9
|
-
@Model<IModelOptionsStudent>({
|
|
9
|
+
@Model<IModelOptionsStudent>({
|
|
10
|
+
entity: EntityStudent,
|
|
11
|
+
relations: {
|
|
12
|
+
trainingRecords: $relation.hasMany('training-record:record', 'studentId', {
|
|
13
|
+
columns: ['id', 'name', 'score', 'description'],
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
})
|
|
10
17
|
export class ModelStudent extends BeanModelBase<EntityStudent> {}
|
|
@@ -23,7 +23,7 @@ export class ServiceStudent extends BeanBase {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
async view(id: TableIdentity): Promise<DtoStudentView | undefined> {
|
|
26
|
-
return await this.scope.model.student.getById(id);
|
|
26
|
+
return await this.scope.model.student.getById(id, { include: { trainingRecords: true } });
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async update(id: TableIdentity, student: DtoStudentUpdate) {
|
|
@@ -3,6 +3,7 @@ import { DtoCreate } from './dtoCreate.ts';
|
|
|
3
3
|
import { DtoGet } from './dtoGet.ts';
|
|
4
4
|
import { DtoGroup } from './dtoGroup.ts';
|
|
5
5
|
import { DtoListAndCount } from './dtoListAndCount.ts';
|
|
6
|
+
import { DtoMutate } from './dtoMutate.ts';
|
|
6
7
|
import { DtoQuery } from './dtoQuery.ts';
|
|
7
8
|
import { DtoQueryPage } from './dtoQueryPage.ts';
|
|
8
9
|
import { DtoSelectAndCount } from './dtoSelectAndCount.ts';
|
|
@@ -11,6 +12,7 @@ import { DtoUpdate } from './dtoUpdate.ts';
|
|
|
11
12
|
export const $Dto = {
|
|
12
13
|
create: DtoCreate,
|
|
13
14
|
update: DtoUpdate,
|
|
15
|
+
mutate: DtoMutate,
|
|
14
16
|
get: DtoGet,
|
|
15
17
|
aggregate: DtoAggregate,
|
|
16
18
|
group: DtoGroup,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
} from 'vona-module-a-openapiutils';
|
|
13
13
|
import z from 'zod';
|
|
14
14
|
|
|
15
|
-
import type { BeanModelMeta } from '../bean.model/bean.model_meta.ts';
|
|
16
15
|
import type { IDtoGetParams, TypeDtoGetResult } from '../../types/dto/dtoGet.ts';
|
|
17
16
|
import type { TypeDtoMutateType } from '../../types/dto/dtoMutate.ts';
|
|
18
17
|
import type { IModelRelationIncludeWrapper } from '../../types/model.ts';
|
|
19
18
|
import type { IDecoratorModelOptions, IModelClassRecord } from '../../types/onion/model.ts';
|
|
20
19
|
import type { IRelationItem } from '../../types/relationsDef.ts';
|
|
20
|
+
import type { BeanModelMeta } from '../bean.model/bean.model_meta.ts';
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
getClassEntityFromClassModel,
|
|
@@ -53,7 +53,7 @@ function _DtoGet_raw<
|
|
|
53
53
|
// model
|
|
54
54
|
const modelClass = prepareClassModel(modelLike);
|
|
55
55
|
// entity
|
|
56
|
-
let entityClass = getClassEntityFromClassModel(modelClass);
|
|
56
|
+
let entityClass = params?.dtoClass ?? getClassEntityFromClassModel(modelClass);
|
|
57
57
|
// columns
|
|
58
58
|
const columns = prepareColumns(params?.columns);
|
|
59
59
|
// always create a new class, no matter if columns empty
|
|
@@ -164,7 +164,7 @@ function _DtoGet_relation_handle_schemaLazy(
|
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
166
|
// dynamic
|
|
167
|
-
const entityClass = getClassEntityFromClassModel(modelTarget);
|
|
167
|
+
const entityClass = optionsReal.dtoClass ?? getClassEntityFromClassModel(modelTarget);
|
|
168
168
|
const beanFullName = appResource.getBeanFullName(entityClass);
|
|
169
169
|
const _hashkey = _DtoGet_relation_handle_schemaLazy_hashkey(optionsReal, mutateTypeTopLevel);
|
|
170
170
|
const dynamicName = `${beanFullName}_${_hashkey}`;
|
|
@@ -3,7 +3,6 @@ import type { Constructable } from 'vona';
|
|
|
3
3
|
import { mutate } from 'mutate-on-copy';
|
|
4
4
|
import { $Class } from 'vona';
|
|
5
5
|
|
|
6
|
-
import type { BeanModelMeta } from '../bean.model/bean.model_meta.ts';
|
|
7
6
|
import type {
|
|
8
7
|
IDtoMutateParams,
|
|
9
8
|
TypeDtoMutateResult,
|
|
@@ -13,6 +12,7 @@ import type { TypeModelColumnsStrict } from '../../types/modelWhere.ts';
|
|
|
13
12
|
import type { IModelClassRecord } from '../../types/onion/model.ts';
|
|
14
13
|
import type { TypeModelOfModelLike, TypeSymbolKeyEntity } from '../../types/relations.ts';
|
|
15
14
|
import type { IRelationItem } from '../../types/relationsDef.ts';
|
|
15
|
+
import type { BeanModelMeta } from '../bean.model/bean.model_meta.ts';
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
18
|
getClassEntityFromClassModel,
|
|
@@ -52,7 +52,7 @@ export function _DtoMutate_raw<
|
|
|
52
52
|
// model
|
|
53
53
|
const modelClass = prepareClassModel(modelLike);
|
|
54
54
|
// entity
|
|
55
|
-
let entityClass = getClassEntityFromClassModel(modelClass);
|
|
55
|
+
let entityClass = params?.dtoClass ?? getClassEntityFromClassModel(modelClass);
|
|
56
56
|
// columns
|
|
57
57
|
let columns = prepareColumns(params?.columns);
|
|
58
58
|
if (columns) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Constructable } from 'vona';
|
|
2
|
+
|
|
1
3
|
import type { BeanModelMeta } from '../../lib/bean.model/bean.model_meta.ts';
|
|
2
4
|
import type { IModelRelationIncludeWrapper } from '../model.ts';
|
|
3
5
|
import type { TypeModelColumns } from '../modelWhere.ts';
|
|
@@ -19,6 +21,7 @@ export interface IBuildDtoGetParams<TRecord, Model extends BeanModelMeta>
|
|
|
19
21
|
|
|
20
22
|
export interface IBuildDtoGetParamsBasic<TRecord> {
|
|
21
23
|
columns?: TypeModelColumns<TRecord>;
|
|
24
|
+
dtoClass?: Constructable<unknown>;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
export type TypeDtoGetResult<
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableIdentity } from 'table-identity';
|
|
2
|
-
import type { OmitNever, TypeOmitStringUnion } from 'vona';
|
|
2
|
+
import type { Constructable, OmitNever, TypeOmitStringUnion } from 'vona';
|
|
3
3
|
|
|
4
4
|
import type { BeanModelMeta } from '../../lib/bean.model/bean.model_meta.ts';
|
|
5
5
|
import type { IModelRelationIncludeWrapper } from '../model.ts';
|
|
@@ -38,6 +38,7 @@ export interface IBuildDtoMutateParams<TRecord, Model extends BeanModelMeta>
|
|
|
38
38
|
|
|
39
39
|
export interface IBuildDtoMutateParamsBasic<TRecord> {
|
|
40
40
|
columns?: TypeModelColumnsStrict<TRecord>;
|
|
41
|
+
dtoClass?: Constructable<unknown>;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export type TypeDtoMutateResult<
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Constructable } from 'vona';
|
|
2
|
+
|
|
1
3
|
import type { BeanModelMeta } from '../lib/bean.model/bean.model_meta.ts';
|
|
2
4
|
import type {
|
|
3
5
|
IModelRelationIncludeWrapper,
|
|
@@ -54,6 +56,7 @@ export interface IBuildModelSelectGeneralParamsBasic<
|
|
|
54
56
|
? TColumn | Array<TColumn>
|
|
55
57
|
: TColumn
|
|
56
58
|
: TypeModelColumnsPatch<TRecord, TColumn>;
|
|
59
|
+
dtoClass?: Constructable<unknown>;
|
|
57
60
|
aggrs?: Aggrs;
|
|
58
61
|
groups?: Groups;
|
|
59
62
|
having?: TypeModelWhere<TRecord, TypeModelSelectGroupParamsColumns<TRecord, Groups, Aggrs>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.81",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@cabloy/process-helper": "^3.1.8",
|
|
45
45
|
"fs-extra": "^11.3.5",
|
|
46
46
|
"semver": "^7.6.2",
|
|
47
|
-
"zova-cli-set-front": "^1.2.
|
|
47
|
+
"zova-cli-set-front": "^1.2.79"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceBlockOptionsBase,
|
|
4
|
+
IJsxRenderContextPage,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceBlockOptionsBase,
|
|
4
|
+
IJsxRenderContextPageEntry,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextPageEntry,
|
|
4
|
+
IResourceFormActionRowOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type { IFormFieldComponentOptions } from 'zova-module-a-form';
|
|
2
3
|
import type { IResourceFormFieldOptionsBase } from 'zova-module-a-openapi';
|
|
3
4
|
|
|
4
5
|
import { BeanControllerBase } from 'zova';
|
|
5
6
|
import { Controller } from 'zova-module-a-bean';
|
|
6
|
-
import { ZFormField
|
|
7
|
+
import { ZFormField } from 'zova-module-a-form';
|
|
7
8
|
|
|
8
9
|
declare module 'zova-module-a-openapi' {
|
|
9
10
|
export interface IResourceFormFieldRecord {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextPage,
|
|
4
|
+
IResourceTableActionBulkOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -6,15 +6,18 @@ import type {
|
|
|
6
6
|
IResourceTableActionRowRecord,
|
|
7
7
|
IResourceFormActionRowRecord,
|
|
8
8
|
IResourceTableActionBulkRecord,
|
|
9
|
+
IResourceDetailsActionBulkRecord,
|
|
9
10
|
IResourceBlockRecord,
|
|
10
11
|
TypeFormSchemaScene,
|
|
11
12
|
IResourceRenderTableActionRowOptionsAction,
|
|
12
13
|
IResourceRenderFormActionRowOptionsAction,
|
|
13
14
|
IResourceRenderTableActionBulkOptionsAction,
|
|
15
|
+
IResourceRenderDetailsActionBulkOptionsAction,
|
|
14
16
|
IResourceRenderBlockOptionsBlock,
|
|
15
17
|
IResourceTableActionRowOptionsBase,
|
|
16
18
|
IResourceFormActionRowOptionsBase,
|
|
17
19
|
IResourceTableActionBulkOptionsBase,
|
|
20
|
+
IResourceDetailsActionBulkOptionsBase,
|
|
18
21
|
} from 'zova-module-a-openapi';
|
|
19
22
|
|
|
20
23
|
import { _generalSchemaRest, _toLowerCaseFirstChar } from './inner.ts';
|
|
@@ -120,6 +123,25 @@ export function schemaRenderTableActionBulkJsx(
|
|
|
120
123
|
return { render: renderComponentJsx, options };
|
|
121
124
|
}
|
|
122
125
|
|
|
126
|
+
export function schemaRenderDetailsActionBulk<K extends keyof IResourceDetailsActionBulkRecord>(
|
|
127
|
+
render: K,
|
|
128
|
+
options?: IResourceDetailsActionBulkRecord[K],
|
|
129
|
+
): IResourceRenderDetailsActionBulkOptionsAction {
|
|
130
|
+
const pos = render.toString().indexOf(':action');
|
|
131
|
+
const name =
|
|
132
|
+
pos > -1
|
|
133
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
134
|
+
: undefined;
|
|
135
|
+
return { $$typeof: 'zova-jsx:actionBulk', name, render, options };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function schemaRenderDetailsActionBulkJsx(
|
|
139
|
+
renderComponentJsx: TypeRenderComponentJsx,
|
|
140
|
+
options?: Pick<IResourceDetailsActionBulkOptionsBase, 'permission'>,
|
|
141
|
+
) {
|
|
142
|
+
return { render: renderComponentJsx, options };
|
|
143
|
+
}
|
|
144
|
+
|
|
123
145
|
export function schemaRenderBlock<K extends keyof IResourceBlockRecord>(
|
|
124
146
|
render: K,
|
|
125
147
|
options?: IResourceBlockRecord[K],
|
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
schemaRenderBlockJsx,
|
|
4
4
|
schemaRenderCell,
|
|
5
5
|
schemaRenderCellJsx,
|
|
6
|
+
schemaRenderDetailsActionBulk,
|
|
7
|
+
schemaRenderDetailsActionBulkJsx,
|
|
6
8
|
schemaRenderField,
|
|
7
9
|
schemaRenderFieldJsx,
|
|
8
10
|
schemaRenderFormActionRow,
|
|
@@ -40,6 +42,8 @@ export const ZovaRender = {
|
|
|
40
42
|
formActionRowJsx: schemaRenderFormActionRowJsx,
|
|
41
43
|
tableActionBulk: schemaRenderTableActionBulk,
|
|
42
44
|
tableActionBulkJsx: schemaRenderTableActionBulkJsx,
|
|
45
|
+
detailsActionBulk: schemaRenderDetailsActionBulk,
|
|
46
|
+
detailsActionBulkJsx: schemaRenderDetailsActionBulkJsx,
|
|
43
47
|
block: schemaRenderBlock,
|
|
44
48
|
blockJsx: schemaRenderBlockJsx,
|
|
45
49
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.105",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zova-core": "^5.1.57",
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
49
|
+
"zova-suite-a-zova": "^5.1.104"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|