-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2513aab
commit 08a5393
Showing
5 changed files
with
154 additions
and
14 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
web/dashboard/src/business/app-layout/header-components/AutoRefresh.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<span style="color: white;margin-left: 20px"> | ||
<el-select v-model="autorefresh" @change="changeAutorefresh"> | ||
<el-option v-for="(vs,index) in autorefreshs" :key="vs.value" | ||
:label="vs.label" | ||
:value="vs.value" | ||
></el-option> | ||
</el-select> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
/*定时刷新设置*/ | ||
export default { | ||
name: "autorefresh", | ||
components: {}, | ||
props: {}, | ||
data () { | ||
return { | ||
autorefresh: '-1', | ||
autorefreshs:[ | ||
{value:'-1',label:"手动刷新"}, | ||
{value:'5',label:"5秒自动刷新"}, | ||
{value:'10',label:"10秒自动刷新"}, | ||
{value:'30',label:"30秒自动刷新"}, | ||
] | ||
} | ||
}, | ||
methods: { | ||
async changeAutorefresh(){ | ||
await this.$store.dispatch("app/setAutorefresh", this.autorefresh) | ||
} | ||
}, | ||
async mounted () { | ||
this.autorefresh =localStorage.getItem("autorefresh") | ||
if(!this.autorefresh || this.autorefresh === 'undefined' || this.autorefresh === ''){ | ||
this.autorefresh = '-1' | ||
} | ||
await this.$store.dispatch("app/setAutorefresh", this.autorefresh) | ||
}, | ||
created () { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters