@simitgroup/simpleapp-generator 1.0.59 → 1.0.61
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/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +1 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +1 -0
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/permission.js +1 -1
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +4 -1
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/framework.js +1 -1
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +11 -6
- package/dist/generate.js.map +1 -1
- package/dist/type.d.ts +1 -0
- package/dist/type.d.ts.map +1 -1
- package/docs/jsonschema.md +1 -0
- package/package.json +1 -1
- package/src/buildinschemas/branch.ts +1 -0
- package/src/buildinschemas/organization.ts +1 -0
- package/src/buildinschemas/permission.ts +1 -1
- package/src/buildinschemas/user.ts +4 -1
- package/src/framework.ts +1 -1
- package/src/generate.ts +15 -7
- package/src/type.ts +1 -0
- package/templates/basic/nest/controller.ts.eta +5 -3
- package/templates/basic/nest/model.ts.eta +32 -7
- package/templates/basic/nuxt/pages.[id].vue.eta +2 -2
- package/templates/basic/nuxt/pages.crud.vue.eta +79 -40
- package/templates/basic/nuxt/pages.landing.vue.eta +82 -0
- package/templates/nest/.env._eta +1 -0
- package/templates/nest/src/simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +127 -22
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +25 -2
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +20 -2
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +41 -40
- package/templates/nest/src/simpleapp/services/user.service.ts.eta +10 -9
- package/templates/nuxt/app.vue.eta +2 -1
- package/templates/nuxt/assets/css/style.css._eta +3 -12
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +24 -20
- package/templates/nuxt/components/ButtonCreateTenant.vue.eta +30 -23
- package/templates/nuxt/components/ButtonHome.vue.eta +15 -2
- package/templates/nuxt/components/ButtonMenuPicker.vue.eta +5 -20
- package/templates/nuxt/components/ButtonPermissionInfo.vue.eta +5 -7
- package/templates/nuxt/components/ButtonProfile.vue.eta +42 -25
- package/templates/nuxt/components/CrudSimple.vue.eta +1 -1
- package/templates/nuxt/components/EventDecision.vue.eta +115 -0
- package/templates/nuxt/components/EventNotification.vue.eta +157 -0
- package/templates/nuxt/components/HeaderBar.vue.eta +2 -2
- package/templates/nuxt/components/Invitation.vue.eta +3 -3
- package/templates/nuxt/components/SelectBranch.vue.eta +5 -2
- package/templates/nuxt/components/SimpleAppDatatable.vue.eta +151 -5
- package/templates/nuxt/components/TenantPicker.vue.eta +75 -0
- package/templates/nuxt/components/UserProfileListItem.vue.eta +65 -0
- package/templates/nuxt/components/renderers/BooleanRender.vue.eta +7 -0
- package/templates/nuxt/components/renderers/DateRender.vue.eta +6 -0
- package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +10 -0
- package/templates/nuxt/components/renderers/MoneyRender.vue.eta +7 -0
- package/templates/nuxt/components/renderers/MultiTextRender.vue.eta +11 -0
- package/templates/nuxt/composables/getDocument.generate.ts.eta +4 -0
- package/templates/nuxt/composables/getMenus.generate.ts.eta +35 -31
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +6 -1
- package/templates/nuxt/composables/goTo.generate.ts.eta +15 -0
- package/templates/nuxt/composables/notifications.generate.ts.eta +21 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +11 -1
- package/templates/nuxt/error.vue._eta +20 -5
- package/templates/nuxt/layouts/documentlist.vue.eta +166 -0
- package/templates/nuxt/middleware/30.acl.global.ts.eta +4 -1
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +4 -4
- package/templates/nuxt/pages/[xorg]/profile.vue.eta +6 -0
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +6 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +211 -377
- package/templates/nuxt/pages/[xorg]/user.vue.eta +197 -0
- package/templates/nuxt/pages/index.vue._eta +101 -0
- package/templates/nuxt/pages/profile.vue.eta +94 -0
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +4 -4
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +11 -10
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +69 -17
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +6 -3
- package/templates/nuxt/tailwind.config.ts._eta +10 -0
- package/templates/nuxt/types/documentlist.ts.eta +9 -0
- package/templates/nuxt/types/events.ts.eta +20 -0
- package/templates/nuxt/types/index.ts.eta +6 -79
- package/templates/nuxt/types/notifications.ts.eta +16 -0
- package/templates/nuxt/types/others.ts.eta +42 -0
- package/templates/nuxt/types/user.ts.eta +44 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nest/src/simpleapp/generate/models/perm.model.ts.eta +0 -52
- package/templates/nest/src/simpleapp/generate/models/tenant.model.ts.eta +0 -43
- package/templates/nest/src/simpleapp/generate/models/user.model.ts.eta +0 -56
- package/templates/nuxt/components/EventMonitor.vue.eta +0 -85
- package/templates/nuxt/pages/[xorg]/tenant/index.vue.eta +0 -89
- package/templates/nuxt/pages/index.vue.eta +0 -116
- package/templates/nuxt/simpleapp/generate/commons/events.ts.eta +0 -11
|
@@ -6,48 +6,52 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import _ from 'lodash'
|
|
8
8
|
import {MenuData} from '~/types'
|
|
9
|
-
import {
|
|
9
|
+
import {getAllDocuments} from '../simpleapp/generate/commons/documents'
|
|
10
10
|
export const getDocTypes = ()=>{
|
|
11
|
-
return
|
|
11
|
+
return getAllDocuments().filter(item=>item.page!='')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getPublicResource = (xorg:string) : MenuData[] => {
|
|
15
|
+
// const xorg = getUserStore().getCurrentXorg()
|
|
16
|
+
const menus:MenuData[] = [
|
|
17
|
+
{label: 'Home',icon: 'pi pi-fw pi-home', url:`/${xorg}`},
|
|
18
|
+
{label: "Profile", url:`/profile`, isolationType:'none', icon:''},
|
|
19
|
+
{label: "Profile", url:`/${xorg}/profile`, isolationType:'none', icon:''},
|
|
20
|
+
{label: 'Signout',icon: 'pi pi-fw pi-home', command: () => logout()},
|
|
21
|
+
{label: 'Signin',icon: 'pi pi-fw pi-home', 'url':'/login'},
|
|
22
|
+
]
|
|
23
|
+
return menus
|
|
12
24
|
}
|
|
13
25
|
export const getMenus =() :MenuData[]=>{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const xorg =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let allmenus =
|
|
26
|
+
// const logout = async () => {
|
|
27
|
+
// const { signOut } = useAuth();
|
|
28
|
+
// const { data } = await <any>useFetch('/api/auth/logout');
|
|
29
|
+
// const addPath = encodeURIComponent("/login");
|
|
30
|
+
// signOut({ redirect: false });
|
|
31
|
+
// window.location.href = data?.value?.path + addPath;
|
|
32
|
+
// };
|
|
33
|
+
|
|
34
|
+
// const route = useRoute();
|
|
35
|
+
const xorg = getUserStore().getCurrentXorg()
|
|
36
|
+
// let data:MenuData[] =[];
|
|
37
|
+
// //sss
|
|
38
|
+
let allmenus = getAllDocuments().filter(item=>item.page!='')
|
|
27
39
|
|
|
28
|
-
const roles =
|
|
40
|
+
const roles = getUserProfile().roles
|
|
29
41
|
let allowmenus=[]
|
|
30
42
|
for(let i=0; i< allmenus.length;i++){
|
|
31
43
|
const keyword = allmenus[i].docName
|
|
32
44
|
// if(m.label)
|
|
33
45
|
|
|
34
|
-
if(
|
|
46
|
+
if(getUserStore().haveAccess(keyword)){
|
|
35
47
|
const m:MenuData = {label: keyword, url:`/${xorg}/${keyword}`, isolationType:allmenus[i].isolationType}
|
|
36
48
|
allowmenus.push(m)
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]
|
|
46
|
-
}else{
|
|
47
|
-
data= [
|
|
48
|
-
{label: 'Home',icon: 'pi pi-fw pi-home', url:'/'},
|
|
49
|
-
{label: 'Signout',icon: 'pi pi-fw pi-home', command: () => logout()},
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
return data
|
|
51
|
+
// data = publicMenus()
|
|
52
|
+
// if(xorg){
|
|
53
|
+
// data.push({label: 'Cruds',icon: 'pi pi-fw pi-pencil',items:allowmenus})
|
|
54
|
+
// }
|
|
55
|
+
// console.log('data',data)
|
|
56
|
+
return allowmenus
|
|
53
57
|
}
|
|
@@ -10,7 +10,12 @@ export const reloadUserStore = async () =>{
|
|
|
10
10
|
export const getUserProfile = () =>{
|
|
11
11
|
return getUserStore().getUserInfo()
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
export const getCurrentXorg = () =>{
|
|
14
|
+
return getUserStore().getCurrentXorg()
|
|
15
|
+
}
|
|
16
|
+
export const getPageBaseUrl = (resourcename:string) =>{
|
|
17
|
+
return `/${getCurrentXorg()}/${resourcename}`;
|
|
18
|
+
}
|
|
14
19
|
/**
|
|
15
20
|
* verify current user can perform specific action base on backend RBAC
|
|
16
21
|
* @param resource:string upper case first letter document name
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const getDocumentUrl = (document:string,id?:string,querystr?:string)=>{
|
|
2
|
+
let path = `/${getCurrentXorg()}/${document}`
|
|
3
|
+
if(id){
|
|
4
|
+
path = path + '/'+id
|
|
5
|
+
}
|
|
6
|
+
if(querystr){
|
|
7
|
+
path=path+'?'+querystr
|
|
8
|
+
}
|
|
9
|
+
return path
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const goTo = (document:string,id?:string,querystr?:string)=>{
|
|
14
|
+
navigateTo(getDocumentUrl(document,id,querystr))
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {NotificationStatus} from '~/types'
|
|
2
|
+
export const getStatusColor = (status:NotificationStatus) => {
|
|
3
|
+
console.log("get status color",status)
|
|
4
|
+
switch(status){
|
|
5
|
+
case NotificationStatus.error:
|
|
6
|
+
return 'bg bg-danger-600 text-white';
|
|
7
|
+
break;
|
|
8
|
+
case NotificationStatus.warn:
|
|
9
|
+
return 'bg bg-warning-600 text-white';
|
|
10
|
+
break;
|
|
11
|
+
case NotificationStatus.info:
|
|
12
|
+
return 'bg bg-secondary-600 text-white';
|
|
13
|
+
break;
|
|
14
|
+
case NotificationStatus.success:
|
|
15
|
+
default:
|
|
16
|
+
return 'bg bg-primary-600 text-white';
|
|
17
|
+
break;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import {Md5} from 'ts-md5'
|
|
1
2
|
export const camelCaseToWords = (s: string) =>{
|
|
2
3
|
const result = s.replace(/([A-Z])/g, ' $1');
|
|
3
4
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const md5=(s:string)=> new Md5().appendStr(s).end()
|
|
9
|
+
|
|
10
|
+
export const getAvatarLink = (email:string, size:number):string=>{
|
|
11
|
+
return `https://api.simbiz.cloud/cloudapi/avatar/${md5(email)}?size=${size}`
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const toLocalDate = (dateiso8601:string)=> new Date(String(dateiso8601)).toLocaleDateString()
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<div class="flex items-center justify-center py-12 bg bg-gray-500">
|
|
3
|
+
<div class="bg-white border rounded-md flex items-center justify-center mx-4 md:w-2/3">
|
|
4
|
+
<div class="flex flex-col items-center py-16">
|
|
5
|
+
|
|
6
|
+
<div class="flex flex-row">
|
|
7
|
+
<div class="w w-40">
|
|
8
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-13.59 -13.59 480.17 480.17" xml:space="preserve" fill="#000000" stroke="#000000" stroke-width="0.00452986"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <g> <g> <path style="fill:#010002;" d="M0,0v452.986h452.986V0H0z M403.223,24.655c8.132,0,14.668,6.558,14.668,14.625 c0,8.111-6.536,14.711-14.668,14.711c-8.089,0-14.668-6.601-14.668-14.711C388.576,31.234,395.134,24.655,403.223,24.655z M352.035,24.655c8.046,0,14.647,6.558,14.647,14.625c0,8.111-6.601,14.711-14.647,14.711c-8.132,0-14.668-6.601-14.668-14.711 C337.389,31.234,343.903,24.655,352.035,24.655z M417.955,418.624H35.053V85.701h382.903V418.624z"></path> <path style="fill:#010002;" d="M226.493,398.952c80.394,0,145.495-65.101,145.495-145.43s-65.101-145.495-145.495-145.495 c-80.373,0-145.516,65.165-145.516,145.495C80.977,333.873,146.12,398.952,226.493,398.952z M142.044,198.516l29.444-29.444 l55.005,55.027l54.984-55.027l29.379,29.444L255.894,253.5l54.984,54.941l-29.423,29.444l-54.962-54.962l-55.005,54.984 l-29.444-29.444l54.984-54.941L142.044,198.516z"></path> </g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> </g> </g></svg>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<h1 class="px-4 pt-2 pb-4 text-left text-5xl font-bold leading-10 text-gray-800">OOPS!</h1>
|
|
12
|
+
<p class="px-4 mt mb-4 text-4xl text-left font font-bold">{{error.statusCode}} Error</p>
|
|
13
|
+
<p class="px-4 pb-10 text-base leading-none text-left text-gray-400">{{error.message}}</p>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
7
22
|
</template>
|
|
8
23
|
<script setup lang="ts">
|
|
9
24
|
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND.
|
|
5
|
+
* last change 2023-09-09
|
|
6
|
+
* author: Ks Tan
|
|
7
|
+
*/
|
|
8
|
+
import { FilterMatchMode } from 'primevue/api';
|
|
9
|
+
import Column from 'primevue/column';
|
|
10
|
+
import {ref} from 'vue'
|
|
11
|
+
import _ from 'lodash'
|
|
12
|
+
import { SimpleAppClient } from '../simpleapp/generate/clients/SimpleAppClient' //'../SimpleAppClient';
|
|
13
|
+
import Dialog from 'primevue/dialog';
|
|
14
|
+
import {SearchBody,CellSetting} from '~/types'
|
|
15
|
+
const {$listen} = useNuxtApp()
|
|
16
|
+
const defaultlist:CellSetting[] = []
|
|
17
|
+
const recordlist = ref([]);
|
|
18
|
+
|
|
19
|
+
const metas = useRoute().meta
|
|
20
|
+
const documentName = ref(String(metas.documentName))
|
|
21
|
+
const tablecolumns = ref<CellSetting[]>([])
|
|
22
|
+
const sorts = metas.sorts as string[][]
|
|
23
|
+
|
|
24
|
+
const filters = ref({
|
|
25
|
+
'global': {value: null, matchMode: FilterMatchMode.CONTAINS},
|
|
26
|
+
});
|
|
27
|
+
// onNuxtReady(()=>{
|
|
28
|
+
// console.log("Listen ReloadLayout")
|
|
29
|
+
// $listen('ReloadLayout',(screenname)=>{
|
|
30
|
+
// console.log("Reload layout",screenname)
|
|
31
|
+
// // const metas = useRoute().meta
|
|
32
|
+
// // renderLayout()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// })
|
|
36
|
+
|
|
37
|
+
// })
|
|
38
|
+
provide('refreshLayout',(docname:string)=>{
|
|
39
|
+
console.log("refresh layout:",docname)
|
|
40
|
+
})
|
|
41
|
+
// onMounted(()=>{
|
|
42
|
+
// console.log("On Mounted at layout")
|
|
43
|
+
|
|
44
|
+
// })
|
|
45
|
+
let obj = getDocument(documentName.value)
|
|
46
|
+
// console.log("obj",obj)
|
|
47
|
+
// const data = obj?.getReactiveData()
|
|
48
|
+
// const disabled=ref(false)
|
|
49
|
+
|
|
50
|
+
// const documentTitle = _.upperFirst(documentName)
|
|
51
|
+
|
|
52
|
+
// // const props = defineProps<{
|
|
53
|
+
// // document:SimpleAppClient<any,any>
|
|
54
|
+
// // listColumns:string[]
|
|
55
|
+
// // path:string
|
|
56
|
+
// // title:string
|
|
57
|
+
// // sorts?: any
|
|
58
|
+
// // }>()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// const route = useRoute()
|
|
64
|
+
|
|
65
|
+
// const popuptitle = ref("New "+documentTitle)
|
|
66
|
+
// const systemwindows = ref(false)
|
|
67
|
+
// const currentjsonschema:any = obj?.getSchema()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// const recordId = computed(()=>route.params.id)
|
|
71
|
+
// const setNew = computed(()=>route.query.new)
|
|
72
|
+
|
|
73
|
+
// const updateVisible = () =>{
|
|
74
|
+
// console.log("UpdateVisible")
|
|
75
|
+
// if(recordId.value || setNew.value){
|
|
76
|
+
// visible.value = true
|
|
77
|
+
// }else{
|
|
78
|
+
// visible.value = false
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
// watch(route,(a,b)=>{
|
|
82
|
+
// console.log('watch route change',a,b)
|
|
83
|
+
// },{deep:true})
|
|
84
|
+
|
|
85
|
+
// watch(recordId,()=>{
|
|
86
|
+
// updateVisible()
|
|
87
|
+
// })
|
|
88
|
+
// watch(setNew,()=>{
|
|
89
|
+
// updateVisible()
|
|
90
|
+
// })
|
|
91
|
+
|
|
92
|
+
const refresh = async() => {
|
|
93
|
+
tablecolumns.value= !useRoute().meta.columns ? [] : useRoute().meta.columns as CellSetting[]
|
|
94
|
+
documentName.value = String(useRoute().meta.documentName)
|
|
95
|
+
const searchbody: SearchBody = {
|
|
96
|
+
fields: tablecolumns.value.concat(['created']),
|
|
97
|
+
sorts: metas.sorts as string[][]
|
|
98
|
+
}
|
|
99
|
+
obj = getDocument(documentName.value)
|
|
100
|
+
|
|
101
|
+
obj?.search(searchbody).then((res:any) => {
|
|
102
|
+
recordlist.value = res;
|
|
103
|
+
// disabled.value=false
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
onNuxtReady(()=>{
|
|
108
|
+
refresh()
|
|
109
|
+
// updateVisible()
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
const renderLayout =()=>{
|
|
113
|
+
const metas = useRoute().meta
|
|
114
|
+
// console.log(obj?.getDocName(),'==',data)
|
|
115
|
+
// if(obj?.getDocName()==data.documentName){
|
|
116
|
+
// console.log("Refresh now")
|
|
117
|
+
// refresh()
|
|
118
|
+
// }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
watch(()=> useRoute().meta ,(newvalue,oldvalue)=>{
|
|
122
|
+
refresh()
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
</script>
|
|
129
|
+
<template>
|
|
130
|
+
<div>
|
|
131
|
+
|
|
132
|
+
<HeaderBar />
|
|
133
|
+
<Invitation/>
|
|
134
|
+
<SimpleAppDatatable :value="recordlist" :columns="tablecolumns" :title="documentName">
|
|
135
|
+
<template #toolbar>
|
|
136
|
+
<div class="w-full text-left">
|
|
137
|
+
<slot>
|
|
138
|
+
undefine page content
|
|
139
|
+
</slot>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
<template #additionaltoolbar>
|
|
143
|
+
<Button class="bg-secondary-600 hover:bg-secondary-400 text-white" @click="refresh()" type="button" >Refresh</Button>
|
|
144
|
+
</template>
|
|
145
|
+
<Column header=" ">
|
|
146
|
+
<template #body="{index,data}">
|
|
147
|
+
<NuxtLink :to="getDocumentUrl(String(useRoute().meta.documentName),data._id)">
|
|
148
|
+
<Button icon="pi pi-pencil" class="bg-primary-600 hover:bg-primary-400 text-white" >Edit</Button>
|
|
149
|
+
</NuxtLink>
|
|
150
|
+
</template>
|
|
151
|
+
</Column>
|
|
152
|
+
</SimpleAppDatatable>
|
|
153
|
+
<!--
|
|
154
|
+
<DebugDocumentData v-model="data"/>
|
|
155
|
+
-->
|
|
156
|
+
<!-- <Dialog v-model:visible="visible"
|
|
157
|
+
:pt="{root:{class:'w-full h-full'}}"
|
|
158
|
+
modal :header="documentName"
|
|
159
|
+
:autoZIndex="false"
|
|
160
|
+
@update:visible="exitRecord"
|
|
161
|
+
>
|
|
162
|
+
<slot></slot>
|
|
163
|
+
</Dialog> -->
|
|
164
|
+
|
|
165
|
+
</div>
|
|
166
|
+
</template>
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import { getUserProfile } from './../composables/getUserStore.generate';
|
|
8
|
+
import {MenuData} from '~/types'
|
|
8
9
|
export default defineNuxtRouteMiddleware((to, from) => {
|
|
9
10
|
|
|
10
11
|
const userprofile = getUserProfile()
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
//is public resource
|
|
15
|
+
if( getPublicResource(String(to.params['xorg'])).filter((item:MenuData)=>to.fullPath === item.url)){
|
|
13
16
|
return true
|
|
14
17
|
}// no permission control needed yet
|
|
15
18
|
else if(!to.params['xorg']){
|
|
@@ -24,7 +24,7 @@ const showbranchfrom = ref(false);
|
|
|
24
24
|
const getBranchList = () => {
|
|
25
25
|
branchdoc
|
|
26
26
|
.getApi()
|
|
27
|
-
.runSearch({ orgId: data.value.orgId })
|
|
27
|
+
.runSearch({ filter:{orgId: data.value.orgId }})
|
|
28
28
|
.then((res) => {
|
|
29
29
|
branchlist.value = res.data;
|
|
30
30
|
});
|
|
@@ -117,7 +117,7 @@ const saveBranch = async () => {
|
|
|
117
117
|
:columns="['branchId', 'branchCode', 'branchName', 'active']"
|
|
118
118
|
>
|
|
119
119
|
<template #header>
|
|
120
|
-
<Button class="
|
|
120
|
+
<Button class="btn-primary" @click="editBranch('')" type="button">
|
|
121
121
|
<span class="font font-normal">Add Branch</span>
|
|
122
122
|
</Button>
|
|
123
123
|
</template>
|
|
@@ -125,7 +125,7 @@ const saveBranch = async () => {
|
|
|
125
125
|
<template #body="{ index, data }">
|
|
126
126
|
<Button
|
|
127
127
|
type="button"
|
|
128
|
-
class="
|
|
128
|
+
class="btn-primary"
|
|
129
129
|
@click="editBranch(data._id)"
|
|
130
130
|
>
|
|
131
131
|
Edit
|
|
@@ -157,7 +157,7 @@ const saveBranch = async () => {
|
|
|
157
157
|
:setting="o.getField('#/properties/description')"
|
|
158
158
|
/>
|
|
159
159
|
<!-- <SimpleAppNumber :readonly="true" v-model="branchdata.orgId" :setting="o.getField('#/properties/orgId')"/> -->
|
|
160
|
-
<Button class="
|
|
160
|
+
<Button class="btn-primary" type="button" @click="saveBranch">
|
|
161
161
|
Save
|
|
162
162
|
</Button>
|
|
163
163
|
</SimpleAppForm>
|