Dashboard => ลบขข้อความ
This commit is contained in:
parent
d20ef87c5e
commit
e9b0d2fbfc
1 changed files with 15 additions and 7 deletions
|
|
@ -95,14 +95,22 @@ const removeData = async (id: string) => {
|
|||
showLoader();
|
||||
await http
|
||||
.delete(config.API.msgInboxDelete(id))
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
const position = inboxList.value.findIndex((item) => item.no === id);
|
||||
if (position !== -1) {
|
||||
inboxList.value.splice(position, 1);
|
||||
data.value = [];
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
// getData();
|
||||
if (inboxList.value.length === 6) {
|
||||
inboxList.value = [];
|
||||
getData(1);
|
||||
}
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
|
@ -122,6 +130,7 @@ function modalReplyClose() {
|
|||
|
||||
const scrollTargetRef = ref<any>(null);
|
||||
const totalInbox = ref<number>(0);
|
||||
|
||||
function onLoad(index: number, done: any) {
|
||||
const num = index === 1 ? 0 : index++;
|
||||
if (inboxList.value.length < totalInbox.value && isLoadInbox) {
|
||||
|
|
@ -157,7 +166,9 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
|
|||
<div class="q-px-md q-py-sm row col-12 items-center">
|
||||
<div class="text-subtitle1 text-weight-medium">กล่องข้อความ</div>
|
||||
<q-space />
|
||||
<div v-if="totalInbox" class="text-grey-5" style="font-size: 12px;">ทั้งหมด {{ totalInbox }} ข้อความ</div>
|
||||
<div v-if="totalInbox" class="text-grey-5" style="font-size: 12px">
|
||||
ทั้งหมด {{ totalInbox }} ข้อความ
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
||||
|
|
@ -172,10 +183,7 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
|
|||
class="q-pa-sm"
|
||||
:scroll-target="scrollTargetRef"
|
||||
>
|
||||
<q-list
|
||||
v-for="(contact, index) in inboxList"
|
||||
:key="contact.no"
|
||||
>
|
||||
<q-list v-for="(contact, index) in inboxList" :key="contact.no">
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue