ดาวโหลดไฟล์

This commit is contained in:
setthawutttty 2025-04-04 17:55:13 +07:00
parent 39b14d7026
commit 6bf655220a
2 changed files with 27 additions and 3 deletions

View file

@ -37,6 +37,7 @@ const {
const myForm = ref<QForm | null>(null);
/** ตัวแปร */
const linkFile = ref<string>("");
const modal = ref<boolean>(false);
const retireld_params = route.params.retirementId;
const retireld = ref<string>(retireld_params.toString());
@ -166,6 +167,7 @@ async function fetchlistprofile(id: string) {
typeReport.value = data.typeReport;
textReport.value = data.detail;
employeeType.value = data.type;
linkFile.value = data.file;
//
if (data.profile !== null) {
@ -433,8 +435,13 @@ async function onSearch() {
);
}
function downloadFile(path: string) {
window.open(path);
}
/** Hook */
onMounted(async () => {
linkFile.value = "";
retireld.value = retireld_params.toString();
await fetchlistprofile(retireld.value);
});
@ -474,7 +481,20 @@ onMounted(async () => {
>
<q-tooltip>เพมรายช</q-tooltip></q-btn
>
<q-btn color="primary" flat round icon="mdi-dots-vertical">
<q-btn
v-if="statusUpload"
outline
color="primary"
@click="downloadFile(linkFile)"
>ดาวนโหลดไฟล</q-btn
>
<q-btn
color="primary"
flat
round
icon="mdi-dots-vertical"
v-if="!statusUpload"
>
<q-menu>
<q-list style="min-width: 100px">
<q-item