diff --git a/src/views/pages/framework/matrix/matrix-overview.vue b/src/views/pages/framework/matrix/matrix-overview.vue index eda26cc7b45c508677f950112bfbfba5c388a09a..f2959d516f59ca0f7e91f28e70a20e11ed383bcf 100644 --- a/src/views/pages/framework/matrix/matrix-overview.vue +++ b/src/views/pages/framework/matrix/matrix-overview.vue @@ -88,9 +88,9 @@
{ if (res.Status == 'OK') { const { tbodyList: cardList, currentPage, pageSize, pageCount, rowNum } = res.Return; @@ -684,6 +681,18 @@ export default { }, 200); }); }, + restoreHistory(historyData) { + let modeType = historyData['modeType']; + this.keyword = historyData['keyword']; + if (this.modeType == 'block') { + this.matrixCardData.currentPage = historyData['currentPage']; + this.matrixCardData.pageSize = historyData['pageSize']; + } else { + this.matrixTableConfig.currentPage = historyData['currentPage']; + this.matrixTableConfig.pageSize = historyData['pageSize']; + } + this.modeType = modeType; + }, action(row, value) { if (value == 'del') { if (row.type === 'private') { @@ -701,38 +710,35 @@ export default { } }, //表格形式展示数据 - getMatrixTableList: function(param) { - let data = param || {}; + getMatrixTableList(currentPage, pageSize) { this.loadingShow = true; - this.$api.framework.matrix.getMatrixList(data).then(res => { + this.$addHistoryData('modeType', this.modeType); + this.$addHistoryData('keyword', this.keyword); + this.$addHistoryData('currentPage', currentPage); + this.$addHistoryData('pageSize', pageSize); + this.$api.framework.matrix.getMatrixList({ + keyword: this.keyword, + currentPage: currentPage, + pageSize: pageSize + }).then(res => { if (res.Status == 'OK') { - this.matrixTableList = res.Return; - this.matrixTableList.theadList = this.matrixTableThead; + this.matrixTableConfig = Object.assign(this.matrixTableConfig, res.Return || {}); setTimeout(() => { this.loadingShow = false; }, 200); } }); }, - getPagedata(current) { + getPagedata(current = 1) { if (current) { - this.matrixTableList.currentPage = current; + this.matrixTableConfig.currentPage = current; + this.matrixTableConfig.pageSize = 20; } - let param = { - keyword: this.keyword, - pageSize: this.tablePageSize, - currentPage: this.matrixTableList.currentPage ? this.matrixTableList.currentPage : 1 - }; - this.getMatrixTableList(param); + this.getMatrixTableList(this.matrixTableConfig.currentPage, this.matrixTableConfig.pageSize); }, - changePageSize(size) { - this.tablePageSize = size; - let param = { - keyword: this.keyword, - pageSize: this.tablePageSize, - currentPage: 1 - }; - this.getMatrixTableList(param); + changePageSize(pageSize = 20) { + this.matrixTableConfig.pageSize = pageSize; + this.getMatrixTableList(1, this.matrixTableConfig.pageSize); }, //新建矩阵 addMatrix: function() { @@ -749,12 +755,7 @@ export default { //搜索矩阵 searchMatrix: function() { this.getMatrixList(); - let data = { - keyword: this.keyword, - pageSize: this.tablePageSize, - currentPage: 1 - }; - this.getMatrixTableList(data); + this.getMatrixTableList(1, 20); }, //删除矩阵 delMatrix(row) { @@ -772,7 +773,6 @@ export default { this.$api.framework.matrix.deleteMatrix(data).then(res => { if (res.Status == 'OK') { this.$Message.success(this.$t('message.deletesuccess')); - this.currentPage = 1; this.searchMatrix(); vnode.isShow = false; } @@ -1032,11 +1032,8 @@ export default { } } }, - filter: {}, - computed: {}, - watch: { modeType: { handler: function(val) {