diff --git a/src/front/src/components/UI/feedback/star-like.vue b/src/front/src/components/UI/feedback/star-like.vue deleted file mode 100644 index 2c3687c5f..000000000 --- a/src/front/src/components/UI/feedback/star-like.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - {{x.name}} - - - - - - - - - - - - - - - - - - - - {{x.name}} - - - - - - - - - - - - - За выбранный период оценок нет - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/front/src/components/cardLike.vue b/src/front/src/components/cardLike.vue index 71c383ded..7fe99bf2d 100644 --- a/src/front/src/components/cardLike.vue +++ b/src/front/src/components/cardLike.vue @@ -60,6 +60,7 @@ import { ref, onMounted, computed } from 'vue' import { axiosApiInstance } from '@/utils/axios-api' import FeedstarLike from '@/components/UI/feedback/feedstar-like.vue' +import { useAlertStore } from '@/store/AboutPortalFilter' export default { components: { FeedstarLike }, @@ -74,6 +75,7 @@ export default { setup(props, {emit}) { + const feedalert = useAlertStore().alert const feedbackdata= ref({nowcomment: {comment: '' }, nowrating: []}) function f_feedbackdata() { @@ -122,11 +124,35 @@ export default { function feedSend() { axiosApiInstance.post(`api/feedback/feedbackdata/`, {nowrating : feedbackdata.value.nowrating, nowcomment: feedbackdata.value.nowcomment} ).then(data => {}) + feedalert.alert = true + textFromAlert() + menusCloses() } - return {feedbackdata, average, menusCloses, myLabel, feedSend} + const textFromAlert = () => { + if (feedbackdata.value.nowcomment.id ==null) { + feedalert.text = "Оценка отправлена, спасибо за участие" + feedalert.ico = "mdi-redo-variant" + } + + else { + feedalert.text = "Оценка обновлена" + feedalert.ico = "mdi-refresh" + } + } + + + return { + feedbackdata, + average, + menusCloses, + myLabel, + feedSend, + feedalert + + } } diff --git a/src/front/src/layouts/default/alertDefault.vue b/src/front/src/layouts/default/alertDefault.vue index db63b3ffa..5f8e80b23 100644 --- a/src/front/src/layouts/default/alertDefault.vue +++ b/src/front/src/layouts/default/alertDefault.vue @@ -2,28 +2,44 @@ - Оценка отправлена, спасибо за участие + location = "bottom" + class="mb-2" + v-model="feedalert.alert" + :text=feedalert.text + variant = "tonal" + density="compact" + > diff --git a/src/front/src/store/AboutPortalFilter.js b/src/front/src/store/AboutPortalFilter.js index b4eb67a92..bd6e8b393 100644 --- a/src/front/src/store/AboutPortalFilter.js +++ b/src/front/src/store/AboutPortalFilter.js @@ -19,8 +19,9 @@ export const usePortalFilterStore = defineStore('filter', () => { export const useAlertStore = defineStore('uniAlert', () => { - const alert = ref({ "alert": true, - "text": new Date(), + const alert = ref({ "alert": false, + "text": '', + "ico": 'mdi-plus' })