dujingxian 4 tahun lalu
induk
melakukan
e72431916f

+ 4 - 0
package.json

@@ -10,8 +10,10 @@
   "dependencies": {
     "axios": "^0.19.2",
     "core-js": "^3.6.4",
+    "echarts": "^5.0.0",
     "element-ui": "^2.13.1",
     "js-cookie": "^2.2.1",
+    "lib-flexible": "^0.3.2",
     "moment": "^2.27.0",
     "vue": "^2.6.11",
     "vue-router": "^3.1.6"
@@ -24,6 +26,8 @@
     "babel-eslint": "^10.1.0",
     "eslint": "^6.7.2",
     "eslint-plugin-vue": "^6.2.2",
+    "postcss-pxtorem": "^5.1.1",
+    "px2rem-loader": "^0.1.9",
     "vue-template-compiler": "^2.6.11"
   },
   "eslintConfig": {

+ 4 - 0
postcss.config.js

@@ -0,0 +1,4 @@
+module.exports = {
+  plugins: {
+  }
+}

+ 1 - 1
public/index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>

+ 4 - 0
src/api/index.js

@@ -338,6 +338,10 @@ export const OilCardRecharge = (params) => {
         timeout: 120000,
     })
 }
+// 首页
+export const getHomeData = () => {
+    return requestLoading(`${Prefix}act=merchant_info&op=home&client_type=ajax`, 'post')
+}
 // 余额列表
 // export const balanceList = (params) => {
 //     return requestLoading(`${Prefix}/balanceList`, 'get', params)

TEMPAT SAMPAH
src/assets/mobilePhone@2x.png


TEMPAT SAMPAH
src/assets/oilCard@2x.png


TEMPAT SAMPAH
src/assets/rechargeAmount@2x.png


TEMPAT SAMPAH
src/assets/todayOrder_01@2x.png


TEMPAT SAMPAH
src/assets/todayOrder_02@2x.png


TEMPAT SAMPAH
src/assets/todayOrder_03@2x.png


TEMPAT SAMPAH
src/assets/todayOrder_04@2x.png


TEMPAT SAMPAH
src/assets/userBalance@2x.png


+ 2 - 0
src/css/base.css

@@ -7,5 +7,7 @@
 
 html,body {
     height: 100%;
+    width: 100%;
+    overflow-x:hidden;
     font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
 }

+ 1 - 0
src/main.js

@@ -6,6 +6,7 @@ import App from './App.vue'
 import router from './router'
 import axios from 'axios'
 Vue.prototype.$axios = axios
+import 'lib-flexible'
 
 
 Vue.use(ElementUI);

+ 14 - 12
src/pages/index.vue

@@ -49,6 +49,10 @@
                     <i class="el-icon-user"></i>
                     <span slot="title">运营人员管理</span>
                 </el-menu-item> -->
+                <el-menu-item index="home" route="/">
+                    <i class="el-icon-house"></i>
+                    <span slot="title">首页</span>
+                </el-menu-item>
                 <el-menu-item index="order" route="order">
                     <i class="el-icon-edit-outline"></i>
                     <span slot="title">订单管理</span>
@@ -224,18 +228,16 @@ export default {
         },
     },
     // 监听器
-    // watch: {
-    //     '$route': {
-    //         handler(newVal, oldVal) {
-    //             console.log(newVal.path, oldVal.path);
-    //             if (newVal && newVal.path == '/') {
-    //                 this.curPath = ''
-    //             } else {
-    //                 this.curPath = this.$route.name
-    //             }
-    //         }
-    //     }
-    // }
+    watch: {
+        '$route': {
+            handler(newVal) {
+                // console.log(newVal.name, oldVal.path);
+                if (newVal) {
+                    this.curPath = newVal.name
+                }
+            }
+        }
+    }
 };
 </script>
 

+ 2 - 0
src/pages/subPages/balance.vue

@@ -1,4 +1,5 @@
 <template>
+<el-card>
 <el-container direction="vertical">
     <!-- <el-header height="40px" style="border-bottom: 1px solid #eee">余额充值</el-header> -->
     <div style="margin:20px 0;">
@@ -130,6 +131,7 @@
         </span>
     </el-dialog>
 </el-container>
+</el-card>
 </template>
 <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
 <script>

