bx-865-apps #1
|
@ -1,4 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import 'primeicons/primeicons.css'
|
||||||
|
|
||||||
const menu = [{
|
const menu = [{
|
||||||
label: 'Создать план помещения',
|
label: 'Создать план помещения',
|
||||||
to: '/plan'
|
to: '/plan'
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
"d3": "^7.9.0",
|
"d3": "^7.9.0",
|
||||||
"nuxt": "^3.11.2",
|
"nuxt": "^3.11.2",
|
||||||
"pathfinding": "^0.4.18",
|
"pathfinding": "^0.4.18",
|
||||||
|
"primeicons": "^7.0.0",
|
||||||
"vue": "^3.4.27",
|
"vue": "^3.4.27",
|
||||||
"vue-router": "^4.3.2"
|
"vue-router": "^4.3.2"
|
||||||
},
|
},
|
||||||
|
@ -9931,6 +9932,11 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"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": {
|
"node_modules/primevue": {
|
||||||
"version": "3.49.1",
|
"version": "3.49.1",
|
||||||
"resolved": "https://registry.npmjs.org/primevue/-/primevue-3.49.1.tgz",
|
"resolved": "https://registry.npmjs.org/primevue/-/primevue-3.49.1.tgz",
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
"d3": "^7.9.0",
|
"d3": "^7.9.0",
|
||||||
"nuxt": "^3.11.2",
|
"nuxt": "^3.11.2",
|
||||||
"pathfinding": "^0.4.18",
|
"pathfinding": "^0.4.18",
|
||||||
|
"primeicons": "^7.0.0",
|
||||||
"vue": "^3.4.27",
|
"vue": "^3.4.27",
|
||||||
"vue-router": "^4.3.2"
|
"vue-router": "^4.3.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -112,22 +112,22 @@ watch(grid_redraw, () => {
|
||||||
loading.value = grid_redraw.value
|
loading.value = grid_redraw.value
|
||||||
})
|
})
|
||||||
watch(active_point, () => {
|
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')
|
const t_index = target_array.value.findIndex(el => el.type == target_type.value)
|
||||||
if (t_index !== -1) target_array.value.splice(t_index, 1)
|
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')
|
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)
|
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_array.value.push(t)
|
||||||
target_points.value.push(t_state)
|
target_points.value.push(t_state)
|
||||||
}
|
|
||||||
|
target_type.value = ''
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -177,14 +177,17 @@ watch(active_point, () => {
|
||||||
<Panel header="Данные о помещениях">
|
<Panel header="Данные о помещениях">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<Button @click="addTargetType('start')">{{ !target_array.filter(el => el.type == 'start').length ?
|
<Button @click="addTargetType('start')" :icon="target_type == 'start' ? 'pi pi-bullseye' : ''"
|
||||||
`Добавить` : 'Изменить' }}
|
:label="`${!target_array.filter(el => el.type == 'start').length ?
|
||||||
точку старта</Button>
|
`Добавить` : 'Изменить'} точку старта`"></Button>
|
||||||
<Button @click="addTargetType('cabinet')">Добавить точку входа в кабинет</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>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<span v-if="active_point">
|
<span v-if="active_point">
|
||||||
{{ active_point }}
|
active point {{ active_point }}
|
||||||
</span>
|
</span>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="item in target_array">
|
<li v-for="item in target_array">
|
||||||
|
|
Loading…
Reference in New Issue