fix files accessed sort
This commit is contained in:
@@ -70,8 +70,8 @@ export default defineStore('filesStore', {
|
|||||||
o.parentLog = "-";
|
o.parentLog = "-";
|
||||||
o.fileType = "Log";
|
o.fileType = "Log";
|
||||||
o.ownerName = o.owner.name;
|
o.ownerName = o.owner.name;
|
||||||
o.updated_at = moment(o.updated_at).format('YYYY-MM-DD HH:MM');
|
o.updated_at = moment(o.updated_at).utcOffset('+08:00').format('YYYY-MM-DD HH:MM');
|
||||||
o.accessed_at = moment(o.accessed_at).format('YYYY-MM-DD HH:MM');
|
o.accessed_at = moment(o.accessed_at).utcOffset('+08:00').format('YYYY-MM-DD HH:mm');
|
||||||
return this.allEventLog
|
return this.allEventLog
|
||||||
})
|
})
|
||||||
if(this.httpStatus < 300) loading.isLoading = false;
|
if(this.httpStatus < 300) loading.isLoading = false;
|
||||||
@@ -101,8 +101,8 @@ export default defineStore('filesStore', {
|
|||||||
this.allFilter.map(o => {
|
this.allFilter.map(o => {
|
||||||
o.fileType = "Filter";
|
o.fileType = "Filter";
|
||||||
o.ownerName = o.owner.name;
|
o.ownerName = o.owner.name;
|
||||||
o.updated_at = moment(o.updated_at).format('YYYY-MM-DD HH:MM');
|
o.updated_at = moment(o.updated_at).utcOffset('+08:00').format('YYYY-MM-DD HH:MM');
|
||||||
o.accessed_at = moment(o.accessed_at).format('YYYY-MM-DD HH:MM');
|
o.accessed_at = moment(o.accessed_at).utcOffset('+08:00').format('YYYY-MM-DD HH:MM');
|
||||||
});
|
});
|
||||||
if(this.httpStatus < 300) loading.isLoading = false;
|
if(this.httpStatus < 300) loading.isLoading = false;
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
|||||||
@@ -165,7 +165,8 @@
|
|||||||
recentlyUsedFiles: function() {
|
recentlyUsedFiles: function() {
|
||||||
let recentlyUsedFiles = Array.from(this.store.allFiles);
|
let recentlyUsedFiles = Array.from(this.store.allFiles);
|
||||||
recentlyUsedFiles.filter(item => item.accessed_at !== null);
|
recentlyUsedFiles.filter(item => item.accessed_at !== null);
|
||||||
return recentlyUsedFiles.sort((x, y) => y.updated_at - x.updated_at);
|
recentlyUsedFiles.sort((x, y) => new Date(y.accessed_at) - new Date(x.accessed_at));
|
||||||
|
return recentlyUsedFiles;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
|||||||
Reference in New Issue
Block a user