建模管理修改属性时显示进度条
This commit is contained in:
		
							parent
							
								
									af304dcedd
								
							
						
					
					
						commit
						2ef21ee96b
					
				| @ -136,6 +136,29 @@ | |||||||
|         v-on:cancel="shapeAnchorConfig.visible = false" |         v-on:cancel="shapeAnchorConfig.visible = false" | ||||||
|         v-on:getResult="handleSaveShapeAnchorConfig" |         v-on:getResult="handleSaveShapeAnchorConfig" | ||||||
|     /> |     /> | ||||||
|  |     <awsui-dialog | ||||||
|  |         :title="progressBarDlg.title" | ||||||
|  |         :visible.sync="progressBarDlg.visible" | ||||||
|  |         :modal=false | ||||||
|  |         :append-to-body=true | ||||||
|  |         :destroy-on-close=true | ||||||
|  |         width="500px" | ||||||
|  |         height="170px" | ||||||
|  |         :before-close="progressBarHandleClose"> | ||||||
|  |       <!--awsui-dialog标签中的内容都可以自行去控制--> | ||||||
|  |       <div style="text-align: center;"> | ||||||
|  |         <el-progress type="dashboard" :percentage="progressBarDlg.percentage" :color="progressBarDlg.colors"></el-progress> | ||||||
|  |       </div> | ||||||
|  |       <div style="text-align: center;"> | ||||||
|  |         <span>总共[<b>{{ progressBarDlg.totalCount }}</b>]条,成功[<b style="color: #5cb87a">{{ progressBarDlg.okCount }}</b>]条,失败[<b style="color: #f56c6c">{{ progressBarDlg.errCount }}</b>]条</span> | ||||||
|  |       </div> | ||||||
|  |       <div style="text-align: center;"> | ||||||
|  |         <span style="font-size: 12px;color: gray;">进度窗口关闭不会影响剩余任务的执行,详情见BPM日志</span> | ||||||
|  |       </div> | ||||||
|  |       <span slot="footer" class="dialog-footer"> | ||||||
|  |             <awsui-button @click="progressBarDlg.visible = false">关闭</awsui-button> | ||||||
|  |           </span> | ||||||
|  |     </awsui-dialog> | ||||||
|   </el-container> |   </el-container> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| @ -192,6 +215,24 @@ export default { | |||||||
|         methodId: '', |         methodId: '', | ||||||
|         shapeName: '', |         shapeName: '', | ||||||
|         wsId: '' |         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.drawer.buttonDisabled = true; | ||||||
|       that.closeDrawer(); |       that.closeDrawer(); | ||||||
|  |       that.closeProgressBarDlg(); | ||||||
|       that.loadingText = '正在更新资产库文件' |       that.loadingText = '正在更新资产库文件' | ||||||
|       that.loading = true; |       that.loading = true; | ||||||
|       const params = { |       const params = { | ||||||
| @ -341,7 +383,12 @@ export default { | |||||||
|       awsuiAxios.post(params).then(function (ro) { |       awsuiAxios.post(params).then(function (ro) { | ||||||
|         that.loading = false; |         that.loading = false; | ||||||
|         if (ro.result == 'ok') { |         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 { |         } else { | ||||||
|           that.$message.error(ro.msg); |           that.$message.error(ro.msg); | ||||||
|         } |         } | ||||||
| @ -349,6 +396,13 @@ export default { | |||||||
|         console.log(error); |         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 |     closeDrawer() {// 关闭drawer | ||||||
|       this.drawer.visible = false; |       this.drawer.visible = false; | ||||||
|     }, |     }, | ||||||
| @ -411,7 +465,48 @@ export default { | |||||||
|       }).catch(error => { |       }).catch(error => { | ||||||
|         console.log(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: { |   computed: { | ||||||
|     listenTopMainHeight() { |     listenTopMainHeight() { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 446052889@qq.com
						446052889@qq.com