Improve graph/map UX and move contact editing to dedicated pages.
Add viewport controls, collapsible panels with persisted state, filters modal, and refined context menus; preserve map layout on navigation and let contacts be edited with relations on /contacts/:id instead of list modals. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,8 +14,15 @@
|
||||
@click.stop
|
||||
@contextmenu.prevent
|
||||
>
|
||||
<button type="button" class="graph-node-menu__item" role="menuitem" @click="onCreateContact">
|
||||
Добавить контакт
|
||||
<button
|
||||
v-for="item in actions"
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="graph-node-menu__item"
|
||||
role="menuitem"
|
||||
@click="onSelect(item.id)"
|
||||
>
|
||||
{{ item.label }}
|
||||
</button>
|
||||
</div>
|
||||
</Teleport>
|
||||
@@ -28,16 +35,21 @@ const props = defineProps({
|
||||
open: { type: Boolean, default: false },
|
||||
x: { type: Number, default: 0 },
|
||||
y: { type: Number, default: 0 },
|
||||
actions: {
|
||||
type: Array,
|
||||
default: () => [{ id: 'create-contact', label: 'Добавить контакт' }],
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['close', 'create-contact'])
|
||||
const emit = defineEmits(['close', 'create-contact', 'select'])
|
||||
|
||||
function close() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function onCreateContact() {
|
||||
emit('create-contact')
|
||||
function onSelect(id) {
|
||||
emit('select', id)
|
||||
if (id === 'create-contact') emit('create-contact')
|
||||
close()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user