代码优化,结构调整,进度50%
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<eHeader :query="query"/>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入关键词搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<div style="display: inline-block;">
|
||||
<!-- 清空缓存 -->
|
||||
<el-button v-permission="['ADMIN','REDIS_ALL','REDIS_DELETE']" :loading="deleteAllLoading" type="warning" size="mini" class="filter-item" icon="el-icon-delete" @click="deleteAll">清空缓存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
@@ -47,14 +56,12 @@
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
||||
import initData from '@/mixins/initData'
|
||||
import { del } from '@/api/redis'
|
||||
import eHeader from './module/header'
|
||||
import { del, delAll } from '@/api/redis'
|
||||
export default {
|
||||
components: { eHeader },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false, sup_this: this, permissions: []
|
||||
delLoading: false, sup_this: this, permissions: [], deleteAllLoading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -93,6 +100,24 @@ export default {
|
||||
this.$refs[index].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
toQuery() {
|
||||
this.page = 0
|
||||
this.init()
|
||||
},
|
||||
deleteAll() {
|
||||
this.$confirm('你确定要清空缓存数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.deleteAllLoading = true
|
||||
delAll().then(res => {
|
||||
this.page = 0
|
||||
this.init()
|
||||
this.deleteAllLoading = false
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<template>
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入关键词搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<div style="display: inline-block;">
|
||||
<!-- 清空缓存 -->
|
||||
<el-button v-permission="['ADMIN','REDIS_ALL','REDIS_DELETE']" :loading="deleteAllLoading" type="warning" size="mini" class="filter-item" icon="el-icon-delete" @click="deleteAll">清空缓存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { delAll } from '@/api/redis'
|
||||
// 查询条件
|
||||
export default {
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deleteAllLoading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toQuery() {
|
||||
this.$parent.page = 0
|
||||
this.$parent.init()
|
||||
},
|
||||
deleteAll() {
|
||||
this.deleteAllLoading = true
|
||||
delAll().then(res => {
|
||||
this.$parent.page = 0
|
||||
this.$parent.init()
|
||||
this.deleteAllLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user