В Dajngo rest добавлена возможность получать структуру МИ ФНС по ЦОД, в frontend создан предварительный шаблон

This commit is contained in:
Andrei Filippov committed 2024-04-12 15:48:42 +03:00
1 parent 0ac19fe330
commit ec5b456d30
8 files changed
+191 -287

No files matched your search

@@ -1,58 +1,63 @@
<template>
<v-row class="d-flex justify-center align-center h-100">
<v-col lg="5">
<v-card :width="640" :height="630" :elevation="5">
<div style="width:640px;height:630px; ">
<l-map :zoom="13" :min-zoom="13" :center="[55.83451, 37.40848]">
<l-tile-layer :url="`${baseURL}media/Tiles/{z}/{x}/{y}.png`"></l-tile-layer>
<l-marker :lat-lng="[55.83451, 37.40848]" :icon="icon_cod"> </l-marker>
<l-marker :lat-lng="[55.83309, 37.39933]" :icon="icon_mcd"> </l-marker>
<l-marker :lat-lng="[55.83463, 37.38335]" :icon="icon_metro"> </l-marker>
<l-marker :lat-lng="[55.83213, 37.38247]" :icon="icon_mcd"> </l-marker>
<l-marker :lat-lng="[55.82741, 37.43715]" :icon="icon_metro"> </l-marker>
<l-marker :lat-lng="[55.82705, 37.4411]" :icon="icon_mcd"> </l-marker>
<l-marker :lat-lng="[55.8496, 37.43925]" :icon="icon_metro"> </l-marker>
<l-marker :lat-lng="[55.8252, 37.3853]" :icon="icon_metro"> </l-marker>
<v-row class="ma-1">
<v-col lg="6" class="d-flex justify-center align-start">
<v-card :elevation="5">
<div style="width:915px;height:823px; ">
<l-map :zoom="13" :min-zoom="13" :center="markers[0].coordinate">
<l-tile-layer :url="`${baseURL}media/Tiles/{z}/{x}/{y}.png`" />
<l-marker v-for="marker in markers" :key="marker" :lat-lng="marker.coordinate"
:icon="icon(marker.icon)" />
</l-map>
</div>
</v-card>
</v-col>
<v-col lg="6" class="d-flex flex-column justify-around h-75">
<v-row class="d-flex align-start">
<v-card :elevation="5" class="w-100 h-75">
<v-card-title class="text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
Способ проезда
</v-card-title>
<v-card-text>
<v-list>
<v-list-item class="text-subtitle-2" v-for="(address_path, i) in address_pathes" :key="i">
{{ address_path.path }}
</v-list-item>
</v-list>
</v-card-text>
</v-card>
</v-row>
<v-col lg="6" class="d-flex flex-column gap">
<v-row>
<v-card :elevation="5" class="w-100">
<v-card-title class="text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
Адрес
</v-card-title>
<v-card-text class="text-h6 d-flex justify-center align-center pa-3">
{{ address.building }}
</v-card-text>
<v-card-text class="text-h6 d-flex justify-center align-center pa-3">
<p>{{ address.phone }}</p>
</v-card-text>
</v-card>
</v-row>
<v-card :elevation="5">
<v-card-title class="text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
Способ проезда
</v-card-title>
<v-card-text class="text-subtitle-1">
<v-list>
<v-list-item v-for="address_path in address_pathes">
{{ address_path.path }}
</v-list-item>
</v-list>
</v-card-text>
</v-card>
<v-card :elevation="5" class="h-50">
<v-card-title class="d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
Адрес
</v-card-title>
<v-card-text class="text-h6 d-flex justify-center align-end pa-4">
{{ address.building }}
</v-card-text>
<v-card-text class="text-h6 d-flex justify-center align-center">
<p>{{ address.phone }}</p>
</v-card-text>
<v-card-title class=" d-flex justify-center">
Время работы
</v-card-title>
<v-card-text class="text-subtitle-1">
<v-list>
<v-list-item v-for="work_time in work_times">
<v-row class="d-flex justify-center">
<v-col lg="4">{{ work_time.day }}</v-col>
<v-col lg="3">{{ work_time.time }}</v-col>
</v-row>
</v-list-item>
</v-list>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>
<script>
import { ref } from 'vue'
import { baseURL } from '@/utils/axios-api'
import "leaflet/dist/leaflet.css";
import { LMap, LTileLayer, LMarker } from "@vue-leaflet/vue-leaflet";
@@ -67,45 +72,67 @@ export default {
icon
},
setup() {
return {
icon_cod: icon({
iconUrl: `${baseURL}media/map_icons/fns.png`,
const pathbuild = (icon) => {
return `${baseURL}media/map_icons/${icon}.png`
}
const icons = {
icon_cod: {
iconUrl: pathbuild(`fns`),
iconSize: [30, 30],
iconAnchor: [16, 40]
}),
icon_mcd: icon({
iconUrl: `${baseURL}media/map_icons/mcd_d2.png`,
iconSize: [32, 18],
iconAnchor: [10, 20]
}),
icon_metro: icon({
iconUrl: `${baseURL}media/map_icons/mos_metro.png`,
},
icon_metro: {
iconUrl: pathbuild(`mos_metro`),
iconSize: [30, 25],
iconAnchor: [10, 20]
}),
},
icon_mcd: {
iconUrl: pathbuild(`mcd_d2`),
iconSize: [32, 18],
iconAnchor: [10, 20]
}
}
const markers = ref([
{ coordinate: [55.83451, 37.40848], icon: icons.icon_cod },
{ coordinate: [55.83309, 37.39933], icon: icons.icon_mcd },
{ coordinate: [55.83463, 37.38335], icon: icons.icon_metro },
{ coordinate: [55.83213, 37.38247], icon: icons.icon_mcd },
{ coordinate: [55.82741, 37.43715], icon: icons.icon_metro },
{ coordinate: [55.82705, 37.4411], icon: icons.icon_mcd },
{ coordinate: [55.8496, 37.43925], icon: icons.icon_metro },
{ coordinate: [55.8252, 37.3853], icon: icons.icon_metro }
])
return {
icons,
markers,
icon,
address: {
"building": "125373, Москва, Походный проезд, двл.3, стр 1",
"phone": "Телефон: 8(495) 198-53-12"
},
address_pathes: [
{ "path": "От станции метро «Волоколамская», 837 автобусом до остановки «Таксомоторный парк», или маршрутным такси № 441" },
{ "path": "От станции метро «Сходненская», 1-й вагон из центра, маршрутное такси № 368, последний вагон из центра, автобусы № 678, № 199" },
{ "path": "От станции метро «Тушинская», последний вагон из центра, автобусы № 2, № 266 до остановки «пл. Трикотажная», автобусы № 88, №177 до остановки «17 Таксомоторный парк»" }
{ "path": "От станции метро «Волоколамская», автобус 368, до остановки \"Налоговый городок\"" },
{ "path": "От платформы МЦД «Волоколамская» проехать одну остановку до платформы МЦД «Трикотажная», далее на автобусе 368 до остановки \"Налоговый городок\" или пешком (10 минут) до территории Налоговго городка" },
{ "path": "От станции МЦД «Трикотажная», далее на автобусе 368, до остановки \"Налоговый городок\" или пешком (10 минут) до территории Налоговго городка" },
{ "path": "От станции метро «Сходненская», 1-й вагон из центра, далее на автобусе № 368" },
{ "path": "От станции метро «Тушинская», последний вагон из центра, автобусы № 400, № 741, 741к, 856, 436, 575 до остановки «пл. Трикотажная» или от станции МЦД «Тушинская» проехать одну остановку до станции МЦД «Трикотажная» на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка" },
{ "path": "От станции МЦД «Трикотажная» на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка" },
],
work_times: [
{ "day": "Понедельник-Четверг", "time": "09:00 - 18:00" },
{ "day": "Пятница", "time": "09:00 - 16:45" },
{ "day": "Суббота-Воскресенье", "time": "не работает" },
],
baseURL,
lmarkers: [
{ "latitude": [55.83451, 37.40848], "icon": "icon_cod" },
{ "latitude": [55.83309, 37.39933], "icon": "icon_mcd" },
{ "latitude": [55.83463, 37.38335], "icon": "icon_metro" },
{ "latitude": [55.83213, 37.38247], "icon": "icon_mcd" },
{ "latitude": [55.82741, 37.43715], "icon": "icon_metro" },
{ "latitude": [55.82705, 37.4411], "icon": "icon_mcd" },
{ "latitude": [55.8496, 37.43925], "icon": "icon_metro" },
{ "latitude": [55.8252, 37.3853], "icon": "icon_metro" },
]
}
}
@@ -1,21 +0,0 @@
<template>
<v-card :elevation="3" :width="width" :height="height">
<v-card-text class="nodrag nopan d-flex justify-center align-center
text-h6
bg-teal-lighten-5 text-center text-teal-darken-4 h-50 pa-3">
<p class="pa-5">{{ label }}</p>
</v-card-text>
<v-card-text class=" text-center text-h6 d-flex justify-center align-center pa-3">
<p>{{ data }}</p>
</v-card-text>
</v-card>
</template>
<script setup>
import { Position, Handle } from '@vue-flow/core'
import "@vue-flow/core/dist/style.css"
// props were passed from the slot using `v-bind="customNodeProps"`
const props = defineProps(['label', 'data', 'width', 'height'])
</script>
@@ -1,206 +1,67 @@
<template>
<VueFlow :nodes="nodes" :edges="edges" :class="{ dark }" class="basicflow" :default-viewport="{ zoom: 1 }" :min-zoom="1"
:max-zoom="1" fit-view-on-init>
<template #node-boss="bossNodeProps">
<BossNode :width="500" :height="100" v-bind="bossNodeProps" />
</template>
<template #node-middleboss="bossNodeProps">
<BossNode :width="230" :height="170" v-bind="bossNodeProps" />
</template>
<template #node-deps="bossNodeProps">
<BossNode :width="250" :height="180" v-bind="bossNodeProps" />
</template>
<v-row class="ma-1">
<!-- Начальник и курируемые им отделы -->
<v-col lg="3">
<v-col v-for="x in 4" :key="x" lg="12" class="w-100">
<v-card class="pa-10"></v-card>
</v-col>
</v-col>
<!-- КОНЕЦ Начальник и курируемые им отделы -->
<Background bgColor="#ffff" />
<Controls position="top-right">
<ControlButton title="Reset Transform" @click="resetTransform">
</ControlButton>
</Controls>
</VueFlow>
<!-- Зам-1 и курируемые им отделы -->
<v-col lg="3">
<v-col v-for="x in 3" :key="x">
<v-card class="pa-10"></v-card>
</v-col>
</v-col>
<!-- КОНЕЦ Зам-1 и курируемые им отделы -->
<!-- Зам-2 и курируемые им отделы -->
<v-col lg="3">
<v-col v-for="x in 3" :key="x" lg="12" class="w-100">
<v-card class="pa-10"></v-card>
</v-col>
</v-col>
<!-- КОНЕЦ Зам-2 и курируемые им отделы -->
<!-- Зам-3 и курируемые им отделы -->
<v-col lg="3">
<v-col v-for="x in 3" :key="x" lg="12" class="w-100">
<v-card class="pa-10"></v-card>
</v-col>
</v-col>
<!-- КОНЕЦ Зам-3 и курируемые им отделы -->
</v-row>
</template>
<script>
import { ref } from 'vue'
import { VueFlow, useVueFlow, Position } from '@vue-flow/core'
import { ControlButton, Controls } from '@vue-flow/controls'
import { Background } from '@vue-flow/background'
import "@vue-flow/core/dist/style.css"
import "@vue-flow/core/dist/theme-default.css"
import BossNode from './BossNode.vue'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
components: {
VueFlow,
useVueFlow,
Position,
ControlButton,
Controls,
Background,
BossNode
},
setup() {
const dark = ref(false)
const structures = ref([])
const { onPaneReady, onConnect, addEdges, setViewport } = useVueFlow()
const getStructure = () => {
axiosApiInstance.get('api/about_inspection/getstructure/').then(res => {
structures.value = res.data
console.log(structures.value[0].deps)
})
function resetTransform() {
setViewport({ x: 0, y: 0, zoom: 1 })
}
onConnect((connection) => {
addEdges(connection)
})
onPaneReady(({ fitView }) => {
fitView()
})
resetTransform()
getStructure()
return {
dark,
nodes: ref([
{
id: '1',
type: 'boss',
label: 'Руководитель МИ ФНС России по ЦОД №2',
data: 'Борис Борисович Толоко ',
position: { x: 180, y: 50 },
sourcePosition: Position.Right,
targetPosition: Position.Bottom,
},
{
id: '2',
type: 'middleboss',
label: 'Заместитель начальника',
data: 'Андреева Наталья Владимировна',
position: { x: 140, y: 280 },
targetPosition: Position.Top,
},
{
id: '3',
type: 'middleboss',
label: 'Заместитель начальника',
data: 'Ахкубеков Мухамат Алиевич',
position: { x: 680, y: 280 },
sourcePosition: Position.Top,
},
{
id: '4',
type: 'middleboss',
label: 'Заместитель начальника',
data: 'Послухаев Артем Николаевич',
position: { x: 1220, y: 280 },
targetPosition: Position.Top,
},
{
id: '5',
type: 'middleboss',
label: 'Общий отдел',
data: ' Начальник Золина Татьяна Евгеньевна ',
position: { x: 792, y: 15 },
targetPosition: Position.Left,
sourcePosition: Position.Right,
},
{
id: '6',
type: 'middleboss',
label: 'Отдел кадров и безопасности',
data: 'Начальник Фролова Ирина Николаевна',
position: { x: 1030, y: 15 },
targetPosition: Position.Left,
sourcePosition: Position.Right,
},
{
id: '7',
type: 'middleboss',
label: 'Отдел управления качеством данных',
data: ' Начальник Гончаров Церен Викторович',
position: { x: 1268, y: 15 },
targetPosition: Position.Left,
sourcePosition: Position.Right,
},
{
id: '8',
type: 'deps',
label: 'Отдел по сопровождению интернет-сервисов',
data: ' Начальник Лосева Екатерина Владимировна',
position: { x: 1080, y: 500 },
targetPosition: Position.Top,
},
{
id: '9',
type: 'deps',
label: 'Отдел внедрения технологических процессов',
data: ' Начальник Туркова Мария Николаевна',
position: { x: 1340, y: 500 },
targetPosition: Position.Top,
},
{
id: '10',
type: 'deps',
label: 'Отдел контроля технологических процессов',
data: ' Начальник Михайлов Виктор Валентинович',
position: { x: 800, y: 500 },
targetPosition: Position.Top,
},
{
id: '11',
type: 'deps',
label: 'Отдел ведения ведомственной модели данных',
data: ' Начальник Щедрин Владимир Дмитриевич',
position: { x: 540, y: 500 },
targetPosition: Position.Top,
},
{
id: '12',
type: 'deps',
label: 'Отдел развития личного кабинеита налогоплательщика физического лица',
data: 'И.О.начальника Романова Марина Александровна',
position: { x: 0, y: 500 },
targetPosition: Position.Top,
},
{
id: '13',
type: 'deps',
label: 'Отдел обработки обращений граждан',
data: 'Начальник Ванюшкина Наталья Николаевна',
position: { x: 260, y: 500 },
targetPosition: Position.Top,
},
]),
edges: ref([
// { id: 'e1-5', type: 'step', source: '1', target: '5' },
// { id: 'e5-6', type: 'step', source: '5', target: '6' },
// { id: 'e6-7', type: 'step', source: '6', target: '7' },
// { id: 'e1-2', type: 'step', source: '1', target: '2' },
// { id: 'e1-3', type: 'step', source: '1', target: '3' },
//{ id: 'e1-4', type: 'step', source: '1', target: '4' },
// { id: 'e1-4', type: 'step', source: '1', target: '4' },
// { id: 'e1-5', type: 'step', source: '1', target: '5' },
// { id: 'e1-7', type: 'step', source: '1', target: '7' },
// { id: 'e4-9', source: '4', target: '8' },
// { id: 'e4-10', source: '4', target: '9' },
// { id: 'e3-11', source: '3', target: '10' },
// { id: 'e3-12', source: '3', target: '11' },
// { id: 'e2-13', source: '2', target: '12' },
// { id: 'e2-14', source: '2', target: '13' },
])
structures
}
}
}
}
</script>
<style></style>
+11 -11
View File
@@ -1,17 +1,17 @@
<template>
<v-row no-gutters class="flex-column h-100 gap pa-1">
<v-col class="w100 h-100 flex-grow-0">
<v-card>
<v-tabs v-model="tab" bg-color="teal-darken-1" slider-color="teal-lighten-3" selected-class="active-tab"
:grow="true">
<v-tab v-for="tabitem in tabs_items" :value="tabitem.value">{{ tabitem.title }}</v-tab>
</v-tabs>
</v-card>
</v-col>
<v-row no-gutters class="flex-column">
<v-card>
<v-tabs v-model="tab" bg-color="teal-darken-1" slider-color="teal-lighten-3" selected-class="active-tab"
:grow="true">
<v-tab v-for="tabitem in tabs_items" :value="tabitem.value">{{ tabitem.title }}</v-tab>
</v-tabs>
</v-card>
<v-col>
<v-window v-model="tab" class="h-100">
<v-window-item value="mainInfo">
<v-row no-gutters>
<v-row>
<v-col lg="3">
<v-card class="ml-2 mb-2 mt-1">
<v-card-text class="text-h6 text-center">
@@ -116,7 +116,7 @@
<v-window-item no-gutters class="gap h-100" value="openVacancies">
<h1>Открытые вакансии</h1>
</v-window-item>
<v-window-item no-gutters class="gap h-100" value="contactInfo">
<v-window-item class="gap h-100" value="contactInfo">
<contact-info />
</v-window-item>
</v-window>