Merge remote-tracking branch 'origin/Vit' into Alex

This commit is contained in:
Alex committed 2025-01-30 14:46:27 +03:00
commit 271d9c4f47
12 files changed
+95 -183

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

+8 -7
View File
@@ -13,7 +13,7 @@
cols=12
class="d-flex pa-1 flex-column "
>
<news-card :news="x"/>
<NewsCard :news="x"/>
</v-col>
</v-row>
@@ -21,7 +21,7 @@
<v-col class="pa-0" >
<v-pagination
v-model="page"
:length=visiblePage
:length="visiblePage"
:total-visible="7"
@update:modelValue="loadNewsAll"
/>
@@ -31,7 +31,7 @@
style="width:53px"
hide-details
hide-selected
density="compact"
v-model="countpage"
rounded
variant="underlined"
@@ -50,7 +50,7 @@
import { ref } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
import { useRoute } from 'vue-router'
import newsCard from './UI/news-card.vue'
import newsCard from './UI/NewsCard.vue'
export default {
@@ -68,11 +68,12 @@ export default {
const visiblePage = ref(0)
const loadNewsAll = () => {
axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path}&page=${page.value-1}&countpage=${countpage.value}`).then(result => {
axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path.slice(1)}&page=${page.value-1}&countpage=${countpage.value}`).then(result => {
newsAll.value= result.data.result
countetnews.value = result.data.countpage/countpage.value
visiblePage.value = countetnews.value <= 1 ? 1 : countetnews.value+1
visiblePage.value = countetnews.value <= 1 ? 1 : Math.ceil(countetnews.value+1)
}
)
}
@@ -82,7 +83,7 @@ export default {
return {
newsAll,
countetnews,
page,
countpage,
visiblePage,
+1 -1
View File
@@ -100,7 +100,7 @@ import Timer from "@/components/UI/Timer.vue"
import {baseURL} from "@/utils/axios-api";
import {computed, ref} from 'vue'
import {useAccountStore} from "@/store/AccountStore";
import defaultImage from '../../assets/emblem.png'
import defaultImage from '@/assets/emblem.png'
export default {
components: {Timer},
@@ -0,0 +1,59 @@
<template>
<div>
<v-list nav density="compact" class="text-blue-grey-lighten-1">
<v-list-item
v-for="x in aMenuItem"
:key="x"
:title="x.name"
:value="x.name"
:href="x.link"
:target="x.link ? '_blank' : ''"
slim
>
<template v-slot:prepend>
<v-icon :icon="x.ico" size="x_small" />
<v-tooltip v-if="rail" activator="parent" location="top">
</v-tooltip>
</template>
</v-list-item>
</v-list>
</div>
</template>
<script>
import { baseURL } from "@/utils/axios-api";
export default {
name:'AdminMenu',
props: {
rail: {
type: Boolean,
default: false
},
},
setup() {
const aMenuItem = [
{
name: "Панель администратора",
ico: "mdi-wrench",
link: baseURL + "admin",
},
]
return {
aMenuItem,
};
},
};
</script>
<style></style>
+18 -57
View File
@@ -12,7 +12,6 @@
<template v-slot:append>
<template v-if="accountStore.cod2user">
<vcard-user :author="accountStore.user" />
<v-tooltip location="bottom">
<template v-slot:activator="{ props }">
<v-btn color="black_and_white" v-bind="props" dark to="/faq" icon="mdi-comment-question-outline" />
@@ -78,15 +77,15 @@
<v-col class="flex-column d-flex">
<v-row><v-col>
<v-list nav density="compact">
<template v-for="(x, key) in navigations">
<template v-for="(x, key) in navigations" :key="key">
<!-- v-if="!('submenu' in x) || (x.path== '/portal' && accountStore.user.is_staff)" -->
<v-list-item v-if="(x.path == '/portal'
? accountStore.user.is_superuser
: true) && !('submenu' in x)
<v-list-item v-if="(x.path == '/portal'? accountStore.user.is_superuser : true) && !('submenu' in x)
" :key="x.key" :title="x.name" :value="x.name" :href="x.link" :disabled="x.path == ''" :to="x.path"
:target="x.link ? '_blank' : ''" color="navigation">
<!-- Чтобы сделать неактивным раздел безопасность, не забыть прописать путь до него в disabled для показа -->
:target="x.link ? '_blank' : ''"
color="navigation"
>
<template v-slot:prepend>
<v-icon :icon="x.ico" />
<v-tooltip v-if="rail" activator="parent" location="top">
@@ -116,7 +115,7 @@
</v-list>
<v-list nav density="compact">
<v-list-item v-for="x of mainmenuStore.portallinks" :key="x.name" :title="x.name" :value="x.name"
<v-list-item v-for="x of mainmenuStore.portallinks" :key="x.name" :title="x.name" :value="x.name"
:href="x.link" color="app_bar" :target="x.link ? '_blank' : ''">
<template v-slot:prepend>
<v-icon :icon="x.imagecode" />
@@ -131,17 +130,8 @@
<v-row class="flex-grow-0" v-if="accountStore.user.is_staff">
<v-col>
<default-portal-menu-list :rail="rail" />
<!-- <v-list nav density="compact" active-class="noneoutline">
<default-portal-menu-list :aMenuItem="supperuser"/>
<div v-if="getDevelopment()">
<default-portal-menu-list :aMenuItem="oRasrab"/>
</div>
</v-list> -->
<AdminMenu :rail="rail" />
</v-col>
</v-row>
<v-row no-gutters class="flex-grow-0">
@@ -197,8 +187,8 @@ import { axiosApiInstance, 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 DefaultPortalMenuList from "@/layouts/default/DefaultPortalMenuList.vue";
import { getDevelopment } from "@/utils/universal_functions";
import AdminMenu from "@/layouts/default/AdminMenu.vue";
import { useDisplay } from "vuetify";
export default {
@@ -208,7 +198,7 @@ export default {
CardLike,
VcardUser,
PageCounter,
DefaultPortalMenuList,
AdminMenu,
},
mixins: [uf],
@@ -258,30 +248,7 @@ export default {
mainmenuStore.loadlinks();
const gittlink = () => {
const link =
baseURL == "http://127.0.0.1:8000/"
? "http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects"
: "http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22";
return link;
};
// 'https://materialdesignicons.com/cdn/1.6.50-dev/'
const oRasrab = [
{
name: "Gitt",
ico: "mdi-github",
link: gittlink(),
},
{
name: "Swagger",
ico: "mdi-puzzle",
link: "http://127.0.0.1:8000/swagger/",
},
];
// ]
const navigations = ref([
{
@@ -354,11 +321,7 @@ export default {
path: "/portal",
},
// {
// name: 'К празднику',
// ico: 'mdi-cake-variant',
// path: "/fnshol"
// }
]);
const imageSrc = computed(() => {
@@ -390,7 +353,7 @@ export default {
});
};
getSafetyChapter();
// getSafetyChapter();
return {
theme,
@@ -402,18 +365,16 @@ export default {
navigations,
imageSrc,
LikeDialog,
scrimg,
oRasrab,
scrimg,
rail,
showTooltip,
menuTruncated,
// feedalert,
alert,
burl,
name,
closeinfo,
baseURL,
getDevelopment,
message,
};
},
@@ -1,89 +0,0 @@
<template>
<div>
<v-list nav density="compact" class="text-blue-grey-lighten-1">
<div v-for="(list, key) in aMenuItem" :key="key">
<div v-if="showProm(key)">
<v-list-item
v-for="x in list"
:key="x"
:title="x.name"
:value="x.name"
:href="x.link"
:target="x.link ? '_blank' : ''"
slim
>
<template v-slot:prepend>
<v-icon :icon="x.ico" size="x_small" />
<v-tooltip v-if="rail" activator="parent" location="top">
</v-tooltip>
</template>
</v-list-item>
</div>
</div>
</v-list>
</div>
</template>
<script>
import { baseURL } from "@/utils/axios-api";
import { getDevelopment } from "@/utils/universal_functions";
export default {
props: {
rail: {
type: Boolean,
default: false
},
},
setup() {
const gittlink = () => {
const link =
baseURL == "http://127.0.0.1:8000/"
? "http://sulaco.nodered.ru:5223/COD2/PORTAL_COD2/projects"
: "http://maestro.cod2.regions.tax.nalog.ru:3333/COD2/PORTAL_COD2/projects/22";
return link;
};
const aMenuItem = {
prom: [
{
name: "Панель администратора",
ico: "mdi-wrench",
link: baseURL + "admin",
},
],
my: [
{
name: "Gitt",
ico: "mdi-github",
link: gittlink(),
},
{
name: "Swagger",
ico: "mdi-puzzle",
link: "http://127.0.0.1:8000/swagger/",
},
],
};
const showProm = (data) => {
let show = true;
if (data == "my" && getDevelopment() == false) {
show = false;
}
return show;
};
return {
aMenuItem,
getDevelopment,
showProm,
};
},
};
</script>
<style></style>
+2 -6
View File
@@ -6,8 +6,7 @@ import { axiosApiInstance, clearAxios } from "@/utils/axios-api";
import { useRouter } from "vue-router";
import moment from "moment";
import { ref, onMounted } from "vue";
import defaultImage from '@/assets/FNS-logo-xs.png'
export function get_name(namestr) {
let arr = namestr.split("/");
return arr[arr.length - 1];
@@ -57,7 +56,7 @@ export function getfromserverfree(path, reactive) {
export function checkremote(filecheck) {
return process.env.NODE_ENV == "development"
? "https://pixelbox.ru/wp-content/uploads/2021/11/avatar-whatsapp-pixelbox.ru-36.jpg"
? defaultImage
: filecheck;
}
@@ -92,9 +91,6 @@ export function pagecounter() {
});
}
}
export function getDevelopment() {
return process.env.NODE_ENV == "development" ? true : false;
}
export function useICalReader(url) {
///
+2 -2
View File
@@ -65,12 +65,12 @@ import NoneVote from "@/components/vote/NoneVote.vue"
import {useRoute, useRouter} from "vue-router";
import VoteResult from "@/components/vote/VoteResult.vue";
import {deleteVote, getVoteDetail, getVoteResult, getVotes} from "@/utils/axios-api";
import {formatDate} from "@vueuse/shared";
// import {formatDate} from "@vueuse/shared";
import { useAccountStore } from "@/store/AccountStore";
import {pagecounter} from '@/utils/universal_functions'
export default {
methods: {formatDate},
components: {CurrentVote, VoteConstructor, VoteCardVue, VoteResult, NoneVote},
setup() {