LaveyD 7 месяцев назад
Родитель
Сommit
051f4cb9c1

+ 9 - 13
src/background.js

@@ -317,10 +317,6 @@ export function checkForUpdates (url) {
 export function setMenu () {
   // const version = app.getVersion()
   let template = [
-    {
-      label: '刷新',
-      role: 'reload'
-    },
     {
       label: '工具',
       submenu: [
@@ -335,15 +331,15 @@ export function setMenu () {
       ]
     },
     {
-      label: '选项',
-      submenu: [
-        {
-          label: '配置',
-          click: function () {
-            win.webContents.send('goConfig')
-          }
-        }
-      ]
+      label: '配置',
+      role: 'config',
+      click: function () {
+        win.webContents.send('goConfig')
+      }
+    },
+    {
+      label: '刷新',
+      role: 'reload'
     }
     // {
     //   label: '帮助',

+ 402 - 337
src/pages/config/index.vue

@@ -1,231 +1,282 @@
 <template>
   <div class="configPage">
     <h1>项目配置</h1>
-    <div class="bg"></div>
+    <!-- <div class="bg"></div> -->
     <div class="content">
-      <el-card>
-        <el-form
-          ref="form"
-          :model="form"
-          :rules="rules">
-          <h3 @click="handleHideClick">
-            服务器配置
-          </h3>
-          <!-- 其他普通景区 -->
-          <el-form-item
-            class="is-require"
-            label="服务器地址"
-            prop="serverUrl">
-            <el-input
-              placeholder=""
-              v-model="form.serverUrl">
-            </el-input>
-          </el-form-item>
-
-          <h3>打印配置</h3>
-          <el-form-item
-            :label="`门票打印机`"
-            prop="printer">
-            <el-select
-              v-model="form.defaultPrinter"
-              style="width:100%">
-              <el-option
-                v-for="item in printers"
-                :key="item.name"
-                :value="item.name"
-                :label="item.name"></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            :label="`小票打印机`"
-            prop="printer">
-            <el-select
-              v-model="form.defaultSmallTicketPrinter"
-              style="width:100%">
-              <el-option
-                v-for="item in printers"
-                :key="item.name"
-                :value="item.name"
-                :label="item.name"></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            label="自动打印门票开关"
-            prop="printer">
-            <el-switch
-              v-model="form.autoPrint"
-              active-color="#13ce66"
-              inactive-color="#ff4949">
-            </el-switch>
-          </el-form-item>
-
-          <el-form-item
-            label="售票快捷键支持"
-            prop="quickSupport">
-            <el-switch
-              v-model="form.quickSupport"
-              active-color="#13ce66"
-              inactive-color="#ff4949">
-            </el-switch>
-          </el-form-item>
-
-          <el-form-item
-            label="显示景点便签(售票界面)"
-            prop="showScenicTag">
-            <el-switch
-              v-model="form.showScenicTag"
-              active-color="#13ce66"
-              inactive-color="#ff4949">
-            </el-switch>
-          </el-form-item>
-
-          <el-form-item
-            label="售票初始数量"
-            prop="initNum">
-            <el-select
-              v-model="form.initNum"
-              style="width:100%">
-              <el-option
-                label="空"
-                value="空"></el-option>
-              <el-option
-                label="1"
-                :value="1"></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            label="默认支付方式"
-            prop="initNum">
-            <el-select
-              v-model="form.defaultPayWay"
-              style="width:100%">
-              <el-option
-                label="无"
-                value=""></el-option>
-              <el-option
-                v-for="(item,index) in payChannelOptions"
-                :key="index"
-                :label="item"
-                :value="item">
-              </el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            label="IC卡补齐长度( 此处设置优先级高于:系统管理->参数配置->IC卡补齐长度。0为不补齐 )"
-            prop="ICCardLength">
-            <el-input
-              style="width:100%"
-              v-model.number="form.ICCardLength"
-              size="normal"
-              :min="0"
-              :step="1"
-              :controls="true"
-              controls-position="both">
-            </el-input>
-          </el-form-item>
-
-          <el-form-item
-            label="人脸识别类型"
-            prop="initNum">
-            <el-select
-              v-model="form.faceApi"
-              style="width:100%">
-              <el-option
-                label="faceApi"
-                value="faceApi"></el-option>
-              <el-option
-                label="Tracking"
-                value="tracking"></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            v-if="form.faceApi==='faceApi'"
-            label="人脸识别模型"
-            prop="faceModel">
-            <el-select
-              v-model="form.faceModel"
-              style="width:100%">
-              <el-option
-                label="ssdMobilenetv1"
-                value="ssdMobilenetv1"></el-option>
-              <el-option
-                label="mtcnn"
-                value="mtcnn"></el-option>
-              <el-option
-                label="tinyFaceDetector"
-                value="tinyFaceDetector"></el-option>
-            </el-select>
-          </el-form-item>
-
-          <h3>POS机终端设置</h3>
-          <el-form-item label="款台号">
-            <el-input
-              :disabled="scenicName==='狼山景区'||scenicName==='军山景区'"
-              v-model="form.termId"></el-input>
-          </el-form-item>
-
-          <el-form-item label="支付客户端路径">
-            <el-button
-              type="info"
-              @click="selectFolder('softposPath')">
-              选择目录
-            </el-button>
-            <el-link
-              @click="openFolder"
-              type="success"
-              style="margin-left:20px">
-              已选择:{{ form.softposPath }}
-            </el-link>
-          </el-form-item>
-
-          <el-form-item label="Pos退款方式">
-            <el-select v-model="form.refundWay">
-              <el-option
-                label="退货"
-                value="refunds">
-              </el-option>
-              <el-option
-                label="撤销"
-                value="revoke">
-              </el-option>
-            </el-select>
-          </el-form-item>
-
-          <!-- 绿博园对接的银行 -->
-          <el-form-item
-            label="银行POS选择(默认建行)"
-            v-if="projectName==='lby'">
-            <el-select
-              v-model="form.posName"
-              style="width:100%">
-              <el-option
-                label="无"
-                value="">
-              </el-option>
-              <el-option
-                label="建行"
-                value="jianhang">
-              </el-option>
-              <el-option
-                label="农行"
-                value="nonghang">
-              </el-option>
-              <el-option
-                label="银联"
-                value="yinlian">
-              </el-option>
-            </el-select>
-          </el-form-item>
-
-          <template v-if="showAdvance">
-            <h3 @click="showAdvance=false,count=0">
-              高级设置(谨慎修改!!!)
-            </h3>
+      <el-tabs v-model="activeTab" type="card">
+        <el-tab-pane label="服务器配置" name="server">
+          <el-form>
+            <el-form-item
+              class="is-require"
+              verify
+              label="服务器地址"
+              prop="serverUrl">
+              <el-input
+                placeholder=""
+                v-model="form.serverUrl">
+              </el-input>
+            </el-form-item>
+          </el-form>
+        </el-tab-pane>
+        <el-tab-pane label="打印配置" name="print">
+          <el-form>
+            <el-form-item
+              :label="`门票打印机`"
+              prop="printer">
+              <el-select
+                v-model="form.defaultPrinter"
+                style="width:100%">
+                <el-option
+                  v-for="item in printers"
+                  :key="item.name"
+                  :value="item.name"
+                  :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              :label="`小票打印机`"
+              prop="printer">
+              <el-select
+                v-model="form.defaultSmallTicketPrinter"
+                style="width:100%">
+                <el-option
+                  v-for="item in printers"
+                  :key="item.name"
+                  :value="item.name"
+                  :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              label="自动打印门票开关"
+              prop="printer">
+              <el-switch
+                v-model="form.autoPrint"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+            </el-form-item>
+            <el-form-item
+              label="售票快捷键支持"
+              prop="quickSupport">
+              <el-switch
+                v-model="form.quickSupport"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+            </el-form-item>
+
+            <el-form-item
+              label="显示景点便签(售票界面)"
+              prop="showScenicTag">
+              <el-switch
+                v-model="form.showScenicTag"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+            </el-form-item>
+
+            <el-form-item
+              label="售票初始数量"
+              prop="initNum">
+              <el-select
+                v-model="form.initNum"
+                style="width:100%">
+                <el-option
+                  label="空"
+                  value="空"></el-option>
+                <el-option
+                  label="1"
+                  :value="1"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              label="默认支付方式"
+              prop="initNum">
+              <el-select
+                v-model="form.defaultPayWay"
+                style="width:100%">
+                <el-option
+                  label="无"
+                  value=""></el-option>
+                <el-option
+                  v-for="(item,index) in payChannelOptions"
+                  :key="index"
+                  :label="item"
+                  :value="item">
+                </el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              label="IC卡补齐长度( 此处设置优先级高于:系统管理->参数配置->IC卡补齐长度。0为不补齐 )"
+              prop="ICCardLength">
+              <el-input
+                style="width:100%"
+                v-model.number="form.ICCardLength"
+                size="normal"
+                :min="0"
+                :step="1"
+                :controls="true"
+                controls-position="both">
+              </el-input>
+            </el-form-item>
+
+            <el-form-item
+              label="人脸识别类型"
+              prop="initNum">
+              <el-select
+                v-model="form.faceApi"
+                style="width:100%">
+                <el-option
+                  label="faceApi"
+                  value="faceApi"></el-option>
+                <el-option
+                  label="Tracking"
+                  value="tracking"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              v-if="form.faceApi==='faceApi'"
+              label="人脸识别模型"
+              prop="faceModel">
+              <el-select
+                v-model="form.faceModel"
+                style="width:100%">
+                <el-option
+                  label="ssdMobilenetv1"
+                  value="ssdMobilenetv1"></el-option>
+                <el-option
+                  label="mtcnn"
+                  value="mtcnn"></el-option>
+                <el-option
+                  label="tinyFaceDetector"
+                  value="tinyFaceDetector"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </el-tab-pane>
+        <el-tab-pane label="POS机终端设置" name="pos">
+          <el-form>
+            <el-form-item label="款台号">
+              <el-input
+                :disabled="scenicName==='狼山景区'||scenicName==='军山景区'"
+                v-model="form.termId"></el-input>
+            </el-form-item>
+
+            <el-form-item label="支付客户端路径">
+              <el-button
+                type="info"
+                @click="selectFolder('softposPath')">
+                选择目录
+              </el-button>
+              <el-link
+                @click="openFolder"
+                type="success"
+                style="margin-left:20px">
+                已选择:{{ form.softposPath }}
+              </el-link>
+            </el-form-item>
+
+            <el-form-item label="Pos退款方式">
+              <el-select v-model="form.refundWay">
+                <el-option
+                  label="退货"
+                  value="refunds">
+                </el-option>
+                <el-option
+                  label="撤销"
+                  value="revoke">
+                </el-option>
+              </el-select>
+            </el-form-item>
+
+            <!-- 绿博园对接的银行 -->
+            <el-form-item
+              label="银行POS选择(默认建行)"
+              v-if="projectName==='lby'">
+              <el-select
+                v-model="form.posName"
+                style="width:100%">
+                <el-option
+                  label="无"
+                  value="">
+                </el-option>
+                <el-option
+                  label="建行"
+                  value="jianhang">
+                </el-option>
+                <el-option
+                  label="农行"
+                  value="nonghang">
+                </el-option>
+                <el-option
+                  label="银联"
+                  value="yinlian">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </el-tab-pane>
+        <el-tab-pane label="其他配置" name="other">
+          <el-form>
+            <el-form-item label="身份证阅读器">
+              <el-select
+                v-model="form.idDevice"
+                style="width:100%">
+                <el-option
+                  label="中控ID200"
+                  value="zk">
+                </el-option>
+                <el-option
+                  label="江苏社保卡密服"
+                  value="tecsun">
+                </el-option>
+                <el-option
+                  label="华视身份证读卡器"
+                  value="hs">
+                </el-option>
+                <el-option
+                  label="精伦身份证读卡器"
+                  value="jl">
+                </el-option>
+                <el-option
+                  label="新中新F200"
+                  value="xzx">
+                </el-option>
+                <el-option
+                  label="东信EST-100"
+                  value="donsee">
+                </el-option>
+                <el-option
+                  label="东信EST-100R"
+                  value="donsee-100R">
+                </el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item
+              v-if="form.idDevice==='tecsun'"
+              label="身份证读卡器串口号">
+              <el-input-number
+                style="width:100%"
+                v-model="form.idDevicePort"
+                :controls="false"
+                placeholder="在设备管理器里查看串口号(数字)"></el-input-number>
+            </el-form-item>
+
+            <el-form-item label="身份证阅读器web接口地址">
+              <el-input
+                v-model="form.idDeviceUrl"
+                placeholder="一般不用设置; 华视:http://127.0.0.1:19196;新中新:http://localhost:8989"></el-input>
+            </el-form-item>
+          </el-form>
+        </el-tab-pane>
+        <el-tab-pane v-if="showAdvance" label="高级设置(谨慎修改!!!)" name="advance">
+          <el-form>
             <el-form-item label="软件名">
               <el-input v-model="form.appName"></el-input>
             </el-form-item>
@@ -245,12 +296,6 @@
                 v-if="customLogoLoaded"
                 :src="customLogoUrl"
                 style="background:#ccc; padding:10px; height:50px; margin-top:10px">
-              <!-- <el-link
-                @click="openFolder"
-                type="success"
-                style="margin-left:20px">
-                已选择:{{ this.customLogo }}
-              </el-link> -->
             </el-form-item>
 
             <el-form-item label="模拟支付">
@@ -283,91 +328,37 @@
                 inactive-color="#ff4949">
               </el-switch>
             </el-form-item>
-          </template>
-
-          <h3>其他设备设置</h3>
-          <el-form-item label="身份证阅读器">
-            <el-select
-              v-model="form.idDevice"
-              style="width:100%">
-              <el-option
-                label="中控ID200"
-                value="zk">
-              </el-option>
-              <el-option
-                label="江苏社保卡密服"
-                value="tecsun">
-              </el-option>
-              <el-option
-                label="华视身份证读卡器"
-                value="hs">
-              </el-option>
-              <el-option
-                label="精伦身份证读卡器"
-                value="jl">
-              </el-option>
-              <el-option
-                label="新中新F200"
-                value="xzx">
-              </el-option>
-              <el-option
-                label="东信EST-100"
-                value="donsee">
-              </el-option>
-              <el-option
-                label="东信EST-100R"
-                value="donsee-100R">
-              </el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item
-            v-if="form.idDevice==='tecsun'"
-            label="身份证读卡器串口号">
-            <el-input-number
-              style="width:100%"
-              v-model="form.idDevicePort"
-              :controls="false"
-              placeholder="在设备管理器里查看串口号(数字)"></el-input-number>
-          </el-form-item>
-
-          <el-form-item label="身份证阅读器web接口地址">
-            <el-input
-              v-model="form.idDeviceUrl"
-              placeholder="一般不用设置; 华视:http://127.0.0.1:19196;新中新:http://localhost:8989"></el-input>
-          </el-form-item>
-
-          <div
-            class="btn-wrap"
-            style="display:flex; justify-content:space-between; margin-bottom:10px">
-            <div>
-              <el-button
-                type="danger"
-                @click.native.prevent="clearLocalConfig">
-                清空本地配置
-              </el-button>
-              <!-- <el-button @click="openConfig">
-                打开配置文件
-              </el-button> -->
-              <el-button @click="openLog">
-                打开日志文件目录
-              </el-button>
-            </div>
-
-            <div>
-              <el-button @click="handleBack">
-                返回
-              </el-button>
-
-              <el-button
-                type="primary"
-                @click.native.prevent="handleSave">
-                保存
-              </el-button>
-            </div>
-          </div>
-        </el-form>
-      </el-card>
+          </el-form>
+        </el-tab-pane>
+      </el-tabs>
+      <div
+        class="btn-wrap">
+        <div>
+          <el-button
+            type="danger"
+            @click.native.prevent="clearLocalConfig">
+            清空本地配置
+          </el-button>
+          <!-- <el-button @click="openConfig">
+            打开配置文件
+          </el-button> -->
+          <el-button @click="openLog">
+            打开日志文件目录
+          </el-button>
+        </div>
+
+        <div>
+          <el-button @click="handleBack">
+            返回
+          </el-button>
+
+          <el-button
+            type="primary"
+            @click.native.prevent="handleSave">
+            保存
+          </el-button>
+        </div>
+      </div>
     </div>
   </div>
 </template>
@@ -418,6 +409,7 @@ export default {
     const hideUpdateUrl = process.env.VUE_APP_PROJECT_NAME.indexOf('妈祖') > 0 // 一般景区为false, 若印象妈祖打包,则需要隐藏升级地址,改为true
 
     return {
+      activeTab: 'server',
       projectName: process.env.VUE_APP_PROJECT,
       scenicOptions,
       previewPath: '',
@@ -546,7 +538,7 @@ export default {
       })
     },
     handleBack () {
-      if (!this.$localStore.get('serverUrl') || !this.$localStore.get('updateUrl')) {
+      if (!this.$localStore.get('serverUrl') && !this.$localStore.get('updateUrl')) {
         this.$message.error('请完成地址配置。')
       }
       this.$router.push('/')
@@ -652,43 +644,116 @@ export default {
 
 <style lang="scss" scoped>
 .configPage {
-  position: absolute; top: 0; left: 0;width: 100%;height: 100%; overflow: hidden;background: #0075ff;
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  background: #fff;
+
   h1 {
-    font-size: 24px; font-weight: normal; line-height: 100px; color: #fff; text-align: center;
+    font-size: 24px;
+    font-weight: bold;
+    line-height: 100px;
+    color: #333;
+    text-align: center;
   }
-  ::v-deep .el-form-item__label{
+
+  ::v-deep .el-form-item__label {
     float: none;
   }
-  h3{
-    color: $blue; border-bottom: 1px solid #ddd; line-height: 2; margin-bottom: 10px; font-weight: bold;
+
+  h3 {
+    color: $blue;
+    border-bottom: 1px solid #ddd;
+    line-height: 2;
+    margin-bottom: 10px;
+    font-weight: bold;
   }
 }
+
 .bg {
-  position: absolute; top: 100px;left: 50%;width: 200%; padding-top: 100%;background: #fff; border-radius: 50%;  transform: translate(-50%,0);
+  position: absolute;
+  top: 100px;
+  left: 50%;
+  width: 200%;
+  padding-top: 100%;
+  background: #F8F9FD;
+  border-radius: 50%;
+  transform: translate(-50%, 0);
 }
+
 .content {
-  position: absolute; width: 100%;height: 100%;overflow: auto; left: 0;top: 0;
-  .el-card {
-    width: 600px; margin: 150px auto 50px;
+  position: absolute;
+  margin: 100px 20px 20px 20px;
+  width: calc(100% - 40px);
+  height: calc(100% - 120px);
+  overflow: auto;
+  background: #fff;
+  box-shadow: 6px 0px 28px 0px #C4CBD6;
+  border-radius: 12px;
+  left: 0;
+  top: 0;
+
+  .el-tabs {
+    margin: 0 20px;
+    width: calc(100% - 40px);
+    height: calc(100% - 50px);
+
+    &__content {
+      height: 100%;
+    }
   }
 }
 
-.preview-wrap{
-  position: absolute; width: 100%; height: 100%; left: 0;top: 0; background: rgba(0,0,0,0.5); overflow: auto;
-  .inner{
-    position: absolute; left: 50%;top: 50%;transform: translate(-50%,-50%);background: #fff; padding: 50px 30px 30px; border-radius: 10px;
+.btn-wrap {
+  display: flex;
+  justify-content: space-around;
+  margin-bottom: 10px;
+}
+
+.preview-wrap {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  left: 0;
+  top: 0;
+  background: rgba(0, 0, 0, 0.5);
+  overflow: auto;
+
+  .inner {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    background: #fff;
+    padding: 50px 30px 30px;
+    border-radius: 10px;
   }
-  .close{
-    position: absolute; right: 16px;top: 16px; cursor: pointer; font-size: 20px;
+
+  .close {
+    position: absolute;
+    right: 16px;
+    top: 16px;
+    cursor: pointer;
+    font-size: 20px;
   }
-  .ticket{
-    box-shadow: 2px 2px 20px #ddd; padding: 10px; overflow: hidden;
+
+  .ticket {
+    box-shadow: 2px 2px 20px #ddd;
+    padding: 10px;
+    overflow: hidden;
   }
-  .btn-wrap{
-    margin-top: 30px; text-align: center;
+
+  .btn-wrap {
+    margin-top: 30px;
+    text-align: center;
   }
-  .rotate{
-    transform: translateY(-100%) rotate(90deg); transform-origin: 0 100%;
+
+  .rotate {
+    transform: translateY(-100%) rotate(90deg);
+    transform-origin: 0 100%;
   }
 }
 </style>

+ 15 - 12
src/pages/dashboard/chart/history.vue

@@ -1,6 +1,7 @@
 <template>
   <div
     id="history"
+    v-loading="loading"
     style="width:100%;height:100%"></div>
 </template>
 
@@ -87,7 +88,7 @@ let option = {
     {
       yAxisIndex: 1,
       name: '售票金额',
-      type: 'line',
+      type: 'bar',
       symbol: 'none',
       itemStyle: {
         color: '#4E84FD'
@@ -98,7 +99,7 @@ let option = {
       data: []
     }, {
       name: '售票张数',
-      type: 'line',
+      type: 'bar',
       symbol: 'none',
       itemStyle: {
         color: '#A359FD'
@@ -109,7 +110,7 @@ let option = {
       data: []
     }, {
       name: '退票张数',
-      type: 'line',
+      type: 'bar',
       symbol: 'none',
       itemStyle: {
         color: '#FE635F'
@@ -124,7 +125,8 @@ let option = {
 export default {
   data () {
     return {
-      option
+      option,
+      loading: false
     }
   },
   mounted () {
@@ -133,7 +135,7 @@ export default {
   methods: {
     async getOrderStatistics () {
       const chart = echarts.init(document.getElementById('history'))
-
+      this.loading = true
       const res = await getOrderStatistics({
         pageSize: -1,
         pageNum: 1,
@@ -143,6 +145,7 @@ export default {
         payChannelList: [],
         groupByList: ['orderDateDay']
       })
+      this.loading = false
       const allData = res.data || []
       const latestDays = Array.from({ length: 30 }, (_, i) => moment().add(-i, 'days').format('YYYY-MM-DD')).reverse()
       const getValue = (time, key) => {
@@ -152,7 +155,7 @@ export default {
       this.option.xAxis[0].data = latestDays
       this.option.series = [
         {
-          type: 'line',
+          type: 'bar',
           name: '售票金额',
           yAxisIndex: 1,
           data: latestDays.map(tm => getValue(tm, 'salePrice')),
@@ -165,7 +168,7 @@ export default {
           }
         },
         {
-          type: 'line',
+          type: 'bar',
           name: '售票张数',
           yAxisIndex: 0,
           data: latestDays.map(tm => getValue(tm, 'saleNum')),
@@ -178,7 +181,7 @@ export default {
           }
         },
         {
-          type: 'line',
+          type: 'bar',
           name: '退票金额',
           yAxisIndex: 1,
           data: latestDays.map(tm => getValue(tm, 'cancelPrice')),
@@ -191,7 +194,7 @@ export default {
           }
         },
         {
-          type: 'line',
+          type: 'bar',
           name: '退票张数',
           yAxisIndex: 0,
           data: latestDays.map(tm => getValue(tm, 'cancelNum')),
@@ -219,7 +222,7 @@ export default {
           }],
           series: [
             {
-              type: 'line',
+              type: 'bar',
               name: '售票金额',
               data: res.map(item => item.sum_price),
               symbol: 'none',
@@ -231,7 +234,7 @@ export default {
               }
             },
             {
-              type: 'line',
+              type: 'bar',
               name: '售票张数',
               data: res.map(item => item.sum_count),
               symbol: 'none',
@@ -243,7 +246,7 @@ export default {
               }
             },
             {
-              type: 'line',
+              type: 'bar',
               name: '退票张数',
               data: res.map(item => item.cancel_count),
               symbol: 'none',

+ 38 - 4
src/pages/dashboard/dataTables/CheckStatistics.vue

@@ -3,11 +3,12 @@
     <el-table
       border
       stripe
+      v-loading="loading"
       :data="CheckStatistics"
       :row-class-name="totalRowClassName">
       <el-table-column
-        label="今日门票检票数据"
-        label-class-name="table_title"
+        label="门票检票数据"
+        label-class-name="table-title"
       >
         <el-table-column
           prop="otaSourceName"
@@ -35,20 +36,52 @@ import moment from 'moment'
 import { totalRowClassName } from '@/utils'
 import { apiCheckList } from '@/api/order.js'
 
+const fmt = 'YYYY-MM-DD HH:mm:ss'
+
 export default {
+  props: {
+    dataDate: {
+      type: String,
+      default: 'today'
+    }
+  },
   data () {
     return {
       totalRowClassName,
+      loading: false,
       CheckStatistics: [], // 按售票渠道今日门票检票数据
-      startDate: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
-      endDate: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')
+      startDate: moment().startOf('day').format(fmt),
+      endDate: moment().endOf('day').format(fmt)
     }
   },
   created () {
     this.getCheckStatisticsByOtaName()
   },
   methods: {
+    getData () {
+      switch (this.dataDate) {
+        case 'yesterday':
+          this.startDate = moment().subtract(1, 'days').startOf('day').format(fmt)
+          this.endDate = moment().subtract(1, 'days').endOf('day').format(fmt)
+          break
+        case 'week':
+          this.startDate = moment().subtract(7, 'days').startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+        case 'month':
+          this.startDate = moment().subtract(30, 'days').startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+        default:
+          this.startDate = moment().startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+      }
+
+      this.getCheckStatisticsByOtaName()
+    },
     getCheckStatisticsByOtaName () {
+      this.loading = true
       apiCheckList({
         startDate: this.startDate,
         endDate: this.endDate,
@@ -59,6 +92,7 @@ export default {
       }).then(res => {
         this.CheckStatistics = res.data
         console.log('this.CheckStatistics', this.CheckStatistics)
+        this.loading = false
       })
     }
   }

+ 1 - 1
src/pages/dashboard/dataTables/FreeCheckCount.vue

@@ -8,7 +8,7 @@
     >
       <el-table-column
         label="今日免费通行人数数据"
-        label-class-name="table_title"
+        label-class-name="table-title"
       >
         <el-table-column
           prop="type"

+ 1 - 1
src/pages/dashboard/dataTables/MemberCheckStatistics.vue

@@ -7,7 +7,7 @@
       :row-class-name="totalRowClassName">
       <el-table-column
         label="今日卡检票数据"
-        label-class-name="table_title"
+        label-class-name="table-title"
       >
         <el-table-column
           prop="ticketTypeName"

+ 39 - 4
src/pages/dashboard/dataTables/OrderStatistics.vue

@@ -3,11 +3,12 @@
     <el-table
       border
       stripe
+      v-loading="loading"
       :data="OrderStatistics"
       :row-class-name="totalRowClassName">
       <el-table-column
-        label="今日门票销售数据"
-        label-class-name="table_title"
+        label="门票销售数据"
+        label-class-name="table-title"
       >
         <el-table-column
           prop="otaSourceName"
@@ -39,20 +40,53 @@ import moment from 'moment'
 import { totalRowClassName } from '@/utils'
 import { getOrderStatistics } from '@/api/order.js'
 
+const fmt = 'YYYY-MM-DD HH:mm:ss'
+
 export default {
+  props: {
+    dataDate: {
+      type: String,
+      default: 'today'
+    }
+  },
+
   data () {
     return {
       totalRowClassName,
+      loading: false,
       OrderStatistics: [], // 按售票渠道今日门票销售数据
-      startDate: moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
-      endDate: moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')
+      startDate: moment().startOf('day').format(fmt),
+      endDate: moment().endOf('day').format(fmt)
     }
   },
   created () {
     this.getOrderStatistics()
   },
   methods: {
+    getData () {
+      switch (this.dataDate) {
+        case 'yesterday':
+          this.startDate = moment().subtract(1, 'days').startOf('day').format(fmt)
+          this.endDate = moment().subtract(1, 'days').endOf('day').format(fmt)
+          break
+        case 'week':
+          this.startDate = moment().subtract(7, 'days').startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+        case 'month':
+          this.startDate = moment().subtract(30, 'days').startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+        default:
+          this.startDate = moment().startOf('day').format(fmt)
+          this.endDate = moment().endOf('day').format(fmt)
+          break
+      }
+
+      this.getOrderStatistics()
+    },
     getOrderStatistics () {
+      this.loading = true
       getOrderStatistics({
         pageSize: -1,
         pageNum: 1,
@@ -64,6 +98,7 @@ export default {
       }).then(res => {
         console.log(res)
         this.OrderStatistics = res.data
+        this.loading = false
       })
     }
   }

+ 168 - 32
src/pages/dashboard/index.vue

@@ -25,16 +25,43 @@
           type="warning"
           :closable="false">
           您有未交班数据,如需交班请
-          <router-link to="/ticketSale/sellerShift">
+          <router-link to="/handOverReport">
             【点击进入】
           </router-link>
           交班页面
         </el-alert>
+        <div class="opt-area">
+          <el-radio-group
+            v-model="dataDate"
+            size="small"
+            @input="refreshData">
+            <el-radio-button
+              v-for="tm in dataTimes"
+              :label="tm.key"
+              :key="tm.key">
+              {{ tm.name }}
+            </el-radio-button>
+          </el-radio-group>
+          <div class="refresh-time">
+            更新时间:{{ refreshTime }}
+          </div>
+          <el-button
+            type="text"
+            icon="el-icon-refresh"
+            @click="refreshData"></el-button>
+        </div>
+        <OrderStatistics
+          v-if="checkPermission('home_page:query') && checkPermission('querystats:sale_stats')"
+          ref="orderStat"
+          :data-date="dataDate"
+        ></OrderStatistics>
 
-        <OrderStatistics v-if="checkPermission('home_page:query') && checkPermission('querystats:sale_stats')"></OrderStatistics>
-
-        <CheckStatistics v-if="checkPermission('home_page:query') && checkPermission('querystats:check_stats')"></CheckStatistics>
-
+        <CheckStatistics
+          v-if="checkPermission('home_page:query') && checkPermission('querystats:check_stats')"
+          ref="checkStat"
+          :data-date="dataDate"
+        ></CheckStatistics>
+        <div class="split-line"></div>
         <!-- <FreeCheckCount
           v-if="checkPermission('home_page:query') && checkPermission('querystats:check_stats') && checkPermission('member:member_check_statistics')">
         </FreeCheckCount>
@@ -239,7 +266,27 @@ export default {
         cancelRate: 0
       },
       dengbaoOpWarnDlgvisible: false, // 城展馆等保检查弹窗 (应付临时检查用)
-      weekDic: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
+      weekDic: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
+      dataDate: 'today',
+      refreshTime: '',
+      dataTimes: [
+        {
+          name: '今天',
+          key: 'today'
+        },
+        {
+          name: '昨天',
+          key: 'yesterday'
+        },
+        {
+          name: '最近7天',
+          key: 'week'
+        },
+        {
+          name: '最近30天',
+          key: 'month'
+        }
+      ]
     }
   },
   computed: {
@@ -260,6 +307,7 @@ export default {
   },
   mounted () {
     this.init()
+    this.refreshTime = moment().format('YYYY-MM-DD HH:mm:ss')
   },
   beforeDestroy () {
     clearInterval(this.timeInt)
@@ -267,6 +315,13 @@ export default {
   methods: {
     checkPermission,
     totalRowClassName,
+    refreshData () {
+      this.refreshTime = moment().format('YYYY-MM-DD HH:mm:ss')
+      this.$nextTick(() => {
+        this.$refs.orderStat && this.$refs.orderStat.getData()
+        this.$refs.checkStat && this.$refs.checkStat.getData()
+      })
+    },
     init () {
       // this.setWeather()
       checkPermission('querystats:sale_stats')
@@ -311,99 +366,180 @@ export default {
 <style lang="scss" >
 .dashboard-wrap {
   padding: 10px 20px 20px;
-  .el-table--small td, .el-table--small th{
-  padding: 0;
-}
-.table_title{
-  background: #f4f4f4;
-  color: #0075ff;
-  font-size: 14px;
-  padding: 10px;
-  font-weight: normal;
-  border-radius: 3px;
-}
+
+  .el-table--small td,
+  .el-table--small th {
+    padding: 0;
+  }
+
+  .table-title {
+    background: #f4f4f4;
+    color: #0075ff;
+    font-size: 14px;
+    padding: 10px;
+    font-weight: normal;
+    border-radius: 3px;
+  }
+
   .el-alert {
-    .el-alert__description{
+    .el-alert__description {
       font-size: 14px;
     }
+
     a {
       color: #0075ff;
     }
   }
+
   .dashboard-head {
-    display: flex;  height: 60px;  margin-bottom: 20px;  border-bottom: 1px solid #666;  justify-content: space-between;  align-items: center;
+    display: flex;
+    height: 60px;
+    margin-bottom: 20px;
+    border-bottom: 1px solid #666;
+    justify-content: space-between;
+    align-items: center;
+
     .hello {
-      display: flex;  align-items: flex-end;
+      display: flex;
+      align-items: flex-end;
+
       h2 {
         margin-right: 20px;
       }
+
       .subtitle {
         color: #666;
       }
     }
+
     .weather {
-      color: #666;  text-align: right; font-size: 1.2em;
+      color: #666;
+      text-align: right;
+      font-size: 1.2em;
     }
   }
+
   .dashboard-content {
     display: flex;
+
+    .opt-area {
+      display: flex;
+      margin: 10px 0;
+      align-items: center;
+
+      .refresh-time {
+        margin: 0 10px;
+      }
+    }
+
     .charts {
-      width: 700px;  margin-right: 20px;
+      width: 100%;
+      min-width: 700px;
+      margin-right: 20px;
+
       .realtime {
         margin-bottom: 20px;
+
         .realtime-wrap {
-          display: flex;  justify-content: space-between;
+          display: flex;
+          justify-content: space-between;
+
           .realtime-block {
-            display: flex;  width: 120px;  height: 100px;  flex-direction: column;  border-radius: 5px;  flex-grow: 1;  justify-content: center;  align-items: center;
+            display: flex;
+            width: 120px;
+            height: 100px;
+            flex-direction: column;
+            border-radius: 5px;
+            flex-grow: 1;
+            justify-content: center;
+            align-items: center;
 
             .label {
-              margin-bottom: 10px;  font-size: 12px;  color: #666;
+              margin-bottom: 10px;
+              font-size: 12px;
+              color: #666;
             }
+
             .count {
               font-size: 20px;
             }
           }
+
           .active-block {
-            color: #fff;  background-color: #fe635f;
+            color: #fff;
+            background-color: #fe635f;
+
             .label {
               color: #fff;
             }
           }
+
           .realtime-block:not(:last-child) {
             margin-right: 10px;
           }
         }
       }
+
       .history {
         .legend {
-          display: flex;  height: 20px;  justify-content: flex-end;
+          display: flex;
+          height: 20px;
+          justify-content: flex-end;
+
           .legend-item {
-            margin-left: 20px;  font-size: 12px;  color: #666;
+            margin-left: 20px;
+            font-size: 12px;
+            color: #666;
           }
+
           .legend-item::before {
-            display: inline-block;  width: 8px;  height: 8px;  content: '';  background-color: #4e84fd;  border-radius: 2px;
+            display: inline-block;
+            width: 8px;
+            height: 8px;
+            content: '';
+            background-color: #4e84fd;
+            border-radius: 2px;
           }
+
           .legend-item:nth-child(2)::before {
             background-color: #a359fd;
           }
+
           .legend-item:nth-child(3)::before {
             background-color: #fe635f;
           }
         }
+
         .history-chart {
           height: 240px;
         }
       }
     }
+
+    .split-line {
+      width: 100%;
+      margin: 10px 0;
+      border-bottom: 2px solid #666;
+    }
+
     .notification {
       width: calc(100% - 720px);
     }
   }
-  .dashboard-panel {color: $blue;
-    border: 1px solid #e2e2e2;  border-radius: 3px;
+
+  .dashboard-panel {
+    color: $blue;
+    border: 1px solid #e2e2e2;
+    border-radius: 3px;
+
     .panel-title {
-      height: 40px;  padding-left: 20px;  line-height: 40px;  background-color: #f4f4f4;  border-bottom: 1px solid #e2e2e2;
+      height: 40px;
+      padding-left: 20px;
+      line-height: 40px;
+      background-color: #f4f4f4;
+      border-bottom: 1px solid #e2e2e2;
     }
+
     .panel-content {
       padding: 10px;
     }

+ 2 - 1
src/pages/queryReport/handOverList.vue

@@ -5,7 +5,8 @@
       ref="form"
       :model="form"
       :inline="true"
-      label-width="100px"
+      label-position="left"
+      label-width="76px"
     >
       <div class="block-title">
         查询条件

+ 1 - 1
src/pages/ticketSetting/ticket/Dialog.vue

@@ -904,7 +904,7 @@
 <script>
 import { addTicket, updateTicket, queueList, addTicketBatch, updateTicketBatch, delTicketBatch } from '@/api/ticketType'
 import { getLabelName } from '@/utils'
-import { cloneDeep, isNumber } from 'lodash'
+import { cloneDeep } from 'lodash'
 import moment from 'moment'
 
 const defaultForm = {

+ 1 - 1
src/pages/visitor/Statistic/Age.vue

@@ -128,7 +128,7 @@ export default {
     ageOption () {
       const ageOption = JSON.parse(JSON.stringify(baseAgeOption))
 
-      ageOption.yAxis.data = this.tableData.map(item => item.age)
+      ageOption.xAxis.data = this.tableData.map(item => item.age)
       ageOption.series[0].data = this.tableData.map(item => item.count)
       // ageOption.series[1].data = this.tableData.map(item => item.femaleCount)
 

+ 22 - 10
src/pages/visitor/Statistic/ageOption.js

@@ -1,4 +1,5 @@
 export default {
+  color: ['#3F70FF'],
   tooltip: {
     trigger: 'axis',
     axisPointer: { // 坐标轴指示器,坐标轴触发有效
@@ -6,30 +7,41 @@ export default {
     }
   },
   legend: {
-    data: ['男', '女']
   },
   grid: {
     left: '3%',
-    right: '4%',
-    bottom: '3%',
+    right: '5%',
+    bottom: '6%',
     containLabel: true
   },
-  xAxis: {
-    type: 'value'
-  },
   yAxis: {
-    type: 'category',
-    offset: 20,
+    type: 'value',
+    name: '人',
+    axisTick: {
+      show: false
+    },
+    splitLine: {
+      show: false
+    },
     data: []
   },
+  xAxis: {
+    type: 'category',
+    name: '岁',
+    axisTick: {
+      show: false
+    },
+    offset: 20
+  },
   series: [
     {
-      name: '总量',
+      name: '总',
       type: 'bar',
+      barWidth: 50,
       label: {
         normal: {
           show: true,
-          position: 'insideRight'
+          position: 'top'
         }
       },
       data: []

+ 42 - 2
src/pages/visitor/Statistic/areaOption.js

@@ -1,4 +1,45 @@
 export default {
+  color: [
+    '#335BFF',
+    '#FF5733',
+    '#33FF57',
+    '#FF33A1',
+    '#FFBD33',
+    '#33FFF5',
+    '#D833FF',
+    '#FF334F',
+    '#4A33FF',
+    '#9B33FF',
+    '#FF338C',
+    '#33FFF0',
+    '#FF8E33',
+    '#33FFCA',
+    '#FF3333',
+    '#33B2FF',
+    '#F7FF33',
+    '#FF33CE',
+    '#6BFF33',
+    '#FF33BE',
+    '#FF3361',
+    '#33AFFF',
+    '#FF9933',
+    '#33FFCC',
+    '#FF6633',
+    '#33FF99',
+    '#FF335A',
+    '#FF33FB',
+    '#33FFFF',
+    '#FF3347',
+    '#335AFF',
+    '#FF33A2',
+    '#FFCC33',
+    '#33FFAB',
+    '#FF3348',
+    '#33B3FF',
+    '#FF33AD',
+    '#FFDD33',
+    '#33FFAE'
+  ],
   tooltip: {
     trigger: 'item',
     formatter: '{a} <br/>{b} : {c} ({d}%)'
@@ -14,8 +55,7 @@ export default {
       type: 'pie',
       radius: '55%',
       center: ['50%', '60%'],
-      data: [
-      ],
+      data: [],
       itemStyle: {
         emphasis: {
           shadowBlur: 10,

+ 1 - 0
src/pages/visitor/Statistic/sexOption.js

@@ -1,4 +1,5 @@
 export default {
+  color: ['#3F70FF', '#FF0202'],
   tooltip: {
     trigger: 'item',
     formatter: '{a} <br/>{b} : {c} ({d}%)'

+ 9 - 9
src/pages/visitor/visitorStatistic.vue

@@ -63,23 +63,22 @@
     </el-form>
     <el-card>
       <el-tabs v-model="activeName">
+        <el-tab-pane
+          label="游客来源统计"
+          name="source">
+          <AreaStatics :table-data="statisticsInfo.provinceStatistics"></AreaStatics>
+        </el-tab-pane>
         <el-tab-pane
           label="游客年龄统计"
-          name="first">
+          name="age">
           <Age :table-data="statisticsInfo.ageStatistics"></Age>
         </el-tab-pane>
 
         <el-tab-pane
           label="游客性别统计"
-          name="second">
+          name="gender">
           <Sex :table-data="statisticsInfo.genderStatistics"></Sex>
         </el-tab-pane>
-
-        <el-tab-pane
-          label="游客来源统计"
-          name="third">
-          <AreaStatics :table-data="statisticsInfo.provinceStatistics"></AreaStatics>
-        </el-tab-pane>
       </el-tabs>
     </el-card>
   </div>
@@ -92,6 +91,7 @@ import AreaStatics from './Statistic/Area'
 import { getVisitorStatistics } from '@/api/visitor'
 
 export default {
+  name: 'visitorStatistic',
   components: {
     Age,
     Sex,
@@ -99,7 +99,7 @@ export default {
   },
   data () {
     return {
-      activeName: 'first',
+      activeName: 'source',
       form: {
         statisticsTimeBegin: '',
         statisticsTimeEnd: '',

+ 1 - 1
src/router/index.js

@@ -277,7 +277,7 @@ let routerMap = [
       {
         path: 'visitorStatistic',
         name: 'visitorStatistic',
-        component: () => require('@/pages/visitor/visitorStatistic').default,
+        component: require('@/pages/visitor/visitorStatistic').default,
         meta: { title: '游客画像', permissionName: 'statistics-center:customer-statistics' }
       },
       {