| @@ -164,6 +164,7 @@ export default { | |||||
| defaultAvatarName:'Ghost', | defaultAvatarName:'Ghost', | ||||
| data:'', | data:'', | ||||
| timer:null, | timer:null, | ||||
| timerFlag:false, | |||||
| }; | }; | ||||
| }, | }, | ||||
| methods: { | methods: { | ||||
| @@ -390,6 +391,13 @@ export default { | |||||
| return "Other" | return "Other" | ||||
| } | } | ||||
| }, | }, | ||||
| intervalModelist(){ | |||||
| if(!this.timerFlag){ | |||||
| this.timer = setInterval(()=>{ | |||||
| this.getModelList() | |||||
| }, 10000); | |||||
| } | |||||
| }, | |||||
| getModelList(){ | getModelList(){ | ||||
| let countStatus = 0 | let countStatus = 0 | ||||
| try { | try { | ||||
| @@ -430,10 +438,12 @@ export default { | |||||
| this.totalNum = res.data.count | this.totalNum = res.data.count | ||||
| if(countStatus===this.tableData.length){ | if(countStatus===this.tableData.length){ | ||||
| clearInterval(this.timer); | clearInterval(this.timer); | ||||
| this.timer=null | |||||
| this.timerFlag = false | |||||
| }else{ | |||||
| this.intervalModelist() | |||||
| this.timerFlag = true | |||||
| } | } | ||||
| // if(res.data.count===1 && res.data.data[0].VersionCount===1){ | |||||
| // location.reload() | |||||
| // } | |||||
| }).catch((err)=>{console.log(err)}) | }).catch((err)=>{console.log(err)}) | ||||
| }catch (e) { | }catch (e) { | ||||
| console.log(e) | console.log(e) | ||||
| @@ -478,9 +488,7 @@ export default { | |||||
| }, | }, | ||||
| mounted() { | mounted() { | ||||
| this.submitId = document.getElementById("submitId") | this.submitId = document.getElementById("submitId") | ||||
| this.timer = setInterval(()=>{ | |||||
| this.getModelList() | |||||
| }, 10000); | |||||
| this.intervalModelist() | |||||
| this.url = location.href.split('show_model')[0] | this.url = location.href.split('show_model')[0] | ||||
| this.submitId.addEventListener("click", this.submit) | this.submitId.addEventListener("click", this.submit) | ||||
| this.url_create_newVersion = this.url + 'create_model' | this.url_create_newVersion = this.url + 'create_model' | ||||