Merge branch 'Vit' into develop

This commit is contained in:
Nukeap committed 2025-02-05 09:21:43 +03:00
commit 5e3350cc80
7 files changed
+205 -318

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run lint-staged
+4
View File
@@ -9,4 +9,8 @@ export default [
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, {languageOptions: { globals: {...globals.browser, ...globals.node} }},
pluginJs.configs.recommended, pluginJs.configs.recommended,
...pluginVue.configs["flat/essential"], ...pluginVue.configs["flat/essential"],
{rules: {
'no-console': 'error',
}}
]; ];
-29
View File
@@ -4,9 +4,6 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"dependencies": {
"vue-md-parser": "^1.0.3"
},
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.19.0", "@eslint/js": "^9.19.0",
"eslint": "^9.19.0", "eslint": "^9.19.0",
@@ -14,7 +11,6 @@
"eslint-plugin-prettier": "^5.2.3", "eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-vue": "^9.32.0", "eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0", "globals": "^15.14.0",
"husky": "^8.0.0",
"lint-staged": "^15.4.3", "lint-staged": "^15.4.3",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"vitepress": "^1.6.3" "vitepress": "^1.6.3"
@@ -2721,22 +2717,6 @@
"node": ">=16.17.0" "node": ">=16.17.0"
} }
}, },
"node_modules/husky": {
"version": "8.0.3",
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
"dev": true,
"license": "MIT",
"bin": {
"husky": "lib/bin.js"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.3.2", "version": "5.3.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
@@ -4386,15 +4366,6 @@
"url": "https://opencollective.com/eslint" "url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/vue-md-parser": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/vue-md-parser/-/vue-md-parser-1.0.3.tgz",
"integrity": "sha512-vQaa/uIRt8qCWDH62WgPvxgBGPMErR7s7oWcF8uOTrdZTUROq3w1wnZ1lJ3fvv44bB7yaai8LyiC8/sScdQ+VA==",
"license": "MIT",
"bin": {
"vue-md-parser": "generateDocs.js"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+1 -8
View File
@@ -4,7 +4,7 @@
"docs:build": "vitepress build docs", "docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs", "docs:preview": "vitepress preview docs",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"prepare": "husky install", "postinstall": "git config core.hooksPath .git-hooks",
"lint-staged": "lint-staged" "lint-staged": "lint-staged"
}, },
"devDependencies": { "devDependencies": {
@@ -14,7 +14,6 @@
"eslint-plugin-prettier": "^5.2.3", "eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-vue": "^9.32.0", "eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0", "globals": "^15.14.0",
"husky": "^8.0.0",
"lint-staged": "^15.4.3", "lint-staged": "^15.4.3",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"vitepress": "^1.6.3" "vitepress": "^1.6.3"
@@ -23,12 +22,6 @@
"*.{js,ts,vue}": [ "*.{js,ts,vue}": [
"prettier --write", "prettier --write",
"eslint --fix" "eslint --fix"
],
"*.py": [
"env/scripts/pylint"
] ]
},
"dependencies": {
"vue-md-parser": "^1.0.3"
} }
} }
@@ -15,7 +15,6 @@
no-resize no-resize
variant="outlined" variant="outlined"
/> />
</v-col> </v-col>
<v-col class="flex-grow-0 px-2"> <v-col class="flex-grow-0 px-2">
<v-btn <v-btn
@@ -47,14 +46,12 @@
</v-locale-provider> </v-locale-provider>
</v-col> </v-col>
<v-col class="flex-column d-flex"> <v-col class="flex-column d-flex">
<v-row no-gutters class="h-0 overflow-auto flex-column flex-nowrap"> <v-row no-gutters class="h-0 overflow-auto flex-column flex-nowrap">
<v-col> <v-col>
<calendar-my <calendar-my
:calendars=" :calendars="
calendarForMy.filter( calendarForMy.filter((e) => e.author == accountStore.user.is_idEmployee)
(e) => e.author == accountStore.user.is_idEmployee
)
" "
title="Мои календари" title="Мои календари"
@getCalendar="getCalendar" @getCalendar="getCalendar"
@@ -62,9 +59,7 @@
<calendar-my <calendar-my
:calendars=" :calendars="
calendarForMy.filter( calendarForMy.filter((e) => e.author != accountStore.user.is_idEmployee)
(e) => e.author != accountStore.user.is_idEmployee
)
" "
title="Подписки" title="Подписки"
/> />
@@ -104,13 +99,13 @@
</template> </template>
<script> <script>
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, watch } from 'vue';
import { useWeekendsStore } from "@/store/WeekendsStore"; import { useWeekendsStore } from '@/store/WeekendsStore';
import EventCreate from "@/components/calendar_of_events/event-create.vue"; import EventCreate from '@/components/calendar_of_events/event-create.vue';
import CalendarMy from "@/components/calendar_of_events/calendar-my.vue"; import CalendarMy from '@/components/calendar_of_events/calendar-my.vue';
import { axiosApiInstance } from "@/utils/axios-api"; import { axiosApiInstance } from '@/utils/axios-api';
import { useAccountStore } from "@/store/AccountStore"; import { useAccountStore } from '@/store/AccountStore';
import CalendarFull from "@/components/calendar_of_events/UI_calendar/calendarFull.vue"; import CalendarFull from '@/components/calendar_of_events/UI_calendar/calendarFull.vue';
export default { export default {
components: { EventCreate, CalendarMy, CalendarFull }, components: { EventCreate, CalendarMy, CalendarFull },
@@ -136,36 +131,27 @@ export default {
}; };
const getCalendar = () => { const getCalendar = () => {
axiosApiInstance axiosApiInstance.get(`api/calendar_of_events/my_calendars/`).then((res) => {
.get(`api/calendar_of_events/my_calendars/`) res.data.forEach((e) => (e.visible = accountStore.calendar.includes(e.id) ? false : true));
.then((res) => { calendarForMy.value = res.data;
res.data.forEach( });
(e) =>
(e.visible = accountStore.calendar.includes(e.id) ? false : true)
);
calendarForMy.value = res.data;
});
}; };
getCalendar(); getCalendar();
const getEvents = (idEvent, clik) => { const getEvents = (idEvent, clik) => {
axiosApiInstance axiosApiInstance
.get( .get(`api/calendar_of_events/my_events/${idEvent === undefined ? '' : `?id=${idEvent}`}`)
`api/calendar_of_events/my_events/${
idEvent === undefined ? "" : `?id=${idEvent}`
}`
)
.then((res) => { .then((res) => {
if (idEvent === undefined) { if (idEvent === undefined) {
res.data.event = { res.data.event = {
name: "", name: '',
participant: [accountStore.user.is_idEmployee], participant: [accountStore.user.is_idEmployee],
files: [], files: [],
date_start: new Date(), date_start: new Date(),
date_end: new Date(), date_end: new Date(),
period: null, period: null,
description: "", description: '',
calendar: null, calendar: null,
}; };
} }
@@ -185,28 +171,25 @@ export default {
}; };
const weekendsData = () => { const weekendsData = () => {
cal.value.$el cal.value.$el.querySelectorAll('.v-date-picker-month__day').forEach((e) => {
.querySelectorAll(".v-date-picker-month__day") let datas = e.getAttribute('data-v-date');
.forEach((e) => { let weeks = new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0;
let datas = e.getAttribute("data-v-date"); if (weeks) {
let weeks = e.querySelectorAll('span').forEach((n) => {
new Date(datas).getDay() === 6 || new Date(datas).getDay() === 0; n.classList.add('text-red');
if (weeks) { });
e.querySelectorAll("span").forEach((n) => { }
n.classList.add("text-red"); if (MyMonth.value in week.week[MyYear.value]) {
if (week.week[MyYear.value][MyMonth.value].includes(datas)) {
e.querySelectorAll('span').forEach((n) => {
n.classList.add('text-red');
if (n.classList.contains('text-red') && weeks) {
n.classList.replace('text-red', 'text-black');
}
}); });
} }
if (MyMonth.value in week.week[MyYear.value]) { }
if (week.week[MyYear.value][MyMonth.value].includes(datas)) { });
e.querySelectorAll("span").forEach((n) => {
n.classList.add("text-red");
if (n.classList.contains("text-red") && weeks) {
n.classList.replace("text-red", "text-black");
}
});
}
}
});
}; };
onMounted(() => { onMounted(() => {
@@ -219,7 +202,7 @@ export default {
if (newValue) { if (newValue) {
weekendsData(); weekendsData();
} }
} },
); );
const CheckingStore = () => { const CheckingStore = () => {
@@ -231,7 +214,7 @@ export default {
}; };
const infoEvent = (i) => { const infoEvent = (i) => {
console.log(i, "iiiiiiiiii"); console.log(i, 'iiiiiiiiii');
}; };
return { return {
+88 -150
View File
@@ -1,160 +1,98 @@
<template> <template>
<v-carousel
cover
:height="carushi"
hide-delimiters
hide-delimiter-background
show-arrows="hover"
color="white"
>
<v-carousel-item v-for="(x, i) in carous" :key="i" :src="`${burl}${x.link}`" cover eager>
<v-container fill-height fluid pa-0 ma-0 pb-3 class="flex-column h-100 d-flex">
<v-card class="bgCard h-100 d-flex flex-column">
<v-card-title class="ma-2 text-h3 text-uppercase titles py-5 flex-column">
<v-row>
<v-col class="pa-0 pl-1 align-self-center">{{ x.title }} </v-col>
<v-carousel <v-col class="flex-grow-0 pa-0 pr-1">
<v-img width="50" :aspect-ratio="1" :src="`${burl}${x.sender}`" cover />
cover </v-col>
:height="carushi" </v-row>
hide-delimiters </v-card-title>
hide-delimiter-background <v-card-text
show-arrows="hover" v-if="'text' in x && x.text.length > 0"
color="white" class="ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1"
>
<v-row>
<v-col cols="6" class="bgText">
<v-textarea
> class="mt-n3 text-black textareas pt-2 font-weight-medium"
:model-value="x.text"
variant="plain"
<v-carousel-item readonly
v-for="(x, i) in carous" :key="i" auto-grow
:src="`${burl}${x.link}`" rows="1"
cover hide-details
eager />
> </v-col>
<v-container <v-col cols="6" class="bgText">
fill-height <v-img :aspect-ratio="1" :src="`${burl}${x.link2}`" />
fluid </v-col>
pa-0 ma-0 pb-3 </v-row>
class="flex-column h-100 d-flex" </v-card-text>
> </v-card>
</v-container>
<v-card class="bgCard h-100 d-flex flex-column"> </v-carousel-item>
<v-card-title class="ma-2 text-h3 text-uppercase titles py-5 flex-column"> </v-carousel>
<v-row> </template>
<v-col class="pa-0 pl-1 align-self-center">{{x.title}}
</v-col>
<v-col class="flex-grow-0 pa-0 pr-1">
<v-img
width="50"
:aspect-ratio="1"
:src="`${burl}${x.sender}`"
cover
/>
</v-col>
</v-row>
</v-card-title>
<v-card-text v-if="'text' in x && x.text.length>0" class="ml-2 mb-0 mb-2 flex-grow-0 pb-3 text-h6 h-100 pl-3 py-3 mr-1 ">
<v-row>
<script>
<v-col cols=6 class=" bgText"> import { ref, computed } from 'vue';
<v-textarea
class="mt-n3 text-black textareas pt-2 font-weight-medium"
:model-value=x.text
variant='plain'
readonly
auto-grow
rows="1"
hide-details
/> import { baseURL } from '@/utils/axios-api';
import { axiosApiInstance } from '@/utils/axios-api';
</v-col>
<v-col cols=6 class=" bgText"> export default {
<v-img setup() {
const burl = baseURL.slice(0, -1);
const carous = ref([{ link: '' }]);
:aspect-ratio="1"
:src="`${burl}${x.link2}`"
/>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-container>
</v-carousel-item>
</v-carousel>
</template>
<script>
import { ref, computed } from 'vue'
import {getfromserver} from '@/utils/universal_functions'
import { baseURL } from '@/utils/axios-api'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
setup() {
const burl = baseURL.slice(0,-1)
const carous=ref([{link: ""}])
axiosApiInstance.get(`api/fns/links/`).then(data => {
carous.value= data.data
// t_dailyRound.value = data.data
// result.value=JSON.parse(JSON.stringify(data.data.daily)) axiosApiInstance.get(`api/fns/links/`).then((data) => {
carous.value = data.data;
}) // t_dailyRound.value = data.data
// getfromserver("api/fns/links/", carous)
const carushi = computed(()=> {
return window.innerHeight-50
})
return { burl, carous, carushi}
}
// result.value=JSON.parse(JSON.stringify(data.data.daily))
});
// getfromserver("api/fns/links/", carous)
const carushi = computed(() => {
} return window.innerHeight - 50;
</script> });
<style> return { burl, carous, carushi };
.bgCard { },
/* #ffffff6b #ffffff8c*/ };
background: #ffffff38 ; </script>
}
<style>
.bgText { .bgCard {
background: #ffffffb0; /* #ffffff6b #ffffff8c*/
line-height: 3.1rem!important; background: #ffffff38;
}
}
.bgText {
.titles { background: #ffffffb0;
/* font-family: cursive !important; */ line-height: 3.1rem !important;
background: #ffffff8c; }
}
.titles {
.textareas .v-field__input { /* font-family: cursive !important; */
background: #ffffff8c;
font-size: 2.5em!important; }
}
</style> .textareas .v-field__input {
font-size: 2.5em !important;
}
</style>
+76 -74
View File
@@ -1,98 +1,100 @@
<template> <template>
<v-container :fluid="true"> <v-container :fluid="true">
<v-tabs v-model="activeTab" class="mb-2 text-teal-darken-4"> <v-tabs v-model="activeTab" class="mb-2 text-teal-darken-4">
<v-tab v-for="tab in tabs" :key="tab.value" :value="tab.value"> {{ tab.title }} </v-tab> <v-tab v-for="tab in tabs" :key="tab.value" :value="tab.value"> {{ tab.title }} </v-tab>
</v-tabs> </v-tabs>
<v-tabs-window v-model="activeTab" class="border-t-thin"> <v-tabs-window v-model="activeTab" class="border-t-thin">
<!-- Вкладка назначенные --> <!-- Вкладка назначенные -->
<v-tabs-window-item class="my-2 "> <v-tabs-window-item class="my-2">
<CatalogTest title="Назначенные" :activeTab="activeTab" :testingCard="getAllTests"> <CatalogTest title="Назначенные" :activeTab="activeTab" :testingCard="getAllTests">
<template #buttons> <template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0"> <v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Тренироваться Тренироваться
</v-btn> </v-btn>
<v-btn color="teal-darken-1" elevation="0"> <v-btn color="teal-darken-1" elevation="0"> Пройти </v-btn>
Пройти </template>
</v-btn> </CatalogTest>
</template> </v-tabs-window-item>
</CatalogTest>
</v-tabs-window-item>
<!-- Вкладка завершенных --> <!-- Вкладка завершенных -->
<v-tabs-window-item> <v-tabs-window-item>
<CatalogTest title="Завершенные" :activeTab="activeTab" :testingCard="getAllTests"> <CatalogTest title="Завершенные" :activeTab="activeTab" :testingCard="getAllTests">
<!-- Здесь отобразить результат теста после того как будет готов БЭК и УМТ --> <!-- Здесь отобразить результат теста после того как будет готов БЭК и УМТ -->
<template #results> <template #results>
<!-- <div> <!-- <div>
<v-icon icon="mdi-calendar-clock" size="large" /> <v-icon icon="mdi-calendar-clock" size="large" />
<span class="ml-1">12354</span> <span class="ml-1">12354</span>
</div> --> </div> -->
</template> </template>
<template #buttons> <template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0"> <v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Результаты Результаты
</v-btn> </v-btn>
</template> </template>
</CatalogTest> </CatalogTest>
</v-tabs-window-item> </v-tabs-window-item>
<!-- Вкладка каталога --> <!-- Вкладка каталога -->
<v-tabs-window-item> <v-tabs-window-item>
<CatalogTest title="Каталог" :activeTab="activeTab" :testingCard="getAllTests"> <CatalogTest title="Каталог" :activeTab="activeTab" :testingCard="getAllTests">
<template #buttons> <template #buttons>
<v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0"> <v-btn color="#00897B1F" class="mr-2 text-teal-darken-1" elevation="0">
Тренироваться Тренироваться
</v-btn> </v-btn>
</template> </template>
</CatalogTest> </CatalogTest>
</v-tabs-window-item> </v-tabs-window-item>
</v-tabs-window> </v-tabs-window>
</v-container> </v-container>
</template> </template>
<script> <script>
import CatalogTest from "@/components/testing/CatalogTest.vue"; import CatalogTest from '@/components/testing/CatalogTest.vue';
import { axiosApiInstance } from "@/utils/axios-api"; import { axiosApiInstance } from '@/utils/axios-api';
import { ref, computed, watch } from "vue" import { ref, computed, watch } from 'vue';
export default { export default {
components: { components: {
CatalogTest CatalogTest,
}, },
setup() { setup() {
const activeTab = ref(0); const activeTab = ref(0);
const currentTest = ref('') const currentTest = ref('');
const getAllTests = ref([])
const getTestById = () => { const getAllTests = ref([]);
let status = activeTab.value == 0 ? '?status=active' : activeTab.value == 1 ? '?status=completed' : ''
axiosApiInstance.get(`/api/tests/gettests/${status}`).then(resp => getAllTests.value = resp.data).finally(() => {
if (activeTab.value == 0) {
currentTest.value = getAllTests.value.length
}
})
}
getTestById() const getTestById = () => {
let status =
watch (() => activeTab.value, activeTab.value == 0 ? '?status=active' : activeTab.value == 1 ? '?status=completed' : '';
() => { axiosApiInstance
getTestById() .get(`/api/tests/gettests/${status}`)
.then((resp) => (getAllTests.value = resp.data))
.finally(() => {
if (activeTab.value == 0) {
currentTest.value = getAllTests.value.length;
} }
) });
};
const tabs = computed(() => [ getTestById();
{ value: 0, title: `Назначенные (${currentTest.value})`, },
{ value: 1, title: 'Завершенные', },
{ value: 2, title: 'Каталог', },
])
watch(
() => activeTab.value,
() => {
getTestById();
},
);
return { const tabs = computed(() => [
activeTab, { value: 0, title: `Назначенные (${currentTest.value})` },
tabs, { value: 1, title: 'Завершенные' },
getAllTests, { value: 2, title: 'Каталог' },
} ]);
}
} return {
</script> activeTab,
tabs,
getAllTests,
};
},
};
</script>