Merge branch 'I'
This commit is contained in:
commit
5e120417a9
35 files changed
+850
-296
No files matched your search
BIN
Binary file not shown.
Generated
+29
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.14",
|
"version": "0.0.15",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.14",
|
"version": "0.0.15",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^6.1.8",
|
"@fullcalendar/core": "^6.1.8",
|
||||||
"@fullcalendar/daygrid": "^6.1.8",
|
"@fullcalendar/daygrid": "^6.1.8",
|
||||||
@@ -19,10 +19,12 @@
|
|||||||
"@vuelidate/core": "^2.0.3",
|
"@vuelidate/core": "^2.0.3",
|
||||||
"@vuelidate/validators": "^2.0.3",
|
"@vuelidate/validators": "^2.0.3",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"chart.js": "^4.4.0",
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.23",
|
||||||
"roboto-fontface": "*",
|
"roboto-fontface": "*",
|
||||||
"vue": "^3.2.0",
|
"vue": "^3.2.0",
|
||||||
|
"vue-chartjs": "^5.2.0",
|
||||||
"vue-jwt-decode": "^0.1.0",
|
"vue-jwt-decode": "^0.1.0",
|
||||||
"vue-router": "^4.0.0",
|
"vue-router": "^4.0.0",
|
||||||
"vue-scrollto": "^2.20.0",
|
"vue-scrollto": "^2.20.0",
|
||||||
@@ -3139,6 +3141,11 @@
|
|||||||
"integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==",
|
"integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@kurkle/color": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
|
||||||
|
},
|
||||||
"node_modules/@mdi/font": {
|
"node_modules/@mdi/font": {
|
||||||
"version": "7.0.96",
|
"version": "7.0.96",
|
||||||
"resolved": "https://registry.npmjs.org/@mdi/font/-/font-7.0.96.tgz",
|
"resolved": "https://registry.npmjs.org/@mdi/font/-/font-7.0.96.tgz",
|
||||||
@@ -6525,6 +6532,17 @@
|
|||||||
"is-regex": "^1.0.3"
|
"is-regex": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/chart.js": {
|
||||||
|
"version": "4.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.0.tgz",
|
||||||
|
"integrity": "sha512-vQEj6d+z0dcsKLlQvbKIMYFHd3t8W/7L2vfJIbYcfyPcRx92CsHqECpueN8qVGNlKyDcr5wBrYAYKnfu/9Q1hQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@kurkle/color": "^0.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"pnpm": ">=7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "3.5.3",
|
"version": "3.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||||
@@ -12845,6 +12863,15 @@
|
|||||||
"@vue/shared": "3.3.4"
|
"@vue/shared": "3.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vue-chartjs": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-chartjs/-/vue-chartjs-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-d3zpKmGZr2OWHQ1xmxBcAn5ShTG917+/UCLaSpaCDDqT0U7DBsvFzTs69ZnHCgKoXT55GZDW8YEj9Av+dlONLA==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"chart.js": "^4.1.1",
|
||||||
|
"vue": "^3.0.0-0 || ^2.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vue-component-type-helpers": {
|
"node_modules/vue-component-type-helpers": {
|
||||||
"version": "1.8.8",
|
"version": "1.8.8",
|
||||||
"resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.8.8.tgz",
|
"resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-1.8.8.tgz",
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.14",
|
"version": "0.0.15",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
"@vuelidate/core": "^2.0.3",
|
"@vuelidate/core": "^2.0.3",
|
||||||
"@vuelidate/validators": "^2.0.3",
|
"@vuelidate/validators": "^2.0.3",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"chart.js": "^4.4.0",
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.23",
|
||||||
"roboto-fontface": "*",
|
"roboto-fontface": "*",
|
||||||
"vue": "^3.2.0",
|
"vue": "^3.2.0",
|
||||||
|
"vue-chartjs": "^5.2.0",
|
||||||
"vue-jwt-decode": "^0.1.0",
|
"vue-jwt-decode": "^0.1.0",
|
||||||
"vue-router": "^4.0.0",
|
"vue-router": "^4.0.0",
|
||||||
"vue-scrollto": "^2.20.0",
|
"vue-scrollto": "^2.20.0",
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 665 KiB |
@@ -106,11 +106,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const logging=async()=>{
|
const logging=async()=>{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!v$.value.$error) {
|
if (!v$.value.$error) {
|
||||||
await accountStore.logging(anon)
|
await accountStore.logging(anon)
|
||||||
}
|
}
|
||||||
@@ -118,9 +113,7 @@ export default {
|
|||||||
console.log(true);
|
console.log(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
v$.value.$validate()
|
v$.value.$validate()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -118,20 +118,7 @@ export default {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
||||||
for (let x in data.data) {
|
for (let x in data.data) {
|
||||||
|
|
||||||
// if (x =="Отпуск") {
|
|
||||||
|
|
||||||
|
|
||||||
// data.data[x].map(e=>{
|
|
||||||
// let d = new Date(e.planned_date)
|
|
||||||
|
|
||||||
// calendarOptions.events.push({ description: 'description for All Day Event', title: x, start: e.planned_date, end: new Date(d.setDate(d.getDate() + e.count_days)).toISOString().split('T')[0]})
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
if (x=="План-график") {
|
if (x=="План-график") {
|
||||||
data.data[x].map(e=>{
|
data.data[x].map(e=>{
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex-grow-1 flex-column overflow-auto">
|
||||||
|
<v-card
|
||||||
|
v-show="route.path=='/'"
|
||||||
|
:ref="i"
|
||||||
|
class="mx-auto"
|
||||||
|
:class="i>0?'mt-1':''"
|
||||||
|
v-for="(x, i) in newss.result" :key= i
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<v-card-title class="py-1">
|
||||||
|
{{x.title}}
|
||||||
|
</v-card-title>
|
||||||
|
<v-img
|
||||||
|
:src="`${burl}${x.link}`"
|
||||||
|
height="164px"
|
||||||
|
cover
|
||||||
|
width="92%"
|
||||||
|
class="mx-auto"
|
||||||
|
/>
|
||||||
|
<v-list-item class="w-100">
|
||||||
|
<div class="justify-self-start mt-1">
|
||||||
|
<v-icon size="x-small" class="me-1" icon="mdi-account" ></v-icon>
|
||||||
|
<span class="text-caption me-2">{{splitname(x.author)}}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-slot:append>
|
||||||
|
<div class="justify-self-end">
|
||||||
|
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
||||||
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
||||||
|
<span class="me-1">·</span>
|
||||||
|
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'" @click="toggleIncrementLike(x.id, false)"/>
|
||||||
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
||||||
|
<span class="me-1">·</span>
|
||||||
|
<v-icon size="x-small" class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
||||||
|
<span class="pointer subheading">{{ x.comment.length }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</v-list-item>
|
||||||
|
<v-divider/>
|
||||||
|
<v-card-text class="pb-0">
|
||||||
|
{{limitText(x.text)}}
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<div class="pt-1 pl-1 pb-2">
|
||||||
|
<v-btn
|
||||||
|
color="light-blue-darken-4"
|
||||||
|
variant="text"
|
||||||
|
:to='`/news?id=${x.id}`'
|
||||||
|
size="small"
|
||||||
|
|
||||||
|
append-icon="mdi-step-forward-2"
|
||||||
|
|
||||||
|
>
|
||||||
|
Подробнее
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { ref, watch, onBeforeUpdate, onMounted } from 'vue'
|
||||||
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
|
import { baseURL } from '@/utils/axios-api'
|
||||||
|
import myHelper from './UI/my-helper.vue'
|
||||||
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
import { format } from 'date-fns'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { myHelper },
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setup(){
|
||||||
|
const divs = ref([])
|
||||||
|
onBeforeUpdate(() => {
|
||||||
|
divs.value = []
|
||||||
|
})
|
||||||
|
const newss=ref([])
|
||||||
|
const dialogCommentShow = ref(false)
|
||||||
|
const burl = baseURL.slice(0,-1)
|
||||||
|
const textcomment = ref('')
|
||||||
|
const idnews = ref(0)
|
||||||
|
const page = ref(1)
|
||||||
|
const selecnews = ref(2)
|
||||||
|
const route = useRoute()
|
||||||
|
let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`
|
||||||
|
|
||||||
|
if (route.path == '/news' && 'id' in route.query){
|
||||||
|
str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}&id=${route.query.id}`
|
||||||
|
}
|
||||||
|
|
||||||
|
getfromserver(str, newss)
|
||||||
|
|
||||||
|
|
||||||
|
const toggleIncrementLike = (news, scores) => {
|
||||||
|
axiosApiInstance.post(`api/navigation/news/`, {news: news, scores: scores}).then(result => {
|
||||||
|
newss.value.result[newss.value.result.findIndex(e=> e.id==news)].scores= result.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const addComment = () => {
|
||||||
|
axiosApiInstance.post(`api/navigation/news/`, {news: idnews.value, text: textcomment.value}).then(result => {
|
||||||
|
dialogCommentShow.value=!dialogCommentShow.value
|
||||||
|
newss.value.result[newss.value.result.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
||||||
|
})
|
||||||
|
textcomment.value=""
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletComment = (id, news) => {
|
||||||
|
axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => {
|
||||||
|
newss.value.result[newss.value.result.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const pagelistNews =() => {
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`, newss)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
||||||
|
if(newValue){
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`,newss)
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
|
||||||
|
watch(()=>selecnews ,(newValue,oldValue)=>{
|
||||||
|
if(newValue){
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${newValue.value}`, newss)
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const dateformat = (datas) => {
|
||||||
|
return format(new Date(datas), 'dd.MM.yyyy HH:mm')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const openComent = (news) => {
|
||||||
|
dialogCommentShow.value=!dialogCommentShow.value
|
||||||
|
idnews.value = news
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const limitText=(text)=> {
|
||||||
|
const t = text.split(' ').slice(0, 25)
|
||||||
|
return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const splitname = (name) => {
|
||||||
|
return name.familyname + ' ' + name.name[0] + '.' + name.parentname[0]+ '.'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
newss,
|
||||||
|
burl,
|
||||||
|
limitText,
|
||||||
|
toggleIncrementLike,
|
||||||
|
dialogCommentShow,
|
||||||
|
accountStore,
|
||||||
|
dateformat,
|
||||||
|
splitname,
|
||||||
|
textcomment,
|
||||||
|
openComent,
|
||||||
|
addComment,
|
||||||
|
idnews,
|
||||||
|
deletComment,
|
||||||
|
pagelistNews,
|
||||||
|
divs,
|
||||||
|
page,
|
||||||
|
selecnews,
|
||||||
|
route
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.newsVH {
|
||||||
|
height: 90vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgchat {
|
||||||
|
background-color: #efe9f98a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgchatnot {
|
||||||
|
background-color: #eef9efad;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .bgf {
|
||||||
|
background: url("@/assets/message.jpg") repeat-y;
|
||||||
|
|
||||||
|
} */
|
||||||
|
|
||||||
|
</style>
|
||||||
+139
-112
@@ -1,30 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container class="py-0 newsVH px-0 bg-transparent overflow-auto">
|
<v-container class="py-0 newsVH px-0 bg-transparent overflow-auto">
|
||||||
<!-- <v-btn v-scroll-to="{element:'#g'}">
|
|
||||||
j
|
|
||||||
</v-btn> -->
|
|
||||||
<v-card
|
<v-card
|
||||||
v-show="pages=='home'"
|
v-show="route.path=='/'"
|
||||||
:ref="i"
|
:ref="i"
|
||||||
class="mx-auto"
|
class="mx-auto"
|
||||||
:class="i>0?'mt-1':''"
|
:class="i>0?'mt-1':''"
|
||||||
v-for="(x, i) in newss" :key= i
|
v-for="(x, i) in newss.result" :key= i
|
||||||
>
|
>
|
||||||
|
|
||||||
<v-list-item class="w-100 pl-4 py-2 pt-3">
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-avatar
|
|
||||||
size="35"
|
|
||||||
color="grey-darken-3"
|
|
||||||
:image="accountStore.user.photo"
|
|
||||||
></v-avatar>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<v-list-item-title class="text-body-2">{{x.author.fio}}</v-list-item-title>
|
<v-card-title class="py-1">
|
||||||
|
|
||||||
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
|
||||||
</v-list-item>
|
|
||||||
<v-card-title class="pt-0 pb-1">
|
|
||||||
{{x.title}}
|
{{x.title}}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-img
|
<v-img
|
||||||
@@ -35,51 +21,61 @@
|
|||||||
class="mx-auto"
|
class="mx-auto"
|
||||||
/>
|
/>
|
||||||
<v-list-item class="w-100">
|
<v-list-item class="w-100">
|
||||||
|
<div class="justify-self-start mt-1">
|
||||||
|
<v-icon size="x-small" class="me-1" icon="mdi-account" ></v-icon>
|
||||||
|
<span class="text-caption me-2">{{splitname(x.author)}}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<div class="justify-self-end">
|
<div class="justify-self-end">
|
||||||
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.id && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
||||||
<span class="me-1">·</span>
|
<span class="me-1">·</span>
|
||||||
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.id && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'" @click="toggleIncrementLike(x.id, false)"/>
|
<v-icon size="x-small" class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'" @click="toggleIncrementLike(x.id, false)"/>
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
||||||
<span class="me-1">·</span>
|
<span class="me-1">·</span>
|
||||||
<v-icon size="x-small" class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
<v-icon size="x-small" class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
||||||
<span @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
|
<span class="pointer subheading">{{ x.comment.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<v-divider/>
|
||||||
<v-card-text class="py-0">
|
<v-card-text class="pb-0">
|
||||||
{{limitText(x.text)}}
|
{{limitText(x.text)}}
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
|
||||||
<v-btn
|
<div class="pt-1 pl-1 pb-2">
|
||||||
color="#3E8890"
|
<v-btn
|
||||||
|
color="light-blue-darken-4"
|
||||||
variant="text"
|
variant="text"
|
||||||
:to="'/news'"
|
:to='`/news?id=${x.id}`'
|
||||||
|
size="small"
|
||||||
|
|
||||||
|
append-icon="mdi-step-forward-2"
|
||||||
|
|
||||||
>
|
>
|
||||||
Подробнее
|
Подробнее
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- :to="'/news'" -->
|
|
||||||
|
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
<!-- <div ref="#g">hello</div> -->
|
|
||||||
|
|
||||||
<!-- ------------------------------ @click="scrollMeTo('porto')"---------------------------------------------------- -->
|
<!-- ------------------------------ @click="scrollMeTo('porto')"---------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div >
|
||||||
|
|
||||||
|
<v-card v-show="route.path=='/news'"
|
||||||
<v-card v-show="pages=='news'"
|
class="mx-auto rounded-0"
|
||||||
class="mx-auto rounded-0 gggggggggggggggggggggggggg"
|
|
||||||
|
|
||||||
:ref="el => { if (el) divs[i] = el }"
|
|
||||||
v-for="(x, i) in newss" :key=i
|
v-for="(x, i) in newss.result" :key=i
|
||||||
>
|
>
|
||||||
<v-list-item class="w-100 pl-4 py-2 pt-3">
|
<v-list-item class="w-100 pl-4 py-2 pt-3">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@@ -89,7 +85,7 @@
|
|||||||
:image=accountStore.user.photo></v-avatar>
|
:image=accountStore.user.photo></v-avatar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<v-list-item-title>{{x.author.fio}} {{ i }}</v-list-item-title>
|
<v-list-item-title>{{x.author.fio}}</v-list-item-title>
|
||||||
|
|
||||||
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
<v-list-item-subtitle>Участник</v-list-item-subtitle>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
@@ -109,13 +105,10 @@
|
|||||||
|
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<div class="justify-self-end">
|
<div class="justify-self-end">
|
||||||
<!-- <v-btn v-scroll-to="{element:'#nh'}">
|
<v-icon class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
||||||
2
|
|
||||||
</v-btn> -->
|
|
||||||
<v-icon class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.id && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'" @click="toggleIncrementLike(x.id, true)"></v-icon>
|
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
|
||||||
<span class="me-1">·</span>
|
<span class="me-1">·</span>
|
||||||
<v-icon class="me-1" icon="mdi-thumb-down-outline" @click="toggleIncrementLike(x.id, false)"/>
|
<v-icon class="me-1" :icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'" @click="toggleIncrementLike(x.id, false)"/>
|
||||||
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
<span class="subheading me-2">{{x.scores.filter(e=> e.score==false).length}}</span>
|
||||||
<span class="me-1">·</span>
|
<span class="me-1">·</span>
|
||||||
<v-icon class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
<v-icon class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
|
||||||
@@ -143,15 +136,13 @@
|
|||||||
class="d-flex flex-column pa-3"
|
class="d-flex flex-column pa-3"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
<!-- :class="accountStore.user.login==y.author.login?'text-end mr-6':''" -->
|
|
||||||
|
|
||||||
<v-row
|
<v-row
|
||||||
class="justify-space-between ma-0 align-center bgchat mr-7"
|
class="justify-space-between ma-0 align-center bgchat mr-7"
|
||||||
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
|
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
|
||||||
|
|
||||||
>
|
>
|
||||||
<v-col class="flex-grow-1 text-subtitle-2 pa-0 "
|
<v-col class="flex-grow-1 text-subtitle-2 pl-2 pa-0 "
|
||||||
|
|
||||||
>
|
>
|
||||||
{{ accountStore.user.login==y.author.login?'':splitname(y.author) }}
|
{{ accountStore.user.login==y.author.login?'':splitname(y.author) }}
|
||||||
@@ -160,19 +151,13 @@
|
|||||||
|
|
||||||
{{dateformat(y.cdate)}}
|
{{dateformat(y.cdate)}}
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="pa-0 text-end text-subtitle-2 ">
|
<v-col class="pa-0 pr-2 text-end text-subtitle-2 ">
|
||||||
{{ accountStore.user.login!=y.author.login?'':splitname(y.author) }}
|
{{ accountStore.user.login!=y.author.login?'':splitname(y.author) }}
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
<!-- <div style="text-align: center;">
|
|
||||||
<div style="display: inline-block; text-align: left;">
|
|
||||||
Centered
|
|
||||||
Content
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="text-subtitle-2">
|
<div class="text-subtitle-2">
|
||||||
|
|
||||||
|
|
||||||
@@ -182,8 +167,8 @@
|
|||||||
<v-alert
|
<v-alert
|
||||||
|
|
||||||
|
|
||||||
color="#f9f9f9"
|
color="white"
|
||||||
|
rounded=0
|
||||||
:border="accountStore.user.login==y.author.login?'end':'start'"
|
:border="accountStore.user.login==y.author.login?'end':'start'"
|
||||||
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
|
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
|
||||||
elevation=0
|
elevation=0
|
||||||
@@ -216,12 +201,13 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
<!-- <div id="nh">ss</div> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
<v-row justify="center">
|
<v-row justify="center">
|
||||||
<v-dialog
|
<v-dialog
|
||||||
v-model="dialogCommentShow"
|
v-model="dialogCommentShow"
|
||||||
@@ -261,35 +247,50 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
</v-container>
|
||||||
</v-container>
|
<v-container v-show="route.path=='/news'">
|
||||||
|
<div class="pagination" >
|
||||||
|
<v-pagination
|
||||||
|
class="flex-grow-1"
|
||||||
|
v-model="page"
|
||||||
|
:length="newss.allnews"
|
||||||
|
prev-icon="mdi-menu-left"
|
||||||
|
next-icon="mdi-menu-right"
|
||||||
|
@click="pagelistNews"
|
||||||
|
></v-pagination>
|
||||||
|
|
||||||
|
<v-select
|
||||||
|
class="flex-grow-0 pt-2"
|
||||||
|
density="compact"
|
||||||
|
v-model="selecnews"
|
||||||
|
variant="outlined"
|
||||||
|
:items="['1', '2', '3', '4', '5', '6']"
|
||||||
|
>
|
||||||
|
</v-select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { ref, watch, onBeforeUpdate } from 'vue'
|
import { ref, watch, onBeforeUpdate, onMounted } from 'vue'
|
||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
import {getfromserver} from '@/utils/universal_functions'
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
import myHelper from './UI/my-helper.vue'
|
import myHelper from './UI/my-helper.vue'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { myHelper },
|
components: { myHelper },
|
||||||
|
|
||||||
props: {
|
|
||||||
pages: {
|
|
||||||
type: String,
|
|
||||||
default: 'home'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setup(props){
|
setup(){
|
||||||
const divs = ref([])
|
const divs = ref([])
|
||||||
onBeforeUpdate(() => {
|
onBeforeUpdate(() => {
|
||||||
divs.value = []
|
divs.value = []
|
||||||
@@ -299,40 +300,69 @@ export default {
|
|||||||
const burl = baseURL.slice(0,-1)
|
const burl = baseURL.slice(0,-1)
|
||||||
const textcomment = ref('')
|
const textcomment = ref('')
|
||||||
const idnews = ref(0)
|
const idnews = ref(0)
|
||||||
|
const page = ref(1)
|
||||||
|
const selecnews = ref(2)
|
||||||
|
const route = useRoute()
|
||||||
|
let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`
|
||||||
|
|
||||||
|
if (route.path == '/news' && 'id' in route.query){
|
||||||
|
str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}&id=${route.query.id}`
|
||||||
|
}
|
||||||
|
|
||||||
|
getfromserver(str, newss)
|
||||||
|
|
||||||
|
|
||||||
const toggleIncrementLike = (news, scores) => {
|
const toggleIncrementLike = (news, scores) => {
|
||||||
axiosApiInstance.post(`api/navigation/news/`, {news: news, scores: scores}).then(result => {
|
axiosApiInstance.post(`api/navigation/news/`, {news: news, scores: scores}).then(result => {
|
||||||
newss.value[newss.value.findIndex(e=> e.id==news)].scores= result.data
|
newss.value.result[newss.value.result.findIndex(e=> e.id==news)].scores= result.data
|
||||||
// console.log(result.data, 'result.data-----------------')
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const dateformat = (datas) => {
|
|
||||||
return format(new Date(datas), 'dd.MM.yyyy HH:mm')
|
|
||||||
}
|
|
||||||
|
|
||||||
const newses =() => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const openComent = (news) => {
|
|
||||||
dialogCommentShow.value=!dialogCommentShow.value
|
|
||||||
idnews.value = news
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const addComment = () => {
|
const addComment = () => {
|
||||||
axiosApiInstance.post(`api/navigation/news/`, {news: idnews.value, text: textcomment.value}).then(result => {
|
axiosApiInstance.post(`api/navigation/news/`, {news: idnews.value, text: textcomment.value}).then(result => {
|
||||||
dialogCommentShow.value=!dialogCommentShow.value
|
dialogCommentShow.value=!dialogCommentShow.value
|
||||||
newss.value[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
newss.value.result[newss.value.result.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
||||||
|
|
||||||
})
|
})
|
||||||
|
textcomment.value=""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deletComment = (id, news) => {
|
||||||
|
axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => {
|
||||||
|
newss.value.result[newss.value.result.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const pagelistNews =() => {
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`, newss)
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
||||||
|
if(newValue){
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`,newss)
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
|
||||||
|
watch(()=>selecnews ,(newValue,oldValue)=>{
|
||||||
|
if(newValue){
|
||||||
|
getfromserver(`api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${newValue.value}`, newss)
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const dateformat = (datas) => {
|
||||||
|
return format(new Date(datas), 'dd.MM.yyyy HH:mm')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const openComent = (news) => {
|
||||||
|
dialogCommentShow.value=!dialogCommentShow.value
|
||||||
|
idnews.value = news
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const limitText=(text)=> {
|
const limitText=(text)=> {
|
||||||
const t = text.split(' ').slice(0, 25)
|
const t = text.split(' ').slice(0, 25)
|
||||||
return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
|
return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
|
||||||
@@ -342,24 +372,9 @@ export default {
|
|||||||
return name.familyname + ' ' + name.name[0] + '.' + name.parentname[0]+ '.'
|
return name.familyname + ' ' + name.name[0] + '.' + name.parentname[0]+ '.'
|
||||||
}
|
}
|
||||||
|
|
||||||
getfromserver(`api/navigation/news/?name=${props.pages}`, newss)
|
|
||||||
|
|
||||||
|
|
||||||
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
|
|
||||||
if(newValue){
|
|
||||||
getfromserver(`api/navigation/news/`,newss)
|
|
||||||
}
|
|
||||||
}, {deep:true})
|
|
||||||
|
|
||||||
const deletComment = (id, news) => {
|
|
||||||
axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => {
|
|
||||||
|
|
||||||
newss.value[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -376,18 +391,25 @@ export default {
|
|||||||
addComment,
|
addComment,
|
||||||
idnews,
|
idnews,
|
||||||
deletComment,
|
deletComment,
|
||||||
newses,
|
pagelistNews,
|
||||||
divs
|
divs,
|
||||||
|
page,
|
||||||
|
selecnews,
|
||||||
|
route
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped>
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.newsVH {
|
.newsVH {
|
||||||
height: 93vh;
|
height: 92vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bgchat {
|
.bgchat {
|
||||||
@@ -398,4 +420,9 @@ export default {
|
|||||||
background-color: #eef9efad;
|
background-color: #eef9efad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .bgf {
|
||||||
|
background: url("@/assets/message.jpg") repeat-y;
|
||||||
|
|
||||||
|
} */
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
class="bg-transparent py"
|
class="bg-transparent py"
|
||||||
density="compact"
|
density="compact"
|
||||||
:prepend-avatar="imageSrc"
|
:prepend-avatar="imageSrc"
|
||||||
title="Портал МиФНС по ЦОД № 2"
|
title="Портал МИ ФНС по ЦОД № 2"
|
||||||
variant="text"
|
variant="text"
|
||||||
:to="'/'" />
|
:to="'/'" />
|
||||||
|
|
||||||
@@ -110,9 +110,15 @@
|
|||||||
:to="x.path"
|
:to="x.path"
|
||||||
color="navigation">
|
color="navigation">
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-icon :icon="x.ico"/>
|
<v-icon :icon="x.ico"/>
|
||||||
</template>
|
<v-tooltip
|
||||||
|
v-if="rail"
|
||||||
|
activator="parent"
|
||||||
|
location="top">
|
||||||
|
{{ x.name }}
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-group v-else
|
<v-list-group v-else
|
||||||
@@ -124,6 +130,13 @@
|
|||||||
v-bind="props"
|
v-bind="props"
|
||||||
:title="x.name"
|
:title="x.name"
|
||||||
:prepend-icon="x.ico" />
|
:prepend-icon="x.ico" />
|
||||||
|
<v-tooltip
|
||||||
|
v-if="rail"
|
||||||
|
activator="parent"
|
||||||
|
location="top"
|
||||||
|
>
|
||||||
|
{{ x.name }}
|
||||||
|
</v-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<v-list-item v-for="(child, k) in x.submenu"
|
<v-list-item v-for="(child, k) in x.submenu"
|
||||||
|
|
||||||
@@ -133,6 +146,13 @@
|
|||||||
:title="!rail?child.name:menuTruncated(child.name)"
|
:title="!rail?child.name:menuTruncated(child.name)"
|
||||||
:to="child.path"
|
:to="child.path"
|
||||||
>
|
>
|
||||||
|
<v-tooltip
|
||||||
|
v-if="rail"
|
||||||
|
activator="parent"
|
||||||
|
location="top"
|
||||||
|
>
|
||||||
|
{{ child.name }}
|
||||||
|
</v-tooltip>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list-group>
|
</v-list-group>
|
||||||
</template>
|
</template>
|
||||||
@@ -147,6 +167,12 @@
|
|||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-icon
|
<v-icon
|
||||||
:icon="x.imagecode" />
|
:icon="x.imagecode" />
|
||||||
|
<v-tooltip
|
||||||
|
v-if="rail"
|
||||||
|
activator="parent"
|
||||||
|
location="top">
|
||||||
|
{{ x.name }}
|
||||||
|
</v-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
@@ -187,105 +213,9 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<!-- <v-col class="pointer align-self-center flex-grow-0"
|
|
||||||
|
|
||||||
@click="rail = !rail">
|
|
||||||
<v-icon
|
|
||||||
|
|
||||||
size="20"
|
|
||||||
:icon="rail?'mdi-chevron-right':'mdi-chevron-left'"
|
|
||||||
|
|
||||||
|
|
||||||
/>
|
|
||||||
</v-col> -->
|
|
||||||
</v-row>
|
|
||||||
<!-- <div class="d-flex flex-column h-100">
|
|
||||||
<v-row>
|
|
||||||
<v-col>
|
|
||||||
<v-divider/>
|
|
||||||
<v-list
|
|
||||||
nav
|
|
||||||
density="compact">
|
|
||||||
|
|
||||||
<template v-for="(x, key) in navigations">
|
|
||||||
<v-list-item
|
|
||||||
v-if="!('submenu' in x)"
|
|
||||||
:key="x.key"
|
|
||||||
:title="x.name"
|
|
||||||
:value="x.name"
|
|
||||||
:href="x.link"
|
|
||||||
:to="x.path"
|
|
||||||
color="navigation"
|
|
||||||
>
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-icon
|
|
||||||
|
|
||||||
:icon="x.ico"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
<v-list-group
|
|
||||||
v-else
|
|
||||||
:key="key"
|
|
||||||
:value="x.name"
|
|
||||||
>
|
|
||||||
<template v-slot:activator="{ props }">
|
|
||||||
<v-list-item
|
|
||||||
v-bind="props"
|
|
||||||
:title="x.name"
|
|
||||||
:prepend-icon="x.ico"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<v-list-item
|
|
||||||
v-for="(child, k) in x.submenu"
|
|
||||||
|
|
||||||
:href="child.link"
|
|
||||||
:key="k"
|
|
||||||
:value="child.name"
|
|
||||||
:title="child.name"
|
|
||||||
:to="child.path"
|
|
||||||
/>
|
|
||||||
</v-list-group>
|
|
||||||
</template>
|
|
||||||
</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"
|
|
||||||
:href="x.link"
|
|
||||||
color="teal-darken-4"
|
|
||||||
|
|
||||||
>
|
|
||||||
<template v-slot:prepend>
|
|
||||||
<v-icon
|
|
||||||
|
|
||||||
:icon="x.imagecode"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row class="flex-grow-0 mb-1 text-caption font-weight-bold text-truncate">
|
|
||||||
<v-col>
|
|
||||||
|
|
||||||
<v-list>
|
|
||||||
|
|
||||||
<v-list-item >
|
|
||||||
<p class="pb-2">Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
|
|
||||||
<p class="pb-2">Посещений сегодня: {{ appStore.countvisitor.visittoday }}</p>
|
|
||||||
<p class="pb-2">Уникальных посещений: {{ appStore.countvisitor.uniqtoday }}</p>
|
|
||||||
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
<!-- <v-navigation-drawer
|
<!-- <v-navigation-drawer
|
||||||
@@ -306,7 +236,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</v-navigation-drawer> -->
|
</v-navigation-drawer> -->
|
||||||
<v-main class="d-flex bg-main_theme">
|
<v-main v-if="accountStore.cod2user" class="d-flex bg-main_theme">
|
||||||
<router-view />
|
<router-view />
|
||||||
<!-- <div class="mystat d-flex flex-column">
|
<!-- <div class="mystat d-flex flex-column">
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -328,6 +258,12 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</div> -->
|
</div> -->
|
||||||
</v-main>
|
</v-main>
|
||||||
|
<v-main v-else class="d-flex justify-center align-center text-h3 bg-teal-lighten-2">
|
||||||
|
<div>
|
||||||
|
<p class="text-center">Добро пожаловать на портал МИ ФНС по ЦОД № 2</p>
|
||||||
|
<p class="mt-3 text-subtitle-1 text-center">Авторизуйтесь, для получения доступа к контенту портала</p>
|
||||||
|
</div>
|
||||||
|
</v-main>
|
||||||
<v-navigation-drawer v-if="accountStore.cod2user"
|
<v-navigation-drawer v-if="accountStore.cod2user"
|
||||||
v-model="drawer_right"
|
v-model="drawer_right"
|
||||||
rail permanent
|
rail permanent
|
||||||
@@ -357,7 +293,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, onMounted} from 'vue'
|
||||||
import uf from '@/utils/universal_functions'
|
import uf from '@/utils/universal_functions'
|
||||||
import { useAccountStore } from '@/store/AccountStore'
|
import { useAccountStore } from '@/store/AccountStore'
|
||||||
import { useMainmenuStore } from '@/store/MainmenuStore'
|
import { useMainmenuStore } from '@/store/MainmenuStore'
|
||||||
@@ -402,7 +338,12 @@ export default {
|
|||||||
{
|
{
|
||||||
name: 'Структура',
|
name: 'Структура',
|
||||||
ico: 'mdi-source-branch',
|
ico: 'mdi-source-branch',
|
||||||
path: "/structure"
|
submenu: [
|
||||||
|
{
|
||||||
|
name: 'ОКиБ',
|
||||||
|
path: "/okib"
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Сотрудники',
|
name: 'Сотрудники',
|
||||||
@@ -446,18 +387,17 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const imageSrc = computed(() => {
|
const imageSrc = computed(() => {
|
||||||
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
|
return new URL(`@/assets/FNS-logo-xs.png`, import.meta.url).href;
|
||||||
})
|
})
|
||||||
|
|
||||||
const getcard = async () => {
|
const getcard = async () => {
|
||||||
menuGetUserDialog.value = true
|
menuGetUserDialog.value = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
onMounted(() => {
|
||||||
|
drawer.value = accountStore.cod2user ? true : false
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
theme,
|
theme,
|
||||||
|
|||||||
@@ -14,54 +14,78 @@ const routes = [
|
|||||||
title:"Портал МиФНС по ЦОД №2"
|
title:"Портал МиФНС по ЦОД №2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/structure',
|
path: '/okib',
|
||||||
name: 'StructurePage',
|
name: 'OKiBPage',
|
||||||
component: () => import('@/views/StructurePage.vue'),
|
component: () => import('@/views/nested_view/o_OKiB.vue'),
|
||||||
meta:{
|
meta:{
|
||||||
title:"Структура"
|
title:"Отдел кадров и безопасности"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/providing',
|
path: '/providing',
|
||||||
name: 'ProvidingActivitiesPage',
|
name: 'ProvidingActivitiesPage',
|
||||||
component: () => import('@/views/ProvidingActivitiesPage.vue'),
|
component: () => import('@/views/ProvidingActivitiesPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Обеспечивающая деятельность"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/faq',
|
path: '/faq',
|
||||||
name: 'FAQPage',
|
name: 'FAQPage',
|
||||||
component: () => import('@/views/FAQPage.vue'),
|
component: () => import('@/views/FAQPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Часто задаваемые вопросы"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/feedback',
|
path: '/feedback',
|
||||||
name: 'FeedbackPage',
|
name: 'FeedbackPage',
|
||||||
component: () => import('@/views/FeedbackPage.vue'),
|
component: () => import('@/views/FeedbackPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Обратная связь"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/labor',
|
path: '/labor',
|
||||||
name: 'LaborProtection',
|
name: 'LaborProtection',
|
||||||
component: () => import('@/views/LaborProtection.vue'),
|
component: () => import('@/views/LaborProtection.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Безопасность"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/securyty',
|
path: '/securyty',
|
||||||
name: 'SecurityPage',
|
name: 'SecurityPage',
|
||||||
component: () => import('@/views/SecurityPage.vue'),
|
component: () => import('@/views/SecurityPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Охрана труда"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/inspection',
|
path: '/inspection',
|
||||||
name: 'AboutInspectionPage',
|
name: 'AboutInspectionPage',
|
||||||
component: () => import('@/views/AboutInspectionPage.vue'),
|
component: () => import('@/views/AboutInspectionPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Об инспекции"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/portal',
|
path: '/portal',
|
||||||
name: 'AboutPortalPage',
|
name: 'AboutPortalPage',
|
||||||
component: () => import('@/views/AboutPortalPage.vue'),
|
component: () => import('@/views/AboutPortalPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"О портале"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/news',
|
path: '/news',
|
||||||
name: 'AboutNewsPage',
|
name: 'AboutNewsPage',
|
||||||
component: () => import('@/views/NewsPage.vue'),
|
component: () => import('@/views/NewsPage.vue'),
|
||||||
|
meta:{
|
||||||
|
title:"Лента новостей"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -38,17 +38,12 @@ export function checkremote(filecheck){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default str;
|
export default str;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function pagecounter(){
|
export function pagecounter(){
|
||||||
console.log('Загружаю данные для циферок по количеству');
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,58 @@
|
|||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col
|
<v-col
|
||||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
class="ma-3"
|
||||||
>
|
>
|
||||||
О портале
|
|
||||||
|
<v-table density="compact" class="mt-3">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-left">
|
||||||
|
Страница
|
||||||
|
</th>
|
||||||
|
<th class="text-left">
|
||||||
|
Количество посещений
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="item in visiting.pages"
|
||||||
|
:key="item.name"
|
||||||
|
>
|
||||||
|
<td>{{ item.page }}</td>
|
||||||
|
<td>{{ item.count__sum }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</v-table>
|
||||||
|
|
||||||
|
<v-table density="compact" class="mt-3">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-left">
|
||||||
|
Пользователь
|
||||||
|
</th>
|
||||||
|
<th class="text-left">
|
||||||
|
Страница
|
||||||
|
</th>
|
||||||
|
<th class="text-left">
|
||||||
|
Количество посещений
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="item in visiting.users"
|
||||||
|
:key="item.name"
|
||||||
|
>
|
||||||
|
<td>{{ item.user__username }}</td>
|
||||||
|
<td>{{ item.page }}</td>
|
||||||
|
<td>{{ item.count__sum }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</v-table>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
@@ -17,9 +65,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
const visiting = ref({})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getfromserver(`api/watcher/counter/`, visiting)
|
||||||
|
|
||||||
|
return {
|
||||||
|
visiting
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -108,13 +108,14 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column justify-space-between px-0 py-2 pr-3 pb-0" lg=3>
|
<v-col class="d-flex flex-column pl-0 justify-space-between" lg=3>
|
||||||
<v-card
|
<v-card
|
||||||
class="h-100 bg-transparent "
|
class="h-100 bg-transparent flex-column d-flex"
|
||||||
elevation="0"
|
elevation="0"
|
||||||
>
|
>
|
||||||
|
|
||||||
<News-list :page="'home'" v-if="accountStore.cod2user"/>
|
<!-- <News-list-home/> -->
|
||||||
|
<News-list v-if="accountStore.cod2user"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +133,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import {useAppStore} from '@/store/app'
|
import {useAppStore} from '@/store/app'
|
||||||
import {useAccountStore} from '@/store/AccountStore'
|
import {useAccountStore} from '@/store/AccountStore'
|
||||||
import {pagecounter} from '@/utils/universal_functions'
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
@@ -141,7 +142,7 @@
|
|||||||
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||||
|
import NewsListHome from '@/components/news-list-home.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
@@ -149,7 +150,8 @@
|
|||||||
NewsList,
|
NewsList,
|
||||||
CarouselList,
|
CarouselList,
|
||||||
CarouselNumbers,
|
CarouselNumbers,
|
||||||
CalendarFull
|
CalendarFull,
|
||||||
|
NewsListHome
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
lg="6"
|
lg="6"
|
||||||
>
|
>
|
||||||
<News-list
|
<News-list
|
||||||
:pages="'news'"
|
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -13,10 +13,15 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NewsList from '@/components/news-list.vue'
|
import NewsList from '@/components/news-list.vue'
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NewsList
|
NewsList
|
||||||
},
|
},
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -40,8 +40,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup(){
|
setup(){
|
||||||
|
pagecounter()
|
||||||
const activates = [
|
const activates = [
|
||||||
{name: 'Комиссии', link: 'http://10.252.44.33/accounting6/SOTRYDNIKI.php#tab_committees'},
|
{name: 'Комиссии', link: 'http://10.252.44.33/accounting6/SOTRYDNIKI.php#tab_committees'},
|
||||||
{name: 'Ответственность', link: 'http://10.252.44.33/accounting6/SOTRYDNIKI.php#tab_departments'},
|
{name: 'Ответственность', link: 'http://10.252.44.33/accounting6/SOTRYDNIKI.php#tab_departments'},
|
||||||
|
|||||||
@@ -4,13 +4,17 @@
|
|||||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||||
>
|
>
|
||||||
Безопасность
|
Безопасность
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {pagecounter} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
setup(){
|
||||||
|
pagecounter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<v-row>
|
||||||
|
<v-col
|
||||||
|
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||||
|
>
|
||||||
|
<v-btn
|
||||||
|
@click="excelOp">
|
||||||
|
Excel
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import {getfromserver} from '@/utils/universal_functions'
|
||||||
|
export default {
|
||||||
|
setup(){
|
||||||
|
const visiting = ref({})
|
||||||
|
const excelOp = () => {
|
||||||
|
getfromserver(`api/general_vacation/dailyroundup/`, visiting)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
visiting,
|
||||||
|
excelOp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -15,6 +15,7 @@ class PlanCalendarAdmin(admin.ModelAdmin):
|
|||||||
list_filter = ('start_work_period', 'end_work_period')
|
list_filter = ('start_work_period', 'end_work_period')
|
||||||
fields = ('name', 'start_work_period', 'end_work_period')
|
fields = ('name', 'start_work_period', 'end_work_period')
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(GeneralVacation, GeneralVacationAdmin),
|
admin.site.register(GeneralVacation, GeneralVacationAdmin),
|
||||||
admin.site.register(PlanCalendar, PlanCalendarAdmin)
|
admin.site.register(PlanCalendar, PlanCalendarAdmin)
|
||||||
|
admin.site.register(BasePosition)
|
||||||
|
admin.site.register(DailyRoundUp)
|
||||||
@@ -2,6 +2,28 @@ from django.db import models
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from userauth.models import DictEmployee
|
from userauth.models import DictEmployee
|
||||||
|
|
||||||
|
class BasePosition(models.Model):
|
||||||
|
name = models.CharField(verbose_name='Название', max_length=150, blank=True, db_index=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Справочник - Позиция"
|
||||||
|
verbose_name_plural = "Справочник - Позиция"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name)
|
||||||
|
|
||||||
|
class DailyRoundUp(models.Model):
|
||||||
|
todaysDate = models.DateField(verbose_name='Начало рабочего периода')
|
||||||
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, verbose_name='Сотрудник')
|
||||||
|
position = models.ForeignKey(BasePosition, on_delete=models.PROTECT, verbose_name='Позиция')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Ежедневный обход"
|
||||||
|
verbose_name_plural = "Ежедневный обход"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name)
|
||||||
|
|
||||||
class GeneralVacation(models.Model):
|
class GeneralVacation(models.Model):
|
||||||
CHOICES = (
|
CHOICES = (
|
||||||
('os', 'Осн'),
|
('os', 'Осн'),
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ from .views import *
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
path('generalvacation/', GeneralVacationAPIView.as_view(), name='generalvacation'),
|
||||||
|
path('dailyroundup/', DailyRoundUpAPIView.as_view(), name='dailyroundup'),
|
||||||
]
|
]
|
||||||
+151
-2
@@ -1,9 +1,18 @@
|
|||||||
|
import os
|
||||||
|
from openpyxl import load_workbook
|
||||||
|
import openpyxl
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
import datetime
|
from datetime import date
|
||||||
from .serializers import *
|
from .serializers import *
|
||||||
from .models import *
|
from .models import *
|
||||||
|
import pandas as pd
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
from userauth.models import *
|
||||||
|
from django.shortcuts import render
|
||||||
|
from pandas.io.excel import ExcelWriter
|
||||||
|
import openpyxl as oxl
|
||||||
|
from openpyxl import Workbook
|
||||||
|
from openpyxl.styles import Font, Alignment, Side, Border
|
||||||
|
|
||||||
class GeneralVacationAPIView(APIView):
|
class GeneralVacationAPIView(APIView):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
@@ -21,3 +30,143 @@ class GeneralVacationAPIView(APIView):
|
|||||||
many=True # Указываем, что на вход подаётся именно набор записей
|
many=True # Указываем, что на вход подаётся именно набор записей
|
||||||
)
|
)
|
||||||
return Response({"Отпуск": serializer_for_basecrit.data, "План-график": serializer_for_plan.data})
|
return Response({"Отпуск": serializer_for_basecrit.data, "План-график": serializer_for_plan.data})
|
||||||
|
|
||||||
|
class DailyRoundUpAPIView(APIView):
|
||||||
|
|
||||||
|
def convert_width(self, width):
|
||||||
|
"""
|
||||||
|
Конвертируем ширину столбца Excel в ширину столбца openpyxl
|
||||||
|
"""
|
||||||
|
PIXELS_PER_CHAR = 7
|
||||||
|
return (width) / PIXELS_PER_CHAR
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname')
|
||||||
|
df = pd.DataFrame.from_records(user)
|
||||||
|
df['tabel'] = df['login'].str.split('-', expand = True)[1]+df['login'].str.split('-', expand = True)[2]
|
||||||
|
file_path = 'media/DailyRoundUp.xlsx'
|
||||||
|
|
||||||
|
thins = Side(border_style="thin")
|
||||||
|
# l = pd.DataFrame(df[(df.department=='Руководство')][['tabel', 'familyname', 'name', 'parentname']])
|
||||||
|
# l.to_excel(file_path, sheet_name="Список", index= False, header= False, startcol=2, startrow=8)
|
||||||
|
wb = Workbook()
|
||||||
|
ws = wb.active
|
||||||
|
ws.title = "Список"
|
||||||
|
ws['B2'] = 'Список сотрудников'
|
||||||
|
ws['B3'] = 'МИ ФНС России по ЦОД № 2'
|
||||||
|
ws['B4'] = 'по подразделениям'
|
||||||
|
|
||||||
|
ws['B6'] = 'Таб.'
|
||||||
|
ws['C6'] = 'Фамилия'
|
||||||
|
ws['D6'] = 'Имя'
|
||||||
|
ws['E6'] = 'Очество'
|
||||||
|
|
||||||
|
for col in ws.iter_cols(min_row=6, max_row=6, min_col=2, max_col=5):
|
||||||
|
for cell in col:
|
||||||
|
cell.font = Font(name='Times New Roman', size=11, bold=True)
|
||||||
|
cell.border = Border(top=thins, bottom=thins, left=thins, right=thins)
|
||||||
|
|
||||||
|
ws['G6'] = 'Отпуск'
|
||||||
|
ws['I6'] = 'Болен'
|
||||||
|
ws['K6'] = 'Удаленка'
|
||||||
|
|
||||||
|
for col in ws.iter_cols(min_row=6, max_row=6, min_col=2, max_col=5):
|
||||||
|
for cell in col:
|
||||||
|
cell.font = Font(name='Times New Roman', size=11, bold=True)
|
||||||
|
cell.border = Border(top=thins, bottom=thins, left=thins, right=thins)
|
||||||
|
|
||||||
|
|
||||||
|
ws['I1'] = 'На '+ date.today().strftime("%d.%m.%Y")
|
||||||
|
|
||||||
|
numb = 1
|
||||||
|
|
||||||
|
column_widths = [29, 53, 96, 96, 112, 28, 222, 29, 148, 28, 145, 33]
|
||||||
|
for i, width in enumerate(column_widths):
|
||||||
|
column_letter = openpyxl.utils.get_column_letter(i+1)
|
||||||
|
ws.column_dimensions[column_letter].width = self.convert_width(width)
|
||||||
|
|
||||||
|
for col in ws.iter_cols(min_row=2, max_row=5, min_col=2, max_col=5):
|
||||||
|
for cell in col:
|
||||||
|
cell.font = Font(name='Times New Roman', size=12, bold=True)
|
||||||
|
cell.alignment = Alignment(horizontal='center')
|
||||||
|
|
||||||
|
ws['I1'].font = Font(name='Times New Roman', size=14, bold=True)
|
||||||
|
ws['I1'].alignment = Alignment(horizontal='left')
|
||||||
|
|
||||||
|
|
||||||
|
for x in range(3):
|
||||||
|
ws.merge_cells(start_row=2+x, start_column=2, end_row=2+x, end_column=6)
|
||||||
|
|
||||||
|
|
||||||
|
k=7
|
||||||
|
for i in df['department'].unique():
|
||||||
|
ws.cell(row = k, column = 2).value = i
|
||||||
|
ws.cell(row = k, column = 2).font = Font(name='Times New Roman', size=10, bold=True)
|
||||||
|
ws.merge_cells(start_row=k, start_column=2, end_row=k, end_column=12)
|
||||||
|
|
||||||
|
l = pd.DataFrame(df[(df.department==i)][['tabel', 'familyname', 'name', 'parentname']])
|
||||||
|
|
||||||
|
|
||||||
|
for x in range(len(l)):
|
||||||
|
k=k+1
|
||||||
|
|
||||||
|
ws.cell(row = k, column = 1).value = numb
|
||||||
|
ws.cell(row = k, column = 1).font = Font(name='Times New Roman', size=10, bold=True)
|
||||||
|
|
||||||
|
ws.cell(row = k, column = 2).value = l.iloc[x]['tabel']
|
||||||
|
ws.cell(row = k, column = 3).value = l.iloc[x]['familyname']
|
||||||
|
ws.cell(row = k, column = 4).value = l.iloc[x]['name']
|
||||||
|
ws.cell(row = k, column = 5).value = l.iloc[x]['parentname']
|
||||||
|
|
||||||
|
|
||||||
|
for v in range(4):
|
||||||
|
ws.cell(row = k, column = 2+v).font = Font(name='Times New Roman', size=10)
|
||||||
|
ws.cell(row = k, column = 2+v).border = Border(top=thins, bottom=thins, left=thins, right=thins)
|
||||||
|
|
||||||
|
numb=numb+1
|
||||||
|
print(l.iloc[x]['name'])
|
||||||
|
k=k+1
|
||||||
|
print(k, '-------------------1')
|
||||||
|
|
||||||
|
|
||||||
|
wb.save(file_path)
|
||||||
|
|
||||||
|
# file_path = 'media/DailyRoundUp.xlsx'
|
||||||
|
|
||||||
|
|
||||||
|
return Response('')
|
||||||
|
|
||||||
|
# with ExcelWriter(file_path, mode="a" if os.path.exists(file_path) else "w" , if_sheet_exists='replace') as writer:
|
||||||
|
# #
|
||||||
|
# for i in df['department'].unique():
|
||||||
|
# for i in df['department'].unique():
|
||||||
|
# k = pd.DataFrame(df[(df.department==i)][['tabel', 'familyname', 'name', 'parentname']])
|
||||||
|
# # k.to_excel(writer,header=None,index=None)
|
||||||
|
# print(i)
|
||||||
|
# print(k)
|
||||||
|
# return Response('')
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# df.to_excel(table)
|
||||||
|
|
||||||
|
|
||||||
|
# def all_books(request):
|
||||||
|
# file_path = 'media/DailyRoundUp.xlsx'
|
||||||
|
# workbook = load_workbook(filename=file_path)
|
||||||
|
# worksheet = workbook.active
|
||||||
|
|
||||||
|
# books = []
|
||||||
|
# skip_first_row = True
|
||||||
|
# for row in worksheet.iter_rows(values_only=True, min_row=2 if skip_first_row else 1):
|
||||||
|
# book = {
|
||||||
|
# 'book_id': int(row[0]),
|
||||||
|
# 'title': row[1],
|
||||||
|
# 'author': row[2],
|
||||||
|
# 'genre': row[3],
|
||||||
|
# 'year': int(row[4]),
|
||||||
|
# 'description': row[5],
|
||||||
|
# 'cover': row[6]
|
||||||
|
# }
|
||||||
|
# books.append(book)
|
||||||
|
|
||||||
|
# return render(request, 'books.html', {'books': books})
|
||||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 665 KiB |
+24
-11
@@ -26,12 +26,21 @@ class NewsAPIView(ListAPIView):
|
|||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
if request.GET.get("name") == "home":
|
if request.GET.__contains__('id'):
|
||||||
newsqueryset = News.objects.all().order_by('cdate')[:10]
|
newsqueryset = News.objects.filter(pk=int(request.GET.get('id')))
|
||||||
|
allnews = 1
|
||||||
else:
|
else:
|
||||||
newsqueryset = News.objects.all().order_by('cdate')
|
newsqueryset = News.objects.all().order_by('cdate')
|
||||||
|
allnews =newsqueryset.count()
|
||||||
|
|
||||||
|
if request.GET.get("name") == "/":
|
||||||
|
newsqueryset = newsqueryset[:10]
|
||||||
|
else:
|
||||||
|
newsqueryset =newsqueryset[int(request.GET.get("page"))*int(request.GET.get("selected")):int(request.GET.get("page"))*int(request.GET.get("selected"))+int(request.GET.get("selected"))]
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for x in newsqueryset:
|
|
||||||
|
for x in newsqueryset:
|
||||||
a=model_to_dict(x)
|
a=model_to_dict(x)
|
||||||
a['link']= str(x.link.url)
|
a['link']= str(x.link.url)
|
||||||
a['show'] = False
|
a['show'] = False
|
||||||
@@ -39,15 +48,18 @@ class NewsAPIView(ListAPIView):
|
|||||||
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
a['author'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x.author.username))
|
||||||
a['scores'] = [{"score":y.score, "user":y.author.username} for y in x.get_news.all()]
|
a['scores'] = [{"score":y.score, "user":y.author.username} for y in x.get_news.all()]
|
||||||
a['comment'] = [{"author":model_to_dict(DictEmployee.objects.using('user_directory').get(login=k.author.username)),
|
a['comment'] = [{"author":model_to_dict(DictEmployee.objects.using('user_directory').get(login=k.author.username)),
|
||||||
"cdate":k.cdate,
|
"cdate":k.cdate,
|
||||||
"text":k.text,
|
"text":k.text,
|
||||||
"id": k.pk
|
"id": k.pk
|
||||||
} for k in x.get_comment_news.all()
|
} for k in x.get_comment_news.all()
|
||||||
]
|
]
|
||||||
|
|
||||||
result.append(a)
|
result.append(a)
|
||||||
|
if len(newsqueryset) ==1:
|
||||||
return Response(result)
|
result[0]['showComment'] = True
|
||||||
|
|
||||||
|
return Response({"result": result, "allnews": round(allnews/int(request.GET.get("selected")))})
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
|
||||||
if 'scores' in request.data:
|
if 'scores' in request.data:
|
||||||
@@ -60,7 +72,8 @@ class NewsAPIView(ListAPIView):
|
|||||||
|
|
||||||
upd.cdate=datetime.now()
|
upd.cdate=datetime.now()
|
||||||
upd.save()
|
upd.save()
|
||||||
back = [{"score":y.score, "user":y.author.id} for y in ScoreNews.objects.filter(news_id=request.data['news'])]
|
|
||||||
|
back = [{"score":y.score, "user":y.author.username} for y in ScoreNews.objects.filter(news_id=request.data['news'])]
|
||||||
|
|
||||||
if 'text' in request.data:
|
if 'text' in request.data:
|
||||||
CommentNews.objects.create(news_id=request.data['news'], author=self.request.user, text=request.data['text'])
|
CommentNews.objects.create(news_id=request.data['news'], author=self.request.user, text=request.data['text'])
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -1,17 +1,24 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from accounts.models import User
|
from accounts.models import User
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
class CountVisitor(models.Model):
|
class CountVisitor(models.Model):
|
||||||
page = models.CharField(db_index=True, max_length=255)
|
page = models.CharField(db_index=True, max_length=255)
|
||||||
visitdate = models.DateField()
|
visitdate = models.DateField()
|
||||||
user = models.ForeignKey(User, null=True, blank=True, on_delete=models.PROTECT)
|
user = models.ForeignKey(User, null=True, blank=True, on_delete=models.PROTECT)
|
||||||
count = models.IntegerField(default=0)
|
count = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.page)
|
return str(self.page)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
constraints = [
|
constraints = [
|
||||||
models.UniqueConstraint(fields=['page', 'user', 'visitdate'], name='unique appversion')
|
models.UniqueConstraint(fields=['page', 'user', 'visitdate'], name='unique appversion')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+26
-11
@@ -1,3 +1,4 @@
|
|||||||
|
from django.forms import model_to_dict
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from rest_framework.generics import ListAPIView
|
from rest_framework.generics import ListAPIView
|
||||||
from .models import *
|
from .models import *
|
||||||
@@ -7,32 +8,46 @@ from django.views.generic import ListView
|
|||||||
from .serializers import *
|
from .serializers import *
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from django.db.models import Sum
|
from django.db.models import Sum
|
||||||
|
from userauth.models import *
|
||||||
|
import pandas as pd
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
class Counter(ListAPIView):
|
class Counter(ListAPIView):
|
||||||
permission_classes = (AllowAny,)
|
permission_classes = (AllowAny,)
|
||||||
serializer_class = CountSerializer
|
serializer_class = CountSerializer
|
||||||
|
|
||||||
# def get(self, request):
|
def get(self, request):
|
||||||
# qs = CountVisitor.objects.values()
|
res = CountVisitor.objects.values('page').annotate(Sum('count'))
|
||||||
# return Response(qs)
|
users = CountVisitor.objects.values('page', 'user__username').annotate(Sum('count'))
|
||||||
|
outuser = DictEmployee.objects.using('user_directory').values('login', 'fio')
|
||||||
|
pUser = pd.DataFrame.from_records(users)
|
||||||
|
pOutUser = pd.DataFrame.from_records(outuser)
|
||||||
|
h = pUser.merge(pOutUser, how="left", left_on="user__username", right_on="login")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for x in users:
|
||||||
|
if x['user__username'] is not None:
|
||||||
|
x['user__username'] = h.loc[h['login']==x['user__username']]['fio'].unique()[0]
|
||||||
|
else:
|
||||||
|
x['user__username'] = 'Анонимные'
|
||||||
|
|
||||||
|
return Response({"pages":res, "users": users})
|
||||||
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
# print(request.data['user__id'])
|
|
||||||
if request.data['user__id'] is not None:
|
if request.data['user__id'] is not None:
|
||||||
# print("sdddddd")
|
|
||||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today())
|
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today())
|
||||||
|
|
||||||
else:
|
else:
|
||||||
watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today())
|
watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today())
|
||||||
watch.count+=1
|
watch.count+=1
|
||||||
watch.save()
|
watch.save()
|
||||||
|
|
||||||
res = {"totalvisit": CountVisitor.objects.aggregate(Sum('count'))['count__sum'],
|
res = {"totalvisit": CountVisitor.objects.filter(page=request.data['page']).aggregate(Sum('count'))['count__sum'],
|
||||||
"visittoday":CountVisitor.objects.filter(visitdate=date.today()).aggregate(Sum('count'))['count__sum'],
|
"visittoday":CountVisitor.objects.filter(visitdate=date.today(), page=request.data['page']).aggregate(Sum('count'))['count__sum'],
|
||||||
"uniqtoday" : CountVisitor.objects.filter(visitdate=date.today()).count()
|
"uniqtoday" : CountVisitor.objects.filter(visitdate=date.today(), page=request.data['page']).count()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
Reference in new issue
Block a user