improve project dialog system

- project model : refactor getSteps() method
- create dialog store
- create DialogWrapper component that open the dialog corresponding to the URL query param
This commit is contained in:
isUnknown 2024-11-16 11:30:51 +01:00
parent 4e8c876dac
commit 26369ad71b
228 changed files with 451 additions and 525 deletions

View file

@ -35,7 +35,6 @@
:current-page-index="currentPageIndex"
:file="file"
:comments="file.comments ?? []"
@update:file="changeFile"
/>
</div>
</Dialog>
@ -46,12 +45,13 @@ import Dialog from "primevue/dialog";
import Comments from "../../comments/Comments.vue";
import { VPdfViewer, useLicense } from "@vue-pdf-viewer/viewer";
import { ref, watch } from "vue";
import { useDialogStore } from "../../../stores/dialog";
import { useRoute, useRouter } from "vue-router";
const { file } = defineProps({
file: Object,
});
const file = useDialogStore().content.files[0];
const emits = defineEmits(["close", "update:file"]);
const router = useRouter();
const route = useRoute();
const licenseKey = import.meta.env.VITE_VPV_LICENSE;
useLicense({ licenseKey });
@ -59,7 +59,7 @@ useLicense({ licenseKey });
// Variables
const isOpen = ref(true);
watch(isOpen, (newValue) => {
emits("close");
router.push({ name: route.name });
});
const isCommentsOpen = ref(false);
const currentPageIndex = ref(1);
@ -123,10 +123,6 @@ const onPdfLoaded = () => {
observePages();
};
function changeFile(newFile) {
emits("update:file", newFile);
}
function setCommentBubbles() {
console.log(file.comments);
if (!file.comments) return;