@simitgroup/simpleapp-generator 1.6.4-alpha → 1.6.4-b-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/package.json +1 -1
- package/templates/basic/nest/controller.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +21 -8
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +9 -5
- package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +7 -12
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +17 -13
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +14 -11
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +13 -8
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +54 -47
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +10 -11
- package/templates/nuxt/components/form/FormUser.vue._eta +2 -4
- package/templates/nuxt/components/image/ImageOrganization.vue.eta.vue +34 -16
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +1 -1
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +10 -5
- package/templates/nuxt/components/select/SelectTemplate.vue.eta +27 -22
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +2 -2
- package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +37 -41
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +57 -25
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +11 -10
- package/templates/nuxt/components/user/UserButtonPermissionInfo.vue.eta +17 -8
- package/templates/nuxt/components/user/UserInvitation.vue.eta +53 -45
- package/templates/nuxt/components/user/UserTenantPicker.vue.eta +31 -70
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +3 -2
- package/templates/nuxt/composables/roles.generate.ts.eta +1 -0
- package/templates/nuxt/error.vue._eta +4 -2
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +12 -3
- package/templates/project/lang/default._json +4 -1
|
@@ -1,71 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-full">
|
|
3
|
-
<div v-if="waiting" class="p-4
|
|
4
|
-
|
|
5
|
-
</div>
|
|
6
|
-
<div v-else class="w-full p-4">
|
|
7
|
-
|
|
3
|
+
<div v-if="waiting" class="p-4 w-full">waiting..</div>
|
|
4
|
+
<div v-else class="w-full p-2 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
|
8
5
|
<div v-for="tenant in alltenants" class="border rounded-lg p-2 m-2">
|
|
6
|
+
|
|
9
7
|
<TextTitle>{{ tenant.tenantName }}</TextTitle>
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<div class="flex flex-row
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
<div v-for=" item in tenant.permissions">
|
|
9
|
+
<NuxtLink :to="`/${item.xOrg}`" external>
|
|
10
|
+
<div class="flex flex-row gap-2 hover:bg-primary-100">
|
|
11
|
+
<div class="min-w-14 p=2">
|
|
12
|
+
<ImageOrganization :orgRecordId="item.orgRecordId" :size="12"/>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex flex-col w-full justify-end gap-2">
|
|
15
|
+
<div class="flex flex-row gap-2">
|
|
16
|
+
<TextMain>{{ item.branchCode }}</TextMain>
|
|
17
|
+
<Tag v-for="groupname in item.groups">{{ t(groupname) }}</Tag>
|
|
18
|
+
</div>
|
|
19
|
+
<TextSubsubtitle>{{ item.orgName }}</TextSubsubtitle>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</NuxtLink>
|
|
25
|
+
</div>
|
|
19
26
|
</div>
|
|
20
|
-
|
|
21
|
-
<!-- <card :pt="{ header: { class: 'text-xl text-gray-600' } }">
|
|
22
|
-
<template #header>
|
|
23
|
-
{{ tenant.tenantName }}
|
|
24
|
-
</template>
|
|
25
|
-
<template #content>
|
|
26
|
-
<ul>
|
|
27
|
-
<li v-for="o in getOrglist(tenant)">
|
|
28
|
-
<h1 class="subtitle-text">{{ o.orgName }}</h1>
|
|
29
|
-
<ul
|
|
30
|
-
role="list"
|
|
31
|
-
class="divide-y divide-gray-100 rounded-md border border-gray-200"
|
|
32
|
-
>
|
|
33
|
-
<li
|
|
34
|
-
v-for="b in getBranchlist(tenant)"
|
|
35
|
-
class="w-full items-center justify-between py-4 pl-4 pr-4 text-sm route-link-list"
|
|
36
|
-
>
|
|
37
|
-
<NuxtLink
|
|
38
|
-
:href="`/${b.xOrg}`"
|
|
39
|
-
v-if="o.orgId == b.orgId"
|
|
40
|
-
:external="true"
|
|
41
|
-
>
|
|
42
|
-
<div class="flex w-full flex-1 items-center">
|
|
43
|
-
<p class="flex-1 flex-shrink-0 font-bold text-primary-600">
|
|
44
|
-
{{ b.branchCode }}
|
|
45
|
-
</p>
|
|
46
|
-
<p class="text-right min-w-0 flex-1 gap-2">
|
|
47
|
-
<span href="#" class="font-medium text-gray-600">{{
|
|
48
|
-
b.group
|
|
49
|
-
}}</span>
|
|
50
|
-
</p>
|
|
51
|
-
</div>
|
|
52
|
-
<div class="flex-shrink-0">
|
|
53
|
-
<span class="font-medium text-gray-400"
|
|
54
|
-
>{{ useRuntimeConfig().public.APP_URL }}/{{
|
|
55
|
-
b.xOrg
|
|
56
|
-
}}</span
|
|
57
|
-
>
|
|
58
|
-
</div>
|
|
59
|
-
</NuxtLink>
|
|
60
|
-
</li>
|
|
61
|
-
</ul>
|
|
62
|
-
</li>
|
|
63
|
-
</ul>
|
|
64
|
-
|
|
65
|
-
</template>
|
|
66
|
-
</card> -->
|
|
67
27
|
</div>
|
|
68
|
-
|
|
69
28
|
</div>
|
|
70
29
|
</template>
|
|
71
30
|
<script setup lang="ts">
|
|
@@ -77,11 +36,12 @@
|
|
|
77
36
|
*/
|
|
78
37
|
import _ from "lodash";
|
|
79
38
|
import TextPrimary from "../text/TextPrimary.vue";
|
|
80
|
-
|
|
39
|
+
import ImageOrganization from "../image/ImageOrganization.vue";
|
|
40
|
+
const waiting = ref(true);
|
|
81
41
|
const alltenants = ref();
|
|
82
42
|
|
|
83
43
|
const loadAllTenants = async () => {
|
|
84
|
-
waiting.value=false
|
|
44
|
+
waiting.value = false;
|
|
85
45
|
alltenants.value = (await getProfileApi().getAllTenants()).data;
|
|
86
46
|
};
|
|
87
47
|
|
|
@@ -90,12 +50,13 @@ const loadAllTenants = async () => {
|
|
|
90
50
|
// }>()
|
|
91
51
|
const getBranchlist = (tenant: any) => tenant.permissions;
|
|
92
52
|
|
|
93
|
-
const getOrglist = (tenant: any) =>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
53
|
+
// const getOrglist = (tenant: any) =>
|
|
54
|
+
// _.uniqBy(getBranchlist(tenant), "orgId").map((item: any) => ({
|
|
55
|
+
// orgId: item.orgId,
|
|
56
|
+
// orgRecordId:'aaa',// item.orgRecordId,
|
|
57
|
+
// orgCode: item.orgCode,
|
|
58
|
+
// orgName: item.orgName,
|
|
59
|
+
// }));
|
|
99
60
|
|
|
100
61
|
onNuxtReady(() => {
|
|
101
62
|
loadAllTenants();
|
|
@@ -48,10 +48,11 @@ export const getPageBaseUrl = (resourcename:string) =>{
|
|
|
48
48
|
* @return boolean
|
|
49
49
|
*/
|
|
50
50
|
export const canPerform = (resource:string,action:string):boolean =>{
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
return getUserStore().canPerform(upperFirst(resource),action)
|
|
52
53
|
}
|
|
53
54
|
export const haveAccess = (resource:string):boolean =>{
|
|
54
|
-
return getUserStore().haveAccess(resource)
|
|
55
|
+
return getUserStore().haveAccess(upperFirst(resource))
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
|
|
@@ -13,6 +13,7 @@ const allroles:roletype[] = [
|
|
|
13
13
|
<% for(let i=0;i<it.modules.length; i++){ %>
|
|
14
14
|
<% const m = it.modules[i] %>
|
|
15
15
|
<% const appconfig = m.schema["x-simpleapp-config"] %>
|
|
16
|
+
{resource: '<%=m.docname%>', action:'access'},
|
|
16
17
|
{resource: '<%=m.docname%>', action:'create'},
|
|
17
18
|
{resource: '<%=m.docname%>', action:'update'},
|
|
18
19
|
{resource: '<%=m.docname%>', action:'delete'},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="w w-full items-center justify-center py-12 bg bg-gray-500">
|
|
2
|
+
<div class="w w-full items-center justify-center py-12 bg bg-gray-500 flex flex-row">
|
|
3
3
|
<div class="bg-white dark:bg-gray-600 p-1 border rounded-md flex items-center justify-center mx-4 w-7/8 md:w-2/3">
|
|
4
4
|
<div class="flex flex-col items-center py-16">
|
|
5
5
|
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
<h1 class="px-4 pt-2 pb-4 text-left text-5xl font-bold leading-10 text-gray-800">OOPS!</h1>
|
|
12
12
|
<p class="px-4 mt mb-4 text-4xl text-left font font-bold">{{isNaN(error?.statusCode) ? t('server'): error?.statusCode}} Error</p>
|
|
13
13
|
<p class="px-4 pb-10 text-base leading-none text-left text-red-400">{{t(error?.statusMessage)}}</p>
|
|
14
|
-
<p>
|
|
14
|
+
<p>
|
|
15
|
+
<ButtonPrimary @click="handleError" class="bg-secondary-600 text-white p-2 rounded">{{ t('backToHome') }}</ButtonPrimary>
|
|
16
|
+
</p>
|
|
15
17
|
</div>
|
|
16
18
|
</div>
|
|
17
19
|
|
|
@@ -125,7 +125,7 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
125
125
|
else
|
|
126
126
|
return Promise.reject('relogin')
|
|
127
127
|
}catch(e){
|
|
128
|
-
return Promise.reject(
|
|
128
|
+
return Promise.reject(e)
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
},
|
|
@@ -225,7 +225,6 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
225
225
|
|
|
226
226
|
try{
|
|
227
227
|
const pingsessionres = await useUserStore().pingSession()
|
|
228
|
-
console.log("pingsessionres",pingsessionres)
|
|
229
228
|
if(pingsessionres == 'wrongxorg'){
|
|
230
229
|
navigateTo('/')
|
|
231
230
|
}
|
|
@@ -239,8 +238,18 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
239
238
|
}
|
|
240
239
|
}
|
|
241
240
|
}catch(e){
|
|
241
|
+
console.error("Ping issue cannot proceed:",e)
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
if(e?.code=='ERR_BAD_RESPONSE'){
|
|
244
|
+
console.log("ping failed failed failed",e.code)
|
|
245
|
+
throw createError({
|
|
246
|
+
statusCode:e.code,
|
|
247
|
+
statusMessage:e.message,
|
|
248
|
+
fatal:true
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
else
|
|
252
|
+
await useUserStore().logout(useRoute().path)
|
|
244
253
|
}
|
|
245
254
|
|
|
246
255
|
}else{
|