Sfoglia il codice sorgente

启动异常bug修复

Zhu Jiaqi 2 mesi fa
parent
commit
180c863994

+ 1 - 1
src/views/order/channel/index.vue

@@ -108,7 +108,7 @@ export default {
     },
     async fetchData() {
       try {
-        const response = await axios.get('/api/shop/import/cross-selling-products');
+        const response = await axios.get('/prod-api/api/shop/import/cross-selling-products');
         if (response.data.success) {
           this.allProducts = response.data.data || [];
           this.initLineChart();

+ 2 - 2
src/views/order/efficiency/index.vue

@@ -60,7 +60,7 @@ export default {
     async initBarChart() {
       this.barChart.loading = true;
       try {
-        const response = await axios.get('/api/shop/import/department-efficiency');
+        const response = await axios.get('/prod-api/api/shop/import/department-efficiency');
         if (!response.data || !response.data.success) {
           throw new Error(response.data.message || 'REPLACED__');
         }
@@ -105,7 +105,7 @@ export default {
     async initPieChart() {
       this.pieChart.loading = true;
       try {
-        const response = await axios.get('/api/shop/import/channel-diversity');
+        const response = await axios.get('/prod-api/api/shop/import/channel-diversity');
         if (!response.data || !response.data.success) {
           throw new Error(response.data.message || '渠道多样性数据获取失败');
         }

+ 19 - 19
src/views/order/ordervalue/index.vue

@@ -47,7 +47,7 @@
 
     </section>
 
-    
+
 
     <!-- 图表区域 -->
 
@@ -57,23 +57,23 @@
 
       <div class="chart-wrapper funnel-chart-wrapper">
 
-        <FunnelChart :date-range="currentDateRange" /> 
+        <FunnelChart :date-range="currentDateRange" />
 
       </div>
 
-      
+
 
       <!-- 明星商品价值环图 (Top 5) -->
 
       <div class="chart-wrapper">
 
-        <Top5PieChart :date-range="currentDateRange" /> 
+        <Top5PieChart :date-range="currentDateRange" />
 
       </div>
 
     </section>
 
-    
+
 
     <!-- 订单价值漏损分析 (退款) - 铺满整排 -->
 
@@ -247,7 +247,7 @@ export default {
 
         files.forEach(file => formData.append('files', file));
 
-        const { data } = await axios.post('/api/import/import-data/upload', formData, {
+        const { data } = await axios.post('/prod-api/api/import/import-data/upload', formData, {
 
           headers: { 'Content-Type': 'multipart/form-data' }
 
@@ -369,13 +369,13 @@ export default {
 
         const [gmvRes, p80Res, top5Res, avgTimeRes] = await Promise.all([
 
-          axios.get(`/api/analysis/gmv?startDate=${startDate}&endDate=${endDate}`),
+          axios.get(`/prod-api/api/analysis/gmv?startDate=${startDate}&endDate=${endDate}`),
 
-          axios.get(`/api/analysis/r-big?startDate=${startDate}&endDate=${endDate}`),
+          axios.get(`/prod-api/api/analysis/r-big?startDate=${startDate}&endDate=${endDate}`),
 
-          axios.get(`/api/analysis/top5-percentage?startDate=${startDate}&endDate=${endDate}`),
+          axios.get(`/prod-api/api/analysis/top5-percentage?startDate=${startDate}&endDate=${endDate}`),
 
-          axios.get(`/api/analysis/average-payment-time?startDate=${startDate}&endDate=${endDate}`)
+          axios.get(`/prod-api/api/analysis/average-payment-time?startDate=${startDate}&endDate=${endDate}`)
 
         ]);
 
@@ -487,13 +487,13 @@ export default {
 
         const [gmvRes, p80Res, top5Res, avgTimeRes] = await Promise.all([
 
-          axios.get(`/api/analysis/gmv?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
+          axios.get(`/prod-api/api/analysis/gmv?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
 
-          axios.get(`/api/analysis/r-big?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
+          axios.get(`/prod-api/api/analysis/r-big?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
 
-          axios.get(`/api/analysis/top5-percentage?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
+          axios.get(`/prod-api/api/analysis/top5-percentage?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`),
 
-          axios.get(`/api/analysis/average-payment-time?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`)
+          axios.get(`/prod-api/api/analysis/average-payment-time?startDate=${previousMonthStart}&endDate=${previousMonthEnd}`)
 
         ]);
 
@@ -525,7 +525,7 @@ export default {
 
       try {
 
-        const res = await axios.get('/api/analysis/max-date');
+        const res = await axios.get('/prod-api/api/analysis/max-date');
 
         this.maxDate = res.data;
 
@@ -663,13 +663,13 @@ export default {
 
         const [gmvRes, p80Res, top5Res, avgTimeRes] = await Promise.all([
 
-          axios.get('/api/analysis/gmv'),
+          axios.get('/prod-api/api/analysis/gmv'),
 
-          axios.get('/api/analysis/r-big'),
+          axios.get('/prod-api/api/analysis/r-big'),
 
-          axios.get('/api/analysis/top5-percentage'),
+          axios.get('/prod-api/api/analysis/top5-percentage'),
 
-          axios.get('/api/analysis/average-payment-time')
+          axios.get('/prod-api/api/analysis/average-payment-time')
 
         ]);
 

+ 27 - 27
src/views/order/related/index.vue

@@ -36,11 +36,11 @@
           </tr>
         </tbody>
       </table>
-      
+
       <!-- 分页控件 -->
       <div class="pagination">
-        <button 
-          :disabled="currentPage === 1" 
+        <button
+          :disabled="currentPage === 1"
           @click="prevPage"
           class="page-button"
         >
@@ -49,8 +49,8 @@
         <span class="page-info">
           第 {{ currentPage }} 页,共 {{ totalPages }} 页
         </span>
-        <button 
-          :disabled="currentPage === totalPages" 
+        <button
+          :disabled="currentPage === totalPages"
           @click="nextPage"
           class="page-button"
         >
@@ -107,7 +107,7 @@ export default {
     },
     async fetchData() {
       try {
-        const response = await axios.get('/api/analysis/co-purchase');
+        const response = await axios.get('/prod-api/api/analysis/co-purchase');
         this.coPurchaseData = response.data || [];
         this.renderNetworkChart(this.coPurchaseData);
       } catch (error) {
@@ -120,27 +120,27 @@ export default {
       const chartEl = this.$refs.networkChart;
       if (!chartEl || !data) return;
       const myChart = echarts.init(chartEl);
-  
+
   // 统计每个节点的出现次数(核心度)
   const nodeCount = {};
   // 统计每条连线的权重
   const linkWeights = {};
-  
+
   data.forEach(item => {
     // 统计节点出现次数
     nodeCount[item.productAId] = (nodeCount[item.productAId] || 0) + 1;
     nodeCount[item.productBId] = (nodeCount[item.productBId] || 0) + 1;
-    
+
     // 统计连线权重
     const linkKey = `${item.productAId}-${item.productBId}`;
     linkWeights[linkKey] = (linkWeights[linkKey] || 0) + item.coPurchaseCount;
   });
-  
+
   // 创建节点和连线
   const nodes = [];
   const links = [];
   const nodeSet = new Set();
-  
+
   // 用于自动聚类的颜色分类
   const categories = [
     { name: '社群1', itemStyle: { color: '#FF6B6B' } },
@@ -150,11 +150,11 @@ export default {
     { name: '社群5', itemStyle: { color: '#FFEAA7' } },
     { name: '社群6', itemStyle: { color: '#DDA0DD' } }
   ];
-  
+
   // 用于社群聚类的简单算法
   const nodeCategories = {};
   let categoryIndex = 0;
-  
+
   data.forEach(item => {
     // 添加节点A
     if (!nodeSet.has(item.productAId)) {
@@ -163,22 +163,22 @@ export default {
       const count = nodeCount[item.productAId];
       // 节点大小范围:15-50
       const symbolSize = Math.min(15 + count * 5, 50);
-      
+
       // 简单的社群聚类:根据第一个关联商品确定社群
       if (!nodeCategories[item.productAId]) {
         nodeCategories[item.productAId] = categoryIndex % categories.length;
         categoryIndex++;
       }
-      
-      nodes.push({ 
-        id: item.productAId, 
-        name: item.productAId, 
-        symbolSize: symbolSize, 
+
+      nodes.push({
+        id: item.productAId,
+        name: item.productAId,
+        symbolSize: symbolSize,
         category: nodeCategories[item.productAId],
         value: count // 用于tooltip显示
       });
     }
-    
+
     // 添加节点B
     if (!nodeSet.has(item.productBId)) {
       nodeSet.add(item.productBId);
@@ -186,22 +186,22 @@ export default {
       const count = nodeCount[item.productBId];
       // 节点大小范围:15-50
       const symbolSize = Math.min(15 + count * 5, 50);
-      
+
       // 简单的社群聚类:根据第一个关联商品确定社群
       if (!nodeCategories[item.productBId]) {
         nodeCategories[item.productBId] = categoryIndex % categories.length;
         categoryIndex++;
       }
-      
-      nodes.push({ 
-        id: item.productBId, 
-        name: item.productBId, 
-        symbolSize: symbolSize, 
+
+      nodes.push({
+        id: item.productBId,
+        name: item.productBId,
+        symbolSize: symbolSize,
         category: nodeCategories[item.productBId],
         value: count // 用于tooltip显示
       });
     }
-    
+
     // 添加连线
     const linkKey = `${item.productAId}-${item.productBId}`;
     const weight = linkWeights[linkKey];

+ 7 - 7
src/views/order/shopvalue/index.vue

@@ -32,7 +32,7 @@
             <span class="kpi-value">{{ (topProductData.contributionRatio * 100).toFixed(2) }}%</span>
           </div>
         </div>
-        
+
         <!-- 下方的环形图 -->
         <div class="chart-card">
           <h3 class="chart-title">Top 5 商品销售分布</h3>
@@ -126,7 +126,7 @@ export default {
       try {
         const formData = new FormData();
         files.forEach(file => formData.append('files', file));
-        const { data } = await axios.post('/api/shop/import/import-sales-data/upload', formData, {
+        const { data } = await axios.post('/prod-api/api/shop/import/import-sales-data/upload', formData, {
           headers: { 'Content-Type': 'multipart/form-data' }
         });
         if (data && data.success) {
@@ -207,7 +207,7 @@ export default {
     },
     async fetchTopProductData() {
       try {
-        const response = await axios.get('/api/shop/import/top-product-contribution');
+        const response = await axios.get('/prod-api/api/shop/import/top-product-contribution');
         if (response.data.success) {
           const data = response.data.data;
           this.topProductData.totalSales = data.totalSales;
@@ -354,10 +354,10 @@ export default {
           channelContributionRes,
           channelRoiValueRes
         ] = await Promise.all([
-          axios.get('/api/shop/import/unit-contribution'),
-          axios.get('/api/shop/import/channel-total-contribution'),
-          axios.get('/api/shop/import/channel-contribution'),
-          axios.get('/api/shop/import/channel-roi-value')
+          axios.get('/prod-api/api/shop/import/unit-contribution'),
+          axios.get('/prod-api/api/shop/import/channel-total-contribution'),
+          axios.get('/prod-api/api/shop/import/channel-contribution'),
+          axios.get('/prod-api/api/shop/import/channel-roi-value')
         ]);
 
         if (unitRes.data.success && unitRes.data.data) {