Eslint fixes

This commit is contained in:
Julie Lenaerts 2025-04-03 10:02:17 +02:00
parent 1c87280b1e
commit df09dd2017
9 changed files with 375 additions and 270 deletions

View File

@ -1,6 +1,8 @@
<template>
<div class="row mb-3">
<label class="col-sm-4 col-form-label visually-hidden">{{ trans(EVALUATION_PUBLIC_COMMENT) }}</label>
<label class="col-sm-4 col-form-label visually-hidden">{{
trans(EVALUATION_PUBLIC_COMMENT)
}}</label>
<div class="col-sm-12">
<ckeditor
:editor="ClassicEditor"
@ -15,11 +17,15 @@
</template>
<script setup>
import { Ckeditor } from '@ckeditor/ckeditor5-vue';
import { ClassicEditor } from 'ckeditor5';
import classicEditorConfig from 'ChillMainAssets/module/ckeditor5/editor_config';
import { EVALUATION_PUBLIC_COMMENT, EVALUATION_COMMENT_PLACEHOLDER, trans } from 'translator';
import { Ckeditor } from "@ckeditor/ckeditor5-vue";
import { ClassicEditor } from "ckeditor5";
import classicEditorConfig from "ChillMainAssets/module/ckeditor5/editor_config";
import {
EVALUATION_PUBLIC_COMMENT,
EVALUATION_COMMENT_PLACEHOLDER,
trans,
} from "translator";
defineProps(['comment']);
defineEmits(['update:comment']);
defineProps(["comment"]);
defineEmits(["update:comment"]);
</script>

View File

@ -53,8 +53,19 @@
</template>
<script setup>
import { EVALUATION_STARTDATE, EVALUATION_ENDDATE, EVALUATION_MAXDATE, EVALUATION_WARNING_INTERVAL, trans } from 'translator';
import {
EVALUATION_STARTDATE,
EVALUATION_ENDDATE,
EVALUATION_MAXDATE,
EVALUATION_WARNING_INTERVAL,
trans,
} from "translator";
defineProps(['startDate', 'endDate', 'maxDate', 'warningInterval']);
defineEmits(['update:startDate', 'update:endDate', 'update:maxDate', 'update:warningInterval']);
defineProps(["startDate", "endDate", "maxDate", "warningInterval"]);
defineEmits([
"update:startDate",
"update:endDate",
"update:maxDate",
"update:warningInterval",
]);
</script>

View File

@ -9,14 +9,21 @@
@go-to-generate-document="$emit('submitBeforeGenerate', $event)"
>
<template v-slot:title>
<label class="col-form-label">{{ trans(EVALUATION_GENERATE_A_DOCUMENT) }}</label>
<label class="col-form-label">{{
trans(EVALUATION_GENERATE_A_DOCUMENT)
}}</label>
</template>
</pick-template>
<div>
<label class="col-form-label">{{ trans(EVALUATION_DOCUMENT_UPLOAD) }}</label>
<label class="col-form-label">{{
trans(EVALUATION_DOCUMENT_UPLOAD)
}}</label>
<ul class="record_actions document-upload">
<li>
<drop-file-modal :allow-remove="false" @add-document="$emit('addDocument', $event)"></drop-file-modal>
<drop-file-modal
:allow-remove="false"
@add-document="$emit('addDocument', $event)"
></drop-file-modal>
</li>
</ul>
</div>
@ -24,13 +31,17 @@
</template>
<script setup>
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
import DropFileModal from 'ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue';
import { EVALUATION_DOCUMENT_ADD,
EVALUATION_DOCUMENT_UPLOAD, EVALUATION_GENERATE_A_DOCUMENT, trans } from 'translator';
import PickTemplate from "ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue";
import DropFileModal from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue";
import {
EVALUATION_DOCUMENT_ADD,
EVALUATION_DOCUMENT_UPLOAD,
EVALUATION_GENERATE_A_DOCUMENT,
trans,
} from "translator";
defineProps(['evaluation', 'templates']);
defineEmits(['addDocument', 'submitBeforeGenerate']);
defineProps(["evaluation", "templates"]);
defineEmits(["addDocument", "submitBeforeGenerate"]);
</script>
<style scoped>

