Skip to content

Commit

Permalink
MOUNTING 逻辑修改
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekko11 committed Apr 18, 2024
1 parent e8db062 commit 7edd627
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions vue-piflow-web/src/components/pages/StopHub/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
:transfer="true"
v-if="row.status.text === 'UNMOUNT'"
>
<span class="button-warp" @click="handleButtonSelect(row, 1)">
<span :class="`button-warp ${row.status.text === 'MOUNTING'?'gray_btn':''}`" @click="handleButtonSelect(row, 1)">
<Icon type="ios-aperture" />
</span>
</Tooltip>
Expand All @@ -165,7 +165,7 @@
placement="top-start"
:transfer="true"
>
<span class="button-warp" @click="handleButtonSelect(row, 1)">
<span :class="`button-warp ${row.status.text === 'MOUNTING'?'gray_btn':''}`" @click="handleButtonSelect(row, 1)">
<Icon type="md-aperture" />
</span>
</Tooltip>
Expand All @@ -187,7 +187,7 @@
</span>
</Tooltip>
<Tooltip content="Delete" placement="top-start" :transfer="true">
<span class="button-warp" @click="handleButtonSelect(row, 3)">
<span :class="`button-warp ${row.status.text === 'MOUNTING'?'gray_btn':''}`" @click="handleButtonSelect(row, 3)">
<Icon type="ios-trash" />
</span>
</Tooltip>
Expand Down Expand Up @@ -1146,6 +1146,7 @@ export default {
},
methods: {
handleButtonSelect(row, key) {
if(row.status.text === 'MOUNTING') return
switch (key) {
case 1:
this.handleMount(row);
Expand Down Expand Up @@ -1353,6 +1354,13 @@ export default {
if (res.data.code === 200) {
this.tableData = res.data.data;
this.total = res.data.count;
if(this.tableData.some(v=>v.status.text === 'MOUNTING') && !this.timer){
this.timer = setInterval(()=>{
this.getTableData()
},60000)
}else{
clearInterval(this.timer)
}
} else {
this.$Message.error({
content: this.$t("tip.request_fail_content"),
Expand Down Expand Up @@ -1621,6 +1629,9 @@ export default {
this.file = null;
},
},
beforeDestroy() {
if(this.timer) clearInterval(this.timer)
},
};
</script>

Expand Down

0 comments on commit 7edd627

Please sign in to comment.