Skip to content

Commit

Permalink
#48 show series in project
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcellino-Palerme committed Jun 24, 2024
1 parent 27a1d41 commit 9691058
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
48 changes: 38 additions & 10 deletions components/ExtractInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const loading = ref<number>(0);
const stateConfBox = ref<string>("");
const openConfBox = ref<boolean>(false);

const rfAllSeries = ref<{id:string, name:string}[]>([]);

// Define struct of table of file
// 3 columns (name, type, size in KB, delete actions)
const tabFilesStruct = [{
Expand Down Expand Up @@ -97,15 +99,17 @@ const currentProject = reactive<tProject>({
name: "",
createDate: "",
nbFile: 0,
files: [] as tFile[]
files: [] as tFile[],
series: []
});
// old version of consulted project
const oldProject = reactive<tProject>({
id: "",
name: "",
createDate: "",
nbFile: 0,
files: [] as tFile[]
files: [] as tFile[],
series: []
});
// Where new files of project save
let currentFolder: string = "";
Expand Down Expand Up @@ -133,14 +137,31 @@ const currentPage = ref<number>(1);
async function getProjects(page: number = 1): Promise<{
projects: tProject[], count: number
}> {
return await $fetch("/api/getProjects", {
return await $fetch("/api/manageControl/rows",{
method: "POST",
body: {
team: useCookie("team", { sameSite: "strict" }).value,
orderBy: sortProject.value.column,
sort: sortProject.value.direction,
page: page
body:{
nameTable: "series",
wheres:{1:1}
}
})
.then((rowsSeries)=>{
// return id and name of series
let series = [];
for (const row of rowsSeries){
series.push({id: row.id, name: row.name});
}
rfAllSeries.value = series;
})
.then(() =>{
return $fetch("/api/getProjects", {
method: "POST",
body: {
team: useCookie("team", { sameSite: "strict" }).value,
orderBy: sortProject.value.column,
sort: sortProject.value.direction,
page: page
}
})
});
}

Expand Down Expand Up @@ -199,7 +220,7 @@ const containProject = [{
label: "label.files",
icon: "i-heroicons-document-duplicate"
}, {
label: "label.templateOperation",
label: "label.Series",
icon: "i-heroicons-variable"
}
]
Expand Down Expand Up @@ -540,6 +561,7 @@ async function deleteProject(id:string, name:string){
}]});
})
}

</script>

<template>
Expand Down Expand Up @@ -698,7 +720,13 @@ async function deleteProject(id:string, name:string){
</template>
</v-data-table>
<div v-else>
<p>couxcou</p>
<v-select
v-model="currentProject.series"
:items="rfAllSeries"
item-title="name"
item-value="id"
label="t('label.selectSerie')"
/>
</div>
</template>
</UTabs>
Expand Down
1 change: 1 addition & 0 deletions plugins/file.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare global {
createDate:string,
nbFile:number,
files:tFile[],
series:{name:string,id:string}[],
// TODO: add operation post export
}
interface tCompound{
Expand Down

0 comments on commit 9691058

Please sign in to comment.