View File

@ -34,7 +34,11 @@
<div class="item-row">
<div class="item-col">
<ul class="record_actions">
<li v-if="d.workflows_availables.length > 0 || d.workflows.length > 0">
<li
v-if="
d.workflows_availables.length > 0 || d.workflows.length > 0
"
>
<list-workflow-modal
:workflows="d.workflows"
:allowCreate="true"
@ -43,7 +47,9 @@
:workflowsAvailables="d.workflows_availables"
:preventDefaultMoveToGenerate="true"
:goToGenerateWorkflowPayload="{ doc: d }"
@go-to-generate-workflow="$emit('goToGenerateWorkflow', $event)"
@go-to-generate-workflow="
$emit('goToGenerateWorkflow', $event)
"
></list-workflow-modal>
</li>
<li>
@ -63,14 +69,23 @@
>
&nbsp;
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons">
<ul
class="dropdown-menu"
aria-labelledby="btnGroupNotifyButtons"
>
<li>
<a class="dropdown-item" @click="$emit('goToGenerateNotification', d, true)">
<a
class="dropdown-item"
@click="$emit('goToGenerateNotification', d, true)"
>
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_REFERRER) }}
</a>
</li>
<li>
<a class="dropdown-item" @click="$emit('goToGenerateNotification', d, false)">
<a
class="dropdown-item"
@click="$emit('goToGenerateNotification', d, false)"
>
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_ANY) }}
</a>
</li>
@ -84,31 +99,57 @@
:can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor"
:davLink="d.storedObject._links?.dav_link.href"
:davLinkExpiration="d.storedObject._links?.dav_link.expiration"
@on-stored-object-status-change="$emit('statusDocumentChanged', $event)"
:davLinkExpiration="
d.storedObject._links?.dav_link.expiration
"
@on-stored-object-status-change="
$emit('statusDocumentChanged', $event)
"
></document-action-buttons-group>
</li>
<li v-if="d.storedObject._permissions.canEdit">
<drop-file-modal
:existing-doc="d.storedObject"
:allow-remove="false"
@add-document="(arg) => $emit('replaceDocument', d, arg.stored_object, arg.stored_object_version)"
@add-document="
(arg) =>
$emit(
'replaceDocument',
d,
arg.stored_object,
arg.stored_object_version,
)
"
></drop-file-modal>
</li>
<li v-if="d.workflows.length === 0">
<a class="btn btn-delete" @click="$emit('removeDocument', d)"> </a>
<a class="btn btn-delete" @click="$emit('removeDocument', d)">
</a>
</li>
<li v-if="Number.isInteger(d.id)">
<div class="duplicate-dropdown">
<button class="btn btn-duplicate dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<button
class="btn btn-duplicate dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Dupliquer
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" @click="$emit('duplicateDocument', d)">Dupliquer ici</a>
<a
class="dropdown-item"
@click="$emit('duplicateDocument', d)"
>Dupliquer ici</a
>
</li>
<li>
<a class="dropdown-item" @click="prepareDocumentDuplicationToWork(d)">Dupliquer vers un autre actions d'accompagnement</a>
<a
class="dropdown-item"
@click="prepareDocumentDuplicationToWork(d)"
>Dupliquer vers un autre actions d'accompagnement</a
>
</li>
</ul>
</div>
@ -131,35 +172,44 @@
</template>
<script setup>
import { ISOToDatetime } from 'ChillMainAssets/chill/js/date';
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
import DocumentActionButtonsGroup from 'ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue';
import DropFileModal from 'ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue';
import { ISOToDatetime } from "ChillMainAssets/chill/js/date";
import ListWorkflowModal from "ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue";
import DocumentActionButtonsGroup from "ChillDocStoreAssets/vuejs/DocumentActionButtonsGroup.vue";
import DropFileModal from "ChillDocStoreAssets/vuejs/DropFileWidget/DropFileModal.vue";
import {
EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
EVALUATION_NOTIFICATION_NOTIFY_ANY,
EVALUATION_NOTIFICATION_SEND,
EVALUATION_DOCUMENTS,
trans
} from 'translator';
import {ref, watch} from "vue";
import AccompanyingPeriodWorkSelectorModal
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue";
trans,
} from "translator";
import { ref, watch } from "vue";
import AccompanyingPeriodWorkSelectorModal from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkSelectorModal.vue";
defineProps(['documents', 'docAnchorId', 'accompanyingPeriodId']);
const emit = defineEmits(['inputDocumentTitle', 'removeDocument', 'duplicateDocument', 'statusDocumentChanged', 'goToGenerateWorkflow', 'goToGenerateNotification', 'duplicateDocumentToWork']);
defineProps(["documents", "docAnchorId", "accompanyingPeriodId"]);
const emit = defineEmits([
"inputDocumentTitle",
"removeDocument",
"duplicateDocument",
"statusDocumentChanged",
"goToGenerateWorkflow",
"goToGenerateNotification",
"duplicateDocumentToWork",
]);
const showAccompanyingPeriodSelector = ref(false);
const selectedEvaluation = ref(null);
const selectedDocument = ref(null);
const prepareDocumentDuplicationToWork = (d) => {
selectedDocument.value = d
showAccompanyingPeriodSelector.value = true
}
selectedDocument.value = d;
showAccompanyingPeriodSelector.value = true;
};
watch(selectedEvaluation, (val) => {
emit('duplicateDocumentToEvaluation', {'evaluation': val, 'document': selectedDocument.value})
emit("duplicateDocumentToEvaluation", {
evaluation: val,
document: selectedDocument.value,
});
});
</script>

