@simitgroup/simpleapp-generator 1.5.0-alpha → 1.6.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/README.md +3 -1
- package/dist/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +10 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/index.d.ts +2 -0
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +5 -1
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/keyvaluepair.d.ts +3 -0
- package/dist/buildinschemas/keyvaluepair.d.ts.map +1 -0
- package/dist/buildinschemas/keyvaluepair.js +28 -0
- package/dist/buildinschemas/keyvaluepair.js.map +1 -0
- package/dist/buildinschemas/message.d.ts +3 -0
- package/dist/buildinschemas/message.d.ts.map +1 -0
- package/dist/buildinschemas/message.js +34 -0
- package/dist/buildinschemas/message.js.map +1 -0
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +18 -1
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/systemmessage.d.ts +3 -0
- package/dist/buildinschemas/systemmessage.d.ts.map +1 -0
- package/dist/buildinschemas/systemmessage.js +43 -0
- package/dist/buildinschemas/systemmessage.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.d.ts.map +1 -1
- package/dist/generate.js +37 -9
- package/dist/generate.js.map +1 -1
- package/dist/processors/bpmnbuilder.d.ts.map +1 -1
- package/dist/processors/bpmnbuilder.js +23 -32
- package/dist/processors/bpmnbuilder.js.map +1 -1
- package/dist/processors/jrxmlbuilder.d.ts +3 -0
- package/dist/processors/jrxmlbuilder.d.ts.map +1 -0
- package/dist/processors/jrxmlbuilder.js +57 -0
- package/dist/processors/jrxmlbuilder.js.map +1 -0
- package/dist/type.d.ts +6 -0
- package/dist/type.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/branch.ts +10 -0
- package/src/buildinschemas/index.ts +2 -0
- package/src/buildinschemas/keyvaluepair.ts +26 -0
- package/src/buildinschemas/organization.ts +18 -1
- package/src/buildinschemas/systemmessage.ts +42 -0
- package/src/framework.ts +3 -2
- package/src/generate.ts +41 -13
- package/src/processors/bpmnbuilder.ts +34 -38
- package/src/processors/jrxmlbuilder.ts +38 -0
- package/src/type.ts +7 -1
- package/templates/basic/nest/apischema.ts.eta +1 -1
- package/templates/basic/nest/controller.ts.eta +37 -19
- package/templates/basic/nest/resolver.ts.eta +1 -1
- package/templates/basic/nest/service.ts.eta +22 -4
- package/templates/basic/nest/type.ts.eta +2 -2
- package/templates/basic/nuxt/pages.form.vue.eta +1 -1
- package/templates/basic/nuxt/pages.mobile.landing.vue.eta +4 -61
- package/templates/nest/src/app.module.ts.eta +2 -0
- package/templates/nest/src/cloudapi/cloudapi.module.ts._eta +15 -0
- package/templates/nest/src/cloudapi/cloudapi.service.ts._eta +15 -0
- package/templates/nest/src/printapi/api/.gitignore.eta +4 -0
- package/templates/nest/src/printapi/api/.npmignore.eta +1 -0
- package/templates/nest/src/printapi/api/.openapi-generator/FILES.eta +8 -0
- package/templates/nest/src/printapi/api/.openapi-generator/VERSION.eta +1 -0
- package/templates/nest/src/printapi/api/.openapi-generator-ignore.eta +23 -0
- package/templates/nest/src/printapi/api/api.ts.eta +223 -0
- package/templates/nest/src/printapi/api/base.ts.eta +86 -0
- package/templates/nest/src/printapi/api/common.ts.eta +150 -0
- package/templates/nest/src/printapi/api/configuration.ts.eta +110 -0
- package/templates/nest/src/printapi/api/git_push.sh.eta +57 -0
- package/templates/nest/src/printapi/api/index.ts.eta +18 -0
- package/templates/nest/src/printapi/api/openapitools.json.eta +7 -0
- package/templates/nest/src/printapi/printapi.module.ts.eta +15 -0
- package/templates/nest/src/printapi/printapi.service.ts.eta +42 -0
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +25 -0
- package/templates/nest/src/simpleapp/generate/commons/robotuser.service.ts.eta +112 -0
- package/templates/nest/src/simpleapp/generate/commons/roles/roles.enum.ts.eta +7 -0
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +8 -5
- package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +73 -0
- package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +104 -0
- package/templates/nest/src/simpleapp/generate/processors/docno.processor.ts.eta +77 -0
- package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +115 -0
- package/templates/nest/src/simpleapp/generate/processors/perm.processor.ts.eta +71 -0
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +29 -9
- package/templates/nest/src/simpleapp/generate/processors/sysmsg.processor.ts.eta +49 -0
- package/templates/nest/src/simpleapp/generate/processors/tenant.processor.ts.eta +52 -0
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +0 -1
- package/templates/nest/src/simpleapp/generate/types/schema.type.ts.eta +191 -0
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +208 -6
- package/templates/nest/src/simpleapp/generate/workflow/workflow.config.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +2 -2
- package/templates/nest/src/simpleapp/generate/workflow/workflow.delegate.ts.eta +33 -28
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +107 -20
- package/templates/nest/src/simpleapp/generate/workflow/workflow.type.ts.eta +4 -4
- package/templates/nest/src/simpleapp/services/sysmsg.service.ts._etaxxx +43 -0
- package/templates/nest/src/simpleapp/services/userresolver.service.ts._eta +70 -0
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +10 -3
- package/templates/nest/src/simpleapp/types/index.ts._eta +11 -0
- package/templates/nest/src/simpleapp/workflows/listeners/simpleapp.listener.ts.eta +31 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +1 -1
- package/templates/nuxt/components/button/ButtonAction.vue._eta +11 -5
- package/templates/nuxt/components/form/{FormBranch.vue.eta → FormBranch.vue._eta} +1 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta.vue +38 -0
- package/templates/nuxt/components/image/ImageOrganization.vue.eta.vue +40 -0
- package/templates/nuxt/components/image/ImageToBase64Uploader.vue.eta.vue +147 -0
- package/templates/nuxt/components/list/ListItem.vue.eta +24 -0
- package/templates/nuxt/components/list/ListMessages.vue.eta +89 -0
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +93 -7
- package/templates/nuxt/components/text/TextBold.vue._eta +13 -0
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +11 -2
- package/templates/nuxt/composables/graphquery.generate.ts.eta +7 -7
- package/templates/nuxt/composables/hotvalue.generate.ts.eta +30 -0
- package/templates/nuxt/composables/pusher.ts._eta +13 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +2 -3
- package/templates/nuxt/composables/sysmessage.generate.ts.eta +20 -0
- package/templates/nuxt/composables/workflow.generate.ts.eta +9 -4
- package/templates/nuxt/layouts/mobile.vue._eta +31 -42
- package/templates/nuxt/nuxt.config.ts._eta +2 -2
- package/templates/nuxt/othermodules.d.ts.eta +449 -0
- package/templates/nuxt/pages/[xorg]/mobile/organization/[id].vue._eta +40 -0
- package/templates/nuxt/pages/[xorg]/mobile/organization/{index.vue.eta → index.vue.aetaz} +16 -13
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +21 -15
- package/templates/nuxt/plugins/40.pusher.ts.eta +18 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +7 -1
- package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +4 -1
- package/templates/nuxt/types/schema.ts.eta +8 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +3 -5
- package/templates/printformats/template.jrxml._eta +27 -0
- package/templates/project/groups/admin.json.eta +6 -1
- package/templates/project/jsonschemas/branch.json._eta +113 -0
- package/templates/project/jsonschemas/invoice.json._eta +5 -1
- package/templates/project/jsonschemas/organization.json._eta +111 -0
- package/templates/project/lang/default._json +70 -150
- package/templates/workflow/next/listener.ts.eta +6 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nest/src/simpleapp/workflows/listeners/simpleapp.listener.ts._eta +0 -26
- /package/templates/nest/src/simpleapp/services/{autoinc.service.ts.eta → autoinc.service.ts.etaxx} +0 -0
- /package/templates/nest/src/simpleapp/services/{branch.service.ts.eta → branch.service.ts.etaxxx} +0 -0
- /package/templates/nest/src/simpleapp/services/{docno.service.ts.eta → docno.service.ts.etaxxx} +0 -0
- /package/templates/nest/src/simpleapp/services/{org.service.ts.eta → org.service.ts.etaxxx} +0 -0
- /package/templates/nest/src/simpleapp/services/{perm.service.ts.eta → perm.service.ts.etaxxx} +0 -0
- /package/templates/nest/src/simpleapp/services/{tenant.service.ts.eta → tenant.service.ts.etaxxx} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ImageToBase64Uploader
|
|
3
|
+
v-if="changable"
|
|
4
|
+
@image-uploaded="handleBase64"
|
|
5
|
+
#default
|
|
6
|
+
class="w-20 h-20"
|
|
7
|
+
>
|
|
8
|
+
<Avatar
|
|
9
|
+
:image="getAvatarLink(email ?? '', size)"
|
|
10
|
+
shape="circle"
|
|
11
|
+
size="xlarge"
|
|
12
|
+
/>
|
|
13
|
+
</ImageToBase64Uploader>
|
|
14
|
+
<div v-else class="inline-block border rounded-lg w-20 h-20">
|
|
15
|
+
<Avatar
|
|
16
|
+
:image="getAvatarLink(email ?? '', size)"
|
|
17
|
+
shape="circle"
|
|
18
|
+
size="xlarge"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
/**
|
|
24
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
25
|
+
* IT IS NOT CHANGABLE
|
|
26
|
+
* last change 2024-04-06
|
|
27
|
+
* author: Ks Tan
|
|
28
|
+
*/
|
|
29
|
+
const props = defineProps<{
|
|
30
|
+
email?: string;
|
|
31
|
+
size: number;
|
|
32
|
+
changable: boolean;
|
|
33
|
+
}>();
|
|
34
|
+
const imageData = ref("");
|
|
35
|
+
const handleBase64 = (data: string) => {
|
|
36
|
+
imageData.value = data;
|
|
37
|
+
};
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ImageToBase64Uploader
|
|
3
|
+
v-if="changable"
|
|
4
|
+
#default
|
|
5
|
+
class="w-20 h-20 place-content-center"
|
|
6
|
+
@image-uploaded="handleBase64"
|
|
7
|
+
>
|
|
8
|
+
<Image :src="imageData"></Image>
|
|
9
|
+
</ImageToBase64Uploader>
|
|
10
|
+
<div v-else class="inline-block border rounded-lg w-20 h-20">
|
|
11
|
+
<Image :src="imageData"></Image>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
// import {KeyValue} from ''
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
changable: boolean;
|
|
18
|
+
}>();
|
|
19
|
+
const imageData = ref("");
|
|
20
|
+
const handleBase64 = async (data: string) => {
|
|
21
|
+
const keyvalue = {
|
|
22
|
+
key: "organizationLogo",
|
|
23
|
+
value: data,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const uploadok = await useNuxtApp()
|
|
27
|
+
.$OrganizationDoc()
|
|
28
|
+
.getApi()
|
|
29
|
+
.runUploadlogo(keyvalue);
|
|
30
|
+
if (uploadok) {
|
|
31
|
+
await loadLogo();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const loadLogo = async () => {
|
|
35
|
+
await refreshOrgLogo();
|
|
36
|
+
imageData.value = getOrgLogo();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
onMounted(async () => await loadLogo());
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
@click="openUploadDialog"
|
|
4
|
+
:title="selectedBase64Img"
|
|
5
|
+
class="place-content-center image-to-base64-uploader rounded-lg border block"
|
|
6
|
+
>
|
|
7
|
+
<slot name="default">
|
|
8
|
+
<Image v-if="selectedBase64Img" :src="selectedBase64Img" />
|
|
9
|
+
<i v-else class="pi pi-upload text-3xl"></i>
|
|
10
|
+
</slot>
|
|
11
|
+
|
|
12
|
+
<Dialog
|
|
13
|
+
v-model:visible="dialogVisible"
|
|
14
|
+
header="Image Upload"
|
|
15
|
+
:pt="{ root: { class: 'w-4/5' } }"
|
|
16
|
+
>
|
|
17
|
+
<div class="upload-container">
|
|
18
|
+
<input
|
|
19
|
+
type="file"
|
|
20
|
+
ref="fileInput"
|
|
21
|
+
accept="image/*"
|
|
22
|
+
@change="handleImageUpload"
|
|
23
|
+
/>
|
|
24
|
+
<div id="preview" v-if="scaledImage" class="w-7/8">
|
|
25
|
+
<Cropper
|
|
26
|
+
ref="cropperInstance"
|
|
27
|
+
:src="scaledImage"
|
|
28
|
+
:stencil-props="{ aspectRatio: 1 }"
|
|
29
|
+
:options="cropperOptions"
|
|
30
|
+
@change="changeChropper"
|
|
31
|
+
/>
|
|
32
|
+
<!-- :maxWidth="50"
|
|
33
|
+
:maxHeight="50" -->
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<template #footer>
|
|
37
|
+
<div class="flex flex-row gap-4">
|
|
38
|
+
<ButtonWarning @click="dialogVisible = false">{{
|
|
39
|
+
t("cancel")
|
|
40
|
+
}}</ButtonWarning>
|
|
41
|
+
<ButtonPrimary @click="confirm">{{ t("confirm") }}</ButtonPrimary>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
</Dialog>
|
|
45
|
+
</button>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
/**
|
|
50
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
51
|
+
* IT IS NOT CHANGABLE
|
|
52
|
+
* last change 2024-04-06
|
|
53
|
+
* author: Ks Tan
|
|
54
|
+
*/
|
|
55
|
+
// Assuming the Dialog component and Cropper component are globally available or imported in a parent component
|
|
56
|
+
import { defineEmits } from "vue";
|
|
57
|
+
// import Cropper from 'cropperjs'; // Assuming CropperJS is installed using a package manager
|
|
58
|
+
import { Cropper } from "vue-advanced-cropper";
|
|
59
|
+
import "vue-advanced-cropper/dist/style.css";
|
|
60
|
+
const selectedBase64Img = ref("");
|
|
61
|
+
const cropedBase64Img = ref("");
|
|
62
|
+
const dialogVisible = ref(false);
|
|
63
|
+
const previewImage = ref<string | null>(null);
|
|
64
|
+
const scaledImage = ref<string | null>(null);
|
|
65
|
+
const image = ref<string | null>(null);
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits<{
|
|
68
|
+
(event: "image-uploaded", imageData: string): void;
|
|
69
|
+
}>();
|
|
70
|
+
|
|
71
|
+
const openUploadDialog = () => {
|
|
72
|
+
dialogVisible.value = true;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const handleImageUpload = (event) => {
|
|
76
|
+
const file = event.target.files?.[0];
|
|
77
|
+
if (file) {
|
|
78
|
+
const reader = new FileReader();
|
|
79
|
+
reader.onload = (e) => {
|
|
80
|
+
const img = new Image();
|
|
81
|
+
img.onload = () => {
|
|
82
|
+
const maxWidth = 800; // Set your desired maximum width
|
|
83
|
+
const maxHeight = 600; // Set your desired maximum height
|
|
84
|
+
const scale = Math.min(maxWidth / img.width, maxHeight / img.height);
|
|
85
|
+
const scaledWidth = img.width * scale;
|
|
86
|
+
const scaledHeight = img.height * scale;
|
|
87
|
+
|
|
88
|
+
const canvas = document.createElement("canvas");
|
|
89
|
+
canvas.width = scaledWidth;
|
|
90
|
+
canvas.height = scaledHeight;
|
|
91
|
+
const ctx = canvas.getContext("2d");
|
|
92
|
+
ctx.drawImage(img, 0, 0, scaledWidth, scaledHeight);
|
|
93
|
+
|
|
94
|
+
scaledImage.value = canvas.toDataURL("image/jpeg"); // Replace with your preferred format
|
|
95
|
+
};
|
|
96
|
+
img.src = e.target.result;
|
|
97
|
+
};
|
|
98
|
+
reader.readAsDataURL(file);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// const handleImageUpload = (event) => {
|
|
103
|
+
// const file = event.target.files?.[0];
|
|
104
|
+
// if (file) {
|
|
105
|
+
// const reader = new FileReader();
|
|
106
|
+
// reader.onload = (e) => {
|
|
107
|
+
// previewImage.value = e.target.result as string;
|
|
108
|
+
// // Initialize Cropper instance automatically
|
|
109
|
+
// // if (cropperInstance.value) {
|
|
110
|
+
// // cropperInstance.value.replace(previewImage.value); // Update Cropper with new image
|
|
111
|
+
// // }
|
|
112
|
+
// };
|
|
113
|
+
// reader.readAsDataURL(file);
|
|
114
|
+
// }
|
|
115
|
+
// };
|
|
116
|
+
const changeChropper = (imageEvent: any) => {
|
|
117
|
+
// console.log('changeChropper',imageEvent)
|
|
118
|
+
// if(cropedBase64Img.value==''){
|
|
119
|
+
// cropedBase64Img.value = imageEvent.image.src
|
|
120
|
+
// }else{
|
|
121
|
+
// cropedBase64Img.value=''
|
|
122
|
+
// }
|
|
123
|
+
};
|
|
124
|
+
const cropperInstance = ref();
|
|
125
|
+
const cropperOptions = {
|
|
126
|
+
aspectRatio: 16 / 9, // Optional: Set aspect ratio for cropping
|
|
127
|
+
zoomable: true, // Optional: Allow zooming
|
|
128
|
+
movable: true, // Optional: Allow moving the crop area
|
|
129
|
+
viewMode: 1, // Optional: Set initial zoom level
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const confirm = () => {
|
|
133
|
+
const imgevent = cropperInstance.value.getResult();
|
|
134
|
+
selectedBase64Img.value = imgevent.canvas.toDataURL("image/jpeg");
|
|
135
|
+
emit("image-uploaded", selectedBase64Img.value);
|
|
136
|
+
|
|
137
|
+
dialogVisible.value = false;
|
|
138
|
+
resetFileInput(); // Optional: Reset file input value
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const resetFileInput = () => {
|
|
142
|
+
const fileInput = ref(null);
|
|
143
|
+
if (fileInput.value) {
|
|
144
|
+
fileInput.value = null;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-col border-b border-gray-200 dark:border-gray-700 p-1">
|
|
3
|
+
<label class="dark:text-gray-400">
|
|
4
|
+
<slot name="label">
|
|
5
|
+
{{ label }}
|
|
6
|
+
</slot>
|
|
7
|
+
</label>
|
|
8
|
+
<div class="dark:text-white text-right">
|
|
9
|
+
<slot name="default">{{ value }}</slot>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
/**
|
|
15
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
16
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
17
|
+
* last change 2023-04-24
|
|
18
|
+
* Author: Ks Tan
|
|
19
|
+
*/
|
|
20
|
+
const props = defineProps<{
|
|
21
|
+
label?: string;
|
|
22
|
+
value?: string;
|
|
23
|
+
}>();
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<Sidebar v-model:visible="messagesvisible" :header="t('messages')">
|
|
4
|
+
<ListView :list="list" #default="{ item, index }" @click="openMessage">
|
|
5
|
+
<div class="flex flex-col">
|
|
6
|
+
<TextBold v-if="!item.read">{{ item.messageTitle }}</TextBold>
|
|
7
|
+
<TextSubtitle v-else>{{ item.messageTitle }}</TextSubtitle>
|
|
8
|
+
<TextSubtitle class="text-xs"><RendererDateTime class="text-sm" v-model="item.created" /></TextSubtitle>
|
|
9
|
+
<TextSubtitle class="text-sm line-clamp-2">{{
|
|
10
|
+
item.description
|
|
11
|
+
}}</TextSubtitle>
|
|
12
|
+
</div>
|
|
13
|
+
</ListView>
|
|
14
|
+
<Dialog v-model:visible="viewmsg" :header="selectedMsg?.messageTitle">
|
|
15
|
+
<template #default>
|
|
16
|
+
<div v-if="selectedMsg" class="flex flex-col w-full">
|
|
17
|
+
<TextSubtitle class="text-sm"
|
|
18
|
+
><RendererDateTime v-model="selectedMsg.created"></RendererDateTime
|
|
19
|
+
></TextSubtitle>
|
|
20
|
+
<div class="whitespace-pre-line">{{ selectedMsg?.description}}</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div v-else>
|
|
23
|
+
<TextDanger>{{ t("cannotObtainMessage") }}</TextDanger>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<template #footer>
|
|
27
|
+
<ButtonPrimary @click="viewmsg=false">{{t('close')}}</ButtonPrimary>
|
|
28
|
+
<ButtonDanger @click="deleteMsg">{{t('delete')}}</ButtonDanger>
|
|
29
|
+
</template>
|
|
30
|
+
</Dialog>
|
|
31
|
+
<ConfirmPopup></ConfirmPopup>
|
|
32
|
+
</Sidebar>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
// import { sysMessage } from "~/composables/messages.generate";
|
|
37
|
+
import { Systemmessage } from "~/simpleapp/generate/openapi";
|
|
38
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
39
|
+
import ButtonDanger from "../button/ButtonDanger.vue";
|
|
40
|
+
const confirm = useConfirm();
|
|
41
|
+
const list = ref<Systemmessage[]>();
|
|
42
|
+
const viewmsg = ref(false);
|
|
43
|
+
const selectedMsg = ref<Systemmessage>();
|
|
44
|
+
const selectedIndex = ref(0)
|
|
45
|
+
const messagesvisible = defineModel<boolean>({ required: true });
|
|
46
|
+
|
|
47
|
+
const openMessage = async (index: number, item: Systemmessage) => {
|
|
48
|
+
selectedMsg.value = await useNuxtApp().$SystemmessageDoc().runReadmsg(item?._id??'')
|
|
49
|
+
selectedIndex.value = index
|
|
50
|
+
const rowIndex = list.value?.findIndex(listitem=>listitem._id == item._id) ?? -1
|
|
51
|
+
if(list.value && rowIndex >=0 )list.value[rowIndex].read=true
|
|
52
|
+
console.log("selectedMsg.value",selectedMsg.value)
|
|
53
|
+
viewmsg.value=true
|
|
54
|
+
|
|
55
|
+
};
|
|
56
|
+
const deleteMsg = async (clickEvent:MouseEvent) =>{
|
|
57
|
+
|
|
58
|
+
confirm.require({
|
|
59
|
+
target: clickEvent.target as HTMLElement,
|
|
60
|
+
header: t("deleteRecord"),
|
|
61
|
+
message: `${t("deleteThisRecord?")}`,
|
|
62
|
+
|
|
63
|
+
// icon: "pi pi-exclamation-triangle gap-4",
|
|
64
|
+
acceptClass: "p-button-danger",
|
|
65
|
+
accept: async () => {
|
|
66
|
+
const id = selectedMsg.value?._id ??''
|
|
67
|
+
const deleteresult = await useNuxtApp().$SystemmessageDoc().delete(id)
|
|
68
|
+
if(deleteresult) {
|
|
69
|
+
viewmsg.value = false
|
|
70
|
+
list.value?.splice(selectedIndex.value,1)
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
const refresh = async ()=>{
|
|
79
|
+
list.value = await sysMessage.download()
|
|
80
|
+
}
|
|
81
|
+
onMounted(async () => {
|
|
82
|
+
await refresh()
|
|
83
|
+
listenDocumentList('systemmessage',()=>{
|
|
84
|
+
refresh()
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</script>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</template>
|
|
47
47
|
<template #option="{ index, option }">
|
|
48
48
|
<slot name="option" :index="index" :option="option">
|
|
49
|
-
<div class="flex flex-row
|
|
49
|
+
<div class="flex flex-row text-white">
|
|
50
50
|
<div class="w w-1/3">{{ option.code }}</div>
|
|
51
51
|
<div class="w w-2/3">{{ option.label }}</div>
|
|
52
52
|
</div>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</slot>
|
|
33
33
|
<ContextMenu ref="menu" :model="menus as MenuItem[]" />
|
|
34
34
|
</template>
|
|
35
|
-
</MobileToolbar>
|
|
35
|
+
</MobileToolbar>
|
|
36
36
|
<ConfirmDialog></ConfirmDialog>
|
|
37
37
|
</div>
|
|
38
38
|
<div v-else class="simpleapp-tool-bar">
|
|
@@ -65,14 +65,48 @@
|
|
|
65
65
|
</Toolbar>
|
|
66
66
|
<ConfirmPopup></ConfirmPopup>
|
|
67
67
|
</div>
|
|
68
|
+
<Dialog v-model:visible="visiblePrintFormats" :header="t('printFormats')">
|
|
69
|
+
<div>
|
|
70
|
+
<ListView
|
|
71
|
+
:list="printformats"
|
|
72
|
+
#default="{ item, index }"
|
|
73
|
+
@click="printPdf"
|
|
74
|
+
>
|
|
75
|
+
<div class="flex flex-col">
|
|
76
|
+
<TextBold>{{ item.formatName }}</TextBold>
|
|
77
|
+
<TextSubtitle>{{ item.description }}</TextSubtitle>
|
|
78
|
+
</div>
|
|
79
|
+
</ListView>
|
|
80
|
+
</div>
|
|
81
|
+
</Dialog>
|
|
82
|
+
<Sidebar
|
|
83
|
+
v-model:visible="visiblePrintPreview"
|
|
84
|
+
:header="t('printPreview')"
|
|
85
|
+
position="bottom"
|
|
86
|
+
>
|
|
87
|
+
|
|
88
|
+
<TextDanger v-if="printservererror || !printstr">
|
|
89
|
+
{{ t("printServerError") }}
|
|
90
|
+
</TextDanger>
|
|
91
|
+
<vue-pdf-embed v-else-if="isMobile()"
|
|
92
|
+
:source="printstr"
|
|
93
|
+
:disableTextLayer="true"
|
|
94
|
+
/>
|
|
95
|
+
<iframe v-else width="100%" height="100%" :src="printstr"></iframe>
|
|
96
|
+
|
|
97
|
+
</Sidebar>
|
|
68
98
|
</template>
|
|
69
99
|
<script setup lang="ts">
|
|
70
100
|
/**
|
|
71
101
|
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
72
|
-
*
|
|
73
|
-
* last change 2024-02
|
|
102
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
103
|
+
* last change 2024-04-02
|
|
74
104
|
* author: Ks Tan
|
|
75
105
|
*/
|
|
106
|
+
import VuePdfEmbed from 'vue-pdf-embed'
|
|
107
|
+
|
|
108
|
+
// import VuePdfKit from 'vue-pdf-kit'
|
|
109
|
+
// import 'vue-pdf-kit/dist/style.css'
|
|
76
110
|
|
|
77
111
|
import { SimpleAppClient } from "~/simpleapp/generate/clients/SimpleAppClient";
|
|
78
112
|
import { useConfirm } from "primevue/useconfirm";
|
|
@@ -81,10 +115,15 @@ import { MenuItem } from "primevue/menuitem";
|
|
|
81
115
|
import { MenuItemCommandEvent } from "primevue/menuitem";
|
|
82
116
|
const confirm = useConfirm();
|
|
83
117
|
const emits = defineEmits(["on", "close"]);
|
|
118
|
+
const visiblePrintFormats = ref(false);
|
|
119
|
+
const visiblePrintPreview = ref(false);
|
|
120
|
+
const printstr = ref();
|
|
121
|
+
const printservererror = ref(false);
|
|
84
122
|
const props = defineProps<{
|
|
85
123
|
document: SimpleAppClient<any, any>;
|
|
86
124
|
disableaction?: string[];
|
|
87
125
|
}>();
|
|
126
|
+
|
|
88
127
|
const createData = async () => {
|
|
89
128
|
try {
|
|
90
129
|
return await doc.create();
|
|
@@ -111,13 +150,13 @@ const doc = props.document;
|
|
|
111
150
|
const data = doc.getReactiveData();
|
|
112
151
|
type Datatype = keyof typeof data.value;
|
|
113
152
|
const config = doc.getSchema()["x-simpleapp-config"];
|
|
114
|
-
const titlefield = (config.
|
|
153
|
+
const titlefield = (config.documentTitle ?? config.uniqueKey) as Datatype;
|
|
115
154
|
const title = computed(() =>
|
|
116
155
|
data.value[titlefield as Datatype]
|
|
117
156
|
? data.value[titlefield as Datatype]
|
|
118
157
|
: t(doc.getDocName()),
|
|
119
158
|
);
|
|
120
|
-
|
|
159
|
+
const printformats = doc.getSchema()["x-simpleapp-config"]?.printFormats;
|
|
121
160
|
const menu = ref();
|
|
122
161
|
const menus = computed(() =>
|
|
123
162
|
[...getActions(), ...getDocActions()].filter((item) => showMenuButton(item)),
|
|
@@ -142,8 +181,27 @@ const emitMobileEvent = (itemevent: MenuItemCommandEvent) => {
|
|
|
142
181
|
emitEvent(itemevent.item, event);
|
|
143
182
|
};
|
|
144
183
|
|
|
184
|
+
const printPdf = async (index: number, format: any) => {
|
|
185
|
+
printservererror.value = false;
|
|
186
|
+
const formatid: string = format.formatId;
|
|
187
|
+
visiblePrintPreview.value = true;
|
|
188
|
+
// console.log("formatidformatid", format);
|
|
189
|
+
try {
|
|
190
|
+
const tmp: any = await doc
|
|
191
|
+
.getApi()
|
|
192
|
+
.runPrint(data.value._id ?? "", formatid);
|
|
193
|
+
printstr.value =
|
|
194
|
+
"data:application/pdf;base64," +
|
|
195
|
+
tmp.data;
|
|
196
|
+
} catch (e) {
|
|
197
|
+
printservererror.value = true;
|
|
198
|
+
printstr.value = "";
|
|
199
|
+
console.error("error from print server", e);
|
|
200
|
+
}
|
|
201
|
+
};
|
|
145
202
|
const getActions = () => {
|
|
146
203
|
const actions = doc.getActions();
|
|
204
|
+
const printformats = doc.getSchema()["x-simpleapp-config"]?.printFormats;
|
|
147
205
|
const crudmenus: any[] = [];
|
|
148
206
|
|
|
149
207
|
// Object.keys(actions).forEach((key)=>{ //crud, api, docstatus
|
|
@@ -160,11 +218,26 @@ const getActions = () => {
|
|
|
160
218
|
});
|
|
161
219
|
}
|
|
162
220
|
});
|
|
221
|
+
if (printformats && printformats.length > 0) {
|
|
222
|
+
crudmenus.push({
|
|
223
|
+
action: "print",
|
|
224
|
+
label: t("print"),
|
|
225
|
+
type: "crud",
|
|
226
|
+
icon: "pi pi-print",
|
|
227
|
+
command: showPrintFormats,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
console.log("crudmenus", crudmenus);
|
|
231
|
+
|
|
163
232
|
// })
|
|
164
233
|
return crudmenus;
|
|
165
234
|
};
|
|
166
235
|
|
|
167
|
-
const
|
|
236
|
+
const showPrintFormats = () => {
|
|
237
|
+
visiblePrintFormats.value = true;
|
|
238
|
+
// console.log("showPrintFormatContext",itemEvent)
|
|
239
|
+
};
|
|
240
|
+
const emitEvent = async (menu: FormMenu, clickEvent: Event | MouseEvent) => {
|
|
168
241
|
if (menu.action == "delete") {
|
|
169
242
|
confirm.require({
|
|
170
243
|
target: clickEvent.target as HTMLElement,
|
|
@@ -178,7 +251,9 @@ const emitEvent = async (menu: FormMenu, clickEvent: MouseEvent) => {
|
|
|
178
251
|
},
|
|
179
252
|
});
|
|
180
253
|
} else {
|
|
181
|
-
if (menu.action == "
|
|
254
|
+
if (menu.action == "print") {
|
|
255
|
+
showPrintFormats();
|
|
256
|
+
} else if (menu.action == "create") {
|
|
182
257
|
if (await createData()) emits("on", FormCrudEvent.create);
|
|
183
258
|
} else if (menu.action == "update") {
|
|
184
259
|
if (await updateData()) emits("on", FormCrudEvent.update);
|
|
@@ -214,6 +289,7 @@ const getDocActions = () => {
|
|
|
214
289
|
const showMenuButton = (menu: FormMenu) => {
|
|
215
290
|
if (menu.separator) return true;
|
|
216
291
|
|
|
292
|
+
if (menu.action == "print") return true;
|
|
217
293
|
//all document status cannot direct apply regardless new or draft
|
|
218
294
|
if (menu.type == "docstatus") return true;
|
|
219
295
|
|
|
@@ -262,3 +338,13 @@ const getActionIcon = (actionName: string) => {
|
|
|
262
338
|
return `pi ${icon}`;
|
|
263
339
|
};
|
|
264
340
|
</script>
|
|
341
|
+
<style>
|
|
342
|
+
.vue-pdf-embed {
|
|
343
|
+
@apply p-4
|
|
344
|
+
}
|
|
345
|
+
.vue-pdf-embed > div {
|
|
346
|
+
@apply mb-4;
|
|
347
|
+
/* margin-bottom: 8px;
|
|
348
|
+
box-shadow: 0 2px 8px 4px rgba(0, 0, 0, 0.1); */
|
|
349
|
+
}
|
|
350
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="text-base font font-bold">
|
|
3
|
+
<slot name="default"></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
/**
|
|
8
|
+
* This file was automatically generated by simpleapp generator during initialization. It is changable.
|
|
9
|
+
* --remove-this-line-to-prevent-override--
|
|
10
|
+
* last change 2024-04-24
|
|
11
|
+
* author: Ks Tan
|
|
12
|
+
*/
|
|
13
|
+
</script>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was automatically generated by simpleapp generator. Every
|
|
3
3
|
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change
|
|
4
|
+
* last change 2024-04-06
|
|
5
5
|
* Author: Ks Tan
|
|
6
6
|
*/
|
|
7
|
+
let orgLogo = ""
|
|
8
|
+
|
|
7
9
|
export const getUserStore = ()=>{
|
|
8
10
|
const {$userstore} = useNuxtApp()
|
|
9
11
|
return $userstore
|
|
@@ -36,4 +38,11 @@ export const canPerform = (resource:string,action:string):boolean =>{
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export const getProfileEmail = () => getUserProfile()?.email
|
|
39
|
-
export const getProfileFullName = () => getUserProfile()?.fullName
|
|
41
|
+
export const getProfileFullName = () => getUserProfile()?.fullName
|
|
42
|
+
|
|
43
|
+
export const refreshOrgLogo = async () => {
|
|
44
|
+
const logodata = await useNuxtApp().$OrganizationDoc().getApi().runGetlogo()
|
|
45
|
+
orgLogo = logodata.data
|
|
46
|
+
}
|
|
47
|
+
export const getOrgLogo = ()=> orgLogo
|
|
48
|
+
export const setOrgLogo = (str:string) => orgLogo = str
|
|
@@ -13,14 +13,14 @@ export const setGraphqlServer=()=>{
|
|
|
13
13
|
uri: `${useRuntimeConfig().public.API_URL}/${getCurrentXorg()}/graphql`,
|
|
14
14
|
})
|
|
15
15
|
apolloclient.setLink(newlink)
|
|
16
|
-
|
|
16
|
+
apolloclient.defaultOptions={
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
query:{
|
|
19
|
+
fetchPolicy: 'no-cache',
|
|
20
|
+
errorPolicy: 'all'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const graphquery=async(qqlstr: typeof gql) =>(await useAsyncQuery(qqlstr)).data
|
|
26
|
+
export const graphquery=async<T>(qqlstr: typeof gql) =>(await useAsyncQuery<T>(qqlstr)).data
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2024-04-20
|
|
5
|
+
* Author: Ks Tan
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Channel } from "pusher-js"
|
|
9
|
+
|
|
10
|
+
let channels: {[key:string]:Channel} = {}
|
|
11
|
+
|
|
12
|
+
export const subscribeHotValueText=(eventName:string,callback:Function )=>{
|
|
13
|
+
const channelname = `[${getUserProfile()?.tenantId??0}]${eventName}`
|
|
14
|
+
channels[channelname]= useNuxtApp().$pusher.subscribe('text')
|
|
15
|
+
channels[channelname].bind(channelname,(msg:string)=>{
|
|
16
|
+
callback(msg)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const subsribeHotValueJson=(eventName:string,callback:Function )=>{
|
|
21
|
+
const channelname = `[${getUserProfile()?.tenantId??0}]${eventName}`
|
|
22
|
+
channels[channelname]= useNuxtApp().$pusher.subscribe('json')
|
|
23
|
+
channels[channelname].bind(channelname,(jsondata:any)=>{
|
|
24
|
+
callback(jsondata)
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const clearChannel = () =>{
|
|
29
|
+
channels = {}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator.
|
|
3
|
+
* --remove-this-line-to-prevent-override--
|
|
4
|
+
* last change 2023-10-28
|
|
5
|
+
* Author: Ks Tan
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const activatePusher =()=>{
|
|
9
|
+
clearChannel()
|
|
10
|
+
subscribeHotValueText(`messages:${getUserProfile()?.uid}`,async (msg:string)=>{
|
|
11
|
+
refreshDocumentList('systemmessage')
|
|
12
|
+
})
|
|
13
|
+
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import _ from 'lodash'
|
|
8
8
|
import {Md5} from 'ts-md5'
|
|
9
|
-
import moment from "moment";
|
|
10
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
10
|
|
|
11
|
+
let orgLogo = ""
|
|
12
12
|
export const camelCaseToWords = (s: string) =>{
|
|
13
13
|
const result = s.replace(/([A-Z])/g, ' $1');
|
|
14
14
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
@@ -18,8 +18,7 @@ export const randomUUID = ()=> uuidv4()
|
|
|
18
18
|
export const md5=(s:string)=> new Md5().appendStr(s).end()
|
|
19
19
|
|
|
20
20
|
export const getAvatarLink = (email:string, size:number):string=>{
|
|
21
|
-
return `https://api.simbiz.cloud/cloudapi/avatar/${md5(email)}?size=${size}`
|
|
22
|
-
|
|
21
|
+
return `https://api.simbiz.cloud/cloudapi/avatar/${md5(email)}?size=${size}`
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
export const t = (txt:string,options?:any):string => !txt || txt.trim()=='' ? '' : useNuxtApp().$i18n.t(txt,options)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
+
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
+
* last change 2024-03-24
|
|
5
|
+
* Author: Ks Tan
|
|
6
|
+
*/
|
|
7
|
+
import { Systemmessage } from "~/simpleapp/generate/openapi";
|
|
8
|
+
|
|
9
|
+
let messages = ref<Systemmessage[]>([])
|
|
10
|
+
export const systemMsgQty = computed(()=>messages.value.filter(item=>!item.read).length)
|
|
11
|
+
export const sysMessage ={
|
|
12
|
+
download: async ()=> {
|
|
13
|
+
messages.value = await useNuxtApp().$SystemmessageDoc().search({})
|
|
14
|
+
console.log("Download messages",messages)
|
|
15
|
+
return messages.value
|
|
16
|
+
},
|
|
17
|
+
getMessages: () => messages.value
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|