@simitgroup/simpleapp-generator 1.0.32 → 1.0.35
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/.vscode/settings.json +3 -0
- package/README.md +185 -16
- package/buildinschemas copy/autoincreament.autoinc.jsonschema.json +39 -0
- package/buildinschemas copy/branch.branch.jsonschema.json +41 -0
- package/buildinschemas copy/docnoformat.docno.jsonschema.json +41 -0
- package/buildinschemas copy/organization.org.jsonschema.json +50 -0
- package/buildinschemas copy/permission.perm.jsonschema.json +23 -0
- package/buildinschemas copy/permission.perm.jsonschema.try.json +25 -0
- package/buildinschemas copy/tenant.tenant.jsonschema.json +21 -0
- package/buildinschemas copy/tenant.tenant.jsonschema.try.json +27 -0
- package/buildinschemas copy/user.user.jsonschema.json +31 -0
- package/dist/buildinschemas/autoincreament.d.ts +3 -0
- package/dist/buildinschemas/autoincreament.d.ts.map +1 -0
- package/dist/buildinschemas/autoincreament.js +36 -0
- package/dist/buildinschemas/autoincreament.js.map +1 -0
- package/dist/buildinschemas/branch.d.ts +3 -0
- package/dist/buildinschemas/branch.d.ts.map +1 -0
- package/dist/buildinschemas/branch.js +41 -0
- package/dist/buildinschemas/branch.js.map +1 -0
- package/dist/buildinschemas/docnoformat.d.ts +3 -0
- package/dist/buildinschemas/docnoformat.d.ts.map +1 -0
- package/dist/buildinschemas/docnoformat.js +60 -0
- package/dist/buildinschemas/docnoformat.js.map +1 -0
- package/dist/buildinschemas/index.d.ts +8 -0
- package/dist/buildinschemas/index.d.ts.map +1 -0
- package/dist/buildinschemas/index.js +18 -0
- package/dist/buildinschemas/index.js.map +1 -0
- package/dist/buildinschemas/organization.d.ts +3 -0
- package/dist/buildinschemas/organization.d.ts.map +1 -0
- package/dist/buildinschemas/organization.js +34 -0
- package/dist/buildinschemas/organization.js.map +1 -0
- package/dist/buildinschemas/permission.d.ts +3 -0
- package/dist/buildinschemas/permission.d.ts.map +1 -0
- package/dist/buildinschemas/permission.js +34 -0
- package/dist/buildinschemas/permission.js.map +1 -0
- package/dist/buildinschemas/tenant.d.ts +3 -0
- package/dist/buildinschemas/tenant.d.ts.map +1 -0
- package/dist/buildinschemas/tenant.js +41 -0
- package/dist/buildinschemas/tenant.js.map +1 -0
- package/dist/buildinschemas/user.d.ts +3 -0
- package/dist/buildinschemas/user.d.ts.map +1 -0
- package/dist/buildinschemas/user.js +31 -0
- package/dist/buildinschemas/user.js.map +1 -0
- package/dist/constant.d.ts +4 -0
- package/dist/constant.d.ts.map +1 -0
- package/dist/constant.js +2 -1
- package/dist/constant.js.map +1 -1
- package/dist/framework.d.ts +10 -0
- package/dist/framework.d.ts.map +1 -0
- package/dist/framework.js +120 -68
- package/dist/framework.js.map +1 -1
- package/dist/generate-allow-changebackend.js +305 -0
- package/dist/generate-allow-changebackend.js.map +1 -0
- package/dist/generate.d.ts +2 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +310 -230
- package/dist/generate.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -20
- package/dist/index.js.map +1 -1
- package/dist/libs.d.ts +2 -0
- package/dist/libs.d.ts.map +1 -0
- package/dist/processors/groupsbuilder.js +2 -0
- package/dist/processors/groupsbuilder.js.map +1 -0
- package/dist/processors/jsonschemabuilder.d.ts +4 -0
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -0
- package/dist/processors/jsonschemabuilder.js +146 -172
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/schematype/baseschema.js +25 -0
- package/dist/schematype/baseschema.js.map +1 -0
- package/dist/schematype/default.js +2 -0
- package/dist/schematype/default.js.map +1 -0
- package/dist/schematype/index.js +12 -0
- package/dist/schematype/index.js.map +1 -0
- package/dist/schematype/primarymasterdata.js +38 -0
- package/dist/schematype/primarymasterdata.js.map +1 -0
- package/dist/schematype/simple.js +24 -0
- package/dist/schematype/simple.js.map +1 -0
- package/dist/schematype/simplemasterdata.js +31 -0
- package/dist/schematype/simplemasterdata.js.map +1 -0
- package/dist/schematype/transaction.js +74 -0
- package/dist/schematype/transaction.js.map +1 -0
- package/dist/storage.d.ts +3 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +2 -2
- package/dist/storage.js.map +1 -1
- package/dist/type.d.ts +164 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +16 -1
- package/dist/type.js.map +1 -1
- package/dist/validation.d.ts +1 -0
- package/dist/validation.d.ts.map +1 -0
- package/documentation/designconcept.bpmn +349 -0
- package/documentation/documentation.png +0 -0
- package/documentation/infra.drawio +141 -0
- package/documentation/infra.png +0 -0
- package/documentation/management.drawio +57 -0
- package/documentation/stack.drawio +106 -0
- package/package.json +3 -1
- package/src/buildinschemas/autoincreament.ts +34 -0
- package/src/buildinschemas/branch.ts +39 -0
- package/src/buildinschemas/docnoformat.ts +58 -0
- package/src/buildinschemas/index.ts +7 -0
- package/src/buildinschemas/organization.ts +31 -0
- package/src/buildinschemas/permission.ts +31 -0
- package/src/buildinschemas/tenant.ts +38 -0
- package/src/buildinschemas/user.ts +28 -0
- package/src/constant.ts +2 -1
- package/src/framework.ts +126 -67
- package/src/generate.ts +327 -266
- package/src/generate.ts.backup +339 -0
- package/src/index.ts +93 -18
- package/src/processors/jsonschemabuilder.ts +199 -226
- package/src/processors/jsonschemabuilder.ts-old +383 -0
- package/src/storage.ts +1 -1
- package/src/type.ts +94 -27
- package/templates/basic/nest/controller.ts.eta +255 -0
- package/templates/basic/nest/default.ts.eta +42 -0
- package/templates/basic/{model.eta → nest/model.ts.eta} +18 -5
- package/templates/basic/nest/processor.ts.eta +129 -0
- package/templates/basic/nest/service.ts.eta +64 -0
- package/templates/basic/{type.eta → nest/type.ts.eta} +3 -3
- package/templates/basic/nuxt/default.ts.eta +42 -0
- package/templates/basic/{pageindex.vue.eta → nuxt/pages.crud.vue.eta} +85 -22
- package/templates/basic/nuxt/simpleapp.doc.ts.eta +11 -0
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +212 -0
- package/templates/nest/.env.eta +31 -0
- package/templates/nest/.gitignore.eta +40 -0
- package/templates/nest/src/app.controller.ts.eta +19 -0
- package/templates/nest/src/app.module.ts.eta +77 -0
- package/templates/nest/src/app.service.ts.eta +9 -0
- package/templates/nest/src/main.ts.eta +58 -0
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +16 -0
- package/templates/nest/src/simpleapp/generate/commons/decorators/appuser.decorator.ts.eta +8 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/foreignkeys.ts.eta +1 -0
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +101 -0
- package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +39 -0
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +38 -0
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +88 -0
- package/templates/nest/{Workflow.eta → src/simpleapp/generate/commons/providers/workflow.provider.ts.etax} +20 -14
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.decorator.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +28 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +10 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +34 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +391 -0
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +71 -0
- package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +53 -0
- package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +45 -0
- package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +57 -0
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +624 -0
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +19 -0
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +74 -0
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +110 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +195 -0
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +18 -0
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +89 -0
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +66 -0
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +93 -0
- package/templates/nest/src/simpleapp/services/org.service.ts.eta +67 -0
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +102 -0
- package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +69 -0
- package/templates/nest/src/simpleapp/services/user.service.ts.eta +66 -0
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +43 -0
- package/templates/nuxt/.env.eta +21 -0
- package/templates/nuxt/.gitignore.eta +28 -0
- package/templates/nuxt/app.vue.eta +5 -2
- package/templates/nuxt/assets/css/tailwind.css.eta +35 -0
- package/templates/nuxt/components/CrudNestedDoc.vue.eta +164 -0
- package/templates/nuxt/components/CrudSimple.vue.eta +179 -0
- package/templates/nuxt/{components.debugdocdata.vue.eta → components/DebugDocumentData.vue.eta} +4 -1
- package/templates/nuxt/{components.eventmonitor.vue.eta → components/EventMonitor.vue.eta} +27 -27
- package/templates/nuxt/components/Invitation.vue.eta +50 -0
- package/templates/nuxt/components/Menus.vue.eta +58 -0
- package/templates/nuxt/components/PermissionInfo.vue.eta +92 -0
- package/templates/nuxt/components/SimpleAppAutocomplete.vue.eta +131 -0
- package/templates/nuxt/components/SimpleAppAutocompletemulti.vue.eta +73 -0
- package/templates/nuxt/components/SimpleAppCalendar.vue.eta +55 -0
- package/templates/nuxt/components/SimpleAppCheckbox.vue.eta +29 -0
- package/templates/nuxt/components/SimpleAppChip.vue.eta +28 -0
- package/templates/nuxt/components/SimpleAppColor.vue.eta +41 -0
- package/templates/nuxt/components/SimpleAppDatatable.vue.eta +20 -0
- package/templates/nuxt/components/SimpleAppDocumentNo.vue.eta +90 -0
- package/templates/nuxt/components/SimpleAppDynamicInput.vue.eta +29 -0
- package/templates/nuxt/components/SimpleAppEditor.vue.eta +31 -0
- package/templates/nuxt/components/SimpleAppForm.vue.eta +131 -0
- package/templates/nuxt/components/SimpleAppInputTable.vue.eta +104 -0
- package/templates/nuxt/components/SimpleAppList.vue.eta +38 -0
- package/templates/nuxt/components/SimpleAppListmulti.vue.eta +41 -0
- package/templates/nuxt/components/SimpleAppNumber.vue.eta +32 -0
- package/templates/nuxt/components/SimpleAppPassword.vue.eta +41 -0
- package/templates/nuxt/components/SimpleAppRadio.vue.eta +42 -0
- package/templates/nuxt/components/SimpleAppRating.vue.eta +41 -0
- package/templates/nuxt/components/SimpleAppSelect.vue.eta +38 -0
- package/templates/nuxt/components/SimpleAppSelectmulti.vue.eta +39 -0
- package/templates/nuxt/components/SimpleAppSlider.vue.eta +42 -0
- package/templates/nuxt/components/SimpleAppSwitch.vue.eta +30 -0
- package/templates/nuxt/components/SimpleAppText.vue.eta +50 -0
- package/templates/nuxt/components/SimpleAppTextarea.vue.eta +30 -0
- package/templates/nuxt/components/SimpleAppValue.vue.eta +86 -0
- package/templates/nuxt/components/SimpleFieldContainer.vue.eta +102 -0
- package/templates/nuxt/components/XorgPicker.vue.eta +66 -0
- package/templates/nuxt/components/helper.ts.eta +90 -0
- package/templates/nuxt/components/type.ts.eta +32 -0
- package/templates/nuxt/composables/docformat.generate.ts.eta +5 -0
- package/templates/nuxt/{composables.getautocomplete.ts.eta → composables/getAutocomplete.generate.ts.eta} +4 -5
- package/templates/nuxt/{composables.getmenus.ts.eta → composables/getMenus.generate.ts.eta} +22 -7
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +6 -0
- package/templates/nuxt/composables/getTenant.generate.ts.eta +4 -0
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +22 -0
- package/templates/nuxt/composables/logout.generate.ts.eta +22 -0
- package/templates/nuxt/composables/roles.generate.ts.eta +48 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +5 -0
- package/templates/nuxt/{layouts.default.vue.eta → layouts/default.vue.eta} +2 -0
- package/templates/nuxt/middleware/10.acl.global.ts.eta +38 -0
- package/templates/nuxt/nuxt.config.ts.eta +12 -2
- package/templates/nuxt/pages/[xorg]/branch/index.vue.eta +102 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/[id].vue.eta +17 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +269 -0
- package/templates/nuxt/pages/[xorg]/index.vue.eta +36 -0
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +148 -0
- package/templates/nuxt/pages/[xorg]/permission/index.vue.eta +280 -0
- package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +93 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +468 -0
- package/templates/nuxt/pages/index.vue.eta +191 -0
- package/templates/nuxt/pages/login.vue.eta +21 -0
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +53 -0
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +155 -0
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +23 -0
- package/templates/nuxt/{server.api.ts.eta → server/api/[xorg]/[...].ts.eta} +5 -2
- package/templates/nuxt/server/api/auth/[...].ts.eta +68 -0
- package/templates/nuxt/{server.api.auth.logout.ts.eta → server/api/auth/logout.ts.eta} +1 -3
- package/templates/nuxt/server/api/profile/[...].ts.eta +150 -0
- package/templates/nuxt/server/api/profile/index.ts.eta +103 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +187 -0
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +5 -0
- package/templates/nuxt/simpleapp/generate/commons/groups.ts.eta +11 -0
- package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +21 -0
- package/templates/nuxt/types/index.ts.eta +65 -0
- package/templates/project/README.md +11 -0
- package/templates/project/build.sh.eta +17 -0
- package/templates/project/config.json.eta +2 -0
- package/templates/project/generate.ts.eta +10 -0
- package/templates/project/schemas/category.ts.eta +26 -0
- package/templates/project/schemas/index.ts.eta +5 -0
- package/templates/project/schemas/product.ts.eta +59 -0
- package/templates/project/shares/hello.ts.eta +1 -0
- package/templates/project/shares/index.ts.eta +2 -0
- package/tsconfig.json +9 -2
- package/tsconfig.tsbuildinfo +1 -0
- package/definations/category.cat.jsonschema.json +0 -55
- package/definations/level.lvl.jsonschema.json +0 -48
- package/definations/product.prd.jsonschema.json +0 -46
- package/templates/basic/controller.eta +0 -152
- package/templates/basic/module.eta +0 -22
- package/templates/basic/service.eta +0 -62
- package/templates/basic/simpleappclient.eta +0 -120
- package/templates/nest/SimpleAppController.eta +0 -69
- package/templates/nest/SimpleAppService.eta +0 -366
- package/templates/nest/TenantMiddleware.eta +0 -34
- package/templates/nest/UserProvider.eta +0 -127
- package/templates/nest/app.controller.eta +0 -12
- package/templates/nest/app.module.eta +0 -64
- package/templates/nest/app.service.eta +0 -8
- package/templates/nest/inputvalidation-exception.eta +0 -6
- package/templates/nest/nest.env.eta +0 -28
- package/templates/nest/nest.main.eta +0 -31
- package/templates/nuxt/components.crudsimple.vue.eta +0 -124
- package/templates/nuxt/components.menus.vue.eta +0 -35
- package/templates/nuxt/env.eta +0 -17
- package/templates/nuxt/pages.[xorg].index.vue.eta +0 -20
- package/templates/nuxt/pages.index.vue.eta +0 -72
- package/templates/nuxt/pages.login.vue.eta +0 -20
- package/templates/nuxt/plugins.simpleapp.ts.eta +0 -88
- package/templates/nuxt/server.api.auth[...].ts.eta +0 -233
- package/templates/nuxt/tailwind.css.eta +0 -49
- /package/templates/basic/{apischema.eta → nest/apischema.ts.eta} +0 -0
- /package/templates/basic/{jsonschema.eta → nest/jsonschema.ts.eta} +0 -0
- /package/templates/basic/{pageindexwithid.vue.eta → nuxt/pages.[id].vue.eta} +0 -0
- /package/templates/nest/{oauth2-redirect.eta → public_html/oauth2-redirect.html.eta} +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button class="btn-primary" @click="newRecord">New</button>
|
|
3
|
+
<ConfirmPopup></ConfirmPopup>
|
|
4
|
+
<DebugDocumentData v-model="data"></DebugDocumentData>
|
|
5
|
+
<SimpleAppDatatable
|
|
6
|
+
|
|
7
|
+
v-model="recordlist"
|
|
8
|
+
:setting="{}"
|
|
9
|
+
:columns="['docNoFormatNo','docNoFormatName','active','docNoPattern','nextNumber','isMonthly']"
|
|
10
|
+
>
|
|
11
|
+
<Column header="action">
|
|
12
|
+
<template #body="{data,index}">
|
|
13
|
+
<button class="pi pi-pencil btn-primary" @click="triggerEdit(data)"></button>
|
|
14
|
+
<button class="pi pi-times btn-danger" @click="triggerDelete(data)"></button>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
</Column>
|
|
18
|
+
</SimpleAppDatatable>
|
|
19
|
+
<Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
20
|
+
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
21
|
+
<button class="btn-default" :disabled="disabled" @click="newRecord" type="button" v-if="canPerform(resourcename,'create')">New</button>
|
|
22
|
+
<button class="btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(resourcename,'create') && data._id==''">Create</button>
|
|
23
|
+
<button class="btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(resourcename,'update') && data._id!=''">Update</button>
|
|
24
|
+
<button class="btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(resourcename,'delete') && data._id!=''">Delete</button>
|
|
25
|
+
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
26
|
+
<ConfirmPopup></ConfirmPopup>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
<SimpleAppForm
|
|
30
|
+
:document="doc"
|
|
31
|
+
#default="o"
|
|
32
|
+
title="Document No"
|
|
33
|
+
|
|
34
|
+
>
|
|
35
|
+
<div class="grid grid-cols-4">
|
|
36
|
+
<SimpleAppText
|
|
37
|
+
autofocus
|
|
38
|
+
:setting="o.getField('#/properties/docNoFormatNo')"
|
|
39
|
+
v-model="data.docNoFormatNo"
|
|
40
|
+
/>
|
|
41
|
+
<SimpleAppText
|
|
42
|
+
autofocus
|
|
43
|
+
:setting="o.getField('#/properties/docNoFormatName')"
|
|
44
|
+
v-model="data.docNoFormatName"
|
|
45
|
+
/>
|
|
46
|
+
<SimpleAppCheckbox
|
|
47
|
+
autofocus
|
|
48
|
+
:setting="o.getField('#/properties/active')"
|
|
49
|
+
v-model="data.active"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<SimpleAppCheckbox
|
|
53
|
+
autofocus
|
|
54
|
+
:setting="o.getField('#/properties/default')"
|
|
55
|
+
v-model="data.default"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<SimpleAppText
|
|
61
|
+
autofocus
|
|
62
|
+
:setting="o.getField('#/properties/docNoPattern')"
|
|
63
|
+
v-model="data.docNoPattern"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
<SimpleAppCheckbox
|
|
67
|
+
autofocus
|
|
68
|
+
:setting="o.getField('#/properties/isMonthly')"
|
|
69
|
+
v-model="data.isMonthly"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<SimpleAppNumber
|
|
73
|
+
autofocus
|
|
74
|
+
:setting="o.getField('#/properties/nextNumber')"
|
|
75
|
+
v-model="data.nextNumber"
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
<SimpleAppValue :setting="o.getField('#/properties/monthlySetting')">
|
|
79
|
+
<SimpleAppNumber
|
|
80
|
+
autofocus
|
|
81
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jan')"
|
|
82
|
+
instancePath="#/monthlySetting/jan"
|
|
83
|
+
v-model="data.monthlySetting.jan"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<SimpleAppNumber
|
|
87
|
+
autofocus
|
|
88
|
+
:setting="o.getField('#/properties/monthlySetting/properties/feb')"
|
|
89
|
+
instancePath="#/monthlySetting/feb"
|
|
90
|
+
v-model="data.monthlySetting.feb"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<SimpleAppNumber
|
|
94
|
+
autofocus
|
|
95
|
+
:setting="o.getField('#/properties/monthlySetting/properties/mar')"
|
|
96
|
+
instancePath="#/monthlySetting/mar"
|
|
97
|
+
v-model="data.monthlySetting.mar"
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<SimpleAppNumber
|
|
101
|
+
autofocus
|
|
102
|
+
:setting="o.getField('#/properties/monthlySetting/properties/apr')"
|
|
103
|
+
instancePath="#/monthlySetting/apr"
|
|
104
|
+
v-model="data.monthlySetting.apr"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<SimpleAppNumber
|
|
108
|
+
autofocus
|
|
109
|
+
:setting="o.getField('#/properties/monthlySetting/properties/may')"
|
|
110
|
+
instancePath="#/monthlySetting/may"
|
|
111
|
+
v-model="data.monthlySetting.may"
|
|
112
|
+
/>
|
|
113
|
+
|
|
114
|
+
<SimpleAppNumber
|
|
115
|
+
autofocus
|
|
116
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jun')"
|
|
117
|
+
instancePath="#/monthlySetting/jun"
|
|
118
|
+
v-model="data.monthlySetting.jun"
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<SimpleAppNumber
|
|
122
|
+
autofocus
|
|
123
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jul')"
|
|
124
|
+
instancePath="#/monthlySetting/jul"
|
|
125
|
+
v-model="data.monthlySetting.jul"
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<SimpleAppNumber
|
|
129
|
+
autofocus
|
|
130
|
+
:setting="o.getField('#/properties/monthlySetting/properties/aug')"
|
|
131
|
+
instancePath="#/monthlySetting/aug"
|
|
132
|
+
v-model="data.monthlySetting.aug"
|
|
133
|
+
/>
|
|
134
|
+
|
|
135
|
+
<SimpleAppNumber
|
|
136
|
+
autofocus
|
|
137
|
+
:setting="o.getField('#/properties/monthlySetting/properties/sep')"
|
|
138
|
+
instancePath="#/monthlySetting/sep"
|
|
139
|
+
v-model="data.monthlySetting.sep"
|
|
140
|
+
/>
|
|
141
|
+
|
|
142
|
+
<SimpleAppNumber
|
|
143
|
+
autofocus
|
|
144
|
+
:setting="o.getField('#/properties/monthlySetting/properties/oct')"
|
|
145
|
+
instancePath="#/monthlySetting/oct"
|
|
146
|
+
v-model="data.monthlySetting.oct"
|
|
147
|
+
/>
|
|
148
|
+
|
|
149
|
+
<SimpleAppNumber
|
|
150
|
+
autofocus
|
|
151
|
+
:setting="o.getField('#/properties/monthlySetting/properties/nov')"
|
|
152
|
+
instancePath="#/monthlySetting/nov"
|
|
153
|
+
v-model="data.monthlySetting.nov"
|
|
154
|
+
/>
|
|
155
|
+
|
|
156
|
+
<SimpleAppNumber
|
|
157
|
+
autofocus
|
|
158
|
+
:setting="o.getField('#/properties/monthlySetting/properties/dec')"
|
|
159
|
+
instancePath="#/monthlySetting/dec"
|
|
160
|
+
v-model="data.monthlySetting.dec"
|
|
161
|
+
/>
|
|
162
|
+
</SimpleAppValue>
|
|
163
|
+
</div>
|
|
164
|
+
</SimpleAppForm>
|
|
165
|
+
</Dialog>
|
|
166
|
+
</template>
|
|
167
|
+
<script setup lang="ts">
|
|
168
|
+
import _ from 'lodash'
|
|
169
|
+
import Dialog from 'primevue/dialog';
|
|
170
|
+
import Column from 'primevue/column';
|
|
171
|
+
import {ListItem} from '@/types/listview'
|
|
172
|
+
import ConfirmPopup from 'primevue/confirmpopup';
|
|
173
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
174
|
+
const {$event,$listen, $DocnoformatDoc} = useNuxtApp()
|
|
175
|
+
const doc = $DocnoformatDoc()
|
|
176
|
+
const data = doc.getReactiveData()
|
|
177
|
+
|
|
178
|
+
const visible = ref(false)
|
|
179
|
+
const disabled = ref(false)
|
|
180
|
+
const popuptitle = ref('edit')
|
|
181
|
+
const recordlist = ref()
|
|
182
|
+
const selectedDoctype = ref('')
|
|
183
|
+
const confirm = useConfirm();
|
|
184
|
+
// This will work in both `<script setup>` and `<script>`
|
|
185
|
+
definePageMeta({
|
|
186
|
+
layout: 'sidelistcrud',
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const resourcename = ref( _.upperFirst(doc.getDocName()))
|
|
190
|
+
|
|
191
|
+
const refresh = async() =>{
|
|
192
|
+
const filter = {docNoType: selectedDoctype.value}
|
|
193
|
+
|
|
194
|
+
console.log("selectedDoctype",selectedDoctype.value)
|
|
195
|
+
|
|
196
|
+
const results = await doc.search(filter)
|
|
197
|
+
recordlist.value = results
|
|
198
|
+
}
|
|
199
|
+
$listen('itemselected', (item:ListItem)=>{
|
|
200
|
+
selectedDoctype.value = item.code
|
|
201
|
+
refresh()
|
|
202
|
+
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
onMounted(()=>{
|
|
206
|
+
const doclist = getDocTypes()
|
|
207
|
+
console.log(doclist)
|
|
208
|
+
const listdata:ListItem[] = getDocTypes().map(item=> ({name:item.docName,code:item.docType} as ListItem))
|
|
209
|
+
$event('listloaded',listdata)
|
|
210
|
+
})
|
|
211
|
+
const newRecord = () => {
|
|
212
|
+
// useRouter().push({ path: `${props.path}` })
|
|
213
|
+
doc.setNew()
|
|
214
|
+
data.value.docNoType=selectedDoctype.value
|
|
215
|
+
|
|
216
|
+
visible.value=true;
|
|
217
|
+
$event("newRecord")
|
|
218
|
+
};
|
|
219
|
+
const createData= ()=>{
|
|
220
|
+
disabled.value=true
|
|
221
|
+
|
|
222
|
+
doc.create().then(()=>{
|
|
223
|
+
visible.value=false
|
|
224
|
+
refresh()
|
|
225
|
+
}).catch(err=>{
|
|
226
|
+
console.error(err)
|
|
227
|
+
}).finally(()=>disabled.value=false)
|
|
228
|
+
}
|
|
229
|
+
const updateData= ()=>{
|
|
230
|
+
disabled.value=true
|
|
231
|
+
|
|
232
|
+
doc.update().then(()=>{
|
|
233
|
+
visible.value=false
|
|
234
|
+
refresh()
|
|
235
|
+
}).catch(err=>{
|
|
236
|
+
console.error(err)
|
|
237
|
+
}).finally(()=>disabled.value=false)
|
|
238
|
+
}
|
|
239
|
+
const deleteData= (e:any)=>{
|
|
240
|
+
confirm.require({
|
|
241
|
+
target: e.currentTarget as HTMLElement,
|
|
242
|
+
message:'Delete?',
|
|
243
|
+
icon: 'pi pi-exclamation-triangle',
|
|
244
|
+
acceptClass: 'p-button-danger',
|
|
245
|
+
accept: ()=>{
|
|
246
|
+
disabled.value=true
|
|
247
|
+
doc.delete(data.value._id ?? "").then(()=>visible.value=false).finally(() => {
|
|
248
|
+
refresh();
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
reject: () => {
|
|
252
|
+
console.log("Cancel delete")
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const triggerDelete = async (event: any) => {
|
|
258
|
+
let id = event._id.toString()
|
|
259
|
+
await doc.delete(id)
|
|
260
|
+
refresh()
|
|
261
|
+
};
|
|
262
|
+
const triggerEdit = async (event: any) => {
|
|
263
|
+
let id = event._id.toString()
|
|
264
|
+
await doc.getById(id)
|
|
265
|
+
console.log(id)
|
|
266
|
+
visible.value=true
|
|
267
|
+
useRouter().push({ path:`/${useRoute().params.xorg}/docnoformat/${id}` })
|
|
268
|
+
};
|
|
269
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
+
* You may modify it for your need
|
|
5
|
+
* last change 2023-09-20
|
|
6
|
+
* author: Ks Tan
|
|
7
|
+
*/
|
|
8
|
+
const userprofile = ref();
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
userprofile.value = getUserProfile();
|
|
11
|
+
});
|
|
12
|
+
const menus = getMenus();
|
|
13
|
+
</script>
|
|
14
|
+
<template>
|
|
15
|
+
<div>
|
|
16
|
+
<div class="desktop-shortcut-link">
|
|
17
|
+
<DebugDocumentData v-model="userprofile"></DebugDocumentData>
|
|
18
|
+
<NuxtLink v-for="menu in menus[1].items" :external="true" :to="menu.to">
|
|
19
|
+
<div>
|
|
20
|
+
{{ camelCaseToWords(menu.label) }}
|
|
21
|
+
</div>
|
|
22
|
+
</NuxtLink>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<style scoped>
|
|
27
|
+
.desktop-shortcut-link {
|
|
28
|
+
@apply m-2 p-2 space-x-2 rounded-sm text-center grid grid-cols-4 gap-4;
|
|
29
|
+
}
|
|
30
|
+
.desktop-shortcut-link div {
|
|
31
|
+
@apply bg-teal-300 p-2;
|
|
32
|
+
}
|
|
33
|
+
.desktop-shortcut-link div:hover {
|
|
34
|
+
@apply bg-teal-600 p-2;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp everytime regenerate code.
|
|
4
|
+
* delete file "delete-me-for-avoid-override" if you want to modify this file and
|
|
5
|
+
* prevent regenerate code override it.
|
|
6
|
+
* last change 2023-09-09
|
|
7
|
+
* author: Ks Tan
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
InputTableColumnType,
|
|
12
|
+
InputTableColumn,
|
|
13
|
+
} from "@simitgroup/simpleapp-vue-component/src/type";
|
|
14
|
+
import Column from "primevue/column";
|
|
15
|
+
const { $OrganizationDoc,$BranchDoc, $listen } = useNuxtApp();
|
|
16
|
+
//organization
|
|
17
|
+
const doc = $OrganizationDoc();
|
|
18
|
+
const data = doc.getReactiveData();
|
|
19
|
+
const columns = ["orgCode", "orgName", "description", "tenantId", "orgId"];
|
|
20
|
+
const branchlist = ref()
|
|
21
|
+
const branchdoc = $BranchDoc()
|
|
22
|
+
const branchdata = branchdoc.getReactiveData()
|
|
23
|
+
const currentOrgId=ref()
|
|
24
|
+
const debugdata= ref()
|
|
25
|
+
const showbranchfrom = ref(false)
|
|
26
|
+
//branch
|
|
27
|
+
|
|
28
|
+
const getBranchList = () => {
|
|
29
|
+
|
|
30
|
+
branchdoc.getApi().runSearch({orgId:data.value.orgId}).then((res)=>{
|
|
31
|
+
branchlist.value =res.data
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
$listen('editRecord',async (editOrgid)=>{
|
|
35
|
+
//console.log('editRecord',editOrgid)
|
|
36
|
+
debugdata.value=data.value
|
|
37
|
+
if(editOrgid){
|
|
38
|
+
|
|
39
|
+
currentOrgId.value=editOrgid
|
|
40
|
+
getBranchList()
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const editBranch=(recordId:string)=>{
|
|
45
|
+
console.log("edit nested",currentOrgId,recordId)
|
|
46
|
+
showbranchfrom.value=true
|
|
47
|
+
debugdata.value=branchdata.value
|
|
48
|
+
if(!recordId){
|
|
49
|
+
branchdoc.setNew()
|
|
50
|
+
}else{
|
|
51
|
+
branchdoc.getById(recordId)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const saveBranch= async()=>{
|
|
55
|
+
branchdata.value.orgId=data.value.orgId
|
|
56
|
+
branchdata.value.organization = {
|
|
57
|
+
_id: data.value._id,
|
|
58
|
+
orgId: data.value.orgId,
|
|
59
|
+
label: data.value.orgName
|
|
60
|
+
}
|
|
61
|
+
if(branchdata.value._id==''){
|
|
62
|
+
console.log("Create")
|
|
63
|
+
await branchdoc.create()
|
|
64
|
+
}else{
|
|
65
|
+
console.log("update")
|
|
66
|
+
await branchdoc.update()
|
|
67
|
+
}
|
|
68
|
+
getBranchList()
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//end
|
|
73
|
+
</script>
|
|
74
|
+
<template>
|
|
75
|
+
<div>
|
|
76
|
+
<DebugDocumentData v-model="debugdata"/>
|
|
77
|
+
<CrudNestedDoc
|
|
78
|
+
:document="doc"
|
|
79
|
+
title="Organization"
|
|
80
|
+
#default="o"
|
|
81
|
+
:path="`/${useRoute().params.xorg}/organization`"
|
|
82
|
+
:listColumns="columns"
|
|
83
|
+
>
|
|
84
|
+
<div class="grid grid-cols-4 gap-4 w-full">
|
|
85
|
+
<SimpleAppText
|
|
86
|
+
autofocus
|
|
87
|
+
:setting="o.getField('#/properties/orgCode')"
|
|
88
|
+
v-model="data.orgCode"
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<SimpleAppText
|
|
92
|
+
:setting="o.getField('#/properties/orgName')"
|
|
93
|
+
v-model="data.orgName"
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<SimpleAppCheckbox
|
|
97
|
+
:setting="o.getField('#/properties/active')"
|
|
98
|
+
v-model="data.active"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<SimpleAppTextarea
|
|
102
|
+
:setting="o.getField('#/properties/description')"
|
|
103
|
+
v-model="data.description"
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<!-- <SimpleAppNumber
|
|
107
|
+
:readonly="true"
|
|
108
|
+
:setting="o.getField('#/properties/tenantId')"
|
|
109
|
+
v-model="data.tenantId"
|
|
110
|
+
/>
|
|
111
|
+
<SimpleAppNumber
|
|
112
|
+
:readonly="true"
|
|
113
|
+
:setting="o.getField('#/properties/orgId')"
|
|
114
|
+
v-model="data.orgId"
|
|
115
|
+
/> -->
|
|
116
|
+
</div>
|
|
117
|
+
<div class="grid grid-cols-4 gap-4 w-full">
|
|
118
|
+
<div class="col-span-2">
|
|
119
|
+
|
|
120
|
+
<SimpleAppDatatable v-model="branchlist" :columns="['branchId','branchCode','branchName','active']">
|
|
121
|
+
<template #header>
|
|
122
|
+
<button class="btn-primary" @click="editBranch('')" type="button" ><span class="pi pi-plus "> </span></button>
|
|
123
|
+
</template>
|
|
124
|
+
<Column header="Action" >
|
|
125
|
+
<template #body="{index,data}">
|
|
126
|
+
<button type="button" class="btn-primary" @click="editBranch(data._id)">Edit</button>
|
|
127
|
+
</template>
|
|
128
|
+
</Column>
|
|
129
|
+
|
|
130
|
+
</SimpleAppDatatable>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="col-span-2" >
|
|
133
|
+
<SimpleAppForm :document="branchdoc" #default="o" v-if="showbranchfrom">
|
|
134
|
+
<SimpleAppText v-model="branchdata.branchCode" :setting="o.getField('#/properties/branchCode')"/>
|
|
135
|
+
<SimpleAppText v-model="branchdata.branchName" :setting="o.getField('#/properties/branchName')"/>
|
|
136
|
+
<SimpleAppCheckbox v-model="branchdata.active" :setting="o.getField('#/properties/active')"/>
|
|
137
|
+
<SimpleAppTextarea v-model="branchdata.description" :setting="o.getField('#/properties/description')"/>
|
|
138
|
+
<!-- <SimpleAppNumber :readonly="true" v-model="branchdata.orgId" :setting="o.getField('#/properties/orgId')"/> -->
|
|
139
|
+
<button class="btn-primary" type="button" @click="saveBranch">Save</button>
|
|
140
|
+
|
|
141
|
+
</SimpleAppForm>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
</CrudNestedDoc>
|
|
146
|
+
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|