|
@@ -290,6 +290,7 @@ export default {
|
|
|
|
|
|
execlimit: 5,
|
|
|
xlsxLoading: false,
|
|
|
+ timeInt: '',
|
|
|
|
|
|
suffixList: [
|
|
|
['txt', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf', 'csv'],
|
|
@@ -420,11 +421,18 @@ export default {
|
|
|
(async () => {
|
|
|
let startTime = new Date().getTime();
|
|
|
this.searchLoading = true;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
+ this.timeInt = setInterval(() => {
|
|
|
+ let endTime = new Date().getTime();
|
|
|
+ this.times = endTime - startTime;
|
|
|
+ }, 1000);
|
|
|
setTimeout(() => {
|
|
|
this.searchLoading = false;
|
|
|
- }, 5000)
|
|
|
+ }, 30000)
|
|
|
let findText = this.handleData.findText.split('\n');
|
|
|
let searchDir = this.searchDir.replace(/\\/g, '/');
|
|
|
+ searchDir = searchDir.replace(/[{}()\[\]]/g, '\\$&'); // 转义所有特殊字符
|
|
|
let ruleStr = [];
|
|
|
let subStr = '/';
|
|
|
if(this.subFolder){ // 是否匹配子文件夹内文件
|
|
@@ -557,10 +565,15 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
let endTime = new Date().getTime();
|
|
|
this.times = endTime - startTime;
|
|
|
// console.log('----查找结果----', files);
|
|
|
}catch(e){
|
|
|
+ this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
this.showError(e);
|
|
|
}
|
|
|
|
|
@@ -576,11 +589,18 @@ export default {
|
|
|
(async () => {
|
|
|
let startTime = new Date().getTime();
|
|
|
this.searchLoading = true;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
+ this.timeInt = setInterval(() => {
|
|
|
+ let endTime = new Date().getTime();
|
|
|
+ this.times = endTime - startTime;
|
|
|
+ }, 1000);
|
|
|
setTimeout(() => {
|
|
|
this.searchLoading = false;
|
|
|
- }, 5000);
|
|
|
+ }, 30000);
|
|
|
|
|
|
let searchDir = this.searchDir.replace(/\\/g, '/');
|
|
|
+ searchDir = searchDir.replace(/[{}()\[\]]/g, '\\$&'); // 转义所有特殊字符
|
|
|
let ruleStr = [];
|
|
|
let subStr = '/';
|
|
|
if(this.subFolder){ // 是否匹配子文件夹内文件
|
|
@@ -635,10 +655,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
let endTime = new Date().getTime();
|
|
|
this.times = endTime - startTime;
|
|
|
// console.log('----查找结果----', files);
|
|
|
}catch(e){
|
|
|
+ this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
this.showError(e);
|
|
|
}
|
|
|
|
|
@@ -654,12 +679,17 @@ export default {
|
|
|
(async () => {
|
|
|
let startTime = new Date().getTime();
|
|
|
this.searchLoading = true;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
+ this.timeInt = setInterval(() => {
|
|
|
+ let endTime = new Date().getTime();
|
|
|
+ this.times = endTime - startTime;
|
|
|
+ }, 1000);
|
|
|
setTimeout(() => {
|
|
|
this.searchLoading = false;
|
|
|
- }, 5000)
|
|
|
+ }, 30000)
|
|
|
let searchDir = this.searchDir.replace(/\\/g, '/');
|
|
|
-
|
|
|
-
|
|
|
+ searchDir = searchDir.replace(/[{}()\[\]]/g, '\\$&'); // 转义所有特殊字符
|
|
|
let ruleStr = [];
|
|
|
let subStr = '/';
|
|
|
if(this.subFolder){ // 是否匹配子文件夹内文件
|
|
@@ -703,10 +733,15 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
let endTime = new Date().getTime();
|
|
|
this.times = endTime - startTime;
|
|
|
// console.log('----查找结果----', files);
|
|
|
}catch(e){
|
|
|
+ this.searchLoading = false;
|
|
|
+ clearInterval(this.timeInt);
|
|
|
+ this.timeInt = null;
|
|
|
this.showError(e);
|
|
|
}
|
|
|
|