7 Commits d9122a82df ... be8f9c1ef1

Author SHA1 Message Date
  Mcal be8f9c1ef1 fix: 调整统计页面布局,修改图表列数以优化展示 4 days ago
  Mcal 3fd19fba09 fix:添加语言i18n,修改输入限制,修改数据展示 1 week ago
  Mcal 17a5e501fd feat: 添加文件删除功能,优化上传组件逻辑 1 week ago
  Mcal f764bd83be fix:修改图片,修改下载名称 1 week ago
  Mcal a309588b45 refactor:升级eChats,封装eChats组件 1 week ago
  Mcal c77bff60de fix:修改展示list缺失,修改上传图片问题 1 week ago
  Mcal b6d9acf13f fix:修改密码,时间选择问题 1 week ago

+ 1 - 1
package.json

@@ -40,7 +40,7 @@
     "axios": "0.24.0",
     "clipboard": "2.0.8",
     "core-js": "3.25.3",
-    "echarts": "4.9.0",
+    "echarts": "^5.6.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",

+ 7 - 0
src/api/home.js

@@ -16,3 +16,10 @@ export function getStatisticData(query) {
     params: query
   })
 }
+export function getStatisticData2(query) {
+  return request({
+    url: 'backendApi/home/revenue/statistics',
+    method: 'get',
+    params: query
+  })
+}

+ 12 - 1
src/api/system/account.js

@@ -56,7 +56,18 @@ export function resetAccountPwd(userId, password) {
     data: data
   })
 }
