fix [P-292]: изменение стиля кнопки "создать календарь"
This commit is contained in:
1 parent
f62e6f175f
commit
0a9f1cd510
1 file changed
+60
-50
@@ -8,8 +8,11 @@
|
|||||||
|
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="title === 'Мои календари'"
|
v-if="title === 'Мои календари'"
|
||||||
|
size="x-regular"
|
||||||
icon="mdi-plus"
|
icon="mdi-plus"
|
||||||
class="simple-hover"
|
variant="outlined"
|
||||||
|
color="btn_text"
|
||||||
|
class="pa-1 ml-2 simple-hover"
|
||||||
@click.stop="editCreatedCalendar()"
|
@click.stop="editCreatedCalendar()"
|
||||||
></v-btn>
|
></v-btn>
|
||||||
</v-expansion-panel-title>
|
</v-expansion-panel-title>
|
||||||
@@ -73,32 +76,41 @@
|
|||||||
</v-expansion-panels>
|
</v-expansion-panels>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script>
|
||||||
import { onMounted, ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import calendarCreate from '@/components/calendar_of_events/calendar-create.vue';
|
import calendarCreate from '@/components/calendar_of_events/calendar-create.vue';
|
||||||
import { useAccountStore } from '@/store/AccountStore';
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useCalendarStore } from '@/store/calendarStore';
|
import { useCalendarStore } from '@/store/calendarStore';
|
||||||
|
|
||||||
const props = defineProps({
|
export default {
|
||||||
calendars: Array,
|
components: { calendarCreate },
|
||||||
title: String,
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['getCalendar']);
|
props: {
|
||||||
|
calendars: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
|
||||||
const showDialog = ref(false);
|
title: {
|
||||||
const accountStore = useAccountStore();
|
type: String,
|
||||||
const { user } = storeToRefs(accountStore);
|
default: '',
|
||||||
const calendarStore = useCalendarStore();
|
},
|
||||||
const { toggleCalendarVisibility, hiddenCalendarIds } = calendarStore;
|
},
|
||||||
|
|
||||||
const calendar = ref(null);
|
setup(props) {
|
||||||
const openGroup = ref([0]);
|
const showDialog = ref(false);
|
||||||
// const trans = ref(false);
|
const accountStore = useAccountStore();
|
||||||
const hover = ref(0);
|
const { user } = storeToRefs(accountStore);
|
||||||
|
const calendarStore = useCalendarStore();
|
||||||
|
const { toggleCalendarVisibility, hiddenCalendarIds } = calendarStore;
|
||||||
|
|
||||||
const editCreatedCalendar = (cal) => {
|
const calendar = ref(null);
|
||||||
|
const openGroup = ref([0]);
|
||||||
|
const trans = ref(false);
|
||||||
|
const hover = ref(0);
|
||||||
|
|
||||||
|
const editCreatedCalendar = (cal) => {
|
||||||
if (cal === undefined) {
|
if (cal === undefined) {
|
||||||
calendar.value = {
|
calendar.value = {
|
||||||
cl_name: '',
|
cl_name: '',
|
||||||
@@ -110,58 +122,56 @@ const editCreatedCalendar = (cal) => {
|
|||||||
calendar.value = { ...cal };
|
calendar.value = { ...cal };
|
||||||
}
|
}
|
||||||
showDialog.value = true;
|
showDialog.value = true;
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
window.$createCalendar = () => {
|
|
||||||
editCreatedCalendar();
|
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
|
||||||
const handleCloseDialog = () => {
|
const handleCloseDialog = () => {
|
||||||
if (calendar.value.cl_name.length > 1) {
|
|
||||||
const calendarData = JSON.parse(JSON.stringify(calendar.value));
|
|
||||||
window.dispatchEvent(
|
|
||||||
new CustomEvent('calendarCreated', {
|
|
||||||
detail: calendarData,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
showDialog.value = false;
|
showDialog.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const resetCalendar = () => {
|
const resetCalendar = () => {
|
||||||
calendar.value = {};
|
calendar.value = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleVisiblityEvents = (cal) => {
|
const toggleVisiblityEvents = (cal) => {
|
||||||
toggleCalendarVisibility(cal.id);
|
toggleCalendarVisibility(cal.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(hiddenCalendarIds, (newHiddenIds) => {}, { deep: true });
|
watch(hiddenCalendarIds, (newHiddenIds) => {}, { deep: true });
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.calendars,
|
() => props.calendars,
|
||||||
(newCalendars) => {},
|
(newCalendars) => {},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
accountStore,
|
||||||
|
user,
|
||||||
|
calendar,
|
||||||
|
showDialog,
|
||||||
|
editCreatedCalendar,
|
||||||
|
toggleVisiblityEvents,
|
||||||
|
openGroup,
|
||||||
|
trans,
|
||||||
|
hover,
|
||||||
|
handleCloseDialog,
|
||||||
|
resetCalendar,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.simple-hover {
|
.simple-hover {
|
||||||
|
opacity: 0.6;
|
||||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
width: 22px !important;
|
min-width: 30px !important;
|
||||||
height: 22px !important;
|
height: 30px !important;
|
||||||
border-radius: 3px !important;
|
|
||||||
margin-left: 0.5rem;
|
|
||||||
background-color: #00897b !important;
|
|
||||||
color: white;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.simple-hover:hover {
|
.simple-hover:hover {
|
||||||
background-color: #004d40 !important;
|
opacity: 1;
|
||||||
|
background-color: rgba(0, 137, 123, 0.1) !important;
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
.fade-enter-active,
|
.fade-enter-active,
|
||||||
|
|||||||
Reference in new issue
Block a user