+ 385 - 30
src/pages/subPages/home.vue

@@ -1,50 +1,405 @@
 <template>
-  <el-card>
-    <el-form ref="form" :model="formData" label-width="120px">
-      <el-form-item label="商户号:">
-        {{formData.admin_id}}
-      </el-form-item>
-      <el-form-item label="账号姓名:">
-        {{formData.name}}
-      </el-form-item>
-    </el-form>
-    <el-form ref="member" :model="member" label-width="120px">
-      <el-form-item label="可用余额:">
-        {{member.available_predeposit}}
-      </el-form-item>
-    </el-form>
-  </el-card>
+  <div class="box">
+    <!-- <div class="header"> -->
+      <div class="head">
+        <div class="headLeft">
+          <div class="title">
+            您好,欢迎登陆椰子充值后台管理系统!
+          </div>
+          <div class="merchants">
+            <span>商户名称: {{merchantData.name}}</span>
+            <span>商户号: {{merchantData.mchid}}</span>
+          </div>
+        </div>
+        <div class="headCenter">
+          <img src="../../assets/userBalance@2x.png" alt="">
+          <div class="userBalance">
+            <span>用户余额</span>
+            <span style="color: #BB1A1A">{{merchantData.available_predeposit}}元</span>
+          </div>
+          <div>
+            <span class="recharge" @click="$router.push('/balance')">我要充值</span>
+          </div>
+        </div>
+        <div class="headCenter">
+          <img src="../../assets/rechargeAmount@2x.png" alt="">
+          <div class="userBalance">
+            <span>今日充值金额</span>
+            <span style="color: #333">{{todayOrder.amountCount}}元</span>
+          </div>
+        </div>
+      </div>
+      <div class="center">
+        <div class="centerLeft">
+          <div class="todayOrder">
+            <div>今日订单累计(个)</div>
+            <div class="count" >{{todayOrder.count}}</div>
+            <div class="orders">
+              <div class="orderIcon">
+                <img src="../../assets/todayOrder_01@2x.png" alt="">
+                <div>订单总数</div>
+                <div>{{todayOrder.count}}</div>
+              </div>
+              <div class="orderIcon">
+                <img src="../../assets/todayOrder_02@2x.png" alt="">
+                <div>成功订单数</div>
+                <div>{{todayOrder.successCount}}</div>
+              </div>
+              <div class="orderIcon">
+                <img src="../../assets/todayOrder_03@2x.png" alt="">
+                <div>失败订单数</div>
+                <div>{{todayOrder.errorCount}}</div>
+              </div>
+              <div class="orderIcon">
+                <img src="../../assets/todayOrder_04@2x.png" alt="">
+                <div>处理中订单数</div>
+                <div>{{todayOrder.otherCount}}</div>
+              </div>
+            </div>
+          </div>
+          <div class="rechargeType" >
+            <div class="rechargeCar" @click="$router.push('/oilCard')">
+              <img src="../../assets/oilCard@2x.png" alt="">
+              <div>
+                <p style="color: #333;">油卡充值</p>
+                <p style="color: #999999;">中石油、中石化</p>
+              </div>
+            </div>
+            <div class="rechargeCar" @click="$router.push('/mobileCard')" >
+              <img src="../../assets/mobilePhone@2x.png" alt="">
+              <div>
+                <p style="color: #333;">话费充值</p>
+                <p style="color: #999999;">中石油、中石化</p>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div id="main" class="centerRight"></div>
+      </div>
+    <!-- </div> -->
+  </div>
 </template>
 
 <script>
