feat: แสดงจำนวนรายการที่ค้นหา, แก้ไขแสสดงชื่อไฟล์
This commit is contained in:
parent
cb789b0ac1
commit
65b05737fb
2 changed files with 11 additions and 6 deletions
|
|
@ -6,9 +6,10 @@ import { storeToRefs } from 'pinia'
|
||||||
import { useSearchDataStore } from '@/stores/searched-data'
|
import { useSearchDataStore } from '@/stores/searched-data'
|
||||||
import { useFileInfoStore } from '@/stores/file-info-data'
|
import { useFileInfoStore } from '@/stores/file-info-data'
|
||||||
import useStorage from '@/stores/storage'
|
import useStorage from '@/stores/storage'
|
||||||
|
import type { StorageFile } from '@/stores/storage'
|
||||||
|
|
||||||
import DialogDelete from './DialogDelete.vue'
|
import DialogDelete from '@/components/DialogDelete.vue'
|
||||||
import FileFormWrapper from './FileFormWrapper.vue'
|
import FileFormWrapper from '@/components/FileFormWrapper.vue'
|
||||||
import FileItemAction from '@/components/FileItemAction.vue'
|
import FileItemAction from '@/components/FileItemAction.vue'
|
||||||
import FileIcon from '@/components/FileIcon.vue'
|
import FileIcon from '@/components/FileIcon.vue'
|
||||||
|
|
||||||
|
|
@ -33,7 +34,7 @@ const keywordList = ref<string[]>([])
|
||||||
const categoryList = ref<string[]>([])
|
const categoryList = ref<string[]>([])
|
||||||
const selectKeyword = ref<string[]>([])
|
const selectKeyword = ref<string[]>([])
|
||||||
const selectCategory = ref<string[]>([])
|
const selectCategory = ref<string[]>([])
|
||||||
const filterFoundFile = ref<any>()
|
const filterFoundFile = ref<StorageFile[]>()
|
||||||
|
|
||||||
const deleteFormType = ref<'deleteFile'>('deleteFile')
|
const deleteFormType = ref<'deleteFile'>('deleteFile')
|
||||||
const dialogDeleteState = ref<boolean>(false)
|
const dialogDeleteState = ref<boolean>(false)
|
||||||
|
|
@ -161,6 +162,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="props.viewMode === 'view_list' && foundFile.length > 0">
|
<div v-if="props.viewMode === 'view_list' && foundFile.length > 0">
|
||||||
|
<span class="text-body text-grey">จำนวน {{ filterFoundFile?.length }} รายการ</span>
|
||||||
<div class="grid q-mt-md">
|
<div class="grid q-mt-md">
|
||||||
<div v-for="(value, index) in filterFoundFile" :key="value.title">
|
<div v-for="(value, index) in filterFoundFile" :key="value.title">
|
||||||
<div
|
<div
|
||||||
|
|
@ -201,6 +203,7 @@ onMounted(() => {
|
||||||
category: value.category,
|
category: value.category,
|
||||||
},
|
},
|
||||||
value.pathname,
|
value.pathname,
|
||||||
|
value.fileName,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
@delete="() => triggerFileDelete(value.pathname)"
|
@delete="() => triggerFileDelete(value.pathname)"
|
||||||
|
|
@ -224,13 +227,13 @@ onMounted(() => {
|
||||||
<q-table
|
<q-table
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
row-key="name"
|
||||||
|
class="cursor"
|
||||||
:rows="filterFoundFile"
|
:rows="filterFoundFile"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="name"
|
|
||||||
:pagination="{
|
:pagination="{
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
}"
|
}"
|
||||||
class="cursor"
|
|
||||||
>
|
>
|
||||||
<template v-slot:body-cell-name="nameData">
|
<template v-slot:body-cell-name="nameData">
|
||||||
<q-td style="width: 50%" @click="() => getFileInfo(nameData.row)">
|
<q-td style="width: 50%" @click="() => getFileInfo(nameData.row)">
|
||||||
|
|
@ -271,11 +274,12 @@ onMounted(() => {
|
||||||
color="positive"
|
color="positive"
|
||||||
dense
|
dense
|
||||||
icon="o_edit"
|
icon="o_edit"
|
||||||
@click="
|
@click.stop="
|
||||||
() =>
|
() =>
|
||||||
fileFormComponent?.triggerFileEdit(
|
fileFormComponent?.triggerFileEdit(
|
||||||
actionData.row,
|
actionData.row,
|
||||||
actionData.row.pathname,
|
actionData.row.pathname,
|
||||||
|
actionData.row.fileName,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
id="listViewFileEdit"
|
id="listViewFileEdit"
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,7 @@ const onRowClick = ((_, row) => {
|
||||||
fileFormComponent?.triggerFileEdit(
|
fileFormComponent?.triggerFileEdit(
|
||||||
data.row,
|
data.row,
|
||||||
data.row.pathname,
|
data.row.pathname,
|
||||||
|
data.row.filename,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
id="listViewFileEdit"
|
id="listViewFileEdit"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue