ทะเบียนประวัติ ==> loadFile
This commit is contained in:
parent
ba32db6123
commit
1e1395f88a
8 changed files with 352 additions and 75 deletions
|
|
@ -7,6 +7,7 @@ import config from "@/app.config";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
|
||||
import { useRegistryDataStore } from "@/modules/10_registry/store/Main";
|
||||
|
||||
import type { HonorFormData } from "@/modules/10_registry/interface/index/Main";
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ const mode = ref<boolean>($q.screen.gt.xs);
|
|||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
|
||||
mixin;
|
||||
const { getPathUploadFlie } = useRegistryDataStore();
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
/** ตัวแปรข้อมูล */
|
||||
|
|
@ -218,6 +220,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const fileGroup = ref<string>("ประกาศเกียรติคุณ");
|
||||
|
||||
function onHistory(id: string) {
|
||||
modalHistory.value = true;
|
||||
idByRow.value = id;
|
||||
|
|
@ -263,6 +267,11 @@ function getHistory() {
|
|||
});
|
||||
}
|
||||
|
||||
async function onDownloadFile(id: string, profileId: string) {
|
||||
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
|
||||
window.open(data.downloadUrl, "_blank");
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
|
|
@ -333,6 +342,7 @@ onMounted(async () => {
|
|||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
|
|
@ -349,6 +359,20 @@ onMounted(async () => {
|
|||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="props.row.isUpload"
|
||||
color="green"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-file-document-outline"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="info"
|
||||
|
|
@ -368,18 +392,32 @@ onMounted(async () => {
|
|||
<div class="q-mb-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
|
||||
<q-card bordered flat>
|
||||
<q-list dense class="q-mt-lg relative-position">
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
class="absolute_button"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประกาศเกียรติคุณ</q-tooltip>
|
||||
</q-btn>
|
||||
<div class="row absolute_button">
|
||||
<q-btn
|
||||
v-if="props.row.isUpload"
|
||||
color="green"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-file-document-outline"
|
||||
@click="onDownloadFile(props.row.id, props.row.profileId)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
class="absolute_button"
|
||||
@click="onHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขประกาศเกียรติคุณ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-item v-for="col in props.cols" :key="col.name">
|
||||
<q-item-section class="fix_top">
|
||||
<q-item-label class="text-grey-6 text-weight-medium">{{
|
||||
|
|
@ -398,6 +436,7 @@ onMounted(async () => {
|
|||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
|
||||
<DialogHistory
|
||||
v-model:modal="modalHistory"
|
||||
:title="'ประวัติแก้ไขประกาศเกียรติคุณ'"
|
||||
|
|
@ -417,5 +456,6 @@ onMounted(async () => {
|
|||
|
||||
.fix_top {
|
||||
justify-content: start !important;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue