refresh game switch

This commit is contained in:
yangduo 2024-08-30 16:13:02 +08:00
parent 71a612a2d9
commit 3bfdcd228d
2 changed files with 27 additions and 6 deletions

View File

@ -30,3 +30,10 @@ export function updatGameSwitch(data) {
// data
// })
// }
export function refreshGameSwitch() {
return request({
url: '/game_switch/refresh',
method: 'get'
})
}

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<!--div class="filter-container">
<el-button class="filter-item" style="margin-left: 10px;" type="primary" @click="handleCreate">
新增
<div class="filter-container">
<el-button class="filter-item" style="margin-left: 10px;" type="primary" :disabled="refreshdisable" @click="refreshServer">
立刻刷新游戏开关
</el-button>
</div-->
</div>
<el-table
:data="gameSwitchList"
border
@ -123,7 +123,7 @@
<script>
// import Pagination from '@/components/Pagination/index.vue'
import { addGameSwitch, updatGameSwitch, getGameSwitchList } from '@/api/gameswitch'
import { addGameSwitch, updatGameSwitch, getGameSwitchList, refreshGameSwitch } from '@/api/gameswitch'
import { parseTime } from '@/utils'
export default {
@ -148,6 +148,7 @@ export default {
totalpage: 0,
curpage: 1,
page_size: 8,
refreshdisable: false,
rules: {
switch_name: [{ required: true, message: 'required', trigger: 'blur' }],
remark: [{ required: true, message: 'required', trigger: 'blur' }]
@ -199,7 +200,6 @@ export default {
},
getList() {
getGameSwitchList(this.page_size, this.curpage).then(response => {
console.log(response)
this.gameSwitchList = response.data
this.totalpage = response.total_page
this.curpage = response.cur_page
@ -213,6 +213,19 @@ export default {
this.curpage = val
this.getList()
},
refreshServer() {
refreshGameSwitch().then(res => {
if (res.code === 0) {
this.refreshdisable = true
this.$notify({
title: 'Success',
message: 'refresh Successfully',
type: 'success',
duration: 2000
})
}
})
},
handleCreate() {
this.resetTemp()
this.dialogStatus = 'create'
@ -253,6 +266,7 @@ export default {
updatGameSwitch(this.form).then(response => {
if (response.code === 0) {
this.dialogFormVisible = false
this.refreshdisable = false
this.getList()
this.$notify({
title: 'Success',