From a45c5c3e18008c51423a19fe042a0f8e51dc8285 Mon Sep 17 00:00:00 2001 From: yaojn Date: Mon, 8 Apr 2024 16:28:59 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E7=9F=A9=E9=98=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=88=97=E8=A1=A8=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=88=86=E9=A1=B5=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E5=BC=82=E5=B8=B8=20=20=20-=20[=E5=85=B3=E8=81=94]#[1?= =?UTF-8?q?121060068491264]=E7=9F=A9=E9=98=B5=E7=AE=A1=E7=90=86-=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=9B=9E=E6=98=BE=E5=BC=82=E5=B8=B8=20http:/?= =?UTF-8?q?/192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/93?= =?UTF-8?q?9050947543057/1121060068491264?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/matrix/matrix-overview.vue | 95 +++++++++---------- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/src/views/pages/framework/matrix/matrix-overview.vue b/src/views/pages/framework/matrix/matrix-overview.vue index eda26cc7..f2959d51 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) { -- Gitee