1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
<el-dialog :title="userObj.title"
:visible.sync="userObj.show" center
width="800px">
<el-table
:data="cacheList"
style="width: 100%;">
<el-table-column
prop="name"
label="缓存列表" style="padding-left:30px">
</el-table-column>
<el-table-column
v-if="!$store.state.readonly"
label="操作">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="cache(scope.row.key)">
清除缓存
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import {clearCacheListApi} from "../../../service/api"
export default {
name:"ClearCache",
props:[
'userObj'
],
data(){
return{
cacheList:[
{name:"主题列表",key:"course_relation_list"},
{name:"课包列表",key:"course_category_list "},
{name:"课包内容",key:"element_detail"}
]
}
},
methods:{
cache(data){
this.$confirm('此操作将清除该缓存记录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
clearCacheListApi(data).then(res=>{
this.$message({
type: 'success',
message: '清除成功!'
});
});
});
}
}
}
</script>
<style scoped lang="less">
</style>