diff --git a/web/src/views/special/document/index.vue b/web/src/views/special/document/index.vue index 8537883..e271768 100644 --- a/web/src/views/special/document/index.vue +++ b/web/src/views/special/document/index.vue @@ -52,6 +52,7 @@ onBeforeUnmount(() => { }) const projectId = ref() const storageKey: any = ref() +const statustype: any = ref('') //websocket let ws1 function setupWebSocket() { @@ -62,6 +63,12 @@ function setupWebSocket() { }; ws1.onmessage = (e) => { console.log('websocket接收到消息', e) + // debugger + if (e.data == '专项文档扫描任务处理完成!') { + statustype.vlaue = '1' + } else { + statustype.vlaue = '2' + } tonstatus(true) } ws1.onclose = () => { @@ -820,7 +827,9 @@ function tonstatus(ready: any) { if (res.data.scanstatus == '1') { tonloading.value = false buttonmsg.value = '扫描项目完整路径' - readyto(ready,'1') + if (statustype.vlaue == '1') { + readyto(ready, '1') + } } else if (res.data.scanstatus == '0') { tonloading.value = true buttonmsg.value = '处理中...' @@ -828,7 +837,9 @@ function tonstatus(ready: any) { if (res.data.uploadstatus == '1') { tonloading1.value = false buttonmsg1.value = '初始化导入项目完整压缩包' - readyto(ready,'2') + if (statustype.vlaue == '2') { + readyto(ready, '2') + } } else if (res.data.uploadstatus == '0') { tonloading1.value = true buttonmsg1.value = '处理中...' @@ -837,7 +848,9 @@ function tonstatus(ready: any) { gettreedata() } function readyto(ready: any, type: any) { + if (ready) { + let msg = type == '1' ? '项目扫描成功' : '项目初始化成功' ElMessageBox.confirm( msg, @@ -848,9 +861,9 @@ function readyto(ready: any, type: any) { type: 'warning', } ) - .then(() => { - - }) + setTimeout(() => { + ElMessageBox.close() + }, 5000) } } diff --git a/web/src/views/testdata/datamanagement/index.vue b/web/src/views/testdata/datamanagement/index.vue index 802a6d3..43cc344 100644 --- a/web/src/views/testdata/datamanagement/index.vue +++ b/web/src/views/testdata/datamanagement/index.vue @@ -155,9 +155,9 @@ function readyto(ready: any) { type: 'warning', } ) - .then(() => { - - }) + setTimeout(() => { + ElMessageBox.close() + }, 5000) } } //左侧树配置 diff --git a/web/src/views/testdata/fileSynchronization/index.vue b/web/src/views/testdata/fileSynchronization/index.vue index 790dc9d..e45b471 100644 --- a/web/src/views/testdata/fileSynchronization/index.vue +++ b/web/src/views/testdata/fileSynchronization/index.vue @@ -126,7 +126,7 @@ function tonstatus(ready: any) { function readyto(ready: any) { if (ready) { ElMessageBox.confirm( - '项目扫描成功', + '文件备份成功', '提示', { confirmButtonText: '确定', @@ -134,9 +134,9 @@ function readyto(ready: any) { type: 'warning', } ) - .then(() => { - - }) + setTimeout(() => { + ElMessageBox.close() + }, 5000) } } ////