|
@@ -16,7 +16,7 @@
|
|
|
-->
|
|
|
|
|
|
<template>
|
|
|
- <div class="app-container pull-auto">
|
|
|
+ <div class="log">
|
|
|
<basic-container>
|
|
|
<avue-crud ref="crud"
|
|
|
:page="page"
|
|
@@ -42,80 +42,80 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { fetchList, delObj } from '@/api/log'
|
|
|
- import { tableOption } from '@/const/crud/log'
|
|
|
- import { mapGetters } from 'vuex'
|
|
|
- export default {
|
|
|
- name: 'log',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableData: [],
|
|
|
- page: {
|
|
|
- total: 0, // 总页数
|
|
|
- currentPage: 1, // 当前页数
|
|
|
- pageSize: 20 // 每页显示多少条
|
|
|
- },
|
|
|
- tableLoading: false,
|
|
|
- tableOption: tableOption
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+import { fetchList, delObj } from '@/api/log'
|
|
|
+import { tableOption } from '@/const/crud/log'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+export default {
|
|
|
+ name: 'log',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ page: {
|
|
|
+ total: 0, // 总页数
|
|
|
+ currentPage: 1, // 当前页数
|
|
|
+ pageSize: 20 // 每页显示多少条
|
|
|
+ },
|
|
|
+ tableLoading: false,
|
|
|
+ tableOption: tableOption
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ },
|
|
|
+ mounted: function () { },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['permissions'])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList (page, params) {
|
|
|
+ this.tableLoading = true
|
|
|
+ fetchList(Object.assign({
|
|
|
+ orderByField: 'create_time',
|
|
|
+ isAsc: false,
|
|
|
+ page: page.currentPage,
|
|
|
+ limit: page.pageSize
|
|
|
+ }, params)).then(response => {
|
|
|
+ this.tableData = response.data.data.records
|
|
|
+ this.page.total = response.data.data.total
|
|
|
+ this.tableLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
- mounted: function() { },
|
|
|
- computed: {
|
|
|
- ...mapGetters(['permissions'])
|
|
|
+ handleDel (row, index) {
|
|
|
+ this.$refs.crud.rowDel(row, index)
|
|
|
},
|
|
|
- methods: {
|
|
|
- getList(page,params) {
|
|
|
- this.tableLoading = true
|
|
|
- fetchList(Object.assign({
|
|
|
- orderByField: 'create_time',
|
|
|
- isAsc: false,
|
|
|
- page: page.currentPage,
|
|
|
- limit: page.pageSize
|
|
|
- }, params)).then(response => {
|
|
|
- this.tableData = response.data.data.records
|
|
|
- this.page.total = response.data.data.total
|
|
|
- this.tableLoading = false
|
|
|
- })
|
|
|
- },
|
|
|
- handleDel(row, index) {
|
|
|
- this.$refs.crud.rowDel(row, index)
|
|
|
- },
|
|
|
- rowDel: function(row, index) {
|
|
|
- var _this = this
|
|
|
- this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ rowDel: function (row, index) {
|
|
|
+ var _this = this
|
|
|
+ this.$confirm('是否确认删除ID为"' + row.id + '"的日志?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(function () {
|
|
|
+ return delObj(row.id)
|
|
|
})
|
|
|
- .then(function() {
|
|
|
- return delObj(row.id)
|
|
|
+ .then(data => {
|
|
|
+ this.getList(this.page)
|
|
|
+ _this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- .then(data => {
|
|
|
- this.getList(this.page)
|
|
|
- _this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '删除成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(function(err) { })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 搜索回调
|
|
|
- */
|
|
|
- searchChange(form) {
|
|
|
- this.getList(this.page,form)
|
|
|
- },
|
|
|
- /**
|
|
|
- * 刷新回调
|
|
|
- */
|
|
|
- refreshChange() {
|
|
|
- this.getList(this.page)
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(function (err) { })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 搜索回调
|
|
|
+ */
|
|
|
+ searchChange (form) {
|
|
|
+ this.getList(this.page, form)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 刷新回调
|
|
|
+ */
|
|
|
+ refreshChange () {
|
|
|
+ this.getList(this.page)
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|