From a028c90cf2f4249ea7ba9a1a896058f89e224577 Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 13 May 2025 10:31:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat(dashboard):=20=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=B1=95=E7=A4=BA=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- src/views/dashboard/dashboard.vue | 36 +++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 3fee89a..c6a2615 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -47,7 +47,7 @@ export const constantRoutes = [ { path: '/', component: Layout, - redirect: '/dashboard', + redirect: '/summaryDashboard', name: 'index', // alwaysShow: true, meta: { title: '首页', icon: 'firstPage', icon1: 'firstPageSel' }, diff --git a/src/views/dashboard/dashboard.vue b/src/views/dashboard/dashboard.vue index 60dbce6..46e3b3d 100644 --- a/src/views/dashboard/dashboard.vue +++ b/src/views/dashboard/dashboard.vue @@ -34,22 +34,22 @@
今日业绩
-
-
首购业绩
-
{{ dailyPerformance.today && dailyPerformance.today.firstAchieve || '0.00' }}
-
首购金额
{{ dailyPerformance.today && dailyPerformance.today.firstAmount || '0.00' }}
-
复购业绩
-
{{ dailyPerformance.today && dailyPerformance.today.repAchieve || '0.00' }}
+
首购业绩
+
{{ dailyPerformance.today && dailyPerformance.today.firstAchieve || '0.00' }}
复购金额
{{ dailyPerformance.today && dailyPerformance.today.repAmount || '0.00' }}
+
+
复购业绩
+
{{ dailyPerformance.today && dailyPerformance.today.repAchieve || '0.00' }}
+
总金额
@@ -65,22 +65,22 @@
昨日业绩
-
-
首购业绩
-
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.firstAchieve || '0.00' }}
-
首购金额
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.firstAmount || '0.00' }}
-
复购业绩
-
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.repAchieve || '0.00' }}
+
首购业绩
+
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.firstAchieve || '0.00' }}
复购金额
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.repAmount || '0.00' }}
+
+
复购业绩
+
{{ dailyPerformance.yesterday && dailyPerformance.yesterday.repAchieve || '0.00' }}
+
总金额
@@ -96,22 +96,22 @@
本月业绩
-
-
首购业绩
-
{{ monthlyPerformance.firstAchieve || '0.00' }}
-
首购金额
{{ monthlyPerformance.firstAmount || '0.00' }}
-
复购业绩
-
{{ monthlyPerformance.repAchieve || '0.00' }}
+
首购业绩
+
{{ monthlyPerformance.firstAchieve || '0.00' }}
复购金额
{{ monthlyPerformance.repAmount || '0.00' }}
+
+
复购业绩
+
{{ monthlyPerformance.repAchieve || '0.00' }}
+
总金额
From c50e06ad7d55338777e6ce3792ae859487c199a2 Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 13 May 2025 10:47:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat(dashboard):=20getRoles=E6=94=B9?= =?UTF-8?q?=E4=B8=BApromise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/dashboard.vue | 12 ++++++----- src/views/dashboard/mixins/top-bar-mixin.js | 23 +++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/views/dashboard/dashboard.vue b/src/views/dashboard/dashboard.vue index 46e3b3d..e8404e2 100644 --- a/src/views/dashboard/dashboard.vue +++ b/src/views/dashboard/dashboard.vue @@ -148,11 +148,13 @@ export default { } }, mounted() { - this.getMemberSummary() - this.getDailyPerformance() - this.getMonthlyPerformance() - this.getApprovalStatus() - this.userInfo = JSON.parse(localStorage.getItem('userInfo')) + this.getRoles().then(() => { + this.getMemberSummary() + this.getDailyPerformance() + this.getMonthlyPerformance() + this.getApprovalStatus() + this.userInfo = JSON.parse(localStorage.getItem('userInfo')) + }) }, methods: { getMemberSummary() { diff --git a/src/views/dashboard/mixins/top-bar-mixin.js b/src/views/dashboard/mixins/top-bar-mixin.js index 3c0705a..5007c2d 100644 --- a/src/views/dashboard/mixins/top-bar-mixin.js +++ b/src/views/dashboard/mixins/top-bar-mixin.js @@ -52,16 +52,21 @@ export default { }) }, getRoles() { - getRouters().then((res) => { - this.roleMenu = res.data || [] - if (!this.roleMenu.find((item) => item.routeName === 'summaryDashboard')) { - this.topList.splice(0, 1) - if (this.$route.name === 'summaryDashboard') { - this.$router.replace({ - name: 'Dashboard' - }) + return new Promise((resolve, reject) => { + getRouters().then((res) => { + this.roleMenu = res.data || [] + if (!this.roleMenu.find((item) => item.routeName === 'summaryDashboard')) { + this.topList.splice(0, 1) + if (this.$route.name === 'SummaryDashboard') { + this.$router.replace({ + name: 'Dashboard' + }) + } + reject() + return } - } + resolve() + }) }) } } From 0d6e8d0d2a56c8af493e888891f346ae8e661a8e Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 13 May 2025 11:05:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix(addMenuRole):=20=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E4=BF=AE=E5=A4=8D=E5=BD=93=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E4=BB=85=E6=9C=89=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/addMenuRole/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/system/addMenuRole/index.vue b/src/views/system/addMenuRole/index.vue index 98da488..7a3ed0e 100644 --- a/src/views/system/addMenuRole/index.vue +++ b/src/views/system/addMenuRole/index.vue @@ -543,7 +543,7 @@ export default { } else { this.menuAllList[index].changed = false this.menuAllList[index].checkArr = [] - this.menuAllList[index].children.forEach((item) => { + this.menuAllList[index].children && this.menuAllList[index].children.forEach((item) => { item.changed = false item.checkArr = [] if (item.children) { From 74c2c3577e25143ec78f42fc0ef1c946361d5a4f Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 13 May 2025 11:09:48 +0800 Subject: [PATCH 4/4] feat(dashboard): dashboard visible after getRole --- src/views/dashboard/dashboard.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/dashboard/dashboard.vue b/src/views/dashboard/dashboard.vue index e8404e2..a8082ef 100644 --- a/src/views/dashboard/dashboard.vue +++ b/src/views/dashboard/dashboard.vue @@ -1,5 +1,5 @@