Browse Source

fix issue

tags/v1.22.9.2^2
zhoupzh 3 years ago
parent
commit
aedab3d28a
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      web_src/js/components/Model.vue

+ 14
- 6
web_src/js/components/Model.vue View File

@@ -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'


Loading…
Cancel
Save