pridana API metoda getallgrouped,
implementovane nacitanie dat do Dashboard z backend
This commit is contained in:
@ -73,4 +73,8 @@ export const backend = {
|
||||
return this.callPromise('getall', {});
|
||||
},
|
||||
|
||||
getAllGrouped(status) {
|
||||
return this.callPromise('getallgrouped', {});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<h2>Nezaradené</h2>
|
||||
<draggable
|
||||
v-model="itemsUncategorized"
|
||||
item-key="id"
|
||||
item-key="report_id"
|
||||
:group="{ name: 'itemsUncategorized', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -18,9 +18,9 @@
|
||||
}"
|
||||
>
|
||||
<Report
|
||||
:title="element.title"
|
||||
:description="element.description"
|
||||
:date="element.date"
|
||||
:title="element.report_title"
|
||||
:description="element.report_description"
|
||||
:date="element.created_dt"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -30,7 +30,7 @@
|
||||
<h2>Čakajúce</h2>
|
||||
<draggable
|
||||
v-model="itemsWaiting"
|
||||
item-key="id"
|
||||
item-key="report_id"
|
||||
:group="{ name: 'itemsWaiting', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -44,9 +44,9 @@
|
||||
}"
|
||||
>
|
||||
<Report
|
||||
:title="element.title"
|
||||
:description="element.description"
|
||||
:date="element.date"
|
||||
:title="element.report_title"
|
||||
:description="element.report_description"
|
||||
:date="element.created_dt"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -56,7 +56,7 @@
|
||||
<h2>Rozpracované</h2>
|
||||
<draggable
|
||||
v-model="itemsInProgress"
|
||||
item-key="id"
|
||||
item-key="report_id"
|
||||
:group="{ name: 'itemsInProgress', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -70,9 +70,9 @@
|
||||
}"
|
||||
>
|
||||
<Report
|
||||
:title="element.title"
|
||||
:description="element.description"
|
||||
:date="element.date"
|
||||
:title="element.report_title"
|
||||
:description="element.report_description"
|
||||
:date="element.created_dt"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -82,7 +82,7 @@
|
||||
<h2>Hotové</h2>
|
||||
<draggable
|
||||
v-model="itemsDone"
|
||||
item-key="id"
|
||||
item-key="report_id"
|
||||
:group="{ name: 'itemsDone', pull: true, put: true }"
|
||||
@change="onDragChange"
|
||||
@start="onDragStart"
|
||||
@ -96,9 +96,9 @@
|
||||
}"
|
||||
>
|
||||
<Report
|
||||
:title="element.title"
|
||||
:description="element.description"
|
||||
:date="element.date"
|
||||
:title="element.report_title"
|
||||
:description="element.report_description"
|
||||
:date="element.created_dt"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -120,13 +120,14 @@ function onDragEnd(evt) {
|
||||
itemDragable.value = 0;
|
||||
}
|
||||
function isDragable(element) {
|
||||
return itemDragable.value === element.id;
|
||||
return itemDragable.value === element.report_id;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import Report from "../components/Report.vue";
|
||||
import draggable from "vuedraggable";
|
||||
import { backend } from "../backend";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -135,67 +136,21 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemsUncategorized: [
|
||||
{
|
||||
id: 1,
|
||||
title: "Pridať bug",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "Resetovat pismo",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
],
|
||||
itemsWaiting: [
|
||||
{
|
||||
id: 11,
|
||||
title: "Vymena obrazkov za ikonky",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
title:
|
||||
"Doplnit serverove ikoky a toto bude dlhy nadpis, ze ako sa s tym vysporiada",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
title: "Rozdelit na 2 polozky na fakture",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
],
|
||||
itemsInProgress: [
|
||||
{
|
||||
id: 21,
|
||||
title: "Imeplemtovat logovanie",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 15:11:23",
|
||||
},
|
||||
],
|
||||
itemsDone: [
|
||||
{
|
||||
id: 31,
|
||||
title: "Doplnit preklady",
|
||||
description:
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa eros, porta id, vestibulum sit amet, malesuada in, sapien. Donec nec justo eget felis facilisis fermentum.",
|
||||
date: "2025-04-13 01:30:18",
|
||||
},
|
||||
],
|
||||
itemsUncategorized: [],
|
||||
itemsWaiting: [],
|
||||
itemsInProgress: [],
|
||||
itemsDone: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
backend.getAllGrouped(Array(0,1,2,3)).then((all_grouped) => {
|
||||
this.itemsUncategorized = all_grouped[0];
|
||||
this.itemsWaiting = all_grouped[1];
|
||||
this.itemsInProgress = all_grouped[2];
|
||||
this.itemsDone = all_grouped[3];
|
||||
})
|
||||
},
|
||||
onDragChange(event) {
|
||||
// console.log("Presunuté:", event);
|
||||
// Napr. uložiť poradie do API
|
||||
@ -225,5 +180,8 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.loadData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user