View File

@ -18,10 +18,7 @@
@update:timeSpent="updateTimeSpent"
/>
<CommentInput
:comment="comment"
@update:comment="updateComment"
/>
<CommentInput :comment="comment" @update:comment="updateComment" />
<DocumentsList
v-if="evaluation.documents.length > 0"
@ -48,53 +45,50 @@
</template>
<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';
import DateInputs from './DateInputs.vue';
import TimeSpentInput from './TimeSpentInput.vue';
import CommentInput from './CommentInput.vue';
import DocumentsList from './DocumentsList.vue';
import DocumentActions from './DocumentActions.vue';
import {makeFetch} from "ChillMainAssets/lib/api/apiMethods";
import { computed } from "vue";
import { useStore } from "vuex";
import DateInputs from "./DateInputs.vue";
import TimeSpentInput from "./TimeSpentInput.vue";
import CommentInput from "./CommentInput.vue";
import DocumentsList from "./DocumentsList.vue";
import DocumentActions from "./DocumentActions.vue";
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import { useToast } from "vue-toast-notification";
import {
DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS,
trans
} from 'translator';
import { DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS, trans } from "translator";
const props = defineProps(['evaluation', 'docAnchorId']);
const props = defineProps(["evaluation", "docAnchorId"]);
const store = useStore();
const toast = useToast();
const timeSpentChoices = [
{ text: '1 minute', value: 60 },
{ text: '2 minutes', value: 120 },
{ text: '3 minutes', value: 180 },
{ text: '4 minutes', value: 240 },
{ text: '5 minutes', value: 300 },
{ text: '10 minutes', value: 600 },
{ text: '15 minutes', value: 900 },
{ text: '20 minutes', value: 1200 },
{ text: '25 minutes', value: 1500 },
{ text: '30 minutes', value: 1800 },
{ text: '45 minutes', value: 2700 },
{ text: '1 hour', value: 3600 },
{ text: '1 hour 15 minutes', value: 4500 },
{ text: '1 hour 30 minutes', value: 5400 },
{ text: '1 hour 45 minutes', value: 6300 },
{ text: '2 hours', value: 7200 },
{ text: '2 hours 30 minutes', value: 9000 },
{ text: '3 hours', value: 10800 },
{ text: '3 hours 30 minutes', value: 12600 },
{ text: '4 hours', value: 14400 },
{ text: '4 hours 30 minutes', value: 16200 },
{ text: '5 hours', value: 18000 },
{ text: '5 hours 30 minutes', value: 19800 },
{ text: '6 hours', value: 21600 },
{ text: '6 hours 30 minutes', value: 23400 },
{ text: '7 hours', value: 25200 },
{ text: '7 hours 30 minutes', value: 27000 },
{ text: '8 hours', value: 28800 },
{ text: "1 minute", value: 60 },
{ text: "2 minutes", value: 120 },
{ text: "3 minutes", value: 180 },
{ text: "4 minutes", value: 240 },
{ text: "5 minutes", value: 300 },
{ text: "10 minutes", value: 600 },
{ text: "15 minutes", value: 900 },
{ text: "20 minutes", value: 1200 },
{ text: "25 minutes", value: 1500 },
{ text: "30 minutes", value: 1800 },
{ text: "45 minutes", value: 2700 },
{ text: "1 hour", value: 3600 },
{ text: "1 hour 15 minutes", value: 4500 },
{ text: "1 hour 30 minutes", value: 5400 },
{ text: "1 hour 45 minutes", value: 6300 },
{ text: "2 hours", value: 7200 },
{ text: "2 hours 30 minutes", value: 9000 },
{ text: "3 hours", value: 10800 },
{ text: "3 hours 30 minutes", value: 12600 },
{ text: "4 hours", value: 14400 },
{ text: "4 hours 30 minutes", value: 16200 },
{ text: "5 hours", value: 18000 },
{ text: "5 hours 30 minutes", value: 19800 },
{ text: "6 hours", value: 21600 },
{ text: "6 hours 30 minutes", value: 23400 },
{ text: "7 hours", value: 25200 },
{ text: "7 hours 30 minutes", value: 27000 },
{ text: "8 hours", value: 28800 },
];
const startDate = computed({
@ -102,7 +96,10 @@ const startDate = computed({
return props.evaluation.startDate;
},
set(v) {
store.commit('setEvaluationStartDate', { key: props.evaluation.key, date: v });
store.commit("setEvaluationStartDate", {
key: props.evaluation.key,
date: v,
});
},
});
@ -111,7 +108,10 @@ const endDate = computed({
return props.evaluation.endDate;
},
set(v) {
store.commit('setEvaluationEndDate', { key: props.evaluation.key, date: v });
store.commit("setEvaluationEndDate", {
key: props.evaluation.key,
date: v,
});
},
});
@ -120,7 +120,10 @@ const maxDate = computed({
return props.evaluation.maxDate;
},
set(v) {
store.commit('setEvaluationMaxDate', { key: props.evaluation.key, date: v });
store.commit("setEvaluationMaxDate", {
key: props.evaluation.key,
date: v,
});
},
});
@ -129,7 +132,10 @@ const warningInterval = computed({
return props.evaluation.warningInterval;
},
set(v) {
store.commit('setEvaluationWarningInterval', { key: props.evaluation.key, days: v });
store.commit("setEvaluationWarningInterval", {
key: props.evaluation.key,
days: v,
});
},
});
@ -138,7 +144,10 @@ const timeSpent = computed({
return props.evaluation.timeSpent;
},
set(v) {
store.commit('setEvaluationTimeSpent', { key: props.evaluation.key, time: v });
store.commit("setEvaluationTimeSpent", {
key: props.evaluation.key,
time: v,
});
},
});
@ -147,12 +156,17 @@ const comment = computed({
return props.evaluation.comment;
},
set(v) {
store.commit('setEvaluationComment', { key: props.evaluation.key, comment: v });
store.commit("setEvaluationComment", {
key: props.evaluation.key,
comment: v,
});
},
});
const getTemplatesAvailables = computed(() => {
return store.getters.getTemplatesAvailablesForEvaluation(props.evaluation.evaluation);
return store.getters.getTemplatesAvailablesForEvaluation(
props.evaluation.evaluation,
);
});
// const getAccompanyingPeriod = computed(() => store.work)
@ -184,7 +198,7 @@ function onInputDocumentTitle(event) {
const id = Number(event.target.id);
const key = Number(event.target.dataset.key) + 1;
const title = event.target.value;
store.commit('updateDocumentTitle', {
store.commit("updateDocumentTitle", {
id: id,
key: key,
evaluationKey: props.evaluation.key,
@ -194,11 +208,11 @@ function onInputDocumentTitle(event) {
function addDocument({ stored_object, stored_object_version }) {
let document = {
type: 'accompanying_period_work_evaluation_document',
type: "accompanying_period_work_evaluation_document",
storedObject: stored_object,
title: 'Nouveau document',
title: "Nouveau document",
};
store.commit('addDocument', {
store.commit("addDocument", {
key: props.evaluation.key,
document,
stored_object_version,
@ -206,8 +220,14 @@ function addDocument({ stored_object, stored_object_version }) {
}
function removeDocument(document) {
if (window.confirm('Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre "' + document.title + '" ?')) {
store.commit('removeDocument', {
if (
window.confirm(
'Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre "' +
document.title +
'" ?',
)
) {
store.commit("removeDocument", {
key: props.evaluation.key,
document: document,
});
@ -215,21 +235,19 @@ function removeDocument(document) {
}
function duplicateDocument(document) {
store.dispatch('duplicateDocument', {
store.dispatch("duplicateDocument", {
evaluation_key: props.evaluation.key,
document: document,
});
}
function duplicateDocumentToEvaluation({evaluation, document}) {
function duplicateDocumentToEvaluation({ evaluation, document }) {
const url = `/api/1.0/person/accompanying-course-work-evaluation-document/${document.id}/evaluation/${evaluation.id}/duplicate`;
// console.log('document id', document.id, 'evaluation id', evaluation.id)
makeFetch("POST", url)
.then((response) => {
console.log('new document', response)
console.log("new document", response);
toast.open({ message: trans(DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS) });
})
.catch((error) => {
@ -238,7 +256,7 @@ function duplicateDocumentToEvaluation({evaluation, document}) {
}
function onStatusDocumentChanged(newStatus) {
store.commit('statusDocumentChanged', {
store.commit("statusDocumentChanged", {
key: props.evaluation.key,
newStatus: newStatus,
});
@ -246,18 +264,22 @@ function onStatusDocumentChanged(newStatus) {
function goToGenerateWorkflowEvaluationDocument({ workflowName, payload }) {
const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find((e) => e.key === props.evaluation.key);
let updatedDocument = evaluation.documents.find((d) => d.key === payload.doc.key);
let evaluation = data.accompanyingPeriodWorkEvaluations.find(
(e) => e.key === props.evaluation.key,
);
let updatedDocument = evaluation.documents.find(
(d) => d.key === payload.doc.key,
);
window.location.assign(
buildLinkCreate(
workflowName,
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument',
"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
updatedDocument.id,
),
);
};
store.dispatch('submit', callback).catch((e) => {
store.dispatch("submit", callback).catch((e) => {
console.log(e);
throw e;
});
@ -265,18 +287,24 @@ function goToGenerateWorkflowEvaluationDocument({ workflowName, payload }) {
function goToGenerateDocumentNotification(document, tos) {
const callback = (data) => {
let evaluation = data.accompanyingPeriodWorkEvaluations.find((e) => e.key === props.evaluation.key);
let updatedDocument = evaluation.documents.find((d) => d.key === document.key);
let evaluation = data.accompanyingPeriodWorkEvaluations.find(
(e) => e.key === props.evaluation.key,
);
let updatedDocument = evaluation.documents.find(
(d) => d.key === document.key,
);
window.location.assign(
buildLinkCreateNotification(
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument',
"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
updatedDocument.id,
tos === true ? store.state.work.accompanyingPeriod.user.id : null,
window.location.pathname + window.location.search + window.location.hash,
window.location.pathname +
window.location.search +
window.location.hash,
),
);
};
store.dispatch('submit', callback).catch((e) => {
store.dispatch("submit", callback).catch((e) => {
console.log(e);
throw e;
});

View File

@ -10,7 +10,11 @@
@input="$emit('update:timeSpent', $event.target.value)"
>
<option disabled value="">{{ trans(EVALUATION_TIME_SPENT) }}</option>
<option v-for="time in timeSpentChoices" :value="time.value" :key="time.value">
<option
v-for="time in timeSpentChoices"
:value="time.value"
:key="time.value"
>
{{ time.text }}
</option>
</select>
@ -19,8 +23,8 @@
</template>
<script setup>
import { EVALUATION_TIME_SPENT, trans } from 'translator';
import { EVALUATION_TIME_SPENT, trans } from "translator";
defineProps(['timeSpent', 'timeSpentChoices']);
defineEmits(['update:timeSpent']);
defineProps(["timeSpent", "timeSpentChoices"]);
defineEmits(["update:timeSpent"]);
</script>

View File

@ -43,7 +43,7 @@ import {
} from "translator";
import { ISOToDate } from "ChillMainAssets/chill/js/date";
import { DateTime } from "ChillMainAssets/types";
import {AccompanyingPeriodWorkEvaluation} from "../../../types";
import { AccompanyingPeriodWorkEvaluation } from "../../../types";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{ eval: AccompanyingPeriodWorkEvaluation }>();

View File

@ -22,10 +22,9 @@
</template>
<script setup lang="ts">
import {AccompanyingPeriodWorkEvaluation} from "../../../types";
import { AccompanyingPeriodWorkEvaluation } from "../../../types";
import { defineProps, ref, watch } from "vue";
import AccompanyingPeriodWorkEvaluationItem
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationItem.vue";
import AccompanyingPeriodWorkEvaluationItem from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationItem.vue";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{

View File

@ -20,7 +20,6 @@
</li>
</ul>
<teleport to="body">
<modal
v-if="showModal"
@ -65,23 +64,21 @@ import {
CONFIRM,
} from "translator";
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import AccompanyingPeriodWorkEvaluationList
from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue";
import {AccompanyingPeriodWorkEvaluation} from "../../../types";
import AccompanyingPeriodWorkEvaluationList from "ChillPersonAssets/vuejs/_components/AccompanyingPeriodWorkSelector/AccompanyingPeriodWorkEvaluationList.vue";
import { AccompanyingPeriodWorkEvaluation } from "../../../types";
const selectedAcpw = ref<AccompanyingPeriodWork | null>(null);
const selectedEvaluation = ref<AccompanyingPeriodWorkEvaluation | null>(null);
const showModal = ref(false);
const accompanyingPeriodWorks = ref<AccompanyingPeriodWork[]>([]);
const evaluations = ref<AccompanyingPeriodWorkEvaluation[]>([])
const evaluations = ref<AccompanyingPeriodWorkEvaluation[]>([]);
const props = defineProps({
accompanyingPeriodId: String,
isEvaluationSelector: Boolean
isEvaluationSelector: Boolean,
});
const emit = defineEmits(['closeModal', 'update:selectedEvaluation'])
const emit = defineEmits(["closeModal", "update:selectedEvaluation"]);
onMounted(() => {
if (props.accompanyingPeriodId) {
@ -114,30 +111,29 @@ watch(selectedAcpw, (newValue) => {
});
const openModal = () => {
showModal.value = true
}
showModal.value = true;
};
const closeModal = () => {
showModal.value = false
selectedEvaluation.value = null
selectedAcpw.value = null
emit('closeModal')
}
showModal.value = false;
selectedEvaluation.value = null;
selectedAcpw.value = null;
emit("closeModal");
};
const confirmSelection = () => {
selectedAcpw.value = selectedAcpw.value;
if(false === props.isEvaluationSelector) {
if (false === props.isEvaluationSelector) {
closeModal();
}
if(selectedAcpw.value && props.isEvaluationSelector) {
evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations
if (selectedAcpw.value && props.isEvaluationSelector) {
evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations;
}
if(selectedEvaluation.value && props.isEvaluationSelector) {
if (selectedEvaluation.value && props.isEvaluationSelector) {
// console.log('evaluation log in modal', selectedEvaluation.value)
emit("update:selectedEvaluation", selectedEvaluation.value);
closeModal()
closeModal();
}
};
</script>