Исправление замечаний, описание компонентов
This commit is contained in:
1 parent
f38ed176e9
commit
8c5b01f6d4
18 files changed
+200
-188
No files matched your search
@@ -68,7 +68,6 @@ class CustomAuth(ModelBackend):
|
|||||||
# try:
|
# try:
|
||||||
|
|
||||||
user = DictEmployee.objects.get(login=username)
|
user = DictEmployee.objects.get(login=username)
|
||||||
# print(user)
|
|
||||||
|
|
||||||
if user.deleted!=1:
|
if user.deleted!=1:
|
||||||
homeuser, created = User.objects.get_or_create(username=username)
|
homeuser, created = User.objects.get_or_create(username=username)
|
||||||
@@ -92,10 +91,4 @@ class CustomAuth(ModelBackend):
|
|||||||
|
|
||||||
return homeuser
|
return homeuser
|
||||||
|
|
||||||
# except Exception as e:
|
|
||||||
# print (e)
|
|
||||||
# elif status_code==403:
|
|
||||||
# print('loh')
|
|
||||||
# return None
|
|
||||||
|
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ class roundExcel():
|
|||||||
|
|
||||||
def excelvacation(self):
|
def excelvacation(self):
|
||||||
|
|
||||||
print('helooooooooooooooooooooooooooooooooooooo')
|
pass
|
||||||
|
|
||||||
|
|
||||||
class loadExcel():
|
class loadExcel():
|
||||||
@@ -232,10 +232,6 @@ class loadExcel():
|
|||||||
df3['d'] = df3['d'].astype(int)
|
df3['d'] = df3['d'].astype(int)
|
||||||
|
|
||||||
for ind in df3.index:
|
for ind in df3.index:
|
||||||
# print(df3['login'][ind])
|
|
||||||
#
|
|
||||||
GeneralVacation.objects.create(login=df3['login'][ind], planned_date=df3['c'][ind], count_days=df3['d'][ind], type_of_vacation=df3['e'][ind], start_work_period=df3['f'][ind])
|
GeneralVacation.objects.create(login=df3['login'][ind], planned_date=df3['c'][ind], count_days=df3['d'][ind], type_of_vacation=df3['e'][ind], start_work_period=df3['f'][ind])
|
||||||
# DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'),
|
|
||||||
# user=df3['login'][ind], defaults={'position':base})
|
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ class DailyRoundUpAPIView(APIView):
|
|||||||
|
|
||||||
|
|
||||||
re = roundExcel(user)
|
re = roundExcel(user)
|
||||||
print( request.GET.get("excel"), '-------------------------------')
|
|
||||||
file_path = getattr(re, request.GET.get("excel"))()
|
file_path = getattr(re, request.GET.get("excel"))()
|
||||||
# if request.GET.get("excel") == 'round':
|
# if request.GET.get("excel") == 'round':
|
||||||
# file_path = re.excround()
|
# file_path = re.excround()
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ class Counter(ListAPIView):
|
|||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
"""Не используется"""
|
"""Не используется"""
|
||||||
# data = UserComment.objects.filter(Q(time_create__range=['2024-01-01', '2024-03-01']), ~Q(comment='')). \
|
|
||||||
# values().order_by('-time_create')
|
|
||||||
# print(data,'---------------------------------------------------------')
|
|
||||||
|
|
||||||
|
|
||||||
return Response('Не используется')
|
return Response('Не используется')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,21 +41,8 @@ export default {
|
|||||||
},
|
},
|
||||||
firstDay:'1',
|
firstDay:'1',
|
||||||
events: [],
|
events: [],
|
||||||
// eventDidMount: function(info) {
|
|
||||||
|
|
||||||
|
|
||||||
// const dayEl = info.el.closest('.fc-daygrid-day')
|
|
||||||
// dayEl.style.backgroundColor = 'red'
|
|
||||||
// },
|
|
||||||
// datesRender: function(info) {
|
|
||||||
|
|
||||||
|
|
||||||
// const start = info.view.activeStart
|
|
||||||
// const end = info.view.activeEnd
|
|
||||||
// let daysEls = document.querySelectorAll('.fc-daygrid-day')
|
|
||||||
// console.log(daysEls , ' info-------------');
|
|
||||||
// },
|
|
||||||
|
|
||||||
editable: true,
|
editable: true,
|
||||||
headerToolbar: {
|
headerToolbar: {
|
||||||
left: 'prev',
|
left: 'prev',
|
||||||
@@ -88,9 +75,6 @@ export default {
|
|||||||
noEventsContent: 'На сегодня событий нет',
|
noEventsContent: 'На сегодня событий нет',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
|
|
||||||
dateClick: (arg) => {
|
|
||||||
console.log(arg.date);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function f_generalvacation() {
|
function f_generalvacation() {
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
|
|
||||||
<v-row no-gutters v-if="top.comment[0].time_create != '1990-01-01'">
|
<v-row no-gutters v-if="top.comment[0].time_create != '1990-01-01'">
|
||||||
<v-col lg=5 class="bg-teal-lighten-4 align-self-center">
|
<v-col lg=5 class="bg-teal-lighten-4 align-self-center">
|
||||||
<list-user :author= "top.author" :from_which="'top_comment'"/>
|
<list-user
|
||||||
|
:author= "top.author"
|
||||||
|
:from_which="'top_comment'"
|
||||||
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="align-self-center pl-0">
|
<v-col class="align-self-center pl-0">
|
||||||
|
|
||||||
@@ -77,14 +80,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
||||||
import ListUser from '@/components/UI/fiousercard/listUser.vue'
|
|
||||||
import TooltipText from '@/components/UI/tooltip-text.vue'
|
import TooltipText from '@/components/UI/tooltip-text.vue'
|
||||||
import CardComment from './card_top_comment/card-comment.vue'
|
import CardComment from './card_top_comment/card-comment.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
PatternCardFeed,
|
PatternCardFeed,
|
||||||
ListUser,
|
|
||||||
TooltipText,
|
TooltipText,
|
||||||
CardComment
|
CardComment
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<v-card class="h-100 ">
|
<v-card class="h-100 ">
|
||||||
<!-- <line-graph v-if="data!==null" :data="data" ref ='linear' :options="options"/> -->
|
<Line
|
||||||
<Line v-if="data!==null" :data="data" ref ='linear' :options="options" />
|
v-if="data!==null"
|
||||||
|
:data="data"
|
||||||
|
ref ='linear'
|
||||||
|
:options="options"
|
||||||
|
/>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import lineGraph from '@/components/graph/line-graph.vue'
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import {computed,ref} from 'vue'
|
import {computed,ref} from 'vue'
|
||||||
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
import { usePortalFilterStore } from '@/store/AboutPortalFilter'
|
||||||
@@ -25,7 +27,6 @@ import {
|
|||||||
TimeScale
|
TimeScale
|
||||||
} from 'chart.js'
|
} from 'chart.js'
|
||||||
import { Line } from 'vue-chartjs'
|
import { Line } from 'vue-chartjs'
|
||||||
|
|
||||||
import ChartDataLabels from 'chartjs-plugin-datalabels'
|
import ChartDataLabels from 'chartjs-plugin-datalabels'
|
||||||
import 'chartjs-adapter-moment'
|
import 'chartjs-adapter-moment'
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
@@ -39,12 +40,15 @@ ChartJS.register(
|
|||||||
Legend,
|
Legend,
|
||||||
TimeScale
|
TimeScale
|
||||||
)
|
)
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Line,
|
Line,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
dataLineChart: {
|
dataLineChart: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
@@ -59,124 +63,110 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'd'
|
default: 'd'
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(props, {emit}) {
|
setup(props, {emit}) {
|
||||||
const filterStore = usePortalFilterStore()
|
const filterStore = usePortalFilterStore()
|
||||||
const between = ref(0)
|
const between = ref(0)
|
||||||
const arrlines = {
|
const arrlines = {
|
||||||
// labels: [''],
|
datasets: [
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'Открыто страниц',
|
|
||||||
backgroundColor: '#C62828',
|
|
||||||
borderColor: '#C62828',
|
|
||||||
borderWidth: 3,
|
|
||||||
cubicInterpolationMode: 'monotone',
|
|
||||||
data: [],
|
|
||||||
func: (val)=>{return val.count},
|
|
||||||
datakey: "count",
|
|
||||||
tooltips: false ,
|
|
||||||
hidden: true,
|
|
||||||
yAxisID: 'y'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Активные пользователи',
|
|
||||||
backgroundColor: 'teal',
|
|
||||||
borderColor: 'teal',
|
|
||||||
borderWidth: 3,
|
|
||||||
cubicInterpolationMode: 'monotone',
|
|
||||||
data: [],
|
|
||||||
func: (val)=>{return val.unic.length},
|
|
||||||
datakey: "unic",
|
|
||||||
|
|
||||||
customlabel: [],
|
|
||||||
tooltips: true,
|
|
||||||
yAxisID: 'y'
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label: 'CRR',
|
|
||||||
backgroundColor: '#673AB7',
|
|
||||||
borderColor: '#673AB7',
|
|
||||||
borderWidth: 3,
|
|
||||||
cubicInterpolationMode: 'monotone',
|
|
||||||
data: [],
|
|
||||||
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))
|
|
||||||
},
|
|
||||||
hidden: true,
|
|
||||||
datakey: "crr",
|
|
||||||
customlabel: [],
|
|
||||||
tooltips: true,
|
|
||||||
yAxisID: 'y1'
|
|
||||||
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label: 'BR',
|
|
||||||
backgroundColor: '#283593',
|
|
||||||
borderColor: '#283593',
|
|
||||||
borderWidth: 3,
|
|
||||||
cubicInterpolationMode: 'monotone',
|
|
||||||
data: [],
|
|
||||||
func: (val)=>{return parseFloat((val.br/val.unic.length*100).toFixed(2))},
|
|
||||||
datakey: "br",
|
|
||||||
hidden: true,
|
|
||||||
customlabel: [],
|
|
||||||
tooltips: true,
|
|
||||||
yAxisID: 'y1'
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label: 'PPV',
|
|
||||||
backgroundColor: '#EF9A9A',
|
|
||||||
borderColor: '#EF9A9A',
|
|
||||||
borderWidth: 3,
|
|
||||||
cubicInterpolationMode: 'monotone',
|
|
||||||
data: [],
|
|
||||||
func: (val)=>{return parseFloat((val.pages/val.unic.length).toFixed(2))},
|
|
||||||
datakey: "ppv",
|
|
||||||
hidden: true,
|
|
||||||
customlabel: [],
|
|
||||||
tooltips: true,
|
|
||||||
yAxisID: 'y'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
const dataf=computed({get() {
|
|
||||||
|
|
||||||
fullpercreate()
|
|
||||||
let data1 = moment(filterStore.date_period.enddate)
|
|
||||||
let data2 = moment(filterStore.date_period.startdate)
|
|
||||||
between.value = data1.diff(data2, 'days') + 1
|
|
||||||
let res = null
|
|
||||||
|
|
||||||
if (Object.keys(props.dataLineChart).length>0){
|
|
||||||
res = arrlines
|
|
||||||
res.labels=[]
|
|
||||||
|
|
||||||
res.datasets.forEach((e) => {e.data =[]})
|
|
||||||
for(let [key,val] of Object.entries(props.dataLineChart))
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
label: 'Открыто страниц',
|
||||||
|
backgroundColor: '#C62828',
|
||||||
|
borderColor: '#C62828',
|
||||||
|
borderWidth: 3,
|
||||||
|
cubicInterpolationMode: 'monotone',
|
||||||
|
data: [],
|
||||||
|
func: (val)=>{return val.count},
|
||||||
|
datakey: "count",
|
||||||
|
tooltips: false ,
|
||||||
|
hidden: true,
|
||||||
|
yAxisID: 'y'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Активные пользователи',
|
||||||
|
backgroundColor: 'teal',
|
||||||
|
borderColor: 'teal',
|
||||||
|
borderWidth: 3,
|
||||||
|
cubicInterpolationMode: 'monotone',
|
||||||
|
data: [],
|
||||||
|
func: (val)=>{return val.unic.length},
|
||||||
|
datakey: "unic",
|
||||||
|
customlabel: [],
|
||||||
|
tooltips: true,
|
||||||
|
yAxisID: 'y'
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
label: 'CRR',
|
||||||
|
backgroundColor: '#673AB7',
|
||||||
|
borderColor: '#673AB7',
|
||||||
|
borderWidth: 3,
|
||||||
|
cubicInterpolationMode: 'monotone',
|
||||||
|
data: [],
|
||||||
|
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))},
|
||||||
|
hidden: true,
|
||||||
|
datakey: "crr",
|
||||||
|
customlabel: [],
|
||||||
|
tooltips: true,
|
||||||
|
yAxisID: 'y1'
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
label: 'BR',
|
||||||
|
backgroundColor: '#283593',
|
||||||
|
borderColor: '#283593',
|
||||||
|
borderWidth: 3,
|
||||||
|
cubicInterpolationMode: 'monotone',
|
||||||
|
data: [],
|
||||||
|
func: (val)=>{return parseFloat((val.br/val.unic.length*100).toFixed(2))},
|
||||||
|
datakey: "br",
|
||||||
|
hidden: true,
|
||||||
|
customlabel: [],
|
||||||
|
tooltips: true,
|
||||||
|
yAxisID: 'y1'
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
label: 'PPV',
|
||||||
|
backgroundColor: '#EF9A9A',
|
||||||
|
borderColor: '#EF9A9A',
|
||||||
|
borderWidth: 3,
|
||||||
|
cubicInterpolationMode: 'monotone',
|
||||||
|
data: [],
|
||||||
|
func: (val)=>{return parseFloat((val.pages/val.unic.length).toFixed(2))},
|
||||||
|
datakey: "ppv",
|
||||||
|
hidden: true,
|
||||||
|
customlabel: [],
|
||||||
|
tooltips: true,
|
||||||
|
yAxisID: 'y'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataf=computed({get() {
|
||||||
|
fullpercreate()
|
||||||
|
let data1 = moment(filterStore.date_period.enddate)
|
||||||
|
let data2 = moment(filterStore.date_period.startdate)
|
||||||
|
between.value = data1.diff(data2, 'days') + 1
|
||||||
|
let res = null
|
||||||
|
|
||||||
|
if (Object.keys(props.dataLineChart).length>0){
|
||||||
|
res = arrlines
|
||||||
|
res.labels=[]
|
||||||
|
res.datasets.forEach((e) => {e.data =[]})
|
||||||
|
for(let [key,val] of Object.entries(props.dataLineChart)) {
|
||||||
res.datasets.forEach((e) => {
|
res.datasets.forEach((e) => {
|
||||||
e.data.push(e.func(val,key))
|
e.data.push(e.func(val,key))
|
||||||
|
});
|
||||||
|
res.labels.push(formatComa(key))
|
||||||
});
|
|
||||||
|
|
||||||
res.labels.push(formatComa(key))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return res
|
||||||
|
}})
|
||||||
return res
|
|
||||||
}})
|
|
||||||
|
|
||||||
const fullper = ref([])
|
const fullper = ref([])
|
||||||
|
|
||||||
const fullpercreate = () => {
|
const fullpercreate = () => {
|
||||||
let arr = []
|
let arr = []
|
||||||
props.period.period.forEach((e) => {
|
props.period.period.forEach((e) => {
|
||||||
@@ -189,27 +179,28 @@ export default {
|
|||||||
arr[ind].user = Array.from(new Set(arr[ind].user).add(e.user.id))
|
arr[ind].user = Array.from(new Set(arr[ind].user).add(e.user.id))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
fullper.value= [...props.period.before, ...arr]
|
fullper.value= [...props.period.before, ...arr]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const crrfunc = (date)=>{
|
const crrfunc = (date)=>{
|
||||||
|
/**
|
||||||
|
* Расчет значения crr, и передача в родительский компонент значения, на последнюю дату в периоде для компонента card-total
|
||||||
|
* @constructor
|
||||||
|
* @param {object} date - по каждому дню, в указанном периоде (пример - 2024-03-22)
|
||||||
|
* @description Для расчетного периода с 04.03.2024 по 20.03.2024 выбирается три периода:
|
||||||
|
* 30.01.2024 - 16.02.2024 - baseunic
|
||||||
|
* 17.02.2024 - 03.03.2024 - crrunic
|
||||||
|
* 04.03.2024 - 20.03.2024 - отсюда даты для расчета
|
||||||
|
* bothuser - Пользователи которые были в baseunic и crrunic
|
||||||
|
*/
|
||||||
|
|
||||||
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) <= moment(new Date(date)).subtract(between.value, 'd')))
|
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) <= moment(new Date(date)).subtract(between.value, 'd')))
|
||||||
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) <= new Date(date)))
|
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) <= new Date(date)))
|
||||||
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
||||||
|
|
||||||
if (date ==formatDash(filterStore.date_period.enddate)) {
|
if (date ==formatDash(filterStore.date_period.enddate)) {
|
||||||
|
|
||||||
editCRR(bothuser.size*100/baseunic.size)
|
editCRR(bothuser.size*100/baseunic.size)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
||||||
@@ -266,14 +257,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// hover: {
|
|
||||||
// onHover: function(e) {
|
|
||||||
// var point = this.getElementAtEvent(e);
|
|
||||||
|
|
||||||
// if (point.length) e.native.target.style.cursor = 'pointer';
|
|
||||||
// else e.native.target.style.cursor = 'default';
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
|
|||||||
@@ -127,12 +127,10 @@
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from '@/utils/axios-api'
|
||||||
import {checkremote} from '@/utils/universal_functions'
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
import listUser from '@/components/UI//fiousercard/listUser.vue'
|
|
||||||
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
import PatternCard from '@/components/UI/aboutportal/pattern-card.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
listUser,
|
|
||||||
PatternCard
|
PatternCard
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# listUser
|
||||||
|
|
||||||
|
Компонент отображает фотографию заглушку, если ведется разработка, и подтягивает фотографию сотрудника, если подключается к серверу. По клику открывает карточка информация о сотруднике
|
||||||
|
*InfoUserCard from '@/components/UI/infoUserCard.vue'* (является глобальным компонентом, прописан в src/front/src/components/UI/index.js)
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
props: {
|
||||||
|
author: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
from_which: {
|
||||||
|
type: String,
|
||||||
|
default: "dialog-search"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## author
|
||||||
|
|
||||||
|
Содержит информацию по сотруднику
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"familyname": "Гришина",
|
||||||
|
"name": "Ирина",
|
||||||
|
"parentname": "Сергеевна",
|
||||||
|
"id": 107,
|
||||||
|
"login": "9966-00-107",
|
||||||
|
"post": "Старший специалист 1 разряда",
|
||||||
|
"department": "Отдел контроля технологических процессов"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## from_which
|
||||||
|
|
||||||
|
Указать из какого компонента вызывается, чтобы написать новое отображение, на случай, если не подходит ни одна из имеющихся
|
||||||
|
|
||||||
|
### Пример использования компонента
|
||||||
|
|
||||||
|
` <list-user
|
||||||
|
:author= "top.author"
|
||||||
|
:from_which="'top_comment'"
|
||||||
|
/>`
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<my-helper :pretext = "author" />
|
||||||
<v-list-item v-if="from_which=='dialog-search'" class="pl-4 h-100 text-left pa-2" @click="open=true">
|
<v-list-item v-if="from_which=='dialog-search'" class="pl-4 h-100 text-left pa-2" @click="open=true">
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-avatar
|
<v-avatar
|
||||||
@@ -61,6 +62,7 @@ import { spravURL } from '@/utils/axios-api'
|
|||||||
import {splitname} from '@/utils/universal_functions'
|
import {splitname} from '@/utils/universal_functions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: "list-user",
|
||||||
props: {
|
props: {
|
||||||
author: {
|
author: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ import myHelper from '@/components/UI/my-helper';
|
|||||||
import InfoUserCard from '@/components/UI/infoUserCard.vue';
|
import InfoUserCard from '@/components/UI/infoUserCard.vue';
|
||||||
import TooltipText from '@/components/UI/tooltip-text.vue'
|
import TooltipText from '@/components/UI/tooltip-text.vue'
|
||||||
import AlertDefault from '@/layouts/default/alertDefault.vue'
|
import AlertDefault from '@/layouts/default/alertDefault.vue'
|
||||||
|
import listUser from '@/components/UI/fiousercard/listUser.vue';
|
||||||
|
|
||||||
export default [myHelper, InfoUserCard, TooltipText, AlertDefault]
|
export default [myHelper, InfoUserCard, TooltipText, AlertDefault, listUser]
|
||||||
@@ -79,17 +79,16 @@ class="px-3 ddd" >
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref,watch, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import {checkremote} from '@/utils/universal_functions'
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from '@/utils/axios-api'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
|
||||||
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
||||||
import listUser from '@/components/UI//fiousercard/listUser.vue'
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
VcardUser,listUser
|
VcardUser
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
const onPickFile = (ex) => {
|
const onPickFile = (ex) => {
|
||||||
console.log(ex)
|
|
||||||
const sdata = new FormData()
|
const sdata = new FormData()
|
||||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
sdata.append('dailyfiles', dailyfiles.value[0])
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,8 @@
|
|||||||
<v-col>
|
<v-col>
|
||||||
<v-list nav density active-class="noneoutline">
|
<v-list nav density active-class="noneoutline">
|
||||||
<default-portal-menu-list :aMenuItem="supperuser"/>
|
<default-portal-menu-list :aMenuItem="supperuser"/>
|
||||||
<div v-if="baseURL=='http://127.0.0.1:8000/'">
|
<div v-if="getDevelopment()">
|
||||||
|
|
||||||
<default-portal-menu-list :aMenuItem="oRasrab"/>
|
<default-portal-menu-list :aMenuItem="oRasrab"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -295,9 +296,9 @@ import { clearAxios } from '@/utils/axios-api'
|
|||||||
|
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api'
|
||||||
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
import VcardUser from '@/components/UI/fiousercard/vcardUser.vue'
|
||||||
import PageCounter from '../../components/UI/defaultportal/page-counter.vue'
|
import PageCounter from '@/components/UI/defaultportal/page-counter.vue'
|
||||||
import DefaultPortalMenuList from './DefaultPortalMenuList.vue'
|
import DefaultPortalMenuList from '@/layouts/default/DefaultPortalMenuList.vue'
|
||||||
|
import {getDevelopment} from '@/utils/universal_functions'
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
@@ -486,7 +487,8 @@ export default {
|
|||||||
burl,
|
burl,
|
||||||
supperuser,
|
supperuser,
|
||||||
closeinfo,
|
closeinfo,
|
||||||
baseURL
|
baseURL,
|
||||||
|
getDevelopment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# alertDefault
|
||||||
|
|
||||||
|
Компонент для отображения информации о выполненном действии/оповещении/предупреждения
|
||||||
|
|
||||||
|
Импорт глобальный, прописан в src/front/src/components/UI/index.js
|
||||||
|
|
||||||
|
*Описание входящих параметров в useAlertStore.md*
|
||||||
@@ -46,12 +46,9 @@ export function getfromserver(path, reactive){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// export function bgimage(filecheck){
|
|
||||||
// const h = new URL(`@assets/bg-for-number-carousel.png`, import.meta.url).href
|
|
||||||
|
|
||||||
// return h
|
|
||||||
// }
|
|
||||||
// bg-for-number-carousel.png
|
|
||||||
|
|
||||||
export function checkremote(filecheck){
|
export function checkremote(filecheck){
|
||||||
|
|
||||||
@@ -61,6 +58,8 @@ export function checkremote(filecheck){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default str;
|
export default str;
|
||||||
|
|
||||||
export function splitname (name) {
|
export function splitname (name) {
|
||||||
@@ -91,5 +90,7 @@ export function pagecounter(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDevelopment() {
|
||||||
|
return process.env.NODE_ENV == 'development'?true:false
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
# Назначение
|
# Универсальные функции
|
||||||
Содержит в себе часто использумые однотивные функции
|
Содержит в себе часто использумые однотивные функции
|
||||||
|
|
||||||
|
> import {} from '@/utils/universal_functions'
|
||||||
|
|
||||||
#### formatComa - DD.MM.YYYY, formatDash - YYYY-MM-DD, formaComaTime - DD.MM.YYYY H:mm изменять формат времени
|
#### formatComa - DD.MM.YYYY, formatDash - YYYY-MM-DD, formaComaTime - DD.MM.YYYY H:mm изменять формат времени
|
||||||
|
|
||||||
Принимает параметр date? в формате new Date()
|
Принимает параметр date? в формате new Date()
|
||||||
@@ -45,7 +47,8 @@ userlinks.login - 9966-00-107
|
|||||||
"department": "Отдел контроля технологических процессов" }
|
"department": "Отдел контроля технологических процессов" }
|
||||||
Данный пример объекта содержит большее количество данных, главное чтобы были ключи **familyname**, **name**, **parentname**
|
Данный пример объекта содержит большее количество данных, главное чтобы были ключи **familyname**, **name**, **parentname**
|
||||||
|
|
||||||
#### pagecounter счетчик для страницы
|
#### pagecounter
|
||||||
|
Cчетчик для страницы
|
||||||
|
|
||||||
Записывает данные посещений на страницу
|
Записывает данные посещений на страницу
|
||||||
|
|
||||||
@@ -56,3 +59,6 @@ accountStore - информация о пользователе из DictEmploye
|
|||||||
appStore - данные о посещенных страницах
|
appStore - данные о посещенных страницах
|
||||||
|
|
||||||
postdata - объект для записи информации о странице из бд по умолчанию данные подгружаются из router и пользователе из стора
|
postdata - объект для записи информации о странице из бд по умолчанию данные подгружаются из router и пользователе из стора
|
||||||
|
|
||||||
|
#### getDevelopment
|
||||||
|
Возвращает true если в разработке and false если на сервере запускается
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import listUser from '@/components/UI/fiousercard/listUser.vue';
|
|
||||||
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
import { baseURL, axiosApiInstance } from '@/utils/axios-api'
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user