описание
This commit is contained in:
1 parent
cf1c4532fa
commit
e041c0ef06
1000 files changed
+90
-571
No files matched your search
Whitespace-only changes.
Whitespace-only changes.
@@ -42,7 +42,7 @@
|
||||
:src="`${burl}${x.sender}`"
|
||||
cover
|
||||
/>
|
||||
<!-- <my-helper :pretext=carous /> -->
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-title>
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
<span class="me-1">
|
||||
·
|
||||
</span>
|
||||
|
||||
<v-icon
|
||||
class="me-1"
|
||||
:icon="newsFull.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'"
|
||||
@@ -196,6 +197,7 @@
|
||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
|
||||
|
||||
У новости нет фотографий
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -229,6 +231,7 @@
|
||||
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
|
||||
|
||||
>
|
||||
<!-- <my-helper :pretext = newsFull /> -->
|
||||
<v-col class="flex-grow-1 text-subtitle-2 pl-2 pa-0 "
|
||||
|
||||
>
|
||||
@@ -264,6 +267,7 @@
|
||||
{{ y.text }}
|
||||
|
||||
</v-alert>
|
||||
|
||||
</v-col>
|
||||
<v-col class="flex-grow-0 d-flex pa-0 align-center"
|
||||
:class="accountStore.user.login==y.author.login?'pa-0':'pa-5'"
|
||||
@@ -560,13 +564,14 @@ export default {
|
||||
|
||||
const toggleLike = (idimage) => {
|
||||
axiosApiInstance.post(`api/navigation/gallery/`, {image: idimage}).then(result => {
|
||||
galleryimges.value.likes= result.data
|
||||
galleryimges.value.likes= result.data
|
||||
})
|
||||
}
|
||||
|
||||
const toggleLikeAll = (idimage) => {
|
||||
axiosApiInstance.post(`api/navigation/gallery/`, {image: idimage}).then(result => {
|
||||
newsFull.value.gallery.filter(e=>e.id ==idimage)[0].likes = result.data
|
||||
newsFull.value.gallery.filter(e=>e.id ==idimage)[0].likes = result.data
|
||||
|
||||
})
|
||||
}
|
||||
const heartIco = () => {
|
||||
@@ -574,7 +579,9 @@ export default {
|
||||
}
|
||||
|
||||
const toggleIncrementLike = (news, scores) => {
|
||||
axiosApiInstance.post(`api/navigation/news/`, {news: news, scores: scores}).then(result => {
|
||||
|
||||
axiosApiInstance.post(`api/navigation/newscrossroad/`, {news: news, scores: scores}).then(result => {
|
||||
console.log(result.data,'reвввввввввввввввввввsult.data')
|
||||
newsFull.value.scores= result.data
|
||||
})
|
||||
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
<template>
|
||||
<div class="flex-column h-100">
|
||||
<div
|
||||
v-for="(x, key) in newss.result"
|
||||
:key="key"
|
||||
>
|
||||
<news-card :news="x"/>
|
||||
</div>
|
||||
|
||||
</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 { axiosApiInstance } from '@/utils/axios-api'
|
||||
import { format } from 'date-fns'
|
||||
import { useRoute } from 'vue-router'
|
||||
import newsCard from './UI/news-card.vue'
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
export default {
|
||||
components: {
|
||||
newsCard
|
||||
},
|
||||
|
||||
|
||||
|
||||
setup(){
|
||||
const divs = ref([])
|
||||
onBeforeUpdate(() => {
|
||||
divs.value = []
|
||||
})
|
||||
const newss=ref([])
|
||||
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 => {
|
||||
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) => {
|
||||
idnews.value = news
|
||||
}
|
||||
|
||||
|
||||
|
||||
const limitText=(text)=> {
|
||||
let parser = new DOMParser().parseFromString(text, "text/html");
|
||||
let doc = parser.body.textContent || ""
|
||||
doc = doc.replaceAll('src="/media/uploads', `src="${baseURL}media/uploads`)
|
||||
const t = doc.split(' ').slice(0, 25)
|
||||
return `${doc.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,
|
||||
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>
|
||||
@@ -187,7 +187,7 @@
|
||||
</v-list>
|
||||
|
||||
<v-list nav density="compact">
|
||||
|
||||
<my-helper :pretext=scrimg />
|
||||
<v-list-item v-for="x of mainmenuStore.portallinks"
|
||||
:key="x.name"
|
||||
:title="x.name"
|
||||
@@ -196,6 +196,7 @@
|
||||
color="app_bar"
|
||||
:target="x.link?'_blank':''"
|
||||
>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon
|
||||
:icon="x.imagecode" />
|
||||
|
||||
@@ -83,9 +83,9 @@ export function pagecounter(){
|
||||
|
||||
clearAxios.post(`${baseURL}api/watcher/counter/`, postdata)
|
||||
.then(result => {
|
||||
|
||||
appStore.countvisitor = result.data})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ setup(){
|
||||
const alldata =ref({period: [], staff: 0, beforperiod: [], feedback: {criteria: [], feed: [], last_comment:{time_create:'1990-01-01'}}})
|
||||
const visition = () => {
|
||||
|
||||
axiosApiInstance.get(`api/watcher/testwatcher/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||
axiosApiInstance.get(`api/watcher/dataforstatistics/?start=${formatDash(filterStore.date_period.startdate)}&end=${formatDash(filterStore.date_period.enddate)}`).then(result => {
|
||||
|
||||
alldata.value = preparedata(result.data)
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
import CarouselList from '@/components/carousel-list.vue'
|
||||
import CarouselNumbers from '@/components/carousel-numbers.vue'
|
||||
import CalendarFull from '@/components/UI/Calendar-full.vue'
|
||||
import NewsListHome from '@/components/news-list-home.vue'
|
||||
|
||||
import NewsHome from '@/components/news-home.vue'
|
||||
import LoadRound from '@/components/load-round.vue'
|
||||
import DigitalLetna from '@/components/digital-letna.vue'
|
||||
@@ -125,7 +125,7 @@
|
||||
CarouselList,
|
||||
CarouselNumbers,
|
||||
CalendarFull,
|
||||
NewsListHome,
|
||||
|
||||
LoadRound,
|
||||
DigitalLetna,
|
||||
EventCalendar,
|
||||
@@ -152,6 +152,7 @@
|
||||
|
||||
axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
||||
.then(data => {
|
||||
console.log(data.data, 'data');
|
||||
favorit.value = data.data
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user