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:
@@ -45,6 +45,13 @@
|
||||
<label>Заметки</label>
|
||||
<textarea v-model="form.notes" class="form-control" placeholder="Дополнительная информация..." rows="3"></textarea>
|
||||
</div>
|
||||
<RelationLinkFields
|
||||
v-if="showRelationLink"
|
||||
ref="relationLinkRef"
|
||||
:options="linkToOptions"
|
||||
:initial-target-id="initialLinkToId"
|
||||
:conflict-mode="conflictMode"
|
||||
/>
|
||||
<component
|
||||
:is="Ext"
|
||||
v-for="(Ext, index) in contactFormExtensions"
|
||||
@@ -74,17 +81,23 @@ import { reactive, ref, watch, computed, onMounted } from 'vue'
|
||||
import { useNetworkMapsStore } from '../stores/networkMaps'
|
||||
import { listMembershipsByContact } from '../application/usecases/networkMaps'
|
||||
import { getContactFormExtensions } from '../core/pluginRegistry'
|
||||
import RelationLinkFields from './RelationLinkFields.vue'
|
||||
|
||||
const props = defineProps({
|
||||
initial: { type: Object, default: () => ({}) },
|
||||
initialMapIds: { type: Array, default: null },
|
||||
deletable: { type: Boolean, default: false },
|
||||
showRelationLink: { type: Boolean, default: false },
|
||||
linkToOptions: { type: Array, default: () => [] },
|
||||
initialLinkToId: { type: [String, Number], default: '' },
|
||||
conflictMode: { type: Boolean, default: false },
|
||||
})
|
||||
const emit = defineEmits(['submit', 'cancel', 'delete'])
|
||||
|
||||
const mapsStore = useNetworkMapsStore()
|
||||
const contactFormExtensions = getContactFormExtensions()
|
||||
const pluginTags = ref([])
|
||||
const relationLinkRef = ref(null)
|
||||
|
||||
const showDelete = computed(() => {
|
||||
if (props.deletable) return true
|
||||
@@ -150,7 +163,10 @@ onMounted(async () => {
|
||||
|
||||
function onSubmit() {
|
||||
const { mapIds, ...contactData } = form
|
||||
emit('submit', contactData, mapIds, { tags: [...pluginTags.value] })
|
||||
const relationLink = props.showRelationLink
|
||||
? relationLinkRef.value?.getRelationLink?.() ?? null
|
||||
: null
|
||||
emit('submit', contactData, mapIds, { tags: [...pluginTags.value] }, relationLink)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user