fix: Issues #230 done.

This commit is contained in:
chiayin
2024-03-22 15:42:20 +08:00
parent af2e9c75e3
commit dfc0d9a7a6
3 changed files with 90 additions and 3 deletions

View File

@@ -223,7 +223,7 @@
import IconVector from '@/components/icons/IconVector.vue';
import IconList from '@/components/icons/IconList.vue';
import IconGrid from '@/components/icons/IconGrid.vue';
import { renameModal, deleteFileModal } from '@/module/alertModal.js';
import { renameModal, deleteFileModal, reallyDeldetInformation } from '@/module/alertModal.js';
export default {
data() {
@@ -318,6 +318,19 @@
isCompareDisabledButton: function() {
let result = this.primaryDragData.length === 0 || this.secondaryDragData.length === 0 ? true : false;
return result;
},
/**
* Really deleted information
*/
reallyDeldetData: function() {
let result = [];
if(this.store.allFiles.length !== 0){
result = JSON.parse(JSON.stringify(this.store.allFiles));
result = result.filter(file => file.is_deleted === true);
}
return result
}
},
watch: {
@@ -331,8 +344,14 @@
},
allFiles: {
handler(newValue) {
this.compareData = JSON.parse(JSON.stringify(newValue));
if(newValue != null) this.compareData = JSON.parse(JSON.stringify(newValue));
}
},
reallyDeldetData: {
handler(newValue, oldValue) {
if(newValue.length !== 0 && oldValue.length === 0) this.showReallyDeldet();
},
immediate: true
}
},
methods: {
@@ -471,6 +490,30 @@
deleteFileModal(srt, this.selectedType, this.selectedId, this.selecteName);
srt = '';
},
/**
* 顯示被 Admin 或被其他帳號刪除的檔案
*/
showReallyDeldet(){
let srt = '';
if(this.reallyDeldetData.length !== 0) {
this.reallyDeldetData.forEach(file => {
switch (file.type) {
case 'log-check':
file.type = 'rule';
break;
case 'filter-check':
file.type = 'rule';
break;
}
let content = `<li>[${file.type}] ${file.name}</li>`;
srt += content;
});
}
reallyDeldetInformation(srt, this.reallyDeldetData);
srt = '';
},
/**
* Download file as CSV
* @param {string} type