ดาวโหลดไฟล์

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

@ -184,7 +184,9 @@ async function fetchProfileGov(id: string) {
function redirecToRegistry() { function redirecToRegistry() {
router.push( router.push(
`/registry-${props.type.toLocaleLowerCase() == "employee" ? "employee" : "officer"}/${props.id}` `/registry-${
props.type.toLocaleLowerCase() == "employee" ? "employee" : "officer"
}/${props.id}`
); );
modal.value = false; modal.value = false;
} }
@ -499,7 +501,9 @@ async function fetchProfile(id: string, avatarName: string) {
<q-card <q-card
bordered bordered
style="border: 1px solid #d6dee1" style="border: 1px solid #d6dee1"
v-if="checkRoute && props.type.toLocaleLowerCase() === 'officer'" v-if="
checkRoute && props.type.toLocaleLowerCase() === 'officer'
"
> >
<CardPosition :id="props.id" :type="props.type" /> <CardPosition :id="props.id" :type="props.type" />
</q-card> </q-card>

View file

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