-import { getUserInfo } from '@/api'
+import { getHomeData } from '@/api'
+// 引入 ECharts 主模块
+var echarts = require('echarts/lib/echarts');
+// 引入柱状图
+require('echarts/lib/chart/bar');
+// 引入提示框和标题组件
+require('echarts/lib/component/tooltip');
+require('echarts/lib/component/title');
 export default {
-  name: 'home',
+  name: 'homeMain',
   data() {
     return {
-      // 表单数据
-      formData: {},
-      member: {}
-      // available_predeposit
+      // 商户信息
+      merchantData: {
+        name: '',
+        mchid: '',
+        available_predeposit: ''
+      },
+      // 今日订单
+      todayOrder: {
+        count: '',
+        errorCount: '',
+        otherCount: '',
+        successCount: '',
+        // 今日充值金额
+        amountCount: ''
+      },
+      // 一周订单总数
+      weekOrderCount: []
     }
   },
   created() {
-    this.getUserInfo()
+    this.getHomeData()
+  },
+  mounted() {
+    this.getEcharts()
   },
   methods: {
-    async getUserInfo() {
-      const res = await getUserInfo()
-      console.log('个人中心', res);
+    async getEcharts() {
+      // 基于准备好的dom,初始化echarts实例
+      var myChart = echarts.init(document.getElementById('main'));
+      // 绘制图表
+      var option = {
+          title: {
+              text: '近一周订单累计:'
+          },
+          color: ['#3398DB'],
+          tooltip: {
+              trigger: 'axis',
+              axisPointer: {            // 坐标轴指示器,坐标轴触发有效
+                  type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
+              }
+          },
+          grid: {
+              left: '3%',
+              right: '4%',
+              bottom: '3%',
+              containLabel: true
+          },
+          xAxis: [
+              {
+                  type: 'category',
+                  data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
+                  axisTick: {
+                      alignWithLabel: true
+                  }
+              }
+          ],
+          yAxis: [
+              {
+                type: 'value',
+                axisLine: {show:true},
+                axisTick: {show:true},
+                min: 0,
+                max: +200,
+              }
+          ],
+          series: [
+              {
+                  name: '订单累计',
+                  type: 'bar',
+                  barWidth: '60%',
+                  data: [10, 52, 30, 30, 39, 160, 190]
+                  // data: this.weekOrderCount || []
+              }
+          ]
+      }
+      // x轴时间
+      let dateArr = []
+      let myDate = new Date()
+      myDate.setDate(myDate.getDate() -6)
+      let dateTemp
+      let flag = 1
+      for (let i = 0; i <7; i++) {
+        dateTemp = myDate.getMonth()+1 + '月' + myDate.getDate()+ '日'
+        dateArr.push(dateTemp)
+        myDate.setDate(myDate.getDate() + flag)
+      }
+      console.log('dateArr', dateArr);
+      option.xAxis[0].data = dateArr
+      const res = await getHomeData()
+      console.log('首页', res);
       if (res && res.code == 200) {
-        this.formData = res.datas
-        this.member = res.datas.member
+        let weekOrderCount = res.datas.weeksStatistics
+        weekOrderCount.forEach(item => this.weekOrderCount.push(item.count))
+        option.series[0].data = this.weekOrderCount
+        myChart.setOption(option)
+        setTimeout(function (){
+          window.onresize = function () {
+            myChart.resize();
+          }
+        },50)
+      }
+    },
+    // 获取数据
+    async getHomeData() {
+      const res = await getHomeData()
+      console.log('首页', res);
+      if (res && res.code == 200) {
+        this.merchantData = res.datas.merchant_info
+        this.todayOrder = res.datas.todayStatistics
+        let weekOrderCount = res.datas.weeksStatistics
+        weekOrderCount.forEach(item => this.weekOrderCount.push(item.count))
+        console.log('weekOrderCount', weekOrderCount);
       }
-      // this.available_predeposit = res.datas.member.available_predeposit
     }
   }
 }
 </script>
-
+<style scoped>
+.box {
+  background-color: #F0F3F9;
+  box-sizing: border-box;
+  padding: 30px 0px;
+  padding-left: 60px;
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  overflow-y: hidden;
+  overflow-x: hidden;
+  margin: -20px;
+}
+.head {
+  /* display: flex;
+  justify-content: space-around; */
+  /* text-align: center; */
+  overflow: hidden;
+}
+.headLeft {
+  background: #FFFFFF;
+  border-radius: 10px 10px 10px 40px;
+  height: 236px;
+  width: 600px;
+  line-height: 118px;
+  text-align: center;
+  margin-right: 30px;
+  float: left;
+}
+.title {
+  font-size: 30px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #333333;
+}
+.merchants {
+  font-size: 20px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #3D638A;
+}
+.merchants span {
+  margin: 0 20px;
+}
+.headCenter {
+  margin-right: 30px;
+  background: #FFFFFF;
+  border-radius: 10px;
+  width: 455px;
+  height: 236px;
+  padding: 72px 0;
+  display: flex;
+  justify-content: space-around;
+  float: left;
+}
+.headCenter:last-child {
+  width: 370px;
+  margin-right: 0px;
+  border-radius: 10px 40px 40px 10px;
+}
+.headCenter img {
+  width: 92px;
+}
+.headCenter div {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 11px 0;
+}
+.headCenter .userBalance {
+  font-size: 20px;
+  font-family: Microsoft YaHei;
+  color: #333333;
+}
+.headCenter .userBalance span:last-child {
+  margin-top: 20px;
+}
+.recharge { 
+  font-size: 18px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #3D638A;
+  margin-top: 55px;
+}
+.center {
+  margin-top:20px;
+  height: 508px;
+}
+.centerLeft {
+  display: inline-block;
+  color: #333333;
+  font-size: 20px;
+  margin-right: 30px;
+  vertical-align: top;
+}
+.todayOrder {
+  width: 600px;
+  height: 340px; 
+  background: #FFFFFF;
+  border-radius: 40px 10px 10px 10px;
+  padding: 42px 59px;
+  text-align: center;
+}
+.orders {
+  overflow: hidden;
+  display: flex;
+  justify-content: space-around;
+}
+.count {
+  font-size:32px
+}
+.orderIcon {
+  /* float: left; */
+  /* margin: 44px 48px 0px 0; */
+  /* text-align: center; */
+  margin-top: 44px;
+}
+.orderIcon:last-child {
+  margin-right: 0;
+}
+.orderIcon img {
+  width: 58px;
+  height: 56px;
+  margin-bottom: 32px;
+}
+.orderIcon div {
+  font-size: 15px;
+}
+.orderIcon div:last-child {
+  font-size: 26px;
+}
+.rechargeType {
+  margin-top: 20px;
+  width: 600px;
+  height: 149px;
+}
+.rechargeCar {
+  display: inline-block;
+  background-color: #fff;
+  border-radius: 10px 10px 10px 30px;
+  width: 287px;
+  height: 100%;
+  margin-right: 26px;
+  box-sizing: border-box;
+  padding: 40px 0;
+  text-align: center;
+}
+.rechargeCar img {
+  display: inline-block;
+  width: 50px;
+  height: 60px;
+  margin-right: 28px;
+}
+.rechargeCar div {
+  display: inline-block;
+}
+.rechargeCar:last-child {
+  margin-right: 0px;
+}
+.rechargeCar p {
+  font-size: 20px;
+}
+.rechargeCar p:last-child {
+  font-size: 16px;
+}
+.centerRight {
+  width: 855px;
+  height: 508px;
+  box-sizing: border-box;
+  padding: 40px;
+  display: inline-block;
+  background: #FFFFFF;
+  border-radius: 10px 40px 40px 10px;
+}
+</style>
 <style>
-
+.el-main {
+  /* padding: 0; */
+}
+.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{
+  border-color: #ccc; 
+}
+.el-table--border::after, .el-table--group::after, .el-table::before{
+  background-color: #ccc;
+}
+.el-table td, .el-table th.is-leaf {
+  border-bottom: 1px solid #ccc;
+  border-right: 1px solid #ccc;
+}
+.el-table thead {
+  color: #606266;
+}
 </style>

+ 3 - 1
src/pages/subPages/message.vue

@@ -1,4 +1,5 @@
 <template>
+<el-card>
 <el-container direction="vertical">
     <div style="margin:10px 0;">
         <el-date-picker v-model="dataRange" :clearable="false" value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 10px"></el-date-picker>
@@ -47,6 +48,7 @@
         <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="onPageChange" :current-page="pageNumber"></el-pagination>
     </el-row>
 </el-container>
+</el-card>
 </template>
 
 <script>
@@ -200,4 +202,4 @@ export default {
 </script>
 
 <style scoped>
-</style>
+</style>

+ 2 - 2
src/pages/subPages/mobileCard.vue

@@ -71,7 +71,7 @@
           <el-table-column align="center" prop="amount" label="充值金额"></el-table-column>
           <el-table-column align="center" label="充值状态">
             <template slot-scope="scope">
-              <el-tag type="success" size="small" v-if="scope.row.state == true">成功</el-tag>
+              <el-tag type="success" size="small" v-if="scope.row.state == true">成功提交</el-tag>
               <el-tag type="danger" size="small" v-else>失败</el-tag>
             </template>
           </el-table-column>
@@ -311,8 +311,8 @@ export default {
         this.curMoney = ''
         this.curBtn = ''
         this.formData.code = ''
-        this.loading = false
       }
+      this.loading = false
     },
   }
 }

