fix skeleton ==> ข้อมูลตำแหน่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-29 11:54:44 +07:00
parent 9a3b21721b
commit 3eb5946489
2 changed files with 17 additions and 3 deletions

View file

@ -505,9 +505,13 @@ watch(modal, (newValue) => {
<div v-if="isLoading" class="row q-pa-sm"> <div v-if="isLoading" class="row q-pa-sm">
<div <div
v-for="n in 8" v-for="n in 9"
:key="n" :key="n"
class="col-xs-6 col-md-6 q-pa-sm" :class="
n !== 1
? 'col-xs-6 col-md-6 q-pa-sm'
: 'col-xs-12 col-md-12 q-pa-sm'
"
> >
<q-skeleton type="QInput" height="40px" /> <q-skeleton type="QInput" height="40px" />
</div> </div>

View file

@ -35,9 +35,11 @@ const cardData = ref<DataCardPos[]>([
data: [], data: [],
}, },
]); ]);
const isLoading = ref(true);
async function fetchDataTenure() { async function fetchDataTenure() {
if (props?.id) { if (props?.id) {
isLoading.value = true;
await http await http
.get( .get(
config.API.salaryTenurePosition( config.API.salaryTenurePosition(
@ -73,6 +75,9 @@ async function fetchDataTenure() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
isLoading.value = false;
}); });
} }
} }
@ -88,7 +93,12 @@ onMounted(() => {
<q-icon name="mdi-account-tie" color="grey-7" /> <q-icon name="mdi-account-tie" color="grey-7" />
<span class="q-ml-md">อมลตำแหน </span> <span class="q-ml-md">อมลตำแหน </span>
</div> </div>
<div class="row q-pa-sm"> <div v-if="isLoading" class="row q-pa-sm">
<q-skeleton class="col-12 q-mt-sm" height="140px" square />
<q-skeleton class="col-12 q-mt-sm" height="140px" square />
<q-skeleton class="col-12 q-mt-sm" height="140px" square />
</div>
<div v-else class="row q-pa-sm">
<q-list flat bordered class="col-12" style="border-radius: 5px"> <q-list flat bordered class="col-12" style="border-radius: 5px">
<q-card flat v-for="(item, index) in cardData" :key="index"> <q-card flat v-for="(item, index) in cardData" :key="index">
<q-item> <q-item>