This commit is contained in:
yangduo 2024-08-13 13:18:47 +08:00
parent 04e7d2ddd1
commit ec294b5713
4 changed files with 39 additions and 39 deletions

View File

@ -23,10 +23,10 @@ export function updatGameSwitch(data) {
})
}
export function delGameSwitch(data) {
return request({
url: '/game_switch/del',
method: 'post',
data
})
}
// export function delGameSwitch(data) {
// return request({
// url: '/game_switch/del',
// method: 'post',
// data
// })
// }

View File

@ -328,7 +328,7 @@ export const asyncRoutes = [
path: 'index',
component: () => import('@/views/gameswitch/index'),
name: 'gameswitch',
meta: { title: '游戏设置', pername: 'gameswitchlist' }
meta: { title: '功能开关', pername: 'gameswitchlist' }
},
{
path: 'blockplayer',

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<div class="filter-container">
<!--div class="filter-container">
<el-button v-show="visibleAddaudit" class="filter-item" style="margin-left: 10px;" type="primary" @click="handleCreate">
新增
</el-button>
</div>
</div-->
<el-table
:data="auditList"
border

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<div class="filter-container">
<!--div class="filter-container">
<el-button class="filter-item" style="margin-left: 10px;" type="primary" @click="handleCreate">
新增
</el-button>
</div>
</div-->
<el-table
:data="gameSwitchList"
border
@ -33,7 +33,7 @@
<svg-icon v-else icon-class="no" style="font-size: 20px;" />
</template>
</el-table-column>
<el-table-column
<!--el-table-column
prop="createtime"
label="创建时间"
>
@ -52,14 +52,14 @@
{{ parseTime(row.modifytime) }}
</span>
</template>
</el-table-column>
</el-table-column-->
<el-table-column
fixed="right"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button>
<!--el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button-->
</template>
</el-table-column>
</el-table>
@ -74,10 +74,10 @@
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" :close-on-click-modal="false" @close="handleDialogClose()">
<el-form ref="form" :rules="rules" :model="form" label-position="left" label-width="90px" style="width: 400px; margin-left:50px;">
<el-form-item label="功能" prop="switch_name">
<el-input v-model="form.switch_name" />
<el-input v-model="form.switch_name" :readonly="true" />
</el-form-item>
<el-form-item label="功能描述" prop="remark">
<el-input v-model="form.remark" />
<el-input v-model="form.remark" :readonly="true" />
</el-form-item>
<el-form-item label="是否启用">
<el-switch
@ -104,7 +104,7 @@
<script>
// import Pagination from '@/components/Pagination/index.vue'
import { addGameSwitch, updatGameSwitch, getGameSwitchList, delGameSwitch } from '@/api/gameswitch'
import { addGameSwitch, updatGameSwitch, getGameSwitchList } from '@/api/gameswitch'
import { parseTime } from '@/utils'
export default {
@ -155,27 +155,27 @@ export default {
})
},
handleDel(row) {
this.$confirm('此操作将无法恢复, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delGameSwitch({ switch_name: row.switch_name }).then(response => {
if (response.code === 0) {
if (this.gameSwitchList.length === 1 && this.curpage === this.totalpage && this.curpage > 1) {
this.curpage--
}
this.getList()
this.$notify({
title: 'Success',
message: 'Deleted Successfully',
type: 'success',
duration: 2000
})
}
})
}).catch(() => {
})
// this.$confirm(', ?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// delGameSwitch({ switch_name: row.switch_name }).then(response => {
// if (response.code === 0) {
// if (this.gameSwitchList.length === 1 && this.curpage === this.totalpage && this.curpage > 1) {
// this.curpage--
// }
// this.getList()
// this.$notify({
// title: 'Success',
// message: 'Deleted Successfully',
// type: 'success',
// duration: 2000
// })
// }
// })
// }).catch(() => {
// })
},
getList() {
getGameSwitchList(this.page_size, this.curpage).then(response => {