Task Status changes, needs some TLC.

This commit is contained in:
rocketdebris 2026-01-14 15:14:34 -05:00
parent 0c52f3fc23
commit 01ff96fb74
3 changed files with 104 additions and 9 deletions

View file

@ -37,7 +37,15 @@ const tableData = ref([]);
const totalRecords = ref(0);
const isLoading = ref(false);
const showCompleted = ref(false);
const statusOptions = ref([]);
const statusOptions = ref([
"Open",
"Working",
"Pending",
"Review",
"Overdue",
"Completed",
"Cancelled",
]);
// Computed property to get current filters for the chart
const currentFilters = computed(() => {
@ -76,15 +84,27 @@ const tableActions = [
},
{
label: "Set Status",
action: (rowData, newValue) => {
console.log("DEBUG: Row Data:", rowData);
console.log("DEBUG: New Value:", newValue);
},
rowAction: true,
type: "menu",
menuItems: statusOptions.value.map(option => ({
label: option,
command: async (rowData) => {
console.log("Clicked on row:", rowData);
await Api.setTaskStatus(rowData.id, option);
let rowIndex = -1;
for (let i = 0; i<tableData.value.length(); i++) {
if (row.id == tableData.value[i].id) {
rowIndex = i;
}
}
if (rowIndex >= 0) {
tableData.value[rowIndex].status = option;
}
},
})),
layout: {
priority: "select"
priority: "menu"
},
statusOptions: statusOptions.value
},
];