Комметнарии

This commit is contained in:
iriska-gri committed 2023-10-09 17:00:12 +03:00
1 parent eb48b4360c
commit a5cf33553b
10 files changed
+157 -81

No files matched your search

BIN
View File
Binary file not shown.
+14
View File
@@ -25,6 +25,7 @@
"vue": "^3.2.0", "vue": "^3.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",
"vue3-autocounter": "^1.0.6", "vue3-autocounter": "^1.0.6",
"vuelidate": "^0.7.7", "vuelidate": "^0.7.7",
"vuetify": "^3.0.0", "vuetify": "^3.0.0",
@@ -6207,6 +6208,11 @@
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"node_modules/bezier-easing": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/bezier-easing/-/bezier-easing-2.1.0.tgz",
"integrity": "sha512-gbIqZ/eslnUFC1tjEvtz0sgx+xTK20wDnYMIA27VA04R7w6xxXQPZDbibjA9DTWZRA2CXtwHykkVzlCaAJAZig=="
},
"node_modules/big-integer": { "node_modules/big-integer": {
"version": "1.6.51", "version": "1.6.51",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
@@ -12970,6 +12976,14 @@
"vue": "^3.2.0" "vue": "^3.2.0"
} }
}, },
"node_modules/vue-scrollto": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/vue-scrollto/-/vue-scrollto-2.20.0.tgz",
"integrity": "sha512-7i+AGKJTThZnMEkhIPgrZjyAX+fXV7/rGdg+CV283uZZwCxwiMXaBLTmIc5RTA4uwGnT+E6eJle3mXQfM2OD3A==",
"dependencies": {
"bezier-easing": "2.1.0"
}
},
"node_modules/vue3-autocounter": { "node_modules/vue3-autocounter": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/vue3-autocounter/-/vue3-autocounter-1.0.6.tgz", "resolved": "https://registry.npmjs.org/vue3-autocounter/-/vue3-autocounter-1.0.6.tgz",
+1
View File
@@ -27,6 +27,7 @@
"vue": "^3.2.0", "vue": "^3.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",
"vue3-autocounter": "^1.0.6", "vue3-autocounter": "^1.0.6",
"vuelidate": "^0.7.7", "vuelidate": "^0.7.7",
"vuetify": "^3.0.0", "vuetify": "^3.0.0",
+11 -11
View File
@@ -69,15 +69,15 @@ export default {
} }
, ,
eventRender: function(eventObj, $el) { // eventRender: function(eventObj, $el) {
$el.popover({ // $el.popover({
title: eventObj.title, // title: eventObj.title,
content: eventObj.description, // content: eventObj.description,
trigger: 'hover', // trigger: 'hover',
placement: 'top', // placement: 'top',
container: 'body' // container: 'body'
}); // });
}, // },
// eventDidMount: function(info) { // eventDidMount: function(info) {
@@ -120,7 +120,7 @@ export default {
data.data[x].map(e=>{ data.data[x].map(e=>{
let d = new Date(e.planned_date) let d = new Date(e.planned_date)
// console.log(, 'e---------d.addDays(e.count_days)--------e')
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]}) 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]})
} }
@@ -128,7 +128,7 @@ export default {
) )
} }
console.log(data.data , 'genvacation--------------------');
}) })
} }
+94 -39
View File
@@ -3,15 +3,18 @@
<v-card <v-card
v-show="pages=='home'" v-show="pages=='home'"
class="mx-auto mb-0 " :ref="i"
class="mx-auto"
:class="i>0?'mt-1':''"
v-for="(x, i) in newss" :key= i v-for="(x, i) in newss" :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>
<v-avatar <v-avatar
color="grey-darken-3" color="grey-darken-3"
image="https://avataaars.io/?avatarStyle=Transparent&topType=ShortHairShortCurly&accessoriesType=Prescription02&hairColor=Black&facialHairType=Blank&clotheType=Hoodie&clotheColor=White&eyeType=Default&eyebrowType=DefaultNatural&mouthType=Default&skinColor=Light" :image="accountStore.user.photo"
></v-avatar> ></v-avatar>
</template> </template>
@@ -26,22 +29,52 @@
:src="`${burl}${x.link}`" :src="`${burl}${x.link}`"
height="164px" height="164px"
cover cover
width="96%" width="92%"
class="mx-auto"
/> />
<v-list-item class="w-100">
<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.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="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)"/>
<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 @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
</div>
</template>
</v-list-item>
<v-card-text class="py-3"> <v-card-text class="py-0">
{{limitText(x.text)}} {{limitText(x.text)}}
</v-card-text> </v-card-text>
<v-card-actions>
<v-btn
color="#3E8890"
variant="text"
:to="'/news'"
>
Подробнее
</v-btn>
</v-card-actions>
<!-- :to="'/news'" -->
</v-card> </v-card>
<!-- ---------------------------------------------------------------------------------- --> <!-- ------------------------------ @click="scrollMeTo('porto')"---------------------------------------------------- -->
<v-card v-show="pages=='news'" <v-card v-show="pages=='news'"
class="mx-auto rounded-0" class="mx-auto rounded-0"
:ref="i"
v-for="(x, i) in newss" :key= i v-for="(x, i) in newss" :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">
@@ -49,8 +82,7 @@
<v-avatar <v-avatar
color="grey-darken-3" color="grey-darken-3"
image="https://avataaars.io/?avatarStyle=Transparent&topType=ShortHairShortCurly&accessoriesType=Prescription02&hairColor=Black&facialHairType=Blank&clotheType=Hoodie&clotheColor=White&eyeType=Default&eyebrowType=DefaultNatural&mouthType=Default&skinColor=Light" :image=accountStore.user.photo></v-avatar>
></v-avatar>
</template> </template>
<v-list-item-title>{{x.author.fio}}</v-list-item-title> <v-list-item-title>{{x.author.fio}}</v-list-item-title>
@@ -101,28 +133,37 @@
<div <div
v-for = "(y, key) in x.comment" v-for = "(y, key) in x.comment"
:key="key" :key="key"
class="d-flex flex-column py-3" class="d-flex flex-column pa-3"
> >
<!-- :class="accountStore.user.login==y.author.login?'text-end mr-6':''" -->
<v-row class="justify-space-between"> <v-row class="justify-space-between">
<v-col class="flex-grow-1 text-subtitle-2">{{ splitname(y.author) }} <v-col class="flex-grow-1 text-nowrap text-subtitle-2 pb-4"
<v-btn
variant="text" >{{ splitname(y.author) }}
size="small" </v-col>
icon='mdi-delete' <v-col class="pa-0 text-center text-subtitle-2 order-3">{{dateformat(y.cdate)}} </v-col>
color="blue-grey-darken-1"
@click="deletComment(y.id, x.id)"
/></v-col>
<v-col class="flex-grow-2 text-subtitle-2 order-3">{{dateformat(y.cdate)}} </v-col>
<v-col class="flex-grow-0"></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">
</div> </div>
<v-row>
<v-col class="pr-0">
<v-alert
<v-alert
class="comWy"
color="#f9f9f9" color="#f9f9f9"
:border="accountStore.user.login==y.author.login?'end':'start'" :border="accountStore.user.login==y.author.login?'end':'start'"
@@ -133,14 +174,22 @@
{{ y.text }} {{ y.text }}
</v-alert> </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'"
>
<v-btn
v-if="accountStore.user.login==y.author.login"
variant="text"
size="small"
icon='mdi-delete'
color="blue-grey-darken-1"
@click="deletComment(y.id, x.id)"
/>
</v-col>
</v-row>
<!-- <v-card
width="400"
:subtitle=splitname(y.author)
:text=y.text
elevation="1"
color="red"
></v-card> -->
</div> </div>
</div> </div>
@@ -154,6 +203,7 @@
</v-card> </v-card>
<v-row justify="center"> <v-row justify="center">
<v-dialog <v-dialog
v-model="dialogCommentShow" v-model="dialogCommentShow"
@@ -193,6 +243,7 @@
</v-card> </v-card>
</v-dialog> </v-dialog>
</v-row> </v-row>
</v-container> </v-container>
</template> </template>
@@ -207,6 +258,7 @@ 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'
const accountStore = useAccountStore() const accountStore = useAccountStore()
export default { export default {
@@ -219,7 +271,6 @@ export default {
} }
}, },
setup(props){ setup(props){
const newss=ref([]) const newss=ref([])
const dialogCommentShow = ref(false) const dialogCommentShow = ref(false)
@@ -238,6 +289,10 @@ export default {
return format(new Date(datas), 'dd.MM.yyyy HH:mm') return format(new Date(datas), 'dd.MM.yyyy HH:mm')
} }
const newses =() => {
}
const openComent = (news) => { const openComent = (news) => {
dialogCommentShow.value=!dialogCommentShow.value dialogCommentShow.value=!dialogCommentShow.value
idnews.value = news idnews.value = news
@@ -245,19 +300,19 @@ export default {
} }
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[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
console.log(result.data, 'result.data-----------------')
}) })
} }
const limitText=(text)=> { const limitText=(text)=> {
const t = text.split(' ').slice(0, 25) const t = text.split(' ').slice(0, 25)
console.log(text.split(' ').slice(0, 25).join(' '));
console.log(t.length<25?'':'...');
return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}` return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
} }
@@ -270,15 +325,15 @@ export default {
watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{ watch(()=>accountStore.cod2user ,(newValue,oldValue)=>{
if(newValue){ if(newValue){
getfromserver("api/navigation/news/",newss) getfromserver(`api/navigation/news/`,newss)
} }
}, {deep:true}) }, {deep:true})
const deletComment = (id, news) => { const deletComment = (id, news) => {
axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => { axiosApiInstance.post(`api/navigation/news/`, {delid: id, news: news}).then(result => {
// dialogCommentShow.value=!dialogCommentShow.value
newss.value[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment newss.value[newss.value.findIndex(e=> e.id==result.data['news'])].comment = result.data.comment
console.log(result.data, 'result.data-----------------')
}) })
@@ -298,8 +353,8 @@ export default {
openComent, openComent,
addComment, addComment,
idnews, idnews,
deletComment deletComment,
newses
} }
} }
@@ -312,7 +367,7 @@ export default {
height: 93vh; height: 93vh;
} }
.comWy { /* .comWy {
width: 96%; width: 96%;
} } */
</style> </style>
+20 -26
View File
@@ -19,23 +19,7 @@
title="Портал МиФНС по ЦОД № 2" title="Портал МиФНС по ЦОД № 2"
variant="text" variant="text"
:to="'/'" /> :to="'/'" />
<!-- @click="drawer = !drawer" -->
<!-- <v-app-bar-nav-icon
:to="'/'"
>
<img
style="cursor:pointer"
:src="imageSrc"
/>
</v-app-bar-nav-icon> -->
<!-- <v-toolbar-title >
Портал МиФНС по ЦОД № 2
</v-toolbar-title> -->
<template v-slot:image> <template v-slot:image>
<v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" /> <v-img gradient="to top right, rgba(19,84,122,.8), rgba(128,208,199,.8)" />
</template> </template>
@@ -111,7 +95,7 @@
</template> </template>
</template> </template>
</v-app-bar> </v-app-bar>
<v-navigation-drawer :rail="rail" permanent v-model="drawer"> <v-navigation-drawer :width="245" :rail="rail" permanent v-model="drawer">
<v-row class="my-0 h-100"> <v-row class="my-0 h-100">
<v-col class="flex-column d-flex"> <v-col class="flex-column d-flex">
<v-row><v-col> <v-row><v-col>
@@ -127,11 +111,12 @@
color="navigation"> color="navigation">
<template v-slot:prepend> <template v-slot:prepend>
<v-icon :icon="x.ico" /> <v-icon :icon="x.ico"/>
</template> </template>
</v-list-item> </v-list-item>
<v-list-group v-else <v-list-group v-else
:class="rail?'railmenu':''"
:key="key" :key="key"
:value="x.name"> :value="x.name">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
@@ -141,12 +126,13 @@
:prepend-icon="x.ico" /> :prepend-icon="x.ico" />
</template> </template>
<v-list-item v-for="(child, k) in x.submenu" <v-list-item v-for="(child, k) in x.submenu"
:href="child.link" :href="child.link"
:key="k" :key="k"
:value="child.name" :value="child.name"
:title="child.name" :title="!rail?child.name:menuTruncated(child.name)"
:to="child.path" :to="child.path"
:prepend-icon="child.subIcon"> >
</v-list-item> </v-list-item>
</v-list-group> </v-list-group>
</template> </template>
@@ -167,8 +153,8 @@
</v-col> </v-col>
</v-row> </v-row>
<v-row class="flex-grow-0"> <v-row class="flex-grow-0">
<v-col class="py-0 pl-1"> <v-col class="py-0 pl-1 d-flex flex-column">
<v-list> <v-list class=" d-flex flex-column ">
<v-list-item v-if="!rail" class="text-caption font-weight-bold text-truncate"> <v-list-item v-if="!rail" class="text-caption font-weight-bold text-truncate">
<p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p> <p>Посещений всего: {{ appStore.countvisitor.totalvisit }}</p>
@@ -180,12 +166,12 @@
</v-list-item> </v-list-item>
<v-list-item v-else> <v-list-item v-else class="align-center ml-2">
<v-tooltip <v-tooltip
v-model="showTooltip" v-model="showTooltip"
location="top"> location="top">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-icon v-bind="props" color="grey"> <v-icon v-bind="props" color="#7A7A7A">
mdi-account-eye mdi-account-eye
</v-icon> </v-icon>
</template> </template>
@@ -398,9 +384,12 @@ export default {
const drawer_right = ref(true) const drawer_right = ref(true)
const menuGetUserDialog = ref(false) const menuGetUserDialog = ref(false)
const LikeDialog = ref(false) const LikeDialog = ref(false)
const rail = ref(true) const rail = ref(false)
const showTooltip = ref(false) const showTooltip = ref(false)
const menuTruncated = (menus) => {
return menus.slice(0,2).toUpperCase()
}
const toggleTheme = () => { const toggleTheme = () => {
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark' theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
@@ -485,7 +474,8 @@ export default {
// userlinks, // userlinks,
appStore, appStore,
rail, rail,
showTooltip showTooltip,
menuTruncated
} }
} }
@@ -504,4 +494,8 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.railmenu .v-list-group__items .v-list-item {
padding-inline-start: 11px!important;
}
</style> </style>
+4 -1
View File
@@ -14,6 +14,8 @@ import { createApp } from 'vue'
import { registerPlugins } from '@/plugins' import { registerPlugins } from '@/plugins'
import components from '@/components/UI/index' import components from '@/components/UI/index'
import Vue3Autocounter from 'vue3-autocounter'; import Vue3Autocounter from 'vue3-autocounter';
import VueScrollTo from 'vue-scrollto'
const app = createApp(App) const app = createApp(App)
components.forEach((component) => { components.forEach((component) => {
@@ -21,7 +23,8 @@ components.forEach((component) => {
}) })
app.component('vue3-autocounter', Vue3Autocounter) app.component('vue3-autocounter', Vue3Autocounter)
app.component('vue-scrollto', VueScrollTo)
// Vue.use(VueScrollTo)
registerPlugins(app) registerPlugins(app)
+8
View File
@@ -1,11 +1,19 @@
<template> <template>
<!-- <div id="app">
<a href="#" id="return-top" v-scroll-to="'#top'">Top</a>
<div ref="top">Hi. I'm #top</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="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>
+1 -2
View File
@@ -114,7 +114,7 @@
elevation="0" elevation="0"
> >
<News-list v-if="accountStore.cod2user"/> <News-list :page="'home'" v-if="accountStore.cod2user"/>
@@ -190,7 +190,6 @@
function proba(){ function proba(){
axiosApiInstance.get('api/feedback/feedbackdata/') axiosApiInstance.get('api/feedback/feedbackdata/')
.then(data => { .then(data => {
console.log(data.data);
t_baseCriteria.value = data.data.results t_baseCriteria.value = data.data.results
}) })
} }
+4 -2
View File
@@ -26,8 +26,10 @@ class NewsAPIView(ListAPIView):
permission_classes = (AllowAny,) permission_classes = (AllowAny,)
def get(self, request): def get(self, request):
print(request.GET.get("name"), '-----------------------------------------') if request.GET.get("name") == "home":
newsqueryset = News.objects.all().order_by('cdate')[:10] newsqueryset = News.objects.all().order_by('cdate')[:10]
else:
newsqueryset = News.objects.all().order_by('cdate')
result = [] result = []
for x in newsqueryset: for x in newsqueryset:
a=model_to_dict(x) a=model_to_dict(x)