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