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
package/zova/pnpm-lock.yaml
CHANGED
|
@@ -231,6 +231,9 @@ importers:
|
|
|
231
231
|
zova-module-basic-date:
|
|
232
232
|
specifier: workspace:^
|
|
233
233
|
version: link:src/suite/cabloy-basic/modules/basic-date
|
|
234
|
+
zova-module-basic-details:
|
|
235
|
+
specifier: workspace:^
|
|
236
|
+
version: link:src/suite/cabloy-basic/modules/basic-details
|
|
234
237
|
zova-module-basic-form:
|
|
235
238
|
specifier: workspace:^
|
|
236
239
|
version: link:src/suite/cabloy-basic/modules/basic-form
|
|
@@ -1571,6 +1574,9 @@ importers:
|
|
|
1571
1574
|
zova-module-basic-date:
|
|
1572
1575
|
specifier: ^5.0.6
|
|
1573
1576
|
version: link:modules/basic-date
|
|
1577
|
+
zova-module-basic-details:
|
|
1578
|
+
specifier: ^5.0.0
|
|
1579
|
+
version: link:modules/basic-details
|
|
1574
1580
|
zova-module-basic-form:
|
|
1575
1581
|
specifier: ^5.0.7
|
|
1576
1582
|
version: link:modules/basic-form
|
|
@@ -1663,6 +1669,15 @@ importers:
|
|
|
1663
1669
|
specifier: ^6.1.3
|
|
1664
1670
|
version: 6.1.3
|
|
1665
1671
|
|
|
1672
|
+
src/suite/cabloy-basic/modules/basic-details:
|
|
1673
|
+
devDependencies:
|
|
1674
|
+
clean-package:
|
|
1675
|
+
specifier: ^2.2.0
|
|
1676
|
+
version: 2.2.0
|
|
1677
|
+
rimraf:
|
|
1678
|
+
specifier: ^6.1.3
|
|
1679
|
+
version: 6.1.3
|
|
1680
|
+
|
|
1666
1681
|
src/suite/cabloy-basic/modules/basic-form:
|
|
1667
1682
|
devDependencies:
|
|
1668
1683
|
clean-package:
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zova-module-basic-details",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Zova Module"
|
|
7
|
+
],
|
|
8
|
+
"author": "",
|
|
9
|
+
"files": [
|
|
10
|
+
"mock",
|
|
11
|
+
"dist",
|
|
12
|
+
"src",
|
|
13
|
+
"icons",
|
|
14
|
+
"assets"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": [
|
|
20
|
+
"./src/index.ts",
|
|
21
|
+
"./dist/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"import": "./src/index.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./*": "./*"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
30
|
+
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
32
|
+
"prepack": "clean-package",
|
|
33
|
+
"postpack": "clean-package restore && npm run clean"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"clean-package": "^2.2.0",
|
|
38
|
+
"rimraf": "^6.1.3"
|
|
39
|
+
},
|
|
40
|
+
"clean-package": {
|
|
41
|
+
"indent": 2,
|
|
42
|
+
"replace": {
|
|
43
|
+
"exports.\\..types": "./dist/index.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"remove": [
|
|
46
|
+
"clean-package",
|
|
47
|
+
"devDependencies",
|
|
48
|
+
"exports.\\..import"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"title": "basic-details"
|
|
52
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/actionCreate.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerActionCreateProps } from '../../component/actionCreate/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerActionCreate } from '../../component/actionCreate/controller.jsx';
|
|
9
|
+
export type ZActionCreateProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerActionCreate) => void;
|
|
11
|
+
} & ControllerActionCreateProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerActionCreateProps,
|
|
15
|
+
keyof typeof ControllerActionCreate.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerActionCreate {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZActionCreate = defineComponent((_props: ZActionCreateProps) => {
|
|
24
|
+
useController(ControllerActionCreate, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerActionCreate.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:actionCreate': ControllerActionCreateProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetails.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerBlockDetailsProps } from '../../component/blockDetails/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerBlockDetails } from '../../component/blockDetails/controller.jsx';
|
|
9
|
+
export type ZBlockDetailsProps<TData extends {} = {}> = {
|
|
10
|
+
controllerRef?: (ref: ControllerBlockDetails<TData>) => void;
|
|
11
|
+
} & ControllerBlockDetailsProps<TData>;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps<TData extends {} = {}> = TypeControllerInnerProps<
|
|
14
|
+
ControllerBlockDetailsProps<TData>,
|
|
15
|
+
keyof typeof ControllerBlockDetails.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerBlockDetails<TData extends {} = {}> {
|
|
19
|
+
$props: ControllerInnerProps<TData>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZBlockDetails = defineComponent(
|
|
24
|
+
<TData extends {} = {}>(_props: ZBlockDetailsProps<TData>) => {
|
|
25
|
+
useController(ControllerBlockDetails, undefined, undefined);
|
|
26
|
+
return () => {};
|
|
27
|
+
},
|
|
28
|
+
prepareComponentOptions(ControllerBlockDetails.$componentOptions),
|
|
29
|
+
);
|
|
30
|
+
declare module 'zova-module-a-bean' {
|
|
31
|
+
export interface IVonaComponentRecord {
|
|
32
|
+
'basic-details:blockDetails': ControllerBlockDetailsProps;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerBlockDetailsToolbarBulkProps } from '../../component/blockDetailsToolbarBulk/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerBlockDetailsToolbarBulk } from '../../component/blockDetailsToolbarBulk/controller.jsx';
|
|
9
|
+
export type ZBlockDetailsToolbarBulkProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerBlockDetailsToolbarBulk) => void;
|
|
11
|
+
} & ControllerBlockDetailsToolbarBulkProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerBlockDetailsToolbarBulkProps,
|
|
15
|
+
keyof typeof ControllerBlockDetailsToolbarBulk.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerBlockDetailsToolbarBulk {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZBlockDetailsToolbarBulk = defineComponent((_props: ZBlockDetailsToolbarBulkProps) => {
|
|
24
|
+
useController(ControllerBlockDetailsToolbarBulk, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerBlockDetailsToolbarBulk.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:blockDetailsToolbarBulk': ControllerBlockDetailsToolbarBulkProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerFormFieldDetailsProps } from '../../component/formFieldDetails/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerFormFieldDetails } from '../../component/formFieldDetails/controller.jsx';
|
|
9
|
+
export type ZFormFieldDetailsProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerFormFieldDetails) => void;
|
|
11
|
+
} & ControllerFormFieldDetailsProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerFormFieldDetailsProps,
|
|
15
|
+
keyof typeof ControllerFormFieldDetails.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerFormFieldDetails {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZFormFieldDetails = defineComponent((_props: ZFormFieldDetailsProps) => {
|
|
24
|
+
useController(ControllerFormFieldDetails, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerFormFieldDetails.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:formFieldDetails': ControllerFormFieldDetailsProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
/** controller: begin */
|
|
3
|
+
export * from '../component/actionCreate/controller.jsx';
|
|
4
|
+
export * from '../component/blockDetails/controller.jsx';
|
|
5
|
+
export * from '../component/blockDetailsToolbarBulk/controller.jsx';
|
|
6
|
+
export * from '../component/formFieldDetails/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import 'zova';
|
|
9
|
+
declare module 'zova' {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
declare module 'zova-module-basic-details' {
|
|
14
|
+
|
|
15
|
+
export interface ControllerActionCreate {
|
|
16
|
+
/** @internal */
|
|
17
|
+
get scope(): ScopeModuleBasicDetails;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ControllerBlockDetails {
|
|
21
|
+
/** @internal */
|
|
22
|
+
get scope(): ScopeModuleBasicDetails;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ControllerBlockDetailsToolbarBulk {
|
|
26
|
+
/** @internal */
|
|
27
|
+
get scope(): ScopeModuleBasicDetails;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ControllerFormFieldDetails {
|
|
31
|
+
/** @internal */
|
|
32
|
+
get scope(): ScopeModuleBasicDetails;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** controller: end */
|
|
36
|
+
/** controller: begin */
|
|
37
|
+
import { ControllerActionCreate } from '../component/actionCreate/controller.jsx';
|
|
38
|
+
import { ControllerBlockDetails } from '../component/blockDetails/controller.jsx';
|
|
39
|
+
import { ControllerBlockDetailsToolbarBulk } from '../component/blockDetailsToolbarBulk/controller.jsx';
|
|
40
|
+
import { ControllerFormFieldDetails } from '../component/formFieldDetails/controller.jsx';
|
|
41
|
+
import 'zova';
|
|
42
|
+
declare module 'zova' {
|
|
43
|
+
export interface IBeanRecordLocal {
|
|
44
|
+
'basic-details.controller.actionCreate': ControllerActionCreate;
|
|
45
|
+
'basic-details.controller.blockDetails': ControllerBlockDetails;
|
|
46
|
+
'basic-details.controller.blockDetailsToolbarBulk': ControllerBlockDetailsToolbarBulk;
|
|
47
|
+
'basic-details.controller.formFieldDetails': ControllerFormFieldDetails;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** controller: end */
|
|
51
|
+
|
|
52
|
+
/** components: begin */
|
|
53
|
+
export * from './component/actionCreate.js';
|
|
54
|
+
import { ZActionCreate } from './component/actionCreate.js';
|
|
55
|
+
export * from './component/blockDetails.js';
|
|
56
|
+
import { ZBlockDetails } from './component/blockDetails.js';
|
|
57
|
+
export * from './component/blockDetailsToolbarBulk.js';
|
|
58
|
+
import { ZBlockDetailsToolbarBulk } from './component/blockDetailsToolbarBulk.js';
|
|
59
|
+
export * from './component/formFieldDetails.js';
|
|
60
|
+
import { ZFormFieldDetails } from './component/formFieldDetails.js';
|
|
61
|
+
export const components = {
|
|
62
|
+
'actionCreate': ZActionCreate,
|
|
63
|
+
'blockDetails': ZBlockDetails,
|
|
64
|
+
'blockDetailsToolbarBulk': ZBlockDetailsToolbarBulk,
|
|
65
|
+
'formFieldDetails': ZFormFieldDetails,
|
|
66
|
+
};
|
|
67
|
+
import 'zova';
|
|
68
|
+
declare module 'zova' {
|
|
69
|
+
export interface IComponentRecord {
|
|
70
|
+
'basic-details:actionCreate': ControllerActionCreate;
|
|
71
|
+
'basic-details:blockDetails': ControllerBlockDetails;
|
|
72
|
+
'basic-details:blockDetailsToolbarBulk': ControllerBlockDetailsToolbarBulk;
|
|
73
|
+
'basic-details:formFieldDetails': ControllerFormFieldDetails;
|
|
74
|
+
}
|
|
75
|
+
export interface IZovaComponentRecord {
|
|
76
|
+
'basic-details:actionCreate': typeof ZActionCreate;
|
|
77
|
+
'basic-details:blockDetails': typeof ZBlockDetails;
|
|
78
|
+
'basic-details:blockDetailsToolbarBulk': typeof ZBlockDetailsToolbarBulk;
|
|
79
|
+
'basic-details:formFieldDetails': typeof ZFormFieldDetails;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** components: end */
|
|
83
|
+
/** locale: begin */
|
|
84
|
+
import { locales } from './locales.js';
|
|
85
|
+
/** locale: end */
|
|
86
|
+
/** scope: begin */
|
|
87
|
+
import { BeanScopeBase, type BeanScopeUtil, TypeModuleLocales, TypeLocaleBase } from 'zova';
|
|
88
|
+
import { Scope } from 'zova-module-a-bean';
|
|
89
|
+
|
|
90
|
+
@Scope()
|
|
91
|
+
export class ScopeModuleBasicDetails extends BeanScopeBase {}
|
|
92
|
+
|
|
93
|
+
export interface ScopeModuleBasicDetails {
|
|
94
|
+
util: BeanScopeUtil;
|
|
95
|
+
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
import 'zova';
|
|
99
|
+
declare module 'zova' {
|
|
100
|
+
export interface IBeanScopeRecord {
|
|
101
|
+
'basic-details': ScopeModuleBasicDetails;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
export interface IBeanScopeLocale {
|
|
107
|
+
'basic-details': (typeof locales)[TypeLocaleBase];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `basic-details::${K}` {
|
|
114
|
+
return `basic-details::${key}`;
|
|
115
|
+
}
|
|
116
|
+
/** scope: end */
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextDetails,
|
|
4
|
+
IResourceDetailsActionBulkOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
6
|
+
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
8
|
+
import { Controller } from 'zova-module-a-bean';
|
|
9
|
+
|
|
10
|
+
declare module 'zova-module-a-openapi' {
|
|
11
|
+
export interface IResourceDetailsActionBulkRecord {
|
|
12
|
+
'basic-details:actionCreate'?: ControllerActionCreateProps;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ControllerActionCreateProps extends IResourceDetailsActionBulkOptionsBase {}
|
|
17
|
+
|
|
18
|
+
@Controller()
|
|
19
|
+
export class ControllerActionCreate extends BeanControllerBase {
|
|
20
|
+
static $propsDefault = {};
|
|
21
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
22
|
+
|
|
23
|
+
@Use({ injectionScope: 'host' })
|
|
24
|
+
$$renderContext: IJsxRenderContextDetails;
|
|
25
|
+
|
|
26
|
+
protected async __init__() {}
|
|
27
|
+
|
|
28
|
+
protected render() {
|
|
29
|
+
return (
|
|
30
|
+
<button
|
|
31
|
+
class={this.$props.class}
|
|
32
|
+
type="button"
|
|
33
|
+
onClick={async () => {
|
|
34
|
+
console.log('create');
|
|
35
|
+
// await this.$performCommand('basic-commands:create', this.$props, this.$$renderContext);
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{this.scope.locale.Create()}
|
|
39
|
+
</button>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { celEnvBase } from '@cabloy/utils';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { BeanControllerBase, IComponentOptions } from 'zova';
|
|
4
|
+
import { ZovaJsx } from 'zova-jsx';
|
|
5
|
+
import { Controller } from 'zova-module-a-bean';
|
|
6
|
+
import {
|
|
7
|
+
IDetailsScope,
|
|
8
|
+
IJsxRenderContextDetails,
|
|
9
|
+
IPermissionHintDetailsActionBulk,
|
|
10
|
+
IResourceBlockOptionsBase,
|
|
11
|
+
IResourceRenderBlockOptionsBlock,
|
|
12
|
+
ISchemaObjectExtensionField,
|
|
13
|
+
TypeFormScene,
|
|
14
|
+
} from 'zova-module-a-openapi';
|
|
15
|
+
import { BeanControllerTableBase } from 'zova-module-a-table';
|
|
16
|
+
|
|
17
|
+
declare module 'zova-module-a-openapi' {
|
|
18
|
+
export interface IResourceBlockRecord {
|
|
19
|
+
'basic-details:blockDetails'?: ControllerBlockDetailsProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ControllerBlockDetailsProps<
|
|
24
|
+
TData extends {} = {},
|
|
25
|
+
> extends IResourceBlockOptionsBase {
|
|
26
|
+
blocks?: IResourceRenderBlockOptionsBlock[];
|
|
27
|
+
formScene?: TypeFormScene;
|
|
28
|
+
schemaRow?: ISchemaObjectExtensionField;
|
|
29
|
+
getDetailItems?: () => TData[] | undefined;
|
|
30
|
+
setDetailItems?: (detailItems: TData[]) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Controller()
|
|
34
|
+
export class ControllerBlockDetails<TData extends {} = {}> extends BeanControllerBase {
|
|
35
|
+
static $propsDefault = {};
|
|
36
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
37
|
+
|
|
38
|
+
tableRef: BeanControllerTableBase<TData>;
|
|
39
|
+
|
|
40
|
+
jsxZova: ZovaJsx;
|
|
41
|
+
jsxCelScope: IDetailsScope;
|
|
42
|
+
jsxRenderContext: IJsxRenderContextDetails<TData>;
|
|
43
|
+
|
|
44
|
+
protected async __init__() {
|
|
45
|
+
// jsx
|
|
46
|
+
this._prepareJsx();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get data() {
|
|
50
|
+
return this.$props.getDetailItems?.() ?? [];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get formScene() {
|
|
54
|
+
return this.$props.formScene!;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get schemaRow() {
|
|
58
|
+
return this.$props.schemaRow!;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public checkPermission(permissionHint?: IPermissionHintDetailsActionBulk): boolean {
|
|
62
|
+
const formScene = this.formScene;
|
|
63
|
+
const formSceneHint = permissionHint?.formScene;
|
|
64
|
+
if (!formSceneHint) return true;
|
|
65
|
+
if (Array.isArray(formSceneHint) && formSceneHint.includes(formScene!)) return true;
|
|
66
|
+
if (formSceneHint === formScene) return true;
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private _prepareJsx() {
|
|
71
|
+
const jsxCelEnv = celEnvBase.clone();
|
|
72
|
+
this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false, undefined, jsxCelEnv);
|
|
73
|
+
this.jsxCelScope = this._prepareJsxCelScope();
|
|
74
|
+
this.jsxRenderContext = {
|
|
75
|
+
app: this.app,
|
|
76
|
+
ctx: this.ctx,
|
|
77
|
+
$scene: 'details',
|
|
78
|
+
$host: this,
|
|
79
|
+
$celScope: this.jsxCelScope,
|
|
80
|
+
$jsx: this.jsxZova,
|
|
81
|
+
$$details: this,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private _prepareJsxCelScope(): IDetailsScope {
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
protected render() {
|
|
90
|
+
return <div class={this.$props.class}>{this._renderBlocks()}</div>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private _renderBlocks() {
|
|
94
|
+
const blocks = this.$props.blocks;
|
|
95
|
+
if (!blocks || blocks.length === 0) return;
|
|
96
|
+
const domBlocks: VNode[] = [];
|
|
97
|
+
blocks.forEach((block, index) => {
|
|
98
|
+
const options = Object.assign({ key: index }, block.options);
|
|
99
|
+
const domBlock = this.jsxZova.render(
|
|
100
|
+
block.render!,
|
|
101
|
+
options,
|
|
102
|
+
this.jsxCelScope,
|
|
103
|
+
this.jsxRenderContext,
|
|
104
|
+
);
|
|
105
|
+
if (!domBlock) return;
|
|
106
|
+
if (Array.isArray(domBlock)) {
|
|
107
|
+
domBlocks.push(...domBlock);
|
|
108
|
+
} else {
|
|
109
|
+
domBlocks.push(domBlock);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return domBlocks;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceBlockOptionsBase,
|
|
4
|
+
IJsxRenderContextDetails,
|
|
5
|
+
IResourceRenderDetailsActionBulkOptionsAction,
|
|
6
|
+
} from 'zova-module-a-openapi';
|
|
7
|
+
|
|
8
|
+
import { VNode } from 'vue';
|
|
9
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
10
|
+
import { Controller } from 'zova-module-a-bean';
|
|
11
|
+
|
|
12
|
+
declare module 'zova-module-a-openapi' {
|
|
13
|
+
export interface IResourceBlockRecord {
|
|
14
|
+
'basic-details:blockDetailsToolbarBulk'?: ControllerBlockDetailsToolbarBulkProps;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ControllerBlockDetailsToolbarBulkProps extends IResourceBlockOptionsBase {
|
|
19
|
+
actions?: IResourceRenderDetailsActionBulkOptionsAction[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Controller()
|
|
23
|
+
export class ControllerBlockDetailsToolbarBulk extends BeanControllerBase {
|
|
24
|
+
static $propsDefault = {};
|
|
25
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
26
|
+
|
|
27
|
+
@Use({ injectionScope: 'host' })
|
|
28
|
+
$$renderContext: IJsxRenderContextDetails;
|
|
29
|
+
|
|
30
|
+
protected async __init__() {}
|
|
31
|
+
|
|
32
|
+
protected render() {
|
|
33
|
+
const domActions = this._renderActions();
|
|
34
|
+
if (!domActions || domActions.length === 0) return;
|
|
35
|
+
return (
|
|
36
|
+
<div class={this.$props.class}>
|
|
37
|
+
<div class="join">{domActions}</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private _renderActions() {
|
|
43
|
+
const { $jsx, $celScope, $$details } = this.$$renderContext;
|
|
44
|
+
const actions = this.$props.actions;
|
|
45
|
+
if (!actions || actions.length === 0) return;
|
|
46
|
+
const domActions: VNode[] = [];
|
|
47
|
+
actions.forEach((action, index) => {
|
|
48
|
+
const permissionHint = action.options?.permission;
|
|
49
|
+
if (!$$details.checkPermission(permissionHint)) return;
|
|
50
|
+
const options = Object.assign({ key: index }, action.options);
|
|
51
|
+
const domAction = $jsx.render(action.render!, options, $celScope, this.$$renderContext);
|
|
52
|
+
if (!domAction) return;
|
|
53
|
+
if (Array.isArray(domAction)) {
|
|
54
|
+
domActions.push(...domAction);
|
|
55
|
+
} else {
|
|
56
|
+
domActions.push(domAction);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return domActions;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
ControllerFormField,
|
|
4
|
+
IFormFieldComponentOptions,
|
|
5
|
+
IFormFieldRenderContext,
|
|
6
|
+
} from 'zova-module-a-form';
|
|
7
|
+
import type {
|
|
8
|
+
IResourceFormFieldOptionsBase,
|
|
9
|
+
ISchemaObjectExtensionField,
|
|
10
|
+
TypeFormScene,
|
|
11
|
+
} from 'zova-module-a-openapi';
|
|
12
|
+
|
|
13
|
+
import { VNode } from 'vue';
|
|
14
|
+
import { BeanControllerBase, deepExtend } from 'zova';
|
|
15
|
+
import { ZovaJsx } from 'zova-jsx';
|
|
16
|
+
import { Controller } from 'zova-module-a-bean';
|
|
17
|
+
import { ZFormField } from 'zova-module-a-form';
|
|
18
|
+
|
|
19
|
+
declare module 'zova-module-a-openapi' {
|
|
20
|
+
export interface IResourceFormFieldRecord {
|
|
21
|
+
'basic-details:formFieldDetails'?: IResourceFormFieldDetailsOptions;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IResourceFormFieldDetailsOptions extends IResourceFormFieldOptionsBase {}
|
|
26
|
+
|
|
27
|
+
export interface ControllerFormFieldDetailsProps extends IFormFieldComponentOptions {
|
|
28
|
+
options?: IResourceFormFieldDetailsOptions;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Controller()
|
|
32
|
+
export class ControllerFormFieldDetails extends BeanControllerBase {
|
|
33
|
+
static $propsDefault = {};
|
|
34
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
35
|
+
|
|
36
|
+
jsxZova: ZovaJsx;
|
|
37
|
+
|
|
38
|
+
protected async __init__() {
|
|
39
|
+
// jsx
|
|
40
|
+
this._prepareJsx();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private _prepareJsx() {
|
|
44
|
+
this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected render() {
|
|
48
|
+
return (
|
|
49
|
+
<ZFormField
|
|
50
|
+
{...this.$props}
|
|
51
|
+
slotDefault={(formFieldRenderContext, $$formField) => {
|
|
52
|
+
return this._renderBlocks(formFieldRenderContext, $$formField) ?? <></>;
|
|
53
|
+
}}
|
|
54
|
+
></ZFormField>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private _renderBlocks(
|
|
59
|
+
formFieldRenderContext: IFormFieldRenderContext,
|
|
60
|
+
$$formField: ControllerFormField,
|
|
61
|
+
) {
|
|
62
|
+
const { propsBucket } = formFieldRenderContext;
|
|
63
|
+
// schema
|
|
64
|
+
const schemaName = $$formField.property?.items?.$ref;
|
|
65
|
+
if (!schemaName) {
|
|
66
|
+
return <div>Should specify the detail schema</div>;
|
|
67
|
+
}
|
|
68
|
+
const schemaRow: ISchemaObjectExtensionField | undefined = this.$sdk.getSchema(
|
|
69
|
+
schemaName!,
|
|
70
|
+
).data;
|
|
71
|
+
if (!schemaRow) return;
|
|
72
|
+
// formScene
|
|
73
|
+
const formScene: TypeFormScene = propsBucket.readonly
|
|
74
|
+
? 'view'
|
|
75
|
+
: $$formField.formMeta!.formScene!;
|
|
76
|
+
// blocks
|
|
77
|
+
const blocks = schemaRow?.rest?.blocks;
|
|
78
|
+
if (!blocks || blocks.length === 0) return;
|
|
79
|
+
const domBlocks: VNode[] = [];
|
|
80
|
+
blocks.forEach((block, index) => {
|
|
81
|
+
const options = deepExtend(
|
|
82
|
+
{ key: index },
|
|
83
|
+
{
|
|
84
|
+
formScene,
|
|
85
|
+
schemaRow,
|
|
86
|
+
getDetailItems: () => {
|
|
87
|
+
return propsBucket.value;
|
|
88
|
+
},
|
|
89
|
+
setDetailItems: (detailItems: any[]) => {
|
|
90
|
+
$$formField.setValue(detailItems);
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
block.options,
|
|
94
|
+
);
|
|
95
|
+
const domBlock = this.jsxZova.render(block.render!, options);
|
|
96
|
+
if (!domBlock) return;
|
|
97
|
+
if (Array.isArray(domBlock)) {
|
|
98
|
+
domBlocks.push(...domBlock);
|
|
99
|
+
} else {
|
|
100
|
+
domBlocks.push(domBlock);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return <div>{domBlocks}</div>;
|
|
104
|
+
}
|
|
105
|
+
}
|