changes 0129092025 laptop

This commit is contained in:
2025-09-29 17:35:54 +02:00
parent 30eee6c5b0
commit 1fddf959f0
7 changed files with 277 additions and 4 deletions
@@ -16,6 +16,12 @@ const form = useForm({
default_record_type: props.template.default_record_type || '',
is_active: props.template.is_active,
client_uuid: props.template.client_uuid || null,
sample_headers: props.template.sample_headers || [],
// Add meta with default delimiter support
meta: {
...(props.template.meta || {}),
delimiter: (props.template.meta && props.template.meta.delimiter) || '',
},
});
const entities = computed(() => (props.template.meta?.entities || []));
@@ -136,6 +142,10 @@ const save = () => {
// drop client change when blocked
delete payload.client_uuid;
}
// Normalize empty delimiter: remove from meta to allow auto-detect
if (payload.meta && typeof payload.meta.delimiter === 'string' && payload.meta.delimiter.trim() === '') {
delete payload.meta.delimiter;
}
useForm(payload).put(route('importTemplates.update', { template: props.template.uuid }), { preserveScroll: true });
};
// Non-blocking confirm modal state for delete
@@ -201,6 +211,18 @@ function performDelete() {
/>
<p v-if="!canChangeClient" class="text-xs text-amber-600 mt-1">Ni mogoče spremeniti naročnika, ker ta predloga že vsebuje preslikave.</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Privzeti ločilni znak (CSV)</label>
<select v-model="form.meta.delimiter" class="mt-1 block w-full border rounded p-2">
<option value="">(Auto-detect)</option>
<option value=",">Comma ,</option>
<option value=";">Semicolon ;</option>
<option value="\t">Tab \t</option>
<option value="|">Pipe |</option>
<option value=" ">Space </option>
</select>
<p class="text-xs text-gray-500 mt-1">Pusti prazno za samodejno zaznavo. Uporabi, ko zaznavanje ne deluje pravilno.</p>
</div>
<div class="flex items-center gap-2">
<input id="is_active" v-model="form.is_active" type="checkbox" class="rounded" />
<label for="is_active" class="text-sm font-medium text-gray-700">Aktivna</label>