+ 3 - 3
src/pages/subPages/oilCard.vue

@@ -62,7 +62,7 @@
           <el-table-column align="center" prop="amount" label="充值金额"></el-table-column>
           <el-table-column align="center" label="充值状态">
             <template slot-scope="scope">
-              <el-tag type="success" size="small" v-if="scope.row.state == true">成功</el-tag>
+              <el-tag type="success" size="small" v-if="scope.row.state == true">成功提交</el-tag>
               <el-tag type="danger" size="small" v-else>失败</el-tag>
             </template>
           </el-table-column>
@@ -320,8 +320,8 @@ export default {
         this.curMoney = ''
         this.curBtn = ''
         this.formData.code = ''
-        this.loading = false
       }
+      this.loading = false
     },
     // 分页
     async onPageChange(page) {
@@ -357,4 +357,4 @@ export default {
 .cardType  span {
   vertical-align: middle;
 }
-</style>>
+</style>

+ 3 - 17
src/pages/subPages/order.vue

@@ -1,4 +1,5 @@
 <template>
+<el-card>
 <el-container direction="vertical">
     <el-header height="40px">
         <el-date-picker
@@ -50,7 +51,7 @@
         <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" :current-page="pageNumber" @current-change="onPageChange"></el-pagination>
     </el-row>
 </el-container>
-
+</el-card>
 <!-- 状态查询弹层 -->
 </template>
 
@@ -202,19 +203,4 @@ export default {
 .el-header {
     padding: 0;
 }
-</style>
-<style>
-.el-table td, .el-table th.is-leaf,.el-table--border, .el-table--group{
-  border-color: #ccc; 
-}
-.el-table--border::after, .el-table--group::after, .el-table::before{
-  background-color: #ccc;
-}
-.el-table td, .el-table th.is-leaf {
-  border-bottom: 1px solid #ccc;
-  border-right: 1px solid #ccc;
-}
-.el-table thead {
-  color: #606266;
-}
-</style>
+</style>

+ 43 - 29
src/pages/subPages/view.vue

@@ -1,4 +1,5 @@
 <template>
+<el-card>
 <el-container direction="vertical">
     <!-- <div style="margin-bottom:10px">
         <el-button type="primary" plain @click="add" size="small">添加ip</el-button>
@@ -13,8 +14,8 @@
             </template>
         </el-table-column>
     </el-table> -->
-    <el-form label-width="120px" :model="formKey" :rules="ruleKey">
-        <el-form-item label="商户号:">
+    <el-form label-width="120px" :model="formKey" :rules="ruleKey" ref="keyForm">
+        <!-- <el-form-item label="商户号:">
             {{merchantsCode}}
         </el-form-item>
         <el-form-item label="商户名称:">
@@ -22,19 +23,20 @@
         </el-form-item>
         <el-form-item label="当前余额:">
             {{available_predeposit}}
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="余额预警:">
             {{alarm_amount}}
         </el-form-item>
-        <el-form-item label="密钥设置:" :prop="useKey == '1' ? 'ReSecurityKey' : 'securityKey'">
-            <el-input show-password v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
-            <el-input show-password v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+        <!-- show-password  -->
+        <el-form-item label="密钥设置:" :prop="useKey == '1' ? 'ReSecurityKey' : 'securityKey'" class="keySet">
+            <el-input v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+            <el-input v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
             <el-button type="primary" size="small" @click="updateKey">{{useKey == '1' ? '重设' : '设置'}}</el-button>
             <el-alert
-                title="请输入数字,字母或者两者结合的字符作为密钥。用于接口对接时生成签名"
+                title="请输入32位字符串,用于接口生成签名"
                 type="info"
                 show-icon
-                style="width:880px;margin-top:5px"
+                style="width:880px;display:inline"
                 :closable="false">
             </el-alert>
         </el-form-item>
@@ -69,6 +71,7 @@
         </span>
     </el-dialog>
 </el-container>
+</el-card>
 </template>
 
 <script>
@@ -122,11 +125,11 @@ export default {
             ruleKey: {
                 securityKey: [
                     { required: true, message: '请输入密钥', trigger: 'blur' },
-                    { pattern: /^[A-Za-z0-9]{1,30}$/, message:'请输入合法密钥,字母或者数字或者两者结合,字数在30个以内', trigger: 'blur' }
+                    { min: 1, max: 32, message:'请输入32位的字符串', trigger: 'blur' }
                 ],
                 // 之前设置过密钥
                 ReSecurityKey: [
-                    { pattern: /^[A-Za-z0-9]{1,30}$/, message:'请输入合法密钥,字母或者数字或者两个结合,字数在30个以内', trigger: 'blur' }
+                    { min: 1, max: 32, message:'请输入32位的字符串', trigger: 'blur' }
                 ]
             },
             // 是否设置过密钥 1-设置过
@@ -237,24 +240,28 @@ export default {
         },
         // 设置密钥
         async updateKey() {
-            let res 
-            if (this.useKey == '1') {
-                let param = new URLSearchParams()
-                param.append('secure_key', this.formKey.ReSecurityKey)
-                // res = await updateKey(this.formKey.ReSecurityKey)
-                res = await updateKey(param)
-            } else {
-                let param = new URLSearchParams()
-                param.append('secure_key', this.formKey.securityKey)
-                // res = await updateKey(this.formKey.securityKey)
-                res = await updateKey(param)
-            }
-            console.log('密钥', res);
-            if (res && res.code == 200) {
-                this.$message.success('设置密钥成功')
-            }
-            this.formKey.ReSecurityKey = ''
-            this.formKey.securityKey = ''
+            let res
+            this.$refs.keyForm.validate(async(valid) => {
+                if (valid) {
+                    if (this.useKey == '1') {
+                        let param = new URLSearchParams()
+                        param.append('secure_key', this.formKey.ReSecurityKey)
+                        // res = await updateKey(this.formKey.ReSecurityKey)
+                        res = await updateKey(param)
+                    } else {
+                        let param = new URLSearchParams()
+                        param.append('secure_key', this.formKey.securityKey)
+                        // res = await updateKey(this.formKey.securityKey)
+                        res = await updateKey(param)
+                    }
+                    console.log('密钥', res);
+                    if (res && res.code == 200) {
+                        this.$message.success('设置密钥成功')
+                    }
+                    this.formKey.ReSecurityKey = ''
+                    this.formKey.securityKey = ''
+                }
+            })
         }
         // 新增
         // addIp() {}
@@ -321,4 +328,11 @@ export default {
 .el-alert {
     padding: 0px 10px;
 }
-</style>
+.keySet {
+    /* border-bottom: 1px solid #DCDFE6; */
+    /* padding-bottom: 10px; */
+}
+.keySet .el-button {
+    margin-right: 10px;
+}
+</style>

+ 7 - 7
src/router/index.js

@@ -5,7 +5,7 @@ import { getUser } from '@/utils/auth'
 const Index = () => import('@/pages/index');
 const Login = () => import('@/pages/login');
 // 首页
-// const Home = () => import('@/pages/subPages/home');
+const Home = () => import('@/pages/subPages/home');
 const order = () => import('@/pages/subPages/order');
 // 柜体控制
 // const Express = () => import('@/pages/subPages/express');
@@ -28,14 +28,14 @@ Vue.use(VueRouter)
     name: 'Index',
     component: Index,
     // redirect:'/login',
-    redirect:'/order',
+    // redirect:'/order',
     children:[
       // 主页
-      // {
-      //   path: '',
-      //   name: 'home',
-      //   component: Home
-      // },
+      {
+        path: '',
+        name: 'home',
+        component: Home
+      },
       // 订单统计
       {
         path:'/order',

+ 13 - 0
vue.config.js

@@ -41,4 +41,17 @@ module.exports = {
             }
         }
     },
+    chainWebpack: config => {
+      config.module
+        .rule("css")
+        .test(/\.css$/)
+        .oneOf("vue")
+        .resourceQuery(/\?vue/)
+        .use("px2rem")
+        .loader("px2rem-loader")
+        .options({
+        //   remUnit: 192
+          remUnit: 210
+        });
+    }
 }