ปรับ วินัย
This commit is contained in:
parent
89bedf5251
commit
2adbbc9b24
22 changed files with 416 additions and 411 deletions
|
|
@ -33,15 +33,6 @@ const pagination = ref({
|
|||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
/** ล้างค่า Input */
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
if (filterRef.value) {
|
||||
filterRef.value.focus();
|
||||
getList();
|
||||
}
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลบสวน */
|
||||
async function getList() {
|
||||
showLoader();
|
||||
|
|
@ -54,7 +45,7 @@ async function getList() {
|
|||
statusFilter.value
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
totalList.value = Math.ceil(
|
||||
res.data.result.total / pagination.value.rowsPerPage
|
||||
);
|
||||
|
|
@ -62,7 +53,7 @@ async function getList() {
|
|||
toptitle.value = res.data.result.total;
|
||||
|
||||
const data = res.data.result.data;
|
||||
dataInvestigate.fecthList(data);
|
||||
await dataInvestigate.fecthList(data);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -95,7 +86,6 @@ async function detailPage(id: string) {
|
|||
* @param update function
|
||||
*/
|
||||
function filterOptionFn(val: string, update: Function) {
|
||||
statusFilter.value = "";
|
||||
update(() => {
|
||||
option.value = dataInvestigate.statusOptions.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
|
|
@ -127,52 +117,51 @@ onMounted(async () => {
|
|||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการสืบสวนข้อเท็จจริง
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<div class="col-xs-12 col-sm-4 col-md-3">
|
||||
<q-select
|
||||
v-model="statusFilter"
|
||||
label="สถานะ"
|
||||
dense
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="option"
|
||||
@update:model-value="getSerach()"
|
||||
use-input
|
||||
@filter="filterOptionFn"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-if="statusFilter !== 'ALL'" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(option = dataInvestigate.statusOptions),
|
||||
(statusFilter = 'ALL'),
|
||||
getSerach()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-select
|
||||
v-model="statusFilter"
|
||||
label="สถานะ"
|
||||
dense
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="option"
|
||||
@update:model-value="getSerach()"
|
||||
use-input
|
||||
@filter="filterOptionFn"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-if="statusFilter !== 'ALL'" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(option = dataInvestigate.statusOptions),
|
||||
(statusFilter = 'ALL'),
|
||||
getSerach()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
for="#search"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
|
|
@ -182,7 +171,7 @@ onMounted(async () => {
|
|||
@keydown.enter.prevent="getSerach()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
|
|
@ -199,7 +188,6 @@ onMounted(async () => {
|
|||
:options="dataInvestigate.columns"
|
||||
option-value="name"
|
||||
style="min-width: 140px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue