@simitgroup/simpleapp-generator 2.0.2-c-alpha → 2.0.2-d-alpha
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/ReleaseNote.md +5 -0
- package/package.json +1 -1
- package/templates/basic/nuxt/resource-bridge.service.ts.eta +14 -6
- package/templates/nest/src/simple-app/_core/framework/base/simple-app.controller.ts.eta +2 -7
- package/templates/nest/src/simple-app/_core/framework/base/simple-app.service.ts.eta +8 -8
- package/templates/nuxt/app.vue.eta +2 -2
- package/templates/nuxt/plugins/18.simpleapp-custom-field-store.ts.eta +2 -2
- package/templates/nuxt/types/others.ts.eta +4 -0
package/ReleaseNote.md
CHANGED
package/package.json
CHANGED
|
@@ -79,12 +79,20 @@ export class MiniApp<%= pascalName %>BridgeService {
|
|
|
79
79
|
<% if (value !== true && typeof value !== 'object') { return; } %>
|
|
80
80
|
|
|
81
81
|
<% if(action === 'list') { %>
|
|
82
|
-
protected async handleList(message: MiniAppBridgeMessageApi
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
protected async handleList(message: MiniAppBridgeMessageApi<MiniAppStudentActions>) {
|
|
83
|
+
const rawBody: any = message.params.body ?? {};
|
|
84
|
+
const pageSize = rawBody.pagination?.pageSize ?? rawBody.pageSize ?? 200;
|
|
85
|
+
const pageNo = rawBody.pagination?.pageNo ?? rawBody.pageNo ?? 0;
|
|
86
|
+
const res = await this.api!.runSearch({
|
|
87
|
+
filter: rawBody.filters,
|
|
88
|
+
fields: rawBody.fields,
|
|
89
|
+
sorts: rawBody.sorts,
|
|
90
|
+
pagination: {
|
|
91
|
+
pageSize,
|
|
92
|
+
pageNo,
|
|
93
|
+
},
|
|
94
|
+
} as any);
|
|
95
|
+
return res.data;
|
|
88
96
|
}
|
|
89
97
|
<% } else if(action === 'detail') { %>
|
|
90
98
|
protected async handleDetail(message: MiniAppBridgeMessageApi<<%= typeActionName %>>) {
|
|
@@ -51,8 +51,7 @@ export class SimpleAppController<TService extends ServiceType, TApiSchema> {
|
|
|
51
51
|
return this.service.fullTextSearch(appuser, body);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async _search(appuser: UserContext, searchObject: SearchBody, res?: Response) {
|
|
55
|
-
//return this.service.search(appuser, searchObject['filter'], searchObject['fields'], searchObject['sorts'], searchObject['lookup']);
|
|
54
|
+
async _search(appuser: UserContext, searchObject: SearchBody, res?: Response) {
|
|
56
55
|
const items = await this.service.searchWithPageInfo(
|
|
57
56
|
appuser,
|
|
58
57
|
searchObject['filter'],
|
|
@@ -61,11 +60,7 @@ export class SimpleAppController<TService extends ServiceType, TApiSchema> {
|
|
|
61
60
|
searchObject['lookup'],
|
|
62
61
|
searchObject['pagination'],
|
|
63
62
|
);
|
|
64
|
-
|
|
65
|
-
if (res && searchObject['pagination']) {
|
|
66
|
-
const total = await this.service.getTotalCount(appuser, searchObject['filter'] || {});
|
|
67
|
-
this.service.setPaginationHeaders(res, total, searchObject['pagination']);
|
|
68
|
-
}
|
|
63
|
+
|
|
69
64
|
return items;
|
|
70
65
|
}
|
|
71
66
|
|
|
@@ -413,15 +413,15 @@ export class SimpleAppService<T extends SchemaFields> {
|
|
|
413
413
|
if (total !== undefined && total !== null && pagination) {
|
|
414
414
|
const { pageSize, pageNo } = this.buildPagination(pagination);
|
|
415
415
|
const pageCount = pageSize > 0 && total > 0 ? Math.ceil(total / pageSize) : (total > 0 ? 1 : 0);
|
|
416
|
-
res.setHeader('x-page-count', pageCount
|
|
417
|
-
res.setHeader('x-page-size', pageSize
|
|
418
|
-
res.setHeader('x-page-no', pageNo
|
|
419
|
-
res.setHeader('x-total-count', total
|
|
416
|
+
res.setHeader('x-page-count', pageCount);
|
|
417
|
+
res.setHeader('x-page-size', pageSize);
|
|
418
|
+
res.setHeader('x-page-no', pageNo);
|
|
419
|
+
res.setHeader('x-total-count', total);
|
|
420
420
|
} else {
|
|
421
|
-
res.setHeader('x-page-count',
|
|
422
|
-
res.setHeader('x-page-size',
|
|
423
|
-
res.setHeader('x-page-no',
|
|
424
|
-
res.setHeader('x-total-count',
|
|
421
|
+
res.setHeader('x-page-count', 0);
|
|
422
|
+
res.setHeader('x-page-size', 0);
|
|
423
|
+
res.setHeader('x-page-no', 0);
|
|
424
|
+
res.setHeader('x-total-count', 0);
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
|
|
@@ -54,9 +54,9 @@ onMounted(async()=>{
|
|
|
54
54
|
const currentgroup = useCookie('currentGroup').value
|
|
55
55
|
//if no xorg, no enforce pick group
|
|
56
56
|
if(getCurrentXorg()===''){
|
|
57
|
-
|
|
57
|
+
navigateTo('/picktenant')
|
|
58
58
|
}else if(!currentgroup){
|
|
59
|
-
|
|
59
|
+
goTo('/pickgroup')
|
|
60
60
|
}
|
|
61
61
|
setGraphqlServer()
|
|
62
62
|
}else{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { ShallowRef } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { CustomField, CUSTOMFIELDApi } from "~/simpleapp/generate/openapi";
|
|
4
4
|
|
|
5
5
|
type CustomFieldStoreData = Pick<
|
|
6
|
-
|
|
6
|
+
CustomField,
|
|
7
7
|
"_id" | "collectionName" | "form" | "list"
|
|
8
8
|
>[];
|
|
9
9
|
|