@simitgroup/simpleapp-generator 1.4.2-alpha → 1.5.0-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/dist/buildinschemas/autoincreament.d.ts.map +1 -1
- package/dist/buildinschemas/autoincreament.js +1 -0
- package/dist/buildinschemas/autoincreament.js.map +1 -1
- package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
- package/dist/buildinschemas/docnoformat.js +1 -0
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/permission.d.ts.map +1 -1
- package/dist/buildinschemas/permission.js +1 -8
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +4 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +6 -4
- package/dist/generate.js.map +1 -1
- package/dist/processors/bpmnbuilder.d.ts.map +1 -1
- package/dist/processors/bpmnbuilder.js +10 -4
- package/dist/processors/bpmnbuilder.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +9 -0
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +1 -0
- package/src/buildinschemas/docnoformat.ts +1 -0
- package/src/buildinschemas/permission.ts +1 -8
- package/src/framework.ts +5 -4
- package/src/generate.ts +7 -6
- package/src/processors/bpmnbuilder.ts +10 -5
- package/src/processors/jsonschemabuilder.ts +10 -0
- package/templates/basic/nest/apischema.ts.eta +5 -0
- package/templates/basic/nest/controller.ts.eta +28 -10
- package/templates/basic/nest/resolver.ts.eta +124 -0
- package/templates/basic/nest/service.ts.eta +0 -6
- package/templates/nest/.env._eta +7 -7
- package/templates/nest/src/app.module.ts.eta +22 -21
- package/templates/nest/src/app.resolver.ts.eta +9 -0
- package/templates/nest/src/simpleapp/generate/commons/decorators/appuser.decorator.ts.eta +11 -5
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +44 -39
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +16 -4
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +24 -12
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +12 -5
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +1 -0
- package/templates/nest/src/simpleapp/generate/types/workflow.type.ts.eta +15 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.config.ts.eta +2 -2
- package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +8 -6
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +41 -22
- package/templates/nest/src/simpleapp/resolvers/readme.md.eta +1 -0
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +9 -2
- package/templates/nuxt/app.vue._eta +8 -2
- package/templates/nuxt/components/renderer/RendererMoney.vue.eta +21 -12
- package/templates/nuxt/composables/graphquery.generate.ts.eta +26 -0
- package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +7 -6
- package/templates/nuxt/layouts/mobile.vue._eta +2 -2
- package/templates/nuxt/nuxt.config.ts._eta +8 -0
- package/templates/nuxt/pages/[xorg]/index.vue._eta +9 -0
- package/templates/nuxt/pages/[xorg]/mobile/index.vue._eta +2 -15
- package/templates/nuxt/pages/picktenant.vue._eta +3 -1
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +2 -0
- package/templates/nuxt/types/events.ts.eta +4 -3
- package/templates/project/workflows/bpmn/{suspendcustomer.bpmn._eta → sayhello.bpmn._eta} +6 -36
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2024-04-15
|
|
5
|
+
* Author: Ks Tan
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type WorkflowCatalogue = {
|
|
9
|
+
<%for(let i=0; i<it.allbpmn.length;i++){ %>
|
|
10
|
+
<% const bpmn = it.allbpmn[i] %>
|
|
11
|
+
<%=bpmn%>:any,
|
|
12
|
+
<%}%>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type WorkflowName = keyof WorkflowCatalogue
|
|
@@ -65,8 +65,8 @@ export class WorkflowConfig {
|
|
|
65
65
|
},
|
|
66
66
|
appDelegate: (server: BPMNServer) =>
|
|
67
67
|
_this.workflowdelegate.setServer(server),
|
|
68
|
-
userService: (server: BPMNServer) =>
|
|
69
|
-
_this.workflowUserService.setServer(server),
|
|
68
|
+
//userService: (server: BPMNServer) =>
|
|
69
|
+
//_this.workflowUserService.setServer(server),
|
|
70
70
|
dataStore: function (server: BPMNServer) {
|
|
71
71
|
return new MyDataStore(server);
|
|
72
72
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-
|
|
4
|
+
* last change 2024-04-15
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
Delete,
|
|
16
16
|
HttpCode,
|
|
17
17
|
} from '@nestjs/common';
|
|
18
|
+
|
|
18
19
|
import { WorkflowService } from './workflow.service';
|
|
19
20
|
import { UserTaskActors } from './workflow.type';
|
|
20
21
|
import { Roles } from '../commons/roles/roles.decorator';
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
import { ApiTags, ApiBody, ApiResponse, ApiOperation } from '@nestjs/swagger';
|
|
30
31
|
import { AppUser } from '../commons/decorators/appuser.decorator';
|
|
31
32
|
import { UserContext } from '../commons/user.context';
|
|
33
|
+
import { WorkflowName } from '../types';
|
|
32
34
|
@ApiTags('workflow')
|
|
33
35
|
@Controller('workflow')
|
|
34
36
|
export class WorkflowController {
|
|
@@ -210,7 +212,7 @@ export class WorkflowController {
|
|
|
210
212
|
})
|
|
211
213
|
async newWorkflowDefinitions(
|
|
212
214
|
@AppUser() appuser: UserContext,
|
|
213
|
-
@Param('workflowname') workflowname:
|
|
215
|
+
@Param('workflowname') workflowname: WorkflowName,
|
|
214
216
|
@Body() xml: string,
|
|
215
217
|
) {
|
|
216
218
|
return await this.workflowService.newWorkflowDefinitions(
|
|
@@ -234,7 +236,7 @@ export class WorkflowController {
|
|
|
234
236
|
})
|
|
235
237
|
async updateWorkflowDefinition(
|
|
236
238
|
@AppUser() appuser: UserContext,
|
|
237
|
-
@Param('workflowname') workflowname:
|
|
239
|
+
@Param('workflowname') workflowname: WorkflowName,
|
|
238
240
|
@Body() xml: string,
|
|
239
241
|
) {
|
|
240
242
|
return await this.workflowService.updateWorkflowDefinition(
|
|
@@ -254,7 +256,7 @@ export class WorkflowController {
|
|
|
254
256
|
})
|
|
255
257
|
async readWorkflowDefinition(
|
|
256
258
|
@AppUser() appuser: UserContext,
|
|
257
|
-
@Param('workflowname') workflowname:
|
|
259
|
+
@Param('workflowname') workflowname: WorkflowName,
|
|
258
260
|
) {
|
|
259
261
|
return await this.workflowService.readWorkflowDefinition(
|
|
260
262
|
appuser,
|
|
@@ -271,7 +273,7 @@ export class WorkflowController {
|
|
|
271
273
|
})
|
|
272
274
|
async dropWorkflowDefinition(
|
|
273
275
|
@AppUser() appuser: UserContext,
|
|
274
|
-
@Param('workflowname') workflowname:
|
|
276
|
+
@Param('workflowname') workflowname: WorkflowName,
|
|
275
277
|
) {
|
|
276
278
|
return await this.workflowService.deleteWorkflowDefinition(
|
|
277
279
|
appuser,
|
|
@@ -344,7 +346,7 @@ export class WorkflowController {
|
|
|
344
346
|
})
|
|
345
347
|
async startWorkflow(
|
|
346
348
|
@AppUser() appuser: UserContext,
|
|
347
|
-
@Param('workflowname') workflowname:
|
|
349
|
+
@Param('workflowname') workflowname: WorkflowName,
|
|
348
350
|
@Body() data: any,
|
|
349
351
|
) {
|
|
350
352
|
return await this.workflowService.startWorkflow(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-
|
|
4
|
+
* last change 2024-04-15
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import { WorkflowConfig } from './workflow.config';
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
} from 'bpmn-server';
|
|
34
34
|
// import { configuration } from './configuration';
|
|
35
35
|
import { UserContext } from '../commons/user.context';
|
|
36
|
+
import { WorkflowName } from '../types';
|
|
36
37
|
//import * as formschemas from '../../workflow/formschema';
|
|
37
38
|
export {
|
|
38
39
|
WorkflowSettingApiSchema,
|
|
@@ -110,7 +111,7 @@ export class WorkflowService {
|
|
|
110
111
|
*/
|
|
111
112
|
async newWorkflowDefinitions(
|
|
112
113
|
appuser: UserContext,
|
|
113
|
-
workflowName:
|
|
114
|
+
workflowName: WorkflowName,
|
|
114
115
|
xml: string,
|
|
115
116
|
) {
|
|
116
117
|
throw new BadRequestException(
|
|
@@ -124,13 +125,19 @@ export class WorkflowService {
|
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
async readWorkflowDefinition(
|
|
128
|
+
async readWorkflowDefinition(
|
|
129
|
+
appuser: UserContext,
|
|
130
|
+
workflowname: WorkflowName,
|
|
131
|
+
) {
|
|
128
132
|
throw new BadRequestException(
|
|
129
133
|
`readWorkflowDefinition is not supported yet`,
|
|
130
134
|
);
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
async deleteWorkflowDefinition(
|
|
137
|
+
async deleteWorkflowDefinition(
|
|
138
|
+
appuser: UserContext,
|
|
139
|
+
workflowname: WorkflowName,
|
|
140
|
+
) {
|
|
134
141
|
throw new BadRequestException(
|
|
135
142
|
`deleteWorkflowDefinition is not supported yet`,
|
|
136
143
|
);
|
|
@@ -138,7 +145,7 @@ export class WorkflowService {
|
|
|
138
145
|
|
|
139
146
|
async updateWorkflowDefinition(
|
|
140
147
|
appuser: UserContext,
|
|
141
|
-
workflowname:
|
|
148
|
+
workflowname: WorkflowName,
|
|
142
149
|
xml: string,
|
|
143
150
|
) {
|
|
144
151
|
throw new BadRequestException(
|
|
@@ -193,21 +200,20 @@ export class WorkflowService {
|
|
|
193
200
|
data: any,
|
|
194
201
|
) {
|
|
195
202
|
try {
|
|
196
|
-
|
|
197
203
|
const response = await this.bpmnServer.engine.invoke(
|
|
198
204
|
{ 'items.id': taskId, 'items.status': 'wait' },
|
|
199
205
|
data,
|
|
200
206
|
appuser.getUid(),
|
|
201
|
-
{appuser:appuser}
|
|
207
|
+
{ appuser: appuser },
|
|
202
208
|
);
|
|
203
209
|
return {
|
|
204
|
-
parentKeys:Object.keys(response),
|
|
205
|
-
parentId:response.id,
|
|
206
|
-
data:response.instance.data,
|
|
210
|
+
parentKeys: Object.keys(response),
|
|
211
|
+
parentId: response.id,
|
|
212
|
+
data: response.instance.data,
|
|
207
213
|
// parentId:response,
|
|
208
|
-
input:response.item.input,
|
|
209
|
-
vars:response.item.vars,
|
|
210
|
-
id:response.item.id,
|
|
214
|
+
input: response.item.input,
|
|
215
|
+
vars: response.item.vars,
|
|
216
|
+
id: response.item.id,
|
|
211
217
|
status: response.item.status,
|
|
212
218
|
};
|
|
213
219
|
} catch (e) {
|
|
@@ -313,12 +319,26 @@ export class WorkflowService {
|
|
|
313
319
|
* @returns workflowsummary
|
|
314
320
|
*/
|
|
315
321
|
@OnEvent('workflow.start')
|
|
316
|
-
async startWorkflow(
|
|
322
|
+
async startWorkflow(
|
|
323
|
+
appuser: UserContext,
|
|
324
|
+
workflowName: WorkflowName,
|
|
325
|
+
data?: any,
|
|
326
|
+
) {
|
|
327
|
+
//run as event, it wont have transaction
|
|
328
|
+
appuser.setDBSession(undefined);
|
|
329
|
+
|
|
330
|
+
if (!data ) data = {}
|
|
331
|
+
|
|
332
|
+
//sometimes data is Mongoose object instead of pure data, need serialize and deserialize to remove that
|
|
333
|
+
data=JSON.parse(JSON.stringify(data))
|
|
334
|
+
|
|
317
335
|
try {
|
|
318
336
|
// console.log('startWorkflow started: ', workflowName);
|
|
337
|
+
|
|
319
338
|
data.tenantId = appuser.getTenantId();
|
|
320
339
|
data.orgId = appuser.getOrgId();
|
|
321
340
|
data.branchId = appuser.getBranchId();
|
|
341
|
+
|
|
322
342
|
const result = await this.bpmnServer.engine.start(
|
|
323
343
|
workflowName,
|
|
324
344
|
data,
|
|
@@ -457,13 +477,12 @@ export class WorkflowService {
|
|
|
457
477
|
const elementProps = event.context.item.element.def;
|
|
458
478
|
// const usertaskinput = event.context.item.input ?? null;
|
|
459
479
|
const data = event.context.instance.data;
|
|
460
|
-
const vars = {}
|
|
461
|
-
Object.assign(vars,event.context.item.input);
|
|
462
|
-
event.context.item.input={}
|
|
480
|
+
const vars = {};
|
|
481
|
+
Object.assign(vars, event.context.item.input);
|
|
482
|
+
event.context.item.input = {};
|
|
463
483
|
const options = event.context.options;
|
|
464
484
|
switch (elementType) {
|
|
465
485
|
case BPMN_TYPE.UserTask:
|
|
466
|
-
|
|
467
486
|
let usertaskeventtype: UserTaskEventType;
|
|
468
487
|
if (eventType == EXECUTION_EVENT.node_start)
|
|
469
488
|
usertaskeventtype = 'start';
|
|
@@ -475,7 +494,7 @@ export class WorkflowService {
|
|
|
475
494
|
usertaskeventtype = 'invoked';
|
|
476
495
|
else if (eventType == EXECUTION_EVENT.node_wait)
|
|
477
496
|
usertaskeventtype = 'wait';
|
|
478
|
-
|
|
497
|
+
// console.log("event-------=================================",eventType,usertaskeventtype)
|
|
479
498
|
if (usertaskeventtype) {
|
|
480
499
|
const props: UserTaskData = {
|
|
481
500
|
workflowName: workflowName,
|
|
@@ -492,9 +511,9 @@ export class WorkflowService {
|
|
|
492
511
|
followUpDate: event.context.item.followUpDate,
|
|
493
512
|
priority: event.context.item.priority,
|
|
494
513
|
formKey: elementProps.formKey,
|
|
495
|
-
},
|
|
514
|
+
},
|
|
496
515
|
data: data,
|
|
497
|
-
vars:vars,
|
|
516
|
+
vars: vars,
|
|
498
517
|
options: options,
|
|
499
518
|
};
|
|
500
519
|
this.eventEmitter.emit(
|
|
@@ -518,7 +537,7 @@ export class WorkflowService {
|
|
|
518
537
|
elementId: elementId,
|
|
519
538
|
elementName: elementName,
|
|
520
539
|
data: data,
|
|
521
|
-
vars:vars,
|
|
540
|
+
vars: vars,
|
|
522
541
|
options: options,
|
|
523
542
|
};
|
|
524
543
|
this.eventEmitter.emit(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
graphql resolver
|
|
@@ -13,6 +13,7 @@ import { AuditTrail } from './generate/commons/audittrail.service';
|
|
|
13
13
|
<% for(let i=0;i<it.modules.length; i++){ %>
|
|
14
14
|
<% let obj = it.modules[i]%>
|
|
15
15
|
import { <%= obj.docname %>Service } from './services/<%= obj.doctype %>.service';
|
|
16
|
+
import { <%= obj.docname %>Resolver } from './generate/resolvers/<%= obj.doctype %>.resolver';
|
|
16
17
|
import { <%= obj.docname %>Controller } from './generate/controllers/<%= obj.doctype %>.controller';
|
|
17
18
|
import { <%= obj.docname %>MongoSchema } from './generate/models/<%= obj.doctype %>.model';
|
|
18
19
|
<%}%>
|
|
@@ -45,12 +46,18 @@ import { <%=capitalizeFirstLetter(bpmn)%>ListenerService } from 'src/simpleapp/w
|
|
|
45
46
|
],
|
|
46
47
|
controllers: [<% for(let i=0;i<it.modules.length; i++){ %><%= it.modules[i].docname %>Controller,<%}%> ProfileController,WorkflowController],
|
|
47
48
|
providers: [
|
|
48
|
-
AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){
|
|
49
|
+
AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %>
|
|
50
|
+
<%= it.modules[i].docname %>Service,
|
|
51
|
+
<%= it.modules[i].docname %>Resolver,
|
|
52
|
+
<%}%> ProfileService,WorkflowDelegate,WorkflowConfig,WorkflowService,WorkflowUserService,
|
|
49
53
|
<%for(let i=0; i<it.allbpmn.length;i++){%>
|
|
50
54
|
<%let bpmn = it.allbpmn[i]%>
|
|
51
55
|
<%=capitalizeFirstLetter(bpmn)%>ListenerService,
|
|
52
56
|
<%}%>
|
|
53
57
|
],
|
|
54
|
-
exports:[AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){
|
|
58
|
+
exports:[AuditTrail,DocNumberFormatGenerator,<% for(let i=0;i<it.modules.length; i++){ %>
|
|
59
|
+
<%= it.modules[i].docname %>Service,
|
|
60
|
+
<%= it.modules[i].docname %>Resolver,
|
|
61
|
+
<%}%> ProfileService,WorkflowDelegate,WorkflowConfig,WorkflowService,WorkflowUserService,]
|
|
55
62
|
})
|
|
56
63
|
export class GenerateModule {}
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
/**
|
|
14
14
|
* This file was automatically generated by simpleapp generator. Every
|
|
15
15
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
16
|
-
* last change
|
|
16
|
+
* last change 2024-03-17
|
|
17
17
|
* Author: Ks Tan
|
|
18
18
|
*/
|
|
19
|
+
|
|
19
20
|
watch(()=>useRoute().params['xorg'],async (newval,oldvalue)=>{
|
|
20
21
|
await reloadUserStore()
|
|
21
22
|
if(getPathPara('xorg','')!=''){
|
|
22
23
|
if(!getUserProfile()?.currentGroup) goTo('pickgroup')
|
|
24
|
+
setGraphqlServer()
|
|
23
25
|
}
|
|
24
26
|
})
|
|
25
27
|
|
|
@@ -36,6 +38,10 @@ const getLayout = ()=>{
|
|
|
36
38
|
onMounted(()=>{
|
|
37
39
|
const currentgroup = useCookie('currentGroup').value
|
|
38
40
|
//if no xorg, no enforce pick group
|
|
39
|
-
if(getCurrentXorg()
|
|
41
|
+
if(getCurrentXorg()){
|
|
42
|
+
if (!currentgroup)goTo('pickgroup')
|
|
43
|
+
setGraphqlServer()
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
})
|
|
41
47
|
</script>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
1
|
<template>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
2
|
+
<span v-if="typeof modelValue=='undefined' || typeof modelValue=='string' ">-</span>
|
|
3
|
+
<span v-else-if="showCurrency">
|
|
4
|
+
{{
|
|
5
|
+
currenyValue
|
|
6
|
+
}}</span
|
|
7
|
+
>
|
|
8
|
+
<span v-else>
|
|
9
|
+
{{ modelValue.toLocaleString(useI18n().defaultLocale, options) }}</span
|
|
10
|
+
>
|
|
9
11
|
</template>
|
|
10
12
|
<script lang="ts" setup>
|
|
11
13
|
/**
|
|
@@ -14,12 +16,19 @@
|
|
|
14
16
|
* last change 2024-02-04
|
|
15
17
|
* author: Ks Tan
|
|
16
18
|
*/
|
|
17
|
-
|
|
19
|
+
const currenyValue = computed(()=>{
|
|
20
|
+
if(modelValue.value === undefined) return '-'
|
|
21
|
+
return Intl.NumberFormat(useI18n().defaultLocale, {
|
|
22
|
+
// style: "currency",
|
|
23
|
+
// currency: getUserProfile()?.currency ?? '',
|
|
24
|
+
// currencyDisplay: "symbol",
|
|
25
|
+
}).format(modelValue.value)
|
|
26
|
+
})
|
|
18
27
|
const options = {
|
|
19
|
-
style:
|
|
28
|
+
style: "decimal", // Other options: 'currency', 'percent', etc.
|
|
20
29
|
minimumFractionDigits: 2,
|
|
21
30
|
maximumFractionDigits: 2,
|
|
22
31
|
};
|
|
23
|
-
const modelValue = defineModel<number>({required:true})
|
|
24
|
-
const props = defineProps<{showCurrency?:boolean}>()
|
|
25
|
-
</script>
|
|
32
|
+
const modelValue = defineModel<number>({ required: true });
|
|
33
|
+
const props = defineProps<{ showCurrency?: boolean }>();
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2024-03-13
|
|
5
|
+
* Author: Ks Tan
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createHttpLink, } from '@apollo/client/core';
|
|
9
|
+
|
|
10
|
+
export const setGraphqlServer=()=>{
|
|
11
|
+
const apolloclient = useNuxtApp().$apollo.defaultClient
|
|
12
|
+
const newlink = createHttpLink({
|
|
13
|
+
uri: `${useRuntimeConfig().public.API_URL}/${getCurrentXorg()}/graphql`,
|
|
14
|
+
})
|
|
15
|
+
apolloclient.setLink(newlink)
|
|
16
|
+
// apolloclient.defaultOptions={
|
|
17
|
+
|
|
18
|
+
// query:{
|
|
19
|
+
// fetchPolicy: 'no-cache',
|
|
20
|
+
// errorPolicy: 'all'
|
|
21
|
+
// }
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const graphquery=async(qqlstr: typeof gql) =>(await useAsyncQuery(qqlstr)).data
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-
|
|
4
|
+
* last change 2024-04-15
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
export const
|
|
7
|
+
import {SimpleAppDocumentType} from '~/types'
|
|
8
|
+
export const refreshDocumentList = (docName:SimpleAppDocumentType)=>useNuxtApp().$event('RefreshDocumentList',{documentName:docName})
|
|
9
|
+
export const refreshDocument = (docName:SimpleAppDocumentType)=>useNuxtApp().$event('RefreshDocument',docName)
|
|
9
10
|
|
|
10
|
-
export const listenDocument = (docName:
|
|
11
|
+
export const listenDocument = (docName:SimpleAppDocumentType,callback:Function) =>{
|
|
11
12
|
useNuxtApp().$listen('RefreshDocument',async (eventdocname:string)=>{
|
|
12
13
|
if(eventdocname==docName) await callback()
|
|
13
14
|
})
|
|
14
15
|
}
|
|
15
|
-
export const listenDocumentList = (docName:
|
|
16
|
+
export const listenDocumentList = (docName:SimpleAppDocumentType,callback:Function) =>{
|
|
16
17
|
useNuxtApp().$listen('RefreshDocumentList',async (eventdata)=>{
|
|
17
18
|
if(eventdata.documentName == docName) await callback()
|
|
18
19
|
})
|
|
19
|
-
}
|
|
20
|
+
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
|
|
24
24
|
<HeaderButtonMenuPicker v-model="showMenu"></HeaderButtonMenuPicker>
|
|
25
25
|
<HeaderButtonProfile v-model="showProfile"/>
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
</div>
|
|
28
|
-
|
|
28
|
+
<UserInvitation/>
|
|
29
29
|
<!-- <HeaderBar class="border flex flex-row h-10 fixed left-0 w-full justify justify-between top-0 z-50 bg-white dark:bg-gray-800"/> -->
|
|
30
30
|
|
|
31
31
|
</div>
|
|
@@ -50,6 +50,7 @@ devServer: {
|
|
|
50
50
|
'dayjs-nuxt',
|
|
51
51
|
'@sidebase/nuxt-auth',
|
|
52
52
|
'nuxt-primevue',
|
|
53
|
+
'@nuxtjs/apollo',
|
|
53
54
|
// '@nuxtjs/pwa', //cannot turn on, will cause nuxt cant start
|
|
54
55
|
// "nuxt-security", //temporary avoid nuxt-security cause cors
|
|
55
56
|
'@vueuse/nuxt',
|
|
@@ -89,6 +90,13 @@ devServer: {
|
|
|
89
90
|
],
|
|
90
91
|
defaultLocale: "en",
|
|
91
92
|
},
|
|
93
|
+
apollo: {
|
|
94
|
+
clients: {
|
|
95
|
+
default: {
|
|
96
|
+
httpEndpoint: process.env.API_URL
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
},
|
|
92
100
|
primevue: {
|
|
93
101
|
|
|
94
102
|
options: {
|
|
@@ -16,4 +16,13 @@
|
|
|
16
16
|
* author: Ks Tan
|
|
17
17
|
*/
|
|
18
18
|
useNuxtApp().$event('SetTitle',t('home'))
|
|
19
|
+
|
|
20
|
+
onMounted(()=>{
|
|
21
|
+
if(!getUserStore()?.currency || !getUserStore()?.country){
|
|
22
|
+
const id=getUserStore().orgRecordId
|
|
23
|
+
onScreenEditDocument<Organization>('organization',id, async (actionName:FormCrudEvent,data:Organization)=>{
|
|
24
|
+
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
})
|
|
19
28
|
</script>
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<client-only>
|
|
4
|
-
<title>{{ getUserProfile()?.branchName }}</title>
|
|
5
|
-
</client-only>
|
|
6
|
-
<h1 class="border text-3xl text-center m-20 p-20">
|
|
7
|
-
{{ t("createYourContentHere") }}
|
|
8
|
-
</h1>
|
|
9
|
-
</div>
|
|
2
|
+
<IndexPage></IndexPage>
|
|
10
3
|
</template>
|
|
11
4
|
<script lang="ts" setup>
|
|
12
|
-
|
|
13
|
-
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
14
|
-
* --remove-this-line-to-prevent-override--
|
|
15
|
-
* last change 2024-02-22
|
|
16
|
-
* author: Ks Tan
|
|
17
|
-
*/
|
|
18
|
-
useNuxtApp().$event('SetTitle',t('home'))
|
|
5
|
+
import IndexPage from '../index.vue'
|
|
19
6
|
</script>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<div class="flex flex-col w-full">
|
|
3
3
|
<TextTitle class="text-center p-2">{{ t("pickYourDatabase") }}</TextTitle>
|
|
4
4
|
<div class="flex flex-col">
|
|
5
|
+
|
|
5
6
|
<div class="p-4">
|
|
7
|
+
{{ t('welcome ') }} {{ getUserProfile()?.fullName }}
|
|
6
8
|
<UserButtonCreateTenant></UserButtonCreateTenant>
|
|
7
9
|
</div>
|
|
8
10
|
<UserTenantPicker></UserTenantPicker>
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
/**
|
|
14
16
|
* This file was automatically generated by simpleapp generator.
|
|
15
17
|
* --remove-this-line-to-prevent-override--
|
|
16
|
-
* last change 2023-
|
|
18
|
+
* last change 2023-04-17
|
|
17
19
|
* author: Ks Tan
|
|
18
20
|
*/
|
|
19
21
|
</script>
|
|
@@ -68,6 +68,7 @@ export class SimpleAppClient<
|
|
|
68
68
|
return await this.docapi.runFindOne(id,this.axios)
|
|
69
69
|
.then((res: AxiosResponse) => {
|
|
70
70
|
// if(this.event){this.event('info:getById',res.data)}
|
|
71
|
+
this.data.value={} as TData
|
|
71
72
|
Object.assign(this.data.value, res.data);
|
|
72
73
|
return res;
|
|
73
74
|
}).catch((res:any)=>{
|
|
@@ -100,6 +101,7 @@ export class SimpleAppClient<
|
|
|
100
101
|
// summary:'Record create successfully',
|
|
101
102
|
// status:NotificationStatus.success
|
|
102
103
|
// })
|
|
104
|
+
this.data.value = {} as TData
|
|
103
105
|
this.data.value = { ...res.data };
|
|
104
106
|
holdScreenEnd()
|
|
105
107
|
return res.data;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-
|
|
4
|
+
* last change 2024-04-15
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import { Component } from 'vue';
|
|
8
8
|
import {Notification} from './notifications'
|
|
9
9
|
import { SimpleAppClient } from '~/simpleapp/generate/clients/SimpleAppClient';
|
|
10
10
|
import { FormCrudEvent } from './simpleappinput';
|
|
11
|
+
import { SimpleAppDocumentType } from './documentlist';
|
|
11
12
|
export type ViewRecord = {
|
|
12
13
|
_id: string
|
|
13
14
|
eventId:string
|
|
14
15
|
label:string
|
|
15
|
-
documentName:
|
|
16
|
+
documentName: SimpleAppDocumentType
|
|
16
17
|
viewer?: any
|
|
17
18
|
readonly?:boolean
|
|
18
19
|
paras?:any
|
|
@@ -20,7 +21,7 @@ export type ViewRecord = {
|
|
|
20
21
|
document?:SimpleAppClient<any,any>
|
|
21
22
|
}
|
|
22
23
|
export type RefreshDocumentList ={
|
|
23
|
-
documentName :
|
|
24
|
+
documentName : SimpleAppDocumentType,
|
|
24
25
|
data?:any
|
|
25
26
|
}
|
|
26
27
|
export type EventType ={
|
|
@@ -1,55 +1,33 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
|
|
2
|
+
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
3
|
<bpmn:process id="process1" name="Suspend Customer" isExecutable="false">
|
|
4
4
|
<bpmn:extensionElements />
|
|
5
5
|
<bpmn:startEvent id="StartEvent_1">
|
|
6
6
|
<bpmn:outgoing>Flow_1a63g0z</bpmn:outgoing>
|
|
7
7
|
</bpmn:startEvent>
|
|
8
8
|
<bpmn:endEvent id="Event_0qpgd23">
|
|
9
|
-
<bpmn:incoming>
|
|
9
|
+
<bpmn:incoming>Flow_1rspxq4</bpmn:incoming>
|
|
10
10
|
</bpmn:endEvent>
|
|
11
11
|
<bpmn:sequenceFlow id="Flow_1a63g0z" sourceRef="StartEvent_1" targetRef="hello1" />
|
|
12
|
-
<bpmn:sequenceFlow id="Flow_1rspxq4" sourceRef="hello1" targetRef="
|
|
12
|
+
<bpmn:sequenceFlow id="Flow_1rspxq4" sourceRef="hello1" targetRef="Event_0qpgd23" />
|
|
13
13
|
<bpmn:serviceTask id="hello1" name="hello1">
|
|
14
14
|
<bpmn:documentation>hello1 doc
|
|
15
15
|
bbb</bpmn:documentation>
|
|
16
16
|
<bpmn:incoming>Flow_1a63g0z</bpmn:incoming>
|
|
17
17
|
<bpmn:outgoing>Flow_1rspxq4</bpmn:outgoing>
|
|
18
18
|
</bpmn:serviceTask>
|
|
19
|
-
<bpmn:sequenceFlow id="Flow_1khvymz" sourceRef="approve1" targetRef="hello2" />
|
|
20
|
-
<bpmn:userTask id="approve1" name="approve1" camunda:formKey="simpleapprove" camunda:assignee="kstan">
|
|
21
|
-
<bpmn:documentation>approve1 doc
|
|
22
|
-
abc</bpmn:documentation>
|
|
23
|
-
<bpmn:incoming>Flow_1rspxq4</bpmn:incoming>
|
|
24
|
-
<bpmn:outgoing>Flow_1khvymz</bpmn:outgoing>
|
|
25
|
-
</bpmn:userTask>
|
|
26
|
-
<bpmn:sequenceFlow id="Flow_1oty8vq" sourceRef="hello2" targetRef="Event_0qpgd23" />
|
|
27
|
-
<bpmn:serviceTask id="hello2" name="hello2">
|
|
28
|
-
<bpmn:documentation>hello2 doc
|
|
29
|
-
ccc</bpmn:documentation>
|
|
30
|
-
<bpmn:incoming>Flow_1khvymz</bpmn:incoming>
|
|
31
|
-
<bpmn:outgoing>Flow_1oty8vq</bpmn:outgoing>
|
|
32
|
-
</bpmn:serviceTask>
|
|
33
19
|
</bpmn:process>
|
|
34
20
|
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
35
21
|
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process1">
|
|
36
22
|
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
|
37
23
|
<dc:Bounds x="122" y="202" width="36" height="36" />
|
|
38
24
|
</bpmndi:BPMNShape>
|
|
39
|
-
<bpmndi:BPMNShape id="Event_0qpgd23_di" bpmnElement="Event_0qpgd23">
|
|
40
|
-
<dc:Bounds x="672" y="202" width="36" height="36" />
|
|
41
|
-
</bpmndi:BPMNShape>
|
|
42
25
|
<bpmndi:BPMNShape id="Activity_1trhs2m_di" bpmnElement="hello1">
|
|
43
26
|
<dc:Bounds x="200" y="180" width="100" height="80" />
|
|
44
27
|
<bpmndi:BPMNLabel />
|
|
45
28
|
</bpmndi:BPMNShape>
|
|
46
|
-
<bpmndi:BPMNShape id="
|
|
47
|
-
<dc:Bounds x="
|
|
48
|
-
<bpmndi:BPMNLabel />
|
|
49
|
-
</bpmndi:BPMNShape>
|
|
50
|
-
<bpmndi:BPMNShape id="Activity_1mg3y6c_di" bpmnElement="hello2">
|
|
51
|
-
<dc:Bounds x="510" y="180" width="100" height="80" />
|
|
52
|
-
<bpmndi:BPMNLabel />
|
|
29
|
+
<bpmndi:BPMNShape id="Event_0qpgd23_di" bpmnElement="Event_0qpgd23">
|
|
30
|
+
<dc:Bounds x="402" y="202" width="36" height="36" />
|
|
53
31
|
</bpmndi:BPMNShape>
|
|
54
32
|
<bpmndi:BPMNEdge id="Flow_1a63g0z_di" bpmnElement="Flow_1a63g0z">
|
|
55
33
|
<di:waypoint x="158" y="220" />
|
|
@@ -57,15 +35,7 @@ ccc</bpmn:documentation>
|
|
|
57
35
|
</bpmndi:BPMNEdge>
|
|
58
36
|
<bpmndi:BPMNEdge id="Flow_1rspxq4_di" bpmnElement="Flow_1rspxq4">
|
|
59
37
|
<di:waypoint x="300" y="220" />
|
|
60
|
-
<di:waypoint x="
|
|
61
|
-
</bpmndi:BPMNEdge>
|
|
62
|
-
<bpmndi:BPMNEdge id="Flow_1khvymz_di" bpmnElement="Flow_1khvymz">
|
|
63
|
-
<di:waypoint x="470" y="220" />
|
|
64
|
-
<di:waypoint x="510" y="220" />
|
|
65
|
-
</bpmndi:BPMNEdge>
|
|
66
|
-
<bpmndi:BPMNEdge id="Flow_1oty8vq_di" bpmnElement="Flow_1oty8vq">
|
|
67
|
-
<di:waypoint x="610" y="220" />
|
|
68
|
-
<di:waypoint x="672" y="220" />
|
|
38
|
+
<di:waypoint x="402" y="220" />
|
|
69
39
|
</bpmndi:BPMNEdge>
|
|
70
40
|
</bpmndi:BPMNPlane>
|
|
71
41
|
</bpmndi:BPMNDiagram>
|