-
+// 个人中心密码重置
+export function PeopleResetAccountPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: 'backendApi/account/mySelfResetPwd',
+    method: 'post',
+    data: data
+  })
+}
 // 用户状态修改
 export function changeAccountStatus(userId, status) {
   const data = {

+ 1 - 1
src/api/table.js

@@ -46,7 +46,7 @@ export function getTableInfo(tableId) {
 export function updateTableStatus(id, status) {
   const data = {
     id,
-    status
+    tableStatus:status
   }
   return request({
     url: 'backendApi/table_info/updateStatus',

+ 55 - 0
src/components/eCharts/eCharts.vue

@@ -0,0 +1,55 @@
+<template>
+    <div ref="chartDom" class="echarts-container"></div>
+  </template>
+  
+  <script>
+  import * as echarts from 'echarts';
+  
+  export default {
+    props: {
+      options: {  // 接收父组件传入的配置
+        type: Object,
+        required: true
+      }
+    },
+    data() {
+      return {
+        chartInstance: null  // 存储图表实例
+      };
+    },
+    mounted() {
+      this.initChart();
+      window.addEventListener('resize', this.handleResize);  // 响应式处理
+    },
+    beforeDestroy() {
+      window.removeEventListener('resize', this.handleResize);  // 清理事件监听
+      if (this.chartInstance) {
+        this.chartInstance.dispose();  // 销毁实例
+      }
+    },
+    methods: {
+      initChart() {
+        this.chartInstance = echarts.init(this.$refs.chartDom);
+        this.chartInstance.setOption(this.options);
+      },
+      handleResize() {
+        this.chartInstance?.resize();  // ES2020可选链操作符
+      }
+    },
+    watch: {  // 监听options变化
+      options: {
+        deep: true,
+        handler(newVal) {
+          this.chartInstance?.setOption(newVal);
+        }
+      }
+    }
+  };
+  </script>
+  
+  <style scoped>
+  .echarts-container {
+    width: 100%;
+    height: 400px;  /* 默认高度 */
+  }
+  </style>

+ 26 - 0
src/locales/en.json

@@ -30,6 +30,8 @@
 
   },
   "operational": {
+    "StoreRanking": "StoreRanking",
+    "SalesStatistics": "SalesStatistics",
     "overview": "Operational Overview",
     "totalTransactionAmount": "Total Transaction Amount (Yuan)",
     "commonFunctions": "Common Functions",
@@ -80,7 +82,12 @@
   "store.list.storeStatus": "Status",
   "store.list.addStore": "Add Store",
   "store.list.belongTo": "Belong To",
+  "export":{
+    "orderList": "Order List"
+  },
   "orderList": {
+    
+    "serviceFee": "Service fee",
     "orderNumber": "Order Number",
     "pleaseEnterOrderNumber": "Please enter the order number",
     "tableCode": "Table Code",
@@ -470,6 +477,25 @@
     }
   },
   "goodList":{
+      "nameRequired": "The name cannot be empty",
+      "nameLengthLimit": "The length of the name must be between 2 and 200 characters",
+      "uploadImage": "Please upload an image",
+      "productNameRequired": "The product name cannot be empty",
+      "productNameLengthLimit": "The length of the product name must be between 2 and 30 characters",
+      "productBarcodeRequired": "The product barcode cannot be empty",
+      "productBarcodeLengthLimit": "The length of the product barcode must be between 2 and 100 characters",
+      "selectProductCategory": "Please select the product category",
+      "uploadProductImages": "Please upload product images",
+      "couponIdsRequired": "Coupon ID cannot be empty",
+      "couponIdsLengthLimit": "The length of the coupon ID must be between 1 and 1000",
+      "pleaseSelect": "Please select",
+      "priceRequired": "Please enter the product price",
+      "priceMustBePositive": "The price must be greater than 0",
+      "stockRequired": "Please enter the stock quantity",
+      "stockMustBePositiveInteger": "The stock quantity must be a positive integer",
+      "initSaleMustBePositiveInteger": "The initial sales volume must be a positive integer",
+      "weightMustBeNonNegative": "The weight must be greater than or equal to 0",
+      "descriptionRequired": "Please enter the product details",
     "categoryName": "Category Name",
     "pleaseEnterCategoryName": "Please Enter Category Name",
     "belongingShop": "Belonging Shop",

+ 25 - 1
src/locales/ru.json

@@ -28,6 +28,8 @@
     },
 
     "operational": {
+          "StoreRanking": "Рейтингмагазинов",
+    "SalesStatistics": "Статистикапродаж",
       "overview": "Обзор операционной деятельности",
       "totalTransactionAmount": "Общая сумма транзакций (Юани)",
       "commonFunctions": "Основные функции",
@@ -77,8 +79,11 @@
     "today.revenue": "Сегодняшний доход",
     "welcome": "Добро пожаловать",
     "greeting": "Привет, {name}!",
-
+    "export":{
+      "orderList": "Список заказов"
+    },
     "orderList":{
+    "serviceFee": "Сбор за услуги",
         "orderNumber": "Номер заказа",
         "pleaseEnterOrderNumber": "Пожалуйста, введите номер заказа",
         "tableCode": "Код стола",
@@ -450,6 +455,25 @@
       },
 
       "goodList": {
+          "nameRequired": "Название не может быть пустым",
+          "nameLengthLimit": "Длина названия должна быть между 2 и 200 символами",
+          "uploadImage": "Пожалуйста, загрузите изображение",
+          "productNameRequired": "Название товара не может быть пустым",
+          "productNameLengthLimit": "Длина названия товара должна быть между 2 и 30 символами",
+          "productBarcodeRequired": "Штрих-код товара не может быть пустым",
+          "productBarcodeLengthLimit": "Длина штрих-кода товара должна быть между 2 и 100 символами",
+          "selectProductCategory": "Пожалуйста, выберите категорию товара",
+          "uploadProductImages": "Пожалуйста, загрузите изображения товара",
+          "couponIdsRequired": "ID купона не может быть пустым",
+          "couponIdsLengthLimit": "Длина ID купона должна быть между 1 и 1000 символами",
+          "pleaseSelect": "Пожалуйста, выберите",
+          "priceRequired": "Пожалуйста, введите цену товара",
+          "priceMustBePositive": "Цена должна быть больше 0",
+          "stockRequired": "Пожалуйста, введите количество товара на складе",
+          "stockMustBePositiveInteger": "Количество товара на складе должно быть положительным целым числом",
+          "initSaleMustBePositiveInteger": "Начальный объем продаж должен быть положительным целым числом",
+          "weightMustBeNonNegative": "Вес должен быть больше или равен 0",
+          "descriptionRequired": "Пожалуйста, введите описание товара",
         "categoryName": "Название категории",
         "pleaseEnterCategoryName": "Пожалуйста, введите название категории",
         "belongingShop": "Принадлежащий магазин",

+ 26 - 1
src/locales/sr.json

@@ -91,6 +91,8 @@
   },
 
   "operational": {
+    "StoreRanking": "Rejtingprodavnica",
+    "SalesStatistics": "Statistikaprodaje",
     "overview": "Pregled operacija",
     "totalTransactionAmount": "Ukupna transakcijska suma (RMB)",
     "commonFunctions": "Česte funkcije",
@@ -135,8 +137,12 @@
     "incomeTrendChart": "Grafikon trenda prihoda",
     "memberStatistics": "Statistika članova"
   },
-
+  "export":{
+    "orderList": "Lista narudžbina"
+  },
   "orderList":{
+    "serviceFee": "Naknada za usluge",
+
      "orderNumber": "Broj narudžbine",
       "pleaseEnterOrderNumber": "Unesite broj narudžbine",
       "tableCode": "Kod stola",
@@ -533,6 +539,25 @@
   },
 
   "goodList": {
+      "nameRequired": "Naziv ne može biti prazan",
+      "nameLengthLimit": "Dužina naziva mora biti između 2 i 200 karaktera",
+      "uploadImage": "Molimo Vas, učitajte sliku",
+      "productNameRequired": "Naziv proizvoda ne može biti prazan",
+      "productNameLengthLimit": "Dužina naziva proizvoda mora biti između 2 i 30 karaktera",
+      "productBarcodeRequired": "Štampasti kod proizvoda ne može biti prazan",
+      "productBarcodeLengthLimit": "Dužina štampastog koda proizvoda mora biti između 2 i 100 karaktera",
+      "selectProductCategory": "Molimo Vas, odaberite kategoriju proizvoda",
+      "uploadProductImages": "Molimo Vas, učitajte slike proizvoda",
+    "couponIdsRequired": "ID kupona ne može biti prazan",
+    "couponIdsLengthLimit": "Dužina ID kupona mora biti između 1 i 1000 karaktera",
+    "pleaseSelect": "Molimo Vas, odaberite",
+    "priceRequired": "Molimo Vas, unesite cenu proizvoda",
+    "priceMustBePositive": "Cena mora biti veća od 0",
+    "stockRequired": "Molimo Vas, unesite količinu robe na lageru",
+    "stockMustBePositiveInteger": "Količina robe na lageru mora biti pozitivni ceo broj",
+    "initSaleMustBePositiveInteger": "Početni obim prodaje mora biti pozitivni ceo broj",
+    "weightMustBeNonNegative": "Težina mora biti veća ili jednaka 0",
+    "descriptionRequired": "Molimo Vas, unesite opis proizvoda",
     "categoryName": "Naziv kategorije",
     "pleaseEnterCategoryName": "Unesite naziv kategorije",
     "belongingShop": "Pripadajuća prodavnica",

+ 25 - 0
src/locales/zh.json

@@ -26,6 +26,8 @@
       "captchaRequired": "请输入验证码"
   },
   "operational": {
+    "StoreRanking": "店铺排名",
+    "SalesStatistics": "销售统计",
     "overview": "运营概况",
     "totalTransactionAmount": "总交易金额(元)",
     "commonFunctions": "常用功能",
@@ -75,7 +77,11 @@
 
   "welcome": "欢迎",
   "greeting": "你好, {name}!",
+  "export":{
+    "orderList": "订单列表"
+  },
   "orderList": {
+    "serviceFee": "服务费",
     "orderNumber": "订单号",
     "pleaseEnterOrderNumber": "请输入订单号",
     "tableCode": "桌码",
@@ -475,6 +481,25 @@
   },
 
   "goodList":{
+      "nameRequired": "名称不能为空",
+      "nameLengthLimit": "名称长度必须介于 2 和 200 之间",
+      "uploadImage": "请上传图片",
+      "productNameRequired": "商品名称不能为空",
+      "productNameLengthLimit": "商品名称长度必须介于2和30之间",
+      "productBarcodeRequired": "商品条码不能为空",
+      "productBarcodeLengthLimit": "商品条码长度必须介于2和100之间",
+      "selectProductCategory": "请选择商品分类",
+      "uploadProductImages": "请上传商品图片",
+    "couponIdsRequired": "卡券ID不能为空",
+    "couponIdsLengthLimit": "卡券ID长度必须介于1和1000之间",
+    "pleaseSelect": "请选择",
+    "priceRequired": "请输入商品价格",
+    "priceMustBePositive": "价格必须大于0",
+    "stockRequired": "请输入库存数量",
+    "stockMustBePositiveInteger": "库存数量必须是正整数",
+    "initSaleMustBePositiveInteger": "初始销量必须是正整数",
+    "weightMustBeNonNegative": "重量必须大于等于0",
+    "descriptionRequired": "请输入商品详情",
     "categoryName": "分类名称",
     "pleaseEnterCategoryName": "请输入分类名称",
     "belongingShop": "所属店铺",

+ 2 - 2
src/utils/request.js

@@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
 import { tansParams } from "@/utils/fuint";
 import cache from '@/plugins/cache'
-
+import i18n from '../i18n'
 // 是否显示重新登录
 export let isRelogin = { show: false };
 
@@ -165,7 +165,7 @@ export async function download(baseURL, params) {
       // 创建一个 a 标签
       const a = document.createElement('a');
       a.href = url;
-      a.download = 'download.xls';
+      a.download = i18n.t('export.orderList')+'.xls';
       a.click();
 
       // 释放临时的 URL 对象

+ 4 - 1
src/views/components/charts/index.vue

@@ -89,7 +89,10 @@ export default {
     },
     headList() {
       this.initChart()
-    }
+    },
+    dataList() {
+      this.initChart()
+    },
   },
   methods: {
     initChart() {

+ 11 - 9
src/views/goods/cate/index.vue

@@ -168,7 +168,7 @@
               <el-input
                 v-model="form.name"
                 :placeholder="$t('goodList.pleaseEnterCategoryName')"
-                maxlength="200"
+                maxlength="30"
               />
             </el-form-item>
           </el-col>
@@ -320,17 +320,19 @@ export default {
       },
       // 表单校验
       rules: {
-        name: [
-          { required: true, message: '名称不能为空', trigger: 'blur' },
-          {
+    name: [
+        { required: true, message: this.$t('goodList.nameRequired'), trigger: 'blur' },
+        {
             min: 2,
             max: 200,
-            message: '名称长度必须介于2 和 200 之间',
+            message: this.$t('goodList.nameLengthLimit'),
             trigger: 'blur'
-          }
-        ],
-        logo: [{ required: true, message: '请上传图片', trigger: 'blur' }]
-      }
+        }
+    ],
+    logo: [
+        { required: true, message: this.$t('goodList.uploadImage'), trigger: 'blur' }
+    ]
+}
     }
   },
   created() {

+ 53 - 39
src/views/goods/goods/goodsForm.vue

@@ -26,7 +26,7 @@
                       class="input"
                       v-model="baseForm.name"
                       :placeholder="$t('goodList.productNamePlaceholder')"
-                      maxlength="200"
+                      maxlength="25"
                     />
                   </el-form-item>
                 </el-col>
@@ -368,50 +368,64 @@ export default {
       uploadFiles: [],
       // 基础信息表单校验
       baseRules: {
-        name: [
-          { required: true, message: '商品名称不能为空', trigger: 'blur' },
-          { min: 2, max: 30, message: '商品名称长度必须介于2和200 之间', trigger: 'blur' }
-        ],
-        goodsNo: [
-          { required: true, message: '商品条码不能为空', trigger: 'blur' },
-          { min: 2, max: 100, message: '商品条码长度必须介于2和100之间', trigger: 'blur' }
-        ],
-        cateId: [{ required: true, message: '请选择商品分类', trigger: 'blur' }],
-        images: [{ required: true, message: '请上传商品图片', trigger: 'blur' }]
-      },
+    name: [
+        { required: true, message: this.$t('goodList.productNameRequired'), trigger: 'blur' },
+        { min: 2, max: 30, message: this.$t('goodList.productNameLengthLimit'), trigger: 'blur' }
+    ],
+    goodsNo: [
+        { required: true, message: this.$t('goodList.productBarcodeRequired'), trigger: 'blur' },
+        { min: 2, max: 100, message: this.$t('goodList.productBarcodeLengthLimit'), trigger: 'blur' }
+    ],
+    cateId: [
+        { required: true, message: this.$t('goodList.selectProductCategory'), trigger: 'blur' }
+    ],
+    images: [
+        { required: true, message: this.$t('goodList.uploadProductImages'), trigger: 'blur' }
+    ]
+},
       // 扩展信息表单校验
       extendRules: {
-        couponIds: [
-          { required: true, message: '卡券ID不能为空', trigger: 'blur' },
-          { min: 1, max: 1000, message: '卡券ID长度必须介于1和100之间', trigger: 'blur' }
-        ],
-        canUsePoint: [{ required: true, message: '请选择', trigger: 'blur' }],
-        isMemberDiscount: [{ required: true, message: '请选择', trigger: 'blur' }],
-        isSingleSpec: [{ required: true, message: '请选择', trigger: 'blur' }],
-        price: [
-          { required: true, message: '请输入商品价格', trigger: 'blur' },
-          {
+    couponIds: [
+        { required: true, message: this.$t('goodList.couponIdsRequired'), trigger: 'blur' },
+        { min: 1, max: 1000, message: this.$t('goodList.couponIdsLengthLimit'), trigger: 'blur' }
+    ],
+    canUsePoint: [
+        { required: true, message: this.$t('goodList.pleaseSelect'), trigger: 'blur' }
+    ],
+    isMemberDiscount: [
+        { required: true, message: this.$t('goodList.pleaseSelect'), trigger: 'blur' }
+    ],
+    isSingleSpec: [
+        { required: true, message: this.$t('goodList.pleaseSelect'), trigger: 'blur' }
+    ],
+    price: [
+        { required: true, message: this.$t('goodList.priceRequired'), trigger: 'blur' },
+        {
             pattern: /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/,
-            message: `价格必须大于0`,
+            message: this.$t('goodList.priceMustBePositive'),
             trigger: 'blur'
-          }
-        ],
-        stock: [
-          { required: true, message: '请输入库存数量', trigger: 'blur' },
-          { pattern: /^[0-9]{1,10}$/, message: `库存数量必须是正整数`, trigger: 'blur' }
-        ],
-        initSale: [{ pattern: /^[0-9]{1,10}$/, message: `初始销量必须是正整数`, trigger: 'blur' }],
-        weight: [
-          {
+        }
+    ],
+    stock: [
+        { required: true, message: this.$t('goodList.stockRequired'), trigger: 'blur' },
+        { pattern: /^[0-9]{1,10}$/, message: this.$t('goodList.stockMustBePositiveInteger'), trigger: 'blur' }
+    ],
+    initSale: [
+        { pattern: /^[0-9]{1,10}$/, message: this.$t('goodList.initSaleMustBePositiveInteger'), trigger: 'blur' }
+    ],
+    weight: [
+        {
             pattern: /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/,
-            message: `重量必须大于等于0`,
+            message: this.$t('goodList.weightMustBeNonNegative'),
             trigger: 'blur'
-          }
-        ]
-      },
-      detailRules: {
-        description: [{ required: true, message: '请输入商品详情', trigger: 'blur' }]
-      }
+        }
+    ]
+},
+detailRules: {
+    description: [
+        { required: true, message: this.$t('goodList.descriptionRequired'), trigger: 'blur' }
+    ]
+}
     }
   },
   created() {

+ 333 - 289
src/views/index.vue

@@ -1,10 +1,39 @@
 <template>
   <div class="app-container">
     <div class="overview">
-      <div class="title">{{ $t('operational.overview') }}</div>
+      <div class="title">{{ $t('operational.dataOverview') }}</div>
       <div class="content" v-loading="loading">
         <el-row class="line">
-          <!-- <el-col class="item" :span="6">
+          <div class="date-picker">
+            <el-form :inline="true"  class="demo-form-inline">
+              <el-form-item label="时间范围">
+                <el-date-picker
+                v-model="timeRange"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                type="datetimerange"
+                style="width: 400px"
+                :start-placeholder="$t('orderList.startTime')"
+                :end-placeholder="$t('orderList.endTime')"
+                :picker-options="pickerOptions"
+                ></el-date-picker>  
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="do-search">
+            <el-button icon="el-icon-refresh" size="small" @click="reset">
+              {{ $t('operational.reset') }}
+            </el-button>
+            <el-button type="primary" icon="el-icon-search" size="small" @click="getMainData">
+              {{ $t('operational.query') }}
+            </el-button>
+            <span class="ex" @click="setDay(3)">{{ $t('operational.lastThreeDays') }}</span>
+            <span class="ex" @click="setDay(7)">{{ $t('operational.lastSevenDays') }}</span>
+            <span class="ex" @click="setDay(15)">{{ $t('operational.lastFifteenDays') }}</span>
+            <span class="ex" @click="setDay(30)">{{ $t('operational.lastThirtyDays') }}</span>
+          </div>
+        </el-row>
+        <el-row class="line">
+          <el-col class="item" :span="6">
             <div class="do">
               <svg
                 t="1641957967018"
@@ -27,10 +56,10 @@
                   p-id="7599"
                 ></path>
               </svg>
-              <p class="text">今日新增订单数(笔)</p>
-              <p class="number">{{ homeData.todayOrder }}</p>
+              <p class="text">{{ $t('operational.orderCount') }}</p>
+              <p class="number">{{ mainData.orderCount }}</p>
             </div>
-          </el-col> -->
+          </el-col>
           <el-col class="item" :span="6">
             <div class="do">
               <svg
@@ -54,13 +83,9 @@
                   p-id="10176"
                 ></path>
               </svg>
-              <p class="text">{{$t('today.revenue')}}({{$t('curency')}})</p>
+              <p class="text">{{ $t('operational.transactionAmount') }}</p>
               <p class="number">
-                {{
-                  homeData.todayPay
-                    ? homeData.todayPay.toFixed(2)
-                    : (0.0).toFixed(2)
-                }}
+                {{ mainData.payAmount ? mainData.payAmount.toFixed(2) : (0.0).toFixed(2) }}
               </p>
             </div>
           </el-col>
@@ -81,131 +106,15 @@
                   p-id="3587"
                   fill="#8a8a8a"
                 ></path>
-                <path
-                  d="M576 128L352 352h448L576 128z"
-                  p-id="3588"
-                  fill="#8a8a8a"
-                ></path>
+                <path d="M576 128L352 352h448L576 128z" p-id="3588" fill="#8a8a8a"></path>
               </svg>
-              <p class="text">{{ $t('operational.totalTransactionAmount') }}</p>
+              <p class="text">{{ $t('operational.totalPayAmount') }}</p>
               <p class="number">
-                {{ homeData.totalPay ? homeData.totalPay : "0.00" }}
+                {{ mainData.totalPayAmount ? mainData.totalPayAmount : '0.00' }}
               </p>
             </div>
           </el-col>
-          <!-- <el-col class="item" :span="6">
-            <div class="do">
-              <svg
-                t="1641957839736"
-                class="icon"
-                viewBox="0 0 1024 1024"
-                version="1.1"
-                xmlns="http://www.w3.org/2000/svg"
-                p-id="6014"
-                width="64"
-                height="64"
-              >
-                <path
-                  d="M624.6 211.8c58.3 0 105.7 46.3 105.7 103.2s-47.4 103.2-105.7 103.2S518.9 371.9 518.9 315s47.4-103.2 105.7-103.2m0-50c-86 0-155.7 68.6-155.7 153.2s69.7 153.2 155.7 153.2S780.3 399.6 780.3 315s-69.7-153.2-155.7-153.2zM427 314.9c0-24.3 5.9-47.3 16.5-67.7-22.8-19.5-52.9-31.4-85.8-31.4-71.2 0-128.9 55.2-128.9 123.4s57.7 123.4 128.9 123.4c43.2 0 81.4-20.3 104.8-51.6-22.3-26.2-35.5-59.6-35.5-96.1zM297.5 727.2v16.9c0-103.5 72.5-191.8 173.7-226.2-29.2-13.3-62.1-20.9-96.9-20.9h-28.5c-118.6 0-215.6 87.2-215.6 194.7v-13.6c0 56.3-4.5 102.3 57.6 102.3H298c-0.9-16.2-0.5-34.2-0.5-53.2z"
-                  p-id="6015"
-                  fill="#8a8a8a"
-                ></path>
-                <path
-                  d="M639.4 561c27.9 0 55.1 5.2 80.6 15.4 24.5 9.8 46.6 23.9 65.5 41.7 38.3 36.2 59.4 83.9 59.4 134.5h0.2c0.1 5.1 0.3 10 0.4 14.9 0.4 13 0.8 25.2 0.3 34.9-0.3 4.5-0.7 7.7-1.1 9.8-1.9 0.3-4.8 0.5-8.7 0.5H418.4c-8.1 0-12.1-1.1-13.7-1.6-0.7-1.6-2.3-5.9-3.4-15.6-1.3-11.8-1.3-26.8-1.2-42.8h0.1c0-50.6 21.1-98.3 59.4-134.5 18.9-17.9 40.9-31.9 65.5-41.7 25.5-10.2 52.6-15.4 80.6-15.4h33.7m0-50.1h-33.8c-140.5 0-255.5 108.3-255.5 241.6v-16.9c0 69.8-5.3 127 68.2 127H836c73.6 0 58.9-57.1 58.9-127v16.9c0-133.4-115-241.6-255.5-241.6z"
-                  p-id="6016"
-                  fill="#8a8a8a"
-                ></path>
-                <path
-                  d="M785.1 706.4c0 10.2-8.4 18.5-18.7 18.5h-37.9v36.4c0 10.2-8.4 18.5-18.7 18.5h-9.4c-10.3 0-18.7-8.3-18.7-18.5v-36.4h-39.8c-10.3 0-18.7-8.3-18.7-18.5v-9.2c0-10.2 8.4-18.5 18.7-18.5h39.8v-40.2c0-10.2 8.4-18.5 18.7-18.5h9.4c10.3 0 18.7 8.3 18.7 18.5v40.2h37.9c10.3 0 18.7 8.3 18.7 18.5v9.2z"
-                  p-id="6017"
-                  fill="#8a8a8a"
-                ></path>
-              </svg>
-              <p class="text">今日新增会员数</p>
-              <p class="number">{{ homeData.todayUser }}</p>
-            </div>
-          </el-col> -->
-          <!-- <el-col class="item" :span="6">
-            <div class="do">
-              <svg
-                t="1641958094548"
-                class="icon"
-                viewBox="0 0 1024 1024"
-                version="1.1"
-                xmlns="http://www.w3.org/2000/svg"
-                p-id="9210"
-                width="64"
-                height="64"
-              >
-                <path
-                  d="M888.34834 0.000284H127.658773A126.776854 126.776854 0 0 0 0.853475 126.777138v295.82214a126.776854 126.776854 0 0 0 126.805298 126.805298v169.045287a211.313719 211.313719 0 0 0 169.045287 207.075498v46.506653a42.268433 42.268433 0 0 0 84.508421 0V887.466705c0-23.324438-18.91555-42.268433-42.268433-42.268433a126.776854 126.776854 0 0 1-126.776854-126.776854v-169.045286h302.16525a241.3226 241.3226 0 0 0-42.268433 146.63107 42.268433 42.268433 0 1 0 84.536865 0c-1.706666-146.63107 120.433744-146.63107 120.433745-146.63107a42.268433 42.268433 0 0 0 42.268433-42.268433 54.527985 54.527985 0 0 0 0-8.021331 44.799988 44.799988 0 0 0 0-8.021331v-142.421294a48.611542 48.611542 0 0 1 42.268432-52.849763 48.611542 48.611542 0 0 1 42.268433 52.849763v369.777675a126.776854 126.776854 0 0 1-126.805298 126.776854c-23.324438 0-42.239988 18.91555-42.239988 42.268433v84.536865a42.268433 42.268433 0 0 0 84.508421 0v-46.506654a211.313719 211.313719 0 0 0 169.045286-207.075498v-169.045286a126.776854 126.776854 0 0 0 126.805298-126.776854v-295.82214A126.776854 126.776854 0 0 0 888.319895 0.000284z m42.268433 422.627439c0 23.324438-18.91555 42.239988-42.268433 42.239988v-116.195523a132.693296 132.693296 0 0 0-126.776854-137.386629 122.993744 122.993744 0 0 0-105.642637 62.151094 150.015958 150.015958 0 1 0-21.134216 76.060423v115.370635H127.630329c-23.324438 0-42.239988-18.91555-42.239988-42.239988v-295.82214c0-23.352882 18.91555-42.268433 42.268432-42.268433H888.319895c23.324438 0 42.268433 18.91555 42.268433 42.239988v295.82214z m-359.224789-147.91107a63.402649 63.402649 0 1 1-126.776854 0 63.402649 63.402649 0 0 1 126.776854 0z"
-                  p-id="9211"
-                  fill="#8a8a8a"
-                ></path>
-              </svg>
-              <p class="text">今日活跃会员数</p>
-              <p class="number">{{ homeData.todayActiveUser }}</p>
-            </div>
-          </el-col> -->
-        </el-row>
-        <el-row class="line">
-          <!-- <el-col class="item second-line" :span="6">
-            <div class="do">
-              <svg
-                t="1641957661068"
-                class="icon"
-                viewBox="0 0 1024 1024"
-                version="1.1"
-                xmlns="http://www.w3.org/2000/svg"
-                p-id="5770"
-                width="64"
-                height="64"
-              >
-                <path
-                  d="M261.7 522.6h0.2c19.3 0 35-15.7 35-35s-15.7-35-35-35c-31.9 0-58.8-37.7-58.8-82.4s26.9-82.4 58.8-82.4c19.3 0 35-15.7 35-35s-15.7-35-35-35c-35.4 0-69.5 17.3-93.7 47.5-22.6 28.4-35.1 65.6-35.1 104.9s12.5 76.5 35.1 104.9c0.6 0.8 1.3 1.6 2 2.4-22.9 13.2-43.4 31-61.1 53.2-38.3 48-59.5 111.4-59.5 178.4 0 19.3 15.7 35 35 35s35-15.7 35-35c0-51.2 15.7-99.1 44.1-134.7 26.6-33.3 61.3-51.7 97.7-51.7 0.2 0 0.3-0.1 0.3-0.1zM914.8 530.7c-17.7-22.2-38.2-40-61.1-53.2 0.7-0.8 1.3-1.6 2-2.4 22.6-28.4 35.1-65.6 35.1-104.9s-12.5-76.5-35.1-104.9c-24.1-30.2-58.3-47.5-93.7-47.5-19.3 0-35 15.7-35 35s15.7 35 35 35c31.9 0 58.8 37.7 58.8 82.4s-26.9 82.4-58.8 82.4c-19.3 0-35 15.7-35 35s15.7 35 35 35H762.3c36.4 0 71.1 18.4 97.7 51.7 28.5 35.6 44.1 83.5 44.1 134.7 0 19.3 15.7 35 35 35s35-15.7 35-35c0.2-67-21-130.3-59.3-178.3z"
-                  p-id="5771"
-                  fill="#8a8a8a"
-                ></path>
-                <path
-                  d="M747.4 541c-30.9-30.8-66.9-54.7-106.1-70.8 40.3-34.7 65.8-86 65.8-143.2 0-104.2-84.8-188.9-188.9-188.9-104.2 0-188.9 84.8-188.9 188.9 0 57 25.4 108.2 65.4 142.9C355.2 486 318.9 510 287.8 541c-61.2 61.1-95.1 142.4-95.5 228.9V850.8c0 19.3 15.7 35 35 35h580.5c19.3 0 35-15.7 35-35v-80.2-0.8c-0.3-86.4-34.2-167.6-95.4-228.8zM518.2 208.1c65.6 0 118.9 53.4 118.9 118.9s-53.4 118.9-118.9 118.9S399.3 392.6 399.3 327s53.4-118.9 118.9-118.9z m254.7 607.8H262.3v-44.6-0.6c0.2-140.5 114.8-254.8 255.3-254.8s255 114.3 255.3 254.8v45.2z"
-                  p-id="5772"
-                  fill="#8a8a8a"
-                ></path>
-              </svg>
-              <p class="text">总会员数</p>
-              <p class="number">{{ homeData.totalUser }}</p>
-            </div>
-          </el-col> -->
-          <!-- <el-col class="item second-line" :span="6">
-            <div class="do">
-              <svg
-                t="1641969647517"
-                class="icon"
-                viewBox="0 0 1024 1024"
-                version="1.1"
-                xmlns="http://www.w3.org/2000/svg"
-                p-id="3586"
-                width="64"
-                height="64"
-              >
-                <path
-                  d="M128 544h128v288H128zM320 480h128v352H320zM512 320h128v512H512zM704 416h128v416H704z"
-                  p-id="3587"
-                  fill="#8a8a8a"
-                ></path>
-                <path
-                  d="M576 128L352 352h448L576 128z"
-                  p-id="3588"
-                  fill="#8a8a8a"
-                ></path>
-              </svg>
-              <p class="text">总交易金额(元)</p>
-              <p class="number">
-                {{ homeData.totalPay ? homeData.totalPay : "0.00" }}
-              </p>
-            </div>
-          </el-col> -->
-          <!-- <el-col class="item second-line" :span="6">
+          <el-col class="item second-line" :span="6">
             <div class="do">
               <svg
                 t="1641957411945"
@@ -223,11 +132,13 @@
                   p-id="4781"
                 ></path>
               </svg>
-              <p class="text">总订单数</p>
-              <p class="number">{{ homeData.totalOrder }}</p>
+              <p class="text">{{ $t('operational.totalOrderCount') }}</p>
+              <p class="number">{{ mainData.totalOrderCount }}</p>
             </div>
-          </el-col> -->
-          <!-- <el-col class="item second-line" :span="6">
+          </el-col>
+        </el-row>
+        <!-- <el-row class="line">
+          <el-col class="item second-line" :span="6">
             <div class="do">
               <svg
                 t="1641958462543"
@@ -260,171 +171,308 @@
                   fill="#8a8a8a"
                 ></path>
               </svg>
-              <p class="text">总支付人数</p>
-              <p class="number">{{ homeData.totalPayUser }}</p>
+              <p class="text">{{ $t('operational.totalPayUserCount') }}</p>
+              <p class="number">{{ mainData.totalPayUserCount }}</p>
             </div>
-          </el-col> -->
-        </el-row>
+          </el-col>
+        </el-row> -->
       </div>
     </div>
     <div class="overview">
-        <div class="title">{{ $t('operational.commonFunctions') }}</div>
-        <div class="content">
-            <el-row class="line home-tools">
-                        <!-- <el-col class="item no-border" :span="8"
-            ><div class="do" @click="toCashier('/fuintCashier/')">
-              <img class="t-icon" src="@/assets/images/home/pay.png" />
-              <div class="text">收银下单</div>
-            </div></el-col
-          > -->
-          <!-- <el-col class="item no-border" :span="8"
-            ><div class="do" @click="toTarget('/coupon/confirm/index')">
-              <img class="t-icon" src="@/assets/images/home/coupon.png" />
-              <div class="text">核销卡券</div>
-            </div></el-col
-          > -->
-          <!-- <el-col class="item no-border" :span="8"
-            ><div class="do" @click="toTarget('/member/index')">
-              <img class="t-icon" src="@/assets/images/home/member.png" />
-              <div class="text">会员管理</div>
-            </div></el-col
-          > -->
-                <el-col class="item no-border" :span="8">
-                    <div class="do" @click="toTarget('/order/index')">
-                        <img class="t-icon" src="@/assets/images/home/order.png" />
-                        <div class="text">{{ $t('operational.orderManagement') }}</div>
-                    </div>
-                </el-col>
-                <el-col class="item no-border" :span="8">
-                    <div class="do" @click="toTarget('/goods/goods/index')">
-                        <img class="t-icon" src="@/assets/images/home/goods.png" />
-                        <div class="text">{{ $t('operational.goodsManagement') }}</div>
-                    </div>
-                </el-col>
-            </el-row>
-        </div>
+      <div class="title">{{ $t('operational.operationTrend') }}</div>
+      <div class="content">
+        <el-row>
+          <el-col class="item" :span="24">
+            <commonChart
+              v-if="chartData1.length > 0"
+              :title="chart1.title"
+              :color="chart1.color"
+              :chart-type="chart1.chartType"
+              :head-list="chart1.header"
+              :data-list="chartData1"
+              width="100%"
+              id="chart1"
+              height="400px"
+            />
+          </el-col>
+          <!-- <el-col class="item" :span="12">
+            <commonChart
+              v-if="chartData2.length > 0"
+              :title="chart2.title"
+              :color="chart2.color"
+              :chart-type="chart2.chartType"
+              :head-list="chart2.header"
+              :data-list="chartData2"
+              width="100%"
+              id="chart2"
+              height="400px"
+            />
+          </el-col> -->
+        </el-row>
+      </div>
     </div>
-    <div class="overview">
-        <div class="title">{{ $t('operational.reportStatistics') }}</div>
-        <div class="content">
-            <el-row>
-                <el-col class="item" :span="12">
-                    <commonChart
-                        v-if="chartData1.length > 0"
-                        :title="chart1.title"
-                        :color="chart1.color"
-                        :chart-type="chart1.chartType"
-                        :head-list="chart1.header"
-                        :data-list="chartData1"
-                        width="100%"
-                        id="chart1"
-                        height="400px"
-                    />
-                </el-col>
-                <el-col class="item" :span="12">
-                    <commonChart
-                        v-if="chartData2.length > 0"
-                        :title="chart2.title"
-                        :color="chart2.color"
-                        :chart-type="chart2.chartType"
-                        :head-list="chart2.header"
-                        :data-list="chartData2"
-                        width="100%"
-                        id="chart2"
-                        height="400px"
-                    />
-                </el-col>
-            </el-row>
-        </div>
+    <div class="overview" v-if="chartData3.length > 0">
+      <div class="title">{{ $t('operational.StoreRanking') }}</div>
+      <div class="content">
+        <el-row>
+          <div class="date-picker">
+            <el-form :inline="true"  class="demo-form-inline">
+              <el-form-item label="时间范围">
+                <el-date-picker
+                v-model="timeRange2"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                type="datetimerange"
+                style="width: 400px"
+                :start-placeholder="$t('orderList.startTime')"
+                :end-placeholder="$t('orderList.endTime')"
+                :picker-options="pickerOptions"
+                ></el-date-picker>  
+              </el-form-item>
+              
+            </el-form>
+          </div>
+          <div class="do-search">
+            <el-button icon="el-icon-refresh" size="small" @click="reset2">
+              {{ $t('operational.reset') }}
+            </el-button>
+            <el-button type="primary" icon="el-icon-search" size="small" @click="getChartsData2">
+              {{ $t('operational.query') }}
+            </el-button>
+            <span class="ex" @click="setDay2(3)">{{ $t('operational.lastThreeDays') }}</span>
+            <span class="ex" @click="setDay2(7)">{{ $t('operational.lastSevenDays') }}</span>
+            <span class="ex" @click="setDay2(15)">{{ $t('operational.lastFifteenDays') }}</span>
+            <span class="ex" @click="setDay2(30)">{{ $t('operational.lastThirtyDays') }}</span>
+          </div>
+        </el-row>
+        <el-row>
+          <el-col class="item" :span="24">
+            <commonChart
+              v-if="chartData3.length > 0"
+              :title="chart3.title"
+              :color="chart3.color"
+              :chart-type="chart3.chartType"
+              :head-list="chart3.header"
+              :data-list="chartData3"
+              width="100%"
+              id="chart3"
+              height="400px"
+            />
+          </el-col>
+        </el-row>
+      </div>
     </div>
+    <!-- <ECharts :options="chartOptions" /> -->
+    <!-- <div class="overview">
+      <div class="title">{{ $t('operational.dataRanking') }}</div>
+      <div class="content">
+        <el-row>
+          <el-col class="item" :span="12">
+            <div class="title">{{ $t('operational.goodsSalesRanking') }}</div>
+            <el-table v-loading="loading" :data="goodsList" style="border: solid 1px #cccccc">
+              <el-table-column :label="$t('operational.id')" prop="id" width="60" />
+              <el-table-column :label="$t('operational.goodsName')" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.name }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column :label="$t('operational.salesVolume')" align="center" prop="num" />
+              <el-table-column :label="$t('operational.salesAmount')" align="center" prop="amount">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.amount.toFixed(2) }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col class="item" :span="12">
+            <div class="title">{{ $t('operational.userConsumptionRanking') }}</div>
+            <el-table v-loading="loading" :data="memberList" style="border: solid 1px #cccccc">
+              <el-table-column :label="$t('operational.id')" prop="id" width="60" />
+              <el-table-column :label="$t('operational.userName')" align="center" width="100">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.name }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                :label="$t('operational.memberNumber')"
+                align="center"
+                prop="userNo"
+              />
+              <el-table-column
+                :label="$t('operational.consumptionAmount')"
+                align="center"
+                prop="amount"
+              >
+                <template slot-scope="scope">
+                  <span>{{ scope.row.amount.toFixed(2) }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-col>
+        </el-row>
+      </div>
+    </div> -->
   </div>
 </template>
 
 <script>
-import { getHomeData, getStatisticData } from "@/api/home";
-import commonChart from "./components/charts/index";
+import { getNumDayTime } from '@/utils/fuint'
+import { getStatisticData, getStatisticData2 } from '@/api/home'
+import { getMainData, getTopData } from '@/api/statistic'
+import commonChart from '@/views/components/charts/index'
+import ECharts  from '@/components/eCharts/eCharts'
+
 export default {
-  name: "HomePage",
+  name: 'Statistic',
   components: {
     commonChart,
+    ECharts 
   },
   data() {
     return {
+        // 配置日期选择器的选项
+      pickerOptions: {
+        disabledDate(time) {
+          // 禁止选择当前时间之后的日期
+          return time.getTime() > Date.now()
+        }
+      },
       loading: false,
-      homeData: {
-        todayUser: 0,
-        totalUser: 0,
-        todayOrder: 0,
-        totalOrder: 0,
-        todayPay: 0,
-        totalPay: 0,
-        todayActiveUser: 0,
-        totalPayUser: 0,
+      startTime: getNumDayTime(30),
+      endTime: getNumDayTime(0),
+      timeRange: [getNumDayTime(30), getNumDayTime(0)],
+      timeRange2: [getNumDayTime(30), getNumDayTime(0)],
+      mainData: {
+        userCount: 0,
+        totalUserCount: 0,
+        orderCount: 0,
+        totalOrderCount: 0,
+        payAmount: 0,
+        totalPayAmount: 0,
+        activeUserCount: 0,
+        totalPayUserCount: 0
       },
       chart1: {
-          title: this.$t('operational.lastSevenDaysOrderCount'),
-          color: "#ff5b57",
-          chartType: "bar",
-          header: [this.$t('operational.orderStatistics')],
+        title: this.$t('operational.lastSevenDaysOrderCount'),
+        color: '#ff5b57',
+        chartType: 'bar',
+        header: [this.$t('operational.orderStatistics')]
       },
       chart2: {
-          title: this.$t('operational.incomeComparisonAmount'),
-          color: "#113a28",
-          chartType: "line",
-          header: [this.$t('operational.income')],
+        title: this.$t('operational.incomeTrendChart'),
+        color: '#113a28',
+        chartType: 'line',
+        header: [this.$t('operational.memberStatistics')]
+      },
+      chart3: {
+        title: this.$t('operational.StoreRanking'),
+        color: '#ff5b57',
+        chartType: 'bar',
+        header: [this.$t('operational.SalesStatistics')]
       },
       chartData1: [],
       chartData2: [],
-    };
-  },
-  computed: {
+      chartData3: [],
+      goodsList: [],
+      memberList: []
+    }
   },
   created() {
-    this.getHomeData();
-    this.getChartsData();
+    this.getMainData()
+    this.getChartsData()
+    this.getChartsData2()
+    this.getTopData()
   },
   methods: {
+    // 重置
+    reset() {
+      this.startTime = ''
+      this.endTime = ''
+      this.timeRange = [this.startTime, this.endTime]
+    },
+    reset2() {
+      this.timeRange2 = [this.startTime, this.endTime]
+    },
+    // 设置日期
+    setDay(day) {
+      this.startTime = getNumDayTime(day - 1)
+      this.endTime = getNumDayTime(0)
+      this.timeRange = [this.startTime, this.endTime]
+      this.getMainData()
+      this.getTopData()
+    },
+    setDay2(day) {
+      this.timeRange2 = [getNumDayTime(day - 1), getNumDayTime(0)]
+      this.getChartsData2()
+    },
     // 查询首页数据
-    getHomeData() {
-      this.loading = true;
-      getHomeData().then((response) => {
-        this.homeData = response.data;
-        this.loading = false;
-      });
+    getMainData() {
+      this.loading = true
+      const param = { startTime: this.timeRange[0], endTime: this.timeRange[1] }
+      getMainData(param).then((response) => {
+        this.mainData = response.data
+        this.loading = false
+      })
+    },
+    getChartsData2(){
+        const app = this
+        app.loading = true
+        // 查询店铺排名数据
+        getStatisticData2({startTime:this.timeRange2[0],endTime:this.timeRange2[1]}).then((response) => {
+        // console.log(response)
+        // return;
+        const data = response.data
+
+        const dataList = []
+        for(let i = 0; i<data.dataY.length; i++){
+          dataList.push({name:data.dataX[i],value0:data.dataY[i]})
+        }
+
+        // data.labels.forEach(function (label, index) {
+        //   const value1 = labelData1[index] ? labelData1[index] : 0
+        //   const value2 = labelData2[index] ? labelData2[index] : 0
+        //   dataList1.push({ name: label, value0: value1 })
+        //   dataList2.push({ name: label, value0: value2 })
+        // })
+        app.chartData3 = dataList
+        app.loading = false
+      })
     },
     // 查询统计数据
     getChartsData() {
-      const app = this;
-      app.loading = true;
-      // 近7日订单数量和活跃会员数量
-      getStatisticData({ tag: "order,user_active" }).then((response) => {
-        const data = response.data;
-        const labelData1 = data.data[0] ? data.data[0] : [];
-        const labelData2 = data.data[1] ? data.data[1] : [];
-        const dataList1 = [];
-        const dataList2 = [];
+      const app = this
+      app.loading = true
+      getStatisticData({ tag: 'order,user_active' }).then((response) => {
+        const data = response.data
+        const labelData1 = data.data[0] ? data.data[0] : []
+        const labelData2 = data.data[1] ? data.data[1] : []
+        const dataList1 = []
+        const dataList2 = []
 
         data.labels.forEach(function (label, index) {
-          const value1 = labelData1[index] ? labelData1[index] : 0;
-          const value2 = labelData2[index] ? labelData2[index] : 0;
-          dataList1.push({ name: label, value0: value1 });
-          dataList2.push({ name: label, value0: value2 });
-        });
-        app.chartData1 = dataList1;
-        app.chartData2 = dataList2;
-        app.loading = false;
-      });
-    },
-    // 页面跳转
-    toTarget(url) {
-      this.$router.push({ path: url });
-    },
-    // 去收银台
-    toCashier(url) {
-      window.open(url, "_blank");
+          const value1 = labelData1[index] ? labelData1[index] : 0
+          const value2 = labelData2[index] ? labelData2[index] : 0
+          dataList1.push({ name: label, value0: value1 })
+          dataList2.push({ name: label, value0: value2 })
+        })
+        app.chartData1 = dataList1
+        app.chartData2 = dataList2
+        app.loading = false
+      })
+
     },
-  },
-};
+    // 查询排行榜数据
+    getTopData() {
+      const app = this
+      app.loading = true
+      const param = { startTime: this.startTime, endTime: this.endTime }
+      getTopData(param).then((response) => {
+        app.loading = false
+        app.goodsList = response.data.goodsList
+        app.memberList = response.data.memberList
+      })
+    }
+  }
+}
 </script>
 
 <style scoped lang="scss">
