Алерты

This commit is contained in:
iriska-gri committed 2024-03-18 09:58:14 +03:00
1 parent 657b089134
commit c28d94b9b1
12 files changed
+67 -66

No files matched your search

@@ -1,40 +0,0 @@
<template>
<v-alert
width = "500"
position="fixed"
class="bottom-alert"
type="success"
title="Успех!"
text="Файл загружен"
:value="alert"
closable
></v-alert>
</template>
<script>
import { ref } from 'vue'
export default {
// props: {
// alert: {
// type: Boolean,
// default: false
// }
// },
setup(){
defineProps(['alert'])
// defineEmits(['update:alert'])
// const alert = ref(true)
return {defineProps}
}
}
</script>
<style>
.bottom-alert {
bottom: 10px;
left: 40%;
}
</style>
@@ -57,7 +57,8 @@ import { useAppStore } from '@/store/app'
import { ref } from 'vue'
export default {
name: "PageCounter",
props: {
rail: {
type: Boolean,
+2 -1
View File
@@ -1,5 +1,6 @@
import myHelper from '@/components/UI/my-helper';
import InfoUserCard from '@/components/UI/infoUserCard.vue';
import TooltipText from '@/components/UI/tooltip-text.vue'
import AlertDefault from '@/layouts/default/alertDefault.vue'
export default [myHelper, InfoUserCard, TooltipText, ]
export default [myHelper, InfoUserCard, TooltipText, AlertDefault]
+2
View File
@@ -135,11 +135,13 @@ export default {
if (feedbackdata.value.nowcomment.id ==null) {
feedalert.text = "Оценка отправлена, спасибо за участие"
feedalert.ico = "mdi-redo-variant"
feedalert.color = "green-darken-4"
}
else {
feedalert.text = "Оценка обновлена"
feedalert.ico = "mdi-refresh"
feedalert.color="light-blue-darken-4"
}
}
@@ -27,11 +27,13 @@
v-if="x.text != '' || x.title != null"
class="bgCard h-100 d-flex flex-column"
>
<v-card-title v-if="x.title != null"
class="text-h3 text-uppercase titles text-text_carous ma-1 mb-0">
<v-row no-gutters >
<v-col class="align-self-center">
{{x.title}}
</v-col>
<v-col class="flex-grow-0">
<v-img
@@ -40,6 +42,7 @@
:src="`${burl}${x.sender}`"
cover
/>
<!-- <my-helper :pretext=carous /> -->
</v-col>
</v-row>
</v-card-title>
@@ -47,6 +50,7 @@
v-if="x.text != ''"
class=" w-50 flex-grow-0 text-h6 bgText overflow-auto ma-1 pa-0"
>
<v-textarea
class="text-text_caroustext-black textareas font-weight-medium nocursor"
:model-value=x.text
+23 -10
View File
@@ -60,7 +60,8 @@
<v-col></v-col>
<v-col></v-col>
<v-col></v-col>
<v-alert
<!-- <v-alert
width = "500"
position="fixed"
class="bottom-alert"
@@ -71,13 +72,9 @@
:color='info=="Файл загружен"?"teal-darken-2":"red-darken-2"'
closable
></v-alert>
></v-alert> -->
</v-row>
<!-- <v-row>
<v-col v-for="(x) in 6" :key=x class=" flex-column d-flex">
{{x}}
</v-col>
</v-row> -->
</v-col>
</v-row>
@@ -89,6 +86,7 @@ import { ref } from 'vue'
import { baseURL } from '@/utils/axios-api'
import {getfromserver} from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api'
import { useAlertStore } from '@/store/AboutPortalFilter'
export default {
setup(){
@@ -96,7 +94,7 @@ export default {
const visiting = ref({})
const info = ref('')
const t_dailyRound = ref('')
const alert = ref(false)
const feedalert = useAlertStore().alert
@@ -124,12 +122,27 @@ export default {
})
showInfo.value = true
dailyfiles.value = []
alert.value = true
feedalert.alert = true
textFromAlert()
}
const textFromAlert = () => {
if (info.value=="Файл загружен") {
feedalert.text = "Файл загружен"
feedalert.ico = "mdi-check"
feedalert.color="green-darken-4"
}
else {
feedalert.text = "Ошибка загрузки"
feedalert.ico = "mdi-alert-circle-outline"
feedalert.color="pink-accent-4"
}
}
const detailRound = () => {
axiosApiInstance.get(`api/general_vacation/dailyload/?id=6`)
@@ -153,7 +166,7 @@ export default {
detailRound,
t_dailyRound,
showInfo,
alert
}
}
@@ -241,7 +241,7 @@
<page-counter :rail=rail />
</v-col>
</v-row>
</v-col>
</v-col>
</v-row>
@@ -276,7 +276,7 @@
</v-card>
<alert-default />
</v-main>
<v-navigation-drawer v-if="accountStore.cod2user"
v-model="drawer_right"
@@ -307,7 +307,7 @@ import { clearAxios } from '@/utils/axios-api'
import { baseURL } from '@/utils/axios-api'
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
import PageCounter from '../../components/UI/defaultportal/page-counter.vue'
import AlertDefault from './alertDefault.vue'
export default {
components: {
@@ -315,8 +315,7 @@ export default {
OnlineUsers,
CardLike,
VcardUser,
PageCounter,
AlertDefault
PageCounter
},
mixins: [uf],
@@ -1,7 +1,7 @@
<template>
<v-alert
color="#C51162"
:color=feedalert.color
:icon=feedalert.ico
theme="dark"
max-height="40"
@@ -19,10 +19,11 @@
</template>
<script>
import { ref, computed, watch} from 'vue'
import { watch} from 'vue'
import { useAlertStore } from '@/store/AboutPortalFilter'
export default {
name: "AlertDefault",
setup() {
const feedalert = useAlertStore().alert
@@ -30,9 +31,9 @@ export default {
watch(()=>feedalert ,()=>{
setTimeout(function() {
feedalert.text=""
feedalert.ico=""
feedalert.color=""
feedalert.alert = false
}, 3000)
+2 -1
View File
@@ -21,7 +21,8 @@ export const useAlertStore = defineStore('uniAlert', () => {
const alert = ref({ "alert": false,
"text": '',
"ico": 'mdi-plus'
"ico": 'mdi-plus',
"color": ''
})