changes
This commit is contained in:
@@ -331,7 +331,12 @@ watch(
|
||||
/>
|
||||
|
||||
<!-- Import Mode Settings -->
|
||||
<ImportModeSettings :form="form" :entities="entities" />
|
||||
<ImportModeSettings
|
||||
:form="form"
|
||||
:entities="entities"
|
||||
:actions="props.actions"
|
||||
:decisions="props.decisions"
|
||||
/>
|
||||
|
||||
<!-- Unassigned Mappings -->
|
||||
<UnassignedMappings
|
||||
|
||||
@@ -160,7 +160,7 @@ function getEntityMappings(entity) {
|
||||
:key="m.id"
|
||||
class="p-3 border rounded-lg bg-muted/30"
|
||||
>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-5 gap-2 items-center">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-6 gap-2 items-center">
|
||||
<div class="space-y-1">
|
||||
<Label class="text-xs">Izvor</Label>
|
||||
<Input v-model="m.source_column" class="text-sm" />
|
||||
@@ -196,6 +196,18 @@ function getEntityMappings(entity) {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<Label class="text-xs">Group</Label>
|
||||
<Input
|
||||
:value="m.options?.group ?? ''"
|
||||
@input="e => {
|
||||
if (!m.options) m.options = {};
|
||||
m.options.group = e.target.value || null;
|
||||
}"
|
||||
class="text-sm"
|
||||
placeholder="1, 2, ..."
|
||||
/>
|
||||
</div>
|
||||
<div class="flex items-end gap-2">
|
||||
<div class="flex flex-col gap-1">
|
||||
<Button
|
||||
@@ -233,7 +245,7 @@ function getEntityMappings(entity) {
|
||||
<div class="p-3 bg-muted/50 rounded-lg border">
|
||||
<div class="space-y-3">
|
||||
<div class="text-sm font-medium">Dodaj novo preslikavo</div>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-4 gap-3">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-5 gap-3">
|
||||
<div class="space-y-2">
|
||||
<Label class="text-xs">Izvorno polje</Label>
|
||||
<Input
|
||||
@@ -289,6 +301,13 @@ function getEntityMappings(entity) {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<Label class="text-xs">Group</Label>
|
||||
<Input
|
||||
v-model="(newRows[entity] ||= {}).group"
|
||||
placeholder="1, 2, ..."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Button @click="addRow(entity)" size="sm">Dodaj preslikavo</Button>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/Components/ui/card";
|
||||
import { Label } from "@/Components/ui/label";
|
||||
import { Checkbox } from "@/Components/ui/checkbox";
|
||||
@@ -8,6 +9,17 @@ import { Badge } from "@/Components/ui/badge";
|
||||
const props = defineProps({
|
||||
form: { type: Object, required: true },
|
||||
entities: { type: Array, default: () => [] },
|
||||
actions: { type: Array, default: () => [] },
|
||||
decisions: { type: Array, default: () => [] },
|
||||
});
|
||||
|
||||
const hasActivities = computed(() => {
|
||||
return Array.isArray(props.entities) && props.entities.includes('activities');
|
||||
});
|
||||
|
||||
const decisionsForActivitiesAction = computed(() => {
|
||||
const act = (props.actions || []).find((a) => a.id === props.form.meta.activity_action_id);
|
||||
return act?.decisions || [];
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -68,6 +80,47 @@ const props = defineProps({
|
||||
<Badge variant="secondary" class="bg-emerald-100 text-emerald-800">Plačila</Badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Activities Settings -->
|
||||
<div v-if="hasActivities" class="space-y-4 pt-4 border-t">
|
||||
<div class="text-sm font-medium">Nastavitve aktivnosti</div>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div class="space-y-2">
|
||||
<Label for="activity_action">Dejanje za aktivnosti</Label>
|
||||
<Select v-model="form.meta.activity_action_id">
|
||||
<SelectTrigger id="activity_action">
|
||||
<SelectValue placeholder="Izberi dejanje" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem :value="null">(brez)</SelectItem>
|
||||
<SelectItem v-for="a in actions || []" :key="a.id" :value="a.id">
|
||||
{{ a.name }}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<Label for="activity_decision">Odločitev za aktivnosti</Label>
|
||||
<Select v-model="form.meta.activity_decision_id" :disabled="!form.meta.activity_action_id">
|
||||
<SelectTrigger id="activity_decision">
|
||||
<SelectValue placeholder="Izberi odločitev" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem :value="null">(brez)</SelectItem>
|
||||
<SelectItem v-for="d in decisionsForActivitiesAction" :key="d.id" :value="d.id">
|
||||
{{ d.name }}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p v-if="!form.meta.activity_action_id" class="text-xs text-muted-foreground">
|
||||
Najprej izberi dejanje, nato odločitev.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
Te nastavitve se uporabljajo za aktivnosti, ki so uvožene iz CSV (npr. opombe, zgodovinske aktivnosti).
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user