@@ -445,6 +493,26 @@ export default {
   .content {
     padding: 15px;
     border: solid 1px #d5d7d8;
+    .date-picker {
+      margin-left: 5px;
+      float: left;
+      margin-right: 10px;
+    }
+    .do-search {
+      margin-top: 2px;
+      float: left;
+      .ex {
+        color: #666666;
+        font-size: 12px;
+        width: 60px;
+        margin-left: 20px;
+        cursor: pointer;
+      }
+      .ex:hover {
+        color: #ff5b57;
+        font-weight: bold;
+      }
+    }
     .item {
       display: block;
       border-right: none;
@@ -482,30 +550,6 @@ export default {
         color: #ff5b57;
       }
     }
-    .home-tools {
-      .do {
-        height: 90px;
-        margin-bottom: 10px;
-        cursor: pointer;
-        font-weight: bold;
-        color: #666666;
-        border-radius: 2px;
-        text-align: left;
-        padding: 20px 0px 10px 20px;
-        float: left;
-        width: 100%;
-        background: #ffffff;
-        border: solid 1px #cccccc;
-        .text {
-          margin-top: 14px;
-        }
-      }
-      .t-icon {
-        width: 50px;
-        height: 50px;
-        float: left;
-      }
-    }
   }
 }
 </style>

