@simitgroup/simpleapp-generator 1.0.47 → 1.0.49
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/README.md +44 -4
- package/buildinschemas copy/docnoformat.docno.jsonschema.json +2 -20
- package/dist/buildinschemas/autoincreament.js +1 -1
- package/dist/buildinschemas/autoincreament.js.map +1 -1
- package/dist/buildinschemas/branch.js +1 -1
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.d.ts.map +1 -1
- package/dist/buildinschemas/docnoformat.js +12 -25
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +1 -0
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +10 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +24 -13
- package/dist/generate.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/type.d.ts +1 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +1 -1
- package/src/buildinschemas/branch.ts +1 -1
- package/src/buildinschemas/docnoformat.ts +13 -27
- package/src/buildinschemas/user.ts +1 -0
- package/src/framework.ts +10 -2
- package/src/generate.ts +26 -13
- package/src/index.ts +1 -1
- package/src/type.ts +1 -0
- package/templates/basic/nest/processor.ts.eta +2 -2
- package/templates/basic/nest/service.ts.eta +2 -4
- package/templates/basic/nuxt/pages.crud.vue.eta +2 -2
- package/templates/nest/src/app.controller.ts.eta +6 -0
- package/templates/nest/src/app.module.ts.eta +9 -1
- package/templates/nest/src/app.service.ts.eta +6 -0
- package/templates/nest/src/main.ts.eta +7 -0
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +6 -2
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +17 -0
- package/templates/nest/src/simpleapp/generate/commons/decorators/appuser.decorator.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +14 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/foreignkeys.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +9 -3
- package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +23 -3
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +52 -10
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/providers/workflow.provider.ts.etax +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.decorator.ts.eta +6 -1
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.guard.ts.eta +6 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +15 -7
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +27 -0
- package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +3 -4
- package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +3 -5
- package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +3 -4
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +42 -11
- package/templates/nest/src/simpleapp/generate/types/apievent.type.ts.eta +22 -0
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +6 -0
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +50 -10
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +5 -7
- package/templates/nest/src/simpleapp/services/org.service.ts.eta +4 -6
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +6 -7
- package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/services/user.service.ts.eta +5 -6
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +6 -8
- package/templates/nuxt/app.vue.eta +6 -1
- package/templates/nuxt/assets/css/style.css._eta +12 -0
- package/templates/nuxt/assets/css/tailwind.css._eta +10 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +37 -0
- package/templates/nuxt/components/ButtonCreateTenant.vue.eta +68 -0
- package/templates/nuxt/components/ButtonHome.vue.eta +10 -0
- package/templates/nuxt/components/ButtonLogout.vue.eta +9 -0
- package/templates/nuxt/components/ButtonMenuPicker.vue.eta +55 -0
- package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +113 -0
- package/templates/nuxt/components/ButtonProfile.vue.eta +52 -0
- package/templates/nuxt/components/CrudNestedDoc.vue.eta +11 -7
- package/templates/nuxt/components/CrudSimple.vue.eta +13 -11
- package/templates/nuxt/components/DebugDocumentData.vue.eta +1 -1
- package/templates/nuxt/components/HeaderBar.vue.eta +39 -0
- package/templates/nuxt/components/Invitation.vue.eta +2 -2
- package/templates/nuxt/components/Menus.vue.eta +7 -7
- package/templates/nuxt/components/SelectBranch.vue.eta +35 -0
- package/templates/nuxt/components/SimpleAppAutocomplete.vue.eta +1 -1
- package/templates/nuxt/components/SimpleAppDatatable.vue.eta +0 -1
- package/templates/nuxt/components/SimpleAppDocumentNo.vue.eta +1 -1
- package/templates/nuxt/components/SimpleAppForm.vue.eta +1 -1
- package/templates/nuxt/components/SimpleAppInputTable.vue.eta +2 -2
- package/templates/nuxt/components/SimpleFieldContainer.vue.eta +18 -12
- package/templates/nuxt/components/Spinner.vue.eta +9 -0
- package/templates/nuxt/composables/getMenus.generate.ts.eta +5 -4
- package/templates/nuxt/layouts/default.vue.eta +3 -12
- package/templates/nuxt/middleware/{10.acl.global.ts.eta → 30.acl.global.ts.eta} +6 -0
- package/templates/nuxt/nuxt.config.ts.eta +55 -12
- package/templates/nuxt/pages/[xorg]/branch/{index.vue.eta → index.vue.etax} +1 -4
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +83 -113
- package/templates/nuxt/pages/[xorg]/index.vue._eta +13 -0
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +89 -69
- package/templates/nuxt/pages/[xorg]/permission/index.vue.eta +7 -7
- package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +0 -4
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +33 -33
- package/templates/nuxt/pages/index.vue.eta +10 -85
- package/templates/nuxt/pages/login.vue.eta +9 -3
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +16 -19
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +19 -3
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +4 -4
- package/templates/nuxt/server/api/[xorg]/[...].ts.eta +4 -4
- package/templates/nuxt/server/api/auth/[...].ts.eta +6 -0
- package/templates/nuxt/server/api/auth/logout.ts.eta +6 -1
- package/templates/nuxt/server/api/profile/[...].ts.eta +4 -5
- package/templates/nuxt/server/api/profile/index.ts.eta +4 -6
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +9 -2
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +12 -3
- package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/commons/groups.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +6 -0
- package/templates/nuxt/tailwind.config.ts._eta +66 -0
- package/templates/nuxt/types/index.ts.eta +22 -1
- package/templates/project/build.sh.eta +4 -4
- package/templates/project/schemas/invoice.ts.eta +1 -0
- package/templates/project/schemas/product.ts.eta +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/assets/css/tailwind.css.eta +0 -35
- package/templates/nuxt/components/PermissionInfo.vue.eta +0 -92
- package/templates/nuxt/components/XorgPicker.vue.eta +0 -66
- package/templates/nuxt/pages/[xorg]/index.vue.eta +0 -36
- package/templates/nuxt/tailwind.config.ts.eta +0 -9
- /package/templates/nest/{.env.eta → .env._eta} +0 -0
- /package/templates/nuxt/{.env.eta → .env._eta} +0 -0
- /package/templates/project/{config.json.eta → config.json._eta} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { usePassThrough } from "primevue/passthrough";
|
|
2
|
+
import Tailwind from "primevue/passthrough/tailwind";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const CustomTailwind = usePassThrough(
|
|
6
|
+
Tailwind,
|
|
7
|
+
{
|
|
8
|
+
button:{
|
|
9
|
+
root:{
|
|
10
|
+
class:['p-2 m-2 border']
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
dialog:{
|
|
14
|
+
root:{
|
|
15
|
+
class:['bg-white border p-2' ]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
panel: {
|
|
19
|
+
root:{
|
|
20
|
+
class:['border']
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
class: ['leading-none font-light text-2xl']
|
|
24
|
+
},
|
|
25
|
+
header:{
|
|
26
|
+
class:['bg bg-gray-200 h-10 content-middle']
|
|
27
|
+
},
|
|
28
|
+
content:{
|
|
29
|
+
class:['']
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export default CustomTailwind;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Button class="btn-primary " @click="visible = true">
|
|
4
|
+
<i class="pi pi-sitemap mr-2"></i>Create My Company
|
|
5
|
+
</Button>
|
|
6
|
+
<Dialog
|
|
7
|
+
v-model:visible="visible"
|
|
8
|
+
modal
|
|
9
|
+
:header="createtitle"
|
|
10
|
+
class="crudsimple-dialog"
|
|
11
|
+
>
|
|
12
|
+
<form @submit.prevent="true" class="flex flex-col text-center">
|
|
13
|
+
<div v-if="errCreateTenant" class="text-error">
|
|
14
|
+
{{ errCreateTenant }}
|
|
15
|
+
</div>
|
|
16
|
+
<InputText
|
|
17
|
+
v-else
|
|
18
|
+
type="text"
|
|
19
|
+
autofocus="true"
|
|
20
|
+
v-model:model-value="data.tenantName"
|
|
21
|
+
placeholder="Organization Name"
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<Button class=" btn-primary" type="submit" @click="createTenant" :loading="onhold">
|
|
25
|
+
Create <span class="pi pi-save"></span>
|
|
26
|
+
</Button>
|
|
27
|
+
</form>
|
|
28
|
+
</Dialog>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
</template>
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import {ref} from 'vue'
|
|
34
|
+
import {AxiosResponse} from 'axios'
|
|
35
|
+
const visible = ref(false);
|
|
36
|
+
const data = ref({tenantName: "",});
|
|
37
|
+
|
|
38
|
+
const createtitle = ref("Create My Company");
|
|
39
|
+
const errCreateTenant = ref();
|
|
40
|
+
const onhold = ref(false);
|
|
41
|
+
|
|
42
|
+
const createTenant = async () => {
|
|
43
|
+
onhold.value = true;
|
|
44
|
+
const { $axios, $listen } = useNuxtApp();
|
|
45
|
+
|
|
46
|
+
const openapi = getApi();
|
|
47
|
+
const apipath = `${useRuntimeConfig().public.API_URL}`;
|
|
48
|
+
let profileapi = new openapi.PROFILEApi(undefined, apipath, $axios);
|
|
49
|
+
|
|
50
|
+
profileapi
|
|
51
|
+
.createTenant(data.value)
|
|
52
|
+
.then((res:AxiosResponse) => {
|
|
53
|
+
if (res && res.status && res.status == 201) {
|
|
54
|
+
if (res.data && res.data["xOrg"]) {
|
|
55
|
+
const xorg = res.data["xOrg"];
|
|
56
|
+
navigateTo("/" + xorg, { external: true });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
errCreateTenant.value = err["message"];
|
|
62
|
+
console.error("errCreateTenant", err);
|
|
63
|
+
})
|
|
64
|
+
.finally(() => {
|
|
65
|
+
onhold.value = false;
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button class="flex flex-row">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
|
4
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
|
|
5
|
+
</svg>
|
|
6
|
+
|
|
7
|
+
<span>{{ getUserProfile().orgName }}</span>
|
|
8
|
+
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button class="flex flex-row">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
|
4
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75" />
|
|
5
|
+
</svg>
|
|
6
|
+
<span>logout</span>
|
|
7
|
+
|
|
8
|
+
</button>
|
|
9
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import Dialog from 'primevue/dialog';
|
|
3
|
+
import {ref} from 'vue'
|
|
4
|
+
import {MenuData} from '~/types'
|
|
5
|
+
const visible = ref(false)
|
|
6
|
+
const menus = getMenus();
|
|
7
|
+
// const emit = defineEmits(['select'])
|
|
8
|
+
const selectMenu = (menu:MenuData) =>{
|
|
9
|
+
navigateTo(menu.url)
|
|
10
|
+
visible.value=false
|
|
11
|
+
// emit('select',menu)
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
<template>
|
|
15
|
+
<div>
|
|
16
|
+
|
|
17
|
+
<button class="text-center border-none cursor-pointer" v-if="useRoute().params.xorg" @click="visible=true">
|
|
18
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
|
19
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
|
20
|
+
</svg>
|
|
21
|
+
</button>
|
|
22
|
+
|
|
23
|
+
<Dialog v-model:visible="visible" modal header="Pick Document" >
|
|
24
|
+
<div class="desktop-shortcut-link">
|
|
25
|
+
|
|
26
|
+
<Button v-for="menu in menus[1].items" @click="selectMenu(menu)">
|
|
27
|
+
<div v-if="menu.isolationType == 'none'" class="adminmenu">
|
|
28
|
+
* {{ camelCaseToWords(menu.label) }}
|
|
29
|
+
</div>
|
|
30
|
+
<div v-else class="usermenu">{{ camelCaseToWords(menu.label) }}</div>
|
|
31
|
+
</Button>
|
|
32
|
+
</div>
|
|
33
|
+
</Dialog>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
<style scoped>
|
|
40
|
+
.desktop-shortcut-link {
|
|
41
|
+
@apply m-2 p-2 space-x-2 rounded-sm text-center grid grid-cols-4 gap-4;
|
|
42
|
+
}
|
|
43
|
+
.desktop-shortcut-link .adminmenu {
|
|
44
|
+
@apply bg-red-300 p-2;
|
|
45
|
+
}
|
|
46
|
+
.desktop-shortcut-link .adminmenu:hover {
|
|
47
|
+
@apply bg-red-600 p-2;
|
|
48
|
+
}
|
|
49
|
+
.desktop-shortcut-link .usermenu {
|
|
50
|
+
@apply bg-teal-300 p-2;
|
|
51
|
+
}
|
|
52
|
+
.desktop-shortcut-link .usermenu:hover {
|
|
53
|
+
@apply bg-teal-600 p-2;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
<Button
|
|
5
|
+
class="btn-primary pi pi-question"
|
|
6
|
+
@click="previewPermission"
|
|
7
|
+
>
|
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
|
9
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z" />
|
|
10
|
+
</svg>
|
|
11
|
+
</Button>
|
|
12
|
+
<Sidebar
|
|
13
|
+
v-model:visible="showpermissioninfo"
|
|
14
|
+
modal
|
|
15
|
+
:header="permissiontitle"
|
|
16
|
+
position="right"
|
|
17
|
+
>
|
|
18
|
+
<SelectButton v-model="selectedgroup" @change="selectGroup" :options="grouplist" option-label="label" option-value="value"></SelectButton>
|
|
19
|
+
<div v-if="selectedgroup">
|
|
20
|
+
<div v-if="useRuntimeConfig().public.DEBUGDATA" class="flex flex-row gap-2 p-2">
|
|
21
|
+
<div class="flex align-items-center">
|
|
22
|
+
<RadioButton v-model="mode" inputId="modepreview" name="pizza" value="preview" />
|
|
23
|
+
<label for="modepreview" class="ml-2">Preview</label>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="flex align-items-center">
|
|
26
|
+
<RadioButton v-model="mode" inputId="modeedit" name="edit" value="edit" />
|
|
27
|
+
<label for="modeedit" class="ml-2">Edit</label>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex align-items-center">
|
|
30
|
+
<RadioButton v-model="mode" inputId="modejson" name="json" value="json" />
|
|
31
|
+
<label for="modejson" class="ml-2">JSON</label>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
<div v-if="mode=='json'">
|
|
36
|
+
<div class="flex-row">
|
|
37
|
+
<div><Button @click="copyText">copy</Button> </div>
|
|
38
|
+
<div class="text text-gray-400">{{ copied }}</div>
|
|
39
|
+
</div>
|
|
40
|
+
<pre id="permissionstr">
|
|
41
|
+
{{ permissions }}
|
|
42
|
+
</pre>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="permission-block flex flex-col m mt-4" v-for="res in allresources" v-else="showjson">
|
|
45
|
+
<div class="m mr-3 ">{{ res }}</div>
|
|
46
|
+
<div class="gap-4" v-if="allactions">
|
|
47
|
+
<SelectButton v-if="mode=='edit'" multiple :options="allactions[res]" v-model="permissions[res]"></SelectButton>
|
|
48
|
+
|
|
49
|
+
<span v-else v-for="actionname in allactions[res]" class="m m-1">
|
|
50
|
+
<Chip class="bg-primary" v-if="canPerformAction(selectedgroup,res,actionname)" severity="success" :label="actionname" ></Chip>
|
|
51
|
+
<Chip v-else :label="actionname" ></Chip>
|
|
52
|
+
</span>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</Sidebar>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import _ from "lodash";
|
|
63
|
+
import Chip from 'primevue/chip';
|
|
64
|
+
import RadioButton from 'primevue/radiobutton';
|
|
65
|
+
import {ref} from 'vue'
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const showpermissioninfo = ref(false)
|
|
69
|
+
const permissiontitle = "Permission Information";
|
|
70
|
+
const selectedgroup = ref('')
|
|
71
|
+
const grouplist = getAllGroups().map((item)=>{return {value:item,label:_.capitalize(item)}})
|
|
72
|
+
const mode = ref('preview')
|
|
73
|
+
|
|
74
|
+
const allresources = getUniqueResource()
|
|
75
|
+
const allactions = ref()
|
|
76
|
+
const permissions=ref()
|
|
77
|
+
|
|
78
|
+
const activeroles = ref()
|
|
79
|
+
const copied = ref('')
|
|
80
|
+
|
|
81
|
+
const previewPermission = () => {
|
|
82
|
+
showpermissioninfo.value = true;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
const copyText = () => {
|
|
87
|
+
copied.value="copied!"
|
|
88
|
+
const storage = document.createElement('textarea');
|
|
89
|
+
storage.value = String(document.getElementById('permissionstr')?.innerHTML)
|
|
90
|
+
document.body.appendChild(storage);
|
|
91
|
+
storage.select();
|
|
92
|
+
storage.setSelectionRange(0, 99999);
|
|
93
|
+
document.execCommand('copy');
|
|
94
|
+
document.body.removeChild(storage);
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
const selectGroup = (selectedgroup:any) => {
|
|
100
|
+
const groupname = selectedgroup.value
|
|
101
|
+
activeroles.value= getGroupRoles(groupname)
|
|
102
|
+
allactions.value={}
|
|
103
|
+
permissions.value={}
|
|
104
|
+
for(let i=0; i< allresources.length; i++){
|
|
105
|
+
const r = allresources[i]
|
|
106
|
+
console.log(r)
|
|
107
|
+
const actions = getActionFromResource(r)
|
|
108
|
+
allactions.value[r]=actions
|
|
109
|
+
permissions.value[r]=getGroupResourcePermission(groupname,r).map(item=>item.action)
|
|
110
|
+
}
|
|
111
|
+
console.log(allactions.value,permissions.value)
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Avatar from 'primevue/avatar';
|
|
3
|
+
import OverlayPanel from 'primevue/overlaypanel';
|
|
4
|
+
import {ref} from 'vue'
|
|
5
|
+
|
|
6
|
+
const userprofileoverlay = ref();
|
|
7
|
+
const toggle = (event:any) => {
|
|
8
|
+
userprofileoverlay.value.toggle(event);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
<div class=" w-[120px] truncate ...">
|
|
16
|
+
|
|
17
|
+
<div class="flex flex-row-reverse cursor-pointer border-none w-full" @click="toggle">
|
|
18
|
+
<p>{{ getUserProfile().fullName }}</p>
|
|
19
|
+
<Avatar :image="getUserStore().getAvatarLink(32)" class="" size="normal" shape="circle" />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<OverlayPanel ref="userprofileoverlay">
|
|
24
|
+
<div class="flex flex-col">
|
|
25
|
+
<div class="flex flex-row">
|
|
26
|
+
<div class="content-center border">
|
|
27
|
+
<Avatar :image="getUserStore().getAvatarLink(60)" class="mr-2" size="xlarge" shape="circle" />
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<div class="text text-center border">
|
|
31
|
+
{{getUserProfile().fullName }}
|
|
32
|
+
</div>
|
|
33
|
+
<div class="text text-center text-sm border" >
|
|
34
|
+
{{getUserProfile().group }}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="flex flex-row gap-2 border">
|
|
41
|
+
<Button class="border">
|
|
42
|
+
<i class="pi pi-user"></i>profile
|
|
43
|
+
</Button>
|
|
44
|
+
<Button class="border" @click="logout()">
|
|
45
|
+
<i class="pi pi-sign-out"></i>logout
|
|
46
|
+
</Button>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
</OverlayPanel>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -69,8 +69,8 @@ const newData = () => {
|
|
|
69
69
|
$event("newRecord")
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const triggerEdit = (
|
|
73
|
-
let id =
|
|
72
|
+
const triggerEdit = (data: any) => {
|
|
73
|
+
let id = data._id.toString()
|
|
74
74
|
router.push({ path: `${props.path}/${id}` })
|
|
75
75
|
};
|
|
76
76
|
const editRecord = (id:string) => {
|
|
@@ -133,13 +133,17 @@ onNuxtReady(()=>{
|
|
|
133
133
|
<template>
|
|
134
134
|
<div class="simpleapp-crudnesteddocument">
|
|
135
135
|
<h1 v-if="systemwindows" class="error-text text-center">* It is system administration screen</h1>
|
|
136
|
-
<
|
|
136
|
+
<Button class="btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">New</Button>
|
|
137
137
|
<SimpleAppDatatable
|
|
138
138
|
@row-dblclick="triggerEdit"
|
|
139
139
|
v-model="recordlist"
|
|
140
140
|
:setting="{}"
|
|
141
141
|
:columns="listColumns"
|
|
142
142
|
>
|
|
143
|
+
<Column header=" ">
|
|
144
|
+
<template #body="{index,data}">
|
|
145
|
+
<Button icon="pi pi-pencil" class="btn-primary" @click="triggerEdit(data)"></Button>
|
|
146
|
+
</template></Column>
|
|
143
147
|
</SimpleAppDatatable>
|
|
144
148
|
|
|
145
149
|
|
|
@@ -148,10 +152,10 @@ onNuxtReady(()=>{
|
|
|
148
152
|
<Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
149
153
|
<SimpleAppForm :document="obj" #default="o">
|
|
150
154
|
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
151
|
-
<
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
<
|
|
155
|
+
<Button class=" btn-default" :disabled="disabled" @click="newData" type="button" v-if="canPerform(resourcename,'create')">New</Button>
|
|
156
|
+
<Button class=" btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(resourcename,'update') && data.created==''">Create</Button>
|
|
157
|
+
<Button class=" btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(resourcename,'update') && data.created!=''">Update</Button>
|
|
158
|
+
<Button class=" btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(resourcename,'delete') && data.created!=''">Delete</Button>
|
|
155
159
|
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
156
160
|
<ConfirmPopup></ConfirmPopup>
|
|
157
161
|
|
|
@@ -70,8 +70,8 @@ const newData = () => {
|
|
|
70
70
|
$event("newRecord")
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const triggerEdit = (
|
|
74
|
-
let id =
|
|
73
|
+
const triggerEdit = (data: any) => {
|
|
74
|
+
let id = data._id
|
|
75
75
|
router.push({ path: `${props.path}/${id}` })
|
|
76
76
|
};
|
|
77
77
|
const editRecord = (id:string) => {
|
|
@@ -140,15 +140,17 @@ onNuxtReady(()=>{
|
|
|
140
140
|
|
|
141
141
|
<template>
|
|
142
142
|
<div class="simpleapp-crudsimple">
|
|
143
|
-
<h1 v-if="systemwindows" class="error-text text-center">* system administration screen</h1>
|
|
144
|
-
|
|
145
|
-
<
|
|
146
|
-
<SimpleAppDatatable
|
|
147
|
-
@row-dblclick="triggerEdit"
|
|
143
|
+
<h1 v-if="systemwindows" class="error-text text-center">* system administration screen</h1>
|
|
144
|
+
<Button class=" btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">New</Button>
|
|
145
|
+
<SimpleAppDatatable
|
|
148
146
|
v-model="recordlist"
|
|
149
147
|
:setting="{}"
|
|
150
148
|
:columns="listColumns"
|
|
151
149
|
>
|
|
150
|
+
<Column header=" ">
|
|
151
|
+
<template #body="{index,data}">
|
|
152
|
+
<Button icon="pi pi-pencil" class="btn-primary" @click="triggerEdit(data)"></Button>
|
|
153
|
+
</template></Column>
|
|
152
154
|
</SimpleAppDatatable>
|
|
153
155
|
|
|
154
156
|
<DebugDocumentData v-model="data"/>
|
|
@@ -157,10 +159,10 @@ onNuxtReady(()=>{
|
|
|
157
159
|
<Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
158
160
|
<SimpleAppForm :document="obj" #default="o">
|
|
159
161
|
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
160
|
-
<
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
<
|
|
162
|
+
<Button class=" btn-default" :disabled="disabled" @click="newData" type="button" v-if="canPerform(resourcename,'create')">New</Button>
|
|
163
|
+
<Button class=" btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(resourcename,'create') && data.created==''">Create</Button>
|
|
164
|
+
<Button class=" btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(resourcename,'update') && data.created!=''">Update</Button>
|
|
165
|
+
<Button class=" btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(resourcename,'delete') && data.created!=''">Delete</Button>
|
|
164
166
|
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
165
167
|
<ConfirmPopup></ConfirmPopup>
|
|
166
168
|
|
|
@@ -18,7 +18,7 @@ const label = ref(props.label??'Debug')
|
|
|
18
18
|
</script>
|
|
19
19
|
<template>
|
|
20
20
|
<div class="floatright" v-if="isdebug=='1'">
|
|
21
|
-
<
|
|
21
|
+
<Button @click="visible=true">{{ label }}</Button>
|
|
22
22
|
<Dialog v-model:visible="visible" modal header="Debug data" :style="{ width: '80vw' }">
|
|
23
23
|
<pre>{{ modelValue }}</pre>
|
|
24
24
|
</Dialog>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import ButtonMenuPicker from "./ButtonMenuPicker.vue"
|
|
3
|
+
|
|
4
|
+
import ButtonProfile from './ButtonProfile.vue';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
</script>
|
|
8
|
+
<template>
|
|
9
|
+
<!-- <header> -->
|
|
10
|
+
<!-- <MegaMenu :model="getMenus()" orientation="horizontal" /> -->
|
|
11
|
+
<div class="bg-white border-b-2 border-b-gray-300 h-10 flex flex-row">
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
<div class="flex-1 flex flex-row gap-2 p-2">
|
|
15
|
+
<div class="">
|
|
16
|
+
<ButtonMenuPicker/>
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
<div class="">
|
|
20
|
+
<ButtonHome @click="navigateTo(`/${getUserProfile().currentxorg}`)"/>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex-1 flex flex-row-reverse gap-2 p-2">
|
|
25
|
+
|
|
26
|
+
<div class=" text-right">
|
|
27
|
+
<ButtonProfile/>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="">
|
|
31
|
+
<SelectBranch/>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</div>
|
|
38
|
+
<!-- </header> -->
|
|
39
|
+
</template>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<div class="text text-xs text-gray-500 italic">{{ item.created }}</div>
|
|
9
9
|
</div>
|
|
10
10
|
<div >
|
|
11
|
-
<
|
|
12
|
-
<
|
|
11
|
+
<Button class="btn-primary" @click="approve(item._id)">Approve</Button>
|
|
12
|
+
<Button class="btn-danger" @click="decline(item._id)">Decline</Button>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
@@ -27,29 +27,29 @@ const visibletenant = ref(false)
|
|
|
27
27
|
<MenuIndex></MenuIndex>
|
|
28
28
|
</Dialog>
|
|
29
29
|
<Dialog v-model:visible="visibletenant" modal header="Pick Tenant" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
</Dialog>
|
|
32
32
|
|
|
33
33
|
<div class="flex-1">
|
|
34
34
|
<NuxtLink to="/" :external="true"><i class="pi pi-home m-2"></i>Home</NuxtLink>
|
|
35
35
|
</div>
|
|
36
36
|
<div class="flex-1 p-1">
|
|
37
|
-
<
|
|
38
|
-
<i class="pi pi-microsoft mr-2"></i>Menu</
|
|
37
|
+
<Button class="text-center border-none cursor-pointer" v-if="useRoute().params.xorg" @click="visible=true">
|
|
38
|
+
<i class="pi pi-microsoft mr-2"></i>Menu</Button>
|
|
39
39
|
<span v-else></span>
|
|
40
40
|
</div>
|
|
41
41
|
<div class="flex-1 p-1">
|
|
42
|
-
<
|
|
42
|
+
<Button class="text-center border-none cursor-pointer" v-if="useRoute().params.xorg" @click="visibletenant=true">
|
|
43
43
|
<i class="pi pi-globe mr-2"></i>
|
|
44
44
|
|
|
45
45
|
{{ getUserProfile().branchCode }} - {{ getUserProfile().branchName }}
|
|
46
|
-
</
|
|
46
|
+
</Button>
|
|
47
47
|
<span v-else></span>
|
|
48
48
|
</div>
|
|
49
49
|
<div class="flex-1 text-right p-1">
|
|
50
|
-
<
|
|
50
|
+
<Button class=" cursor-pointer border-none" @click="logout()">
|
|
51
51
|
<i class="pi pi-sign-out mr-2"></i>logout {{ getUserProfile().fullName }}
|
|
52
|
-
</
|
|
52
|
+
</Button>
|
|
53
53
|
</div>
|
|
54
54
|
|
|
55
55
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import _ from 'lodash'
|
|
3
|
+
import {ref} from 'vue'
|
|
4
|
+
|
|
5
|
+
const selectedbranch = ref(getUserProfile().currentxorg)
|
|
6
|
+
type Org = {orgId:number, label:string,_id:string}
|
|
7
|
+
const branches = getUserProfile().branches
|
|
8
|
+
const orgList:Org[] = _.uniqBy(branches,'branch.orgId').map((item)=>({
|
|
9
|
+
_id:item['branch']['organization']['_id'],
|
|
10
|
+
orgId:item['branch']['orgId'],
|
|
11
|
+
label:item['branch']['organization']['label']}))
|
|
12
|
+
// console.log("orgList",orgList)
|
|
13
|
+
const getBranchesForOrg = (org:Org)=>{
|
|
14
|
+
const branchlist = branches.filter((item,index)=>{
|
|
15
|
+
// console.log(org['orgId'] ,'===', item['branch']['orgId'])
|
|
16
|
+
return org['orgId'] === item['branch']['orgId']
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
return branchlist
|
|
20
|
+
}
|
|
21
|
+
const switchXorg = ()=>{
|
|
22
|
+
navigateTo(`/${selectedbranch.value}`,{external:true})
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<div>
|
|
27
|
+
<select v-model="selectedbranch" class=" text-right" @change="switchXorg()">
|
|
28
|
+
<optgroup v-for="o in orgList" :label="o.label">
|
|
29
|
+
<option v-for="b in getBranchesForOrg(o)" :value="b['xOrg']">{{ b['branch']['branchCode']}} </option>
|
|
30
|
+
</optgroup>
|
|
31
|
+
|
|
32
|
+
</select>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
</template>
|
|
@@ -32,7 +32,7 @@ import AutoComplete from 'primevue/autocomplete';
|
|
|
32
32
|
import FieldContainer from './SimpleFieldContainer.vue'
|
|
33
33
|
import {prepareList} from './helper'
|
|
34
34
|
import type {SimpleAppFieldSetting,ListOptionType} from './type'
|
|
35
|
-
import { SimpleAppClient } from '../generate/
|
|
35
|
+
import { SimpleAppClient } from '../simpleapp/generate/clients/SimpleAppClient'
|
|
36
36
|
import type { JSONSchema7 } from 'json-schema';
|
|
37
37
|
|
|
38
38
|
type autocompletetype={[key:string]:any}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
12
|
import DataTable from 'primevue/datatable';
|
|
13
13
|
import Column from 'primevue/column';
|
|
14
|
-
import Button from 'primevue/button';
|
|
15
14
|
import {camelCaseToWords} from './helper'
|
|
16
15
|
const props = defineProps<{columns:string[]}>()
|
|
17
16
|
const valueModel = defineModel<Object[]>()
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:pt="{input:{class:'text-right w-full'}}"
|
|
11
11
|
/>
|
|
12
12
|
<span class="p-inputgroup-addon p p-0">
|
|
13
|
-
<
|
|
13
|
+
<Button class="pi pi-angle-down" type="button" @click="toggle"></Button>
|
|
14
14
|
|
|
15
15
|
<OverlayPanel ref="op">
|
|
16
16
|
<ul>
|