@simitgroup/simpleapp-generator 1.3.3-alpha → 1.3.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/framework.js +2 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +7 -11
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +8 -0
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/framework.ts +2 -2
- package/src/generate.ts +15 -12
- package/src/processors/jsonschemabuilder.ts +12 -1
- package/templates/basic/nest/controller.ts.eta +16 -5
- package/templates/basic/nuxt/component.select.vue.eta +35 -0
- package/templates/basic/nuxt/pages.form.vue.eta +5 -8
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +3 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +10 -9
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +2 -2
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +38 -38
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +14 -9
- package/templates/nuxt/assets/css/style.css._eta +39 -3
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +17 -12
- package/templates/nuxt/components/button/ButtonAction.vue._eta +19 -0
- package/templates/nuxt/components/button/ButtonDanger.vue._eta +13 -6
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +13 -6
- package/templates/nuxt/components/button/ButtonMultiple.vue._eta +9 -7
- package/templates/nuxt/components/button/ButtonPrimary.vue._eta +13 -6
- package/templates/nuxt/components/button/ButtonText.vue._eta +16 -7
- package/templates/nuxt/components/button/ButtonWarning.vue._eta +13 -6
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +83 -69
- package/templates/nuxt/components/chart/card.vue._eta +32 -0
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +44 -21
- package/templates/nuxt/components/event/EventNotification.vue._eta +119 -107
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +129 -75
- package/templates/nuxt/components/list/ListView.vue.eta +44 -13
- package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +6 -5
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +35 -37
- package/templates/nuxt/components/overlay/OverlaySideBarCrud.vue.eta +3 -4
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +3 -2
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +38 -34
- package/templates/nuxt/components/select/SelectTemplate.vue.eta +79 -0
- package/templates/nuxt/components/select/readme.md +1 -0
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +181 -35
- package/templates/nuxt/components/simpleApp/SimpleAppChildrenList.vue.eta +70 -0
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +77 -73
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +113 -111
- package/templates/nuxt/components/simpleApp/{SimpleAppFormToolBar.vue.eta → SimpleAppFormToolBar.vue._eta} +125 -61
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +116 -42
- package/templates/nuxt/components/text/TextPrimary.vue._eta +13 -0
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +68 -0
- package/templates/nuxt/components/user/UserTenantPicker.vue.eta +81 -70
- package/templates/nuxt/composables/date.generate.ts.eta +2 -0
- package/templates/nuxt/composables/getDocument.generate.ts.eta +35 -2
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +5 -1
- package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +2 -1
- package/templates/nuxt/lang/en.ts.eta +3 -1
- package/templates/nuxt/nuxt.config.ts._eta +3 -0
- package/templates/nuxt/pages/index.vue._eta +10 -56
- package/templates/nuxt/pages/picktenant.vue._eta +19 -0
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +10 -2
- package/templates/nuxt/server/api/[xorg]/[...].ts.eta +9 -10
- package/templates/nuxt/types/calendar.ts.eta +2 -0
- package/templates/nuxt/types/events.ts.eta +3 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +1 -0
- package/templates/project/lang/default._json +5 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue.eta +0 -103
|
@@ -1,80 +1,94 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<vue-cal
|
|
3
|
+
:id="id"
|
|
4
|
+
class="w-full"
|
|
5
|
+
hide-view-selector
|
|
6
|
+
click-to-navigate
|
|
7
|
+
:time="false"
|
|
8
|
+
today-button
|
|
9
|
+
active-view="month"
|
|
10
|
+
:disable-views="['week', 'day']"
|
|
11
|
+
:selected-date="selectedDate"
|
|
12
|
+
events-count-on-year-view
|
|
13
|
+
@view-change="viewChange"
|
|
14
|
+
:events="allevents"
|
|
15
|
+
@cell-focus="chooseDate"
|
|
16
|
+
xsmall
|
|
17
|
+
>
|
|
18
|
+
<template #today-button>
|
|
19
|
+
<!-- Using Vuetify (but we prefer Wave UI 🤘) -->
|
|
20
|
+
<div @click="chooseDate(new Date(), true)">{{ t("today") }}</div>
|
|
21
|
+
</template>
|
|
22
|
+
<template #cell-content="{ cell, events }">
|
|
23
|
+
<div @contextmenu="(mouseevent) => onRightclickDate(mouseevent, cell)">
|
|
24
|
+
<div>
|
|
25
|
+
<s
|
|
26
|
+
v-if="dateExists(new Date(cell.formattedDate), alloffdays)"
|
|
27
|
+
v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
28
|
+
class="text text-red-400 font-bold"
|
|
29
|
+
>{{ cell.content }}</s
|
|
30
|
+
>
|
|
31
|
+
<span v-else>{{ cell.content }} </span>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<slot name="default" :cell="cell" events="events">
|
|
35
|
+
<Badge
|
|
36
|
+
v-if="events.length > 0"
|
|
37
|
+
@contextmenu="(mouseevent) => onRightClickDate(mouseevent, cell)"
|
|
38
|
+
severity="info"
|
|
39
|
+
:value="events.length"
|
|
40
|
+
/>
|
|
41
|
+
</slot>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</vue-cal>
|
|
40
46
|
</template>
|
|
41
47
|
<script lang="ts" setup generic="T">
|
|
42
48
|
/**
|
|
43
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
49
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
44
50
|
* IT IS NOT CHANGABLE
|
|
45
51
|
* last change 2024-02-22
|
|
46
52
|
* author: Ks Tan
|
|
47
53
|
*/
|
|
48
54
|
import VueCal, { Event, SplitDaysAttributes } from "vue-cal";
|
|
49
|
-
import {
|
|
50
|
-
|
|
55
|
+
import {
|
|
56
|
+
CalEventType,
|
|
57
|
+
CalRightClickEvent,
|
|
58
|
+
OffDay,
|
|
59
|
+
CalViewChange,
|
|
60
|
+
} from "~/types";
|
|
61
|
+
const viewStatus = ref<CalViewChange>();
|
|
51
62
|
const props = defineProps<{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}>()
|
|
56
|
-
const emits =
|
|
57
|
-
const alloffdays = computed(()=> props.offdays.map(item=>item.date))
|
|
58
|
-
const selectedDate = defineModel<Date>({required:true})
|
|
59
|
-
const getHolidayName = (date:Date) =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
id: string;
|
|
64
|
+
items: CalEventType<T>[];
|
|
65
|
+
offdays: OffDay[];
|
|
66
|
+
}>();
|
|
67
|
+
const emits = defineEmits(["chooseDate", "rightClick"]);
|
|
68
|
+
const alloffdays = computed(() => props.offdays.map((item) => item.date));
|
|
69
|
+
const selectedDate = defineModel<Date>({ required: true });
|
|
70
|
+
const getHolidayName = (date: Date) =>
|
|
71
|
+
props.offdays.find((item) => item.date.getTime() == date.getTime())?.title;
|
|
72
|
+
const allevents = computed(() => {
|
|
73
|
+
const list = props.items.map((item) => {
|
|
74
|
+
if (item.start instanceof Date)
|
|
75
|
+
item.start = item.start.format("YYYY-MM-DD HH:mm");
|
|
76
|
+
if (item.end instanceof Date)
|
|
77
|
+
item.end = item.end.format("YYYY-MM-DD HH:mm");
|
|
78
|
+
return item;
|
|
79
|
+
});
|
|
80
|
+
return list;
|
|
81
|
+
});
|
|
82
|
+
const viewChange = (event: CalViewChange) => {
|
|
83
|
+
viewStatus.value = event;
|
|
71
84
|
};
|
|
72
|
-
const chooseDate = (date1: Date) => {
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
const chooseDate = (date1: Date, force?: boolean) => {
|
|
86
|
+
if (force || !viewStatus.value || viewStatus.value.view == "month") {
|
|
87
|
+
selectedDate.value = date1;
|
|
88
|
+
emits("chooseDate", date1);
|
|
89
|
+
}
|
|
75
90
|
};
|
|
76
|
-
const onRightClickDate=(e: MouseEvent,cell:CalRightClickEvent)=>{
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
</script>
|
|
91
|
+
const onRightClickDate = (e: MouseEvent, cell: CalRightClickEvent) => {
|
|
92
|
+
emits("rightClick", e, cell);
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template >
|
|
2
|
+
<div class="rounded-lg h-20 p-2" @click="showCartDialog">
|
|
3
|
+
<div class="line-clamp-1 text-sm md:text-base">{{ title }}</div>
|
|
4
|
+
<div class="text text-2xl md:text-3xl text-right">
|
|
5
|
+
<slot name="default"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
<Dialog v-model:visible="dialogVisiable" modal :header="title">
|
|
8
|
+
<slot name="dialogbody">
|
|
9
|
+
define {{title}} body
|
|
10
|
+
</slot>
|
|
11
|
+
</Dialog>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
/**
|
|
17
|
+
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
18
|
+
* --remove-this-line-to-prevent-override--
|
|
19
|
+
* last change 2024-03-02
|
|
20
|
+
* author: Ks Tan
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const props = defineProps<{
|
|
24
|
+
title:string,
|
|
25
|
+
showDialog?:boolean
|
|
26
|
+
}>()
|
|
27
|
+
const dialogVisiable = ref(false)
|
|
28
|
+
const showCartDialog = () =>{
|
|
29
|
+
console.log("showCartDialogshowCartDialog")
|
|
30
|
+
if(props.showDialog) dialogVisiable.value=true
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<OverlayViewer v-model="visible"
|
|
1
|
+
<template>
|
|
2
|
+
<OverlayViewer v-model="visible">
|
|
3
3
|
<!-- <template #header>
|
|
4
4
|
|
|
5
5
|
</template> -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<Chip
|
|
6
|
+
<div class="w-full h-full">
|
|
7
|
+
<!-- <div class="flex flex-row gap-4" v-if="allview.length>0">
|
|
8
|
+
<Chip
|
|
9
9
|
v-for="(v, k) in allview"
|
|
10
10
|
:label="v.label"
|
|
11
11
|
@remove="deleteTab"
|
|
12
12
|
:removable="true"
|
|
13
13
|
/>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
</div> -->
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
v-for="(v, k) in allview"
|
|
18
|
+
v-memo="[k]"
|
|
19
|
+
class="viewer-item flex flex-col"
|
|
20
|
+
>
|
|
21
|
+
<div>
|
|
21
22
|
<component
|
|
22
23
|
:is="defineAsyncComponent(v.viewer)"
|
|
23
24
|
:_id="v._id"
|
|
@@ -30,10 +31,11 @@
|
|
|
30
31
|
/>
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
34
|
+
</div>
|
|
33
35
|
</OverlayViewer>
|
|
34
36
|
</template>
|
|
35
37
|
<script setup lang="ts">
|
|
36
|
-
|
|
38
|
+
/*
|
|
37
39
|
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
38
40
|
* --remove-this-line-to-prevent-override--
|
|
39
41
|
* last change 2024-02-22
|
|
@@ -42,17 +44,22 @@
|
|
|
42
44
|
import { onKeyStroke } from "@vueuse/core";
|
|
43
45
|
import { useDialog } from "primevue/usedialog";
|
|
44
46
|
import { defineAsyncComponent } from "vue";
|
|
45
|
-
import { ViewRecord,FormCrudEvent } from "~/types";
|
|
47
|
+
import { ViewRecord, FormCrudEvent } from "~/types";
|
|
46
48
|
// import TabView from 'primevue/tabview';
|
|
47
49
|
import Chip from "primevue/chip";
|
|
48
50
|
|
|
49
51
|
const { $listen } = useNuxtApp();
|
|
50
|
-
const initDocumentName = ref('')
|
|
51
52
|
const visible = ref(false);
|
|
52
53
|
const allview = ref<{ [key: string]: ViewRecord }>({});
|
|
53
|
-
const after = (
|
|
54
|
+
const after = (
|
|
55
|
+
v: ViewRecord,
|
|
56
|
+
eventType: FormCrudEvent,
|
|
57
|
+
data: any,
|
|
58
|
+
result: any,
|
|
59
|
+
) => {
|
|
54
60
|
if (v.after) {
|
|
55
|
-
v.after(eventType, data
|
|
61
|
+
v.after(eventType, data);
|
|
62
|
+
|
|
56
63
|
//only after mount consider no remove tab
|
|
57
64
|
if (eventType != "mount") deleteTab();
|
|
58
65
|
}
|
|
@@ -67,20 +74,36 @@ const deleteTab = () => {
|
|
|
67
74
|
const keys = Object.keys(allview.value);
|
|
68
75
|
const lastkey = keys[keys.length - 1];
|
|
69
76
|
delete allview.value[lastkey];
|
|
70
|
-
|
|
77
|
+
|
|
71
78
|
// updateprops.value++
|
|
72
79
|
if (Object.keys(allview.value).length == 0) {
|
|
73
80
|
visible.value = false;
|
|
74
|
-
useNuxtApp().$event(
|
|
81
|
+
useNuxtApp().$event("CloseDialog", "viewer");
|
|
75
82
|
return;
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
85
|
|
|
79
|
-
$listen("ViewRecord", (setting) => {
|
|
80
|
-
if(initDocumentName.value=='') initDocumentName.value= setting.documentName
|
|
86
|
+
$listen("ViewRecord", (setting) => {
|
|
81
87
|
visible.value = true;
|
|
82
88
|
allview.value[setting.eventId] = setting;
|
|
83
89
|
});
|
|
90
|
+
|
|
91
|
+
$listen("CloseDialog", (documentName: string) => {
|
|
92
|
+
if (!documentName) return;
|
|
93
|
+
const keys = Object.keys(allview.value);
|
|
94
|
+
const lastkey = keys[keys.length - 1];
|
|
95
|
+
if (
|
|
96
|
+
allview.value[lastkey] &&
|
|
97
|
+
allview.value[lastkey].documentName == documentName
|
|
98
|
+
) {
|
|
99
|
+
deleteTab();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
// $listen('C' (setting) => {
|
|
103
|
+
// if(initDocumentName.value=='') initDocumentName.value= setting.documentName
|
|
104
|
+
// visible.value = true;
|
|
105
|
+
// allview.value[setting.eventId] = setting;
|
|
106
|
+
// });
|
|
84
107
|
</script>
|
|
85
108
|
|
|
86
109
|
<style scoped>
|
|
@@ -1,121 +1,133 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
3
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
4
|
* --remove-this-line-to-prevent-override--
|
|
5
|
-
* last change
|
|
5
|
+
* last change 2023-03-02
|
|
6
6
|
* author: Ks Tan
|
|
7
7
|
*/
|
|
8
|
-
import {Notification, NotificationStatus} from
|
|
8
|
+
import { Notification, NotificationStatus } from "~/types";
|
|
9
9
|
//import { useToast, } from 'primevue/usetoast';
|
|
10
|
-
import type {
|
|
11
|
-
import Toast from
|
|
12
|
-
import { stringify } from
|
|
13
|
-
import {upperFirst, last } from
|
|
14
|
-
|
|
10
|
+
import type { ToastMessageOptions } from "primevue/toast";
|
|
11
|
+
import Toast from "primevue/toast";
|
|
12
|
+
import { stringify } from "ajv";
|
|
13
|
+
import { upperFirst, last } from "lodash";
|
|
15
14
|
|
|
16
15
|
const toast = useToast();
|
|
17
|
-
const { $event
|
|
16
|
+
const { $event, $listen } = useNuxtApp();
|
|
18
17
|
// WildcardHandler<Record<EventType, unknown>>
|
|
19
|
-
let resmsg:ToastMessageOptions = {} as ToastMessageOptions
|
|
20
|
-
const eventdata=ref()
|
|
21
|
-
$listen("Notification",(data:Notification)=>{
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// if(isshow && severity){
|
|
79
|
-
// console.log("isshow",isshow,"event:",severity,eventdata)
|
|
80
|
-
toast.removeAllGroups()
|
|
81
|
-
resmsg = { severity: type as typeof resmsg['severity'], summary: data.summary, detail :data.data, life: duration, group:toastgroup}
|
|
82
|
-
toast.add(resmsg)
|
|
83
|
-
// }
|
|
84
|
-
// isshow=false
|
|
85
|
-
|
|
86
|
-
})
|
|
18
|
+
let resmsg: ToastMessageOptions = {} as ToastMessageOptions;
|
|
19
|
+
const eventdata = ref();
|
|
20
|
+
$listen("Notification", (data: Notification) => {
|
|
21
|
+
// $listen('*',(type:key of EventType,data:any)=>{
|
|
22
|
+
// mobile ui dont want to show notification
|
|
23
|
+
// if (isMobile()) return false;
|
|
24
|
+
eventdata.value = data;
|
|
25
|
+
const type: NotificationStatus = data.status;
|
|
26
|
+
// let arrupdate = type.split(':')
|
|
27
|
+
// let eventdata = data
|
|
28
|
+
let duration = 3000;
|
|
29
|
+
// let severity:typeof resmsg['severity']
|
|
30
|
+
// let isshow=true
|
|
31
|
+
let toastgroup = "default";
|
|
32
|
+
// let eventname = arrupdate[1]
|
|
33
|
+
// let eventtype = arrupdate[0]
|
|
34
|
+
// let title = ''
|
|
35
|
+
switch (type) {
|
|
36
|
+
case NotificationStatus.success:
|
|
37
|
+
duration = 3000;
|
|
38
|
+
break;
|
|
39
|
+
case NotificationStatus.error:
|
|
40
|
+
duration = 0;
|
|
41
|
+
break;
|
|
42
|
+
case NotificationStatus.warn:
|
|
43
|
+
duration = 5000;
|
|
44
|
+
break;
|
|
45
|
+
case NotificationStatus.info:
|
|
46
|
+
duration = 3000;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
// if(type=='error'){
|
|
50
|
+
// duration = 0
|
|
51
|
+
// severity='error'
|
|
52
|
+
// title=upperFirst(eventname) +' failed'
|
|
53
|
+
// }
|
|
54
|
+
// else if(type.indexOf('warn')>=0){
|
|
55
|
+
// duration = 10000
|
|
56
|
+
// severity='warn'
|
|
57
|
+
// title=upperFirst(eventname) +' with warning'
|
|
58
|
+
// }
|
|
59
|
+
// else if(type.indexOf('info')>=0){
|
|
60
|
+
// duration = 3000
|
|
61
|
+
// severity='info'
|
|
62
|
+
// isshow=false
|
|
63
|
+
// title='Info'
|
|
64
|
+
// }
|
|
65
|
+
// else if(type.indexOf('success')>=0){
|
|
66
|
+
// duration = 3000
|
|
67
|
+
// severity='success'
|
|
68
|
+
// title= upperFirst(eventname) +' successfully'
|
|
69
|
+
// }
|
|
70
|
+
// if(Array.isArray(data)){
|
|
71
|
+
// toastgroup='list'
|
|
72
|
+
// }else if(typeof data == 'object'){
|
|
73
|
+
// // title = camelCaseToWords(useCamelCase(title.replace(":","-")))
|
|
74
|
+
// eventdata = data.message
|
|
75
|
+
// }
|
|
87
76
|
|
|
77
|
+
// if(isshow && severity){
|
|
78
|
+
// console.log("isshow",isshow,"event:",severity,eventdata)
|
|
79
|
+
toast.removeAllGroups();
|
|
80
|
+
resmsg = {
|
|
81
|
+
severity: type as (typeof resmsg)["severity"],
|
|
82
|
+
summary: data.summary,
|
|
83
|
+
detail: data.data,
|
|
84
|
+
life: duration,
|
|
85
|
+
group: toastgroup,
|
|
86
|
+
};
|
|
87
|
+
toast.add(resmsg);
|
|
88
|
+
// }
|
|
89
|
+
// isshow=false
|
|
90
|
+
});
|
|
88
91
|
|
|
89
|
-
const getFieldName = (path:string)=>{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
92
|
+
const getFieldName = (path: string) => {
|
|
93
|
+
const lastword: string = last<string>(path.split("/")) ?? "";
|
|
94
|
+
return camelCaseToWords(lastword);
|
|
95
|
+
// const lastField = path.split
|
|
96
|
+
};
|
|
94
97
|
</script>
|
|
95
98
|
<template>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
<Toast group="default">
|
|
100
|
+
<template #message="p">
|
|
101
|
+
<div class="h-full w-full border">
|
|
102
|
+
<p class="text-lg text-red-800 font-semibold pb-1">
|
|
103
|
+
{{ p.message.summary }}
|
|
104
|
+
</p>
|
|
105
|
+
<div v-if="p.message.detail" class="flex flex-col gap-2">
|
|
106
|
+
<p
|
|
107
|
+
v-if="Array.isArray(p.message.detail)"
|
|
108
|
+
v-for="item in p.message.detail"
|
|
109
|
+
class="text-sm text-red-600 font-normal"
|
|
110
|
+
>
|
|
111
|
+
<span v-if="item.instancePath">{{ item.instancePath }} </span>
|
|
112
|
+
<span v-if="item.message"> {{ item.message }} </span>
|
|
113
|
+
</p>
|
|
114
|
+
<p
|
|
115
|
+
v-else-if="typeof p.message.detail == 'string'"
|
|
116
|
+
class="text-sm text-gray-600 dark:text-gray-400 font-normal"
|
|
117
|
+
>
|
|
118
|
+
{{ p.message.detail }}
|
|
119
|
+
</p>
|
|
120
|
+
<p
|
|
121
|
+
v-else-if="typeof p.message.detail == 'object'"
|
|
122
|
+
class="text-sm text-gray-600 dark:text-gray-400 font-normal"
|
|
123
|
+
>
|
|
124
|
+
{{ p.message.detail.message }}
|
|
125
|
+
</p>
|
|
126
|
+
<p v-else></p>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
130
|
+
<!-- <template #message="p">
|
|
119
131
|
|
|
120
132
|
<div class="bg-gray-200 dark:bg-gray-900 h-full w-full border">
|
|
121
133
|
<div class=" flex content content-end w-full">
|
|
@@ -148,8 +160,8 @@ const getFieldName = (path:string)=>{
|
|
|
148
160
|
</div>
|
|
149
161
|
</div>
|
|
150
162
|
</template> -->
|
|
151
|
-
|
|
152
|
-
|
|
163
|
+
</Toast>
|
|
164
|
+
<!-- <Toast group="list">
|
|
153
165
|
<template #message="p">
|
|
154
166
|
<div class="bg-gray-200 dark:bg-gray-900 h-full">
|
|
155
167
|
<div class="relative mx-auto flex justify-center sm:justify-end pt-16 sm:pt-6 pb-6 sm:pb-16 h-64 overflow-x-hidden">
|