+ 22 - 5
src/views/merchant/index.vue

@@ -182,6 +182,20 @@
           <el-col :span="9">
             <el-form-item :label="$t('merchant.merchantLogo')" prop="logo">
               <el-upload
+                      class="form__head-icon-upload"
+                      :action="uploadAction"
+                      accept="image/*"
+                      :class="{ hide: hideUpload }"
+                      list-type="picture-card"
+                      :file-list="uploadFiles"
+                      :limit="1"
+                      :auto-upload="true"
+                      :headers="uploadHeader"
+                      :on-success="handleUploadSuccess"
+                      :on-remove="handleRemove"
+
+                    >
+              <!-- <el-upload
                 :action="uploadAction"
                 list-type="picture-card"
                 :class="{ hide: hideUpload }"
@@ -190,8 +204,8 @@
                 :show-file-list="false"
                 :headers="uploadHeader"
                 :on-success="handleUploadSuccess"
-              >
-                <img v-if="form.logo" :src="form.logo" class="list-img" />
+              > -->
+                <img v-if="form.logo" :src="uploadFiles[0]" class="list-img" />
                 <i v-if="!form.logo" class="el-icon-plus"></i>
               </el-upload>
             </el-form-item>
@@ -365,7 +379,7 @@ export default {
         status: 'A'
       },
       // 上传地址
