bx-865-apps #1

Merged
ksenia_mikhailova merged 140 commits from bx-865-apps into main 2024-06-27 15:03:27 +03:00
4 changed files with 28 additions and 16 deletions
Showing only changes of commit dae9790ff5 - Show all commits

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import 'primeicons/primeicons.css'
const menu = [{
label: 'Создать план помещения',
to: '/plan'

View File

@ -12,6 +12,7 @@
"d3": "^7.9.0",
"nuxt": "^3.11.2",
"pathfinding": "^0.4.18",
"primeicons": "^7.0.0",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
},
@ -9931,6 +9932,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/primeicons": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/primeicons/-/primeicons-7.0.0.tgz",
"integrity": "sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw=="
},
"node_modules/primevue": {
"version": "3.49.1",
"resolved": "https://registry.npmjs.org/primevue/-/primevue-3.49.1.tgz",

View File

@ -15,6 +15,7 @@
"d3": "^7.9.0",
"nuxt": "^3.11.2",
"pathfinding": "^0.4.18",
"primeicons": "^7.0.0",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
},

View File

@ -112,22 +112,22 @@ watch(grid_redraw, () => {
loading.value = grid_redraw.value
})
watch(active_point, () => {
if (target_type.value === 'start') {
if (!active_point.value) return
if (!active_point.value) return
const t_index = target_array.value.findIndex(el => el.type == 'start')
if (t_index !== -1) target_array.value.splice(t_index, 1)
const t_index = target_array.value.findIndex(el => el.type == target_type.value)
if (t_index !== -1) target_array.value.splice(t_index, 1)
const t = ({ type: 'start', title: 'home', points: active_point.value })
const t = ({ type: target_type.value, title: 'home', points: active_point.value })
const t_state_index = target_points.value.findIndex(el => el.type == 'start')
if (t_state_index !== -1) target_points.value.splice(t_state_index, 1)
const t_state_index = target_points.value.findIndex(el => el.type == target_type.value)
if (t_state_index !== -1) target_points.value.splice(t_state_index, 1)
const t_state = ({ type: 'start', x: active_point.value.x, y: active_point.value.y })
const t_state = ({ type: target_type.value, x: active_point.value.x, y: active_point.value.y })
target_array.value.push(t)
target_points.value.push(t_state)
}
target_array.value.push(t)
target_points.value.push(t_state)
target_type.value = ''
})
</script>
<template>
@ -177,14 +177,17 @@ watch(active_point, () => {
<Panel header="Данные о помещениях">
<div class="flex gap-2">
<div class="flex flex-col gap-2">
<Button @click="addTargetType('start')">{{ !target_array.filter(el => el.type == 'start').length ?
`Добавить` : 'Изменить' }}
точку старта</Button>
<Button @click="addTargetType('cabinet')">Добавить точку входа в кабинет</Button>
<Button @click="addTargetType('start')" :icon="target_type == 'start' ? 'pi pi-bullseye' : ''"
:label="`${!target_array.filter(el => el.type == 'start').length ?
`Добавить` : 'Изменить'} точку старта`"></Button>
<Button
@click="addTargetType('cabinet' + (target_array.filter(el => el.type.indexOf('cabinet') !== -1).length + 1))"
:icon="target_type.indexOf('cabinet') !== -1 ? 'pi pi-bullseye' : ''"
label="Добавить точку входа в кабинет"></Button>
</div>
<div class="flex flex-col">
<span v-if="active_point">
{{ active_point }}
active point {{ active_point }}
</span>
<ul>
<li v-for="item in target_array">