@simitgroup/simpleapp-generator 1.6.2-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/README.md +6 -5
- package/dist/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +1 -2
- 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/index.js +4 -1
- package/dist/index.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 -2
- 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/index.ts +8 -3
- 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 +3 -6
- package/templates/basic/nuxt/pages.landing.vue.eta +2 -21
- 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/docnogenerator.service.ts.eta +36 -30
- 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 +128 -14
- 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/{app.vue._eta → app.vue.eta} +3 -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 +49 -7
- 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 +17 -14
- 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 +62 -22
- 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/ListDocument.vue.eta +10 -5
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +21 -13
- package/templates/nuxt/components/list/ListMessages.vue.eta +1 -1
- package/templates/nuxt/components/list/ListView.vue.eta +94 -56
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +11 -4
- package/templates/nuxt/components/overlay/OverlaySideBarCrud.vue.eta +17 -6
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +16 -6
- package/templates/nuxt/components/page/PageDocList.vue.eta +108 -31
- 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 +76 -38
- package/templates/nuxt/components/session/SessionBlock.vue.eta +44 -46
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +61 -24
- package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +64 -0
- package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +26 -14
- 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 +128 -33
- 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/confirm.generate.ts.eta +19 -0
- package/templates/nuxt/composables/date.generate.ts.eta +106 -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 +54 -1
- package/templates/nuxt/composables/sysmessage.generate.ts.eta +1 -1
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +1 -1
- package/templates/nuxt/pages/[xorg]/mobile/docnoformat/{index.vue.eta → index.vue.etaxxx} +1 -1
- package/templates/nuxt/pages/[xorg]/mobile/user/{index.vue.eta → index.vue.etaxxx} +1 -1
- package/templates/nuxt/pages/[xorg]/{organization.vue.eta → organization.vue._eta} +39 -10
- package/templates/nuxt/pages/[xorg]/profile.vue.eta +1 -1
- package/templates/nuxt/pages/[xorg]/user.vue.eta +13 -10
- package/templates/nuxt/pages/login.vue._eta +4 -1
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +4 -0
- 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 +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta.vue +0 -38
- /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
|
@@ -1,55 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</template>
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
/**
|
|
2
|
+
<Dialog
|
|
3
|
+
v-model:visible="showDialog"
|
|
4
|
+
modal
|
|
5
|
+
:pt="{ root: { class: 'w-1/3' } }"
|
|
6
|
+
:header="t('sessionExpire')"
|
|
7
|
+
>
|
|
8
|
+
<div>
|
|
9
|
+
{{ t("reloginMessage") }}
|
|
10
|
+
</div>
|
|
11
|
+
<div class="text-right">
|
|
12
|
+
<Button @click="relogin" class="btn-primary">
|
|
13
|
+
{{ t("login") }}
|
|
14
|
+
</Button>
|
|
15
|
+
</div>
|
|
16
|
+
</Dialog>
|
|
17
|
+
</template>
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
/**
|
|
23
20
|
* This file was automatically generated by simpleapp generator. Every
|
|
24
21
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
25
22
|
* last change 2023-10-28
|
|
26
23
|
* Author: Ks Tan
|
|
27
24
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const result = await getApiSession()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
showDialog.value=
|
|
25
|
+
import { PROFILEApi } from "~/simpleapp/generate/openapi";
|
|
26
|
+
const showDialog = ref(false);
|
|
27
|
+
const tabvisible = ref("");
|
|
28
|
+
|
|
29
|
+
addEventListener("visibilitychange", async (event) => {
|
|
30
|
+
tabvisible.value = document.visibilityState;
|
|
31
|
+
|
|
32
|
+
if (document.visibilityState === "visible") {
|
|
33
|
+
//focus tab, try session still active?
|
|
34
|
+
try{
|
|
35
|
+
const result = await getApiSession();
|
|
36
|
+
console.log("get sessionresult ",result)
|
|
37
|
+
if (result) {
|
|
38
|
+
|
|
39
|
+
showDialog.value = false;
|
|
40
|
+
} else {
|
|
41
|
+
showDialog.value = true;
|
|
43
42
|
}
|
|
43
|
+
}catch(e){
|
|
44
|
+
showDialog.value = true;
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const relogin= ()=>{
|
|
49
|
-
window.open(useRuntimeConfig().public.APP_URL+'/relogin')
|
|
46
|
+
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const relogin = () => {
|
|
51
|
+
window.open(useRuntimeConfig().public.APP_URL + "/relogin");
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="readonly"
|
|
4
|
+
class="p-2 border rounded-lg border-gray-300 dark:border-blue-900/40"
|
|
5
|
+
>
|
|
6
|
+
<button
|
|
7
|
+
:readonly="readonly"
|
|
8
|
+
class="cursor-pointer text-primary-600 dark:text-primary-400"
|
|
9
|
+
tabindex="0"
|
|
10
|
+
@click="openViewer(true)"
|
|
11
|
+
>
|
|
12
|
+
{{ modelValue && modelValue.label ? modelValue.label : "-" }}
|
|
13
|
+
</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
v-else-if="modelValue !== undefined"
|
|
17
|
+
class="p-2 border rounded-lg border-gray-300 dark:border-blue-900/40 relative"
|
|
18
|
+
>
|
|
19
|
+
<button
|
|
20
|
+
ref="autocompleteinput"
|
|
21
|
+
readonly
|
|
22
|
+
class="cursor-pointer text-primary-600 dark:text-primary-400"
|
|
23
|
+
@click="openViewer(true)"
|
|
24
|
+
>
|
|
25
|
+
{{ modelValue && modelValue.label ? modelValue.label : "-" }}
|
|
26
|
+
</button>
|
|
27
|
+
|
|
3
28
|
<div
|
|
4
|
-
class="absolute h-full top-0 right-
|
|
29
|
+
class="absolute h-full top-0 right-0 text-right text-white z-10 align-middle p-3"
|
|
30
|
+
>
|
|
31
|
+
<button
|
|
32
|
+
class="pi pi-times rounded-full bg-slate-500 p-1 cursor-pointer text-xs"
|
|
33
|
+
@click="clear"
|
|
34
|
+
tabindex="0"
|
|
35
|
+
></button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div v-else class="relative">
|
|
39
|
+
<div
|
|
40
|
+
class="absolute h-full top-0 right-10 text-right text-white z-10 align-middle p-3"
|
|
5
41
|
v-if="modelValue?._id"
|
|
6
42
|
>
|
|
7
43
|
<span
|
|
@@ -13,7 +49,7 @@
|
|
|
13
49
|
<AutoComplete
|
|
14
50
|
v-if="!isMobile()"
|
|
15
51
|
class="w-full"
|
|
16
|
-
v-model="
|
|
52
|
+
v-model="autocompleteitem"
|
|
17
53
|
ref="autocompleteinput"
|
|
18
54
|
forceSelection
|
|
19
55
|
optionLabel="label"
|
|
@@ -24,20 +60,27 @@
|
|
|
24
60
|
:dropdown="true"
|
|
25
61
|
@clear="clear"
|
|
26
62
|
:dropdown-mode="'current'"
|
|
63
|
+
:readonly="readonly"
|
|
27
64
|
:pt="pt"
|
|
28
65
|
:delay="500"
|
|
29
66
|
:disabled="readonly"
|
|
67
|
+
@click="clickAutocomplete"
|
|
30
68
|
:suggestions="list"
|
|
31
69
|
@blur="onBlurAutocomplete"
|
|
32
70
|
:inputId="inputId"
|
|
33
71
|
:path="setting.instancepath"
|
|
34
|
-
:readonly="readonly"
|
|
35
72
|
>
|
|
36
73
|
<template #header>
|
|
37
74
|
<slot name="header">
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
|
|
75
|
+
<div
|
|
76
|
+
class="flex flex-row font font-semibold text-sm dark:text-white gap-2 p-2"
|
|
77
|
+
>
|
|
78
|
+
<div class="w w-1/3 line-clamp-1">
|
|
79
|
+
{{ t(codefield) ?? t("code") }}
|
|
80
|
+
</div>
|
|
81
|
+
<div class="w w-2/3 line-clamp-1">
|
|
82
|
+
{{ t(labelfield) ?? t("label") }}
|
|
83
|
+
</div>
|
|
41
84
|
</div>
|
|
42
85
|
</slot>
|
|
43
86
|
</template>
|
|
@@ -46,9 +89,9 @@
|
|
|
46
89
|
</template>
|
|
47
90
|
<template #option="{ index, option }">
|
|
48
91
|
<slot name="option" :index="index" :option="option">
|
|
49
|
-
<div class="flex flex-row text-white">
|
|
50
|
-
<div class="w w-1/3">{{ option.code }}</div>
|
|
51
|
-
<div class="w w-2/3">{{ option.label }}</div>
|
|
92
|
+
<div class="flex flex-row dark:text-white text-sm gap-2">
|
|
93
|
+
<div class="w w-1/3 line-clamp-1">{{ option.code }}</div>
|
|
94
|
+
<div class="w w-2/3 line-clamp-1">{{ option.label }}</div>
|
|
52
95
|
</div>
|
|
53
96
|
</slot>
|
|
54
97
|
</template>
|
|
@@ -91,7 +134,7 @@
|
|
|
91
134
|
<i class="pi pi-plus"></i>
|
|
92
135
|
</ButtonText> -->
|
|
93
136
|
</template>
|
|
94
|
-
</mobile-toolbar>
|
|
137
|
+
</mobile-toolbar>
|
|
95
138
|
<ListView
|
|
96
139
|
:list="list"
|
|
97
140
|
:withFilter="true"
|
|
@@ -124,18 +167,6 @@
|
|
|
124
167
|
</OverlaySideBarCrud>
|
|
125
168
|
</div>
|
|
126
169
|
</div>
|
|
127
|
-
<div
|
|
128
|
-
v-else
|
|
129
|
-
class="p-3 border rounded-lg border-gray-300 dark:border-blue-900/40"
|
|
130
|
-
>
|
|
131
|
-
<span
|
|
132
|
-
:readonly="readonly"
|
|
133
|
-
class="cursor-pointer text-primary-600 dark:text-primary-400"
|
|
134
|
-
tabindex="0"
|
|
135
|
-
@click="openViewer(true)"
|
|
136
|
-
>{{ modelValue && modelValue.label ? modelValue.label : "-" }}</span
|
|
137
|
-
>
|
|
138
|
-
</div>
|
|
139
170
|
</template>
|
|
140
171
|
<script setup lang="ts">
|
|
141
172
|
/**
|
|
@@ -179,6 +210,7 @@ const props = withDefaults(
|
|
|
179
210
|
showNull: true,
|
|
180
211
|
},
|
|
181
212
|
);
|
|
213
|
+
|
|
182
214
|
const mobileListMode = ref("list");
|
|
183
215
|
const defaultFilterValue = ref("");
|
|
184
216
|
const path = "$" + props.setting.instancepath;
|
|
@@ -301,7 +333,7 @@ const setFocus = (ev: any) => {
|
|
|
301
333
|
const openViewer = (readonly: boolean) => {
|
|
302
334
|
if (remotedoc) {
|
|
303
335
|
$event("ViewRecord", {
|
|
304
|
-
_id: modelValue.value?._id as string,
|
|
336
|
+
_id: (modelValue.value?._id ?? '' )as string,
|
|
305
337
|
eventId: randomUUID(),
|
|
306
338
|
label: (readonly
|
|
307
339
|
? modelValue.value?.label
|
|
@@ -368,4 +400,9 @@ const afterRenderMobileForm = async (
|
|
|
368
400
|
mobileVisible.value = false;
|
|
369
401
|
}
|
|
370
402
|
};
|
|
403
|
+
|
|
404
|
+
const clickAutocomplete = (a, b) => {
|
|
405
|
+
console.log("clickAutocomplete", a, b);
|
|
406
|
+
return false;
|
|
407
|
+
};
|
|
371
408
|
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Calendar
|
|
3
|
+
:pt="pt"
|
|
4
|
+
:inputId="uuid"
|
|
5
|
+
:path="setting.instancepath"
|
|
6
|
+
v-model="datetimevalue"
|
|
7
|
+
@update:modelValue="updateDateTime"
|
|
8
|
+
showButtonBar
|
|
9
|
+
:readonly="readonly"
|
|
10
|
+
:placeholder="placeholder"
|
|
11
|
+
:showTime="showtime"
|
|
12
|
+
:timeOnly="timeOnly"
|
|
13
|
+
hourFormat="12"
|
|
14
|
+
v-bind="componentProps as CalendarProps"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
// :date-format="getDateFormat()"
|
|
19
|
+
import { CalendarProps } from 'primevue/calendar';
|
|
20
|
+
const props =defineProps<{
|
|
21
|
+
pt:any
|
|
22
|
+
uuid:string
|
|
23
|
+
placeholder?:string
|
|
24
|
+
setting: any;
|
|
25
|
+
readonly?: boolean;
|
|
26
|
+
componentProps?:CalendarProps
|
|
27
|
+
type: "date"|"time"|"datetime"
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const emits = defineEmits(['change'])
|
|
32
|
+
const showtime = props.type == 'date'? false : true
|
|
33
|
+
const timeOnly = props.type=='time'?true:false
|
|
34
|
+
const modelValue = defineModel<string>({ required: true });
|
|
35
|
+
const datetimevalue = ref<Date>();
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const refreshFromParent = ()=>{
|
|
39
|
+
if(modelValue.value === undefined || modelValue.value=='')
|
|
40
|
+
datetimevalue.value = undefined
|
|
41
|
+
else if(props.type=='time')
|
|
42
|
+
datetimevalue.value = stringToDate(('2000-01-01 '+modelValue.value??'00:00:00'))
|
|
43
|
+
else if(props.type=='date')
|
|
44
|
+
datetimevalue.value = stringToDate((modelValue.value)+'T00:00:00')
|
|
45
|
+
else
|
|
46
|
+
datetimevalue.value = stringToDate(modelValue.value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
watch(modelValue, () => refreshFromParent())
|
|
50
|
+
|
|
51
|
+
const updateDateTime = (value: any) => {
|
|
52
|
+
if (!value) modelValue.value = "";
|
|
53
|
+
else if(props.type=='datetime')modelValue.value = dateToISOString(value)
|
|
54
|
+
else if(props.type=='date')modelValue.value = dateToString(value)
|
|
55
|
+
else if(props.type=='time') modelValue.value = dateToTimeString(value)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
emits('change');
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
refreshFromParent()
|
|
64
|
+
</script>
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col">
|
|
3
3
|
<div class="flex flex-row gap-2">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</div>
|
|
4
|
+
<TextTitle v-if="title" class="flex-1">{{ title }}</TextTitle>
|
|
5
|
+
|
|
6
|
+
<div class="flex flex-row"><slot name="buttons"></slot></div>
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<ButtonDefault v-if="addNew" @click="addRow">
|
|
10
|
+
<i class="pi pi-plus"></i>
|
|
11
|
+
</ButtonDefault>
|
|
12
|
+
</div>
|
|
14
13
|
</div>
|
|
15
14
|
<ListView
|
|
16
15
|
class="p-2 dark:bg-slate-900 bg-slate-200 rounded-lg"
|
|
@@ -23,14 +22,15 @@
|
|
|
23
22
|
</slot>
|
|
24
23
|
</ListView>
|
|
25
24
|
|
|
26
|
-
<Dialog v-model:visible="showDialog"
|
|
25
|
+
<Dialog v-model:visible="showDialog"
|
|
26
|
+
modal :header="t('editDetails')" :pt="{root:{class:'w-1/2'}}">
|
|
27
27
|
<div class="flex flex-col p-2 gap-4">
|
|
28
28
|
<slot name="popupbody" :index="rowIndex" :item="list[rowIndex]">
|
|
29
29
|
row {{ rowIndex }} define SimpleAppInputs here
|
|
30
30
|
</slot>
|
|
31
31
|
</div>
|
|
32
32
|
<template #footer>
|
|
33
|
-
<div v-if="!
|
|
33
|
+
<div v-if="!readonly" class="flex flex-row gap-2 w-full">
|
|
34
34
|
<ButtonDanger @click="deleteItem">{{ t("delete") }}</ButtonDanger>
|
|
35
35
|
<ButtonPrimary @click="updateItem">{{ t("ok") }}</ButtonPrimary>
|
|
36
36
|
</div>
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
</template>
|
|
41
41
|
<script setup lang="ts" generic="T extends { [key: string]: any }">
|
|
42
|
+
import { SimpleAppClient } from "~/simpleapp/generate/clients/SimpleAppClient";
|
|
42
43
|
/**
|
|
43
44
|
* This file was automatically generated by simpleapp generator. Every
|
|
44
45
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
@@ -47,9 +48,20 @@
|
|
|
47
48
|
*/
|
|
48
49
|
const showDialog = ref(false);
|
|
49
50
|
const rowIndex = ref(0);
|
|
50
|
-
const emits = defineEmits(["addrow", "deleteitem", "itemupdated"]);
|
|
51
|
-
const props = defineProps<{ list: T[]; title?: string; readOnly?: boolean }>();
|
|
52
51
|
|
|
52
|
+
const emits = defineEmits(["addrow", "deleteitem", "itemupdated"]);
|
|
53
|
+
const props = defineProps<{
|
|
54
|
+
list: T[];
|
|
55
|
+
title?: string;
|
|
56
|
+
addNew?: boolean;
|
|
57
|
+
readonly?: boolean;
|
|
58
|
+
doc: SimpleAppClient<any, any>;
|
|
59
|
+
}>();
|
|
60
|
+
const readonly = computed(() => {
|
|
61
|
+
if (props.readonly) return true;
|
|
62
|
+
else if (props.doc.isReadOnly()) return true;
|
|
63
|
+
else return false;
|
|
64
|
+
});
|
|
53
65
|
const showRow = (index: number, item: T) => {
|
|
54
66
|
showDialog.value = true;
|
|
55
67
|
rowIndex.value = index;
|
|
@@ -9,28 +9,28 @@
|
|
|
9
9
|
:class="
|
|
10
10
|
!pt
|
|
11
11
|
? 'flex-1 w-full rounded-lg ' +
|
|
12
|
-
(props.readonly ? '' : 'rounded-tr-none rounded-br-none')
|
|
12
|
+
(props.readonly || !props.setting.document.isNew() ? '' : 'rounded-tr-none rounded-br-none')
|
|
13
13
|
: ''
|
|
14
14
|
"
|
|
15
15
|
/>
|
|
16
|
-
<span class="" v-if="!readonly">
|
|
17
|
-
<button
|
|
16
|
+
<span class="" v-if="!readonly && props.setting.document.isNew()">
|
|
17
|
+
<button
|
|
18
|
+
v-ripple
|
|
18
19
|
type="button"
|
|
19
20
|
@click="toggle"
|
|
20
21
|
tabindex="-1"
|
|
21
|
-
class="'btn
|
|
22
|
+
class="'btn bg-primary-500 dark:text-black text-white p-3 dark:border-blue-900/40 rounded-lg rounded-tl-none rounded-bl-none"
|
|
22
23
|
>
|
|
23
24
|
<i class="pi pi-angle-down"></i>
|
|
24
25
|
</button>
|
|
25
|
-
<OverlayPanel ref="op"
|
|
26
|
+
<OverlayPanel ref="op">
|
|
26
27
|
<div class="m-4">
|
|
27
28
|
<ul>
|
|
28
29
|
<li v-for="docno in docFormatlist" class="hover-list-primary p-2">
|
|
29
|
-
<
|
|
30
|
-
<span class="pi pi-hashtag mr-2"></span>
|
|
30
|
+
<div class="flex flex-row gap-2 cursor-pointer" @click="chooseFormat(docno)">
|
|
31
31
|
<span class="">{{ docno.docNoFormatName }}</span>
|
|
32
32
|
<span class="text text-green-600">{{ docno.sample }}</span>
|
|
33
|
-
</
|
|
33
|
+
</div>
|
|
34
34
|
</li>
|
|
35
35
|
</ul>
|
|
36
36
|
</div>
|