@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
|
@@ -7,73 +7,69 @@
|
|
|
7
7
|
* author: Ks Tan
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
InputTableColumnType,
|
|
12
|
-
InputTableColumn,
|
|
13
|
-
} from "@simitgroup/simpleapp-vue-component/src/type";
|
|
14
10
|
import Column from "primevue/column";
|
|
15
|
-
const { $OrganizationDoc
|
|
11
|
+
const { $OrganizationDoc, $BranchDoc, $listen } = useNuxtApp();
|
|
16
12
|
//organization
|
|
17
13
|
const doc = $OrganizationDoc();
|
|
18
14
|
const data = doc.getReactiveData();
|
|
19
15
|
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)
|
|
16
|
+
const branchlist = ref();
|
|
17
|
+
const branchdoc = $BranchDoc();
|
|
18
|
+
const branchdata = branchdoc.getReactiveData();
|
|
19
|
+
const currentOrgId = ref();
|
|
20
|
+
const debugdata = ref();
|
|
21
|
+
const showbranchfrom = ref(false);
|
|
26
22
|
//branch
|
|
27
23
|
|
|
28
24
|
const getBranchList = () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
25
|
+
branchdoc
|
|
26
|
+
.getApi()
|
|
27
|
+
.runSearch({ orgId: data.value.orgId })
|
|
28
|
+
.then((res) => {
|
|
29
|
+
branchlist.value = res.data;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
$listen("editRecord", async (editOrgid) => {
|
|
33
|
+
//console.log('editRecord',editOrgid)
|
|
34
|
+
debugdata.value = data.value;
|
|
35
|
+
if (editOrgid) {
|
|
36
|
+
currentOrgId.value = editOrgid;
|
|
37
|
+
getBranchList();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
43
40
|
|
|
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)
|
|
41
|
+
const editBranch = (recordId: string) => {
|
|
42
|
+
console.log("edit nested", currentOrgId, recordId);
|
|
43
|
+
showbranchfrom.value = true;
|
|
44
|
+
debugdata.value = branchdata.value;
|
|
45
|
+
if (!recordId) {
|
|
46
|
+
branchdoc.setNew();
|
|
47
|
+
} else {
|
|
48
|
+
branchdoc.getById(recordId);
|
|
52
49
|
}
|
|
53
|
-
}
|
|
54
|
-
const saveBranch= async()=>{
|
|
55
|
-
branchdata.value.orgId=data.value.orgId
|
|
50
|
+
};
|
|
51
|
+
const saveBranch = async () => {
|
|
52
|
+
branchdata.value.orgId = data.value.orgId;
|
|
56
53
|
branchdata.value.organization = {
|
|
57
54
|
_id: data.value._id,
|
|
58
55
|
orgId: data.value.orgId,
|
|
59
|
-
label: data.value.orgName
|
|
60
|
-
}
|
|
61
|
-
if(
|
|
62
|
-
console.log("Create")
|
|
63
|
-
await branchdoc.create()
|
|
64
|
-
}else{
|
|
65
|
-
console.log("update")
|
|
66
|
-
await branchdoc.update()
|
|
56
|
+
label: data.value.orgName,
|
|
57
|
+
};
|
|
58
|
+
if (branchdoc.isNew()) {
|
|
59
|
+
console.log("Create");
|
|
60
|
+
await branchdoc.create();
|
|
61
|
+
} else {
|
|
62
|
+
console.log("update");
|
|
63
|
+
await branchdoc.update();
|
|
67
64
|
}
|
|
68
|
-
getBranchList()
|
|
69
|
-
|
|
70
|
-
}
|
|
65
|
+
getBranchList();
|
|
66
|
+
};
|
|
71
67
|
|
|
72
68
|
//end
|
|
73
69
|
</script>
|
|
74
70
|
<template>
|
|
75
71
|
<div>
|
|
76
|
-
<DebugDocumentData v-model="debugdata"/>
|
|
72
|
+
<DebugDocumentData v-model="debugdata" />
|
|
77
73
|
<CrudNestedDoc
|
|
78
74
|
:document="doc"
|
|
79
75
|
title="Organization"
|
|
@@ -116,33 +112,57 @@ const saveBranch= async()=>{
|
|
|
116
112
|
</div>
|
|
117
113
|
<div class="grid grid-cols-4 gap-4 w-full">
|
|
118
114
|
<div class="col-span-2">
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
<SimpleAppDatatable
|
|
116
|
+
v-model="branchlist"
|
|
117
|
+
:columns="['branchId', 'branchCode', 'branchName', 'active']"
|
|
118
|
+
>
|
|
121
119
|
<template #header>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
<Button class=" btn-primary" @click="editBranch('')" type="button">
|
|
121
|
+
<span class="font font-normal">Add Branch</span>
|
|
122
|
+
</Button>
|
|
123
|
+
</template>
|
|
124
|
+
<Column header="Action">
|
|
125
|
+
<template #body="{ index, data }">
|
|
126
|
+
<Button
|
|
127
|
+
type="button"
|
|
128
|
+
class=" btn-primary"
|
|
129
|
+
@click="editBranch(data._id)"
|
|
130
|
+
>
|
|
131
|
+
Edit
|
|
132
|
+
</Button>
|
|
133
|
+
</template>
|
|
134
|
+
</Column>
|
|
130
135
|
</SimpleAppDatatable>
|
|
131
136
|
</div>
|
|
132
|
-
<div class="col-span-2"
|
|
133
|
-
<SimpleAppForm
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
<div class="col-span-2">
|
|
138
|
+
<SimpleAppForm
|
|
139
|
+
:document="branchdoc"
|
|
140
|
+
#default="o"
|
|
141
|
+
v-if="showbranchfrom"
|
|
142
|
+
>
|
|
143
|
+
<SimpleAppText
|
|
144
|
+
v-model="branchdata.branchCode"
|
|
145
|
+
:setting="o.getField('#/properties/branchCode')"
|
|
146
|
+
/>
|
|
147
|
+
<SimpleAppText
|
|
148
|
+
v-model="branchdata.branchName"
|
|
149
|
+
:setting="o.getField('#/properties/branchName')"
|
|
150
|
+
/>
|
|
151
|
+
<SimpleAppCheckbox
|
|
152
|
+
v-model="branchdata.active"
|
|
153
|
+
:setting="o.getField('#/properties/active')"
|
|
154
|
+
/>
|
|
155
|
+
<SimpleAppTextarea
|
|
156
|
+
v-model="branchdata.description"
|
|
157
|
+
:setting="o.getField('#/properties/description')"
|
|
158
|
+
/>
|
|
159
|
+
<!-- <SimpleAppNumber :readonly="true" v-model="branchdata.orgId" :setting="o.getField('#/properties/orgId')"/> -->
|
|
160
|
+
<Button class=" btn-primary" type="button" @click="saveBranch">
|
|
161
|
+
Save
|
|
162
|
+
</Button>
|
|
141
163
|
</SimpleAppForm>
|
|
142
164
|
</div>
|
|
143
|
-
|
|
144
165
|
</div>
|
|
145
166
|
</CrudNestedDoc>
|
|
146
|
-
|
|
147
167
|
</div>
|
|
148
168
|
</template>
|
|
@@ -156,7 +156,7 @@ onMounted(() => {
|
|
|
156
156
|
});
|
|
157
157
|
</script>
|
|
158
158
|
<template>
|
|
159
|
-
<
|
|
159
|
+
<Button @click="refreshList()" class="pi pi-refresh"></Button>
|
|
160
160
|
<Dialog
|
|
161
161
|
v-model:visible="showpermissioninfo"
|
|
162
162
|
modal
|
|
@@ -204,8 +204,8 @@ onMounted(() => {
|
|
|
204
204
|
placeholder="email"
|
|
205
205
|
v-model="inviteemail"
|
|
206
206
|
/>
|
|
207
|
-
<
|
|
208
|
-
>Invite</
|
|
207
|
+
<Button label="Search" class=" btn-primary" @click="invite"
|
|
208
|
+
>Invite</Button
|
|
209
209
|
>
|
|
210
210
|
|
|
211
211
|
</div>
|
|
@@ -221,10 +221,10 @@ onMounted(() => {
|
|
|
221
221
|
{{ invitation.email }}
|
|
222
222
|
</div>
|
|
223
223
|
<div>
|
|
224
|
-
<
|
|
224
|
+
<Button
|
|
225
225
|
class="btn-danger pi pi-times"
|
|
226
226
|
@click="deleteInvitation(invitation._id)"
|
|
227
|
-
></
|
|
227
|
+
></Button>
|
|
228
228
|
</div>
|
|
229
229
|
</div>
|
|
230
230
|
</div>
|
|
@@ -235,10 +235,10 @@ onMounted(() => {
|
|
|
235
235
|
<div class="flex flex-row w w-full">
|
|
236
236
|
<div class="text text-xl p p-2 text-left flex-1">{{ activeuser }}</div>
|
|
237
237
|
<div class="text-right m mr-2">
|
|
238
|
-
<
|
|
238
|
+
<Button
|
|
239
239
|
class="btn-primary pi pi-question"
|
|
240
240
|
@click="previewPermission"
|
|
241
|
-
></
|
|
241
|
+
></Button>
|
|
242
242
|
</div>
|
|
243
243
|
</div>
|
|
244
244
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import Menu from "primevue/menu";
|
|
9
9
|
import Dialog from "primevue/dialog";
|
|
10
|
-
import {SearchBody} from
|
|
10
|
+
import { SearchBody } from "~/types";
|
|
11
11
|
import _ from "lodash";
|
|
12
12
|
import Panel from "primevue/panel";
|
|
13
13
|
import { ref } from "vue";
|
|
@@ -67,7 +67,9 @@ const permissiontitle = "Permission Information";
|
|
|
67
67
|
*/
|
|
68
68
|
const refreshList = async (resetpage: boolean = true) => {
|
|
69
69
|
const items: any[] = [];
|
|
70
|
-
const searchbody: SearchBody = {
|
|
70
|
+
const searchbody: SearchBody = {
|
|
71
|
+
fields: ["uid", "email", "created", "fullname", "active"],
|
|
72
|
+
};
|
|
71
73
|
userlist.value = await userdoc.search(searchbody);
|
|
72
74
|
//listUser();
|
|
73
75
|
// userlist.value = _.uniqBy(permlist.value, "uid");
|
|
@@ -90,13 +92,25 @@ const refreshList = async (resetpage: boolean = true) => {
|
|
|
90
92
|
*/
|
|
91
93
|
const onSelectUser = async (menuitem: any) => {
|
|
92
94
|
const user: UserListItem = { ...menuitem };
|
|
93
|
-
const orgsearchbody: SearchBody = {
|
|
94
|
-
|
|
95
|
+
const orgsearchbody: SearchBody = {
|
|
96
|
+
fields: ["orgId", "orgCode", "orgName", "active"],
|
|
97
|
+
};
|
|
98
|
+
const branchsearchbody: SearchBody = {
|
|
99
|
+
fields: ["orgId", "branchId", "branchCode", "branchName", "active"],
|
|
100
|
+
};
|
|
95
101
|
const permsearchbody: SearchBody = {
|
|
96
|
-
filter:{$or: [{ uid: user.uid }, { user_id: user._id }]
|
|
97
|
-
fields:[
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
filter: { $or: [{ uid: user.uid }, { user_id: user._id }] },
|
|
103
|
+
fields: [
|
|
104
|
+
"uid",
|
|
105
|
+
"branchId",
|
|
106
|
+
"tenantId",
|
|
107
|
+
"orgId",
|
|
108
|
+
"active",
|
|
109
|
+
"group",
|
|
110
|
+
"created",
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
|
|
100
114
|
orglist.value = await orgdoc.search(orgsearchbody);
|
|
101
115
|
branchlist.value = await branchdoc.search(branchsearchbody);
|
|
102
116
|
permlist.value = await permdoc.search(permsearchbody);
|
|
@@ -238,21 +252,11 @@ onMounted(() => {
|
|
|
238
252
|
});
|
|
239
253
|
</script>
|
|
240
254
|
<template>
|
|
241
|
-
<
|
|
255
|
+
<Button
|
|
242
256
|
@click="refreshList()"
|
|
243
257
|
v-if="useRuntimeConfig().public.DEBUGDATA"
|
|
244
258
|
class="pi pi-refresh"
|
|
245
|
-
></
|
|
246
|
-
<Dialog
|
|
247
|
-
v-model:visible="showpermissioninfo"
|
|
248
|
-
modal
|
|
249
|
-
:header="permissiontitle"
|
|
250
|
-
:autoZIndex="false"
|
|
251
|
-
:style="{ zIndex: 100, width: '80vw' }"
|
|
252
|
-
>
|
|
253
|
-
<PermissionInfo></PermissionInfo>
|
|
254
|
-
</Dialog>
|
|
255
|
-
|
|
259
|
+
></Button>
|
|
256
260
|
<div class="grid grid-cols-4">
|
|
257
261
|
<div v-if="userlist">
|
|
258
262
|
<TabView>
|
|
@@ -281,11 +285,11 @@ onMounted(() => {
|
|
|
281
285
|
</div>
|
|
282
286
|
<div class="basis-1/6 m-2">
|
|
283
287
|
<!-- only debug mode can delete user -->
|
|
284
|
-
<
|
|
288
|
+
<Button
|
|
285
289
|
v-if="useRuntimeConfig().public.DEBUGDATA"
|
|
286
290
|
class="pi pi-times btn-danger"
|
|
287
291
|
@click="deleteUser(item)"
|
|
288
|
-
></
|
|
292
|
+
></Button>
|
|
289
293
|
</div>
|
|
290
294
|
</a>
|
|
291
295
|
</template>
|
|
@@ -316,11 +320,11 @@ onMounted(() => {
|
|
|
316
320
|
</div>
|
|
317
321
|
<div class="basis-1/6 m-2">
|
|
318
322
|
<!-- only debug mode can delete user -->
|
|
319
|
-
<
|
|
323
|
+
<Button
|
|
320
324
|
v-if="useRuntimeConfig().public.DEBUGDATA"
|
|
321
325
|
class="pi pi-times btn-danger"
|
|
322
326
|
@click="deleteUser(item)"
|
|
323
|
-
></
|
|
327
|
+
></Button>
|
|
324
328
|
</div>
|
|
325
329
|
</a>
|
|
326
330
|
</template>
|
|
@@ -335,9 +339,9 @@ onMounted(() => {
|
|
|
335
339
|
placeholder="email"
|
|
336
340
|
v-model="inviteemail"
|
|
337
341
|
/>
|
|
338
|
-
<
|
|
342
|
+
<Button label="Search" class="btn btn-primary" @click="invite">
|
|
339
343
|
Invite
|
|
340
|
-
</
|
|
344
|
+
</Button>
|
|
341
345
|
</div>
|
|
342
346
|
</form>
|
|
343
347
|
</div>
|
|
@@ -364,10 +368,10 @@ onMounted(() => {
|
|
|
364
368
|
<div class="text text-sm text-right">{{ item.email }}</div>
|
|
365
369
|
</div>
|
|
366
370
|
<div class="basis-1/6 m-2">
|
|
367
|
-
<
|
|
371
|
+
<Button
|
|
368
372
|
class="pi pi-times btn-danger"
|
|
369
373
|
@click="deleteUser(item)"
|
|
370
|
-
></
|
|
374
|
+
></Button>
|
|
371
375
|
</div>
|
|
372
376
|
</a>
|
|
373
377
|
</template>
|
|
@@ -415,17 +419,13 @@ onMounted(() => {
|
|
|
415
419
|
>
|
|
416
420
|
<BlockUI :blocked="blockscreen">
|
|
417
421
|
<div class="text-right m mr-2">
|
|
418
|
-
<
|
|
419
|
-
class="btn-primary pi pi-question"
|
|
420
|
-
@click="previewPermission"
|
|
421
|
-
></button>
|
|
422
|
+
<ButtonPermissionInfo></ButtonPermissionInfo>
|
|
422
423
|
</div>
|
|
423
424
|
|
|
424
425
|
<div class="grid grid-cols-2">
|
|
425
426
|
<Card v-for="o in orglist" class="m-2">
|
|
426
427
|
<template #title>{{ o.orgName }}</template>
|
|
427
428
|
<template #content>
|
|
428
|
-
|
|
429
429
|
<table class="w w-full">
|
|
430
430
|
<thead class="">
|
|
431
431
|
<tr>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/**
|
|
3
|
-
* This file was automatically generated by simpleapp generator
|
|
4
|
-
*
|
|
5
|
-
* last change 2023-
|
|
6
|
-
*
|
|
3
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
4
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
5
|
+
* last change 2023-10-28
|
|
6
|
+
* Author: Ks Tan
|
|
7
7
|
*/
|
|
8
8
|
import _ from "lodash";
|
|
9
9
|
import InputText from "primevue/inputtext";
|
|
@@ -11,28 +11,21 @@ import Dialog from "primevue/dialog";
|
|
|
11
11
|
import { ref, Ref } from "vue";
|
|
12
12
|
import { SimpleAppEventType } from "../simpleapp/generate/commons/events";
|
|
13
13
|
import { TenantDoc } from "../simpleapp/docs/TenantDoc";
|
|
14
|
-
import ProgressSpinner from
|
|
14
|
+
import ProgressSpinner from "primevue/progressspinner";
|
|
15
15
|
import Panel from "primevue/panel";
|
|
16
16
|
import Card from "primevue/card";
|
|
17
17
|
import { AxiosResponse } from "axios";
|
|
18
18
|
|
|
19
19
|
const { $event, $listen, $userstore } = useNuxtApp();
|
|
20
|
-
const errCreateTenant = ref();
|
|
21
20
|
const branches = ref([]);
|
|
22
|
-
const data = ref();
|
|
23
|
-
const visible = ref(false);
|
|
24
21
|
const userprofile = ref();
|
|
25
|
-
const createtitle = ref("Create My Company");
|
|
26
22
|
const orgList = ref();
|
|
27
|
-
|
|
23
|
+
|
|
28
24
|
const loadProfile = async () => {
|
|
29
25
|
await reloadUserStore();
|
|
30
26
|
userprofile.value = getUserProfile();
|
|
31
27
|
console.log("useprofile", userprofile.value);
|
|
32
|
-
|
|
33
|
-
tenantName: "",
|
|
34
|
-
};
|
|
35
|
-
|
|
28
|
+
|
|
36
29
|
branches.value = userprofile.value.branches;
|
|
37
30
|
|
|
38
31
|
orgList.value = _.uniqBy(branches.value, "branch.orgId").map((item) => ({
|
|
@@ -52,34 +45,6 @@ onMounted(() => {
|
|
|
52
45
|
loadProfile();
|
|
53
46
|
});
|
|
54
47
|
|
|
55
|
-
const createTenant = async () => {
|
|
56
|
-
|
|
57
|
-
onhold.value=true
|
|
58
|
-
const { $axios, $listen } = useNuxtApp();
|
|
59
|
-
|
|
60
|
-
const openapi = getApi();
|
|
61
|
-
const apipath = `${useRuntimeConfig().public.API_URL}`;
|
|
62
|
-
let profileapi = new openapi.PROFILEApi(undefined, apipath, $axios);
|
|
63
|
-
|
|
64
|
-
profileapi
|
|
65
|
-
.createTenant(data.value)
|
|
66
|
-
.then((res) => {
|
|
67
|
-
if (res && res.status && res.status == 201) {
|
|
68
|
-
if (res.data && res.data["xOrg"]) {
|
|
69
|
-
const xorg = res.data["xOrg"];
|
|
70
|
-
navigateTo("/" + xorg, { external: true });
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
})
|
|
75
|
-
.catch((err) => {
|
|
76
|
-
errCreateTenant.value = err["message"];
|
|
77
|
-
console.error("errCreateTenant", err);
|
|
78
|
-
|
|
79
|
-
}).finally(()=>{
|
|
80
|
-
onhold.value=false
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
48
|
</script>
|
|
84
49
|
<template>
|
|
85
50
|
<div class="grid grid-cols-2">
|
|
@@ -87,38 +52,7 @@ const createTenant = async () => {
|
|
|
87
52
|
<Panel header="Create New Tenant">
|
|
88
53
|
<div>
|
|
89
54
|
<h1>Create new one?</h1>
|
|
90
|
-
<
|
|
91
|
-
v-model="data"
|
|
92
|
-
label="CreateTenant"
|
|
93
|
-
></DebugDocumentData>
|
|
94
|
-
<button class="btn-primary" @click="visible = true">
|
|
95
|
-
Create My Company
|
|
96
|
-
</button>
|
|
97
|
-
|
|
98
|
-
<Dialog
|
|
99
|
-
v-model:visible="visible"
|
|
100
|
-
modal
|
|
101
|
-
:header="createtitle"
|
|
102
|
-
class="crudsimple-dialog"
|
|
103
|
-
>
|
|
104
|
-
<form @submit.prevent="true" class="flex flex-col text-center">
|
|
105
|
-
|
|
106
|
-
<div v-if="errCreateTenant" class="text-error">
|
|
107
|
-
{{ errCreateTenant }}
|
|
108
|
-
</div>
|
|
109
|
-
<ProgressSpinner v-if="onhold"></ProgressSpinner>
|
|
110
|
-
<InputText v-else
|
|
111
|
-
type="text"
|
|
112
|
-
autofocus="true"
|
|
113
|
-
v-model:model-value="data.tenantName"
|
|
114
|
-
placeholder="Organization Name"
|
|
115
|
-
/>
|
|
116
|
-
|
|
117
|
-
<button class="btn-primary" type="submit" @click="createTenant">
|
|
118
|
-
Create
|
|
119
|
-
</button>
|
|
120
|
-
</form>
|
|
121
|
-
</Dialog>
|
|
55
|
+
<ButtonCreateTenant></ButtonCreateTenant>
|
|
122
56
|
</div>
|
|
123
57
|
</Panel>
|
|
124
58
|
<Panel header="Reserved">
|
|
@@ -130,11 +64,11 @@ const createTenant = async () => {
|
|
|
130
64
|
<template #header>
|
|
131
65
|
<div class="flex flex-row">
|
|
132
66
|
<div class="font font-bold">Login To</div>
|
|
133
|
-
<
|
|
67
|
+
<Button
|
|
134
68
|
class="pi pi-refresh ml-4"
|
|
135
69
|
@click="loadProfile"
|
|
136
70
|
v-if="useRuntimeConfig().public.DEBUGDATA"
|
|
137
|
-
></
|
|
71
|
+
></Button>
|
|
138
72
|
</div>
|
|
139
73
|
</template>
|
|
140
74
|
<div class="grid grid-cols-2">
|
|
@@ -180,12 +114,3 @@ const createTenant = async () => {
|
|
|
180
114
|
</Panel>
|
|
181
115
|
</div>
|
|
182
116
|
</template>
|
|
183
|
-
|
|
184
|
-
<style scoped>
|
|
185
|
-
.p-panel {
|
|
186
|
-
@apply m-2;
|
|
187
|
-
}
|
|
188
|
-
/* .tenant-link:hover div {
|
|
189
|
-
@apply bg-gray-300;
|
|
190
|
-
} */
|
|
191
|
-
</style>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<NuxtPage />
|
|
3
|
-
</template>
|
|
4
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
4
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
5
|
+
* last change 2023-10-28
|
|
6
|
+
* Author: Ks Tan
|
|
7
|
+
*/
|
|
5
8
|
definePageMeta({
|
|
6
9
|
name: "Login",
|
|
7
10
|
auth: false,
|
|
@@ -19,3 +22,6 @@ onMounted(async () => {
|
|
|
19
22
|
await signIn("keycloak", { callbackUrl: callbackUrl });
|
|
20
23
|
});
|
|
21
24
|
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<NuxtPage />
|
|
27
|
+
</template>
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
// import { Tailwind } from 'primevue/passthrough/tailwind';
|
|
2
|
-
import Tailwind from "primevue/passthrough/tailwind";
|
|
3
|
-
|
|
4
|
-
// const Base64URL = require('@darkwolf/base64url');
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
|
-
* This file was automatically generated by simpleapp generator
|
|
8
|
-
*
|
|
9
|
-
* last change 2023-
|
|
10
|
-
*
|
|
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
|
|
11
6
|
*/
|
|
12
7
|
import { defineNuxtPlugin } from "#app";
|
|
13
8
|
import axios, { Axios, AxiosResponse } from 'axios'
|
|
14
|
-
import PrimeVue from "primevue/config";
|
|
9
|
+
// import PrimeVue from "primevue/config";
|
|
15
10
|
import mitt from 'mitt'
|
|
16
|
-
import ToastService from 'primevue/toastservice';
|
|
17
|
-
import ConfirmationService from 'primevue/confirmationservice';
|
|
18
|
-
import Tooltip from 'primevue/tooltip';
|
|
11
|
+
// import ToastService from 'primevue/toastservice';
|
|
12
|
+
// import ConfirmationService from 'primevue/confirmationservice';
|
|
13
|
+
// import Tooltip from 'primevue/tooltip';
|
|
19
14
|
const emitter = mitt()
|
|
20
15
|
|
|
21
16
|
export default defineNuxtPlugin( async(nuxtApp) => {
|
|
@@ -34,12 +29,14 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
34
29
|
return Promise.reject(error)
|
|
35
30
|
}
|
|
36
31
|
});
|
|
37
|
-
|
|
38
|
-
nuxtApp.vueApp
|
|
39
|
-
.use(
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
|
|
32
|
+
|
|
33
|
+
// nuxtApp.vueApp.use(PrimeVue, { ripple: true,Tailwind:true, pt: Tailwind});
|
|
34
|
+
// nuxtApp.vueApp.use(PrimeVue, { unstyled: true, pt: {} });
|
|
35
|
+
// nuxtApp.vueApp
|
|
36
|
+
// .use(ToastService)
|
|
37
|
+
// .use(ConfirmationService)
|
|
38
|
+
// .directive('tooltip', Tooltip)
|
|
39
|
+
// ;
|
|
43
40
|
|
|
44
41
|
|
|
45
42
|
return {
|