-      uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
+      uploadAction: process.env.VUE_APP_SERVER_URL + '/backendApi/file/upload',
       // 隐藏上传
       hideUpload: false,
       // 上传文件列表
@@ -547,8 +561,11 @@ export default {
            .catch(() => {});
     },
     handleUploadSuccess(file) {
-        this.form.logo = file.data.fileName;
-    }
+        this.form.logo = file.data.url;
+    },
+    handleRemove() {
+        this.form.logo = '';
+    },
   }
 }
 </script>

+ 4 - 0
src/views/order/detail.vue

@@ -24,6 +24,10 @@
               <span class="control-label">{{ orderInfo.typeName }}</span>
             </el-col> -->
             <el-col :span="8">
+              <span class="head">{{ $t('orderList.serviceFee') }}:</span>
+              <span class="control-label">¥{{ orderInfo.serviceFee }}</span>
+            </el-col>
+            <el-col :span="8">
               <span class="head">{{ $t('orderList.detail.orderTime') }}:</span>
               <span class="control-label">{{ orderInfo.createTime }}</span>
             </el-col>

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

@@ -160,7 +160,7 @@
         prop="newTableInfo.tableNumber"
       >
         <template slot-scope="scope">
-          <span v-if="scope.row.newTableInfo.tableNumber">
+          <span v-if="scope.row.newTableInfo&&scope.row.newTableInfo.tableNumber">
             {{ scope.row.newTableInfo.tableNumber }}
           </span>
           <span v-else>-</span>
