rt-sim-training-client/src/views/system/cacheControl/index.vue

84 lines
1.6 KiB
Vue
Raw Normal View History

2019-10-31 15:34:38 +08:00
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { getCacheList, delCacheList } from '@/api/management/user';
export default {
name: 'CacheControl',
components: {
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
key: {
type: 'text',
label: 'key'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: 'key',
prop: 'key'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.delete'),
handleClick: this.handledelete,
type: 'danger'
}
]
}
]
},
currentModel: {}
};
},
created() {
},
methods: {
// 删除
handledelete(index, row) {
this.$confirm( this.$t('tip.deleteListHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
delCacheList(row.key).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('tip.failDelete'));
});
});
},
queryFunction(params) {
return getCacheList(params);
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>