@simitgroup/simpleapp-generator 1.2.7 → 1.3.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +3 -1
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +4 -9
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +14 -14
- package/dist/generate.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/organization.ts +3 -1
- package/src/framework.ts +5 -9
- package/src/generate.ts +17 -16
- package/templates/basic/nest/controller.ts.eta +17 -0
- package/templates/basic/nest/default.ts.eta +6 -2
- package/templates/basic/nuxt/default.ts.eta +10 -6
- package/templates/basic/nuxt/pages.[id].vue.eta +9 -7
- package/templates/basic/nuxt/pages.form.vue.eta +16 -36
- package/templates/basic/nuxt/pages.landing.vue.eta +42 -35
- package/templates/basic/nuxt/pages.viewer.vue.eta +4 -6
- package/templates/nest/.env._eta +0 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +14 -2
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +32 -18
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +76 -13
- package/templates/nuxt/app.vue.eta +7 -3
- package/templates/nuxt/assets/css/calendar.css._eta +21 -8
- package/templates/nuxt/assets/css/style.css._eta +17 -10
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +44 -22
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +1 -2
- package/templates/nuxt/components/button/ButtonMultiple.vue._eta +21 -0
- package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +29 -8
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +3 -4
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +75 -65
- package/templates/nuxt/components/event/EventNotification.vue._eta +23 -2
- package/templates/nuxt/components/form/FormBranch.vue.eta +83 -0
- package/templates/nuxt/components/form/readme.md.eta +1 -0
- package/templates/nuxt/components/header/HeaderBar.vue._eta +9 -9
- package/templates/nuxt/components/header/HeaderBreadcrumb.vue.eta +2 -2
- package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue._eta +16 -22
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +29 -46
- package/templates/nuxt/components/list/ListDocument.vue.eta +25 -0
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +77 -0
- package/templates/nuxt/components/list/ListView.vue.eta +129 -58
- package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +10 -0
- package/templates/nuxt/components/overlay/OverlaySideBarCrud.vue.eta +21 -0
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +20 -0
- package/templates/nuxt/components/page/PageDocList.vue.eta +170 -0
- package/templates/nuxt/components/renderer/RendererBoolean.vue.eta +8 -4
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +4 -4
- package/templates/nuxt/components/renderer/RendererLink.vue.eta +12 -20
- package/templates/nuxt/components/renderer/RendererMoney.vue.eta +10 -2
- package/templates/nuxt/components/renderer/RendererViewer.vue.eta +27 -21
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +202 -150
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +7 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +112 -101
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue.eta +183 -91
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +383 -246
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +4 -3
- package/templates/nuxt/components/table/TableDocuments.vue.eta +3 -3
- package/templates/nuxt/components/text/TextDanger.vue._eta +5 -0
- package/templates/nuxt/components/text/TextSubtitle.vue._eta +5 -0
- package/templates/nuxt/components/text/TextTitle.vue._eta +5 -0
- package/templates/nuxt/components/user/UserProfileListItem.vue.eta +2 -2
- package/templates/nuxt/composables/date.generate.ts.eta +21 -0
- package/templates/nuxt/composables/goTo.generate.ts.eta +1 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +0 -5
- package/templates/nuxt/error.vue._eta +3 -3
- package/templates/nuxt/i18n.config.ts.eta +1 -1
- package/templates/nuxt/lang/en.ts.eta +16 -0
- package/templates/nuxt/layouts/default.vue._eta +34 -34
- package/templates/nuxt/layouts/loginlayout.vue._eta +3 -0
- package/templates/nuxt/layouts/mobile.vue._eta +52 -0
- package/templates/nuxt/nuxt.config.ts._eta +28 -22
- package/templates/nuxt/pages/[xorg]/organization/[id].vue.eta +39 -0
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +30 -143
- package/templates/nuxt/pages/[xorg]/organization/viewer.vue.eta +3 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +81 -127
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +40 -0
- package/templates/nuxt/pages/[xorg]/user/form.vue.eta +329 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +37 -0
- package/templates/nuxt/pages/[xorg]/{organization/[id]/branches/[bid].vue → user/new.vue.eta} +10 -4
- package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +30 -0
- package/templates/nuxt/pages/[xorg]/{user.vue._eta → user.vue.eta} +88 -78
- package/templates/nuxt/pages/login.vue._eta +34 -0
- package/templates/nuxt/pages/profile.vue.eta +12 -3
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +36 -35
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +6 -0
- package/templates/nuxt/server/api/[xorg]/[...].ts.eta +7 -40
- package/templates/nuxt/server/api/profile/[...].ts.eta +3 -32
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +42 -3
- package/templates/nuxt/types/calendar.ts.eta +8 -1
- package/templates/nuxt/types/documentlist.ts.eta +0 -9
- package/templates/nuxt/types/events.ts.eta +1 -0
- package/templates/nuxt/types/others.ts.eta +4 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +12 -2
- package/templates/nuxt/types/user.ts.eta +2 -0
- package/templates/project/lang/default._json +9 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/docPage/DocPageList.vue.eta +0 -125
- package/templates/nuxt/lang/en.ts._eta +0 -6
- package/templates/nuxt/pages/[xorg]/organization/[bid].vue.eta +0 -14
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +0 -149
- package/templates/nuxt/pages/[xorg]/organization/[id]/index.vue.eta +0 -1
- package/templates/nuxt/pages/[xorg]/user/[id].vue._eta +0 -6
- package/templates/nuxt/pages/[xorg]/user/index.vue._eta +0 -302
- package/templates/nuxt/pages/login.vue.eta +0 -30
- /package/templates/nuxt/lang/{df.ts.eta → df.ts.etaxxxx} +0 -0
|
@@ -4,50 +4,73 @@ import Tailwind from "primevue/passthrough/tailwind";
|
|
|
4
4
|
|
|
5
5
|
const CustomTailwind = usePassThrough(
|
|
6
6
|
Tailwind,
|
|
7
|
-
{
|
|
8
|
-
|
|
7
|
+
{
|
|
8
|
+
avatar:{
|
|
9
|
+
root:{ class:'h-full w-full'},
|
|
10
|
+
},
|
|
9
11
|
toast:{
|
|
10
|
-
root:{ class:'w-1/3 '},
|
|
11
|
-
message:{},
|
|
12
|
-
container:{class:'w-full ' },
|
|
13
|
-
content:{class:'flex flex-row-reverse w-full'},
|
|
14
|
-
buttonContainer:{class:'hidden'},
|
|
12
|
+
root:{ class:'w-full md:w-1/2 lg:w-1/3 ml-4' , style:'position: fixed; top: 0px; right: 0px; z-index: 1102;'},
|
|
13
|
+
// message:{},
|
|
14
|
+
// container:{class:'w-full ' },
|
|
15
|
+
// content:{class:'flex flex-row-reverse w-full'},
|
|
16
|
+
// buttonContainer:{class:'hidden'},
|
|
15
17
|
},
|
|
16
18
|
card:{
|
|
17
|
-
root:{class:'shadow p-4 rounded-2xl
|
|
19
|
+
root:{class:'bg-white dark:bg-gray-800 shadow p-4 rounded-2xl'},
|
|
18
20
|
// title:{class:''},
|
|
19
21
|
// header:{class:''}
|
|
20
22
|
},
|
|
21
23
|
tabpanel:{
|
|
22
24
|
headerTitle:{class:'m-0 p-0'},
|
|
23
25
|
},
|
|
26
|
+
accordiontab:{
|
|
27
|
+
content:{style:'padding: 0.7rem;'}
|
|
28
|
+
|
|
29
|
+
},
|
|
24
30
|
selectbutton:{
|
|
25
|
-
root:{class:'flex flex-row gap-1'},
|
|
31
|
+
root:{class:'flex flex-row gap-1 '},
|
|
26
32
|
button: ({ context }) => ({
|
|
27
|
-
class: ` focus:outline-none transition duration-150 ease-in-out rounded p-2 m-1 border dark:border-gray-600 ${context.active ? 'bg-primary-600 border-primary-400 text-white' :
|
|
33
|
+
class: ` focus:outline-none transition duration-150 ease-in-out rounded p-2 m-1 border dark:border-gray-600 ${context.active ? 'bg-primary-600 border-primary-400 text-white' : ''}`
|
|
28
34
|
}),
|
|
29
35
|
// button: ( context) => ({
|
|
30
36
|
|
|
31
37
|
// class: ['text-center border text-gray-400 dark:border-gray-700 dark:text-gray-300 rounded-lg p-2 cursor-pointer hover:bg-primary-400 dark:hover:bg-primary-800 hover:text-white', context.active ? 'bg-primary-600 dark:bg-primary-700 text-white' : '']
|
|
32
38
|
// }),
|
|
33
|
-
label:{class: 'text-sm'},
|
|
39
|
+
label:{class: 'text-sm dark:text-white'},
|
|
40
|
+
},
|
|
41
|
+
checkbox:{
|
|
42
|
+
input:{ class:' flex items-center justify-center border-2 w-6 h-6 text-gray-600 rounded-lg transition-colors duration-200 border-gray-300 bg-white dark:border-blue-900/40 dark:bg-gray-500 hover:border-blue-500 dark:hover:border-blue-400 focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]'}
|
|
43
|
+
// p-checkbox p-component cursor-pointer inline-flex relative select-none align-bottom w-6 h-6
|
|
44
|
+
|
|
34
45
|
},
|
|
35
46
|
button:{root:{class: 'focus:outline-none transition duration-150 ease-in-out rounded p-2 m-1 border dark:border-gray-600'}},
|
|
36
|
-
dialog:{
|
|
47
|
+
dialog:{
|
|
48
|
+
root:{class:[' w-full max-h-full max-w-full md:h-3/4 lg:h-1/2 p-2']},
|
|
49
|
+
header:{class: 'p-dialog-header flex items-center text-2xl justify-between shrink-0 bg-white text-gray-800 border-t-0 rounded-tl-lg rounded-tr-lg p-6 dark:bg-gray-900 dark:text-white/80'},
|
|
50
|
+
content:{class:'p-dialog-content overflow-y-auto bg-white text-gray-700 px-6 pb-8 pt-0 dark:bg-gray-900 dark:text-white/80 rounded-bl-lg rounded-br-lg h-full'}
|
|
51
|
+
},
|
|
37
52
|
calendar:{
|
|
38
|
-
root:{class:'border border-
|
|
39
|
-
input:{class:'w-full p-
|
|
53
|
+
root:{class:'border border-grey-900 dark:!border-blue-900/40 rounded-lg flex flex-row p-0'},
|
|
54
|
+
input:{class:'w-full p-inputtext p-component font-sans text-base text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 p-3 border border-gray-300 dark:border-blue-900/40 transition-colors duration-200 appearance-none hover:border-blue-500 rounded-lg'},
|
|
40
55
|
},
|
|
41
56
|
autocomplete:{
|
|
42
|
-
root:{class:'border border-gray-400 dark:!border-blue-900/40 rounded-lg flex flex-row'},
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
// root:{class:'border border-gray-400 dark:!border-blue-900/40 rounded-lg flex flex-row'},
|
|
58
|
+
// loadingIcon:{class:'hidden'},
|
|
59
|
+
panel:{
|
|
60
|
+
class:'p-autocomplete-panel p-component p-2 w-full md:max-w-[500px] p-input-filled bg-white text-gray-700 border-0 rounded-md shadow-lg max-h-[200px] overflow-auto dark:bg-gray-900 dark:text-white/80'
|
|
61
|
+
},
|
|
45
62
|
dropdownbutton: {
|
|
46
63
|
root:' btn-primary dark:shadow-primary-800 dark:border-primary-900 text-white rounded-lg flex flex-row p-3 rounded-tl-none rounded-bl-none '
|
|
47
64
|
}
|
|
48
65
|
},
|
|
66
|
+
column:{
|
|
67
|
+
bodycell:{
|
|
68
|
+
style:'padding:5px;'
|
|
69
|
+
},
|
|
70
|
+
},
|
|
49
71
|
sidebar:{
|
|
50
|
-
root:{class:'w-full md:w-
|
|
72
|
+
root:{class:'w-full md:w-2/3 bg-white dark:bg-slate-950 p-0 h-full'},
|
|
73
|
+
header:{class:'dark:text-white text-2xl p-2'},
|
|
51
74
|
content:{class:'p-0 pt-0 h-full w-full grow overflow-y-auto'}
|
|
52
75
|
},
|
|
53
76
|
panel: {
|
|
@@ -59,10 +82,9 @@ const CustomTailwind = usePassThrough(
|
|
|
59
82
|
breadcrumb:{
|
|
60
83
|
root:{class:''}
|
|
61
84
|
},
|
|
62
|
-
inputnumber:{
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
}
|
|
85
|
+
// inputnumber:{
|
|
86
|
+
// input:{class:'text-right text-yellow-700'}
|
|
87
|
+
// }
|
|
66
88
|
},
|
|
67
89
|
);
|
|
68
90
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-for="o in options">
|
|
3
|
+
<ButtonPrimary v-if="value == o.value" @click="switchButton(o.value)">{{
|
|
4
|
+
o.label
|
|
5
|
+
}}</ButtonPrimary>
|
|
6
|
+
<ButtonDefault v-else @click="switchButton(o.value)">{{
|
|
7
|
+
o.label
|
|
8
|
+
}}</ButtonDefault>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
type keyvalue = { label: string; value: string };
|
|
13
|
+
const emits = defineEmits(["switch"]);
|
|
14
|
+
const props = defineProps<{
|
|
15
|
+
options: keyvalue[];
|
|
16
|
+
value: string;
|
|
17
|
+
}>();
|
|
18
|
+
const switchButton = (v: string) => {
|
|
19
|
+
if (v != props.value) emits("switch", v);
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
{{ calendarMode }}
|
|
3
2
|
<VueCal
|
|
3
|
+
|
|
4
4
|
:id="id"
|
|
5
|
+
ref="vueresourcecal"
|
|
5
6
|
:disable-views="['years', 'year', 'month', 'week']"
|
|
6
7
|
:time-from="8 * 60"
|
|
7
|
-
:time-to="
|
|
8
|
-
:time-step="
|
|
8
|
+
:time-to="22 * 60"
|
|
9
|
+
:time-step="60"
|
|
9
10
|
active-view="day"
|
|
10
11
|
:snap-to-time="15"
|
|
11
12
|
hide-view-selector
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
@event-drag-create="onDragNew"
|
|
23
24
|
@event-drop="onEventDrop"
|
|
24
25
|
@view-change="viewChange"
|
|
25
|
-
|
|
26
|
+
@cell-click="onCellClick"
|
|
26
27
|
@cell-contextmenu="eventHappend"
|
|
27
28
|
|
|
28
29
|
>
|
|
@@ -68,12 +69,13 @@
|
|
|
68
69
|
|
|
69
70
|
import "vue-cal/dist/vuecal.css";
|
|
70
71
|
import VueCal, { Event, SplitDaysAttributes } from "vue-cal";
|
|
71
|
-
import { CalEventType,
|
|
72
|
+
import { CalEventType,CalViewClickSlotEvent,CalResource,CalResourceType,RelocateEvent } from '~/types'
|
|
72
73
|
import { emit } from "process";
|
|
73
|
-
|
|
74
|
+
import moment from 'moment'
|
|
74
75
|
const timezoneoffset = new Date().getTimezoneOffset()
|
|
75
76
|
const eventsdata = ref<CalEventType<T>[]>()
|
|
76
|
-
const
|
|
77
|
+
const vueresourcecal = ref()
|
|
78
|
+
const emits = defineEmits(['eventRghtClick','eventClick','eventDrop','eventDragNew','viewChange','resourceClick','slotClick'])
|
|
77
79
|
const props = defineProps<{
|
|
78
80
|
id:string
|
|
79
81
|
items:CalEventType<T>[]
|
|
@@ -126,6 +128,25 @@ const allresources = computed(()=>{
|
|
|
126
128
|
})
|
|
127
129
|
return tmplist
|
|
128
130
|
})
|
|
131
|
+
const onCellClick = async(e:CalViewClickSlotEvent)=>{
|
|
132
|
+
const date =e.date
|
|
133
|
+
date.setHours(date.getHours() + Math.floor(date.getMinutes()/60));
|
|
134
|
+
date.setMinutes(0, 0, 0); // Resets also seconds and milliseconds
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
const newevent:CalEventType<T> = {
|
|
138
|
+
id: 'new',
|
|
139
|
+
start: date,
|
|
140
|
+
end: date.addHours(1),
|
|
141
|
+
class: 'nostudent',
|
|
142
|
+
title: t('new'),
|
|
143
|
+
// content?: string | undefined;
|
|
144
|
+
split: e.split,
|
|
145
|
+
data: {} as T
|
|
146
|
+
}
|
|
147
|
+
// emits('slotClick',e)
|
|
148
|
+
emits('eventDragNew',newevent)
|
|
149
|
+
}
|
|
129
150
|
const onEventDrop = async (relocateData: RelocateEvent<T>)=>{
|
|
130
151
|
emits('eventDrop', relocateData)
|
|
131
152
|
}
|
|
@@ -143,7 +164,7 @@ const onEventClick = (eventdata: CalResource) => {
|
|
|
143
164
|
|
|
144
165
|
const calendarMode = computed(()=>{
|
|
145
166
|
|
|
146
|
-
if(
|
|
167
|
+
if(useDevice().isMobile){
|
|
147
168
|
return {
|
|
148
169
|
title: false,
|
|
149
170
|
drag: true,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="p-0
|
|
3
|
-
<
|
|
4
|
-
<i class="pi pi-code"></i>
|
|
5
|
-
{{ label }}</Button>
|
|
2
|
+
<div :class="`p-0 absolute bg-yellow-200 bottom-0 right-0`" v-if="isdebug=='1'">
|
|
3
|
+
<button @click="visible=true" class=" text-white text-xs bg-warning-800 p-0 m-0">
|
|
4
|
+
<i class="pi pi-code"></i>{{ label }}</button>
|
|
6
5
|
<Sidebar v-model:visible="visible" class="text-red-100">
|
|
7
6
|
|
|
8
7
|
<template #header >
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<OverlayViewer v-model="visible" :close-event-name="initDocumentName" >
|
|
3
|
+
<!-- <template #header>
|
|
4
|
+
|
|
5
|
+
</template> -->
|
|
6
|
+
<div class="w-full h-full ">
|
|
7
|
+
<div class="flex flex-row gap-4">
|
|
8
|
+
<Chip
|
|
9
|
+
v-for="(v, k) in allview"
|
|
10
|
+
:label="v.label"
|
|
11
|
+
@remove="deleteTab"
|
|
12
|
+
:removable="true"
|
|
13
|
+
/>
|
|
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
|
+
<component
|
|
22
|
+
:is="defineAsyncComponent(v.viewer)"
|
|
23
|
+
:_id="v._id"
|
|
24
|
+
:readonly="v.readonly"
|
|
25
|
+
:paras="v.paras"
|
|
26
|
+
@after="
|
|
27
|
+
(eventType: FormCrudEvent, data: any, result: any) =>
|
|
28
|
+
after(v, eventType, data, result)
|
|
29
|
+
"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</OverlayViewer>
|
|
24
34
|
</template>
|
|
25
35
|
<script setup lang="ts">
|
|
26
36
|
/**
|
|
@@ -29,55 +39,55 @@
|
|
|
29
39
|
* last change 2024-01-27
|
|
30
40
|
* author: Ks Tan
|
|
31
41
|
*/
|
|
32
|
-
import { onKeyStroke } from
|
|
33
|
-
import { useDialog } from
|
|
34
|
-
import {defineAsyncComponent} from
|
|
35
|
-
import { ViewRecord } from
|
|
42
|
+
import { onKeyStroke } from "@vueuse/core";
|
|
43
|
+
import { useDialog } from "primevue/usedialog";
|
|
44
|
+
import { defineAsyncComponent } from "vue";
|
|
45
|
+
import { ViewRecord,FormCrudEvent } from "~/types";
|
|
36
46
|
// import TabView from 'primevue/tabview';
|
|
37
|
-
import Chip from
|
|
47
|
+
import Chip from "primevue/chip";
|
|
38
48
|
|
|
49
|
+
const { $listen } = useNuxtApp();
|
|
50
|
+
const initDocumentName = ref('')
|
|
51
|
+
const visible = ref(false);
|
|
52
|
+
const allview = ref<{ [key: string]: ViewRecord }>({});
|
|
53
|
+
const after = (v: ViewRecord, eventType: FormCrudEvent, data: any, result: any) => {
|
|
54
|
+
if (v.after) {
|
|
55
|
+
v.after(eventType, data, result);
|
|
56
|
+
//only after mount consider no remove tab
|
|
57
|
+
if (eventType != "mount") deleteTab();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
39
60
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if(v.after){
|
|
45
|
-
v.after(eventType,data,result)
|
|
46
|
-
//only after mount consider no remove tab
|
|
47
|
-
if(eventType!='mount') deleteTab()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onKeyStroke('Escape', (e) => {
|
|
52
|
-
e.preventDefault()
|
|
53
|
-
deleteTab()
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const deleteTab=()=>{
|
|
57
|
-
|
|
58
|
-
const keys = Object.keys(allview.value)
|
|
59
|
-
const lastkey = keys[keys.length-1]
|
|
60
|
-
delete allview.value[lastkey]
|
|
61
|
-
// updateprops.value++
|
|
62
|
-
if(Object.keys(allview.value).length==0){
|
|
63
|
-
visible.value=false
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
}
|
|
61
|
+
onKeyStroke("Escape", (e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
deleteTab();
|
|
64
|
+
});
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
const deleteTab = () => {
|
|
67
|
+
const keys = Object.keys(allview.value);
|
|
68
|
+
const lastkey = keys[keys.length - 1];
|
|
69
|
+
delete allview.value[lastkey];
|
|
70
|
+
console.log("DeleteTab",allview.value)
|
|
71
|
+
// updateprops.value++
|
|
72
|
+
if (Object.keys(allview.value).length == 0) {
|
|
73
|
+
visible.value = false;
|
|
74
|
+
useNuxtApp().$event('CloseDialog','viewer')
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
73
78
|
|
|
79
|
+
$listen("ViewRecord", (setting) => {
|
|
80
|
+
if(initDocumentName.value=='') initDocumentName.value= setting.documentName
|
|
81
|
+
visible.value = true;
|
|
82
|
+
allview.value[setting.eventId] = setting;
|
|
83
|
+
});
|
|
74
84
|
</script>
|
|
75
85
|
|
|
76
86
|
<style scoped>
|
|
77
|
-
.viewer-item{
|
|
78
|
-
|
|
87
|
+
.viewer-item {
|
|
88
|
+
display: none;
|
|
79
89
|
}
|
|
80
|
-
.viewer-item:last-child{
|
|
81
|
-
|
|
90
|
+
.viewer-item:last-child {
|
|
91
|
+
display: flex;
|
|
82
92
|
}
|
|
83
|
-
</style>
|
|
93
|
+
</style>
|
|
@@ -93,8 +93,29 @@ const getFieldName = (path:string)=>{
|
|
|
93
93
|
}
|
|
94
94
|
</script>
|
|
95
95
|
<template>
|
|
96
|
-
<Toast group="default"
|
|
96
|
+
<Toast group="default">
|
|
97
97
|
<template #message="p">
|
|
98
|
+
<div class="h-full w-full border">
|
|
99
|
+
<p class="text-lg text-red-800 font-semibold pb-1">{{ p.message.summary }}</p>
|
|
100
|
+
<div v-if="p.message.detail" class="flex flex-col gap-2 ">
|
|
101
|
+
<p v-if="Array.isArray(p.message.detail)" v-for="item in p.message.detail"
|
|
102
|
+
class="text-sm text-red-600 font-normal">
|
|
103
|
+
<span v-if="item.instancePath">{{ item.instancePath }} </span>
|
|
104
|
+
<span v-if="item.message"> {{ item.message }} </span>
|
|
105
|
+
|
|
106
|
+
</p>
|
|
107
|
+
<p v-else-if="typeof p.message.detail == 'string'" class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
108
|
+
{{ p.message.detail }}
|
|
109
|
+
</p>
|
|
110
|
+
<p v-else-if="typeof p.message.detail == 'object'" class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
111
|
+
{{ p.message.detail.message }}
|
|
112
|
+
</p>
|
|
113
|
+
<p v-else></p>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
<!-- <template #message="p">
|
|
98
119
|
|
|
99
120
|
<div class="bg-gray-200 dark:bg-gray-900 h-full w-full border">
|
|
100
121
|
<div class=" flex content content-end w-full">
|
|
@@ -126,7 +147,7 @@ const getFieldName = (path:string)=>{
|
|
|
126
147
|
</div>
|
|
127
148
|
</div>
|
|
128
149
|
</div>
|
|
129
|
-
</template>
|
|
150
|
+
</template> -->
|
|
130
151
|
</Toast>
|
|
131
152
|
<!-- <Toast group="list">
|
|
132
153
|
<template #message="p">
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<SimpleAppForm #default="o" :document="doc">
|
|
3
|
+
<client-only>
|
|
4
|
+
<title v-if="id">{{ data.branchName ?? data.branchCode }}</title>
|
|
5
|
+
|
|
6
|
+
<SimpleAppFormToolBar
|
|
7
|
+
:document="doc"
|
|
8
|
+
@on="actionListener"
|
|
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
|
+
>
|
|
13
|
+
<SimpleAppInput
|
|
14
|
+
:input-type="SimpleAppInputType.text"
|
|
15
|
+
:setting="o.getField('#/properties/branchName')"
|
|
16
|
+
v-model="data.branchName"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<SimpleAppInput
|
|
20
|
+
:input-type="SimpleAppInputType.text"
|
|
21
|
+
:setting="o.getField('#/properties/branchCode')"
|
|
22
|
+
v-model="data.branchCode"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<SimpleAppInput
|
|
26
|
+
:input-type="SimpleAppInputType.checkbox"
|
|
27
|
+
:setting="o.getField('#/properties/active')"
|
|
28
|
+
v-model="data.active"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<SimpleAppInput
|
|
32
|
+
:input-type="SimpleAppInputType.textarea"
|
|
33
|
+
:setting="o.getField('#/properties/description')"
|
|
34
|
+
v-model="data.description"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</client-only>
|
|
38
|
+
</SimpleAppForm>
|
|
39
|
+
<DebugDocumentData v-model="data" :label="doc.getDocName()" />
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
/**
|
|
44
|
+
* This file was automatically generated by simpleapp generator.
|
|
45
|
+
* last change 2024-02-16
|
|
46
|
+
* Author: Ks Tan
|
|
47
|
+
*/
|
|
48
|
+
import { SimpleAppInputType, FormCrudEvent } from "~/types";
|
|
49
|
+
import { Branch } from "~/simpleapp/generate/types";
|
|
50
|
+
import { BranchDoc } from "~/simpleapp/docs/BranchDoc";
|
|
51
|
+
|
|
52
|
+
const props = defineProps<{
|
|
53
|
+
_id?: string;
|
|
54
|
+
doc?: BranchDoc;
|
|
55
|
+
paras?: Branch;
|
|
56
|
+
}>();
|
|
57
|
+
const doc = props.doc ?? useNuxtApp().$BranchDoc();
|
|
58
|
+
const data = doc.getReactiveData();
|
|
59
|
+
const emits = defineEmits(["after"]);
|
|
60
|
+
const id = computed(() => props._id ?? "");
|
|
61
|
+
|
|
62
|
+
/************ start default methods ****************/
|
|
63
|
+
|
|
64
|
+
const newData = () => doc.setNew();
|
|
65
|
+
|
|
66
|
+
const getRecord = async () => {
|
|
67
|
+
if (id.value && id.value != "new") {
|
|
68
|
+
await doc.getById(id.value);
|
|
69
|
+
} else {
|
|
70
|
+
newData();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
getRecord();
|
|
75
|
+
watch(id, async () => await getRecord());
|
|
76
|
+
/************ end default methods ****************/
|
|
77
|
+
|
|
78
|
+
const actionListener = async (actionName: string) => {
|
|
79
|
+
emits("after", actionName, data.value, doc);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
onMounted(async () => await actionListener(FormCrudEvent.mount));
|
|
83
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
all document form auto generate into here
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- <header> -->
|
|
3
3
|
<!-- <MegaMenu :model="getMenus()" orientation="horizontal" /> -->
|
|
4
|
-
|
|
5
|
-
<div
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
<div >
|
|
6
|
+
<client-only>
|
|
7
7
|
|
|
8
8
|
<div class="flex-1 flex flex-row gap-2 p-2">
|
|
9
9
|
<!-- <div class="">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<!-- <div class="">
|
|
14
14
|
<HeaderButtonHome/>
|
|
15
15
|
</div> -->
|
|
16
|
-
<div v-if="isMobile()">
|
|
16
|
+
<div v-if="isMobile()" class="dark:text-white max-w-[15rem] truncate ...">
|
|
17
17
|
<div v-if="useRoute().fullPath.split('/').length<=3">{{ t('home') }}</div>
|
|
18
18
|
<div v-else>{{ _.last(useRoute().fullPath.split('/')) }}</div>
|
|
19
19
|
</div>
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
|
|
24
24
|
</div>
|
|
25
25
|
<div class="flex-1 flex flex-row-reverse gap-2 p-2">
|
|
26
|
-
|
|
27
|
-
<div class=" text-right">
|
|
26
|
+
<!--
|
|
27
|
+
<div class=" text-right" v-if="!isMobile()">
|
|
28
28
|
<HeaderButtonProfile/>
|
|
29
29
|
</div>
|
|
30
|
-
|
|
30
|
+
<div class=" text-right">
|
|
31
31
|
<HeaderButtonTaskList/>
|
|
32
32
|
</div> -->
|
|
33
33
|
<!-- <div class="">
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
</client-only>
|
|
40
40
|
</div>
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
<!-- </header> -->
|
|
43
43
|
</template>
|
|
44
44
|
|
|
@@ -52,11 +52,11 @@ const getBranches = ()=>{
|
|
|
52
52
|
<template>
|
|
53
53
|
<Breadcrumb :home="home" :model="items" class="!p-0 border-none ">
|
|
54
54
|
<template #item="{ item }">
|
|
55
|
-
<NuxtLink :to="item.url" v-if="item.url" :active-class="'-'" :exact-active-class="'-'">
|
|
55
|
+
<NuxtLink :to="item.url" v-if="item.url" class="dark:text-white" :active-class="'-'" :exact-active-class="'-'">
|
|
56
56
|
<span :class="item.icon"></span>{{ item.label }}
|
|
57
57
|
</NuxtLink>
|
|
58
58
|
<div v-else>
|
|
59
|
-
<span class="cursor-pointer" @click="showSwitcher">{{ item.label }}</span>
|
|
59
|
+
<span class="cursor-pointer dark:text-white" @click="showSwitcher">{{ item.label }}</span>
|
|
60
60
|
<OverlayPanel ref="op">
|
|
61
61
|
<div>
|
|
62
62
|
<ul class="flex flex-col">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import Dialog from 'primevue/dialog';
|
|
3
|
-
import {ref} from 'vue'
|
|
3
|
+
// import {ref} from 'vue'
|
|
4
4
|
import {MenuData} from '~/types'
|
|
5
|
-
const visible =
|
|
5
|
+
const visible = defineModel<boolean>({default:true,required:true})
|
|
6
6
|
|
|
7
7
|
// const emit = defineEmits(['select'])
|
|
8
8
|
const selectMenu = (menuname:{name:string,children:any}) =>{
|
|
@@ -12,11 +12,11 @@ const selectMenu = (menuname:{name:string,children:any}) =>{
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
const m = getMenustFromPageMeta()
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
let treemenu:any[] = []
|
|
17
16
|
|
|
18
17
|
getMenustFromPageMeta().reduce((r, item) => {
|
|
19
|
-
item.split('/').
|
|
18
|
+
item.split('/').
|
|
19
|
+
reduce((o, name) => {
|
|
20
20
|
var temp = (o.children = o.children || []).find(q => q.name === name);
|
|
21
21
|
if (!temp) o.children.push(temp = { name });
|
|
22
22
|
return temp;
|
|
@@ -24,32 +24,26 @@ getMenustFromPageMeta().reduce((r, item) => {
|
|
|
24
24
|
return r;
|
|
25
25
|
}, { children: treemenu })
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
treemenu = treemenu.sort((a,b)=>a.name<b.name ?-1:1)
|
|
28
28
|
</script>
|
|
29
29
|
<template>
|
|
30
|
-
|
|
31
|
-
<button class="text-center border-none cursor-pointer" v-if="getCurrentXorg()" @click="visible=true">
|
|
32
|
-
<
|
|
33
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
|
|
34
|
-
</svg>
|
|
35
|
-
</button>
|
|
36
|
-
|
|
37
|
-
<Dialog v-model:visible="visible" modal :header="t('pickDocument')" :pt="{dialog:{ class:' bg-primary-800 ' }}">
|
|
30
|
+
|
|
31
|
+
<!-- <button class="text-center border-none cursor-pointer pi pi-bars dark:text-white" v-if="getCurrentXorg()" @click="visible=true"> -->
|
|
32
|
+
<Dialog v-model:visible="visible" modal :header="t('pickDocument')" :pt="{dialog:{ class:' bg-primary-800 ' }}">
|
|
38
33
|
<div class="">
|
|
39
|
-
|
|
34
|
+
|
|
35
|
+
<div v-for="m in treemenu.sort()" class="m-4">
|
|
36
|
+
|
|
40
37
|
<h3>{{ t(m.name) }}</h3>
|
|
41
|
-
<div class="grid grid-cols-6 gap-4">
|
|
42
|
-
<
|
|
38
|
+
<div class="grid md:grid-cols-2 lg:grid-cols-6 gap-4">
|
|
39
|
+
<ButtonPrimary v-for="submenu in m.children.sort((a:any,b:any)=>a.name<b.name ?-1:1)" class="border rounded-lg p-2" @click="selectMenu(submenu)">
|
|
43
40
|
{{ t(submenu.name) }}
|
|
44
|
-
</
|
|
41
|
+
</ButtonPrimary>
|
|
45
42
|
</div>
|
|
46
43
|
|
|
47
44
|
</div>
|
|
48
45
|
|
|
49
46
|
</div>
|
|
50
47
|
</Dialog>
|
|
51
|
-
|
|
48
|
+
|
|
52
49
|
</template>
|
|
53
|
-
<style scoped>
|
|
54
|
-
|
|
55
|
-
</style>
|