From 1a372f89d4d80aa17c03645b4b06da7945688133 Mon Sep 17 00:00:00 2001 From: QuAoLi Date: Wed, 5 Jan 2022 18:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/data.js | 29 ++ src/components/Table/index.js | 8 +- src/views/data/DataStatisticsList.vue | 365 ++++++++++++++++++++++++++ src/views/notice/NoticeDetail.vue | 4 +- src/views/notice/NoticeList.vue | 4 +- src/views/org/OrgList.vue | 4 +- 6 files changed, 407 insertions(+), 7 deletions(-) create mode 100644 src/api/data/data.js create mode 100644 src/views/data/DataStatisticsList.vue diff --git a/src/api/data/data.js b/src/api/data/data.js new file mode 100644 index 0000000..30eafc5 --- /dev/null +++ b/src/api/data/data.js @@ -0,0 +1,29 @@ +import request from '@/utils/request' + +const dataApi = { + orgStatistics: 'data/orgStatistics', + personalStatistics: 'data/personalStatistics', + classHourTop: 'data/personalStatistics/classHourTop' +} + +export function dataOrgStatistics (params) { + return request({ + url: dataApi.orgStatistics, + method: 'get', + params: params + }) +} +export function dataPersonalStatistics (params) { + return request({ + url: dataApi.personalStatistics, + method: 'get', + params: params + }) +} +export function dataClassHourTop (params) { + return request({ + url: dataApi.classHourTop, + method: 'get', + params: params + }) +} diff --git a/src/components/Table/index.js b/src/components/Table/index.js index 94494c2..85cbd1d 100644 --- a/src/components/Table/index.js +++ b/src/components/Table/index.js @@ -163,11 +163,11 @@ export default { this.localPagination.pageSize }) || false // 后端数据rows为null保存修复 - if (r.rows == null) { - r.rows = [] - } + // if (r.rows == null) { + // r.rows = [] + // } // 为防止删除数据后导致页面当前页面数据长度为 0 ,自动翻页到上一页 - if (r.rows.length === 0 && this.showPagination && this.localPagination.current > 1) { + if (this.showPagination && r.rows.length === 0 && this.localPagination.current > 1) { this.localPagination.current-- this.loadData() return diff --git a/src/views/data/DataStatisticsList.vue b/src/views/data/DataStatisticsList.vue new file mode 100644 index 0000000..f1237f8 --- /dev/null +++ b/src/views/data/DataStatisticsList.vue @@ -0,0 +1,365 @@ + + + diff --git a/src/views/notice/NoticeDetail.vue b/src/views/notice/NoticeDetail.vue index be642b2..9be07af 100644 --- a/src/views/notice/NoticeDetail.vue +++ b/src/views/notice/NoticeDetail.vue @@ -153,7 +153,9 @@ export default { } if (key === '2') { this.queryParam.isRead = 0 - this.$refs.table2.refresh(true) + this.$nextTick(()=>{ + this.$refs.table2.refresh(true) + }) } } } diff --git a/src/views/notice/NoticeList.vue b/src/views/notice/NoticeList.vue index c65817d..0fc421c 100644 --- a/src/views/notice/NoticeList.vue +++ b/src/views/notice/NoticeList.vue @@ -148,7 +148,9 @@ tabsCallback (key) { if (key === '1') { this.queryParam.noticeRange = 1 - this.$refs.table1.refresh(true) + this.$nextTick(()=>{ + this.$refs.table1.refresh(true) + }) } if (key === '2') { this.queryParam.noticeRange = 2 diff --git a/src/views/org/OrgList.vue b/src/views/org/OrgList.vue index 2e6a5bd..1601efd 100644 --- a/src/views/org/OrgList.vue +++ b/src/views/org/OrgList.vue @@ -119,7 +119,9 @@ } if (key === '2') { this.orgType = 2 - this.$refs.table2.refresh(true) + this.$nextTick(()=>{ + this.$refs.table2.refresh(true) + }) } }, /**