diff --git a/com.actionsoft.apps.coe.pal/src/views/method/MethodObject.vue b/com.actionsoft.apps.coe.pal/src/views/method/MethodObject.vue index 9de7ab4..33983a6 100644 --- a/com.actionsoft.apps.coe.pal/src/views/method/MethodObject.vue +++ b/com.actionsoft.apps.coe.pal/src/views/method/MethodObject.vue @@ -136,6 +136,29 @@ v-on:cancel="shapeAnchorConfig.visible = false" v-on:getResult="handleSaveShapeAnchorConfig" /> + + +
+ +
+
+ 总共[{{ progressBarDlg.totalCount }}]条,成功[{{ progressBarDlg.okCount }}]条,失败[{{ progressBarDlg.errCount }}]条 +
+
+ 进度窗口关闭不会影响剩余任务的执行,详情见BPM日志 +
+ + 关闭 + +
@@ -192,6 +215,24 @@ export default { methodId: '', shapeName: '', wsId: '' + }, + progressBarDlg: { + visible: false, + title: '保存进度', + interval: null, // 查询日志定时器 + timer: 0, // 时间戳记录 + logId: '', + totalCount: 0, + okCount: 0, + errCount: 0, + percentage: 0, + colors: [ + {color: '#f56c6c', percentage: 20}, + {color: '#e6a23c', percentage: 40}, + {color: '#5cb87a', percentage: 60}, + {color: '#5cb87a', percentage: 80}, + {color: '#5cb87a', percentage: 100} + ] } } }, @@ -324,6 +365,7 @@ export default { } that.drawer.buttonDisabled = true; that.closeDrawer(); + that.closeProgressBarDlg(); that.loadingText = '正在更新资产库文件' that.loading = true; const params = { @@ -341,7 +383,12 @@ export default { awsuiAxios.post(params).then(function (ro) { that.loading = false; if (ro.result == 'ok') { - that.$message({message: '更新成功', type: 'success'}); + that.progressBarDlg.logId = ro.data.progressBarCacheId; + // that.$message({message: '更新成功',type: 'success'}); + that.$nextTick(()=> { + that.progressBarDlg.visible = true; + that.getUpdateInfoEvent();// 查询执行过程 + }); } else { that.$message.error(ro.msg); } @@ -349,6 +396,13 @@ export default { console.log(error); }) }, + closeProgressBarDlg() { + this.progressBarDlg.visible = false; + this.progressBarDlg.percentage = 0; + this.progressBarDlg.interval = null; + this.progressBarDlg.timer = 0; + this.progressBarDlg.logId = ''; + }, closeDrawer() {// 关闭drawer this.drawer.visible = false; }, @@ -411,7 +465,48 @@ export default { }).catch(error => { console.log(error); }) - } + }, + progressBarHandleClose() { + this.closeProgressBarDlg(); + }, + getUpdateInfoEvent() {// 定时器查询导入日志 + this.progressBarDlg.interval = setInterval(this.queryLog, 1000) + }, + queryLog() { + const that = this; + that.progressBarDlg.timer = new Date().getTime(); + const data = { + url: 'jd', + data: { + cmd: "com.actionsoft.apps.coe.pal_pl_manage_method_more_attr_config_save_log_query", + logId: that.progressBarDlg.logId, + timer: that.progressBarDlg.timer + } + }; + awsuiAxios.post(data).then(function (ro) { + if (ro.result == 'ok') { + if (parseInt(ro.data.timer) <= that.progressBarDlg.timer) {// axios异步,以时间戳对比获取最新日至内容 + // 设置结果 + that.progressBarDlg.totalCount = ro.data.totalCount; + that.progressBarDlg.okCount = ro.data.okCount; + that.progressBarDlg.errCount = ro.data.errCount; + that.progressBarDlg.percentage = ro.data.percentage; + if (that.progressBarDlg.totalCount == that.progressBarDlg.okCount + that.progressBarDlg.errCount) { + that.clearInterval(); + } + } + } else if (ro.result == 'warning') { + that.$message({message: ro.msg, type: 'warning'}); + } else { + that.$message.error(ro.msg); + } + }).catch(error => { + console.log(error); + }) + }, + clearInterval() { + clearInterval(this.progressBarDlg.interval); + }, }, computed: { listenTopMainHeight() {