Add conflictology map mode and fix graph rendering reliability.
Support conflict types, involvement sizing, and map-type toggles while keeping polar sector layout; improve GraphView init retries and edge matching on network maps. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,10 +14,22 @@
|
||||
<label>Тип карты *</label>
|
||||
<select v-model="form.mapTypeId" class="form-control" required>
|
||||
<option v-for="type in mapTypes" :key="type.id" :value="String(type.id)">
|
||||
{{ type.name }}{{ type.isDefault ? ' (по умолчанию)' : '' }}
|
||||
{{ type.name }}{{ type.isDefault ? ' (по умолчанию)' : '' }}{{ type.conflictologyEnabled ? ' · конфликтология' : '' }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div v-if="selectedMapType?.conflictologyEnabled" class="form-group">
|
||||
<label>Предмет / инцидент конфликта (в центре карты) *</label>
|
||||
<input
|
||||
v-model="form.conflictSubject"
|
||||
class="form-control"
|
||||
required
|
||||
placeholder="Например: Спор о зоне ответственности"
|
||||
/>
|
||||
<p class="text-muted field-hint">
|
||||
Секторы и круги задаются в типе карты; здесь — только название конфликта в центре.
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Описание</label>
|
||||
<textarea
|
||||
@@ -64,8 +76,13 @@ const form = reactive({
|
||||
name: '',
|
||||
description: '',
|
||||
mapTypeId: '',
|
||||
conflictSubject: '',
|
||||
})
|
||||
|
||||
const selectedMapType = computed(() =>
|
||||
props.mapTypes.find((t) => String(t.id) === String(form.mapTypeId)) || null
|
||||
)
|
||||
|
||||
watch(
|
||||
() => [props.open, props.initial, props.defaultMapTypeId, props.mapTypes],
|
||||
() => {
|
||||
@@ -75,15 +92,33 @@ watch(
|
||||
form.mapTypeId = String(
|
||||
props.initial?.mapTypeId || props.defaultMapTypeId || props.mapTypes[0]?.id || ''
|
||||
)
|
||||
form.conflictSubject = props.initial?.conflictSubject
|
||||
|| props.initial?.conflict_subject
|
||||
|| ''
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => [form.mapTypeId, form.name, selectedMapType.value?.conflictologyEnabled],
|
||||
() => {
|
||||
if (!selectedMapType.value?.conflictologyEnabled) {
|
||||
form.conflictSubject = ''
|
||||
return
|
||||
}
|
||||
if (!form.conflictSubject.trim() && form.name.trim()) {
|
||||
form.conflictSubject = form.name.trim()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
function onSubmit() {
|
||||
const conflictType = selectedMapType.value?.conflictologyEnabled
|
||||
emit('submit', {
|
||||
name: form.name.trim(),
|
||||
description: form.description.trim(),
|
||||
mapTypeId: form.mapTypeId,
|
||||
conflictSubject: conflictType ? form.conflictSubject.trim() : '',
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -101,4 +136,9 @@ function onSubmit() {
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
}
|
||||
.field-hint {
|
||||
margin: 6px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user