@@ -172,6 +172,13 @@
           <span v-else>0.00</span>
         </template>
       </el-table-column>
+      <el-table-column :label="$t('orderList.serviceFee')" align="center" prop="amount">
+        <template slot-scope="scope">
+          <span v-if="scope.row.serviceFee">{{ scope.row.serviceFee.toFixed(2) }}</span>
+          <span v-else>0.00</span>
+        </template>
+      </el-table-column>
+      
       <!-- <el-table-column label="支付状态" align="center" width="80" prop="payStatus">
         <template slot-scope="scope">
           <span v-if="scope.row.payStatus == 'B'" class="status-active">{{ getName(payStatusList, scope.row.payStatus) }}</span>

+ 2 - 2
src/views/person/account.vue

@@ -38,7 +38,7 @@
 import ImageUpload from '@/components/ImageUpload'
 import { mapGetters } from 'vuex'
 import { validateForm, validatePassword } from '@/utils/validate'
-import { resetAccountPwd } from '@/api/system/account'
+import { PeopleResetAccountPwd } from '@/api/system/account'
 
 export default {
   name: 'Account',
@@ -76,7 +76,7 @@ export default {
     async handleSubmit() {
       await this.$refs['form'].validate()
       this.loading = true
-      await resetAccountPwd(this.userId, this.form.password)?.finally(() => {
+      await PeopleResetAccountPwd(this.userId, this.form.password)?.finally(() => {
         this.loading = false
       })
       await this.$modal.alertSuccess(this.$t('account.passwordChangeSuccess'))

+ 125 - 23
src/views/statistic/index.vue

@@ -5,21 +5,19 @@
       <div class="content" v-loading="loading">
         <el-row class="line">
           <div class="date-picker">
-            <el-date-picker
-              v-model="startTime"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              type="datetime"
-              style="width: 200px"
-              :placeholder="$t('operational.startTimePlaceholder')"
-            ></el-date-picker>
-            <span class="sp">~</span>
-            <el-date-picker
-              v-model="endTime"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              type="datetime"
-              style="width: 200px"
-              :placeholder="$t('operational.endTimePlaceholder')"
-            ></el-date-picker>
+            <el-form :inline="true"  class="demo-form-inline">
+              <el-form-item label="时间范围">
+                <el-date-picker
+                v-model="timeRange"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                type="datetimerange"
+                style="width: 400px"
+                :start-placeholder="$t('orderList.startTime')"
+                :end-placeholder="$t('orderList.endTime')"
+                :picker-options="pickerOptions"
+                ></el-date-picker>  
+              </el-form-item>
+            </el-form>
           </div>
           <div class="do-search">
             <el-button icon="el-icon-refresh" size="small" @click="reset">
@@ -184,7 +182,7 @@
       <div class="title">{{ $t('operational.operationTrend') }}</div>
       <div class="content">
         <el-row>
-          <el-col class="item" :span="12">
+          <el-col class="item" :span="24">
             <commonChart
               v-if="chartData1.length > 0"
               :title="chart1.title"
@@ -197,7 +195,7 @@
               height="400px"
             />
           </el-col>
-          <el-col class="item" :span="12">
+          <!-- <el-col class="item" :span="12">
             <commonChart
               v-if="chartData2.length > 0"
               :title="chart2.title"
@@ -209,11 +207,62 @@
               id="chart2"
               height="400px"
             />
+          </el-col> -->
+        </el-row>
+      </div>
+    </div>
+    <div class="overview" v-if="chartData3.length > 0">
+      <div class="title">{{ $t('operational.StoreRanking') }}</div>
+      <div class="content">
+        <el-row>
+          <div class="date-picker">
+            <el-form :inline="true"  class="demo-form-inline">
+              <el-form-item label="时间范围">
+                <el-date-picker
+                v-model="timeRange2"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                type="datetimerange"
+                style="width: 400px"
+                :start-placeholder="$t('orderList.startTime')"
+                :end-placeholder="$t('orderList.endTime')"
+                :picker-options="pickerOptions"
+                ></el-date-picker>  
+              </el-form-item>
+              
+            </el-form>
+          </div>
+          <div class="do-search">
+            <el-button icon="el-icon-refresh" size="small" @click="reset2">
+              {{ $t('operational.reset') }}
+            </el-button>
+            <el-button type="primary" icon="el-icon-search" size="small" @click="getChartsData2">
+              {{ $t('operational.query') }}
+            </el-button>
+            <span class="ex" @click="setDay2(3)">{{ $t('operational.lastThreeDays') }}</span>
+            <span class="ex" @click="setDay2(7)">{{ $t('operational.lastSevenDays') }}</span>
+            <span class="ex" @click="setDay2(15)">{{ $t('operational.lastFifteenDays') }}</span>
+            <span class="ex" @click="setDay2(30)">{{ $t('operational.lastThirtyDays') }}</span>
+          </div>
+        </el-row>
+        <el-row>
+          <el-col class="item" :span="24">
+            <commonChart
+              v-if="chartData3.length > 0"
+              :title="chart3.title"
+              :color="chart3.color"
+              :chart-type="chart3.chartType"
+              :head-list="chart3.header"
+              :data-list="chartData3"
+              width="100%"
+              id="chart3"
+              height="400px"
+            />
           </el-col>
         </el-row>
       </div>
     </div>
-    <div class="overview">
+    <!-- <ECharts :options="chartOptions" /> -->
+    <!-- <div class="overview">
       <div class="title">{{ $t('operational.dataRanking') }}</div>
       <div class="content">
         <el-row>
@@ -261,25 +310,37 @@
           </el-col>
         </el-row>
       </div>
-    </div>
+    </div> -->
   </div>
 </template>
 
 <script>
 import { getNumDayTime } from '@/utils/fuint'
-import { getStatisticData } from '@/api/home'
+import { getStatisticData, getStatisticData2 } from '@/api/home'
 import { getMainData, getTopData } from '@/api/statistic'
 import commonChart from '../components/charts/index'
+import ECharts  from '@/components/eCharts/eCharts'
+
 export default {
   name: 'Statistic',
   components: {
-    commonChart
+    commonChart,
+    ECharts 
   },
   data() {
     return {
+        // 配置日期选择器的选项
+      pickerOptions: {
+        disabledDate(time) {
+          // 禁止选择当前时间之后的日期
+          return time.getTime() > Date.now()
+        }
+      },
       loading: false,
       startTime: getNumDayTime(30),
       endTime: getNumDayTime(0),
+      timeRange: [getNumDayTime(30), getNumDayTime(0)],
+      timeRange2: [getNumDayTime(30), getNumDayTime(0)],
       mainData: {
         userCount: 0,
         totalUserCount: 0,
@@ -302,8 +363,15 @@ export default {
         chartType: 'line',
         header: [this.$t('operational.memberStatistics')]
       },
+      chart3: {
+        title: this.$t('operational.StoreRanking'),
+        color: '#ff5b57',
+        chartType: 'bar',
+        header: [this.$t('operational.SalesStatistics')]
+      },
       chartData1: [],
       chartData2: [],
+      chartData3: [],
       goodsList: [],
       memberList: []
     }
@@ -311,6 +379,7 @@ export default {
   created() {
     this.getMainData()
     this.getChartsData()
+    this.getChartsData2()
     this.getTopData()
   },
   methods: {
@@ -318,28 +387,60 @@ export default {
     reset() {
       this.startTime = ''
       this.endTime = ''
+      this.timeRange = [this.startTime, this.endTime]
+    },
+    reset2() {
+      this.timeRange2 = [this.startTime, this.endTime]
     },
     // 设置日期
     setDay(day) {
       this.startTime = getNumDayTime(day - 1)
       this.endTime = getNumDayTime(0)
+      this.timeRange = [this.startTime, this.endTime]
       this.getMainData()
       this.getTopData()
     },
+    setDay2(day) {
+      this.timeRange2 = [getNumDayTime(day - 1), getNumDayTime(0)]
+      this.getChartsData2()
+    },
     // 查询首页数据
     getMainData() {
       this.loading = true
-      const param = { startTime: this.startTime, endTime: this.endTime }
+      const param = { startTime: this.timeRange[0], endTime: this.timeRange[1] }
       getMainData(param).then((response) => {
         this.mainData = response.data
         this.loading = false
       })
     },
+    getChartsData2(){
+        const app = this
+        app.loading = true
+        // 查询店铺排名数据
+        getStatisticData2({startTime:this.timeRange2[0],endTime:this.timeRange2[1]}).then((response) => {
+        // console.log(response)
+        // return;
+        const data = response.data
+
+        const dataList = []
+        for(let i = 0; i<data.dataY.length; i++){
+          dataList.push({name:data.dataX[i],value0:data.dataY[i]})
+        }
+
+        // data.labels.forEach(function (label, index) {
+        //   const value1 = labelData1[index] ? labelData1[index] : 0
+        //   const value2 = labelData2[index] ? labelData2[index] : 0
+        //   dataList1.push({ name: label, value0: value1 })
+        //   dataList2.push({ name: label, value0: value2 })
+        // })
+        app.chartData3 = dataList
+        app.loading = false
+      })
+    },
     // 查询统计数据
     getChartsData() {
       const app = this
       app.loading = true
-      // 近7日订单数量和活跃会员数量
       getStatisticData({ tag: 'order,user_active' }).then((response) => {
         const data = response.data
         const labelData1 = data.data[0] ? data.data[0] : []
@@ -357,6 +458,7 @@ export default {
         app.chartData2 = dataList2
         app.loading = false
       })
+
     },
     // 查询排行榜数据
     getTopData() {

+ 28 - 9
src/views/store/list.vue

@@ -25,8 +25,8 @@
                 clearable
                 style="width: 240px"
             >
-                <el-option :key="$t('storeList.list.enabledKey')" :label="$t('storeList.list.enabled')" :value="A" />
-                <el-option :key="$t('storeList.list.disabledKey')" :label="$t('storeList.list.disabled')" :value="N" />
+                <el-option :key="$t('storeList.list.enabledKey')" :label="$t('storeList.list.enabled')" value="A" />
+                <el-option :key="$t('storeList.list.disabledKey')" :label="$t('storeList.list.disabled')" value="N" />
             </el-select>
         </el-form-item>
         <el-form-item>
@@ -180,17 +180,31 @@
             <el-row>
                 <el-col :span="9">
                     <el-form-item :label="$t('storeList.list.merchantLogo')" prop="logo">
-                        <el-upload
+                      <el-upload
+                      class="form__head-icon-upload"
+                      :action="uploadAction"
+                      accept="image/*"
+                      :class="{ hide: hideUpload }"
+                      list-type="picture-card"
+                      :file-list="uploadFiles"
+                      :limit="1"
+                      :auto-upload="true"
+                      :headers="uploadHeader"
+                      :on-success="handleUploadSuccess"
+                      :on-remove="handleRemove"
+                    >
+                        <!-- <el-upload
                             :action="uploadAction"
                             list-type="picture-card"
+                            accept="image/*"
                             :class="{ hide: hideUpload }"
                             :file-list="uploadFiles"
+                            :limit="1"
                             :auto-upload="true"
-                            :show-file-list="false"
                             :headers="uploadHeader"
                             :on-success="handleUploadSuccess"
-                        >
-                            <img v-if="form.logo" :src="imagePath + form.logo" class="list-img" />
+                        > -->
+                            <img v-if="form.logo" :src="form.logo" class="list-img" />
                             <i v-if="!form.logo" class="el-icon-plus"></i>
                         </el-upload>
                     </el-form-item>
@@ -565,12 +579,12 @@ export default {
       // 微信支付证书
       wxCertPath: "",
       // 上传地址
-      uploadAction: process.env.VUE_APP_SERVER_URL + "/backendApi/file/upload",
+      uploadAction: process.env.VUE_APP_SERVER_URL + '/backendApi/file/upload',
       // 隐藏上传
       hideUpload: false,
       // 上传文件列表
       uploadFiles: [],
-      uploadHeader: { "Access-Token": getToken() },
+      uploadHeader: { 'Access-Token': getToken() },
       merchantOptions: [],
       // 图片根目录
       imagePath: "",
@@ -806,7 +820,12 @@ export default {
           .catch(() => {});
     },
     handleUploadSuccess(file) {
-      this.form.logo = file.data.fileName
+      console.log(file)
+      this.form.logo = file.data.url
+    },
+    // 文件删除处理
+    handleRemove(file) {
+      this.form.logo = ""
     },
     handleUploadLicenseSuccess(file) {
       this.form.license = file.data.fileName

+ 1 - 1
src/views/table/index.vue

@@ -158,7 +158,7 @@
               <el-input
                 v-model="form.tableNumber"
                 :placeholder="$t('tableManagement.pleaseEnterTableEncoding')"
-                maxlength="30"
+                maxlength="10"
               />
             </el-form-item>
           </el-col>

+ 0 - 0
test.js