@simitgroup/simpleapp-generator 1.3.5-alpha → 1.4.1-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/permission.d.ts.map +1 -1
- package/dist/buildinschemas/permission.js +10 -6
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +22 -2
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/generate.js +20 -6
- package/dist/generate.js.map +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/permission.ts +10 -6
- package/src/buildinschemas/user.ts +23 -3
- package/src/generate.ts +19 -6
- package/src/type.ts +3 -1
- package/templates/basic/nest/service.ts.eta +7 -3
- package/templates/basic/nuxt/pages.[id].vue.eta +4 -4
- package/templates/basic/nuxt/pages.mobile.[id].vue.eta +39 -0
- package/templates/basic/nuxt/pages.mobile.landing.vue.eta +69 -0
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +29 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +22 -12
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +26 -1
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +2 -1
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +5 -7
- package/templates/nest/src/simpleapp/services/user.service.ts.eta.old +118 -0
- package/templates/nest/src/simpleapp/types/index.ts._eta +8 -0
- package/templates/nuxt/app.vue._eta +31 -17
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +1 -1
- package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +181 -163
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +8 -6
- package/templates/nuxt/components/form/FormDocnoformat.vue.eta +174 -0
- package/templates/nuxt/components/form/FormUser.vue._eta +91 -0
- package/templates/nuxt/components/form/user/FormUserPermission.vue.eta +83 -0
- package/templates/nuxt/components/header/HeaderBar.vue._eta +43 -39
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +7 -9
- package/templates/nuxt/components/page/PageDocList.vue.eta +6 -4
- package/templates/nuxt/components/renderer/RendererDateTime.vue.eta +13 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +6 -3
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +3 -4
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +48 -4
- package/templates/nuxt/composables/date.generate.ts.eta +3 -1
- package/templates/nuxt/composables/goTo.generate.ts.eta +4 -1
- package/templates/nuxt/layouts/mobile.vue._eta +26 -12
- package/templates/nuxt/nuxt.config.ts._eta +27 -20
- package/templates/nuxt/pages/[xorg]/{user/index.vue.eta → docnoformat/[id].vue.eta} +11 -9
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +51 -20
- package/templates/nuxt/pages/[xorg]/mobile/docnoformat/index.vue.eta +59 -0
- package/templates/nuxt/pages/[xorg]/mobile/index.vue._eta +19 -0
- package/templates/nuxt/pages/[xorg]/mobile/organization/index.vue.eta +138 -0
- package/templates/nuxt/pages/[xorg]/mobile/pickgroup.vue._eta +35 -0
- package/templates/nuxt/pages/[xorg]/mobile/user/index.vue.eta +231 -0
- package/templates/nuxt/pages/[xorg]/pickgroup.vue._eta +35 -0
- package/templates/nuxt/pages/[xorg]/user.vue.eta +91 -74
- package/templates/nuxt/pages/profile.vue.eta +7 -7
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +14 -3
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +18 -16
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +1 -1
- package/templates/nuxt/types/events.ts.eta +1 -0
- package/templates/nuxt/types/simpleappinput.ts.eta +3 -2
- package/templates/nuxt/types/user.ts.eta +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nest/src/simpleapp/services/user.service.ts.etax +0 -66
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/[id].vue.eta +0 -13
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +0 -229
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +0 -38
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +0 -11
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +0 -39
- package/templates/nuxt/pages/[xorg]/user/form.vue.eta +0 -334
- package/templates/nuxt/pages/[xorg]/user/new.vue.eta +0 -18
- package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +0 -29
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator
|
|
3
|
-
*
|
|
4
|
-
* last change
|
|
5
|
-
*
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2023-10-28
|
|
5
|
+
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import path from 'path'
|
|
8
8
|
export default defineNuxtConfig({
|
|
@@ -27,6 +27,15 @@ export default defineNuxtConfig({
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
+
app: {
|
|
31
|
+
// pageTransition: {
|
|
32
|
+
// name: 'slide-fade',
|
|
33
|
+
// mode: 'out-in',
|
|
34
|
+
// css: false,
|
|
35
|
+
|
|
36
|
+
// },
|
|
37
|
+
// layoutTransition: { name: 'layout', mode: 'default' }
|
|
38
|
+
},
|
|
30
39
|
tailwindcss: {
|
|
31
40
|
// Options
|
|
32
41
|
},
|
|
@@ -36,7 +45,7 @@ devServer: {
|
|
|
36
45
|
modules: [
|
|
37
46
|
// "@hebilicious/authjs-nuxt",
|
|
38
47
|
'@nuxtjs/color-mode',
|
|
39
|
-
|
|
48
|
+
'@nuxtjs/device',
|
|
40
49
|
'@nuxtjs/i18n',
|
|
41
50
|
'dayjs-nuxt',
|
|
42
51
|
'@sidebase/nuxt-auth',
|
|
@@ -52,19 +61,18 @@ devServer: {
|
|
|
52
61
|
['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
|
|
53
62
|
],
|
|
54
63
|
}],
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
],
|
|
65
|
+
dayjs:{
|
|
66
|
+
plugins: [ 'utc', 'duration']
|
|
67
|
+
},
|
|
59
68
|
device: {
|
|
60
69
|
refreshOnResize: true
|
|
61
|
-
},
|
|
70
|
+
},
|
|
62
71
|
i18n: {
|
|
63
72
|
lazy: true,
|
|
64
73
|
langDir: "lang/",
|
|
65
74
|
strategy: "no_prefix",
|
|
66
|
-
locales: [
|
|
67
|
-
|
|
75
|
+
locales: [
|
|
68
76
|
{
|
|
69
77
|
code: "en",
|
|
70
78
|
iso: "en",
|
|
@@ -82,17 +90,18 @@ devServer: {
|
|
|
82
90
|
defaultLocale: "en",
|
|
83
91
|
},
|
|
84
92
|
primevue: {
|
|
93
|
+
|
|
85
94
|
options: {
|
|
86
|
-
//unstyled: true,
|
|
87
95
|
ripple: true,
|
|
88
|
-
inputStyle: 'filled'
|
|
96
|
+
inputStyle: 'filled',
|
|
97
|
+
|
|
89
98
|
},
|
|
90
99
|
components: {
|
|
91
100
|
include: '*',
|
|
92
|
-
exclude: ['chart']
|
|
101
|
+
// exclude: ['chart']
|
|
93
102
|
},
|
|
94
103
|
directives: {
|
|
95
|
-
include: ['Ripple', 'Tooltip','
|
|
104
|
+
include: ['Ripple', 'Tooltip','Badge','FocusTrap']
|
|
96
105
|
},
|
|
97
106
|
cssLayerOrder: 'tailwind-base, primevue, tailwind-utilities',
|
|
98
107
|
importPT: { as: 'SimpleAppPT', from: path.resolve(__dirname,'./assets/primevue/passthrough.ts') },
|
|
@@ -105,9 +114,6 @@ devServer: {
|
|
|
105
114
|
auth: {
|
|
106
115
|
globalAppMiddleware: false
|
|
107
116
|
},
|
|
108
|
-
dayjs:{
|
|
109
|
-
plugins: [ 'utc', 'duration']
|
|
110
|
-
},
|
|
111
117
|
// security: {
|
|
112
118
|
// corsHandler:{
|
|
113
119
|
// origin: '*' //| 'null' | (string | RegExp)[] | ((origin: string) => boolean);
|
|
@@ -136,10 +142,11 @@ devServer: {
|
|
|
136
142
|
css: [
|
|
137
143
|
'primeicons/primeicons.css',
|
|
138
144
|
path.resolve(__dirname,'./assets/css/style.css'),
|
|
145
|
+
path.resolve(__dirname,'./assets/css/listview.css'),
|
|
139
146
|
path.resolve(__dirname,'./assets/css/calendar.css'),
|
|
140
147
|
],
|
|
141
148
|
},
|
|
142
|
-
|
|
149
|
+
|
|
143
150
|
// devtools: { enabled: true },
|
|
144
151
|
// build: {
|
|
145
152
|
// // transpile: ["primevue"]
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<LazyFormDocnoformat :_id="_id" @after="after" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
6
|
/**
|
|
7
|
-
* This file was automatically generated by simpleapp generator.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Author: Ks Tan
|
|
7
|
+
* This file was automatically generated by simpleapp generator.
|
|
8
|
+
* last change 2023-09-09
|
|
9
|
+
* author: Ks Tan
|
|
11
10
|
*/
|
|
12
|
-
import Crud from "./form.vue";
|
|
13
|
-
import { User } from "~/simpleapp/generate/types";
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
import { Docnoformat } from "~/simpleapp/generate/types";
|
|
13
|
+
const doc = useNuxtApp().$DocnoformatDoc();
|
|
16
14
|
|
|
17
15
|
const props = defineProps<{ _id: string }>();
|
|
18
|
-
const after = (actionName: string, data:
|
|
16
|
+
const after = (actionName: string, data: Docnoformat) => {
|
|
17
|
+
console.log("Docnoformat capture after emits ", actionName);
|
|
19
18
|
switch (actionName) {
|
|
20
19
|
case "new":
|
|
21
20
|
goTo(doc.getDocName(), "new");
|
|
@@ -23,13 +22,16 @@ const after = (actionName: string, data: User, result: any) => {
|
|
|
23
22
|
case "create":
|
|
24
23
|
goTo(doc.getDocName(), data._id);
|
|
25
24
|
refreshDocumentList(doc.getDocName());
|
|
25
|
+
useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
|
|
26
26
|
break;
|
|
27
27
|
case "update":
|
|
28
28
|
refreshDocumentList(doc.getDocName());
|
|
29
|
+
useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
|
|
29
30
|
break;
|
|
30
31
|
case "delete":
|
|
31
32
|
goTo(doc.getDocName(), "new");
|
|
32
33
|
refreshDocumentList(doc.getDocName());
|
|
34
|
+
useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
|
|
33
35
|
break;
|
|
34
36
|
}
|
|
35
37
|
};
|
|
@@ -1,28 +1,59 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
<PageDocList
|
|
3
|
+
:document="doc"
|
|
4
|
+
:columns="columns"
|
|
5
|
+
:data="docdata"
|
|
6
|
+
:sorts="sorts"
|
|
7
|
+
>
|
|
8
|
+
<template #mobileList="{ item }">
|
|
9
|
+
<!-- <div class="flex flex-row justify justify-end"> -->
|
|
10
|
+
<div class="flex flex-col flex-1">
|
|
11
|
+
<text-primary>{{ item.docNoFormatName }}</text-primary>
|
|
12
|
+
<div class="flex flex-row gap-2">
|
|
13
|
+
<text-subtitle>{{ item.docNoPattern }}</text-subtitle>
|
|
14
|
+
<renderer-boolean v-model="item.active"/>
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex flex-col text-right">
|
|
19
|
+
<text-subtitle>{{ item.docNoType }}</text-subtitle>
|
|
20
|
+
<text-subtitle>{{ item.nextNumber }}</text-subtitle>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<!-- </div> -->
|
|
24
|
+
</template>
|
|
25
|
+
<template #dataTableColumns>
|
|
26
|
+
</template>
|
|
27
|
+
<template #default
|
|
28
|
+
><div><NuxtPage :_id="id ?? 'new'" /></div
|
|
29
|
+
></template>
|
|
30
|
+
</PageDocList>
|
|
16
31
|
</template>
|
|
17
32
|
<script setup lang="ts">
|
|
18
33
|
/**
|
|
19
|
-
* This file was automatically generated by simpleapp generator.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Author: Ks Tan
|
|
34
|
+
* This file was automatically generated by simpleapp generator.
|
|
35
|
+
* last change 2023-09-09
|
|
36
|
+
* author: Ks Tan
|
|
23
37
|
*/
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
const doc = useNuxtApp().$DocnoformatDoc()
|
|
41
|
+
const docdata = doc.getReactiveData();
|
|
42
|
+
|
|
24
43
|
definePageMeta({
|
|
25
44
|
menuPath: "setting/docnoformat",
|
|
26
|
-
|
|
27
|
-
</script>
|
|
45
|
+
});
|
|
28
46
|
|
|
47
|
+
const columns = [
|
|
48
|
+
"docNoFormatNo",
|
|
49
|
+
"docNoFormatName",
|
|
50
|
+
"active",
|
|
51
|
+
"docNoType",
|
|
52
|
+
"docNoPattern",
|
|
53
|
+
"nextNumber",
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const sorts: string[][] = [["docNoType", "asc"],["docNoFormatNo","asc"]];
|
|
57
|
+
|
|
58
|
+
const id = computed(() => useRoute().params.id);
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PageDocList
|
|
3
|
+
:document="doc"
|
|
4
|
+
:columns="columns"
|
|
5
|
+
:data="docdata"
|
|
6
|
+
:sorts="sorts"
|
|
7
|
+
>
|
|
8
|
+
<template #mobileList="{ item }">
|
|
9
|
+
<!-- <div class="flex flex-row justify justify-end"> -->
|
|
10
|
+
<div class="flex flex-col flex-1">
|
|
11
|
+
<text-primary>{{ item.docNoFormatName }}</text-primary>
|
|
12
|
+
<div class="flex flex-row gap-2">
|
|
13
|
+
<text-subtitle>{{ item.docNoPattern }}</text-subtitle>
|
|
14
|
+
<renderer-boolean v-model="item.active"/>
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex flex-col text-right">
|
|
19
|
+
<text-subtitle>{{ item.docNoType }}</text-subtitle>
|
|
20
|
+
<text-subtitle>{{ item.nextNumber }}</text-subtitle>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<!-- </div> -->
|
|
24
|
+
</template>
|
|
25
|
+
<template #dataTableColumns>
|
|
26
|
+
</template>
|
|
27
|
+
<template #default
|
|
28
|
+
><div><NuxtPage :_id="id ?? 'new'" /></div
|
|
29
|
+
></template>
|
|
30
|
+
</PageDocList>
|
|
31
|
+
</template>
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
/**
|
|
34
|
+
* This file was automatically generated by simpleapp generator.
|
|
35
|
+
* last change 2023-09-09
|
|
36
|
+
* author: Ks Tan
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
const doc = useNuxtApp().$DocnoformatDoc()
|
|
41
|
+
const docdata = doc.getReactiveData();
|
|
42
|
+
|
|
43
|
+
definePageMeta({
|
|
44
|
+
menuPath: "setting/docnoformat",
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const columns = [
|
|
48
|
+
"docNoFormatNo",
|
|
49
|
+
"docNoFormatName",
|
|
50
|
+
"active",
|
|
51
|
+
"docNoType",
|
|
52
|
+
"docNoPattern",
|
|
53
|
+
"nextNumber",
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const sorts: string[][] = [["docNoType", "asc"],["docNoFormatNo","asc"]];
|
|
57
|
+
|
|
58
|
+
const id = computed(() => useRoute().params.id);
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="frontpage-container">
|
|
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>
|
|
10
|
+
</template>
|
|
11
|
+
<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'))
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div class="w-full flex-col flex">
|
|
4
|
+
<title>{{ t("organization") }}</title>
|
|
5
|
+
<MobileToolbar class="bg-gray-600">
|
|
6
|
+
<template #center><TextTitle class="text-white">{{ t("organization") }}</TextTitle></template>
|
|
7
|
+
<template #end>
|
|
8
|
+
<ButtonText @click="showEditOrg = true" class="text-white"
|
|
9
|
+
><i class="pi pi-pencil"></i
|
|
10
|
+
></ButtonText>
|
|
11
|
+
</template>
|
|
12
|
+
</MobileToolbar>
|
|
13
|
+
|
|
14
|
+
<div class="w-full flex flex-row p-2 border-b border-gray-300 ">
|
|
15
|
+
<div class="p-4">
|
|
16
|
+
<div class="border w-12 h-12 md:w-24 md:h24"></div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="flex flex-col flex-1 ">
|
|
19
|
+
<TextTitle>{{ data.orgName }} / {{ data.orgCode }}</TextTitle>
|
|
20
|
+
<TextSubtitle>
|
|
21
|
+
{{ data.description }}
|
|
22
|
+
</TextSubtitle>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="w-full p-2 flex flex-col ">
|
|
27
|
+
|
|
28
|
+
<div class="flex flex-row justify-end">
|
|
29
|
+
<TextTitle class="flex-1 p-2">{{ t('branches') }}</TextTitle>
|
|
30
|
+
<div>
|
|
31
|
+
<ButtonPrimary @click="goBranch('new')">
|
|
32
|
+
<i class="pi pi-plus"></i> <span>{{ t("addBranches") }}</span>
|
|
33
|
+
</ButtonPrimary>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<ListView class="border rounded-lg border-gray-400 dark:border-gray-600"
|
|
37
|
+
:list="branchlist"
|
|
38
|
+
title-field="branchName"
|
|
39
|
+
sub-title-field="branchCode"
|
|
40
|
+
:url="getDocumentUrl('organization', id)"
|
|
41
|
+
#default="{item}"
|
|
42
|
+
>
|
|
43
|
+
<div class="flex flex-row">
|
|
44
|
+
<div class="flex-col flex flex-1">
|
|
45
|
+
<TextPrimary>{{ item.branchName }}</TextPrimary>
|
|
46
|
+
<TextSubtitle>{{ item.description }}</TextSubtitle>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="flex-col flex text-right">
|
|
49
|
+
<div>{{ item.branchCode }}</div>
|
|
50
|
+
<renderer-boolean v-model="item.active"></renderer-boolean>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</ListView>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<OverlaySideBarCrud v-model="showEditOrg" close-event-name="organization">
|
|
58
|
+
<FormOrganization
|
|
59
|
+
:_id="getUserProfile()?.orgRecordId"
|
|
60
|
+
@after="afterOrganization"
|
|
61
|
+
></FormOrganization>
|
|
62
|
+
</OverlaySideBarCrud>
|
|
63
|
+
|
|
64
|
+
<OverlaySideBarCrud v-model="showEditBranch" close-event-name="branch">
|
|
65
|
+
<NuxtPage :_id="id"></NuxtPage>
|
|
66
|
+
</OverlaySideBarCrud>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
/**
|
|
72
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
73
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
74
|
+
* last change 2023-10-28
|
|
75
|
+
* Author: Ks Tan
|
|
76
|
+
*/
|
|
77
|
+
import { FormCrudEvent, SimpleAppInputType } from "~/types";
|
|
78
|
+
import ConfirmPopup from "primevue/confirmpopup";
|
|
79
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
80
|
+
const confirm = useConfirm();
|
|
81
|
+
const showEditOrg = ref<boolean>(false);
|
|
82
|
+
const showEditBranch = ref<boolean>(false);
|
|
83
|
+
|
|
84
|
+
const { $OrganizationDoc, $BranchDoc, $event, $listen } = useNuxtApp();
|
|
85
|
+
|
|
86
|
+
const orgId = computed(() => <string>getUserProfile()?.orgRecordId);
|
|
87
|
+
const doc = $OrganizationDoc();
|
|
88
|
+
const brancdoc = $BranchDoc();
|
|
89
|
+
const data = doc.getReactiveData();
|
|
90
|
+
const branchlist = ref([]);
|
|
91
|
+
const isReadOnly = ref(true);
|
|
92
|
+
const getCurrentOrg = async () => {
|
|
93
|
+
await doc.getById(orgId.value);
|
|
94
|
+
await fetchRecord();
|
|
95
|
+
};
|
|
96
|
+
const fetchRecord = async () => {
|
|
97
|
+
//fetch org
|
|
98
|
+
// await doc.getById(data.value.orgId);
|
|
99
|
+
//fetch branch
|
|
100
|
+
branchlist.value = await brancdoc.search({
|
|
101
|
+
filter: { orgId: data.value.orgId },
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
console.log("reload data", branchlist);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const id = computed((): string => String(useRoute().params.id ?? ""));
|
|
108
|
+
|
|
109
|
+
definePageMeta({
|
|
110
|
+
menuPath: "setting/organization",
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
//branch record update then reload
|
|
114
|
+
$listen("RefreshDocumentList", async (data) => {
|
|
115
|
+
console.log("trigger RefreshDocumentList", data);
|
|
116
|
+
if (data.documentName == "branch" || data.documentName == "organization") {
|
|
117
|
+
await fetchRecord();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const showBranchDialogIfRequired = () => {
|
|
122
|
+
if (useRoute().path.includes("/new") || id.value) showEditBranch.value = true;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const afterOrganization = (actionName: FormCrudEvent) => {
|
|
126
|
+
if (actionName == FormCrudEvent.update) {
|
|
127
|
+
showEditOrg.value = false;
|
|
128
|
+
getCurrentOrg();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
watch(
|
|
133
|
+
() => useRoute().path,
|
|
134
|
+
() => showBranchDialogIfRequired(),
|
|
135
|
+
);
|
|
136
|
+
onMounted(() => showBranchDialogIfRequired());
|
|
137
|
+
getCurrentOrg();
|
|
138
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col w-full gap-4 p-4">
|
|
3
|
+
<TextTitle class="text-center">{{ t("pickGroup") }}</TextTitle>
|
|
4
|
+
<div v-for="(groupName, index) in getUserProfile()?.groups" :key="index">
|
|
5
|
+
<div
|
|
6
|
+
class="border rounded-lg bg-primary-500 text-white p-4 text-center"
|
|
7
|
+
@click="pickGroup(groupName)"
|
|
8
|
+
>
|
|
9
|
+
{{ t(groupName) }}
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
/**
|
|
16
|
+
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
17
|
+
* --remove-this-line-to-prevent-override--
|
|
18
|
+
* last change 2024-04-09
|
|
19
|
+
* author: Ks Tan
|
|
20
|
+
*/
|
|
21
|
+
const pickGroup = async (groupName: string) => {
|
|
22
|
+
try{
|
|
23
|
+
useCookie('currentGroup').value= groupName
|
|
24
|
+
localStorage.setItem('currentGroup',groupName)
|
|
25
|
+
useNuxtApp().$userstore.currentGroup = groupName;
|
|
26
|
+
useNuxtApp().$event("pickGroup", groupName);
|
|
27
|
+
goTo("");
|
|
28
|
+
}catch(e){
|
|
29
|
+
alert("something wrong")
|
|
30
|
+
console.error(e)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
|