@simitgroup/simpleapp-generator 1.3.4-alpha → 1.4.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildinschemas/permission.d.ts.map +1 -1
- package/dist/buildinschemas/permission.js +10 -6
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +22 -2
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/generate.js +20 -6
- package/dist/generate.js.map +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/permission.ts +10 -6
- package/src/buildinschemas/user.ts +23 -3
- package/src/generate.ts +19 -6
- package/src/type.ts +3 -1
- package/templates/basic/nest/controller.ts.eta +1 -1
- package/templates/basic/nest/service.ts.eta +7 -3
- package/templates/basic/nuxt/pages.[id].vue.eta +4 -4
- package/templates/basic/nuxt/pages.mobile.[id].vue.eta +39 -0
- package/templates/basic/nuxt/pages.mobile.landing.vue.eta +69 -0
- package/templates/nest/.gitignore.eta +6 -1
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +29 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +22 -12
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +26 -1
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +5 -7
- package/templates/nest/src/simpleapp/services/user.service.ts.eta.old +118 -0
- package/templates/nest/src/simpleapp/types/index.ts._eta +8 -0
- package/templates/nuxt/app.vue._eta +31 -17
- package/templates/nuxt/assets/css/style.css._eta +4 -4
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +10 -4
- package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +181 -163
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +8 -6
- package/templates/nuxt/components/form/FormDocnoformat.vue.eta +174 -0
- package/templates/nuxt/components/form/FormUser.vue._eta +91 -0
- package/templates/nuxt/components/form/user/FormUserPermission.vue.eta +83 -0
- package/templates/nuxt/components/header/HeaderBar.vue._eta +43 -39
- package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue._eta +46 -38
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +9 -9
- package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +12 -8
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +1 -1
- package/templates/nuxt/components/page/PageDocList.vue.eta +6 -4
- package/templates/nuxt/components/renderer/RendererDateTime.vue.eta +13 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +6 -3
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +3 -4
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +20 -7
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +2 -5
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +56 -12
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +2 -6
- package/templates/nuxt/composables/date.generate.ts.eta +3 -1
- package/templates/nuxt/composables/goTo.generate.ts.eta +4 -1
- package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +13 -2
- package/templates/nuxt/layouts/mobile.vue._eta +26 -12
- package/templates/nuxt/nuxt.config.ts._eta +27 -20
- package/templates/nuxt/pages/[xorg]/{user/index.vue.eta → docnoformat/[id].vue.eta} +11 -9
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +51 -20
- package/templates/nuxt/pages/[xorg]/mobile/docnoformat/index.vue.eta +59 -0
- package/templates/nuxt/pages/[xorg]/mobile/index.vue._eta +19 -0
- package/templates/nuxt/pages/[xorg]/mobile/organization/index.vue.eta +138 -0
- package/templates/nuxt/pages/[xorg]/mobile/pickgroup.vue._eta +35 -0
- package/templates/nuxt/pages/[xorg]/mobile/user/index.vue.eta +231 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +80 -61
- package/templates/nuxt/pages/[xorg]/pickgroup.vue._eta +35 -0
- package/templates/nuxt/pages/[xorg]/user.vue.eta +91 -74
- package/templates/nuxt/pages/profile.vue.eta +7 -7
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +14 -3
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +18 -16
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +1 -1
- package/templates/nuxt/types/events.ts.eta +1 -0
- package/templates/nuxt/types/simpleappinput.ts.eta +3 -2
- package/templates/nuxt/types/user.ts.eta +2 -1
- package/templates/project/lang/default._json +150 -67
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nest/src/simpleapp/services/user.service.ts.etax +0 -66
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/[id].vue.eta +0 -13
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +0 -229
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +0 -38
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +0 -11
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +0 -39
- package/templates/nuxt/pages/[xorg]/user/form.vue.eta +0 -334
- package/templates/nuxt/pages/[xorg]/user/new.vue.eta +0 -18
- package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +0 -29
|
@@ -1,72 +1,79 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<div
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
<div class="w-full flex flex-col p-3">
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<div><TextTitle>{{ t('user') }}</TextTitle></div>
|
|
6
|
+
<div class="flex flex-row w-full ">
|
|
7
|
+
<title>{{ t("user") }}</title>
|
|
8
|
+
|
|
9
|
+
<div class="w-full md:w-1/2 xl:w-1/3">
|
|
10
|
+
<TabView>
|
|
11
|
+
<TabPanel header="Active">
|
|
12
|
+
<ul role="list" class="divide-y divide-gray-100">
|
|
13
|
+
<li v-for="item in userlist" :key="item.email">
|
|
14
|
+
<NuxtLink
|
|
15
|
+
v-if="item.uid && item.active"
|
|
16
|
+
:to="getDocumentUrl('user', item._id)"
|
|
17
|
+
>
|
|
18
|
+
<UserProfileListItem :data="item"></UserProfileListItem>
|
|
19
|
+
</NuxtLink>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</TabPanel>
|
|
23
|
+
<TabPanel header="Inactive">
|
|
24
|
+
<ul role="list" class="divide-y divide-gray-100">
|
|
25
|
+
<li v-for="item in userlist" :key="item.email">
|
|
26
|
+
<NuxtLink
|
|
27
|
+
v-if="item.uid && !item.active"
|
|
28
|
+
:to="getDocumentUrl('user', item._id)"
|
|
29
|
+
>
|
|
30
|
+
<UserProfileListItem :data="item"></UserProfileListItem>
|
|
31
|
+
</NuxtLink>
|
|
32
|
+
</li>
|
|
33
|
+
</ul>
|
|
34
|
+
</TabPanel>
|
|
35
|
+
<TabPanel header="Invite">
|
|
36
|
+
<div class="padding p-2">
|
|
37
|
+
<form @submit.prevent="true" class="w-full">
|
|
38
|
+
<div class="p-inputgroup flex flex-row">
|
|
39
|
+
<InputText
|
|
40
|
+
class="flex-1"
|
|
41
|
+
type="email"
|
|
42
|
+
placeholder="email"
|
|
43
|
+
v-model="inviteemail"
|
|
44
|
+
/>
|
|
45
|
+
<div class="p-inputgroup-addon p p-0">
|
|
46
|
+
<button
|
|
47
|
+
label="Search"
|
|
48
|
+
class="border rounded-tl-none rounded-bl-none btn btn-primary -ml-1 h-full p-3 rounded-r-md"
|
|
49
|
+
@click="invite"
|
|
50
|
+
>
|
|
51
|
+
Invite
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
51
54
|
</div>
|
|
52
|
-
</
|
|
53
|
-
</
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
</form>
|
|
56
|
+
</div>
|
|
57
|
+
<ul role="list" class="divide-y divide-gray-100">
|
|
58
|
+
<li v-for="item in userlist" :key="item.email">
|
|
59
|
+
<NuxtLink v-if="!item.uid" :to="getDocumentUrl('user', item._id)">
|
|
60
|
+
<UserProfileListItem :data="item"></UserProfileListItem>
|
|
61
|
+
</NuxtLink>
|
|
62
|
+
</li>
|
|
63
|
+
</ul>
|
|
64
|
+
</TabPanel>
|
|
65
|
+
</TabView>
|
|
66
|
+
</div>
|
|
67
|
+
<div v-if="!isMobile()" class="flex-1">
|
|
68
|
+
<NuxtPage :_id="userid" />
|
|
69
|
+
</div>
|
|
70
|
+
<OverlaySideBarCrud
|
|
71
|
+
v-if="dialogvisible"
|
|
72
|
+
v-model="dialogvisible"
|
|
73
|
+
closeEventName="user"
|
|
74
|
+
>
|
|
75
|
+
<NuxtPage :_id="userid" />
|
|
76
|
+
</OverlaySideBarCrud>
|
|
70
77
|
</div>
|
|
71
78
|
</div>
|
|
72
79
|
</template>
|
|
@@ -81,7 +88,7 @@
|
|
|
81
88
|
// import userchild from './userchild.vue'
|
|
82
89
|
import Menu from "primevue/menu";
|
|
83
90
|
import Dialog from "primevue/dialog";
|
|
84
|
-
import { SearchBody, EventType,UserProfile } from "~/types";
|
|
91
|
+
import { SearchBody, EventType, UserProfile } from "~/types";
|
|
85
92
|
import _ from "lodash";
|
|
86
93
|
import Panel from "primevue/panel";
|
|
87
94
|
import { ref } from "vue";
|
|
@@ -99,7 +106,7 @@ import TabView from "primevue/tabview";
|
|
|
99
106
|
import TabPanel from "primevue/tabpanel";
|
|
100
107
|
import { Permission, User } from "~/simpleapp/generate/openapi/api";
|
|
101
108
|
import BlockUI from "primevue/blockui";
|
|
102
|
-
|
|
109
|
+
const dialogvisible = ref(false);
|
|
103
110
|
//initialize api
|
|
104
111
|
const {
|
|
105
112
|
$listen,
|
|
@@ -134,10 +141,9 @@ const activeuser = ref("");
|
|
|
134
141
|
const showpermissioninfo = ref(false);
|
|
135
142
|
const permissionselected = ref();
|
|
136
143
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
144
|
+
const selectUser = (user: any) => {
|
|
145
|
+
// goTo('user',user._id)
|
|
146
|
+
};
|
|
141
147
|
|
|
142
148
|
/**
|
|
143
149
|
* 1. get all users from this tenant
|
|
@@ -201,11 +207,22 @@ const invite = async () => {
|
|
|
201
207
|
// onSelectUser(invitedata);
|
|
202
208
|
};
|
|
203
209
|
|
|
204
|
-
|
|
210
|
+
const showDialogIfNeeded = () => {
|
|
211
|
+
if (isMobile()) {
|
|
212
|
+
if (userid.value != "") dialogvisible.value = true;
|
|
213
|
+
else dialogvisible.value = false;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
watch(
|
|
217
|
+
() => useRoute().path,
|
|
218
|
+
() => showDialogIfNeeded(),
|
|
219
|
+
);
|
|
220
|
+
$listen("RefreshDocumentList", async () => {
|
|
205
221
|
await refreshList();
|
|
206
222
|
});
|
|
207
223
|
onMounted(async () => {
|
|
208
224
|
await refreshList();
|
|
225
|
+
showDialogIfNeeded();
|
|
209
226
|
});
|
|
210
227
|
|
|
211
228
|
definePageMeta({
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
<dt
|
|
28
28
|
class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400"
|
|
29
29
|
>
|
|
30
|
-
{{ t("
|
|
30
|
+
{{ t("groups") }}
|
|
31
31
|
</dt>
|
|
32
32
|
<dd
|
|
33
33
|
class="mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300 sm:col-span-2 sm:mt-0"
|
|
34
34
|
>
|
|
35
|
-
{{ getUserProfile()
|
|
35
|
+
{{ getUserProfile()?.groups }}
|
|
36
36
|
</dd>
|
|
37
37
|
</div>
|
|
38
38
|
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
|
@@ -88,7 +88,6 @@
|
|
|
88
88
|
</ul>
|
|
89
89
|
</dd>
|
|
90
90
|
</div>
|
|
91
|
-
|
|
92
91
|
|
|
93
92
|
<div
|
|
94
93
|
v-if="useRuntimeConfig().public.DEBUGDATA == '1'"
|
|
@@ -105,14 +104,15 @@
|
|
|
105
104
|
class="mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300 sm:col-span-2 sm:mt-0"
|
|
106
105
|
>
|
|
107
106
|
<div>
|
|
108
|
-
<p>{{t(
|
|
107
|
+
<p>{{ t("accessRights") }}</p>
|
|
109
108
|
{{ getUserProfile().roles }}
|
|
110
109
|
</div>
|
|
111
110
|
<div>
|
|
112
|
-
<p>{{ t(
|
|
113
|
-
{{ getUserProfile()?.country }} /
|
|
111
|
+
<p>{{ t("others") }}</p>
|
|
112
|
+
{{ getUserProfile()?.country }} /
|
|
113
|
+
{{ getUserProfile()?.currency }} /
|
|
114
|
+
{{ getUserProfile()?.offsetMinute }}
|
|
114
115
|
</div>
|
|
115
|
-
|
|
116
116
|
</dd>
|
|
117
117
|
</div>
|
|
118
118
|
</dl>
|
|
@@ -9,6 +9,7 @@ import {PROFILEApi} from '../simpleapp/generate/openapi'
|
|
|
9
9
|
import {UserProfile} from '~/types'
|
|
10
10
|
import axios, { Axios, AxiosResponse } from 'axios'
|
|
11
11
|
import _ from 'lodash'
|
|
12
|
+
import { group } from "console";
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
export default defineNuxtPlugin( async(nuxtApp) => {
|
|
@@ -33,7 +34,8 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
33
34
|
email: ref(''),
|
|
34
35
|
fullName: ref(''),
|
|
35
36
|
roles:ref<string[]>([]),
|
|
36
|
-
|
|
37
|
+
groups:ref<string[]>([]),
|
|
38
|
+
currentGroup:ref(''),
|
|
37
39
|
branches:ref([]),
|
|
38
40
|
invites : ref([]),
|
|
39
41
|
time:ref(''),
|
|
@@ -78,11 +80,19 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
78
80
|
this.email = res.data.email
|
|
79
81
|
this.fullName = res.data.fullName
|
|
80
82
|
this.branches = res.data.branches
|
|
81
|
-
this.
|
|
83
|
+
this.groups = res.data.groups
|
|
82
84
|
this.roles = res.data.roles
|
|
83
85
|
this.time = res.data.time
|
|
84
86
|
this.invites = res.data.invites
|
|
85
87
|
this.moreProps = res.data.moreProps
|
|
88
|
+
|
|
89
|
+
let cachegroup = useCookie('currentGroup').value ?? ''
|
|
90
|
+
if(!this.groups || !this.groups.includes(cachegroup)){
|
|
91
|
+
cachegroup=''
|
|
92
|
+
}
|
|
93
|
+
this.currentGroup = cachegroup
|
|
94
|
+
useNuxtApp().$event('pickGroup',cachegroup)
|
|
95
|
+
|
|
86
96
|
return Promise.resolve(true)
|
|
87
97
|
// return true
|
|
88
98
|
}).catch((err:any)=>{
|
|
@@ -183,7 +193,8 @@ export default defineNuxtPlugin( async(nuxtApp) => {
|
|
|
183
193
|
branches:this.branches??[],
|
|
184
194
|
invites: this.invites ?? [],
|
|
185
195
|
roles:this.roles,
|
|
186
|
-
|
|
196
|
+
groups:this.groups,
|
|
197
|
+
currentGroup:this.currentGroup,
|
|
187
198
|
time:this.time,
|
|
188
199
|
moreProps: this.moreProps
|
|
189
200
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-
|
|
4
|
+
* last change 2024-03-08
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
7
|
import Ajv from 'ajv';
|
|
@@ -28,7 +28,7 @@ export class SimpleAppClient<
|
|
|
28
28
|
TData extends { _id?: string,created?:string },
|
|
29
29
|
TApi extends crudType,
|
|
30
30
|
> {
|
|
31
|
-
protected defaultTimeOut=5000
|
|
31
|
+
// protected defaultTimeOut=5000
|
|
32
32
|
protected docapi;
|
|
33
33
|
public event:Function|null=null;
|
|
34
34
|
public listen:Function|null=null;
|
|
@@ -38,11 +38,13 @@ export class SimpleAppClient<
|
|
|
38
38
|
protected docname = '';
|
|
39
39
|
protected errorlist = ref({});
|
|
40
40
|
protected completeformula = true;
|
|
41
|
+
protected axios ;
|
|
41
42
|
|
|
42
43
|
constructor(apiobj: TApi,doctype:string,docname:string) {
|
|
43
44
|
this.docapi = apiobj;
|
|
44
45
|
this.doctype=doctype
|
|
45
46
|
this.docname = docname
|
|
47
|
+
this.axios = useNuxtApp().$axios
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
getDocType = () => this.doctype;
|
|
@@ -63,7 +65,7 @@ export class SimpleAppClient<
|
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
async getById(id?: string) {
|
|
66
|
-
return await this.docapi.runFindOne(id,
|
|
68
|
+
return await this.docapi.runFindOne(id,this.axios)
|
|
67
69
|
.then((res: AxiosResponse) => {
|
|
68
70
|
// if(this.event){this.event('info:getById',res.data)}
|
|
69
71
|
Object.assign(this.data.value, res.data);
|
|
@@ -88,7 +90,7 @@ export class SimpleAppClient<
|
|
|
88
90
|
return await Promise.reject(errors);
|
|
89
91
|
} else {
|
|
90
92
|
return await this.docapi
|
|
91
|
-
.runCreate(this.data.value,
|
|
93
|
+
.runCreate(this.data.value,this.axios)
|
|
92
94
|
.then((res: AxiosResponse) => {
|
|
93
95
|
// if(this.event){this.event('success:create',res.data);return res.data}
|
|
94
96
|
// console.log(this.getDocName(), "ok")
|
|
@@ -104,9 +106,9 @@ export class SimpleAppClient<
|
|
|
104
106
|
documentName:this.getDocName(),
|
|
105
107
|
summary:'Record create failed',
|
|
106
108
|
status:NotificationStatus.error,
|
|
107
|
-
data:errors.response.data
|
|
109
|
+
data:errors.response.data
|
|
108
110
|
})
|
|
109
|
-
console.error('error:create',errors.response.data
|
|
111
|
+
console.error('error:create',errors.response.data)
|
|
110
112
|
return Promise.reject(errors)
|
|
111
113
|
});
|
|
112
114
|
}
|
|
@@ -128,7 +130,7 @@ export class SimpleAppClient<
|
|
|
128
130
|
return await Promise.reject(errors);
|
|
129
131
|
} else {
|
|
130
132
|
return await this.docapi
|
|
131
|
-
.runUpdate(recordid, this.data.value,
|
|
133
|
+
.runUpdate(recordid, this.data.value,this.axios)
|
|
132
134
|
.then((res: AxiosResponse) => {
|
|
133
135
|
// if(this.event){this.event('success:update',res.data)}
|
|
134
136
|
// $event('Notification',{
|
|
@@ -144,12 +146,12 @@ export class SimpleAppClient<
|
|
|
144
146
|
documentName:this.getDocName(),
|
|
145
147
|
summary:'Record update failed',
|
|
146
148
|
status:NotificationStatus.error,
|
|
147
|
-
data:errors.response.data
|
|
149
|
+
data:errors.response.data
|
|
148
150
|
})
|
|
149
151
|
// console.error('error:update---',errors,",---",errors.message)
|
|
150
152
|
// if(this.event){
|
|
151
153
|
// this.event('error:update',errors.response.data.data)}
|
|
152
|
-
console.error('error:update',errors.response.data
|
|
154
|
+
console.error('error:update',errors.response.data)
|
|
153
155
|
return Promise.reject(errors)
|
|
154
156
|
});
|
|
155
157
|
}
|
|
@@ -159,7 +161,7 @@ export class SimpleAppClient<
|
|
|
159
161
|
const {$event} =useNuxtApp()
|
|
160
162
|
const recordid: string = this.data.value._id ?? '';
|
|
161
163
|
return await this.docapi
|
|
162
|
-
.runPatch(recordid, this.data.value,
|
|
164
|
+
.runPatch(recordid, this.data.value,this.axios)
|
|
163
165
|
.then((res: AxiosResponse) => {
|
|
164
166
|
// if(this.event){this.event('success:update',res.data)}
|
|
165
167
|
// $event('Notification',{
|
|
@@ -175,12 +177,12 @@ export class SimpleAppClient<
|
|
|
175
177
|
documentName:this.getDocName(),
|
|
176
178
|
summary:'Record patch failed',
|
|
177
179
|
status:NotificationStatus.error,
|
|
178
|
-
data:errors.response.data
|
|
180
|
+
data:errors.response.data
|
|
179
181
|
})
|
|
180
182
|
// console.error('error:update---',errors,",---",errors.message)
|
|
181
183
|
// if(this.event){
|
|
182
184
|
// this.event('error:update',errors.response.data.data)}
|
|
183
|
-
console.error('error:patch',errors.response.data
|
|
185
|
+
console.error('error:patch',errors.response.data)
|
|
184
186
|
return Promise.reject(errors)
|
|
185
187
|
|
|
186
188
|
})
|
|
@@ -190,7 +192,7 @@ export class SimpleAppClient<
|
|
|
190
192
|
id = this.data.value._id ?? ''
|
|
191
193
|
}
|
|
192
194
|
const {$event} =useNuxtApp()
|
|
193
|
-
return await this.docapi.runDelete(id,
|
|
195
|
+
return await this.docapi.runDelete(id,this.axios)
|
|
194
196
|
.then((res:AxiosResponse)=>{
|
|
195
197
|
// if(this.event){this.event('success:delete',res.data)}
|
|
196
198
|
// $event('Notification',{
|
|
@@ -206,14 +208,14 @@ export class SimpleAppClient<
|
|
|
206
208
|
documentName:this.getDocName(),
|
|
207
209
|
summary:'Record delete failed',
|
|
208
210
|
status:NotificationStatus.error,
|
|
209
|
-
data:errors.response.data
|
|
211
|
+
data:errors.response.data
|
|
210
212
|
})
|
|
211
|
-
console.error(errors.response.data
|
|
213
|
+
console.error(errors.response.data)
|
|
212
214
|
return Promise.reject(errors)
|
|
213
215
|
});
|
|
214
216
|
}
|
|
215
217
|
async search(searchbody:SearchBody) {
|
|
216
|
-
return await this.docapi.runSearch(searchbody,
|
|
218
|
+
return await this.docapi.runSearch(searchbody,this.axios)
|
|
217
219
|
.then((res:AxiosResponse)=>{
|
|
218
220
|
// if(this.event){this.event('info:listready',res.data);}
|
|
219
221
|
return res.data
|
|
@@ -14,7 +14,7 @@ export const getAllDocuments=():DocumentMetaData[] => [
|
|
|
14
14
|
<% const conf = d.schema["x-simpleapp-config"] %>
|
|
15
15
|
{docName:'<%= d['docname'].toLowerCase() %>',docType:'<%= d['doctype'].toUpperCase()%>',page: '<%=d['pagetype']%>', isolationType:'<%=conf['isolationType']%>',
|
|
16
16
|
documentDate:'<%=conf['documentDate']??""%>', docNumber:<%=conf['generateDocumentNumber']??false%>,
|
|
17
|
-
|
|
17
|
+
viewer: () => import('~/components/viewer/Viewer<%=d['docname']%>.vue'),
|
|
18
18
|
docClass: useNuxtApp().$<%=d['docname']%>Doc()},
|
|
19
19
|
<%}%>
|
|
20
20
|
]
|
|
@@ -11,7 +11,7 @@ export enum SimpleAppInputType {
|
|
|
11
11
|
'date'='date',
|
|
12
12
|
'time'='time',
|
|
13
13
|
'calendar'='calendar',
|
|
14
|
-
|
|
14
|
+
'datetime'='datetime',
|
|
15
15
|
|
|
16
16
|
'autocomplete'='autocomplete',
|
|
17
17
|
'autocompletemultiple'='autocompletemultiple',
|
|
@@ -66,4 +66,5 @@ export type FormMenu = {
|
|
|
66
66
|
command? : Function
|
|
67
67
|
event?:FormCrudEvent
|
|
68
68
|
[key:string] : any
|
|
69
|
-
}
|
|
69
|
+
}
|
|
70
|
+
|