This commit is contained in:
@@ -322,7 +322,8 @@ export default {
|
|||||||
group: null,
|
group: null,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
count: 0,
|
count: 0,
|
||||||
searchGroup:null
|
searchGroup:null,
|
||||||
|
resultdata:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -378,7 +379,7 @@ export default {
|
|||||||
const endIndex = startIndex + 10;
|
const endIndex = startIndex + 10;
|
||||||
// ในตัวอย่างนี้ จะใช้ items ของ this.items เป็นตัวอย่าง โดยใช้ฟังก์ชัน slice หรือการดึงข้อมูลจากแหล่งข้อมูล
|
// ในตัวอย่างนี้ จะใช้ items ของ this.items เป็นตัวอย่าง โดยใช้ฟังก์ชัน slice หรือการดึงข้อมูลจากแหล่งข้อมูล
|
||||||
if(this.count>0){
|
if(this.count>0){
|
||||||
this.result = [...this.result].slice(startIndex, endIndex); }
|
this.result = [...this.resultdata].slice(startIndex, endIndex); }
|
||||||
|
|
||||||
// if (offset == 0) {
|
// if (offset == 0) {
|
||||||
// this.page = 1;
|
// this.page = 1;
|
||||||
@@ -458,11 +459,13 @@ export default {
|
|||||||
alert("ไม่สามารถโหลดข้อมูลได้");
|
alert("ไม่สามารถโหลดข้อมูลได้");
|
||||||
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
|
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const startIndex = (this.page - 1) * 10;
|
||||||
|
const endIndex = startIndex + 10;
|
||||||
client.user.getAllUser
|
client.user.getAllUser
|
||||||
.query(data)
|
.query(data)
|
||||||
.then((rs) => {
|
.then((rs) => {
|
||||||
this.result = rs;
|
this.resultdata = rs;
|
||||||
console.log(rs);
|
console.log(rs);
|
||||||
this.load = false;
|
this.load = false;
|
||||||
if (rs.length == 0) {
|
if (rs.length == 0) {
|
||||||
@@ -475,6 +478,11 @@ export default {
|
|||||||
// alert("ไม่สามารถโหลดข้อมูลได้");
|
// alert("ไม่สามารถโหลดข้อมูลได้");
|
||||||
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
|
console.error("เกิดข้อผิดพลาดในการโหลดข้อมูล:", error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ในตัวอย่างนี้ จะใช้ items ของ this.items เป็นตัวอย่าง โดยใช้ฟังก์ชัน slice หรือการดึงข้อมูลจากแหล่งข้อมูล
|
||||||
|
if(this.count>0){
|
||||||
|
this.result = [...this.resultdata].slice(startIndex, endIndex); }
|
||||||
|
|
||||||
},
|
},
|
||||||
filterData() {
|
filterData() {
|
||||||
// กรองข้อมูลอันที่สองโดยใช้ข้อมูลจากอันแรก
|
// กรองข้อมูลอันที่สองโดยใช้ข้อมูลจากอันแรก
|
||||||
|
|||||||
Reference in New Issue
Block a user