@simitgroup/simpleapp-generator 1.6.4-e-alpha → 1.6.4-g-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/ReleaseNote.md +13 -0
- package/dist/buildinschemas/index.d.ts +0 -1
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +1 -3
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/systemmessage.js +3 -3
- package/dist/buildinschemas/systemmessage.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +7 -0
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/buildinschemas/webhook.d.ts.map +1 -1
- package/dist/buildinschemas/webhook.js +20 -5
- package/dist/buildinschemas/webhook.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/index.ts +0 -1
- package/src/buildinschemas/systemmessage.ts +3 -3
- package/src/buildinschemas/user.ts +7 -0
- package/src/buildinschemas/webhook.ts +21 -7
- package/templates/basic/nest/controller.ts.eta +3 -3
- package/templates/nest/.env._eta +7 -0
- package/templates/nest/src/app.module.ts.eta +12 -5
- package/templates/nest/src/main.ts.eta +30 -0
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +32 -12
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +31 -26
- package/templates/nest/src/simpleapp/generate/commons/customkeycloa.guard.ts.eta +43 -0
- package/templates/nest/src/simpleapp/generate/commons/dicts/documents.ts.eta +2 -1
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +31 -5
- package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +15 -17
- package/templates/nest/src/simpleapp/generate/commons/runwebhook.service.ts.eta +161 -29
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +17 -2
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +4 -6
- package/templates/nest/src/simpleapp/generate/processors/webhook.processor.ts.eta +224 -0
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +113 -110
- package/templates/nuxt/components/image/ImageAvatar.vue.eta._vue +47 -13
- package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta.vue +5 -5
- package/templates/nuxt/components/renderer/RendererDocHistories.vue.eta +8 -5
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +25 -18
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +13 -9
- package/templates/nuxt/pages/profile.vue.eta +3 -1
- package/templates/nuxt/server/api/profile/[...].ts.eta +11 -2
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +3 -1
- package/templates/nuxt/types/others.ts.eta +1 -0
- package/templates/nuxt/types/simpleappinput.ts.eta +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/src/buildinschemas/webhookhistory.ts +0 -42
|
@@ -1,129 +1,132 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:events="allevents"
|
|
16
|
-
@cell-focus="chooseDate"
|
|
17
|
-
xsmall
|
|
18
|
-
>
|
|
19
|
-
<template #today-button>
|
|
20
|
-
<!-- Using Vuetify (but we prefer Wave UI 🤘) -->
|
|
21
|
-
<div @click="chooseDate(new Date(), true)">{{ t("today") }}</div>
|
|
22
|
-
</template>
|
|
23
|
-
<template #cell-content="{ cell, events }">
|
|
24
|
-
<div>
|
|
25
|
-
<div>
|
|
26
|
-
<s
|
|
27
|
-
v-if="isHoliday(cell.formattedDate)"
|
|
28
|
-
v-tooltip="getHolidayName(new Date(cell.formattedDate))"
|
|
29
|
-
class="text text-red-400 dark:text-red-400 font-bold"
|
|
30
|
-
>{{ cell.content }}</s
|
|
31
|
-
>
|
|
32
|
-
<div v-else-if="isOffDay(cell)" class="text-gray-400">
|
|
33
|
-
<s v-tooltip="t('offDay')">{{ cell.content }}</s>
|
|
34
|
-
</div>
|
|
35
|
-
<span v-else>{{ cell.content }} </span>
|
|
36
|
-
</div>
|
|
1
|
+
<template>
|
|
2
|
+
<Calendar
|
|
3
|
+
v-model="selectedDate"
|
|
4
|
+
inline
|
|
5
|
+
@update:modelValue="chooseDate"
|
|
6
|
+
:pt="{root:{class:'w-full'}}"
|
|
7
|
+
@month-change="viewChange"
|
|
8
|
+
@year-change="viewChange"
|
|
9
|
+
class="smallcalendar">
|
|
10
|
+
<template #footer>
|
|
11
|
+
<div class="p-2 flex flex-row justify-between">
|
|
12
|
+
<ButtonPrimary @click="goToday()">{{ t('today') }}</ButtonPrimary>
|
|
13
|
+
<TextSubsubtitle class="text-right"
|
|
14
|
+
>{{ items.length }} {{ t("records") }}</TextSubsubtitle>
|
|
37
15
|
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
<template #date="{date}">
|
|
19
|
+
<div class="flex flex-col text-center" >
|
|
20
|
+
<s v-if="isHoliday(date)" class="text-red-600">
|
|
21
|
+
{{ date.day }}
|
|
22
|
+
</s>
|
|
23
|
+
<span v-else-if="isOffDay(date)" class="text-gray-400">
|
|
24
|
+
{{ date.day }}
|
|
25
|
+
</span>
|
|
26
|
+
<template v-else>
|
|
27
|
+
{{ date.day }}
|
|
28
|
+
</template>
|
|
40
29
|
<Badge
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
"
|
|
45
|
-
severity="info"
|
|
46
|
-
:value="events.length"
|
|
30
|
+
v-if="getEventQty(date) > 0"
|
|
31
|
+
severity="info"
|
|
32
|
+
:value="getEventQty(date)"
|
|
47
33
|
/>
|
|
48
|
-
</slot>
|
|
49
34
|
</div>
|
|
50
|
-
</div>
|
|
51
35
|
</template>
|
|
52
|
-
|
|
53
|
-
</ClientOnly>
|
|
36
|
+
</Calendar>
|
|
54
37
|
</template>
|
|
55
|
-
<script lang="ts"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* IT IS NOT CHANGABLE
|
|
59
|
-
* last change 2024-02-22
|
|
60
|
-
* author: Ks Tan
|
|
61
|
-
*/
|
|
62
|
-
//, { Event, SplitDaysAttributes }
|
|
63
|
-
import VueCal from "vue-cal";
|
|
64
|
-
import "vue-cal/dist/vuecal.css";
|
|
38
|
+
<script setup lang="ts" generic="T">
|
|
39
|
+
import { CalendarDateSlotOptions,CalendarMonthChangeEvent } from "primevue/calendar";
|
|
40
|
+
|
|
65
41
|
import {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
42
|
+
CalEventType,
|
|
43
|
+
CalRightClickEvent,
|
|
44
|
+
OffDay,
|
|
45
|
+
CalViewChange,
|
|
70
46
|
} from "~/types";
|
|
71
|
-
|
|
47
|
+
|
|
72
48
|
const props = defineProps<{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
49
|
+
id: string;
|
|
50
|
+
items: CalEventType<T>[];
|
|
51
|
+
holidays: OffDay[];
|
|
76
52
|
}>();
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
const emits = defineEmits(["chooseDate", "viewChange"]);
|
|
54
|
+
|
|
55
|
+
|
|
80
56
|
const selectedDate = defineModel<Date>({ required: true });
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (item.end instanceof Date)
|
|
91
|
-
item.end = item.end.format("YYYY-MM-DD HH:mm");
|
|
92
|
-
else if (typeof item.end == "string") {
|
|
93
|
-
item.end = item.end.substring(0, 16).replace("T", " ");
|
|
94
|
-
}
|
|
95
|
-
return item;
|
|
96
|
-
});
|
|
97
|
-
return list;
|
|
98
|
-
});
|
|
99
|
-
const viewChange = (event: CalViewChange) => {
|
|
100
|
-
viewStatus.value = event;
|
|
101
|
-
emits('viewChange',event)
|
|
102
|
-
};
|
|
57
|
+
const offdays = ref<string[]>([]);
|
|
58
|
+
type DateType = {
|
|
59
|
+
day: number
|
|
60
|
+
month : number
|
|
61
|
+
otherMonth: boolean
|
|
62
|
+
selectable : boolean
|
|
63
|
+
today : boolean
|
|
64
|
+
year: number
|
|
65
|
+
}
|
|
103
66
|
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
67
|
+
const disableDays=computed(()=>{
|
|
68
|
+
return offdays.value.map(item=>{
|
|
69
|
+
if(item=='sun')return 0
|
|
70
|
+
else if(item=='mon')return 1
|
|
71
|
+
else if(item=='tue')return 2
|
|
72
|
+
else if(item=='wed')return 3
|
|
73
|
+
else if(item=='thu')return 4
|
|
74
|
+
else if(item=='fri')return 5
|
|
75
|
+
else if(item=='sat')return 6
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
function isHoliday(date:CalendarDateSlotOptions){
|
|
80
|
+
|
|
81
|
+
for(let i = 0 ; i<props.holidays.length;i++){
|
|
82
|
+
const item = props.holidays[i]
|
|
83
|
+
const currenyday = getDayJs()(item.date).date()
|
|
84
|
+
const currentmonth = getDayJs()(item.date).month()
|
|
85
|
+
const currentyear = getDayJs()(item.date).year()
|
|
86
|
+
if(currenyday==date.day && currentmonth==date.month && currentyear==date.year){
|
|
87
|
+
return true
|
|
88
|
+
}
|
|
120
89
|
}
|
|
90
|
+
return false
|
|
91
|
+
}
|
|
92
|
+
function goToday(){
|
|
93
|
+
selectedDate.value= new Date(today())
|
|
94
|
+
chooseDate(new Date(today()))
|
|
95
|
+
}
|
|
96
|
+
function chooseDate(date: string | string[] | Date | Date[] | undefined){
|
|
97
|
+
emits('chooseDate',date)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const isOffDay = (date:CalendarDateSlotOptions) => {
|
|
101
|
+
const dayname: string = new Date(date.year,date.month, date.day)
|
|
102
|
+
|
|
103
|
+
.toLocaleString("en", { weekday: "short" })
|
|
104
|
+
.toLowerCase();
|
|
105
|
+
if (offdays.value.includes(dayname)) return true;
|
|
106
|
+
else return false;
|
|
121
107
|
};
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
|
|
109
|
+
const getEventQty = (date:CalendarDateSlotOptions)=>{
|
|
110
|
+
const checkdate = dateToISOWithoutConvert(new Date(date.year,date.month, date.day)).substring(0,10)
|
|
111
|
+
const recordlength = props.items.filter(item=>item.start==checkdate).length
|
|
112
|
+
return recordlength
|
|
113
|
+
}
|
|
114
|
+
const viewChange = (event: CalendarMonthChangeEvent) => {
|
|
115
|
+
emits("viewChange", event);
|
|
124
116
|
};
|
|
125
117
|
|
|
118
|
+
|
|
126
119
|
onMounted(() => {
|
|
127
|
-
|
|
120
|
+
offdays.value = getCurrentBranch()?.branch.offdays ?? [];
|
|
128
121
|
});
|
|
129
122
|
</script>
|
|
123
|
+
<style >
|
|
124
|
+
.smallcalendar td {
|
|
125
|
+
height: 3rem;
|
|
126
|
+
border: solid 1px #ccc;
|
|
127
|
+
}
|
|
128
|
+
.smallcalendar .p-datepicker table td > span {
|
|
129
|
+
widows: initial !important;
|
|
130
|
+
height: initial !important;
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -1,23 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<ImageToBase64Uploader
|
|
3
|
+
v-if="changable"
|
|
4
|
+
#default
|
|
5
|
+
:class="`w-${sizenumber} h-${sizenumber} place-content-center bg-white`"
|
|
6
|
+
@image-uploaded="handleBase64"
|
|
7
|
+
>
|
|
8
|
+
<NuxtImg
|
|
6
9
|
class="w-full h-full"
|
|
10
|
+
:key="imageKey"
|
|
11
|
+
:src="imagepath"
|
|
7
12
|
/>
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
</ImageToBase64Uploader>
|
|
14
|
+
<div
|
|
15
|
+
v-else
|
|
16
|
+
:class="`inline-block border rounded-lg w-${sizenumber} h-${sizenumber} bg-white text-black`"
|
|
17
|
+
>
|
|
18
|
+
<NuxtImg class="w-full h-full" :src="imagepath" />
|
|
10
19
|
</div>
|
|
11
20
|
</template>
|
|
12
21
|
<script lang="ts" setup>
|
|
13
|
-
|
|
14
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
15
|
-
* --remove-this-line-to-prevent-override--
|
|
16
|
-
* last change 2024-04-06
|
|
17
|
-
* author: Ks Tan
|
|
18
|
-
*/
|
|
22
|
+
// import {KeyValue} from ''
|
|
19
23
|
const props = defineProps<{
|
|
20
|
-
|
|
24
|
+
changable?: boolean;
|
|
25
|
+
uid?: string;
|
|
21
26
|
size: number;
|
|
22
27
|
}>();
|
|
28
|
+
const imageKey = ref(0);
|
|
29
|
+
const uid = computed(
|
|
30
|
+
() => props.uid ?? getUserProfile()?.uid,
|
|
31
|
+
);
|
|
32
|
+
// const xorgpath = getCurrentXorg() ? `${getCurrentXorg()}/` : "MC0wLTA/";
|
|
33
|
+
|
|
34
|
+
const sizenumber = props.size ?? 16;
|
|
35
|
+
const imagepath = getAvatarByUid(uid.value,sizenumber) //`${xorgpath}images/organization/${orgRecordId.value}`;
|
|
36
|
+
const imageData = ref("");
|
|
37
|
+
watch(
|
|
38
|
+
uid,
|
|
39
|
+
() => imageKey.value++,
|
|
40
|
+
);
|
|
41
|
+
const handleBase64 = async (data: string) => {
|
|
42
|
+
// const keyvalue = {
|
|
43
|
+
// key: "org-" + props.orgRecordId,
|
|
44
|
+
// value: data,
|
|
45
|
+
// };
|
|
46
|
+
// console.log("upload logo ", data);
|
|
47
|
+
// const uploadok = await useNuxtApp()
|
|
48
|
+
// .$OrganizationDoc()
|
|
49
|
+
// .getApi()
|
|
50
|
+
// .runUploadlogo(keyvalue);
|
|
51
|
+
// if (uploadok) {
|
|
52
|
+
// const realpath = `/api/${imagepath}`;
|
|
53
|
+
// await fetch(realpath, { cache: "reload", credentials: "include" });
|
|
54
|
+
// imageKey.value++;
|
|
55
|
+
// }
|
|
56
|
+
};
|
|
23
57
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
@click="openUploadDialog"
|
|
4
4
|
:title="selectedBase64Img"
|
|
5
|
-
class="
|
|
5
|
+
class="place-content-center image-to-base64-uploader rounded-lg border block"
|
|
6
6
|
>
|
|
7
7
|
<ClientOnly>
|
|
8
8
|
<slot name="default">
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
</slot>
|
|
12
12
|
|
|
13
13
|
<Dialog
|
|
14
|
-
v-if="dialogVisible"
|
|
14
|
+
v-if="dialogVisible" modal
|
|
15
15
|
v-model:visible="dialogVisible"
|
|
16
16
|
header="Image Upload"
|
|
17
|
-
:pt="{ root: { class: 'w-
|
|
17
|
+
:pt="{ root: { class: 'w-11/12' } }"
|
|
18
18
|
>
|
|
19
19
|
<div class="w-full grid grid-cols-2 gap-2">
|
|
20
20
|
<div class="w-7/8 border rounded p-4">
|
|
@@ -96,8 +96,8 @@ const handleImageUpload = (event) => {
|
|
|
96
96
|
reader.onload = (e) => {
|
|
97
97
|
const img = new Image();
|
|
98
98
|
img.onload = () => {
|
|
99
|
-
const maxWidth =
|
|
100
|
-
const maxHeight =
|
|
99
|
+
const maxWidth = 800; // Set your desired maximum width
|
|
100
|
+
const maxHeight = 600; // Set your desired maximum height
|
|
101
101
|
const scale = Math.min(maxWidth / img.width, maxHeight / img.height);
|
|
102
102
|
const scaledWidth = img.width * scale;
|
|
103
103
|
const scaledHeight = img.height * scale;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="flex flex-row text-xs cursor-pointer justify-end
|
|
3
|
+
class="flex flex-row text-xs cursor-pointer justify-end"
|
|
4
4
|
v-if="data?.updated && data?.updated != ''"
|
|
5
5
|
@click="viewHistories"
|
|
6
6
|
>
|
|
7
|
-
<ImageAvatar
|
|
7
|
+
<ImageAvatar
|
|
8
8
|
v-if="data?.updatedBy"
|
|
9
9
|
:id="data.updatedBy"
|
|
10
|
-
:size="
|
|
10
|
+
:size="36"
|
|
11
11
|
></ImageAvatar>
|
|
12
12
|
<div class="flex flex-col flex-1">
|
|
13
|
-
<TextDocStatus
|
|
13
|
+
<TextDocStatus
|
|
14
|
+
v-if="data?.documentStatus"
|
|
15
|
+
:docStatus="data?.documentStatus"
|
|
16
|
+
/>
|
|
14
17
|
<!-- <TextSubsubtitle class="text-gray-400 italic"
|
|
15
18
|
>{{ t("updated") }}:</TextSubsubtitle
|
|
16
19
|
> -->
|
|
@@ -26,7 +29,7 @@
|
|
|
26
29
|
<Timeline :value="events" class="w-full md:w-20rem">
|
|
27
30
|
<template #opposite="{ item }">
|
|
28
31
|
<div class="flex flex-row">
|
|
29
|
-
<ImageAvatar :email="item.email" :id="item.uid"
|
|
32
|
+
<ImageAvatar :email="item.email" :id="item.uid" />
|
|
30
33
|
<div class="flex flex-col">
|
|
31
34
|
<span>{{ item.fullName }}</span>
|
|
32
35
|
<RendererDateAge
|
|
@@ -34,51 +34,51 @@
|
|
|
34
34
|
v-bind="componentProps as InputSwitchProps"
|
|
35
35
|
@change="onChange"
|
|
36
36
|
/>
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
<!-- calendar component -->
|
|
39
|
-
<SimpleAppCalendarInput
|
|
39
|
+
<SimpleAppCalendarInput
|
|
40
40
|
v-else-if="
|
|
41
41
|
SimpleAppInputType.calendar == inputType ||
|
|
42
42
|
inputType == SimpleAppInputType.date
|
|
43
43
|
"
|
|
44
44
|
:pt="pt"
|
|
45
45
|
type="date"
|
|
46
|
-
v-model="modelValue"
|
|
46
|
+
v-model="modelValue"
|
|
47
47
|
:uuid="slotprops.uuid"
|
|
48
48
|
:placeholder="placeholder"
|
|
49
49
|
:setting="setting"
|
|
50
50
|
:readonly="isReadonly"
|
|
51
51
|
:componentProps="componentProps"
|
|
52
52
|
@change="onChange"
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
55
|
<!-- time component -->
|
|
56
|
-
<SimpleAppCalendarInput
|
|
56
|
+
<SimpleAppCalendarInput
|
|
57
57
|
v-else-if="inputType == SimpleAppInputType.time"
|
|
58
58
|
:pt="pt"
|
|
59
59
|
type="time"
|
|
60
|
-
v-model="modelValue"
|
|
60
|
+
v-model="modelValue"
|
|
61
61
|
:uuid="slotprops.uuid"
|
|
62
62
|
:placeholder="placeholder"
|
|
63
63
|
:setting="setting"
|
|
64
64
|
:readonly="isReadonly"
|
|
65
65
|
:componentProps="componentProps"
|
|
66
66
|
@change="onChange"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<SimpleAppCalendarInput
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<SimpleAppCalendarInput
|
|
70
70
|
v-else-if="inputType == SimpleAppInputType.datetime"
|
|
71
71
|
:pt="pt"
|
|
72
72
|
type="datetime"
|
|
73
|
-
v-model="modelValue"
|
|
73
|
+
v-model="modelValue"
|
|
74
74
|
:uuid="slotprops.uuid"
|
|
75
75
|
:placeholder="placeholder"
|
|
76
76
|
:setting="setting"
|
|
77
77
|
:readonly="isReadonly"
|
|
78
78
|
:componentProps="componentProps"
|
|
79
79
|
@change="onChange"
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
82
|
<!-- select/list component -->
|
|
83
83
|
<Listbox
|
|
84
84
|
v-model="modelValue"
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
@focus="setFocus"
|
|
280
280
|
:max-fraction-digits="2"
|
|
281
281
|
:min-fraction-digits="2"
|
|
282
|
-
mode="currency"
|
|
282
|
+
mode="currency"
|
|
283
283
|
:currency="getCurrency()"
|
|
284
284
|
:readonly="isReadonly"
|
|
285
285
|
:pt="pt"
|
|
@@ -304,6 +304,16 @@
|
|
|
304
304
|
:placeholder="placeholder"
|
|
305
305
|
v-bind="componentProps as TextareaProps"
|
|
306
306
|
/>
|
|
307
|
+
<Editor
|
|
308
|
+
v-else-if="inputType == SimpleAppInputType.html"
|
|
309
|
+
@update:modelValue="onChange"
|
|
310
|
+
:inputId="slotprops.uuid"
|
|
311
|
+
:path="setting.instancepath"
|
|
312
|
+
:placeholder="placeholder"
|
|
313
|
+
:readonly="isReadonly"
|
|
314
|
+
v-model="modelValue as string"
|
|
315
|
+
v-bind="componentProps as EditorProps"
|
|
316
|
+
/>
|
|
307
317
|
<InputText
|
|
308
318
|
v-else
|
|
309
319
|
v-model="modelValue as string"
|
|
@@ -351,12 +361,12 @@ import RadioButton, { RadioButtonProps } from "primevue/radiobutton";
|
|
|
351
361
|
import Rating, { RatingProps } from "primevue/rating";
|
|
352
362
|
import Slider, { SliderProps } from "primevue/slider";
|
|
353
363
|
import Textarea, { TextareaProps } from "primevue/textarea";
|
|
364
|
+
import Editor, { EditorProps } from "primevue/editor";
|
|
354
365
|
import { SimpleAppInputType } from "~/types";
|
|
355
366
|
const resetcount = ref(0);
|
|
356
367
|
const instancepath = ref("");
|
|
357
368
|
const modelValue = defineModel({ required: true });
|
|
358
369
|
|
|
359
|
-
|
|
360
370
|
const watchOnChange = ref(false);
|
|
361
371
|
const props = withDefaults(
|
|
362
372
|
defineProps<{
|
|
@@ -388,7 +398,6 @@ const props = withDefaults(
|
|
|
388
398
|
|
|
389
399
|
const pt = ref(props.pt);
|
|
390
400
|
|
|
391
|
-
|
|
392
401
|
if (props?.instancepath) instancepath.value = props.instancepath;
|
|
393
402
|
else if (props.setting?.instancepath)
|
|
394
403
|
instancepath.value = props.setting.instancepath;
|
|
@@ -432,7 +441,6 @@ const isReadonly = computed(() => {
|
|
|
432
441
|
}
|
|
433
442
|
});
|
|
434
443
|
|
|
435
|
-
|
|
436
444
|
const setFocus = (ev: any) => {
|
|
437
445
|
if (!isMobile()) ev.target.select();
|
|
438
446
|
};
|
|
@@ -464,7 +472,6 @@ const emits = defineEmits([
|
|
|
464
472
|
"update:docNoFormat",
|
|
465
473
|
]);
|
|
466
474
|
|
|
467
|
-
|
|
468
475
|
const onChange = () => {
|
|
469
476
|
if (props.setting.document.isReady()) {
|
|
470
477
|
pt.value = undefined;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import _ from 'lodash'
|
|
8
8
|
import {Md5} from 'ts-md5'
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
-
|
|
10
|
+
const myAvatarVersion = ref(0)
|
|
11
11
|
let orgLogo = ""
|
|
12
12
|
export const camelCaseToWords = (s: string) =>{
|
|
13
13
|
const result = s.replace(/([A-Z])/g, ' $1');
|
|
@@ -17,15 +17,19 @@ export const camelCaseToWords = (s: string) =>{
|
|
|
17
17
|
export const randomUUID = ()=> uuidv4()
|
|
18
18
|
export const md5=(s:string)=> new Md5().appendStr(s).end()
|
|
19
19
|
|
|
20
|
-
export const getAvatarLink = (email:string, size:number):string=>{
|
|
21
|
-
return `https://gravatar.com/avatar/${md5(email)}?size=${size}`;
|
|
22
|
-
//return
|
|
23
|
-
}
|
|
24
|
-
export const getAvatarByUid = (id:string, size
|
|
25
|
-
|
|
26
|
-
return `${
|
|
27
|
-
|
|
20
|
+
// export const getAvatarLink = (email:string, size:number):string=>{
|
|
21
|
+
// return `https://gravatar.com/avatar/${md5(email)}?size=${size}`;
|
|
22
|
+
// return useRuntimeConfig().public.AVATAR_URL+`${md5(email)}?size=${size}`
|
|
23
|
+
// }
|
|
24
|
+
export const getAvatarByUid = (id:string, size?:number):string=>{
|
|
25
|
+
if(size===undefined)size=160
|
|
26
|
+
return `${useRuntimeConfig().public.AVATAR_URL}/${md5(id)}?size=${size}`
|
|
28
27
|
}
|
|
28
|
+
export const updateAvatarVersion = ()=>{
|
|
29
|
+
myAvatarVersion.value++
|
|
30
|
+
useNuxtApp().$event('RefreshUser',getUserProfile().uid)
|
|
31
|
+
}
|
|
32
|
+
export const getAvatarVersion = ()=>myAvatarVersion
|
|
29
33
|
|
|
30
34
|
export const getDefaultLocale =()=> useNuxtApp().$i18n.defaultLocale
|
|
31
35
|
export const t = (txt:string,options?:any):string => typeof txt !='string' ?'' : useNuxtApp().$i18n.t(txt.trim(),options)
|
|
@@ -45,8 +45,11 @@ export default defineEventHandler(async (event:any) => {
|
|
|
45
45
|
// }
|
|
46
46
|
|
|
47
47
|
const frontEndRes = event.node.res;
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
const url = process.env.SIMPLEAPP_BACKEND_URL + `/profile/${documentLink}`;
|
|
49
50
|
// console.warn('backend server-----',req.method,url,forwardData)
|
|
51
|
+
|
|
52
|
+
|
|
50
53
|
const axiosConfig: any = {
|
|
51
54
|
method: req.method,
|
|
52
55
|
url: url,
|
|
@@ -56,7 +59,12 @@ export default defineEventHandler(async (event:any) => {
|
|
|
56
59
|
data: forwardData,
|
|
57
60
|
params: forwardData,
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
|
|
63
|
+
if(documentLink=='avatar' ){
|
|
64
|
+
axiosConfig.url = process.env.AVATAR_URL
|
|
65
|
+
delete axiosConfig.params
|
|
66
|
+
}
|
|
67
|
+
// console.log("axiosConfig",axiosConfig)
|
|
60
68
|
// if(key === 'system') {
|
|
61
69
|
// axiosConfig.headers["X-Global"] = true;
|
|
62
70
|
// delete axiosConfig.headers["X-Org"];
|
|
@@ -68,6 +76,7 @@ export default defineEventHandler(async (event:any) => {
|
|
|
68
76
|
// }
|
|
69
77
|
|
|
70
78
|
axios(axiosConfig).then((res) => {
|
|
79
|
+
// console.log("RRes",res)
|
|
71
80
|
if (res.headers['content-type'] === 'image/png') {
|
|
72
81
|
// Set the response headers for the image
|
|
73
82
|
frontEndRes.setHeader('Content-Type', 'image/png');
|
|
@@ -15,6 +15,8 @@ export const getAllDocuments=():DocumentMetaData[] => [
|
|
|
15
15
|
{docName:'<%= d['docname'].toLowerCase() %>',docType:'<%= d['doctype'].toUpperCase()%>',page: '<%=d['pagetype']%>', isolationType:'<%=conf['isolationType']%>',
|
|
16
16
|
documentDate:'<%=conf['documentDate']??""%>', docNumber:<%=conf['generateDocumentNumber']??false%>,
|
|
17
17
|
viewer: () => import('~/components/viewer/Viewer<%=d['docname']%>.vue'),
|
|
18
|
-
docClass: useNuxtApp().$<%=d['docname']%>Doc()
|
|
18
|
+
docClass: useNuxtApp().$<%=d['docname']%>Doc(),
|
|
19
|
+
webhook:<%~ JSON.stringify(conf['webhook'])%>
|
|
20
|
+
},
|
|
19
21
|
<%}%>
|
|
20
22
|
]
|