Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-04-17 16:28:37 +07:00
commit 0d0978b4df
2 changed files with 85 additions and 48 deletions

View file

@ -189,26 +189,53 @@ watch(
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="q-gutter-y-sm">
<div class="row items-center q-gutter-x-sm q-pb-sm">
<q-select
class="inputgreen"
v-model="type"
label="เลื่อนขั้น"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="typeRangeOps"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space
@update:model-value="chengType()"
style="min-width: 140px"
/>
<q-space />
<div class="q-col-gutter-sm">
<div class="row q-col-gutter-sm jus">
<div class="col-3">
<q-select
class="inputgreen"
v-model="type"
label="เลื่อนขั้น"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="typeRangeOps"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
lazy-rules
hide-bottom-space
@update:model-value="chengType()"
style="min-width: 140px"
/>
</div>
<div class="row col-9 items-center">
<q-checkbox
v-if="type === 'FULL'"
keep-color
label="สำรอง"
dense
v-model="isReserve"
/>
<q-input
v-if="type === 'NONE'"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
:class="inputEdit(isReadonly)"
/>
</div>
</div>
<div class="col-12">
<q-separator class="col-12" />
</div>
<div class="row justify-end q-col-gutter-sm">
<q-input
standout
dense
@ -237,20 +264,23 @@ watch(
/>
</div>
<div class="col-12">
<d-table
<div class="row justify-end">งหมด {{ total }} รายการ</div>
<div class="col-12 q-mt-sm">
<q-table
class="custom-header-table"
ref="table"
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
hide-pagination
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selectedData"
:pagination="{ page: 1, rowsPerPage: total }"
>
<template v-slot:header-selection="scope">
<q-checkbox
@ -311,27 +341,7 @@ watch(
</q-td>
</q-tr>
</template>
</d-table>
</div>
<div class="col-12">
<q-checkbox
v-if="type === 'FULL'"
keep-color
label="สำรอง"
dense
v-model="isReserve"
/>
<q-input
v-if="type === 'NONE'"
outlined
dense
v-model="note"
label="หมายเหตุ"
type="textarea"
:class="inputEdit(isReadonly)"
/>
</q-table>
</div>
</div>
</q-card-section>
@ -348,4 +358,31 @@ watch(
</q-dialog>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.custom-header-table {
height: auto;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
/* this will be the loading indicator */
.q-table thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style>

View file

@ -389,8 +389,8 @@ function onClickViewInfo(type: string, id: string) {
flat
round
dense
color="public"
icon="mdi-stairs-up"
color="green-6"
icon="mdi-swap-vertical-bold"
@click="onClickMoveLevelMulti"
>
<q-tooltip>เลอนข</q-tooltip>