xsh_1997 1 неделя назад
Родитель
Сommit
f451ffb77c

+ 8 - 0
ruoyi-screen/src/api/login.js

@@ -19,3 +19,11 @@ export function getCodeImg() {
19 19
     timeout: 20000
20 20
   })
21 21
 }
22
+
23
+/** 退出登录(对齐 ruoyi-ui) */
24
+export function logout() {
25
+  return request({
26
+    url: '/logout',
27
+    method: 'post'
28
+  })
29
+}

+ 5 - 14
ruoyi-screen/src/components/ScreenNavBar.vue

@@ -44,6 +44,8 @@
44 44
 <script setup>
45 45
 import { computed } from "vue";
46 46
 import { useRoute, useRouter } from "vue-router";
47
+import { logout } from "@/api/login";
48
+import { removeToken } from "@/utils/auth";
47 49
 
48 50
 const router = useRouter();
49 51
 const route = useRoute();
@@ -97,20 +99,9 @@ function goNav(item) {
97 99
 }
98 100
 
99 101
 function onLogout() {
100
-  console.log(111)
101
-}
102
-
103
-function onNavClick(item) {
104
-  if (item.action === "logout") onLogout();
105
-  else goNav(item);
106
-}
107
-
108
-function toggleFullscreen() {
109
-  if (!document.fullscreenElement) {
110
-    document.documentElement.requestFullscreen?.();
111
-  } else {
112
-    document.exitFullscreen?.();
113
-  }
102
+  logout().catch(() => {});
103
+  removeToken();
104
+  router.replace({ path: "/login" });
114 105
 }
115 106
 </script>
116 107
 

+ 10 - 6
ruoyi-screen/src/views/tradeSales/chartOptions.js

@@ -132,13 +132,13 @@ export function buildTradeMonthlyOption(tradeMonthlyTrend) {
132 132
     color: ['#5ef0c8', '#ecd27b'],
133 133
     tooltip: { trigger: 'axis' },
134 134
     legend: {
135
-      bottom: 0,
135
+      top: 0,
136 136
       left: 'center',
137 137
       textStyle: { color: '#a8d4c8', fontSize: 10 },
138 138
       itemWidth: 14,
139 139
       itemHeight: 8
140 140
     },
141
-    grid: { ...GRID, bottom: 36 },
141
+    grid: { ...GRID, bottom: 10 },
142 142
     xAxis: {
143 143
       type: 'category',
144 144
       data: MONTHS,
@@ -210,7 +210,7 @@ export function buildSalesDestinationBarOption(salesDestination) {
210 210
         return `${p.name}<br/>${p.value} 头 (${ratio})`
211 211
       }
212 212
     },
213
-    grid: { ...GRID, top: 12, bottom: 28 },
213
+    grid: { ...GRID, top: 12, bottom: 10 },
214 214
     xAxis: {
215 215
       type: 'category',
216 216
       data: names,
@@ -361,7 +361,7 @@ export function buildMallOrderTrendOption(mallOrderTrend, mallStatsAvailable = t
361 361
   return {
362 362
     color: ['#6eb5ff'],
363 363
     tooltip: { trigger: 'axis' },
364
-    grid: { ...GRID, top: 12, bottom: 32 },
364
+    grid: { ...GRID, top: 12, bottom: 10 },
365 365
     xAxis: {
366 366
       type: 'category',
367 367
       data: MONTHS,
@@ -424,7 +424,11 @@ export function buildShopEntryPieOption(shopEntry, mallStatsAvailable = true) {
424 424
         label: {
425 425
           color: '#e8eef5',
426 426
           fontSize: 9,
427
-          formatter: (p) => `${p.name}\n${p.percent}%`
427
+          formatter: (p) => {
428
+            const row = shopEntry.items.find((it) => `${it.month}月` === p.name)
429
+            const ratio = row?.ratio != null ? Number(row.ratio).toFixed(1) : p.percent
430
+            return `${p.name}\n${ratio}%`
431
+          }
428 432
         },
429 433
         labelLine: { length: 6, length2: 4 },
430 434
         data
@@ -457,7 +461,7 @@ export function buildRegionRankBarOption(regionRank, mallStatsAvailable = true)
457 461
         return `${p.name}<br/>${Number(p.value).toFixed(2)} 万元`
458 462
       }
459 463
     },
460
-    grid: { ...GRID, top: 12, bottom: 28 },
464
+    grid: { ...GRID, top: 12, bottom: 10 },
461 465
     xAxis: {
462 466
       type: 'category',
463 467
       data: names,

+ 13 - 5
ruoyi-screen/src/views/tradeSales/index.vue

@@ -110,7 +110,7 @@
110 110
       <div class="screen-page--home-column-right ts-mall-panel">
111 111
         <div class="top_title">
112 112
           农资品类销售 ཞིང་ལས་རྒྱུ་ཆ་རིགས་ཀྱི་ཚོང་འདོན།
113
-          <span v-if="categoryStatDate" class="ts-mall-stat-date">({{ categoryStatDate }})</span>
113
+          <!-- <span v-if="categoryStatYearLabel" class="ts-mall-stat-year">({{ categoryStatYearLabel }})</span> -->
114 114
         </div>
115 115
         <div class="ts-mall-top">
116 116
           <div class="ts-mall-top__pie">
@@ -227,9 +227,17 @@ const hotCategoryItems = computed(() => {
227 227
 
228 228
 const mallEmptyHint = computed(() => (mallStatsAvailable.value ? '暂无热销数据' : '商城统计未接入'))
229 229
 
230
-const categoryStatDate = computed(
231
-  () => categorySales.value?.statDate || hotCategoryRank.value?.statDate || ''
232
-)
230
+/** 右栏品类/热销标题:展示统计年 Y(对齐 v1.2 categorySales.statYear) */
231
+const categoryStatYearLabel = computed(() => {
232
+  const y =
233
+    categorySales.value?.statYear ??
234
+    hotCategoryRank.value?.statYear ??
235
+    statYear.value
236
+  if (y === null || y === undefined || y === '') {
237
+    return ''
238
+  }
239
+  return `${y}年`
240
+})
233 241
 
234 242
 const tradeOverviewItems = computed(() => {
235 243
   const o = tradeOverview.value
@@ -531,7 +539,7 @@ onUnmounted(() => {
531 539
   flex-direction: column;
532 540
 }
533 541
 
534
-.ts-mall-stat-date {
542
+.ts-mall-stat-year {
535 543
   font-size: 12px;
536 544
   color: rgba(168, 212, 200, 0.8);
537 545
   margin-left: 4px;