@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Button
|
|
3
|
+
v-if="isMobile()"
|
|
4
|
+
severity="info"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
8
|
+
@click="onActivate"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</Button>
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="info"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</Button>
|
|
20
|
+
</template>
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
/**
|
|
23
|
+
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
24
|
+
* --remove-this-line-to-prevent-override--
|
|
25
|
+
* last change 2024-02-22
|
|
26
|
+
* author: Ks Tan
|
|
27
|
+
*/
|
|
28
|
+
const emits = defineEmits(["click"]);
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
30
|
+
const onActivate = (e: Event) => {
|
|
31
|
+
emits("click", e);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
4
|
@click="onActivate"
|
|
5
|
-
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
5
|
+
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
6
8
|
>
|
|
7
9
|
<slot></slot>
|
|
8
10
|
</Button>
|
|
9
|
-
<
|
|
11
|
+
<div
|
|
10
12
|
v-else
|
|
11
13
|
@click="onActivate"
|
|
12
|
-
:class="`border-none dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
14
|
+
:class="`cursor-pointer p-3 border-none text-center dark:text-white active:text-primary-600 click:bg-gray-600 ${
|
|
15
|
+
animate ? 'animate-bounce' : ''
|
|
16
|
+
}`"
|
|
13
17
|
>
|
|
14
18
|
<slot></slot>
|
|
15
|
-
</
|
|
19
|
+
</div>
|
|
16
20
|
</template>
|
|
17
21
|
<script setup lang="ts">
|
|
18
22
|
/**
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
* author: Ks Tan
|
|
23
27
|
*/
|
|
24
28
|
const emits = defineEmits(["click"]);
|
|
25
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
26
30
|
let stopawhile = false;
|
|
27
31
|
const onActivate = (e: Event) => {
|
|
28
32
|
emits("click", e);
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Button
|
|
3
3
|
v-if="isMobile()"
|
|
4
|
-
|
|
4
|
+
severity="warning"
|
|
5
|
+
:class="`w-full rounded-full text-center block ${
|
|
6
|
+
animate ? 'animate-bounce' : ''
|
|
7
|
+
}`"
|
|
5
8
|
@click="onActivate"
|
|
6
9
|
>
|
|
7
10
|
<slot></slot>
|
|
8
11
|
</Button>
|
|
9
|
-
<Button
|
|
12
|
+
<Button
|
|
13
|
+
v-else
|
|
14
|
+
severity="warning"
|
|
15
|
+
:class="`${animate ? 'animate-bounce' : ''}`"
|
|
16
|
+
@click="onActivate"
|
|
17
|
+
>
|
|
10
18
|
<slot></slot>
|
|
11
19
|
</Button>
|
|
12
20
|
</template>
|
|
@@ -18,7 +26,7 @@
|
|
|
18
26
|
* author: Ks Tan
|
|
19
27
|
*/
|
|
20
28
|
const emits = defineEmits(["click"]);
|
|
21
|
-
const props = defineProps<{animate?:boolean}>()
|
|
29
|
+
const props = defineProps<{ animate?: boolean }>();
|
|
22
30
|
const onActivate = (e: Event) => {
|
|
23
31
|
emits("click", e);
|
|
24
32
|
};
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
class="w-full"
|
|
7
7
|
:inputid="inputid"
|
|
8
8
|
:date-format="getPrimevueCalendarDateFormat()"
|
|
9
|
-
@update:modelValue="emits('change',modelValue)"
|
|
10
|
-
|
|
9
|
+
@update:modelValue="emits('change', modelValue)"
|
|
10
|
+
showButtonBar
|
|
11
|
+
/>
|
|
11
12
|
</div>
|
|
12
13
|
</template>
|
|
13
14
|
<script setup lang="ts">
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
*/
|
|
20
21
|
const modelValue = defineModel<Date>({ required: true });
|
|
21
22
|
const inputid = randomUUID();
|
|
22
|
-
const emits = defineEmits([
|
|
23
|
+
const emits = defineEmits(["change"]);
|
|
23
24
|
const props = defineProps<{
|
|
24
25
|
label?: string;
|
|
25
26
|
}>();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<ClientOnly>
|
|
2
3
|
<VueCal
|
|
3
4
|
:id="id"
|
|
4
5
|
class="w-full"
|
|
@@ -13,25 +14,24 @@
|
|
|
13
14
|
@view-change="viewChange"
|
|
14
15
|
:events="allevents"
|
|
15
16
|
@cell-focus="chooseDate"
|
|
16
|
-
|
|
17
17
|
xsmall
|
|
18
18
|
>
|
|
19
19
|
<template #today-button>
|
|
20
20
|
<!-- Using Vuetify (but we prefer Wave UI 🤘) -->
|
|
21
|
-
<div
|
|
22
|
-
@click="chooseDate(new Date(), true)">{{ t("today") }}</div>
|
|
21
|
+
<div @click="chooseDate(new Date(), true)">{{ t("today") }}</div>
|
|
23
22
|
</template>
|
|
24
23
|
<template #cell-content="{ cell, events }">
|
|
25
24
|
<div>
|
|
26
25
|
<div>
|
|
27
|
-
<s
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
>{{ cell.content }}</s
|
|
32
|
-
>
|
|
26
|
+
<s v-if="isHoliday(cell.formattedDate)" v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
27
|
+
class="text text-red-400 dark:text-red-400 font-bold"
|
|
28
|
+
>{{ cell.content }}</s>
|
|
29
|
+
<div v-else-if="isOffDay(cell)" class="text-gray-400">
|
|
30
|
+
<s v-tooltip="t('offDay')">{{ cell.content }}</s>
|
|
31
|
+
</div>
|
|
33
32
|
<span v-else>{{ cell.content }} </span>
|
|
34
33
|
</div>
|
|
34
|
+
|
|
35
35
|
<div>
|
|
36
36
|
<slot name="default" :cell="cell" :events="events">
|
|
37
37
|
<Badge
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
</template>
|
|
47
47
|
</VueCal>
|
|
48
|
+
</ClientOnly>
|
|
48
49
|
</template>
|
|
49
50
|
<script lang="ts" setup generic="T">
|
|
50
51
|
/**
|
|
@@ -66,24 +67,25 @@ const viewStatus = ref<CalViewChange>();
|
|
|
66
67
|
const props = defineProps<{
|
|
67
68
|
id: string;
|
|
68
69
|
items: CalEventType<T>[];
|
|
69
|
-
|
|
70
|
+
holidays: OffDay[];
|
|
70
71
|
}>();
|
|
72
|
+
const offdays = ref<string[]>([]);
|
|
71
73
|
const emits = defineEmits(["chooseDate", "rightClick"]);
|
|
72
|
-
const
|
|
74
|
+
// const allholidays = computed(() => props.holidays.map((item) => item.date));
|
|
73
75
|
const selectedDate = defineModel<Date>({ required: true });
|
|
74
76
|
const getHolidayName = (date: Date) =>
|
|
75
|
-
props.
|
|
77
|
+
props.holidays.find((item) => item.date.getTime() == date.getTime())?.title;
|
|
76
78
|
const allevents = computed(() => {
|
|
77
79
|
const list = props.items.map((item) => {
|
|
78
80
|
if (item.start instanceof Date)
|
|
79
81
|
item.start = item.start.format("YYYY-MM-DD HH:mm");
|
|
80
|
-
else if (typeof item.start ==
|
|
81
|
-
item.start = item.start.substring(0,16).replace(
|
|
82
|
+
else if (typeof item.start == "string") {
|
|
83
|
+
item.start = item.start.substring(0, 16).replace("T", " ");
|
|
82
84
|
}
|
|
83
85
|
if (item.end instanceof Date)
|
|
84
86
|
item.end = item.end.format("YYYY-MM-DD HH:mm");
|
|
85
|
-
else if (typeof item.end ==
|
|
86
|
-
item.end = item.end.substring(0,16).replace(
|
|
87
|
+
else if (typeof item.end == "string") {
|
|
88
|
+
item.end = item.end.substring(0, 16).replace("T", " ");
|
|
87
89
|
}
|
|
88
90
|
return item;
|
|
89
91
|
});
|
|
@@ -93,6 +95,17 @@ const viewChange = (event: CalViewChange) => {
|
|
|
93
95
|
viewStatus.value = event;
|
|
94
96
|
};
|
|
95
97
|
|
|
98
|
+
const isHoliday = (datestr: string) => {
|
|
99
|
+
return props.holidays.find(
|
|
100
|
+
(item) => item.date.format("YYYY-MM-DD") == datestr,
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
const isOffDay = (cell: any) => {
|
|
104
|
+
|
|
105
|
+
const dayname: string = new Date(cell.formattedDate) .toLocaleString("en", { weekday: "short" }).toLowerCase();
|
|
106
|
+
if (offdays.value.includes(dayname)) return true;
|
|
107
|
+
else return false;
|
|
108
|
+
};
|
|
96
109
|
const chooseDate = (date1: Date, force?: boolean) => {
|
|
97
110
|
if (force || !viewStatus.value || viewStatus.value.view == "month") {
|
|
98
111
|
selectedDate.value = date1;
|
|
@@ -102,4 +115,8 @@ const chooseDate = (date1: Date, force?: boolean) => {
|
|
|
102
115
|
const onRightClickDate = (e: MouseEvent, cell: CalRightClickEvent) => {
|
|
103
116
|
emits("rightClick", e, cell);
|
|
104
117
|
};
|
|
118
|
+
|
|
119
|
+
onMounted(() => {
|
|
120
|
+
offdays.value = getCurrentBranch()?.branch.offdays ?? [];
|
|
121
|
+
});
|
|
105
122
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template >
|
|
2
|
-
<div class="rounded-lg
|
|
2
|
+
<div class="rounded-lg p-2" @click="showCartDialog">
|
|
3
3
|
<div class="line-clamp-1 text-sm md:text-base">{{ title }}</div>
|
|
4
4
|
<div class="text text-2xl md:text-3xl text-right">
|
|
5
5
|
<slot name="default"></slot>
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</template>
|
|
10
|
-
<template #default>
|
|
11
|
-
<pre class="border rounder-lg m-0 p-0 dark:bg-gray-500">{{ modelValue }}
|
|
12
|
-
</pre>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
</Sidebar>
|
|
16
|
-
|
|
2
|
+
<div :class="`p-0 bg-yellow-200 dark:bg-yellow-700 rounded-lg border`" v-if="isdebug == '1'">
|
|
3
|
+
<div
|
|
4
|
+
@click="visible = true"
|
|
5
|
+
class="cursor-pointer text-xs p-0 m-0 flex flex-col p-2 text-center"
|
|
6
|
+
>
|
|
7
|
+
<i class="pi pi-code"></i>
|
|
8
|
+
<span>{{ label }}</span>
|
|
17
9
|
</div>
|
|
18
|
-
|
|
10
|
+
<Sidebar
|
|
11
|
+
v-model:visible="visible"
|
|
12
|
+
:pt="{ root: { class: 'w-5/6' } }"
|
|
13
|
+
class="text-red-100"
|
|
14
|
+
>
|
|
15
|
+
<template #header>
|
|
16
|
+
<h1 class="text-gray-700 text-lg font-bold content-center">
|
|
17
|
+
{{ label }} Data
|
|
18
|
+
</h1>
|
|
19
|
+
</template>
|
|
20
|
+
<template #default>
|
|
21
|
+
<pre class="border rounder-lg m-0 p-0 bg-gray-500 text-white"
|
|
22
|
+
>{{ modelValue }}
|
|
23
|
+
</pre
|
|
24
|
+
>
|
|
25
|
+
</template>
|
|
26
|
+
</Sidebar>
|
|
27
|
+
</div>
|
|
19
28
|
</template>
|
|
20
29
|
|
|
21
30
|
<script setup lang="ts">
|
|
22
31
|
/**
|
|
23
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
32
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
24
33
|
* IT IS NOT CHANGABLE
|
|
25
34
|
* last change 2024-02-22
|
|
26
35
|
* author: Ks Tan
|
|
27
36
|
*/
|
|
28
37
|
// import Panel from 'primevue/panel';
|
|
29
38
|
// import ScrollPanel from 'primevue/scrollpanel';
|
|
30
|
-
import Dialog from
|
|
31
|
-
import Sidebar from
|
|
39
|
+
import Dialog from "primevue/dialog";
|
|
40
|
+
import Sidebar from "primevue/sidebar";
|
|
32
41
|
|
|
33
|
-
import {ref} from
|
|
34
|
-
const modelValue = defineModel()
|
|
35
|
-
const isdebug = ref(useRuntimeConfig().public.DEBUGDATA)
|
|
36
|
-
const visible = ref(false)
|
|
37
|
-
const props = withDefaults(defineProps<{label?:string}>(),{
|
|
38
|
-
|
|
42
|
+
import { ref } from "vue";
|
|
43
|
+
const modelValue = defineModel();
|
|
44
|
+
const isdebug = ref(useRuntimeConfig().public.DEBUGDATA);
|
|
45
|
+
const visible = ref(false);
|
|
46
|
+
const props = withDefaults(defineProps<{ label?: string }>(), {
|
|
47
|
+
label: "label",
|
|
48
|
+
});
|
|
49
|
+
const buttonlabel = computed(() => props.label ?? "debug");
|
|
39
50
|
const op = ref();
|
|
40
|
-
|
|
41
51
|
</script>
|
|
@@ -35,14 +35,12 @@
|
|
|
35
35
|
<script setup lang="ts">
|
|
36
36
|
/*
|
|
37
37
|
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
38
|
-
* --remove-this-line-to-prevent-override--
|
|
39
38
|
* last change 2024-02-22
|
|
40
39
|
* author: Ks Tan
|
|
41
40
|
*/
|
|
42
41
|
import { onKeyStroke } from "@vueuse/core";
|
|
43
42
|
import { useDialog } from "primevue/usedialog";
|
|
44
43
|
import { defineAsyncComponent } from "vue";
|
|
45
|
-
|
|
46
44
|
import { ViewRecord, FormCrudEvent } from "~/types";
|
|
47
45
|
// import TabView from 'primevue/tabview';
|
|
48
46
|
import Chip from "primevue/chip";
|
|
@@ -57,6 +55,7 @@ const lastDocumentName = computed(() => {
|
|
|
57
55
|
});
|
|
58
56
|
const { $listen } = useNuxtApp();
|
|
59
57
|
const visible = ref(false);
|
|
58
|
+
const autodeletetab = ref(true);
|
|
60
59
|
const allview = ref<{ [key: string]: ViewRecord }>({});
|
|
61
60
|
const after = (
|
|
62
61
|
v: ViewRecord,
|
|
@@ -65,10 +64,12 @@ const after = (
|
|
|
65
64
|
result: any,
|
|
66
65
|
) => {
|
|
67
66
|
if (v.after) {
|
|
68
|
-
v.after(eventType, data);
|
|
69
|
-
|
|
67
|
+
v.after(eventType, data, visible);
|
|
68
|
+
console.log("eventTypeeventType",eventType,"setting['autoclose'] ",autodeletetab.value)
|
|
70
69
|
//only after mount consider no remove tab
|
|
71
|
-
if (eventType
|
|
70
|
+
if (eventType == "mount") return
|
|
71
|
+
|
|
72
|
+
deleteTab();
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
|
|
@@ -80,18 +81,30 @@ onKeyStroke("Escape", (e) => {
|
|
|
80
81
|
const deleteTab = () => {
|
|
81
82
|
const keys = Object.keys(allview.value);
|
|
82
83
|
const lastkey = keys[keys.length - 1];
|
|
83
|
-
delete
|
|
84
|
+
console.log("Trigger delete tab")
|
|
85
|
+
if (keys.length == 1) {
|
|
86
|
+
const callback = allview.value[lastkey]?.after;
|
|
87
|
+
if (typeof callback == "function") {
|
|
88
|
+
callback(FormCrudEvent.exit, undefined, visible);
|
|
89
|
+
}
|
|
84
90
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
if(autodeletetab.value){
|
|
92
|
+
delete allview.value[lastkey];
|
|
93
|
+
visible.value = false;
|
|
94
|
+
useNuxtApp().$event("CloseDialog", "viewer");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}else{
|
|
98
|
+
console.log("Trigger delete tab2")
|
|
99
|
+
delete allview.value[lastkey];
|
|
90
100
|
}
|
|
91
101
|
};
|
|
92
102
|
|
|
93
103
|
$listen("ViewRecord", (setting) => {
|
|
94
104
|
visible.value = true;
|
|
105
|
+
if (setting["autoclose"] != undefined) {
|
|
106
|
+
autodeletetab.value = setting["autoclose"] ==0 ? false : true;
|
|
107
|
+
}
|
|
95
108
|
allview.value[setting.eventId] = setting;
|
|
96
109
|
});
|
|
97
110
|
|
|
@@ -113,11 +126,21 @@ $listen("CloseDialog", (documentName: string) => {
|
|
|
113
126
|
// });
|
|
114
127
|
//
|
|
115
128
|
const clearView = () => {
|
|
129
|
+
const firstId = Object.keys(allview.value)[0];
|
|
130
|
+
console.log("clear view", allview.value);
|
|
131
|
+
const callback = allview.value[firstId]?.after;
|
|
132
|
+
if (typeof callback == "function") {
|
|
133
|
+
callback(FormCrudEvent.exit, undefined, visible);
|
|
134
|
+
}
|
|
116
135
|
allview.value = {};
|
|
117
136
|
};
|
|
118
|
-
|
|
137
|
+
// watch(visible,()=>{
|
|
138
|
+
// if(visible.value==false){
|
|
139
|
+
// v.after(FormCrudEvent.exit, data,visible);
|
|
140
|
+
// }
|
|
141
|
+
// })
|
|
119
142
|
watch(visible, () => {
|
|
120
|
-
if (visible.value
|
|
143
|
+
if (!visible.value) {
|
|
121
144
|
clearView();
|
|
122
145
|
}
|
|
123
146
|
});
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
:document="doc"
|
|
8
8
|
@on="actionListener"
|
|
9
9
|
></SimpleAppFormToolBar>
|
|
10
|
-
<div
|
|
11
|
-
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 p-2"
|
|
12
|
-
>
|
|
10
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 p-2">
|
|
13
11
|
<SimpleAppInput
|
|
14
12
|
:input-type="SimpleAppInputType.text"
|
|
15
13
|
:setting="o.getField('#/properties/branchName')"
|
|
@@ -27,7 +25,53 @@
|
|
|
27
25
|
:setting="o.getField('#/properties/active')"
|
|
28
26
|
v-model="data.active"
|
|
29
27
|
/>
|
|
28
|
+
<SimpleAppInput
|
|
29
|
+
:input-type="SimpleAppInputType.selectmultiple"
|
|
30
|
+
:setting="o.getField('#/properties/offdays')"
|
|
31
|
+
v-model="data.offdays"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<SimpleAppInput
|
|
35
|
+
:input-type="SimpleAppInputType.text"
|
|
36
|
+
:setting="o.getField('#/properties/street1')"
|
|
37
|
+
v-model="data.street1"
|
|
38
|
+
/>
|
|
39
|
+
<SimpleAppInput
|
|
40
|
+
:input-type="SimpleAppInputType.text"
|
|
41
|
+
:setting="o.getField('#/properties/street2')"
|
|
42
|
+
v-model="data.street2"
|
|
43
|
+
/>
|
|
30
44
|
|
|
45
|
+
<SimpleAppInput
|
|
46
|
+
:input-type="SimpleAppInputType.text"
|
|
47
|
+
:setting="o.getField('#/properties/postcode')"
|
|
48
|
+
v-model="data.postcode"
|
|
49
|
+
/>
|
|
50
|
+
<SimpleAppInput
|
|
51
|
+
:input-type="SimpleAppInputType.text"
|
|
52
|
+
:setting="o.getField('#/properties/city')"
|
|
53
|
+
v-model="data.city"
|
|
54
|
+
/>
|
|
55
|
+
<SimpleAppInput
|
|
56
|
+
:input-type="SimpleAppInputType.text"
|
|
57
|
+
:setting="o.getField('#/properties/region')"
|
|
58
|
+
v-model="data.region"
|
|
59
|
+
/>
|
|
60
|
+
<SimpleAppInput
|
|
61
|
+
:input-type="SimpleAppInputType.text"
|
|
62
|
+
:setting="o.getField('#/properties/country')"
|
|
63
|
+
v-model="data.country"
|
|
64
|
+
/>
|
|
65
|
+
<SimpleAppInput
|
|
66
|
+
:input-type="SimpleAppInputType.text"
|
|
67
|
+
:setting="o.getField('#/properties/tel')"
|
|
68
|
+
v-model="data.tel"
|
|
69
|
+
/>
|
|
70
|
+
<SimpleAppInput
|
|
71
|
+
:input-type="SimpleAppInputType.text"
|
|
72
|
+
:setting="o.getField('#/properties/email')"
|
|
73
|
+
v-model="data.email"
|
|
74
|
+
/>
|
|
31
75
|
<SimpleAppInput
|
|
32
76
|
:input-type="SimpleAppInputType.textarea"
|
|
33
77
|
:setting="o.getField('#/properties/description')"
|
|
@@ -41,8 +85,7 @@
|
|
|
41
85
|
|
|
42
86
|
<script setup lang="ts">
|
|
43
87
|
/**
|
|
44
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
45
|
-
* --remove-this-line-to-prevent-override--
|
|
88
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
46
89
|
* last change 2024-02-22
|
|
47
90
|
* author: Ks Tan
|
|
48
91
|
*/
|
|
@@ -69,6 +112,10 @@ const getRecord = async () => {
|
|
|
69
112
|
await doc.getById(id.value);
|
|
70
113
|
} else {
|
|
71
114
|
newData();
|
|
115
|
+
data.value.organization={
|
|
116
|
+
_id:getUserProfile()?.orgRecordId,
|
|
117
|
+
label:getUserProfile()?.orgName
|
|
118
|
+
}
|
|
72
119
|
}
|
|
73
120
|
};
|
|
74
121
|
|
|
@@ -8,13 +8,21 @@
|
|
|
8
8
|
@on="actionListener"
|
|
9
9
|
></SimpleAppFormToolBar>
|
|
10
10
|
<div
|
|
11
|
-
class="grid grid-cols-1
|
|
11
|
+
class="grid grid-cols-1 lg:grid-cols-2 gap-4 p-2"
|
|
12
12
|
>
|
|
13
13
|
<SimpleAppInput
|
|
14
14
|
:input-type="SimpleAppInputType.autocomplete"
|
|
15
15
|
:setting="o.getField('#/properties/branch')"
|
|
16
16
|
v-model="data.branch"
|
|
17
17
|
/>
|
|
18
|
+
<SimpleAppInput
|
|
19
|
+
:readonly="!doc.isNew()"
|
|
20
|
+
:input-type="SimpleAppInputType.select"
|
|
21
|
+
:setting="o.getField('#/properties/docNoType')"
|
|
22
|
+
:options="getAllDocFormats().map((item) => item.docType)"
|
|
23
|
+
v-model="data.docNoType"
|
|
24
|
+
/>
|
|
25
|
+
|
|
18
26
|
|
|
19
27
|
<SimpleAppInput
|
|
20
28
|
:input-type="SimpleAppInputType.text"
|
|
@@ -39,14 +47,7 @@
|
|
|
39
47
|
v-model="data.default"
|
|
40
48
|
/>
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
:readonly="!doc.isNew()"
|
|
44
|
-
:input-type="SimpleAppInputType.select"
|
|
45
|
-
:setting="o.getField('#/properties/docNoType')"
|
|
46
|
-
:options="getAllDocFormats().map((item) => item.docType)"
|
|
47
|
-
v-model="data.docNoType"
|
|
48
|
-
/>
|
|
49
|
-
|
|
50
|
+
|
|
50
51
|
<SimpleAppInput
|
|
51
52
|
:input-type="SimpleAppInputType.text"
|
|
52
53
|
:setting="o.getField('#/properties/docNoPattern')"
|
|
@@ -91,7 +92,10 @@ const id = computed(() => props._id ?? "");
|
|
|
91
92
|
|
|
92
93
|
/************ start default methods ****************/
|
|
93
94
|
|
|
94
|
-
const newData = () =>
|
|
95
|
+
const newData = () => {
|
|
96
|
+
doc.setNew()
|
|
97
|
+
delete data.value.branch
|
|
98
|
+
}
|
|
95
99
|
|
|
96
100
|
const getRecord = async () => {
|
|
97
101
|
if (id.value && id.value != "new") {
|