|
@@ -101,7 +101,19 @@ import { useImageManager } from '~/composables/data/useImageManager'
|
|
|
import { FILE_VISIBILITY, IMAGE_SIZE, TYPE_ALERT } from '~/types/enum/enums'
|
|
import { FILE_VISIBILITY, IMAGE_SIZE, TYPE_ALERT } from '~/types/enum/enums'
|
|
|
import { usePageStore } from '~/stores/page'
|
|
import { usePageStore } from '~/stores/page'
|
|
|
import FileUtils from '~/services/utils/fileUtils'
|
|
import FileUtils from '~/services/utils/fileUtils'
|
|
|
-import { useImageFetch } from '~/composables/data/useImageFetch'
|
|
|
|
|
|
|
+
|
|
|
|
|
+interface CropperChangeEvent {
|
|
|
|
|
+ coordinates: {
|
|
|
|
|
+ left: number;
|
|
|
|
|
+ top: number;
|
|
|
|
|
+ width: number;
|
|
|
|
|
+ height: number;
|
|
|
|
|
+ };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+interface UploadResponse {
|
|
|
|
|
+ fileId: number;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
/**
|
|
/**
|
|
@@ -342,7 +354,7 @@ const uploadImage = async (event: Event) => {
|
|
|
* Lorsque le cropper change de position / taille, on met à jour les coordonnées
|
|
* Lorsque le cropper change de position / taille, on met à jour les coordonnées
|
|
|
* @param newCoordinates
|
|
* @param newCoordinates
|
|
|
*/
|
|
*/
|
|
|
-const onCropperChange = ({ coordinates: newCoordinates }: any) => {
|
|
|
|
|
|
|
+const onCropperChange = ({ coordinates: newCoordinates }: CropperChangeEvent) => {
|
|
|
cropperConfig.value = newCoordinates
|
|
cropperConfig.value = newCoordinates
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -380,7 +392,7 @@ const saveNewImage = async (): Promise<number> => {
|
|
|
currentImage.value.content,
|
|
currentImage.value.content,
|
|
|
FILE_VISIBILITY.EVERYBODY,
|
|
FILE_VISIBILITY.EVERYBODY,
|
|
|
config,
|
|
config,
|
|
|
- )) as any
|
|
|
|
|
|
|
+ )) as UploadResponse
|
|
|
|
|
|
|
|
return response.fileId
|
|
return response.fileId
|
|
|
}
|
|
}
|