@simitgroup/simpleapp-generator 1.2.5 → 1.2.7
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 -0
- package/dist/buildinschemas/organization.js +2 -2
- package/dist/buildinschemas/organization.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/organization.ts +2 -2
- package/templates/basic/nest/controller.ts.eta +25 -21
- package/templates/basic/nest/service.ts.eta +5 -5
- package/templates/basic/nuxt/default.ts.eta +1 -1
- package/templates/basic/nuxt/pages.form.vue.eta +4 -4
- package/templates/basic/nuxt/pages.landing.vue.eta +9 -0
- package/templates/basic/nuxt/pages.viewer.vue.eta +4 -3
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +6 -17
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +10 -0
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +7 -19
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +20 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +9 -3
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +3 -3
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +1 -4
- package/templates/nest/src/simpleapp/types/index.ts._eta +7 -0
- package/templates/nuxt/assets/css/calendar.css._eta +37 -0
- package/templates/nuxt/assets/css/style.css._eta +3 -2
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +16 -5
- package/templates/nuxt/components/button/ButtonDanger.vue._eta +6 -0
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +6 -0
- package/templates/nuxt/components/button/ButtonPrimary.vue._eta +6 -0
- package/templates/nuxt/components/button/ButtonWarning.vue._eta +6 -0
- package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +167 -0
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +74 -0
- package/templates/nuxt/components/docPage/DocPageList.vue.eta +48 -40
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +10 -10
- package/templates/nuxt/components/header/HeaderBar.vue._eta +25 -12
- package/templates/nuxt/components/renderer/RendererBoolean.vue.eta +6 -1
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +6 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +7 -1
- package/templates/nuxt/components/renderer/RendererLink.vue.eta +33 -0
- package/templates/nuxt/components/renderer/RendererMoney.vue.eta +11 -1
- package/templates/nuxt/components/renderer/RendererMultiText.vue.eta +6 -0
- package/templates/nuxt/components/renderer/RendererViewer.vue.eta +32 -0
- package/templates/nuxt/components/renderer/{index.ts.eta → index.ts._eta} +10 -2
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +4 -7
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue.eta +3 -2
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +3 -4
- package/templates/nuxt/components/simpleApp/pending/SimpleAppValue.vue +1 -1
- package/templates/nuxt/composables/screensize.generate.ts.eta +1 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +4 -2
- package/templates/nuxt/error.vue._eta +1 -1
- package/templates/nuxt/layouts/default.vue._eta +47 -8
- package/templates/nuxt/nuxt.config.ts._eta +5 -1
- package/templates/nuxt/pages/[xorg]/index.vue._eta +11 -9
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +5 -0
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +13 -2
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +17 -17
- package/templates/nuxt/types/calendar.ts.eta +54 -0
- package/templates/nuxt/types/documentlist.ts.eta +6 -0
- package/templates/nuxt/types/events.ts.eta +5 -5
- package/templates/nuxt/types/index.ts._eta +4 -3
- package/templates/nuxt/types/listview.ts.eta +6 -0
- package/templates/nuxt/types/notifications.ts.eta +6 -1
- package/templates/nuxt/types/others.ts.eta +6 -1
- package/templates/nuxt/types/schema.ts.eta +8 -0
- package/templates/nuxt/types/simpleappinput.ts.eta +6 -0
- package/templates/nuxt/types/user.ts.eta +8 -0
- package/templates/nuxt/types/workflow.ts.eta +6 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
{{ calendarMode }}
|
|
3
|
+
<VueCal
|
|
4
|
+
:id="id"
|
|
5
|
+
:disable-views="['years', 'year', 'month', 'week']"
|
|
6
|
+
:time-from="8 * 60"
|
|
7
|
+
:time-to="20 * 60"
|
|
8
|
+
:time-step="30"
|
|
9
|
+
active-view="day"
|
|
10
|
+
:snap-to-time="15"
|
|
11
|
+
hide-view-selector
|
|
12
|
+
:events="allevents"
|
|
13
|
+
:editable-events="calendarMode"
|
|
14
|
+
:split-days="allresources"
|
|
15
|
+
:min-split-width="100"
|
|
16
|
+
|
|
17
|
+
:sticky-split-labels="true"
|
|
18
|
+
sticky-split-labels
|
|
19
|
+
|
|
20
|
+
:selected-date="selectedDate"
|
|
21
|
+
:drag-to-create-threshold="15"
|
|
22
|
+
@event-drag-create="onDragNew"
|
|
23
|
+
@event-drop="onEventDrop"
|
|
24
|
+
@view-change="viewChange"
|
|
25
|
+
|
|
26
|
+
@cell-contextmenu="eventHappend"
|
|
27
|
+
|
|
28
|
+
>
|
|
29
|
+
<!-- header template -->
|
|
30
|
+
<template #split-label="{ split, view }">
|
|
31
|
+
<div
|
|
32
|
+
@click="clickResource(split._id, split.label)"
|
|
33
|
+
class="cursor-pointer"
|
|
34
|
+
>
|
|
35
|
+
<!-- <div
|
|
36
|
+
v-if="resourceType == CalResourceType.teacher && split.email"
|
|
37
|
+
class="w-full text-center"
|
|
38
|
+
>
|
|
39
|
+
<img
|
|
40
|
+
:src="getAvatarLink(split.email, 48)"
|
|
41
|
+
class="overflow-hidden object-cover rounded-full border-2 border-white dark:border-gray-700 shadow"
|
|
42
|
+
/> -->
|
|
43
|
+
<div>{{ split.displayName }} <span v-if="split._id == '?'" class="pi pi-plus"></span></div>
|
|
44
|
+
<!-- </div>
|
|
45
|
+
<div v-else>{{ split.displayName }}</div> -->
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<!-- event template -->
|
|
51
|
+
<!-- @contextmenu="onRightClick($event, event)" -->
|
|
52
|
+
<template #event="{ event, view }">
|
|
53
|
+
<div
|
|
54
|
+
@click="onRightClick($event,event)"
|
|
55
|
+
class="cursor-pointer"
|
|
56
|
+
>
|
|
57
|
+
<slot name="default" :event="<CalEventType<T>>event">
|
|
58
|
+
<div>{{ event.title }}</div>
|
|
59
|
+
<div>{{ event.start }}</div>
|
|
60
|
+
<div>{{ event.end }}</div>
|
|
61
|
+
</slot>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
</VueCal>
|
|
65
|
+
</template>
|
|
66
|
+
<script setup lang="ts" generic="T">
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
import "vue-cal/dist/vuecal.css";
|
|
70
|
+
import VueCal, { Event, SplitDaysAttributes } from "vue-cal";
|
|
71
|
+
import { CalEventType,CalRightClickEvent,OffDay,CalResource,CalResourceType,RelocateEvent } from '~/types'
|
|
72
|
+
import { emit } from "process";
|
|
73
|
+
|
|
74
|
+
const timezoneoffset = new Date().getTimezoneOffset()
|
|
75
|
+
const eventsdata = ref<CalEventType<T>[]>()
|
|
76
|
+
const emits = defineEmits(['eventRghtClick','eventClick','eventDrop','eventDragNew','viewChange','resourceClick'])
|
|
77
|
+
const props = defineProps<{
|
|
78
|
+
id:string
|
|
79
|
+
items:CalEventType<T>[]
|
|
80
|
+
resources:CalResource[]
|
|
81
|
+
resourceType:CalResourceType
|
|
82
|
+
}>()
|
|
83
|
+
const selectedDate = defineModel<Date>()
|
|
84
|
+
const selectedSchedule = ref<CalResource>();
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
const allevents = computed(()=>{
|
|
89
|
+
|
|
90
|
+
const list = props.items.map(item=>{
|
|
91
|
+
if(item.start instanceof Date) item.start =item.start.addMinutes(timezoneoffset).format('YYYY-MM-DD HH:mm')
|
|
92
|
+
if(item.end instanceof Date) item.end = item.end.addMinutes(timezoneoffset).format('YYYY-MM-DD HH:mm')
|
|
93
|
+
if(!item.split) item.split='?'
|
|
94
|
+
return item
|
|
95
|
+
})
|
|
96
|
+
return list
|
|
97
|
+
})
|
|
98
|
+
const eventHappend = (e:any)=>{
|
|
99
|
+
console.log("event happen eee",e)
|
|
100
|
+
// alert("event happend")
|
|
101
|
+
}
|
|
102
|
+
const viewChange = (e:any)=>{
|
|
103
|
+
console.log("calendar view change",e)
|
|
104
|
+
selectedDate.value=e.startDate
|
|
105
|
+
// endDate : Sat Feb 17 2024 23:59:59 GMT+0800 (Malaysia Time) {}
|
|
106
|
+
// events : []
|
|
107
|
+
// startDate : Sat Feb 17 2024 00:00:00 GMT+0800 (Malaysia Time) {}
|
|
108
|
+
// view : "day"
|
|
109
|
+
emits('viewChange',e)
|
|
110
|
+
}
|
|
111
|
+
const allresources = computed(()=>{
|
|
112
|
+
const tmplist = props.resources.map(r=>{
|
|
113
|
+
if(!r.id) r.id =r._id
|
|
114
|
+
if(r.hide===undefined) r.hide=false
|
|
115
|
+
if(!r.displayName) r.displayName=r.label
|
|
116
|
+
return r
|
|
117
|
+
})
|
|
118
|
+
tmplist.push({
|
|
119
|
+
_id:'?',
|
|
120
|
+
id:'?',
|
|
121
|
+
hide:false,
|
|
122
|
+
label:t('unknown'),
|
|
123
|
+
displayName:t('unknown'),
|
|
124
|
+
code:'',
|
|
125
|
+
email:'',
|
|
126
|
+
})
|
|
127
|
+
return tmplist
|
|
128
|
+
})
|
|
129
|
+
const onEventDrop = async (relocateData: RelocateEvent<T>)=>{
|
|
130
|
+
emits('eventDrop', relocateData)
|
|
131
|
+
}
|
|
132
|
+
const clickResource = async (splitid:string, splitlabel:string)=> emits('resourceClick', splitid,splitlabel)
|
|
133
|
+
const onDragNew = (e: CalEventType<T>)=> emits('eventDragNew', e)
|
|
134
|
+
|
|
135
|
+
const onRightClick = (clickevent: any, scheduledata: any) => {
|
|
136
|
+
selectedSchedule.value = scheduledata;
|
|
137
|
+
emits('eventRghtClick', clickevent,scheduledata)
|
|
138
|
+
};
|
|
139
|
+
const onEventClick = (eventdata: CalResource) => {
|
|
140
|
+
selectedSchedule.value = eventdata;
|
|
141
|
+
emits('eventClick',eventdata)
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const calendarMode = computed(()=>{
|
|
145
|
+
|
|
146
|
+
if(isMobile()){
|
|
147
|
+
return {
|
|
148
|
+
title: false,
|
|
149
|
+
drag: true,
|
|
150
|
+
resize: false,
|
|
151
|
+
delete: false,
|
|
152
|
+
// create: true,
|
|
153
|
+
}
|
|
154
|
+
}else{
|
|
155
|
+
return {
|
|
156
|
+
title: false,
|
|
157
|
+
drag: true,
|
|
158
|
+
resize: false,
|
|
159
|
+
delete: false,
|
|
160
|
+
create: true,
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
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 #cell-content="{ cell, view, events }" class="bg-red-300">
|
|
19
|
+
<div class="flex flex-col" @contextmenu="(mouseevent:MouseEvent)=>onRightClickDate(mouseevent,cell)">
|
|
20
|
+
<div>
|
|
21
|
+
<s
|
|
22
|
+
v-if="dateExists(new Date(cell.formattedDate),alloffdays)"
|
|
23
|
+
v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
24
|
+
class="text text-red-400 font-bold"
|
|
25
|
+
>{{ cell.content }}</s
|
|
26
|
+
>
|
|
27
|
+
<span v-else>{{ cell.content }} </span>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<slot name="default" :cell="cell" events="events">
|
|
31
|
+
<Badge v-if="events.length>0"
|
|
32
|
+
@contextmenu="(mouseevent:MouseEvent)=>onRightClickDate(mouseevent,cell)"
|
|
33
|
+
severity="info"
|
|
34
|
+
:value="events.length"/>
|
|
35
|
+
</slot>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
</vue-cal>
|
|
40
|
+
</template>
|
|
41
|
+
<script lang="ts" setup generic="T">
|
|
42
|
+
import VueCal, { Event, SplitDaysAttributes } from "vue-cal";
|
|
43
|
+
import { CalEventType,CalRightClickEvent,OffDay } from '~/types'
|
|
44
|
+
|
|
45
|
+
const props = defineProps<{
|
|
46
|
+
id:string
|
|
47
|
+
items:CalEventType<T>[]
|
|
48
|
+
offdays:OffDay[]
|
|
49
|
+
}>()
|
|
50
|
+
const emits = defineEmits(['chooseDate','rightClick'])
|
|
51
|
+
const alloffdays = computed(()=> props.offdays.map(item=>item.date))
|
|
52
|
+
const selectedDate = defineModel<Date>({required:true})
|
|
53
|
+
const getHolidayName = (date:Date) => props.offdays.find(item=>item.date.getTime() == date.getTime())?.title
|
|
54
|
+
const allevents = computed(()=>{
|
|
55
|
+
const list = props.items.map(item=>{
|
|
56
|
+
if(item.start instanceof Date) item.start = item.start.format('YYYY-MM-DD HH:mm')
|
|
57
|
+
if(item.end instanceof Date) item.end = item.end.format('YYYY-MM-DD HH:mm')
|
|
58
|
+
return item
|
|
59
|
+
})
|
|
60
|
+
return list
|
|
61
|
+
})
|
|
62
|
+
const viewChange = (event: any) => {
|
|
63
|
+
console.log("Calendar Small view change")
|
|
64
|
+
chooseDate(event.startDate);
|
|
65
|
+
};
|
|
66
|
+
const chooseDate = (date1: Date) => {
|
|
67
|
+
selectedDate.value = date1;
|
|
68
|
+
emits('chooseDate',selectedDate.value)
|
|
69
|
+
};
|
|
70
|
+
const onRightClickDate=(e: MouseEvent,cell:CalRightClickEvent)=>{
|
|
71
|
+
emits('rightClick',e,cell)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
</script>
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<div class="simpleapp-crudsimple">
|
|
4
|
+
<TableDocuments :value="recordlist" :columns="columns" :title="doc.getDocName()" >
|
|
5
|
+
<template #toolbar>
|
|
6
|
+
<div class="w-full text-left">
|
|
7
|
+
<Button class=" btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">{{ t('new') }}</Button>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<template #additionaltoolbar>
|
|
11
|
+
<Button class="bg-secondary-600 hover:bg-secondary-400 text-white" @click="refresh()" type="button" >{{ t('refresh') }}</Button>
|
|
12
|
+
</template>
|
|
13
|
+
</TableDocuments>
|
|
14
|
+
<Dialog v-model:visible="showDialog" modal>
|
|
15
|
+
<NuxtPage :_id="id" @after="after"></NuxtPage>
|
|
16
|
+
</Dialog>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
</template>
|
|
1
20
|
<script setup lang="ts">
|
|
2
21
|
/**
|
|
3
22
|
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
23
|
* DO NOT MODIFY IT BY HAND.
|
|
5
|
-
* last change
|
|
24
|
+
* last change 2024-02-04
|
|
6
25
|
* author: Ks Tan
|
|
7
26
|
*/
|
|
8
27
|
import {ref} from 'vue'
|
|
@@ -10,20 +29,15 @@ import _ from 'lodash'
|
|
|
10
29
|
import { SimpleAppClient } from '~/simpleapp/generate/clients/SimpleAppClient' //'../SimpleAppClient';
|
|
11
30
|
|
|
12
31
|
import {SearchBody,CellSetting} from '~/types'
|
|
13
|
-
const props =
|
|
32
|
+
const props = defineProps<{
|
|
14
33
|
document:SimpleAppClient<any,any>
|
|
15
|
-
columns:CellSetting[]
|
|
16
|
-
layoutClass?:string
|
|
17
|
-
col1Class?:string
|
|
18
|
-
col2Class?:string
|
|
34
|
+
columns:CellSetting[]
|
|
19
35
|
sorts?: string[][]
|
|
20
|
-
}>()
|
|
21
|
-
|
|
22
|
-
col1Class:'p-4',
|
|
23
|
-
col2Class:'p-4'
|
|
24
|
-
})
|
|
36
|
+
}>()
|
|
37
|
+
const id= computed(()=>getPathPara('id'))
|
|
25
38
|
const resourcename = ref( _.upperFirst(props.document.getDocName()))
|
|
26
39
|
const visible = ref(false)
|
|
40
|
+
const showDialog = ref(false);
|
|
27
41
|
const doc = props.document
|
|
28
42
|
const data = doc.getReactiveData()
|
|
29
43
|
const disabled=ref(false)
|
|
@@ -84,34 +98,28 @@ const getWantedFields = (selectedCols:CellSetting[]) =>{
|
|
|
84
98
|
return cols
|
|
85
99
|
}
|
|
86
100
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
101
|
+
watch(showDialog,()=>{
|
|
102
|
+
if(!showDialog.value){
|
|
103
|
+
goTo(props.document.getDocName())
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
watch(()=>useRoute().path, async()=>{
|
|
107
|
+
if(getPathPara('id')){
|
|
108
|
+
showDialog.value=true
|
|
109
|
+
}else{
|
|
110
|
+
showDialog.value=false
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
const after = (eventType:string)=>{
|
|
114
|
+
if(eventType!='mount') goTo(resourcename.value)
|
|
115
|
+
//showDialog.value=false
|
|
90
116
|
}
|
|
117
|
+
onMounted(()=>{
|
|
118
|
+
if(id.value){
|
|
119
|
+
showDialog.value=true
|
|
120
|
+
}else{
|
|
121
|
+
showDialog.value=false
|
|
122
|
+
}
|
|
123
|
+
})
|
|
91
124
|
</script>
|
|
92
|
-
|
|
93
|
-
<template>
|
|
94
|
-
<div class="simpleapp-crudsimple">
|
|
95
|
-
<h1 v-if="systemwindows" class="error-text text-center">* system administration screen</h1>
|
|
96
|
-
<div :class="layoutClass">
|
|
97
|
-
<div v-if="recordlist" :class="col1Class">
|
|
98
|
-
<TableDocuments :value="recordlist" :columns="columns" :title="doc.getDocName()" @select-row="selectRow">
|
|
99
|
-
<template #toolbar>
|
|
100
|
-
<div class="w-full text-left">
|
|
101
|
-
<Button class=" btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">{{ t('new') }}</Button>
|
|
102
|
-
</div>
|
|
103
|
-
</template>
|
|
104
|
-
<template #additionaltoolbar>
|
|
105
|
-
<Button class="bg-secondary-600 hover:bg-secondary-400 text-white" @click="refresh()" type="button" >{{ t('refresh') }}</Button>
|
|
106
|
-
</template>
|
|
107
|
-
</TableDocuments>
|
|
108
|
-
|
|
109
|
-
</div>
|
|
110
|
-
<div :class="col2Class">
|
|
111
|
-
<slot>
|
|
112
|
-
undefine page content
|
|
113
|
-
</slot>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</template>
|
|
125
|
+
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<Dialog v-model:visible="visible"
|
|
3
3
|
:pt="{root:{class:'w-5/6 h-5/6'}}"
|
|
4
4
|
:modal="true"
|
|
5
|
-
:close-on-escape="false" >
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
:close-on-escape="false" >
|
|
8
6
|
<template #header>
|
|
9
7
|
<div class="flex flex-row gap-4">
|
|
10
8
|
<Chip v-for="(v,k) in allview" :label="v.label" @remove="deleteTab" :removable="true"
|
|
@@ -16,8 +14,9 @@
|
|
|
16
14
|
<component
|
|
17
15
|
:is="defineAsyncComponent(v.viewer)"
|
|
18
16
|
:_id="v._id"
|
|
19
|
-
:readonly="v.readonly"
|
|
20
|
-
|
|
17
|
+
:readonly="v.readonly"
|
|
18
|
+
:paras="v.paras"
|
|
19
|
+
@after="(eventType:string,data:any,result:any)=>after(v,eventType,data,result)"
|
|
21
20
|
/>
|
|
22
21
|
</div>
|
|
23
22
|
</template>
|
|
@@ -41,13 +40,14 @@ import Chip from 'primevue/chip';
|
|
|
41
40
|
const {$listen,} = useNuxtApp()
|
|
42
41
|
const visible = ref(false)
|
|
43
42
|
const allview = ref<{[key:string]:ViewRecord}>({})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const after = (v:ViewRecord,eventType:string,data:any,result:any)=>{
|
|
44
|
+
if(v.after){
|
|
45
|
+
v.after(eventType,data,result)
|
|
46
|
+
//only after mount consider no remove tab
|
|
47
|
+
if(eventType!='mount') deleteTab()
|
|
48
48
|
}
|
|
49
|
-
deleteTab()
|
|
50
49
|
}
|
|
50
|
+
|
|
51
51
|
onKeyStroke('Escape', (e) => {
|
|
52
52
|
e.preventDefault()
|
|
53
53
|
deleteTab()
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
//import ButtonMenuPicker from "./ButtonMenuPicker.vue"
|
|
3
|
-
|
|
4
|
-
//import ButtonProfile from './ButtonProfile.vue';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
1
|
<template>
|
|
9
2
|
<!-- <header> -->
|
|
10
3
|
<!-- <MegaMenu :model="getMenus()" orientation="horizontal" /> -->
|
|
@@ -13,23 +6,30 @@
|
|
|
13
6
|
|
|
14
7
|
|
|
15
8
|
<div class="flex-1 flex flex-row gap-2 p-2">
|
|
16
|
-
<div class="">
|
|
9
|
+
<!-- <div class="">
|
|
17
10
|
<HeaderButtonMenuPicker/>
|
|
18
|
-
</div>
|
|
11
|
+
</div> -->
|
|
19
12
|
|
|
20
13
|
<!-- <div class="">
|
|
21
14
|
<HeaderButtonHome/>
|
|
22
15
|
</div> -->
|
|
23
|
-
<
|
|
16
|
+
<div v-if="isMobile()">
|
|
17
|
+
<div v-if="useRoute().fullPath.split('/').length<=3">{{ t('home') }}</div>
|
|
18
|
+
<div v-else>{{ _.last(useRoute().fullPath.split('/')) }}</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div v-else>
|
|
21
|
+
<HeaderBreadcrumb class="hidden md:block" v-if="useRoute().fullPath!='/'"></HeaderBreadcrumb>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
24
|
</div>
|
|
25
25
|
<div class="flex-1 flex flex-row-reverse gap-2 p-2">
|
|
26
26
|
|
|
27
27
|
<div class=" text-right">
|
|
28
28
|
<HeaderButtonProfile/>
|
|
29
29
|
</div>
|
|
30
|
-
<div class=" text-right">
|
|
30
|
+
<!-- <div class=" text-right">
|
|
31
31
|
<HeaderButtonTaskList/>
|
|
32
|
-
</div>
|
|
32
|
+
</div> -->
|
|
33
33
|
<!-- <div class="">
|
|
34
34
|
<HeaderSelectBranch/>
|
|
35
35
|
</div> -->
|
|
@@ -41,3 +41,16 @@
|
|
|
41
41
|
</client-only>
|
|
42
42
|
<!-- </header> -->
|
|
43
43
|
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import _ from 'lodash'
|
|
47
|
+
//import ButtonMenuPicker from "./ButtonMenuPicker.vue"
|
|
48
|
+
|
|
49
|
+
//import ButtonProfile from './ButtonProfile.vue';
|
|
50
|
+
const pageTitle = ref<string>('')
|
|
51
|
+
onMounted(()=>{
|
|
52
|
+
// useNuxtApp().$listen('SetTitle',(title:string)=>{
|
|
53
|
+
// pageTitle.value = title
|
|
54
|
+
// })
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
<i class="pi" :class="{ 'pi-check-circle text-green-500 ': modelValue, 'pi-times-circle text-red-500': !modelValue }"></i>
|
|
3
3
|
</template>
|
|
4
4
|
<script lang="ts" setup>
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
7
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
8
|
+
* last change 2024-02-04
|
|
9
|
+
* author: Ks Tan
|
|
10
|
+
*/
|
|
6
11
|
const modelValue = defineModel()
|
|
7
12
|
</script>
|
|
@@ -2,5 +2,11 @@
|
|
|
2
2
|
<span>{{ toLocalDate(value??'') }}</span>
|
|
3
3
|
</template>
|
|
4
4
|
<script lang="ts" setup>
|
|
5
|
+
/**
|
|
6
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
7
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
8
|
+
* last change 2024-02-04
|
|
9
|
+
* author: Ks Tan
|
|
10
|
+
*/
|
|
5
11
|
const props = defineProps<{value?:string}>()
|
|
6
12
|
</script>
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
<span v-else>{{ displayText }}</span>
|
|
6
6
|
</template>
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
+
/**
|
|
9
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
10
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
11
|
+
* last change 2024-02-04
|
|
12
|
+
* author: Ks Tan
|
|
13
|
+
*/
|
|
8
14
|
import { ForeignKey } from '~/types';
|
|
9
15
|
|
|
10
16
|
|
|
@@ -28,7 +34,7 @@ const viewRecord = () => {
|
|
|
28
34
|
$event('ViewRecord',{
|
|
29
35
|
_id: modelValue.value?._id as string,
|
|
30
36
|
label: modelValue.value?.label as string,
|
|
31
|
-
eventId:
|
|
37
|
+
eventId: randomUUID(),
|
|
32
38
|
documentName: props.setting.collection,
|
|
33
39
|
viewer: viewer.value,
|
|
34
40
|
readonly:true
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a @click="go" class="text-primary-700 hover:text-primary-500 cursor-pointer">
|
|
3
|
+
<slot name="default">
|
|
4
|
+
<div >{{ value[fields[0]] }}</div>
|
|
5
|
+
</slot>
|
|
6
|
+
</a>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
/**
|
|
10
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
11
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
12
|
+
* last change 2024-02-04
|
|
13
|
+
* author: Ks Tan
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
fields:any,
|
|
18
|
+
setting:any,
|
|
19
|
+
value:any
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const go = ()=>{
|
|
23
|
+
goTo(props.setting.path,props.value._id)
|
|
24
|
+
// useNuxtApp().$event('ViewRecord',{
|
|
25
|
+
// _id: props.value._id ,
|
|
26
|
+
// documentName: props.setting.documentName,
|
|
27
|
+
// viewer: getDocument(props.setting.documentName)?.viewer,
|
|
28
|
+
// label: props.setting.documentName,
|
|
29
|
+
// document:getDocument(props.setting.documentName)?.docClass,
|
|
30
|
+
// eventId: crypto.randomUUID()
|
|
31
|
+
// })
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
<template>
|
|
3
|
-
<span>{{ Intl.NumberFormat('en
|
|
3
|
+
<span> {{ Intl.NumberFormat('en',{
|
|
4
|
+
style:'currency',
|
|
5
|
+
currency: getUserProfile()?.currency,
|
|
6
|
+
currencyDisplay: 'symbol',
|
|
7
|
+
}).format(modelValue) }}</span>
|
|
4
8
|
</template>
|
|
5
9
|
<script lang="ts" setup>
|
|
10
|
+
/**
|
|
11
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
12
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
13
|
+
* last change 2024-02-04
|
|
14
|
+
* author: Ks Tan
|
|
15
|
+
*/
|
|
6
16
|
const props = defineProps(['modelValue'])
|
|
7
17
|
</script>
|
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
</template>
|
|
8
8
|
<script lang="ts" setup>
|
|
9
|
+
/**
|
|
10
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
11
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
12
|
+
* last change 2024-02-04
|
|
13
|
+
* author: Ks Tan
|
|
14
|
+
*/
|
|
9
15
|
const props = defineProps(['value','fields'])
|
|
10
16
|
|
|
11
17
|
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a @click="openViewer" class="text-primary-700 hover:text-primary-500 cursor-pointer">
|
|
3
|
+
<slot name="default">
|
|
4
|
+
<div >{{ value[fields[0]] }}</div>
|
|
5
|
+
</slot>
|
|
6
|
+
</a>
|
|
7
|
+
</template>
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
/**
|
|
10
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
11
|
+
* DONT CHANGE THIS FILE CAUSE IT OVERRIDE
|
|
12
|
+
* last change 2024-02-04
|
|
13
|
+
* author: Ks Tan
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
fields:any,
|
|
18
|
+
setting:any,
|
|
19
|
+
value:any
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const openViewer = ()=>{
|
|
23
|
+
useNuxtApp().$event('ViewRecord',{
|
|
24
|
+
_id: props.value._id ,
|
|
25
|
+
documentName: props.setting.documentName,
|
|
26
|
+
viewer: getDocument(props.setting.documentName)?.viewer,
|
|
27
|
+
label: props.setting.documentName,
|
|
28
|
+
document:getDocument(props.setting.documentName)?.docClass,
|
|
29
|
+
eventId: randomUUID()
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
3
|
+
* YOU CAN MODIFY IT.
|
|
4
|
+
* last change 2024-02-04
|
|
5
|
+
* author: Ks Tan
|
|
6
|
+
*/
|
|
1
7
|
import RendererBoolean from './RendererBoolean.vue'
|
|
2
8
|
import RendererDate from './RendererDate.vue'
|
|
3
9
|
import RendererForeignKey from './RendererForeignKey.vue'
|
|
4
10
|
import RendererMoney from './RendererMoney.vue'
|
|
5
11
|
import RendererMultiText from './RendererMultiText.vue'
|
|
6
|
-
|
|
12
|
+
import RendererViewer from './RendererViewer.vue'
|
|
13
|
+
import RendererLink from './RendererLink.vue'
|
|
7
14
|
|
|
8
15
|
export default {
|
|
9
16
|
|
|
10
|
-
RendererBoolean,RendererDate,RendererForeignKey,RendererMoney,RendererMultiText
|
|
17
|
+
RendererBoolean,RendererDate,RendererForeignKey,RendererMoney,RendererMultiText,RendererViewer,
|
|
18
|
+
RendererLink
|
|
11
19
|
|
|
12
20
|
};
|
|
@@ -48,7 +48,7 @@ const queryresult = jsonpath.query(props.setting.defaultValue,modifiedpath)[0]
|
|
|
48
48
|
const emptyautocomplete = computed(():autocompletetype=> queryresult)
|
|
49
49
|
|
|
50
50
|
const autocompleteitem = ref<autocompletetype>(emptyautocomplete.value)
|
|
51
|
-
const modelValue = defineModel<autocompletetype>()
|
|
51
|
+
const modelValue = defineModel<autocompletetype>({required:true})
|
|
52
52
|
if(modelValue.value && modelValue.value._id){
|
|
53
53
|
autocompleteitem.value={...modelValue.value}
|
|
54
54
|
}
|
|
@@ -97,12 +97,9 @@ const getListFromAutocompleteApi = (event:any)=>{
|
|
|
97
97
|
|
|
98
98
|
//on select
|
|
99
99
|
const pickAutoComplete = (event:any)=>{
|
|
100
|
-
|
|
101
|
-
if(event.value._id===''){
|
|
102
|
-
|
|
100
|
+
if(event.value._id===''){
|
|
103
101
|
modelValue.value = emptyautocomplete.value
|
|
104
102
|
autocompleteitem.value = emptyautocomplete.value
|
|
105
|
-
console.log(modelValue.value )
|
|
106
103
|
} else if(event.value._id==='new'){
|
|
107
104
|
|
|
108
105
|
modelValue.value = emptyautocomplete.value
|
|
@@ -138,14 +135,14 @@ const openViewer = (readonly:boolean) =>{
|
|
|
138
135
|
const docname = props.setting.fieldsetting['x-foreignkey']
|
|
139
136
|
$event('ViewRecord',{
|
|
140
137
|
_id: modelValue.value?._id as string,
|
|
141
|
-
eventId:
|
|
138
|
+
eventId: randomUUID(),
|
|
142
139
|
label: (readonly ? modelValue.value?.label : `${t('new') + ' '+ t(docname) }`) as string,
|
|
143
140
|
readonly:readonly,
|
|
144
141
|
viewer : getDocument(docname)?.viewer,
|
|
145
142
|
documentName: docname,
|
|
146
143
|
|
|
147
144
|
//after create, auto copy value into auto complete
|
|
148
|
-
|
|
145
|
+
after:(eventType:string,data:any,result:any)=>{
|
|
149
146
|
autocompleteitem.value = {
|
|
150
147
|
_id: data._id,
|
|
151
148
|
code: data[codefield],
|