| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | v-model:page="page" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" :before-open="beforeOpen" |
| | | v-model="form" :permission="permissionList" v-model:page="page" @search-change="searchChange" |
| | | @search-reset="searchReset" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getErrorList, getErrorLogs } from '@/api/logs'; |
| | | import { mapGetters } from 'vuex'; |
| | | import { getErrorList, getErrorLogs } from '@/api/logs' |
| | | import { mapGetters } from 'vuex' |
| | | |
| | | export default { |
| | | data() { |
| | | data () { |
| | | return { |
| | | form: {}, |
| | | selectionList: [], |
| | |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | // height: 'auto', |
| | | // calcHeight: 32, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | delBtn: false, |
| | | menuWidth: 120, |
| | | dialogType: 'drawer', |
| | | |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | |
| | | column: [ |
| | | { |
| | | label: '服务名称', |
| | | prop: 'serviceId', |
| | | search: true, |
| | | searchSpan:4, |
| | | searchSpan: 4, |
| | | width: '120', |
| | | }, |
| | | |
| | |
| | | label: '请求接口', |
| | | prop: 'requestUri', |
| | | search: true, |
| | | searchSpan:6, |
| | | searchSpan: 6, |
| | | }, |
| | | { |
| | | label: '操作人', |
| | | prop: 'createBy', |
| | | search: true, |
| | | searchSpan:4, |
| | | searchSpan: 4, |
| | | width: '120', |
| | | }, |
| | | { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['permission']), |
| | | permissionList() { |
| | | permissionList () { |
| | | return { |
| | | viewBtn: this.validData(this.permission.log_error_view, false), |
| | | }; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | searchReset () { |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | searchChange (params, done) { |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | beforeOpen (done, type) { |
| | | if (['edit', 'view'].includes(type)) { |
| | | getErrorLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | onLoad (page, params = {}) { |
| | | let values = { |
| | | ...params, |
| | | ...this.query, |
| | | }; |
| | | this.loading = true; |
| | | } |
| | | this.loading = true |
| | | getErrorList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | </style> |
| | | <style scoped lang="scss"></style> |