@simitgroup/simpleapp-generator 1.6.3-alpha → 1.6.4-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/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +1 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/changehistories.d.ts +3 -0
- package/dist/buildinschemas/changehistories.d.ts.map +1 -0
- package/dist/buildinschemas/changehistories.js +36 -0
- package/dist/buildinschemas/changehistories.js.map +1 -0
- package/dist/buildinschemas/index.d.ts +1 -0
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +3 -1
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/organization.js +2 -2
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +5 -1
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/buildinschemas/webhook.d.ts +3 -0
- package/dist/buildinschemas/webhook.d.ts.map +1 -0
- package/dist/buildinschemas/webhook.js +33 -0
- package/dist/buildinschemas/webhook.js.map +1 -0
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +3 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +30 -11
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +10 -2
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/type.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/branch.ts +1 -0
- package/src/buildinschemas/changehistories.ts +33 -0
- package/src/buildinschemas/index.ts +2 -1
- package/src/buildinschemas/organization.ts +2 -2
- package/src/buildinschemas/user.ts +5 -1
- package/src/buildinschemas/webhook.ts +31 -0
- package/src/framework.ts +3 -2
- package/src/generate.ts +35 -15
- package/src/processors/jsonschemabuilder.ts +10 -2
- package/src/type.ts +2 -0
- package/templates/basic/nest/controller.ts.eta +23 -2
- package/templates/basic/nest/model.ts.eta +9 -1
- package/templates/basic/nest/resolver.ts.eta +2 -2
- package/templates/basic/nuxt/pages.[id].vue.eta +7 -7
- package/templates/basic/nuxt/pages.form.vue.eta +1 -4
- package/templates/basic/nuxt/pages.landing.vue.eta +1 -20
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +8 -1
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +2 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +9 -2
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +5 -10
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.group.ts.eta +1 -0
- package/templates/nest/src/simpleapp/generate/commons/runwebhook.service.ts.eta +50 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +13 -3
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +9 -1
- package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +12 -6
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +120 -19
- package/templates/nest/src/simpleapp/generate/types/schema.type.ts.eta +3 -1
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +1 -0
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +19 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +30 -8
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +2 -1
- package/templates/nuxt/assets/css/calendar.css._eta +3 -0
- package/templates/nuxt/assets/css/style.css._eta +1 -1
- package/templates/nuxt/assets/images/unknown.png.eta +0 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +6 -1
- package/templates/nuxt/components/button/ButtonAction.vue._eta +40 -39
- package/templates/nuxt/components/button/ButtonDanger.vue._eta +11 -3
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +11 -3
- package/templates/nuxt/components/button/ButtonPrimary.vue._eta +9 -3
- package/templates/nuxt/components/button/ButtonSecondary.vue._eta +33 -0
- package/templates/nuxt/components/button/ButtonText.vue._eta +9 -5
- package/templates/nuxt/components/button/ButtonWarning.vue._eta +11 -3
- package/templates/nuxt/components/calendar/CalendarInput.vue.eta +4 -3
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +33 -16
- package/templates/nuxt/components/chart/card.vue._eta +1 -1
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +36 -26
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +36 -13
- package/templates/nuxt/components/form/FormBranch.vue._eta +52 -5
- package/templates/nuxt/components/form/FormDocnoformat.vue.eta +14 -10
- package/templates/nuxt/components/form/FormUser.vue._eta +1 -1
- package/templates/nuxt/components/form/user/FormUserPermission.vue.eta +77 -59
- package/templates/nuxt/components/header/HeaderSelectBranch.vue.eta +42 -35
- package/templates/nuxt/components/image/ImageAvatar.vue.eta._vue +30 -0
- package/templates/nuxt/components/image/ImageOrganization.vue.eta.vue +7 -5
- package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta.vue +67 -50
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +20 -12
- package/templates/nuxt/components/list/ListView.vue.eta +64 -35
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +5 -4
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +8 -8
- package/templates/nuxt/components/page/PageDocList.vue.eta +36 -13
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +8 -2
- package/templates/nuxt/components/renderer/RendererDateTime.vue.eta +7 -1
- package/templates/nuxt/components/renderer/RendererDocHistories.vue.eta +56 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +9 -8
- package/templates/nuxt/components/renderer/RendererLink.vue.eta +7 -4
- package/templates/nuxt/components/renderer/RendererMoney.vue.eta +25 -17
- package/templates/nuxt/components/renderer/RendererTime.vue.eta +7 -1
- package/templates/nuxt/components/renderer/RendererViewer.vue.eta +19 -9
- package/templates/nuxt/components/select/SelectTemplate.vue.eta +47 -21
- package/templates/nuxt/components/session/SessionBlock.vue.eta +44 -46
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +24 -15
- package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +64 -0
- package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +16 -8
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +8 -8
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +66 -22
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +89 -168
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +43 -40
- package/templates/nuxt/components/simpleApp/SimpleAppUserPicker.vue.eta +387 -0
- package/templates/nuxt/components/text/TextDocStatus.vue._eta +22 -0
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +13 -15
- package/templates/nuxt/components/user/UserButtonPermissionInfo.vue.eta +127 -93
- package/templates/nuxt/components/user/UserTenantPicker.vue.eta +1 -1
- package/templates/nuxt/composables/date.generate.ts.eta +105 -8
- package/templates/nuxt/composables/getDocument.generate.ts.eta +8 -6
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +58 -10
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +37 -5
- package/templates/nuxt/composables/goTo.generate.ts.eta +14 -1
- package/templates/nuxt/composables/graphquery.generate.ts.eta +20 -2
- package/templates/nuxt/composables/recently.generate.ts.eta +16 -0
- package/templates/nuxt/composables/roles.generate.ts.eta +8 -13
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +52 -0
- package/templates/nuxt/composables/sysmessage.generate.ts.eta +1 -1
- package/templates/nuxt/pages/[xorg]/{organization.vue.eta → organization.vue._eta} +38 -9
- package/templates/nuxt/pages/[xorg]/user.vue.eta +12 -9
- package/templates/nuxt/pages/login.vue._eta +4 -1
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +45 -26
- package/templates/nuxt/plugins/70.recently.ts.eta +55 -0
- package/templates/nuxt/providers/my-provider.ts.eta +22 -0
- package/templates/nuxt/server/api/[xorg]/{[...].ts.eta → [...].ts._eta} +47 -21
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +44 -3
- package/templates/nuxt/types/events.ts.eta +3 -2
- package/templates/nuxt/types/others.ts.eta +11 -1
- package/templates/nuxt/types/schema.ts.eta +3 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +1 -1
- package/templates/nuxt/types/user.ts.eta +8 -7
- package/templates/project/jsonschemas/branch.json._eta +1 -0
- package/templates/project/jsonschemas/invoice.json._eta +4 -3
- package/templates/project/jsonschemas/organization.json._eta +2 -2
- package/templates/project/lang/default._json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta.vue +0 -38
- /package/templates/nuxt/pages/[xorg]/mobile/docnoformat/{index.vue.eta → index.vue.etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/{index.vue._eta → index.vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/organization/{[id].vue._eta → [id].vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/{pickgroup.vue._eta → pickgroup.vue._etaxxx} +0 -0
- /package/templates/nuxt/pages/[xorg]/mobile/user/{index.vue.eta → index.vue.etaxxx} +0 -0
|
@@ -1,30 +1,50 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative">
|
|
3
|
+
<div v-if="header">
|
|
4
|
+
<slot name="header">
|
|
5
|
+
<TextMain class="text-gray-800 pl-2 pt-2">{{ header }}</TextMain>
|
|
6
|
+
</slot>
|
|
7
|
+
<hr class="mt-2" />
|
|
8
|
+
</div>
|
|
3
9
|
<div v-if="withFilter" class="flex flex-row p-2">
|
|
4
|
-
<InputGroup>
|
|
5
|
-
<InputGroupAddon
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<InputGroup :pt="{ root: { class: 'p-0' } }">
|
|
11
|
+
<InputGroupAddon
|
|
12
|
+
v-if="filter !== undefined && Object.keys(filter).length > 0"
|
|
13
|
+
:pt="{
|
|
14
|
+
root: {
|
|
15
|
+
class:
|
|
16
|
+
'p-0 pi pi-filter cursor-pointer bg-warning-400 text-white p-3',
|
|
17
|
+
},
|
|
18
|
+
}"
|
|
19
|
+
@click="showMoreFilter"
|
|
20
|
+
>
|
|
21
|
+
</InputGroupAddon>
|
|
22
|
+
<InputGroupAddon
|
|
23
|
+
v-else
|
|
24
|
+
:pt="{ root: { class: 'p-0 pi pi-filter cursor-pointer p-3' } }"
|
|
25
|
+
@click="showMoreFilter"
|
|
26
|
+
>
|
|
15
27
|
</InputGroupAddon>
|
|
16
28
|
<InputText
|
|
17
29
|
:placeholder="t('searchKeyword')"
|
|
18
30
|
v-model="searchvalue"
|
|
19
|
-
class="w-full dark:text-white text-sm"
|
|
20
31
|
type="search"
|
|
32
|
+
:pt="{ root: { class: 'p-1' } }"
|
|
21
33
|
ref="listviewfilter"
|
|
22
34
|
/>
|
|
23
|
-
<InputGroupAddon
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
<InputGroupAddon
|
|
36
|
+
:pt="{
|
|
37
|
+
root: {
|
|
38
|
+
class:
|
|
39
|
+
'p-0 cursor-pointer bg-primary-400 pi pi-plus p-3 text-white',
|
|
40
|
+
},
|
|
41
|
+
}"
|
|
42
|
+
v-if="withAddNew"
|
|
43
|
+
@click="emits('add')"
|
|
44
|
+
>
|
|
45
|
+
|
|
27
46
|
</InputGroupAddon>
|
|
47
|
+
<slot name="inputAddOn"></slot>
|
|
28
48
|
</InputGroup>
|
|
29
49
|
</div>
|
|
30
50
|
|
|
@@ -90,10 +110,14 @@
|
|
|
90
110
|
</div>
|
|
91
111
|
</div>
|
|
92
112
|
|
|
93
|
-
<Dialog
|
|
113
|
+
<Dialog
|
|
114
|
+
v-model:visible="visibleMoreFilter"
|
|
115
|
+
:header="t('filter')"
|
|
116
|
+
:pt="{ root: { class: 'w-1/3' } }"
|
|
117
|
+
>
|
|
94
118
|
<slot name="filter"> define filter in #filter </slot>
|
|
95
119
|
<template #footer>
|
|
96
|
-
<div class="flex flex-row">
|
|
120
|
+
<div class="flex flex-row gap-4">
|
|
97
121
|
<ButtonDefault @click="clearFilter" class="flex flex-row p-2">
|
|
98
122
|
<i class="pi pi-times mr-1" />
|
|
99
123
|
<span class="mr-1">{{ t("clear") }}</span>
|
|
@@ -123,11 +147,13 @@ const props = withDefaults(
|
|
|
123
147
|
defineProps<{
|
|
124
148
|
list: T[];
|
|
125
149
|
url?: string;
|
|
150
|
+
urlsuffix?: string;
|
|
151
|
+
header?: string;
|
|
126
152
|
titleField?: string;
|
|
127
153
|
idField?: string;
|
|
128
154
|
subTitleField?: string;
|
|
129
155
|
withFilter?: boolean;
|
|
130
|
-
filter?:
|
|
156
|
+
filter?: { [key: string]: any };
|
|
131
157
|
withAddNew?: boolean;
|
|
132
158
|
showIndex?: boolean;
|
|
133
159
|
showClickEffect?: boolean;
|
|
@@ -147,9 +173,14 @@ const clickRow = (item: ListItem) => {
|
|
|
147
173
|
// selecteditem.value = item.code
|
|
148
174
|
};
|
|
149
175
|
const getUrl = (item: any) => {
|
|
176
|
+
const urlsuffix =
|
|
177
|
+
props.urlsuffix === undefined || props.urlsuffix == ""
|
|
178
|
+
? ""
|
|
179
|
+
: "/" + props.urlsuffix;
|
|
150
180
|
if (props.url && props.idField) {
|
|
151
|
-
if (_.last(props.url) == "/")
|
|
152
|
-
|
|
181
|
+
if (_.last(props.url) == "/")
|
|
182
|
+
return `${props.url}${item[props.idField]}${urlsuffix}`;
|
|
183
|
+
else return `${props.url}/${item[props.idField]}${urlsuffix}`;
|
|
153
184
|
} else return undefined;
|
|
154
185
|
// :to="url ? `${url}/${item[idField]}` : undefined"
|
|
155
186
|
};
|
|
@@ -159,22 +190,20 @@ const filterlist = computed(() => {
|
|
|
159
190
|
return [];
|
|
160
191
|
}
|
|
161
192
|
if (props.list !== undefined) {
|
|
162
|
-
const searchstr = searchvalue.value.toLowerCase()
|
|
163
|
-
|
|
193
|
+
const searchstr = searchvalue.value.toLowerCase();
|
|
194
|
+
|
|
164
195
|
newlist = props.list.filter((item: T) => {
|
|
165
|
-
let res = false
|
|
166
|
-
if(searchstr.length==0) return true
|
|
167
|
-
if(props.titleField && item[props.titleField]){
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
196
|
+
let res = false;
|
|
197
|
+
if (searchstr.length == 0) return true;
|
|
198
|
+
if (props.titleField && item[props.titleField]) {
|
|
199
|
+
res = item[props.titleField].toLowerCase().includes(searchstr);
|
|
200
|
+
}
|
|
201
|
+
if (res) return true;
|
|
202
|
+
|
|
203
|
+
if (props.subTitleField && item[props.subTitleField])
|
|
204
|
+
res = item[props.subTitleField].toLowerCase().includes(searchstr);
|
|
205
|
+
if (res) return true;
|
|
172
206
|
|
|
173
|
-
if(props.subTitleField && item[props.subTitleField])
|
|
174
|
-
res = item[props.subTitleField].toLowerCase()
|
|
175
|
-
.includes(searchstr)
|
|
176
|
-
if(res) return true
|
|
177
|
-
|
|
178
207
|
return false;
|
|
179
208
|
});
|
|
180
209
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Sidebar
|
|
3
|
-
:position="position??'right'"
|
|
3
|
+
:position="position ?? 'right'"
|
|
4
4
|
v-if="showDialog"
|
|
5
5
|
v-model:visible="showDialog"
|
|
6
6
|
modal
|
|
7
7
|
:show-close-icon="false"
|
|
8
8
|
:dismissable="dismissable"
|
|
9
|
+
:pt="{root:{class:'w-2/3 border-0 border-l border-l-gray-500'}}"
|
|
9
10
|
#container
|
|
10
11
|
>
|
|
11
|
-
<div class="overflow-y-scroll
|
|
12
|
-
<MobileToolbar class="
|
|
12
|
+
<div class="overflow-y-scroll">
|
|
13
|
+
<MobileToolbar class="">
|
|
13
14
|
<template #start>
|
|
14
15
|
<slot name="headerLeft"></slot>
|
|
15
16
|
</template>
|
|
@@ -37,7 +38,7 @@ const showDialog = defineModel<boolean>({ required: true });
|
|
|
37
38
|
const props = defineProps<{
|
|
38
39
|
closeEventName: string;
|
|
39
40
|
dismissable?: boolean;
|
|
40
|
-
position?:
|
|
41
|
+
position?: "right" | "full" | "left" | "top" | "bottom" | undefined;
|
|
41
42
|
}>();
|
|
42
43
|
// const position = ref(props?.position ?? 'right')
|
|
43
44
|
useNuxtApp().$listen("CloseDialog", (closeEventName: string) => {
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
<Dialog
|
|
3
3
|
v-if="showDialog"
|
|
4
4
|
v-model:visible="showDialog"
|
|
5
|
-
|
|
6
5
|
maximizable
|
|
7
6
|
:dismissable="false"
|
|
8
7
|
:show-close-icon="false"
|
|
9
8
|
:closeOnEscape="false"
|
|
10
9
|
:modal="true"
|
|
11
|
-
:pt="{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
:pt="{
|
|
11
|
+
root: { class: 'w-11/12 border top-0' },
|
|
12
|
+
mask: {
|
|
13
|
+
style: 'backdrop-filter: blur(2px);background-color: red;',
|
|
14
|
+
},
|
|
15
|
+
}"
|
|
15
16
|
>
|
|
16
17
|
<template #header>
|
|
17
|
-
<slot name="header">{{t(title)}}</slot>
|
|
18
|
+
<slot name="header">{{ t(title) }}</slot>
|
|
18
19
|
</template>
|
|
19
|
-
<div class="overflow-y-scroll
|
|
20
|
+
<div class="overflow-y-scroll bodycolorclass">
|
|
20
21
|
<slot name="default"></slot>
|
|
21
22
|
</div>
|
|
22
23
|
</Dialog>
|
|
@@ -32,5 +33,4 @@ const showDialog = defineModel<boolean>({ required: true });
|
|
|
32
33
|
useNuxtApp().$listen("CloseDialog", (closeEventName: string) => {
|
|
33
34
|
if (closeEventName == "viewer") showDialog.value = false;
|
|
34
35
|
});
|
|
35
|
-
|
|
36
36
|
</script>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</div>
|
|
9
9
|
<div>
|
|
10
10
|
<ButtonText
|
|
11
|
+
v-if="allowAction('create')"
|
|
11
12
|
@click="goTo(doc.getDocName(), 'new')"
|
|
12
13
|
class="pi pi-plus"
|
|
13
14
|
></ButtonText>
|
|
@@ -36,12 +37,13 @@
|
|
|
36
37
|
>
|
|
37
38
|
<template #toolbar>
|
|
38
39
|
<div class="w-full text-left">
|
|
39
|
-
<ButtonPrimary
|
|
40
|
-
class="pi pi-plus"
|
|
40
|
+
<ButtonPrimary
|
|
41
41
|
@click="newData"
|
|
42
42
|
v-tooltip="t('new')"
|
|
43
|
-
v-if="canPerform(resourcename, 'create')"
|
|
44
|
-
|
|
43
|
+
v-if="allowAction('create') && canPerform(resourcename, 'create')"
|
|
44
|
+
>
|
|
45
|
+
<i class="pi pi-plus"></i>
|
|
46
|
+
</ButtonPrimary>
|
|
45
47
|
</div>
|
|
46
48
|
</template>
|
|
47
49
|
<template #default>
|
|
@@ -65,6 +67,14 @@
|
|
|
65
67
|
:fields="[col]"
|
|
66
68
|
>
|
|
67
69
|
</RendererLink>
|
|
70
|
+
<TextMain v-else-if="col == 'documentStatus'">{{
|
|
71
|
+
t(data[col])
|
|
72
|
+
}}</TextMain>
|
|
73
|
+
<RendererMoney
|
|
74
|
+
v-else-if="schemacols[col]['format'] == 'money'"
|
|
75
|
+
v-model="data[col]"
|
|
76
|
+
>
|
|
77
|
+
</RendererMoney>
|
|
68
78
|
<span v-else-if="typeof schemacols[col].enum != 'undefined'">
|
|
69
79
|
{{ t(data[col]) }}
|
|
70
80
|
</span>
|
|
@@ -78,6 +88,12 @@
|
|
|
78
88
|
>
|
|
79
89
|
{{ data[col]?.label ?? data[col]?.code ?? data[col] }}
|
|
80
90
|
</RendererForeignKey>
|
|
91
|
+
<span v-else-if="schemacols[col].format == 'date'">
|
|
92
|
+
<RendererDate v-model="data[col]" />
|
|
93
|
+
</span>
|
|
94
|
+
<span v-else-if="schemacols[col].format == 'datetime'">
|
|
95
|
+
<RendererDateTime v-model="data[col]" />
|
|
96
|
+
</span>
|
|
81
97
|
<span v-else-if="data[col]?.label !== undefined">{{
|
|
82
98
|
data[col].label
|
|
83
99
|
}}</span>
|
|
@@ -105,15 +121,15 @@
|
|
|
105
121
|
}}</TextTitle>
|
|
106
122
|
</template>
|
|
107
123
|
<template #headerRight>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
<i v-if="sidebarposition=='
|
|
124
|
+
<ButtonText
|
|
125
|
+
@click="
|
|
126
|
+
sidebarposition =
|
|
127
|
+
sidebarposition == 'right' ? (sidebarposition = 'full') : 'right'
|
|
128
|
+
"
|
|
129
|
+
>
|
|
130
|
+
<i v-if="sidebarposition == 'right'" class="pi pi-window-maximize" />
|
|
131
|
+
<i v-if="sidebarposition == 'full'" class="pi pi-window-minimize" />
|
|
115
132
|
</ButtonText>
|
|
116
|
-
|
|
117
133
|
</template>
|
|
118
134
|
|
|
119
135
|
<div class="p-2">
|
|
@@ -135,7 +151,7 @@ import { ref } from "vue";
|
|
|
135
151
|
import _ from "lodash";
|
|
136
152
|
import { SearchBody } from "~/types";
|
|
137
153
|
import { SimpleAppClient } from "~/simpleapp/generate/clients/SimpleAppClient";
|
|
138
|
-
const sidebarposition = ref(
|
|
154
|
+
const sidebarposition = ref("right");
|
|
139
155
|
const props = defineProps<{
|
|
140
156
|
document: SimpleAppClient<any, any>;
|
|
141
157
|
data: T;
|
|
@@ -143,6 +159,7 @@ const props = defineProps<{
|
|
|
143
159
|
columns: string[];
|
|
144
160
|
mobileColumns?: string[];
|
|
145
161
|
sorts?: string[][];
|
|
162
|
+
availableActions?:string[]
|
|
146
163
|
}>();
|
|
147
164
|
const maxcolumns = 16;
|
|
148
165
|
const emits = defineEmits(["selectRow"]);
|
|
@@ -164,6 +181,12 @@ const recordlist = ref<T[]>();
|
|
|
164
181
|
const uniqueKey = doc.getSchema()["x-simpleapp-config"].uniqueKey;
|
|
165
182
|
const documentTitle = doc.getSchema()["x-simpleapp-config"].documentTitle;
|
|
166
183
|
const schemacols = doc.getSchema().properties;
|
|
184
|
+
const allowAction = (actname:string)=>{
|
|
185
|
+
if(props.availableActions === undefined) return true
|
|
186
|
+
else if(Array.isArray(props.availableActions) && props.availableActions.length>0 && !props.availableActions.includes(actname))
|
|
187
|
+
return false
|
|
188
|
+
else return true
|
|
189
|
+
}
|
|
167
190
|
const getCssClass = (col: string) => {
|
|
168
191
|
if (schemacols[col]?.type == "number") return "text-right";
|
|
169
192
|
else if (schemacols[col]?.type == "boolean")
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span v-if="modelValue">
|
|
2
|
+
<span v-if="modelValue">
|
|
3
|
+
{{ dateRenderToDateStr(modelValue) }}
|
|
4
|
+
</span>
|
|
5
|
+
<span v-else-if="value">
|
|
6
|
+
{{ dateRenderToDateStr(value) }}
|
|
7
|
+
</span>
|
|
3
8
|
<span v-else>-</span>
|
|
4
9
|
</template>
|
|
5
10
|
<script lang="ts" setup>
|
|
@@ -9,5 +14,6 @@
|
|
|
9
14
|
* last change 2024-02-04
|
|
10
15
|
* author: Ks Tan
|
|
11
16
|
*/
|
|
12
|
-
const modelValue = defineModel<Date|string>()
|
|
17
|
+
const modelValue = defineModel<Date | string>();
|
|
18
|
+
const props = defineProps<{value:Date|string}>()
|
|
13
19
|
</script>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span v-if="modelValue">
|
|
2
|
+
<span v-if="modelValue">
|
|
3
|
+
{{ dateRenderToDateTimeStr(modelValue) }}
|
|
4
|
+
</span>
|
|
5
|
+
<span v-else-if="value">
|
|
6
|
+
{{ dateRenderToDateTimeStr(value) }}
|
|
7
|
+
</span>
|
|
3
8
|
<span v-else>-</span>
|
|
4
9
|
</template>
|
|
5
10
|
<script lang="ts" setup>
|
|
@@ -10,4 +15,5 @@
|
|
|
10
15
|
* author: Ks Tan
|
|
11
16
|
*/
|
|
12
17
|
const modelValue = defineModel<Date | string>();
|
|
18
|
+
const props = defineProps<{value:Date|string}>()
|
|
13
19
|
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-row text-xs cursor-pointer"
|
|
3
|
+
v-if="data?.updated && data?.updated !=''" @click="viewHistories">
|
|
4
|
+
<ImageAvatar v-if="data?.updatedBy" :id="data.updatedBy" :size="12"></ImageAvatar>
|
|
5
|
+
<div class="flex flex-col p-2">
|
|
6
|
+
<TextDocStatus v-if="data?.docStatus" :docStatus="data?.docStatus" />
|
|
7
|
+
<TextSubsubtitle class=" text-gray-400 italic">{{ t('updated') }}:</TextSubsubtitle>
|
|
8
|
+
<RendererDateTime :value="data?.updated" class="text-gray-400 italic"/>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<Dialog v-model:visible="visibleHistories" modal
|
|
13
|
+
:header="t('histories')" :pt="{root:{class:'w-1/4'}}">
|
|
14
|
+
<Timeline :value="events" class="w-full md:w-20rem">
|
|
15
|
+
<template #opposite="slotProps">
|
|
16
|
+
<RendererDateTime class="italic text-gray-400 text-xs" :value="slotProps.item.date"/>
|
|
17
|
+
</template>
|
|
18
|
+
<template #content="slotProps">
|
|
19
|
+
<div>
|
|
20
|
+
<div>{{ slotProps.item.status }}</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
</template>
|
|
24
|
+
</Timeline>
|
|
25
|
+
</Dialog>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
</template>
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import TextSubsubtitle from '../text/TextSubsubtitle.vue';
|
|
31
|
+
import RendererDateTime from './RendererDateTime.vue';
|
|
32
|
+
const visibleHistories = ref(false)
|
|
33
|
+
const props=defineProps<{data:any}>()
|
|
34
|
+
const events = computed(()=>{
|
|
35
|
+
const list = [{ status: t('created'), date: props.data.created },]
|
|
36
|
+
|
|
37
|
+
if(props.data.updated != props.data.created){
|
|
38
|
+
list.push({ status: t('paidFeature'), date:''})
|
|
39
|
+
list.push( { status: t('lastUpdate'), date: props.data.updated })
|
|
40
|
+
}
|
|
41
|
+
return list
|
|
42
|
+
})
|
|
43
|
+
const severity = computed(()=>{
|
|
44
|
+
const stat = props.data.docStatus
|
|
45
|
+
if(props.data.docStatus=='confirm') return "success"
|
|
46
|
+
else if(props.data.docStatus=='void') return "danger"
|
|
47
|
+
else if(props.data.docStatus=='draft') return "secondary"
|
|
48
|
+
else return "warning"
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const viewHistories = () =>{
|
|
53
|
+
visibleHistories.value=true
|
|
54
|
+
console.log("histories")
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -21,25 +21,26 @@ import { ForeignKey, FormCrudEvent, SimpleAppDocumentType } from "~/types";
|
|
|
21
21
|
|
|
22
22
|
type SettingProp = { collection: SimpleAppDocumentType; displayField?: string };
|
|
23
23
|
const modelValue = defineModel<ForeignKey>();
|
|
24
|
+
|
|
24
25
|
const emits = defineEmits(["after"]);
|
|
25
|
-
const props = defineProps<{
|
|
26
|
+
const props = defineProps<{value?:ForeignKey; setting: SettingProp }>();
|
|
26
27
|
const displayText = computed(() => {
|
|
27
28
|
const s = props.setting;
|
|
28
|
-
if (!modelValue.value) return undefined;
|
|
29
|
-
else if (!s.collection) return modelValue.value;
|
|
30
|
-
else if (s.displayField) return modelValue.value[s.displayField];
|
|
31
|
-
else return modelValue.value.label;
|
|
29
|
+
if (!modelValue.value && !props.value) return undefined;
|
|
30
|
+
else if (!s.collection) return modelValue.value??props.value;
|
|
31
|
+
else if (s.displayField) return modelValue.value[s.displayField] ??props.value[s.displayField];
|
|
32
|
+
else return modelValue.value?.label ??props.value?.label;
|
|
32
33
|
});
|
|
33
34
|
const { $event } = useNuxtApp();
|
|
34
35
|
const viewer = ref();
|
|
35
36
|
const viewRecord = () => {
|
|
36
37
|
viewer.value = getDocument(props.setting.collection)?.viewer;
|
|
37
|
-
|
|
38
|
+
const value = modelValue.value?? props.value
|
|
38
39
|
// getDocumentUrl(setting.collection,modelValue ? modelValue['_id']:'')
|
|
39
40
|
//getDocumentUrl(setting.collection,modelValue ? modelValue['_id']:'')
|
|
40
41
|
$event("ViewRecord", {
|
|
41
|
-
_id:
|
|
42
|
-
label:
|
|
42
|
+
_id: value?._id as string,
|
|
43
|
+
label: value?.label as string,
|
|
43
44
|
eventId: randomUUID(),
|
|
44
45
|
documentName: props.setting.collection,
|
|
45
46
|
viewer: viewer.value,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a
|
|
2
|
+
<a
|
|
3
|
+
@click="go"
|
|
4
|
+
class="text-primary-700 dark:text-primary-300 dark:hover:text-primary-200 hover:text-primary-500 cursor-pointer"
|
|
5
|
+
>
|
|
3
6
|
<slot name="default">
|
|
4
|
-
<div>{{ value[fields[0]] }}</div>
|
|
7
|
+
<div>{{ value[fields[0]] ?? t('undefined') }}</div>
|
|
5
8
|
</slot>
|
|
6
9
|
</a>
|
|
7
10
|
</template>
|
|
@@ -20,6 +23,6 @@ const props = defineProps<{
|
|
|
20
23
|
}>();
|
|
21
24
|
|
|
22
25
|
const go = () => {
|
|
23
|
-
goTo(props.setting.path, props.value._id);
|
|
26
|
+
goTo(props.setting.path, props.value._id);
|
|
24
27
|
};
|
|
25
|
-
</script>
|
|
28
|
+
</script>
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
|
|
3
|
+
<span>
|
|
4
|
+
<span class="mr-1" v-if="showCurrency">{{ getCurrency() }}</span>
|
|
5
|
+
<span v-if="typeof modelValue != 'undefined'">{{
|
|
6
|
+
modelValue.toLocaleString(useI18n().defaultLocale, options)
|
|
7
|
+
}}</span>
|
|
8
|
+
<span v-else-if="typeof props.value != 'undefined'">{{
|
|
9
|
+
props.value.toLocaleString(useI18n().defaultLocale, options)
|
|
10
|
+
}}</span>
|
|
11
|
+
<span v-else>-</span>
|
|
12
|
+
</span>
|
|
9
13
|
</template>
|
|
10
14
|
<script lang="ts" setup>
|
|
11
15
|
/**
|
|
@@ -14,20 +18,24 @@
|
|
|
14
18
|
* last change 2024-02-04
|
|
15
19
|
* author: Ks Tan
|
|
16
20
|
*/
|
|
17
|
-
const currenyValue = computed(() => {
|
|
18
|
-
if (modelValue.value === undefined) return "-";
|
|
19
|
-
return Intl.NumberFormat(useI18n().defaultLocale, {
|
|
20
|
-
// style: "currency",
|
|
21
|
-
// currency: getUserProfile()?.currency ?? '',
|
|
22
|
-
// currencyDisplay: "symbol",
|
|
23
|
-
}).format(modelValue.value);
|
|
24
|
-
});
|
|
25
21
|
const options = {
|
|
26
22
|
style: "decimal", // Other options: 'currency', 'percent', etc.
|
|
27
23
|
minimumFractionDigits: 2,
|
|
28
24
|
maximumFractionDigits: 2,
|
|
29
25
|
};
|
|
30
|
-
const modelValue = defineModel<number>(
|
|
31
|
-
const props = defineProps<{ showCurrency?: boolean }>();
|
|
26
|
+
const modelValue = defineModel<number>();
|
|
27
|
+
const props = defineProps<{ showCurrency?: boolean ; value?:number }>();
|
|
28
|
+
|
|
29
|
+
const currenyValue = computed(() => {
|
|
30
|
+
if (typeof modelValue.value == 'number'){
|
|
31
|
+
return Intl.NumberFormat(useI18n().defaultLocale,
|
|
32
|
+
{}).format(modelValue.value);
|
|
33
|
+
}else if(typeof props.value == 'number'){
|
|
34
|
+
return Intl.NumberFormat(useI18n().defaultLocale,{}).format(props.value);
|
|
35
|
+
}else return '-'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
});
|
|
39
|
+
|
|
32
40
|
|
|
33
41
|
</script>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span v-if="modelValue">
|
|
2
|
+
<span v-if="modelValue">
|
|
3
|
+
{{ dateRenderToTimeStr(modelValue) }}
|
|
4
|
+
</span>
|
|
5
|
+
<span v-else-if="value">
|
|
6
|
+
{{ dateRenderToTimeStr(value) }}
|
|
7
|
+
</span>
|
|
3
8
|
<span v-else>-</span>
|
|
4
9
|
</template>
|
|
5
10
|
<script lang="ts" setup>
|
|
@@ -10,4 +15,5 @@
|
|
|
10
15
|
* author: Ks Tan
|
|
11
16
|
*/
|
|
12
17
|
const modelValue = defineModel<Date | string>();
|
|
18
|
+
const props = defineProps<{ value: Date | string }>();
|
|
13
19
|
</script>
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div v-if="!value"></div>
|
|
3
|
+
<a v-else
|
|
3
4
|
@click="openViewer"
|
|
4
5
|
class="text-primary-700 dark:text-primary-400 hover:text-primary-500 cursor-pointer"
|
|
5
6
|
>
|
|
6
7
|
<slot name="default">
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
<TextDanger v-if="!value">{{t('undefined')}}</TextDanger>
|
|
10
|
+
<TextDanger v-else-if="!Array.isArray(fields) || !fields[0]">{{t('undefinedFields')}}</TextDanger>
|
|
11
|
+
<div v-else-if="value[fields[0]]">{{ value[fields[0]] }}</div>
|
|
12
|
+
<div v-else></div>
|
|
8
13
|
</slot>
|
|
9
|
-
</a>
|
|
14
|
+
</a>
|
|
10
15
|
</template>
|
|
11
16
|
<script setup lang="ts">
|
|
12
17
|
/**
|
|
@@ -21,18 +26,23 @@ const props = defineProps<{
|
|
|
21
26
|
setting: RendererSetting;
|
|
22
27
|
value: any;
|
|
23
28
|
}>();
|
|
24
|
-
|
|
29
|
+
const viewervalue = computed(()=>{
|
|
30
|
+
return props.value ?? {}
|
|
31
|
+
})
|
|
25
32
|
const openViewer = () => {
|
|
26
33
|
useNuxtApp().$event("ViewRecord", {
|
|
27
34
|
_id: props.value._id,
|
|
28
35
|
documentName: props.setting.documentName,
|
|
29
36
|
viewer: getDocument(props.setting.documentName)?.viewer,
|
|
30
|
-
label:
|
|
37
|
+
label:
|
|
38
|
+
props.fields !== undefined
|
|
39
|
+
? props.value[props.fields[0]]
|
|
40
|
+
: props.setting.documentName,
|
|
31
41
|
document: getDocument(props.setting.documentName)?.docClass,
|
|
32
|
-
eventId: randomUUID(),
|
|
33
|
-
after:()=>{
|
|
34
|
-
useNuxtApp().$event(
|
|
35
|
-
}
|
|
42
|
+
eventId: randomUUID(),
|
|
43
|
+
after: () => {
|
|
44
|
+
useNuxtApp().$event("CloseDialog", props.setting.documentName);
|
|
45
|
+
},
|
|
36
46
|
});
|
|
37
47
|
};
|
|
38
48
|
</script>
|